Passed
Pull Request — master (#261)
by Viruthagiri
09:40
created
geodirectory-templates/listing-listview.php 1 patch
Indentation   +276 added lines, -276 removed lines patch added patch discarded remove patch
@@ -44,57 +44,57 @@  discard block
 block discarded – undo
44 44
 
45 45
         <?php if (have_posts()) :
46 46
 
47
-            /**
48
-             * Called inside the `ul` of the listings template, but before any `li` elements.
49
-             *
50
-             * When used by the widget view template then it will only show if there are listings to be shown.
51
-             *
52
-             * @since 1.0.0
53
-             * @see 'geodir_after_listing_post_listview'
54
-             */
55
-            do_action('geodir_before_listing_post_listview');
56
-
57
-            while (have_posts()) : the_post();
58
-                global $post, $wpdb, $preview;
59
-
60
-                /**
61
-                 * Add a class to the `li` element of the listings list template.
62
-                 *
63
-                 * @since 1.0.0
64
-                 * @param string $class The extra class for the `li` element, default empty.
65
-                 */
66
-                $post_view_class = apply_filters('geodir_post_view_extra_class', '');
67
-
68
-                /**
69
-                 * Add a class to the `article` tag inside the `li` element on the listings list template.
70
-                 *
71
-                 * @since 1.0.0
72
-                 * @param string $class The extra class for the `article` element, default empty.
73
-                 */
74
-                $post_view_article_class = apply_filters('geodir_post_view_article_extra_class', '');
75
-                ?>
47
+			/**
48
+			 * Called inside the `ul` of the listings template, but before any `li` elements.
49
+			 *
50
+			 * When used by the widget view template then it will only show if there are listings to be shown.
51
+			 *
52
+			 * @since 1.0.0
53
+			 * @see 'geodir_after_listing_post_listview'
54
+			 */
55
+			do_action('geodir_before_listing_post_listview');
56
+
57
+			while (have_posts()) : the_post();
58
+				global $post, $wpdb, $preview;
59
+
60
+				/**
61
+				 * Add a class to the `li` element of the listings list template.
62
+				 *
63
+				 * @since 1.0.0
64
+				 * @param string $class The extra class for the `li` element, default empty.
65
+				 */
66
+				$post_view_class = apply_filters('geodir_post_view_extra_class', '');
67
+
68
+				/**
69
+				 * Add a class to the `article` tag inside the `li` element on the listings list template.
70
+				 *
71
+				 * @since 1.0.0
72
+				 * @param string $class The extra class for the `article` element, default empty.
73
+				 */
74
+				$post_view_article_class = apply_filters('geodir_post_view_article_extra_class', '');
75
+				?>
76 76
 
77 77
                 <li class="clearfix <?php if ($grid_view_class) {
78
-                    echo 'geodir-gridview ' . $grid_view_class;
79
-                } else {
80
-                    echo ' geodir-listview ';
81
-                } ?> <?php if ($post_view_class) {
82
-                    echo $post_view_class;
83
-                } ?>" <?php if (isset($listing_width) && $listing_width) echo "style='width:{$listing_width}%;'"; // Width for widget listing
84
-
85
-                echo " data-post-id='$post->ID' ";
86
-                /**
87
-                 * Called inside the `<li>` tag for listing outputs.
88
-                 *
89
-                 * @since 1.5.9
90
-                 * @param object $post The post object.
91
-                 * @param string $string If called on the listing or widget template.
92
-                 */
93
-                do_action('geodir_listview_inside_li', $post, 'listing');
94
-                ?> >
78
+					echo 'geodir-gridview ' . $grid_view_class;
79
+				} else {
80
+					echo ' geodir-listview ';
81
+				} ?> <?php if ($post_view_class) {
82
+					echo $post_view_class;
83
+				} ?>" <?php if (isset($listing_width) && $listing_width) echo "style='width:{$listing_width}%;'"; // Width for widget listing
84
+
85
+				echo " data-post-id='$post->ID' ";
86
+				/**
87
+				 * Called inside the `<li>` tag for listing outputs.
88
+				 *
89
+				 * @since 1.5.9
90
+				 * @param object $post The post object.
91
+				 * @param string $string If called on the listing or widget template.
92
+				 */
93
+				do_action('geodir_listview_inside_li', $post, 'listing');
94
+				?> >
95 95
                     <article class="geodir-category-listing <?php if ($post_view_article_class) {
96
-                        echo $post_view_article_class;
97
-                    } ?>">
96
+						echo $post_view_article_class;
97
+					} ?>">
98 98
                         <div class="geodir-post-img <?php echo apply_filters('geodir_listing_listview_thumb_extra_class', '', 'listing'); ?>">
99 99
                             <?php if ($fimage = geodir_show_featured_image($post->ID, 'list-thumb', true, false, $post->featured_image)) { ?>
100 100
 
@@ -102,37 +102,37 @@  discard block
 block discarded – undo
102 102
                                     <?php echo $fimage; ?>
103 103
                                 </a>
104 104
                                 <?php
105
-                                /**
106
-                                 * Called before badges are output.
107
-                                 *
108
-                                 * Called on the listings template after the image has been output and before the badges like `new` or `featured` are output.
109
-                                 *
110
-                                 * @since 1.0.0
111
-                                 * @param object $post The post object.
112
-                                 * @see 'geodir_after_badge_on_image'
113
-                                 */
114
-                                do_action('geodir_before_badge_on_image', $post);
115
-                                if (isset($post->is_featured) && $post->is_featured) {
116
-                                    echo geodir_show_badges_on_image('featured', $post, get_permalink());
117
-                                }
118
-
119
-                                $geodir_days_new = (int)get_option('geodir_listing_new_days');
120
-
121
-                                if (round(abs(strtotime($post->post_date) - strtotime(date('Y-m-d'))) / 86400) < $geodir_days_new) {
122
-                                    echo geodir_show_badges_on_image('new', $post, get_permalink());
123
-                                }
124
-
125
-                                /**
126
-                                 * Called after badges are output.
127
-                                 *
128
-                                 * Called on the listings template after the image and badges like `new` or `featured` have been output.
129
-                                 *
130
-                                 * @since 1.0.0
131
-                                 * @param object $post The post object.
132
-                                 * @see 'geodir_before_badge_on_image'
133
-                                 */
134
-                                do_action('geodir_after_badge_on_image', $post);
135
-                                ?>
105
+								/**
106
+								 * Called before badges are output.
107
+								 *
108
+								 * Called on the listings template after the image has been output and before the badges like `new` or `featured` are output.
109
+								 *
110
+								 * @since 1.0.0
111
+								 * @param object $post The post object.
112
+								 * @see 'geodir_after_badge_on_image'
113
+								 */
114
+								do_action('geodir_before_badge_on_image', $post);
115
+								if (isset($post->is_featured) && $post->is_featured) {
116
+									echo geodir_show_badges_on_image('featured', $post, get_permalink());
117
+								}
118
+
119
+								$geodir_days_new = (int)get_option('geodir_listing_new_days');
120
+
121
+								if (round(abs(strtotime($post->post_date) - strtotime(date('Y-m-d'))) / 86400) < $geodir_days_new) {
122
+									echo geodir_show_badges_on_image('new', $post, get_permalink());
123
+								}
124
+
125
+								/**
126
+								 * Called after badges are output.
127
+								 *
128
+								 * Called on the listings template after the image and badges like `new` or `featured` have been output.
129
+								 *
130
+								 * @since 1.0.0
131
+								 * @param object $post The post object.
132
+								 * @see 'geodir_before_badge_on_image'
133
+								 */
134
+								do_action('geodir_after_badge_on_image', $post);
135
+								?>
136 136
 
137 137
 
138 138
                             <?php } ?>
@@ -142,15 +142,15 @@  discard block
 block discarded – undo
142 142
                         <div class="geodir-content <?php echo apply_filters('geodir_listing_listview_content_extra_class', '', 'listing'); ?>">
143 143
 
144 144
                             <?php
145
-                            /**
146
-                             * Called before the post title on the listings view template.
147
-                             *
148
-                             * @since 1.0.0
149
-                             * @param string $type The template type, default 'listview'.
150
-                             * @param object $post The post object.
151
-                             * @see 'geodir_after_listing_post_title'
152
-                             */
153
-                            do_action('geodir_before_listing_post_title', 'listview', $post); ?>
145
+							/**
146
+							 * Called before the post title on the listings view template.
147
+							 *
148
+							 * @since 1.0.0
149
+							 * @param string $type The template type, default 'listview'.
150
+							 * @param object $post The post object.
151
+							 * @see 'geodir_after_listing_post_title'
152
+							 */
153
+							do_action('geodir_before_listing_post_title', 'listview', $post); ?>
154 154
 
155 155
                             <header class="geodir-entry-header"><h3 class="geodir-entry-title">
156 156
                                     <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
@@ -162,226 +162,226 @@  discard block
 block discarded – undo
162 162
                             <!-- .entry-header -->
163 163
 
164 164
                             <?php
165
-                            /**
166
-                             * Called after the post title on the listings view template.
167
-                             *
168
-                             * @since 1.0.0
169
-                             * @param string $type The template type, default 'listview'.
170
-                             * @param object $post The post object.
171
-                             * @see 'geodir_before_listing_post_title'
172
-                             */
173
-                            do_action('geodir_after_listing_post_title', 'listview', $post); ?>
165
+							/**
166
+							 * Called after the post title on the listings view template.
167
+							 *
168
+							 * @since 1.0.0
169
+							 * @param string $type The template type, default 'listview'.
170
+							 * @param object $post The post object.
171
+							 * @see 'geodir_before_listing_post_title'
172
+							 */
173
+							do_action('geodir_after_listing_post_title', 'listview', $post); ?>
174 174
 
175 175
                             <?php /// Print Distance
176
-                            if ((isset($_REQUEST['sgeo_lat']) && $_REQUEST['sgeo_lat'] != '') || $related_nearest) {
177
-
178
-                                if ($related_nearest) {
179
-                                    $startPoint = array('latitude' => $related_parent_lat, 'longitude' => $related_parent_lon);
180
-                                } else {
181
-                                    $startPoint = array('latitude' => $_REQUEST['sgeo_lat'], 'longitude' => $_REQUEST['sgeo_lon']);
182
-                                }
183
-
184
-                                $endLat = $post->post_latitude;
185
-                                $endLon = $post->post_longitude;
186
-                                $endPoint = array('latitude' => $endLat, 'longitude' => $endLon);
187
-                                $uom = get_option('geodir_search_dist_1');
188
-                                $distance = geodir_calculateDistanceFromLatLong($startPoint, $endPoint, $uom); ?>
176
+							if ((isset($_REQUEST['sgeo_lat']) && $_REQUEST['sgeo_lat'] != '') || $related_nearest) {
177
+
178
+								if ($related_nearest) {
179
+									$startPoint = array('latitude' => $related_parent_lat, 'longitude' => $related_parent_lon);
180
+								} else {
181
+									$startPoint = array('latitude' => $_REQUEST['sgeo_lat'], 'longitude' => $_REQUEST['sgeo_lon']);
182
+								}
183
+
184
+								$endLat = $post->post_latitude;
185
+								$endLon = $post->post_longitude;
186
+								$endPoint = array('latitude' => $endLat, 'longitude' => $endLon);
187
+								$uom = get_option('geodir_search_dist_1');
188
+								$distance = geodir_calculateDistanceFromLatLong($startPoint, $endPoint, $uom); ?>
189 189
                                 <h3>
190 190
                                     <?php
191 191
 
192
-                                    if (round($distance, 2) == 0) {
193
-                                        $uom = get_option('geodir_search_dist_2');
194
-
195
-                                        $distance = geodir_calculateDistanceFromLatLong($startPoint, $endPoint, $uom);
196
-                                        if ($uom == 'feet') {
197
-                                            $uom = __('feet', 'geodirectory');
198
-                                        } else {
199
-                                            $uom = __('meters', 'geodirectory');
200
-                                        }
201
-                                        echo round($distance) . ' ' . $uom . '<br />';
202
-                                    } else {
203
-                                        if ($uom == 'miles') {
204
-                                            $uom = __('miles', 'geodirectory');
205
-                                        } else {
206
-                                            $uom = __('km', 'geodirectory');
207
-                                        }
208
-                                        echo round($distance, 2) . ' ' . $uom . '<br />';
209
-                                    }
210
-                                    ?>
192
+									if (round($distance, 2) == 0) {
193
+										$uom = get_option('geodir_search_dist_2');
194
+
195
+										$distance = geodir_calculateDistanceFromLatLong($startPoint, $endPoint, $uom);
196
+										if ($uom == 'feet') {
197
+											$uom = __('feet', 'geodirectory');
198
+										} else {
199
+											$uom = __('meters', 'geodirectory');
200
+										}
201
+										echo round($distance) . ' ' . $uom . '<br />';
202
+									} else {
203
+										if ($uom == 'miles') {
204
+											$uom = __('miles', 'geodirectory');
205
+										} else {
206
+											$uom = __('km', 'geodirectory');
207
+										}
208
+										echo round($distance, 2) . ' ' . $uom . '<br />';
209
+									}
210
+									?>
211 211
                                 </h3>
212 212
                             <?php } ?>
213 213
 
214 214
 
215 215
                             <?php
216
-                            /**
217
-                             * Called before the post excerpt on the listings view template.
218
-                             *
219
-                             * @since 1.0.0
220
-                             * @param object $post The post object.
221
-                             * @see 'geodir_after_listing_post_excerpt'
222
-                             */
223
-                            do_action('geodir_before_listing_post_excerpt', $post); ?>
216
+							/**
217
+							 * Called before the post excerpt on the listings view template.
218
+							 *
219
+							 * @since 1.0.0
220
+							 * @param object $post The post object.
221
+							 * @see 'geodir_after_listing_post_excerpt'
222
+							 */
223
+							do_action('geodir_before_listing_post_excerpt', $post); ?>
224 224
                             <?php echo geodir_show_listing_info('listing'); ?>
225 225
                             <div class="geodir-entry-content">
226 226
 
227 227
                                 <?php
228
-                                /**
229
-                                 * Filter to hide the listing excerpt
230
-                                 *
231
-                                 * @since 1.5.3
232
-                                 * @param bool $display Display the excerpt or not. Default true.
233
-                                 * @param string $view The view type, default 'listview'.
234
-                                 * @param object $post The post object.
235
-                                 */
236
-                                $show_listing_excerpt = apply_filters('geodir_show_listing_post_excerpt', true, 'listview', $post);
237
-                                if ($show_listing_excerpt) {
238
-                                    if ( isset( $character_count ) && ( $character_count || $character_count == '0' ) ) {
239
-                                        $content_out = geodir_max_excerpt( $character_count );
240
-                                    } else {
241
-                                        $content_out = get_the_excerpt();
242
-                                    }
243
-                                    if ( ! empty( $content_out ) ) {
244
-                                        echo "<p>" . $content_out . "</p>";
245
-                                    }
246
-                                }
247
-                                ?></div>
228
+								/**
229
+								 * Filter to hide the listing excerpt
230
+								 *
231
+								 * @since 1.5.3
232
+								 * @param bool $display Display the excerpt or not. Default true.
233
+								 * @param string $view The view type, default 'listview'.
234
+								 * @param object $post The post object.
235
+								 */
236
+								$show_listing_excerpt = apply_filters('geodir_show_listing_post_excerpt', true, 'listview', $post);
237
+								if ($show_listing_excerpt) {
238
+									if ( isset( $character_count ) && ( $character_count || $character_count == '0' ) ) {
239
+										$content_out = geodir_max_excerpt( $character_count );
240
+									} else {
241
+										$content_out = get_the_excerpt();
242
+									}
243
+									if ( ! empty( $content_out ) ) {
244
+										echo "<p>" . $content_out . "</p>";
245
+									}
246
+								}
247
+								?></div>
248 248
 
249 249
                             <?php
250
-                            /**
251
-                             * Called after the post excerpt on the listings view template.
252
-                             *
253
-                             * @since 1.0.0
254
-                             * @param object $post The post object.
255
-                             * @see 'geodir_before_listing_post_excerpt'
256
-                             */
257
-                            do_action('geodir_after_listing_post_excerpt', $post); ?>
250
+							/**
251
+							 * Called after the post excerpt on the listings view template.
252
+							 *
253
+							 * @since 1.0.0
254
+							 * @param object $post The post object.
255
+							 * @see 'geodir_before_listing_post_excerpt'
256
+							 */
257
+							do_action('geodir_after_listing_post_excerpt', $post); ?>
258 258
                         </div>
259 259
                         <!-- gd-content ends here-->
260 260
                         <?php
261
-                        /**
262
-                         * Called after printing listing content.
263
-                         *
264
-                         * @since 1.5.3
265
-                         * @param object $post The post object.
266
-                         * @param string $view The view type, default 'listing'.
267
-                         */
268
-                        do_action( 'geodir_after_listing_content', $post, 'listing' ); ?>
261
+						/**
262
+						 * Called after printing listing content.
263
+						 *
264
+						 * @since 1.5.3
265
+						 * @param object $post The post object.
266
+						 * @param string $view The view type, default 'listing'.
267
+						 */
268
+						do_action( 'geodir_after_listing_content', $post, 'listing' ); ?>
269 269
                         <footer class="geodir-entry-meta <?php echo apply_filters('geodir_listing_listview_meta_extra_class', '', 'listing'); ?>">
270 270
                             <div class="geodir-addinfo clearfix <?php echo apply_filters('geodir_listing_listview_addinfo_extra_class', '', 'listing'); ?>">
271 271
 
272 272
                                 <?php
273
-                                /**
274
-                                 * Called before printing review stars html.
275
-                                 *
276
-                                 * @since 1.5.3
277
-                                 * @param object $post The post object.
278
-                                 * @param string $view The view type, default 'listing'.
279
-                                 */
280
-                                do_action( 'geodir_before_review_html', $post, 'listing' );
281
-
282
-                                $review_show = geodir_is_reviews_show('listview');
283
-
284
-                                if ($review_show) {
285
-
286
-                                    if (!$preview) {
287
-                                        $post_avgratings = geodir_get_post_rating($post->ID);
288
-                                        /**
289
-                                         * Called before the rating stars are output on the listings view template.
290
-                                         *
291
-                                         * @since 1.0.0
292
-                                         * @param float $post_avgratings The average rating for the post.
293
-                                         * @param int $post->ID The post ID.
294
-                                         * @see 'geodir_after_review_rating_stars_on_listview'
295
-                                         */
296
-                                        do_action('geodir_before_review_rating_stars_on_listview', $post_avgratings, $post->ID);
297
-
298
-                                        echo geodir_get_rating_stars($post_avgratings, $post->ID);
299
-
300
-                                        /**
301
-                                         * Called after the rating stars are output on the listings view template.
302
-                                         *
303
-                                         * @since 1.0.0
304
-                                         * @param float $post_avgratings The average rating for the post.
305
-                                         * @param int $post->ID The post ID.
306
-                                         * @see 'geodir_before_review_rating_stars_on_listview'
307
-                                         */
308
-                                        do_action('geodir_after_review_rating_stars_on_listview', $post_avgratings, $post->ID);
309
-                                    }
310
-                                    ?>
273
+								/**
274
+								 * Called before printing review stars html.
275
+								 *
276
+								 * @since 1.5.3
277
+								 * @param object $post The post object.
278
+								 * @param string $view The view type, default 'listing'.
279
+								 */
280
+								do_action( 'geodir_before_review_html', $post, 'listing' );
281
+
282
+								$review_show = geodir_is_reviews_show('listview');
283
+
284
+								if ($review_show) {
285
+
286
+									if (!$preview) {
287
+										$post_avgratings = geodir_get_post_rating($post->ID);
288
+										/**
289
+										 * Called before the rating stars are output on the listings view template.
290
+										 *
291
+										 * @since 1.0.0
292
+										 * @param float $post_avgratings The average rating for the post.
293
+										 * @param int $post->ID The post ID.
294
+										 * @see 'geodir_after_review_rating_stars_on_listview'
295
+										 */
296
+										do_action('geodir_before_review_rating_stars_on_listview', $post_avgratings, $post->ID);
297
+
298
+										echo geodir_get_rating_stars($post_avgratings, $post->ID);
299
+
300
+										/**
301
+										 * Called after the rating stars are output on the listings view template.
302
+										 *
303
+										 * @since 1.0.0
304
+										 * @param float $post_avgratings The average rating for the post.
305
+										 * @param int $post->ID The post ID.
306
+										 * @see 'geodir_before_review_rating_stars_on_listview'
307
+										 */
308
+										do_action('geodir_after_review_rating_stars_on_listview', $post_avgratings, $post->ID);
309
+									}
310
+									?>
311 311
                                     <a href="<?php comments_link(); ?>" class="geodir-pcomments"><i
312 312
                                             class="fa fa-comments"></i>
313 313
                                         <?php geodir_comments_number($post->rating_count); ?></a>
314 314
                                 <?php
315
-                                }
315
+								}
316 316
 
317 317
 
318
-                                /**
319
-                                 * Called after printing favorite html.
320
-                                 *
321
-                                 * @since 1.0.0
322
-                                 */
323
-                                do_action( 'geodir_after_favorite_html', $post->ID, 'listing' );
318
+								/**
319
+								 * Called after printing favorite html.
320
+								 *
321
+								 * @since 1.0.0
322
+								 */
323
+								do_action( 'geodir_after_favorite_html', $post->ID, 'listing' );
324 324
 
325 325
 
326
-                                /**
327
-                                 * Called after printing map pin point.
328
-                                 *
329
-                                 * @since 1.0.0
330
-                                 * @since 1.5.9 Added $post as second param.
331
-                                 * @param int $post->ID The post id.
332
-                                 * @param object $post The post object.
333
-                                 */
334
-                                do_action( 'geodir_listing_after_pinpoint', $post->ID ,$post);
326
+								/**
327
+								 * Called after printing map pin point.
328
+								 *
329
+								 * @since 1.0.0
330
+								 * @since 1.5.9 Added $post as second param.
331
+								 * @param int $post->ID The post id.
332
+								 * @param object $post The post object.
333
+								 */
334
+								do_action( 'geodir_listing_after_pinpoint', $post->ID ,$post);
335 335
 
336
-                                if ($post->post_author == get_current_user_id()) { ?>
336
+								if ($post->post_author == get_current_user_id()) { ?>
337 337
                                     <?php
338
-                                    $addplacelink = get_permalink(geodir_add_listing_page_id());
339
-                                    $editlink = geodir_getlink($addplacelink, array('pid' => $post->ID), false);
340
-                                    $upgradelink = geodir_getlink($editlink, array('upgrade' => '1'), false);
338
+									$addplacelink = get_permalink(geodir_add_listing_page_id());
339
+									$editlink = geodir_getlink($addplacelink, array('pid' => $post->ID), false);
340
+									$upgradelink = geodir_getlink($editlink, array('upgrade' => '1'), false);
341 341
 
342
-                                    $ajaxlink = geodir_get_ajax_url();
343
-                                    $deletelink = geodir_getlink($ajaxlink, array('geodir_ajax' => 'add_listing', 'ajax_action' => 'delete', 'pid' => $post->ID), false);
342
+									$ajaxlink = geodir_get_ajax_url();
343
+									$deletelink = geodir_getlink($ajaxlink, array('geodir_ajax' => 'add_listing', 'ajax_action' => 'delete', 'pid' => $post->ID), false);
344 344
 
345
-                                    ?>
345
+									?>
346 346
 
347 347
                                     <span class="geodir-authorlink clearfix">
348 348
 											
349 349
 											<?php if (isset($_REQUEST['geodir_dashbord']) && $_REQUEST['geodir_dashbord']) {
350
-                                                /**
351
-                                                 * Called before the edit post link on the listings view template used on the author page.
352
-                                                 *
353
-                                                 * @since 1.0.0
354
-                                                 * @see 'geodir_after_edit_post_link_on_listing'
355
-                                                 */
356
-                                                do_action('geodir_before_edit_post_link_on_listing');
357
-                                                ?>
350
+												/**
351
+												 * Called before the edit post link on the listings view template used on the author page.
352
+												 *
353
+												 * @since 1.0.0
354
+												 * @see 'geodir_after_edit_post_link_on_listing'
355
+												 */
356
+												do_action('geodir_before_edit_post_link_on_listing');
357
+												?>
358 358
 
359 359
                                                 <a href="<?php echo esc_url($editlink); ?>" class="geodir-edit"
360 360
                                                    title="<?php _e('Edit Listing', 'geodirectory'); ?>">
361 361
                                                     <?php
362
-                                                    $geodir_listing_edit_icon = apply_filters('geodir_listing_edit_icon', 'fa fa-edit');
363
-                                                    echo '<i class="'. $geodir_listing_edit_icon .'"></i>';
364
-                                                    ?>
362
+													$geodir_listing_edit_icon = apply_filters('geodir_listing_edit_icon', 'fa fa-edit');
363
+													echo '<i class="'. $geodir_listing_edit_icon .'"></i>';
364
+													?>
365 365
                                                     <?php _e('Edit', 'geodirectory'); ?>
366 366
                                                 </a>
367 367
                                                 <a href="<?php echo esc_url($deletelink); ?>" class="geodir-delete"
368 368
                                                    title="<?php _e('Delete Listing', 'geodirectory'); ?>">
369 369
                                                     <?php
370
-                                                    $geodir_listing_delete_icon = apply_filters('geodir_listing_delete_icon', 'fa fa-close');
371
-                                                    echo '<i class="'. $geodir_listing_delete_icon .'"></i>';
372
-                                                    ?>
370
+													$geodir_listing_delete_icon = apply_filters('geodir_listing_delete_icon', 'fa fa-close');
371
+													echo '<i class="'. $geodir_listing_delete_icon .'"></i>';
372
+													?>
373 373
                                                     <?php _e('Delete', 'geodirectory'); ?>
374 374
                                                 </a>
375 375
                                                 <?php
376 376
 
377
-                                                /**
378
-                                                 * Called after the edit post link on the listings view template used on the author page.
379
-                                                 *
380
-                                                 * @since 1.0.0
381
-                                                 * @see 'geodir_before_edit_post_link_on_listing'
382
-                                                 */
383
-                                                do_action('geodir_after_edit_post_link_on_listing');
384
-                                            } ?>
377
+												/**
378
+												 * Called after the edit post link on the listings view template used on the author page.
379
+												 *
380
+												 * @since 1.0.0
381
+												 * @see 'geodir_before_edit_post_link_on_listing'
382
+												 */
383
+												do_action('geodir_after_edit_post_link_on_listing');
384
+											} ?>
385 385
 											</span>
386 386
 
387 387
                                 <?php } ?>
@@ -394,32 +394,32 @@  discard block
 block discarded – undo
394 394
                 </li>
395 395
 
396 396
             <?php
397
-            endwhile;
398
-
399
-            /**
400
-             * Called inside the `ul` of the listings template, but after all `li` elements.
401
-             *
402
-             * When used by the widget view template then it will only show if there are listings to be shown.
403
-             *
404
-             * @since 1.0.0
405
-             * @see 'geodir_before_listing_post_listview'
406
-             */
407
-            do_action('geodir_after_listing_post_listview');
408
-
409
-        else:
397
+			endwhile;
398
+
399
+			/**
400
+			 * Called inside the `ul` of the listings template, but after all `li` elements.
401
+			 *
402
+			 * When used by the widget view template then it will only show if there are listings to be shown.
403
+			 *
404
+			 * @since 1.0.0
405
+			 * @see 'geodir_before_listing_post_listview'
406
+			 */
407
+			do_action('geodir_after_listing_post_listview');
408
+
409
+		else:
410 410
 			$favorite = isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite' ? true : false;
411 411
             
412 412
 			/**
413
-             * Called inside the `ul` of the listings template, when no listing found.
414
-             *
415
-             * @since 1.5.5
413
+			 * Called inside the `ul` of the listings template, when no listing found.
414
+			 *
415
+			 * @since 1.5.5
416 416
 			 * @param string 'listing-listview' Listing listview template.
417 417
 			 * @param bool $favorite Are favorite listings results?
418
-             */
419
-            do_action('geodir_message_not_found_on_listing', 'listing-listview', $favorite);
420
-        endif;
418
+			 */
419
+			do_action('geodir_message_not_found_on_listing', 'listing-listview', $favorite);
420
+		endif;
421 421
 
422
-        ?>
422
+		?>
423 423
     </ul>  <!-- geodir_category_list_view ends here-->
424 424
 
425 425
     <div class="clear"></div>
Please login to merge, or discard this patch.
geodirectory_hooks_actions.php 1 patch
Indentation   +1503 added lines, -1503 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()) {
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()) {
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,59 +1278,59 @@  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
-        //start not show alert msg
1302
-        'rating_error_msg' => __('Error : please retry', 'geodirectory'),
1303
-        'listing_url_prefix_msg' => __('Please enter listing url prefix', 'geodirectory'),
1304
-        'invalid_listing_prefix_msg' => __('Invalid character in listing url prefix', 'geodirectory'),
1305
-        'location_url_prefix_msg' => __('Please enter location url prefix', 'geodirectory'),
1306
-        'invalid_location_prefix_msg' => __('Invalid character in location url prefix', 'geodirectory'),
1307
-        'location_and_cat_url_separator_msg' => __('Please enter location and category url separator', 'geodirectory'),
1308
-        'invalid_char_and_cat_url_separator_msg' => __('Invalid character in location and category url separator', 'geodirectory'),
1309
-        'listing_det_url_separator_msg' => __('Please enter listing detail url separator', 'geodirectory'),
1310
-        'invalid_char_listing_det_url_separator_msg' => __('Invalid character in listing detail url separator', 'geodirectory'),
1311
-        'loading_listing_error_favorite' => __('Error loading listing.', 'geodirectory'),
1312
-        'geodir_field_id_required' => __('This field is required.', 'geodirectory'),
1313
-        'geodir_valid_email_address_msg' => __('Please enter valid email address.', 'geodirectory'),
1314
-        'geodir_default_marker_icon' => $default_marker_icon,
1315
-        'geodir_default_marker_w' => $default_marker_width,
1316
-        'geodir_default_marker_h' => $default_marker_height,
1317
-        'geodir_latitude_error_msg' => GEODIR_LATITUDE_ERROR_MSG,
1318
-        'geodir_longgitude_error_msg' => GEODIR_LOGNGITUDE_ERROR_MSG,
1319
-        'geodir_default_rating_star_icon' => get_option('geodir_default_rating_star_icon'),
1320
-        'gd_cmt_btn_post_reply' => __('Post Reply', 'geodirectory'),
1321
-        'gd_cmt_btn_reply_text' => __('Reply text', 'geodirectory'),
1322
-        'gd_cmt_btn_post_review' => __('Post Review', 'geodirectory'),
1323
-        'gd_cmt_btn_review_text' => __('Review text', 'geodirectory'),
1324
-        'gd_cmt_err_no_rating' => __("Please select star rating, you can't leave a review without stars.", 'geodirectory'),
1325
-        /* on/off dragging for phone devices */
1326
-        'geodir_onoff_dragging' => get_option('geodir_map_onoff_dragging') ? true : false,
1327
-        'geodir_is_mobile' => wp_is_mobile() ? true : false,
1328
-        'geodir_on_dragging_text' => __('Enable Dragging', 'geodirectory'),
1329
-        'geodir_off_dragging_text' => __('Disable Dragging', 'geodirectory'),
1330
-        'geodir_err_max_file_size' => __('File size error : You tried to upload a file over %s', 'geodirectory'),
1331
-        'geodir_err_file_upload_limit' => __('You have reached your upload limit of %s files.', 'geodirectory'),
1332
-        'geodir_err_pkg_upload_limit' => __('You may only upload %s files with this package, please try again.', 'geodirectory'),
1333
-        '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
+		//start not show alert msg
1302
+		'rating_error_msg' => __('Error : please retry', 'geodirectory'),
1303
+		'listing_url_prefix_msg' => __('Please enter listing url prefix', 'geodirectory'),
1304
+		'invalid_listing_prefix_msg' => __('Invalid character in listing url prefix', 'geodirectory'),
1305
+		'location_url_prefix_msg' => __('Please enter location url prefix', 'geodirectory'),
1306
+		'invalid_location_prefix_msg' => __('Invalid character in location url prefix', 'geodirectory'),
1307
+		'location_and_cat_url_separator_msg' => __('Please enter location and category url separator', 'geodirectory'),
1308
+		'invalid_char_and_cat_url_separator_msg' => __('Invalid character in location and category url separator', 'geodirectory'),
1309
+		'listing_det_url_separator_msg' => __('Please enter listing detail url separator', 'geodirectory'),
1310
+		'invalid_char_listing_det_url_separator_msg' => __('Invalid character in listing detail url separator', 'geodirectory'),
1311
+		'loading_listing_error_favorite' => __('Error loading listing.', 'geodirectory'),
1312
+		'geodir_field_id_required' => __('This field is required.', 'geodirectory'),
1313
+		'geodir_valid_email_address_msg' => __('Please enter valid email address.', 'geodirectory'),
1314
+		'geodir_default_marker_icon' => $default_marker_icon,
1315
+		'geodir_default_marker_w' => $default_marker_width,
1316
+		'geodir_default_marker_h' => $default_marker_height,
1317
+		'geodir_latitude_error_msg' => GEODIR_LATITUDE_ERROR_MSG,
1318
+		'geodir_longgitude_error_msg' => GEODIR_LOGNGITUDE_ERROR_MSG,
1319
+		'geodir_default_rating_star_icon' => get_option('geodir_default_rating_star_icon'),
1320
+		'gd_cmt_btn_post_reply' => __('Post Reply', 'geodirectory'),
1321
+		'gd_cmt_btn_reply_text' => __('Reply text', 'geodirectory'),
1322
+		'gd_cmt_btn_post_review' => __('Post Review', 'geodirectory'),
1323
+		'gd_cmt_btn_review_text' => __('Review text', 'geodirectory'),
1324
+		'gd_cmt_err_no_rating' => __("Please select star rating, you can't leave a review without stars.", 'geodirectory'),
1325
+		/* on/off dragging for phone devices */
1326
+		'geodir_onoff_dragging' => get_option('geodir_map_onoff_dragging') ? true : false,
1327
+		'geodir_is_mobile' => wp_is_mobile() ? true : false,
1328
+		'geodir_on_dragging_text' => __('Enable Dragging', 'geodirectory'),
1329
+		'geodir_off_dragging_text' => __('Disable Dragging', 'geodirectory'),
1330
+		'geodir_err_max_file_size' => __('File size error : You tried to upload a file over %s', 'geodirectory'),
1331
+		'geodir_err_file_upload_limit' => __('You have reached your upload limit of %s files.', 'geodirectory'),
1332
+		'geodir_err_pkg_upload_limit' => __('You may only upload %s files with this package, please try again.', 'geodirectory'),
1333
+		'geodir_action_remove' => __('Remove', 'geodirectory'),
1334 1334
 		'geodir_txt_all_files' => __('Allowed files', 'geodirectory'),
1335 1335
 		'geodir_err_file_type' => __('File type error. Allowed file types: %s', 'geodirectory'),
1336 1336
 		'gd_allowed_img_types' => !empty($allowed_img_types) ? implode(',', $allowed_img_types) : '',
@@ -1338,29 +1338,29 @@  discard block
 block discarded – undo
1338 1338
 		'geodir_txt_form_searching' => __('Searching...', 'geodirectory'),
1339 1339
 		'fa_rating' => (int)get_option('geodir_reviewrating_enable_font_awesome') == 1 ? 1 : '',
1340 1340
 		'reviewrating' => defined('GEODIRREVIEWRATING_VERSION') ? 1 : '',
1341
-        'geodir_map_name' => geodir_map_name(),
1342
-    );
1343
-
1344
-    /**
1345
-     * Filters the translated JS strings from function geodir_localize_all_js_msg().
1346
-     *
1347
-     * With this filter you can add, remove or change translated JS strings.
1348
-     * You should add your own translations to this if you are building an addon rather than adding another script block.
1349
-     *
1350
-     * @since 1.0.0
1351
-     */
1352
-    $arr_alert_msg = apply_filters('geodir_all_js_msg', $arr_alert_msg);
1353
-
1354
-    foreach ($arr_alert_msg as $key => $value) {
1355
-        if (!is_scalar($value))
1356
-            continue;
1357
-        $arr_alert_msg[$key] = html_entity_decode((string)$value, ENT_QUOTES, 'UTF-8');
1358
-    }
1341
+		'geodir_map_name' => geodir_map_name(),
1342
+	);
1343
+
1344
+	/**
1345
+	 * Filters the translated JS strings from function geodir_localize_all_js_msg().
1346
+	 *
1347
+	 * With this filter you can add, remove or change translated JS strings.
1348
+	 * You should add your own translations to this if you are building an addon rather than adding another script block.
1349
+	 *
1350
+	 * @since 1.0.0
1351
+	 */
1352
+	$arr_alert_msg = apply_filters('geodir_all_js_msg', $arr_alert_msg);
1353
+
1354
+	foreach ($arr_alert_msg as $key => $value) {
1355
+		if (!is_scalar($value))
1356
+			continue;
1357
+		$arr_alert_msg[$key] = html_entity_decode((string)$value, ENT_QUOTES, 'UTF-8');
1358
+	}
1359 1359
 
1360
-    $script = "var geodir_all_js_msg = " . json_encode($arr_alert_msg) . ';';
1361
-    echo '<script>';
1362
-    echo $script;
1363
-    echo '</script>';
1360
+	$script = "var geodir_all_js_msg = " . json_encode($arr_alert_msg) . ';';
1361
+	echo '<script>';
1362
+	echo $script;
1363
+	echo '</script>';
1364 1364
 }
1365 1365
 
1366 1366
 add_action('admin_bar_menu', 'geodir_admin_bar_site_menu', 31);
@@ -1376,11 +1376,11 @@  discard block
 block discarded – undo
1376 1376
  */
1377 1377
 function geodir_admin_bar_site_menu($wp_admin_bar)
1378 1378
 {
1379
-    if (get_option("geodir_installed")) {
1380
-        if (current_user_can('manage_options')) {
1381
-            $wp_admin_bar->add_menu(array('parent' => 'appearance', 'id' => 'geodirectory', 'title' => __('GeoDirectory', 'geodirectory'), 'href' => admin_url('?page=geodirectory')));
1382
-        }
1383
-    }
1379
+	if (get_option("geodir_installed")) {
1380
+		if (current_user_can('manage_options')) {
1381
+			$wp_admin_bar->add_menu(array('parent' => 'appearance', 'id' => 'geodirectory', 'title' => __('GeoDirectory', 'geodirectory'), 'href' => admin_url('?page=geodirectory')));
1382
+		}
1383
+	}
1384 1384
 }
1385 1385
 
1386 1386
 add_action('geodir_before_listing', 'geodir_display_sort_options'); /*function in custom_functions.php*/
@@ -1406,25 +1406,25 @@  discard block
 block discarded – undo
1406 1406
  */
1407 1407
 function geodir_store_sidebars()
1408 1408
 {
1409
-    global $geodir_sidebars;
1410
-    global $sidebars_widgets;
1411
-
1412
-    if (!is_array($sidebars_widgets))
1413
-        $sidebars_widgets = wp_get_sidebars_widgets();
1414
-    $geodir_old_sidebars = array();
1415
-
1416
-    if (is_array($geodir_sidebars)) {
1417
-        foreach ($geodir_sidebars as $val) {
1418
-            if (is_array($sidebars_widgets)) {
1419
-                if (array_key_exists($val, $sidebars_widgets))
1420
-                    $geodir_old_sidebars[$val] = $sidebars_widgets[$val];
1421
-                else
1422
-                    $geodir_old_sidebars[$val] = array();
1423
-            }
1424
-        }
1425
-    }
1426
-    update_option('geodir_sidebars', $geodir_old_sidebars);
1427
-    geodir_option_version_backup('geodir_sidebars');
1409
+	global $geodir_sidebars;
1410
+	global $sidebars_widgets;
1411
+
1412
+	if (!is_array($sidebars_widgets))
1413
+		$sidebars_widgets = wp_get_sidebars_widgets();
1414
+	$geodir_old_sidebars = array();
1415
+
1416
+	if (is_array($geodir_sidebars)) {
1417
+		foreach ($geodir_sidebars as $val) {
1418
+			if (is_array($sidebars_widgets)) {
1419
+				if (array_key_exists($val, $sidebars_widgets))
1420
+					$geodir_old_sidebars[$val] = $sidebars_widgets[$val];
1421
+				else
1422
+					$geodir_old_sidebars[$val] = array();
1423
+			}
1424
+		}
1425
+	}
1426
+	update_option('geodir_sidebars', $geodir_old_sidebars);
1427
+	geodir_option_version_backup('geodir_sidebars');
1428 1428
 
1429 1429
 }
1430 1430
 
@@ -1438,28 +1438,28 @@  discard block
 block discarded – undo
1438 1438
  */
1439 1439
 function geodir_restore_sidebars()
1440 1440
 {
1441
-    global $sidebars_widgets;
1442
-
1443
-    if (!is_array($sidebars_widgets))
1444
-        $sidebars_widgets = wp_get_sidebars_widgets();
1445
-
1446
-    if (is_array($sidebars_widgets)) {
1447
-        $geodir_old_sidebars = get_option('geodir_sidebars');
1448
-        if (is_array($geodir_old_sidebars)) {
1449
-            foreach ($geodir_old_sidebars as $key => $val) {
1450
-                if(0 === strpos($key, 'geodir_'))// if gd widget
1451
-                {
1452
-                    $sidebars_widgets[$key] = $geodir_old_sidebars[$key];
1453
-                }
1441
+	global $sidebars_widgets;
1454 1442
 
1443
+	if (!is_array($sidebars_widgets))
1444
+		$sidebars_widgets = wp_get_sidebars_widgets();
1455 1445
 
1456
-            }
1457
-        }
1446
+	if (is_array($sidebars_widgets)) {
1447
+		$geodir_old_sidebars = get_option('geodir_sidebars');
1448
+		if (is_array($geodir_old_sidebars)) {
1449
+			foreach ($geodir_old_sidebars as $key => $val) {
1450
+				if(0 === strpos($key, 'geodir_'))// if gd widget
1451
+				{
1452
+					$sidebars_widgets[$key] = $geodir_old_sidebars[$key];
1453
+				}
1458 1454
 
1459
-    }
1460 1455
 
1461
-    update_option('sidebars_widgets', $sidebars_widgets);
1462
-    update_option('geodir_sidebars', '');
1456
+			}
1457
+		}
1458
+
1459
+	}
1460
+
1461
+	update_option('sidebars_widgets', $sidebars_widgets);
1462
+	update_option('geodir_sidebars', '');
1463 1463
 }
1464 1464
 
1465 1465
 add_action('geodir_after_listing_post_gridview', 'geodir_after_listing_post_gridview');
@@ -1472,9 +1472,9 @@  discard block
 block discarded – undo
1472 1472
  */
1473 1473
 function geodir_after_listing_post_gridview()
1474 1474
 {
1475
-    global $gridview_columns;
1475
+	global $gridview_columns;
1476 1476
 
1477
-    $gridview_columns = '';
1477
+	$gridview_columns = '';
1478 1478
 
1479 1479
 }
1480 1480
 
@@ -1502,11 +1502,11 @@  discard block
 block discarded – undo
1502 1502
  */
1503 1503
 function so_handle_038($url, $original_url, $_context)
1504 1504
 {
1505
-    if (strstr($url, "maps.google.com/maps/api/js") !== false) {
1506
-        $url = str_replace("&#038;", "&amp;", $url); // or $url = $original_url
1507
-    }
1505
+	if (strstr($url, "maps.google.com/maps/api/js") !== false) {
1506
+		$url = str_replace("&#038;", "&amp;", $url); // or $url = $original_url
1507
+	}
1508 1508
 
1509
-    return $url;
1509
+	return $url;
1510 1510
 }
1511 1511
 
1512 1512
 
@@ -1522,34 +1522,34 @@  discard block
 block discarded – undo
1522 1522
 function geodir_after_main_form_fields() {
1523 1523
 	global $gd_session;
1524 1524
 	
1525
-    if (get_option('geodir_accept_term_condition')) {
1526
-        global $post;
1527
-        $term_condition = '';
1528
-        if (isset($_REQUEST['backandedit'])) {
1529
-            $post = (object)$gd_session->get('listing');
1530
-            $term_condition = isset($post->geodir_accept_term_condition) ? $post->geodir_accept_term_condition : '';
1531
-        }
1532
-
1533
-        ?>
1525
+	if (get_option('geodir_accept_term_condition')) {
1526
+		global $post;
1527
+		$term_condition = '';
1528
+		if (isset($_REQUEST['backandedit'])) {
1529
+			$post = (object)$gd_session->get('listing');
1530
+			$term_condition = isset($post->geodir_accept_term_condition) ? $post->geodir_accept_term_condition : '';
1531
+		}
1532
+
1533
+		?>
1534 1534
         <div id="geodir_accept_term_condition_row" class="required_field geodir_form_row clearfix">
1535 1535
             <label>&nbsp;</label>
1536 1536
 
1537 1537
             <div class="geodir_taxonomy_field" style="float:left; width:70%;">
1538 1538
 				<span style="display:block"> 
1539 1539
 				<input class="main_list_selecter" type="checkbox" <?php if ($term_condition == '1') {
1540
-                    echo 'checked="checked"';
1541
-                } ?> field_type="checkbox" name="geodir_accept_term_condition" id="geodir_accept_term_condition"
1540
+					echo 'checked="checked"';
1541
+				} ?> field_type="checkbox" name="geodir_accept_term_condition" id="geodir_accept_term_condition"
1542 1542
                        class="geodir_textfield" value="1"
1543 1543
                        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>
1544 1544
 				</span>
1545 1545
             </div>
1546 1546
             <span class="geodir_message_error"><?php if (isset($required_msg)) {
1547
-                    _e($required_msg, 'geodirectory');
1548
-                } ?></span>
1547
+					_e($required_msg, 'geodirectory');
1548
+				} ?></span>
1549 1549
         </div>
1550 1550
     <?php
1551 1551
 
1552
-    }
1552
+	}
1553 1553
 }
1554 1554
 
1555 1555
 
@@ -1574,42 +1574,42 @@  discard block
 block discarded – undo
1574 1574
  */
1575 1575
 function geodir_detail_page_tab_is_display($is_display, $tab)
1576 1576
 {
1577
-    global $post, $post_images, $video, $special_offers, $related_listing, $geodir_post_detail_fields;
1577
+	global $post, $post_images, $video, $special_offers, $related_listing, $geodir_post_detail_fields;
1578 1578
 
1579
-    if ($tab == 'post_profile') {
1580
-        /** This action is documented in geodirectory_template_actions.php */
1581
-        $desc_limit = apply_filters('geodir_description_field_desc_limit', '');
1579
+	if ($tab == 'post_profile') {
1580
+		/** This action is documented in geodirectory_template_actions.php */
1581
+		$desc_limit = apply_filters('geodir_description_field_desc_limit', '');
1582 1582
         
1583
-        if (!($desc_limit === '' || (int)$desc_limit > 0)) {
1584
-            $is_display = false;
1585
-        }
1586
-    }
1583
+		if (!($desc_limit === '' || (int)$desc_limit > 0)) {
1584
+			$is_display = false;
1585
+		}
1586
+	}
1587 1587
     
1588
-    if ($tab == 'post_info')
1589
-        $is_display = (!empty($geodir_post_detail_fields)) ? true : false;
1588
+	if ($tab == 'post_info')
1589
+		$is_display = (!empty($geodir_post_detail_fields)) ? true : false;
1590 1590
 
1591
-    if ($tab == 'post_images')
1592
-        $is_display = (!empty($post_images)) ? true : false;
1591
+	if ($tab == 'post_images')
1592
+		$is_display = (!empty($post_images)) ? true : false;
1593 1593
 
1594
-    if ($tab == 'post_video')
1595
-        $is_display = (!empty($video)) ? true : false;
1594
+	if ($tab == 'post_video')
1595
+		$is_display = (!empty($video)) ? true : false;
1596 1596
 
1597
-    if ($tab == 'special_offers')
1598
-        $is_display = (!empty($special_offers)) ? true : false;
1597
+	if ($tab == 'special_offers')
1598
+		$is_display = (!empty($special_offers)) ? true : false;
1599 1599
 
1600
-    if ($tab == 'reviews')
1601
-        $is_display = (geodir_is_page('detail')) ? true : false;
1600
+	if ($tab == 'reviews')
1601
+		$is_display = (geodir_is_page('detail')) ? true : false;
1602 1602
 
1603
-    if ($tab == 'related_listing') {
1604
-       $message = __('No listings found which match your selection.', 'geodirectory');
1603
+	if ($tab == 'related_listing') {
1604
+	   $message = __('No listings found which match your selection.', 'geodirectory');
1605 1605
        
1606
-       /** This action is documented in geodirectory-functions/template_functions.php */
1607
-       $message = apply_filters('geodir_message_listing_not_found', $message, 'listing-listview', false);
1606
+	   /** This action is documented in geodirectory-functions/template_functions.php */
1607
+	   $message = apply_filters('geodir_message_listing_not_found', $message, 'listing-listview', false);
1608 1608
        
1609
-       $is_display = ((strpos($related_listing, $message) !== false || $related_listing == '' || !geodir_is_page('detail'))) ? false : true;
1610
-    }
1609
+	   $is_display = ((strpos($related_listing, $message) !== false || $related_listing == '' || !geodir_is_page('detail'))) ? false : true;
1610
+	}
1611 1611
 
1612
-    return $is_display;
1612
+	return $is_display;
1613 1613
 }
1614 1614
 
1615 1615
 
@@ -1625,69 +1625,69 @@  discard block
 block discarded – undo
1625 1625
  * @global string $plugin_prefix Geodirectory plugin table prefix.
1626 1626
  */
1627 1627
 function geodir_changes_in_custom_fields_table() {
1628
-    global $wpdb, $plugin_prefix;
1628
+	global $wpdb, $plugin_prefix;
1629 1629
 	
1630 1630
 	// Remove unused virtual page
1631 1631
 	$listings_page_id = (int)get_option('geodir_listing_page');
1632 1632
 	if ($listings_page_id) {
1633 1633
 		$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')));
1634
-        delete_option('geodir_listing_page');
1634
+		delete_option('geodir_listing_page');
1635 1635
 	}
1636 1636
 
1637
-    if (!get_option('geodir_changes_in_custom_fields_table')) {
1638
-        $wpdb->query(
1639
-            $wpdb->prepare(
1640
-                "UPDATE " . GEODIR_CUSTOM_FIELDS_TABLE . " SET is_default=%s, is_admin=%s WHERE is_default=%s",
1641
-                array('1', '1', 'admin')
1642
-            )
1643
-        );
1637
+	if (!get_option('geodir_changes_in_custom_fields_table')) {
1638
+		$wpdb->query(
1639
+			$wpdb->prepare(
1640
+				"UPDATE " . GEODIR_CUSTOM_FIELDS_TABLE . " SET is_default=%s, is_admin=%s WHERE is_default=%s",
1641
+				array('1', '1', 'admin')
1642
+			)
1643
+		);
1644 1644
 
1645 1645
 
1646
-        /* --- terms meta value set --- */
1646
+		/* --- terms meta value set --- */
1647 1647
 
1648
-        update_option('geodir_default_marker_icon', geodir_plugin_url() . '/geodirectory-functions/map-functions/icons/pin.png');
1648
+		update_option('geodir_default_marker_icon', geodir_plugin_url() . '/geodirectory-functions/map-functions/icons/pin.png');
1649 1649
 
1650
-        $options_data = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "options WHERE option_name LIKE %s", array('%tax_meta_%')));
1650
+		$options_data = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "options WHERE option_name LIKE %s", array('%tax_meta_%')));
1651 1651
 
1652
-        if (!empty($options_data)) {
1652
+		if (!empty($options_data)) {
1653 1653
 
1654
-            foreach ($options_data as $optobj) {
1654
+			foreach ($options_data as $optobj) {
1655 1655
 
1656
-                $option_val = str_replace('tax_meta_', '', $optobj->option_name);
1656
+				$option_val = str_replace('tax_meta_', '', $optobj->option_name);
1657 1657
 
1658
-                $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)));
1658
+				$taxonomies_data = $wpdb->get_results($wpdb->prepare("SELECT taxonomy FROM " . $wpdb->prefix . "term_taxonomy WHERE taxonomy LIKE %s AND term_id=%d", array('%category%', $option_val)));
1659 1659
 
1660
-                if (!empty($taxonomies_data)) {
1660
+				if (!empty($taxonomies_data)) {
1661 1661
 
1662
-                    foreach ($taxonomies_data as $taxobj) {
1662
+					foreach ($taxonomies_data as $taxobj) {
1663 1663
 
1664
-                        $taxObject = get_taxonomy($taxobj->taxonomy);
1665
-                        $post_type = $taxObject->object_type[0];
1664
+						$taxObject = get_taxonomy($taxobj->taxonomy);
1665
+						$post_type = $taxObject->object_type[0];
1666 1666
 
1667
-                        $opt_value = 'tax_meta_' . $post_type . '_' . $option_val;
1667
+						$opt_value = 'tax_meta_' . $post_type . '_' . $option_val;
1668 1668
 
1669
-                        $duplicate_data = $wpdb->get_var($wpdb->prepare("SELECT option_id FROM " . $wpdb->prefix . "options WHERE option_name=%s", array('tax_meta_' . $option_val)));
1669
+						$duplicate_data = $wpdb->get_var($wpdb->prepare("SELECT option_id FROM " . $wpdb->prefix . "options WHERE option_name=%s", array('tax_meta_' . $option_val)));
1670 1670
 
1671
-                        if ($duplicate_data) {
1671
+						if ($duplicate_data) {
1672 1672
 
1673
-                            $wpdb->query($wpdb->prepare("UPDATE " . $wpdb->prefix . "options SET	option_name=%s WHERE option_id=%d", array($opt_value, $optobj->option_id)));
1673
+							$wpdb->query($wpdb->prepare("UPDATE " . $wpdb->prefix . "options SET	option_name=%s WHERE option_id=%d", array($opt_value, $optobj->option_id)));
1674 1674
 
1675
-                        } else {
1675
+						} else {
1676 1676
 
1677
-                            $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)));
1677
+							$wpdb->query($wpdb->prepare("INSERT INTO " . $wpdb->prefix . "options (option_name,option_value,autoload) VALUES (%s, %s, %s)", array($opt_value, $optobj->option_value, $optobj->autoload)));
1678 1678
 
1679
-                        }
1679
+						}
1680 1680
 
1681
-                    }
1681
+					}
1682 1682
 
1683
-                }
1683
+				}
1684 1684
 
1685
-            }
1686
-        }
1685
+			}
1686
+		}
1687 1687
 
1688
-        update_option('geodir_changes_in_custom_fields_table', '1');
1688
+		update_option('geodir_changes_in_custom_fields_table', '1');
1689 1689
 
1690
-    }
1690
+	}
1691 1691
 
1692 1692
 }
1693 1693
 
@@ -1706,24 +1706,24 @@  discard block
 block discarded – undo
1706 1706
 function geodir_location_slug_check($slug)
1707 1707
 {
1708 1708
 
1709
-    global $wpdb, $table_prefix;
1709
+	global $wpdb, $table_prefix;
1710 1710
 
1711
-    $slug_exists = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($slug)));
1711
+	$slug_exists = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($slug)));
1712 1712
 
1713
-    if ($slug_exists) {
1713
+	if ($slug_exists) {
1714 1714
 
1715
-        $suffix = 1;
1716
-        do {
1717
-            $alt_location_name = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix";
1718
-            $location_slug_check = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($alt_location_name)));
1719
-            $suffix++;
1720
-        } while ($location_slug_check && $suffix < 100);
1715
+		$suffix = 1;
1716
+		do {
1717
+			$alt_location_name = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix";
1718
+			$location_slug_check = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($alt_location_name)));
1719
+			$suffix++;
1720
+		} while ($location_slug_check && $suffix < 100);
1721 1721
 
1722
-        $slug = $alt_location_name;
1722
+		$slug = $alt_location_name;
1723 1723
 
1724
-    }
1724
+	}
1725 1725
 
1726
-    return $slug;
1726
+	return $slug;
1727 1727
 
1728 1728
 }
1729 1729
 
@@ -1748,42 +1748,42 @@  discard block
 block discarded – undo
1748 1748
 function geodir_update_term_slug($term_id, $tt_id, $taxonomy)
1749 1749
 {
1750 1750
 
1751
-    global $wpdb, $plugin_prefix, $table_prefix;
1751
+	global $wpdb, $plugin_prefix, $table_prefix;
1752 1752
 
1753
-    $tern_data = get_term_by('id', $term_id, $taxonomy);
1753
+	$tern_data = get_term_by('id', $term_id, $taxonomy);
1754 1754
 
1755
-    $slug = $tern_data->slug;
1755
+	$slug = $tern_data->slug;
1756 1756
 
1757
-    /**
1758
-     * Filter if a term slug exists.
1759
-     *
1760
-     * @since 1.0.0
1761
-     * @package GeoDirectory
1762
-     * @param bool $bool Default: false.
1763
-     * @param string $slug The term slug.
1764
-     * @param int $term_id The term ID.
1765
-     */
1766
-    $slug_exists = apply_filters('geodir_term_slug_is_exists', false, $slug, $term_id);
1757
+	/**
1758
+	 * Filter if a term slug exists.
1759
+	 *
1760
+	 * @since 1.0.0
1761
+	 * @package GeoDirectory
1762
+	 * @param bool $bool Default: false.
1763
+	 * @param string $slug The term slug.
1764
+	 * @param int $term_id The term ID.
1765
+	 */
1766
+	$slug_exists = apply_filters('geodir_term_slug_is_exists', false, $slug, $term_id);
1767 1767
 
1768
-    if ($slug_exists) {
1768
+	if ($slug_exists) {
1769 1769
 
1770
-        $suffix = 1;
1771
-        do {
1772
-            $new_slug = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix";
1770
+		$suffix = 1;
1771
+		do {
1772
+			$new_slug = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix";
1773 1773
 
1774
-            /** This action is documented in geodirectory_hooks_actions.php */
1775
-            $term_slug_check = apply_filters('geodir_term_slug_is_exists', false, $new_slug, $term_id);
1774
+			/** This action is documented in geodirectory_hooks_actions.php */
1775
+			$term_slug_check = apply_filters('geodir_term_slug_is_exists', false, $new_slug, $term_id);
1776 1776
 
1777
-            $suffix++;
1778
-        } while ($term_slug_check && $suffix < 100);
1777
+			$suffix++;
1778
+		} while ($term_slug_check && $suffix < 100);
1779 1779
 
1780
-        $slug = $new_slug;
1780
+		$slug = $new_slug;
1781 1781
 
1782
-        //wp_update_term( $term_id, $taxonomy, array('slug' => $slug) );
1782
+		//wp_update_term( $term_id, $taxonomy, array('slug' => $slug) );
1783 1783
 
1784
-        $wpdb->query($wpdb->prepare("UPDATE " . $table_prefix . "terms SET slug=%s WHERE term_id=%d", array($slug, $term_id)));
1784
+		$wpdb->query($wpdb->prepare("UPDATE " . $table_prefix . "terms SET slug=%s WHERE term_id=%d", array($slug, $term_id)));
1785 1785
 
1786
-    }
1786
+	}
1787 1787
 	
1788 1788
 	// Update tag in detail table.
1789 1789
 	$taxonomy_obj = get_taxonomy($taxonomy);
@@ -1824,21 +1824,21 @@  discard block
 block discarded – undo
1824 1824
 function geodir_term_slug_is_exists($slug_exists, $slug, $term_id)
1825 1825
 {
1826 1826
 
1827
-    global $wpdb, $table_prefix;
1827
+	global $wpdb, $table_prefix;
1828 1828
 
1829
-    $default_location = geodir_get_default_location();
1829
+	$default_location = geodir_get_default_location();
1830 1830
 
1831
-    $country_slug = $default_location->country_slug;
1832
-    $region_slug = $default_location->region_slug;
1833
-    $city_slug = $default_location->city_slug;
1831
+	$country_slug = $default_location->country_slug;
1832
+	$region_slug = $default_location->region_slug;
1833
+	$city_slug = $default_location->city_slug;
1834 1834
 
1835
-    if ($country_slug == $slug || $region_slug == $slug || $city_slug == $slug)
1836
-        return $slug_exists = true;
1835
+	if ($country_slug == $slug || $region_slug == $slug || $city_slug == $slug)
1836
+		return $slug_exists = true;
1837 1837
 
1838
-    if ($wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s AND term_id != %d", array($slug, $term_id))))
1839
-        return $slug_exists = true;
1838
+	if ($wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s AND term_id != %d", array($slug, $term_id))))
1839
+		return $slug_exists = true;
1840 1840
 
1841
-    return $slug_exists;
1841
+	return $slug_exists;
1842 1842
 }
1843 1843
 
1844 1844
 
@@ -1857,75 +1857,75 @@  discard block
 block discarded – undo
1857 1857
  */
1858 1858
 function geodir_custom_page_title($title = '', $sep = '')
1859 1859
 {
1860
-    global $wp;
1861
-    if (class_exists('WPSEO_Frontend') || class_exists('All_in_One_SEO_Pack')) {
1862
-        return $title;
1863
-    }
1860
+	global $wp;
1861
+	if (class_exists('WPSEO_Frontend') || class_exists('All_in_One_SEO_Pack')) {
1862
+		return $title;
1863
+	}
1864 1864
 
1865
-    if ($sep == '') {
1866
-        /**
1867
-         * Filter the page title separator.
1868
-         *
1869
-         * @since 1.0.0
1870
-         * @package GeoDirectory
1871
-         * @param string $sep The separator, default: `|`.
1872
-         */
1873
-        $sep = apply_filters('geodir_page_title_separator', '|');
1874
-    }
1865
+	if ($sep == '') {
1866
+		/**
1867
+		 * Filter the page title separator.
1868
+		 *
1869
+		 * @since 1.0.0
1870
+		 * @package GeoDirectory
1871
+		 * @param string $sep The separator, default: `|`.
1872
+		 */
1873
+		$sep = apply_filters('geodir_page_title_separator', '|');
1874
+	}
1875 1875
 
1876 1876
 
1877
-    $gd_page = '';
1878
-    if(geodir_is_page('home')){
1879
-        $gd_page = 'home';
1880
-        $title = (get_option('geodir_meta_title_homepage')) ? get_option('geodir_meta_title_homepage') : $title;
1881
-    }
1882
-    elseif(geodir_is_page('detail')){
1883
-        $gd_page = 'detail';
1884
-        $title = (get_option('geodir_meta_title_detail')) ? get_option('geodir_meta_title_detail') : $title;
1885
-    }
1886
-    elseif(geodir_is_page('pt')){
1887
-        $gd_page = 'pt';
1888
-        $title = (get_option('geodir_meta_title_pt')) ? get_option('geodir_meta_title_pt') : $title;
1889
-    }
1890
-    elseif(geodir_is_page('listing')){
1891
-        $gd_page = 'listing';
1892
-        $title = (get_option('geodir_meta_title_listing')) ? get_option('geodir_meta_title_listing') : $title;
1893
-    }
1894
-    elseif(geodir_is_page('location')){
1895
-        $gd_page = 'location';
1896
-        $title = (get_option('geodir_meta_title_location')) ? get_option('geodir_meta_title_location') : $title;
1897
-    }
1898
-    elseif(geodir_is_page('search')){
1899
-        $gd_page = 'search';
1900
-        $title = (get_option('geodir_meta_title_search')) ? get_option('geodir_meta_title_search') : $title;
1901
-    }
1902
-    elseif(geodir_is_page('add-listing')){
1903
-        $gd_page = 'add-listing';
1904
-        $title = (get_option('geodir_meta_title_add-listing')) ? get_option('geodir_meta_title_add-listing') : $title;
1905
-    }
1906
-    elseif(geodir_is_page('author')){
1907
-        $gd_page = 'author';
1908
-        $title = (get_option('geodir_meta_title_author')) ? get_option('geodir_meta_title_author') : $title;
1909
-    }
1910
-    elseif(geodir_is_page('login')){
1911
-        $gd_page = 'login';
1912
-        $title = (get_option('geodir_meta_title_login')) ? get_option('geodir_meta_title_login') : $title;
1913
-    }
1914
-    elseif(geodir_is_page('listing-success')){
1915
-        $gd_page = 'listing-success';
1916
-        $title = (get_option('geodir_meta_title_listing-success')) ? get_option('geodir_meta_title_listing-success') : $title;
1917
-    }
1877
+	$gd_page = '';
1878
+	if(geodir_is_page('home')){
1879
+		$gd_page = 'home';
1880
+		$title = (get_option('geodir_meta_title_homepage')) ? get_option('geodir_meta_title_homepage') : $title;
1881
+	}
1882
+	elseif(geodir_is_page('detail')){
1883
+		$gd_page = 'detail';
1884
+		$title = (get_option('geodir_meta_title_detail')) ? get_option('geodir_meta_title_detail') : $title;
1885
+	}
1886
+	elseif(geodir_is_page('pt')){
1887
+		$gd_page = 'pt';
1888
+		$title = (get_option('geodir_meta_title_pt')) ? get_option('geodir_meta_title_pt') : $title;
1889
+	}
1890
+	elseif(geodir_is_page('listing')){
1891
+		$gd_page = 'listing';
1892
+		$title = (get_option('geodir_meta_title_listing')) ? get_option('geodir_meta_title_listing') : $title;
1893
+	}
1894
+	elseif(geodir_is_page('location')){
1895
+		$gd_page = 'location';
1896
+		$title = (get_option('geodir_meta_title_location')) ? get_option('geodir_meta_title_location') : $title;
1897
+	}
1898
+	elseif(geodir_is_page('search')){
1899
+		$gd_page = 'search';
1900
+		$title = (get_option('geodir_meta_title_search')) ? get_option('geodir_meta_title_search') : $title;
1901
+	}
1902
+	elseif(geodir_is_page('add-listing')){
1903
+		$gd_page = 'add-listing';
1904
+		$title = (get_option('geodir_meta_title_add-listing')) ? get_option('geodir_meta_title_add-listing') : $title;
1905
+	}
1906
+	elseif(geodir_is_page('author')){
1907
+		$gd_page = 'author';
1908
+		$title = (get_option('geodir_meta_title_author')) ? get_option('geodir_meta_title_author') : $title;
1909
+	}
1910
+	elseif(geodir_is_page('login')){
1911
+		$gd_page = 'login';
1912
+		$title = (get_option('geodir_meta_title_login')) ? get_option('geodir_meta_title_login') : $title;
1913
+	}
1914
+	elseif(geodir_is_page('listing-success')){
1915
+		$gd_page = 'listing-success';
1916
+		$title = (get_option('geodir_meta_title_listing-success')) ? get_option('geodir_meta_title_listing-success') : $title;
1917
+	}
1918 1918
 
1919 1919
 
1920
-    /**
1921
-     * Filter page meta title to replace variables.
1922
-     *
1923
-     * @since 1.5.4
1924
-     * @param string $title The page title including variables.
1925
-     * @param string $gd_page The GeoDirectory page type if any.
1926
-     * @param string $sep The title separator symbol.
1927
-     */
1928
-    return apply_filters('geodir_seo_meta_title', __($title, 'geodirectory'), $gd_page, $sep);
1920
+	/**
1921
+	 * Filter page meta title to replace variables.
1922
+	 *
1923
+	 * @since 1.5.4
1924
+	 * @param string $title The page title including variables.
1925
+	 * @param string $gd_page The GeoDirectory page type if any.
1926
+	 * @param string $sep The title separator symbol.
1927
+	 */
1928
+	return apply_filters('geodir_seo_meta_title', __($title, 'geodirectory'), $gd_page, $sep);
1929 1929
 
1930 1930
 }
1931 1931
 
@@ -1941,36 +1941,36 @@  discard block
 block discarded – undo
1941 1941
 function geodir_set_post_attachment()
1942 1942
 {
1943 1943
 
1944
-    if (!get_option('geodir_set_post_attachments')) {
1944
+	if (!get_option('geodir_set_post_attachments')) {
1945 1945
 
1946
-        require_once(ABSPATH . 'wp-admin/includes/image.php');
1947
-        require_once(ABSPATH . 'wp-admin/includes/file.php');
1946
+		require_once(ABSPATH . 'wp-admin/includes/image.php');
1947
+		require_once(ABSPATH . 'wp-admin/includes/file.php');
1948 1948
 
1949
-        $all_postypes = geodir_get_posttypes();
1949
+		$all_postypes = geodir_get_posttypes();
1950 1950
 
1951
-        foreach($all_postypes as $post_type){
1952
-            $args = array(
1953
-                'posts_per_page' => -1,
1954
-                'post_type' => $post_type,
1955
-                'post_status' => 'publish');
1951
+		foreach($all_postypes as $post_type){
1952
+			$args = array(
1953
+				'posts_per_page' => -1,
1954
+				'post_type' => $post_type,
1955
+				'post_status' => 'publish');
1956 1956
 
1957
-            $posts_array = get_posts($args);
1957
+			$posts_array = get_posts($args);
1958 1958
 
1959
-            if (!empty($posts_array)) {
1959
+			if (!empty($posts_array)) {
1960 1960
 
1961
-                foreach ($posts_array as $post) {
1961
+				foreach ($posts_array as $post) {
1962 1962
 
1963
-                    geodir_set_wp_featured_image($post->ID);
1963
+					geodir_set_wp_featured_image($post->ID);
1964 1964
 
1965
-                }
1965
+				}
1966 1966
 
1967
-            }
1968
-        }
1967
+			}
1968
+		}
1969 1969
 
1970 1970
 
1971
-        update_option('geodir_set_post_attachments', '1');
1971
+		update_option('geodir_set_post_attachments', '1');
1972 1972
 
1973
-    }
1973
+	}
1974 1974
 
1975 1975
 }
1976 1976
 
@@ -1987,19 +1987,19 @@  discard block
 block discarded – undo
1987 1987
 function geodir_remove_url_seperator()
1988 1988
 {
1989 1989
 
1990
-    if (!get_option('geodir_remove_url_seperator')) {
1990
+	if (!get_option('geodir_remove_url_seperator')) {
1991 1991
 
1992
-        if (get_option('geodir_listingurl_separator'))
1993
-            delete_option('geodir_listingurl_separator');
1992
+		if (get_option('geodir_listingurl_separator'))
1993
+			delete_option('geodir_listingurl_separator');
1994 1994
 
1995
-        if (get_option('geodir_detailurl_separator'))
1996
-            delete_option('geodir_detailurl_separator');
1995
+		if (get_option('geodir_detailurl_separator'))
1996
+			delete_option('geodir_detailurl_separator');
1997 1997
 
1998
-        flush_rewrite_rules(false);
1998
+		flush_rewrite_rules(false);
1999 1999
 
2000
-        update_option('geodir_remove_url_seperator', '1');
2000
+		update_option('geodir_remove_url_seperator', '1');
2001 2001
 
2002
-    }
2002
+	}
2003 2003
 
2004 2004
 }
2005 2005
 
@@ -2015,19 +2015,19 @@  discard block
 block discarded – undo
2015 2015
  */
2016 2016
 function geodir_remove_url_seperator_form_permalink_settings($permalink_arr)
2017 2017
 {
2018
-    foreach ($permalink_arr as $key => $value) {
2018
+	foreach ($permalink_arr as $key => $value) {
2019 2019
 
2020
-        if ($value['id'] == 'geodir_listingurl_separator' || $value['id'] == 'geodir_detailurl_separator')
2021
-            unset($permalink_arr[$key]);
2020
+		if ($value['id'] == 'geodir_listingurl_separator' || $value['id'] == 'geodir_detailurl_separator')
2021
+			unset($permalink_arr[$key]);
2022 2022
 
2023
-    }
2023
+	}
2024 2024
 
2025
-    return $permalink_arr;
2025
+	return $permalink_arr;
2026 2026
 
2027 2027
 }
2028 2028
 
2029 2029
 if (!is_admin()) {
2030
-    add_filter('posts_results', 'geodir_set_status_draft_to_publish_for_own_post');
2030
+	add_filter('posts_results', 'geodir_set_status_draft_to_publish_for_own_post');
2031 2031
 }
2032 2032
 /**
2033 2033
  * Set status from draft to publish.
@@ -2040,16 +2040,16 @@  discard block
 block discarded – undo
2040 2040
  */
2041 2041
 function geodir_set_status_draft_to_publish_for_own_post($post)
2042 2042
 {
2043
-    $user_id = get_current_user_id();
2043
+	$user_id = get_current_user_id();
2044 2044
 
2045
-    if(!$user_id){return $post;}
2045
+	if(!$user_id){return $post;}
2046 2046
 
2047
-    $gd_post_types = geodir_get_posttypes();
2047
+	$gd_post_types = geodir_get_posttypes();
2048 2048
 
2049
-    if (!empty($post) && $post[0]->post_author == $user_id && in_array($post[0]->post_type, $gd_post_types) && !isset($_REQUEST['fl_builder'])) {
2050
-        $post[0]->post_status = 'publish';
2051
-    }
2052
-    return $post;
2049
+	if (!empty($post) && $post[0]->post_author == $user_id && in_array($post[0]->post_type, $gd_post_types) && !isset($_REQUEST['fl_builder'])) {
2050
+		$post[0]->post_status = 'publish';
2051
+	}
2052
+	return $post;
2053 2053
 }
2054 2054
 
2055 2055
 
@@ -2141,33 +2141,33 @@  discard block
 block discarded – undo
2141 2141
  */
2142 2142
 function geodir_detail_page_tab_headings_change($tabs_arr)
2143 2143
 {
2144
-    global $wpdb;
2144
+	global $wpdb;
2145 2145
 
2146
-    $post_type = geodir_get_current_posttype();
2146
+	$post_type = geodir_get_current_posttype();
2147 2147
 
2148
-    $all_postypes = geodir_get_posttypes();
2148
+	$all_postypes = geodir_get_posttypes();
2149 2149
 
2150
-    if (!empty($tabs_arr) && $post_type != '' && in_array($post_type, $all_postypes)) {
2150
+	if (!empty($tabs_arr) && $post_type != '' && in_array($post_type, $all_postypes)) {
2151 2151
 
2152
-        if (array_key_exists('post_video', $tabs_arr)) {
2152
+		if (array_key_exists('post_video', $tabs_arr)) {
2153 2153
 
2154
-            $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)));
2154
+			$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)));
2155 2155
 
2156
-            if (isset($tabs_arr['post_video']['heading_text']) && $field_title != '')
2157
-                $tabs_arr['post_video']['heading_text'] = $field_title;
2158
-        }
2156
+			if (isset($tabs_arr['post_video']['heading_text']) && $field_title != '')
2157
+				$tabs_arr['post_video']['heading_text'] = $field_title;
2158
+		}
2159 2159
 
2160
-        if (array_key_exists('special_offers', $tabs_arr)) {
2160
+		if (array_key_exists('special_offers', $tabs_arr)) {
2161 2161
 
2162
-            $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)));
2162
+			$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)));
2163 2163
 
2164
-            if (isset($tabs_arr['special_offers']['heading_text']) && $field_title != '')
2165
-                $tabs_arr['special_offers']['heading_text'] = $field_title;
2166
-        }
2164
+			if (isset($tabs_arr['special_offers']['heading_text']) && $field_title != '')
2165
+				$tabs_arr['special_offers']['heading_text'] = $field_title;
2166
+		}
2167 2167
 
2168
-    }
2168
+	}
2169 2169
 
2170
-    return $tabs_arr;
2170
+	return $tabs_arr;
2171 2171
 
2172 2172
 }
2173 2173
 
@@ -2180,10 +2180,10 @@  discard block
 block discarded – undo
2180 2180
  */
2181 2181
 function geodir_remove_template_redirect_actions()
2182 2182
 {
2183
-    if (geodir_is_page('login')){
2184
-        remove_all_actions('template_redirect');
2185
-        remove_action('init', 'avia_modify_front', 10);
2186
-    }
2183
+	if (geodir_is_page('login')){
2184
+		remove_all_actions('template_redirect');
2185
+		remove_action('init', 'avia_modify_front', 10);
2186
+	}
2187 2187
 }
2188 2188
 
2189 2189
 
@@ -2205,51 +2205,51 @@  discard block
 block discarded – undo
2205 2205
 function geodirectory_before_featured_image_delete($attachment_id)
2206 2206
 {
2207 2207
 
2208
-    global $wpdb, $plugin_prefix;
2208
+	global $wpdb, $plugin_prefix;
2209 2209
 
2210
-    $post_id = get_post_field('post_parent', $attachment_id);
2210
+	$post_id = get_post_field('post_parent', $attachment_id);
2211 2211
 
2212
-    $attachment_url = wp_get_attachment_url($attachment_id);
2212
+	$attachment_url = wp_get_attachment_url($attachment_id);
2213 2213
 
2214
-    if ($post_id > 0 && (isset($_REQUEST['action']) && $_REQUEST['action'] == 'delete')) {
2214
+	if ($post_id > 0 && (isset($_REQUEST['action']) && $_REQUEST['action'] == 'delete')) {
2215 2215
 
2216
-        $post_type = get_post_type($post_id);
2216
+		$post_type = get_post_type($post_id);
2217 2217
 
2218
-        $all_postypes = geodir_get_posttypes();
2218
+		$all_postypes = geodir_get_posttypes();
2219 2219
 
2220
-        if (!in_array($post_type, $all_postypes) || !is_admin())
2221
-            return false;
2220
+		if (!in_array($post_type, $all_postypes) || !is_admin())
2221
+			return false;
2222 2222
 
2223
-        $uploads = wp_upload_dir();
2223
+		$uploads = wp_upload_dir();
2224 2224
 
2225
-        $split_img_path = explode($uploads['baseurl'], $attachment_url);
2225
+		$split_img_path = explode($uploads['baseurl'], $attachment_url);
2226 2226
 
2227
-        $split_img_file_path = isset($split_img_path[1]) ? $split_img_path[1] : '';
2227
+		$split_img_file_path = isset($split_img_path[1]) ? $split_img_path[1] : '';
2228 2228
 
2229
-        $wpdb->query(
2230
-            $wpdb->prepare("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id = %d AND file=%s ",
2231
-                array($post_id, $split_img_file_path)
2232
-            )
2233
-        );
2229
+		$wpdb->query(
2230
+			$wpdb->prepare("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id = %d AND file=%s ",
2231
+				array($post_id, $split_img_file_path)
2232
+			)
2233
+		);
2234 2234
 
2235
-        $attachment_data = $wpdb->get_row(
2236
-            $wpdb->prepare("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=%d",
2237
-                array($post_id)
2238
-            )
2239
-        );
2235
+		$attachment_data = $wpdb->get_row(
2236
+			$wpdb->prepare("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=%d",
2237
+				array($post_id)
2238
+			)
2239
+		);
2240 2240
 
2241
-        if (!empty($attachment_data)) {
2242
-            $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
2243
-        }
2241
+		if (!empty($attachment_data)) {
2242
+			$wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
2243
+		}
2244 2244
 
2245 2245
 
2246
-        $table_name = $plugin_prefix . $post_type . '_detail';
2246
+		$table_name = $plugin_prefix . $post_type . '_detail';
2247 2247
 
2248
-        $wpdb->query("UPDATE " . $table_name . " SET featured_image='' WHERE post_id =" . $post_id);
2248
+		$wpdb->query("UPDATE " . $table_name . " SET featured_image='' WHERE post_id =" . $post_id);
2249 2249
 
2250
-        geodir_set_wp_featured_image($post_id);
2250
+		geodir_set_wp_featured_image($post_id);
2251 2251
 
2252
-    }
2252
+	}
2253 2253
 
2254 2254
 }
2255 2255
 
@@ -2267,79 +2267,79 @@  discard block
 block discarded – undo
2267 2267
 function geodir_temp_set_post_attachment()
2268 2268
 {
2269 2269
 
2270
-    global $wpdb, $plugin_prefix;
2270
+	global $wpdb, $plugin_prefix;
2271 2271
 
2272
-    $all_postypes = geodir_get_posttypes();
2272
+	$all_postypes = geodir_get_posttypes();
2273 2273
 
2274
-    foreach ($all_postypes as $posttype) {
2274
+	foreach ($all_postypes as $posttype) {
2275 2275
 
2276
-        $tablename = $plugin_prefix . $posttype . '_detail';
2276
+		$tablename = $plugin_prefix . $posttype . '_detail';
2277 2277
 
2278
-        $get_post_data = $wpdb->get_results("SELECT post_id FROM " . $tablename);
2278
+		$get_post_data = $wpdb->get_results("SELECT post_id FROM " . $tablename);
2279 2279
 
2280
-        if (!empty($get_post_data)) {
2280
+		if (!empty($get_post_data)) {
2281 2281
 
2282
-            foreach ($get_post_data as $data) {
2282
+			foreach ($get_post_data as $data) {
2283 2283
 
2284
-                $post_id = $data->post_id;
2284
+				$post_id = $data->post_id;
2285 2285
 
2286
-                $attachment_data = $wpdb->get_results("SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id =" . $post_id . " AND file!=''");
2286
+				$attachment_data = $wpdb->get_results("SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id =" . $post_id . " AND file!=''");
2287 2287
 
2288
-                if (!empty($attachment_data)) {
2288
+				if (!empty($attachment_data)) {
2289 2289
 
2290
-                    foreach ($attachment_data as $attach) {
2290
+					foreach ($attachment_data as $attach) {
2291 2291
 
2292
-                        $file_info = pathinfo($attach->file);
2292
+						$file_info = pathinfo($attach->file);
2293 2293
 
2294
-                        $sub_dir = '';
2295
-                        if ($file_info['dirname'] != '.' && $file_info['dirname'] != '..')
2296
-                            $sub_dir = stripslashes_deep($file_info['dirname']);
2294
+						$sub_dir = '';
2295
+						if ($file_info['dirname'] != '.' && $file_info['dirname'] != '..')
2296
+							$sub_dir = stripslashes_deep($file_info['dirname']);
2297 2297
 
2298
-                        $uploads = wp_upload_dir(trim($sub_dir, '/')); // Array of key => value pairs
2299
-                        $uploads_path = $uploads['basedir'];
2298
+						$uploads = wp_upload_dir(trim($sub_dir, '/')); // Array of key => value pairs
2299
+						$uploads_path = $uploads['basedir'];
2300 2300
 
2301
-                        $file_name = $file_info['basename'];
2301
+						$file_name = $file_info['basename'];
2302 2302
 
2303
-                        $img_arr['path'] = $uploads_path . $sub_dir . '/' . $file_name;
2303
+						$img_arr['path'] = $uploads_path . $sub_dir . '/' . $file_name;
2304 2304
 
2305
-                        if (!file_exists($img_arr['path'])) {
2305
+						if (!file_exists($img_arr['path'])) {
2306 2306
 
2307
-                            $wpdb->query("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE ID=" . $attach->ID);
2307
+							$wpdb->query("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE ID=" . $attach->ID);
2308 2308
 
2309
-                        }
2309
+						}
2310 2310
 
2311
-                    }
2311
+					}
2312 2312
 
2313
-                    $attachment_data = $wpdb->get_row("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=" . $post_id . " GROUP BY post_id");
2313
+					$attachment_data = $wpdb->get_row("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=" . $post_id . " GROUP BY post_id");
2314 2314
 
2315
-                    if (!empty($attachment_data)) {
2315
+					if (!empty($attachment_data)) {
2316 2316
 
2317
-                        if ($attachment_data->ID)
2318
-                            $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
2317
+						if ($attachment_data->ID)
2318
+							$wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
2319 2319
 
2320
-                    } else {
2320
+					} else {
2321 2321
 
2322
-                        if (has_post_thumbnail($post_id)) {
2322
+						if (has_post_thumbnail($post_id)) {
2323 2323
 
2324
-                            $post_thumbnail_id = get_post_thumbnail_id($post_id);
2324
+							$post_thumbnail_id = get_post_thumbnail_id($post_id);
2325 2325
 
2326
-                            wp_delete_attachment($post_thumbnail_id);
2326
+							wp_delete_attachment($post_thumbnail_id);
2327 2327
 
2328
-                        }
2328
+						}
2329 2329
 
2330
-                    }
2330
+					}
2331 2331
 
2332
-                    $wpdb->query("UPDATE " . $tablename . " SET featured_image='' WHERE post_id =" . $post_id);
2332
+					$wpdb->query("UPDATE " . $tablename . " SET featured_image='' WHERE post_id =" . $post_id);
2333 2333
 
2334
-                    geodir_set_wp_featured_image($post_id);
2334
+					geodir_set_wp_featured_image($post_id);
2335 2335
 
2336
-                }
2336
+				}
2337 2337
 
2338
-            }
2338
+			}
2339 2339
 
2340
-        }
2340
+		}
2341 2341
 
2342
-    }
2342
+	}
2343 2343
 
2344 2344
 }
2345 2345
 
@@ -2357,9 +2357,9 @@  discard block
 block discarded – undo
2357 2357
 function geodir_default_rating_star_icon()
2358 2358
 {
2359 2359
 
2360
-    if (!get_option('geodir_default_rating_star_icon')) {
2361
-        update_option('geodir_default_rating_star_icon', geodir_plugin_url() . '/geodirectory-assets/images/stars.png');
2362
-    }
2360
+	if (!get_option('geodir_default_rating_star_icon')) {
2361
+		update_option('geodir_default_rating_star_icon', geodir_plugin_url() . '/geodirectory-assets/images/stars.png');
2362
+	}
2363 2363
 
2364 2364
 }
2365 2365
 
@@ -2377,27 +2377,27 @@  discard block
 block discarded – undo
2377 2377
  */
2378 2378
 function geodir_user_post_listing_count($user_id=null)
2379 2379
 {
2380
-    global $wpdb, $plugin_prefix, $current_user;
2381
-    if(!$user_id){
2382
-        $user_id = $current_user->ID;
2383
-    }
2380
+	global $wpdb, $plugin_prefix, $current_user;
2381
+	if(!$user_id){
2382
+		$user_id = $current_user->ID;
2383
+	}
2384 2384
 
2385
-    $user_id = $current_user->ID;
2386
-    $all_postypes = geodir_get_posttypes();
2387
-    $all_posts = get_option('geodir_listing_link_user_dashboard');
2385
+	$user_id = $current_user->ID;
2386
+	$all_postypes = geodir_get_posttypes();
2387
+	$all_posts = get_option('geodir_listing_link_user_dashboard');
2388 2388
 
2389
-    $user_listing = array();
2390
-    if (is_array($all_posts) && !empty($all_posts)) {
2391
-        foreach ($all_posts as $ptype) {
2392
-            $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' )");
2389
+	$user_listing = array();
2390
+	if (is_array($all_posts) && !empty($all_posts)) {
2391
+		foreach ($all_posts as $ptype) {
2392
+			$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' )");
2393 2393
 
2394
-            if ($total_posts > 0) {
2395
-                $user_listing[$ptype] = $total_posts;
2396
-            }
2397
-        }
2398
-    }
2394
+			if ($total_posts > 0) {
2395
+				$user_listing[$ptype] = $total_posts;
2396
+			}
2397
+		}
2398
+	}
2399 2399
 
2400
-    return $user_listing;
2400
+	return $user_listing;
2401 2401
 }
2402 2402
 
2403 2403
 
@@ -2417,593 +2417,593 @@  discard block
 block discarded – undo
2417 2417
  */
2418 2418
 function geodir_detail_page_custom_field_tab($tabs_arr)
2419 2419
 {
2420
-    global $post;
2421
-
2422
-    $post_type = geodir_get_current_posttype();
2423
-    $all_postypes = geodir_get_posttypes();
2424
-
2425
-    if (!empty($tabs_arr) && $post_type != '' && in_array($post_type, $all_postypes) && (geodir_is_page('detail') || geodir_is_page('preview'))) {
2426
-        $package_info = array();
2427
-        $package_info = geodir_post_package_info($package_info, $post);
2428
-        $post_package_id = $package_info->pid;
2429
-        $fields_location = 'detail';
2430
-
2431
-        $custom_fields = geodir_post_custom_fields($post_package_id, 'default', $post_type, $fields_location);
2432
-        if (!empty($custom_fields)) {
2433
-            $parse_custom_fields = array();
2434
-            foreach ($custom_fields as $field) {
2435
-                $field = stripslashes_deep($field); // strip slashes
2420
+	global $post;
2421
+
2422
+	$post_type = geodir_get_current_posttype();
2423
+	$all_postypes = geodir_get_posttypes();
2424
+
2425
+	if (!empty($tabs_arr) && $post_type != '' && in_array($post_type, $all_postypes) && (geodir_is_page('detail') || geodir_is_page('preview'))) {
2426
+		$package_info = array();
2427
+		$package_info = geodir_post_package_info($package_info, $post);
2428
+		$post_package_id = $package_info->pid;
2429
+		$fields_location = 'detail';
2430
+
2431
+		$custom_fields = geodir_post_custom_fields($post_package_id, 'default', $post_type, $fields_location);
2432
+		if (!empty($custom_fields)) {
2433
+			$parse_custom_fields = array();
2434
+			foreach ($custom_fields as $field) {
2435
+				$field = stripslashes_deep($field); // strip slashes
2436 2436
                 
2437
-                $type = $field;
2438
-                $field_name = $field['htmlvar_name'];
2439
-                if (empty($geodir_post_info) && geodir_is_page('preview') && $field_name != '' && !isset($post->{$field_name}) && isset($_REQUEST[$field_name])) {
2440
-                    $post->{$field_name} = $_REQUEST[$field_name];
2441
-                }
2442
-
2443
-                if (isset($field['show_as_tab']) && $field['show_as_tab'] == 1 && ((isset($post->{$field_name}) && $post->{$field_name} != '') || $field['type'] == 'fieldset') && in_array($field['type'], array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file'))) {
2444
-                    if ($type['type'] == 'datepicker' && ($post->{$type['htmlvar_name']} == '' || $post->{$type['htmlvar_name']} == '0000-00-00')) {
2445
-                        continue;
2446
-                    }
2447
-
2448
-                    $parse_custom_fields[] = $field;
2449
-                }
2450
-            }
2451
-            $custom_fields = $parse_custom_fields;
2452
-        }
2437
+				$type = $field;
2438
+				$field_name = $field['htmlvar_name'];
2439
+				if (empty($geodir_post_info) && geodir_is_page('preview') && $field_name != '' && !isset($post->{$field_name}) && isset($_REQUEST[$field_name])) {
2440
+					$post->{$field_name} = $_REQUEST[$field_name];
2441
+				}
2442
+
2443
+				if (isset($field['show_as_tab']) && $field['show_as_tab'] == 1 && ((isset($post->{$field_name}) && $post->{$field_name} != '') || $field['type'] == 'fieldset') && in_array($field['type'], array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file'))) {
2444
+					if ($type['type'] == 'datepicker' && ($post->{$type['htmlvar_name']} == '' || $post->{$type['htmlvar_name']} == '0000-00-00')) {
2445
+						continue;
2446
+					}
2447
+
2448
+					$parse_custom_fields[] = $field;
2449
+				}
2450
+			}
2451
+			$custom_fields = $parse_custom_fields;
2452
+		}
2453 2453
 
2454
-        if (!empty($custom_fields)) {
2455
-            $post = stripslashes_deep($post); // strip slashes
2454
+		if (!empty($custom_fields)) {
2455
+			$post = stripslashes_deep($post); // strip slashes
2456 2456
             
2457
-            $field_set_start = 0;
2458
-            $fieldset_count = 0;
2459
-            $fieldset = '';
2460
-            $total_fields = count($custom_fields);
2461
-            $count_field = 0;
2462
-            $fieldset_arr = array();
2463
-            $i = 0;
2464
-            $geodir_post_info = isset($post->ID) && !empty($post->ID) ? geodir_get_post_info($post->ID) : NULL;
2465
-
2466
-            foreach ($custom_fields as $field) {
2467
-                $count_field++;
2468
-                $field_name = $field['htmlvar_name'];
2469
-                if (empty($geodir_post_info) && geodir_is_page('preview') && $field_name != '' && !isset($post->{$field_name}) && isset($_REQUEST[$field_name])) {
2470
-                    $post->{$field_name} = $_REQUEST[$field_name];
2471
-                }
2472
-
2473
-                if (isset($field['show_as_tab']) && $field['show_as_tab'] == 1 && ((isset($post->{$field_name}) && $post->{$field_name} != '') || $field['type'] == 'fieldset') && in_array($field['type'], array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file'))) {
2474
-                    $label = $field['site_title'] != '' ? $field['site_title'] : $field['admin_title'];
2475
-                    $site_title = trim($field['site_title']);
2476
-                    $type = $field;
2477
-                    $html = '';
2478
-                    $html_var = $field_name;
2479
-                    $field_icon = '';
2480
-                    $variables_array = array();
2481
-
2482
-                    if ($type['type'] == 'datepicker' && ($post->{$type['htmlvar_name']} == '' || $post->{$type['htmlvar_name']} == '0000-00-00')) {
2483
-                        continue;
2484
-                    }
2485
-
2486
-                    if ($type['type'] != 'fieldset') {
2487
-                        $i++;
2488
-                        $variables_array['post_id'] = $post->ID;
2489
-                        $variables_array['label'] = __($type['site_title'], 'geodirectory');
2490
-                        $variables_array['value'] = '';
2491
-                        $variables_array['value'] = $post->{$type['htmlvar_name']};
2492
-                    }
2493
-
2494
-                    if (strpos($type['field_icon'], 'http') !== false) {
2495
-                        $field_icon = ' background: url(' . $type['field_icon'] . ') no-repeat left center;background-size:18px 18px;padding-left: 21px;';
2496
-                    } elseif (strpos($type['field_icon'], 'fa fa-') !== false) {
2497
-                        $field_icon = '<i class="' . $type['field_icon'] . '"></i>';
2498
-                    }
2499
-
2500
-                    switch ($type['type']) {
2501
-                        case 'fieldset': {
2502
-                            $i = 0;
2503
-                            $fieldset_count++;
2504
-                            $field_set_start = 1;
2505
-                            $fieldset_arr[$fieldset_count]['htmlvar_name'] = 'gd_tab_' . $fieldset_count;
2506
-                            $fieldset_arr[$fieldset_count]['label'] = $label;
2507
-                        }
2508
-                            break;
2509
-                        case 'url': {
2510
-                            if (strpos($field_icon, 'http') !== false) {
2511
-                                $field_icon_af = '';
2512
-                            } elseif ($field_icon == '') {
2513
-
2514
-                                if ($type['name'] == 'geodir_facebook') {
2515
-                                    $field_icon_af = '<i class="fa fa-facebook-square"></i>';
2516
-                                } elseif ($type['name'] == 'geodir_twitter') {
2517
-                                    $field_icon_af = '<i class="fa fa-twitter-square"></i>';
2518
-                                } else {
2519
-                                    $field_icon_af = '<i class="fa fa-link"></i>';
2520
-                                }
2521
-
2522
-                            } else {
2523
-                                $field_icon_af = $field_icon;
2524
-                                $field_icon = '';
2525
-                            }
2457
+			$field_set_start = 0;
2458
+			$fieldset_count = 0;
2459
+			$fieldset = '';
2460
+			$total_fields = count($custom_fields);
2461
+			$count_field = 0;
2462
+			$fieldset_arr = array();
2463
+			$i = 0;
2464
+			$geodir_post_info = isset($post->ID) && !empty($post->ID) ? geodir_get_post_info($post->ID) : NULL;
2465
+
2466
+			foreach ($custom_fields as $field) {
2467
+				$count_field++;
2468
+				$field_name = $field['htmlvar_name'];
2469
+				if (empty($geodir_post_info) && geodir_is_page('preview') && $field_name != '' && !isset($post->{$field_name}) && isset($_REQUEST[$field_name])) {
2470
+					$post->{$field_name} = $_REQUEST[$field_name];
2471
+				}
2472
+
2473
+				if (isset($field['show_as_tab']) && $field['show_as_tab'] == 1 && ((isset($post->{$field_name}) && $post->{$field_name} != '') || $field['type'] == 'fieldset') && in_array($field['type'], array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file'))) {
2474
+					$label = $field['site_title'] != '' ? $field['site_title'] : $field['admin_title'];
2475
+					$site_title = trim($field['site_title']);
2476
+					$type = $field;
2477
+					$html = '';
2478
+					$html_var = $field_name;
2479
+					$field_icon = '';
2480
+					$variables_array = array();
2481
+
2482
+					if ($type['type'] == 'datepicker' && ($post->{$type['htmlvar_name']} == '' || $post->{$type['htmlvar_name']} == '0000-00-00')) {
2483
+						continue;
2484
+					}
2485
+
2486
+					if ($type['type'] != 'fieldset') {
2487
+						$i++;
2488
+						$variables_array['post_id'] = $post->ID;
2489
+						$variables_array['label'] = __($type['site_title'], 'geodirectory');
2490
+						$variables_array['value'] = '';
2491
+						$variables_array['value'] = $post->{$type['htmlvar_name']};
2492
+					}
2493
+
2494
+					if (strpos($type['field_icon'], 'http') !== false) {
2495
+						$field_icon = ' background: url(' . $type['field_icon'] . ') no-repeat left center;background-size:18px 18px;padding-left: 21px;';
2496
+					} elseif (strpos($type['field_icon'], 'fa fa-') !== false) {
2497
+						$field_icon = '<i class="' . $type['field_icon'] . '"></i>';
2498
+					}
2499
+
2500
+					switch ($type['type']) {
2501
+						case 'fieldset': {
2502
+							$i = 0;
2503
+							$fieldset_count++;
2504
+							$field_set_start = 1;
2505
+							$fieldset_arr[$fieldset_count]['htmlvar_name'] = 'gd_tab_' . $fieldset_count;
2506
+							$fieldset_arr[$fieldset_count]['label'] = $label;
2507
+						}
2508
+							break;
2509
+						case 'url': {
2510
+							if (strpos($field_icon, 'http') !== false) {
2511
+								$field_icon_af = '';
2512
+							} elseif ($field_icon == '') {
2513
+
2514
+								if ($type['name'] == 'geodir_facebook') {
2515
+									$field_icon_af = '<i class="fa fa-facebook-square"></i>';
2516
+								} elseif ($type['name'] == 'geodir_twitter') {
2517
+									$field_icon_af = '<i class="fa fa-twitter-square"></i>';
2518
+								} else {
2519
+									$field_icon_af = '<i class="fa fa-link"></i>';
2520
+								}
2521
+
2522
+							} else {
2523
+								$field_icon_af = $field_icon;
2524
+								$field_icon = '';
2525
+							}
2526 2526
                             
2527
-                            $a_url = geodir_parse_custom_field_url($post->{$type['htmlvar_name']});
2528
-
2529
-                            $website = !empty($a_url['url']) ? $a_url['url'] : '';
2530
-                            $title = !empty($a_url['label']) ? $a_url['label'] : $type['site_title'];
2531
-                            $title = $title != '' ? __(stripslashes($title), 'geodirectory') : '';
2532
-
2533
-                            $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2534
-
2535
-                            // all search engines that use the nofollow value exclude links that use it from their ranking calculation
2536
-                            $rel = strpos($website, get_site_url()) !== false ? '' : 'rel="nofollow"';
2537
-
2538
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '"><span class="geodir-i-website" style="' . $field_icon . '">' . $field_icon_af . ' <a href="' . $website . '" target="_blank" ' . $rel . ' ><strong>' .
2539
-                                /**
2540
-                                 * Filer the custom field website name.
2541
-                                 *
2542
-                                 * @since 1.0.0
2543
-                                 * @param string $title The field name default: "Website".
2544
-                                 * @param string $website The website address.
2545
-                                 * @param int $post->ID The post ID.
2546
-                                 */
2547
-                                apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID) . '</strong></a></span></div>';
2548
-                        }
2549
-                            break;
2550
-                        case 'phone': {
2551
-                            if (strpos($field_icon, 'http') !== false) {
2552
-                                $field_icon_af = '';
2553
-                            } elseif ($field_icon == '') {
2554
-                                $field_icon_af = '<i class="fa fa-phone"></i>';
2555
-                            } else {
2556
-                                $field_icon_af = $field_icon;
2557
-                                $field_icon = '';
2558
-                            }
2559
-
2560
-                            $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2561
-
2562
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-contact" style="' . $field_icon . '">' . $field_icon_af;
2563
-                            if ($field_set_start == 1 && $site_title != '') {
2564
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2565
-                            }
2566
-                            $html .= ' </span>' . $post->{$type['htmlvar_name']} . '</div>';
2567
-                        }
2568
-                            break;
2569
-                        case 'time': {
2570
-                            $value = '';
2571
-                            if ($post->{$type['htmlvar_name']} != '')
2572
-                                $value = date_i18n(get_option('time_format'), strtotime($post->{$type['htmlvar_name']}));
2573
-
2574
-                            if (strpos($field_icon, 'http') !== false) {
2575
-                                $field_icon_af = '';
2576
-                            } elseif ($field_icon == '') {
2577
-                                $field_icon_af = '<i class="fa fa-clock-o"></i>';
2578
-                            } else {
2579
-                                $field_icon_af = $field_icon;
2580
-                                $field_icon = '';
2581
-                            }
2582
-
2583
-                            $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2584
-
2585
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-time" style="' . $field_icon . '">' . $field_icon_af;
2586
-                            if ($field_set_start == 1 && $site_title != '') {
2587
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2588
-                            }
2589
-                            $html .= ' </span>' . $value . '</div>';
2590
-                        }
2591
-                            break;
2592
-                        case 'datepicker': {
2593
-                            $date_format = geodir_default_date_format();
2594
-                            if ($type['extra_fields'] != '') {
2595
-                                $date_format = unserialize($type['extra_fields']);
2596
-                                $date_format = $date_format['date_format'];
2597
-                            }
2598
-
2599
-                            // check if we need to change the format or not
2600
-                            $date_format_len = strlen(str_replace(' ', '', $date_format));
2601
-                            if($date_format_len>5){// if greater then 5 then it's the old style format.
2602
-
2603
-                                $search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format
2604
-                                $replace = array('d','j','l','m','n','F','Y');//PHP date format
2605
-
2606
-                                $date_format = str_replace($search, $replace, $date_format);
2607
-
2608
-                                $post_htmlvar_value = ($date_format == 'd/m/Y' || $date_format == 'j/n/Y' ) ? str_replace('/', '-', $post->{$type['htmlvar_name']}) : $post->{$type['htmlvar_name']}; // PHP doesn't work well with dd/mm/yyyy format
2609
-                            }else{
2610
-                                $post_htmlvar_value = $post->{$type['htmlvar_name']};
2611
-                            }
2612
-
2613
-                            $value = '';
2614
-                            if ($post->{$type['htmlvar_name']} != '')
2615
-                                $value = date_i18n($date_format, strtotime($post_htmlvar_value));
2616
-
2617
-                            if (strpos($field_icon, 'http') !== false) {
2618
-                                $field_icon_af = '';
2619
-                            } elseif ($field_icon == '') {
2620
-                                $field_icon_af = '<i class="fa fa-calendar"></i>';
2621
-                            } else {
2622
-                                $field_icon_af = $field_icon;
2623
-                                $field_icon = '';
2624
-                            }
2625
-
2626
-                            $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2627
-
2628
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-datepicker" style="' . $field_icon . '">' . $field_icon_af;
2629
-                            if ($field_set_start == 1 && $site_title != '') {
2630
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2631
-                            }
2632
-                            $html .= ' </span>' . $value . '</div>';
2633
-                        }
2634
-                            break;
2635
-                        case 'text': {
2636
-                            if (strpos($field_icon, 'http') !== false) {
2637
-                                $field_icon_af = '';
2638
-                            } elseif ($field_icon == '') {
2639
-                                $field_icon_af = '';
2640
-                            } else {
2641
-                                $field_icon_af = $field_icon;
2642
-                                $field_icon = '';
2643
-                            }
2644
-
2645
-                            $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2646
-
2647
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
2648
-                            if ($field_set_start == 1 && $site_title != '') {
2649
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2650
-                            }
2651
-                            $html .= ' </span>' . $post->{$type['htmlvar_name']} . '</div>';
2652
-                        }
2653
-                            break;
2654
-                        case 'radio': {
2655
-
2656
-                            if ($post->{$type['htmlvar_name']} != '') {
2657
-                                if ($post->{$type['htmlvar_name']} == 'f' || $post->{$type['htmlvar_name']} == '0') {
2658
-                                    $html_val = __('No', 'geodirectory');
2659
-                                } else if ($post->{$type['htmlvar_name']} == 't' || $post->{$type['htmlvar_name']} == '1') {
2660
-                                    $html_val = __('Yes', 'geodirectory');
2661
-                                } else {
2662
-                                    $html_val = __($post->{$type['htmlvar_name']}, 'geodirectory');
2527
+							$a_url = geodir_parse_custom_field_url($post->{$type['htmlvar_name']});
2528
+
2529
+							$website = !empty($a_url['url']) ? $a_url['url'] : '';
2530
+							$title = !empty($a_url['label']) ? $a_url['label'] : $type['site_title'];
2531
+							$title = $title != '' ? __(stripslashes($title), 'geodirectory') : '';
2532
+
2533
+							$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2534
+
2535
+							// all search engines that use the nofollow value exclude links that use it from their ranking calculation
2536
+							$rel = strpos($website, get_site_url()) !== false ? '' : 'rel="nofollow"';
2537
+
2538
+							$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '"><span class="geodir-i-website" style="' . $field_icon . '">' . $field_icon_af . ' <a href="' . $website . '" target="_blank" ' . $rel . ' ><strong>' .
2539
+								/**
2540
+								 * Filer the custom field website name.
2541
+								 *
2542
+								 * @since 1.0.0
2543
+								 * @param string $title The field name default: "Website".
2544
+								 * @param string $website The website address.
2545
+								 * @param int $post->ID The post ID.
2546
+								 */
2547
+								apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID) . '</strong></a></span></div>';
2548
+						}
2549
+							break;
2550
+						case 'phone': {
2551
+							if (strpos($field_icon, 'http') !== false) {
2552
+								$field_icon_af = '';
2553
+							} elseif ($field_icon == '') {
2554
+								$field_icon_af = '<i class="fa fa-phone"></i>';
2555
+							} else {
2556
+								$field_icon_af = $field_icon;
2557
+								$field_icon = '';
2558
+							}
2559
+
2560
+							$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2561
+
2562
+							$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-contact" style="' . $field_icon . '">' . $field_icon_af;
2563
+							if ($field_set_start == 1 && $site_title != '') {
2564
+								$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2565
+							}
2566
+							$html .= ' </span>' . $post->{$type['htmlvar_name']} . '</div>';
2567
+						}
2568
+							break;
2569
+						case 'time': {
2570
+							$value = '';
2571
+							if ($post->{$type['htmlvar_name']} != '')
2572
+								$value = date_i18n(get_option('time_format'), strtotime($post->{$type['htmlvar_name']}));
2573
+
2574
+							if (strpos($field_icon, 'http') !== false) {
2575
+								$field_icon_af = '';
2576
+							} elseif ($field_icon == '') {
2577
+								$field_icon_af = '<i class="fa fa-clock-o"></i>';
2578
+							} else {
2579
+								$field_icon_af = $field_icon;
2580
+								$field_icon = '';
2581
+							}
2582
+
2583
+							$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2584
+
2585
+							$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-time" style="' . $field_icon . '">' . $field_icon_af;
2586
+							if ($field_set_start == 1 && $site_title != '') {
2587
+								$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2588
+							}
2589
+							$html .= ' </span>' . $value . '</div>';
2590
+						}
2591
+							break;
2592
+						case 'datepicker': {
2593
+							$date_format = geodir_default_date_format();
2594
+							if ($type['extra_fields'] != '') {
2595
+								$date_format = unserialize($type['extra_fields']);
2596
+								$date_format = $date_format['date_format'];
2597
+							}
2598
+
2599
+							// check if we need to change the format or not
2600
+							$date_format_len = strlen(str_replace(' ', '', $date_format));
2601
+							if($date_format_len>5){// if greater then 5 then it's the old style format.
2602
+
2603
+								$search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format
2604
+								$replace = array('d','j','l','m','n','F','Y');//PHP date format
2605
+
2606
+								$date_format = str_replace($search, $replace, $date_format);
2607
+
2608
+								$post_htmlvar_value = ($date_format == 'd/m/Y' || $date_format == 'j/n/Y' ) ? str_replace('/', '-', $post->{$type['htmlvar_name']}) : $post->{$type['htmlvar_name']}; // PHP doesn't work well with dd/mm/yyyy format
2609
+							}else{
2610
+								$post_htmlvar_value = $post->{$type['htmlvar_name']};
2611
+							}
2612
+
2613
+							$value = '';
2614
+							if ($post->{$type['htmlvar_name']} != '')
2615
+								$value = date_i18n($date_format, strtotime($post_htmlvar_value));
2616
+
2617
+							if (strpos($field_icon, 'http') !== false) {
2618
+								$field_icon_af = '';
2619
+							} elseif ($field_icon == '') {
2620
+								$field_icon_af = '<i class="fa fa-calendar"></i>';
2621
+							} else {
2622
+								$field_icon_af = $field_icon;
2623
+								$field_icon = '';
2624
+							}
2625
+
2626
+							$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2627
+
2628
+							$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-datepicker" style="' . $field_icon . '">' . $field_icon_af;
2629
+							if ($field_set_start == 1 && $site_title != '') {
2630
+								$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2631
+							}
2632
+							$html .= ' </span>' . $value . '</div>';
2633
+						}
2634
+							break;
2635
+						case 'text': {
2636
+							if (strpos($field_icon, 'http') !== false) {
2637
+								$field_icon_af = '';
2638
+							} elseif ($field_icon == '') {
2639
+								$field_icon_af = '';
2640
+							} else {
2641
+								$field_icon_af = $field_icon;
2642
+								$field_icon = '';
2643
+							}
2644
+
2645
+							$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2646
+
2647
+							$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
2648
+							if ($field_set_start == 1 && $site_title != '') {
2649
+								$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2650
+							}
2651
+							$html .= ' </span>' . $post->{$type['htmlvar_name']} . '</div>';
2652
+						}
2653
+							break;
2654
+						case 'radio': {
2655
+
2656
+							if ($post->{$type['htmlvar_name']} != '') {
2657
+								if ($post->{$type['htmlvar_name']} == 'f' || $post->{$type['htmlvar_name']} == '0') {
2658
+									$html_val = __('No', 'geodirectory');
2659
+								} else if ($post->{$type['htmlvar_name']} == 't' || $post->{$type['htmlvar_name']} == '1') {
2660
+									$html_val = __('Yes', 'geodirectory');
2661
+								} else {
2662
+									$html_val = __($post->{$type['htmlvar_name']}, 'geodirectory');
2663 2663
                                     
2664
-                                    if (!empty($type['option_values'])) {
2665
-                                        $cf_option_values = geodir_string_values_to_options(stripslashes_deep($type['option_values']), true);
2664
+									if (!empty($type['option_values'])) {
2665
+										$cf_option_values = geodir_string_values_to_options(stripslashes_deep($type['option_values']), true);
2666 2666
                                         
2667
-                                        if (!empty($cf_option_values)) {
2668
-                                            foreach ($cf_option_values as $cf_option_value) {
2669
-                                                if (isset($cf_option_value['value']) && $cf_option_value['value'] == $post->{$type['htmlvar_name']}) {
2670
-                                                    $html_val = $cf_option_value['label'];
2671
-                                                }
2672
-                                            }
2673
-                                        }
2674
-                                    }
2675
-                                }
2676
-
2677
-                                if (strpos($field_icon, 'http') !== false) {
2678
-                                    $field_icon_af = '';
2679
-                                } else if ($field_icon == '') {
2680
-                                    $field_icon_af = '';
2681
-                                } else {
2682
-                                    $field_icon_af = $field_icon;
2683
-                                    $field_icon = '';
2684
-                                }
2685
-
2686
-                                $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2687
-
2688
-                                $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-radio" style="' . $field_icon . '">' . $field_icon_af;
2689
-
2690
-                                if ($field_set_start == 1 && $site_title != '') {
2691
-                                    $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2692
-                                }
2693
-
2694
-                                $html .= ' </span>' . $html_val . '</div>';
2695
-                            }
2696
-                        }
2697
-                            break;
2698
-                        case 'checkbox': {
2699
-                            $html_var = $type['htmlvar_name'];
2700
-                            $html_val = $type['htmlvar_name'];
2701
-
2702
-                            if ((int)$post->{$html_var} == 1) {
2703
-
2704
-                                if ($post->{$type['htmlvar_name']} == '1') {
2705
-                                    $html_val = __('Yes', 'geodirectory');
2706
-                                } else {
2707
-                                    $html_val = __('No', 'geodirectory');
2708
-                                }
2709
-
2710
-                                if (strpos($field_icon, 'http') !== false) {
2711
-                                    $field_icon_af = '';
2712
-                                } else if ($field_icon == '') {
2713
-                                    $field_icon_af = '';
2714
-                                } else {
2715
-                                    $field_icon_af = $field_icon;
2716
-                                    $field_icon = '';
2717
-                                }
2718
-
2719
-                                $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2720
-
2721
-                                $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-checkbox" style="' . $field_icon . '">' . $field_icon_af;
2722
-
2723
-                                if ($field_set_start == 1 && $site_title != '') {
2724
-                                    $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2725
-                                }
2726
-
2727
-                                $html .= ' </span>' . $html_val . '</div>';
2728
-                            }
2729
-                        }
2730
-                            break;
2731
-                        case 'select': {
2732
-                            if (strpos($field_icon, 'http') !== false) {
2733
-                                $field_icon_af = '';
2734
-                            } elseif ($field_icon == '') {
2735
-                                $field_icon_af = '';
2736
-                            } else {
2737
-                                $field_icon_af = $field_icon;
2738
-                                $field_icon = '';
2739
-                            }
2667
+										if (!empty($cf_option_values)) {
2668
+											foreach ($cf_option_values as $cf_option_value) {
2669
+												if (isset($cf_option_value['value']) && $cf_option_value['value'] == $post->{$type['htmlvar_name']}) {
2670
+													$html_val = $cf_option_value['label'];
2671
+												}
2672
+											}
2673
+										}
2674
+									}
2675
+								}
2676
+
2677
+								if (strpos($field_icon, 'http') !== false) {
2678
+									$field_icon_af = '';
2679
+								} else if ($field_icon == '') {
2680
+									$field_icon_af = '';
2681
+								} else {
2682
+									$field_icon_af = $field_icon;
2683
+									$field_icon = '';
2684
+								}
2685
+
2686
+								$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2687
+
2688
+								$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-radio" style="' . $field_icon . '">' . $field_icon_af;
2689
+
2690
+								if ($field_set_start == 1 && $site_title != '') {
2691
+									$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2692
+								}
2693
+
2694
+								$html .= ' </span>' . $html_val . '</div>';
2695
+							}
2696
+						}
2697
+							break;
2698
+						case 'checkbox': {
2699
+							$html_var = $type['htmlvar_name'];
2700
+							$html_val = $type['htmlvar_name'];
2701
+
2702
+							if ((int)$post->{$html_var} == 1) {
2703
+
2704
+								if ($post->{$type['htmlvar_name']} == '1') {
2705
+									$html_val = __('Yes', 'geodirectory');
2706
+								} else {
2707
+									$html_val = __('No', 'geodirectory');
2708
+								}
2709
+
2710
+								if (strpos($field_icon, 'http') !== false) {
2711
+									$field_icon_af = '';
2712
+								} else if ($field_icon == '') {
2713
+									$field_icon_af = '';
2714
+								} else {
2715
+									$field_icon_af = $field_icon;
2716
+									$field_icon = '';
2717
+								}
2718
+
2719
+								$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2720
+
2721
+								$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-checkbox" style="' . $field_icon . '">' . $field_icon_af;
2722
+
2723
+								if ($field_set_start == 1 && $site_title != '') {
2724
+									$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2725
+								}
2726
+
2727
+								$html .= ' </span>' . $html_val . '</div>';
2728
+							}
2729
+						}
2730
+							break;
2731
+						case 'select': {
2732
+							if (strpos($field_icon, 'http') !== false) {
2733
+								$field_icon_af = '';
2734
+							} elseif ($field_icon == '') {
2735
+								$field_icon_af = '';
2736
+							} else {
2737
+								$field_icon_af = $field_icon;
2738
+								$field_icon = '';
2739
+							}
2740 2740
                             
2741
-                            $field_value = __($post->{$type['htmlvar_name']}, 'geodirectory');
2741
+							$field_value = __($post->{$type['htmlvar_name']}, 'geodirectory');
2742 2742
                             
2743
-                            if (!empty($type['option_values'])) {
2744
-                                $cf_option_values = geodir_string_values_to_options(stripslashes_deep($type['option_values']), true);
2743
+							if (!empty($type['option_values'])) {
2744
+								$cf_option_values = geodir_string_values_to_options(stripslashes_deep($type['option_values']), true);
2745 2745
                                 
2746
-                                if (!empty($cf_option_values)) {
2747
-                                    foreach ($cf_option_values as $cf_option_value) {
2748
-                                        if (isset($cf_option_value['value']) && $cf_option_value['value'] == $post->{$type['htmlvar_name']}) {
2749
-                                            $field_value = $cf_option_value['label'];
2750
-                                        }
2751
-                                    }
2752
-                                }
2753
-                            }
2754
-
2755
-                            $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2756
-
2757
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
2758
-                            if ($field_set_start == 1 && $site_title != '') {
2759
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2760
-                            }
2761
-                            $html .= ' </span>' . $field_value . '</div>';
2762
-                        }
2763
-                            break;
2764
-                        case 'multiselect': {
2765
-                            if (is_array($post->{$type['htmlvar_name']})) {
2766
-                                $post->{$type['htmlvar_name']} = implode(', ', $post->{$type['htmlvar_name']});
2767
-                            }
2768
-
2769
-                            if (strpos($field_icon, 'http') !== false) {
2770
-                                $field_icon_af = '';
2771
-                            } elseif ($field_icon == '') {
2772
-                                $field_icon_af = '';
2773
-                            } else {
2774
-                                $field_icon_af = $field_icon;
2775
-                                $field_icon = '';
2776
-                            }
2777
-
2778
-                            $field_values = explode(',', trim($post->{$type['htmlvar_name']}, ","));
2779
-
2780
-                            $option_values = array();
2781
-                            if (!empty($type['option_values'])) {
2782
-                                $cf_option_values = geodir_string_values_to_options(stripslashes_deep($type['option_values']), true);
2746
+								if (!empty($cf_option_values)) {
2747
+									foreach ($cf_option_values as $cf_option_value) {
2748
+										if (isset($cf_option_value['value']) && $cf_option_value['value'] == $post->{$type['htmlvar_name']}) {
2749
+											$field_value = $cf_option_value['label'];
2750
+										}
2751
+									}
2752
+								}
2753
+							}
2754
+
2755
+							$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2756
+
2757
+							$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
2758
+							if ($field_set_start == 1 && $site_title != '') {
2759
+								$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2760
+							}
2761
+							$html .= ' </span>' . $field_value . '</div>';
2762
+						}
2763
+							break;
2764
+						case 'multiselect': {
2765
+							if (is_array($post->{$type['htmlvar_name']})) {
2766
+								$post->{$type['htmlvar_name']} = implode(', ', $post->{$type['htmlvar_name']});
2767
+							}
2768
+
2769
+							if (strpos($field_icon, 'http') !== false) {
2770
+								$field_icon_af = '';
2771
+							} elseif ($field_icon == '') {
2772
+								$field_icon_af = '';
2773
+							} else {
2774
+								$field_icon_af = $field_icon;
2775
+								$field_icon = '';
2776
+							}
2777
+
2778
+							$field_values = explode(',', trim($post->{$type['htmlvar_name']}, ","));
2779
+
2780
+							$option_values = array();
2781
+							if (!empty($type['option_values'])) {
2782
+								$cf_option_values = geodir_string_values_to_options(stripslashes_deep($type['option_values']), true);
2783 2783
                                 
2784
-                                if (!empty($cf_option_values)) {
2785
-                                    foreach ($cf_option_values as $cf_option_value) {
2786
-                                        if (isset($cf_option_value['value']) && in_array($cf_option_value['value'], $field_values)) {
2787
-                                            $option_values[] = $cf_option_value['label'];
2788
-                                        }
2789
-                                    }
2790
-                                }
2791
-                            }
2792
-
2793
-                            $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2794
-
2795
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
2796
-                            if ($field_set_start == 1 && $site_title != '') {
2797
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2798
-                            }
2799
-                            $html .= ' </span>';
2800
-
2801
-                            $html .= ' <span class="gd-multiselect-value-output gd-val-'.$type['htmlvar_name'].'" >';
2802
-
2803
-                            if (count($option_values) > 1) {
2804
-                                $html .= "<span>".implode('</span>, <span>',$option_values)."</span>";
2805
-                            } else {
2806
-                                $vals = explode(",",$post->{$type['htmlvar_name']});
2807
-                                $html .= "<span>".implode('</span>, <span>', $vals)."</span>";
2808
-                            }
2809
-
2810
-                            $html .= ' </span>';
2811
-
2812
-
2813
-
2814
-
2815
-                            $html .= '</div>';
2816
-                        }
2817
-                            break;
2818
-                        case 'email': {
2819
-                            if (strpos($field_icon, 'http') !== false) {
2820
-                                $field_icon_af = '';
2821
-                            } elseif ($field_icon == '') {
2822
-                                $field_icon_af = '<i class="fa fa-envelope"></i>';
2823
-                            } else {
2824
-                                $field_icon_af = $field_icon;
2825
-                                $field_icon = '';
2826
-                            }
2827
-
2828
-                            $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2829
-
2830
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af;
2831
-                            if ($field_set_start == 1 && $site_title != '') {
2832
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2833
-                            }
2834
-                            $html .= ' </span>' . $post->{$type['htmlvar_name']} . '</div>';
2835
-                        }
2836
-                            break;
2837
-                        case 'textarea': {
2838
-                            if (strpos($field_icon, 'http') !== false) {
2839
-                                $field_icon_af = '';
2840
-                            } elseif ($field_icon == '') {
2841
-                                $field_icon_af = '';
2842
-                            } else {
2843
-                                $field_icon_af = $field_icon;
2844
-                                $field_icon = '';
2845
-                            }
2846
-
2847
-                            $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2848
-
2849
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
2850
-                            if ($field_set_start == 1 && $site_title != '') {
2851
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2852
-                            }
2853
-                            $html .= '</span>' . wpautop($post->{$type['htmlvar_name']}) . '</div>';
2854
-                        }
2855
-                            break;
2856
-                        case 'html': {
2857
-                            if (strpos($field_icon, 'http') !== false) {
2858
-                                $field_icon_af = '';
2859
-                            } elseif ($field_icon == '') {
2860
-                                $field_icon_af = '';
2861
-                            } else {
2862
-                                $field_icon_af = $field_icon;
2863
-                                $field_icon = '';
2864
-                            }
2865
-
2866
-                            $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2867
-
2868
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
2869
-                            if ($field_set_start == 1 && $site_title != '') {
2870
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2871
-                            }
2872
-                            $html .= ' </span>' . wpautop($post->{$type['htmlvar_name']}) . '</div>';
2873
-                        }
2874
-                        break;
2875
-                        case 'file': {
2876
-                            $html_var = $type['htmlvar_name'];
2877
-
2878
-                            if (!empty($post->{$type['htmlvar_name']})) {
2879
-                                $files = explode(",", $post->{$type['htmlvar_name']});
2880
-
2881
-                                if (!empty($files)) {
2882
-                                    $extra_fields = !empty($type['extra_fields']) ? maybe_unserialize($type['extra_fields']) : NULL;
2883
-                                    $allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types'] ) ? $extra_fields['gd_file_types'] : '';
2784
+								if (!empty($cf_option_values)) {
2785
+									foreach ($cf_option_values as $cf_option_value) {
2786
+										if (isset($cf_option_value['value']) && in_array($cf_option_value['value'], $field_values)) {
2787
+											$option_values[] = $cf_option_value['label'];
2788
+										}
2789
+									}
2790
+								}
2791
+							}
2792
+
2793
+							$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2794
+
2795
+							$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
2796
+							if ($field_set_start == 1 && $site_title != '') {
2797
+								$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2798
+							}
2799
+							$html .= ' </span>';
2800
+
2801
+							$html .= ' <span class="gd-multiselect-value-output gd-val-'.$type['htmlvar_name'].'" >';
2802
+
2803
+							if (count($option_values) > 1) {
2804
+								$html .= "<span>".implode('</span>, <span>',$option_values)."</span>";
2805
+							} else {
2806
+								$vals = explode(",",$post->{$type['htmlvar_name']});
2807
+								$html .= "<span>".implode('</span>, <span>', $vals)."</span>";
2808
+							}
2809
+
2810
+							$html .= ' </span>';
2811
+
2812
+
2813
+
2814
+
2815
+							$html .= '</div>';
2816
+						}
2817
+							break;
2818
+						case 'email': {
2819
+							if (strpos($field_icon, 'http') !== false) {
2820
+								$field_icon_af = '';
2821
+							} elseif ($field_icon == '') {
2822
+								$field_icon_af = '<i class="fa fa-envelope"></i>';
2823
+							} else {
2824
+								$field_icon_af = $field_icon;
2825
+								$field_icon = '';
2826
+							}
2827
+
2828
+							$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2829
+
2830
+							$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af;
2831
+							if ($field_set_start == 1 && $site_title != '') {
2832
+								$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2833
+							}
2834
+							$html .= ' </span>' . $post->{$type['htmlvar_name']} . '</div>';
2835
+						}
2836
+							break;
2837
+						case 'textarea': {
2838
+							if (strpos($field_icon, 'http') !== false) {
2839
+								$field_icon_af = '';
2840
+							} elseif ($field_icon == '') {
2841
+								$field_icon_af = '';
2842
+							} else {
2843
+								$field_icon_af = $field_icon;
2844
+								$field_icon = '';
2845
+							}
2846
+
2847
+							$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2848
+
2849
+							$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
2850
+							if ($field_set_start == 1 && $site_title != '') {
2851
+								$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2852
+							}
2853
+							$html .= '</span>' . wpautop($post->{$type['htmlvar_name']}) . '</div>';
2854
+						}
2855
+							break;
2856
+						case 'html': {
2857
+							if (strpos($field_icon, 'http') !== false) {
2858
+								$field_icon_af = '';
2859
+							} elseif ($field_icon == '') {
2860
+								$field_icon_af = '';
2861
+							} else {
2862
+								$field_icon_af = $field_icon;
2863
+								$field_icon = '';
2864
+							}
2865
+
2866
+							$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2867
+
2868
+							$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
2869
+							if ($field_set_start == 1 && $site_title != '') {
2870
+								$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2871
+							}
2872
+							$html .= ' </span>' . wpautop($post->{$type['htmlvar_name']}) . '</div>';
2873
+						}
2874
+						break;
2875
+						case 'file': {
2876
+							$html_var = $type['htmlvar_name'];
2877
+
2878
+							if (!empty($post->{$type['htmlvar_name']})) {
2879
+								$files = explode(",", $post->{$type['htmlvar_name']});
2880
+
2881
+								if (!empty($files)) {
2882
+									$extra_fields = !empty($type['extra_fields']) ? maybe_unserialize($type['extra_fields']) : NULL;
2883
+									$allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types'] ) ? $extra_fields['gd_file_types'] : '';
2884 2884
                                
2885
-                                    $file_paths = '';
2886
-                                    foreach ($files as $file) {
2887
-                                        if (!empty($file)) {
2888
-                                            $image_name_arr = explode('/', $file);
2889
-                                            $filename = end($image_name_arr);
2890
-
2891
-                                            $arr_file_type = wp_check_filetype($filename);
2892
-                                            if (empty($arr_file_type['ext']) || empty($arr_file_type['type'])) {
2893
-                                                continue;
2894
-                                            }
2895
-                                            $uploaded_file_type = $arr_file_type['type'];
2896
-                                            $uploaded_file_ext = $arr_file_type['ext'];
2885
+									$file_paths = '';
2886
+									foreach ($files as $file) {
2887
+										if (!empty($file)) {
2888
+											$image_name_arr = explode('/', $file);
2889
+											$filename = end($image_name_arr);
2890
+
2891
+											$arr_file_type = wp_check_filetype($filename);
2892
+											if (empty($arr_file_type['ext']) || empty($arr_file_type['type'])) {
2893
+												continue;
2894
+											}
2895
+											$uploaded_file_type = $arr_file_type['type'];
2896
+											$uploaded_file_ext = $arr_file_type['ext'];
2897 2897
                                             
2898
-                                            if (!empty($allowed_file_types) && !in_array($uploaded_file_ext, $allowed_file_types)) {
2899
-                                                continue; // Invalid file type.
2900
-                                            }
2901
-
2902
-                                            $image_file_types = array('image/jpg', 'image/jpeg', 'image/gif', 'image/png', 'image/bmp', 'image/x-icon');
2903
-
2904
-                                            // If the uploaded file is image
2905
-                                            if (in_array($uploaded_file_type, $image_file_types)) {
2906
-                                                $file_paths .= '<div class="geodir-custom-post-gallery" class="clearfix">';
2907
-                                                $file_paths .= '<a href="'.$file.'">';
2908
-                                                $file_paths .= geodir_show_image(array('src' => $file), 'thumbnail', false, false);
2909
-                                                $file_paths .= '</a>';
2910
-                                                $file_paths .= '</div>';
2911
-                                            } else {
2912
-                                                $ext_path = '_' . $html_var . '_';
2913
-                                                $filename = explode($ext_path, $filename);
2914
-                                                $file_paths .= '<a href="' . $file . '" target="_blank">' . $filename[count($filename) - 1] . '</a>';
2915
-                                            }
2916
-                                        }
2917
-                                    }
2918
-
2919
-                                    if (strpos($field_icon, 'http') !== false) {
2920
-                                        $field_icon_af = '';
2921
-                                    } else if ($field_icon == '') {
2922
-                                        $field_icon_af = '';
2923
-                                    } else {
2924
-                                        $field_icon_af = $field_icon;
2925
-                                        $field_icon = '';
2926
-                                    }
2927
-
2928
-                                    $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2929
-
2930
-
2931
-                                    $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . ' geodir-custom-file-box" style="clear:both;"><span class="geodir-i-file" style="display:inline-block;vertical-align:top;padding-right:14px;' . $field_icon . '">' . $field_icon_af;
2932
-
2933
-                                    if ($field_set_start == 1 && $site_title != '') {
2934
-                                        $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2935
-                                    }
2936
-
2937
-                                    $html .= ' </span>' . $file_paths . '</div>';
2938
-                                }
2939
-                            }
2940
-                        }
2941
-                            break;
2942
-                    }
2943
-
2944
-
2945
-                    /**
2946
-                     * Filter custom field output in tab.
2947
-                     *
2948
-                     * @since 1.5.6
2949
-                     *
2950
-                     * @param string $html_var The HTML variable name for the field.
2951
-                     * @param string $html Custom field unfiltered HTML.
2952
-                     * @param array $variables_array Custom field variables array.
2953
-                     */
2954
-                    $html = apply_filters("geodir_tab_show_{$html_var}", $html, $variables_array);
2955
-
2956
-                    $fieldset_html = '';
2957
-                    if ($field_set_start == 1) {
2958
-                        $add_html = false;
2959
-                        if ($type['type'] == 'fieldset' && $fieldset_count > 1) {
2960
-                            if ($fieldset != '') {
2961
-                                $add_html = true;
2962
-                                $label = $fieldset_arr[$fieldset_count - 1]['label'];
2963
-                                $htmlvar_name = $fieldset_arr[$fieldset_count - 1]['htmlvar_name'];
2964
-                            }
2965
-                            $fieldset_html = $fieldset;
2966
-                            $fieldset = '';
2967
-                        } else {
2968
-                            $fieldset .= $html;
2969
-                            if ($total_fields == $count_field && $fieldset != '') {
2970
-                                $add_html = true;
2971
-                                $label = $fieldset_arr[$fieldset_count]['label'];
2972
-                                $htmlvar_name = $fieldset_arr[$fieldset_count]['htmlvar_name'];
2973
-                                $fieldset_html = $fieldset;
2974
-                            }
2975
-                        }
2976
-
2977
-                        if ($add_html) {
2978
-                            $tabs_arr[$htmlvar_name] = array(
2979
-                                'heading_text' => __($label, 'geodirectory'),
2980
-                                'is_active_tab' => false,
2981
-                                /**
2982
-                                 * Filter if a custom field should be displayed on the details page tab.
2983
-                                 *
2984
-                                 * @since 1.0.0
2985
-                                 * @param string $htmlvar_name The field HTML var name.
2986
-                                 */
2987
-                                'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, $htmlvar_name),
2988
-                                'tab_content' => '<div class="geodir-company_info field-group">' . $fieldset_html . '</html>'
2989
-                            );
2990
-                        }
2991
-                    } else {
2992
-                        if ($html != '') {
2993
-                            $tabs_arr[$field['htmlvar_name']] = array(
2994
-                                'heading_text' => __($label, 'geodirectory'),
2995
-                                'is_active_tab' => false,
2996
-                                /** This action is documented in geodirectory_hooks_actions.php */
2997
-                                'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, $field['htmlvar_name']),
2998
-                                'tab_content' => $html
2999
-                            );
3000
-                        }
3001
-                    }
3002
-                }
3003
-            }
3004
-        }
3005
-    }
3006
-    return $tabs_arr;
2898
+											if (!empty($allowed_file_types) && !in_array($uploaded_file_ext, $allowed_file_types)) {
2899
+												continue; // Invalid file type.
2900
+											}
2901
+
2902
+											$image_file_types = array('image/jpg', 'image/jpeg', 'image/gif', 'image/png', 'image/bmp', 'image/x-icon');
2903
+
2904
+											// If the uploaded file is image
2905
+											if (in_array($uploaded_file_type, $image_file_types)) {
2906
+												$file_paths .= '<div class="geodir-custom-post-gallery" class="clearfix">';
2907
+												$file_paths .= '<a href="'.$file.'">';
2908
+												$file_paths .= geodir_show_image(array('src' => $file), 'thumbnail', false, false);
2909
+												$file_paths .= '</a>';
2910
+												$file_paths .= '</div>';
2911
+											} else {
2912
+												$ext_path = '_' . $html_var . '_';
2913
+												$filename = explode($ext_path, $filename);
2914
+												$file_paths .= '<a href="' . $file . '" target="_blank">' . $filename[count($filename) - 1] . '</a>';
2915
+											}
2916
+										}
2917
+									}
2918
+
2919
+									if (strpos($field_icon, 'http') !== false) {
2920
+										$field_icon_af = '';
2921
+									} else if ($field_icon == '') {
2922
+										$field_icon_af = '';
2923
+									} else {
2924
+										$field_icon_af = $field_icon;
2925
+										$field_icon = '';
2926
+									}
2927
+
2928
+									$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2929
+
2930
+
2931
+									$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . ' geodir-custom-file-box" style="clear:both;"><span class="geodir-i-file" style="display:inline-block;vertical-align:top;padding-right:14px;' . $field_icon . '">' . $field_icon_af;
2932
+
2933
+									if ($field_set_start == 1 && $site_title != '') {
2934
+										$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2935
+									}
2936
+
2937
+									$html .= ' </span>' . $file_paths . '</div>';
2938
+								}
2939
+							}
2940
+						}
2941
+							break;
2942
+					}
2943
+
2944
+
2945
+					/**
2946
+					 * Filter custom field output in tab.
2947
+					 *
2948
+					 * @since 1.5.6
2949
+					 *
2950
+					 * @param string $html_var The HTML variable name for the field.
2951
+					 * @param string $html Custom field unfiltered HTML.
2952
+					 * @param array $variables_array Custom field variables array.
2953
+					 */
2954
+					$html = apply_filters("geodir_tab_show_{$html_var}", $html, $variables_array);
2955
+
2956
+					$fieldset_html = '';
2957
+					if ($field_set_start == 1) {
2958
+						$add_html = false;
2959
+						if ($type['type'] == 'fieldset' && $fieldset_count > 1) {
2960
+							if ($fieldset != '') {
2961
+								$add_html = true;
2962
+								$label = $fieldset_arr[$fieldset_count - 1]['label'];
2963
+								$htmlvar_name = $fieldset_arr[$fieldset_count - 1]['htmlvar_name'];
2964
+							}
2965
+							$fieldset_html = $fieldset;
2966
+							$fieldset = '';
2967
+						} else {
2968
+							$fieldset .= $html;
2969
+							if ($total_fields == $count_field && $fieldset != '') {
2970
+								$add_html = true;
2971
+								$label = $fieldset_arr[$fieldset_count]['label'];
2972
+								$htmlvar_name = $fieldset_arr[$fieldset_count]['htmlvar_name'];
2973
+								$fieldset_html = $fieldset;
2974
+							}
2975
+						}
2976
+
2977
+						if ($add_html) {
2978
+							$tabs_arr[$htmlvar_name] = array(
2979
+								'heading_text' => __($label, 'geodirectory'),
2980
+								'is_active_tab' => false,
2981
+								/**
2982
+								 * Filter if a custom field should be displayed on the details page tab.
2983
+								 *
2984
+								 * @since 1.0.0
2985
+								 * @param string $htmlvar_name The field HTML var name.
2986
+								 */
2987
+								'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, $htmlvar_name),
2988
+								'tab_content' => '<div class="geodir-company_info field-group">' . $fieldset_html . '</html>'
2989
+							);
2990
+						}
2991
+					} else {
2992
+						if ($html != '') {
2993
+							$tabs_arr[$field['htmlvar_name']] = array(
2994
+								'heading_text' => __($label, 'geodirectory'),
2995
+								'is_active_tab' => false,
2996
+								/** This action is documented in geodirectory_hooks_actions.php */
2997
+								'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, $field['htmlvar_name']),
2998
+								'tab_content' => $html
2999
+							);
3000
+						}
3001
+					}
3002
+				}
3003
+			}
3004
+		}
3005
+	}
3006
+	return $tabs_arr;
3007 3007
 }
3008 3008
 
3009 3009
 /* display add listing page for wpml */
@@ -3027,37 +3027,37 @@  discard block
 block discarded – undo
3027 3027
  */
3028 3028
 function geodir_add_post_status_author_page()
3029 3029
 {
3030
-    global $wpdb, $post;
3031
-
3032
-    $html = '';
3033
-    if (get_current_user_id()) {
3034
-        if (geodir_is_page('author') && !empty($post) && isset($post->post_author) && $post->post_author == get_current_user_id()) {
3035
-
3036
-            // 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.
3037
-            $real_status = $wpdb->get_var("SELECT post_status from $wpdb->posts WHERE ID=$post->ID");
3038
-            $status = "<strong>(";
3039
-            $status_icon = '<i class="fa fa-play"></i>';
3040
-            if ($real_status == 'publish') {
3041
-                $status .= __('Published', 'geodirectory');
3042
-            } else {
3043
-                $status .= __('Not published', 'geodirectory');
3044
-                $status_icon = '<i class="fa fa-pause"></i>';
3045
-            }
3046
-            $status .= ")</strong>";
3030
+	global $wpdb, $post;
3031
+
3032
+	$html = '';
3033
+	if (get_current_user_id()) {
3034
+		if (geodir_is_page('author') && !empty($post) && isset($post->post_author) && $post->post_author == get_current_user_id()) {
3035
+
3036
+			// 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.
3037
+			$real_status = $wpdb->get_var("SELECT post_status from $wpdb->posts WHERE ID=$post->ID");
3038
+			$status = "<strong>(";
3039
+			$status_icon = '<i class="fa fa-play"></i>';
3040
+			if ($real_status == 'publish') {
3041
+				$status .= __('Published', 'geodirectory');
3042
+			} else {
3043
+				$status .= __('Not published', 'geodirectory');
3044
+				$status_icon = '<i class="fa fa-pause"></i>';
3045
+			}
3046
+			$status .= ")</strong>";
3047 3047
 
3048
-            $html = '<span class="geodir-post-status">' . $status_icon . ' <font class="geodir-status-label">' . __('Status: ', 'geodirectory') . '</font>' . $status . '</span>';
3049
-        }
3050
-    }
3048
+			$html = '<span class="geodir-post-status">' . $status_icon . ' <font class="geodir-status-label">' . __('Status: ', 'geodirectory') . '</font>' . $status . '</span>';
3049
+		}
3050
+	}
3051 3051
 
3052
-    if ($html != '') {
3053
-        /**
3054
-         * Filter the post status text on the author page.
3055
-         *
3056
-         * @since 1.0.0
3057
-         * @param string $html The HTML of the status.
3058
-         */
3059
-        echo apply_filters('geodir_filter_status_text_on_author_page', $html);
3060
-    }
3052
+	if ($html != '') {
3053
+		/**
3054
+		 * Filter the post status text on the author page.
3055
+		 *
3056
+		 * @since 1.0.0
3057
+		 * @param string $html The HTML of the status.
3058
+		 */
3059
+		echo apply_filters('geodir_filter_status_text_on_author_page', $html);
3060
+	}
3061 3061
 
3062 3062
 
3063 3063
 }
@@ -3071,21 +3071,21 @@  discard block
 block discarded – undo
3071 3071
  */
3072 3072
 function geodir_init_no_rating()
3073 3073
 {
3074
-    if (get_option('geodir_disable_rating')) {
3075
-        remove_action('comment_form_logged_in_after', 'geodir_comment_rating_fields');
3076
-        remove_action('comment_form_before_fields', 'geodir_comment_rating_fields');
3077
-        remove_action('comment_form_logged_in_after', 'geodir_reviewrating_comment_rating_fields');
3078
-        remove_action('comment_form_before_fields', 'geodir_reviewrating_comment_rating_fields');
3079
-        remove_action('add_meta_boxes_comment', 'geodir_comment_add_meta_box');
3080
-        remove_action('add_meta_boxes', 'geodir_reviewrating_comment_metabox', 13);
3081
-        remove_filter('comment_text', 'geodir_wrap_comment_text', 40);
3082
-
3083
-        add_action('comment_form_logged_in_after', 'geodir_no_rating_rating_fields');
3084
-        add_action('comment_form_before_fields', 'geodir_no_rating_rating_fields');
3085
-        add_filter('comment_text', 'geodir_no_rating_comment_text', 100, 2);
3086
-        add_filter('geodir_detail_page_review_rating_html', 'geodir_no_rating_review_rating_html', 100);
3087
-        add_filter('geodir_get_sort_options', 'geodir_no_rating_get_sort_options', 100, 2);
3088
-    }
3074
+	if (get_option('geodir_disable_rating')) {
3075
+		remove_action('comment_form_logged_in_after', 'geodir_comment_rating_fields');
3076
+		remove_action('comment_form_before_fields', 'geodir_comment_rating_fields');
3077
+		remove_action('comment_form_logged_in_after', 'geodir_reviewrating_comment_rating_fields');
3078
+		remove_action('comment_form_before_fields', 'geodir_reviewrating_comment_rating_fields');
3079
+		remove_action('add_meta_boxes_comment', 'geodir_comment_add_meta_box');
3080
+		remove_action('add_meta_boxes', 'geodir_reviewrating_comment_metabox', 13);
3081
+		remove_filter('comment_text', 'geodir_wrap_comment_text', 40);
3082
+
3083
+		add_action('comment_form_logged_in_after', 'geodir_no_rating_rating_fields');
3084
+		add_action('comment_form_before_fields', 'geodir_no_rating_rating_fields');
3085
+		add_filter('comment_text', 'geodir_no_rating_comment_text', 100, 2);
3086
+		add_filter('geodir_detail_page_review_rating_html', 'geodir_no_rating_review_rating_html', 100);
3087
+		add_filter('geodir_get_sort_options', 'geodir_no_rating_get_sort_options', 100, 2);
3088
+	}
3089 3089
 }
3090 3090
 
3091 3091
 /**
@@ -3097,20 +3097,20 @@  discard block
 block discarded – undo
3097 3097
  */
3098 3098
 function geodir_no_rating_rating_fields()
3099 3099
 {
3100
-    global $post;
3100
+	global $post;
3101 3101
 
3102
-    $post_types = geodir_get_posttypes();
3102
+	$post_types = geodir_get_posttypes();
3103 3103
 
3104
-    if (!empty($post) && isset($post->post_type) && in_array($post->post_type, $post_types)) {
3105
-        if (is_plugin_active('geodir_review_rating_manager/geodir_review_rating_manager.php')) {
3106
-            echo '<input type="hidden" value="1" name="geodir_rating[overall]" />';
3107
-            if (get_option('geodir_reviewrating_enable_images')) {
3108
-                geodir_reviewrating_rating_img_html();
3109
-            }
3110
-        } else {
3111
-            echo '<input type="hidden" id="geodir_overallrating" name="geodir_overallrating" value="1" />';
3112
-        }
3113
-    }
3104
+	if (!empty($post) && isset($post->post_type) && in_array($post->post_type, $post_types)) {
3105
+		if (is_plugin_active('geodir_review_rating_manager/geodir_review_rating_manager.php')) {
3106
+			echo '<input type="hidden" value="1" name="geodir_rating[overall]" />';
3107
+			if (get_option('geodir_reviewrating_enable_images')) {
3108
+				geodir_reviewrating_rating_img_html();
3109
+			}
3110
+		} else {
3111
+			echo '<input type="hidden" id="geodir_overallrating" name="geodir_overallrating" value="1" />';
3112
+		}
3113
+	}
3114 3114
 }
3115 3115
 
3116 3116
 /**
@@ -3124,11 +3124,11 @@  discard block
 block discarded – undo
3124 3124
  */
3125 3125
 function geodir_no_rating_comment_text($content, $comment = '')
3126 3126
 {
3127
-    if (!is_admin()) {
3128
-        return '<div class="description">' . $content . '</div>';
3129
-    } else {
3130
-        return $content;
3131
-    }
3127
+	if (!is_admin()) {
3128
+		return '<div class="description">' . $content . '</div>';
3129
+	} else {
3130
+		return $content;
3131
+	}
3132 3132
 }
3133 3133
 
3134 3134
 /**
@@ -3141,7 +3141,7 @@  discard block
 block discarded – undo
3141 3141
  */
3142 3142
 function geodir_no_rating_review_rating_html($content = '')
3143 3143
 {
3144
-    return NULL;
3144
+	return NULL;
3145 3145
 }
3146 3146
 
3147 3147
 /**
@@ -3155,19 +3155,19 @@  discard block
 block discarded – undo
3155 3155
  */
3156 3156
 function geodir_no_rating_get_sort_options($options, $post_type = '')
3157 3157
 {
3158
-    $new_options = array();
3159
-    if (!empty($options)) {
3160
-        foreach ($options as $option) {
3161
-            if (is_object($option) && isset($option->htmlvar_name) && $option->htmlvar_name == 'overall_rating') {
3162
-                continue;
3163
-            }
3164
-            $new_options[] = $option;
3165
-        }
3158
+	$new_options = array();
3159
+	if (!empty($options)) {
3160
+		foreach ($options as $option) {
3161
+			if (is_object($option) && isset($option->htmlvar_name) && $option->htmlvar_name == 'overall_rating') {
3162
+				continue;
3163
+			}
3164
+			$new_options[] = $option;
3165
+		}
3166 3166
 
3167
-        $options = $new_options;
3168
-    }
3167
+		$options = $new_options;
3168
+	}
3169 3169
 
3170
-    return $options;
3170
+	return $options;
3171 3171
 }
3172 3172
 
3173 3173
 add_filter('geodir_all_js_msg', 'geodir_all_js_msg_no_rating', 100);
@@ -3181,11 +3181,11 @@  discard block
 block discarded – undo
3181 3181
  */
3182 3182
 function geodir_all_js_msg_no_rating($msg = array())
3183 3183
 {
3184
-    if (get_option('geodir_disable_rating')) {
3185
-        $msg['gd_cmt_no_rating'] = true;
3186
-    }
3184
+	if (get_option('geodir_disable_rating')) {
3185
+		$msg['gd_cmt_no_rating'] = true;
3186
+	}
3187 3187
 
3188
-    return $msg;
3188
+	return $msg;
3189 3189
 }
3190 3190
 
3191 3191
 add_filter('body_class', 'geodir_body_class_no_rating', 100);
@@ -3199,13 +3199,13 @@  discard block
 block discarded – undo
3199 3199
  */
3200 3200
 function geodir_body_class_no_rating($classes = array())
3201 3201
 {
3202
-    if (get_option('geodir_disable_rating')) {
3203
-        $classes[] = 'gd-no-rating';
3204
-    }
3202
+	if (get_option('geodir_disable_rating')) {
3203
+		$classes[] = 'gd-no-rating';
3204
+	}
3205 3205
     
3206
-    $classes[] = 'gd-map-' . geodir_map_name();
3206
+	$classes[] = 'gd-map-' . geodir_map_name();
3207 3207
 
3208
-    return $classes;
3208
+	return $classes;
3209 3209
 }
3210 3210
 
3211 3211
 add_filter('admin_body_class', 'geodir_admin_body_class_no_rating', 100);
@@ -3219,13 +3219,13 @@  discard block
 block discarded – undo
3219 3219
  */
3220 3220
 function geodir_admin_body_class_no_rating($class = '')
3221 3221
 {
3222
-    if (get_option('geodir_disable_rating')) {
3223
-        $class .= ' gd-no-rating';
3224
-    }
3222
+	if (get_option('geodir_disable_rating')) {
3223
+		$class .= ' gd-no-rating';
3224
+	}
3225 3225
     
3226
-    $class .= ' gd-map-' . geodir_map_name();
3226
+	$class .= ' gd-map-' . geodir_map_name();
3227 3227
 
3228
-    return $class;
3228
+	return $class;
3229 3229
 }
3230 3230
 
3231 3231
 add_action('wp_head', 'geodir_wp_head_no_rating');
@@ -3238,10 +3238,10 @@  discard block
 block discarded – undo
3238 3238
  */
3239 3239
 function geodir_wp_head_no_rating()
3240 3240
 {
3241
-    if (get_option('geodir_disable_rating')) {
3242
-        echo '<style>body .geodir-rating, body .geodir-bubble-rating, body .gd_ratings_module_box{display:none!important;}</style>';
3243
-        echo '<script type="text/javascript">jQuery(function(){jQuery(".gd_rating_show").parent(".geodir-rating").remove();});</script>';
3244
-    }
3241
+	if (get_option('geodir_disable_rating')) {
3242
+		echo '<style>body .geodir-rating, body .geodir-bubble-rating, body .gd_ratings_module_box{display:none!important;}</style>';
3243
+		echo '<script type="text/javascript">jQuery(function(){jQuery(".gd_rating_show").parent(".geodir-rating").remove();});</script>';
3244
+	}
3245 3245
 }
3246 3246
 
3247 3247
 add_filter('geodir_load_db_language', 'geodir_load_custom_field_translation');
@@ -3258,36 +3258,36 @@  discard block
 block discarded – undo
3258 3258
  * @return array Translation texts.
3259 3259
  */
3260 3260
 function geodir_load_gd_options_text_translation($translation_texts = array()) {
3261
-    $translation_texts = !empty( $translation_texts ) && is_array( $translation_texts ) ? $translation_texts : array();
3262
-
3263
-    $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');
3264
-
3265
-    /**
3266
-     * Filters the geodirectory option names that requires to add for translation.
3267
-     *
3268
-     * @since 1.5.7
3269
-     * @package GeoDirectory
3270
-     *
3271
-     * @param  array $gd_options Array of option names.
3272
-     */
3273
-    $gd_options = apply_filters('geodir_gd_options_for_translation', $gd_options);
3274
-    $gd_options = array_unique($gd_options);
3275
-
3276
-    if (!empty($gd_options)) {
3277
-        foreach ($gd_options as $gd_option) {
3278
-            if ($gd_option != '' && $option_value = get_option($gd_option)) {
3279
-                $option_value = is_string($option_value) ? stripslashes_deep($option_value) : '';
3261
+	$translation_texts = !empty( $translation_texts ) && is_array( $translation_texts ) ? $translation_texts : array();
3262
+
3263
+	$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');
3264
+
3265
+	/**
3266
+	 * Filters the geodirectory option names that requires to add for translation.
3267
+	 *
3268
+	 * @since 1.5.7
3269
+	 * @package GeoDirectory
3270
+	 *
3271
+	 * @param  array $gd_options Array of option names.
3272
+	 */
3273
+	$gd_options = apply_filters('geodir_gd_options_for_translation', $gd_options);
3274
+	$gd_options = array_unique($gd_options);
3275
+
3276
+	if (!empty($gd_options)) {
3277
+		foreach ($gd_options as $gd_option) {
3278
+			if ($gd_option != '' && $option_value = get_option($gd_option)) {
3279
+				$option_value = is_string($option_value) ? stripslashes_deep($option_value) : '';
3280 3280
                 
3281
-                if ($option_value != '' && !in_array($option_value, $translation_texts)) {
3282
-                    $translation_texts[] = stripslashes_deep($option_value);
3283
-                }
3284
-            }
3285
-        }
3286
-    }
3281
+				if ($option_value != '' && !in_array($option_value, $translation_texts)) {
3282
+					$translation_texts[] = stripslashes_deep($option_value);
3283
+				}
3284
+			}
3285
+		}
3286
+	}
3287 3287
 
3288
-    $translation_texts = !empty($translation_texts) ? array_unique($translation_texts) : $translation_texts;
3288
+	$translation_texts = !empty($translation_texts) ? array_unique($translation_texts) : $translation_texts;
3289 3289
 
3290
-    return $translation_texts;
3290
+	return $translation_texts;
3291 3291
 }
3292 3292
 
3293 3293
 add_filter('geodir_load_db_language', 'geodir_load_gd_options_text_translation');
@@ -3301,15 +3301,15 @@  discard block
 block discarded – undo
3301 3301
 
3302 3302
 add_filter('get_comments_link', 'gd_get_comments_link', 10, 2);
3303 3303
 function gd_get_comments_link($comments_link, $post_id) {
3304
-    $post_type = get_post_type($post_id);
3304
+	$post_type = get_post_type($post_id);
3305 3305
 
3306
-    $all_postypes = geodir_get_posttypes();
3307
-    if (in_array($post_type, $all_postypes)) {
3308
-        $comments_link = str_replace('#comments', '#reviews', $comments_link);
3309
-        $comments_link = str_replace('#respond', '#reviews', $comments_link);
3310
-    }
3306
+	$all_postypes = geodir_get_posttypes();
3307
+	if (in_array($post_type, $all_postypes)) {
3308
+		$comments_link = str_replace('#comments', '#reviews', $comments_link);
3309
+		$comments_link = str_replace('#respond', '#reviews', $comments_link);
3310
+	}
3311 3311
 
3312
-    return $comments_link;
3312
+	return $comments_link;
3313 3313
 }
3314 3314
 
3315 3315
 
@@ -3327,11 +3327,11 @@  discard block
 block discarded – undo
3327 3327
 function geodir_add_nav_menu_class( $args )
3328 3328
 {
3329 3329
 
3330
-        if(isset($args['menu_class'])){
3331
-            $args['menu_class'] = $args['menu_class']." gd-menu-z";
3332
-        }
3330
+		if(isset($args['menu_class'])){
3331
+			$args['menu_class'] = $args['menu_class']." gd-menu-z";
3332
+		}
3333 3333
     
3334
-    return $args;
3334
+	return $args;
3335 3335
 }
3336 3336
 
3337 3337
 add_filter( 'wp_nav_menu_args', 'geodir_add_nav_menu_class' );
3338 3338
\ No newline at end of file
Please login to merge, or discard this patch.
geodirectory-functions/custom_functions.php 2 patches
Indentation   +1398 added lines, -1398 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
  * @global object $gd_session GeoDirectory Session object.
18 18
  */
19 19
 function geodir_list_view_select() {
20
-    global $gd_session;
20
+	global $gd_session;
21 21
 	?>
22 22
     <script type="text/javascript">
23 23
 	function geodir_list_view_select(list) {
@@ -86,63 +86,63 @@  discard block
 block discarded – undo
86 86
  */
87 87
 function geodir_max_excerpt($charlength)
88 88
 {
89
-    global $post;
90
-    if ($charlength == '0') {
91
-        return;
92
-    }
93
-    $out = '';
89
+	global $post;
90
+	if ($charlength == '0') {
91
+		return;
92
+	}
93
+	$out = '';
94 94
 	
95 95
 	$temp_post = $post;
96 96
 	$excerpt = get_the_excerpt();
97 97
 
98
-    $charlength++;
99
-    $excerpt_more = function_exists('geodirf_excerpt_more') ? geodirf_excerpt_more('') : geodir_excerpt_more('');
100
-    if (mb_strlen($excerpt) > $charlength) {
101
-        if (mb_strlen($excerpt_more) > 0 && mb_strpos($excerpt, $excerpt_more) !== false) {
102
-            $excut = -(mb_strlen($excerpt_more));
103
-            $subex = mb_substr($excerpt, 0, $excut);
104
-            if ($charlength > 0 && mb_strlen($subex) > $charlength) {
105
-                $subex = mb_substr($subex, 0, $charlength);
106
-            }
107
-            $out .= $subex;
108
-        } else {
109
-            $subex = mb_substr($excerpt, 0, $charlength - 5);
110
-            $exwords = explode(' ', $subex);
111
-            $excut = -(mb_strlen($exwords[count($exwords) - 1]));
112
-            if ($excut < 0) {
113
-                $out .= mb_substr($subex, 0, $excut);
114
-            } else {
115
-                $out .= $subex;
116
-            }
117
-        }
118
-        $out .= ' <a class="excerpt-read-more" href="' . get_permalink() . '" title="' . get_the_title() . '">';
119
-        /**
120
-         * Filter excerpt read more text.
121
-         *
122
-         * @since 1.0.0
123
-         */
124
-        $out .= apply_filters('geodir_max_excerpt_end', __('Read more [...]', 'geodirectory'));
125
-        $out .= '</a>';
126
-
127
-    } else {
128
-        if (mb_strlen($excerpt_more) > 0 && mb_strpos($excerpt, $excerpt_more) !== false) {
129
-            $excut = -(mb_strlen($excerpt_more));
130
-            $out .= mb_substr($excerpt, 0, $excut);
131
-            $out .= ' <a class="excerpt-read-more" href="' . get_permalink() . '" title="' . get_the_title() . '">';
132
-            /**
133
-             * Filter excerpt read more text.
134
-             *
135
-             * @since 1.0.0
136
-             */
137
-            $out .= apply_filters('geodir_max_excerpt_end', __('Read more [...]', 'geodirectory'));
138
-            $out .= '</a>';
139
-        } else {
140
-            $out .= $excerpt;
141
-        }
142
-    }
98
+	$charlength++;
99
+	$excerpt_more = function_exists('geodirf_excerpt_more') ? geodirf_excerpt_more('') : geodir_excerpt_more('');
100
+	if (mb_strlen($excerpt) > $charlength) {
101
+		if (mb_strlen($excerpt_more) > 0 && mb_strpos($excerpt, $excerpt_more) !== false) {
102
+			$excut = -(mb_strlen($excerpt_more));
103
+			$subex = mb_substr($excerpt, 0, $excut);
104
+			if ($charlength > 0 && mb_strlen($subex) > $charlength) {
105
+				$subex = mb_substr($subex, 0, $charlength);
106
+			}
107
+			$out .= $subex;
108
+		} else {
109
+			$subex = mb_substr($excerpt, 0, $charlength - 5);
110
+			$exwords = explode(' ', $subex);
111
+			$excut = -(mb_strlen($exwords[count($exwords) - 1]));
112
+			if ($excut < 0) {
113
+				$out .= mb_substr($subex, 0, $excut);
114
+			} else {
115
+				$out .= $subex;
116
+			}
117
+		}
118
+		$out .= ' <a class="excerpt-read-more" href="' . get_permalink() . '" title="' . get_the_title() . '">';
119
+		/**
120
+		 * Filter excerpt read more text.
121
+		 *
122
+		 * @since 1.0.0
123
+		 */
124
+		$out .= apply_filters('geodir_max_excerpt_end', __('Read more [...]', 'geodirectory'));
125
+		$out .= '</a>';
126
+
127
+	} else {
128
+		if (mb_strlen($excerpt_more) > 0 && mb_strpos($excerpt, $excerpt_more) !== false) {
129
+			$excut = -(mb_strlen($excerpt_more));
130
+			$out .= mb_substr($excerpt, 0, $excut);
131
+			$out .= ' <a class="excerpt-read-more" href="' . get_permalink() . '" title="' . get_the_title() . '">';
132
+			/**
133
+			 * Filter excerpt read more text.
134
+			 *
135
+			 * @since 1.0.0
136
+			 */
137
+			$out .= apply_filters('geodir_max_excerpt_end', __('Read more [...]', 'geodirectory'));
138
+			$out .= '</a>';
139
+		} else {
140
+			$out .= $excerpt;
141
+		}
142
+	}
143 143
 	$post = $temp_post;
144 144
 
145
-    return $out;
145
+	return $out;
146 146
 }
147 147
 
148 148
 /**
@@ -157,34 +157,34 @@  discard block
 block discarded – undo
157 157
  */
158 158
 function geodir_post_package_info($package_info, $post = '', $post_type = '')
159 159
 {
160
-    $package_info['pid'] = 0;
161
-    $package_info['days'] = 0;
162
-    $package_info['amount'] = 0;
163
-    $package_info['is_featured'] = 0;
164
-    $package_info['image_limit'] = '';
165
-    $package_info['google_analytics'] = 1;
166
-    $package_info['sendtofriend'] = 1;
167
-
168
-    /**
169
-     * Filter listing package info.
170
-     *
171
-     * @since 1.0.0
172
-     * @param array $package_info {
173
-     *    Attributes of the package_info.
174
-     *
175
-     *    @type int $pid Package ID. Default 0.
176
-     *    @type int $days Package validity in Days. Default 0.
177
-     *    @type int $amount Package amount. Default 0.
178
-     *    @type int $is_featured Is this featured package? Default 0.
179
-     *    @type string $image_limit Image limit for this package. Default "".
180
-     *    @type int $google_analytics Add analytics to this package. Default 1.
181
-     *    @type int $sendtofriend Send to friend. Default 1.
182
-     *
183
-     * }
184
-     * @param object|string $post The post object.
185
-     * @param string $post_type The post type.
186
-     */
187
-    return (object)apply_filters('geodir_post_package_info', $package_info, $post, $post_type);
160
+	$package_info['pid'] = 0;
161
+	$package_info['days'] = 0;
162
+	$package_info['amount'] = 0;
163
+	$package_info['is_featured'] = 0;
164
+	$package_info['image_limit'] = '';
165
+	$package_info['google_analytics'] = 1;
166
+	$package_info['sendtofriend'] = 1;
167
+
168
+	/**
169
+	 * Filter listing package info.
170
+	 *
171
+	 * @since 1.0.0
172
+	 * @param array $package_info {
173
+	 *    Attributes of the package_info.
174
+	 *
175
+	 *    @type int $pid Package ID. Default 0.
176
+	 *    @type int $days Package validity in Days. Default 0.
177
+	 *    @type int $amount Package amount. Default 0.
178
+	 *    @type int $is_featured Is this featured package? Default 0.
179
+	 *    @type string $image_limit Image limit for this package. Default "".
180
+	 *    @type int $google_analytics Add analytics to this package. Default 1.
181
+	 *    @type int $sendtofriend Send to friend. Default 1.
182
+	 *
183
+	 * }
184
+	 * @param object|string $post The post object.
185
+	 * @param string $post_type The post type.
186
+	 */
187
+	return (object)apply_filters('geodir_post_package_info', $package_info, $post, $post_type);
188 188
 
189 189
 }
190 190
 
@@ -212,127 +212,127 @@  discard block
 block discarded – undo
212 212
  */
213 213
 function geodir_send_inquiry($request)
214 214
 {
215
-    global $wpdb;
215
+	global $wpdb;
216 216
 
217
-    // strip slashes from text
218
-    $request = !empty($request) ? stripslashes_deep($request) : $request;
217
+	// strip slashes from text
218
+	$request = !empty($request) ? stripslashes_deep($request) : $request;
219 219
 
220
-    $yourname = $request['inq_name'];
221
-    $youremail = $request['inq_email'];
222
-    $inq_phone = $request['inq_phone'];
223
-    $frnd_comments = $request['inq_msg'];
224
-    $pid = $request['pid'];
220
+	$yourname = $request['inq_name'];
221
+	$youremail = $request['inq_email'];
222
+	$inq_phone = $request['inq_phone'];
223
+	$frnd_comments = $request['inq_msg'];
224
+	$pid = $request['pid'];
225 225
 
226
-    $author_id = '';
227
-    $post_title = '';
226
+	$author_id = '';
227
+	$post_title = '';
228 228
 
229
-    if ($request['pid']) {
229
+	if ($request['pid']) {
230 230
 
231
-        $productinfosql = $wpdb->prepare(
232
-            "select ID,post_author,post_title from $wpdb->posts where ID =%d",
233
-            array($request['pid'])
234
-        );
235
-        $productinfo = $wpdb->get_row($productinfosql);
231
+		$productinfosql = $wpdb->prepare(
232
+			"select ID,post_author,post_title from $wpdb->posts where ID =%d",
233
+			array($request['pid'])
234
+		);
235
+		$productinfo = $wpdb->get_row($productinfosql);
236 236
 
237
-        $author_id = $productinfo->post_author;
238
-        $post_title = $productinfo->post_title;
239
-    }
237
+		$author_id = $productinfo->post_author;
238
+		$post_title = $productinfo->post_title;
239
+	}
240 240
 
241
-    $post_title = '<a href="' . get_permalink($pid) . '">' . $post_title . '</a>';
241
+	$post_title = '<a href="' . get_permalink($pid) . '">' . $post_title . '</a>';
242 242
 
243
-    $user_info = get_userdata($author_id);
244
-    $to_email = geodir_get_post_meta($pid, 'geodir_email', true);
245
-    $to_name = geodir_get_client_name($author_id);
243
+	$user_info = get_userdata($author_id);
244
+	$to_email = geodir_get_post_meta($pid, 'geodir_email', true);
245
+	$to_name = geodir_get_client_name($author_id);
246 246
 
247
-    if ($to_email == '') {
248
-        $to_email = get_option('admin_email');
249
-    }
247
+	if ($to_email == '') {
248
+		$to_email = get_option('admin_email');
249
+	}
250 250
 
251
-    /**
252
-     * Called after the send enquiry var have been set but before the email has been sent.
253
-     *
254
-     * @since 1.0.0
255
-     * @param array $request {
256
-     *    The submitted form fields as an array.
257
-     *
258
-     *    @type string $sendact Enquiry type. Default "send_inqury".
259
-     *    @type string $pid Post ID.
260
-     *    @type string $inq_name Sender name.
261
-     *    @type string $inq_email Sender mail.
262
-     *    @type string $inq_phone Sender phone.
263
-     *    @type string $inq_msg Email message.
264
-     *
265
-     * }
266
-     * @param string $type The form type, default: `Enquiry`.
267
-     */
268
-    do_action('geodir_after_send_enquiry', $request, 'Enquiry');
269
-
270
-    $client_message = $frnd_comments;
271
-    $client_message .= '<br>' . __('From :', 'geodirectory') . ' ' . $yourname . '<br>' . __('Phone :', 'geodirectory') . ' ' . $inq_phone . '<br>' . __('Email :', 'geodirectory') . ' ' . $youremail . '<br><br>' . __('Sent from', 'geodirectory') . ' - <b><a href="' . trailingslashit(home_url()) . '">' . get_option('blogname') . '</a></b>.';
272
-    /**
273
-     * Filter client message text.
274
-     *
275
-     * @since 1.0.0
276
-     * @param string $client_message Client message text.
277
-     */
278
-    $client_message = apply_filters('geodir_inquiry_email_msg', $client_message);
279
-
280
-    /**
281
-     * Called before the send enquiry email is sent.
282
-     *
283
-     * @since 1.0.0
284
-     * @param array $request {
285
-     *    The submitted form fields as an array.
286
-     *
287
-     *    @type string $sendact Enquiry type. Default "send_inqury".
288
-     *    @type string $pid Post ID.
289
-     *    @type string $inq_name Sender name.
290
-     *    @type string $inq_email Sender mail.
291
-     *    @type string $inq_phone Sender phone.
292
-     *    @type string $inq_msg Email message.
293
-     *
294
-     * }
295
-     */
296
-    do_action('geodir_before_send_enquiry_email', $request);
297
-    if ($to_email) {
298
-        // strip slashes message
299
-        $client_message = stripslashes_deep($client_message);
300
-
301
-        geodir_sendEmail($youremail, $yourname, $to_email, $to_name, '', $client_message, $extra = '', 'send_enquiry', $request['pid']);//To client email
302
-    }
251
+	/**
252
+	 * Called after the send enquiry var have been set but before the email has been sent.
253
+	 *
254
+	 * @since 1.0.0
255
+	 * @param array $request {
256
+	 *    The submitted form fields as an array.
257
+	 *
258
+	 *    @type string $sendact Enquiry type. Default "send_inqury".
259
+	 *    @type string $pid Post ID.
260
+	 *    @type string $inq_name Sender name.
261
+	 *    @type string $inq_email Sender mail.
262
+	 *    @type string $inq_phone Sender phone.
263
+	 *    @type string $inq_msg Email message.
264
+	 *
265
+	 * }
266
+	 * @param string $type The form type, default: `Enquiry`.
267
+	 */
268
+	do_action('geodir_after_send_enquiry', $request, 'Enquiry');
303 269
 
304
-    /**
305
-     * Called after the send enquiry email is sent.
306
-     *
307
-     * @since 1.0.0
308
-     * @param array $request {
309
-     *    The submitted form fields as an array.
310
-     *
311
-     *    @type string $sendact Enquiry type. Default "send_inqury".
312
-     *    @type string $pid Post ID.
313
-     *    @type string $inq_name Sender name.
314
-     *    @type string $inq_email Sender mail.
315
-     *    @type string $inq_phone Sender phone.
316
-     *    @type string $inq_msg Email message.
317
-     *
318
-     * }
319
-     */
320
-    do_action('geodir_after_send_enquiry_email', $request);
321
-    $url = get_permalink($pid);
322
-    if (strstr($url, '?')) {
323
-        $url = $url . "&send_inquiry=success";
324
-    } else {
325
-        $url = $url . "?send_inquiry=success";
326
-    }
327
-    /**
328
-     * Filter redirect url after the send enquiry email is sent.
329
-     *
330
-     * @since 1.0.0
331
-     * @param string $url Redirect url.
332
-     */
333
-    $url = apply_filters('geodir_send_enquiry_after_submit_redirect', $url);
334
-    wp_redirect($url);
335
-    gd_die();
270
+	$client_message = $frnd_comments;
271
+	$client_message .= '<br>' . __('From :', 'geodirectory') . ' ' . $yourname . '<br>' . __('Phone :', 'geodirectory') . ' ' . $inq_phone . '<br>' . __('Email :', 'geodirectory') . ' ' . $youremail . '<br><br>' . __('Sent from', 'geodirectory') . ' - <b><a href="' . trailingslashit(home_url()) . '">' . get_option('blogname') . '</a></b>.';
272
+	/**
273
+	 * Filter client message text.
274
+	 *
275
+	 * @since 1.0.0
276
+	 * @param string $client_message Client message text.
277
+	 */
278
+	$client_message = apply_filters('geodir_inquiry_email_msg', $client_message);
279
+
280
+	/**
281
+	 * Called before the send enquiry email is sent.
282
+	 *
283
+	 * @since 1.0.0
284
+	 * @param array $request {
285
+	 *    The submitted form fields as an array.
286
+	 *
287
+	 *    @type string $sendact Enquiry type. Default "send_inqury".
288
+	 *    @type string $pid Post ID.
289
+	 *    @type string $inq_name Sender name.
290
+	 *    @type string $inq_email Sender mail.
291
+	 *    @type string $inq_phone Sender phone.
292
+	 *    @type string $inq_msg Email message.
293
+	 *
294
+	 * }
295
+	 */
296
+	do_action('geodir_before_send_enquiry_email', $request);
297
+	if ($to_email) {
298
+		// strip slashes message
299
+		$client_message = stripslashes_deep($client_message);
300
+
301
+		geodir_sendEmail($youremail, $yourname, $to_email, $to_name, '', $client_message, $extra = '', 'send_enquiry', $request['pid']);//To client email
302
+	}
303
+
304
+	/**
305
+	 * Called after the send enquiry email is sent.
306
+	 *
307
+	 * @since 1.0.0
308
+	 * @param array $request {
309
+	 *    The submitted form fields as an array.
310
+	 *
311
+	 *    @type string $sendact Enquiry type. Default "send_inqury".
312
+	 *    @type string $pid Post ID.
313
+	 *    @type string $inq_name Sender name.
314
+	 *    @type string $inq_email Sender mail.
315
+	 *    @type string $inq_phone Sender phone.
316
+	 *    @type string $inq_msg Email message.
317
+	 *
318
+	 * }
319
+	 */
320
+	do_action('geodir_after_send_enquiry_email', $request);
321
+	$url = get_permalink($pid);
322
+	if (strstr($url, '?')) {
323
+		$url = $url . "&send_inquiry=success";
324
+	} else {
325
+		$url = $url . "?send_inquiry=success";
326
+	}
327
+	/**
328
+	 * Filter redirect url after the send enquiry email is sent.
329
+	 *
330
+	 * @since 1.0.0
331
+	 * @param string $url Redirect url.
332
+	 */
333
+	$url = apply_filters('geodir_send_enquiry_after_submit_redirect', $url);
334
+	wp_redirect($url);
335
+	gd_die();
336 336
 
337 337
 }
338 338
 
@@ -361,85 +361,85 @@  discard block
 block discarded – undo
361 361
  */
362 362
 function geodir_send_friend($request)
363 363
 {
364
-    global $wpdb;
365
-
366
-    // strip slashes from text
367
-    $request = !empty($request) ? stripslashes_deep($request) : $request;
368
-
369
-    $yourname = $request['yourname'];
370
-    $youremail = $request['youremail'];
371
-    $frnd_subject = $request['frnd_subject'];
372
-    $frnd_comments = $request['frnd_comments'];
373
-    $pid = $request['pid'];
374
-    $to_email = $request['to_email'];
375
-    $to_name = $request['to_name'];
376
-    if ($request['pid']) {
377
-        $productinfosql = $wpdb->prepare(
378
-            "select ID,post_title from $wpdb->posts where ID =%d",
379
-            array($request['pid'])
380
-        );
381
-        $productinfo = $wpdb->get_results($productinfosql);
382
-        foreach ($productinfo as $productinfoObj) {
383
-            $post_title = $productinfoObj->post_title;
384
-        }
385
-    }
364
+	global $wpdb;
365
+
366
+	// strip slashes from text
367
+	$request = !empty($request) ? stripslashes_deep($request) : $request;
368
+
369
+	$yourname = $request['yourname'];
370
+	$youremail = $request['youremail'];
371
+	$frnd_subject = $request['frnd_subject'];
372
+	$frnd_comments = $request['frnd_comments'];
373
+	$pid = $request['pid'];
374
+	$to_email = $request['to_email'];
375
+	$to_name = $request['to_name'];
376
+	if ($request['pid']) {
377
+		$productinfosql = $wpdb->prepare(
378
+			"select ID,post_title from $wpdb->posts where ID =%d",
379
+			array($request['pid'])
380
+		);
381
+		$productinfo = $wpdb->get_results($productinfosql);
382
+		foreach ($productinfo as $productinfoObj) {
383
+			$post_title = $productinfoObj->post_title;
384
+		}
385
+	}
386 386
 
387
-    /**
388
-     * Called before the send to friend email is sent.
389
-     *
390
-     * @since 1.0.0
391
-     * @param array $request {
392
-     *    The submitted form fields as an array.
393
-     *
394
-     *    @type string $sendact Enquiry type. Default "email_frnd".
395
-     *    @type string $pid Post ID.
396
-     *    @type string $to_name Friend name.
397
-     *    @type string $to_email Friend email.
398
-     *    @type string $yourname Sender name.
399
-     *    @type string $youremail Sender email.
400
-     *    @type string $frnd_subject Email subject.
401
-     *    @type string $frnd_comments Email Message.
402
-     *
403
-     * }
404
-     */
405
-    do_action('geodir_before_send_to_friend_email', $request);
406
-    geodir_sendEmail($youremail, $yourname, $to_email, $to_name, $frnd_subject, $frnd_comments, $extra = '', 'send_friend', $request['pid']);//To client email
407
-
408
-    /**
409
-     * Called after the send to friend email is sent.
410
-     *
411
-     * @since 1.0.0
412
-     * @param array $request {
413
-     *    The submitted form fields as an array.
414
-     *
415
-     *    @type string $sendact Enquiry type. Default "email_frnd".
416
-     *    @type string $pid Post ID.
417
-     *    @type string $to_name Friend name.
418
-     *    @type string $to_email Friend email.
419
-     *    @type string $yourname Sender name.
420
-     *    @type string $youremail Sender email.
421
-     *    @type string $frnd_subject Email subject.
422
-     *    @type string $frnd_comments Email Message.
423
-     *
424
-     * }
425
-     */
426
-    do_action('geodir_after_send_to_friend_email', $request);
427
-
428
-    $url = get_permalink($pid);
429
-    if (strstr($url, '?')) {
430
-        $url = $url . "&sendtofrnd=success";
431
-    } else {
432
-        $url = $url . "?sendtofrnd=success";
433
-    }
434
-    /**
435
-     * Filter redirect url after the send to friend email is sent.
436
-     *
437
-     * @since 1.0.0
438
-     * @param string $url Redirect url.
439
-     */
440
-    $url = apply_filters('geodir_send_to_friend_after_submit_redirect', $url);
441
-    wp_redirect($url);
442
-    gd_die();
387
+	/**
388
+	 * Called before the send to friend email is sent.
389
+	 *
390
+	 * @since 1.0.0
391
+	 * @param array $request {
392
+	 *    The submitted form fields as an array.
393
+	 *
394
+	 *    @type string $sendact Enquiry type. Default "email_frnd".
395
+	 *    @type string $pid Post ID.
396
+	 *    @type string $to_name Friend name.
397
+	 *    @type string $to_email Friend email.
398
+	 *    @type string $yourname Sender name.
399
+	 *    @type string $youremail Sender email.
400
+	 *    @type string $frnd_subject Email subject.
401
+	 *    @type string $frnd_comments Email Message.
402
+	 *
403
+	 * }
404
+	 */
405
+	do_action('geodir_before_send_to_friend_email', $request);
406
+	geodir_sendEmail($youremail, $yourname, $to_email, $to_name, $frnd_subject, $frnd_comments, $extra = '', 'send_friend', $request['pid']);//To client email
407
+
408
+	/**
409
+	 * Called after the send to friend email is sent.
410
+	 *
411
+	 * @since 1.0.0
412
+	 * @param array $request {
413
+	 *    The submitted form fields as an array.
414
+	 *
415
+	 *    @type string $sendact Enquiry type. Default "email_frnd".
416
+	 *    @type string $pid Post ID.
417
+	 *    @type string $to_name Friend name.
418
+	 *    @type string $to_email Friend email.
419
+	 *    @type string $yourname Sender name.
420
+	 *    @type string $youremail Sender email.
421
+	 *    @type string $frnd_subject Email subject.
422
+	 *    @type string $frnd_comments Email Message.
423
+	 *
424
+	 * }
425
+	 */
426
+	do_action('geodir_after_send_to_friend_email', $request);
427
+
428
+	$url = get_permalink($pid);
429
+	if (strstr($url, '?')) {
430
+		$url = $url . "&sendtofrnd=success";
431
+	} else {
432
+		$url = $url . "?sendtofrnd=success";
433
+	}
434
+	/**
435
+	 * Filter redirect url after the send to friend email is sent.
436
+	 *
437
+	 * @since 1.0.0
438
+	 * @param string $url Redirect url.
439
+	 */
440
+	$url = apply_filters('geodir_send_to_friend_after_submit_redirect', $url);
441
+	wp_redirect($url);
442
+	gd_die();
443 443
 }
444 444
 
445 445
 /**
@@ -453,28 +453,28 @@  discard block
 block discarded – undo
453 453
  */
454 454
 function geodir_before_tab_content($hash_key)
455 455
 {
456
-    switch ($hash_key) {
457
-        case 'post_info' :
458
-            echo '<div class="geodir-company_info field-group">';
459
-            break;
460
-        case 'post_images' :
461
-            /**
462
-             * Filter post gallery HTML id.
463
-             *
464
-             * @since 1.0.0
465
-             */
466
-            echo ' <div id="' . apply_filters('geodir_post_gallery_id', 'geodir-post-gallery') . '" class="clearfix" >';
467
-            break;
468
-        case 'reviews' :
469
-            echo '<div id="reviews-wrap" class="clearfix"> ';
470
-            break;
471
-        case 'post_video':
472
-            echo ' <div id="post_video-wrap" class="clearfix">';
473
-            break;
474
-        case 'special_offers':
475
-            echo '<div id="special_offers-wrap" class="clearfix">';
476
-            break;
477
-    }
456
+	switch ($hash_key) {
457
+		case 'post_info' :
458
+			echo '<div class="geodir-company_info field-group">';
459
+			break;
460
+		case 'post_images' :
461
+			/**
462
+			 * Filter post gallery HTML id.
463
+			 *
464
+			 * @since 1.0.0
465
+			 */
466
+			echo ' <div id="' . apply_filters('geodir_post_gallery_id', 'geodir-post-gallery') . '" class="clearfix" >';
467
+			break;
468
+		case 'reviews' :
469
+			echo '<div id="reviews-wrap" class="clearfix"> ';
470
+			break;
471
+		case 'post_video':
472
+			echo ' <div id="post_video-wrap" class="clearfix">';
473
+			break;
474
+		case 'special_offers':
475
+			echo '<div id="special_offers-wrap" class="clearfix">';
476
+			break;
477
+	}
478 478
 }
479 479
 
480 480
 /**
@@ -488,23 +488,23 @@  discard block
 block discarded – undo
488 488
  */
489 489
 function geodir_after_tab_content($hash_key)
490 490
 {
491
-    switch ($hash_key) {
492
-        case 'post_info' :
493
-            echo '</div>';
494
-            break;
495
-        case 'post_images' :
496
-            echo '</div>';
497
-            break;
498
-        case 'reviews' :
499
-            echo '</div>';
500
-            break;
501
-        case 'post_video':
502
-            echo '</div>';
503
-            break;
504
-        case 'special_offers':
505
-            echo '</div>';
506
-            break;
507
-    }
491
+	switch ($hash_key) {
492
+		case 'post_info' :
493
+			echo '</div>';
494
+			break;
495
+		case 'post_images' :
496
+			echo '</div>';
497
+			break;
498
+		case 'reviews' :
499
+			echo '</div>';
500
+			break;
501
+		case 'post_video':
502
+			echo '</div>';
503
+			break;
504
+		case 'special_offers':
505
+			echo '</div>';
506
+			break;
507
+	}
508 508
 }
509 509
 
510 510
 
@@ -520,21 +520,21 @@  discard block
 block discarded – undo
520 520
 function geodir_get_posts_default_sort($post_type)
521 521
 {
522 522
 
523
-    global $wpdb;
523
+	global $wpdb;
524 524
 
525
-    if ($post_type != '') {
525
+	if ($post_type != '') {
526 526
 
527
-        $all_postypes = geodir_get_posttypes();
527
+		$all_postypes = geodir_get_posttypes();
528 528
 
529
-        if (!in_array($post_type, $all_postypes))
530
-            return false;
529
+		if (!in_array($post_type, $all_postypes))
530
+			return false;
531 531
 
532
-        $sort_field_info = $wpdb->get_var($wpdb->prepare("select default_order from " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " where	post_type= %s and is_active=%d and is_default=%d", array($post_type, 1, 1)));
532
+		$sort_field_info = $wpdb->get_var($wpdb->prepare("select default_order from " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " where	post_type= %s and is_active=%d and is_default=%d", array($post_type, 1, 1)));
533 533
 
534
-        if (!empty($sort_field_info))
535
-            return $sort_field_info;
534
+		if (!empty($sort_field_info))
535
+			return $sort_field_info;
536 536
 
537
-    }
537
+	}
538 538
 
539 539
 }
540 540
 
@@ -549,24 +549,24 @@  discard block
 block discarded – undo
549 549
  * @return bool|mixed|void Returns sort results, when the post type is valid. Otherwise returns false.
550 550
  */
551 551
 function geodir_get_sort_options($post_type) {
552
-    global $wpdb;
553
-
554
-    if ($post_type != '') {
555
-        $all_postypes = geodir_get_posttypes();
556
-
557
-        if (!in_array($post_type, $all_postypes))
558
-            return false;
559
-
560
-        $sort_field_info = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " WHERE post_type=%s AND is_active=%d AND (sort_asc=1 || sort_desc=1 || field_type='random') AND field_type != 'address' ORDER BY sort_order ASC", array($post_type, 1)));
561
-        /**
562
-         * Filter post sort options.
563
-         *
564
-         * @since 1.0.0
565
-         * @param array $sort_field_info Unfiltered sort field array.
566
-         * @param string $post_type Post type.
567
-         */
568
-        return apply_filters('geodir_get_sort_options', $sort_field_info, $post_type);
569
-    }
552
+	global $wpdb;
553
+
554
+	if ($post_type != '') {
555
+		$all_postypes = geodir_get_posttypes();
556
+
557
+		if (!in_array($post_type, $all_postypes))
558
+			return false;
559
+
560
+		$sort_field_info = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " WHERE post_type=%s AND is_active=%d AND (sort_asc=1 || sort_desc=1 || field_type='random') AND field_type != 'address' ORDER BY sort_order ASC", array($post_type, 1)));
561
+		/**
562
+		 * Filter post sort options.
563
+		 *
564
+		 * @since 1.0.0
565
+		 * @param array $sort_field_info Unfiltered sort field array.
566
+		 * @param string $post_type Post type.
567
+		 */
568
+		return apply_filters('geodir_get_sort_options', $sort_field_info, $post_type);
569
+	}
570 570
 
571 571
 }
572 572
 
@@ -580,7 +580,7 @@  discard block
 block discarded – undo
580 580
  */
581 581
 function geodir_display_sort_options()
582 582
 {
583
-    global $wp_query;
583
+	global $wp_query;
584 584
 	
585 585
 	/**
586 586
 	 * On search pages there should be no sort options, sorting is done by search criteria.
@@ -591,57 +591,57 @@  discard block
 block discarded – undo
591 591
 		return;
592 592
 	}
593 593
 
594
-    $sort_by = '';
594
+	$sort_by = '';
595 595
 
596
-    if (isset($_REQUEST['sort_by'])) $sort_by = $_REQUEST['sort_by'];
596
+	if (isset($_REQUEST['sort_by'])) $sort_by = $_REQUEST['sort_by'];
597 597
 
598
-    $gd_post_type = geodir_get_current_posttype();
598
+	$gd_post_type = geodir_get_current_posttype();
599 599
 
600
-    $sort_options = geodir_get_sort_options($gd_post_type);
600
+	$sort_options = geodir_get_sort_options($gd_post_type);
601 601
 
602 602
 
603
-    $sort_field_options = '';
603
+	$sort_field_options = '';
604 604
 
605
-    if (!empty($sort_options)) {
606
-        foreach ($sort_options as $sort) {
605
+	if (!empty($sort_options)) {
606
+		foreach ($sort_options as $sort) {
607 607
 			$sort = stripslashes_deep($sort); // strip slashes
608 608
 
609
-            $label = __($sort->site_title, 'geodirectory');
609
+			$label = __($sort->site_title, 'geodirectory');
610 610
 
611
-            if ($sort->field_type == 'random') {
612
-                $key = $sort->field_type;
613
-                ($sort_by == $key || ($sort->is_default == '1' && !isset($_REQUEST['sort_by']))) ? $selected = 'selected="selected"' : $selected = '';
614
-                $sort_field_options .= '<option ' . $selected . ' value="' . esc_url( add_query_arg('sort_by', $key) ) . '">' . __($label, 'geodirectory') . '</option>';
615
-            }
611
+			if ($sort->field_type == 'random') {
612
+				$key = $sort->field_type;
613
+				($sort_by == $key || ($sort->is_default == '1' && !isset($_REQUEST['sort_by']))) ? $selected = 'selected="selected"' : $selected = '';
614
+				$sort_field_options .= '<option ' . $selected . ' value="' . esc_url( add_query_arg('sort_by', $key) ) . '">' . __($label, 'geodirectory') . '</option>';
615
+			}
616 616
 
617
-            if ($sort->htmlvar_name == 'comment_count') {
618
-                $sort->htmlvar_name = 'rating_count';
619
-            }
617
+			if ($sort->htmlvar_name == 'comment_count') {
618
+				$sort->htmlvar_name = 'rating_count';
619
+			}
620 620
 
621
-            if ($sort->sort_asc) {
622
-                $key = $sort->htmlvar_name . '_asc';
623
-                $label = $sort->site_title;
624
-                if ($sort->asc_title)
625
-                    $label = $sort->asc_title;
626
-                ($sort_by == $key || ($sort->is_default == '1' && $sort->default_order == $key && !isset($_REQUEST['sort_by']))) ? $selected = 'selected="selected"' : $selected = '';
627
-                $sort_field_options .= '<option ' . $selected . ' value="' . esc_url( add_query_arg('sort_by', $key) ) . '">' . __($label, 'geodirectory') . '</option>';
628
-            }
621
+			if ($sort->sort_asc) {
622
+				$key = $sort->htmlvar_name . '_asc';
623
+				$label = $sort->site_title;
624
+				if ($sort->asc_title)
625
+					$label = $sort->asc_title;
626
+				($sort_by == $key || ($sort->is_default == '1' && $sort->default_order == $key && !isset($_REQUEST['sort_by']))) ? $selected = 'selected="selected"' : $selected = '';
627
+				$sort_field_options .= '<option ' . $selected . ' value="' . esc_url( add_query_arg('sort_by', $key) ) . '">' . __($label, 'geodirectory') . '</option>';
628
+			}
629 629
 
630
-            if ($sort->sort_desc) {
631
-                $key = $sort->htmlvar_name . '_desc';
632
-                $label = $sort->site_title;
633
-                if ($sort->desc_title)
634
-                    $label = $sort->desc_title;
635
-                ($sort_by == $key || ($sort->is_default == '1' && $sort->default_order == $key && !isset($_REQUEST['sort_by']))) ? $selected = 'selected="selected"' : $selected = '';
636
-                $sort_field_options .= '<option ' . $selected . ' value="' . esc_url( add_query_arg('sort_by', $key) ) . '">' . __($label, 'geodirectory') . '</option>';
637
-            }
630
+			if ($sort->sort_desc) {
631
+				$key = $sort->htmlvar_name . '_desc';
632
+				$label = $sort->site_title;
633
+				if ($sort->desc_title)
634
+					$label = $sort->desc_title;
635
+				($sort_by == $key || ($sort->is_default == '1' && $sort->default_order == $key && !isset($_REQUEST['sort_by']))) ? $selected = 'selected="selected"' : $selected = '';
636
+				$sort_field_options .= '<option ' . $selected . ' value="' . esc_url( add_query_arg('sort_by', $key) ) . '">' . __($label, 'geodirectory') . '</option>';
637
+			}
638 638
 
639
-        }
640
-    }
639
+		}
640
+	}
641 641
 
642
-    if ($sort_field_options != '') {
642
+	if ($sort_field_options != '') {
643 643
 
644
-        ?>
644
+		?>
645 645
 
646 646
         <div class="geodir-tax-sort">
647 647
 
@@ -650,14 +650,14 @@  discard block
 block discarded – undo
650 650
                 <option
651 651
                     value="<?php echo esc_url( add_query_arg('sort_by', '') );?>" <?php if ($sort_by == '') echo 'selected="selected"';?>><?php _e('Sort By', 'geodirectory');?></option><?php
652 652
 
653
-                echo $sort_field_options;?>
653
+				echo $sort_field_options;?>
654 654
 
655 655
             </select>
656 656
 
657 657
         </div>
658 658
     <?php
659 659
 
660
-    }
660
+	}
661 661
 
662 662
 }
663 663
 
@@ -677,10 +677,10 @@  discard block
 block discarded – undo
677 677
 function geodir_advance_customfields_heading($title, $field_type)
678 678
 {
679 679
 
680
-    if (in_array($field_type, array('multiselect', 'textarea', 'taxonomy'))) {
681
-        $title = '';
682
-    }
683
-    return $title;
680
+	if (in_array($field_type, array('multiselect', 'textarea', 'taxonomy'))) {
681
+		$title = '';
682
+	}
683
+	return $title;
684 684
 }
685 685
 
686 686
 
@@ -697,71 +697,71 @@  discard block
 block discarded – undo
697 697
  * @return string Returns related posts html.
698 698
  */
699 699
 function geodir_related_posts_display($request) {
700
-    if (!empty($request)) {
701
-        $before_title = (isset($request['before_title']) && !empty($request['before_title'])) ? $request['before_title'] : '';
702
-        $after_title = (isset($request['after_title']) && !empty($request['after_title'])) ? $request['after_title'] : '';
703
-
704
-        $title = (isset($request['title']) && !empty($request['title'])) ? $request['title'] : __('Related Listings', 'geodirectory');
705
-        $post_number = (isset($request['post_number']) && !empty($request['post_number'])) ? $request['post_number'] : '5';
706
-        $relate_to = (isset($request['relate_to']) && !empty($request['relate_to'])) ? $request['relate_to'] : 'category';
707
-        $layout = (isset($request['layout']) && !empty($request['layout'])) ? $request['layout'] : 'gridview_onehalf';
708
-        $add_location_filter = (isset($request['add_location_filter']) && !empty($request['add_location_filter'])) ? $request['add_location_filter'] : '0';
709
-        $listing_width = (isset($request['listing_width']) && !empty($request['listing_width'])) ? $request['listing_width'] : '';
710
-        $list_sort = (isset($request['list_sort']) && !empty($request['list_sort'])) ? $request['list_sort'] : 'latest';
711
-        $character_count = (isset($request['character_count']) && !empty($request['character_count'])) ? $request['character_count'] : '';
712
-
713
-        global $wpdb, $post, $gd_session, $related_nearest, $related_parent_lat, $related_parent_lon;
714
-        $related_parent_lat = $post->post_latitude;
715
-        $related_parent_lon = $post->post_longitude;
716
-        $origi_post = $post;
717
-        $post_type = '';
718
-        $post_id = '';
719
-        $category_taxonomy = '';
720
-        $tax_field = 'id';
721
-        $category = array();
722
-
723
-        if (isset($_REQUEST['backandedit'])) {
724
-            $post = (object)$gd_session->get('listing');
725
-            $post_type = $post->listing_type;
726
-            if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '')
727
-                $post_id = $_REQUEST['pid'];
728
-        } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
729
-            $post = geodir_get_post_info($_REQUEST['pid']);
730
-            $post_type = $post->post_type;
731
-            $post_id = $_REQUEST['pid'];
732
-        } elseif (isset($post->post_type) && $post->post_type != '') {
733
-            $post_type = $post->post_type;
734
-            $post_id = $post->ID;
735
-        }
700
+	if (!empty($request)) {
701
+		$before_title = (isset($request['before_title']) && !empty($request['before_title'])) ? $request['before_title'] : '';
702
+		$after_title = (isset($request['after_title']) && !empty($request['after_title'])) ? $request['after_title'] : '';
703
+
704
+		$title = (isset($request['title']) && !empty($request['title'])) ? $request['title'] : __('Related Listings', 'geodirectory');
705
+		$post_number = (isset($request['post_number']) && !empty($request['post_number'])) ? $request['post_number'] : '5';
706
+		$relate_to = (isset($request['relate_to']) && !empty($request['relate_to'])) ? $request['relate_to'] : 'category';
707
+		$layout = (isset($request['layout']) && !empty($request['layout'])) ? $request['layout'] : 'gridview_onehalf';
708
+		$add_location_filter = (isset($request['add_location_filter']) && !empty($request['add_location_filter'])) ? $request['add_location_filter'] : '0';
709
+		$listing_width = (isset($request['listing_width']) && !empty($request['listing_width'])) ? $request['listing_width'] : '';
710
+		$list_sort = (isset($request['list_sort']) && !empty($request['list_sort'])) ? $request['list_sort'] : 'latest';
711
+		$character_count = (isset($request['character_count']) && !empty($request['character_count'])) ? $request['character_count'] : '';
712
+
713
+		global $wpdb, $post, $gd_session, $related_nearest, $related_parent_lat, $related_parent_lon;
714
+		$related_parent_lat = $post->post_latitude;
715
+		$related_parent_lon = $post->post_longitude;
716
+		$origi_post = $post;
717
+		$post_type = '';
718
+		$post_id = '';
719
+		$category_taxonomy = '';
720
+		$tax_field = 'id';
721
+		$category = array();
722
+
723
+		if (isset($_REQUEST['backandedit'])) {
724
+			$post = (object)$gd_session->get('listing');
725
+			$post_type = $post->listing_type;
726
+			if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '')
727
+				$post_id = $_REQUEST['pid'];
728
+		} elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
729
+			$post = geodir_get_post_info($_REQUEST['pid']);
730
+			$post_type = $post->post_type;
731
+			$post_id = $_REQUEST['pid'];
732
+		} elseif (isset($post->post_type) && $post->post_type != '') {
733
+			$post_type = $post->post_type;
734
+			$post_id = $post->ID;
735
+		}
736 736
 
737
-        if ($relate_to == 'category') {
737
+		if ($relate_to == 'category') {
738 738
 
739
-            $category_taxonomy = $post_type . $relate_to;
740
-            if (isset($post->{$category_taxonomy}) && $post->{$category_taxonomy} != '')
741
-                $category = explode(',', trim($post->{$category_taxonomy}, ','));
739
+			$category_taxonomy = $post_type . $relate_to;
740
+			if (isset($post->{$category_taxonomy}) && $post->{$category_taxonomy} != '')
741
+				$category = explode(',', trim($post->{$category_taxonomy}, ','));
742 742
 
743
-        } elseif ($relate_to == 'tags') {
743
+		} elseif ($relate_to == 'tags') {
744 744
 
745
-            $category_taxonomy = $post_type . '_' . $relate_to;
746
-            if ($post->post_tags != '')
747
-                $category = explode(',', trim($post->post_tags, ','));
748
-            $tax_field = 'name';
749
-        }
745
+			$category_taxonomy = $post_type . '_' . $relate_to;
746
+			if ($post->post_tags != '')
747
+				$category = explode(',', trim($post->post_tags, ','));
748
+			$tax_field = 'name';
749
+		}
750 750
 
751
-        /* --- return false in invalid request --- */
752
-        if (empty($category))
753
-            return false;
751
+		/* --- return false in invalid request --- */
752
+		if (empty($category))
753
+			return false;
754 754
 
755
-        $all_postypes = geodir_get_posttypes();
755
+		$all_postypes = geodir_get_posttypes();
756 756
 
757
-        if (!in_array($post_type, $all_postypes))
758
-            return false;
757
+		if (!in_array($post_type, $all_postypes))
758
+			return false;
759 759
 
760
-        /* --- return false in invalid request --- */
760
+		/* --- return false in invalid request --- */
761 761
 
762
-       $location_url = '';
763
-        if ($add_location_filter != '0') {
764
-            $location_url = array();
762
+	   $location_url = '';
763
+		if ($add_location_filter != '0') {
764
+			$location_url = array();
765 765
 			$geodir_show_location_url = get_option('geodir_show_location_url');
766 766
 			
767 767
 			$gd_city = get_query_var('gd_city');
@@ -769,13 +769,13 @@  discard block
 block discarded – undo
769 769
 			if ($gd_city) {
770 770
 				$gd_country = get_query_var('gd_country');
771 771
 				$gd_region = get_query_var('gd_region');
772
-            } else {
773
-                $location = geodir_get_default_location();
772
+			} else {
773
+				$location = geodir_get_default_location();
774 774
 				
775 775
 				$gd_country = isset($location->country_slug) ? $location->country_slug : '';
776 776
 				$gd_region = isset($location->region_slug) ? $location->region_slug : '';
777 777
 				$gd_city = isset($location->city_slug) ? $location->city_slug : '';
778
-            }
778
+			}
779 779
 			
780 780
 			if ($geodir_show_location_url == 'all') {
781 781
 				$location_url[] = $gd_country;
@@ -788,100 +788,100 @@  discard block
 block discarded – undo
788 788
 			
789 789
 			$location_url[] = $gd_city;
790 790
 
791
-            $location_url = implode('/', $location_url);
792
-        }
791
+			$location_url = implode('/', $location_url);
792
+		}
793 793
 
794 794
 
795
-        if (!empty($category)) {
796
-            global $geodir_add_location_url;
797
-            $geodir_add_location_url = '0';
798
-            if ($add_location_filter != '0') {
799
-                $geodir_add_location_url = '1';
800
-            }
801
-            $viewall_url = get_term_link((int)$category[0], $post_type . $category_taxonomy);
802
-            $geodir_add_location_url = NULL;
803
-        }
804
-        ob_start();
805
-        ?>
795
+		if (!empty($category)) {
796
+			global $geodir_add_location_url;
797
+			$geodir_add_location_url = '0';
798
+			if ($add_location_filter != '0') {
799
+				$geodir_add_location_url = '1';
800
+			}
801
+			$viewall_url = get_term_link((int)$category[0], $post_type . $category_taxonomy);
802
+			$geodir_add_location_url = NULL;
803
+		}
804
+		ob_start();
805
+		?>
806 806
 
807 807
 
808 808
         <div class="geodir_locations geodir_location_listing">
809 809
 
810 810
             <?php
811
-            if (isset($request['is_widget']) && $request['is_widget'] == '1') {
812
-                /** geodir_before_title filter Documented in geodirectory_widgets.php */
813
-                $before_title = isset($before_title) ? $before_title : apply_filters('geodir_before_title', '<h3 class="widget-title">');
814
-                /** geodir_after_title filter Documented in geodirectory_widgets.php */
815
-                $after_title = isset($after_title) ? $after_title : apply_filters('geodir_after_title', '</h3>');
816
-                ?>
811
+			if (isset($request['is_widget']) && $request['is_widget'] == '1') {
812
+				/** geodir_before_title filter Documented in geodirectory_widgets.php */
813
+				$before_title = isset($before_title) ? $before_title : apply_filters('geodir_before_title', '<h3 class="widget-title">');
814
+				/** geodir_after_title filter Documented in geodirectory_widgets.php */
815
+				$after_title = isset($after_title) ? $after_title : apply_filters('geodir_after_title', '</h3>');
816
+				?>
817 817
                 <div class="location_list_heading clearfix">
818 818
                     <?php echo $before_title . $title . $after_title; ?>
819 819
                 </div>
820 820
             <?php
821
-            }
822
-            $query_args = array(
823
-                'posts_per_page' => $post_number,
824
-                'is_geodir_loop' => true,
825
-                'gd_location' => ($add_location_filter) ? true : false,
826
-                'post_type' => $post_type,
827
-                'order_by' => $list_sort,
828
-                'post__not_in' => array($post_id),
829
-                'excerpt_length' => $character_count,
830
-                'related_listings' => true
831
-            );
821
+			}
822
+			$query_args = array(
823
+				'posts_per_page' => $post_number,
824
+				'is_geodir_loop' => true,
825
+				'gd_location' => ($add_location_filter) ? true : false,
826
+				'post_type' => $post_type,
827
+				'order_by' => $list_sort,
828
+				'post__not_in' => array($post_id),
829
+				'excerpt_length' => $character_count,
830
+				'related_listings' => true
831
+			);
832 832
 
833
-            $tax_query = array('taxonomy' => $category_taxonomy,
834
-                'field' => $tax_field,
835
-                'terms' => $category
836
-            );
833
+			$tax_query = array('taxonomy' => $category_taxonomy,
834
+				'field' => $tax_field,
835
+				'terms' => $category
836
+			);
837 837
 
838
-            $query_args['tax_query'] = array($tax_query);
838
+			$query_args['tax_query'] = array($tax_query);
839 839
 
840 840
 
841
-            global $gridview_columns, $post;
841
+			global $gridview_columns, $post;
842 842
 
843 843
 
844
-            query_posts($query_args);
844
+			query_posts($query_args);
845 845
 
846
-            if (strstr($layout, 'gridview')) {
847
-                $listing_view_exp = explode('_', $layout);
848
-                $gridview_columns = $layout;
849
-                $layout = $listing_view_exp[0];
850
-            } else if ($layout == 'list') {
851
-                $gridview_columns = '';
852
-            }
853
-            $related_posts = true;
846
+			if (strstr($layout, 'gridview')) {
847
+				$listing_view_exp = explode('_', $layout);
848
+				$gridview_columns = $layout;
849
+				$layout = $listing_view_exp[0];
850
+			} else if ($layout == 'list') {
851
+				$gridview_columns = '';
852
+			}
853
+			$related_posts = true;
854 854
 
855
-            $related_nearest = false;
856
-            if ($list_sort == 'nearest') {
857
-                $related_nearest = true;
858
-            }
855
+			$related_nearest = false;
856
+			if ($list_sort == 'nearest') {
857
+				$related_nearest = true;
858
+			}
859 859
 
860 860
 
861
-            /**
862
-             * Filters related listing listview template.
863
-             *
864
-             * @since 1.0.0
865
-             */
866
-            $template = apply_filters("geodir_template_part-related-listing-listview", geodir_locate_template('listing-listview'));
861
+			/**
862
+			 * Filters related listing listview template.
863
+			 *
864
+			 * @since 1.0.0
865
+			 */
866
+			$template = apply_filters("geodir_template_part-related-listing-listview", geodir_locate_template('listing-listview'));
867 867
 
868
-            /**
869
-             * Includes related listing listview template.
870
-             *
871
-             * @since 1.0.0
872
-             */
873
-            include($template);
868
+			/**
869
+			 * Includes related listing listview template.
870
+			 *
871
+			 * @since 1.0.0
872
+			 */
873
+			include($template);
874 874
 
875
-            wp_reset_query();
876
-            $post = $origi_post;
877
-            $related_nearest = false;
878
-            ?>
875
+			wp_reset_query();
876
+			$post = $origi_post;
877
+			$related_nearest = false;
878
+			?>
879 879
 
880 880
         </div>
881 881
         <?php
882
-        return $html = ob_get_clean();
882
+		return $html = ob_get_clean();
883 883
 
884
-    }
884
+	}
885 885
 
886 886
 }
887 887
 
@@ -897,17 +897,17 @@  discard block
 block discarded – undo
897 897
  */
898 898
 function geodir_category_count_script()
899 899
 {
900
-    global $geodir_post_category_str;
900
+	global $geodir_post_category_str;
901 901
 
902
-    if (!empty($geodir_post_category_str)) {
903
-        $geodir_post_category_str = serialize($geodir_post_category_str);
904
-    }
902
+	if (!empty($geodir_post_category_str)) {
903
+		$geodir_post_category_str = serialize($geodir_post_category_str);
904
+	}
905 905
 
906
-    $all_var['post_category_array'] = html_entity_decode((string)$geodir_post_category_str, ENT_QUOTES, 'UTF-8');
907
-    $script = "var post_category_array = " . json_encode($all_var) . ';';
908
-    echo '<script>';
909
-    echo $script;
910
-    echo '</script>';
906
+	$all_var['post_category_array'] = html_entity_decode((string)$geodir_post_category_str, ENT_QUOTES, 'UTF-8');
907
+	$script = "var post_category_array = " . json_encode($all_var) . ';';
908
+	echo '<script>';
909
+	echo $script;
910
+	echo '</script>';
911 911
 
912 912
 }
913 913
 
@@ -920,16 +920,16 @@  discard block
 block discarded – undo
920 920
  */
921 921
 function geodir_get_map_default_language()
922 922
 {
923
-    $geodir_default_map_language = get_option('geodir_default_map_language');
924
-    if (empty($geodir_default_map_language))
925
-        $geodir_default_map_language = 'en';
926
-    /**
927
-     * Filter default map language.
928
-     *
929
-     * @since 1.0.0
930
-     * @param string $geodir_default_map_language Default map language.
931
-     */
932
-    return apply_filters('geodir_default_map_language', $geodir_default_map_language);
923
+	$geodir_default_map_language = get_option('geodir_default_map_language');
924
+	if (empty($geodir_default_map_language))
925
+		$geodir_default_map_language = 'en';
926
+	/**
927
+	 * Filter default map language.
928
+	 *
929
+	 * @since 1.0.0
930
+	 * @param string $geodir_default_map_language Default map language.
931
+	 */
932
+	return apply_filters('geodir_default_map_language', $geodir_default_map_language);
933 933
 }
934 934
 
935 935
 /**
@@ -941,14 +941,14 @@  discard block
 block discarded – undo
941 941
  */
942 942
 function geodir_get_map_api_key()
943 943
 {
944
-    $key = get_option('geodir_google_api_key');
945
-    /**
946
-     * Filter Google maps api key.
947
-     *
948
-     * @since 1.6.4
949
-     * @param string $key Google maps api key.
950
-     */
951
-    return apply_filters('geodir_google_api_key', $key);
944
+	$key = get_option('geodir_google_api_key');
945
+	/**
946
+	 * Filter Google maps api key.
947
+	 *
948
+	 * @since 1.6.4
949
+	 * @param string $key Google maps api key.
950
+	 */
951
+	return apply_filters('geodir_google_api_key', $key);
952 952
 }
953 953
 
954 954
 
@@ -965,12 +965,12 @@  discard block
 block discarded – undo
965 965
  */
966 966
 function geodir_add_meta_keywords()
967 967
 {
968
-    global $wp, $post, $wp_query, $wpdb, $geodir_addon_list;
968
+	global $wp, $post, $wp_query, $wpdb, $geodir_addon_list;
969 969
 
970
-    $is_geodir_page = geodir_is_geodir_page();
971
-    if (!$is_geodir_page) {
972
-        return;
973
-    }// if non GD page, bail
970
+	$is_geodir_page = geodir_is_geodir_page();
971
+	if (!$is_geodir_page) {
972
+		return;
973
+	}// if non GD page, bail
974 974
 
975 975
 	$use_gd_meta = true;
976 976
 	if (class_exists('WPSEO_Frontend') || class_exists('All_in_One_SEO_Pack')) {
@@ -985,182 +985,182 @@  discard block
 block discarded – undo
985 985
 		return;
986 986
 	}// bail if Yoast Wordpress SEO or All_in_One_SEO_Pack active.
987 987
 
988
-    $current_term = $wp_query->get_queried_object();
988
+	$current_term = $wp_query->get_queried_object();
989 989
 
990
-    $all_postypes = geodir_get_posttypes();
990
+	$all_postypes = geodir_get_posttypes();
991 991
 
992
-    $geodir_taxonomies = geodir_get_taxonomies('', true);
992
+	$geodir_taxonomies = geodir_get_taxonomies('', true);
993 993
 
994
-    $meta_desc = '';
995
-    $meta_key = '';
996
-    if (isset($current_term->ID) && $current_term->ID == geodir_location_page_id()) {
997
-        /**
998
-         * Filter SEO meta location description.
999
-         *
1000
-         * @since 1.0.0
1001
-         */
1002
-        $meta_desc = apply_filters('geodir_seo_meta_location_description', '');
1003
-        $meta_desc .= '';
1004
-    }
1005
-    if (have_posts() && is_single() OR is_page()) {
1006
-        while (have_posts()) {
1007
-            the_post();
1008
-
1009
-            if (has_excerpt()) {
1010
-                $out_excerpt = strip_tags(strip_shortcodes(get_the_excerpt()));
1011
-                if (empty($out_excerpt)) {
1012
-                    $out_excerpt = strip_tags(do_shortcode(get_the_excerpt()));
1013
-                }
1014
-                $out_excerpt = str_replace(array("\r\n", "\r", "\n"), "", $out_excerpt);
1015
-            } else {
1016
-                $out_excerpt = str_replace(array("\r\n", "\r", "\n"), "", $post->post_content);
1017
-                $out_excerpt = strip_tags(strip_shortcodes($out_excerpt));
1018
-                if (empty($out_excerpt)) {
1019
-                    $out_excerpt = strip_tags(do_shortcode($out_excerpt)); // parse short code from content
1020
-                }
1021
-                $out_excerpt = trim(wp_trim_words($out_excerpt, 35, ''), '.!?,;:-');
1022
-            }
994
+	$meta_desc = '';
995
+	$meta_key = '';
996
+	if (isset($current_term->ID) && $current_term->ID == geodir_location_page_id()) {
997
+		/**
998
+		 * Filter SEO meta location description.
999
+		 *
1000
+		 * @since 1.0.0
1001
+		 */
1002
+		$meta_desc = apply_filters('geodir_seo_meta_location_description', '');
1003
+		$meta_desc .= '';
1004
+	}
1005
+	if (have_posts() && is_single() OR is_page()) {
1006
+		while (have_posts()) {
1007
+			the_post();
1008
+
1009
+			if (has_excerpt()) {
1010
+				$out_excerpt = strip_tags(strip_shortcodes(get_the_excerpt()));
1011
+				if (empty($out_excerpt)) {
1012
+					$out_excerpt = strip_tags(do_shortcode(get_the_excerpt()));
1013
+				}
1014
+				$out_excerpt = str_replace(array("\r\n", "\r", "\n"), "", $out_excerpt);
1015
+			} else {
1016
+				$out_excerpt = str_replace(array("\r\n", "\r", "\n"), "", $post->post_content);
1017
+				$out_excerpt = strip_tags(strip_shortcodes($out_excerpt));
1018
+				if (empty($out_excerpt)) {
1019
+					$out_excerpt = strip_tags(do_shortcode($out_excerpt)); // parse short code from content
1020
+				}
1021
+				$out_excerpt = trim(wp_trim_words($out_excerpt, 35, ''), '.!?,;:-');
1022
+			}
1023 1023
 
1024
-            $meta_desc .= $out_excerpt;
1025
-        }
1026
-    } elseif ((is_category() || is_tag()) && isset($current_term->taxonomy) && in_array($current_term->taxonomy, $geodir_taxonomies)) {
1027
-        if (is_category()) {
1028
-            $meta_desc .= __("Posts related to Category:", 'geodirectory') . " " . ucfirst(single_cat_title("", FALSE));
1029
-        } elseif (is_tag()) {
1030
-            $meta_desc .= __("Posts related to Tag:", 'geodirectory') . " " . ucfirst(single_tag_title("", FALSE));
1031
-        }
1032
-    } elseif (isset($current_term->taxonomy) && in_array($current_term->taxonomy, $geodir_taxonomies)) {
1033
-        $meta_desc .= isset($current_term->description) ? $current_term->description : '';
1034
-    }
1024
+			$meta_desc .= $out_excerpt;
1025
+		}
1026
+	} elseif ((is_category() || is_tag()) && isset($current_term->taxonomy) && in_array($current_term->taxonomy, $geodir_taxonomies)) {
1027
+		if (is_category()) {
1028
+			$meta_desc .= __("Posts related to Category:", 'geodirectory') . " " . ucfirst(single_cat_title("", FALSE));
1029
+		} elseif (is_tag()) {
1030
+			$meta_desc .= __("Posts related to Tag:", 'geodirectory') . " " . ucfirst(single_tag_title("", FALSE));
1031
+		}
1032
+	} elseif (isset($current_term->taxonomy) && in_array($current_term->taxonomy, $geodir_taxonomies)) {
1033
+		$meta_desc .= isset($current_term->description) ? $current_term->description : '';
1034
+	}
1035 1035
 
1036 1036
 
1037
-    $geodir_post_type = geodir_get_current_posttype();
1038
-    $geodir_post_type_info = get_post_type_object($geodir_post_type);
1039
-    $geodir_is_page_listing = geodir_is_page('listing') ? true : false;
1040
-
1041
-    $category_taxonomy = geodir_get_taxonomies($geodir_post_type);
1042
-    $tag_taxonomy = geodir_get_taxonomies($geodir_post_type, true);
1043
-
1044
-    $geodir_is_category = isset($category_taxonomy[0]) && get_query_var($category_taxonomy[0]) ? get_query_var($category_taxonomy[0]) : false;
1045
-    $geodir_is_tag = isset($tag_taxonomy[0]) && get_query_var($tag_taxonomy[0]) ? true : false;
1046
-
1047
-    $geodir_is_search = geodir_is_page('search') ? true : false;
1048
-    $geodir_is_location = geodir_is_page('location') ? true : false;
1049
-    $geodir_location_manager = isset($geodir_addon_list['geodir_location_manager']) && $geodir_addon_list['geodir_location_manager'] = 'yes' ? true : false;
1050
-    $godir_location_terms = geodir_get_current_location_terms('query_vars');
1051
-    $gd_city = $geodir_location_manager && isset($godir_location_terms['gd_city']) ? $godir_location_terms['gd_city'] : NULL;
1052
-    $gd_region = $geodir_location_manager && isset($godir_location_terms['gd_region']) ? $godir_location_terms['gd_region'] : NULL;
1053
-    $gd_country = $geodir_location_manager && isset($godir_location_terms['gd_country']) ? $godir_location_terms['gd_country'] : NULL;
1054
-    $replace_location = __('Everywhere', 'geodirectory');
1055
-    $location_id = NULL;
1056
-    if ($geodir_location_manager) {
1057
-        $sql = $wpdb->prepare("SELECT location_id FROM " . POST_LOCATION_TABLE . " WHERE city_slug=%s ORDER BY location_id ASC LIMIT 1", array($gd_city));
1058
-        $location_id = (int)$wpdb->get_var($sql);
1059
-        $location_type = geodir_what_is_current_location();
1060
-        if ($location_type == 'city') {
1061
-            $replace_location = geodir_get_current_location(array('what' => 'city', 'echo' => false));
1062
-        } elseif ($location_type == 'region') {
1063
-            $replace_location = geodir_get_current_location(array('what' => 'region', 'echo' => false));
1064
-        } elseif ($location_type == 'country') {
1065
-            $replace_location = geodir_get_current_location(array('what' => 'country', 'echo' => false));
1066
-            $replace_location = __($replace_location, 'geodirectory');
1067
-        }
1068
-        $country = get_query_var('gd_country');
1069
-        $region = get_query_var('gd_region');
1070
-        $city = get_query_var('gd_city');
1071
-        $current_location = '';
1072
-        if ($country != '') {
1073
-            $current_location = get_actual_location_name('country', $country, true);
1074
-        }
1075
-        if ($region != '') {
1076
-            $current_location = get_actual_location_name('region', $region);
1077
-        }
1078
-        if ($city != '') {
1079
-            $current_location = get_actual_location_name('city', $city);
1080
-        }
1081
-        $replace_location = $current_location != '' ? $current_location : $replace_location;
1082
-    }
1037
+	$geodir_post_type = geodir_get_current_posttype();
1038
+	$geodir_post_type_info = get_post_type_object($geodir_post_type);
1039
+	$geodir_is_page_listing = geodir_is_page('listing') ? true : false;
1040
+
1041
+	$category_taxonomy = geodir_get_taxonomies($geodir_post_type);
1042
+	$tag_taxonomy = geodir_get_taxonomies($geodir_post_type, true);
1043
+
1044
+	$geodir_is_category = isset($category_taxonomy[0]) && get_query_var($category_taxonomy[0]) ? get_query_var($category_taxonomy[0]) : false;
1045
+	$geodir_is_tag = isset($tag_taxonomy[0]) && get_query_var($tag_taxonomy[0]) ? true : false;
1046
+
1047
+	$geodir_is_search = geodir_is_page('search') ? true : false;
1048
+	$geodir_is_location = geodir_is_page('location') ? true : false;
1049
+	$geodir_location_manager = isset($geodir_addon_list['geodir_location_manager']) && $geodir_addon_list['geodir_location_manager'] = 'yes' ? true : false;
1050
+	$godir_location_terms = geodir_get_current_location_terms('query_vars');
1051
+	$gd_city = $geodir_location_manager && isset($godir_location_terms['gd_city']) ? $godir_location_terms['gd_city'] : NULL;
1052
+	$gd_region = $geodir_location_manager && isset($godir_location_terms['gd_region']) ? $godir_location_terms['gd_region'] : NULL;
1053
+	$gd_country = $geodir_location_manager && isset($godir_location_terms['gd_country']) ? $godir_location_terms['gd_country'] : NULL;
1054
+	$replace_location = __('Everywhere', 'geodirectory');
1055
+	$location_id = NULL;
1056
+	if ($geodir_location_manager) {
1057
+		$sql = $wpdb->prepare("SELECT location_id FROM " . POST_LOCATION_TABLE . " WHERE city_slug=%s ORDER BY location_id ASC LIMIT 1", array($gd_city));
1058
+		$location_id = (int)$wpdb->get_var($sql);
1059
+		$location_type = geodir_what_is_current_location();
1060
+		if ($location_type == 'city') {
1061
+			$replace_location = geodir_get_current_location(array('what' => 'city', 'echo' => false));
1062
+		} elseif ($location_type == 'region') {
1063
+			$replace_location = geodir_get_current_location(array('what' => 'region', 'echo' => false));
1064
+		} elseif ($location_type == 'country') {
1065
+			$replace_location = geodir_get_current_location(array('what' => 'country', 'echo' => false));
1066
+			$replace_location = __($replace_location, 'geodirectory');
1067
+		}
1068
+		$country = get_query_var('gd_country');
1069
+		$region = get_query_var('gd_region');
1070
+		$city = get_query_var('gd_city');
1071
+		$current_location = '';
1072
+		if ($country != '') {
1073
+			$current_location = get_actual_location_name('country', $country, true);
1074
+		}
1075
+		if ($region != '') {
1076
+			$current_location = get_actual_location_name('region', $region);
1077
+		}
1078
+		if ($city != '') {
1079
+			$current_location = get_actual_location_name('city', $city);
1080
+		}
1081
+		$replace_location = $current_location != '' ? $current_location : $replace_location;
1082
+	}
1083 1083
 
1084
-    $geodir_meta_keys = '';
1085
-    $geodir_meta_desc = '';
1086
-    if ($is_geodir_page && !empty($geodir_post_type_info)) {
1087
-        if ($geodir_is_page_listing || $geodir_is_search || geodir_is_page('add-listing')) {
1088
-            $geodir_meta_keys = isset($geodir_post_type_info->seo['meta_keyword']) && $geodir_post_type_info->seo['meta_keyword'] != '' ? $geodir_post_type_info->seo['meta_keyword'] : $geodir_meta_keys;
1089
-
1090
-            $geodir_meta_desc = isset($geodir_post_type_info->description) ? $geodir_post_type_info->description : $geodir_meta_desc;
1091
-            $geodir_meta_desc = isset($geodir_post_type_info->seo['meta_description']) && $geodir_post_type_info->seo['meta_description'] != '' ? $geodir_post_type_info->seo['meta_description'] : $geodir_meta_desc;
1092
-
1093
-            if ($geodir_is_category) {
1094
-                $category = $geodir_is_category ? get_term_by('slug', $geodir_is_category, $category_taxonomy[0]) : NULL;
1095
-                if (isset($category->term_id) && !empty($category->term_id)) {
1096
-                    $category_id = $category->term_id;
1097
-                    $category_desc = trim($category->description) != '' ? trim($category->description) : get_tax_meta($category_id, 'ct_cat_top_desc', false, $geodir_post_type);
1098
-                    if ($location_id) {
1099
-                        $option_name = 'geodir_cat_loc_' . $geodir_post_type . '_' . $category_id;
1100
-                        $cat_loc_option = get_option($option_name);
1101
-
1102
-                        $gd_cat_loc_default = !empty($cat_loc_option) && isset($cat_loc_option['gd_cat_loc_default']) && $cat_loc_option['gd_cat_loc_default'] > 0 ? true : false;
1103
-                        if (!$gd_cat_loc_default) {
1104
-                            $option_name = 'geodir_cat_loc_' . $geodir_post_type . '_' . $category_id . '_' . $location_id;
1105
-                            $option = get_option($option_name);
1106
-                            $category_desc = isset($option['gd_cat_loc_desc']) && trim($option['gd_cat_loc_desc']) != '' ? trim($option['gd_cat_loc_desc']) : $category_desc;
1107
-                        }
1108
-                    }
1109
-                    $geodir_meta_desc = __("Posts related to Category:", 'geodirectory') . " " . ucfirst(single_cat_title("", FALSE)) . '. ' . $category_desc;
1110
-                }
1111
-            } else if ($geodir_is_tag) {
1112
-                $geodir_meta_desc = __("Posts related to Tag:", 'geodirectory') . " " . ucfirst(single_tag_title("", FALSE)) . '. ' . $geodir_meta_desc;
1113
-            }
1114
-        }
1115
-    }
1084
+	$geodir_meta_keys = '';
1085
+	$geodir_meta_desc = '';
1086
+	if ($is_geodir_page && !empty($geodir_post_type_info)) {
1087
+		if ($geodir_is_page_listing || $geodir_is_search || geodir_is_page('add-listing')) {
1088
+			$geodir_meta_keys = isset($geodir_post_type_info->seo['meta_keyword']) && $geodir_post_type_info->seo['meta_keyword'] != '' ? $geodir_post_type_info->seo['meta_keyword'] : $geodir_meta_keys;
1089
+
1090
+			$geodir_meta_desc = isset($geodir_post_type_info->description) ? $geodir_post_type_info->description : $geodir_meta_desc;
1091
+			$geodir_meta_desc = isset($geodir_post_type_info->seo['meta_description']) && $geodir_post_type_info->seo['meta_description'] != '' ? $geodir_post_type_info->seo['meta_description'] : $geodir_meta_desc;
1092
+
1093
+			if ($geodir_is_category) {
1094
+				$category = $geodir_is_category ? get_term_by('slug', $geodir_is_category, $category_taxonomy[0]) : NULL;
1095
+				if (isset($category->term_id) && !empty($category->term_id)) {
1096
+					$category_id = $category->term_id;
1097
+					$category_desc = trim($category->description) != '' ? trim($category->description) : get_tax_meta($category_id, 'ct_cat_top_desc', false, $geodir_post_type);
1098
+					if ($location_id) {
1099
+						$option_name = 'geodir_cat_loc_' . $geodir_post_type . '_' . $category_id;
1100
+						$cat_loc_option = get_option($option_name);
1101
+
1102
+						$gd_cat_loc_default = !empty($cat_loc_option) && isset($cat_loc_option['gd_cat_loc_default']) && $cat_loc_option['gd_cat_loc_default'] > 0 ? true : false;
1103
+						if (!$gd_cat_loc_default) {
1104
+							$option_name = 'geodir_cat_loc_' . $geodir_post_type . '_' . $category_id . '_' . $location_id;
1105
+							$option = get_option($option_name);
1106
+							$category_desc = isset($option['gd_cat_loc_desc']) && trim($option['gd_cat_loc_desc']) != '' ? trim($option['gd_cat_loc_desc']) : $category_desc;
1107
+						}
1108
+					}
1109
+					$geodir_meta_desc = __("Posts related to Category:", 'geodirectory') . " " . ucfirst(single_cat_title("", FALSE)) . '. ' . $category_desc;
1110
+				}
1111
+			} else if ($geodir_is_tag) {
1112
+				$geodir_meta_desc = __("Posts related to Tag:", 'geodirectory') . " " . ucfirst(single_tag_title("", FALSE)) . '. ' . $geodir_meta_desc;
1113
+			}
1114
+		}
1115
+	}
1116 1116
 
1117 1117
 
1118
-    $gd_page = '';
1119
-    if(geodir_is_page('home')){
1120
-        $gd_page = 'home';
1121
-        $meta_desc = (get_option('geodir_meta_desc_homepage')) ? get_option('geodir_meta_desc_homepage') : $meta_desc;
1122
-    }
1123
-    elseif(geodir_is_page('detail')){
1124
-        $gd_page = 'detail';
1125
-        $meta_desc = (get_option('geodir_meta_desc_detail')) ? get_option('geodir_meta_desc_detail') : $meta_desc;
1126
-    }
1127
-    elseif(geodir_is_page('pt')){
1128
-        $gd_page = 'pt';
1129
-        $meta_desc = (get_option('geodir_meta_desc_pt')) ? get_option('geodir_meta_desc_pt') : $meta_desc;
1130
-    }
1131
-    elseif(geodir_is_page('listing')){
1132
-        $gd_page = 'listing';
1133
-        $meta_desc = (get_option('geodir_meta_desc_listing')) ? get_option('geodir_meta_desc_listing') : $meta_desc;
1134
-    }
1135
-    elseif(geodir_is_page('location')){
1136
-        $gd_page = 'location';
1137
-        $meta_desc = (get_option('geodir_meta_desc_location')) ? get_option('geodir_meta_desc_location') : $meta_desc;
1138
-        $meta_desc = apply_filters('geodir_seo_meta_location_description', $meta_desc);
1118
+	$gd_page = '';
1119
+	if(geodir_is_page('home')){
1120
+		$gd_page = 'home';
1121
+		$meta_desc = (get_option('geodir_meta_desc_homepage')) ? get_option('geodir_meta_desc_homepage') : $meta_desc;
1122
+	}
1123
+	elseif(geodir_is_page('detail')){
1124
+		$gd_page = 'detail';
1125
+		$meta_desc = (get_option('geodir_meta_desc_detail')) ? get_option('geodir_meta_desc_detail') : $meta_desc;
1126
+	}
1127
+	elseif(geodir_is_page('pt')){
1128
+		$gd_page = 'pt';
1129
+		$meta_desc = (get_option('geodir_meta_desc_pt')) ? get_option('geodir_meta_desc_pt') : $meta_desc;
1130
+	}
1131
+	elseif(geodir_is_page('listing')){
1132
+		$gd_page = 'listing';
1133
+		$meta_desc = (get_option('geodir_meta_desc_listing')) ? get_option('geodir_meta_desc_listing') : $meta_desc;
1134
+	}
1135
+	elseif(geodir_is_page('location')){
1136
+		$gd_page = 'location';
1137
+		$meta_desc = (get_option('geodir_meta_desc_location')) ? get_option('geodir_meta_desc_location') : $meta_desc;
1138
+		$meta_desc = apply_filters('geodir_seo_meta_location_description', $meta_desc);
1139 1139
 
1140
-    }
1141
-    elseif(geodir_is_page('search')){
1142
-        $gd_page = 'search';
1143
-        $meta_desc = (get_option('geodir_meta_desc_search')) ? get_option('geodir_meta_desc_search') : $meta_desc;
1144
-    }
1145
-    elseif(geodir_is_page('add-listing')){
1146
-        $gd_page = 'add-listing';
1147
-        $meta_desc = (get_option('geodir_meta_desc_add-listing')) ? get_option('geodir_meta_desc_add-listing') : $meta_desc;
1148
-    }
1149
-    elseif(geodir_is_page('author')){
1150
-        $gd_page = 'author';
1151
-        $meta_desc = (get_option('geodir_meta_desc_author')) ? get_option('geodir_meta_desc_author') : $meta_desc;
1152
-    }
1153
-    elseif(geodir_is_page('login')){
1154
-        $gd_page = 'login';
1155
-        $meta_desc = (get_option('geodir_meta_desc_login')) ? get_option('geodir_meta_desc_login') : $meta_desc;
1156
-    }
1157
-    elseif(geodir_is_page('listing-success')){
1158
-        $gd_page = 'listing-success';
1159
-        $meta_desc = (get_option('geodir_meta_desc_listing-success')) ? get_option('geodir_meta_desc_listing-success') : $meta_desc;
1160
-    }
1140
+	}
1141
+	elseif(geodir_is_page('search')){
1142
+		$gd_page = 'search';
1143
+		$meta_desc = (get_option('geodir_meta_desc_search')) ? get_option('geodir_meta_desc_search') : $meta_desc;
1144
+	}
1145
+	elseif(geodir_is_page('add-listing')){
1146
+		$gd_page = 'add-listing';
1147
+		$meta_desc = (get_option('geodir_meta_desc_add-listing')) ? get_option('geodir_meta_desc_add-listing') : $meta_desc;
1148
+	}
1149
+	elseif(geodir_is_page('author')){
1150
+		$gd_page = 'author';
1151
+		$meta_desc = (get_option('geodir_meta_desc_author')) ? get_option('geodir_meta_desc_author') : $meta_desc;
1152
+	}
1153
+	elseif(geodir_is_page('login')){
1154
+		$gd_page = 'login';
1155
+		$meta_desc = (get_option('geodir_meta_desc_login')) ? get_option('geodir_meta_desc_login') : $meta_desc;
1156
+	}
1157
+	elseif(geodir_is_page('listing-success')){
1158
+		$gd_page = 'listing-success';
1159
+		$meta_desc = (get_option('geodir_meta_desc_listing-success')) ? get_option('geodir_meta_desc_listing-success') : $meta_desc;
1160
+	}
1161 1161
 
1162 1162
 
1163
-    /*
1163
+	/*
1164 1164
     $geodir_meta_desc = $geodir_meta_desc != '' ? $geodir_meta_desc : $meta_desc;
1165 1165
     if ($geodir_meta_desc != '') {
1166 1166
         $geodir_meta_desc = strip_tags($geodir_meta_desc);
@@ -1173,74 +1173,74 @@  discard block
 block discarded – undo
1173 1173
     */
1174 1174
 
1175 1175
 
1176
-    if ($meta_desc) {
1177
-        $meta_desc = stripslashes_deep($meta_desc);
1178
-        /**
1179
-         * Filter page description to replace variables.
1180
-         *
1181
-         * @since 1.5.4
1182
-         * @param string $title The page description including variables.
1183
-         * @param string $gd_page The GeoDirectory page type if any.
1184
-         */
1185
-        $meta_desc = apply_filters('geodir_seo_meta_description_pre', __($meta_desc, 'geodirectory'),$gd_page,'');
1186
-
1187
-        /**
1188
-         * Filter SEO meta description.
1189
-         *
1190
-         * @since 1.0.0
1191
-         * @param string $meta_desc Meta description content.
1192
-         */
1193
-        echo apply_filters('geodir_seo_meta_description', '<meta name="description" content="' . $meta_desc . '" />', $meta_desc);
1194
-    }
1176
+	if ($meta_desc) {
1177
+		$meta_desc = stripslashes_deep($meta_desc);
1178
+		/**
1179
+		 * Filter page description to replace variables.
1180
+		 *
1181
+		 * @since 1.5.4
1182
+		 * @param string $title The page description including variables.
1183
+		 * @param string $gd_page The GeoDirectory page type if any.
1184
+		 */
1185
+		$meta_desc = apply_filters('geodir_seo_meta_description_pre', __($meta_desc, 'geodirectory'),$gd_page,'');
1186
+
1187
+		/**
1188
+		 * Filter SEO meta description.
1189
+		 *
1190
+		 * @since 1.0.0
1191
+		 * @param string $meta_desc Meta description content.
1192
+		 */
1193
+		echo apply_filters('geodir_seo_meta_description', '<meta name="description" content="' . $meta_desc . '" />', $meta_desc);
1194
+	}
1195 1195
 
1196
-    // meta keywords
1197
-    if (isset($post->post_type) && in_array($post->post_type, $all_postypes)) {
1198
-        $place_tags = wp_get_post_terms($post->ID, $post->post_type . '_tags', array("fields" => "names"));
1199
-        $place_cats = wp_get_post_terms($post->ID, $post->post_type . 'category', array("fields" => "names"));
1200
-
1201
-        $meta_key .= implode(", ", array_merge((array)$place_cats, (array)$place_tags));
1202
-    } else {
1203
-        $posttags = get_the_tags();
1204
-        if ($posttags) {
1205
-            foreach ($posttags as $tag) {
1206
-                $meta_key .= $tag->name . ' ';
1207
-            }
1208
-        } else {
1209
-            $tags = get_tags(array('orderby' => 'count', 'order' => 'DESC'));
1210
-            $xt = 1;
1196
+	// meta keywords
1197
+	if (isset($post->post_type) && in_array($post->post_type, $all_postypes)) {
1198
+		$place_tags = wp_get_post_terms($post->ID, $post->post_type . '_tags', array("fields" => "names"));
1199
+		$place_cats = wp_get_post_terms($post->ID, $post->post_type . 'category', array("fields" => "names"));
1200
+
1201
+		$meta_key .= implode(", ", array_merge((array)$place_cats, (array)$place_tags));
1202
+	} else {
1203
+		$posttags = get_the_tags();
1204
+		if ($posttags) {
1205
+			foreach ($posttags as $tag) {
1206
+				$meta_key .= $tag->name . ' ';
1207
+			}
1208
+		} else {
1209
+			$tags = get_tags(array('orderby' => 'count', 'order' => 'DESC'));
1210
+			$xt = 1;
1211 1211
 
1212
-            foreach ($tags as $tag) {
1213
-                if ($xt <= 20) {
1214
-                    $meta_key .= $tag->name . ", ";
1215
-                }
1212
+			foreach ($tags as $tag) {
1213
+				if ($xt <= 20) {
1214
+					$meta_key .= $tag->name . ", ";
1215
+				}
1216 1216
 
1217
-                $xt++;
1218
-            }
1219
-        }
1220
-    }
1217
+				$xt++;
1218
+			}
1219
+		}
1220
+	}
1221 1221
 
1222
-    $meta_key = $meta_key != '' ? rtrim(trim($meta_key), ",") : $meta_key;
1223
-    $geodir_meta_keys = $geodir_meta_keys != '' ? ($meta_key != '' ? $meta_key . ', ' . $geodir_meta_keys : $geodir_meta_keys) : $meta_key;
1224
-    if ($geodir_meta_keys != '') {
1225
-        $geodir_meta_keys = strip_tags($geodir_meta_keys);
1226
-        $geodir_meta_keys = esc_html($geodir_meta_keys);
1227
-        $geodir_meta_keys = geodir_strtolower($geodir_meta_keys);
1228
-        $geodir_meta_keys = wp_html_excerpt($geodir_meta_keys, 1000, '');
1229
-        $geodir_meta_keys = str_replace('%location%', $replace_location, $geodir_meta_keys);
1222
+	$meta_key = $meta_key != '' ? rtrim(trim($meta_key), ",") : $meta_key;
1223
+	$geodir_meta_keys = $geodir_meta_keys != '' ? ($meta_key != '' ? $meta_key . ', ' . $geodir_meta_keys : $geodir_meta_keys) : $meta_key;
1224
+	if ($geodir_meta_keys != '') {
1225
+		$geodir_meta_keys = strip_tags($geodir_meta_keys);
1226
+		$geodir_meta_keys = esc_html($geodir_meta_keys);
1227
+		$geodir_meta_keys = geodir_strtolower($geodir_meta_keys);
1228
+		$geodir_meta_keys = wp_html_excerpt($geodir_meta_keys, 1000, '');
1229
+		$geodir_meta_keys = str_replace('%location%', $replace_location, $geodir_meta_keys);
1230 1230
 
1231
-        $meta_key = rtrim(trim($geodir_meta_keys), ",");
1232
-    }
1231
+		$meta_key = rtrim(trim($geodir_meta_keys), ",");
1232
+	}
1233 1233
 
1234
-    if ($meta_key) {
1235
-        $meta_key = stripslashes_deep($meta_key);
1236
-        /**
1237
-         * Filter SEO meta keywords.
1238
-         *
1239
-         * @since 1.0.0
1240
-         * @param string $meta_desc Meta keywords.
1241
-         */
1242
-        echo apply_filters('geodir_seo_meta_keywords', '<meta name="keywords" content="' . $meta_key . '" />', $meta_key);
1243
-    }
1234
+	if ($meta_key) {
1235
+		$meta_key = stripslashes_deep($meta_key);
1236
+		/**
1237
+		 * Filter SEO meta keywords.
1238
+		 *
1239
+		 * @since 1.0.0
1240
+		 * @param string $meta_desc Meta keywords.
1241
+		 */
1242
+		echo apply_filters('geodir_seo_meta_keywords', '<meta name="keywords" content="' . $meta_key . '" />', $meta_key);
1243
+	}
1244 1244
 
1245 1245
 }
1246 1246
 
@@ -1255,14 +1255,14 @@  discard block
 block discarded – undo
1255 1255
  */
1256 1256
 function geodir_detail_page_tabs_key_value_array()
1257 1257
 {
1258
-    $geodir_detail_page_tabs_key_value_array = array();
1258
+	$geodir_detail_page_tabs_key_value_array = array();
1259 1259
 
1260
-    $geodir_detail_page_tabs_array = geodir_detail_page_tabs_array();
1260
+	$geodir_detail_page_tabs_array = geodir_detail_page_tabs_array();
1261 1261
 
1262
-    foreach ($geodir_detail_page_tabs_array as $key => $tabs_obj) {
1263
-        $geodir_detail_page_tabs_key_value_array[$key] = $tabs_obj['heading_text'];
1264
-    }
1265
-    return $geodir_detail_page_tabs_key_value_array;
1262
+	foreach ($geodir_detail_page_tabs_array as $key => $tabs_obj) {
1263
+		$geodir_detail_page_tabs_key_value_array[$key] = $tabs_obj['heading_text'];
1264
+	}
1265
+	return $geodir_detail_page_tabs_key_value_array;
1266 1266
 }
1267 1267
 
1268 1268
 /**
@@ -1275,73 +1275,73 @@  discard block
 block discarded – undo
1275 1275
 function geodir_detail_page_tabs_array()
1276 1276
 {
1277 1277
 
1278
-    $arr_tabs = array();
1279
-    /**
1280
-     * Filter detail page tab display.
1281
-     *
1282
-     * @since 1.0.0
1283
-     */
1284
-    $arr_tabs['post_profile'] = array(
1285
-        'heading_text' => __('Profile', 'geodirectory'),
1286
-        'is_active_tab' => true,
1287
-        'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, 'post_profile'),
1288
-        'tab_content' => ''
1289
-    );
1290
-    $arr_tabs['post_info'] = array(
1291
-        'heading_text' => __('More Info', 'geodirectory'),
1292
-        'is_active_tab' => false,
1293
-        'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, 'post_info'),
1294
-        'tab_content' => ''
1295
-    );
1296
-
1297
-    $arr_tabs['post_images'] = array(
1298
-        'heading_text' => __('Photo', 'geodirectory'),
1299
-        'is_active_tab' => false,
1300
-        'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, 'post_images'),
1301
-        'tab_content' => ''
1302
-    );
1303
-
1304
-    $arr_tabs['post_video'] = array(
1305
-        'heading_text' => __('Video', 'geodirectory'),
1306
-        'is_active_tab' => false,
1307
-        'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, 'post_video'),
1308
-        'tab_content' => ''
1309
-    );
1310
-
1311
-    $arr_tabs['special_offers'] = array(
1312
-        'heading_text' => __('Special Offers', 'geodirectory'),
1313
-        'is_active_tab' => false,
1314
-        'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, 'special_offers'),
1315
-        'tab_content' => ''
1316
-    );
1317
-
1318
-    $arr_tabs['post_map'] = array(
1319
-        'heading_text' => __('Map', 'geodirectory'),
1320
-        'is_active_tab' => false,
1321
-        'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, 'post_map'),
1322
-        'tab_content' => ''
1323
-    );
1324
-
1325
-    $arr_tabs['reviews'] = array(
1326
-        'heading_text' => __('Reviews', 'geodirectory'),
1327
-        'is_active_tab' => false,
1328
-        'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, 'reviews'),
1329
-        'tab_content' => 'review display'
1330
-    );
1331
-
1332
-    $arr_tabs['related_listing'] = array(
1333
-        'heading_text' => __('Related Listing', 'geodirectory'),
1334
-        'is_active_tab' => false,
1335
-        'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, 'related_listing'),
1336
-        'tab_content' => ''
1337
-    );
1338
-
1339
-    /**
1340
-     * Filter the tabs array.
1341
-     *
1342
-     * @since 1.0.0
1343
-     */
1344
-    return apply_filters('geodir_detail_page_tab_list_extend', $arr_tabs);
1278
+	$arr_tabs = array();
1279
+	/**
1280
+	 * Filter detail page tab display.
1281
+	 *
1282
+	 * @since 1.0.0
1283
+	 */
1284
+	$arr_tabs['post_profile'] = array(
1285
+		'heading_text' => __('Profile', 'geodirectory'),
1286
+		'is_active_tab' => true,
1287
+		'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, 'post_profile'),
1288
+		'tab_content' => ''
1289
+	);
1290
+	$arr_tabs['post_info'] = array(
1291
+		'heading_text' => __('More Info', 'geodirectory'),
1292
+		'is_active_tab' => false,
1293
+		'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, 'post_info'),
1294
+		'tab_content' => ''
1295
+	);
1296
+
1297
+	$arr_tabs['post_images'] = array(
1298
+		'heading_text' => __('Photo', 'geodirectory'),
1299
+		'is_active_tab' => false,
1300
+		'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, 'post_images'),
1301
+		'tab_content' => ''
1302
+	);
1303
+
1304
+	$arr_tabs['post_video'] = array(
1305
+		'heading_text' => __('Video', 'geodirectory'),
1306
+		'is_active_tab' => false,
1307
+		'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, 'post_video'),
1308
+		'tab_content' => ''
1309
+	);
1310
+
1311
+	$arr_tabs['special_offers'] = array(
1312
+		'heading_text' => __('Special Offers', 'geodirectory'),
1313
+		'is_active_tab' => false,
1314
+		'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, 'special_offers'),
1315
+		'tab_content' => ''
1316
+	);
1317
+
1318
+	$arr_tabs['post_map'] = array(
1319
+		'heading_text' => __('Map', 'geodirectory'),
1320
+		'is_active_tab' => false,
1321
+		'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, 'post_map'),
1322
+		'tab_content' => ''
1323
+	);
1324
+
1325
+	$arr_tabs['reviews'] = array(
1326
+		'heading_text' => __('Reviews', 'geodirectory'),
1327
+		'is_active_tab' => false,
1328
+		'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, 'reviews'),
1329
+		'tab_content' => 'review display'
1330
+	);
1331
+
1332
+	$arr_tabs['related_listing'] = array(
1333
+		'heading_text' => __('Related Listing', 'geodirectory'),
1334
+		'is_active_tab' => false,
1335
+		'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, 'related_listing'),
1336
+		'tab_content' => ''
1337
+	);
1338
+
1339
+	/**
1340
+	 * Filter the tabs array.
1341
+	 *
1342
+	 * @since 1.0.0
1343
+	 */
1344
+	return apply_filters('geodir_detail_page_tab_list_extend', $arr_tabs);
1345 1345
 
1346 1346
 
1347 1347
 }
@@ -1356,15 +1356,15 @@  discard block
 block discarded – undo
1356 1356
  */
1357 1357
 function geodir_detail_page_tabs_list()
1358 1358
 {
1359
-    $tabs_excluded = get_option('geodir_detail_page_tabs_excluded');
1360
-    $tabs_array = geodir_detail_page_tabs_array();
1361
-    if (!empty($tabs_excluded)) {
1362
-        foreach ($tabs_excluded as $tab) {
1363
-            if (array_key_exists($tab, $tabs_array))
1364
-                unset($tabs_array[$tab]);
1365
-        }
1366
-    }
1367
-    return $tabs_array;
1359
+	$tabs_excluded = get_option('geodir_detail_page_tabs_excluded');
1360
+	$tabs_array = geodir_detail_page_tabs_array();
1361
+	if (!empty($tabs_excluded)) {
1362
+		foreach ($tabs_excluded as $tab) {
1363
+			if (array_key_exists($tab, $tabs_array))
1364
+				unset($tabs_array[$tab]);
1365
+		}
1366
+	}
1367
+	return $tabs_array;
1368 1368
 }
1369 1369
 
1370 1370
 
@@ -1382,156 +1382,156 @@  discard block
 block discarded – undo
1382 1382
  */
1383 1383
 function geodir_show_detail_page_tabs()
1384 1384
 {
1385
-    global $post, $post_images, $video, $special_offers, $related_listing, $geodir_post_detail_fields;
1385
+	global $post, $post_images, $video, $special_offers, $related_listing, $geodir_post_detail_fields;
1386 1386
 
1387
-    $post_id = !empty($post) && isset($post->ID) ? (int)$post->ID : 0;
1388
-    $request_post_id = !empty($_REQUEST['p']) ? (int)$_REQUEST['p'] : 0;
1389
-    $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
1387
+	$post_id = !empty($post) && isset($post->ID) ? (int)$post->ID : 0;
1388
+	$request_post_id = !empty($_REQUEST['p']) ? (int)$_REQUEST['p'] : 0;
1389
+	$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
1390 1390
 
1391
-    if ($is_backend_preview && !$post_id > 0 && $request_post_id > 0) {
1392
-        $post = geodir_get_post_info($request_post_id);
1393
-        setup_postdata($post);
1394
-    }
1391
+	if ($is_backend_preview && !$post_id > 0 && $request_post_id > 0) {
1392
+		$post = geodir_get_post_info($request_post_id);
1393
+		setup_postdata($post);
1394
+	}
1395 1395
 
1396
-    $geodir_post_detail_fields = geodir_show_listing_info('detail');
1397
-
1398
-    $arr_detail_page_tabs = geodir_detail_page_tabs_list();// get this sooner so we can get the active tab for the user
1399
-
1400
-    if (geodir_is_page('detail')) {
1401
-        $video = geodir_get_video($post->ID);
1402
-        $special_offers = geodir_get_special_offers($post->ID);
1403
-        $related_listing_array = array();
1404
-        if (get_option('geodir_add_related_listing_posttypes'))
1405
-            $related_listing_array = get_option('geodir_add_related_listing_posttypes');
1406
-
1407
-        $related_listing = '';
1408
-        if (in_array($post->post_type, $related_listing_array) && $arr_detail_page_tabs['related_listing']['is_display']) {
1409
-            $request = array('post_number' => get_option('geodir_related_post_count'),
1410
-                'relate_to' => get_option('geodir_related_post_relate_to'),
1411
-                'layout' => get_option('geodir_related_post_listing_view'),
1412
-                'add_location_filter' => get_option('geodir_related_post_location_filter'),
1413
-                'list_sort' => get_option('geodir_related_post_sortby'),
1414
-                'character_count' => get_option('geodir_related_post_excerpt'));
1415
-
1416
-            if ($post->post_type == 'gd_event' && defined('GDEVENTS_VERSION')) {
1417
-                $related_listing = geodir_get_detail_page_related_events($request);
1418
-            } else {
1419
-                $related_listing = geodir_related_posts_display($request);
1420
-            }
1396
+	$geodir_post_detail_fields = geodir_show_listing_info('detail');
1397
+
1398
+	$arr_detail_page_tabs = geodir_detail_page_tabs_list();// get this sooner so we can get the active tab for the user
1399
+
1400
+	if (geodir_is_page('detail')) {
1401
+		$video = geodir_get_video($post->ID);
1402
+		$special_offers = geodir_get_special_offers($post->ID);
1403
+		$related_listing_array = array();
1404
+		if (get_option('geodir_add_related_listing_posttypes'))
1405
+			$related_listing_array = get_option('geodir_add_related_listing_posttypes');
1406
+
1407
+		$related_listing = '';
1408
+		if (in_array($post->post_type, $related_listing_array) && $arr_detail_page_tabs['related_listing']['is_display']) {
1409
+			$request = array('post_number' => get_option('geodir_related_post_count'),
1410
+				'relate_to' => get_option('geodir_related_post_relate_to'),
1411
+				'layout' => get_option('geodir_related_post_listing_view'),
1412
+				'add_location_filter' => get_option('geodir_related_post_location_filter'),
1413
+				'list_sort' => get_option('geodir_related_post_sortby'),
1414
+				'character_count' => get_option('geodir_related_post_excerpt'));
1415
+
1416
+			if ($post->post_type == 'gd_event' && defined('GDEVENTS_VERSION')) {
1417
+				$related_listing = geodir_get_detail_page_related_events($request);
1418
+			} else {
1419
+				$related_listing = geodir_related_posts_display($request);
1420
+			}
1421 1421
 
1422
-        }
1422
+		}
1423 1423
 
1424
-        $post_images = geodir_get_images($post->ID, 'thumbnail');
1425
-        $thumb_image = '';
1426
-        if (!empty($post_images)) {
1427
-            foreach ($post_images as $image) {
1428
-                $caption = (!empty($image->caption)) ? $image->caption : '';
1429
-                $thumb_image .= '<a href="' . $image->src . '" title="'.$caption.'">';
1430
-                $thumb_image .= geodir_show_image($image, 'thumbnail', true, false);
1431
-                $thumb_image .= '</a>';
1432
-            }
1433
-        }
1424
+		$post_images = geodir_get_images($post->ID, 'thumbnail');
1425
+		$thumb_image = '';
1426
+		if (!empty($post_images)) {
1427
+			foreach ($post_images as $image) {
1428
+				$caption = (!empty($image->caption)) ? $image->caption : '';
1429
+				$thumb_image .= '<a href="' . $image->src . '" title="'.$caption.'">';
1430
+				$thumb_image .= geodir_show_image($image, 'thumbnail', true, false);
1431
+				$thumb_image .= '</a>';
1432
+			}
1433
+		}
1434 1434
 
1435
-        $map_args = array();
1436
-        $map_args['map_canvas_name'] = 'detail_page_map_canvas';
1437
-        $map_args['width'] = '600';
1438
-        $map_args['height'] = '300';
1439
-        if ($post->post_mapzoom) {
1440
-            $map_args['zoom'] = '' . $post->post_mapzoom . '';
1441
-        }
1442
-        $map_args['autozoom'] = false;
1443
-        $map_args['child_collapse'] = '0';
1444
-        $map_args['enable_cat_filters'] = false;
1445
-        $map_args['enable_text_search'] = false;
1446
-        $map_args['enable_post_type_filters'] = false;
1447
-        $map_args['enable_location_filters'] = false;
1448
-        $map_args['enable_jason_on_load'] = true;
1449
-        $map_args['enable_map_direction'] = true;
1450
-        $map_args['map_class_name'] = 'geodir-map-detail-page';
1451
-        $map_args['maptype'] = (!empty($post->post_mapview)) ? $post->post_mapview : 'ROADMAP';
1452
-    } else if (geodir_is_page('preview')) {
1453
-        $video = isset($post->geodir_video) ? $post->geodir_video : '';
1454
-        $special_offers = isset($post->geodir_special_offers) ? $post->geodir_special_offers : '';
1455
-
1456
-        if (isset($post->post_images))
1457
-            $post->post_images = trim($post->post_images, ",");
1458
-
1459
-        if (isset($post->post_images) && !empty($post->post_images))
1460
-            $post_images = explode(",", $post->post_images);
1461
-
1462
-        $thumb_image = '';
1463
-        if (!empty($post_images)) {
1464
-            foreach ($post_images as $image) {
1465
-                if ($image != '') {
1466
-                    $thumb_image .= '<a href="' . $image . '">';
1467
-                    $thumb_image .= geodir_show_image(array('src' => $image), 'thumbnail', true, false);
1468
-                    $thumb_image .= '</a>';
1469
-                }
1470
-            }
1471
-        }
1435
+		$map_args = array();
1436
+		$map_args['map_canvas_name'] = 'detail_page_map_canvas';
1437
+		$map_args['width'] = '600';
1438
+		$map_args['height'] = '300';
1439
+		if ($post->post_mapzoom) {
1440
+			$map_args['zoom'] = '' . $post->post_mapzoom . '';
1441
+		}
1442
+		$map_args['autozoom'] = false;
1443
+		$map_args['child_collapse'] = '0';
1444
+		$map_args['enable_cat_filters'] = false;
1445
+		$map_args['enable_text_search'] = false;
1446
+		$map_args['enable_post_type_filters'] = false;
1447
+		$map_args['enable_location_filters'] = false;
1448
+		$map_args['enable_jason_on_load'] = true;
1449
+		$map_args['enable_map_direction'] = true;
1450
+		$map_args['map_class_name'] = 'geodir-map-detail-page';
1451
+		$map_args['maptype'] = (!empty($post->post_mapview)) ? $post->post_mapview : 'ROADMAP';
1452
+	} else if (geodir_is_page('preview')) {
1453
+		$video = isset($post->geodir_video) ? $post->geodir_video : '';
1454
+		$special_offers = isset($post->geodir_special_offers) ? $post->geodir_special_offers : '';
1455
+
1456
+		if (isset($post->post_images))
1457
+			$post->post_images = trim($post->post_images, ",");
1458
+
1459
+		if (isset($post->post_images) && !empty($post->post_images))
1460
+			$post_images = explode(",", $post->post_images);
1461
+
1462
+		$thumb_image = '';
1463
+		if (!empty($post_images)) {
1464
+			foreach ($post_images as $image) {
1465
+				if ($image != '') {
1466
+					$thumb_image .= '<a href="' . $image . '">';
1467
+					$thumb_image .= geodir_show_image(array('src' => $image), 'thumbnail', true, false);
1468
+					$thumb_image .= '</a>';
1469
+				}
1470
+			}
1471
+		}
1472 1472
 
1473
-        global $map_jason;
1474
-        $marker_json = $post->marker_json != '' ? json_decode($post->marker_json, true) : array();
1475
-        $marker_icon = (!empty($marker_json) && !empty($marker_json['i'])) ? $marker_json['i'] : '';
1476
-        $icon_size = geodir_get_marker_size($marker_icon);
1477
-        $marker_json['w'] = $icon_size['w'];
1478
-        $marker_json['h'] = $icon_size['h'];
1479
-        $map_jason[] = json_encode($marker_json);
1480
-
1481
-        $address_latitude = isset($post->post_latitude) ? $post->post_latitude : '';
1482
-        $address_longitude = isset($post->post_longitude) ? $post->post_longitude : '';
1483
-        $mapview = isset($post->post_mapview) ? $post->post_mapview : '';
1484
-        $mapzoom = isset($post->post_mapzoom) ? $post->post_mapzoom : '';
1485
-        if (!$mapzoom) {
1486
-            $mapzoom = 12;
1487
-        }
1473
+		global $map_jason;
1474
+		$marker_json = $post->marker_json != '' ? json_decode($post->marker_json, true) : array();
1475
+		$marker_icon = (!empty($marker_json) && !empty($marker_json['i'])) ? $marker_json['i'] : '';
1476
+		$icon_size = geodir_get_marker_size($marker_icon);
1477
+		$marker_json['w'] = $icon_size['w'];
1478
+		$marker_json['h'] = $icon_size['h'];
1479
+		$map_jason[] = json_encode($marker_json);
1480
+
1481
+		$address_latitude = isset($post->post_latitude) ? $post->post_latitude : '';
1482
+		$address_longitude = isset($post->post_longitude) ? $post->post_longitude : '';
1483
+		$mapview = isset($post->post_mapview) ? $post->post_mapview : '';
1484
+		$mapzoom = isset($post->post_mapzoom) ? $post->post_mapzoom : '';
1485
+		if (!$mapzoom) {
1486
+			$mapzoom = 12;
1487
+		}
1488 1488
 
1489
-        $map_args = array();
1490
-        $map_args['map_canvas_name'] = 'preview_map_canvas';
1491
-        $map_args['width'] = '950';
1492
-        $map_args['height'] = '300';
1493
-        $map_args['child_collapse'] = '0';
1494
-        $map_args['maptype'] = $mapview;
1495
-        $map_args['autozoom'] = false;
1496
-        $map_args['zoom'] = "$mapzoom";
1497
-        $map_args['latitude'] = $address_latitude;
1498
-        $map_args['longitude'] = $address_longitude;
1499
-        $map_args['enable_cat_filters'] = false;
1500
-        $map_args['enable_text_search'] = false;
1501
-        $map_args['enable_post_type_filters'] = false;
1502
-        $map_args['enable_location_filters'] = false;
1503
-        $map_args['enable_jason_on_load'] = true;
1504
-        $map_args['enable_map_direction'] = true;
1505
-        $map_args['map_class_name'] = 'geodir-map-preview-page';
1506
-    }
1489
+		$map_args = array();
1490
+		$map_args['map_canvas_name'] = 'preview_map_canvas';
1491
+		$map_args['width'] = '950';
1492
+		$map_args['height'] = '300';
1493
+		$map_args['child_collapse'] = '0';
1494
+		$map_args['maptype'] = $mapview;
1495
+		$map_args['autozoom'] = false;
1496
+		$map_args['zoom'] = "$mapzoom";
1497
+		$map_args['latitude'] = $address_latitude;
1498
+		$map_args['longitude'] = $address_longitude;
1499
+		$map_args['enable_cat_filters'] = false;
1500
+		$map_args['enable_text_search'] = false;
1501
+		$map_args['enable_post_type_filters'] = false;
1502
+		$map_args['enable_location_filters'] = false;
1503
+		$map_args['enable_jason_on_load'] = true;
1504
+		$map_args['enable_map_direction'] = true;
1505
+		$map_args['map_class_name'] = 'geodir-map-preview-page';
1506
+	}
1507 1507
 
1508
-    $active_tab = '';
1509
-    $active_tab_name = '';
1510
-    $default_tab = '';
1511
-    $default_tab_name = '';
1512
-    foreach($arr_detail_page_tabs as $tab_index => $tabs){
1513
-        if (isset($tabs['is_active_tab']) && $tabs['is_active_tab'] && !empty($tabs['is_display']) && isset($tabs['heading_text']) && $tabs['heading_text']) {
1514
-            $active_tab = $tab_index;
1515
-            $active_tab_name = __($tabs['heading_text'], 'geodirectory');
1516
-        }
1508
+	$active_tab = '';
1509
+	$active_tab_name = '';
1510
+	$default_tab = '';
1511
+	$default_tab_name = '';
1512
+	foreach($arr_detail_page_tabs as $tab_index => $tabs){
1513
+		if (isset($tabs['is_active_tab']) && $tabs['is_active_tab'] && !empty($tabs['is_display']) && isset($tabs['heading_text']) && $tabs['heading_text']) {
1514
+			$active_tab = $tab_index;
1515
+			$active_tab_name = __($tabs['heading_text'], 'geodirectory');
1516
+		}
1517 1517
         
1518
-        if ($default_tab === '' && !empty($tabs['is_display']) && !empty($tabs['heading_text'])) {
1519
-            $default_tab = $tab_index;
1520
-            $default_tab_name = __($tabs['heading_text'], 'geodirectory');
1521
-        }
1522
-    }
1518
+		if ($default_tab === '' && !empty($tabs['is_display']) && !empty($tabs['heading_text'])) {
1519
+			$default_tab = $tab_index;
1520
+			$default_tab_name = __($tabs['heading_text'], 'geodirectory');
1521
+		}
1522
+	}
1523 1523
     
1524
-    if ($active_tab === '' && $default_tab !== '') { // Make first tab acs a active tab if not any tab is active.
1525
-        if (isset($arr_detail_page_tabs[$active_tab]) && isset($arr_detail_page_tabs[$active_tab]['is_active_tab'])) {
1526
-            $arr_detail_page_tabs[$active_tab]['is_active_tab'] = false;
1527
-        }
1524
+	if ($active_tab === '' && $default_tab !== '') { // Make first tab acs a active tab if not any tab is active.
1525
+		if (isset($arr_detail_page_tabs[$active_tab]) && isset($arr_detail_page_tabs[$active_tab]['is_active_tab'])) {
1526
+			$arr_detail_page_tabs[$active_tab]['is_active_tab'] = false;
1527
+		}
1528 1528
         
1529
-        $arr_detail_page_tabs[$default_tab]['is_active_tab'] = true;
1530
-        $active_tab = $default_tab;
1531
-        $active_tab_name = $default_tab_name;
1532
-    }
1533
-    $tab_list = (get_option('geodir_disable_tabs',false)) ? true : false;
1534
-    ?>
1529
+		$arr_detail_page_tabs[$default_tab]['is_active_tab'] = true;
1530
+		$active_tab = $default_tab;
1531
+		$active_tab_name = $default_tab_name;
1532
+	}
1533
+	$tab_list = (get_option('geodir_disable_tabs',false)) ? true : false;
1534
+	?>
1535 1535
     <div class="geodir-tabs" id="gd-tabs" style="position:relative;">
1536 1536
         <?php if(!$tab_list){ ?>
1537 1537
         <div id="geodir-tab-mobile-menu">
@@ -1541,166 +1541,166 @@  discard block
 block discarded – undo
1541 1541
         </div>
1542 1542
         <dl class="geodir-tab-head">
1543 1543
             <?php
1544
-            }
1545
-            /**
1546
-             * Called before the details page tab list headings, inside the `dl` tag.
1547
-             *
1548
-             * @since 1.0.0
1549
-             * @see 'geodir_after_tab_list'
1550
-             */
1551
-            do_action('geodir_before_tab_list'); ?>
1544
+			}
1545
+			/**
1546
+			 * Called before the details page tab list headings, inside the `dl` tag.
1547
+			 *
1548
+			 * @since 1.0.0
1549
+			 * @see 'geodir_after_tab_list'
1550
+			 */
1551
+			do_action('geodir_before_tab_list'); ?>
1552 1552
             <?php
1553 1553
 
1554
-            foreach ($arr_detail_page_tabs as $tab_index => $detail_page_tab) {
1555
-                if ($detail_page_tab['is_display']) {
1554
+			foreach ($arr_detail_page_tabs as $tab_index => $detail_page_tab) {
1555
+				if ($detail_page_tab['is_display']) {
1556 1556
 
1557
-                    if(!$tab_list) {
1558
-                        ?>
1557
+					if(!$tab_list) {
1558
+						?>
1559 1559
                         <dt></dt> <!-- added to comply with validation -->
1560 1560
                         <dd <?php if ($detail_page_tab['is_active_tab']){ ?>class="geodir-tab-active"<?php } ?> ><a
1561 1561
                                 data-tab="#<?php echo $tab_index; ?>"
1562 1562
                                 data-status="enable"><?php _e($detail_page_tab['heading_text'], 'geodirectory'); ?></a>
1563 1563
                         </dd>
1564 1564
                         <?php
1565
-                    }
1566
-                    ob_start() // start tab content buffering
1567
-                    ?>
1565
+					}
1566
+					ob_start() // start tab content buffering
1567
+					?>
1568 1568
                     <li id="<?php echo $tab_index;?>Tab">
1569 1569
                         <?php if($tab_list){
1570
-                            $tab_title = '<span class="gd-tab-list-title" ><a href="#'.$tab_index.'">'.__($detail_page_tab['heading_text'],'geodirectory').'</a></span><hr />';
1571
-                            /**
1572
-                             * Filter the tab list title html.
1573
-                             *
1574
-                             * @since 1.6.1
1575
-                             * @param string $tab_title The html for the tab title.
1576
-                             * @param string $tab_index The tab index type.
1577
-                             * @param array $detail_page_tab The array of values including title text.
1578
-                             */
1579
-                            echo apply_filters('geodir_tab_list_title',$tab_title ,$tab_index ,$detail_page_tab);
1580
-                        }?>
1570
+							$tab_title = '<span class="gd-tab-list-title" ><a href="#'.$tab_index.'">'.__($detail_page_tab['heading_text'],'geodirectory').'</a></span><hr />';
1571
+							/**
1572
+							 * Filter the tab list title html.
1573
+							 *
1574
+							 * @since 1.6.1
1575
+							 * @param string $tab_title The html for the tab title.
1576
+							 * @param string $tab_index The tab index type.
1577
+							 * @param array $detail_page_tab The array of values including title text.
1578
+							 */
1579
+							echo apply_filters('geodir_tab_list_title',$tab_title ,$tab_index ,$detail_page_tab);
1580
+						}?>
1581 1581
                         <div id="<?php echo $tab_index;?>" class="hash-offset"></div>
1582 1582
                         <?php
1583
-                        /**
1584
-                         * Called before the details tab content is output per tab.
1585
-                         *
1586
-                         * @since 1.0.0
1587
-                         * @param string $tab_index The tab name ID.
1588
-                         */
1589
-                        do_action('geodir_before_tab_content', $tab_index);
1590
-
1591
-                        /**
1592
-                         * Called before the details tab content is output per tab.
1593
-                         *
1594
-                         * Uses dynamic hook name: geodir_before_$tab_index_tab_content
1595
-                         *
1596
-                         * @since 1.0.0
1597
-                         * @todo do we need this if we have the hook above? 'geodir_before_tab_content'
1598
-                         */
1599
-                        do_action('geodir_before_' . $tab_index . '_tab_content');
1600
-                        /// write a code to generate content of each tab
1601
-                        switch ($tab_index) {
1602
-                            case 'post_profile':
1603
-                                /**
1604
-                                 * Called before the listing description content on the details page tab.
1605
-                                 *
1606
-                                 * @since 1.0.0
1607
-                                 */
1608
-                                do_action('geodir_before_description_on_listing_detail');
1609
-                                if (geodir_is_page('detail')) {
1610
-                                    the_content();
1611
-                                } else {
1612
-                                    /** This action is documented in geodirectory_template_actions.php */
1613
-                                    echo apply_filters('the_content', stripslashes($post->post_desc));
1614
-                                }
1615
-
1616
-                                /**
1617
-                                 * Called after the listing description content on the details page tab.
1618
-                                 *
1619
-                                 * @since 1.0.0
1620
-                                 */
1621
-                                do_action('geodir_after_description_on_listing_detail');
1622
-                                break;
1623
-                            case 'post_info':
1624
-                                echo $geodir_post_detail_fields;
1625
-                                break;
1626
-                            case 'post_images':
1627
-                                echo $thumb_image;
1628
-                                break;
1629
-                            case 'post_video':
1630
-                                /** This action is documented in geodirectory_template_actions.php */
1631
-                                echo apply_filters('the_content', stripslashes($video));// we apply the_content filter so oembed works also;
1632
-                                break;
1633
-                            case 'special_offers':
1634
-                                echo apply_filters('gd_special_offers_content', wpautop(stripslashes($special_offers)));
1635
-
1636
-                                break;
1637
-                            case 'post_map':
1638
-                                geodir_draw_map($map_args);
1639
-                                break;
1640
-                            case 'reviews':
1641
-                                comments_template();
1642
-                                break;
1643
-                            case 'related_listing':
1644
-                                echo $related_listing;
1645
-                                break;
1646
-                            default: {
1647
-                                if ((isset($post->{$tab_index}) || (!isset($post->{$tab_index}) && (strpos($tab_index, 'gd_tab_') !== false || $tab_index == 'link_business'))) && !empty($detail_page_tab['tab_content'])) {
1648
-                                    echo $detail_page_tab['tab_content'];
1649
-                                }
1650
-                            }
1651
-                                break;
1652
-                        }
1653
-
1654
-                        /**
1655
-                         * Called after the details tab content is output per tab.
1656
-                         *
1657
-                         * @since 1.0.0
1658
-                         */
1659
-                        do_action('geodir_after_tab_content', $tab_index);
1660
-
1661
-                        /**
1662
-                         * Called after the details tab content is output per tab.
1663
-                         *
1664
-                         * Uses dynamic hook name: geodir_after_$tab_index_tab_content
1665
-                         *
1666
-                         * @since 1.0.0
1667
-                         * @todo do we need this if we have the hook above? 'geodir_after_tab_content'
1668
-                         */
1669
-                        do_action('geodir_after_' . $tab_index . '_tab_content');
1670
-                        ?> </li>
1583
+						/**
1584
+						 * Called before the details tab content is output per tab.
1585
+						 *
1586
+						 * @since 1.0.0
1587
+						 * @param string $tab_index The tab name ID.
1588
+						 */
1589
+						do_action('geodir_before_tab_content', $tab_index);
1590
+
1591
+						/**
1592
+						 * Called before the details tab content is output per tab.
1593
+						 *
1594
+						 * Uses dynamic hook name: geodir_before_$tab_index_tab_content
1595
+						 *
1596
+						 * @since 1.0.0
1597
+						 * @todo do we need this if we have the hook above? 'geodir_before_tab_content'
1598
+						 */
1599
+						do_action('geodir_before_' . $tab_index . '_tab_content');
1600
+						/// write a code to generate content of each tab
1601
+						switch ($tab_index) {
1602
+							case 'post_profile':
1603
+								/**
1604
+								 * Called before the listing description content on the details page tab.
1605
+								 *
1606
+								 * @since 1.0.0
1607
+								 */
1608
+								do_action('geodir_before_description_on_listing_detail');
1609
+								if (geodir_is_page('detail')) {
1610
+									the_content();
1611
+								} else {
1612
+									/** This action is documented in geodirectory_template_actions.php */
1613
+									echo apply_filters('the_content', stripslashes($post->post_desc));
1614
+								}
1615
+
1616
+								/**
1617
+								 * Called after the listing description content on the details page tab.
1618
+								 *
1619
+								 * @since 1.0.0
1620
+								 */
1621
+								do_action('geodir_after_description_on_listing_detail');
1622
+								break;
1623
+							case 'post_info':
1624
+								echo $geodir_post_detail_fields;
1625
+								break;
1626
+							case 'post_images':
1627
+								echo $thumb_image;
1628
+								break;
1629
+							case 'post_video':
1630
+								/** This action is documented in geodirectory_template_actions.php */
1631
+								echo apply_filters('the_content', stripslashes($video));// we apply the_content filter so oembed works also;
1632
+								break;
1633
+							case 'special_offers':
1634
+								echo apply_filters('gd_special_offers_content', wpautop(stripslashes($special_offers)));
1635
+
1636
+								break;
1637
+							case 'post_map':
1638
+								geodir_draw_map($map_args);
1639
+								break;
1640
+							case 'reviews':
1641
+								comments_template();
1642
+								break;
1643
+							case 'related_listing':
1644
+								echo $related_listing;
1645
+								break;
1646
+							default: {
1647
+								if ((isset($post->{$tab_index}) || (!isset($post->{$tab_index}) && (strpos($tab_index, 'gd_tab_') !== false || $tab_index == 'link_business'))) && !empty($detail_page_tab['tab_content'])) {
1648
+									echo $detail_page_tab['tab_content'];
1649
+								}
1650
+							}
1651
+								break;
1652
+						}
1653
+
1654
+						/**
1655
+						 * Called after the details tab content is output per tab.
1656
+						 *
1657
+						 * @since 1.0.0
1658
+						 */
1659
+						do_action('geodir_after_tab_content', $tab_index);
1660
+
1661
+						/**
1662
+						 * Called after the details tab content is output per tab.
1663
+						 *
1664
+						 * Uses dynamic hook name: geodir_after_$tab_index_tab_content
1665
+						 *
1666
+						 * @since 1.0.0
1667
+						 * @todo do we need this if we have the hook above? 'geodir_after_tab_content'
1668
+						 */
1669
+						do_action('geodir_after_' . $tab_index . '_tab_content');
1670
+						?> </li>
1671 1671
                     <?php
1672
-                    /**
1673
-                     * Filter the current tab content.
1674
-                     *
1675
-                     * @since 1.0.0
1676
-                     */
1677
-                    $arr_detail_page_tabs[$tab_index]['tab_content'] = apply_filters("geodir_modify_" . $detail_page_tab['tab_content'] . "_tab_content", ob_get_clean());
1678
-                } // end of if for is_display
1679
-            }// end of foreach
1680
-
1681
-            /**
1682
-             * Called after the details page tab list headings, inside the `dl` tag.
1683
-             *
1684
-             * @since 1.0.0
1685
-             * @see 'geodir_before_tab_list'
1686
-             */
1687
-            do_action('geodir_after_tab_list');
1688
-            ?>
1672
+					/**
1673
+					 * Filter the current tab content.
1674
+					 *
1675
+					 * @since 1.0.0
1676
+					 */
1677
+					$arr_detail_page_tabs[$tab_index]['tab_content'] = apply_filters("geodir_modify_" . $detail_page_tab['tab_content'] . "_tab_content", ob_get_clean());
1678
+				} // end of if for is_display
1679
+			}// end of foreach
1680
+
1681
+			/**
1682
+			 * Called after the details page tab list headings, inside the `dl` tag.
1683
+			 *
1684
+			 * @since 1.0.0
1685
+			 * @see 'geodir_before_tab_list'
1686
+			 */
1687
+			do_action('geodir_after_tab_list');
1688
+			?>
1689 1689
             <?php if(!$tab_list){?></dl><?php }?>
1690 1690
         <ul class="geodir-tabs-content entry-content <?php if($tab_list){?>geodir-tabs-list<?php }?>" style="position:relative;">
1691 1691
             <?php
1692
-            foreach ($arr_detail_page_tabs as $detail_page_tab) {
1693
-                if ($detail_page_tab['is_display'] && !empty($detail_page_tab['tab_content'])) {
1694
-                    echo $detail_page_tab['tab_content'];
1695
-                }// end of if
1696
-            }// end of foreach
1697
-
1698
-            /**
1699
-             * Called after all the tab content is output in `li` tags, called before the closing `ul` tag.
1700
-             *
1701
-             * @since 1.0.0
1702
-             */
1703
-            do_action('geodir_add_tab_content'); ?>
1692
+			foreach ($arr_detail_page_tabs as $detail_page_tab) {
1693
+				if ($detail_page_tab['is_display'] && !empty($detail_page_tab['tab_content'])) {
1694
+					echo $detail_page_tab['tab_content'];
1695
+				}// end of if
1696
+			}// end of foreach
1697
+
1698
+			/**
1699
+			 * Called after all the tab content is output in `li` tags, called before the closing `ul` tag.
1700
+			 *
1701
+			 * @since 1.0.0
1702
+			 */
1703
+			do_action('geodir_add_tab_content'); ?>
1704 1704
         </ul>
1705 1705
         <!--gd-tabs-content ul end-->
1706 1706
     </div>
@@ -1723,7 +1723,7 @@  discard block
 block discarded – undo
1723 1723
         });
1724 1724
     </script>
1725 1725
     <?php
1726
-    }
1726
+	}
1727 1727
 }
1728 1728
 
1729 1729
 /**
@@ -1736,127 +1736,127 @@  discard block
 block discarded – undo
1736 1736
  */
1737 1737
 function geodir_exif($file)
1738 1738
 {
1739
-    if (empty($file) || !is_array($file)) {
1740
-        return $file;
1741
-    }
1739
+	if (empty($file) || !is_array($file)) {
1740
+		return $file;
1741
+	}
1742 1742
     
1743
-    $file_path = !empty($file['tmp_name']) ? sanitize_text_field($file['tmp_name']) : '';
1744
-    if (!($file_path && file_exists($file_path))) {
1745
-        return $file;
1746
-    }
1747
-    $file['file'] = $file_path;
1743
+	$file_path = !empty($file['tmp_name']) ? sanitize_text_field($file['tmp_name']) : '';
1744
+	if (!($file_path && file_exists($file_path))) {
1745
+		return $file;
1746
+	}
1747
+	$file['file'] = $file_path;
1748 1748
     
1749
-    if (!file_is_valid_image($file_path)) {
1750
-        return $file; // Bail if file is not an image.
1751
-    }
1749
+	if (!file_is_valid_image($file_path)) {
1750
+		return $file; // Bail if file is not an image.
1751
+	}
1752 1752
     
1753
-    if (!function_exists('wp_get_image_editor')) {
1754
-        return $file;
1755
-    }
1753
+	if (!function_exists('wp_get_image_editor')) {
1754
+		return $file;
1755
+	}
1756 1756
    
1757
-    $mime_type = $file['type'];
1758
-    $exif = array();
1759
-    if ($mime_type == 'image/jpeg' && function_exists('exif_read_data')) {
1760
-        try {
1761
-            $exif = exif_read_data($file_path);
1762
-        } catch(Exception $e) {
1763
-            $exif = array();
1764
-        }
1765
-    }
1757
+	$mime_type = $file['type'];
1758
+	$exif = array();
1759
+	if ($mime_type == 'image/jpeg' && function_exists('exif_read_data')) {
1760
+		try {
1761
+			$exif = exif_read_data($file_path);
1762
+		} catch(Exception $e) {
1763
+			$exif = array();
1764
+		}
1765
+	}
1766 1766
     
1767
-    $rotate = false;
1768
-    $flip = false;
1769
-    $modify = false;
1770
-    $orientation = 0;
1771
-    if (!empty($exif) && isset($exif['Orientation'])) {
1772
-        switch ((int)$exif['Orientation']) {
1773
-            case 1:
1774
-                // do nothing
1775
-                break;
1776
-            case 2:
1777
-                $flip = array(false, true);
1778
-                $modify = true;
1779
-                break;
1780
-            case 3:
1781
-                $orientation = -180;
1782
-                $rotate = true;
1783
-                $modify = true;
1784
-                break;
1785
-            case 4:
1786
-                $flip = array(true, false);
1787
-                $modify = true;
1788
-                break;
1789
-            case 5:
1790
-                $orientation = -90;
1791
-                $rotate = true;
1792
-                $flip = array(false, true);
1793
-                $modify = true;
1794
-                break;
1795
-            case 6:
1796
-                $orientation = -90;
1797
-                $rotate = true;
1798
-                $modify = true;
1799
-                break;
1800
-            case 7:
1801
-                $orientation = -270;
1802
-                $rotate = true;
1803
-                $flip = array(false, true);
1804
-                $modify = true;
1805
-                break;
1806
-            case 8:
1807
-            case 9:
1808
-                $orientation = -270;
1809
-                $rotate = true;
1810
-                $modify = true;
1811
-                break;
1812
-            default:
1813
-                $orientation = 0;
1814
-                $rotate = true;
1815
-                $modify = true;
1816
-                break;
1817
-        }
1818
-    }
1767
+	$rotate = false;
1768
+	$flip = false;
1769
+	$modify = false;
1770
+	$orientation = 0;
1771
+	if (!empty($exif) && isset($exif['Orientation'])) {
1772
+		switch ((int)$exif['Orientation']) {
1773
+			case 1:
1774
+				// do nothing
1775
+				break;
1776
+			case 2:
1777
+				$flip = array(false, true);
1778
+				$modify = true;
1779
+				break;
1780
+			case 3:
1781
+				$orientation = -180;
1782
+				$rotate = true;
1783
+				$modify = true;
1784
+				break;
1785
+			case 4:
1786
+				$flip = array(true, false);
1787
+				$modify = true;
1788
+				break;
1789
+			case 5:
1790
+				$orientation = -90;
1791
+				$rotate = true;
1792
+				$flip = array(false, true);
1793
+				$modify = true;
1794
+				break;
1795
+			case 6:
1796
+				$orientation = -90;
1797
+				$rotate = true;
1798
+				$modify = true;
1799
+				break;
1800
+			case 7:
1801
+				$orientation = -270;
1802
+				$rotate = true;
1803
+				$flip = array(false, true);
1804
+				$modify = true;
1805
+				break;
1806
+			case 8:
1807
+			case 9:
1808
+				$orientation = -270;
1809
+				$rotate = true;
1810
+				$modify = true;
1811
+				break;
1812
+			default:
1813
+				$orientation = 0;
1814
+				$rotate = true;
1815
+				$modify = true;
1816
+				break;
1817
+		}
1818
+	}
1819 1819
     
1820
-    $quality = null;
1821
-    /**
1822
-     * Filter the image quality.
1823
-     *
1824
-     * @since 1.5.7
1825
-     * @param int|null $quality Image Compression quality between 1-100% scale. Default null.
1826
-     * @param string $quality Image mime type.
1827
-     */
1828
-    $quality = apply_filters('geodir_image_upload_set_quality', $quality, $mime_type);
1829
-    if ($quality !== null) {
1830
-        $modify = true;
1831
-    }
1820
+	$quality = null;
1821
+	/**
1822
+	 * Filter the image quality.
1823
+	 *
1824
+	 * @since 1.5.7
1825
+	 * @param int|null $quality Image Compression quality between 1-100% scale. Default null.
1826
+	 * @param string $quality Image mime type.
1827
+	 */
1828
+	$quality = apply_filters('geodir_image_upload_set_quality', $quality, $mime_type);
1829
+	if ($quality !== null) {
1830
+		$modify = true;
1831
+	}
1832 1832
 
1833
-    if (!$modify) {
1834
-        return $file; // no change
1835
-    }
1833
+	if (!$modify) {
1834
+		return $file; // no change
1835
+	}
1836 1836
 
1837
-    $image = wp_get_image_editor($file_path);
1838
-    if (!is_wp_error($image)) {
1839
-        if ($rotate) {
1840
-            $image->rotate($orientation);
1841
-        }
1837
+	$image = wp_get_image_editor($file_path);
1838
+	if (!is_wp_error($image)) {
1839
+		if ($rotate) {
1840
+			$image->rotate($orientation);
1841
+		}
1842 1842
         
1843
-        if (!empty($flip)) {
1844
-            $image->flip($flip[0], $flip[1]);
1845
-        }
1843
+		if (!empty($flip)) {
1844
+			$image->flip($flip[0], $flip[1]);
1845
+		}
1846 1846
         
1847
-        if ($quality !== null) {
1848
-            $image->set_quality((int)$quality);
1849
-        }
1847
+		if ($quality !== null) {
1848
+			$image->set_quality((int)$quality);
1849
+		}
1850 1850
         
1851
-       $result = $image->save($file_path);
1852
-       if (!is_wp_error($result)) {
1853
-           $file['file'] = $result['path'];
1854
-           $file['tmp_name'] = $result['path'];
1855
-       }
1856
-    }
1851
+	   $result = $image->save($file_path);
1852
+	   if (!is_wp_error($result)) {
1853
+		   $file['file'] = $result['path'];
1854
+		   $file['tmp_name'] = $result['path'];
1855
+	   }
1856
+	}
1857 1857
     
1858
-    // The image orientation is fixed, pass it back for further processing
1859
-    return $file;
1858
+	// The image orientation is fixed, pass it back for further processing
1859
+	return $file;
1860 1860
 }
1861 1861
 
1862 1862
 /**
@@ -1875,138 +1875,138 @@  discard block
 block discarded – undo
1875 1875
  * @return string Returns the recent reviews html.
1876 1876
  */
1877 1877
 function geodir_get_recent_reviews($g_size = 60, $no_comments = 10, $comment_lenth = 60, $show_pass_post = false) {
1878
-    global $wpdb, $tablecomments, $tableposts, $rating_table_name, $gd_session;
1879
-    $tablecomments = $wpdb->comments;
1880
-    $tableposts = $wpdb->posts;
1881
-
1882
-    $comments_echo = '';
1883
-    $city_filter = '';
1884
-    $region_filter = '';
1885
-    $country_filter = '';
1886
-
1887
-    if ($gd_session->get('gd_multi_location')) {
1888
-        if ($gd_ses_country = $gd_session->get('gd_country')) {
1889
-            $country_filter = $wpdb->prepare(" AND r.post_country=%s ", str_replace("-", " ", $gd_ses_country));
1890
-        }
1878
+	global $wpdb, $tablecomments, $tableposts, $rating_table_name, $gd_session;
1879
+	$tablecomments = $wpdb->comments;
1880
+	$tableposts = $wpdb->posts;
1881
+
1882
+	$comments_echo = '';
1883
+	$city_filter = '';
1884
+	$region_filter = '';
1885
+	$country_filter = '';
1886
+
1887
+	if ($gd_session->get('gd_multi_location')) {
1888
+		if ($gd_ses_country = $gd_session->get('gd_country')) {
1889
+			$country_filter = $wpdb->prepare(" AND r.post_country=%s ", str_replace("-", " ", $gd_ses_country));
1890
+		}
1891 1891
 
1892
-        if ($gd_ses_region = $gd_session->get('gd_region')) {
1893
-            $region_filter = $wpdb->prepare(" AND r.post_region=%s ", str_replace("-", " ", $gd_ses_region));
1894
-        }
1892
+		if ($gd_ses_region = $gd_session->get('gd_region')) {
1893
+			$region_filter = $wpdb->prepare(" AND r.post_region=%s ", str_replace("-", " ", $gd_ses_region));
1894
+		}
1895 1895
 
1896
-        if ($gd_ses_city = $gd_session->get('gd_city')) {
1897
-            $city_filter = $wpdb->prepare(" AND r.post_city=%s ", str_replace("-", " ", $gd_ses_city));
1898
-        }
1899
-    }
1896
+		if ($gd_ses_city = $gd_session->get('gd_city')) {
1897
+			$city_filter = $wpdb->prepare(" AND r.post_city=%s ", str_replace("-", " ", $gd_ses_city));
1898
+		}
1899
+	}
1900 1900
 	
1901
-    $review_table = GEODIR_REVIEW_TABLE;
1902
-    $request = "SELECT r.id as ID, r.post_type, r.comment_id as comment_ID, r.post_date as comment_date,r.overall_rating, r.user_id, r.post_id FROM $review_table as r WHERE r.post_status = 1 AND r.status =1 AND r.overall_rating>=1 $country_filter $region_filter $city_filter ORDER BY r.post_date DESC, r.id DESC LIMIT $no_comments";
1903
-
1904
-    $comments = $wpdb->get_results($request);
1905
-
1906
-    foreach ($comments as $comment) {
1907
-        // Set the extra comment info needed.
1908
-        $comment_extra = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID =$comment->comment_ID");
1909
-        //echo "SELECT * FROM $wpdb->comments WHERE comment_ID =$comment->comment_ID";
1910
-        $comment->comment_content = $comment_extra->comment_content;
1911
-        $comment->comment_author = $comment_extra->comment_author;
1912
-        $comment->comment_author_email = $comment_extra->comment_author_email;
1913
-
1914
-        $comment_id = '';
1915
-        $comment_id = $comment->comment_ID;
1916
-        $comment_content = strip_tags($comment->comment_content);
1917
-
1918
-        $comment_content = preg_replace('#(\\[img\\]).+(\\[\\/img\\])#', '', $comment_content);
1919
-
1920
-        $permalink = get_permalink($comment->ID) . "#comment-" . $comment->comment_ID;
1921
-        $comment_author_email = $comment->comment_author_email;
1922
-        $comment_post_ID = $comment->post_id;
1923
-
1924
-        $na = true;
1925
-        if (function_exists('icl_object_id') && icl_object_id($comment_post_ID, $comment->post_type, true)) {
1926
-            $comment_post_ID2 = icl_object_id($comment_post_ID, $comment->post_type, false);
1927
-            if ($comment_post_ID == $comment_post_ID2) {
1928
-            } else {
1929
-                $na = false;
1930
-            }
1931
-        }
1901
+	$review_table = GEODIR_REVIEW_TABLE;
1902
+	$request = "SELECT r.id as ID, r.post_type, r.comment_id as comment_ID, r.post_date as comment_date,r.overall_rating, r.user_id, r.post_id FROM $review_table as r WHERE r.post_status = 1 AND r.status =1 AND r.overall_rating>=1 $country_filter $region_filter $city_filter ORDER BY r.post_date DESC, r.id DESC LIMIT $no_comments";
1903
+
1904
+	$comments = $wpdb->get_results($request);
1905
+
1906
+	foreach ($comments as $comment) {
1907
+		// Set the extra comment info needed.
1908
+		$comment_extra = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID =$comment->comment_ID");
1909
+		//echo "SELECT * FROM $wpdb->comments WHERE comment_ID =$comment->comment_ID";
1910
+		$comment->comment_content = $comment_extra->comment_content;
1911
+		$comment->comment_author = $comment_extra->comment_author;
1912
+		$comment->comment_author_email = $comment_extra->comment_author_email;
1913
+
1914
+		$comment_id = '';
1915
+		$comment_id = $comment->comment_ID;
1916
+		$comment_content = strip_tags($comment->comment_content);
1917
+
1918
+		$comment_content = preg_replace('#(\\[img\\]).+(\\[\\/img\\])#', '', $comment_content);
1919
+
1920
+		$permalink = get_permalink($comment->ID) . "#comment-" . $comment->comment_ID;
1921
+		$comment_author_email = $comment->comment_author_email;
1922
+		$comment_post_ID = $comment->post_id;
1923
+
1924
+		$na = true;
1925
+		if (function_exists('icl_object_id') && icl_object_id($comment_post_ID, $comment->post_type, true)) {
1926
+			$comment_post_ID2 = icl_object_id($comment_post_ID, $comment->post_type, false);
1927
+			if ($comment_post_ID == $comment_post_ID2) {
1928
+			} else {
1929
+				$na = false;
1930
+			}
1931
+		}
1932 1932
 
1933
-        $post_title = get_the_title($comment_post_ID);
1934
-        $permalink = get_permalink($comment_post_ID);
1935
-        $comment_permalink = $permalink . "#comment-" . $comment->comment_ID;
1936
-        $read_more = '<a class="comment_excerpt" href="' . $comment_permalink . '">' . __('Read more', 'geodirectory') . '</a>';
1933
+		$post_title = get_the_title($comment_post_ID);
1934
+		$permalink = get_permalink($comment_post_ID);
1935
+		$comment_permalink = $permalink . "#comment-" . $comment->comment_ID;
1936
+		$read_more = '<a class="comment_excerpt" href="' . $comment_permalink . '">' . __('Read more', 'geodirectory') . '</a>';
1937 1937
 
1938
-        $comment_content_length = strlen($comment_content);
1939
-        if ($comment_content_length > $comment_lenth) {
1940
-            $comment_excerpt = mb_substr($comment_content, 0, $comment_lenth) . '... ' . $read_more;
1941
-        } else {
1942
-            $comment_excerpt = $comment_content;
1943
-        }
1938
+		$comment_content_length = strlen($comment_content);
1939
+		if ($comment_content_length > $comment_lenth) {
1940
+			$comment_excerpt = mb_substr($comment_content, 0, $comment_lenth) . '... ' . $read_more;
1941
+		} else {
1942
+			$comment_excerpt = $comment_content;
1943
+		}
1944 1944
 
1945
-        if ($comment->user_id) {
1946
-            $user_profile_url = get_author_posts_url($comment->user_id);
1947
-        } else {
1948
-            $user_profile_url = '';
1949
-        }
1945
+		if ($comment->user_id) {
1946
+			$user_profile_url = get_author_posts_url($comment->user_id);
1947
+		} else {
1948
+			$user_profile_url = '';
1949
+		}
1950 1950
 
1951
-        if ($comment_id && $na) {
1952
-            $comments_echo .= '<li class="clearfix">';
1953
-            $comments_echo .= "<span class=\"li" . $comment_id . " geodir_reviewer_image\">";
1954
-            if (function_exists('get_avatar')) {
1955
-                if (!isset($comment->comment_type)) {
1956
-                    if ($user_profile_url) {
1957
-                        $comments_echo .= '<a href="' . $user_profile_url . '">';
1958
-                    }
1959
-                    $comments_echo .= get_avatar($comment->comment_author_email, $g_size, geodir_plugin_url() . '/geodirectory-assets/images/gravatar2.png');
1960
-                    if ($user_profile_url) {
1961
-                        $comments_echo .= '</a>';
1962
-                    }
1963
-                } elseif ((isset($comment->comment_type) && $comment->comment_type == 'trackback') || (isset($comment->comment_type) && $comment->comment_type == 'pingback')) {
1964
-                    if ($user_profile_url) {
1965
-                        $comments_echo .= '<a href="' . $user_profile_url . '">';
1966
-                    }
1967
-                    $comments_echo .= get_avatar($comment->comment_author_url, $g_size, geodir_plugin_url() . '/geodirectory-assets/images/gravatar2.png');
1968
-                }
1969
-            } elseif (function_exists('gravatar')) {
1970
-                if ($user_profile_url) {
1971
-                    $comments_echo .= '<a href="' . $user_profile_url . '">';
1972
-                }
1973
-                $comments_echo .= "<img src=\"";
1974
-                if ('' == $comment->comment_type) {
1975
-                    $comments_echo .= gravatar($comment->comment_author_email, $g_size, geodir_plugin_url() . '/geodirectory-assets/images/gravatar2.png');
1976
-                    if ($user_profile_url) {
1977
-                        $comments_echo .= '</a>';
1978
-                    }
1979
-                } elseif (('trackback' == $comment->comment_type) || ('pingback' == $comment->comment_type)) {
1980
-                    if ($user_profile_url) {
1981
-                        $comments_echo .= '<a href="' . $user_profile_url . '">';
1982
-                    }
1983
-                    $comments_echo .= gravatar($comment->comment_author_url, $g_size, geodir_plugin_url() . '/geodirectory-assets/images/gravatar2.png');
1984
-                    if ($user_profile_url) {
1985
-                        $comments_echo .= '</a>';
1986
-                    }
1987
-                }
1988
-                $comments_echo .= "\" alt=\"\" class=\"avatar\" />";
1989
-            }
1951
+		if ($comment_id && $na) {
1952
+			$comments_echo .= '<li class="clearfix">';
1953
+			$comments_echo .= "<span class=\"li" . $comment_id . " geodir_reviewer_image\">";
1954
+			if (function_exists('get_avatar')) {
1955
+				if (!isset($comment->comment_type)) {
1956
+					if ($user_profile_url) {
1957
+						$comments_echo .= '<a href="' . $user_profile_url . '">';
1958
+					}
1959
+					$comments_echo .= get_avatar($comment->comment_author_email, $g_size, geodir_plugin_url() . '/geodirectory-assets/images/gravatar2.png');
1960
+					if ($user_profile_url) {
1961
+						$comments_echo .= '</a>';
1962
+					}
1963
+				} elseif ((isset($comment->comment_type) && $comment->comment_type == 'trackback') || (isset($comment->comment_type) && $comment->comment_type == 'pingback')) {
1964
+					if ($user_profile_url) {
1965
+						$comments_echo .= '<a href="' . $user_profile_url . '">';
1966
+					}
1967
+					$comments_echo .= get_avatar($comment->comment_author_url, $g_size, geodir_plugin_url() . '/geodirectory-assets/images/gravatar2.png');
1968
+				}
1969
+			} elseif (function_exists('gravatar')) {
1970
+				if ($user_profile_url) {
1971
+					$comments_echo .= '<a href="' . $user_profile_url . '">';
1972
+				}
1973
+				$comments_echo .= "<img src=\"";
1974
+				if ('' == $comment->comment_type) {
1975
+					$comments_echo .= gravatar($comment->comment_author_email, $g_size, geodir_plugin_url() . '/geodirectory-assets/images/gravatar2.png');
1976
+					if ($user_profile_url) {
1977
+						$comments_echo .= '</a>';
1978
+					}
1979
+				} elseif (('trackback' == $comment->comment_type) || ('pingback' == $comment->comment_type)) {
1980
+					if ($user_profile_url) {
1981
+						$comments_echo .= '<a href="' . $user_profile_url . '">';
1982
+					}
1983
+					$comments_echo .= gravatar($comment->comment_author_url, $g_size, geodir_plugin_url() . '/geodirectory-assets/images/gravatar2.png');
1984
+					if ($user_profile_url) {
1985
+						$comments_echo .= '</a>';
1986
+					}
1987
+				}
1988
+				$comments_echo .= "\" alt=\"\" class=\"avatar\" />";
1989
+			}
1990 1990
 
1991
-            $comments_echo .= "</span>\n";
1992
-
1993
-            $comments_echo .= '<span class="geodir_reviewer_content">';
1994
-            if($comment->user_id){$comments_echo .= '<a href="'.get_author_posts_url( $comment->user_id ).'">';}
1995
-            $comments_echo .= '<span class="geodir_reviewer_author">' . $comment->comment_author . '</span> ';
1996
-            if($comment->user_id){$comments_echo .= '</a>';}
1997
-            $comments_echo .= '<span class="geodir_reviewer_reviewed">' . __('reviewed', 'geodirectory') . '</span> ';
1998
-            $comments_echo .= '<a href="' . $permalink . '" class="geodir_reviewer_title">' . $post_title . '</a>';
1999
-            $comments_echo .= geodir_get_rating_stars($comment->overall_rating, $comment_post_ID);
2000
-            $comments_echo .= '<p class="geodir_reviewer_text">' . $comment_excerpt . '';
2001
-            //echo preg_replace('#(\\[img\\]).+(\\[\\/img\\])#', '', $comment_excerpt);
2002
-            $comments_echo .= '</p>';
2003
-
2004
-            $comments_echo .= "</span>\n";
2005
-            $comments_echo .= '</li>';
2006
-        }
2007
-    }
1991
+			$comments_echo .= "</span>\n";
1992
+
1993
+			$comments_echo .= '<span class="geodir_reviewer_content">';
1994
+			if($comment->user_id){$comments_echo .= '<a href="'.get_author_posts_url( $comment->user_id ).'">';}
1995
+			$comments_echo .= '<span class="geodir_reviewer_author">' . $comment->comment_author . '</span> ';
1996
+			if($comment->user_id){$comments_echo .= '</a>';}
1997
+			$comments_echo .= '<span class="geodir_reviewer_reviewed">' . __('reviewed', 'geodirectory') . '</span> ';
1998
+			$comments_echo .= '<a href="' . $permalink . '" class="geodir_reviewer_title">' . $post_title . '</a>';
1999
+			$comments_echo .= geodir_get_rating_stars($comment->overall_rating, $comment_post_ID);
2000
+			$comments_echo .= '<p class="geodir_reviewer_text">' . $comment_excerpt . '';
2001
+			//echo preg_replace('#(\\[img\\]).+(\\[\\/img\\])#', '', $comment_excerpt);
2002
+			$comments_echo .= '</p>';
2003
+
2004
+			$comments_echo .= "</span>\n";
2005
+			$comments_echo .= '</li>';
2006
+		}
2007
+	}
2008 2008
 
2009
-    return $comments_echo;
2009
+	return $comments_echo;
2010 2010
 }
2011 2011
 
2012 2012
 /**
@@ -2018,29 +2018,29 @@  discard block
 block discarded – undo
2018 2018
  */
2019 2019
 function geodir_home_map_cats_key_value_array()
2020 2020
 {
2021
-    $post_types = geodir_get_posttypes('object');
2022
-
2023
-    $return = array();
2024
-    if (!empty($post_types)) {
2025
-        foreach ($post_types as $key => $post_type) {
2026
-            $cpt_name = __($post_type->labels->singular_name, 'geodirectory');
2027
-            $post_type_name =   sprintf(__('%s Categories', 'geodirectory'),$cpt_name);
2028
-            $taxonomies = geodir_get_taxonomies($key);
2029
-            $cat_taxonomy = !empty($taxonomies[0]) ? $taxonomies[0] : NULL;
2030
-            $cat_terms = $cat_taxonomy ? get_terms($cat_taxonomy) : NULL;
2031
-
2032
-            if (!empty($cat_terms)) {
2033
-                $return['optgroup_start-' . $key] = $post_type_name;
2034
-
2035
-                foreach ($cat_terms as $cat_term) {
2036
-                    $return[$key . '_' . $cat_term->term_id] = $cat_term->name;
2037
-                }
2021
+	$post_types = geodir_get_posttypes('object');
2038 2022
 
2039
-                $return['optgroup_end-' . $key] = $post_type_name;
2040
-            }
2041
-        }
2042
-    }
2043
-    return $return;
2023
+	$return = array();
2024
+	if (!empty($post_types)) {
2025
+		foreach ($post_types as $key => $post_type) {
2026
+			$cpt_name = __($post_type->labels->singular_name, 'geodirectory');
2027
+			$post_type_name =   sprintf(__('%s Categories', 'geodirectory'),$cpt_name);
2028
+			$taxonomies = geodir_get_taxonomies($key);
2029
+			$cat_taxonomy = !empty($taxonomies[0]) ? $taxonomies[0] : NULL;
2030
+			$cat_terms = $cat_taxonomy ? get_terms($cat_taxonomy) : NULL;
2031
+
2032
+			if (!empty($cat_terms)) {
2033
+				$return['optgroup_start-' . $key] = $post_type_name;
2034
+
2035
+				foreach ($cat_terms as $cat_term) {
2036
+					$return[$key . '_' . $cat_term->term_id] = $cat_term->name;
2037
+				}
2038
+
2039
+				$return['optgroup_end-' . $key] = $post_type_name;
2040
+			}
2041
+		}
2042
+	}
2043
+	return $return;
2044 2044
 }
2045 2045
 
2046 2046
 /**
@@ -2052,7 +2052,7 @@  discard block
 block discarded – undo
2052 2052
  */
2053 2053
 function geodir_twitter_tweet_button()
2054 2054
 {
2055
-    ?>
2055
+	?>
2056 2056
     <a href="http://twitter.com/share"
2057 2057
        class="twitter-share-button"><?php _e('Tweet', 'geodirectory'); ?></a>
2058 2058
     <script type="text/javascript" src="//platform.twitter.com/widgets.js"></script>
@@ -2069,11 +2069,11 @@  discard block
 block discarded – undo
2069 2069
  * @global object $post The current post object.
2070 2070
  */
2071 2071
 function geodir_fb_like_button() {
2072
-    global $post;
2073
-    ?>
2072
+	global $post;
2073
+	?>
2074 2074
     <iframe <?php if (isset($_SERVER['HTTP_USER_AGENT']) && (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false)) {
2075
-        echo 'allowtransparency="true"';
2076
-    } ?> class="facebook"
2075
+		echo 'allowtransparency="true"';
2076
+	} ?> class="facebook"
2077 2077
          src="//www.facebook.com/plugins/like.php?href=<?php echo urlencode(get_permalink($post->ID)); ?>&amp;layout=button_count&amp;show_faces=false&amp;width=100&amp;action=like&amp;colorscheme=light"
2078 2078
          style="border:none; overflow:hidden; width:100px; height:20px"></iframe>
2079 2079
     <?php
@@ -2088,7 +2088,7 @@  discard block
 block discarded – undo
2088 2088
  * @package GeoDirectory
2089 2089
  */
2090 2090
 function geodir_google_plus_button() {
2091
-    ?>
2091
+	?>
2092 2092
     <div id="plusone-div" class="g-plusone" data-size="medium"></div>
2093 2093
     <script type="text/javascript">
2094 2094
         (function () {
@@ -2113,8 +2113,8 @@  discard block
 block discarded – undo
2113 2113
  * @global object $post The current post object.
2114 2114
  */
2115 2115
 function geodir_share_this_button_code() {
2116
-    global $post;
2117
-    ?>
2116
+	global $post;
2117
+	?>
2118 2118
     <div class="addthis_toolbox addthis_default_style">
2119 2119
         <span id='st_sharethis'></span>
2120 2120
         <script type="text/javascript">var switchTo5x = false;</script>
@@ -2139,8 +2139,8 @@  discard block
 block discarded – undo
2139 2139
 }
2140 2140
 
2141 2141
 function geodir_listing_bounce_map_pin_on_hover() {
2142
-    if(get_option('geodir_listing_hover_bounce_map_pin',true)) {
2143
-        ?>
2142
+	if(get_option('geodir_listing_hover_bounce_map_pin',true)) {
2143
+		?>
2144 2144
         <script>
2145 2145
             jQuery(function ($) {
2146 2146
                 if (typeof(animate_marker) == 'function') {
@@ -2157,27 +2157,27 @@  discard block
 block discarded – undo
2157 2157
             });
2158 2158
         </script>
2159 2159
         <?php
2160
-    }
2160
+	}
2161 2161
 }
2162 2162
 add_action('geodir_after_listing_listview','geodir_listing_bounce_map_pin_on_hover',10);
2163 2163
 
2164 2164
 add_action('geodir_after_favorite_html','geodir_output_favourite_html_listings',1,1);
2165 2165
 function geodir_output_favourite_html_listings( $post_id){
2166
-    geodir_favourite_html('', $post_id);
2166
+	geodir_favourite_html('', $post_id);
2167 2167
 }
2168 2168
 
2169 2169
 add_action( 'geodir_listing_after_pinpoint', 'geodir_output_pinpoint_html_listings', 1, 2);
2170 2170
 function geodir_output_pinpoint_html_listings( $post_id, $post){
2171
-    global $wp_query;
2171
+	global $wp_query;
2172 2172
 
2173
-    $show_pin_point = $wp_query->is_main_query();
2173
+	$show_pin_point = $wp_query->is_main_query();
2174 2174
     
2175
-    if (!empty($show_pin_point) && is_active_widget(false, "", "geodir_map_v3_listing_map")) {
2176
-        $term_icon_url = get_tax_meta($post->default_category, 'ct_cat_icon', false, $post->post_type);
2177
-        $marker_icon = isset($term_icon_url['src']) ? $term_icon_url['src'] : get_option('geodir_default_marker_icon');
2178
-        ?>
2175
+	if (!empty($show_pin_point) && is_active_widget(false, "", "geodir_map_v3_listing_map")) {
2176
+		$term_icon_url = get_tax_meta($post->default_category, 'ct_cat_icon', false, $post->post_type);
2177
+		$marker_icon = isset($term_icon_url['src']) ? $term_icon_url['src'] : get_option('geodir_default_marker_icon');
2178
+		?>
2179 2179
         <span class="geodir-pinpoint" style="background:url('<?php echo $marker_icon; ?>') no-repeat scroll left top transparent;background-size:auto 100%; -webkit-background-size:auto 100%;-moz-background-size:auto 100%;height:9px;width:14px;"><?php echo apply_filters('geodir_listing_listview_pinpoint_inner_content', '', 'listing'); ?></span>
2180 2180
         <a class="geodir-pinpoint-link" href="javascript:void(0)" onclick="openMarker('listing_map_canvas' ,'<?php echo $post->ID; ?>')" onmouseover="animate_marker('listing_map_canvas' ,'<?php echo $post->ID; ?>')" onmouseout="stop_marker_animation('listing_map_canvas' ,'<?php echo $post->ID; ?>')"><?php _e('Pinpoint', 'geodirectory'); ?></a>
2181 2181
         <?php
2182
-    }
2182
+	}
2183 2183
 }
2184 2184
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +122 added lines, -122 removed lines patch added patch discarded remove patch
@@ -51,20 +51,20 @@  discard block
 block discarded – undo
51 51
 			jQuery(listSel).children('li').switchClass('gridview_onehalf gridview_onethird gridview_onefourth', 'gridview_onefifth', 600);
52 52
 		}
53 53
 
54
-		jQuery.post("<?php echo geodir_get_ajax_url();?>&gd_listing_view=" + val, function (data) {
54
+		jQuery.post("<?php echo geodir_get_ajax_url(); ?>&gd_listing_view=" + val, function (data) {
55 55
 			//alert(data );
56 56
 		});
57 57
 	}
58 58
     </script>
59 59
     <div class="geodir-list-view-select">
60 60
         <select name="gd_list_view" id="gd_list_view" onchange="geodir_list_view_select(this);">
61
-            <?php $listing_view = (int)$gd_session->get('gd_listing_view'); ?>
62
-            <option value=""><?php _e('View:', 'geodirectory');?></option>
63
-            <option value="1" <?php selected(1, $listing_view);?>><?php _e('View: List', 'geodirectory');?></option>
64
-            <option value="2" <?php selected(2, $listing_view);?>><?php _e('View: Grid 2', 'geodirectory');?></option>
65
-            <option value="3" <?php selected(3, $listing_view);?>><?php _e('View: Grid 3', 'geodirectory');?></option>
66
-            <option value="4" <?php selected(4, $listing_view);?>><?php _e('View: Grid 4', 'geodirectory');?></option>
67
-            <option value="5" <?php selected(5, $listing_view);?>><?php _e('View: Grid 5', 'geodirectory');?></option>
61
+            <?php $listing_view = (int) $gd_session->get('gd_listing_view'); ?>
62
+            <option value=""><?php _e('View:', 'geodirectory'); ?></option>
63
+            <option value="1" <?php selected(1, $listing_view); ?>><?php _e('View: List', 'geodirectory'); ?></option>
64
+            <option value="2" <?php selected(2, $listing_view); ?>><?php _e('View: Grid 2', 'geodirectory'); ?></option>
65
+            <option value="3" <?php selected(3, $listing_view); ?>><?php _e('View: Grid 3', 'geodirectory'); ?></option>
66
+            <option value="4" <?php selected(4, $listing_view); ?>><?php _e('View: Grid 4', 'geodirectory'); ?></option>
67
+            <option value="5" <?php selected(5, $listing_view); ?>><?php _e('View: Grid 5', 'geodirectory'); ?></option>
68 68
         </select>
69 69
     </div>
70 70
 <?php
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
                 $out .= $subex;
116 116
             }
117 117
         }
118
-        $out .= ' <a class="excerpt-read-more" href="' . get_permalink() . '" title="' . get_the_title() . '">';
118
+        $out .= ' <a class="excerpt-read-more" href="'.get_permalink().'" title="'.get_the_title().'">';
119 119
         /**
120 120
          * Filter excerpt read more text.
121 121
          *
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
         if (mb_strlen($excerpt_more) > 0 && mb_strpos($excerpt, $excerpt_more) !== false) {
129 129
             $excut = -(mb_strlen($excerpt_more));
130 130
             $out .= mb_substr($excerpt, 0, $excut);
131
-            $out .= ' <a class="excerpt-read-more" href="' . get_permalink() . '" title="' . get_the_title() . '">';
131
+            $out .= ' <a class="excerpt-read-more" href="'.get_permalink().'" title="'.get_the_title().'">';
132 132
             /**
133 133
              * Filter excerpt read more text.
134 134
              *
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
      * @param object|string $post The post object.
185 185
      * @param string $post_type The post type.
186 186
      */
187
-    return (object)apply_filters('geodir_post_package_info', $package_info, $post, $post_type);
187
+    return (object) apply_filters('geodir_post_package_info', $package_info, $post, $post_type);
188 188
 
189 189
 }
190 190
 
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
         $post_title = $productinfo->post_title;
239 239
     }
240 240
 
241
-    $post_title = '<a href="' . get_permalink($pid) . '">' . $post_title . '</a>';
241
+    $post_title = '<a href="'.get_permalink($pid).'">'.$post_title.'</a>';
242 242
 
243 243
     $user_info = get_userdata($author_id);
244 244
     $to_email = geodir_get_post_meta($pid, 'geodir_email', true);
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
     do_action('geodir_after_send_enquiry', $request, 'Enquiry');
269 269
 
270 270
     $client_message = $frnd_comments;
271
-    $client_message .= '<br>' . __('From :', 'geodirectory') . ' ' . $yourname . '<br>' . __('Phone :', 'geodirectory') . ' ' . $inq_phone . '<br>' . __('Email :', 'geodirectory') . ' ' . $youremail . '<br><br>' . __('Sent from', 'geodirectory') . ' - <b><a href="' . trailingslashit(home_url()) . '">' . get_option('blogname') . '</a></b>.';
271
+    $client_message .= '<br>'.__('From :', 'geodirectory').' '.$yourname.'<br>'.__('Phone :', 'geodirectory').' '.$inq_phone.'<br>'.__('Email :', 'geodirectory').' '.$youremail.'<br><br>'.__('Sent from', 'geodirectory').' - <b><a href="'.trailingslashit(home_url()).'">'.get_option('blogname').'</a></b>.';
272 272
     /**
273 273
      * Filter client message text.
274 274
      *
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
         // strip slashes message
299 299
         $client_message = stripslashes_deep($client_message);
300 300
 
301
-        geodir_sendEmail($youremail, $yourname, $to_email, $to_name, '', $client_message, $extra = '', 'send_enquiry', $request['pid']);//To client email
301
+        geodir_sendEmail($youremail, $yourname, $to_email, $to_name, '', $client_message, $extra = '', 'send_enquiry', $request['pid']); //To client email
302 302
     }
303 303
 
304 304
     /**
@@ -320,9 +320,9 @@  discard block
 block discarded – undo
320 320
     do_action('geodir_after_send_enquiry_email', $request);
321 321
     $url = get_permalink($pid);
322 322
     if (strstr($url, '?')) {
323
-        $url = $url . "&send_inquiry=success";
323
+        $url = $url."&send_inquiry=success";
324 324
     } else {
325
-        $url = $url . "?send_inquiry=success";
325
+        $url = $url."?send_inquiry=success";
326 326
     }
327 327
     /**
328 328
      * Filter redirect url after the send enquiry email is sent.
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
      * }
404 404
      */
405 405
     do_action('geodir_before_send_to_friend_email', $request);
406
-    geodir_sendEmail($youremail, $yourname, $to_email, $to_name, $frnd_subject, $frnd_comments, $extra = '', 'send_friend', $request['pid']);//To client email
406
+    geodir_sendEmail($youremail, $yourname, $to_email, $to_name, $frnd_subject, $frnd_comments, $extra = '', 'send_friend', $request['pid']); //To client email
407 407
 
408 408
     /**
409 409
      * Called after the send to friend email is sent.
@@ -427,9 +427,9 @@  discard block
 block discarded – undo
427 427
 
428 428
     $url = get_permalink($pid);
429 429
     if (strstr($url, '?')) {
430
-        $url = $url . "&sendtofrnd=success";
430
+        $url = $url."&sendtofrnd=success";
431 431
     } else {
432
-        $url = $url . "?sendtofrnd=success";
432
+        $url = $url."?sendtofrnd=success";
433 433
     }
434 434
     /**
435 435
      * Filter redirect url after the send to friend email is sent.
@@ -463,7 +463,7 @@  discard block
 block discarded – undo
463 463
              *
464 464
              * @since 1.0.0
465 465
              */
466
-            echo ' <div id="' . apply_filters('geodir_post_gallery_id', 'geodir-post-gallery') . '" class="clearfix" >';
466
+            echo ' <div id="'.apply_filters('geodir_post_gallery_id', 'geodir-post-gallery').'" class="clearfix" >';
467 467
             break;
468 468
         case 'reviews' :
469 469
             echo '<div id="reviews-wrap" class="clearfix"> ';
@@ -529,7 +529,7 @@  discard block
 block discarded – undo
529 529
         if (!in_array($post_type, $all_postypes))
530 530
             return false;
531 531
 
532
-        $sort_field_info = $wpdb->get_var($wpdb->prepare("select default_order from " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " where	post_type= %s and is_active=%d and is_default=%d", array($post_type, 1, 1)));
532
+        $sort_field_info = $wpdb->get_var($wpdb->prepare("select default_order from ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." where	post_type= %s and is_active=%d and is_default=%d", array($post_type, 1, 1)));
533 533
 
534 534
         if (!empty($sort_field_info))
535 535
             return $sort_field_info;
@@ -557,7 +557,7 @@  discard block
 block discarded – undo
557 557
         if (!in_array($post_type, $all_postypes))
558 558
             return false;
559 559
 
560
-        $sort_field_info = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " WHERE post_type=%s AND is_active=%d AND (sort_asc=1 || sort_desc=1 || field_type='random') AND field_type != 'address' ORDER BY sort_order ASC", array($post_type, 1)));
560
+        $sort_field_info = $wpdb->get_results($wpdb->prepare("SELECT * FROM ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." WHERE post_type=%s AND is_active=%d AND (sort_asc=1 || sort_desc=1 || field_type='random') AND field_type != 'address' ORDER BY sort_order ASC", array($post_type, 1)));
561 561
         /**
562 562
          * Filter post sort options.
563 563
          *
@@ -587,7 +587,7 @@  discard block
 block discarded – undo
587 587
 	 *
588 588
 	 * @since 1.4.4
589 589
 	 */
590
-	if ( is_search() ) {
590
+	if (is_search()) {
591 591
 		return;
592 592
 	}
593 593
 
@@ -611,7 +611,7 @@  discard block
 block discarded – undo
611 611
             if ($sort->field_type == 'random') {
612 612
                 $key = $sort->field_type;
613 613
                 ($sort_by == $key || ($sort->is_default == '1' && !isset($_REQUEST['sort_by']))) ? $selected = 'selected="selected"' : $selected = '';
614
-                $sort_field_options .= '<option ' . $selected . ' value="' . esc_url( add_query_arg('sort_by', $key) ) . '">' . __($label, 'geodirectory') . '</option>';
614
+                $sort_field_options .= '<option '.$selected.' value="'.esc_url(add_query_arg('sort_by', $key)).'">'.__($label, 'geodirectory').'</option>';
615 615
             }
616 616
 
617 617
             if ($sort->htmlvar_name == 'comment_count') {
@@ -619,21 +619,21 @@  discard block
 block discarded – undo
619 619
             }
620 620
 
621 621
             if ($sort->sort_asc) {
622
-                $key = $sort->htmlvar_name . '_asc';
622
+                $key = $sort->htmlvar_name.'_asc';
623 623
                 $label = $sort->site_title;
624 624
                 if ($sort->asc_title)
625 625
                     $label = $sort->asc_title;
626 626
                 ($sort_by == $key || ($sort->is_default == '1' && $sort->default_order == $key && !isset($_REQUEST['sort_by']))) ? $selected = 'selected="selected"' : $selected = '';
627
-                $sort_field_options .= '<option ' . $selected . ' value="' . esc_url( add_query_arg('sort_by', $key) ) . '">' . __($label, 'geodirectory') . '</option>';
627
+                $sort_field_options .= '<option '.$selected.' value="'.esc_url(add_query_arg('sort_by', $key)).'">'.__($label, 'geodirectory').'</option>';
628 628
             }
629 629
 
630 630
             if ($sort->sort_desc) {
631
-                $key = $sort->htmlvar_name . '_desc';
631
+                $key = $sort->htmlvar_name.'_desc';
632 632
                 $label = $sort->site_title;
633 633
                 if ($sort->desc_title)
634 634
                     $label = $sort->desc_title;
635 635
                 ($sort_by == $key || ($sort->is_default == '1' && $sort->default_order == $key && !isset($_REQUEST['sort_by']))) ? $selected = 'selected="selected"' : $selected = '';
636
-                $sort_field_options .= '<option ' . $selected . ' value="' . esc_url( add_query_arg('sort_by', $key) ) . '">' . __($label, 'geodirectory') . '</option>';
636
+                $sort_field_options .= '<option '.$selected.' value="'.esc_url(add_query_arg('sort_by', $key)).'">'.__($label, 'geodirectory').'</option>';
637 637
             }
638 638
 
639 639
         }
@@ -648,9 +648,9 @@  discard block
 block discarded – undo
648 648
             <select name="sort_by" id="sort_by" onchange="javascript:window.location=this.value;">
649 649
 
650 650
                 <option
651
-                    value="<?php echo esc_url( add_query_arg('sort_by', '') );?>" <?php if ($sort_by == '') echo 'selected="selected"';?>><?php _e('Sort By', 'geodirectory');?></option><?php
651
+                    value="<?php echo esc_url(add_query_arg('sort_by', '')); ?>" <?php if ($sort_by == '') echo 'selected="selected"'; ?>><?php _e('Sort By', 'geodirectory'); ?></option><?php
652 652
 
653
-                echo $sort_field_options;?>
653
+                echo $sort_field_options; ?>
654 654
 
655 655
             </select>
656 656
 
@@ -721,7 +721,7 @@  discard block
 block discarded – undo
721 721
         $category = array();
722 722
 
723 723
         if (isset($_REQUEST['backandedit'])) {
724
-            $post = (object)$gd_session->get('listing');
724
+            $post = (object) $gd_session->get('listing');
725 725
             $post_type = $post->listing_type;
726 726
             if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '')
727 727
                 $post_id = $_REQUEST['pid'];
@@ -736,13 +736,13 @@  discard block
 block discarded – undo
736 736
 
737 737
         if ($relate_to == 'category') {
738 738
 
739
-            $category_taxonomy = $post_type . $relate_to;
739
+            $category_taxonomy = $post_type.$relate_to;
740 740
             if (isset($post->{$category_taxonomy}) && $post->{$category_taxonomy} != '')
741 741
                 $category = explode(',', trim($post->{$category_taxonomy}, ','));
742 742
 
743 743
         } elseif ($relate_to == 'tags') {
744 744
 
745
-            $category_taxonomy = $post_type . '_' . $relate_to;
745
+            $category_taxonomy = $post_type.'_'.$relate_to;
746 746
             if ($post->post_tags != '')
747 747
                 $category = explode(',', trim($post->post_tags, ','));
748 748
             $tax_field = 'name';
@@ -798,7 +798,7 @@  discard block
 block discarded – undo
798 798
             if ($add_location_filter != '0') {
799 799
                 $geodir_add_location_url = '1';
800 800
             }
801
-            $viewall_url = get_term_link((int)$category[0], $post_type . $category_taxonomy);
801
+            $viewall_url = get_term_link((int) $category[0], $post_type.$category_taxonomy);
802 802
             $geodir_add_location_url = NULL;
803 803
         }
804 804
         ob_start();
@@ -815,7 +815,7 @@  discard block
 block discarded – undo
815 815
                 $after_title = isset($after_title) ? $after_title : apply_filters('geodir_after_title', '</h3>');
816 816
                 ?>
817 817
                 <div class="location_list_heading clearfix">
818
-                    <?php echo $before_title . $title . $after_title; ?>
818
+                    <?php echo $before_title.$title.$after_title; ?>
819 819
                 </div>
820 820
             <?php
821 821
             }
@@ -903,8 +903,8 @@  discard block
 block discarded – undo
903 903
         $geodir_post_category_str = serialize($geodir_post_category_str);
904 904
     }
905 905
 
906
-    $all_var['post_category_array'] = html_entity_decode((string)$geodir_post_category_str, ENT_QUOTES, 'UTF-8');
907
-    $script = "var post_category_array = " . json_encode($all_var) . ';';
906
+    $all_var['post_category_array'] = html_entity_decode((string) $geodir_post_category_str, ENT_QUOTES, 'UTF-8');
907
+    $script = "var post_category_array = ".json_encode($all_var).';';
908 908
     echo '<script>';
909 909
     echo $script;
910 910
     echo '</script>';
@@ -1025,9 +1025,9 @@  discard block
 block discarded – undo
1025 1025
         }
1026 1026
     } elseif ((is_category() || is_tag()) && isset($current_term->taxonomy) && in_array($current_term->taxonomy, $geodir_taxonomies)) {
1027 1027
         if (is_category()) {
1028
-            $meta_desc .= __("Posts related to Category:", 'geodirectory') . " " . ucfirst(single_cat_title("", FALSE));
1028
+            $meta_desc .= __("Posts related to Category:", 'geodirectory')." ".ucfirst(single_cat_title("", FALSE));
1029 1029
         } elseif (is_tag()) {
1030
-            $meta_desc .= __("Posts related to Tag:", 'geodirectory') . " " . ucfirst(single_tag_title("", FALSE));
1030
+            $meta_desc .= __("Posts related to Tag:", 'geodirectory')." ".ucfirst(single_tag_title("", FALSE));
1031 1031
         }
1032 1032
     } elseif (isset($current_term->taxonomy) && in_array($current_term->taxonomy, $geodir_taxonomies)) {
1033 1033
         $meta_desc .= isset($current_term->description) ? $current_term->description : '';
@@ -1054,8 +1054,8 @@  discard block
 block discarded – undo
1054 1054
     $replace_location = __('Everywhere', 'geodirectory');
1055 1055
     $location_id = NULL;
1056 1056
     if ($geodir_location_manager) {
1057
-        $sql = $wpdb->prepare("SELECT location_id FROM " . POST_LOCATION_TABLE . " WHERE city_slug=%s ORDER BY location_id ASC LIMIT 1", array($gd_city));
1058
-        $location_id = (int)$wpdb->get_var($sql);
1057
+        $sql = $wpdb->prepare("SELECT location_id FROM ".POST_LOCATION_TABLE." WHERE city_slug=%s ORDER BY location_id ASC LIMIT 1", array($gd_city));
1058
+        $location_id = (int) $wpdb->get_var($sql);
1059 1059
         $location_type = geodir_what_is_current_location();
1060 1060
         if ($location_type == 'city') {
1061 1061
             $replace_location = geodir_get_current_location(array('what' => 'city', 'echo' => false));
@@ -1096,65 +1096,65 @@  discard block
 block discarded – undo
1096 1096
                     $category_id = $category->term_id;
1097 1097
                     $category_desc = trim($category->description) != '' ? trim($category->description) : get_tax_meta($category_id, 'ct_cat_top_desc', false, $geodir_post_type);
1098 1098
                     if ($location_id) {
1099
-                        $option_name = 'geodir_cat_loc_' . $geodir_post_type . '_' . $category_id;
1099
+                        $option_name = 'geodir_cat_loc_'.$geodir_post_type.'_'.$category_id;
1100 1100
                         $cat_loc_option = get_option($option_name);
1101 1101
 
1102 1102
                         $gd_cat_loc_default = !empty($cat_loc_option) && isset($cat_loc_option['gd_cat_loc_default']) && $cat_loc_option['gd_cat_loc_default'] > 0 ? true : false;
1103 1103
                         if (!$gd_cat_loc_default) {
1104
-                            $option_name = 'geodir_cat_loc_' . $geodir_post_type . '_' . $category_id . '_' . $location_id;
1104
+                            $option_name = 'geodir_cat_loc_'.$geodir_post_type.'_'.$category_id.'_'.$location_id;
1105 1105
                             $option = get_option($option_name);
1106 1106
                             $category_desc = isset($option['gd_cat_loc_desc']) && trim($option['gd_cat_loc_desc']) != '' ? trim($option['gd_cat_loc_desc']) : $category_desc;
1107 1107
                         }
1108 1108
                     }
1109
-                    $geodir_meta_desc = __("Posts related to Category:", 'geodirectory') . " " . ucfirst(single_cat_title("", FALSE)) . '. ' . $category_desc;
1109
+                    $geodir_meta_desc = __("Posts related to Category:", 'geodirectory')." ".ucfirst(single_cat_title("", FALSE)).'. '.$category_desc;
1110 1110
                 }
1111 1111
             } else if ($geodir_is_tag) {
1112
-                $geodir_meta_desc = __("Posts related to Tag:", 'geodirectory') . " " . ucfirst(single_tag_title("", FALSE)) . '. ' . $geodir_meta_desc;
1112
+                $geodir_meta_desc = __("Posts related to Tag:", 'geodirectory')." ".ucfirst(single_tag_title("", FALSE)).'. '.$geodir_meta_desc;
1113 1113
             }
1114 1114
         }
1115 1115
     }
1116 1116
 
1117 1117
 
1118 1118
     $gd_page = '';
1119
-    if(geodir_is_page('home')){
1119
+    if (geodir_is_page('home')) {
1120 1120
         $gd_page = 'home';
1121 1121
         $meta_desc = (get_option('geodir_meta_desc_homepage')) ? get_option('geodir_meta_desc_homepage') : $meta_desc;
1122 1122
     }
1123
-    elseif(geodir_is_page('detail')){
1123
+    elseif (geodir_is_page('detail')) {
1124 1124
         $gd_page = 'detail';
1125 1125
         $meta_desc = (get_option('geodir_meta_desc_detail')) ? get_option('geodir_meta_desc_detail') : $meta_desc;
1126 1126
     }
1127
-    elseif(geodir_is_page('pt')){
1127
+    elseif (geodir_is_page('pt')) {
1128 1128
         $gd_page = 'pt';
1129 1129
         $meta_desc = (get_option('geodir_meta_desc_pt')) ? get_option('geodir_meta_desc_pt') : $meta_desc;
1130 1130
     }
1131
-    elseif(geodir_is_page('listing')){
1131
+    elseif (geodir_is_page('listing')) {
1132 1132
         $gd_page = 'listing';
1133 1133
         $meta_desc = (get_option('geodir_meta_desc_listing')) ? get_option('geodir_meta_desc_listing') : $meta_desc;
1134 1134
     }
1135
-    elseif(geodir_is_page('location')){
1135
+    elseif (geodir_is_page('location')) {
1136 1136
         $gd_page = 'location';
1137 1137
         $meta_desc = (get_option('geodir_meta_desc_location')) ? get_option('geodir_meta_desc_location') : $meta_desc;
1138 1138
         $meta_desc = apply_filters('geodir_seo_meta_location_description', $meta_desc);
1139 1139
 
1140 1140
     }
1141
-    elseif(geodir_is_page('search')){
1141
+    elseif (geodir_is_page('search')) {
1142 1142
         $gd_page = 'search';
1143 1143
         $meta_desc = (get_option('geodir_meta_desc_search')) ? get_option('geodir_meta_desc_search') : $meta_desc;
1144 1144
     }
1145
-    elseif(geodir_is_page('add-listing')){
1145
+    elseif (geodir_is_page('add-listing')) {
1146 1146
         $gd_page = 'add-listing';
1147 1147
         $meta_desc = (get_option('geodir_meta_desc_add-listing')) ? get_option('geodir_meta_desc_add-listing') : $meta_desc;
1148 1148
     }
1149
-    elseif(geodir_is_page('author')){
1149
+    elseif (geodir_is_page('author')) {
1150 1150
         $gd_page = 'author';
1151 1151
         $meta_desc = (get_option('geodir_meta_desc_author')) ? get_option('geodir_meta_desc_author') : $meta_desc;
1152 1152
     }
1153
-    elseif(geodir_is_page('login')){
1153
+    elseif (geodir_is_page('login')) {
1154 1154
         $gd_page = 'login';
1155 1155
         $meta_desc = (get_option('geodir_meta_desc_login')) ? get_option('geodir_meta_desc_login') : $meta_desc;
1156 1156
     }
1157
-    elseif(geodir_is_page('listing-success')){
1157
+    elseif (geodir_is_page('listing-success')) {
1158 1158
         $gd_page = 'listing-success';
1159 1159
         $meta_desc = (get_option('geodir_meta_desc_listing-success')) ? get_option('geodir_meta_desc_listing-success') : $meta_desc;
1160 1160
     }
@@ -1182,7 +1182,7 @@  discard block
 block discarded – undo
1182 1182
          * @param string $title The page description including variables.
1183 1183
          * @param string $gd_page The GeoDirectory page type if any.
1184 1184
          */
1185
-        $meta_desc = apply_filters('geodir_seo_meta_description_pre', __($meta_desc, 'geodirectory'),$gd_page,'');
1185
+        $meta_desc = apply_filters('geodir_seo_meta_description_pre', __($meta_desc, 'geodirectory'), $gd_page, '');
1186 1186
 
1187 1187
         /**
1188 1188
          * Filter SEO meta description.
@@ -1190,20 +1190,20 @@  discard block
 block discarded – undo
1190 1190
          * @since 1.0.0
1191 1191
          * @param string $meta_desc Meta description content.
1192 1192
          */
1193
-        echo apply_filters('geodir_seo_meta_description', '<meta name="description" content="' . $meta_desc . '" />', $meta_desc);
1193
+        echo apply_filters('geodir_seo_meta_description', '<meta name="description" content="'.$meta_desc.'" />', $meta_desc);
1194 1194
     }
1195 1195
 
1196 1196
     // meta keywords
1197 1197
     if (isset($post->post_type) && in_array($post->post_type, $all_postypes)) {
1198
-        $place_tags = wp_get_post_terms($post->ID, $post->post_type . '_tags', array("fields" => "names"));
1199
-        $place_cats = wp_get_post_terms($post->ID, $post->post_type . 'category', array("fields" => "names"));
1198
+        $place_tags = wp_get_post_terms($post->ID, $post->post_type.'_tags', array("fields" => "names"));
1199
+        $place_cats = wp_get_post_terms($post->ID, $post->post_type.'category', array("fields" => "names"));
1200 1200
 
1201
-        $meta_key .= implode(", ", array_merge((array)$place_cats, (array)$place_tags));
1201
+        $meta_key .= implode(", ", array_merge((array) $place_cats, (array) $place_tags));
1202 1202
     } else {
1203 1203
         $posttags = get_the_tags();
1204 1204
         if ($posttags) {
1205 1205
             foreach ($posttags as $tag) {
1206
-                $meta_key .= $tag->name . ' ';
1206
+                $meta_key .= $tag->name.' ';
1207 1207
             }
1208 1208
         } else {
1209 1209
             $tags = get_tags(array('orderby' => 'count', 'order' => 'DESC'));
@@ -1211,7 +1211,7 @@  discard block
 block discarded – undo
1211 1211
 
1212 1212
             foreach ($tags as $tag) {
1213 1213
                 if ($xt <= 20) {
1214
-                    $meta_key .= $tag->name . ", ";
1214
+                    $meta_key .= $tag->name.", ";
1215 1215
                 }
1216 1216
 
1217 1217
                 $xt++;
@@ -1220,7 +1220,7 @@  discard block
 block discarded – undo
1220 1220
     }
1221 1221
 
1222 1222
     $meta_key = $meta_key != '' ? rtrim(trim($meta_key), ",") : $meta_key;
1223
-    $geodir_meta_keys = $geodir_meta_keys != '' ? ($meta_key != '' ? $meta_key . ', ' . $geodir_meta_keys : $geodir_meta_keys) : $meta_key;
1223
+    $geodir_meta_keys = $geodir_meta_keys != '' ? ($meta_key != '' ? $meta_key.', '.$geodir_meta_keys : $geodir_meta_keys) : $meta_key;
1224 1224
     if ($geodir_meta_keys != '') {
1225 1225
         $geodir_meta_keys = strip_tags($geodir_meta_keys);
1226 1226
         $geodir_meta_keys = esc_html($geodir_meta_keys);
@@ -1239,7 +1239,7 @@  discard block
 block discarded – undo
1239 1239
          * @since 1.0.0
1240 1240
          * @param string $meta_desc Meta keywords.
1241 1241
          */
1242
-        echo apply_filters('geodir_seo_meta_keywords', '<meta name="keywords" content="' . $meta_key . '" />', $meta_key);
1242
+        echo apply_filters('geodir_seo_meta_keywords', '<meta name="keywords" content="'.$meta_key.'" />', $meta_key);
1243 1243
     }
1244 1244
 
1245 1245
 }
@@ -1384,8 +1384,8 @@  discard block
 block discarded – undo
1384 1384
 {
1385 1385
     global $post, $post_images, $video, $special_offers, $related_listing, $geodir_post_detail_fields;
1386 1386
 
1387
-    $post_id = !empty($post) && isset($post->ID) ? (int)$post->ID : 0;
1388
-    $request_post_id = !empty($_REQUEST['p']) ? (int)$_REQUEST['p'] : 0;
1387
+    $post_id = !empty($post) && isset($post->ID) ? (int) $post->ID : 0;
1388
+    $request_post_id = !empty($_REQUEST['p']) ? (int) $_REQUEST['p'] : 0;
1389 1389
     $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
1390 1390
 
1391 1391
     if ($is_backend_preview && !$post_id > 0 && $request_post_id > 0) {
@@ -1395,7 +1395,7 @@  discard block
 block discarded – undo
1395 1395
 
1396 1396
     $geodir_post_detail_fields = geodir_show_listing_info('detail');
1397 1397
 
1398
-    $arr_detail_page_tabs = geodir_detail_page_tabs_list();// get this sooner so we can get the active tab for the user
1398
+    $arr_detail_page_tabs = geodir_detail_page_tabs_list(); // get this sooner so we can get the active tab for the user
1399 1399
 
1400 1400
     if (geodir_is_page('detail')) {
1401 1401
         $video = geodir_get_video($post->ID);
@@ -1426,7 +1426,7 @@  discard block
 block discarded – undo
1426 1426
         if (!empty($post_images)) {
1427 1427
             foreach ($post_images as $image) {
1428 1428
                 $caption = (!empty($image->caption)) ? $image->caption : '';
1429
-                $thumb_image .= '<a href="' . $image->src . '" title="'.$caption.'">';
1429
+                $thumb_image .= '<a href="'.$image->src.'" title="'.$caption.'">';
1430 1430
                 $thumb_image .= geodir_show_image($image, 'thumbnail', true, false);
1431 1431
                 $thumb_image .= '</a>';
1432 1432
             }
@@ -1437,7 +1437,7 @@  discard block
 block discarded – undo
1437 1437
         $map_args['width'] = '600';
1438 1438
         $map_args['height'] = '300';
1439 1439
         if ($post->post_mapzoom) {
1440
-            $map_args['zoom'] = '' . $post->post_mapzoom . '';
1440
+            $map_args['zoom'] = ''.$post->post_mapzoom.'';
1441 1441
         }
1442 1442
         $map_args['autozoom'] = false;
1443 1443
         $map_args['child_collapse'] = '0';
@@ -1463,7 +1463,7 @@  discard block
 block discarded – undo
1463 1463
         if (!empty($post_images)) {
1464 1464
             foreach ($post_images as $image) {
1465 1465
                 if ($image != '') {
1466
-                    $thumb_image .= '<a href="' . $image . '">';
1466
+                    $thumb_image .= '<a href="'.$image.'">';
1467 1467
                     $thumb_image .= geodir_show_image(array('src' => $image), 'thumbnail', true, false);
1468 1468
                     $thumb_image .= '</a>';
1469 1469
                 }
@@ -1509,7 +1509,7 @@  discard block
 block discarded – undo
1509 1509
     $active_tab_name = '';
1510 1510
     $default_tab = '';
1511 1511
     $default_tab_name = '';
1512
-    foreach($arr_detail_page_tabs as $tab_index => $tabs){
1512
+    foreach ($arr_detail_page_tabs as $tab_index => $tabs) {
1513 1513
         if (isset($tabs['is_active_tab']) && $tabs['is_active_tab'] && !empty($tabs['is_display']) && isset($tabs['heading_text']) && $tabs['heading_text']) {
1514 1514
             $active_tab = $tab_index;
1515 1515
             $active_tab_name = __($tabs['heading_text'], 'geodirectory');
@@ -1530,10 +1530,10 @@  discard block
 block discarded – undo
1530 1530
         $active_tab = $default_tab;
1531 1531
         $active_tab_name = $default_tab_name;
1532 1532
     }
1533
-    $tab_list = (get_option('geodir_disable_tabs',false)) ? true : false;
1533
+    $tab_list = (get_option('geodir_disable_tabs', false)) ? true : false;
1534 1534
     ?>
1535 1535
     <div class="geodir-tabs" id="gd-tabs" style="position:relative;">
1536
-        <?php if(!$tab_list){ ?>
1536
+        <?php if (!$tab_list) { ?>
1537 1537
         <div id="geodir-tab-mobile-menu">
1538 1538
             <i class="fa fa-bars"></i>
1539 1539
             <span class="geodir-mobile-active-tab"><?php echo $active_tab_name; ?></span>
@@ -1554,10 +1554,10 @@  discard block
 block discarded – undo
1554 1554
             foreach ($arr_detail_page_tabs as $tab_index => $detail_page_tab) {
1555 1555
                 if ($detail_page_tab['is_display']) {
1556 1556
 
1557
-                    if(!$tab_list) {
1557
+                    if (!$tab_list) {
1558 1558
                         ?>
1559 1559
                         <dt></dt> <!-- added to comply with validation -->
1560
-                        <dd <?php if ($detail_page_tab['is_active_tab']){ ?>class="geodir-tab-active"<?php } ?> ><a
1560
+                        <dd <?php if ($detail_page_tab['is_active_tab']) { ?>class="geodir-tab-active"<?php } ?> ><a
1561 1561
                                 data-tab="#<?php echo $tab_index; ?>"
1562 1562
                                 data-status="enable"><?php _e($detail_page_tab['heading_text'], 'geodirectory'); ?></a>
1563 1563
                         </dd>
@@ -1565,9 +1565,9 @@  discard block
 block discarded – undo
1565 1565
                     }
1566 1566
                     ob_start() // start tab content buffering
1567 1567
                     ?>
1568
-                    <li id="<?php echo $tab_index;?>Tab">
1569
-                        <?php if($tab_list){
1570
-                            $tab_title = '<span class="gd-tab-list-title" ><a href="#'.$tab_index.'">'.__($detail_page_tab['heading_text'],'geodirectory').'</a></span><hr />';
1568
+                    <li id="<?php echo $tab_index; ?>Tab">
1569
+                        <?php if ($tab_list) {
1570
+                            $tab_title = '<span class="gd-tab-list-title" ><a href="#'.$tab_index.'">'.__($detail_page_tab['heading_text'], 'geodirectory').'</a></span><hr />';
1571 1571
                             /**
1572 1572
                              * Filter the tab list title html.
1573 1573
                              *
@@ -1576,9 +1576,9 @@  discard block
 block discarded – undo
1576 1576
                              * @param string $tab_index The tab index type.
1577 1577
                              * @param array $detail_page_tab The array of values including title text.
1578 1578
                              */
1579
-                            echo apply_filters('geodir_tab_list_title',$tab_title ,$tab_index ,$detail_page_tab);
1579
+                            echo apply_filters('geodir_tab_list_title', $tab_title, $tab_index, $detail_page_tab);
1580 1580
                         }?>
1581
-                        <div id="<?php echo $tab_index;?>" class="hash-offset"></div>
1581
+                        <div id="<?php echo $tab_index; ?>" class="hash-offset"></div>
1582 1582
                         <?php
1583 1583
                         /**
1584 1584
                          * Called before the details tab content is output per tab.
@@ -1596,7 +1596,7 @@  discard block
 block discarded – undo
1596 1596
                          * @since 1.0.0
1597 1597
                          * @todo do we need this if we have the hook above? 'geodir_before_tab_content'
1598 1598
                          */
1599
-                        do_action('geodir_before_' . $tab_index . '_tab_content');
1599
+                        do_action('geodir_before_'.$tab_index.'_tab_content');
1600 1600
                         /// write a code to generate content of each tab
1601 1601
                         switch ($tab_index) {
1602 1602
                             case 'post_profile':
@@ -1628,7 +1628,7 @@  discard block
 block discarded – undo
1628 1628
                                 break;
1629 1629
                             case 'post_video':
1630 1630
                                 /** This action is documented in geodirectory_template_actions.php */
1631
-                                echo apply_filters('the_content', stripslashes($video));// we apply the_content filter so oembed works also;
1631
+                                echo apply_filters('the_content', stripslashes($video)); // we apply the_content filter so oembed works also;
1632 1632
                                 break;
1633 1633
                             case 'special_offers':
1634 1634
                                 echo apply_filters('gd_special_offers_content', wpautop(stripslashes($special_offers)));
@@ -1666,7 +1666,7 @@  discard block
 block discarded – undo
1666 1666
                          * @since 1.0.0
1667 1667
                          * @todo do we need this if we have the hook above? 'geodir_after_tab_content'
1668 1668
                          */
1669
-                        do_action('geodir_after_' . $tab_index . '_tab_content');
1669
+                        do_action('geodir_after_'.$tab_index.'_tab_content');
1670 1670
                         ?> </li>
1671 1671
                     <?php
1672 1672
                     /**
@@ -1674,7 +1674,7 @@  discard block
 block discarded – undo
1674 1674
                      *
1675 1675
                      * @since 1.0.0
1676 1676
                      */
1677
-                    $arr_detail_page_tabs[$tab_index]['tab_content'] = apply_filters("geodir_modify_" . $detail_page_tab['tab_content'] . "_tab_content", ob_get_clean());
1677
+                    $arr_detail_page_tabs[$tab_index]['tab_content'] = apply_filters("geodir_modify_".$detail_page_tab['tab_content']."_tab_content", ob_get_clean());
1678 1678
                 } // end of if for is_display
1679 1679
             }// end of foreach
1680 1680
 
@@ -1686,8 +1686,8 @@  discard block
 block discarded – undo
1686 1686
              */
1687 1687
             do_action('geodir_after_tab_list');
1688 1688
             ?>
1689
-            <?php if(!$tab_list){?></dl><?php }?>
1690
-        <ul class="geodir-tabs-content entry-content <?php if($tab_list){?>geodir-tabs-list<?php }?>" style="position:relative;">
1689
+            <?php if (!$tab_list) {?></dl><?php }?>
1690
+        <ul class="geodir-tabs-content entry-content <?php if ($tab_list) {?>geodir-tabs-list<?php }?>" style="position:relative;">
1691 1691
             <?php
1692 1692
             foreach ($arr_detail_page_tabs as $detail_page_tab) {
1693 1693
                 if ($detail_page_tab['is_display'] && !empty($detail_page_tab['tab_content'])) {
@@ -1704,7 +1704,7 @@  discard block
 block discarded – undo
1704 1704
         </ul>
1705 1705
         <!--gd-tabs-content ul end-->
1706 1706
     </div>
1707
-    <?php if(!$tab_list){ ?>
1707
+    <?php if (!$tab_list) { ?>
1708 1708
     <script>
1709 1709
         if (window.location.hash && window.location.hash.indexOf('&') === -1 && jQuery(window.location.hash + 'Tab').length) {
1710 1710
             hashVal = window.location.hash;
@@ -1759,7 +1759,7 @@  discard block
 block discarded – undo
1759 1759
     if ($mime_type == 'image/jpeg' && function_exists('exif_read_data')) {
1760 1760
         try {
1761 1761
             $exif = exif_read_data($file_path);
1762
-        } catch(Exception $e) {
1762
+        } catch (Exception $e) {
1763 1763
             $exif = array();
1764 1764
         }
1765 1765
     }
@@ -1769,7 +1769,7 @@  discard block
 block discarded – undo
1769 1769
     $modify = false;
1770 1770
     $orientation = 0;
1771 1771
     if (!empty($exif) && isset($exif['Orientation'])) {
1772
-        switch ((int)$exif['Orientation']) {
1772
+        switch ((int) $exif['Orientation']) {
1773 1773
             case 1:
1774 1774
                 // do nothing
1775 1775
                 break;
@@ -1845,7 +1845,7 @@  discard block
 block discarded – undo
1845 1845
         }
1846 1846
         
1847 1847
         if ($quality !== null) {
1848
-            $image->set_quality((int)$quality);
1848
+            $image->set_quality((int) $quality);
1849 1849
         }
1850 1850
         
1851 1851
        $result = $image->save($file_path);
@@ -1917,7 +1917,7 @@  discard block
 block discarded – undo
1917 1917
 
1918 1918
         $comment_content = preg_replace('#(\\[img\\]).+(\\[\\/img\\])#', '', $comment_content);
1919 1919
 
1920
-        $permalink = get_permalink($comment->ID) . "#comment-" . $comment->comment_ID;
1920
+        $permalink = get_permalink($comment->ID)."#comment-".$comment->comment_ID;
1921 1921
         $comment_author_email = $comment->comment_author_email;
1922 1922
         $comment_post_ID = $comment->post_id;
1923 1923
 
@@ -1932,12 +1932,12 @@  discard block
 block discarded – undo
1932 1932
 
1933 1933
         $post_title = get_the_title($comment_post_ID);
1934 1934
         $permalink = get_permalink($comment_post_ID);
1935
-        $comment_permalink = $permalink . "#comment-" . $comment->comment_ID;
1936
-        $read_more = '<a class="comment_excerpt" href="' . $comment_permalink . '">' . __('Read more', 'geodirectory') . '</a>';
1935
+        $comment_permalink = $permalink."#comment-".$comment->comment_ID;
1936
+        $read_more = '<a class="comment_excerpt" href="'.$comment_permalink.'">'.__('Read more', 'geodirectory').'</a>';
1937 1937
 
1938 1938
         $comment_content_length = strlen($comment_content);
1939 1939
         if ($comment_content_length > $comment_lenth) {
1940
-            $comment_excerpt = mb_substr($comment_content, 0, $comment_lenth) . '... ' . $read_more;
1940
+            $comment_excerpt = mb_substr($comment_content, 0, $comment_lenth).'... '.$read_more;
1941 1941
         } else {
1942 1942
             $comment_excerpt = $comment_content;
1943 1943
         }
@@ -1950,37 +1950,37 @@  discard block
 block discarded – undo
1950 1950
 
1951 1951
         if ($comment_id && $na) {
1952 1952
             $comments_echo .= '<li class="clearfix">';
1953
-            $comments_echo .= "<span class=\"li" . $comment_id . " geodir_reviewer_image\">";
1953
+            $comments_echo .= "<span class=\"li".$comment_id." geodir_reviewer_image\">";
1954 1954
             if (function_exists('get_avatar')) {
1955 1955
                 if (!isset($comment->comment_type)) {
1956 1956
                     if ($user_profile_url) {
1957
-                        $comments_echo .= '<a href="' . $user_profile_url . '">';
1957
+                        $comments_echo .= '<a href="'.$user_profile_url.'">';
1958 1958
                     }
1959
-                    $comments_echo .= get_avatar($comment->comment_author_email, $g_size, geodir_plugin_url() . '/geodirectory-assets/images/gravatar2.png');
1959
+                    $comments_echo .= get_avatar($comment->comment_author_email, $g_size, geodir_plugin_url().'/geodirectory-assets/images/gravatar2.png');
1960 1960
                     if ($user_profile_url) {
1961 1961
                         $comments_echo .= '</a>';
1962 1962
                     }
1963 1963
                 } elseif ((isset($comment->comment_type) && $comment->comment_type == 'trackback') || (isset($comment->comment_type) && $comment->comment_type == 'pingback')) {
1964 1964
                     if ($user_profile_url) {
1965
-                        $comments_echo .= '<a href="' . $user_profile_url . '">';
1965
+                        $comments_echo .= '<a href="'.$user_profile_url.'">';
1966 1966
                     }
1967
-                    $comments_echo .= get_avatar($comment->comment_author_url, $g_size, geodir_plugin_url() . '/geodirectory-assets/images/gravatar2.png');
1967
+                    $comments_echo .= get_avatar($comment->comment_author_url, $g_size, geodir_plugin_url().'/geodirectory-assets/images/gravatar2.png');
1968 1968
                 }
1969 1969
             } elseif (function_exists('gravatar')) {
1970 1970
                 if ($user_profile_url) {
1971
-                    $comments_echo .= '<a href="' . $user_profile_url . '">';
1971
+                    $comments_echo .= '<a href="'.$user_profile_url.'">';
1972 1972
                 }
1973 1973
                 $comments_echo .= "<img src=\"";
1974 1974
                 if ('' == $comment->comment_type) {
1975
-                    $comments_echo .= gravatar($comment->comment_author_email, $g_size, geodir_plugin_url() . '/geodirectory-assets/images/gravatar2.png');
1975
+                    $comments_echo .= gravatar($comment->comment_author_email, $g_size, geodir_plugin_url().'/geodirectory-assets/images/gravatar2.png');
1976 1976
                     if ($user_profile_url) {
1977 1977
                         $comments_echo .= '</a>';
1978 1978
                     }
1979 1979
                 } elseif (('trackback' == $comment->comment_type) || ('pingback' == $comment->comment_type)) {
1980 1980
                     if ($user_profile_url) {
1981
-                        $comments_echo .= '<a href="' . $user_profile_url . '">';
1981
+                        $comments_echo .= '<a href="'.$user_profile_url.'">';
1982 1982
                     }
1983
-                    $comments_echo .= gravatar($comment->comment_author_url, $g_size, geodir_plugin_url() . '/geodirectory-assets/images/gravatar2.png');
1983
+                    $comments_echo .= gravatar($comment->comment_author_url, $g_size, geodir_plugin_url().'/geodirectory-assets/images/gravatar2.png');
1984 1984
                     if ($user_profile_url) {
1985 1985
                         $comments_echo .= '</a>';
1986 1986
                     }
@@ -1991,13 +1991,13 @@  discard block
 block discarded – undo
1991 1991
             $comments_echo .= "</span>\n";
1992 1992
 
1993 1993
             $comments_echo .= '<span class="geodir_reviewer_content">';
1994
-            if($comment->user_id){$comments_echo .= '<a href="'.get_author_posts_url( $comment->user_id ).'">';}
1995
-            $comments_echo .= '<span class="geodir_reviewer_author">' . $comment->comment_author . '</span> ';
1996
-            if($comment->user_id){$comments_echo .= '</a>';}
1997
-            $comments_echo .= '<span class="geodir_reviewer_reviewed">' . __('reviewed', 'geodirectory') . '</span> ';
1998
-            $comments_echo .= '<a href="' . $permalink . '" class="geodir_reviewer_title">' . $post_title . '</a>';
1994
+            if ($comment->user_id) {$comments_echo .= '<a href="'.get_author_posts_url($comment->user_id).'">'; }
1995
+            $comments_echo .= '<span class="geodir_reviewer_author">'.$comment->comment_author.'</span> ';
1996
+            if ($comment->user_id) {$comments_echo .= '</a>'; }
1997
+            $comments_echo .= '<span class="geodir_reviewer_reviewed">'.__('reviewed', 'geodirectory').'</span> ';
1998
+            $comments_echo .= '<a href="'.$permalink.'" class="geodir_reviewer_title">'.$post_title.'</a>';
1999 1999
             $comments_echo .= geodir_get_rating_stars($comment->overall_rating, $comment_post_ID);
2000
-            $comments_echo .= '<p class="geodir_reviewer_text">' . $comment_excerpt . '';
2000
+            $comments_echo .= '<p class="geodir_reviewer_text">'.$comment_excerpt.'';
2001 2001
             //echo preg_replace('#(\\[img\\]).+(\\[\\/img\\])#', '', $comment_excerpt);
2002 2002
             $comments_echo .= '</p>';
2003 2003
 
@@ -2024,19 +2024,19 @@  discard block
 block discarded – undo
2024 2024
     if (!empty($post_types)) {
2025 2025
         foreach ($post_types as $key => $post_type) {
2026 2026
             $cpt_name = __($post_type->labels->singular_name, 'geodirectory');
2027
-            $post_type_name =   sprintf(__('%s Categories', 'geodirectory'),$cpt_name);
2027
+            $post_type_name = sprintf(__('%s Categories', 'geodirectory'), $cpt_name);
2028 2028
             $taxonomies = geodir_get_taxonomies($key);
2029 2029
             $cat_taxonomy = !empty($taxonomies[0]) ? $taxonomies[0] : NULL;
2030 2030
             $cat_terms = $cat_taxonomy ? get_terms($cat_taxonomy) : NULL;
2031 2031
 
2032 2032
             if (!empty($cat_terms)) {
2033
-                $return['optgroup_start-' . $key] = $post_type_name;
2033
+                $return['optgroup_start-'.$key] = $post_type_name;
2034 2034
 
2035 2035
                 foreach ($cat_terms as $cat_term) {
2036
-                    $return[$key . '_' . $cat_term->term_id] = $cat_term->name;
2036
+                    $return[$key.'_'.$cat_term->term_id] = $cat_term->name;
2037 2037
                 }
2038 2038
 
2039
-                $return['optgroup_end-' . $key] = $post_type_name;
2039
+                $return['optgroup_end-'.$key] = $post_type_name;
2040 2040
             }
2041 2041
         }
2042 2042
     }
@@ -2128,10 +2128,10 @@  discard block
 block discarded – undo
2128 2128
             stWidget.addEntry({
2129 2129
                 "service": "sharethis",
2130 2130
                 "element": document.getElementById('st_sharethis'),
2131
-                "url": "<?php echo geodir_curPageURL();?>",
2132
-                "title": "<?php echo $post->post_title;?>",
2131
+                "url": "<?php echo geodir_curPageURL(); ?>",
2132
+                "title": "<?php echo $post->post_title; ?>",
2133 2133
                 "type": "chicklet",
2134
-                "text": "<?php _e( 'Share', 'geodirectory' );?>"
2134
+                "text": "<?php _e('Share', 'geodirectory'); ?>"
2135 2135
             });
2136 2136
         </script>
2137 2137
     </div>
@@ -2139,7 +2139,7 @@  discard block
 block discarded – undo
2139 2139
 }
2140 2140
 
2141 2141
 function geodir_listing_bounce_map_pin_on_hover() {
2142
-    if(get_option('geodir_listing_hover_bounce_map_pin',true)) {
2142
+    if (get_option('geodir_listing_hover_bounce_map_pin', true)) {
2143 2143
         ?>
2144 2144
         <script>
2145 2145
             jQuery(function ($) {
@@ -2159,15 +2159,15 @@  discard block
 block discarded – undo
2159 2159
         <?php
2160 2160
     }
2161 2161
 }
2162
-add_action('geodir_after_listing_listview','geodir_listing_bounce_map_pin_on_hover',10);
2162
+add_action('geodir_after_listing_listview', 'geodir_listing_bounce_map_pin_on_hover', 10);
2163 2163
 
2164
-add_action('geodir_after_favorite_html','geodir_output_favourite_html_listings',1,1);
2165
-function geodir_output_favourite_html_listings( $post_id){
2164
+add_action('geodir_after_favorite_html', 'geodir_output_favourite_html_listings', 1, 1);
2165
+function geodir_output_favourite_html_listings($post_id) {
2166 2166
     geodir_favourite_html('', $post_id);
2167 2167
 }
2168 2168
 
2169
-add_action( 'geodir_listing_after_pinpoint', 'geodir_output_pinpoint_html_listings', 1, 2);
2170
-function geodir_output_pinpoint_html_listings( $post_id, $post){
2169
+add_action('geodir_listing_after_pinpoint', 'geodir_output_pinpoint_html_listings', 1, 2);
2170
+function geodir_output_pinpoint_html_listings($post_id, $post) {
2171 2171
     global $wp_query;
2172 2172
 
2173 2173
     $show_pin_point = $wp_query->is_main_query();
Please login to merge, or discard this patch.
geodirectory-functions/listing_filters.php 2 patches
Indentation   +516 added lines, -516 removed lines patch added patch discarded remove patch
@@ -16,10 +16,10 @@  discard block
 block discarded – undo
16 16
  */
17 17
 function geodir_session_start()
18 18
 {
19
-    if (!session_id()) session_start();
20
-    global $geodir_add_location_url;
19
+	if (!session_id()) session_start();
20
+	global $geodir_add_location_url;
21 21
 
22
-    $geodir_add_location_url = NULL;
22
+	$geodir_add_location_url = NULL;
23 23
 }
24 24
 
25 25
 /**
@@ -33,18 +33,18 @@  discard block
 block discarded – undo
33 33
  */
34 34
 function geodir_modified_query($query)
35 35
 {
36
-    if ($query->is_main_query() && (
37
-            (geodir_is_page('add-listing') && isset($_REQUEST['pid']) && $_REQUEST['pid'] != '')
38
-            || geodir_is_page('listing')
39
-            || geodir_is_page('author')
40
-            || geodir_is_page('search')
41
-            || geodir_is_page('detail'))
42
-    ) {
43
-
44
-        $query->set('is_geodir_loop', true);
45
-    }
36
+	if ($query->is_main_query() && (
37
+			(geodir_is_page('add-listing') && isset($_REQUEST['pid']) && $_REQUEST['pid'] != '')
38
+			|| geodir_is_page('listing')
39
+			|| geodir_is_page('author')
40
+			|| geodir_is_page('search')
41
+			|| geodir_is_page('detail'))
42
+	) {
43
+
44
+		$query->set('is_geodir_loop', true);
45
+	}
46 46
 
47
-    return $query;
47
+	return $query;
48 48
 }
49 49
 
50 50
 /**
@@ -67,81 +67,81 @@  discard block
 block discarded – undo
67 67
  */
68 68
 function set_listing_request()
69 69
 {
70
-    global $wp_query, $wpdb, $geodir_post_type, $table, $dist, $mylat, $mylon, $s, $snear, $s, $s_A, $s_SA;
70
+	global $wp_query, $wpdb, $geodir_post_type, $table, $dist, $mylat, $mylon, $s, $snear, $s, $s_A, $s_SA;
71 71
 
72 72
 
73
-    // fix woocommerce shop products filtered by language for GD + WPML + Woocommerce
74
-    if (!geodir_is_geodir_page()) {
75
-        return;
76
-    }
73
+	// fix woocommerce shop products filtered by language for GD + WPML + Woocommerce
74
+	if (!geodir_is_geodir_page()) {
75
+		return;
76
+	}
77 77
 
78
-    /* remove all pre filters */
79
-    remove_all_filters('query');
80
-    remove_all_filters('posts_search');
81
-    remove_all_filters('posts_fields');
82
-    remove_all_filters('posts_join');
83
-    remove_all_filters('posts_orderby');
84
-    remove_all_filters('posts_where');
78
+	/* remove all pre filters */
79
+	remove_all_filters('query');
80
+	remove_all_filters('posts_search');
81
+	remove_all_filters('posts_fields');
82
+	remove_all_filters('posts_join');
83
+	remove_all_filters('posts_orderby');
84
+	remove_all_filters('posts_where');
85 85
 
86 86
 
87
-    if ((is_search() && isset($_REQUEST['geodir_search']) && $_REQUEST['geodir_search'] != '')):
87
+	if ((is_search() && isset($_REQUEST['geodir_search']) && $_REQUEST['geodir_search'] != '')):
88 88
 
89
-        if (isset($_REQUEST['scat']) && $_REQUEST['scat'] == 'all') $_REQUEST['scat'] = '';
90
-        //if(isset($_REQUEST['s']) && $_REQUEST['s'] == '+') $_REQUEST['s'] = '';
89
+		if (isset($_REQUEST['scat']) && $_REQUEST['scat'] == 'all') $_REQUEST['scat'] = '';
90
+		//if(isset($_REQUEST['s']) && $_REQUEST['s'] == '+') $_REQUEST['s'] = '';
91 91
 
92
-        if (isset($_REQUEST['sdist'])) {
93
-            ($_REQUEST['sdist'] != '0' && $_REQUEST['sdist'] != '') ? $dist = esc_attr($_REQUEST['sdist']) : $dist = 25000;
94
-        } elseif (get_option('geodir_search_dist') != '') {
95
-            $dist = get_option('geodir_search_dist');
92
+		if (isset($_REQUEST['sdist'])) {
93
+			($_REQUEST['sdist'] != '0' && $_REQUEST['sdist'] != '') ? $dist = esc_attr($_REQUEST['sdist']) : $dist = 25000;
94
+		} elseif (get_option('geodir_search_dist') != '') {
95
+			$dist = get_option('geodir_search_dist');
96 96
 
97
-        } else {
98
-            $dist = 25000;
99
-        } //  Distance
97
+		} else {
98
+			$dist = 25000;
99
+		} //  Distance
100 100
 
101
-        if (isset($_REQUEST['sgeo_lat'])) {
102
-            $mylat = (float)esc_attr($_REQUEST['sgeo_lat']);
103
-        } else {
104
-            $mylat = (float)geodir_get_current_city_lat();
105
-        } //  Latatude
101
+		if (isset($_REQUEST['sgeo_lat'])) {
102
+			$mylat = (float)esc_attr($_REQUEST['sgeo_lat']);
103
+		} else {
104
+			$mylat = (float)geodir_get_current_city_lat();
105
+		} //  Latatude
106 106
 
107
-        if (isset($_REQUEST['sgeo_lon'])) {
108
-            $mylon = (float)esc_attr($_REQUEST['sgeo_lon']);
109
-        } else {
110
-            $mylon = (float)geodir_get_current_city_lng();
111
-        } //  Distance
107
+		if (isset($_REQUEST['sgeo_lon'])) {
108
+			$mylon = (float)esc_attr($_REQUEST['sgeo_lon']);
109
+		} else {
110
+			$mylon = (float)geodir_get_current_city_lng();
111
+		} //  Distance
112 112
 
113
-        if (isset($_REQUEST['snear'])) {
114
-            $snear = trim(esc_attr($_REQUEST['snear']));
115
-        }
113
+		if (isset($_REQUEST['snear'])) {
114
+			$snear = trim(esc_attr($_REQUEST['snear']));
115
+		}
116 116
 
117
-        if (isset($_REQUEST['s'])) {
118
-            $s = trim(esc_attr(wp_strip_all_tags($_REQUEST['s'])));
119
-        }
117
+		if (isset($_REQUEST['s'])) {
118
+			$s = trim(esc_attr(wp_strip_all_tags($_REQUEST['s'])));
119
+		}
120 120
 
121
-        if ($snear == 'NEAR ME') {
122
-            $ip = $_SERVER['REMOTE_ADDR'];
123
-            $addr_details = unserialize(file_get_contents('http://www.geoplugin.net/php.gp?ip=' . $ip));
124
-            $mylat = stripslashes(ucfirst($addr_details[geoplugin_latitude]));
125
-            $mylon = stripslashes(ucfirst($addr_details[geoplugin_longitude]));
126
-        }
121
+		if ($snear == 'NEAR ME') {
122
+			$ip = $_SERVER['REMOTE_ADDR'];
123
+			$addr_details = unserialize(file_get_contents('http://www.geoplugin.net/php.gp?ip=' . $ip));
124
+			$mylat = stripslashes(ucfirst($addr_details[geoplugin_latitude]));
125
+			$mylon = stripslashes(ucfirst($addr_details[geoplugin_longitude]));
126
+		}
127 127
 
128 128
 
129
-        if (strstr($s, ',')) {
130
-            $s_AA = str_replace(" ", "", $s);
131
-            $s_A = explode(",", $s_AA);
132
-            $s_A = implode('","', $s_A);
133
-            $s_A = '"' . $s_A . '"';
134
-        } else {
135
-            $s_A = '"' . $s . '"';
136
-        }
129
+		if (strstr($s, ',')) {
130
+			$s_AA = str_replace(" ", "", $s);
131
+			$s_A = explode(",", $s_AA);
132
+			$s_A = implode('","', $s_A);
133
+			$s_A = '"' . $s_A . '"';
134
+		} else {
135
+			$s_A = '"' . $s . '"';
136
+		}
137 137
 
138
-        if (strstr($s, ' ')) {
139
-            $s_SA = explode(" ", $s);
140
-        } else {
141
-            $s_SA = '';
142
-        }
138
+		if (strstr($s, ' ')) {
139
+			$s_SA = explode(" ", $s);
140
+		} else {
141
+			$s_SA = '';
142
+		}
143 143
 
144
-    endif;
144
+	endif;
145 145
 
146 146
 
147 147
 
@@ -162,56 +162,56 @@  discard block
 block discarded – undo
162 162
  */
163 163
 function geodir_listing_loop_filter($query)
164 164
 {
165
-    global $wp_query, $geodir_post_type, $table, $plugin_prefix, $table, $term;
165
+	global $wp_query, $geodir_post_type, $table, $plugin_prefix, $table, $term;
166 166
 
167
-    // fix wp_reset_query for popular post view widget
168
-    if (!geodir_is_geodir_page()) {
169
-        return;
170
-    }
167
+	// fix wp_reset_query for popular post view widget
168
+	if (!geodir_is_geodir_page()) {
169
+		return;
170
+	}
171 171
 
172
-    $geodir_post_type = geodir_get_current_posttype();
173
-
174
-    if (isset($wp_query->tax_query->queries) && $wp_query->tax_query->queries) {
175
-        $taxonomies = wp_list_pluck($wp_query->tax_query->queries, 'taxonomy');
176
-
177
-        if (isset($wp_query->query[$taxonomies[0]])) {
178
-            $request_term = explode("/", $wp_query->query[$taxonomies[0]]);
179
-            $request_term = end($request_term);
180
-            if (!term_exists($request_term)) {
181
-                $args = array('number' => '1',);
182
-                $terms_arr = get_terms($taxonomies[0], $args);
183
-                foreach ($terms_arr as $location_term) {
184
-                    $term_arr = $location_term;
185
-                    $term_arr->name = geodir_ucwords(str_replace('-', ' ', $request_term));
186
-                }
187
-                $wp_query->queried_object_id = 1;
188
-                $wp_query->queried_object = $term_arr;
189
-                //print_r($wp_query) ;
190
-            }
191
-        }
172
+	$geodir_post_type = geodir_get_current_posttype();
173
+
174
+	if (isset($wp_query->tax_query->queries) && $wp_query->tax_query->queries) {
175
+		$taxonomies = wp_list_pluck($wp_query->tax_query->queries, 'taxonomy');
176
+
177
+		if (isset($wp_query->query[$taxonomies[0]])) {
178
+			$request_term = explode("/", $wp_query->query[$taxonomies[0]]);
179
+			$request_term = end($request_term);
180
+			if (!term_exists($request_term)) {
181
+				$args = array('number' => '1',);
182
+				$terms_arr = get_terms($taxonomies[0], $args);
183
+				foreach ($terms_arr as $location_term) {
184
+					$term_arr = $location_term;
185
+					$term_arr->name = geodir_ucwords(str_replace('-', ' ', $request_term));
186
+				}
187
+				$wp_query->queried_object_id = 1;
188
+				$wp_query->queried_object = $term_arr;
189
+				//print_r($wp_query) ;
190
+			}
191
+		}
192 192
 
193
-    }
194
-    if (isset($query->query_vars['is_geodir_loop']) && $query->query_vars['is_geodir_loop']) {
195
-
196
-        $table = $plugin_prefix . $geodir_post_type . '_detail';
197
-
198
-        add_filter('posts_fields', 'geodir_posts_fields', 1);
199
-        add_filter('posts_join', 'geodir_posts_join', 1);
200
-        geodir_post_where();
201
-        if (!is_admin())
202
-            add_filter('posts_orderby', 'geodir_posts_orderby', 1);
203
-
204
-        // advanced filter for popular post view widget
205
-        global $wp_query;
206
-        if (!is_admin()) {
207
-            if (!empty($wp_query->query['with_pics_only'])) {
208
-                add_filter('posts_join', 'geodir_filter_widget_join', 1000);
209
-            }
210
-            add_filter('posts_where', 'geodir_filter_widget_where', 1000);
211
-        }
193
+	}
194
+	if (isset($query->query_vars['is_geodir_loop']) && $query->query_vars['is_geodir_loop']) {
212 195
 
213
-    }
214
-    return $query;
196
+		$table = $plugin_prefix . $geodir_post_type . '_detail';
197
+
198
+		add_filter('posts_fields', 'geodir_posts_fields', 1);
199
+		add_filter('posts_join', 'geodir_posts_join', 1);
200
+		geodir_post_where();
201
+		if (!is_admin())
202
+			add_filter('posts_orderby', 'geodir_posts_orderby', 1);
203
+
204
+		// advanced filter for popular post view widget
205
+		global $wp_query;
206
+		if (!is_admin()) {
207
+			if (!empty($wp_query->query['with_pics_only'])) {
208
+				add_filter('posts_join', 'geodir_filter_widget_join', 1000);
209
+			}
210
+			add_filter('posts_where', 'geodir_filter_widget_where', 1000);
211
+		}
212
+
213
+	}
214
+	return $query;
215 215
 }
216 216
 
217 217
 
@@ -230,67 +230,67 @@  discard block
 block discarded – undo
230 230
  * @return string Modified fields query string.
231 231
  */
232 232
 function geodir_posts_fields($fields) {
233
-    global $wp_query, $wpdb, $geodir_post_type, $table, $plugin_prefix, $dist, $mylat, $mylon, $snear, $gd_session;
233
+	global $wp_query, $wpdb, $geodir_post_type, $table, $plugin_prefix, $dist, $mylat, $mylon, $snear, $gd_session;
234 234
 
235
-    // Filter-Location-Manager to add location table.
236
-    $fields .= ", " . $table . ".* ";
235
+	// Filter-Location-Manager to add location table.
236
+	$fields .= ", " . $table . ".* ";
237 237
     
238 238
 	if ($snear != '' || $gd_session->get('all_near_me')) {
239
-        $DistanceRadius = geodir_getDistanceRadius(get_option('geodir_search_dist_1'));
239
+		$DistanceRadius = geodir_getDistanceRadius(get_option('geodir_search_dist_1'));
240 240
         
241 241
 		if ($gd_session->get('all_near_me')) {
242
-            $mylat = $gd_session->get('user_lat');
243
-            $mylon = $gd_session->get('user_lon');
244
-        }
245
-
246
-        $fields .= " , (" . $DistanceRadius . " * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(" . $table . ".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(" . $table . ".post_latitude) * pi()/180) *POWER(SIN(($mylon - " . $table . ".post_longitude) * pi()/180 / 2), 2) )))as distance ";
247
-    }
248
-
249
-    global $s;
250
-    if (is_search() && isset($_REQUEST['geodir_search']) && $s && trim($s) != '') {
251
-        $keywords = explode(" ", $s);
252
-
253
-        if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
254
-            foreach($keywords as $kkey=>$kword){
255
-                if(mb_strlen($kword, 'UTF-8')<=$klimit){
256
-                    unset($keywords[$kkey]);
257
-                }
258
-            }
259
-        }
242
+			$mylat = $gd_session->get('user_lat');
243
+			$mylon = $gd_session->get('user_lon');
244
+		}
260 245
 
246
+		$fields .= " , (" . $DistanceRadius . " * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(" . $table . ".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(" . $table . ".post_latitude) * pi()/180) *POWER(SIN(($mylon - " . $table . ".post_longitude) * pi()/180 / 2), 2) )))as distance ";
247
+	}
261 248
 
262
-        if (count($keywords) > 1) {
263
-            $parts = array(
264
-                'AND' => 'gd_alltitlematch_part',
265
-                'OR' => 'gd_titlematch_part'
266
-            );
267
-            $gd_titlematch_part = "";
268
-            foreach ($parts as $key => $part) {
269
-                $gd_titlematch_part .= " CASE WHEN ";
270
-                $count = 0;
271
-                foreach ($keywords as $keyword) {
272
-                    $keyword = trim($keyword);
273
-                    $keyword  = wp_specialchars_decode($keyword ,ENT_QUOTES);
249
+	global $s;
250
+	if (is_search() && isset($_REQUEST['geodir_search']) && $s && trim($s) != '') {
251
+		$keywords = explode(" ", $s);
252
+
253
+		if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
254
+			foreach($keywords as $kkey=>$kword){
255
+				if(mb_strlen($kword, 'UTF-8')<=$klimit){
256
+					unset($keywords[$kkey]);
257
+				}
258
+			}
259
+		}
260
+
261
+
262
+		if (count($keywords) > 1) {
263
+			$parts = array(
264
+				'AND' => 'gd_alltitlematch_part',
265
+				'OR' => 'gd_titlematch_part'
266
+			);
267
+			$gd_titlematch_part = "";
268
+			foreach ($parts as $key => $part) {
269
+				$gd_titlematch_part .= " CASE WHEN ";
270
+				$count = 0;
271
+				foreach ($keywords as $keyword) {
272
+					$keyword = trim($keyword);
273
+					$keyword  = wp_specialchars_decode($keyword ,ENT_QUOTES);
274 274
 					$count++;
275
-                    if ($count < count($keywords)) {
276
-                       // $gd_titlematch_part .= $wpdb->posts . ".post_title LIKE '%%" . $keyword . "%%' " . $key . " ";
275
+					if ($count < count($keywords)) {
276
+					   // $gd_titlematch_part .= $wpdb->posts . ".post_title LIKE '%%" . $keyword . "%%' " . $key . " ";
277 277
 						$gd_titlematch_part .= "( " . $wpdb->posts . ".post_title LIKE '" . $keyword . "' OR " . $wpdb->posts . ".post_title LIKE '" . $keyword . "%%' OR " . $wpdb->posts . ".post_title LIKE '%% " . $keyword . "%%' ) " . $key . " ";
278
-                    } else {
279
-                        //$gd_titlematch_part .= $wpdb->posts . ".post_title LIKE '%%" . $keyword . "%%' ";
278
+					} else {
279
+						//$gd_titlematch_part .= $wpdb->posts . ".post_title LIKE '%%" . $keyword . "%%' ";
280 280
 						$gd_titlematch_part .= "( " . $wpdb->posts . ".post_title LIKE '" . $keyword . "' OR " . $wpdb->posts . ".post_title LIKE '" . $keyword . "%%' OR " . $wpdb->posts . ".post_title LIKE '%% " . $keyword . "%%' ) ";
281
-                    }
282
-                }
283
-                $gd_titlematch_part .= "THEN 1 ELSE 0 END AS " . $part . ",";
284
-            }
285
-        } else {
286
-            $gd_titlematch_part = "";
287
-        }
288
-        $s = stripslashes_deep( $s );
289
-        $s = wp_specialchars_decode($s,ENT_QUOTES);
281
+					}
282
+				}
283
+				$gd_titlematch_part .= "THEN 1 ELSE 0 END AS " . $part . ",";
284
+			}
285
+		} else {
286
+			$gd_titlematch_part = "";
287
+		}
288
+		$s = stripslashes_deep( $s );
289
+		$s = wp_specialchars_decode($s,ENT_QUOTES);
290 290
 		$fields .= $wpdb->prepare(", CASE WHEN " . $table . ".is_featured='1' THEN 1 ELSE 0 END AS gd_featured, CASE WHEN " . $wpdb->posts . ".post_title LIKE %s THEN 1 ELSE 0 END AS gd_exacttitle," . $gd_titlematch_part . " CASE WHEN ( " . $wpdb->posts . ".post_title LIKE %s OR " . $wpdb->posts . ".post_title LIKE %s OR " . $wpdb->posts . ".post_title LIKE %s ) THEN 1 ELSE 0 END AS gd_titlematch, CASE WHEN ( " . $wpdb->posts . ".post_content LIKE %s OR " . $wpdb->posts . ".post_content LIKE %s OR " . $wpdb->posts . ".post_content LIKE %s OR " . $wpdb->posts . ".post_content LIKE %s ) THEN 1 ELSE 0 END AS gd_content", array($s, $s, $s . '%', '% ' . $s . '%', $s, $s . ' %', '% ' . $s . ' %', '% ' . $s));
291
-    }
291
+	}
292 292
 
293
-    return $fields;
293
+	return $fields;
294 294
 }
295 295
 
296 296
 
@@ -307,26 +307,26 @@  discard block
 block discarded – undo
307 307
  */
308 308
 function geodir_posts_join($join)
309 309
 {
310
-    global $wpdb, $geodir_post_type, $table, $table_prefix, $plugin_prefix;
310
+	global $wpdb, $geodir_post_type, $table, $table_prefix, $plugin_prefix;
311 311
 
312
-    ########### WPML ###########
312
+	########### WPML ###########
313 313
 
314
-    if (function_exists('icl_object_id')) {
315
-        global $sitepress;
316
-        $lang_code = ICL_LANGUAGE_CODE;
317
-        $default_lang_code = $sitepress->get_default_language();
318
-        if ($lang_code) {
319
-            $join .= "JOIN " . $table_prefix . "icl_translations icl_t ON icl_t.element_id = " . $table_prefix . "posts.ID";
320
-        }
314
+	if (function_exists('icl_object_id')) {
315
+		global $sitepress;
316
+		$lang_code = ICL_LANGUAGE_CODE;
317
+		$default_lang_code = $sitepress->get_default_language();
318
+		if ($lang_code) {
319
+			$join .= "JOIN " . $table_prefix . "icl_translations icl_t ON icl_t.element_id = " . $table_prefix . "posts.ID";
320
+		}
321 321
 
322
-    }
323
-    ########### WPML ###########
322
+	}
323
+	########### WPML ###########
324 324
 
325
-    $join .= " INNER JOIN " . $table . " ON (" . $table . ".post_id = $wpdb->posts.ID)  ";
326
-    //===old code start
327
-    //$join .= " INNER JOIN ".POST_LOCATION_TABLE." ON (".$table.".post_location_id = ".POST_LOCATION_TABLE.".location_id)  " ;//===old code end
325
+	$join .= " INNER JOIN " . $table . " ON (" . $table . ".post_id = $wpdb->posts.ID)  ";
326
+	//===old code start
327
+	//$join .= " INNER JOIN ".POST_LOCATION_TABLE." ON (".$table.".post_location_id = ".POST_LOCATION_TABLE.".location_id)  " ;//===old code end
328 328
 
329
-    return $join;
329
+	return $join;
330 330
 }
331 331
 
332 332
 
@@ -344,15 +344,15 @@  discard block
 block discarded – undo
344 344
  */
345 345
 function geodir_posts_orderby($orderby)
346 346
 {
347
-    global $wpdb, $wp_query, $geodir_post_type, $table, $plugin_prefix, $snear, $default_sort;
347
+	global $wpdb, $wp_query, $geodir_post_type, $table, $plugin_prefix, $snear, $default_sort;
348 348
 
349
-    $sort_by = '';
350
-    $orderby = ' ';
349
+	$sort_by = '';
350
+	$orderby = ' ';
351 351
 
352
-    if (get_query_var('order_by'))
353
-        $sort_by = get_query_var('order_by');
352
+	if (get_query_var('order_by'))
353
+		$sort_by = get_query_var('order_by');
354 354
 
355
-    /*if(isset($wp_query->tax_query->queries) && $wp_query->tax_query->queries){
355
+	/*if(isset($wp_query->tax_query->queries) && $wp_query->tax_query->queries){
356 356
         $current_term = $wp_query->get_queried_object();
357 357
     }
358 358
 
@@ -366,116 +366,116 @@  discard block
 block discarded – undo
366 366
     }*/
367 367
 
368 368
 
369
-    if ($snear != '') {
370
-        $orderby .= " distance,";
371
-    }
369
+	if ($snear != '') {
370
+		$orderby .= " distance,";
371
+	}
372 372
 
373
-    if (isset($_REQUEST['sort_by']) && $_REQUEST['sort_by'] != '' && is_main_query())
374
-        $sort_by = esc_attr($_REQUEST['sort_by']);
373
+	if (isset($_REQUEST['sort_by']) && $_REQUEST['sort_by'] != '' && is_main_query())
374
+		$sort_by = esc_attr($_REQUEST['sort_by']);
375 375
 
376 376
 
377
-    if ($sort_by == '') {
378
-        $default_sort = geodir_get_posts_default_sort($geodir_post_type);
379
-        if (!empty($default_sort))
380
-            $sort_by = $default_sort;
381
-    }
377
+	if ($sort_by == '') {
378
+		$default_sort = geodir_get_posts_default_sort($geodir_post_type);
379
+		if (!empty($default_sort))
380
+			$sort_by = $default_sort;
381
+	}
382 382
 
383
-    /*
383
+	/*
384 384
     if search by term & no location then order always "relevance"
385 385
     if search by location then order always "nearest"
386 386
     */
387
-    if (is_main_query() && geodir_is_page('search')) {
388
-        $search_term = get_query_var('s');
387
+	if (is_main_query() && geodir_is_page('search')) {
388
+		$search_term = get_query_var('s');
389 389
 
390
-        if (trim($search_term) != '' && !isset($_REQUEST['sort_by'])) {
391
-            $sort_by = 'az';
392
-        }
390
+		if (trim($search_term) != '' && !isset($_REQUEST['sort_by'])) {
391
+			$sort_by = 'az';
392
+		}
393 393
 
394
-        if ($snear != '') {
395
-            $sort_by = 'nearest';
396
-        }
397
-    }
394
+		if ($snear != '') {
395
+			$sort_by = 'nearest';
396
+		}
397
+	}
398 398
 
399
-    switch ($sort_by):
400
-        case 'newest':
401
-            $orderby = "$wpdb->posts.post_date desc, ";
402
-            break;
403
-        case 'oldest':
404
-            $orderby = "$wpdb->posts.post_date asc, ";
405
-            break;
406
-        case 'low_review':
407
-        case 'rating_count_asc':
408
-            $orderby = $table . ".rating_count ASC, " . $table . ".overall_rating ASC, ";
409
-            break;
410
-        case 'high_review':
411
-        case 'rating_count_desc':
399
+	switch ($sort_by):
400
+		case 'newest':
401
+			$orderby = "$wpdb->posts.post_date desc, ";
402
+			break;
403
+		case 'oldest':
404
+			$orderby = "$wpdb->posts.post_date asc, ";
405
+			break;
406
+		case 'low_review':
407
+		case 'rating_count_asc':
408
+			$orderby = $table . ".rating_count ASC, " . $table . ".overall_rating ASC, ";
409
+			break;
410
+		case 'high_review':
411
+		case 'rating_count_desc':
412 412
 			$orderby = $table . ".rating_count DESC, " . $table . ".overall_rating DESC, ";
413
-            break;
414
-        case 'low_rating':
415
-            $orderby = "( " . $table . ".overall_rating  ) ASC, " . $table . ".rating_count ASC,  ";
416
-            break;
417
-        case 'high_rating':
418
-            $orderby = " " . $table . ".overall_rating DESC, " . $table . ".rating_count DESC, ";
419
-            break;
420
-        case 'featured':
421
-            $orderby = $table . ".is_featured asc, ";
422
-            break;
423
-        case 'nearest':
424
-            $orderby = " distance asc, ";
425
-            break;
426
-        case 'farthest':
427
-            $orderby = " distance desc, ";
428
-            break;
429
-        case 'random':
430
-            $orderby = " rand(), ";
431
-            break;
432
-        case 'az':
433
-            $orderby = "$wpdb->posts.post_title asc, ";
434
-            break;
435
-        default:
436
-
437
-            break;
438
-    endswitch;
439
-
440
-    global $s;
441
-
442
-    if (is_search() && isset($_REQUEST['geodir_search']) && $s && trim($s) != '') {
443
-        $keywords = explode(" ", $s);
444
-        if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
445
-            foreach($keywords as $kkey=>$kword){
446
-                if(mb_strlen($kword, 'UTF-8')<=$klimit){
447
-                    unset($keywords[$kkey]);
448
-                }
449
-            }
450
-        }
451
-        if ($sort_by == 'nearest' || $sort_by == 'farthest') {
452
-            if (count($keywords) > 1) {
453
-                $orderby = $orderby . " ( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_alltitlematch_part * 100 + gd_titlematch_part * 50 + gd_content * 1.5) DESC, ";
454
-            } else {
455
-                $orderby = $orderby . " ( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_content * 1.5) DESC, ";
456
-            }
457
-        } else {
458
-            if (count($keywords) > 1) {
459
-                $orderby = "( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_alltitlematch_part * 100 + gd_titlematch_part * 50 + gd_content * 1.5) DESC, " . $orderby;
460
-            } else {
461
-                $orderby = "( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_content * 1.5) DESC, " . $orderby;
462
-            }
463
-        }
464
-    }
413
+			break;
414
+		case 'low_rating':
415
+			$orderby = "( " . $table . ".overall_rating  ) ASC, " . $table . ".rating_count ASC,  ";
416
+			break;
417
+		case 'high_rating':
418
+			$orderby = " " . $table . ".overall_rating DESC, " . $table . ".rating_count DESC, ";
419
+			break;
420
+		case 'featured':
421
+			$orderby = $table . ".is_featured asc, ";
422
+			break;
423
+		case 'nearest':
424
+			$orderby = " distance asc, ";
425
+			break;
426
+		case 'farthest':
427
+			$orderby = " distance desc, ";
428
+			break;
429
+		case 'random':
430
+			$orderby = " rand(), ";
431
+			break;
432
+		case 'az':
433
+			$orderby = "$wpdb->posts.post_title asc, ";
434
+			break;
435
+		default:
436
+
437
+			break;
438
+	endswitch;
439
+
440
+	global $s;
441
+
442
+	if (is_search() && isset($_REQUEST['geodir_search']) && $s && trim($s) != '') {
443
+		$keywords = explode(" ", $s);
444
+		if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
445
+			foreach($keywords as $kkey=>$kword){
446
+				if(mb_strlen($kword, 'UTF-8')<=$klimit){
447
+					unset($keywords[$kkey]);
448
+				}
449
+			}
450
+		}
451
+		if ($sort_by == 'nearest' || $sort_by == 'farthest') {
452
+			if (count($keywords) > 1) {
453
+				$orderby = $orderby . " ( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_alltitlematch_part * 100 + gd_titlematch_part * 50 + gd_content * 1.5) DESC, ";
454
+			} else {
455
+				$orderby = $orderby . " ( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_content * 1.5) DESC, ";
456
+			}
457
+		} else {
458
+			if (count($keywords) > 1) {
459
+				$orderby = "( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_alltitlematch_part * 100 + gd_titlematch_part * 50 + gd_content * 1.5) DESC, " . $orderby;
460
+			} else {
461
+				$orderby = "( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_content * 1.5) DESC, " . $orderby;
462
+			}
463
+		}
464
+	}
465 465
 
466
-    /**
467
-     * Filter order by SQL.
468
-     *
469
-     * @since 1.0.0
470
-     * @param string $orderby The orderby query string.
471
-     * @param string $sort_by Sortby query string.
472
-     * @param string $table Listing table name.
473
-     */
474
-    $orderby = apply_filters('geodir_posts_order_by_sort', $orderby, $sort_by, $table);
466
+	/**
467
+	 * Filter order by SQL.
468
+	 *
469
+	 * @since 1.0.0
470
+	 * @param string $orderby The orderby query string.
471
+	 * @param string $sort_by Sortby query string.
472
+	 * @param string $table Listing table name.
473
+	 */
474
+	$orderby = apply_filters('geodir_posts_order_by_sort', $orderby, $sort_by, $table);
475 475
 
476
-    $orderby .= $table . ".is_featured asc, $wpdb->posts.post_date desc, $wpdb->posts.post_title ";
476
+	$orderby .= $table . ".is_featured asc, $wpdb->posts.post_date desc, $wpdb->posts.post_title ";
477 477
 
478
-    return $orderby;
478
+	return $orderby;
479 479
 }
480 480
 
481 481
 
@@ -493,53 +493,53 @@  discard block
 block discarded – undo
493 493
 function geodir_posts_order_by_custom_sort($orderby, $sort_by, $table)
494 494
 {
495 495
 
496
-    global $wpdb;
496
+	global $wpdb;
497 497
 
498
-    if ($sort_by != '' && !is_search()) {
498
+	if ($sort_by != '' && !is_search()) {
499 499
 
500
-        $sort_array = explode('_', $sort_by);
500
+		$sort_array = explode('_', $sort_by);
501 501
 
502
-        $sort_by_count = count($sort_array);
502
+		$sort_by_count = count($sort_array);
503 503
 
504
-        $order = $sort_array[$sort_by_count - 1];
504
+		$order = $sort_array[$sort_by_count - 1];
505 505
 
506
-        if ($sort_by_count > 1 && ($order == 'asc' || $order == 'desc')) {
506
+		if ($sort_by_count > 1 && ($order == 'asc' || $order == 'desc')) {
507 507
 
508
-            $sort_by = str_replace('_' . $order, '', $sort_by);
508
+			$sort_by = str_replace('_' . $order, '', $sort_by);
509 509
 
510
-            switch ($sort_by):
510
+			switch ($sort_by):
511 511
 
512
-                case 'post_date':
513
-                case 'comment_count':
512
+				case 'post_date':
513
+				case 'comment_count':
514 514
 
515
-                    $orderby = "$wpdb->posts." . $sort_by . " " . $order . ", ".$table . ".overall_rating " . $order . ", ";
516
-                    break;
515
+					$orderby = "$wpdb->posts." . $sort_by . " " . $order . ", ".$table . ".overall_rating " . $order . ", ";
516
+					break;
517 517
 
518
-                case 'distance':
519
-                    $orderby = $sort_by . " " . $order . ", ";
520
-                    break;
518
+				case 'distance':
519
+					$orderby = $sort_by . " " . $order . ", ";
520
+					break;
521 521
 
522 522
 
523
-                // sort by rating
524
-                case 'overall_rating':
525
-                    $orderby = " " . $table . "." . $sort_by . "  " . $order . ", " . $table . ".rating_count " . $order . ", ";
523
+				// sort by rating
524
+				case 'overall_rating':
525
+					$orderby = " " . $table . "." . $sort_by . "  " . $order . ", " . $table . ".rating_count " . $order . ", ";
526 526
 
527
-                    break;
527
+					break;
528 528
 
529 529
 
530
-                default:
531
-                    if (geodir_column_exist($table, $sort_by)) {
530
+				default:
531
+					if (geodir_column_exist($table, $sort_by)) {
532 532
 						$orderby = $table . "." . $sort_by . " " . $order . ", ";
533 533
 					}
534
-                    break;
534
+					break;
535 535
 
536
-            endswitch;
536
+			endswitch;
537 537
 
538
-        }
538
+		}
539 539
 
540
-    }
540
+	}
541 541
 
542
-    return $orderby;
542
+	return $orderby;
543 543
 }
544 544
 
545 545
 /**
@@ -554,34 +554,34 @@  discard block
 block discarded – undo
554 554
 {
555 555
 
556 556
 
557
-    global $wpdb, $geodir_post_type, $table, $s, $snear;
557
+	global $wpdb, $geodir_post_type, $table, $s, $snear;
558 558
 
559
-    if (!is_admin()) {
559
+	if (!is_admin()) {
560 560
 
561
-        if (geodir_is_page('add-listing') && isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
562
-            add_filter('posts_where', 'geodir_edit_listing_where', 1);
561
+		if (geodir_is_page('add-listing') && isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
562
+			add_filter('posts_where', 'geodir_edit_listing_where', 1);
563 563
 
564
-        } elseif ((is_search() && $_REQUEST['geodir_search'])) {
564
+		} elseif ((is_search() && $_REQUEST['geodir_search'])) {
565 565
 
566
-            add_filter('posts_where', 'searching_filter_where', 1);
566
+			add_filter('posts_where', 'searching_filter_where', 1);
567 567
 
568
-            if ($snear != '')
569
-                add_filter('posts_where', 'searching_filter_where', 1);
568
+			if ($snear != '')
569
+				add_filter('posts_where', 'searching_filter_where', 1);
570 570
 
571
-            add_filter('posts_orderby', 'geodir_posts_orderby', 1);
571
+			add_filter('posts_orderby', 'geodir_posts_orderby', 1);
572 572
 
573
-        } elseif (geodir_is_page('author')) {
573
+		} elseif (geodir_is_page('author')) {
574 574
 
575
-            add_filter('posts_where', 'author_filter_where', 1);
575
+			add_filter('posts_where', 'author_filter_where', 1);
576 576
 
577
-        }
577
+		}
578 578
 
579
-        //if (!geodir_is_page('detail'))
580
-            add_filter('posts_where', 'geodir_default_where', 1);/**/
579
+		//if (!geodir_is_page('detail'))
580
+			add_filter('posts_where', 'geodir_default_where', 1);/**/
581 581
 
582
-        //add_filter( 'user_has_cap', 'geodir_preview_post_cap', 10, 3 );// let subscribers edit their own posts
582
+		//add_filter( 'user_has_cap', 'geodir_preview_post_cap', 10, 3 );// let subscribers edit their own posts
583 583
 
584
-    }
584
+	}
585 585
 }
586 586
 
587 587
 /**
@@ -596,13 +596,13 @@  discard block
 block discarded – undo
596 596
  */
597 597
 function geodir_preview_post_cap($allcaps, $caps, $args)
598 598
 {
599
-    $user_id = get_current_user_id();
600
-    if ($user_id && isset($_REQUEST['post_type']) && $_REQUEST['post_type'] != '' && isset($_REQUEST['p']) && $_REQUEST['p'] != '' && $args[0] == 'edit_post' && $_REQUEST['p'] == $args[2]) {
599
+	$user_id = get_current_user_id();
600
+	if ($user_id && isset($_REQUEST['post_type']) && $_REQUEST['post_type'] != '' && isset($_REQUEST['p']) && $_REQUEST['p'] != '' && $args[0] == 'edit_post' && $_REQUEST['p'] == $args[2]) {
601 601
 
602
-        $allcaps['edit_posts'] = true;
603
-    }
604
-    //print_r($allcaps);
605
-    return $allcaps;
602
+		$allcaps['edit_posts'] = true;
603
+	}
604
+	//print_r($allcaps);
605
+	return $allcaps;
606 606
 }
607 607
 
608 608
 
@@ -617,9 +617,9 @@  discard block
 block discarded – undo
617 617
  */
618 618
 function geodir_edit_listing_where($where)
619 619
 {
620
-    global $wpdb;
621
-    $where = $wpdb->prepare(" AND $wpdb->posts.ID = %d ", $_REQUEST['pid']);
622
-    return $where;
620
+	global $wpdb;
621
+	$where = $wpdb->prepare(" AND $wpdb->posts.ID = %d ", $_REQUEST['pid']);
622
+	return $where;
623 623
 }
624 624
 
625 625
 
@@ -636,29 +636,29 @@  discard block
 block discarded – undo
636 636
  */
637 637
 function geodir_default_where($where)
638 638
 {
639
-    global $wp_query, $wpdb;
640
-
641
-    //print_r($wp_query);
642
-    ########### WPML ###########
643
-
644
-    if (function_exists('icl_object_id')) {
645
-        global $sitepress, $table_prefix;
646
-        $lang_code = ICL_LANGUAGE_CODE;
647
-        $default_lang_code = $sitepress->get_default_language();
648
-        $q_post_type = isset($wp_query->query['post_type']) ? $wp_query->query['post_type'] : '';
649
-        //echo '##########'.$q_post_type;
650
-        if ($lang_code && $q_post_type) {
651
-            $where .= " AND icl_t.language_code = '$lang_code' AND icl_t.element_type IN('post_" . $q_post_type . "') ";
652
-            //$where .= " AND icl_t.language_code = '$lang_code' ";
653
-        }
639
+	global $wp_query, $wpdb;
654 640
 
655
-    }
656
-    ########### WPML ###########
641
+	//print_r($wp_query);
642
+	########### WPML ###########
657 643
 
644
+	if (function_exists('icl_object_id')) {
645
+		global $sitepress, $table_prefix;
646
+		$lang_code = ICL_LANGUAGE_CODE;
647
+		$default_lang_code = $sitepress->get_default_language();
648
+		$q_post_type = isset($wp_query->query['post_type']) ? $wp_query->query['post_type'] : '';
649
+		//echo '##########'.$q_post_type;
650
+		if ($lang_code && $q_post_type) {
651
+			$where .= " AND icl_t.language_code = '$lang_code' AND icl_t.element_type IN('post_" . $q_post_type . "') ";
652
+			//$where .= " AND icl_t.language_code = '$lang_code' ";
653
+		}
654
+
655
+	}
656
+	########### WPML ###########
658 657
 
659
-    return $where = str_replace("0 = 1", "1=1", $where);
660 658
 
661
-    /* ====== old code start ===
659
+	return $where = str_replace("0 = 1", "1=1", $where);
660
+
661
+	/* ====== old code start ===
662 662
     $where = str_replace("0 = 1", "1=1", $where);
663 663
     $country = get_query_var('gd_country');
664 664
     $region = get_query_var('gd_region');
@@ -699,108 +699,108 @@  discard block
 block discarded – undo
699 699
  * @return string Modified where query string.
700 700
  */
701 701
 function searching_filter_where($where) {
702
-    global $wpdb, $geodir_post_type, $table, $plugin_prefix, $dist, $mylat, $mylon, $s, $snear, $s_A, $s_SA, $search_term, $gd_session;
702
+	global $wpdb, $geodir_post_type, $table, $plugin_prefix, $dist, $mylat, $mylon, $s, $snear, $s_A, $s_SA, $search_term, $gd_session;
703 703
 	
704
-    $search_term = 'OR';
705
-    $search_term = 'AND';
706
-    $geodir_custom_search = '';
707
-    $category_search_range = '';
704
+	$search_term = 'OR';
705
+	$search_term = 'AND';
706
+	$geodir_custom_search = '';
707
+	$category_search_range = '';
708 708
 
709
-    if (is_single() && get_query_var('post_type')) {
709
+	if (is_single() && get_query_var('post_type')) {
710 710
 		return $where;
711 711
 	}
712 712
 
713
-    if (is_tax()) {
713
+	if (is_tax()) {
714 714
 		return $where;
715 715
 	}
716 716
 	
717 717
 	$s = trim($s);
718
-    $s  = wp_specialchars_decode($s ,ENT_QUOTES);
719
-    $s_A = wp_specialchars_decode($s_A ,ENT_QUOTES);
720
-
721
-    $where = '';
722
-    $better_search_terms = '';
723
-    if (isset($_REQUEST['stype']))
724
-        $post_types = esc_attr(wp_strip_all_tags($_REQUEST['stype']));
725
-    else
726
-        $post_types = 'gd_place';
727
-
728
-    if ($s != '') {
729
-        $keywords = explode(" ", $s);
730
-        if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
731
-            foreach($keywords as $kkey=>$kword){
732
-                if(mb_strlen($kword, 'UTF-8')<=$klimit){
733
-                    unset($keywords[$kkey]);
734
-                }
735
-            }
736
-        }
718
+	$s  = wp_specialchars_decode($s ,ENT_QUOTES);
719
+	$s_A = wp_specialchars_decode($s_A ,ENT_QUOTES);
720
+
721
+	$where = '';
722
+	$better_search_terms = '';
723
+	if (isset($_REQUEST['stype']))
724
+		$post_types = esc_attr(wp_strip_all_tags($_REQUEST['stype']));
725
+	else
726
+		$post_types = 'gd_place';
737 727
 
738
-        if (!empty($keywords)) {
739
-            foreach ($keywords as $keyword) {
740
-                $keyword = trim($keyword);
741
-                $keyword  = wp_specialchars_decode($keyword ,ENT_QUOTES);
742
-                if ($keyword != '') {
743
-                    /**
744
-                     * Filter the search query keywords SQL.
745
-                     *
746
-                     * @since 1.5.9
747
-                     * @package GeoDirectory
748
-                     * @param string $better_search_terms The query values, default: `' OR ( ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '" OR ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '%" OR ' . $wpdb->posts . '.post_title LIKE "% ' . $keyword . '%" )'`.
749
-                     * @param array $keywords The array of keywords for the query.
750
-                     * @param string $keyword The single keyword being searched.
751
-                     */
728
+	if ($s != '') {
729
+		$keywords = explode(" ", $s);
730
+		if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
731
+			foreach($keywords as $kkey=>$kword){
732
+				if(mb_strlen($kword, 'UTF-8')<=$klimit){
733
+					unset($keywords[$kkey]);
734
+				}
735
+			}
736
+		}
737
+
738
+		if (!empty($keywords)) {
739
+			foreach ($keywords as $keyword) {
740
+				$keyword = trim($keyword);
741
+				$keyword  = wp_specialchars_decode($keyword ,ENT_QUOTES);
742
+				if ($keyword != '') {
743
+					/**
744
+					 * Filter the search query keywords SQL.
745
+					 *
746
+					 * @since 1.5.9
747
+					 * @package GeoDirectory
748
+					 * @param string $better_search_terms The query values, default: `' OR ( ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '" OR ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '%" OR ' . $wpdb->posts . '.post_title LIKE "% ' . $keyword . '%" )'`.
749
+					 * @param array $keywords The array of keywords for the query.
750
+					 * @param string $keyword The single keyword being searched.
751
+					 */
752 752
 					$better_search_terms .= apply_filters("geodir_search_better_search_terms",' OR ( ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '" OR ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '%" OR ' . $wpdb->posts . '.post_title LIKE "% ' . $keyword . '%" )',$keywords,$keyword);
753
-                }
754
-            }
755
-        }
756
-    }
753
+				}
754
+			}
755
+		}
756
+	}
757 757
 
758
-    /* get taxonomy */
759
-    $taxonomies = geodir_get_taxonomies($post_types, true);
760
-    if($taxonomies) {
761
-        $taxonomies = implode("','", $taxonomies);
762
-        $taxonomies = "'" . $taxonomies . "'";
763
-    }else{$taxonomies='';}
758
+	/* get taxonomy */
759
+	$taxonomies = geodir_get_taxonomies($post_types, true);
760
+	if($taxonomies) {
761
+		$taxonomies = implode("','", $taxonomies);
762
+		$taxonomies = "'" . $taxonomies . "'";
763
+	}else{$taxonomies='';}
764 764
 
765
-    $content_where = $terms_where = '';
765
+	$content_where = $terms_where = '';
766 766
 	if ($s != '') {
767
-        /**
768
-         * Filter the search query content where values.
769
-         *
770
-         * @since 1.5.0
771
-         * @package GeoDirectory
772
-         * @param string $content_where The query values, default: `" OR ($wpdb->posts.post_content LIKE \"$s\" OR $wpdb->posts.post_content LIKE \"$s%\" OR $wpdb->posts.post_content LIKE \"% $s%\" OR $wpdb->posts.post_content LIKE \"%>$s%\" OR $wpdb->posts.post_content LIKE \"%\n$s%\") ") "`.
773
-         */
767
+		/**
768
+		 * Filter the search query content where values.
769
+		 *
770
+		 * @since 1.5.0
771
+		 * @package GeoDirectory
772
+		 * @param string $content_where The query values, default: `" OR ($wpdb->posts.post_content LIKE \"$s\" OR $wpdb->posts.post_content LIKE \"$s%\" OR $wpdb->posts.post_content LIKE \"% $s%\" OR $wpdb->posts.post_content LIKE \"%>$s%\" OR $wpdb->posts.post_content LIKE \"%\n$s%\") ") "`.
773
+		 */
774 774
 		$content_where = apply_filters("geodir_search_content_where"," OR ($wpdb->posts.post_content LIKE \"$s\" OR $wpdb->posts.post_content LIKE \"$s%\" OR $wpdb->posts.post_content LIKE \"% $s%\" OR $wpdb->posts.post_content LIKE \"%>$s%\" OR $wpdb->posts.post_content LIKE \"%\n$s%\") ");
775
-        /**
776
-         * Filter the search query term values.
777
-         *
778
-         * @since 1.5.0
779
-         * @package GeoDirectory
780
-         * @param string $terms_where The separator, default: `" AND ($wpdb->terms.name LIKE \"$s\" OR $wpdb->terms.name LIKE \"$s%\" OR $wpdb->terms.name LIKE \"% $s%\" OR $wpdb->terms.name IN ($s_A)) "`.
781
-         */
782
-        $terms_where = apply_filters("geodir_search_terms_where"," AND ($wpdb->terms.name LIKE \"$s\" OR $wpdb->terms.name LIKE \"$s%\" OR $wpdb->terms.name LIKE \"% $s%\" OR $wpdb->terms.name IN ($s_A)) ");
775
+		/**
776
+		 * Filter the search query term values.
777
+		 *
778
+		 * @since 1.5.0
779
+		 * @package GeoDirectory
780
+		 * @param string $terms_where The separator, default: `" AND ($wpdb->terms.name LIKE \"$s\" OR $wpdb->terms.name LIKE \"$s%\" OR $wpdb->terms.name LIKE \"% $s%\" OR $wpdb->terms.name IN ($s_A)) "`.
781
+		 */
782
+		$terms_where = apply_filters("geodir_search_terms_where"," AND ($wpdb->terms.name LIKE \"$s\" OR $wpdb->terms.name LIKE \"$s%\" OR $wpdb->terms.name LIKE \"% $s%\" OR $wpdb->terms.name IN ($s_A)) ");
783 783
 	}
784 784
 		
785
-    if ($snear != '') {
785
+	if ($snear != '') {
786 786
 
787 787
 
788
-        if (is_numeric($gd_session->get('near_me_range')) && !isset($_REQUEST['sdist'])) {
789
-            $dist = $gd_session->get('near_me_range');
790
-        }
791
-        $lon1 = $mylon - $dist / abs(cos(deg2rad($mylat)) * 69);
792
-        $lon2 = $mylon + $dist / abs(cos(deg2rad($mylat)) * 69);
793
-        $lat1 = $mylat - ($dist / 69);
794
-        $lat2 = $mylat + ($dist / 69);
788
+		if (is_numeric($gd_session->get('near_me_range')) && !isset($_REQUEST['sdist'])) {
789
+			$dist = $gd_session->get('near_me_range');
790
+		}
791
+		$lon1 = $mylon - $dist / abs(cos(deg2rad($mylat)) * 69);
792
+		$lon2 = $mylon + $dist / abs(cos(deg2rad($mylat)) * 69);
793
+		$lat1 = $mylat - ($dist / 69);
794
+		$lat2 = $mylat + ($dist / 69);
795 795
 
796
-        $rlon1 = is_numeric(min($lon1, $lon2)) ? min($lon1, $lon2) : '';
797
-        $rlon2 = is_numeric(max($lon1, $lon2)) ? max($lon1, $lon2) : '';
798
-        $rlat1 = is_numeric(min($lat1, $lat2)) ? min($lat1, $lat2) : '';
799
-        $rlat2 = is_numeric(max($lat1, $lat2)) ? max($lat1, $lat2) : '';
796
+		$rlon1 = is_numeric(min($lon1, $lon2)) ? min($lon1, $lon2) : '';
797
+		$rlon2 = is_numeric(max($lon1, $lon2)) ? max($lon1, $lon2) : '';
798
+		$rlat1 = is_numeric(min($lat1, $lat2)) ? min($lat1, $lat2) : '';
799
+		$rlat2 = is_numeric(max($lat1, $lat2)) ? max($lat1, $lat2) : '';
800 800
 
801 801
 
802 802
 
803
-	    $where .= " AND ( ( $wpdb->posts.post_title LIKE \"$s\" $better_search_terms)
803
+		$where .= " AND ( ( $wpdb->posts.post_title LIKE \"$s\" $better_search_terms)
804 804
 			                    $content_where 
805 805
 								OR ($wpdb->posts.ID IN( 
806 806
 										SELECT $wpdb->term_relationships.object_id as post_id 
@@ -817,13 +817,13 @@  discard block
 block discarded – undo
817 817
 						AND ( " . $table . ".post_latitude between $rlat1 and $rlat2 )
818 818
 						AND ( " . $table . ".post_longitude between $rlon1 and $rlon2 ) ";
819 819
 
820
-        if (isset($_REQUEST['sdist']) && $_REQUEST['sdist'] != 'all') {
821
-            $DistanceRadius = geodir_getDistanceRadius(get_option('geodir_search_dist_1'));
822
-            $where .= " AND CONVERT((" . $DistanceRadius . " * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(" . $table . ".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(" . $table . ".post_latitude) * pi()/180) *POWER(SIN(($mylon - " . $table . ".post_longitude) * pi()/180 / 2), 2) ))),DECIMAL(64,4)) <= " . $dist;
823
-        }
820
+		if (isset($_REQUEST['sdist']) && $_REQUEST['sdist'] != 'all') {
821
+			$DistanceRadius = geodir_getDistanceRadius(get_option('geodir_search_dist_1'));
822
+			$where .= " AND CONVERT((" . $DistanceRadius . " * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(" . $table . ".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(" . $table . ".post_latitude) * pi()/180) *POWER(SIN(($mylon - " . $table . ".post_longitude) * pi()/180 / 2), 2) ))),DECIMAL(64,4)) <= " . $dist;
823
+		}
824 824
 
825
-    } else {
826
-        $where .= " AND (	( $wpdb->posts.post_title LIKE \"$s\" $better_search_terms)
825
+	} else {
826
+		$where .= " AND (	( $wpdb->posts.post_title LIKE \"$s\" $better_search_terms)
827 827
                             $content_where  
828 828
 							OR ( $wpdb->posts.ID IN(	
829 829
 									SELECT $wpdb->term_relationships.object_id as post_id                     
@@ -837,19 +837,19 @@  discard block
 block discarded – undo
837 837
 					) 
838 838
 				AND $wpdb->posts.post_type in ('$post_types')
839 839
 				AND ($wpdb->posts.post_status = 'publish') ";
840
-    }
840
+	}
841 841
 	
842 842
 	########### WPML ###########
843
-    if ( function_exists( 'icl_object_id' ) ) {       
843
+	if ( function_exists( 'icl_object_id' ) ) {       
844 844
 		$lang_code = ICL_LANGUAGE_CODE;
845 845
 		
846 846
 		if ($lang_code && $post_types) {
847
-            $where .= " AND icl_t.language_code = '".$lang_code."' AND icl_t.element_type IN('post_" . $post_types . "') ";
848
-        }
849
-    }
850
-    ########### WPML ###########
847
+			$where .= " AND icl_t.language_code = '".$lang_code."' AND icl_t.element_type IN('post_" . $post_types . "') ";
848
+		}
849
+	}
850
+	########### WPML ###########
851 851
 	
852
-    return $where;
852
+	return $where;
853 853
 }
854 854
 
855 855
 
@@ -864,45 +864,45 @@  discard block
 block discarded – undo
864 864
  * @return string Modified where query string.
865 865
  */
866 866
 function author_filter_where($where) {
867
-    global $wpdb, $geodir_post_type, $table, $curr;
867
+	global $wpdb, $geodir_post_type, $table, $curr;
868 868
 
869
-    $curauth = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
870
-    $user_id = !empty($curauth->ID) ? (int)$curauth->ID : 0;
869
+	$curauth = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
870
+	$user_id = !empty($curauth->ID) ? (int)$curauth->ID : 0;
871 871
     
872
-    if (isset($_REQUEST['stype'])) {
873
-        $where = $wpdb->prepare(" AND $wpdb->posts.post_type IN (%s) ",$_REQUEST['stype']);
874
-    } else {
875
-        $where = " AND $wpdb->posts.post_type IN ('gd_place') ";
876
-    }
872
+	if (isset($_REQUEST['stype'])) {
873
+		$where = $wpdb->prepare(" AND $wpdb->posts.post_type IN (%s) ",$_REQUEST['stype']);
874
+	} else {
875
+		$where = " AND $wpdb->posts.post_type IN ('gd_place') ";
876
+	}
877 877
 
878
-    if ($user_id > 0) {
879
-        if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
880
-            $user_fav_posts = get_user_meta($user_id, 'gd_user_favourite_post', true);
881
-            $user_fav_posts = !empty($user_fav_posts) && is_array($user_fav_posts) ? implode("','", $user_fav_posts) : '-1';
882
-            $where .= " AND $wpdb->posts.ID IN ('$user_fav_posts')";
883
-        } else
884
-            $where .= " AND $wpdb->posts.post_author = $user_id";
885
-
886
-        if ($user_id == (int)get_current_user_id()) {
887
-            $where .= " AND $wpdb->posts.post_status IN ('publish','draft','pending') ";
888
-        } else {
889
-            $where .= " AND $wpdb->posts.post_status = 'publish' ";
890
-        }
891
-    } else {
892
-        $where .= " AND $wpdb->posts.post_author = '-1' AND $wpdb->posts.post_status = 'publish' ";
893
-    }
878
+	if ($user_id > 0) {
879
+		if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
880
+			$user_fav_posts = get_user_meta($user_id, 'gd_user_favourite_post', true);
881
+			$user_fav_posts = !empty($user_fav_posts) && is_array($user_fav_posts) ? implode("','", $user_fav_posts) : '-1';
882
+			$where .= " AND $wpdb->posts.ID IN ('$user_fav_posts')";
883
+		} else
884
+			$where .= " AND $wpdb->posts.post_author = $user_id";
885
+
886
+		if ($user_id == (int)get_current_user_id()) {
887
+			$where .= " AND $wpdb->posts.post_status IN ('publish','draft','pending') ";
888
+		} else {
889
+			$where .= " AND $wpdb->posts.post_status = 'publish' ";
890
+		}
891
+	} else {
892
+		$where .= " AND $wpdb->posts.post_author = '-1' AND $wpdb->posts.post_status = 'publish' ";
893
+	}
894 894
 
895
-    ########### WPML ###########
896
-    if (function_exists('icl_object_id')) {
897
-        $lang_code = ICL_LANGUAGE_CODE;
898
-        if ($lang_code) {
899
-            $where .= " AND icl_t.language_code='" . $lang_code . "' ";
900
-        }
895
+	########### WPML ###########
896
+	if (function_exists('icl_object_id')) {
897
+		$lang_code = ICL_LANGUAGE_CODE;
898
+		if ($lang_code) {
899
+			$where .= " AND icl_t.language_code='" . $lang_code . "' ";
900
+		}
901 901
 
902
-    }
903
-    ########### WPML ###########
902
+	}
903
+	########### WPML ###########
904 904
     
905
-    return $where;
905
+	return $where;
906 906
 }
907 907
 
908 908
 /**
@@ -917,11 +917,11 @@  discard block
 block discarded – undo
917 917
  */
918 918
 function geodir_filter_widget_join($join)
919 919
 {
920
-    global $wp_query, $table;
921
-    if (!empty($wp_query->query['with_pics_only'])) {
922
-        $join .= " LEFT JOIN " . GEODIR_ATTACHMENT_TABLE . " ON ( " . GEODIR_ATTACHMENT_TABLE . ".post_id=" . $table . ".post_id AND " . GEODIR_ATTACHMENT_TABLE . ".mime_type LIKE '%image%' )";
923
-    }
924
-    return $join;
920
+	global $wp_query, $table;
921
+	if (!empty($wp_query->query['with_pics_only'])) {
922
+		$join .= " LEFT JOIN " . GEODIR_ATTACHMENT_TABLE . " ON ( " . GEODIR_ATTACHMENT_TABLE . ".post_id=" . $table . ".post_id AND " . GEODIR_ATTACHMENT_TABLE . ".mime_type LIKE '%image%' )";
923
+	}
924
+	return $join;
925 925
 }
926 926
 
927 927
 /**
@@ -936,47 +936,47 @@  discard block
 block discarded – undo
936 936
  */
937 937
 function geodir_filter_widget_where($where)
938 938
 {
939
-    global $wp_query, $table;
940
-    if (!empty($wp_query->query['show_featured_only'])) {
941
-        $where .= " AND " . $table . ".is_featured = '1'";
942
-    }
943
-    if (!empty($wp_query->query['show_special_only'])) {
944
-        $where .= " AND ( " . $table . ".geodir_special_offers != '' AND " . $table . ".geodir_special_offers IS NOT NULL )";
945
-    }
946
-    if (!empty($wp_query->query['with_pics_only'])) {
947
-        $where .= " AND " . GEODIR_ATTACHMENT_TABLE . ".ID IS NOT NULL GROUP BY " . $table . ".post_id";
948
-    }
949
-    if (!empty($wp_query->query['with_videos_only'])) {
950
-        $where .= " AND ( " . $table . ".geodir_video != '' AND " . $table . ".geodir_video IS NOT NULL )";
951
-    }
952
-    return $where;
939
+	global $wp_query, $table;
940
+	if (!empty($wp_query->query['show_featured_only'])) {
941
+		$where .= " AND " . $table . ".is_featured = '1'";
942
+	}
943
+	if (!empty($wp_query->query['show_special_only'])) {
944
+		$where .= " AND ( " . $table . ".geodir_special_offers != '' AND " . $table . ".geodir_special_offers IS NOT NULL )";
945
+	}
946
+	if (!empty($wp_query->query['with_pics_only'])) {
947
+		$where .= " AND " . GEODIR_ATTACHMENT_TABLE . ".ID IS NOT NULL GROUP BY " . $table . ".post_id";
948
+	}
949
+	if (!empty($wp_query->query['with_videos_only'])) {
950
+		$where .= " AND ( " . $table . ".geodir_video != '' AND " . $table . ".geodir_video IS NOT NULL )";
951
+	}
952
+	return $where;
953 953
 }
954 954
 
955 955
 
956 956
 function geodir_related_posts_fields($fields) {
957
-    global $wp_query, $wpdb, $table, $post;
957
+	global $wp_query, $wpdb, $table, $post;
958 958
 
959
-    $fields .= ", " . $table . ".* ";
959
+	$fields .= ", " . $table . ".* ";
960 960
 
961
-    $DistanceRadius = geodir_getDistanceRadius(get_option('geodir_search_dist_1'));
961
+	$DistanceRadius = geodir_getDistanceRadius(get_option('geodir_search_dist_1'));
962 962
 
963
-    $mylat = $post->post_latitude;
964
-    $mylon = $post->post_longitude;
963
+	$mylat = $post->post_latitude;
964
+	$mylon = $post->post_longitude;
965 965
 
966
-    $fields .= " , (" . $DistanceRadius . " * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(" . $table . ".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(" . $table . ".post_latitude) * pi()/180) *POWER(SIN(($mylon - " . $table . ".post_longitude) * pi()/180 / 2), 2) )))as distance ";
967
-    return $fields;
966
+	$fields .= " , (" . $DistanceRadius . " * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(" . $table . ".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(" . $table . ".post_latitude) * pi()/180) *POWER(SIN(($mylon - " . $table . ".post_longitude) * pi()/180 / 2), 2) )))as distance ";
967
+	return $fields;
968 968
 }
969 969
 function geodir_related_posts_fields_filter($query) {
970
-    if (geodir_is_page('detail')) {
971
-        $arr_detail_page_tabs = geodir_detail_page_tabs_list();
972
-        $is_display = $arr_detail_page_tabs['related_listing']['is_display'];
973
-        if ( isset($query->query_vars['is_geodir_loop']) && $query->query_vars['is_geodir_loop']
974
-            && isset($query->query_vars['order_by']) && $query->query_vars['order_by'] == 'nearest'
975
-            && isset($query->query_vars['related_listings']) && $query->query_vars['related_listings']
976
-            && $is_display
977
-        ) {
978
-            add_filter('posts_fields', 'geodir_related_posts_fields', 1);
979
-        }
980
-    }
970
+	if (geodir_is_page('detail')) {
971
+		$arr_detail_page_tabs = geodir_detail_page_tabs_list();
972
+		$is_display = $arr_detail_page_tabs['related_listing']['is_display'];
973
+		if ( isset($query->query_vars['is_geodir_loop']) && $query->query_vars['is_geodir_loop']
974
+			&& isset($query->query_vars['order_by']) && $query->query_vars['order_by'] == 'nearest'
975
+			&& isset($query->query_vars['related_listings']) && $query->query_vars['related_listings']
976
+			&& $is_display
977
+		) {
978
+			add_filter('posts_fields', 'geodir_related_posts_fields', 1);
979
+		}
980
+	}
981 981
 }
982 982
 add_action('pre_get_posts', 'geodir_related_posts_fields_filter', 1);
983 983
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +71 added lines, -71 removed lines patch added patch discarded remove patch
@@ -99,15 +99,15 @@  discard block
 block discarded – undo
99 99
         } //  Distance
100 100
 
101 101
         if (isset($_REQUEST['sgeo_lat'])) {
102
-            $mylat = (float)esc_attr($_REQUEST['sgeo_lat']);
102
+            $mylat = (float) esc_attr($_REQUEST['sgeo_lat']);
103 103
         } else {
104
-            $mylat = (float)geodir_get_current_city_lat();
104
+            $mylat = (float) geodir_get_current_city_lat();
105 105
         } //  Latatude
106 106
 
107 107
         if (isset($_REQUEST['sgeo_lon'])) {
108
-            $mylon = (float)esc_attr($_REQUEST['sgeo_lon']);
108
+            $mylon = (float) esc_attr($_REQUEST['sgeo_lon']);
109 109
         } else {
110
-            $mylon = (float)geodir_get_current_city_lng();
110
+            $mylon = (float) geodir_get_current_city_lng();
111 111
         } //  Distance
112 112
 
113 113
         if (isset($_REQUEST['snear'])) {
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 
121 121
         if ($snear == 'NEAR ME') {
122 122
             $ip = $_SERVER['REMOTE_ADDR'];
123
-            $addr_details = unserialize(file_get_contents('http://www.geoplugin.net/php.gp?ip=' . $ip));
123
+            $addr_details = unserialize(file_get_contents('http://www.geoplugin.net/php.gp?ip='.$ip));
124 124
             $mylat = stripslashes(ucfirst($addr_details[geoplugin_latitude]));
125 125
             $mylon = stripslashes(ucfirst($addr_details[geoplugin_longitude]));
126 126
         }
@@ -130,9 +130,9 @@  discard block
 block discarded – undo
130 130
             $s_AA = str_replace(" ", "", $s);
131 131
             $s_A = explode(",", $s_AA);
132 132
             $s_A = implode('","', $s_A);
133
-            $s_A = '"' . $s_A . '"';
133
+            $s_A = '"'.$s_A.'"';
134 134
         } else {
135
-            $s_A = '"' . $s . '"';
135
+            $s_A = '"'.$s.'"';
136 136
         }
137 137
 
138 138
         if (strstr($s, ' ')) {
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
     }
194 194
     if (isset($query->query_vars['is_geodir_loop']) && $query->query_vars['is_geodir_loop']) {
195 195
 
196
-        $table = $plugin_prefix . $geodir_post_type . '_detail';
196
+        $table = $plugin_prefix.$geodir_post_type.'_detail';
197 197
 
198 198
         add_filter('posts_fields', 'geodir_posts_fields', 1);
199 199
         add_filter('posts_join', 'geodir_posts_join', 1);
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
     global $wp_query, $wpdb, $geodir_post_type, $table, $plugin_prefix, $dist, $mylat, $mylon, $snear, $gd_session;
234 234
 
235 235
     // Filter-Location-Manager to add location table.
236
-    $fields .= ", " . $table . ".* ";
236
+    $fields .= ", ".$table.".* ";
237 237
     
238 238
 	if ($snear != '' || $gd_session->get('all_near_me')) {
239 239
         $DistanceRadius = geodir_getDistanceRadius(get_option('geodir_search_dist_1'));
@@ -243,16 +243,16 @@  discard block
 block discarded – undo
243 243
             $mylon = $gd_session->get('user_lon');
244 244
         }
245 245
 
246
-        $fields .= " , (" . $DistanceRadius . " * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(" . $table . ".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(" . $table . ".post_latitude) * pi()/180) *POWER(SIN(($mylon - " . $table . ".post_longitude) * pi()/180 / 2), 2) )))as distance ";
246
+        $fields .= " , (".$DistanceRadius." * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(".$table.".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(".$table.".post_latitude) * pi()/180) *POWER(SIN(($mylon - ".$table.".post_longitude) * pi()/180 / 2), 2) )))as distance ";
247 247
     }
248 248
 
249 249
     global $s;
250 250
     if (is_search() && isset($_REQUEST['geodir_search']) && $s && trim($s) != '') {
251 251
         $keywords = explode(" ", $s);
252 252
 
253
-        if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
254
-            foreach($keywords as $kkey=>$kword){
255
-                if(mb_strlen($kword, 'UTF-8')<=$klimit){
253
+        if (is_array($keywords) && $klimit = get_option('geodir_search_word_limit')) {
254
+            foreach ($keywords as $kkey=>$kword) {
255
+                if (mb_strlen($kword, 'UTF-8') <= $klimit) {
256 256
                     unset($keywords[$kkey]);
257 257
                 }
258 258
             }
@@ -270,24 +270,24 @@  discard block
 block discarded – undo
270 270
                 $count = 0;
271 271
                 foreach ($keywords as $keyword) {
272 272
                     $keyword = trim($keyword);
273
-                    $keyword  = wp_specialchars_decode($keyword ,ENT_QUOTES);
273
+                    $keyword = wp_specialchars_decode($keyword, ENT_QUOTES);
274 274
 					$count++;
275 275
                     if ($count < count($keywords)) {
276 276
                        // $gd_titlematch_part .= $wpdb->posts . ".post_title LIKE '%%" . $keyword . "%%' " . $key . " ";
277
-						$gd_titlematch_part .= "( " . $wpdb->posts . ".post_title LIKE '" . $keyword . "' OR " . $wpdb->posts . ".post_title LIKE '" . $keyword . "%%' OR " . $wpdb->posts . ".post_title LIKE '%% " . $keyword . "%%' ) " . $key . " ";
277
+						$gd_titlematch_part .= "( ".$wpdb->posts.".post_title LIKE '".$keyword."' OR ".$wpdb->posts.".post_title LIKE '".$keyword."%%' OR ".$wpdb->posts.".post_title LIKE '%% ".$keyword."%%' ) ".$key." ";
278 278
                     } else {
279 279
                         //$gd_titlematch_part .= $wpdb->posts . ".post_title LIKE '%%" . $keyword . "%%' ";
280
-						$gd_titlematch_part .= "( " . $wpdb->posts . ".post_title LIKE '" . $keyword . "' OR " . $wpdb->posts . ".post_title LIKE '" . $keyword . "%%' OR " . $wpdb->posts . ".post_title LIKE '%% " . $keyword . "%%' ) ";
280
+						$gd_titlematch_part .= "( ".$wpdb->posts.".post_title LIKE '".$keyword."' OR ".$wpdb->posts.".post_title LIKE '".$keyword."%%' OR ".$wpdb->posts.".post_title LIKE '%% ".$keyword."%%' ) ";
281 281
                     }
282 282
                 }
283
-                $gd_titlematch_part .= "THEN 1 ELSE 0 END AS " . $part . ",";
283
+                $gd_titlematch_part .= "THEN 1 ELSE 0 END AS ".$part.",";
284 284
             }
285 285
         } else {
286 286
             $gd_titlematch_part = "";
287 287
         }
288
-        $s = stripslashes_deep( $s );
289
-        $s = wp_specialchars_decode($s,ENT_QUOTES);
290
-		$fields .= $wpdb->prepare(", CASE WHEN " . $table . ".is_featured='1' THEN 1 ELSE 0 END AS gd_featured, CASE WHEN " . $wpdb->posts . ".post_title LIKE %s THEN 1 ELSE 0 END AS gd_exacttitle," . $gd_titlematch_part . " CASE WHEN ( " . $wpdb->posts . ".post_title LIKE %s OR " . $wpdb->posts . ".post_title LIKE %s OR " . $wpdb->posts . ".post_title LIKE %s ) THEN 1 ELSE 0 END AS gd_titlematch, CASE WHEN ( " . $wpdb->posts . ".post_content LIKE %s OR " . $wpdb->posts . ".post_content LIKE %s OR " . $wpdb->posts . ".post_content LIKE %s OR " . $wpdb->posts . ".post_content LIKE %s ) THEN 1 ELSE 0 END AS gd_content", array($s, $s, $s . '%', '% ' . $s . '%', $s, $s . ' %', '% ' . $s . ' %', '% ' . $s));
288
+        $s = stripslashes_deep($s);
289
+        $s = wp_specialchars_decode($s, ENT_QUOTES);
290
+		$fields .= $wpdb->prepare(", CASE WHEN ".$table.".is_featured='1' THEN 1 ELSE 0 END AS gd_featured, CASE WHEN ".$wpdb->posts.".post_title LIKE %s THEN 1 ELSE 0 END AS gd_exacttitle,".$gd_titlematch_part." CASE WHEN ( ".$wpdb->posts.".post_title LIKE %s OR ".$wpdb->posts.".post_title LIKE %s OR ".$wpdb->posts.".post_title LIKE %s ) THEN 1 ELSE 0 END AS gd_titlematch, CASE WHEN ( ".$wpdb->posts.".post_content LIKE %s OR ".$wpdb->posts.".post_content LIKE %s OR ".$wpdb->posts.".post_content LIKE %s OR ".$wpdb->posts.".post_content LIKE %s ) THEN 1 ELSE 0 END AS gd_content", array($s, $s, $s.'%', '% '.$s.'%', $s, $s.' %', '% '.$s.' %', '% '.$s));
291 291
     }
292 292
 
293 293
     return $fields;
@@ -316,13 +316,13 @@  discard block
 block discarded – undo
316 316
         $lang_code = ICL_LANGUAGE_CODE;
317 317
         $default_lang_code = $sitepress->get_default_language();
318 318
         if ($lang_code) {
319
-            $join .= "JOIN " . $table_prefix . "icl_translations icl_t ON icl_t.element_id = " . $table_prefix . "posts.ID";
319
+            $join .= "JOIN ".$table_prefix."icl_translations icl_t ON icl_t.element_id = ".$table_prefix."posts.ID";
320 320
         }
321 321
 
322 322
     }
323 323
     ########### WPML ###########
324 324
 
325
-    $join .= " INNER JOIN " . $table . " ON (" . $table . ".post_id = $wpdb->posts.ID)  ";
325
+    $join .= " INNER JOIN ".$table." ON (".$table.".post_id = $wpdb->posts.ID)  ";
326 326
     //===old code start
327 327
     //$join .= " INNER JOIN ".POST_LOCATION_TABLE." ON (".$table.".post_location_id = ".POST_LOCATION_TABLE.".location_id)  " ;//===old code end
328 328
 
@@ -405,20 +405,20 @@  discard block
 block discarded – undo
405 405
             break;
406 406
         case 'low_review':
407 407
         case 'rating_count_asc':
408
-            $orderby = $table . ".rating_count ASC, " . $table . ".overall_rating ASC, ";
408
+            $orderby = $table.".rating_count ASC, ".$table.".overall_rating ASC, ";
409 409
             break;
410 410
         case 'high_review':
411 411
         case 'rating_count_desc':
412
-			$orderby = $table . ".rating_count DESC, " . $table . ".overall_rating DESC, ";
412
+			$orderby = $table.".rating_count DESC, ".$table.".overall_rating DESC, ";
413 413
             break;
414 414
         case 'low_rating':
415
-            $orderby = "( " . $table . ".overall_rating  ) ASC, " . $table . ".rating_count ASC,  ";
415
+            $orderby = "( ".$table.".overall_rating  ) ASC, ".$table.".rating_count ASC,  ";
416 416
             break;
417 417
         case 'high_rating':
418
-            $orderby = " " . $table . ".overall_rating DESC, " . $table . ".rating_count DESC, ";
418
+            $orderby = " ".$table.".overall_rating DESC, ".$table.".rating_count DESC, ";
419 419
             break;
420 420
         case 'featured':
421
-            $orderby = $table . ".is_featured asc, ";
421
+            $orderby = $table.".is_featured asc, ";
422 422
             break;
423 423
         case 'nearest':
424 424
             $orderby = " distance asc, ";
@@ -441,24 +441,24 @@  discard block
 block discarded – undo
441 441
 
442 442
     if (is_search() && isset($_REQUEST['geodir_search']) && $s && trim($s) != '') {
443 443
         $keywords = explode(" ", $s);
444
-        if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
445
-            foreach($keywords as $kkey=>$kword){
446
-                if(mb_strlen($kword, 'UTF-8')<=$klimit){
444
+        if (is_array($keywords) && $klimit = get_option('geodir_search_word_limit')) {
445
+            foreach ($keywords as $kkey=>$kword) {
446
+                if (mb_strlen($kword, 'UTF-8') <= $klimit) {
447 447
                     unset($keywords[$kkey]);
448 448
                 }
449 449
             }
450 450
         }
451 451
         if ($sort_by == 'nearest' || $sort_by == 'farthest') {
452 452
             if (count($keywords) > 1) {
453
-                $orderby = $orderby . " ( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_alltitlematch_part * 100 + gd_titlematch_part * 50 + gd_content * 1.5) DESC, ";
453
+                $orderby = $orderby." ( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_alltitlematch_part * 100 + gd_titlematch_part * 50 + gd_content * 1.5) DESC, ";
454 454
             } else {
455
-                $orderby = $orderby . " ( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_content * 1.5) DESC, ";
455
+                $orderby = $orderby." ( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_content * 1.5) DESC, ";
456 456
             }
457 457
         } else {
458 458
             if (count($keywords) > 1) {
459
-                $orderby = "( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_alltitlematch_part * 100 + gd_titlematch_part * 50 + gd_content * 1.5) DESC, " . $orderby;
459
+                $orderby = "( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_alltitlematch_part * 100 + gd_titlematch_part * 50 + gd_content * 1.5) DESC, ".$orderby;
460 460
             } else {
461
-                $orderby = "( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_content * 1.5) DESC, " . $orderby;
461
+                $orderby = "( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_content * 1.5) DESC, ".$orderby;
462 462
             }
463 463
         }
464 464
     }
@@ -473,7 +473,7 @@  discard block
 block discarded – undo
473 473
      */
474 474
     $orderby = apply_filters('geodir_posts_order_by_sort', $orderby, $sort_by, $table);
475 475
 
476
-    $orderby .= $table . ".is_featured asc, $wpdb->posts.post_date desc, $wpdb->posts.post_title ";
476
+    $orderby .= $table.".is_featured asc, $wpdb->posts.post_date desc, $wpdb->posts.post_title ";
477 477
 
478 478
     return $orderby;
479 479
 }
@@ -505,31 +505,31 @@  discard block
 block discarded – undo
505 505
 
506 506
         if ($sort_by_count > 1 && ($order == 'asc' || $order == 'desc')) {
507 507
 
508
-            $sort_by = str_replace('_' . $order, '', $sort_by);
508
+            $sort_by = str_replace('_'.$order, '', $sort_by);
509 509
 
510 510
             switch ($sort_by):
511 511
 
512 512
                 case 'post_date':
513 513
                 case 'comment_count':
514 514
 
515
-                    $orderby = "$wpdb->posts." . $sort_by . " " . $order . ", ".$table . ".overall_rating " . $order . ", ";
515
+                    $orderby = "$wpdb->posts.".$sort_by." ".$order.", ".$table.".overall_rating ".$order.", ";
516 516
                     break;
517 517
 
518 518
                 case 'distance':
519
-                    $orderby = $sort_by . " " . $order . ", ";
519
+                    $orderby = $sort_by." ".$order.", ";
520 520
                     break;
521 521
 
522 522
 
523 523
                 // sort by rating
524 524
                 case 'overall_rating':
525
-                    $orderby = " " . $table . "." . $sort_by . "  " . $order . ", " . $table . ".rating_count " . $order . ", ";
525
+                    $orderby = " ".$table.".".$sort_by."  ".$order.", ".$table.".rating_count ".$order.", ";
526 526
 
527 527
                     break;
528 528
 
529 529
 
530 530
                 default:
531 531
                     if (geodir_column_exist($table, $sort_by)) {
532
-						$orderby = $table . "." . $sort_by . " " . $order . ", ";
532
+						$orderby = $table.".".$sort_by." ".$order.", ";
533 533
 					}
534 534
                     break;
535 535
 
@@ -577,7 +577,7 @@  discard block
 block discarded – undo
577 577
         }
578 578
 
579 579
         //if (!geodir_is_page('detail'))
580
-            add_filter('posts_where', 'geodir_default_where', 1);/**/
580
+            add_filter('posts_where', 'geodir_default_where', 1); /**/
581 581
 
582 582
         //add_filter( 'user_has_cap', 'geodir_preview_post_cap', 10, 3 );// let subscribers edit their own posts
583 583
 
@@ -648,7 +648,7 @@  discard block
 block discarded – undo
648 648
         $q_post_type = isset($wp_query->query['post_type']) ? $wp_query->query['post_type'] : '';
649 649
         //echo '##########'.$q_post_type;
650 650
         if ($lang_code && $q_post_type) {
651
-            $where .= " AND icl_t.language_code = '$lang_code' AND icl_t.element_type IN('post_" . $q_post_type . "') ";
651
+            $where .= " AND icl_t.language_code = '$lang_code' AND icl_t.element_type IN('post_".$q_post_type."') ";
652 652
             //$where .= " AND icl_t.language_code = '$lang_code' ";
653 653
         }
654 654
 
@@ -715,8 +715,8 @@  discard block
 block discarded – undo
715 715
 	}
716 716
 	
717 717
 	$s = trim($s);
718
-    $s  = wp_specialchars_decode($s ,ENT_QUOTES);
719
-    $s_A = wp_specialchars_decode($s_A ,ENT_QUOTES);
718
+    $s = wp_specialchars_decode($s, ENT_QUOTES);
719
+    $s_A = wp_specialchars_decode($s_A, ENT_QUOTES);
720 720
 
721 721
     $where = '';
722 722
     $better_search_terms = '';
@@ -727,9 +727,9 @@  discard block
 block discarded – undo
727 727
 
728 728
     if ($s != '') {
729 729
         $keywords = explode(" ", $s);
730
-        if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
731
-            foreach($keywords as $kkey=>$kword){
732
-                if(mb_strlen($kword, 'UTF-8')<=$klimit){
730
+        if (is_array($keywords) && $klimit = get_option('geodir_search_word_limit')) {
731
+            foreach ($keywords as $kkey=>$kword) {
732
+                if (mb_strlen($kword, 'UTF-8') <= $klimit) {
733 733
                     unset($keywords[$kkey]);
734 734
                 }
735 735
             }
@@ -738,7 +738,7 @@  discard block
 block discarded – undo
738 738
         if (!empty($keywords)) {
739 739
             foreach ($keywords as $keyword) {
740 740
                 $keyword = trim($keyword);
741
-                $keyword  = wp_specialchars_decode($keyword ,ENT_QUOTES);
741
+                $keyword = wp_specialchars_decode($keyword, ENT_QUOTES);
742 742
                 if ($keyword != '') {
743 743
                     /**
744 744
                      * Filter the search query keywords SQL.
@@ -749,7 +749,7 @@  discard block
 block discarded – undo
749 749
                      * @param array $keywords The array of keywords for the query.
750 750
                      * @param string $keyword The single keyword being searched.
751 751
                      */
752
-					$better_search_terms .= apply_filters("geodir_search_better_search_terms",' OR ( ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '" OR ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '%" OR ' . $wpdb->posts . '.post_title LIKE "% ' . $keyword . '%" )',$keywords,$keyword);
752
+					$better_search_terms .= apply_filters("geodir_search_better_search_terms", ' OR ( '.$wpdb->posts.'.post_title LIKE "'.$keyword.'" OR '.$wpdb->posts.'.post_title LIKE "'.$keyword.'%" OR '.$wpdb->posts.'.post_title LIKE "% '.$keyword.'%" )', $keywords, $keyword);
753 753
                 }
754 754
             }
755 755
         }
@@ -757,10 +757,10 @@  discard block
 block discarded – undo
757 757
 
758 758
     /* get taxonomy */
759 759
     $taxonomies = geodir_get_taxonomies($post_types, true);
760
-    if($taxonomies) {
760
+    if ($taxonomies) {
761 761
         $taxonomies = implode("','", $taxonomies);
762
-        $taxonomies = "'" . $taxonomies . "'";
763
-    }else{$taxonomies='';}
762
+        $taxonomies = "'".$taxonomies."'";
763
+    } else {$taxonomies = ''; }
764 764
 
765 765
     $content_where = $terms_where = '';
766 766
 	if ($s != '') {
@@ -771,7 +771,7 @@  discard block
 block discarded – undo
771 771
          * @package GeoDirectory
772 772
          * @param string $content_where The query values, default: `" OR ($wpdb->posts.post_content LIKE \"$s\" OR $wpdb->posts.post_content LIKE \"$s%\" OR $wpdb->posts.post_content LIKE \"% $s%\" OR $wpdb->posts.post_content LIKE \"%>$s%\" OR $wpdb->posts.post_content LIKE \"%\n$s%\") ") "`.
773 773
          */
774
-		$content_where = apply_filters("geodir_search_content_where"," OR ($wpdb->posts.post_content LIKE \"$s\" OR $wpdb->posts.post_content LIKE \"$s%\" OR $wpdb->posts.post_content LIKE \"% $s%\" OR $wpdb->posts.post_content LIKE \"%>$s%\" OR $wpdb->posts.post_content LIKE \"%\n$s%\") ");
774
+		$content_where = apply_filters("geodir_search_content_where", " OR ($wpdb->posts.post_content LIKE \"$s\" OR $wpdb->posts.post_content LIKE \"$s%\" OR $wpdb->posts.post_content LIKE \"% $s%\" OR $wpdb->posts.post_content LIKE \"%>$s%\" OR $wpdb->posts.post_content LIKE \"%\n$s%\") ");
775 775
         /**
776 776
          * Filter the search query term values.
777 777
          *
@@ -779,7 +779,7 @@  discard block
 block discarded – undo
779 779
          * @package GeoDirectory
780 780
          * @param string $terms_where The separator, default: `" AND ($wpdb->terms.name LIKE \"$s\" OR $wpdb->terms.name LIKE \"$s%\" OR $wpdb->terms.name LIKE \"% $s%\" OR $wpdb->terms.name IN ($s_A)) "`.
781 781
          */
782
-        $terms_where = apply_filters("geodir_search_terms_where"," AND ($wpdb->terms.name LIKE \"$s\" OR $wpdb->terms.name LIKE \"$s%\" OR $wpdb->terms.name LIKE \"% $s%\" OR $wpdb->terms.name IN ($s_A)) ");
782
+        $terms_where = apply_filters("geodir_search_terms_where", " AND ($wpdb->terms.name LIKE \"$s\" OR $wpdb->terms.name LIKE \"$s%\" OR $wpdb->terms.name LIKE \"% $s%\" OR $wpdb->terms.name IN ($s_A)) ");
783 783
 	}
784 784
 		
785 785
     if ($snear != '') {
@@ -814,12 +814,12 @@  discard block
 block discarded – undo
814 814
 							)
815 815
 						AND $wpdb->posts.post_type in ('{$post_types}')
816 816
 						AND ($wpdb->posts.post_status = 'publish')
817
-						AND ( " . $table . ".post_latitude between $rlat1 and $rlat2 )
818
-						AND ( " . $table . ".post_longitude between $rlon1 and $rlon2 ) ";
817
+						AND ( ".$table.".post_latitude between $rlat1 and $rlat2 )
818
+						AND ( ".$table.".post_longitude between $rlon1 and $rlon2 ) ";
819 819
 
820 820
         if (isset($_REQUEST['sdist']) && $_REQUEST['sdist'] != 'all') {
821 821
             $DistanceRadius = geodir_getDistanceRadius(get_option('geodir_search_dist_1'));
822
-            $where .= " AND CONVERT((" . $DistanceRadius . " * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(" . $table . ".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(" . $table . ".post_latitude) * pi()/180) *POWER(SIN(($mylon - " . $table . ".post_longitude) * pi()/180 / 2), 2) ))),DECIMAL(64,4)) <= " . $dist;
822
+            $where .= " AND CONVERT((".$DistanceRadius." * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(".$table.".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(".$table.".post_latitude) * pi()/180) *POWER(SIN(($mylon - ".$table.".post_longitude) * pi()/180 / 2), 2) ))),DECIMAL(64,4)) <= ".$dist;
823 823
         }
824 824
 
825 825
     } else {
@@ -840,11 +840,11 @@  discard block
 block discarded – undo
840 840
     }
841 841
 	
842 842
 	########### WPML ###########
843
-    if ( function_exists( 'icl_object_id' ) ) {       
843
+    if (function_exists('icl_object_id')) {       
844 844
 		$lang_code = ICL_LANGUAGE_CODE;
845 845
 		
846 846
 		if ($lang_code && $post_types) {
847
-            $where .= " AND icl_t.language_code = '".$lang_code."' AND icl_t.element_type IN('post_" . $post_types . "') ";
847
+            $where .= " AND icl_t.language_code = '".$lang_code."' AND icl_t.element_type IN('post_".$post_types."') ";
848 848
         }
849 849
     }
850 850
     ########### WPML ###########
@@ -867,10 +867,10 @@  discard block
 block discarded – undo
867 867
     global $wpdb, $geodir_post_type, $table, $curr;
868 868
 
869 869
     $curauth = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
870
-    $user_id = !empty($curauth->ID) ? (int)$curauth->ID : 0;
870
+    $user_id = !empty($curauth->ID) ? (int) $curauth->ID : 0;
871 871
     
872 872
     if (isset($_REQUEST['stype'])) {
873
-        $where = $wpdb->prepare(" AND $wpdb->posts.post_type IN (%s) ",$_REQUEST['stype']);
873
+        $where = $wpdb->prepare(" AND $wpdb->posts.post_type IN (%s) ", $_REQUEST['stype']);
874 874
     } else {
875 875
         $where = " AND $wpdb->posts.post_type IN ('gd_place') ";
876 876
     }
@@ -883,7 +883,7 @@  discard block
 block discarded – undo
883 883
         } else
884 884
             $where .= " AND $wpdb->posts.post_author = $user_id";
885 885
 
886
-        if ($user_id == (int)get_current_user_id()) {
886
+        if ($user_id == (int) get_current_user_id()) {
887 887
             $where .= " AND $wpdb->posts.post_status IN ('publish','draft','pending') ";
888 888
         } else {
889 889
             $where .= " AND $wpdb->posts.post_status = 'publish' ";
@@ -896,7 +896,7 @@  discard block
 block discarded – undo
896 896
     if (function_exists('icl_object_id')) {
897 897
         $lang_code = ICL_LANGUAGE_CODE;
898 898
         if ($lang_code) {
899
-            $where .= " AND icl_t.language_code='" . $lang_code . "' ";
899
+            $where .= " AND icl_t.language_code='".$lang_code."' ";
900 900
         }
901 901
 
902 902
     }
@@ -919,7 +919,7 @@  discard block
 block discarded – undo
919 919
 {
920 920
     global $wp_query, $table;
921 921
     if (!empty($wp_query->query['with_pics_only'])) {
922
-        $join .= " LEFT JOIN " . GEODIR_ATTACHMENT_TABLE . " ON ( " . GEODIR_ATTACHMENT_TABLE . ".post_id=" . $table . ".post_id AND " . GEODIR_ATTACHMENT_TABLE . ".mime_type LIKE '%image%' )";
922
+        $join .= " LEFT JOIN ".GEODIR_ATTACHMENT_TABLE." ON ( ".GEODIR_ATTACHMENT_TABLE.".post_id=".$table.".post_id AND ".GEODIR_ATTACHMENT_TABLE.".mime_type LIKE '%image%' )";
923 923
     }
924 924
     return $join;
925 925
 }
@@ -938,16 +938,16 @@  discard block
 block discarded – undo
938 938
 {
939 939
     global $wp_query, $table;
940 940
     if (!empty($wp_query->query['show_featured_only'])) {
941
-        $where .= " AND " . $table . ".is_featured = '1'";
941
+        $where .= " AND ".$table.".is_featured = '1'";
942 942
     }
943 943
     if (!empty($wp_query->query['show_special_only'])) {
944
-        $where .= " AND ( " . $table . ".geodir_special_offers != '' AND " . $table . ".geodir_special_offers IS NOT NULL )";
944
+        $where .= " AND ( ".$table.".geodir_special_offers != '' AND ".$table.".geodir_special_offers IS NOT NULL )";
945 945
     }
946 946
     if (!empty($wp_query->query['with_pics_only'])) {
947
-        $where .= " AND " . GEODIR_ATTACHMENT_TABLE . ".ID IS NOT NULL GROUP BY " . $table . ".post_id";
947
+        $where .= " AND ".GEODIR_ATTACHMENT_TABLE.".ID IS NOT NULL GROUP BY ".$table.".post_id";
948 948
     }
949 949
     if (!empty($wp_query->query['with_videos_only'])) {
950
-        $where .= " AND ( " . $table . ".geodir_video != '' AND " . $table . ".geodir_video IS NOT NULL )";
950
+        $where .= " AND ( ".$table.".geodir_video != '' AND ".$table.".geodir_video IS NOT NULL )";
951 951
     }
952 952
     return $where;
953 953
 }
@@ -956,21 +956,21 @@  discard block
 block discarded – undo
956 956
 function geodir_related_posts_fields($fields) {
957 957
     global $wp_query, $wpdb, $table, $post;
958 958
 
959
-    $fields .= ", " . $table . ".* ";
959
+    $fields .= ", ".$table.".* ";
960 960
 
961 961
     $DistanceRadius = geodir_getDistanceRadius(get_option('geodir_search_dist_1'));
962 962
 
963 963
     $mylat = $post->post_latitude;
964 964
     $mylon = $post->post_longitude;
965 965
 
966
-    $fields .= " , (" . $DistanceRadius . " * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(" . $table . ".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(" . $table . ".post_latitude) * pi()/180) *POWER(SIN(($mylon - " . $table . ".post_longitude) * pi()/180 / 2), 2) )))as distance ";
966
+    $fields .= " , (".$DistanceRadius." * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(".$table.".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(".$table.".post_latitude) * pi()/180) *POWER(SIN(($mylon - ".$table.".post_longitude) * pi()/180 / 2), 2) )))as distance ";
967 967
     return $fields;
968 968
 }
969 969
 function geodir_related_posts_fields_filter($query) {
970 970
     if (geodir_is_page('detail')) {
971 971
         $arr_detail_page_tabs = geodir_detail_page_tabs_list();
972 972
         $is_display = $arr_detail_page_tabs['related_listing']['is_display'];
973
-        if ( isset($query->query_vars['is_geodir_loop']) && $query->query_vars['is_geodir_loop']
973
+        if (isset($query->query_vars['is_geodir_loop']) && $query->query_vars['is_geodir_loop']
974 974
             && isset($query->query_vars['order_by']) && $query->query_vars['order_by'] == 'nearest'
975 975
             && isset($query->query_vars['related_listings']) && $query->query_vars['related_listings']
976 976
             && $is_display
Please login to merge, or discard this patch.
geodirectory-functions/map-functions/map_functions.php 1 patch
Indentation   +197 added lines, -197 removed lines patch added patch discarded remove patch
@@ -15,8 +15,8 @@  discard block
 block discarded – undo
15 15
  */
16 16
 function  geodir_init_map_jason()
17 17
 {
18
-    global $map_jason;
19
-    $map_jason = array();
18
+	global $map_jason;
19
+	$map_jason = array();
20 20
 }
21 21
 
22 22
 /**
@@ -28,8 +28,8 @@  discard block
 block discarded – undo
28 28
  */
29 29
 function geodir_init_map_canvas_array()
30 30
 {
31
-    global $map_canvas_arr;
32
-    $map_canvas_arr = array();
31
+	global $map_canvas_arr;
32
+	$map_canvas_arr = array();
33 33
 }
34 34
 
35 35
 
@@ -50,47 +50,47 @@  discard block
 block discarded – undo
50 50
  */
51 51
 function create_marker_jason_of_posts($post)
52 52
 {
53
-    global $wpdb, $map_jason, $add_post_in_marker_array, $geodir_cat_icons, $gd_marker_sizes;
53
+	global $wpdb, $map_jason, $add_post_in_marker_array, $geodir_cat_icons, $gd_marker_sizes;
54 54
 
55
-    if (!empty($post) && isset($post->ID) && $post->ID > 0 && (is_main_query() || $add_post_in_marker_array) && $post->marker_json != '') {
56
-        $srcharr = array("'", "/", "-", '"', '\\');
57
-        $replarr = array("&prime;", "&frasl;", "&ndash;", "&ldquo;", '');
55
+	if (!empty($post) && isset($post->ID) && $post->ID > 0 && (is_main_query() || $add_post_in_marker_array) && $post->marker_json != '') {
56
+		$srcharr = array("'", "/", "-", '"', '\\');
57
+		$replarr = array("&prime;", "&frasl;", "&ndash;", "&ldquo;", '');
58 58
 
59 59
 
60
-        $geodir_cat_icons = geodir_get_term_icon();
61
-        $icon = !empty($geodir_cat_icons) && isset($geodir_cat_icons[$post->default_category]) ? $geodir_cat_icons[$post->default_category] : '';
60
+		$geodir_cat_icons = geodir_get_term_icon();
61
+		$icon = !empty($geodir_cat_icons) && isset($geodir_cat_icons[$post->default_category]) ? $geodir_cat_icons[$post->default_category] : '';
62 62
 
63
-        $post_title = $post->post_title;
64
-        $title = str_replace($srcharr, $replarr, $post_title);
63
+		$post_title = $post->post_title;
64
+		$title = str_replace($srcharr, $replarr, $post_title);
65 65
 
66
-        if (is_ssl()) {
67
-            $icon = str_replace("http:","https:",$icon );
68
-        }
66
+		if (is_ssl()) {
67
+			$icon = str_replace("http:","https:",$icon );
68
+		}
69 69
         
70
-        if ($icon != '') {
71
-            $gd_marker_sizes = empty($gd_marker_sizes) ? array() : $gd_marker_sizes;
70
+		if ($icon != '') {
71
+			$gd_marker_sizes = empty($gd_marker_sizes) ? array() : $gd_marker_sizes;
72 72
             
73
-            if (isset($gd_marker_sizes[$icon])) {
74
-                $icon_size = $gd_marker_sizes[$icon];
75
-            } else {
76
-                $icon_size = geodir_get_marker_size($icon);
77
-                $gd_marker_sizes[$icon] = $icon_size;
78
-            }               
79
-        } else {
80
-            $icon_size = array('w' => 36, 'h' => 45);
81
-        }
82
-
83
-        $post_json = '{"id":"' . $post->ID . '","t": "' . $title . '","lt": "' . $post->post_latitude . '","ln": "' . $post->post_longitude . '","mk_id":"' . $post->ID . '_' . $post->default_category . '","i":"' . $icon . '","w":"' . $icon_size['w'] . '","h":"' . $icon_size['h'] . '"}';
84
-
85
-        /**
86
-         * Filter the json data when creating output for post json marker..
87
-         *
88
-         * @since 1.5.7
89
-         * @param string $post_json JSON representation of the post marker info.
90
-         * @param object $post The post object.
91
-         */
92
-        $map_jason[] = apply_filters('geodir_create_marker_jason_of_posts',$post_json, $post);
93
-    }
73
+			if (isset($gd_marker_sizes[$icon])) {
74
+				$icon_size = $gd_marker_sizes[$icon];
75
+			} else {
76
+				$icon_size = geodir_get_marker_size($icon);
77
+				$gd_marker_sizes[$icon] = $icon_size;
78
+			}               
79
+		} else {
80
+			$icon_size = array('w' => 36, 'h' => 45);
81
+		}
82
+
83
+		$post_json = '{"id":"' . $post->ID . '","t": "' . $title . '","lt": "' . $post->post_latitude . '","ln": "' . $post->post_longitude . '","mk_id":"' . $post->ID . '_' . $post->default_category . '","i":"' . $icon . '","w":"' . $icon_size['w'] . '","h":"' . $icon_size['h'] . '"}';
84
+
85
+		/**
86
+		 * Filter the json data when creating output for post json marker..
87
+		 *
88
+		 * @since 1.5.7
89
+		 * @param string $post_json JSON representation of the post marker info.
90
+		 * @param object $post The post object.
91
+		 */
92
+		$map_jason[] = apply_filters('geodir_create_marker_jason_of_posts',$post_json, $post);
93
+	}
94 94
 }
95 95
 
96 96
 /**
@@ -103,59 +103,59 @@  discard block
 block discarded – undo
103 103
  */
104 104
 function send_marker_jason_to_js()
105 105
 {
106
-    global $map_jason, $map_canvas_arr;
107
-
108
-    if (is_array($map_canvas_arr) && !empty($map_canvas_arr)) {
109
-        foreach ($map_canvas_arr as $canvas => $jason) {
110
-            if (is_array($map_jason) && !empty($map_jason)) {
111
-                $canvas_jason = $canvas . "_jason";
112
-                $map_canvas_arr[$canvas] = array_unique($map_jason);
113
-                unset($cat_content_info);
114
-                $cat_content_info[] = implode(',', $map_canvas_arr[$canvas]);
115
-                $totalcount = count(array_unique($map_jason));
116
-                if (!empty($cat_content_info)) {
117
-                    $json_content = substr(implode(',', $cat_content_info), 1);
118
-                    $json_content = htmlentities($json_content, ENT_QUOTES); // Quotes in csv title import break maps - FIXED by kiran on 2nd March, 2016
119
-                    $canvas_jason = '[{"totalcount":"' . $totalcount . '",' . $json_content . ']';
120
-                } else {
121
-                    $canvas_jason = '[{"totalcount":"0"}]';
122
-                }
123
-
124
-                $map_canvas_jason_args = array($canvas . '_jason' => $canvas_jason);
125
-
126
-                /**
127
-                 * Filter the send_marker_jason_to_js() function map canvas json args.
128
-                 *
129
-                 * You can use this filter to modify map canvas json args.
130
-                 *
131
-                 * @since 1.0.0
132
-                 * @package GeoDirectory
133
-                 * @param string $canvas Map canvas array key.
134
-                 * @param array $map_canvas_jason_args Map canvas args.
135
-                 */
136
-                $map_canvas_jason_args = apply_filters('geodir_map_canvas_jason_' . $canvas, $map_canvas_jason_args);
137
-
138
-                wp_localize_script('geodir-map-widget', $canvas . '_jason_args', $map_canvas_jason_args);
139
-            } else {
140
-                $canvas_jason = '[{"totalcount":"0"}]';
141
-                $map_canvas_jason_args = array($canvas . '_jason' => $canvas_jason);
142
-
143
-                /**
144
-                 * Filter the send_marker_jason_to_js() function map canvas json args.
145
-                 *
146
-                 * You can use this filter to modify map canvas json args.
147
-                 *
148
-                 * @since 1.0.0
149
-                 * @package GeoDirectory
150
-                 * @param string $canvas Map canvas array key.
151
-                 * @param array $map_canvas_jason_args Map canvas args.
152
-                 */
153
-                $map_canvas_jason_args = apply_filters('geodir_map_canvas_jason_' . $canvas, $map_canvas_jason_args);
154
-                wp_localize_script('geodir-map-widget', $canvas . '_jason_args', $map_canvas_jason_args);
155
-            }
156
-        }
157
-
158
-    }
106
+	global $map_jason, $map_canvas_arr;
107
+
108
+	if (is_array($map_canvas_arr) && !empty($map_canvas_arr)) {
109
+		foreach ($map_canvas_arr as $canvas => $jason) {
110
+			if (is_array($map_jason) && !empty($map_jason)) {
111
+				$canvas_jason = $canvas . "_jason";
112
+				$map_canvas_arr[$canvas] = array_unique($map_jason);
113
+				unset($cat_content_info);
114
+				$cat_content_info[] = implode(',', $map_canvas_arr[$canvas]);
115
+				$totalcount = count(array_unique($map_jason));
116
+				if (!empty($cat_content_info)) {
117
+					$json_content = substr(implode(',', $cat_content_info), 1);
118
+					$json_content = htmlentities($json_content, ENT_QUOTES); // Quotes in csv title import break maps - FIXED by kiran on 2nd March, 2016
119
+					$canvas_jason = '[{"totalcount":"' . $totalcount . '",' . $json_content . ']';
120
+				} else {
121
+					$canvas_jason = '[{"totalcount":"0"}]';
122
+				}
123
+
124
+				$map_canvas_jason_args = array($canvas . '_jason' => $canvas_jason);
125
+
126
+				/**
127
+				 * Filter the send_marker_jason_to_js() function map canvas json args.
128
+				 *
129
+				 * You can use this filter to modify map canvas json args.
130
+				 *
131
+				 * @since 1.0.0
132
+				 * @package GeoDirectory
133
+				 * @param string $canvas Map canvas array key.
134
+				 * @param array $map_canvas_jason_args Map canvas args.
135
+				 */
136
+				$map_canvas_jason_args = apply_filters('geodir_map_canvas_jason_' . $canvas, $map_canvas_jason_args);
137
+
138
+				wp_localize_script('geodir-map-widget', $canvas . '_jason_args', $map_canvas_jason_args);
139
+			} else {
140
+				$canvas_jason = '[{"totalcount":"0"}]';
141
+				$map_canvas_jason_args = array($canvas . '_jason' => $canvas_jason);
142
+
143
+				/**
144
+				 * Filter the send_marker_jason_to_js() function map canvas json args.
145
+				 *
146
+				 * You can use this filter to modify map canvas json args.
147
+				 *
148
+				 * @since 1.0.0
149
+				 * @package GeoDirectory
150
+				 * @param string $canvas Map canvas array key.
151
+				 * @param array $map_canvas_jason_args Map canvas args.
152
+				 */
153
+				$map_canvas_jason_args = apply_filters('geodir_map_canvas_jason_' . $canvas, $map_canvas_jason_args);
154
+				wp_localize_script('geodir-map-widget', $canvas . '_jason_args', $map_canvas_jason_args);
155
+			}
156
+		}
157
+
158
+	}
159 159
 }
160 160
 
161 161
 /**
@@ -174,92 +174,92 @@  discard block
 block discarded – undo
174 174
  */
175 175
 function home_map_taxonomy_walker($cat_taxonomy, $cat_parent = 0, $hide_empty = true, $pading = 0, $map_canvas_name = '', $child_collapse, $is_home_map = false)
176 176
 {
177
-    global $cat_count, $geodir_cat_icons;
177
+	global $cat_count, $geodir_cat_icons;
178 178
 
179
-    $exclude_categories = get_option('geodir_exclude_cat_on_map');
180
-    $exclude_categories_new = get_option('geodir_exclude_cat_on_map_upgrade');
179
+	$exclude_categories = get_option('geodir_exclude_cat_on_map');
180
+	$exclude_categories_new = get_option('geodir_exclude_cat_on_map_upgrade');
181 181
 
182
-    // check if exclude categories saved before fix of categories identical names
183
-    if ($exclude_categories_new) {
184
-        $gd_cat_taxonomy = isset($cat_taxonomy[0]) ? $cat_taxonomy[0] : '';
185
-        $exclude_categories = !empty($exclude_categories[$gd_cat_taxonomy]) && is_array($exclude_categories[$gd_cat_taxonomy]) ? array_unique($exclude_categories[$gd_cat_taxonomy]) : array();
186
-    }
182
+	// check if exclude categories saved before fix of categories identical names
183
+	if ($exclude_categories_new) {
184
+		$gd_cat_taxonomy = isset($cat_taxonomy[0]) ? $cat_taxonomy[0] : '';
185
+		$exclude_categories = !empty($exclude_categories[$gd_cat_taxonomy]) && is_array($exclude_categories[$gd_cat_taxonomy]) ? array_unique($exclude_categories[$gd_cat_taxonomy]) : array();
186
+	}
187 187
 
188
-    $exclude_cat_str = implode(',', $exclude_categories);
188
+	$exclude_cat_str = implode(',', $exclude_categories);
189 189
 
190
-    if ($exclude_cat_str == '') {
191
-        $exclude_cat_str = '0';
192
-    }
190
+	if ($exclude_cat_str == '') {
191
+		$exclude_cat_str = '0';
192
+	}
193 193
 
194
-    $cat_terms = get_terms($cat_taxonomy, array('parent' => $cat_parent, 'exclude' => $exclude_cat_str, 'hide_empty ' => $hide_empty));
194
+	$cat_terms = get_terms($cat_taxonomy, array('parent' => $cat_parent, 'exclude' => $exclude_cat_str, 'hide_empty ' => $hide_empty));
195 195
 
196
-    if ($hide_empty) {
197
-        $cat_terms = geodir_filter_empty_terms($cat_terms);
198
-    }
196
+	if ($hide_empty) {
197
+		$cat_terms = geodir_filter_empty_terms($cat_terms);
198
+	}
199 199
 
200
-    $main_list_class = '';
201
-    //If there are terms, start displaying
202
-    if (count($cat_terms) > 0) {
203
-        //Displaying as a list
204
-        $p = $pading * 15;
205
-        $pading++;
200
+	$main_list_class = '';
201
+	//If there are terms, start displaying
202
+	if (count($cat_terms) > 0) {
203
+		//Displaying as a list
204
+		$p = $pading * 15;
205
+		$pading++;
206 206
 
207
-        if ($cat_parent == 0) {
208
-            $list_class = 'main_list';
209
-            $display = '';
210
-        } else {
211
-            $list_class = 'sub_list';
212
-            $display = !$child_collapse ? '' : 'display:none';
213
-        }
207
+		if ($cat_parent == 0) {
208
+			$list_class = 'main_list';
209
+			$display = '';
210
+		} else {
211
+			$list_class = 'sub_list';
212
+			$display = !$child_collapse ? '' : 'display:none';
213
+		}
214 214
 
215 215
 
216
-        $out = '<ul class="treeview ' . $list_class . '" style="margin-left:' . $p . 'px;' . $display . ';">';
216
+		$out = '<ul class="treeview ' . $list_class . '" style="margin-left:' . $p . 'px;' . $display . ';">';
217 217
 
218
-        $geodir_cat_icons = geodir_get_term_icon();
218
+		$geodir_cat_icons = geodir_get_term_icon();
219 219
 
220
-        $geodir_default_map_search_pt = (get_option('geodir_default_map_search_pt')) ? get_option('geodir_default_map_search_pt') :  'gd_place';
221
-        $post_type = isset($_REQUEST['post_type']) ? $_REQUEST['post_type'] : $geodir_default_map_search_pt;
222
-        foreach ($cat_terms as $cat_term):
220
+		$geodir_default_map_search_pt = (get_option('geodir_default_map_search_pt')) ? get_option('geodir_default_map_search_pt') :  'gd_place';
221
+		$post_type = isset($_REQUEST['post_type']) ? $_REQUEST['post_type'] : $geodir_default_map_search_pt;
222
+		foreach ($cat_terms as $cat_term):
223 223
 
224 224
 
225 225
 
226
-            $icon = !empty($geodir_cat_icons) && isset($geodir_cat_icons[$cat_term->term_id]) ? $geodir_cat_icons[$cat_term->term_id] : '';
226
+			$icon = !empty($geodir_cat_icons) && isset($geodir_cat_icons[$cat_term->term_id]) ? $geodir_cat_icons[$cat_term->term_id] : '';
227 227
 
228
-            if (!in_array($cat_term->term_id, $exclude_categories)):
229
-                //Secret sauce.  Function calls itself to display child elements, if any
230
-                $checked = 'checked="checked"';
228
+			if (!in_array($cat_term->term_id, $exclude_categories)):
229
+				//Secret sauce.  Function calls itself to display child elements, if any
230
+				$checked = 'checked="checked"';
231 231
 
232
-                // Untick the category by default on home map
233
-                if ($is_home_map && $geodir_home_map_untick = get_option('geodir_home_map_untick')) {
234
-                    if (!empty($geodir_home_map_untick) && in_array($post_type . '_' . $cat_term->term_id, $geodir_home_map_untick)) {
235
-                        $checked = '';
236
-                    }
237
-                }
232
+				// Untick the category by default on home map
233
+				if ($is_home_map && $geodir_home_map_untick = get_option('geodir_home_map_untick')) {
234
+					if (!empty($geodir_home_map_untick) && in_array($post_type . '_' . $cat_term->term_id, $geodir_home_map_untick)) {
235
+						$checked = '';
236
+					}
237
+				}
238 238
 
239
-                $term_check = '<input type="checkbox" ' . $checked . ' id="' .$map_canvas_name.'_tick_cat_'. $cat_term->term_id . '" class="group_selector ' . $main_list_class . '"';
240
-                $term_check .= ' name="' . $map_canvas_name . '_cat[]" ';
241
-                $term_check .= '  title="' . esc_attr(ucfirst($cat_term->name)) . '" value="' . $cat_term->term_id . '" onclick="javascript:build_map_ajax_search_param(\'' . $map_canvas_name . '\',false, this)">';
242
-                $term_img = '<img height="15" width="15" alt="' . $cat_term->taxonomy . '" src="' . $icon . '" title="' . ucfirst($cat_term->name) . '"/>';
243
-                $out .= '<li>' . $term_check . '<label for="' . $map_canvas_name.'_tick_cat_'. $cat_term->term_id . '">' . $term_img . ucfirst($cat_term->name) . '</label><i class="fa fa-long-arrow-down"></i>';
239
+				$term_check = '<input type="checkbox" ' . $checked . ' id="' .$map_canvas_name.'_tick_cat_'. $cat_term->term_id . '" class="group_selector ' . $main_list_class . '"';
240
+				$term_check .= ' name="' . $map_canvas_name . '_cat[]" ';
241
+				$term_check .= '  title="' . esc_attr(ucfirst($cat_term->name)) . '" value="' . $cat_term->term_id . '" onclick="javascript:build_map_ajax_search_param(\'' . $map_canvas_name . '\',false, this)">';
242
+				$term_img = '<img height="15" width="15" alt="' . $cat_term->taxonomy . '" src="' . $icon . '" title="' . ucfirst($cat_term->name) . '"/>';
243
+				$out .= '<li>' . $term_check . '<label for="' . $map_canvas_name.'_tick_cat_'. $cat_term->term_id . '">' . $term_img . ucfirst($cat_term->name) . '</label><i class="fa fa-long-arrow-down"></i>';
244 244
 
245
-            endif;
245
+			endif;
246 246
 
247 247
 
248
-            // get sub category by recursion
249
-            $out .= home_map_taxonomy_walker($cat_taxonomy, $cat_term->term_id, $hide_empty, $pading, $map_canvas_name, $child_collapse, $is_home_map);
248
+			// get sub category by recursion
249
+			$out .= home_map_taxonomy_walker($cat_taxonomy, $cat_term->term_id, $hide_empty, $pading, $map_canvas_name, $child_collapse, $is_home_map);
250 250
 
251
-            $out .= '</li>';
251
+			$out .= '</li>';
252 252
 
253
-        endforeach;
253
+		endforeach;
254 254
 
255
-        $out .= '</ul>';
255
+		$out .= '</ul>';
256 256
 
257
-        return $out;
258
-    } else {
259
-        if ($cat_parent == 0)
260
-            return _e('No category', 'geodirectory');
261
-    }
262
-    return;
257
+		return $out;
258
+	} else {
259
+		if ($cat_parent == 0)
260
+			return _e('No category', 'geodirectory');
261
+	}
262
+	return;
263 263
 }
264 264
 
265 265
 /**
@@ -271,19 +271,19 @@  discard block
 block discarded – undo
271 271
  * @return string The map API provider name.
272 272
  */
273 273
 function geodir_map_name() {
274
-    $geodir_map_name = get_option('geodir_load_map', 'google');
274
+	$geodir_map_name = get_option('geodir_load_map', 'google');
275 275
     
276
-    if (!in_array($geodir_map_name, array('none', 'auto', 'google', 'osm'))) {
277
-        $geodir_map_name = 'auto';
278
-    }
279
-
280
-    /**
281
-     * Filter the map JS API provider name.
282
-     *
283
-     * @since 1.6.1
284
-     * @param string $geodir_map_name The map API provider name.
285
-     */
286
-    return apply_filters('geodir_map_name', $geodir_map_name);
276
+	if (!in_array($geodir_map_name, array('none', 'auto', 'google', 'osm'))) {
277
+		$geodir_map_name = 'auto';
278
+	}
279
+
280
+	/**
281
+	 * Filter the map JS API provider name.
282
+	 *
283
+	 * @since 1.6.1
284
+	 * @param string $geodir_map_name The map API provider name.
285
+	 */
286
+	return apply_filters('geodir_map_name', $geodir_map_name);
287 287
 }
288 288
 
289 289
 /**
@@ -299,48 +299,48 @@  discard block
 block discarded – undo
299 299
  * @return array The icon size.
300 300
  */
301 301
 function geodir_get_marker_size($icon, $default_size = array('w' => 36, 'h' => 45)) {
302
-    global $gd_marker_sizes;
302
+	global $gd_marker_sizes;
303 303
     
304
-    if (empty($gd_marker_sizes)) {
305
-        $gd_marker_sizes = array();
306
-    }
304
+	if (empty($gd_marker_sizes)) {
305
+		$gd_marker_sizes = array();
306
+	}
307 307
       
308
-    if (!empty($gd_marker_sizes[$icon])) {
309
-        return $gd_marker_sizes[$icon];
310
-    }
308
+	if (!empty($gd_marker_sizes[$icon])) {
309
+		return $gd_marker_sizes[$icon];
310
+	}
311 311
     
312
-    if (empty($icon)) {
313
-        $gd_marker_sizes[$icon] = $default_size;
312
+	if (empty($icon)) {
313
+		$gd_marker_sizes[$icon] = $default_size;
314 314
         
315
-        return $default_size;
316
-    }
315
+		return $default_size;
316
+	}
317 317
     
318
-    $icon_url = $icon;
318
+	$icon_url = $icon;
319 319
     
320
-    $uploads = wp_upload_dir(); // Array of key => value pairs
320
+	$uploads = wp_upload_dir(); // Array of key => value pairs
321 321
       
322
-    if (!path_is_absolute($icon)) {
323
-        $icon = str_replace($uploads['baseurl'], $uploads['basedir'], $icon);
324
-    }
322
+	if (!path_is_absolute($icon)) {
323
+		$icon = str_replace($uploads['baseurl'], $uploads['basedir'], $icon);
324
+	}
325 325
     
326
-    if (!path_is_absolute($icon) && strpos($icon, WP_CONTENT_URL) !== false) {
327
-        $icon = str_replace(WP_CONTENT_URL, WP_CONTENT_DIR, $icon);
328
-    }
326
+	if (!path_is_absolute($icon) && strpos($icon, WP_CONTENT_URL) !== false) {
327
+		$icon = str_replace(WP_CONTENT_URL, WP_CONTENT_DIR, $icon);
328
+	}
329 329
     
330
-    $sizes = array();
331
-    if (is_file($icon) && file_exists($icon)) {
332
-        $size = getimagesize(trim($icon));
330
+	$sizes = array();
331
+	if (is_file($icon) && file_exists($icon)) {
332
+		$size = getimagesize(trim($icon));
333 333
         
334
-        if (!empty($size[0]) && !empty($size[1])) {
335
-            $sizes = array('w' => $size[0], 'h' => $size[1]);
336
-        }
337
-    }
334
+		if (!empty($size[0]) && !empty($size[1])) {
335
+			$sizes = array('w' => $size[0], 'h' => $size[1]);
336
+		}
337
+	}
338 338
     
339
-    $sizes = !empty($sizes) ? $sizes : $default_size;
339
+	$sizes = !empty($sizes) ? $sizes : $default_size;
340 340
     
341
-    $gd_marker_sizes[$icon_url] = $sizes;
341
+	$gd_marker_sizes[$icon_url] = $sizes;
342 342
     
343
-    return $sizes;
343
+	return $sizes;
344 344
 }
345 345
 
346 346
 add_action('wp_head', 'geodir_map_load_style', 10);
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
  * @package GeoDirectory
353 353
  */
354 354
 function geodir_map_load_style() {    
355
-    if (in_array(geodir_map_name(), array('auto', 'google')) && wp_script_is( 'geodirectory-googlemap-script', 'done')) {
355
+	if (in_array(geodir_map_name(), array('auto', 'google')) && wp_script_is( 'geodirectory-googlemap-script', 'done')) {
356 356
 ?>
357 357
 <script type="text/javascript">
358 358
 if (!(window.google && typeof google.maps !== 'undefined')) {
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
 }
361 361
 </script>
362 362
 <?php
363
-    }
363
+	}
364 364
 }
365 365
 
366 366
 add_action('wp_footer', 'geodir_map_load_script', 10);
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
  * @package GeoDirectory
373 373
  */
374 374
 function geodir_map_load_script() {
375
-    if (in_array(geodir_map_name(), array('auto', 'google')) && wp_script_is( 'geodirectory-googlemap-script', 'done')) {
375
+	if (in_array(geodir_map_name(), array('auto', 'google')) && wp_script_is( 'geodirectory-googlemap-script', 'done')) {
376 376
 ?>
377 377
 <script type="text/javascript">
378 378
 if (!(window.google && typeof google.maps !== 'undefined')) {
@@ -381,5 +381,5 @@  discard block
 block discarded – undo
381 381
 }
382 382
 </script>
383 383
 <?php
384
-    }
384
+	}
385 385
 }
386 386
\ No newline at end of file
Please login to merge, or discard this patch.
geodirectory-admin/option-pages/design_settings_array.php 1 patch
Indentation   +946 added lines, -946 removed lines patch added patch discarded remove patch
@@ -17,14 +17,14 @@  discard block
 block discarded – undo
17 17
  */
18 18
 function geodir_post_type_setting_fun()
19 19
 {
20
-    $post_type_arr = array();
20
+	$post_type_arr = array();
21 21
 
22
-    $post_types = geodir_get_posttypes('object');
22
+	$post_types = geodir_get_posttypes('object');
23 23
 
24
-    foreach ($post_types as $key => $post_types_obj) {
25
-        $post_type_arr[$key] = $post_types_obj->labels->singular_name;
26
-    }
27
-    return $post_type_arr;
24
+	foreach ($post_types as $key => $post_types_obj) {
25
+		$post_type_arr[$key] = $post_types_obj->labels->singular_name;
26
+	}
27
+	return $post_type_arr;
28 28
 }
29 29
 
30 30
 /**
@@ -35,17 +35,17 @@  discard block
 block discarded – undo
35 35
  */
36 36
 function geodir_theme_location_setting_fun()
37 37
 {
38
-    $post_type_arr = array();
39
-    $geodir_all_nav_locations = get_registered_nav_menus();
40
-    $geodir_active_nav_locations = get_nav_menu_locations();
41
-    if (!empty($geodir_active_nav_locations) && is_array($geodir_active_nav_locations)) {
42
-        foreach ($geodir_active_nav_locations as $key => $theme_location) {
43
-            if (!empty($geodir_all_nav_locations) && is_array($geodir_all_nav_locations) && array_key_exists($key, $geodir_all_nav_locations))
44
-                $post_type_arr[$key] = $geodir_all_nav_locations[$key];
45
-        }
46
-    }
47
-
48
-    return $post_type_arr;
38
+	$post_type_arr = array();
39
+	$geodir_all_nav_locations = get_registered_nav_menus();
40
+	$geodir_active_nav_locations = get_nav_menu_locations();
41
+	if (!empty($geodir_active_nav_locations) && is_array($geodir_active_nav_locations)) {
42
+		foreach ($geodir_active_nav_locations as $key => $theme_location) {
43
+			if (!empty($geodir_all_nav_locations) && is_array($geodir_all_nav_locations) && array_key_exists($key, $geodir_all_nav_locations))
44
+				$post_type_arr[$key] = $geodir_all_nav_locations[$key];
45
+		}
46
+	}
47
+
48
+	return $post_type_arr;
49 49
 }
50 50
 /**
51 51
  * Filter GD design settings array.
@@ -55,543 +55,543 @@  discard block
 block discarded – undo
55 55
  */
56 56
 $geodir_settings['design_settings'] = apply_filters('geodir_design_settings', array(
57 57
 
58
-    /* Home Layout Settings start */
59
-    array('name' => __('Home', 'geodirectory'), 'type' => 'title', 'desc' => 'Setting to set home page layout', 'id' => 'home_page_settings '),
58
+	/* Home Layout Settings start */
59
+	array('name' => __('Home', 'geodirectory'), 'type' => 'title', 'desc' => 'Setting to set home page layout', 'id' => 'home_page_settings '),
60 60
 
61 61
 
62
-    array('name' => __('Home Top Section Settings', 'geodirectory'),
63
-        'type' => 'sectionstart',
64
-        'desc' => '',
65
-        'id' => 'geodir_home_top_section'),
62
+	array('name' => __('Home Top Section Settings', 'geodirectory'),
63
+		'type' => 'sectionstart',
64
+		'desc' => '',
65
+		'id' => 'geodir_home_top_section'),
66 66
 
67
-    array(
68
-        'name' => __('Geodirectory home page', 'geodirectory'),
69
-        'desc' => __('Set geodirectory home page as your home. <b style="color:red;">This setting has been depreciated and will be removed in the next version, instead please set the GD home page in GD>Permalinks and then set this page to the front page under Settings>Reading>Front Page</b>', 'geodirectory'),
70
-        'id' => 'geodir_set_as_home',
71
-        'type' => 'checkbox',
72
-        'std' => '0' // Default value to show home top section
73
-    ),
67
+	array(
68
+		'name' => __('Geodirectory home page', 'geodirectory'),
69
+		'desc' => __('Set geodirectory home page as your home. <b style="color:red;">This setting has been depreciated and will be removed in the next version, instead please set the GD home page in GD>Permalinks and then set this page to the front page under Settings>Reading>Front Page</b>', 'geodirectory'),
70
+		'id' => 'geodir_set_as_home',
71
+		'type' => 'checkbox',
72
+		'std' => '0' // Default value to show home top section
73
+	),
74 74
 
75
-    array(
76
-        'name' => __('Home top section', 'geodirectory'),
77
-        'desc' => __('Show the top section of home page', 'geodirectory'),
78
-        'id' => 'geodir_show_home_top_section',
79
-        'type' => 'checkbox',
80
-        'std' => '1' // Default value to show home top section
81
-    ),
75
+	array(
76
+		'name' => __('Home top section', 'geodirectory'),
77
+		'desc' => __('Show the top section of home page', 'geodirectory'),
78
+		'id' => 'geodir_show_home_top_section',
79
+		'type' => 'checkbox',
80
+		'std' => '1' // Default value to show home top section
81
+	),
82 82
 
83 83
 
84
-    array('type' => 'sectionend', 'id' => 'geodir_home_top_section'),
84
+	array('type' => 'sectionend', 'id' => 'geodir_home_top_section'),
85 85
 
86 86
 
87
-    array('name' => __('Home Page Layout Settings', 'geodirectory'),
88
-        'type' => 'sectionstart',
89
-        'desc' => '',
90
-        'id' => 'geodir_home_layout'),
87
+	array('name' => __('Home Page Layout Settings', 'geodirectory'),
88
+		'type' => 'sectionstart',
89
+		'desc' => '',
90
+		'id' => 'geodir_home_layout'),
91 91
 
92
-    array(
93
-        'name' => __('Home right section', 'geodirectory'),
94
-        'desc' => __('Show the right section of home page', 'geodirectory'),
95
-        'id' => 'geodir_show_home_right_section',
96
-        'type' => 'checkbox',
97
-        'std' => '1' // Default value to show home top section
98
-    ),
92
+	array(
93
+		'name' => __('Home right section', 'geodirectory'),
94
+		'desc' => __('Show the right section of home page', 'geodirectory'),
95
+		'id' => 'geodir_show_home_right_section',
96
+		'type' => 'checkbox',
97
+		'std' => '1' // Default value to show home top section
98
+	),
99 99
 
100
-    array(
101
-        'name' => __('Width of home right section', 'geodirectory'),
102
-        'desc' => __('Enter the width of right section of home page in %', 'geodirectory'),
103
-        'id' => 'geodir_width_home_right_section',
104
-        'type' => 'text',
105
-        'css' => 'min-width:300px;',
106
-        'std' => '30' // Default value to show home top section
107
-    ),
100
+	array(
101
+		'name' => __('Width of home right section', 'geodirectory'),
102
+		'desc' => __('Enter the width of right section of home page in %', 'geodirectory'),
103
+		'id' => 'geodir_width_home_right_section',
104
+		'type' => 'text',
105
+		'css' => 'min-width:300px;',
106
+		'std' => '30' // Default value to show home top section
107
+	),
108 108
 
109
-    array(
110
-        'name' => __('Home content section', 'geodirectory'),
111
-        'desc' => __('Show the content section of home page', 'geodirectory'),
112
-        'id' => 'geodir_show_home_contant_section',
113
-        'type' => 'checkbox',
114
-        'std' => '1' // Default value to show home top section
115
-    ),
109
+	array(
110
+		'name' => __('Home content section', 'geodirectory'),
111
+		'desc' => __('Show the content section of home page', 'geodirectory'),
112
+		'id' => 'geodir_show_home_contant_section',
113
+		'type' => 'checkbox',
114
+		'std' => '1' // Default value to show home top section
115
+	),
116 116
 
117
-    array(
118
-        'name' => __('Width of home content section', 'geodirectory'),
119
-        'desc' => __('Enter the width of content section of home page in %', 'geodirectory'),
120
-        'id' => 'geodir_width_home_contant_section',
121
-        'type' => 'text',
122
-        'css' => 'min-width:300px;',
123
-        'std' => '63' // Default value to show home top section
124
-    ),
117
+	array(
118
+		'name' => __('Width of home content section', 'geodirectory'),
119
+		'desc' => __('Enter the width of content section of home page in %', 'geodirectory'),
120
+		'id' => 'geodir_width_home_contant_section',
121
+		'type' => 'text',
122
+		'css' => 'min-width:300px;',
123
+		'std' => '63' // Default value to show home top section
124
+	),
125 125
 
126
-    array(
127
-        'name' => __('Home left section', 'geodirectory'),
128
-        'desc' => __('Show the left section of home page', 'geodirectory'),
129
-        'id' => 'geodir_show_home_left_section',
130
-        'type' => 'checkbox',
131
-        'std' => '0' // Default value to show home top section
132
-    ),
126
+	array(
127
+		'name' => __('Home left section', 'geodirectory'),
128
+		'desc' => __('Show the left section of home page', 'geodirectory'),
129
+		'id' => 'geodir_show_home_left_section',
130
+		'type' => 'checkbox',
131
+		'std' => '0' // Default value to show home top section
132
+	),
133 133
 
134
-    array(
135
-        'name' => __('Width of home left section', 'geodirectory'),
136
-        'desc' => __('Enter the width of left section of home page in %', 'geodirectory'),
137
-        'id' => 'geodir_width_home_left_section',
138
-        'type' => 'text',
139
-        'css' => 'min-width:300px;',
140
-        'std' => '30' // Default value to show home top section
141
-    ),
134
+	array(
135
+		'name' => __('Width of home left section', 'geodirectory'),
136
+		'desc' => __('Enter the width of left section of home page in %', 'geodirectory'),
137
+		'id' => 'geodir_width_home_left_section',
138
+		'type' => 'text',
139
+		'css' => 'min-width:300px;',
140
+		'std' => '30' // Default value to show home top section
141
+	),
142 142
 
143
-    array(
144
-        'name' => __('Home bottom section', 'geodirectory'),
145
-        'desc' => __('Show the bottom section of home page', 'geodirectory'),
146
-        'id' => 'geodir_show_home_bottom_section',
147
-        'type' => 'checkbox',
148
-        'std' => '0' // Default value to show home top section
149
-    ),
150
-    array(
151
-        'name' => __('Resize image large size', 'geodirectory'),
152
-        'desc' => sprintf(__('Use default wordpress media image large size ( %s ) for featured image upload. If unchecked then default geodirectory image large size ( 800x800 ) will be used.', 'geodirectory'), get_option('large_size_w') . 'x' . get_option('large_size_h')),
153
-        'id' => 'geodir_use_wp_media_large_size',
154
-        'type' => 'checkbox',
155
-        'std' => '0'
156
-    ),
143
+	array(
144
+		'name' => __('Home bottom section', 'geodirectory'),
145
+		'desc' => __('Show the bottom section of home page', 'geodirectory'),
146
+		'id' => 'geodir_show_home_bottom_section',
147
+		'type' => 'checkbox',
148
+		'std' => '0' // Default value to show home top section
149
+	),
150
+	array(
151
+		'name' => __('Resize image large size', 'geodirectory'),
152
+		'desc' => sprintf(__('Use default wordpress media image large size ( %s ) for featured image upload. If unchecked then default geodirectory image large size ( 800x800 ) will be used.', 'geodirectory'), get_option('large_size_w') . 'x' . get_option('large_size_h')),
153
+		'id' => 'geodir_use_wp_media_large_size',
154
+		'type' => 'checkbox',
155
+		'std' => '0'
156
+	),
157 157
 
158
-    array('type' => 'sectionend', 'id' => 'geodir_home_layout'),
158
+	array('type' => 'sectionend', 'id' => 'geodir_home_layout'),
159 159
 
160 160
 
161
-    /* Home Layout Settings end */
161
+	/* Home Layout Settings end */
162 162
 
163 163
 
164
-    /* Listing Layout Settings end */
164
+	/* Listing Layout Settings end */
165 165
 
166
-    array('name' => __('Listings', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_listing_settings '),
166
+	array('name' => __('Listings', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_listing_settings '),
167 167
 
168 168
 
169
-    array('name' => __('Listing Page Layout Settings', 'geodirectory'),
170
-        'type' => 'sectionstart',
171
-        'desc' => '',
172
-        'id' => 'geodir_listing_layout'),
169
+	array('name' => __('Listing Page Layout Settings', 'geodirectory'),
170
+		'type' => 'sectionstart',
171
+		'desc' => '',
172
+		'id' => 'geodir_listing_layout'),
173 173
 
174
-    array(
175
-        'name' => __('Listing top section', 'geodirectory'),
176
-        'desc' => __('Show the top section of listing page', 'geodirectory'),
177
-        'id' => 'geodir_show_listing_top_section',
178
-        'type' => 'checkbox',
179
-        'std' => '1' // Default value to show home top section
180
-    ),
174
+	array(
175
+		'name' => __('Listing top section', 'geodirectory'),
176
+		'desc' => __('Show the top section of listing page', 'geodirectory'),
177
+		'id' => 'geodir_show_listing_top_section',
178
+		'type' => 'checkbox',
179
+		'std' => '1' // Default value to show home top section
180
+	),
181 181
 
182
-    array(
183
-        'name' => __('Listing right section', 'geodirectory'),
184
-        'desc' => __('Show the right section of listing page', 'geodirectory'),
185
-        'id' => 'geodir_show_listing_right_section',
186
-        'type' => 'checkbox',
187
-        'std' => '1' // Default value to show home top section
188
-    ),
182
+	array(
183
+		'name' => __('Listing right section', 'geodirectory'),
184
+		'desc' => __('Show the right section of listing page', 'geodirectory'),
185
+		'id' => 'geodir_show_listing_right_section',
186
+		'type' => 'checkbox',
187
+		'std' => '1' // Default value to show home top section
188
+	),
189 189
 
190
-    array(
191
-        'name' => __('Width of listing right section', 'geodirectory'),
192
-        'desc' => __('Enter the width of right section of listing page in %', 'geodirectory'),
193
-        'id' => 'geodir_width_listing_right_section',
194
-        'type' => 'text',
195
-        'css' => 'min-width:300px;',
196
-        'std' => '30' // Default value to show home top section
197
-    ),
190
+	array(
191
+		'name' => __('Width of listing right section', 'geodirectory'),
192
+		'desc' => __('Enter the width of right section of listing page in %', 'geodirectory'),
193
+		'id' => 'geodir_width_listing_right_section',
194
+		'type' => 'text',
195
+		'css' => 'min-width:300px;',
196
+		'std' => '30' // Default value to show home top section
197
+	),
198 198
 
199 199
 
200
-    array(
201
-        'name' => __('Listing content section view', 'geodirectory'),
202
-        'desc' => __('Set the listing view of listing page', 'geodirectory'),
203
-        'id' => 'geodir_listing_view',
204
-        'css' => 'min-width:300px;',
205
-        'std' => 'gridview_onehalf',
206
-        'type' => 'select',
207
-        'class' => 'chosen_select',
208
-        'options' => array_unique(array(
209
-            'gridview_onehalf' => __('Grid View (Two Columns)', 'geodirectory'),
210
-            'gridview_onethird' => __('Grid View (Three Columns)', 'geodirectory'),
211
-            'gridview_onefourth' => __('Grid View (Four Columns)', 'geodirectory'),
212
-            'gridview_onefifth' => __('Grid View (Five Columns)', 'geodirectory'),
213
-            'listview' => __('List view', 'geodirectory'),
214
-        ))
215
-    ),
200
+	array(
201
+		'name' => __('Listing content section view', 'geodirectory'),
202
+		'desc' => __('Set the listing view of listing page', 'geodirectory'),
203
+		'id' => 'geodir_listing_view',
204
+		'css' => 'min-width:300px;',
205
+		'std' => 'gridview_onehalf',
206
+		'type' => 'select',
207
+		'class' => 'chosen_select',
208
+		'options' => array_unique(array(
209
+			'gridview_onehalf' => __('Grid View (Two Columns)', 'geodirectory'),
210
+			'gridview_onethird' => __('Grid View (Three Columns)', 'geodirectory'),
211
+			'gridview_onefourth' => __('Grid View (Four Columns)', 'geodirectory'),
212
+			'gridview_onefifth' => __('Grid View (Five Columns)', 'geodirectory'),
213
+			'listview' => __('List view', 'geodirectory'),
214
+		))
215
+	),
216 216
 
217
-    array(
218
-        'name' => __('Width of listing content section', 'geodirectory'),
219
-        'desc' => __('Enter the width of content section of listing page in %', 'geodirectory'),
220
-        'id' => 'geodir_width_listing_contant_section',
221
-        'type' => 'text',
222
-        'css' => 'min-width:300px;',
223
-        'std' => '63' // Default value to show home top section
224
-    ),
217
+	array(
218
+		'name' => __('Width of listing content section', 'geodirectory'),
219
+		'desc' => __('Enter the width of content section of listing page in %', 'geodirectory'),
220
+		'id' => 'geodir_width_listing_contant_section',
221
+		'type' => 'text',
222
+		'css' => 'min-width:300px;',
223
+		'std' => '63' // Default value to show home top section
224
+	),
225 225
 
226
-    array(
227
-        'name' => __('Listing left section', 'geodirectory'),
228
-        'desc' => __('Show the left section of listing page', 'geodirectory'),
229
-        'id' => 'geodir_show_listing_left_section',
230
-        'type' => 'checkbox',
231
-        'std' => '0' // Default value to show home top section
232
-    ),
226
+	array(
227
+		'name' => __('Listing left section', 'geodirectory'),
228
+		'desc' => __('Show the left section of listing page', 'geodirectory'),
229
+		'id' => 'geodir_show_listing_left_section',
230
+		'type' => 'checkbox',
231
+		'std' => '0' // Default value to show home top section
232
+	),
233 233
 
234
-    array(
235
-        'name' => __('Width of listing left section', 'geodirectory'),
236
-        'desc' => __('Enter the width of left section of listing in %', 'geodirectory'),
237
-        'id' => 'geodir_width_listing_left_section',
238
-        'type' => 'text',
239
-        'css' => 'min-width:300px;',
240
-        'std' => '30' // Default value to show home top section
241
-    ),
234
+	array(
235
+		'name' => __('Width of listing left section', 'geodirectory'),
236
+		'desc' => __('Enter the width of left section of listing in %', 'geodirectory'),
237
+		'id' => 'geodir_width_listing_left_section',
238
+		'type' => 'text',
239
+		'css' => 'min-width:300px;',
240
+		'std' => '30' // Default value to show home top section
241
+	),
242 242
 
243
-    array(
244
-        'name' => __('Listing bottom section', 'geodirectory'),
245
-        'desc' => __('Show the bottom section of listing page', 'geodirectory'),
246
-        'id' => 'geodir_show_listing_bottom_section',
247
-        'type' => 'checkbox',
248
-        'std' => '0' // Default value to show home top section
249
-    ),
243
+	array(
244
+		'name' => __('Listing bottom section', 'geodirectory'),
245
+		'desc' => __('Show the bottom section of listing page', 'geodirectory'),
246
+		'id' => 'geodir_show_listing_bottom_section',
247
+		'type' => 'checkbox',
248
+		'std' => '0' // Default value to show home top section
249
+	),
250 250
 
251
-    array(
252
-        'name' => __('Upload listing no image', 'geodirectory'),
253
-        'desc' => '',
254
-        'id' => 'geodir_listing_no_img',
255
-        'type' => 'file',
256
-        'std' => '0' // Default value to show home top section
257
-    ),
251
+	array(
252
+		'name' => __('Upload listing no image', 'geodirectory'),
253
+		'desc' => '',
254
+		'id' => 'geodir_listing_no_img',
255
+		'type' => 'file',
256
+		'std' => '0' // Default value to show home top section
257
+	),
258 258
 
259
-    array(
260
-        'name' => __('Description word limit', 'geodirectory'),
261
-        'desc' => '',
262
-        'id' => 'geodir_desc_word_limit',
263
-        'type' => 'text',
264
-        'css' => 'min-width:300px;',
265
-        'std' => '50' // Default value to show home top section
266
-    ),
259
+	array(
260
+		'name' => __('Description word limit', 'geodirectory'),
261
+		'desc' => '',
262
+		'id' => 'geodir_desc_word_limit',
263
+		'type' => 'text',
264
+		'css' => 'min-width:300px;',
265
+		'std' => '50' // Default value to show home top section
266
+	),
267 267
 
268
-    array(
269
-        'name' => __('Hover listing map animation', 'geodirectory'),
270
-        'desc' => __('Bounce map pin if listing hovered', 'geodirectory'),
271
-        'id' => 'geodir_listing_hover_bounce_map_pin',
272
-        'type' => 'checkbox',
273
-        'std' => '1' // Default value to show home top section
274
-    ),
268
+	array(
269
+		'name' => __('Hover listing map animation', 'geodirectory'),
270
+		'desc' => __('Bounce map pin if listing hovered', 'geodirectory'),
271
+		'id' => 'geodir_listing_hover_bounce_map_pin',
272
+		'type' => 'checkbox',
273
+		'std' => '1' // Default value to show home top section
274
+	),
275 275
 
276
-    array('type' => 'sectionend', 'id' => 'geodir_listing_layout'),
276
+	array('type' => 'sectionend', 'id' => 'geodir_listing_layout'),
277 277
 
278 278
 
279
-    array('name' => __('Listing General Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_listing_gen_settings '),
279
+	array('name' => __('Listing General Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_listing_gen_settings '),
280 280
 
281
-    array(
282
-        'name' => __('New listing default status', 'geodirectory'),
283
-        'desc' => __('Select new listing default status.', 'geodirectory'),
284
-        'tip' => '',
285
-        'id' => 'geodir_new_post_default_status',
286
-        'css' => 'min-width:300px;',
287
-        'std' => 'publish',
288
-        'type' => 'select',
289
-        'class' => 'chosen_select',
290
-        'options' => array_unique(array(
291
-            'publish' => __('publish', 'geodirectory'),
292
-            'draft' => __('draft', 'geodirectory'),
293
-        ))
294
-    ),
281
+	array(
282
+		'name' => __('New listing default status', 'geodirectory'),
283
+		'desc' => __('Select new listing default status.', 'geodirectory'),
284
+		'tip' => '',
285
+		'id' => 'geodir_new_post_default_status',
286
+		'css' => 'min-width:300px;',
287
+		'std' => 'publish',
288
+		'type' => 'select',
289
+		'class' => 'chosen_select',
290
+		'options' => array_unique(array(
291
+			'publish' => __('publish', 'geodirectory'),
292
+			'draft' => __('draft', 'geodirectory'),
293
+		))
294
+	),
295 295
 
296
-    array(
297
-        'name' => __('New listings settings', 'geodirectory'),
298
-        'desc' => __('Enter number of days a listing will appear new.(enter 0 to disable feature)', 'geodirectory'),
299
-        'id' => 'geodir_listing_new_days',
300
-        'type' => 'text',
301
-        'css' => 'min-width:300px;',
302
-        'std' => '30' // Default value for the page title - changed in settings
303
-    ),
296
+	array(
297
+		'name' => __('New listings settings', 'geodirectory'),
298
+		'desc' => __('Enter number of days a listing will appear new.(enter 0 to disable feature)', 'geodirectory'),
299
+		'id' => 'geodir_listing_new_days',
300
+		'type' => 'text',
301
+		'css' => 'min-width:300px;',
302
+		'std' => '30' // Default value for the page title - changed in settings
303
+	),
304 304
 
305
-    array('type' => 'sectionend', 'id' => 'geodir_listing_gen_settings'),
305
+	array('type' => 'sectionend', 'id' => 'geodir_listing_gen_settings'),
306 306
 
307 307
 
308
-    array('name' => __('Add Listing Form Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_add_listing_gen_settings'),
308
+	array('name' => __('Add Listing Form Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_add_listing_gen_settings'),
309 309
 
310
-    array(
311
-        'name' => __('Enable "Accept Terms and Conditions"', 'geodirectory'),
312
-        'desc' => __('Show the "Accept Terms and Conditions" field on add listing.', 'geodirectory'),
313
-        'id' => 'geodir_accept_term_condition',
314
-        'type' => 'checkbox',
315
-        'std' => '1' // Default value to show home top section
316
-    ),
310
+	array(
311
+		'name' => __('Enable "Accept Terms and Conditions"', 'geodirectory'),
312
+		'desc' => __('Show the "Accept Terms and Conditions" field on add listing.', 'geodirectory'),
313
+		'id' => 'geodir_accept_term_condition',
314
+		'type' => 'checkbox',
315
+		'std' => '1' // Default value to show home top section
316
+	),
317 317
 
318 318
 
319
-    array(
320
-        'name' => __('Show description field as editor', 'geodirectory'),
321
-        'desc' => __('Select post types to show advanced editor on add listing page.', 'geodirectory'),
322
-        'tip' => '',
323
-        'id' => 'geodir_tiny_editor_on_add_listing',
324
-        'css' => 'min-width:300px;',
325
-        'std' => array(),
326
-        'type' => 'multiselect',
327
-        'placeholder_text' => __('Select post types', 'geodirectory'),
328
-        'class' => 'chosen_select',
329
-        'options' => array_unique(geodir_post_type_setting_fun())
330
-    ),
319
+	array(
320
+		'name' => __('Show description field as editor', 'geodirectory'),
321
+		'desc' => __('Select post types to show advanced editor on add listing page.', 'geodirectory'),
322
+		'tip' => '',
323
+		'id' => 'geodir_tiny_editor_on_add_listing',
324
+		'css' => 'min-width:300px;',
325
+		'std' => array(),
326
+		'type' => 'multiselect',
327
+		'placeholder_text' => __('Select post types', 'geodirectory'),
328
+		'class' => 'chosen_select',
329
+		'options' => array_unique(geodir_post_type_setting_fun())
330
+	),
331 331
 
332
-    array('type' => 'sectionend', 'id' => 'geodir_add_listing_gen_settings'),
333
-    /* Listing Layout Settings end */
332
+	array('type' => 'sectionend', 'id' => 'geodir_add_listing_gen_settings'),
333
+	/* Listing Layout Settings end */
334 334
 
335 335
 
336
-    /* Search Layout Settings end */
336
+	/* Search Layout Settings end */
337 337
 
338
-    array('name' => __('Search', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_search_settings '),
338
+	array('name' => __('Search', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_search_settings '),
339 339
 
340 340
 
341
-    array('name' => __('Search Page Layout Settings', 'geodirectory'),
342
-        'type' => 'sectionstart',
343
-        'desc' => '',
344
-        'id' => 'geodir_search_layout'),
341
+	array('name' => __('Search Page Layout Settings', 'geodirectory'),
342
+		'type' => 'sectionstart',
343
+		'desc' => '',
344
+		'id' => 'geodir_search_layout'),
345 345
 
346
-    array(
347
-        'name' => __('Search top section', 'geodirectory'),
348
-        'desc' => __('Show the top section of search page', 'geodirectory'),
349
-        'id' => 'geodir_show_search_top_section',
350
-        'type' => 'checkbox',
351
-        'std' => '1' // Default value to show home top section
352
-    ),
346
+	array(
347
+		'name' => __('Search top section', 'geodirectory'),
348
+		'desc' => __('Show the top section of search page', 'geodirectory'),
349
+		'id' => 'geodir_show_search_top_section',
350
+		'type' => 'checkbox',
351
+		'std' => '1' // Default value to show home top section
352
+	),
353 353
 
354
-    array(
355
-        'name' => __('Search right section', 'geodirectory'),
356
-        'desc' => __('Show the right section of search page', 'geodirectory'),
357
-        'id' => 'geodir_show_search_right_section',
358
-        'type' => 'checkbox',
359
-        'std' => '1' // Default value to show home top section
360
-    ),
354
+	array(
355
+		'name' => __('Search right section', 'geodirectory'),
356
+		'desc' => __('Show the right section of search page', 'geodirectory'),
357
+		'id' => 'geodir_show_search_right_section',
358
+		'type' => 'checkbox',
359
+		'std' => '1' // Default value to show home top section
360
+	),
361 361
 
362
-    array(
363
-        'name' => __('Width of search right section', 'geodirectory'),
364
-        'desc' => __('Enter the width of right section of search page in %', 'geodirectory'),
365
-        'id' => 'geodir_width_search_right_section',
366
-        'type' => 'text',
367
-        'css' => 'min-width:300px;',
368
-        'std' => '30' // Default value to show home top section
369
-    ),
362
+	array(
363
+		'name' => __('Width of search right section', 'geodirectory'),
364
+		'desc' => __('Enter the width of right section of search page in %', 'geodirectory'),
365
+		'id' => 'geodir_width_search_right_section',
366
+		'type' => 'text',
367
+		'css' => 'min-width:300px;',
368
+		'std' => '30' // Default value to show home top section
369
+	),
370 370
 
371 371
 
372
-    array(
373
-        'name' => __('Search content section view', 'geodirectory'),
374
-        'desc' => __('Set the listing view of search page', 'geodirectory'),
375
-        'id' => 'geodir_search_view',
376
-        'css' => 'min-width:300px;',
377
-        'std' => 'gridview_onehalf',
378
-        'type' => 'select',
379
-        'class' => 'chosen_select',
380
-        'options' => array_unique(array(
381
-            'gridview_onehalf' => __('Grid View (Two Columns)', 'geodirectory'),
382
-            'gridview_onethird' => __('Grid View (Three Columns)', 'geodirectory'),
383
-            'gridview_onefourth' => __('Grid View (Four Columns)', 'geodirectory'),
384
-            'gridview_onefifth' => __('Grid View (Five Columns)', 'geodirectory'),
385
-            'listview' => __('List view', 'geodirectory'),
386
-        ))
387
-    ),
372
+	array(
373
+		'name' => __('Search content section view', 'geodirectory'),
374
+		'desc' => __('Set the listing view of search page', 'geodirectory'),
375
+		'id' => 'geodir_search_view',
376
+		'css' => 'min-width:300px;',
377
+		'std' => 'gridview_onehalf',
378
+		'type' => 'select',
379
+		'class' => 'chosen_select',
380
+		'options' => array_unique(array(
381
+			'gridview_onehalf' => __('Grid View (Two Columns)', 'geodirectory'),
382
+			'gridview_onethird' => __('Grid View (Three Columns)', 'geodirectory'),
383
+			'gridview_onefourth' => __('Grid View (Four Columns)', 'geodirectory'),
384
+			'gridview_onefifth' => __('Grid View (Five Columns)', 'geodirectory'),
385
+			'listview' => __('List view', 'geodirectory'),
386
+		))
387
+	),
388 388
 
389
-    array(
390
-        'name' => __('Width of search content section', 'geodirectory'),
391
-        'desc' => __('Enter the width of content section of search page in %', 'geodirectory'),
392
-        'id' => 'geodir_width_search_contant_section',
393
-        'type' => 'text',
394
-        'css' => 'min-width:300px;',
395
-        'std' => '63' // Default value to show home top section
396
-    ),
389
+	array(
390
+		'name' => __('Width of search content section', 'geodirectory'),
391
+		'desc' => __('Enter the width of content section of search page in %', 'geodirectory'),
392
+		'id' => 'geodir_width_search_contant_section',
393
+		'type' => 'text',
394
+		'css' => 'min-width:300px;',
395
+		'std' => '63' // Default value to show home top section
396
+	),
397 397
 
398
-    array(
399
-        'name' => __('Search left section', 'geodirectory'),
400
-        'desc' => __('Show the left section of search page', 'geodirectory'),
401
-        'id' => 'geodir_show_search_left_section',
402
-        'type' => 'checkbox',
403
-        'std' => '0' // Default value to show home top section
404
-    ),
398
+	array(
399
+		'name' => __('Search left section', 'geodirectory'),
400
+		'desc' => __('Show the left section of search page', 'geodirectory'),
401
+		'id' => 'geodir_show_search_left_section',
402
+		'type' => 'checkbox',
403
+		'std' => '0' // Default value to show home top section
404
+	),
405 405
 
406
-    array(
407
-        'name' => __('Width of search left section', 'geodirectory'),
408
-        'desc' => __('Enter the width of left section of search in %', 'geodirectory'),
409
-        'id' => 'geodir_width_search_left_section',
410
-        'type' => 'text',
411
-        'css' => 'min-width:300px;',
412
-        'std' => '30' // Default value to show home top section
413
-    ),
406
+	array(
407
+		'name' => __('Width of search left section', 'geodirectory'),
408
+		'desc' => __('Enter the width of left section of search in %', 'geodirectory'),
409
+		'id' => 'geodir_width_search_left_section',
410
+		'type' => 'text',
411
+		'css' => 'min-width:300px;',
412
+		'std' => '30' // Default value to show home top section
413
+	),
414 414
 
415
-    array(
416
-        'name' => __('Search bottom section', 'geodirectory'),
417
-        'desc' => __('Show the bottom section of search page', 'geodirectory'),
418
-        'id' => 'geodir_show_search_bottom_section',
419
-        'type' => 'checkbox',
420
-        'std' => '0' // Default value to show home top section
421
-    ),
415
+	array(
416
+		'name' => __('Search bottom section', 'geodirectory'),
417
+		'desc' => __('Show the bottom section of search page', 'geodirectory'),
418
+		'id' => 'geodir_show_search_bottom_section',
419
+		'type' => 'checkbox',
420
+		'std' => '0' // Default value to show home top section
421
+	),
422 422
 	
423 423
 	array(
424
-        'name' => __('Show advanced pagination details', 'geodirectory'),
425
-        'desc' => __('This will add extra pagination info like "Showing listings x-y of z" after/before pagination.', 'geodirectory'),
426
-        'id' => 'geodir_pagination_advance_info',
427
-        'css' => 'min-width:300px;',
428
-        'std' => '',
429
-        'type' => 'select',
430
-        'class' => 'chosen_select',
431
-        'options' => array(
424
+		'name' => __('Show advanced pagination details', 'geodirectory'),
425
+		'desc' => __('This will add extra pagination info like "Showing listings x-y of z" after/before pagination.', 'geodirectory'),
426
+		'id' => 'geodir_pagination_advance_info',
427
+		'css' => 'min-width:300px;',
428
+		'std' => '',
429
+		'type' => 'select',
430
+		'class' => 'chosen_select',
431
+		'options' => array(
432 432
 						'' => __('Never Display', 'geodirectory'),
433 433
 						'after' => __('After Pagination', 'geodirectory'),
434 434
 						'before' => __('Before Pagination', 'geodirectory')
435 435
 					)
436
-    ),
436
+	),
437 437
 
438
-    array('type' => 'sectionend', 'id' => 'geodir_search_layout'),
438
+	array('type' => 'sectionend', 'id' => 'geodir_search_layout'),
439 439
 
440 440
 
441
-    array('name' => __('Search form default text settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_search_form_default_text_settings'),
441
+	array('name' => __('Search form default text settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_search_form_default_text_settings'),
442 442
 
443
-    array(
444
-        'name' => __('Search field default value', 'geodirectory'),
445
-        'desc' => __('Show the search text box \'placeholder\' value on search form.', 'geodirectory'),
446
-        'id' => 'geodir_search_field_default_text',
447
-        'type' => 'text',
448
-        'css' => 'min-width:300px;',
449
-        'std' => 'Search for' // show on the listing page.
450
-    ),
443
+	array(
444
+		'name' => __('Search field default value', 'geodirectory'),
445
+		'desc' => __('Show the search text box \'placeholder\' value on search form.', 'geodirectory'),
446
+		'id' => 'geodir_search_field_default_text',
447
+		'type' => 'text',
448
+		'css' => 'min-width:300px;',
449
+		'std' => 'Search for' // show on the listing page.
450
+	),
451 451
 
452
-    array(
453
-        'name' => __('Near field default value', 'geodirectory'),
454
-        'desc' => __('Show the near text box \'placeholder\' value on search form.', 'geodirectory'),
455
-        'id' => 'geodir_near_field_default_text',
456
-        'type' => 'text',
457
-        'css' => 'min-width:300px;',
458
-        'std' => 'Near' // show on the listing page.
459
-    ),
452
+	array(
453
+		'name' => __('Near field default value', 'geodirectory'),
454
+		'desc' => __('Show the near text box \'placeholder\' value on search form.', 'geodirectory'),
455
+		'id' => 'geodir_near_field_default_text',
456
+		'type' => 'text',
457
+		'css' => 'min-width:300px;',
458
+		'std' => 'Near' // show on the listing page.
459
+	),
460 460
 
461
-    array(
462
-        'name' => __('Search button label', 'geodirectory'),
463
-        'desc' => __('Show the search button label on search form.', 'geodirectory'),
464
-        'id' => 'geodir_search_button_label',
465
-        'type' => 'text',
466
-        'css' => 'min-width:300px;',
467
-        'std' => 'Search' // show on the listing page.
468
-    ),
461
+	array(
462
+		'name' => __('Search button label', 'geodirectory'),
463
+		'desc' => __('Show the search button label on search form.', 'geodirectory'),
464
+		'id' => 'geodir_search_button_label',
465
+		'type' => 'text',
466
+		'css' => 'min-width:300px;',
467
+		'std' => 'Search' // show on the listing page.
468
+	),
469 469
 
470
-    array('type' => 'sectionend', 'id' => 'geodir_search_form_default_text_settings'),
470
+	array('type' => 'sectionend', 'id' => 'geodir_search_form_default_text_settings'),
471 471
 
472
-    /* Listing Layout Settings end */
472
+	/* Listing Layout Settings end */
473 473
 
474 474
 
475
-    /* Detail Layout Settings end */
475
+	/* Detail Layout Settings end */
476 476
 
477
-    array('name' => __('Detail', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_detail_settings '),
477
+	array('name' => __('Detail', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_detail_settings '),
478 478
 
479
-    array('name' => __('Detail/Single Page Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'detail_page_settings '),
479
+	array('name' => __('Detail/Single Page Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'detail_page_settings '),
480 480
 
481
-    array(
482
-        'name' => __('Detail top section', 'geodirectory'),
483
-        'desc' => __('Show the top section of listing page', 'geodirectory'),
484
-        'id' => 'geodir_show_detail_top_section',
485
-        'type' => 'checkbox',
486
-        'std' => '1' // Default value to show home top section
487
-    ),
481
+	array(
482
+		'name' => __('Detail top section', 'geodirectory'),
483
+		'desc' => __('Show the top section of listing page', 'geodirectory'),
484
+		'id' => 'geodir_show_detail_top_section',
485
+		'type' => 'checkbox',
486
+		'std' => '1' // Default value to show home top section
487
+	),
488 488
 
489
-    array(
490
-        'name' => __('Detail bottom section', 'geodirectory'),
491
-        'desc' => __('Show the bottom section of listing page', 'geodirectory'),
492
-        'id' => 'geodir_show_detail_bottom_section',
493
-        'type' => 'checkbox',
494
-        'std' => '1' // Default value to show home top section
495
-    ),
496
-    array(
497
-        'name' => __('Detail sidebar section on left side', 'geodirectory'),
498
-        'desc' => __('Display detail sidebar section on left side of the detail page', 'geodirectory'),
499
-        'id' => 'geodir_detail_sidebar_left_section',
500
-        'type' => 'checkbox',
501
-        'std' => '0'
502
-    ),
503
-    array(
504
-        'name' => __('Disable GD modal', 'geodirectory'),
505
-        'desc' => __('Disable GD modal that displays slideshow images in popup', 'geodirectory'),
506
-        'id' => 'geodir_disable_gb_modal',
507
-        'type' => 'checkbox',
508
-        'std' => '0'
509
-    ),
510
-    array(
511
-        'name' => __('Disable Tweet, Fb Like, Google+ buttons section', 'geodirectory'),
512
-        'desc' => __('Disable Tweet, Fb Like, Google+ buttons section that displays on Detail page sidebar', 'geodirectory'),
513
-        'id' => 'geodir_disable_tfg_buttons_section',
514
-        'type' => 'checkbox',
515
-        'std' => '0'
516
-    ),
517
-    array(
518
-        'name' => __('Disable share this button section', 'geodirectory'),
519
-        'desc' => __('Disable share this button section that displays on Detail page sidebar', 'geodirectory'),
520
-        'id' => 'geodir_disable_sharethis_button_section',
521
-        'type' => 'checkbox',
522
-        'std' => '0'
523
-    ),
524
-    array(
525
-        'name' => __('Disable Google Analytics section', 'geodirectory'),
526
-        'desc' => __('Disable Google Analytics section that displays on Detail page sidebar', 'geodirectory'),
527
-        'id' => 'geodir_disable_google_analytics_section',
528
-        'type' => 'checkbox',
529
-        'std' => '0'
530
-    ),
531
-    array(
532
-        'name' => __('Disable User Links section', 'geodirectory'),
533
-        'desc' => __('Disable User Links section (Edit post, Favorite etc..) that displays on Detail page sidebar', 'geodirectory'),
534
-        'id' => 'geodir_disable_user_links_section',
535
-        'type' => 'checkbox',
536
-        'std' => '0'
537
-    ),
538
-    array(
539
-        'name' => __('Disable Rating Info section', 'geodirectory'),
540
-        'desc' => __('Disable Rating Info section that displays on Detail page sidebar', 'geodirectory'),
541
-        'id' => 'geodir_disable_rating_info_section',
542
-        'type' => 'checkbox',
543
-        'std' => '0'
544
-    ),
545
-    array(
546
-        'name' => __('Disable Listing Info section', 'geodirectory'),
547
-        'desc' => __('Disable Listing Info section that displays on Detail page sidebar', 'geodirectory'),
548
-        'id' => 'geodir_disable_listing_info_section',
549
-        'type' => 'checkbox',
550
-        'std' => '0'
551
-    ),
489
+	array(
490
+		'name' => __('Detail bottom section', 'geodirectory'),
491
+		'desc' => __('Show the bottom section of listing page', 'geodirectory'),
492
+		'id' => 'geodir_show_detail_bottom_section',
493
+		'type' => 'checkbox',
494
+		'std' => '1' // Default value to show home top section
495
+	),
496
+	array(
497
+		'name' => __('Detail sidebar section on left side', 'geodirectory'),
498
+		'desc' => __('Display detail sidebar section on left side of the detail page', 'geodirectory'),
499
+		'id' => 'geodir_detail_sidebar_left_section',
500
+		'type' => 'checkbox',
501
+		'std' => '0'
502
+	),
503
+	array(
504
+		'name' => __('Disable GD modal', 'geodirectory'),
505
+		'desc' => __('Disable GD modal that displays slideshow images in popup', 'geodirectory'),
506
+		'id' => 'geodir_disable_gb_modal',
507
+		'type' => 'checkbox',
508
+		'std' => '0'
509
+	),
510
+	array(
511
+		'name' => __('Disable Tweet, Fb Like, Google+ buttons section', 'geodirectory'),
512
+		'desc' => __('Disable Tweet, Fb Like, Google+ buttons section that displays on Detail page sidebar', 'geodirectory'),
513
+		'id' => 'geodir_disable_tfg_buttons_section',
514
+		'type' => 'checkbox',
515
+		'std' => '0'
516
+	),
517
+	array(
518
+		'name' => __('Disable share this button section', 'geodirectory'),
519
+		'desc' => __('Disable share this button section that displays on Detail page sidebar', 'geodirectory'),
520
+		'id' => 'geodir_disable_sharethis_button_section',
521
+		'type' => 'checkbox',
522
+		'std' => '0'
523
+	),
524
+	array(
525
+		'name' => __('Disable Google Analytics section', 'geodirectory'),
526
+		'desc' => __('Disable Google Analytics section that displays on Detail page sidebar', 'geodirectory'),
527
+		'id' => 'geodir_disable_google_analytics_section',
528
+		'type' => 'checkbox',
529
+		'std' => '0'
530
+	),
531
+	array(
532
+		'name' => __('Disable User Links section', 'geodirectory'),
533
+		'desc' => __('Disable User Links section (Edit post, Favorite etc..) that displays on Detail page sidebar', 'geodirectory'),
534
+		'id' => 'geodir_disable_user_links_section',
535
+		'type' => 'checkbox',
536
+		'std' => '0'
537
+	),
538
+	array(
539
+		'name' => __('Disable Rating Info section', 'geodirectory'),
540
+		'desc' => __('Disable Rating Info section that displays on Detail page sidebar', 'geodirectory'),
541
+		'id' => 'geodir_disable_rating_info_section',
542
+		'type' => 'checkbox',
543
+		'std' => '0'
544
+	),
545
+	array(
546
+		'name' => __('Disable Listing Info section', 'geodirectory'),
547
+		'desc' => __('Disable Listing Info section that displays on Detail page sidebar', 'geodirectory'),
548
+		'id' => 'geodir_disable_listing_info_section',
549
+		'type' => 'checkbox',
550
+		'std' => '0'
551
+	),
552 552
 
553
-    array('type' => 'sectionend', 'id' => 'detail_page_settings'),
553
+	array('type' => 'sectionend', 'id' => 'detail_page_settings'),
554 554
 
555 555
 
556
-    /* ---------- DETAIL PAGE TAB SETTING START*/
556
+	/* ---------- DETAIL PAGE TAB SETTING START*/
557 557
 
558
-    array('name' => __('Detail Page Tab Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_detail_page_tab_settings '),
558
+	array('name' => __('Detail Page Tab Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_detail_page_tab_settings '),
559 559
 
560
-    array(
561
-        'name' => __('Exclude selected tabs from detail page', 'geodirectory'),
562
-        'desc' => __('Select tabs to exclude from the list of all appearing tabs on detail page.', 'geodirectory'),
563
-        'tip' => '',
564
-        'id' => 'geodir_detail_page_tabs_excluded',
565
-        'css' => 'min-width:300px;',
566
-        'std' => geodir_get_posttypes(),
567
-        'type' => 'multiselect',
568
-        'placeholder_text' => __('Select tabs', 'geodirectory'),
569
-        'class' => 'chosen_select',
570
-        'options' => array_unique(geodir_detail_page_tabs_key_value_array())
571
-    ),
560
+	array(
561
+		'name' => __('Exclude selected tabs from detail page', 'geodirectory'),
562
+		'desc' => __('Select tabs to exclude from the list of all appearing tabs on detail page.', 'geodirectory'),
563
+		'tip' => '',
564
+		'id' => 'geodir_detail_page_tabs_excluded',
565
+		'css' => 'min-width:300px;',
566
+		'std' => geodir_get_posttypes(),
567
+		'type' => 'multiselect',
568
+		'placeholder_text' => __('Select tabs', 'geodirectory'),
569
+		'class' => 'chosen_select',
570
+		'options' => array_unique(geodir_detail_page_tabs_key_value_array())
571
+	),
572 572
     
573
-    array(
574
-        'name' => __('Show as list', 'geodirectory'),
575
-        'desc' => __('Show as list instead of tabs', 'geodirectory'),
576
-        'id' => 'geodir_disable_tabs',
577
-        'type' => 'checkbox',
578
-        'std' => '0'
579
-    ),
573
+	array(
574
+		'name' => __('Show as list', 'geodirectory'),
575
+		'desc' => __('Show as list instead of tabs', 'geodirectory'),
576
+		'id' => 'geodir_disable_tabs',
577
+		'type' => 'checkbox',
578
+		'std' => '0'
579
+	),
580 580
 
581
-    array('type' => 'sectionend', 'id' => 'geodir_detail_page_tab_settings'),
582
-    /* ---------- DETAIL PAGE TAB SETTING END*/
581
+	array('type' => 'sectionend', 'id' => 'geodir_detail_page_tab_settings'),
582
+	/* ---------- DETAIL PAGE TAB SETTING END*/
583 583
 
584
-    /* START DEFAULT STAR IMAGE*/
585
-    array('name' => __('Default Rating Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_rating_settings '),
584
+	/* START DEFAULT STAR IMAGE*/
585
+	array('name' => __('Default Rating Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_rating_settings '),
586 586
 
587
-    array(
588
-        'name' => __('Upload default rating star icon', 'geodirectory'),
589
-        'desc' => '',
590
-        'id' => 'geodir_default_rating_star_icon',
591
-        'type' => 'file',
592
-        'std' => '0',
593
-        'value' => geodir_plugin_url() . '/geodirectory-assets/images/stars.png'// Default value to show home top section
594
-    ),
587
+	array(
588
+		'name' => __('Upload default rating star icon', 'geodirectory'),
589
+		'desc' => '',
590
+		'id' => 'geodir_default_rating_star_icon',
591
+		'type' => 'file',
592
+		'std' => '0',
593
+		'value' => geodir_plugin_url() . '/geodirectory-assets/images/stars.png'// Default value to show home top section
594
+	),
595 595
 	array(
596 596
 		'name' => __('Enable Font Awesome', 'geodirectory'),
597 597
 		'desc' => __('When enabled all rating images will be using font awesome rating icons as images.', 'geodirectory' ),
@@ -607,369 +607,369 @@  discard block
 block discarded – undo
607 607
 		'std' => '#757575'
608 608
 	),
609 609
 
610
-    array('type' => 'sectionend', 'id' => 'geodir_detail_page_tab_settings'),
610
+	array('type' => 'sectionend', 'id' => 'geodir_detail_page_tab_settings'),
611 611
 
612
-    /* END DEFAULT STAR IMAGE*/
612
+	/* END DEFAULT STAR IMAGE*/
613 613
 
614
-    /* Detail related post settings start */
614
+	/* Detail related post settings start */
615 615
 
616
-    array('name' => __('Related Post Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'detail_page_related_post_settings '),
616
+	array('name' => __('Related Post Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'detail_page_related_post_settings '),
617 617
 
618
-    array(
619
-        'name' => __('Show related post listing on', 'geodirectory'),
620
-        'desc' => __('Select the post types to display related listing on detail page.', 'geodirectory'),
621
-        'tip' => '',
622
-        'id' => 'geodir_add_related_listing_posttypes',
623
-        'css' => 'min-width:300px;',
624
-        'std' => geodir_get_posttypes(),
625
-        'type' => 'multiselect',
626
-        'placeholder_text' => __('Select post types', 'geodirectory'),
627
-        'class' => 'chosen_select',
628
-        'options' => array_unique(geodir_post_type_setting_fun())
629
-    ),
618
+	array(
619
+		'name' => __('Show related post listing on', 'geodirectory'),
620
+		'desc' => __('Select the post types to display related listing on detail page.', 'geodirectory'),
621
+		'tip' => '',
622
+		'id' => 'geodir_add_related_listing_posttypes',
623
+		'css' => 'min-width:300px;',
624
+		'std' => geodir_get_posttypes(),
625
+		'type' => 'multiselect',
626
+		'placeholder_text' => __('Select post types', 'geodirectory'),
627
+		'class' => 'chosen_select',
628
+		'options' => array_unique(geodir_post_type_setting_fun())
629
+	),
630 630
 
631
-    array(
632
-        'name' => __('Relate to', 'geodirectory'),
633
-        'desc' => __('Set the relation between current post to related posts.', 'geodirectory'),
634
-        'id' => 'geodir_related_post_relate_to',
635
-        'css' => 'min-width:300px;',
636
-        'std' => 'category',
637
-        'type' => 'select',
638
-        'class' => 'chosen_select',
639
-        'options' => array_unique(array(
640
-            'category' => __('Categories', 'geodirectory'),
641
-            'tags' => __('Tags', 'geodirectory'),
642
-        ))
643
-    ),
631
+	array(
632
+		'name' => __('Relate to', 'geodirectory'),
633
+		'desc' => __('Set the relation between current post to related posts.', 'geodirectory'),
634
+		'id' => 'geodir_related_post_relate_to',
635
+		'css' => 'min-width:300px;',
636
+		'std' => 'category',
637
+		'type' => 'select',
638
+		'class' => 'chosen_select',
639
+		'options' => array_unique(array(
640
+			'category' => __('Categories', 'geodirectory'),
641
+			'tags' => __('Tags', 'geodirectory'),
642
+		))
643
+	),
644 644
 
645
-    array(
646
-        'name' => __('Layout', 'geodirectory'),
647
-        'desc' => __('Set the listing view of relate post on detail page', 'geodirectory'),
648
-        'id' => 'geodir_related_post_listing_view',
649
-        'css' => 'min-width:300px;',
650
-        'std' => 'gridview_onehalf',
651
-        'type' => 'select',
652
-        'class' => 'chosen_select',
653
-        'options' => array_unique(array(
654
-            'gridview_onehalf' => __('Grid View (Two Columns)', 'geodirectory'),
655
-            'gridview_onethird' => __('Grid View (Three Columns)', 'geodirectory'),
656
-            'gridview_onefourth' => __('Grid View (Four Columns)', 'geodirectory'),
657
-            'gridview_onefifth' => __('Grid View (Five Columns)', 'geodirectory'),
658
-            'listview' => __('List view', 'geodirectory'),
659
-        ))
660
-    ),
645
+	array(
646
+		'name' => __('Layout', 'geodirectory'),
647
+		'desc' => __('Set the listing view of relate post on detail page', 'geodirectory'),
648
+		'id' => 'geodir_related_post_listing_view',
649
+		'css' => 'min-width:300px;',
650
+		'std' => 'gridview_onehalf',
651
+		'type' => 'select',
652
+		'class' => 'chosen_select',
653
+		'options' => array_unique(array(
654
+			'gridview_onehalf' => __('Grid View (Two Columns)', 'geodirectory'),
655
+			'gridview_onethird' => __('Grid View (Three Columns)', 'geodirectory'),
656
+			'gridview_onefourth' => __('Grid View (Four Columns)', 'geodirectory'),
657
+			'gridview_onefifth' => __('Grid View (Five Columns)', 'geodirectory'),
658
+			'listview' => __('List view', 'geodirectory'),
659
+		))
660
+	),
661 661
 
662
-    array(
663
-        'name' => __('Sort by', 'geodirectory'),
664
-        'desc' => __('Set the related post listing sort by view', 'geodirectory'),
665
-        'id' => 'geodir_related_post_sortby',
666
-        'css' => 'min-width:300px;',
667
-        'std' => 'latest',
668
-        'type' => 'select',
669
-        'class' => 'chosen_select',
670
-        'options' => array_unique(array(
671
-            'latest' => __('Latest', 'geodirectory'),
672
-            'featured' => __('Featured', 'geodirectory'),
673
-            'high_review' => __('Review', 'geodirectory'),
674
-            'high_rating' => __('Rating', 'geodirectory'),
675
-            'random' => __('Random', 'geodirectory'),
676
-            'nearest' => __('Nearest', 'geodirectory'),
677
-        ))
678
-    ),
662
+	array(
663
+		'name' => __('Sort by', 'geodirectory'),
664
+		'desc' => __('Set the related post listing sort by view', 'geodirectory'),
665
+		'id' => 'geodir_related_post_sortby',
666
+		'css' => 'min-width:300px;',
667
+		'std' => 'latest',
668
+		'type' => 'select',
669
+		'class' => 'chosen_select',
670
+		'options' => array_unique(array(
671
+			'latest' => __('Latest', 'geodirectory'),
672
+			'featured' => __('Featured', 'geodirectory'),
673
+			'high_review' => __('Review', 'geodirectory'),
674
+			'high_rating' => __('Rating', 'geodirectory'),
675
+			'random' => __('Random', 'geodirectory'),
676
+			'nearest' => __('Nearest', 'geodirectory'),
677
+		))
678
+	),
679 679
 
680
-    array(
681
-        'name' => __('Number of posts:', 'geodirectory'),
682
-        'desc' => __('Enter number of posts to display on related posts listing', 'geodirectory'),
683
-        'id' => 'geodir_related_post_count',
684
-        'type' => 'text',
685
-        'css' => 'min-width:300px;',
686
-        'std' => '5' // Default value to show home top section
687
-    ),
680
+	array(
681
+		'name' => __('Number of posts:', 'geodirectory'),
682
+		'desc' => __('Enter number of posts to display on related posts listing', 'geodirectory'),
683
+		'id' => 'geodir_related_post_count',
684
+		'type' => 'text',
685
+		'css' => 'min-width:300px;',
686
+		'std' => '5' // Default value to show home top section
687
+	),
688 688
 
689
-    array(
690
-        'name' => __('Post excerpt', 'geodirectory'),
691
-        'desc' => __('Post content excerpt character count', 'geodirectory'),
692
-        'id' => 'geodir_related_post_excerpt',
693
-        'type' => 'text',
694
-        'css' => 'min-width:300px;',
695
-        'std' => '20' // Default value to show home top section
696
-    ),
689
+	array(
690
+		'name' => __('Post excerpt', 'geodirectory'),
691
+		'desc' => __('Post content excerpt character count', 'geodirectory'),
692
+		'id' => 'geodir_related_post_excerpt',
693
+		'type' => 'text',
694
+		'css' => 'min-width:300px;',
695
+		'std' => '20' // Default value to show home top section
696
+	),
697 697
 
698 698
 
699
-    array('type' => 'sectionend', 'id' => 'detail_page_related_post_settings'),
700
-    /* Detail Layout Settings end */
699
+	array('type' => 'sectionend', 'id' => 'detail_page_related_post_settings'),
700
+	/* Detail Layout Settings end */
701 701
 
702
-    /* Author Layout Settings Start */
702
+	/* Author Layout Settings Start */
703 703
 
704
-    array('name' => __('Author', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_author_settings '),
704
+	array('name' => __('Author', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_author_settings '),
705 705
 
706 706
 
707
-    array('name' => __('Author Page Layout Settings', 'geodirectory'),
708
-        'type' => 'sectionstart',
709
-        'desc' => '',
710
-        'id' => 'geodir_author_layout'),
707
+	array('name' => __('Author Page Layout Settings', 'geodirectory'),
708
+		'type' => 'sectionstart',
709
+		'desc' => '',
710
+		'id' => 'geodir_author_layout'),
711 711
 
712
-    array(
713
-        'name' => __('Author top section', 'geodirectory'),
714
-        'desc' => __('Show the top section of author page', 'geodirectory'),
715
-        'id' => 'geodir_show_author_top_section',
716
-        'type' => 'checkbox',
717
-        'std' => '1' // Default value to show home top section
718
-    ),
712
+	array(
713
+		'name' => __('Author top section', 'geodirectory'),
714
+		'desc' => __('Show the top section of author page', 'geodirectory'),
715
+		'id' => 'geodir_show_author_top_section',
716
+		'type' => 'checkbox',
717
+		'std' => '1' // Default value to show home top section
718
+	),
719 719
 
720
-    array(
721
-        'name' => __('Author right section', 'geodirectory'),
722
-        'desc' => __('Show the right section of author page', 'geodirectory'),
723
-        'id' => 'geodir_show_author_right_section',
724
-        'type' => 'checkbox',
725
-        'std' => '1' // Default value to show home top section
726
-    ),
720
+	array(
721
+		'name' => __('Author right section', 'geodirectory'),
722
+		'desc' => __('Show the right section of author page', 'geodirectory'),
723
+		'id' => 'geodir_show_author_right_section',
724
+		'type' => 'checkbox',
725
+		'std' => '1' // Default value to show home top section
726
+	),
727 727
 
728
-    array(
729
-        'name' => __('Width of author right section', 'geodirectory'),
730
-        'desc' => __('Enter the width of right section of author page in %', 'geodirectory'),
731
-        'id' => 'geodir_width_author_right_section',
732
-        'type' => 'text',
733
-        'css' => 'min-width:300px;',
734
-        'std' => '30' // Default value to show home top section
735
-    ),
728
+	array(
729
+		'name' => __('Width of author right section', 'geodirectory'),
730
+		'desc' => __('Enter the width of right section of author page in %', 'geodirectory'),
731
+		'id' => 'geodir_width_author_right_section',
732
+		'type' => 'text',
733
+		'css' => 'min-width:300px;',
734
+		'std' => '30' // Default value to show home top section
735
+	),
736 736
 
737
-    array(
738
-        'name' => __('Author content section view', 'geodirectory'),
739
-        'desc' => __('Set the listing view of author page', 'geodirectory'),
740
-        'id' => 'geodir_author_view',
741
-        'css' => 'min-width:300px;',
742
-        'std' => 'gridview_onehalf',
743
-        'type' => 'select',
744
-        'class' => 'chosen_select',
745
-        'options' => array_unique(array(
746
-            'gridview_onehalf' => __('Grid View (Two Columns)', 'geodirectory'),
747
-            'gridview_onethird' => __('Grid View (Three Columns)', 'geodirectory'),
748
-            'gridview_onefourth' => __('Grid View (Four Columns)', 'geodirectory'),
749
-            'gridview_onefifth' => __('Grid View (Five Columns)', 'geodirectory'),
750
-            'listview' => __('List view', 'geodirectory'),
751
-        ))
752
-    ),
737
+	array(
738
+		'name' => __('Author content section view', 'geodirectory'),
739
+		'desc' => __('Set the listing view of author page', 'geodirectory'),
740
+		'id' => 'geodir_author_view',
741
+		'css' => 'min-width:300px;',
742
+		'std' => 'gridview_onehalf',
743
+		'type' => 'select',
744
+		'class' => 'chosen_select',
745
+		'options' => array_unique(array(
746
+			'gridview_onehalf' => __('Grid View (Two Columns)', 'geodirectory'),
747
+			'gridview_onethird' => __('Grid View (Three Columns)', 'geodirectory'),
748
+			'gridview_onefourth' => __('Grid View (Four Columns)', 'geodirectory'),
749
+			'gridview_onefifth' => __('Grid View (Five Columns)', 'geodirectory'),
750
+			'listview' => __('List view', 'geodirectory'),
751
+		))
752
+	),
753 753
 
754
-    array(
755
-        'name' => __('Width of author content section', 'geodirectory'),
756
-        'desc' => __('Enter the width of content section of author page in %', 'geodirectory'),
757
-        'id' => 'geodir_width_author_contant_section',
758
-        'type' => 'text',
759
-        'css' => 'min-width:300px;',
760
-        'std' => '63' // Default value to show home top section
761
-    ),
754
+	array(
755
+		'name' => __('Width of author content section', 'geodirectory'),
756
+		'desc' => __('Enter the width of content section of author page in %', 'geodirectory'),
757
+		'id' => 'geodir_width_author_contant_section',
758
+		'type' => 'text',
759
+		'css' => 'min-width:300px;',
760
+		'std' => '63' // Default value to show home top section
761
+	),
762 762
 
763
-    array(
764
-        'name' => __('Author left section', 'geodirectory'),
765
-        'desc' => __('Show the left section of author page', 'geodirectory'),
766
-        'id' => 'geodir_show_author_left_section',
767
-        'type' => 'checkbox',
768
-        'std' => '0' // Default value to show home top section
769
-    ),
763
+	array(
764
+		'name' => __('Author left section', 'geodirectory'),
765
+		'desc' => __('Show the left section of author page', 'geodirectory'),
766
+		'id' => 'geodir_show_author_left_section',
767
+		'type' => 'checkbox',
768
+		'std' => '0' // Default value to show home top section
769
+	),
770 770
 
771
-    array(
772
-        'name' => __('Width of author left section', 'geodirectory'),
773
-        'desc' => __('Enter the width of left section of home page in %', 'geodirectory'),
774
-        'id' => 'geodir_width_author_left_section',
775
-        'type' => 'text',
776
-        'css' => 'min-width:300px;',
777
-        'std' => '30' // Default value to show home top section
778
-    ),
771
+	array(
772
+		'name' => __('Width of author left section', 'geodirectory'),
773
+		'desc' => __('Enter the width of left section of home page in %', 'geodirectory'),
774
+		'id' => 'geodir_width_author_left_section',
775
+		'type' => 'text',
776
+		'css' => 'min-width:300px;',
777
+		'std' => '30' // Default value to show home top section
778
+	),
779 779
 
780
-    array(
781
-        'name' => __('Author bottom section', 'geodirectory'),
782
-        'desc' => __('Show the bottom section of author page', 'geodirectory'),
783
-        'id' => 'geodir_show_author_bottom_section',
784
-        'type' => 'checkbox',
785
-        'std' => '0' // Default value to show home top section
786
-    ),
780
+	array(
781
+		'name' => __('Author bottom section', 'geodirectory'),
782
+		'desc' => __('Show the bottom section of author page', 'geodirectory'),
783
+		'id' => 'geodir_show_author_bottom_section',
784
+		'type' => 'checkbox',
785
+		'std' => '0' // Default value to show home top section
786
+	),
787 787
 
788 788
 
789
-    array(
790
-        'name' => __('Description word limit', 'geodirectory'),
791
-        'desc' => '',
792
-        'id' => 'geodir_author_desc_word_limit',
793
-        'type' => 'text',
794
-        'css' => 'min-width:300px;',
795
-        'std' => '50' // Default value to show home top section
796
-    ),
789
+	array(
790
+		'name' => __('Description word limit', 'geodirectory'),
791
+		'desc' => '',
792
+		'id' => 'geodir_author_desc_word_limit',
793
+		'type' => 'text',
794
+		'css' => 'min-width:300px;',
795
+		'std' => '50' // Default value to show home top section
796
+	),
797 797
 
798
-    array('type' => 'sectionend', 'id' => 'geodir_author_layout'),
799
-    /* Author Layout Settings end */
798
+	array('type' => 'sectionend', 'id' => 'geodir_author_layout'),
799
+	/* Author Layout Settings end */
800 800
 
801 801
 
802
-    /* Post Type Navigation Settings Start */
803
-    array('name' => __('Navigation', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_navigation_settings'),
802
+	/* Post Type Navigation Settings Start */
803
+	array('name' => __('Navigation', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_navigation_settings'),
804 804
 
805 805
 
806
-    /* Post Type Navigation Settings Start */
806
+	/* Post Type Navigation Settings Start */
807 807
 
808
-    array('name' => __('Navigation Locations', 'geodirectory'),
809
-        'type' => 'sectionstart',
810
-        'desc' => '',
811
-        'id' => 'geodir_navigation_locations'),
808
+	array('name' => __('Navigation Locations', 'geodirectory'),
809
+		'type' => 'sectionstart',
810
+		'desc' => '',
811
+		'id' => 'geodir_navigation_locations'),
812 812
 
813
-    array(
814
-        'name' => __('Show geodirectory navigation in selected menu locations', 'geodirectory'),
815
-        'desc' => '',
816
-        'tip' => '',
817
-        'id' => 'geodir_theme_location_nav',
818
-        'css' => 'min-width:300px;',
819
-        'std' => array(),
820
-        'type' => 'multiselect',
821
-        'placeholder_text' => __('Select menu locations', 'geodirectory'),
822
-        'class' => 'chosen_select',
823
-        'options' => array_unique(geodir_theme_location_setting_fun())
824
-    ),
825
-    array('type' => 'sectionend', 'id' => 'geodir_navigation_options'),
826
-
827
-
828
-    array('name' => __('Navigation Settings', 'geodirectory'),
829
-        'type' => 'sectionstart',
830
-        'desc' => '',
831
-        'id' => 'geodir_navigation_options'),
813
+	array(
814
+		'name' => __('Show geodirectory navigation in selected menu locations', 'geodirectory'),
815
+		'desc' => '',
816
+		'tip' => '',
817
+		'id' => 'geodir_theme_location_nav',
818
+		'css' => 'min-width:300px;',
819
+		'std' => array(),
820
+		'type' => 'multiselect',
821
+		'placeholder_text' => __('Select menu locations', 'geodirectory'),
822
+		'class' => 'chosen_select',
823
+		'options' => array_unique(geodir_theme_location_setting_fun())
824
+	),
825
+	array('type' => 'sectionend', 'id' => 'geodir_navigation_options'),
832 826
 
833 827
 
834
-    array(
835
-        'name' => __('Show add listing navigation in menu', 'geodirectory'),
836
-        'desc' => sprintf(__('Show add listing navigation in main menu? (untick to disable) If you disable this option, none of the add listing link will appear in main navigation.', 'geodirectory')),
837
-        'id' => 'geodir_show_addlisting_nav',
838
-        'std' => '1',
839
-        'type' => 'checkbox'
840
-    ),
828
+	array('name' => __('Navigation Settings', 'geodirectory'),
829
+		'type' => 'sectionstart',
830
+		'desc' => '',
831
+		'id' => 'geodir_navigation_options'),
841 832
 
842
-    array(
843
-        'name' => __('Show listings navigation in menu', 'geodirectory'),
844
-        'desc' => sprintf(__('Show listing navigation in main menu? (untick to disable) If you disable this option, none of the listing link will appear in main navigation.', 'geodirectory')),
845
-        'id' => 'geodir_show_listing_nav',
846
-        'std' => '1',
847
-        'type' => 'checkbox'
848
-    ),
849 833
 
850
-    array('type' => 'sectionend', 'id' => 'geodir_navigation_options'),
834
+	array(
835
+		'name' => __('Show add listing navigation in menu', 'geodirectory'),
836
+		'desc' => sprintf(__('Show add listing navigation in main menu? (untick to disable) If you disable this option, none of the add listing link will appear in main navigation.', 'geodirectory')),
837
+		'id' => 'geodir_show_addlisting_nav',
838
+		'std' => '1',
839
+		'type' => 'checkbox'
840
+	),
851 841
 
842
+	array(
843
+		'name' => __('Show listings navigation in menu', 'geodirectory'),
844
+		'desc' => sprintf(__('Show listing navigation in main menu? (untick to disable) If you disable this option, none of the listing link will appear in main navigation.', 'geodirectory')),
845
+		'id' => 'geodir_show_listing_nav',
846
+		'std' => '1',
847
+		'type' => 'checkbox'
848
+	),
852 849
 
853
-    array('name' => __('Post Type Navigation Settings', 'geodirectory'),
854
-        'type' => 'sectionstart',
855
-        'desc' => '',
856
-        'id' => 'geodir_post_type_navigation_layout'),
857
-    array(
858
-        'name' => __('Show listing link in main navigation', 'geodirectory'),
859
-        'desc' => '',
860
-        'tip' => '',
861
-        'id' => 'geodir_add_posttype_in_main_nav',
862
-        'css' => 'min-width:300px;',
863
-        'std' => array(),
864
-        'type' => 'multiselect',
865
-        'placeholder_text' => __('Select post types', 'geodirectory'),
866
-        'class' => 'chosen_select',
867
-        'options' => array_unique(geodir_post_type_setting_fun())
868
-    ),
850
+	array('type' => 'sectionend', 'id' => 'geodir_navigation_options'),
869 851
 
870
-    array(
871
-        'name' => __('Show listing link in listing navigation', 'geodirectory'),
872
-        'desc' => '',
873
-        'tip' => '',
874
-        'id' => 'geodir_add_posttype_in_listing_nav',
875
-        'css' => 'min-width:300px;',
876
-        'std' => geodir_get_posttypes(),
877
-        'type' => 'multiselect',
878
-        'placeholder_text' => __('Select post types', 'geodirectory'),
879
-        'class' => 'chosen_select',
880
-        'options' => array_unique(geodir_post_type_setting_fun())
881
-    ),
882 852
 
883
-    array(
884
-        'name' => __('Allow post type to add from frontend', 'geodirectory'),
885
-        'desc' => '',
886
-        'tip' => '',
887
-        'id' => 'geodir_allow_posttype_frontend',
888
-        'css' => 'min-width:300px;',
889
-        'std' => geodir_get_posttypes(),
890
-        'type' => 'multiselect',
891
-        'placeholder_text' => __('Select post types', 'geodirectory'),
892
-        'class' => 'chosen_select',
893
-        'options' => array_unique(geodir_post_type_setting_fun())
894
-    ),
853
+	array('name' => __('Post Type Navigation Settings', 'geodirectory'),
854
+		'type' => 'sectionstart',
855
+		'desc' => '',
856
+		'id' => 'geodir_post_type_navigation_layout'),
857
+	array(
858
+		'name' => __('Show listing link in main navigation', 'geodirectory'),
859
+		'desc' => '',
860
+		'tip' => '',
861
+		'id' => 'geodir_add_posttype_in_main_nav',
862
+		'css' => 'min-width:300px;',
863
+		'std' => array(),
864
+		'type' => 'multiselect',
865
+		'placeholder_text' => __('Select post types', 'geodirectory'),
866
+		'class' => 'chosen_select',
867
+		'options' => array_unique(geodir_post_type_setting_fun())
868
+	),
895 869
 
896
-    array(
897
-        'name' => __('Show add listing link in main navigation', 'geodirectory'),
898
-        'desc' => '',
899
-        'tip' => '',
900
-        'id' => 'geodir_add_listing_link_main_nav',
901
-        'css' => 'min-width:300px;',
902
-        'std' => array(),
903
-        'type' => 'multiselect',
904
-        'placeholder_text' => __('Select post types', 'geodirectory'),
905
-        'class' => 'chosen_select',
906
-        'options' => array_unique(geodir_post_type_setting_fun())
907
-    ),
870
+	array(
871
+		'name' => __('Show listing link in listing navigation', 'geodirectory'),
872
+		'desc' => '',
873
+		'tip' => '',
874
+		'id' => 'geodir_add_posttype_in_listing_nav',
875
+		'css' => 'min-width:300px;',
876
+		'std' => geodir_get_posttypes(),
877
+		'type' => 'multiselect',
878
+		'placeholder_text' => __('Select post types', 'geodirectory'),
879
+		'class' => 'chosen_select',
880
+		'options' => array_unique(geodir_post_type_setting_fun())
881
+	),
908 882
 
909
-    array(
910
-        'name' => __('Show add listing link in add listing navigation', 'geodirectory'),
911
-        'desc' => '',
912
-        'tip' => '',
913
-        'id' => 'geodir_add_listing_link_add_listing_nav',
914
-        'css' => 'min-width:300px;',
915
-        'std' => geodir_get_posttypes(),
916
-        'type' => 'multiselect',
917
-        'class' => 'chosen_select',
918
-        'options' => array_unique(geodir_post_type_setting_fun())
919
-    ),
883
+	array(
884
+		'name' => __('Allow post type to add from frontend', 'geodirectory'),
885
+		'desc' => '',
886
+		'tip' => '',
887
+		'id' => 'geodir_allow_posttype_frontend',
888
+		'css' => 'min-width:300px;',
889
+		'std' => geodir_get_posttypes(),
890
+		'type' => 'multiselect',
891
+		'placeholder_text' => __('Select post types', 'geodirectory'),
892
+		'class' => 'chosen_select',
893
+		'options' => array_unique(geodir_post_type_setting_fun())
894
+	),
920 895
 
921
-    array('type' => 'sectionend', 'id' => 'geodir_post_type_navigation_layout'),
896
+	array(
897
+		'name' => __('Show add listing link in main navigation', 'geodirectory'),
898
+		'desc' => '',
899
+		'tip' => '',
900
+		'id' => 'geodir_add_listing_link_main_nav',
901
+		'css' => 'min-width:300px;',
902
+		'std' => array(),
903
+		'type' => 'multiselect',
904
+		'placeholder_text' => __('Select post types', 'geodirectory'),
905
+		'class' => 'chosen_select',
906
+		'options' => array_unique(geodir_post_type_setting_fun())
907
+	),
922 908
 
909
+	array(
910
+		'name' => __('Show add listing link in add listing navigation', 'geodirectory'),
911
+		'desc' => '',
912
+		'tip' => '',
913
+		'id' => 'geodir_add_listing_link_add_listing_nav',
914
+		'css' => 'min-width:300px;',
915
+		'std' => geodir_get_posttypes(),
916
+		'type' => 'multiselect',
917
+		'class' => 'chosen_select',
918
+		'options' => array_unique(geodir_post_type_setting_fun())
919
+	),
923 920
 
924
-    array('name' => __('User Dashboard Post Type Navigation Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_user_dashboard_post_type '),
921
+	array('type' => 'sectionend', 'id' => 'geodir_post_type_navigation_layout'),
925 922
 
926 923
 
927
-    array(
928
-        'name' => __('Show add listing link in user dashboard', 'geodirectory'),
929
-        'desc' => '',
930
-        'tip' => '',
931
-        'id' => 'geodir_add_listing_link_user_dashboard',
932
-        'css' => 'min-width:300px;',
933
-        'std' => geodir_get_posttypes(),
934
-        'type' => 'multiselect',
935
-        'placeholder_text' => __('Select post types', 'geodirectory'),
936
-        'class' => 'chosen_select',
937
-        'options' => array_unique(geodir_post_type_setting_fun())
938
-    ),
924
+	array('name' => __('User Dashboard Post Type Navigation Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_user_dashboard_post_type '),
939 925
 
940
-    array(
941
-        'name' => __('Show favorite link in user dashboard', 'geodirectory'),
942
-        'desc' => __('Option will not appear if user does not have a favorite of that post type', 'geodirectory'),
943
-        'tip' => '',
944
-        'id' => 'geodir_favorite_link_user_dashboard',
945
-        'css' => 'min-width:300px;',
946
-        'std' => geodir_get_posttypes(),
947
-        'type' => 'multiselect',
948
-        'placeholder_text' => __('Select post types', 'geodirectory'),
949
-        'class' => 'chosen_select',
950
-        'options' => array_unique(geodir_post_type_setting_fun())
951
-    ),
952 926
 
953
-    array(
954
-        'name' => __('Show listing link in user dashboard', 'geodirectory'),
955
-        'desc' => __('Option will not appear if user does not have his/her own listing of that post type', 'geodirectory'),
956
-        'tip' => '',
957
-        'id' => 'geodir_listing_link_user_dashboard',
958
-        'css' => 'min-width:300px;',
959
-        'std' => geodir_get_posttypes(),
960
-        'type' => 'multiselect',
961
-        'placeholder_text' => __('Select post types', 'geodirectory'),
962
-        'class' => 'chosen_select',
963
-        'options' => array_unique(geodir_post_type_setting_fun())
964
-    ),
965
-
966
-    array('type' => 'sectionend', 'id' => 'geodir_user_dashboard_post_type'),
967
-    /* Post Type Navigation Settings End */
968
-
969
-    /* Script Settings Start */
970
-    array('name' => __('Scripts', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_script_settings '),
971
-
972
-    /*
927
+	array(
928
+		'name' => __('Show add listing link in user dashboard', 'geodirectory'),
929
+		'desc' => '',
930
+		'tip' => '',
931
+		'id' => 'geodir_add_listing_link_user_dashboard',
932
+		'css' => 'min-width:300px;',
933
+		'std' => geodir_get_posttypes(),
934
+		'type' => 'multiselect',
935
+		'placeholder_text' => __('Select post types', 'geodirectory'),
936
+		'class' => 'chosen_select',
937
+		'options' => array_unique(geodir_post_type_setting_fun())
938
+	),
939
+
940
+	array(
941
+		'name' => __('Show favorite link in user dashboard', 'geodirectory'),
942
+		'desc' => __('Option will not appear if user does not have a favorite of that post type', 'geodirectory'),
943
+		'tip' => '',
944
+		'id' => 'geodir_favorite_link_user_dashboard',
945
+		'css' => 'min-width:300px;',
946
+		'std' => geodir_get_posttypes(),
947
+		'type' => 'multiselect',
948
+		'placeholder_text' => __('Select post types', 'geodirectory'),
949
+		'class' => 'chosen_select',
950
+		'options' => array_unique(geodir_post_type_setting_fun())
951
+	),
952
+
953
+	array(
954
+		'name' => __('Show listing link in user dashboard', 'geodirectory'),
955
+		'desc' => __('Option will not appear if user does not have his/her own listing of that post type', 'geodirectory'),
956
+		'tip' => '',
957
+		'id' => 'geodir_listing_link_user_dashboard',
958
+		'css' => 'min-width:300px;',
959
+		'std' => geodir_get_posttypes(),
960
+		'type' => 'multiselect',
961
+		'placeholder_text' => __('Select post types', 'geodirectory'),
962
+		'class' => 'chosen_select',
963
+		'options' => array_unique(geodir_post_type_setting_fun())
964
+	),
965
+
966
+	array('type' => 'sectionend', 'id' => 'geodir_user_dashboard_post_type'),
967
+	/* Post Type Navigation Settings End */
968
+
969
+	/* Script Settings Start */
970
+	array('name' => __('Scripts', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_script_settings '),
971
+
972
+	/*
973 973
     array( 	'name' => __( 'Add/Remove Scripts', 'geodirectory' ),
974 974
                 'type' => 'sectionstart',
975 975
                 'desc' => '',
@@ -995,190 +995,190 @@  discard block
 block discarded – undo
995 995
 
996 996
     */
997 997
 
998
-    array('name' => __('GD Lazy Load Images', 'geodirectory'),
999
-        'type' => 'sectionstart',
1000
-        'desc' => '',
1001
-        'id' => 'geodir_gdll_settings'),
998
+	array('name' => __('GD Lazy Load Images', 'geodirectory'),
999
+		'type' => 'sectionstart',
1000
+		'desc' => '',
1001
+		'id' => 'geodir_gdll_settings'),
1002 1002
 
1003
-    array(
1004
-        'name' => __('Enable lazy load images?', 'geodirectory'),
1005
-        'desc' => __('GD images will be loaded only when visible on the page', 'geodirectory'),
1006
-        'id' => 'geodir_lazy_load',
1007
-        'type' => 'checkbox',
1008
-        'std' => '1' // Default value to show home top section
1009
-    ),
1010
-    array('type' => 'sectionend', 'id' => 'geodir_gdll_settings'),
1003
+	array(
1004
+		'name' => __('Enable lazy load images?', 'geodirectory'),
1005
+		'desc' => __('GD images will be loaded only when visible on the page', 'geodirectory'),
1006
+		'id' => 'geodir_lazy_load',
1007
+		'type' => 'checkbox',
1008
+		'std' => '1' // Default value to show home top section
1009
+	),
1010
+	array('type' => 'sectionend', 'id' => 'geodir_gdll_settings'),
1011 1011
     
1012 1012
 
1013
-    array('name' => __('Script Settings', 'geodirectory'),
1014
-        'type' => 'sectionstart',
1015
-        'desc' => '',
1016
-        'id' => 'geodir_script_settings'),
1013
+	array('name' => __('Script Settings', 'geodirectory'),
1014
+		'type' => 'sectionstart',
1015
+		'desc' => '',
1016
+		'id' => 'geodir_script_settings'),
1017 1017
 
1018
-    array(
1019
-        'name' => __('Custom style css code', 'geodirectory'),
1020
-        'desc' => '',
1021
-        'id' => 'geodir_coustem_css',
1022
-        'type' => 'textarea',
1023
-        'css' => 'min-width:300px;',
1024
-        'std' => '' // Default value for the page title - changed in settings
1025
-    ),
1018
+	array(
1019
+		'name' => __('Custom style css code', 'geodirectory'),
1020
+		'desc' => '',
1021
+		'id' => 'geodir_coustem_css',
1022
+		'type' => 'textarea',
1023
+		'css' => 'min-width:300px;',
1024
+		'std' => '' // Default value for the page title - changed in settings
1025
+	),
1026 1026
 
1027
-    array(
1028
-        'name' => __('Header script code', 'geodirectory'),
1029
-        'desc' => '',
1030
-        'id' => 'geodir_header_scripts',
1031
-        'type' => 'textarea',
1032
-        'css' => 'min-width:300px;',
1033
-        'std' => '' // Default value for the page title - changed in settings
1034
-    ),
1027
+	array(
1028
+		'name' => __('Header script code', 'geodirectory'),
1029
+		'desc' => '',
1030
+		'id' => 'geodir_header_scripts',
1031
+		'type' => 'textarea',
1032
+		'css' => 'min-width:300px;',
1033
+		'std' => '' // Default value for the page title - changed in settings
1034
+	),
1035 1035
 
1036
-    array(
1037
-        'name' => __('Footer script code', 'geodirectory'),
1038
-        'desc' => '',
1039
-        'id' => 'geodir_footer_scripts',
1040
-        'type' => 'textarea',
1041
-        'css' => 'min-width:300px;',
1042
-        'std' => '' // Default value for the page title - changed in settings
1043
-    ),
1036
+	array(
1037
+		'name' => __('Footer script code', 'geodirectory'),
1038
+		'desc' => '',
1039
+		'id' => 'geodir_footer_scripts',
1040
+		'type' => 'textarea',
1041
+		'css' => 'min-width:300px;',
1042
+		'std' => '' // Default value for the page title - changed in settings
1043
+	),
1044 1044
 
1045
-    array('type' => 'sectionend', 'id' => 'geodir_script_settings'),
1046
-    /* Script Settings End */
1045
+	array('type' => 'sectionend', 'id' => 'geodir_script_settings'),
1046
+	/* Script Settings End */
1047 1047
 
1048
-    /* Map Settings Start */
1049
-    array('name' => __('Map', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_map_settings '),
1048
+	/* Map Settings Start */
1049
+	array('name' => __('Map', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_map_settings '),
1050 1050
 
1051 1051
 
1052
-    // Google API key
1053
-    array(
1054
-        'name' => __('Google Maps API KEY', 'geodirectory'),
1055
-        'type' => 'sectionstart',
1056
-        'desc' => '',
1057
-        'id' => 'geodir_google_api_key'
1058
-    ),
1059
-    array(
1060
-        'name' => __('Google Maps API KEY', 'geodirectory'),
1061
-        'desc' => sprintf(
1062
-            __('This is a requirement to use Google Maps, you can get a key from <a href="%s" target="_blank">here</a> OR you can set GD to use Open Street Maps below under Select Maps API setting.   (<a href="%s" target="_blank">How to add a Google API KEY?</a>)', 'geodirectory'),
1063
-            'https://console.developers.google.com/flows/enableapi?apiid=maps_backend,geocoding_backend,directions_backend,distance_matrix_backend,elevation_backend&keyType=CLIENT_SIDE&reusekey=true','https://wpgeodirectory.com/docs/add-google-api-key/' ),
1064
-        'tip' => '',
1065
-        'id' => 'geodir_google_api_key',
1066
-        'css' => 'min-width:300px;',
1067
-        'std' => '',
1068
-        'type' => 'text',
1069
-    ),
1070
-    array(
1071
-        'type' => 'sectionend',
1072
-        'id' => 'geodir_google_api_key'
1073
-    ),
1052
+	// Google API key
1053
+	array(
1054
+		'name' => __('Google Maps API KEY', 'geodirectory'),
1055
+		'type' => 'sectionstart',
1056
+		'desc' => '',
1057
+		'id' => 'geodir_google_api_key'
1058
+	),
1059
+	array(
1060
+		'name' => __('Google Maps API KEY', 'geodirectory'),
1061
+		'desc' => sprintf(
1062
+			__('This is a requirement to use Google Maps, you can get a key from <a href="%s" target="_blank">here</a> OR you can set GD to use Open Street Maps below under Select Maps API setting.   (<a href="%s" target="_blank">How to add a Google API KEY?</a>)', 'geodirectory'),
1063
+			'https://console.developers.google.com/flows/enableapi?apiid=maps_backend,geocoding_backend,directions_backend,distance_matrix_backend,elevation_backend&keyType=CLIENT_SIDE&reusekey=true','https://wpgeodirectory.com/docs/add-google-api-key/' ),
1064
+		'tip' => '',
1065
+		'id' => 'geodir_google_api_key',
1066
+		'css' => 'min-width:300px;',
1067
+		'std' => '',
1068
+		'type' => 'text',
1069
+	),
1070
+	array(
1071
+		'type' => 'sectionend',
1072
+		'id' => 'geodir_google_api_key'
1073
+	),
1074 1074
 
1075
-    /* Untick the category by default on home map */
1076
-    array(
1077
-        'name' => __('Home Map Settings', 'geodirectory'),
1078
-        'type' => 'sectionstart',
1079
-        'desc' => '',
1080
-        'id' => 'geodir_home_map_section'
1081
-    ),
1082
-    array(
1083
-        'name' => __('Select category to untick by default on map', 'geodirectory'),
1084
-        'desc' => __('Select category to untick by default on the home map.', 'geodirectory'),
1085
-        'tip' => '',
1086
-        'id' => 'geodir_home_map_untick',
1087
-        'css' => 'min-width:300px;',
1088
-        'std' => '',
1089
-        'type' => 'multiselect',
1090
-        'placeholder_text' => __('Select category', 'geodirectory'),
1091
-        'class' => 'chosen_select',
1092
-        'options' => geodir_home_map_cats_key_value_array()
1093
-    ),
1094
-    array(
1095
-        'type' => 'sectionend',
1096
-        'id' => 'geodir_home_map_section'
1097
-    ),
1075
+	/* Untick the category by default on home map */
1076
+	array(
1077
+		'name' => __('Home Map Settings', 'geodirectory'),
1078
+		'type' => 'sectionstart',
1079
+		'desc' => '',
1080
+		'id' => 'geodir_home_map_section'
1081
+	),
1082
+	array(
1083
+		'name' => __('Select category to untick by default on map', 'geodirectory'),
1084
+		'desc' => __('Select category to untick by default on the home map.', 'geodirectory'),
1085
+		'tip' => '',
1086
+		'id' => 'geodir_home_map_untick',
1087
+		'css' => 'min-width:300px;',
1088
+		'std' => '',
1089
+		'type' => 'multiselect',
1090
+		'placeholder_text' => __('Select category', 'geodirectory'),
1091
+		'class' => 'chosen_select',
1092
+		'options' => geodir_home_map_cats_key_value_array()
1093
+	),
1094
+	array(
1095
+		'type' => 'sectionend',
1096
+		'id' => 'geodir_home_map_section'
1097
+	),
1098 1098
 
1099
-    array(
1100
-        'name' => __('Add Listing Map Settings', 'geodirectory'),
1101
-        'type' => 'sectionstart',
1102
-        'desc' => '',
1103
-        'id' => 'geodir_add_listing_map_section'
1104
-    ),
1105
-    array(
1106
-        'name' => __('Disable mouse scroll', 'geodirectory'),
1107
-        'desc' => __('Stops the mouse scroll zooming the map', 'geodirectory'),
1108
-        'id' => 'geodir_add_listing_mouse_scroll',
1109
-        'type' => 'checkbox',
1110
-        'std' => '0' // Default value to show home top section
1111
-    ),
1112
-    array(
1113
-        'type' => 'sectionend',
1114
-        'id' => 'geodir_add_listing_map_section'
1115
-    ),
1099
+	array(
1100
+		'name' => __('Add Listing Map Settings', 'geodirectory'),
1101
+		'type' => 'sectionstart',
1102
+		'desc' => '',
1103
+		'id' => 'geodir_add_listing_map_section'
1104
+	),
1105
+	array(
1106
+		'name' => __('Disable mouse scroll', 'geodirectory'),
1107
+		'desc' => __('Stops the mouse scroll zooming the map', 'geodirectory'),
1108
+		'id' => 'geodir_add_listing_mouse_scroll',
1109
+		'type' => 'checkbox',
1110
+		'std' => '0' // Default value to show home top section
1111
+	),
1112
+	array(
1113
+		'type' => 'sectionend',
1114
+		'id' => 'geodir_add_listing_map_section'
1115
+	),
1116 1116
 
1117 1117
 
1118
-    array('name' => __('Default map settings', 'geodirectory'),
1119
-        'type' => 'sectionstart',
1120
-        'desc' => '',
1121
-        'id' => 'geodir_map_default_settings'),
1118
+	array('name' => __('Default map settings', 'geodirectory'),
1119
+		'type' => 'sectionstart',
1120
+		'desc' => '',
1121
+		'id' => 'geodir_map_default_settings'),
1122 1122
 
1123
-    array(
1124
-        'name' => '',
1125
-        'desc' => '',
1126
-        'id' => 'map_default_settings',
1127
-        'type' => 'map_default_settings',
1128
-        'css' => 'min-width:300px;',
1129
-        'std' => '' // Default value for the page title - changed in settings
1130
-    ),
1123
+	array(
1124
+		'name' => '',
1125
+		'desc' => '',
1126
+		'id' => 'map_default_settings',
1127
+		'type' => 'map_default_settings',
1128
+		'css' => 'min-width:300px;',
1129
+		'std' => '' // Default value for the page title - changed in settings
1130
+	),
1131 1131
 
1132
-    array(
1133
-        'name' => __('Upload map default marker icon', 'geodirectory'),
1134
-        'desc' => '',
1135
-        'id' => 'geodir_default_marker_icon',
1136
-        'type' => 'file',
1137
-        'std' => '0',
1138
-        'value' => geodir_plugin_url() . '/geodirectory-functions/map-functions/icons/pin.png'// Default value to show home top section
1139
-    ),
1140
-    // add option that allows enable/disable map dragging to phone devices
1141
-    array(
1142
-        'name' => __('Show button control on map to enable/disable dragging', 'geodirectory'),
1143
-        'desc' => __('If checked, it displays button control to enable/disable dragging on google maps for phone devices', 'geodirectory'),
1144
-        'id' => 'geodir_map_onoff_dragging',
1145
-        'type' => 'checkbox',
1146
-        'std' => '0' // Default value to show home top section
1147
-    ),
1148
-    array(
1149
-        'name' => __('Select Maps API', 'geodirectory'),
1150
-        'desc' => __('- Google Maps API will force to load Google JS library only.<br>- OpenStreetMap API will force to load OpenStreetMap JS library only.<br>- Load Automatic will load Google JS library first, but if Google maps JS library not loaded it then loads the OpenStreetMap JS library to load the maps (recommended for regions where Google maps banned).<br>- Disable Maps will disable and hides maps for entire site.', 'geodirectory'),
1151
-        'tip' => '',
1152
-        'id' => 'geodir_load_map',
1153
-        'css' => 'min-width:300px;',
1154
-        'std' => 'auto',
1155
-        'type' => 'select',
1156
-        'placeholder_text' => __('Select Map', 'geodirectory'),
1157
-        'options' => array(
1158
-                        'auto' => __('Load Automatic', 'geodirectory'),
1159
-                        'google' => __('Load Google Maps API', 'geodirectory'),
1160
-                        'osm' => __('Load OpenStreetMap API', 'geodirectory'),
1161
-                        'none' => __('Disable Maps', 'geodirectory')
1162
-                    )
1163
-    ),
1164
-
1165
-    array('type' => 'sectionend', 'id' => 'geodir_map_default_settings'),
1166
-
1167
-    array('name' => __('Show / hide post type and category on map', 'geodirectory'),
1168
-        'type' => 'sectionstart',
1169
-        'desc' => '',
1170
-        'id' => 'geodir_map_settings'),
1132
+	array(
1133
+		'name' => __('Upload map default marker icon', 'geodirectory'),
1134
+		'desc' => '',
1135
+		'id' => 'geodir_default_marker_icon',
1136
+		'type' => 'file',
1137
+		'std' => '0',
1138
+		'value' => geodir_plugin_url() . '/geodirectory-functions/map-functions/icons/pin.png'// Default value to show home top section
1139
+	),
1140
+	// add option that allows enable/disable map dragging to phone devices
1141
+	array(
1142
+		'name' => __('Show button control on map to enable/disable dragging', 'geodirectory'),
1143
+		'desc' => __('If checked, it displays button control to enable/disable dragging on google maps for phone devices', 'geodirectory'),
1144
+		'id' => 'geodir_map_onoff_dragging',
1145
+		'type' => 'checkbox',
1146
+		'std' => '0' // Default value to show home top section
1147
+	),
1148
+	array(
1149
+		'name' => __('Select Maps API', 'geodirectory'),
1150
+		'desc' => __('- Google Maps API will force to load Google JS library only.<br>- OpenStreetMap API will force to load OpenStreetMap JS library only.<br>- Load Automatic will load Google JS library first, but if Google maps JS library not loaded it then loads the OpenStreetMap JS library to load the maps (recommended for regions where Google maps banned).<br>- Disable Maps will disable and hides maps for entire site.', 'geodirectory'),
1151
+		'tip' => '',
1152
+		'id' => 'geodir_load_map',
1153
+		'css' => 'min-width:300px;',
1154
+		'std' => 'auto',
1155
+		'type' => 'select',
1156
+		'placeholder_text' => __('Select Map', 'geodirectory'),
1157
+		'options' => array(
1158
+						'auto' => __('Load Automatic', 'geodirectory'),
1159
+						'google' => __('Load Google Maps API', 'geodirectory'),
1160
+						'osm' => __('Load OpenStreetMap API', 'geodirectory'),
1161
+						'none' => __('Disable Maps', 'geodirectory')
1162
+					)
1163
+	),
1171 1164
 
1172
-    array(
1173
-        'name' => __('Select Map Category', 'geodirectory'),
1174
-        'desc' => '',
1175
-        'id' => 'geodir_map_settings',
1176
-        'type' => 'map',
1177
-        'css' => 'min-width:300px;',
1178
-        'std' => '' // Default value for the page title - changed in settings
1179
-    ),
1180
-
1181
-    array('type' => 'sectionend', 'id' => 'geodir_map_settings'),
1182
-    /* Map Settings End */
1165
+	array('type' => 'sectionend', 'id' => 'geodir_map_default_settings'),
1166
+
1167
+	array('name' => __('Show / hide post type and category on map', 'geodirectory'),
1168
+		'type' => 'sectionstart',
1169
+		'desc' => '',
1170
+		'id' => 'geodir_map_settings'),
1171
+
1172
+	array(
1173
+		'name' => __('Select Map Category', 'geodirectory'),
1174
+		'desc' => '',
1175
+		'id' => 'geodir_map_settings',
1176
+		'type' => 'map',
1177
+		'css' => 'min-width:300px;',
1178
+		'std' => '' // Default value for the page title - changed in settings
1179
+	),
1180
+
1181
+	array('type' => 'sectionend', 'id' => 'geodir_map_settings'),
1182
+	/* Map Settings End */
1183 1183
 
1184 1184
 )); // End Design settings
Please login to merge, or discard this patch.