Test Failed
Pull Request — master (#296)
by Viruthagiri
11:50
created
geodirectory-widgets/geodirectory_bestof_widget.php 3 patches
Braces   +9 added lines, -5 removed lines patch added patch discarded remove patch
@@ -118,10 +118,11 @@  discard block
 block discarded – undo
118 118
         $instance['listing_width'] = strip_tags($new_instance['listing_width']);
119 119
         $instance['list_sort'] = strip_tags($new_instance['list_sort']);
120 120
         $instance['character_count'] = $new_instance['character_count'];
121
-        if (isset($new_instance['add_location_filter']) && $new_instance['add_location_filter'] != '')
122
-            $instance['add_location_filter'] = strip_tags($new_instance['add_location_filter']);
123
-        else
124
-            $instance['add_location_filter'] = '0';
121
+        if (isset($new_instance['add_location_filter']) && $new_instance['add_location_filter'] != '') {
122
+                    $instance['add_location_filter'] = strip_tags($new_instance['add_location_filter']);
123
+        } else {
124
+                    $instance['add_location_filter'] = '0';
125
+        }
125 126
 
126 127
         return $instance;
127 128
     }
@@ -279,7 +280,10 @@  discard block
 block discarded – undo
279 280
             <label for="<?php echo $this->get_field_id('add_location_filter'); ?>">
280 281
                 <?php _e('Enable Location Filter:', 'geodirectory');?>
281 282
                 <input type="checkbox" id="<?php echo $this->get_field_id('add_location_filter'); ?>"
282
-                       name="<?php echo $this->get_field_name('add_location_filter'); ?>" <?php if ($add_location_filter) echo 'checked="checked"';?>
283
+                       name="<?php echo $this->get_field_name('add_location_filter'); ?>" <?php if ($add_location_filter) {
284
+	echo 'checked="checked"';
285
+}
286
+?>
283 287
                        value="1"/>
284 288
             </label>
285 289
         </p>
Please login to merge, or discard this patch.
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -51,11 +51,11 @@  discard block
 block discarded – undo
51 51
          * @param string $instance ['tab_layout'] Best of widget tab layout name.
52 52
          */
53 53
         $tab_layout = empty($instance['tab_layout']) ? 'bestof-tabs-on-top' : apply_filters('bestof_widget_tab_layout', $instance['tab_layout']);
54
-        echo '<div class="bestof-widget-tab-layout ' . $tab_layout . '">';
54
+        echo '<div class="bestof-widget-tab-layout '.$tab_layout.'">';
55 55
         echo $before_widget;
56 56
         $loc_terms = geodir_get_current_location_terms();
57 57
         if (!empty($loc_terms)) {
58
-            $cur_location = ' : ' . geodir_ucwords(str_replace('-', ' ', end($loc_terms)));
58
+            $cur_location = ' : '.geodir_ucwords(str_replace('-', ' ', end($loc_terms)));
59 59
         } else {
60 60
             $cur_location = '';
61 61
         }
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
          *
77 77
          * @param string $instance ['title'] The widget title.
78 78
          */
79
-        $title = empty($instance['title']) ? wp_sprintf(__('Best of %s', 'geodirectory'), get_bloginfo('name') . $cur_location) : apply_filters('bestof_widget_title', __($instance['title'], 'geodirectory'));
79
+        $title = empty($instance['title']) ? wp_sprintf(__('Best of %s', 'geodirectory'), get_bloginfo('name').$cur_location) : apply_filters('bestof_widget_title', __($instance['title'], 'geodirectory'));
80 80
 
81 81
         /**
82 82
          * Filter the post type.
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
         }
203 203
 
204 204
 
205
-        echo $before_title . __($title,'geodirectory') . $after_title;
205
+        echo $before_title.__($title, 'geodirectory').$after_title;
206 206
 
207 207
         //term navigation - start
208 208
         echo '<div class="geodir-tabs gd-bestof-tabs" id="gd-bestof-tabs" style="position:relative;">';
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
             $is_dropdown = ($tab_layout == 'bestof-tabs-as-dropdown') ? true : false;
214 214
 
215 215
             if ($is_dropdown) {
216
-                $nav_html .= '<select id="geodir_bestof_tab_dd" class="chosen_select" name="geodir_bestof_tab_dd" data-placeholder="' . esc_attr(__('Select Category', 'geodirectory')) . '">';
216
+                $nav_html .= '<select id="geodir_bestof_tab_dd" class="chosen_select" name="geodir_bestof_tab_dd" data-placeholder="'.esc_attr(__('Select Category', 'geodirectory')).'">';
217 217
             } else {
218 218
                 $nav_html .= '<dl class="geodir-tab-head geodir-bestof-cat-list">';
219 219
                 $nav_html .= '<dt></dt>';
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
                     }
231 231
                     if ($is_dropdown) {
232 232
                         $selected = ($cat_count == 1) ? 'selected="selected"' : '';
233
-                        $nav_html .= '<option ' . $selected . ' value="' . $cat->term_id . '">' . geodir_ucwords($cat->name) . '</option>';
233
+                        $nav_html .= '<option '.$selected.' value="'.$cat->term_id.'">'.geodir_ucwords($cat->name).'</option>';
234 234
                     } else {
235 235
                         if ($cat_count == 1) {
236 236
                             $nav_html .= '<dd class="geodir-tab-active">';
@@ -238,8 +238,8 @@  discard block
 block discarded – undo
238 238
                             $nav_html .= '<dd class="">';
239 239
                         }
240 240
                         $term_icon_url = !empty($term_icon) && isset($term_icon[$cat->term_id]) ? $term_icon[$cat->term_id] : '';
241
-                        $nav_html .= '<a data-termid="' . $cat->term_id . '" href="' . get_term_link($cat, $cat->taxonomy) . '">';
242
-                        $nav_html .= '<img alt="' . $cat->name . ' icon" class="bestof-cat-icon" src="' . $term_icon_url . '"/>';
241
+                        $nav_html .= '<a data-termid="'.$cat->term_id.'" href="'.get_term_link($cat, $cat->taxonomy).'">';
242
+                        $nav_html .= '<img alt="'.$cat->name.' icon" class="bestof-cat-icon" src="'.$term_icon_url.'"/>';
243 243
                         $nav_html .= '<span>';
244 244
                         $nav_html .= geodir_ucwords($cat->name);
245 245
                         $nav_html .= '<small>';
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
                             if ($num_reviews == 0) {
249 249
                                 $reviews = __('No Reviews', 'geodirectory');
250 250
                             } elseif ($num_reviews > 1) {
251
-                                $reviews = $num_reviews . __(' Reviews', 'geodirectory');
251
+                                $reviews = $num_reviews.__(' Reviews', 'geodirectory');
252 252
                             } else {
253 253
                                 $reviews = __('1 Review', 'geodirectory');
254 254
                             }
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
                  */
322 322
                 $view_all_link = apply_filters('geodir_bestof_widget_view_all_link', $view_all_link, $post_type, $first_term);
323 323
 
324
-                echo '<h3 class="bestof-cat-title">' . wp_sprintf(__('Best of %s', 'geodirectory'), $first_term->name) . '<a href="' . esc_url($view_all_link) . '">' . __("View all", 'geodirectory') . '</a></h3>';
324
+                echo '<h3 class="bestof-cat-title">'.wp_sprintf(__('Best of %s', 'geodirectory'), $first_term->name).'<a href="'.esc_url($view_all_link).'">'.__("View all", 'geodirectory').'</a></h3>';
325 325
             }
326 326
             if ($excerpt_type == 'show-reviews') {
327 327
                 add_filter('get_the_excerpt', 'best_of_show_review_in_excerpt');
@@ -378,7 +378,7 @@  discard block
 block discarded – undo
378 378
      */
379 379
     public function form($instance)
380 380
     {
381
-        $instance = wp_parse_args((array)$instance,
381
+        $instance = wp_parse_args((array) $instance,
382 382
             array(
383 383
                 'title' => '',
384 384
                 'post_type' => '',
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
 
404 404
         ?>
405 405
         <p>
406
-            <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'geodirectory');?>
406
+            <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'geodirectory'); ?>
407 407
 
408 408
                 <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>"
409 409
                        name="<?php echo $this->get_field_name('title'); ?>" type="text"
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
 
414 414
         <p>
415 415
             <label
416
-                for="<?php echo $this->get_field_id('post_type'); ?>"><?php _e('Post Type:', 'geodirectory');?>
416
+                for="<?php echo $this->get_field_id('post_type'); ?>"><?php _e('Post Type:', 'geodirectory'); ?>
417 417
 
418 418
                 <?php $postypes = geodir_get_posttypes();
419 419
                 /**
@@ -445,7 +445,7 @@  discard block
 block discarded – undo
445 445
         <p>
446 446
 
447 447
             <label
448
-                for="<?php echo $this->get_field_id('post_limit'); ?>"><?php _e('Number of posts:', 'geodirectory');?>
448
+                for="<?php echo $this->get_field_id('post_limit'); ?>"><?php _e('Number of posts:', 'geodirectory'); ?>
449 449
 
450 450
                 <input class="widefat" id="<?php echo $this->get_field_id('post_limit'); ?>"
451 451
                        name="<?php echo $this->get_field_name('post_limit'); ?>" type="text"
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
         <p>
457 457
 
458 458
             <label
459
-                for="<?php echo $this->get_field_id('categ_limit'); ?>"><?php _e('Number of categories:', 'geodirectory');?>
459
+                for="<?php echo $this->get_field_id('categ_limit'); ?>"><?php _e('Number of categories:', 'geodirectory'); ?>
460 460
 
461 461
                 <input class="widefat" id="<?php echo $this->get_field_id('categ_limit'); ?>"
462 462
                        name="<?php echo $this->get_field_name('categ_limit'); ?>" type="text"
@@ -466,7 +466,7 @@  discard block
 block discarded – undo
466 466
 
467 467
         <p>
468 468
             <label
469
-                for="<?php echo $this->get_field_id('character_count'); ?>"><?php _e('Post Content excerpt character count :', 'geodirectory');?>
469
+                for="<?php echo $this->get_field_id('character_count'); ?>"><?php _e('Post Content excerpt character count :', 'geodirectory'); ?>
470 470
                 <input class="widefat" id="<?php echo $this->get_field_id('character_count'); ?>"
471 471
                        name="<?php echo $this->get_field_name('character_count'); ?>" type="text"
472 472
                        value="<?php echo esc_attr($character_count); ?>"/>
@@ -474,7 +474,7 @@  discard block
 block discarded – undo
474 474
         </p>
475 475
         <p>
476 476
             <label
477
-                for="<?php echo $this->get_field_id('tab_layout'); ?>"><?php _e('Tab Layout:', 'geodirectory');?>
477
+                for="<?php echo $this->get_field_id('tab_layout'); ?>"><?php _e('Tab Layout:', 'geodirectory'); ?>
478 478
 
479 479
                 <select class="widefat" id="<?php echo $this->get_field_id('tab_layout'); ?>"
480 480
                         name="<?php echo $this->get_field_name('tab_layout'); ?>">
@@ -495,7 +495,7 @@  discard block
 block discarded – undo
495 495
 
496 496
         <p>
497 497
             <label
498
-                for="<?php echo $this->get_field_id('excerpt_type'); ?>"><?php _e('Excerpt Type:', 'geodirectory');?>
498
+                for="<?php echo $this->get_field_id('excerpt_type'); ?>"><?php _e('Excerpt Type:', 'geodirectory'); ?>
499 499
 
500 500
                 <select class="widefat" id="<?php echo $this->get_field_id('excerpt_type'); ?>"
501 501
                         name="<?php echo $this->get_field_name('excerpt_type'); ?>">
@@ -512,9 +512,9 @@  discard block
 block discarded – undo
512 512
 
513 513
         <p>
514 514
             <label for="<?php echo $this->get_field_id('add_location_filter'); ?>">
515
-                <?php _e('Enable Location Filter:', 'geodirectory');?>
515
+                <?php _e('Enable Location Filter:', 'geodirectory'); ?>
516 516
                 <input type="checkbox" id="<?php echo $this->get_field_id('add_location_filter'); ?>"
517
-                       name="<?php echo $this->get_field_name('add_location_filter'); ?>" <?php if ($add_location_filter) echo 'checked="checked"';?>
517
+                       name="<?php echo $this->get_field_name('add_location_filter'); ?>" <?php if ($add_location_filter) echo 'checked="checked"'; ?>
518 518
                        value="1"/>
519 519
             </label>
520 520
         </p>
@@ -662,7 +662,7 @@  discard block
 block discarded – undo
662 662
         /** This filter is documented in geodirectory-widgets/geodirectory_bestof_widget.php */
663 663
         $view_all_link = apply_filters('geodir_bestof_widget_view_all_link', $view_all_link, $post_type, $term);
664 664
 
665
-        echo '<h3 class="bestof-cat-title">' . wp_sprintf(__('Best of %s', 'geodirectory'), $term->name) . '<a href="' . esc_url($view_all_link) . '">' . __("View all", 'geodirectory') . '</a></h3>';
665
+        echo '<h3 class="bestof-cat-title">'.wp_sprintf(__('Best of %s', 'geodirectory'), $term->name).'<a href="'.esc_url($view_all_link).'">'.__("View all", 'geodirectory').'</a></h3>';
666 666
     }
667 667
     if ($excerpt_type == 'show-reviews') {
668 668
         add_filter('get_the_excerpt', 'best_of_show_review_in_excerpt');
Please login to merge, or discard this patch.
Indentation   +517 added lines, -517 removed lines patch added patch discarded remove patch
@@ -14,280 +14,280 @@  discard block
 block discarded – undo
14 14
  */
15 15
 class geodir_bestof_widget extends WP_Widget
16 16
 {
17
-    /**
18
-     * Register the best of widget with WordPress.
19
-     *
20
-     * @since 1.3.9
21
-     * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct.
22
-     */
23
-    public function __construct()
24
-    {
25
-        $widget_ops = array('classname' => 'geodir_bestof_widget', 'description' => __('GD > Best of widget', 'geodirectory'));
26
-        parent::__construct(
27
-            'bestof_widget', // Base ID
28
-            __('GD > Best of widget', 'geodirectory'), // Name
29
-            $widget_ops// Args
30
-        );
31
-    }
32
-
33
-    /**
34
-     * Front-end display content for best of widget.
35
-     *
36
-     * @since 1.3.9
37
-     * @since 1.5.1 Added filter to view all link.
38
-     * @since 1.5.1 Declare function public.
39
-     *
40
-     * @param array $args Widget arguments.
41
-     * @param array $instance Saved values from database.
42
-     */
43
-    public function widget($args, $instance)
44
-    {
45
-        extract($args);
46
-        /**
47
-         * Filter the best of widget tab layout.
48
-         *
49
-         * @since 1.3.9
50
-         *
51
-         * @param string $instance ['tab_layout'] Best of widget tab layout name.
52
-         */
53
-        $tab_layout = empty($instance['tab_layout']) ? 'bestof-tabs-on-top' : apply_filters('bestof_widget_tab_layout', $instance['tab_layout']);
54
-        echo '<div class="bestof-widget-tab-layout ' . $tab_layout . '">';
55
-        echo $before_widget;
56
-        $loc_terms = geodir_get_current_location_terms();
57
-        if (!empty($loc_terms)) {
58
-            $cur_location = ' : ' . geodir_ucwords(str_replace('-', ' ', end($loc_terms)));
59
-        } else {
60
-            $cur_location = '';
61
-        }
62
-
63
-        /**
64
-         * Filter the current location name.
65
-         *
66
-         * @since 1.3.9
67
-         *
68
-         * @param string $cur_location Current location name.
69
-         */
70
-        $cur_location = apply_filters('bestof_widget_cur_location', $cur_location);
71
-
72
-        /**
73
-         * Filter the widget title.
74
-         *
75
-         * @since 1.3.9
76
-         *
77
-         * @param string $instance ['title'] The widget title.
78
-         */
79
-        $title = empty($instance['title']) ? wp_sprintf(__('Best of %s', 'geodirectory'), get_bloginfo('name') . $cur_location) : apply_filters('bestof_widget_title', __($instance['title'], 'geodirectory'));
80
-
81
-        /**
82
-         * Filter the post type.
83
-         *
84
-         * @since 1.3.9
85
-         *
86
-         * @param string $instance ['post_type'] The post type.
87
-         */
88
-        $post_type = empty($instance['post_type']) ? 'gd_place' : apply_filters('bestof_widget_post_type', $instance['post_type']);
89
-
90
-        /**
91
-         * Filter the excerpt type.
92
-         *
93
-         * @since 1.5.4
94
-         *
95
-         * @param string $instance ['excerpt_type'] The excerpt type.
96
-         */
97
-        $excerpt_type = empty($instance['excerpt_type']) ? 'show-desc' : apply_filters('bestof_widget_excerpt_type', $instance['excerpt_type']);
98
-
99
-
100
-        /**
101
-         * Filter the listing limit.
102
-         *
103
-         * @since 1.3.9
104
-         *
105
-         * @param int $instance ['post_limit'] No. of posts to display.
106
-         */
107
-        $post_limit = empty($instance['post_limit']) ? '5' : apply_filters('bestof_widget_post_limit', $instance['post_limit']);
108
-
109
-        /**
110
-         * Filter the category limit.
111
-         *
112
-         * @since 1.3.9
113
-         *
114
-         * @param int $instance ['categ_limit'] No. of categories to display.
115
-         */
116
-        $categ_limit = empty($instance['categ_limit']) ? '3' : apply_filters('bestof_widget_categ_limit', $instance['categ_limit']);
117
-        $use_viewing_post_type = !empty($instance['use_viewing_post_type']) ? true : false;
118
-
119
-        /**
120
-         * Filter the use of location filter.
121
-         *
122
-         * @since 1.3.9
123
-         *
124
-         * @param int|bool $instance ['add_location_filter'] Filter listings using current location.
125
-         */
126
-        $add_location_filter = empty($instance['add_location_filter']) ? '1' : apply_filters('bestof_widget_location_filter', $instance['add_location_filter']);
127
-
128
-        // set post type to current viewing post type
129
-        if ($use_viewing_post_type) {
130
-            $current_post_type = geodir_get_current_posttype();
131
-            if ($current_post_type != '' && $current_post_type != $post_type) {
132
-                $post_type = $current_post_type;
133
-            }
134
-        }
135
-
136
-        if (isset($instance['character_count'])) {
137
-            /**
138
-             * Filter the widget's excerpt character count.
139
-             *
140
-             * @since 1.3.9
141
-             *
142
-             * @param int $instance ['character_count'] Excerpt character count.
143
-             */
144
-            $character_count = apply_filters('bestof_widget_list_character_count', $instance['character_count']);
145
-        } else {
146
-            $character_count = '';
147
-        }
148
-
149
-        $category_taxonomy = geodir_get_taxonomies($post_type);
150
-
151
-        $term_args = array(
152
-            'hide_empty' => true,
153
-            'parent' => 0
154
-        );
155
-
156
-        if (is_tax()) {
157
-            $taxonomy = get_query_var('taxonomy');
158
-            $cur_term = get_query_var('term');
159
-            $term_data = get_term_by('name', $cur_term, $taxonomy);
160
-            $term_args['parent'] = $term_data->term_id;
161
-        }
162
-
163
-        $terms = get_terms($category_taxonomy[0], $term_args);
164
-
165
-        $term_reviews = geodir_count_reviews_by_terms();
166
-        $a_terms = array();
167
-        foreach ($terms as $term) {
168
-
169
-
170
-            if ($term->count > 0) {
171
-                if (isset($term_reviews[$term->term_id])) {
172
-                    $term->review_count = $term_reviews[$term->term_id];
173
-                } else {
174
-                    $term->review_count = '0';
175
-                }
176
-
177
-                $a_terms[] = $term;
178
-            }
179
-
180
-        }
181
-
182
-
183
-        $terms = geodir_sort_terms($a_terms, 'review_count');
184
-
185
-        $query_args = array(
186
-            'posts_per_page' => $post_limit,
187
-            'is_geodir_loop' => true,
188
-            'post_type' => $post_type,
189
-            'gd_location' => $add_location_filter ? true : false,
190
-            'order_by' => 'high_review'
191
-        );
192
-        if ($character_count >= 0) {
193
-            $query_args['excerpt_length'] = $character_count;
194
-        }
195
-
196
-        $layout = array();
197
-        if ($tab_layout == 'bestof-tabs-as-dropdown') {
198
-            $layout[] = $tab_layout;
199
-        } else {
200
-            $layout[] = 'bestof-tabs-as-dropdown';
201
-            $layout[] = $tab_layout;
202
-        }
203
-
204
-
205
-        echo $before_title . __($title,'geodirectory') . $after_title;
206
-
207
-        //term navigation - start
208
-        echo '<div class="geodir-tabs gd-bestof-tabs" id="gd-bestof-tabs" style="position:relative;">';
209
-
210
-        $final_html = '';
211
-        foreach ($layout as $tab_layout) {
212
-            $nav_html = '';
213
-            $is_dropdown = ($tab_layout == 'bestof-tabs-as-dropdown') ? true : false;
214
-
215
-            if ($is_dropdown) {
216
-                $nav_html .= '<select id="geodir_bestof_tab_dd" class="chosen_select" name="geodir_bestof_tab_dd" data-placeholder="' . esc_attr(__('Select Category', 'geodirectory')) . '">';
217
-            } else {
218
-                $nav_html .= '<dl class="geodir-tab-head geodir-bestof-cat-list">';
219
-                $nav_html .= '<dt></dt>';
220
-            }
221
-
222
-
223
-            $term_icon = geodir_get_term_icon();
224
-            $cat_count = 0;
225
-            if (!empty($terms)) {
226
-                foreach ($terms as $cat) {
227
-                    $cat_count++;
228
-                    if ($cat_count > $categ_limit) {
229
-                        break;
230
-                    }
231
-                    if ($is_dropdown) {
232
-                        $selected = ($cat_count == 1) ? 'selected="selected"' : '';
233
-                        $nav_html .= '<option ' . $selected . ' value="' . $cat->term_id . '">' . geodir_ucwords($cat->name) . '</option>';
234
-                    } else {
235
-                        if ($cat_count == 1) {
236
-                            $nav_html .= '<dd class="geodir-tab-active">';
237
-                        } else {
238
-                            $nav_html .= '<dd class="">';
239
-                        }
240
-                        $term_icon_url = !empty($term_icon) && isset($term_icon[$cat->term_id]) ? $term_icon[$cat->term_id] : '';
241
-                        $nav_html .= '<a data-termid="' . $cat->term_id . '" href="' . get_term_link($cat, $cat->taxonomy) . '">';
242
-                        $nav_html .= '<img alt="' . $cat->name . ' icon" class="bestof-cat-icon" src="' . $term_icon_url . '"/>';
243
-                        $nav_html .= '<span>';
244
-                        $nav_html .= geodir_ucwords($cat->name);
245
-                        $nav_html .= '<small>';
246
-                        if (isset($cat->review_count)) {
247
-                            $num_reviews = $cat->review_count;
248
-                            if ($num_reviews == 0) {
249
-                                $reviews = __('No Reviews', 'geodirectory');
250
-                            } elseif ($num_reviews > 1) {
251
-                                $reviews = $num_reviews . __(' Reviews', 'geodirectory');
252
-                            } else {
253
-                                $reviews = __('1 Review', 'geodirectory');
254
-                            }
255
-                            $nav_html .= $reviews;
256
-                        }
257
-                        $nav_html .= '</small>';
258
-                        $nav_html .= '</span>';
259
-                        $nav_html .= '</a>';
260
-                        $nav_html .= '</dd>';
261
-                    }
262
-                }
263
-            }
264
-
265
-            if ($is_dropdown) {
266
-                $nav_html .= '</select>';
267
-            } else {
268
-                $nav_html .= '</dl>';
269
-            }
270
-            $final_html .= $nav_html;
271
-        }
272
-        if ($terms) {
273
-            echo $final_html;
274
-        }
275
-        echo '</div>';
276
-        //term navigation - end
277
-
278
-        //first term listings by default - start
279
-        $first_term = '';
280
-        if ($terms) {
281
-            $first_term = $terms[0];
282
-            $tax_query = array(
283
-                'taxonomy' => $category_taxonomy[0],
284
-                'field' => 'id',
285
-                'terms' => $first_term->term_id
286
-            );
287
-            $query_args['tax_query'] = array($tax_query);
288
-        }
289
-
290
-        ?>
17
+	/**
18
+	 * Register the best of widget with WordPress.
19
+	 *
20
+	 * @since 1.3.9
21
+	 * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct.
22
+	 */
23
+	public function __construct()
24
+	{
25
+		$widget_ops = array('classname' => 'geodir_bestof_widget', 'description' => __('GD > Best of widget', 'geodirectory'));
26
+		parent::__construct(
27
+			'bestof_widget', // Base ID
28
+			__('GD > Best of widget', 'geodirectory'), // Name
29
+			$widget_ops// Args
30
+		);
31
+	}
32
+
33
+	/**
34
+	 * Front-end display content for best of widget.
35
+	 *
36
+	 * @since 1.3.9
37
+	 * @since 1.5.1 Added filter to view all link.
38
+	 * @since 1.5.1 Declare function public.
39
+	 *
40
+	 * @param array $args Widget arguments.
41
+	 * @param array $instance Saved values from database.
42
+	 */
43
+	public function widget($args, $instance)
44
+	{
45
+		extract($args);
46
+		/**
47
+		 * Filter the best of widget tab layout.
48
+		 *
49
+		 * @since 1.3.9
50
+		 *
51
+		 * @param string $instance ['tab_layout'] Best of widget tab layout name.
52
+		 */
53
+		$tab_layout = empty($instance['tab_layout']) ? 'bestof-tabs-on-top' : apply_filters('bestof_widget_tab_layout', $instance['tab_layout']);
54
+		echo '<div class="bestof-widget-tab-layout ' . $tab_layout . '">';
55
+		echo $before_widget;
56
+		$loc_terms = geodir_get_current_location_terms();
57
+		if (!empty($loc_terms)) {
58
+			$cur_location = ' : ' . geodir_ucwords(str_replace('-', ' ', end($loc_terms)));
59
+		} else {
60
+			$cur_location = '';
61
+		}
62
+
63
+		/**
64
+		 * Filter the current location name.
65
+		 *
66
+		 * @since 1.3.9
67
+		 *
68
+		 * @param string $cur_location Current location name.
69
+		 */
70
+		$cur_location = apply_filters('bestof_widget_cur_location', $cur_location);
71
+
72
+		/**
73
+		 * Filter the widget title.
74
+		 *
75
+		 * @since 1.3.9
76
+		 *
77
+		 * @param string $instance ['title'] The widget title.
78
+		 */
79
+		$title = empty($instance['title']) ? wp_sprintf(__('Best of %s', 'geodirectory'), get_bloginfo('name') . $cur_location) : apply_filters('bestof_widget_title', __($instance['title'], 'geodirectory'));
80
+
81
+		/**
82
+		 * Filter the post type.
83
+		 *
84
+		 * @since 1.3.9
85
+		 *
86
+		 * @param string $instance ['post_type'] The post type.
87
+		 */
88
+		$post_type = empty($instance['post_type']) ? 'gd_place' : apply_filters('bestof_widget_post_type', $instance['post_type']);
89
+
90
+		/**
91
+		 * Filter the excerpt type.
92
+		 *
93
+		 * @since 1.5.4
94
+		 *
95
+		 * @param string $instance ['excerpt_type'] The excerpt type.
96
+		 */
97
+		$excerpt_type = empty($instance['excerpt_type']) ? 'show-desc' : apply_filters('bestof_widget_excerpt_type', $instance['excerpt_type']);
98
+
99
+
100
+		/**
101
+		 * Filter the listing limit.
102
+		 *
103
+		 * @since 1.3.9
104
+		 *
105
+		 * @param int $instance ['post_limit'] No. of posts to display.
106
+		 */
107
+		$post_limit = empty($instance['post_limit']) ? '5' : apply_filters('bestof_widget_post_limit', $instance['post_limit']);
108
+
109
+		/**
110
+		 * Filter the category limit.
111
+		 *
112
+		 * @since 1.3.9
113
+		 *
114
+		 * @param int $instance ['categ_limit'] No. of categories to display.
115
+		 */
116
+		$categ_limit = empty($instance['categ_limit']) ? '3' : apply_filters('bestof_widget_categ_limit', $instance['categ_limit']);
117
+		$use_viewing_post_type = !empty($instance['use_viewing_post_type']) ? true : false;
118
+
119
+		/**
120
+		 * Filter the use of location filter.
121
+		 *
122
+		 * @since 1.3.9
123
+		 *
124
+		 * @param int|bool $instance ['add_location_filter'] Filter listings using current location.
125
+		 */
126
+		$add_location_filter = empty($instance['add_location_filter']) ? '1' : apply_filters('bestof_widget_location_filter', $instance['add_location_filter']);
127
+
128
+		// set post type to current viewing post type
129
+		if ($use_viewing_post_type) {
130
+			$current_post_type = geodir_get_current_posttype();
131
+			if ($current_post_type != '' && $current_post_type != $post_type) {
132
+				$post_type = $current_post_type;
133
+			}
134
+		}
135
+
136
+		if (isset($instance['character_count'])) {
137
+			/**
138
+			 * Filter the widget's excerpt character count.
139
+			 *
140
+			 * @since 1.3.9
141
+			 *
142
+			 * @param int $instance ['character_count'] Excerpt character count.
143
+			 */
144
+			$character_count = apply_filters('bestof_widget_list_character_count', $instance['character_count']);
145
+		} else {
146
+			$character_count = '';
147
+		}
148
+
149
+		$category_taxonomy = geodir_get_taxonomies($post_type);
150
+
151
+		$term_args = array(
152
+			'hide_empty' => true,
153
+			'parent' => 0
154
+		);
155
+
156
+		if (is_tax()) {
157
+			$taxonomy = get_query_var('taxonomy');
158
+			$cur_term = get_query_var('term');
159
+			$term_data = get_term_by('name', $cur_term, $taxonomy);
160
+			$term_args['parent'] = $term_data->term_id;
161
+		}
162
+
163
+		$terms = get_terms($category_taxonomy[0], $term_args);
164
+
165
+		$term_reviews = geodir_count_reviews_by_terms();
166
+		$a_terms = array();
167
+		foreach ($terms as $term) {
168
+
169
+
170
+			if ($term->count > 0) {
171
+				if (isset($term_reviews[$term->term_id])) {
172
+					$term->review_count = $term_reviews[$term->term_id];
173
+				} else {
174
+					$term->review_count = '0';
175
+				}
176
+
177
+				$a_terms[] = $term;
178
+			}
179
+
180
+		}
181
+
182
+
183
+		$terms = geodir_sort_terms($a_terms, 'review_count');
184
+
185
+		$query_args = array(
186
+			'posts_per_page' => $post_limit,
187
+			'is_geodir_loop' => true,
188
+			'post_type' => $post_type,
189
+			'gd_location' => $add_location_filter ? true : false,
190
+			'order_by' => 'high_review'
191
+		);
192
+		if ($character_count >= 0) {
193
+			$query_args['excerpt_length'] = $character_count;
194
+		}
195
+
196
+		$layout = array();
197
+		if ($tab_layout == 'bestof-tabs-as-dropdown') {
198
+			$layout[] = $tab_layout;
199
+		} else {
200
+			$layout[] = 'bestof-tabs-as-dropdown';
201
+			$layout[] = $tab_layout;
202
+		}
203
+
204
+
205
+		echo $before_title . __($title,'geodirectory') . $after_title;
206
+
207
+		//term navigation - start
208
+		echo '<div class="geodir-tabs gd-bestof-tabs" id="gd-bestof-tabs" style="position:relative;">';
209
+
210
+		$final_html = '';
211
+		foreach ($layout as $tab_layout) {
212
+			$nav_html = '';
213
+			$is_dropdown = ($tab_layout == 'bestof-tabs-as-dropdown') ? true : false;
214
+
215
+			if ($is_dropdown) {
216
+				$nav_html .= '<select id="geodir_bestof_tab_dd" class="chosen_select" name="geodir_bestof_tab_dd" data-placeholder="' . esc_attr(__('Select Category', 'geodirectory')) . '">';
217
+			} else {
218
+				$nav_html .= '<dl class="geodir-tab-head geodir-bestof-cat-list">';
219
+				$nav_html .= '<dt></dt>';
220
+			}
221
+
222
+
223
+			$term_icon = geodir_get_term_icon();
224
+			$cat_count = 0;
225
+			if (!empty($terms)) {
226
+				foreach ($terms as $cat) {
227
+					$cat_count++;
228
+					if ($cat_count > $categ_limit) {
229
+						break;
230
+					}
231
+					if ($is_dropdown) {
232
+						$selected = ($cat_count == 1) ? 'selected="selected"' : '';
233
+						$nav_html .= '<option ' . $selected . ' value="' . $cat->term_id . '">' . geodir_ucwords($cat->name) . '</option>';
234
+					} else {
235
+						if ($cat_count == 1) {
236
+							$nav_html .= '<dd class="geodir-tab-active">';
237
+						} else {
238
+							$nav_html .= '<dd class="">';
239
+						}
240
+						$term_icon_url = !empty($term_icon) && isset($term_icon[$cat->term_id]) ? $term_icon[$cat->term_id] : '';
241
+						$nav_html .= '<a data-termid="' . $cat->term_id . '" href="' . get_term_link($cat, $cat->taxonomy) . '">';
242
+						$nav_html .= '<img alt="' . $cat->name . ' icon" class="bestof-cat-icon" src="' . $term_icon_url . '"/>';
243
+						$nav_html .= '<span>';
244
+						$nav_html .= geodir_ucwords($cat->name);
245
+						$nav_html .= '<small>';
246
+						if (isset($cat->review_count)) {
247
+							$num_reviews = $cat->review_count;
248
+							if ($num_reviews == 0) {
249
+								$reviews = __('No Reviews', 'geodirectory');
250
+							} elseif ($num_reviews > 1) {
251
+								$reviews = $num_reviews . __(' Reviews', 'geodirectory');
252
+							} else {
253
+								$reviews = __('1 Review', 'geodirectory');
254
+							}
255
+							$nav_html .= $reviews;
256
+						}
257
+						$nav_html .= '</small>';
258
+						$nav_html .= '</span>';
259
+						$nav_html .= '</a>';
260
+						$nav_html .= '</dd>';
261
+					}
262
+				}
263
+			}
264
+
265
+			if ($is_dropdown) {
266
+				$nav_html .= '</select>';
267
+			} else {
268
+				$nav_html .= '</dl>';
269
+			}
270
+			$final_html .= $nav_html;
271
+		}
272
+		if ($terms) {
273
+			echo $final_html;
274
+		}
275
+		echo '</div>';
276
+		//term navigation - end
277
+
278
+		//first term listings by default - start
279
+		$first_term = '';
280
+		if ($terms) {
281
+			$first_term = $terms[0];
282
+			$tax_query = array(
283
+				'taxonomy' => $category_taxonomy[0],
284
+				'field' => 'id',
285
+				'terms' => $first_term->term_id
286
+			);
287
+			$query_args['tax_query'] = array($tax_query);
288
+		}
289
+
290
+		?>
291 291
         <input type="hidden" id="bestof_widget_post_type" name="bestof_widget_post_type"
292 292
                value="<?php echo $post_type; ?>">
293 293
         <input type="hidden" id="bestof_widget_excerpt_type" name="bestof_widget_excerpt_type"
@@ -298,110 +298,110 @@  discard block
 block discarded – undo
298 298
                value="<?php echo $category_taxonomy[0]; ?>">
299 299
         <input type="hidden" id="bestof_widget_location_filter" name="bestof_widget_location_filter"
300 300
                value="<?php if ($add_location_filter) {
301
-                   echo 1;
302
-               } else {
303
-                   echo 0;
304
-               } ?>">
301
+				   echo 1;
302
+			   } else {
303
+				   echo 0;
304
+			   } ?>">
305 305
         <input type="hidden" id="bestof_widget_char_count" name="bestof_widget_char_count"
306 306
                value="<?php echo $character_count; ?>">
307 307
         <div class="geo-bestof-contentwrap geodir-tabs-content" style="position: relative; z-index: 0;">
308 308
             <p id="geodir-bestof-loading" class="geodir-bestof-loading"><i class="fa fa-cog fa-spin"></i></p>
309 309
             <?php
310
-            echo '<div id="geodir-bestof-places">';
311
-            if ($terms) {
312
-                $view_all_link = add_query_arg(array('sort_by' => 'rating_count_desc'), get_term_link($first_term, $first_term->taxonomy));
313
-                /**
314
-                 * Filter the page link to view all lisitngs.
315
-                 *
316
-                 * @since 1.5.1
317
-                 *
318
-                 * @param array $view_all_link View all listings page link.
319
-                 * @param array $post_type The Post type.
320
-                 * @param array $first_term The category term object.
321
-                 */
322
-                $view_all_link = apply_filters('geodir_bestof_widget_view_all_link', $view_all_link, $post_type, $first_term);
323
-
324
-                echo '<h3 class="bestof-cat-title">' . wp_sprintf(__('Best of %s', 'geodirectory'), $first_term->name) . '<a href="' . esc_url($view_all_link) . '">' . __("View all", 'geodirectory') . '</a></h3>';
325
-            }
326
-            if ($excerpt_type == 'show-reviews') {
327
-                add_filter('get_the_excerpt', 'best_of_show_review_in_excerpt');
328
-            }
329
-            geodir_bestof_places_by_term($query_args);
330
-            if ($excerpt_type == 'show-reviews') {
331
-                remove_filter('get_the_excerpt', 'best_of_show_review_in_excerpt');
332
-            }
333
-            echo "</div>";
334
-            ?>
310
+			echo '<div id="geodir-bestof-places">';
311
+			if ($terms) {
312
+				$view_all_link = add_query_arg(array('sort_by' => 'rating_count_desc'), get_term_link($first_term, $first_term->taxonomy));
313
+				/**
314
+				 * Filter the page link to view all lisitngs.
315
+				 *
316
+				 * @since 1.5.1
317
+				 *
318
+				 * @param array $view_all_link View all listings page link.
319
+				 * @param array $post_type The Post type.
320
+				 * @param array $first_term The category term object.
321
+				 */
322
+				$view_all_link = apply_filters('geodir_bestof_widget_view_all_link', $view_all_link, $post_type, $first_term);
323
+
324
+				echo '<h3 class="bestof-cat-title">' . wp_sprintf(__('Best of %s', 'geodirectory'), $first_term->name) . '<a href="' . esc_url($view_all_link) . '">' . __("View all", 'geodirectory') . '</a></h3>';
325
+			}
326
+			if ($excerpt_type == 'show-reviews') {
327
+				add_filter('get_the_excerpt', 'best_of_show_review_in_excerpt');
328
+			}
329
+			geodir_bestof_places_by_term($query_args);
330
+			if ($excerpt_type == 'show-reviews') {
331
+				remove_filter('get_the_excerpt', 'best_of_show_review_in_excerpt');
332
+			}
333
+			echo "</div>";
334
+			?>
335 335
         </div>
336 336
         <?php //first term listings by default - end
337
-        ?>
337
+		?>
338 338
         <?php echo $after_widget;
339
-        echo "</div>";
340
-    }
341
-
342
-    /**
343
-     * Sanitize best of widget form values as they are saved.
344
-     *
345
-     * @since 1.3.9
346
-     * @since 1.5.1 Declare function public.
347
-     *
348
-     * @param array $new_instance Values just sent to be saved.
349
-     * @param array $old_instance Previously saved values from database.
350
-     *
351
-     * @return array Updated safe values to be saved.
352
-     */
353
-    public function update($new_instance, $old_instance)
354
-    {
355
-        $instance = $old_instance;
356
-        $instance['title'] = strip_tags($new_instance['title']);
357
-        $instance['post_type'] = strip_tags($new_instance['post_type']);
358
-        $instance['post_limit'] = strip_tags($new_instance['post_limit']);
359
-        $instance['categ_limit'] = strip_tags($new_instance['categ_limit']);
360
-        $instance['character_count'] = $new_instance['character_count'];
361
-        $instance['tab_layout'] = $new_instance['tab_layout'];
362
-        $instance['excerpt_type'] = $new_instance['excerpt_type'];
363
-        if (isset($new_instance['add_location_filter']) && $new_instance['add_location_filter'] != '')
364
-            $instance['add_location_filter'] = strip_tags($new_instance['add_location_filter']);
365
-        else
366
-            $instance['add_location_filter'] = '0';
367
-        $instance['use_viewing_post_type'] = isset($new_instance['use_viewing_post_type']) && $new_instance['use_viewing_post_type'] ? 1 : 0;
368
-        return $instance;
369
-    }
370
-
371
-    /**
372
-     * Back-end best of widget settings form.
373
-     *
374
-     * @since 1.3.9
375
-     * @since 1.5.1 Declare function public.
376
-     *
377
-     * @param array $instance Previously saved values from database.
378
-     */
379
-    public function form($instance)
380
-    {
381
-        $instance = wp_parse_args((array)$instance,
382
-            array(
383
-                'title' => '',
384
-                'post_type' => '',
385
-                'post_limit' => '5',
386
-                'categ_limit' => '3',
387
-                'character_count' => '20',
388
-                'add_location_filter' => '1',
389
-                'tab_layout' => 'bestof-tabs-on-top',
390
-                'excerpt_type' => 'show-desc',
391
-                'use_viewing_post_type' => ''
392
-            )
393
-        );
394
-        $title = strip_tags($instance['title']);
395
-        $post_type = strip_tags($instance['post_type']);
396
-        $post_limit = strip_tags($instance['post_limit']);
397
-        $categ_limit = strip_tags($instance['categ_limit']);
398
-        $character_count = strip_tags($instance['character_count']);
399
-        $tab_layout = strip_tags($instance['tab_layout']);
400
-        $excerpt_type = strip_tags($instance['excerpt_type']);
401
-        $add_location_filter = strip_tags($instance['add_location_filter']);
402
-        $use_viewing_post_type = isset($instance['use_viewing_post_type']) && $instance['use_viewing_post_type'] ? true : false;
403
-
404
-        ?>
339
+		echo "</div>";
340
+	}
341
+
342
+	/**
343
+	 * Sanitize best of widget form values as they are saved.
344
+	 *
345
+	 * @since 1.3.9
346
+	 * @since 1.5.1 Declare function public.
347
+	 *
348
+	 * @param array $new_instance Values just sent to be saved.
349
+	 * @param array $old_instance Previously saved values from database.
350
+	 *
351
+	 * @return array Updated safe values to be saved.
352
+	 */
353
+	public function update($new_instance, $old_instance)
354
+	{
355
+		$instance = $old_instance;
356
+		$instance['title'] = strip_tags($new_instance['title']);
357
+		$instance['post_type'] = strip_tags($new_instance['post_type']);
358
+		$instance['post_limit'] = strip_tags($new_instance['post_limit']);
359
+		$instance['categ_limit'] = strip_tags($new_instance['categ_limit']);
360
+		$instance['character_count'] = $new_instance['character_count'];
361
+		$instance['tab_layout'] = $new_instance['tab_layout'];
362
+		$instance['excerpt_type'] = $new_instance['excerpt_type'];
363
+		if (isset($new_instance['add_location_filter']) && $new_instance['add_location_filter'] != '')
364
+			$instance['add_location_filter'] = strip_tags($new_instance['add_location_filter']);
365
+		else
366
+			$instance['add_location_filter'] = '0';
367
+		$instance['use_viewing_post_type'] = isset($new_instance['use_viewing_post_type']) && $new_instance['use_viewing_post_type'] ? 1 : 0;
368
+		return $instance;
369
+	}
370
+
371
+	/**
372
+	 * Back-end best of widget settings form.
373
+	 *
374
+	 * @since 1.3.9
375
+	 * @since 1.5.1 Declare function public.
376
+	 *
377
+	 * @param array $instance Previously saved values from database.
378
+	 */
379
+	public function form($instance)
380
+	{
381
+		$instance = wp_parse_args((array)$instance,
382
+			array(
383
+				'title' => '',
384
+				'post_type' => '',
385
+				'post_limit' => '5',
386
+				'categ_limit' => '3',
387
+				'character_count' => '20',
388
+				'add_location_filter' => '1',
389
+				'tab_layout' => 'bestof-tabs-on-top',
390
+				'excerpt_type' => 'show-desc',
391
+				'use_viewing_post_type' => ''
392
+			)
393
+		);
394
+		$title = strip_tags($instance['title']);
395
+		$post_type = strip_tags($instance['post_type']);
396
+		$post_limit = strip_tags($instance['post_limit']);
397
+		$categ_limit = strip_tags($instance['categ_limit']);
398
+		$character_count = strip_tags($instance['character_count']);
399
+		$tab_layout = strip_tags($instance['tab_layout']);
400
+		$excerpt_type = strip_tags($instance['excerpt_type']);
401
+		$add_location_filter = strip_tags($instance['add_location_filter']);
402
+		$use_viewing_post_type = isset($instance['use_viewing_post_type']) && $instance['use_viewing_post_type'] ? true : false;
403
+
404
+		?>
405 405
         <p>
406 406
             <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'geodirectory');?>
407 407
 
@@ -416,14 +416,14 @@  discard block
 block discarded – undo
416 416
                 for="<?php echo $this->get_field_id('post_type'); ?>"><?php _e('Post Type:', 'geodirectory');?>
417 417
 
418 418
                 <?php $postypes = geodir_get_posttypes();
419
-                /**
420
-                 * Filter the post types to display in widget.
421
-                 *
422
-                 * @since 1.3.9
423
-                 *
424
-                 * @param array $postypes Post types array.
425
-                 */
426
-                $postypes = apply_filters('geodir_post_type_list_in_p_widget', $postypes); ?>
419
+				/**
420
+				 * Filter the post types to display in widget.
421
+				 *
422
+				 * @since 1.3.9
423
+				 *
424
+				 * @param array $postypes Post types array.
425
+				 */
426
+				$postypes = apply_filters('geodir_post_type_list_in_p_widget', $postypes); ?>
427 427
 
428 428
                 <select class="widefat" id="<?php echo $this->get_field_id('post_type'); ?>"
429 429
                         name="<?php echo $this->get_field_name('post_type'); ?>"
@@ -432,9 +432,9 @@  discard block
 block discarded – undo
432 432
                     <?php foreach ($postypes as $postypes_obj) { ?>
433 433
 
434 434
                         <option <?php if ($post_type == $postypes_obj) {
435
-                            echo 'selected="selected"';
436
-                        } ?> value="<?php echo $postypes_obj; ?>"><?php $extvalue = explode('_', $postypes_obj);
437
-                            echo ucfirst($extvalue[1]); ?></option>
435
+							echo 'selected="selected"';
436
+						} ?> value="<?php echo $postypes_obj; ?>"><?php $extvalue = explode('_', $postypes_obj);
437
+							echo ucfirst($extvalue[1]); ?></option>
438 438
 
439 439
                     <?php } ?>
440 440
 
@@ -480,14 +480,14 @@  discard block
 block discarded – undo
480 480
                         name="<?php echo $this->get_field_name('tab_layout'); ?>">
481 481
 
482 482
                     <option <?php if ($tab_layout == 'bestof-tabs-on-top') {
483
-                        echo 'selected="selected"';
484
-                    } ?> value="bestof-tabs-on-top"><?php _e('Tabs on Top', 'geodirectory'); ?></option>
483
+						echo 'selected="selected"';
484
+					} ?> value="bestof-tabs-on-top"><?php _e('Tabs on Top', 'geodirectory'); ?></option>
485 485
                     <option <?php if ($tab_layout == 'bestof-tabs-on-left') {
486
-                        echo 'selected="selected"';
487
-                    } ?> value="bestof-tabs-on-left"><?php _e('Tabs on Left', 'geodirectory'); ?></option>
486
+						echo 'selected="selected"';
487
+					} ?> value="bestof-tabs-on-left"><?php _e('Tabs on Left', 'geodirectory'); ?></option>
488 488
                     <option <?php if ($tab_layout == 'bestof-tabs-as-dropdown') {
489
-                        echo 'selected="selected"';
490
-                    } ?>
489
+						echo 'selected="selected"';
490
+					} ?>
491 491
                         value="bestof-tabs-as-dropdown"><?php _e('Tabs as Dropdown', 'geodirectory'); ?></option>
492 492
                 </select>
493 493
             </label>
@@ -501,11 +501,11 @@  discard block
 block discarded – undo
501 501
                         name="<?php echo $this->get_field_name('excerpt_type'); ?>">
502 502
 
503 503
                     <option <?php if ($excerpt_type == 'show-desc') {
504
-                        echo 'selected="selected"';
505
-                    } ?> value="show-desc"><?php _e('Show Description', 'geodirectory'); ?></option>
504
+						echo 'selected="selected"';
505
+					} ?> value="show-desc"><?php _e('Show Description', 'geodirectory'); ?></option>
506 506
                     <option <?php if ($excerpt_type == 'show-reviews') {
507
-                        echo 'selected="selected"';
508
-                    } ?> value="show-reviews"><?php _e('Show Reviews if Available', 'geodirectory'); ?></option>
507
+						echo 'selected="selected"';
508
+					} ?> value="show-reviews"><?php _e('Show Reviews if Available', 'geodirectory'); ?></option>
509 509
                 </select>
510 510
             </label>
511 511
         </p>
@@ -524,12 +524,12 @@  discard block
 block discarded – undo
524 524
                 for="<?php echo $this->get_field_id('use_viewing_post_type'); ?>"><?php _e('Use current viewing post type:', 'geodirectory'); ?>
525 525
                 <input type="checkbox" id="<?php echo $this->get_field_id('use_viewing_post_type'); ?>"
526 526
                        name="<?php echo $this->get_field_name('use_viewing_post_type'); ?>" <?php if ($use_viewing_post_type) {
527
-                    echo 'checked="checked"';
528
-                } ?>  value="1"/>
527
+					echo 'checked="checked"';
528
+				} ?>  value="1"/>
529 529
             </label>
530 530
         </p>
531 531
     <?php
532
-    }
532
+	}
533 533
 } // class geodir_bestof_widget
534 534
 
535 535
 register_widget('geodir_bestof_widget');
@@ -549,68 +549,68 @@  discard block
 block discarded – undo
549 549
  */
550 550
 function geodir_bestof_places_by_term($query_args)
551 551
 {
552
-    global $gd_session;
553
-
554
-    /**
555
-     * This action called before querying widget listings.
556
-     *
557
-     * @since 1.0.0
558
-     */
559
-    do_action('geodir_bestof_get_widget_listings_before');
560
-
561
-    $widget_listings = geodir_get_widget_listings($query_args);
562
-
563
-    /**
564
-     * This action called after querying widget listings.
565
-     *
566
-     * @since 1.0.0
567
-     */
568
-    do_action('geodir_bestof_get_widget_listings_after');
569
-
570
-    $character_count = isset($query_args['excerpt_length']) ? $query_args['excerpt_length'] : '';
571
-
572
-    if (!isset($character_count)) {
573
-        /** This filter is documented in geodirectory-widgets/geodirectory_bestof_widget.php */
574
-        $character_count = $character_count == '' ? 50 : apply_filters('bestof_widget_character_count', $character_count);
575
-    }
576
-
577
-    /** This filter is documented in geodirectory-functions/general_functions.php */
578
-    $template = apply_filters("geodir_template_part-widget-listing-listview", geodir_locate_template('widget-listing-listview'));
579
-
580
-    global $post, $map_jason, $map_canvas_arr, $gridview_columns_widget, $geodir_is_widget_listing;
581
-    $current_post = $post;
582
-    $current_map_jason = $map_jason;
583
-    $current_map_canvas_arr = $map_canvas_arr;
584
-    $current_grid_view = $gridview_columns_widget;
585
-    $gridview_columns_widget = null;
586
-
587
-    $gd_listing_view_set = $gd_session->get('gd_listing_view') ? true : false;
588
-    $gd_listing_view_old = $gd_listing_view_set ? $gd_session->get('gd_listing_view') : '';
589
-
590
-    $gd_session->set('gd_listing_view', '1');
591
-    $geodir_is_widget_listing = true;
592
-
593
-    /**
594
-     * Includes the template for the listing listview.
595
-     *
596
-     * @since 1.3.9
597
-     */
598
-    include($template);
599
-
600
-    $geodir_is_widget_listing = false;
601
-
602
-    $GLOBALS['post'] = $current_post;
603
-    if (!empty($current_post)) {
604
-        setup_postdata($current_post);
605
-    }
606
-    if ($gd_listing_view_set) { // Set back previous value
607
-        $gd_session->set('gd_listing_view', $gd_listing_view_old);
608
-    } else {
609
-        $gd_session->un_set('gd_listing_view');
610
-    }
611
-    $map_jason = $current_map_jason;
612
-    $map_canvas_arr = $current_map_canvas_arr;
613
-    $gridview_columns_widget = $current_grid_view;
552
+	global $gd_session;
553
+
554
+	/**
555
+	 * This action called before querying widget listings.
556
+	 *
557
+	 * @since 1.0.0
558
+	 */
559
+	do_action('geodir_bestof_get_widget_listings_before');
560
+
561
+	$widget_listings = geodir_get_widget_listings($query_args);
562
+
563
+	/**
564
+	 * This action called after querying widget listings.
565
+	 *
566
+	 * @since 1.0.0
567
+	 */
568
+	do_action('geodir_bestof_get_widget_listings_after');
569
+
570
+	$character_count = isset($query_args['excerpt_length']) ? $query_args['excerpt_length'] : '';
571
+
572
+	if (!isset($character_count)) {
573
+		/** This filter is documented in geodirectory-widgets/geodirectory_bestof_widget.php */
574
+		$character_count = $character_count == '' ? 50 : apply_filters('bestof_widget_character_count', $character_count);
575
+	}
576
+
577
+	/** This filter is documented in geodirectory-functions/general_functions.php */
578
+	$template = apply_filters("geodir_template_part-widget-listing-listview", geodir_locate_template('widget-listing-listview'));
579
+
580
+	global $post, $map_jason, $map_canvas_arr, $gridview_columns_widget, $geodir_is_widget_listing;
581
+	$current_post = $post;
582
+	$current_map_jason = $map_jason;
583
+	$current_map_canvas_arr = $map_canvas_arr;
584
+	$current_grid_view = $gridview_columns_widget;
585
+	$gridview_columns_widget = null;
586
+
587
+	$gd_listing_view_set = $gd_session->get('gd_listing_view') ? true : false;
588
+	$gd_listing_view_old = $gd_listing_view_set ? $gd_session->get('gd_listing_view') : '';
589
+
590
+	$gd_session->set('gd_listing_view', '1');
591
+	$geodir_is_widget_listing = true;
592
+
593
+	/**
594
+	 * Includes the template for the listing listview.
595
+	 *
596
+	 * @since 1.3.9
597
+	 */
598
+	include($template);
599
+
600
+	$geodir_is_widget_listing = false;
601
+
602
+	$GLOBALS['post'] = $current_post;
603
+	if (!empty($current_post)) {
604
+		setup_postdata($current_post);
605
+	}
606
+	if ($gd_listing_view_set) { // Set back previous value
607
+		$gd_session->set('gd_listing_view', $gd_listing_view_old);
608
+	} else {
609
+		$gd_session->un_set('gd_listing_view');
610
+	}
611
+	$map_jason = $current_map_jason;
612
+	$map_canvas_arr = $current_map_canvas_arr;
613
+	$gridview_columns_widget = $current_grid_view;
614 614
 }
615 615
 
616 616
 //Ajax functions
@@ -627,51 +627,51 @@  discard block
 block discarded – undo
627 627
  */
628 628
 function geodir_bestof_callback()
629 629
 {
630
-    check_ajax_referer('geodir-bestof-nonce', 'geodir_bestof_nonce');
631
-    //set variables
632
-    $post_type = strip_tags(esc_sql($_POST['post_type']));
633
-    $post_limit = strip_tags(esc_sql($_POST['post_limit']));
634
-    $character_count = strip_tags(esc_sql($_POST['char_count']));
635
-    $taxonomy = strip_tags(esc_sql($_POST['taxonomy']));
636
-    $add_location_filter = strip_tags(esc_sql($_POST['add_location_filter']));
637
-    $term_id = strip_tags(esc_sql($_POST['term_id']));
638
-    $excerpt_type = strip_tags(esc_sql($_POST['excerpt_type']));
639
-
640
-    $query_args = array(
641
-        'posts_per_page' => $post_limit,
642
-        'is_geodir_loop' => true,
643
-        'post_type' => $post_type,
644
-        'gd_location' => $add_location_filter ? true : false,
645
-        'order_by' => 'high_review'
646
-    );
647
-
648
-    if ($character_count >= 0) {
649
-        $query_args['excerpt_length'] = $character_count;
650
-    }
651
-
652
-    $tax_query = array(
653
-        'taxonomy' => $taxonomy,
654
-        'field' => 'id',
655
-        'terms' => $term_id
656
-    );
657
-
658
-    $query_args['tax_query'] = array($tax_query);
659
-    if ($term_id && $taxonomy) {
660
-        $term = get_term_by('id', $term_id, $taxonomy);
661
-        $view_all_link = add_query_arg(array('sort_by' => 'rating_count_desc'), get_term_link($term));
662
-        /** This filter is documented in geodirectory-widgets/geodirectory_bestof_widget.php */
663
-        $view_all_link = apply_filters('geodir_bestof_widget_view_all_link', $view_all_link, $post_type, $term);
664
-
665
-        echo '<h3 class="bestof-cat-title">' . wp_sprintf(__('Best of %s', 'geodirectory'), $term->name) . '<a href="' . esc_url($view_all_link) . '">' . __("View all", 'geodirectory') . '</a></h3>';
666
-    }
667
-    if ($excerpt_type == 'show-reviews') {
668
-        add_filter('get_the_excerpt', 'best_of_show_review_in_excerpt');
669
-    }
670
-    geodir_bestof_places_by_term($query_args);
671
-    if ($excerpt_type == 'show-reviews') {
672
-        remove_filter('get_the_excerpt', 'best_of_show_review_in_excerpt');
673
-    }
674
-    gd_die();
630
+	check_ajax_referer('geodir-bestof-nonce', 'geodir_bestof_nonce');
631
+	//set variables
632
+	$post_type = strip_tags(esc_sql($_POST['post_type']));
633
+	$post_limit = strip_tags(esc_sql($_POST['post_limit']));
634
+	$character_count = strip_tags(esc_sql($_POST['char_count']));
635
+	$taxonomy = strip_tags(esc_sql($_POST['taxonomy']));
636
+	$add_location_filter = strip_tags(esc_sql($_POST['add_location_filter']));
637
+	$term_id = strip_tags(esc_sql($_POST['term_id']));
638
+	$excerpt_type = strip_tags(esc_sql($_POST['excerpt_type']));
639
+
640
+	$query_args = array(
641
+		'posts_per_page' => $post_limit,
642
+		'is_geodir_loop' => true,
643
+		'post_type' => $post_type,
644
+		'gd_location' => $add_location_filter ? true : false,
645
+		'order_by' => 'high_review'
646
+	);
647
+
648
+	if ($character_count >= 0) {
649
+		$query_args['excerpt_length'] = $character_count;
650
+	}
651
+
652
+	$tax_query = array(
653
+		'taxonomy' => $taxonomy,
654
+		'field' => 'id',
655
+		'terms' => $term_id
656
+	);
657
+
658
+	$query_args['tax_query'] = array($tax_query);
659
+	if ($term_id && $taxonomy) {
660
+		$term = get_term_by('id', $term_id, $taxonomy);
661
+		$view_all_link = add_query_arg(array('sort_by' => 'rating_count_desc'), get_term_link($term));
662
+		/** This filter is documented in geodirectory-widgets/geodirectory_bestof_widget.php */
663
+		$view_all_link = apply_filters('geodir_bestof_widget_view_all_link', $view_all_link, $post_type, $term);
664
+
665
+		echo '<h3 class="bestof-cat-title">' . wp_sprintf(__('Best of %s', 'geodirectory'), $term->name) . '<a href="' . esc_url($view_all_link) . '">' . __("View all", 'geodirectory') . '</a></h3>';
666
+	}
667
+	if ($excerpt_type == 'show-reviews') {
668
+		add_filter('get_the_excerpt', 'best_of_show_review_in_excerpt');
669
+	}
670
+	geodir_bestof_places_by_term($query_args);
671
+	if ($excerpt_type == 'show-reviews') {
672
+		remove_filter('get_the_excerpt', 'best_of_show_review_in_excerpt');
673
+	}
674
+	gd_die();
675 675
 }
676 676
 
677 677
 //Javascript
@@ -684,8 +684,8 @@  discard block
 block discarded – undo
684 684
  */
685 685
 function geodir_bestof_js()
686 686
 {
687
-    $ajax_nonce = wp_create_nonce("geodir-bestof-nonce");
688
-    ?>
687
+	$ajax_nonce = wp_create_nonce("geodir-bestof-nonce");
688
+	?>
689 689
     <script type="text/javascript">
690 690
         jQuery(document).ready(function () {
691 691
             jQuery('.geodir-bestof-cat-list a, #geodir_bestof_tab_dd').on("click change", function (e) {
@@ -758,18 +758,18 @@  discard block
 block discarded – undo
758 758
 
759 759
 function best_of_show_review_in_excerpt($excerpt)
760 760
 {
761
-    global $wpdb, $post;
762
-    $review_table = GEODIR_REVIEW_TABLE;
763
-    $request = "SELECT comment_ID FROM $review_table WHERE post_id = $post->ID ORDER BY post_date DESC, id DESC LIMIT 1";
764
-    $comments = $wpdb->get_results($request);
765
-
766
-    if ($comments) {
767
-        foreach ($comments as $comment) {
768
-            // Set the extra comment info needed.
769
-            $comment_extra = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID =$comment->comment_ID");
770
-            $comment_content = $comment_extra->comment_content;
771
-            $excerpt = strip_tags($comment_content);
772
-        }
773
-    }
774
-    return $excerpt;
761
+	global $wpdb, $post;
762
+	$review_table = GEODIR_REVIEW_TABLE;
763
+	$request = "SELECT comment_ID FROM $review_table WHERE post_id = $post->ID ORDER BY post_date DESC, id DESC LIMIT 1";
764
+	$comments = $wpdb->get_results($request);
765
+
766
+	if ($comments) {
767
+		foreach ($comments as $comment) {
768
+			// Set the extra comment info needed.
769
+			$comment_extra = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID =$comment->comment_ID");
770
+			$comment_content = $comment_extra->comment_content;
771
+			$excerpt = strip_tags($comment_content);
772
+		}
773
+	}
774
+	return $excerpt;
775 775
 }
776 776
\ No newline at end of file
Please login to merge, or discard this patch.
geodirectory_template_actions.php 3 patches
Braces   +31 added lines, -24 removed lines patch added patch discarded remove patch
@@ -714,8 +714,9 @@  discard block
 block discarded – undo
714 714
 
715 715
                         if (isset($post->post_default_category) && $post->post_default_category == $cat_id) {
716 716
                             if ($term_icon_url = get_tax_meta($cat_id, 'ct_cat_icon', false, $post_type)) {
717
-                                if (isset($term_icon_url['src']) && $term_icon_url['src'] != '')
718
-                                    $term_icon = $term_icon_url['src'];
717
+                                if (isset($term_icon_url['src']) && $term_icon_url['src'] != '') {
718
+                                                                    $term_icon = $term_icon_url['src'];
719
+                                }
719 720
                                 break;
720 721
                             }
721 722
                         }
@@ -1246,8 +1247,9 @@  discard block
 block discarded – undo
1246 1247
         echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>';
1247 1248
     }
1248 1249
 
1249
-    if (isset($taxonomies[$post_type . '_tags']))
1250
-        echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>';
1250
+    if (isset($taxonomies[$post_type . '_tags'])) {
1251
+            echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>';
1252
+    }
1251 1253
 
1252 1254
     ?>
1253 1255
     </p><?php
@@ -1598,23 +1600,21 @@  discard block
 block discarded – undo
1598 1600
     if(geodir_is_page('pt')){
1599 1601
         $gd_page = 'pt';
1600 1602
         $title  = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
1601
-    }
1602
-    elseif(geodir_is_page('listing')){
1603
+    } elseif(geodir_is_page('listing')){
1603 1604
         $gd_page = 'listing';
1604 1605
         global $wp_query;
1605 1606
         $current_term = $wp_query->get_queried_object();
1606 1607
         if (strpos($current_term->taxonomy,'_tags') !== false) {
1607 1608
             $title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
1608
-        }else{
1609
+        } else{
1609 1610
             $title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
1610 1611
         }
1611 1612
 
1612
-    }
1613
-    elseif(geodir_is_page('author')){
1613
+    } elseif(geodir_is_page('author')){
1614 1614
         $gd_page = 'author';
1615 1615
         if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
1616 1616
             $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
1617
-        }else{
1617
+        } else{
1618 1618
             $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
1619 1619
         }
1620 1620
 
@@ -2025,8 +2025,9 @@  discard block
 block discarded – undo
2025 2025
  */
2026 2026
 function geodir_action_add_listing_page_title()
2027 2027
 {
2028
-    if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '')
2029
-        $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2028
+    if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '') {
2029
+            $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2030
+    }
2030 2031
     /** This action is documented in geodirectory_template_actions.php */
2031 2032
     $class = apply_filters('geodir_page_title_class', 'entry-title fn');
2032 2033
     /** This action is documented in geodirectory_template_actions.php */
@@ -2038,7 +2039,7 @@  discard block
 block discarded – undo
2038 2039
         $gd_page = 'add-listing';
2039 2040
         if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
2040 2041
             $title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
2041
-        }elseif(isset($listing_type)){
2042
+        } elseif(isset($listing_type)){
2042 2043
             $title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
2043 2044
         }
2044 2045
 
@@ -2321,8 +2322,9 @@  discard block
 block discarded – undo
2321 2322
         $totImg = 0;
2322 2323
         if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
2323 2324
             $post = (object)$gd_session->get('listing');
2324
-            if (isset($post->post_images))
2325
-                $curImages = trim($post->post_images, ",");
2325
+            if (isset($post->post_images)) {
2326
+                            $curImages = trim($post->post_images, ",");
2327
+            }
2326 2328
 
2327 2329
 
2328 2330
             if ($curImages != '') {
@@ -2350,10 +2352,13 @@  discard block
 block discarded – undo
2350 2352
             $totImg = count((array)$thumb_img_arr);
2351 2353
         }
2352 2354
 
2353
-        if ($curImages != '')
2354
-            $svalue = $curImages; // this will be initial value of the above form field. Image urls.
2355
-        else
2356
-            $svalue = '';
2355
+        if ($curImages != '') {
2356
+                    $svalue = $curImages;
2357
+        }
2358
+        // this will be initial value of the above form field. Image urls.
2359
+        else {
2360
+                    $svalue = '';
2361
+        }
2357 2362
 
2358 2363
         $image_limit = $package_info->image_limit;
2359 2364
         $show_image_input_box = ($image_limit != '0');
@@ -2563,8 +2568,9 @@  discard block
 block discarded – undo
2563 2568
     </script><?php
2564 2569
 
2565 2570
     global $errors;
2566
-    if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim')
2567
-        $errors->add('claim_login', LOGIN_CLAIM);
2571
+    if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim') {
2572
+            $errors->add('claim_login', LOGIN_CLAIM);
2573
+    }
2568 2574
 
2569 2575
     if (!empty($errors)) {
2570 2576
         foreach ($errors as $errorsObj) {
@@ -2668,8 +2674,9 @@  discard block
 block discarded – undo
2668 2674
 
2669 2675
     if (!empty($term)) {
2670 2676
         $current_term = get_term_by('slug', $term, $taxonomy[0]);
2671
-        if (!empty($current_term))
2672
-            $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
2677
+        if (!empty($current_term)) {
2678
+                    $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
2679
+        }
2673 2680
     }
2674 2681
 
2675 2682
 
@@ -2687,7 +2694,7 @@  discard block
 block discarded – undo
2687 2694
         $gd_page = 'author';
2688 2695
         if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
2689 2696
             $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
2690
-        }else{
2697
+        } else{
2691 2698
             $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
2692 2699
         }
2693 2700
 
Please login to merge, or discard this patch.
Indentation   +1771 added lines, -1771 removed lines patch added patch discarded remove patch
@@ -17,10 +17,10 @@  discard block
 block discarded – undo
17 17
  */
18 18
 function gd_compat_styles()
19 19
 {
20
-    $tc = get_option('theme_compatibility_setting');
21
-    echo "<style id='gd-compat-styles' type='text/css'>";
22
-    echo $tc['geodir_theme_compat_css'];
23
-    echo "</style>";
20
+	$tc = get_option('theme_compatibility_setting');
21
+	echo "<style id='gd-compat-styles' type='text/css'>";
22
+	echo $tc['geodir_theme_compat_css'];
23
+	echo "</style>";
24 24
 }
25 25
 
26 26
 /**
@@ -31,10 +31,10 @@  discard block
 block discarded – undo
31 31
  */
32 32
 function gd_compat_script()
33 33
 {
34
-    $tc = get_option('theme_compatibility_setting');
35
-    echo "<script>";
36
-    echo $tc['geodir_theme_compat_js'];
37
-    echo " </script>";
34
+	$tc = get_option('theme_compatibility_setting');
35
+	echo "<script>";
36
+	echo $tc['geodir_theme_compat_js'];
37
+	echo " </script>";
38 38
 }
39 39
 
40 40
 /**
@@ -47,8 +47,8 @@  discard block
 block discarded – undo
47 47
  */
48 48
 function geodir_top_content_add_dynamic()
49 49
 {
50
-    $tc = get_option('theme_compatibility_setting');
51
-    echo $tc['geodir_top_content_add'];
50
+	$tc = get_option('theme_compatibility_setting');
51
+	echo $tc['geodir_top_content_add'];
52 52
 }
53 53
 
54 54
 /**
@@ -61,8 +61,8 @@  discard block
 block discarded – undo
61 61
  */
62 62
 function geodir_before_main_content_add_dynamic()
63 63
 {
64
-    $tc = get_option('theme_compatibility_setting');
65
-    echo $tc['geodir_before_main_content_add'];
64
+	$tc = get_option('theme_compatibility_setting');
65
+	echo $tc['geodir_before_main_content_add'];
66 66
 }
67 67
 
68 68
 /**
@@ -75,8 +75,8 @@  discard block
 block discarded – undo
75 75
  */
76 76
 function geodir_full_page_class_dynamic()
77 77
 {
78
-    $tc = get_option('theme_compatibility_setting');
79
-    return $tc['geodir_full_page_class_filter'];
78
+	$tc = get_option('theme_compatibility_setting');
79
+	return $tc['geodir_full_page_class_filter'];
80 80
 }
81 81
 
82 82
 /**
@@ -89,8 +89,8 @@  discard block
 block discarded – undo
89 89
  */
90 90
 function geodir_before_widget_dynamic()
91 91
 {
92
-    $tc = get_option('theme_compatibility_setting');
93
-    return $tc['geodir_before_widget_filter'];
92
+	$tc = get_option('theme_compatibility_setting');
93
+	return $tc['geodir_before_widget_filter'];
94 94
 }
95 95
 
96 96
 /**
@@ -103,8 +103,8 @@  discard block
 block discarded – undo
103 103
  */
104 104
 function geodir_after_widget_dynamic()
105 105
 {
106
-    $tc = get_option('theme_compatibility_setting');
107
-    return $tc['geodir_after_widget_filter'];
106
+	$tc = get_option('theme_compatibility_setting');
107
+	return $tc['geodir_after_widget_filter'];
108 108
 }
109 109
 
110 110
 /**
@@ -117,8 +117,8 @@  discard block
 block discarded – undo
117 117
  */
118 118
 function geodir_before_title_dynamic()
119 119
 {
120
-    $tc = get_option('theme_compatibility_setting');
121
-    return $tc['geodir_before_title_filter'];
120
+	$tc = get_option('theme_compatibility_setting');
121
+	return $tc['geodir_before_title_filter'];
122 122
 }
123 123
 
124 124
 /**
@@ -131,8 +131,8 @@  discard block
 block discarded – undo
131 131
  */
132 132
 function geodir_after_title_dynamic()
133 133
 {
134
-    $tc = get_option('theme_compatibility_setting');
135
-    return $tc['geodir_after_title_filter'];
134
+	$tc = get_option('theme_compatibility_setting');
135
+	return $tc['geodir_after_title_filter'];
136 136
 }
137 137
 
138 138
 /**
@@ -145,8 +145,8 @@  discard block
 block discarded – undo
145 145
  */
146 146
 function geodir_menu_li_class_dynamic()
147 147
 {
148
-    $tc = get_option('theme_compatibility_setting');
149
-    return $tc['geodir_menu_li_class_filter'];
148
+	$tc = get_option('theme_compatibility_setting');
149
+	return $tc['geodir_menu_li_class_filter'];
150 150
 }
151 151
 
152 152
 /**
@@ -159,8 +159,8 @@  discard block
 block discarded – undo
159 159
  */
160 160
 function geodir_sub_menu_ul_class_dynamic()
161 161
 {
162
-    $tc = get_option('theme_compatibility_setting');
163
-    return $tc['geodir_sub_menu_ul_class_filter'];
162
+	$tc = get_option('theme_compatibility_setting');
163
+	return $tc['geodir_sub_menu_ul_class_filter'];
164 164
 }
165 165
 
166 166
 /**
@@ -173,8 +173,8 @@  discard block
 block discarded – undo
173 173
  */
174 174
 function geodir_sub_menu_li_class_dynamic()
175 175
 {
176
-    $tc = get_option('theme_compatibility_setting');
177
-    return $tc['geodir_sub_menu_li_class_filter'];
176
+	$tc = get_option('theme_compatibility_setting');
177
+	return $tc['geodir_sub_menu_li_class_filter'];
178 178
 }
179 179
 
180 180
 /**
@@ -187,8 +187,8 @@  discard block
 block discarded – undo
187 187
  */
188 188
 function geodir_menu_a_class_dynamic()
189 189
 {
190
-    $tc = get_option('theme_compatibility_setting');
191
-    return $tc['geodir_menu_a_class_filter'];
190
+	$tc = get_option('theme_compatibility_setting');
191
+	return $tc['geodir_menu_a_class_filter'];
192 192
 }
193 193
 
194 194
 /**
@@ -201,8 +201,8 @@  discard block
 block discarded – undo
201 201
  */
202 202
 function geodir_sub_menu_a_class_dynamic()
203 203
 {
204
-    $tc = get_option('theme_compatibility_setting');
205
-    return $tc['geodir_sub_menu_a_class_filter'];
204
+	$tc = get_option('theme_compatibility_setting');
205
+	return $tc['geodir_sub_menu_a_class_filter'];
206 206
 }
207 207
 
208 208
 /**
@@ -215,8 +215,8 @@  discard block
 block discarded – undo
215 215
  */
216 216
 function geodir_location_switcher_menu_li_class_dynamic()
217 217
 {
218
-    $tc = get_option('theme_compatibility_setting');
219
-    return $tc['geodir_location_switcher_menu_li_class_filter'];
218
+	$tc = get_option('theme_compatibility_setting');
219
+	return $tc['geodir_location_switcher_menu_li_class_filter'];
220 220
 }
221 221
 
222 222
 /**
@@ -229,8 +229,8 @@  discard block
 block discarded – undo
229 229
  */
230 230
 function geodir_location_switcher_menu_a_class_dynamic()
231 231
 {
232
-    $tc = get_option('theme_compatibility_setting');
233
-    return $tc['geodir_location_switcher_menu_a_class_filter'];
232
+	$tc = get_option('theme_compatibility_setting');
233
+	return $tc['geodir_location_switcher_menu_a_class_filter'];
234 234
 }
235 235
 
236 236
 /**
@@ -243,8 +243,8 @@  discard block
 block discarded – undo
243 243
  */
244 244
 function geodir_location_switcher_menu_sub_ul_class_dynamic()
245 245
 {
246
-    $tc = get_option('theme_compatibility_setting');
247
-    return $tc['geodir_location_switcher_menu_sub_ul_class_filter'];
246
+	$tc = get_option('theme_compatibility_setting');
247
+	return $tc['geodir_location_switcher_menu_sub_ul_class_filter'];
248 248
 }
249 249
 
250 250
 /**
@@ -257,8 +257,8 @@  discard block
 block discarded – undo
257 257
  */
258 258
 function geodir_location_switcher_menu_sub_li_class_dynamic()
259 259
 {
260
-    $tc = get_option('theme_compatibility_setting');
261
-    return $tc['geodir_location_switcher_menu_sub_li_class_filter'];
260
+	$tc = get_option('theme_compatibility_setting');
261
+	return $tc['geodir_location_switcher_menu_sub_li_class_filter'];
262 262
 }
263 263
 
264 264
 
@@ -275,106 +275,106 @@  discard block
 block discarded – undo
275 275
 function geodir_content_actions_dynamic()
276 276
 {
277 277
 
278
-    $tc = get_option('theme_compatibility_setting');
279
-    if (empty($tc)) {
280
-        return;
281
-    }
278
+	$tc = get_option('theme_compatibility_setting');
279
+	if (empty($tc)) {
280
+		return;
281
+	}
282 282
 
283
-    //php
284
-    if (!empty($tc['geodir_theme_compat_code'])) {
285
-        include_once('geodirectory-functions/compatibility/' . $tc['geodir_theme_compat_code'] . '.php');
286
-    }
283
+	//php
284
+	if (!empty($tc['geodir_theme_compat_code'])) {
285
+		include_once('geodirectory-functions/compatibility/' . $tc['geodir_theme_compat_code'] . '.php');
286
+	}
287 287
 
288
-    //geodir_full_page_class
289
-    if (!empty($tc['geodir_full_page_class_filter'])) {
290
-        add_filter('geodir_full_page_class', 'geodir_full_page_class_dynamic', 10);
291
-    }
288
+	//geodir_full_page_class
289
+	if (!empty($tc['geodir_full_page_class_filter'])) {
290
+		add_filter('geodir_full_page_class', 'geodir_full_page_class_dynamic', 10);
291
+	}
292 292
 
293
-    //widget before filter
294
-    if (!empty($tc['geodir_before_widget_filter'])) {
295
-        add_filter('geodir_before_widget', 'geodir_before_widget_dynamic', 10);
296
-    }
293
+	//widget before filter
294
+	if (!empty($tc['geodir_before_widget_filter'])) {
295
+		add_filter('geodir_before_widget', 'geodir_before_widget_dynamic', 10);
296
+	}
297 297
 
298
-    //widget after filter
299
-    if (!empty($tc['geodir_after_widget_filter'])) {
300
-        add_filter('geodir_after_widget', 'geodir_after_widget_dynamic', 10);
301
-    }
298
+	//widget after filter
299
+	if (!empty($tc['geodir_after_widget_filter'])) {
300
+		add_filter('geodir_after_widget', 'geodir_after_widget_dynamic', 10);
301
+	}
302 302
 
303
-    //widget before title filter
304
-    if (!empty($tc['geodir_before_title_filter'])) {
305
-        add_filter('geodir_before_title', 'geodir_before_title_dynamic', 10);
306
-    }
303
+	//widget before title filter
304
+	if (!empty($tc['geodir_before_title_filter'])) {
305
+		add_filter('geodir_before_title', 'geodir_before_title_dynamic', 10);
306
+	}
307 307
 
308
-    //widget before title filter
309
-    if (!empty($tc['geodir_after_title_filter'])) {
310
-        add_filter('geodir_after_title', 'geodir_after_title_dynamic', 10);
311
-    }
308
+	//widget before title filter
309
+	if (!empty($tc['geodir_after_title_filter'])) {
310
+		add_filter('geodir_after_title', 'geodir_after_title_dynamic', 10);
311
+	}
312 312
 
313
-    //menu li class
314
-    if (!empty($tc['geodir_menu_li_class_filter'])) {
315
-        add_filter('geodir_menu_li_class', 'geodir_menu_li_class_dynamic', 10);
316
-    }
313
+	//menu li class
314
+	if (!empty($tc['geodir_menu_li_class_filter'])) {
315
+		add_filter('geodir_menu_li_class', 'geodir_menu_li_class_dynamic', 10);
316
+	}
317 317
 
318
-    //menu ul class
319
-    if (!empty($tc['geodir_sub_menu_ul_class_filter'])) {
320
-        add_filter('geodir_sub_menu_ul_class', 'geodir_sub_menu_ul_class_dynamic', 10);
321
-    }
318
+	//menu ul class
319
+	if (!empty($tc['geodir_sub_menu_ul_class_filter'])) {
320
+		add_filter('geodir_sub_menu_ul_class', 'geodir_sub_menu_ul_class_dynamic', 10);
321
+	}
322 322
 
323
-    //menu sub li class
324
-    if (!empty($tc['geodir_sub_menu_li_class_filter'])) {
325
-        add_filter('geodir_sub_menu_li_class', 'geodir_sub_menu_li_class_dynamic', 10);
326
-    }
323
+	//menu sub li class
324
+	if (!empty($tc['geodir_sub_menu_li_class_filter'])) {
325
+		add_filter('geodir_sub_menu_li_class', 'geodir_sub_menu_li_class_dynamic', 10);
326
+	}
327 327
 
328
-    //menu a class
329
-    if (!empty($tc['geodir_menu_a_class_filter'])) {
330
-        add_filter('geodir_menu_a_class', 'geodir_menu_a_class_dynamic', 10);
331
-    }
328
+	//menu a class
329
+	if (!empty($tc['geodir_menu_a_class_filter'])) {
330
+		add_filter('geodir_menu_a_class', 'geodir_menu_a_class_dynamic', 10);
331
+	}
332 332
 
333
-    //menu sub a class
334
-    if (!empty($tc['geodir_sub_menu_a_class_filter'])) {
335
-        add_filter('geodir_sub_menu_a_class', 'geodir_sub_menu_a_class_dynamic', 10);
336
-    }
333
+	//menu sub a class
334
+	if (!empty($tc['geodir_sub_menu_a_class_filter'])) {
335
+		add_filter('geodir_sub_menu_a_class', 'geodir_sub_menu_a_class_dynamic', 10);
336
+	}
337 337
 
338
-    //location menu li class
339
-    if (!empty($tc['geodir_location_switcher_menu_li_class_filter'])) {
340
-        add_filter('geodir_location_switcher_menu_li_class', 'geodir_location_switcher_menu_li_class_dynamic', 10);
341
-    }
338
+	//location menu li class
339
+	if (!empty($tc['geodir_location_switcher_menu_li_class_filter'])) {
340
+		add_filter('geodir_location_switcher_menu_li_class', 'geodir_location_switcher_menu_li_class_dynamic', 10);
341
+	}
342 342
 
343
-    //location menu sub ul class
344
-    if (!empty($tc['geodir_location_switcher_menu_sub_ul_class_filter'])) {
345
-        add_filter('geodir_location_switcher_menu_sub_ul_class', 'geodir_location_switcher_menu_sub_ul_class_dynamic', 10);
346
-    }
343
+	//location menu sub ul class
344
+	if (!empty($tc['geodir_location_switcher_menu_sub_ul_class_filter'])) {
345
+		add_filter('geodir_location_switcher_menu_sub_ul_class', 'geodir_location_switcher_menu_sub_ul_class_dynamic', 10);
346
+	}
347 347
 
348
-    //location menu sub li class
349
-    if (!empty($tc['geodir_location_switcher_menu_sub_li_class_filter'])) {
350
-        add_filter('geodir_location_switcher_menu_sub_li_class', 'geodir_location_switcher_menu_sub_li_class_dynamic', 10);
351
-    }
348
+	//location menu sub li class
349
+	if (!empty($tc['geodir_location_switcher_menu_sub_li_class_filter'])) {
350
+		add_filter('geodir_location_switcher_menu_sub_li_class', 'geodir_location_switcher_menu_sub_li_class_dynamic', 10);
351
+	}
352 352
 
353
-    //location menu a class
354
-    if (!empty($tc['geodir_location_switcher_menu_a_class_filter'])) {
355
-        add_filter('geodir_location_switcher_menu_a_class', 'geodir_location_switcher_menu_a_class_dynamic', 10);
356
-    }
353
+	//location menu a class
354
+	if (!empty($tc['geodir_location_switcher_menu_a_class_filter'])) {
355
+		add_filter('geodir_location_switcher_menu_a_class', 'geodir_location_switcher_menu_a_class_dynamic', 10);
356
+	}
357 357
 
358
-    // compat styles
359
-    if (!empty($tc['geodir_theme_compat_css'])) {
360
-        add_action('wp_head', 'gd_compat_styles');
361
-    }
358
+	// compat styles
359
+	if (!empty($tc['geodir_theme_compat_css'])) {
360
+		add_action('wp_head', 'gd_compat_styles');
361
+	}
362 362
 
363
-    // compat js
364
-    if (!empty($tc['geodir_theme_compat_js'])) {
365
-        add_action('wp_footer', 'gd_compat_script');
366
-    }
363
+	// compat js
364
+	if (!empty($tc['geodir_theme_compat_js'])) {
365
+		add_action('wp_footer', 'gd_compat_script');
366
+	}
367 367
 
368 368
 
369
-    // geodir_top_content_add
370
-    if (!empty($tc['geodir_top_content_add'])) {
371
-        add_action('geodir_top_content', 'geodir_top_content_add_dynamic', 10, 1);
372
-    }
369
+	// geodir_top_content_add
370
+	if (!empty($tc['geodir_top_content_add'])) {
371
+		add_action('geodir_top_content', 'geodir_top_content_add_dynamic', 10, 1);
372
+	}
373 373
 
374
-    // geodir_before_main_content_add
375
-    if (!empty($tc['geodir_before_main_content_add'])) {
376
-        add_action('geodir_before_main_content', 'geodir_before_main_content_add_dynamic', 10, 1);
377
-    }
374
+	// geodir_before_main_content_add
375
+	if (!empty($tc['geodir_before_main_content_add'])) {
376
+		add_action('geodir_before_main_content', 'geodir_before_main_content_add_dynamic', 10, 1);
377
+	}
378 378
 
379 379
 
380 380
 }
@@ -397,23 +397,23 @@  discard block
 block discarded – undo
397 397
  */
398 398
 function geodir_action_wrapper_open($type = '', $id = '', $class = '')
399 399
 {
400
-    $tc = get_option('theme_compatibility_setting');
401
-    if (!empty($tc['geodir_wrapper_open_replace'])) {
402
-        $text = $tc['geodir_wrapper_open_replace'];
403
-    } else {
404
-        $text = '<div id="[id]" class="[class]">';
405
-    }
400
+	$tc = get_option('theme_compatibility_setting');
401
+	if (!empty($tc['geodir_wrapper_open_replace'])) {
402
+		$text = $tc['geodir_wrapper_open_replace'];
403
+	} else {
404
+		$text = '<div id="[id]" class="[class]">';
405
+	}
406 406
 
407
-    if (!empty($tc['geodir_wrapper_open_id'])) {
408
-        $id = $tc['geodir_wrapper_open_id'];
409
-    }
410
-    if (!empty($tc['geodir_wrapper_open_class'])) {
411
-        $class = $tc['geodir_wrapper_open_class'];
412
-    }
407
+	if (!empty($tc['geodir_wrapper_open_id'])) {
408
+		$id = $tc['geodir_wrapper_open_id'];
409
+	}
410
+	if (!empty($tc['geodir_wrapper_open_class'])) {
411
+		$class = $tc['geodir_wrapper_open_class'];
412
+	}
413 413
 
414
-    $text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
414
+	$text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
415 415
 
416
-    echo $text;
416
+	echo $text;
417 417
 }
418 418
 
419 419
 // action for adding the wrapperdiv closing tag
@@ -428,14 +428,14 @@  discard block
 block discarded – undo
428 428
  */
429 429
 function geodir_action_wrapper_close($type = '')
430 430
 {
431
-    $tc = get_option('theme_compatibility_setting');
432
-    if (!empty($tc['geodir_wrapper_close_replace'])) {
433
-        $text = $tc['geodir_wrapper_close_replace'];
434
-    } else {
435
-        $text = '</div><!-- wrapper ends here-->';
436
-    }
431
+	$tc = get_option('theme_compatibility_setting');
432
+	if (!empty($tc['geodir_wrapper_close_replace'])) {
433
+		$text = $tc['geodir_wrapper_close_replace'];
434
+	} else {
435
+		$text = '</div><!-- wrapper ends here-->';
436
+	}
437 437
 
438
-    echo $text;
438
+	echo $text;
439 439
 }
440 440
 
441 441
 // action for adding the content div opening tag
@@ -451,35 +451,35 @@  discard block
 block discarded – undo
451 451
  */
452 452
 function geodir_action_wrapper_content_open($type = '', $id = '', $class = '')
453 453
 {
454
-    if ($type == 'home-page' && $width = get_option('geodir_width_home_contant_section')) {
455
-        $width_css = 'style="width:' . $width . '%;"';
456
-    } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_contant_section')) {
457
-        $width_css = 'style="width:' . $width . '%;"';
458
-    } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_contant_section')) {
459
-        $width_css = 'style="width:' . $width . '%;"';
460
-    } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_contant_section')) {
461
-        $width_css = 'style="width:' . $width . '%;"';
462
-    } else {
463
-        $width_css = '';
464
-    }
465
-
466
-    $tc = get_option('theme_compatibility_setting');
467
-    if (!empty($tc['geodir_wrapper_content_open_replace'])) {
468
-        $text = $tc['geodir_wrapper_content_open_replace'];
469
-    } else {
470
-        $text = '<div id="[id]" class="[class]" role="main" [width_css]>';
471
-    }
472
-
473
-    if (!empty($tc['geodir_wrapper_content_open_id'])) {
474
-        $id = $tc['geodir_wrapper_content_open_id'];
475
-    }
476
-    if (!empty($tc['geodir_wrapper_content_open_class'])) {
477
-        $class = $tc['geodir_wrapper_content_open_class'];
478
-    }
479
-
480
-    $text = str_replace(array("[id]", "[class]", "[width_css]"), array($id, $class, $width_css), $text);
481
-
482
-    echo $text;
454
+	if ($type == 'home-page' && $width = get_option('geodir_width_home_contant_section')) {
455
+		$width_css = 'style="width:' . $width . '%;"';
456
+	} elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_contant_section')) {
457
+		$width_css = 'style="width:' . $width . '%;"';
458
+	} elseif ($type == 'search-page' && $width = get_option('geodir_width_search_contant_section')) {
459
+		$width_css = 'style="width:' . $width . '%;"';
460
+	} elseif ($type == 'author-page' && $width = get_option('geodir_width_author_contant_section')) {
461
+		$width_css = 'style="width:' . $width . '%;"';
462
+	} else {
463
+		$width_css = '';
464
+	}
465
+
466
+	$tc = get_option('theme_compatibility_setting');
467
+	if (!empty($tc['geodir_wrapper_content_open_replace'])) {
468
+		$text = $tc['geodir_wrapper_content_open_replace'];
469
+	} else {
470
+		$text = '<div id="[id]" class="[class]" role="main" [width_css]>';
471
+	}
472
+
473
+	if (!empty($tc['geodir_wrapper_content_open_id'])) {
474
+		$id = $tc['geodir_wrapper_content_open_id'];
475
+	}
476
+	if (!empty($tc['geodir_wrapper_content_open_class'])) {
477
+		$class = $tc['geodir_wrapper_content_open_class'];
478
+	}
479
+
480
+	$text = str_replace(array("[id]", "[class]", "[width_css]"), array($id, $class, $width_css), $text);
481
+
482
+	echo $text;
483 483
 }
484 484
 
485 485
 // action for adding the primary div closing tag
@@ -493,13 +493,13 @@  discard block
 block discarded – undo
493 493
  */
494 494
 function geodir_action_wrapper_content_close($type = '')
495 495
 {
496
-    $tc = get_option('theme_compatibility_setting');
497
-    if (!empty($tc['geodir_wrapper_content_close_replace'])) {
498
-        $text = $tc['geodir_wrapper_content_close_replace'];
499
-    } else {
500
-        $text = '</div><!-- content ends here-->';
501
-    }
502
-    echo $text;
496
+	$tc = get_option('theme_compatibility_setting');
497
+	if (!empty($tc['geodir_wrapper_content_close_replace'])) {
498
+		$text = $tc['geodir_wrapper_content_close_replace'];
499
+	} else {
500
+		$text = '</div><!-- content ends here-->';
501
+	}
502
+	echo $text;
503 503
 }
504 504
 
505 505
 // action for adding the <article> opening tag
@@ -517,24 +517,24 @@  discard block
 block discarded – undo
517 517
  */
518 518
 function geodir_action_article_open($type = '', $id = '', $class = '', $itemtype = '')
519 519
 {
520
-    $class = implode(" ", $class);
521
-    $tc = get_option('theme_compatibility_setting');
522
-    if (!empty($tc['geodir_article_open_replace'])) {
523
-        $text = $tc['geodir_article_open_replace'];
524
-    } else {
525
-        $text = '<article  id="[id]" class="[class]" >';
526
-    }
520
+	$class = implode(" ", $class);
521
+	$tc = get_option('theme_compatibility_setting');
522
+	if (!empty($tc['geodir_article_open_replace'])) {
523
+		$text = $tc['geodir_article_open_replace'];
524
+	} else {
525
+		$text = '<article  id="[id]" class="[class]" >';
526
+	}
527 527
 
528
-    if (!empty($tc['geodir_article_open_id'])) {
529
-        $id = $tc['geodir_article_open_id'];
530
-    }
531
-    if (!empty($tc['geodir_article_open_class'])) {
532
-        $class = $tc['geodir_article_open_class'];
533
-    }
528
+	if (!empty($tc['geodir_article_open_id'])) {
529
+		$id = $tc['geodir_article_open_id'];
530
+	}
531
+	if (!empty($tc['geodir_article_open_class'])) {
532
+		$class = $tc['geodir_article_open_class'];
533
+	}
534 534
 
535
-    $text = str_replace(array("[id]", "[class]", "[itemtype]"), array($id, $class, $itemtype), $text);
535
+	$text = str_replace(array("[id]", "[class]", "[itemtype]"), array($id, $class, $itemtype), $text);
536 536
 
537
-    echo $text;
537
+	echo $text;
538 538
 }
539 539
 
540 540
 // action for adding the primary div closing tag
@@ -548,13 +548,13 @@  discard block
 block discarded – undo
548 548
  */
549 549
 function geodir_action_article_close($type = '')
550 550
 {
551
-    $tc = get_option('theme_compatibility_setting');
552
-    if (!empty($tc['geodir_article_close_replace'])) {
553
-        $text = $tc['geodir_article_close_replace'];
554
-    } else {
555
-        $text = '</article><!-- article ends here-->';
556
-    }
557
-    echo $text;
551
+	$tc = get_option('theme_compatibility_setting');
552
+	if (!empty($tc['geodir_article_close_replace'])) {
553
+		$text = $tc['geodir_article_close_replace'];
554
+	} else {
555
+		$text = '</article><!-- article ends here-->';
556
+	}
557
+	echo $text;
558 558
 }
559 559
 
560 560
 // action for adding the sidebar opening tag
@@ -571,35 +571,35 @@  discard block
 block discarded – undo
571 571
  */
572 572
 function geodir_action_sidebar_right_open($type = '', $id = '', $class = '', $itemtype = '')
573 573
 {
574
-    if ($type == 'home-page' && $width = get_option('geodir_width_home_right_section')) {
575
-        $width_css = 'style="width:' . $width . '%;"';
576
-    } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_right_section')) {
577
-        $width_css = 'style="width:' . $width . '%;"';
578
-    } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_right_section')) {
579
-        $width_css = 'style="width:' . $width . '%;"';
580
-    } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_right_section')) {
581
-        $width_css = 'style="width:' . $width . '%;"';
582
-    } else {
583
-        $width_css = '';
584
-    }
585
-
586
-    $tc = get_option('theme_compatibility_setting');
587
-    if (!empty($tc['geodir_sidebar_right_open_replace'])) {
588
-        $text = $tc['geodir_sidebar_right_open_replace'];
589
-    } else {
590
-        $text = '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>';
591
-    }
592
-
593
-    if (!empty($tc['geodir_sidebar_right_open_id'])) {
594
-        $id = $tc['geodir_sidebar_right_open_id'];
595
-    }
596
-    if (!empty($tc['geodir_sidebar_right_open_class'])) {
597
-        $class = $tc['geodir_sidebar_right_open_class'];
598
-    }
599
-
600
-    $text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
601
-
602
-    echo $text;
574
+	if ($type == 'home-page' && $width = get_option('geodir_width_home_right_section')) {
575
+		$width_css = 'style="width:' . $width . '%;"';
576
+	} elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_right_section')) {
577
+		$width_css = 'style="width:' . $width . '%;"';
578
+	} elseif ($type == 'search-page' && $width = get_option('geodir_width_search_right_section')) {
579
+		$width_css = 'style="width:' . $width . '%;"';
580
+	} elseif ($type == 'author-page' && $width = get_option('geodir_width_author_right_section')) {
581
+		$width_css = 'style="width:' . $width . '%;"';
582
+	} else {
583
+		$width_css = '';
584
+	}
585
+
586
+	$tc = get_option('theme_compatibility_setting');
587
+	if (!empty($tc['geodir_sidebar_right_open_replace'])) {
588
+		$text = $tc['geodir_sidebar_right_open_replace'];
589
+	} else {
590
+		$text = '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>';
591
+	}
592
+
593
+	if (!empty($tc['geodir_sidebar_right_open_id'])) {
594
+		$id = $tc['geodir_sidebar_right_open_id'];
595
+	}
596
+	if (!empty($tc['geodir_sidebar_right_open_class'])) {
597
+		$class = $tc['geodir_sidebar_right_open_class'];
598
+	}
599
+
600
+	$text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
601
+
602
+	echo $text;
603 603
 }
604 604
 
605 605
 // action for adding the primary div closing tag
@@ -613,13 +613,13 @@  discard block
 block discarded – undo
613 613
  */
614 614
 function geodir_action_sidebar_right_close($type = '')
615 615
 {
616
-    $tc = get_option('theme_compatibility_setting');
617
-    if (!empty($tc['geodir_sidebar_right_close_replace'])) {
618
-        $text = $tc['geodir_sidebar_right_close_replace'];
619
-    } else {
620
-        $text = '</aside><!-- sidebar ends here-->';
621
-    }
622
-    echo $text;
616
+	$tc = get_option('theme_compatibility_setting');
617
+	if (!empty($tc['geodir_sidebar_right_close_replace'])) {
618
+		$text = $tc['geodir_sidebar_right_close_replace'];
619
+	} else {
620
+		$text = '</aside><!-- sidebar ends here-->';
621
+	}
622
+	echo $text;
623 623
 }
624 624
 
625 625
 
@@ -640,121 +640,121 @@  discard block
 block discarded – undo
640 640
  */
641 641
 function geodir_action_geodir_set_preview_post()
642 642
 {
643
-    global $post, $preview, $gd_session;
644
-    $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
645
-    if (!$preview || $is_backend_preview) {
646
-        return;
647
-    }// bail if not previewing
648
-
649
-    $listing_type = isset($_REQUEST['listing_type']) ? sanitize_text_field($_REQUEST['listing_type']) : '';
650
-
651
-    $fields_info = geodir_get_custom_fields_type($listing_type);
652
-
653
-    foreach ($_REQUEST as $pkey => $pval) {
654
-        if ($pkey == 'geodir_video') {
655
-            $tags = '<iframe>';
656
-        } else if ($pkey == 'post_desc') {
657
-            $tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>';
658
-        } else if (is_array($fields_info) && isset($fields_info[$pkey]) && ($fields_info[$pkey] == 'textarea' || $fields_info[$pkey] == 'html')) {
659
-            $tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>';
660
-        } else if (is_array($_REQUEST[$pkey])) {
661
-            $tags = 'skip_field';
662
-        } else {
663
-            $tags = '';
664
-        }
665
-        /**
666
-         * Allows the filtering of the allowed HTML tags per field when submitting from frontend add listing page.
667
-         *
668
-         * @since 1.0.0
669
-         * @param string $tags The allowed HTML tags for the field. Can be many things, for example the description allows these tags '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>'.
670
-         * @param string|array $pkey The field id/name. If array then value is set as "skip_field".
671
-         */
672
-        $tags = apply_filters('geodir_save_post_key', $tags, $pkey);
673
-
674
-        if ($tags != 'skip_field') {
675
-            $_REQUEST[$pkey] = strip_tags($_REQUEST[$pkey], $tags);
676
-        }
677
-    }
678
-
679
-    $post = (object)$_REQUEST;
680
-
681
-
682
-    if (isset($post->video)) {
683
-        $post->video = stripslashes($post->video);
684
-    }
685
-
686
-    if (isset($post->Video2)) {
687
-        $post->Video2 = stripslashes($post->Video2);
688
-    }
689
-
690
-    $post_type = $post->listing_type;
691
-    $post_type_info = get_post_type_object($post_type);
692
-
693
-    $listing_label = $post_type_info->labels->singular_name;
694
-
695
-    $term_icon = '';
696
-
697
-    if (!empty($post->post_category)) {
698
-        foreach ($post->post_category as $post_taxonomy => $post_term) {
699
-
700
-            if ($post_term != '' && !is_array($post_term)) {
701
-                $post_term = explode(',', trim($post_term, ','));
702
-            }
643
+	global $post, $preview, $gd_session;
644
+	$is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
645
+	if (!$preview || $is_backend_preview) {
646
+		return;
647
+	}// bail if not previewing
648
+
649
+	$listing_type = isset($_REQUEST['listing_type']) ? sanitize_text_field($_REQUEST['listing_type']) : '';
650
+
651
+	$fields_info = geodir_get_custom_fields_type($listing_type);
652
+
653
+	foreach ($_REQUEST as $pkey => $pval) {
654
+		if ($pkey == 'geodir_video') {
655
+			$tags = '<iframe>';
656
+		} else if ($pkey == 'post_desc') {
657
+			$tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>';
658
+		} else if (is_array($fields_info) && isset($fields_info[$pkey]) && ($fields_info[$pkey] == 'textarea' || $fields_info[$pkey] == 'html')) {
659
+			$tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>';
660
+		} else if (is_array($_REQUEST[$pkey])) {
661
+			$tags = 'skip_field';
662
+		} else {
663
+			$tags = '';
664
+		}
665
+		/**
666
+		 * Allows the filtering of the allowed HTML tags per field when submitting from frontend add listing page.
667
+		 *
668
+		 * @since 1.0.0
669
+		 * @param string $tags The allowed HTML tags for the field. Can be many things, for example the description allows these tags '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>'.
670
+		 * @param string|array $pkey The field id/name. If array then value is set as "skip_field".
671
+		 */
672
+		$tags = apply_filters('geodir_save_post_key', $tags, $pkey);
673
+
674
+		if ($tags != 'skip_field') {
675
+			$_REQUEST[$pkey] = strip_tags($_REQUEST[$pkey], $tags);
676
+		}
677
+	}
678
+
679
+	$post = (object)$_REQUEST;
680
+
681
+
682
+	if (isset($post->video)) {
683
+		$post->video = stripslashes($post->video);
684
+	}
685
+
686
+	if (isset($post->Video2)) {
687
+		$post->Video2 = stripslashes($post->Video2);
688
+	}
689
+
690
+	$post_type = $post->listing_type;
691
+	$post_type_info = get_post_type_object($post_type);
692
+
693
+	$listing_label = $post_type_info->labels->singular_name;
694
+
695
+	$term_icon = '';
696
+
697
+	if (!empty($post->post_category)) {
698
+		foreach ($post->post_category as $post_taxonomy => $post_term) {
699
+
700
+			if ($post_term != '' && !is_array($post_term)) {
701
+				$post_term = explode(',', trim($post_term, ','));
702
+			}
703 703
 
704
-            if (is_array($post_term)) {
705
-                $post_term = array_unique($post_term);
706
-            }
704
+			if (is_array($post_term)) {
705
+				$post_term = array_unique($post_term);
706
+			}
707 707
 
708
-            if (!empty($post_term)) {
709
-                foreach ($post_term as $cat_id) {
710
-                    $cat_id = trim($cat_id);
711
-
712
-                    if ($cat_id != '') {
713
-                        $term_icon = get_option('geodir_default_marker_icon');
714
-
715
-                        if (isset($post->post_default_category) && $post->post_default_category == $cat_id) {
716
-                            if ($term_icon_url = get_tax_meta($cat_id, 'ct_cat_icon', false, $post_type)) {
717
-                                if (isset($term_icon_url['src']) && $term_icon_url['src'] != '')
718
-                                    $term_icon = $term_icon_url['src'];
719
-                                break;
720
-                            }
721
-                        }
722
-                    }
723
-                }
724
-            }
725
-        }
726
-    }
708
+			if (!empty($post_term)) {
709
+				foreach ($post_term as $cat_id) {
710
+					$cat_id = trim($cat_id);
711
+
712
+					if ($cat_id != '') {
713
+						$term_icon = get_option('geodir_default_marker_icon');
714
+
715
+						if (isset($post->post_default_category) && $post->post_default_category == $cat_id) {
716
+							if ($term_icon_url = get_tax_meta($cat_id, 'ct_cat_icon', false, $post_type)) {
717
+								if (isset($term_icon_url['src']) && $term_icon_url['src'] != '')
718
+									$term_icon = $term_icon_url['src'];
719
+								break;
720
+							}
721
+						}
722
+					}
723
+				}
724
+			}
725
+		}
726
+	}
727 727
 
728
-    $post_latitude = isset($post->post_latitude) ? $post->post_latitude : '';
729
-    $post_longitude = isset($post->post_longitude) ? $post->post_longitude : '';
728
+	$post_latitude = isset($post->post_latitude) ? $post->post_latitude : '';
729
+	$post_longitude = isset($post->post_longitude) ? $post->post_longitude : '';
730 730
 
731
-    $srcharr = array("'", "/", "-", '"', '\\');
732
-    $replarr = array("&prime;", "&frasl;", "&ndash;", "&ldquo;", '');
731
+	$srcharr = array("'", "/", "-", '"', '\\');
732
+	$replarr = array("&prime;", "&frasl;", "&ndash;", "&ldquo;", '');
733 733
 
734
-    $json_title = str_replace($srcharr, $replarr, $post->post_title);
734
+	$json_title = str_replace($srcharr, $replarr, $post->post_title);
735 735
 
736
-    $json = '{';
737
-    $json .= '"post_preview": "1",';
738
-    $json .= '"t": "' . $json_title . '",';
739
-    $json .= '"lt": "' . $post_latitude . '",';
740
-    $json .= '"ln": "' . $post_longitude . '",';
741
-    $json .= '"i":"' . $term_icon . '"';
742
-    $json .= '}';
736
+	$json = '{';
737
+	$json .= '"post_preview": "1",';
738
+	$json .= '"t": "' . $json_title . '",';
739
+	$json .= '"lt": "' . $post_latitude . '",';
740
+	$json .= '"ln": "' . $post_longitude . '",';
741
+	$json .= '"i":"' . $term_icon . '"';
742
+	$json .= '}';
743 743
 
744
-    $post->marker_json = $json;
744
+	$post->marker_json = $json;
745 745
 
746
-    $gd_session->set('listing', $_REQUEST);
746
+	$gd_session->set('listing', $_REQUEST);
747 747
 
748
-    // we need to define a few things to trick the setup_postdata
749
-    if (!isset($post->ID)) {
750
-        $post->ID = '';
751
-        $post->post_author = '';
752
-        $post->post_date = '';
753
-        $post->post_content = '';
754
-        $post->default_category = '';
755
-        $post->post_type = '';
756
-    }
757
-    setup_postdata($post);
748
+	// we need to define a few things to trick the setup_postdata
749
+	if (!isset($post->ID)) {
750
+		$post->ID = '';
751
+		$post->post_author = '';
752
+		$post->post_date = '';
753
+		$post->post_content = '';
754
+		$post->default_category = '';
755
+		$post->post_type = '';
756
+	}
757
+	setup_postdata($post);
758 758
 }
759 759
 
760 760
 /**
@@ -766,15 +766,15 @@  discard block
 block discarded – undo
766 766
  */
767 767
 function geodir_action_geodir_preview_code()
768 768
 {
769
-    global $preview;
769
+	global $preview;
770 770
 
771
-    $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
771
+	$is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
772 772
 
773
-    if (!$preview || $is_backend_preview) {
774
-        return;
775
-    }// bail if not previewing
773
+	if (!$preview || $is_backend_preview) {
774
+		return;
775
+	}// bail if not previewing
776 776
 
777
-    geodir_get_template_part('preview', 'buttons');
777
+	geodir_get_template_part('preview', 'buttons');
778 778
 }
779 779
 
780 780
 // action for adding the details page top widget area
@@ -790,20 +790,20 @@  discard block
 block discarded – undo
790 790
  */
791 791
 function geodir_action_geodir_sidebar_detail_top($class = '')
792 792
 {
793
-    if (get_option('geodir_show_detail_top_section')) { ?>
793
+	if (get_option('geodir_show_detail_top_section')) { ?>
794 794
         <div
795 795
             class="<?php
796
-            /**
797
-             * Filter the div class for the wrapper of the full width widget areas.
798
-             *
799
-             * Allows you to filter the class of the div for the HTML Container wrapper for the full width widget areas referred to as "Top Section" or "Bottom Section" in the widget areas.
800
-             *
801
-             * @since 1.0.0
802
-             * @param string $class The class of the div.
803
-             * @param string $type The page type the widget area is being used on. Values can be 'geodir_detail_top', 'geodir_detail_bottom', 'geodir_listing_top', 'geodir_listing_bottom', 'Reg/Login Top Section',
804
-             *               'geodir_author_top','geodir_author_bottom', 'geodir_search_top', 'geodir_search_bottom', 'geodir_home_top' or 'geodir_home_bottom'.
805
-             */
806
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_top'); ?> <?php echo $class; ?>">
796
+			/**
797
+			 * Filter the div class for the wrapper of the full width widget areas.
798
+			 *
799
+			 * Allows you to filter the class of the div for the HTML Container wrapper for the full width widget areas referred to as "Top Section" or "Bottom Section" in the widget areas.
800
+			 *
801
+			 * @since 1.0.0
802
+			 * @param string $class The class of the div.
803
+			 * @param string $type The page type the widget area is being used on. Values can be 'geodir_detail_top', 'geodir_detail_bottom', 'geodir_listing_top', 'geodir_listing_bottom', 'Reg/Login Top Section',
804
+			 *               'geodir_author_top','geodir_author_bottom', 'geodir_search_top', 'geodir_search_bottom', 'geodir_home_top' or 'geodir_home_bottom'.
805
+			 */
806
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_top'); ?> <?php echo $class; ?>">
807 807
             <?php dynamic_sidebar('geodir_detail_top'); ?>
808 808
         </div>
809 809
     <?php }
@@ -827,11 +827,11 @@  discard block
 block discarded – undo
827 827
  */
828 828
 function geodir_action_geodir_sidebar_detail_bottom_section($class = '')
829 829
 {
830
-    if (get_option('geodir_show_detail_bottom_section')) { ?>
830
+	if (get_option('geodir_show_detail_bottom_section')) { ?>
831 831
         <div
832 832
             class="<?php
833
-            /** This action is documented in geodirectory_template_actions.php */
834
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_bottom'); ?> <?php echo $class; ?>">
833
+			/** This action is documented in geodirectory_template_actions.php */
834
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_bottom'); ?> <?php echo $class; ?>">
835 835
             <?php dynamic_sidebar('geodir_detail_bottom'); ?>
836 836
         </div><!-- clearfix ends here-->
837 837
     <?php }
@@ -845,7 +845,7 @@  discard block
 block discarded – undo
845 845
  */
846 846
 function geodir_details_sidebar_widget_area()
847 847
 {
848
-    dynamic_sidebar('geodir_detail_sidebar');
848
+	dynamic_sidebar('geodir_detail_sidebar');
849 849
 }
850 850
 
851 851
 /**
@@ -856,12 +856,12 @@  discard block
 block discarded – undo
856 856
  */
857 857
 function geodir_details_sidebar_place_details()
858 858
 {
859
-    /**
860
-     * Used to add items to the details page sidebar.
861
-     *
862
-     * @since 1.0.0
863
-     */
864
-    do_action('geodir_detail_page_sidebar');
859
+	/**
860
+	 * Used to add items to the details page sidebar.
861
+	 *
862
+	 * @since 1.0.0
863
+	 */
864
+	do_action('geodir_detail_page_sidebar');
865 865
 }
866 866
 
867 867
 add_action('geodir_detail_sidebar_inside', 'geodir_details_sidebar_place_details', 10);
@@ -876,68 +876,68 @@  discard block
 block discarded – undo
876 876
  */
877 877
 function geodir_action_details_sidebar()
878 878
 {
879
-    // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
880
-    if (get_option('geodir_detail_sidebar_left_section')) {
881
-        /**
882
-         * Called before the details page left sidebar is opened.
883
-         *
884
-         * This is used to add opening wrapper HTML to the details page left sidebar.
885
-         *
886
-         * @since 1.0.0
887
-         * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
888
-         * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-left'.
889
-         * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-left geodir-details-sidebar-left'.
890
-         * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'.
891
-         */
892
-        do_action('geodir_sidebar_left_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-left geodir-details-sidebar-left', 'https://schema.org/WPSideBar');
893
-        ?>
879
+	// this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
880
+	if (get_option('geodir_detail_sidebar_left_section')) {
881
+		/**
882
+		 * Called before the details page left sidebar is opened.
883
+		 *
884
+		 * This is used to add opening wrapper HTML to the details page left sidebar.
885
+		 *
886
+		 * @since 1.0.0
887
+		 * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
888
+		 * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-left'.
889
+		 * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-left geodir-details-sidebar-left'.
890
+		 * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'.
891
+		 */
892
+		do_action('geodir_sidebar_left_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-left geodir-details-sidebar-left', 'https://schema.org/WPSideBar');
893
+		?>
894 894
         <div class="geodir-content-left geodir-sidebar-wrap"><?php
895
-        /**
896
-         * Called inside the HTML wrapper of the details sidebar for either the left and right sidebar.
897
-         *
898
-         * This is used to add all info to the details page sidebars.
899
-         *
900
-         * @since 1.0.0
901
-         */
902
-        do_action('geodir_detail_sidebar_inside');
903
-        ?></div><!-- end geodir-content-left --><?php
904
-        /**
905
-         * Called after the details page left sidebar.
906
-         *
907
-         * This is used to add closing wrapper HTML to the details page left sidebar.
908
-         *
909
-         * @since 1.0.0
910
-         * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
911
-         */
912
-        do_action('geodir_sidebar_left_close', 'details-page');
913
-    } else {
914
-        /**
915
-         * Called before the details page right sidebar is opened.
916
-         *
917
-         * This is used to add opening wrapper HTML to the details page right sidebar.
918
-         *
919
-         * @since 1.0.0
920
-         * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'add-listing-page', 'author-page', 'search-page' or 'home-page'.
921
-         * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-right'.
922
-         * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-right geodir-details-sidebar-right'.
923
-         * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'.
924
-         */
925
-        do_action('geodir_sidebar_right_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-right geodir-details-sidebar-right', 'http://schema.org/WPSideBar');
926
-        ?>
895
+		/**
896
+		 * Called inside the HTML wrapper of the details sidebar for either the left and right sidebar.
897
+		 *
898
+		 * This is used to add all info to the details page sidebars.
899
+		 *
900
+		 * @since 1.0.0
901
+		 */
902
+		do_action('geodir_detail_sidebar_inside');
903
+		?></div><!-- end geodir-content-left --><?php
904
+		/**
905
+		 * Called after the details page left sidebar.
906
+		 *
907
+		 * This is used to add closing wrapper HTML to the details page left sidebar.
908
+		 *
909
+		 * @since 1.0.0
910
+		 * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
911
+		 */
912
+		do_action('geodir_sidebar_left_close', 'details-page');
913
+	} else {
914
+		/**
915
+		 * Called before the details page right sidebar is opened.
916
+		 *
917
+		 * This is used to add opening wrapper HTML to the details page right sidebar.
918
+		 *
919
+		 * @since 1.0.0
920
+		 * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'add-listing-page', 'author-page', 'search-page' or 'home-page'.
921
+		 * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-right'.
922
+		 * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-right geodir-details-sidebar-right'.
923
+		 * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'.
924
+		 */
925
+		do_action('geodir_sidebar_right_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-right geodir-details-sidebar-right', 'http://schema.org/WPSideBar');
926
+		?>
927 927
         <div class="geodir-content-right geodir-sidebar-wrap"><?php
928
-        /** This action is documented in geodirectory_template_actions.php */
929
-        do_action('geodir_detail_sidebar_inside');
930
-        ?></div><!-- end geodir-content-right --><?php
931
-        /**
932
-         * Called after the details page right sidebar.
933
-         *
934
-         * This is used to add closing wrapper HTML to the details page right sidebar.
935
-         *
936
-         * @since 1.0.0
937
-         * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
938
-         */
939
-        do_action('geodir_sidebar_right_close', 'details-page');
940
-    }
928
+		/** This action is documented in geodirectory_template_actions.php */
929
+		do_action('geodir_detail_sidebar_inside');
930
+		?></div><!-- end geodir-content-right --><?php
931
+		/**
932
+		 * Called after the details page right sidebar.
933
+		 *
934
+		 * This is used to add closing wrapper HTML to the details page right sidebar.
935
+		 *
936
+		 * @since 1.0.0
937
+		 * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
938
+		 */
939
+		do_action('geodir_sidebar_right_close', 'details-page');
940
+	}
941 941
 }
942 942
 
943 943
 add_action('geodir_page_title', 'geodir_action_page_title', 10);
@@ -951,21 +951,21 @@  discard block
 block discarded – undo
951 951
  */
952 952
 function geodir_action_page_title()
953 953
 {
954
-    /**
955
-     * Filter the page title HTML h1 class.
956
-     *
957
-     * @since 1.0.0
958
-     * @param string $class The class to use. Default is 'entry-title fn'.
959
-     */
960
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
961
-    /**
962
-     * Filter the page title HTML header wrapper class.
963
-     *
964
-     * @since 1.0.0
965
-     * @param string $class The class to use. Default is 'entry-header'.
966
-     */
967
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
968
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . stripslashes(get_the_title()) . '</h1></header>';
954
+	/**
955
+	 * Filter the page title HTML h1 class.
956
+	 *
957
+	 * @since 1.0.0
958
+	 * @param string $class The class to use. Default is 'entry-title fn'.
959
+	 */
960
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
961
+	/**
962
+	 * Filter the page title HTML header wrapper class.
963
+	 *
964
+	 * @since 1.0.0
965
+	 * @param string $class The class to use. Default is 'entry-header'.
966
+	 */
967
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
968
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . stripslashes(get_the_title()) . '</h1></header>';
969 969
 }
970 970
 
971 971
 
@@ -982,87 +982,87 @@  discard block
 block discarded – undo
982 982
  */
983 983
 function geodir_action_details_slider()
984 984
 {
985
-    global $preview, $post;
985
+	global $preview, $post;
986 986
 
987
-    $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // preview from backend
987
+	$is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // preview from backend
988 988
 
989
-    if ($is_backend_preview && !empty($post) && !empty($post->ID) && !isset($post->post_images)) {
990
-        $preview_get_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
989
+	if ($is_backend_preview && !empty($post) && !empty($post->ID) && !isset($post->post_images)) {
990
+		$preview_get_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
991 991
 
992
-        $preview_post_images = array();
993
-        if ($preview_get_images) {
994
-            foreach ($preview_get_images as $row) {
995
-                $preview_post_images[] = $row->src;
996
-            }
997
-        }
998
-        if (!empty($preview_post_images)) {
999
-            $post->post_images = implode(',', $preview_post_images);
1000
-        }
1001
-    }
1002
-
1003
-    if ($preview) {
1004
-        $post_images = array();
1005
-        if (isset($post->post_images) && !empty($post->post_images)) {
1006
-            $post->post_images = trim($post->post_images, ",");
1007
-            $post_images = explode(",", $post->post_images);
1008
-        }
1009
-
1010
-        $main_slides = '';
1011
-        $nav_slides = '';
1012
-        $slides = 0;
1013
-
1014
-        if (!empty($post_images)) {
1015
-            foreach ($post_images as $image) {
1016
-                if (!empty($image)) {
1017
-                    $sizes = getimagesize(trim($image));
1018
-                    $width = !empty($sizes) && isset($sizes[0]) ? $sizes[0] : 0;
1019
-                    $height = !empty($sizes) && isset($sizes[1]) ? $sizes[1] : 0;
1020
-
1021
-                    if ($image && $width && $height) {
1022
-                        $image = (object)array('src' => $image, 'width' => $width, 'height' => $height);
1023
-                    }
1024
-
1025
-                    if (isset($image->src)) {
1026
-                        if ($image->height >= 400) {
1027
-                            $spacer_height = 0;
1028
-                        } else {
1029
-                            $spacer_height = ((400 - $image->height) / 2);
1030
-                        }
1031
-
1032
-                        $image_title = isset($image->title) ? $image->title : '';
1033
-
1034
-                        $main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />';
1035
-                        $main_slides .= '<img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:400px;margin:0 auto;" /></li>';
1036
-                        $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:48px;margin:0 auto;" /></li>';
1037
-                        $slides++;
1038
-                    }
1039
-                }
1040
-            }// endfore
1041
-        } //end if
1042
-    } else {
1043
-        $main_slides = '';
1044
-        $nav_slides = '';
1045
-        $post_images = geodir_get_images($post->ID, 'thumbnail', false); // Hide default image on listing preview/detail page.
1046
-        $slides = 0;
1047
-
1048
-        if (!empty($post_images)) {
1049
-            foreach ($post_images as $image) {
1050
-                if ($image->height >= 400) {
1051
-                    $spacer_height = 0;
1052
-                } else {
1053
-                    $spacer_height = ((400 - $image->height) / 2);
1054
-                }
1055
-                $caption = '';//(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : '';
1056
-                $main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />';
1057
-                $main_slides .= '<img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>';
1058
-                $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:48px;margin:0 auto;" /></li>';
1059
-                $slides++;
1060
-            }
1061
-        }// endfore
1062
-    }
992
+		$preview_post_images = array();
993
+		if ($preview_get_images) {
994
+			foreach ($preview_get_images as $row) {
995
+				$preview_post_images[] = $row->src;
996
+			}
997
+		}
998
+		if (!empty($preview_post_images)) {
999
+			$post->post_images = implode(',', $preview_post_images);
1000
+		}
1001
+	}
1002
+
1003
+	if ($preview) {
1004
+		$post_images = array();
1005
+		if (isset($post->post_images) && !empty($post->post_images)) {
1006
+			$post->post_images = trim($post->post_images, ",");
1007
+			$post_images = explode(",", $post->post_images);
1008
+		}
1009
+
1010
+		$main_slides = '';
1011
+		$nav_slides = '';
1012
+		$slides = 0;
1013
+
1014
+		if (!empty($post_images)) {
1015
+			foreach ($post_images as $image) {
1016
+				if (!empty($image)) {
1017
+					$sizes = getimagesize(trim($image));
1018
+					$width = !empty($sizes) && isset($sizes[0]) ? $sizes[0] : 0;
1019
+					$height = !empty($sizes) && isset($sizes[1]) ? $sizes[1] : 0;
1020
+
1021
+					if ($image && $width && $height) {
1022
+						$image = (object)array('src' => $image, 'width' => $width, 'height' => $height);
1023
+					}
1024
+
1025
+					if (isset($image->src)) {
1026
+						if ($image->height >= 400) {
1027
+							$spacer_height = 0;
1028
+						} else {
1029
+							$spacer_height = ((400 - $image->height) / 2);
1030
+						}
1031
+
1032
+						$image_title = isset($image->title) ? $image->title : '';
1033
+
1034
+						$main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />';
1035
+						$main_slides .= '<img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:400px;margin:0 auto;" /></li>';
1036
+						$nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:48px;margin:0 auto;" /></li>';
1037
+						$slides++;
1038
+					}
1039
+				}
1040
+			}// endfore
1041
+		} //end if
1042
+	} else {
1043
+		$main_slides = '';
1044
+		$nav_slides = '';
1045
+		$post_images = geodir_get_images($post->ID, 'thumbnail', false); // Hide default image on listing preview/detail page.
1046
+		$slides = 0;
1047
+
1048
+		if (!empty($post_images)) {
1049
+			foreach ($post_images as $image) {
1050
+				if ($image->height >= 400) {
1051
+					$spacer_height = 0;
1052
+				} else {
1053
+					$spacer_height = ((400 - $image->height) / 2);
1054
+				}
1055
+				$caption = '';//(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : '';
1056
+				$main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />';
1057
+				$main_slides .= '<img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>';
1058
+				$nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:48px;margin:0 auto;" /></li>';
1059
+				$slides++;
1060
+			}
1061
+		}// endfore
1062
+	}
1063 1063
 
1064
-    if (!empty($post_images)) {
1065
-        ?>
1064
+	if (!empty($post_images)) {
1065
+		?>
1066 1066
         <div class="geodir_flex-container">
1067 1067
             <div class="geodir_flex-loader"><i class="fa fa-refresh fa-spin"></i></div>
1068 1068
             <div id="geodir_slider" class="geodir_flexslider ">
@@ -1075,7 +1075,7 @@  discard block
 block discarded – undo
1075 1075
             <?php } ?>
1076 1076
         </div>
1077 1077
     <?php
1078
-    }
1078
+	}
1079 1079
 }
1080 1080
 
1081 1081
 add_action('geodir_details_taxonomies', 'geodir_action_details_taxonomies', 10);
@@ -1090,177 +1090,177 @@  discard block
 block discarded – undo
1090 1090
  */
1091 1091
 function geodir_action_details_taxonomies()
1092 1092
 {
1093
-    global $preview, $post;?>
1093
+	global $preview, $post;?>
1094 1094
     <p class="geodir_post_taxomomies clearfix">
1095 1095
     <?php
1096
-    $taxonomies = array();
1097
-
1098
-    $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
1099
-
1100
-    if ($preview && !$is_backend_preview) {
1101
-        $post_type = $post->listing_type;
1102
-        $post_taxonomy = $post_type . 'category';
1103
-        $post->{$post_taxonomy} = $post->post_category[$post_taxonomy];
1104
-    } else {
1105
-        $post_type = $post->post_type;
1106
-        $post_taxonomy = $post_type . 'category';
1107
-    }
1096
+	$taxonomies = array();
1097
+
1098
+	$is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
1099
+
1100
+	if ($preview && !$is_backend_preview) {
1101
+		$post_type = $post->listing_type;
1102
+		$post_taxonomy = $post_type . 'category';
1103
+		$post->{$post_taxonomy} = $post->post_category[$post_taxonomy];
1104
+	} else {
1105
+		$post_type = $post->post_type;
1106
+		$post_taxonomy = $post_type . 'category';
1107
+	}
1108 1108
 //{	
1109
-    $post_type_info = get_post_type_object($post_type);
1110
-    $listing_label = __($post_type_info->labels->singular_name, 'geodirectory');
1111
-
1112
-    if (!empty($post->post_tags)) {
1113
-
1114
-        if (taxonomy_exists($post_type . '_tags')):
1115
-            $links = array();
1116
-            $terms = array();
1117
-            // to limit post tags
1118
-            $post_tags = trim($post->post_tags, ",");
1119
-            $post_id = isset($post->ID) ? $post->ID : '';
1120
-            /**
1121
-             * Filter the post tags.
1122
-             *
1123
-             * Allows you to filter the post tags output on the details page of a post.
1124
-             *
1125
-             * @since 1.0.0
1126
-             * @param string $post_tags A comma seperated list of tags.
1127
-             * @param int $post_id The current post id.
1128
-             */
1129
-            $post_tags = apply_filters('geodir_action_details_post_tags', $post_tags, $post_id);
1130
-
1131
-            $post->post_tags = $post_tags;
1132
-            $post_tags = explode(",", trim($post->post_tags, ","));
1133
-
1134
-
1135
-            foreach ($post_tags as $post_term) {
1136
-
1137
-                // fix slug creation order for tags & location
1138
-                $post_term = trim($post_term);
1139
-
1140
-                $priority_location = false;
1141
-                if ($insert_term = term_exists($post_term, $post_type . '_tags')) {
1142
-                    $term = get_term_by('id', $insert_term['term_id'], $post_type . '_tags');
1143
-                } else {
1144
-                    $post_country = isset($_REQUEST['post_country']) && $_REQUEST['post_country'] != '' ? sanitize_text_field($_REQUEST['post_country']) : NULL;
1145
-                    $post_region = isset($_REQUEST['post_region']) && $_REQUEST['post_region'] != '' ? sanitize_text_field($_REQUEST['post_region']) : NULL;
1146
-                    $post_city = isset($_REQUEST['post_city']) && $_REQUEST['post_city'] != '' ? sanitize_text_field($_REQUEST['post_city']) : NULL;
1147
-                    $match_country = $post_country && sanitize_title($post_term) == sanitize_title($post_country) ? true : false;
1148
-                    $match_region = $post_region && sanitize_title($post_term) == sanitize_title($post_region) ? true : false;
1149
-                    $match_city = $post_city && sanitize_title($post_term) == sanitize_title($post_city) ? true : false;
1150
-                    if ($match_country || $match_region || $match_city) {
1151
-                        $priority_location = true;
1152
-                        $term = get_term_by('name', $post_term, $post_type . '_tags');
1153
-                    } else {
1154
-                        $insert_term = wp_insert_term($post_term, $post_type . '_tags');
1155
-                        $term = get_term_by('name', $post_term, $post_type . '_tags');
1156
-                    }
1157
-                }
1158
-
1159
-                if (!is_wp_error($term) && is_object($term)) {
1160
-
1161
-                    // fix tag link on detail page
1162
-                    if ($priority_location) {
1163
-
1164
-                        $tag_link = "<a href=''>$post_term</a>";
1165
-                        /**
1166
-                         * Filter the tag name on the details page.
1167
-                         *
1168
-                         * @since 1.5.6
1169
-                         * @param string $tag_link The tag link html.
1170
-                         * @param object $term The tag term object.
1171
-                         */
1172
-                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1173
-                        $links[] = $tag_link;
1174
-                    } else {
1175
-                        $tag_link = "<a href='" . esc_attr(get_term_link($term->term_id, $term->taxonomy)) . "'>$term->name</a>";
1176
-                        /** This action is documented in geodirectory-template_actions.php */
1177
-                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1178
-                        $links[] = $tag_link;
1179
-                    }
1180
-                    $terms[] = $term;
1181
-                }
1182
-                //
1183
-            }
1184
-            if (!isset($listing_label)) {
1185
-                $listing_label = '';
1186
-            }
1187
-            $taxonomies[$post_type . '_tags'] = wp_sprintf(__('%s Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1188
-        endif;
1189
-
1190
-    }
1191
-
1192
-    if (!empty($post->{$post_taxonomy})) {
1193
-        $links = array();
1194
-        $terms = array();
1195
-        $termsOrdered = array();
1196
-        if (!is_array($post->{$post_taxonomy})) {
1197
-            $post_term = explode(",", trim($post->{$post_taxonomy}, ","));
1198
-        } else {
1199
-            $post_term = $post->{$post_taxonomy};
1109
+	$post_type_info = get_post_type_object($post_type);
1110
+	$listing_label = __($post_type_info->labels->singular_name, 'geodirectory');
1111
+
1112
+	if (!empty($post->post_tags)) {
1113
+
1114
+		if (taxonomy_exists($post_type . '_tags')):
1115
+			$links = array();
1116
+			$terms = array();
1117
+			// to limit post tags
1118
+			$post_tags = trim($post->post_tags, ",");
1119
+			$post_id = isset($post->ID) ? $post->ID : '';
1120
+			/**
1121
+			 * Filter the post tags.
1122
+			 *
1123
+			 * Allows you to filter the post tags output on the details page of a post.
1124
+			 *
1125
+			 * @since 1.0.0
1126
+			 * @param string $post_tags A comma seperated list of tags.
1127
+			 * @param int $post_id The current post id.
1128
+			 */
1129
+			$post_tags = apply_filters('geodir_action_details_post_tags', $post_tags, $post_id);
1130
+
1131
+			$post->post_tags = $post_tags;
1132
+			$post_tags = explode(",", trim($post->post_tags, ","));
1133
+
1134
+
1135
+			foreach ($post_tags as $post_term) {
1136
+
1137
+				// fix slug creation order for tags & location
1138
+				$post_term = trim($post_term);
1139
+
1140
+				$priority_location = false;
1141
+				if ($insert_term = term_exists($post_term, $post_type . '_tags')) {
1142
+					$term = get_term_by('id', $insert_term['term_id'], $post_type . '_tags');
1143
+				} else {
1144
+					$post_country = isset($_REQUEST['post_country']) && $_REQUEST['post_country'] != '' ? sanitize_text_field($_REQUEST['post_country']) : NULL;
1145
+					$post_region = isset($_REQUEST['post_region']) && $_REQUEST['post_region'] != '' ? sanitize_text_field($_REQUEST['post_region']) : NULL;
1146
+					$post_city = isset($_REQUEST['post_city']) && $_REQUEST['post_city'] != '' ? sanitize_text_field($_REQUEST['post_city']) : NULL;
1147
+					$match_country = $post_country && sanitize_title($post_term) == sanitize_title($post_country) ? true : false;
1148
+					$match_region = $post_region && sanitize_title($post_term) == sanitize_title($post_region) ? true : false;
1149
+					$match_city = $post_city && sanitize_title($post_term) == sanitize_title($post_city) ? true : false;
1150
+					if ($match_country || $match_region || $match_city) {
1151
+						$priority_location = true;
1152
+						$term = get_term_by('name', $post_term, $post_type . '_tags');
1153
+					} else {
1154
+						$insert_term = wp_insert_term($post_term, $post_type . '_tags');
1155
+						$term = get_term_by('name', $post_term, $post_type . '_tags');
1156
+					}
1157
+				}
1158
+
1159
+				if (!is_wp_error($term) && is_object($term)) {
1160
+
1161
+					// fix tag link on detail page
1162
+					if ($priority_location) {
1163
+
1164
+						$tag_link = "<a href=''>$post_term</a>";
1165
+						/**
1166
+						 * Filter the tag name on the details page.
1167
+						 *
1168
+						 * @since 1.5.6
1169
+						 * @param string $tag_link The tag link html.
1170
+						 * @param object $term The tag term object.
1171
+						 */
1172
+						$tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1173
+						$links[] = $tag_link;
1174
+					} else {
1175
+						$tag_link = "<a href='" . esc_attr(get_term_link($term->term_id, $term->taxonomy)) . "'>$term->name</a>";
1176
+						/** This action is documented in geodirectory-template_actions.php */
1177
+						$tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1178
+						$links[] = $tag_link;
1179
+					}
1180
+					$terms[] = $term;
1181
+				}
1182
+				//
1183
+			}
1184
+			if (!isset($listing_label)) {
1185
+				$listing_label = '';
1186
+			}
1187
+			$taxonomies[$post_type . '_tags'] = wp_sprintf(__('%s Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1188
+		endif;
1189
+
1190
+	}
1191
+
1192
+	if (!empty($post->{$post_taxonomy})) {
1193
+		$links = array();
1194
+		$terms = array();
1195
+		$termsOrdered = array();
1196
+		if (!is_array($post->{$post_taxonomy})) {
1197
+			$post_term = explode(",", trim($post->{$post_taxonomy}, ","));
1198
+		} else {
1199
+			$post_term = $post->{$post_taxonomy};
1200 1200
 			
1201 1201
 			if ($preview && !$is_backend_preview) {
1202 1202
 				$post_term = geodir_add_parent_terms($post_term, $post_taxonomy);
1203 1203
 			}
1204
-        }
1205
-
1206
-        $post_term = array_unique($post_term);
1207
-        if (!empty($post_term)) {
1208
-            foreach ($post_term as $post_term) {
1209
-                $post_term = trim($post_term);
1210
-
1211
-                if ($post_term != ''):
1212
-                    $term = get_term_by('id', $post_term, $post_taxonomy);
1213
-
1214
-                    if (is_object($term)) {
1215
-                        $term_link = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>$term->name</a>";
1216
-                        /**
1217
-                         * Filter the category name on the details page.
1218
-                         *
1219
-                         * @since 1.5.6
1220
-                         * @param string $term_link The link html to the category.
1221
-                         * @param object $term The category term object.
1222
-                         */
1223
-                        $term_link = apply_filters('geodir_details_taxonomies_cat_link',$term_link,$term);
1224
-                        $links[] = $term_link;
1225
-                        $terms[] = $term;
1226
-                    }
1227
-                endif;
1228
-            }
1229
-            // order alphabetically
1230
-            asort($links);
1231
-            foreach (array_keys($links) as $key) {
1232
-                $termsOrdered[$key] = $terms[$key];
1233
-            }
1234
-            $terms = $termsOrdered;
1204
+		}
1205
+
1206
+		$post_term = array_unique($post_term);
1207
+		if (!empty($post_term)) {
1208
+			foreach ($post_term as $post_term) {
1209
+				$post_term = trim($post_term);
1210
+
1211
+				if ($post_term != ''):
1212
+					$term = get_term_by('id', $post_term, $post_taxonomy);
1213
+
1214
+					if (is_object($term)) {
1215
+						$term_link = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>$term->name</a>";
1216
+						/**
1217
+						 * Filter the category name on the details page.
1218
+						 *
1219
+						 * @since 1.5.6
1220
+						 * @param string $term_link The link html to the category.
1221
+						 * @param object $term The category term object.
1222
+						 */
1223
+						$term_link = apply_filters('geodir_details_taxonomies_cat_link',$term_link,$term);
1224
+						$links[] = $term_link;
1225
+						$terms[] = $term;
1226
+					}
1227
+				endif;
1228
+			}
1229
+			// order alphabetically
1230
+			asort($links);
1231
+			foreach (array_keys($links) as $key) {
1232
+				$termsOrdered[$key] = $terms[$key];
1233
+			}
1234
+			$terms = $termsOrdered;
1235 1235
 
1236
-        }
1236
+		}
1237 1237
 
1238
-        if (!isset($listing_label)) {
1239
-            $listing_label = '';
1240
-        }
1241
-        $taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1238
+		if (!isset($listing_label)) {
1239
+			$listing_label = '';
1240
+		}
1241
+		$taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1242 1242
 
1243
-    }
1243
+	}
1244 1244
 
1245
-    /**
1246
-     * Filter the taxonomies array before output.
1247
-     *
1248
-     * @since 1.5.9
1249
-     * @param array $taxonomies The array of cats and tags.
1250
-     * @param string $post_type The post type being output.
1251
-     * @param string $listing_label The post type label.
1252
-     * @param string $listing_label The post type label with ucwords function.
1253
-     */
1254
-    $taxonomies = apply_filters('geodir_details_taxonomies_output',$taxonomies,$post_type,$listing_label,geodir_ucwords($listing_label));
1245
+	/**
1246
+	 * Filter the taxonomies array before output.
1247
+	 *
1248
+	 * @since 1.5.9
1249
+	 * @param array $taxonomies The array of cats and tags.
1250
+	 * @param string $post_type The post type being output.
1251
+	 * @param string $listing_label The post type label.
1252
+	 * @param string $listing_label The post type label with ucwords function.
1253
+	 */
1254
+	$taxonomies = apply_filters('geodir_details_taxonomies_output',$taxonomies,$post_type,$listing_label,geodir_ucwords($listing_label));
1255 1255
 
1256
-    if (isset($taxonomies[$post_taxonomy])) {
1257
-        echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>';
1258
-    }
1256
+	if (isset($taxonomies[$post_taxonomy])) {
1257
+		echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>';
1258
+	}
1259 1259
 
1260
-    if (isset($taxonomies[$post_type . '_tags']))
1261
-        echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>';
1260
+	if (isset($taxonomies[$post_type . '_tags']))
1261
+		echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>';
1262 1262
 
1263
-    ?>
1263
+	?>
1264 1264
     </p><?php
1265 1265
 }
1266 1266
 
@@ -1282,140 +1282,140 @@  discard block
 block discarded – undo
1282 1282
 function geodir_action_details_micordata($post='')
1283 1283
 {
1284 1284
 
1285
-    global $preview;
1286
-    if(empty($post)){global $post;}
1287
-    if ($preview || !geodir_is_page('detail')) {
1288
-        return;
1289
-    }
1290
-
1291
-    // url
1292
-    $c_url = geodir_curPageURL();
1293
-
1294
-    // post reviews
1295
-    $post_reviews = get_comments(array('post_id' => $post->ID, 'status' => 'approve'));
1296
-    if (empty($post_reviews)) {
1297
-        $reviews = '';
1298
-    } else {
1299
-        foreach ($post_reviews as $review) {
1300
-            $reviews[] = array(
1301
-                "@type" => "Review",
1302
-                "author" => $review->comment_author,
1303
-                "datePublished" => $review->comment_date,
1304
-                "description" => $review->comment_content,
1305
-                "reviewRating" => array(
1306
-                    "@type" => "Rating",
1307
-                    "bestRating" => "5",// @todo this will need to be filtered for review manager if user changes the score.
1308
-                    "ratingValue" => geodir_get_commentoverall($review->comment_ID),
1309
-                    "worstRating" => "1"
1310
-                )
1311
-            );
1312
-        }
1313
-
1314
-    }
1315
-
1316
-    // post images
1317
-    $post_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
1318
-    if (empty($post_images)) {
1319
-        $images = '';
1320
-    } else {
1321
-        $i_arr = array();
1322
-        foreach ($post_images as $img) {
1323
-            $i_arr[] = $img->src;
1324
-        }
1325
-
1326
-        if (count($i_arr) == 1) {
1327
-            $images = $i_arr[0];
1328
-        } else {
1329
-            $images = $i_arr;
1330
-        }
1331
-
1332
-    }
1333
-    //print_r($post);
1334
-    // external links
1335
-    $external_links =  array();
1336
-    $external_links[] = $post->geodir_website;
1337
-    $external_links[] = $post->geodir_twitter;
1338
-    $external_links[] = $post->geodir_facebook;
1339
-    $external_links = array_filter($external_links);
1340
-
1341
-    if(!empty($external_links)){
1342
-        $external_links = array_values($external_links);
1343
-    }
1344
-
1345
-    // reviews
1346
-    $comment_count = geodir_get_review_count_total($post->ID);
1347
-    $post_avgratings = geodir_get_post_rating($post->ID);
1348
-
1349
-    // schema type
1350
-    $schema_type = 'LocalBusiness';
1351
-    if(isset($post->default_category) && $post->default_category){
1352
-        $cat_schema = get_tax_meta($post->default_category, 'ct_cat_schema', false, $post->post_type);
1353
-        if($cat_schema){$schema_type = $cat_schema;}
1354
-        if(!$schema_type && $post->post_type=='gd_event'){$schema_type = 'Event';}
1355
-    }
1356
-
1357
-    $schema = array();
1358
-    $schema['@context'] = "https://schema.org";
1359
-    $schema['@type'] = $schema_type;
1360
-    $schema['name'] = $post->post_title;
1361
-    $schema['description'] = wp_strip_all_tags( $post->post_content, true );
1362
-    $schema['telephone'] = $post->geodir_contact;
1363
-    $schema['url'] = $c_url;
1364
-    $schema['sameAs'] = $external_links;
1365
-    $schema['image'] = $images;
1366
-    $schema['address'] = array(
1367
-        "@type" => "PostalAddress",
1368
-        "streetAddress" => $post->post_address,
1369
-        "addressLocality" => $post->post_city,
1370
-        "addressRegion" => $post->post_region,
1371
-        "addressCountry" => $post->post_country,
1372
-        "postalCode" => $post->post_zip
1373
-    );
1374
-
1375
-    if($post->post_latitude && $post->post_longitude) {
1376
-        $schema['geo'] = array(
1377
-            "@type" => "GeoCoordinates",
1378
-            "latitude" => $post->post_latitude,
1379
-            "longitude" => $post->post_longitude
1380
-        );
1381
-    }
1382
-
1383
-    if($post_avgratings) {
1384
-        $schema['aggregateRating'] = array(
1385
-            "@type" => "AggregateRating",
1386
-            "ratingValue" => $post_avgratings,
1387
-            "bestRating" => "5", // @todo this will need to be filtered for review manager if user changes the score.
1388
-            "worstRating" => "1",
1389
-            "ratingCount" => $comment_count
1390
-        );
1391
-    }
1392
-    $schema['review'] = $reviews;
1393
-
1394
-    /**
1395
-     * Allow the schema JSON-LD info to be filtered.
1396
-     *
1397
-     * @since 1.5.4
1398
-     * @since 1.5.7 Added $post variable.
1399
-     * @param array $schema The array of schema data to be filtered.
1400
-     * @param object $post The post object.
1401
-     */
1402
-    $schema = apply_filters('geodir_details_schema', $schema,$post);
1403
-
1404
-
1405
-    echo '<script type="application/ld+json">' . json_encode($schema) . '</script>';
1406
-
1407
-
1408
-    $uploads = wp_upload_dir();
1409
-    $facebook_og = (isset($post->featured_image) && $post->featured_image) ? '<meta property="og:image" content="'.$uploads['baseurl'].$post->featured_image.'"/>' : '';
1410
-
1411
-    /**
1412
-     * Show facebook open graph meta info
1413
-     *
1414
-     * @since 1.6.6
1415
-     * @param string $facebook_og The open graph html to be filtered.
1416
-     * @param object $post The post object.
1417
-     */
1418
-    echo apply_filters('geodir_details_facebook_og', $facebook_og,$post);
1285
+	global $preview;
1286
+	if(empty($post)){global $post;}
1287
+	if ($preview || !geodir_is_page('detail')) {
1288
+		return;
1289
+	}
1290
+
1291
+	// url
1292
+	$c_url = geodir_curPageURL();
1293
+
1294
+	// post reviews
1295
+	$post_reviews = get_comments(array('post_id' => $post->ID, 'status' => 'approve'));
1296
+	if (empty($post_reviews)) {
1297
+		$reviews = '';
1298
+	} else {
1299
+		foreach ($post_reviews as $review) {
1300
+			$reviews[] = array(
1301
+				"@type" => "Review",
1302
+				"author" => $review->comment_author,
1303
+				"datePublished" => $review->comment_date,
1304
+				"description" => $review->comment_content,
1305
+				"reviewRating" => array(
1306
+					"@type" => "Rating",
1307
+					"bestRating" => "5",// @todo this will need to be filtered for review manager if user changes the score.
1308
+					"ratingValue" => geodir_get_commentoverall($review->comment_ID),
1309
+					"worstRating" => "1"
1310
+				)
1311
+			);
1312
+		}
1313
+
1314
+	}
1315
+
1316
+	// post images
1317
+	$post_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
1318
+	if (empty($post_images)) {
1319
+		$images = '';
1320
+	} else {
1321
+		$i_arr = array();
1322
+		foreach ($post_images as $img) {
1323
+			$i_arr[] = $img->src;
1324
+		}
1325
+
1326
+		if (count($i_arr) == 1) {
1327
+			$images = $i_arr[0];
1328
+		} else {
1329
+			$images = $i_arr;
1330
+		}
1331
+
1332
+	}
1333
+	//print_r($post);
1334
+	// external links
1335
+	$external_links =  array();
1336
+	$external_links[] = $post->geodir_website;
1337
+	$external_links[] = $post->geodir_twitter;
1338
+	$external_links[] = $post->geodir_facebook;
1339
+	$external_links = array_filter($external_links);
1340
+
1341
+	if(!empty($external_links)){
1342
+		$external_links = array_values($external_links);
1343
+	}
1344
+
1345
+	// reviews
1346
+	$comment_count = geodir_get_review_count_total($post->ID);
1347
+	$post_avgratings = geodir_get_post_rating($post->ID);
1348
+
1349
+	// schema type
1350
+	$schema_type = 'LocalBusiness';
1351
+	if(isset($post->default_category) && $post->default_category){
1352
+		$cat_schema = get_tax_meta($post->default_category, 'ct_cat_schema', false, $post->post_type);
1353
+		if($cat_schema){$schema_type = $cat_schema;}
1354
+		if(!$schema_type && $post->post_type=='gd_event'){$schema_type = 'Event';}
1355
+	}
1356
+
1357
+	$schema = array();
1358
+	$schema['@context'] = "https://schema.org";
1359
+	$schema['@type'] = $schema_type;
1360
+	$schema['name'] = $post->post_title;
1361
+	$schema['description'] = wp_strip_all_tags( $post->post_content, true );
1362
+	$schema['telephone'] = $post->geodir_contact;
1363
+	$schema['url'] = $c_url;
1364
+	$schema['sameAs'] = $external_links;
1365
+	$schema['image'] = $images;
1366
+	$schema['address'] = array(
1367
+		"@type" => "PostalAddress",
1368
+		"streetAddress" => $post->post_address,
1369
+		"addressLocality" => $post->post_city,
1370
+		"addressRegion" => $post->post_region,
1371
+		"addressCountry" => $post->post_country,
1372
+		"postalCode" => $post->post_zip
1373
+	);
1374
+
1375
+	if($post->post_latitude && $post->post_longitude) {
1376
+		$schema['geo'] = array(
1377
+			"@type" => "GeoCoordinates",
1378
+			"latitude" => $post->post_latitude,
1379
+			"longitude" => $post->post_longitude
1380
+		);
1381
+	}
1382
+
1383
+	if($post_avgratings) {
1384
+		$schema['aggregateRating'] = array(
1385
+			"@type" => "AggregateRating",
1386
+			"ratingValue" => $post_avgratings,
1387
+			"bestRating" => "5", // @todo this will need to be filtered for review manager if user changes the score.
1388
+			"worstRating" => "1",
1389
+			"ratingCount" => $comment_count
1390
+		);
1391
+	}
1392
+	$schema['review'] = $reviews;
1393
+
1394
+	/**
1395
+	 * Allow the schema JSON-LD info to be filtered.
1396
+	 *
1397
+	 * @since 1.5.4
1398
+	 * @since 1.5.7 Added $post variable.
1399
+	 * @param array $schema The array of schema data to be filtered.
1400
+	 * @param object $post The post object.
1401
+	 */
1402
+	$schema = apply_filters('geodir_details_schema', $schema,$post);
1403
+
1404
+
1405
+	echo '<script type="application/ld+json">' . json_encode($schema) . '</script>';
1406
+
1407
+
1408
+	$uploads = wp_upload_dir();
1409
+	$facebook_og = (isset($post->featured_image) && $post->featured_image) ? '<meta property="og:image" content="'.$uploads['baseurl'].$post->featured_image.'"/>' : '';
1410
+
1411
+	/**
1412
+	 * Show facebook open graph meta info
1413
+	 *
1414
+	 * @since 1.6.6
1415
+	 * @param string $facebook_og The open graph html to be filtered.
1416
+	 * @param object $post The post object.
1417
+	 */
1418
+	echo apply_filters('geodir_details_facebook_og', $facebook_og,$post);
1419 1419
 
1420 1420
 
1421 1421
 
@@ -1435,7 +1435,7 @@  discard block
 block discarded – undo
1435 1435
  */
1436 1436
 function geodir_action_details_next_prev()
1437 1437
 {
1438
-    ?>
1438
+	?>
1439 1439
     <div class="geodir-pos_navigation clearfix">
1440 1440
     <div
1441 1441
         class="geodir-post_left"><?php previous_post_link('%link', '' . __('Previous', 'geodirectory'), false) ?></div>
@@ -1453,15 +1453,15 @@  discard block
 block discarded – undo
1453 1453
  */
1454 1454
 function geodir_action_before_single_post()
1455 1455
 {
1456
-    global $post;
1457
-    /**
1458
-     * Called at the very start of the details page output, before the title section.
1459
-     *
1460
-     * @since 1.0.0
1461
-     * @param object $post The current post object.
1462
-     * @global WP_Post|null $post The current post, if available.
1463
-     */
1464
-    do_action('geodir_before_single_post', $post); // extra action	
1456
+	global $post;
1457
+	/**
1458
+	 * Called at the very start of the details page output, before the title section.
1459
+	 *
1460
+	 * @since 1.0.0
1461
+	 * @param object $post The current post object.
1462
+	 * @global WP_Post|null $post The current post, if available.
1463
+	 */
1464
+	do_action('geodir_before_single_post', $post); // extra action	
1465 1465
 }
1466 1466
 
1467 1467
 /**
@@ -1472,13 +1472,13 @@  discard block
 block discarded – undo
1472 1472
  */
1473 1473
 function geodir_action_after_single_post($post)
1474 1474
 {
1475
-    /**
1476
-     * Called on the details page after the details page tabs section and before the next/prev buttons.
1477
-     *
1478
-     * @since 1.0.0
1479
-     * @param object $post The current post object.
1480
-     */
1481
-    do_action('geodir_after_single_post', $post); // extra action	
1475
+	/**
1476
+	 * Called on the details page after the details page tabs section and before the next/prev buttons.
1477
+	 *
1478
+	 * @since 1.0.0
1479
+	 * @param object $post The current post object.
1480
+	 */
1481
+	do_action('geodir_after_single_post', $post); // extra action	
1482 1482
 }
1483 1483
 
1484 1484
 add_action('geodir_details_main_content', 'geodir_action_before_single_post', 10);
@@ -1504,168 +1504,168 @@  discard block
 block discarded – undo
1504 1504
  */
1505 1505
 function geodir_action_listings_title()
1506 1506
 {
1507
-    global $wp, $term;
1507
+	global $wp, $term;
1508 1508
 
1509
-    $gd_post_type = geodir_get_current_posttype();
1510
-    $post_type_info = get_post_type_object($gd_post_type);
1509
+	$gd_post_type = geodir_get_current_posttype();
1510
+	$post_type_info = get_post_type_object($gd_post_type);
1511 1511
 
1512
-    $add_string_in_title = __('All', 'geodirectory') . ' ';
1513
-    if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
1514
-        $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
1515
-    }
1512
+	$add_string_in_title = __('All', 'geodirectory') . ' ';
1513
+	if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
1514
+		$add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
1515
+	}
1516 1516
 
1517
-    $list_title = $add_string_in_title . __(ucfirst($post_type_info->labels->name), 'geodirectory');
1518
-    $single_name = $post_type_info->labels->singular_name;
1517
+	$list_title = $add_string_in_title . __(ucfirst($post_type_info->labels->name), 'geodirectory');
1518
+	$single_name = $post_type_info->labels->singular_name;
1519 1519
 
1520
-    $taxonomy = geodir_get_taxonomies($gd_post_type, true);
1520
+	$taxonomy = geodir_get_taxonomies($gd_post_type, true);
1521 1521
 
1522
-    $gd_country = get_query_var('gd_country');
1523
-    $gd_region = get_query_var('gd_region');
1524
-    $gd_city = get_query_var('gd_city');
1522
+	$gd_country = get_query_var('gd_country');
1523
+	$gd_region = get_query_var('gd_region');
1524
+	$gd_city = get_query_var('gd_city');
1525 1525
 
1526
-    if (!empty($term)) {
1527
-        $location_name = '';
1528
-        if ($gd_country != '' || $gd_region != '' || $gd_city != '') {
1529
-            if ($gd_country != '') {
1530
-                $location_name = geodir_sanitize_location_name('gd_country', $gd_country);
1531
-            }
1532
-
1533
-            if ($gd_region != '') {
1534
-                $location_name = geodir_sanitize_location_name('gd_region', $gd_region);
1535
-            }
1536
-
1537
-            if ($gd_city != '') {
1538
-                $location_name = geodir_sanitize_location_name('gd_city', $gd_city);
1539
-            }
1540
-        }
1541
-
1542
-        $current_term = get_term_by('slug', $term, $taxonomy[0]);
1543
-        if (!empty($current_term)) {
1544
-            $current_term_name = __(ucfirst($current_term->name), 'geodirectory');
1545
-            if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1546
-                $location_last_char = substr($location_name, -1);
1547
-                $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1548
-                $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1549
-            } else {
1550
-                $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1551
-            }
1552
-        } else {
1553
-            if (count($taxonomy) > 1) {
1554
-                $current_term = get_term_by('slug', $term, $taxonomy[1]);
1555
-
1556
-                if (!empty($current_term)) {
1557
-                    $current_term_name = __(ucfirst($current_term->name), 'geodirectory');
1558
-                    if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1559
-                        $location_last_char = substr($location_name, -1);
1560
-                        $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1561
-                        $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1562
-                    } else {
1563
-                        $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1564
-                    }
1565
-                }
1566
-            }
1567
-        }
1568
-
1569
-    } else {
1570
-        $gd_country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : '';
1571
-        $gd_region = (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') ? $wp->query_vars['gd_region'] : '';
1572
-        $gd_city = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : '';
1573
-
1574
-        $gd_country_actual = $gd_region_actual = $gd_city_actual = '';
1575
-
1576
-        if (function_exists('get_actual_location_name')) {
1577
-            $gd_country_actual = $gd_country != '' ? get_actual_location_name('country', $gd_country, true) : $gd_country;
1578
-            $gd_region_actual = $gd_region != '' ? get_actual_location_name('region', $gd_region) : $gd_region;
1579
-            $gd_city_actual = $gd_city != '' ? get_actual_location_name('city', $gd_city) : $gd_city;
1580
-        }
1581
-
1582
-        if ($gd_city != '') {
1583
-            if ($gd_city_actual != '') {
1584
-                $gd_city = $gd_city_actual;
1585
-            } else {
1586
-                $gd_city = preg_replace('/-(\d+)$/', '', $gd_city);
1587
-                $gd_city = preg_replace('/[_-]/', ' ', $gd_city);
1588
-                $gd_city = __(geodir_ucwords($gd_city), 'geodirectory');
1589
-            }
1590
-
1591
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_city . "'";
1592
-        } else if ($gd_region != '') {
1593
-            if ($gd_region_actual != '') {
1594
-                $gd_region = $gd_region_actual;
1595
-            } else {
1596
-                $gd_region = preg_replace('/-(\d+)$/', '', $gd_region);
1597
-                $gd_region = preg_replace('/[_-]/', ' ', $gd_region);
1598
-                $gd_region = __(geodir_ucwords($gd_region), 'geodirectory');
1599
-            }
1600
-
1601
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_region . "'";
1602
-        } else if ($gd_country != '') {
1603
-            if ($gd_country_actual != '') {
1604
-                $gd_country = $gd_country_actual;
1605
-            } else {
1606
-                $gd_country = preg_replace('/-(\d+)$/', '', $gd_country);
1607
-                $gd_country = preg_replace('/[_-]/', ' ', $gd_country);
1608
-                $gd_country = __(geodir_ucwords($gd_country), 'geodirectory');
1609
-            }
1610
-
1611
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_country . "'";
1612
-        }
1613
-    }
1614
-
1615
-    if (is_search()) {
1616
-        $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
1617
-    }
1618
-    /** This action is documented in geodirectory_template_actions.php */
1619
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
1620
-    /** This action is documented in geodirectory_template_actions.php */
1621
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
1622
-
1623
-
1624
-    $title = $list_title;
1625
-    $gd_page = '';
1626
-    if(geodir_is_page('pt')){
1627
-        $gd_page = 'pt';
1628
-        $title  = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
1629
-    }
1630
-    elseif(geodir_is_page('listing')){
1631
-        $gd_page = 'listing';
1632
-        global $wp_query;
1633
-        $current_term = $wp_query->get_queried_object();
1634
-        if (strpos($current_term->taxonomy,'_tags') !== false) {
1635
-            $title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
1636
-        }else{
1637
-            $title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
1638
-        }
1526
+	if (!empty($term)) {
1527
+		$location_name = '';
1528
+		if ($gd_country != '' || $gd_region != '' || $gd_city != '') {
1529
+			if ($gd_country != '') {
1530
+				$location_name = geodir_sanitize_location_name('gd_country', $gd_country);
1531
+			}
1639 1532
 
1640
-    }
1641
-    elseif(geodir_is_page('author')){
1642
-        $gd_page = 'author';
1643
-        if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
1644
-            $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
1645
-        }else{
1646
-            $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
1647
-        }
1533
+			if ($gd_region != '') {
1534
+				$location_name = geodir_sanitize_location_name('gd_region', $gd_region);
1535
+			}
1648 1536
 
1649
-    }
1537
+			if ($gd_city != '') {
1538
+				$location_name = geodir_sanitize_location_name('gd_city', $gd_city);
1539
+			}
1540
+		}
1541
+
1542
+		$current_term = get_term_by('slug', $term, $taxonomy[0]);
1543
+		if (!empty($current_term)) {
1544
+			$current_term_name = __(ucfirst($current_term->name), 'geodirectory');
1545
+			if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1546
+				$location_last_char = substr($location_name, -1);
1547
+				$location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1548
+				$list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1549
+			} else {
1550
+				$list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1551
+			}
1552
+		} else {
1553
+			if (count($taxonomy) > 1) {
1554
+				$current_term = get_term_by('slug', $term, $taxonomy[1]);
1555
+
1556
+				if (!empty($current_term)) {
1557
+					$current_term_name = __(ucfirst($current_term->name), 'geodirectory');
1558
+					if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1559
+						$location_last_char = substr($location_name, -1);
1560
+						$location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1561
+						$list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1562
+					} else {
1563
+						$list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1564
+					}
1565
+				}
1566
+			}
1567
+		}
1568
+
1569
+	} else {
1570
+		$gd_country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : '';
1571
+		$gd_region = (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') ? $wp->query_vars['gd_region'] : '';
1572
+		$gd_city = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : '';
1573
+
1574
+		$gd_country_actual = $gd_region_actual = $gd_city_actual = '';
1575
+
1576
+		if (function_exists('get_actual_location_name')) {
1577
+			$gd_country_actual = $gd_country != '' ? get_actual_location_name('country', $gd_country, true) : $gd_country;
1578
+			$gd_region_actual = $gd_region != '' ? get_actual_location_name('region', $gd_region) : $gd_region;
1579
+			$gd_city_actual = $gd_city != '' ? get_actual_location_name('city', $gd_city) : $gd_city;
1580
+		}
1581
+
1582
+		if ($gd_city != '') {
1583
+			if ($gd_city_actual != '') {
1584
+				$gd_city = $gd_city_actual;
1585
+			} else {
1586
+				$gd_city = preg_replace('/-(\d+)$/', '', $gd_city);
1587
+				$gd_city = preg_replace('/[_-]/', ' ', $gd_city);
1588
+				$gd_city = __(geodir_ucwords($gd_city), 'geodirectory');
1589
+			}
1650 1590
 
1591
+			$list_title .= __(' in', 'geodirectory') . " '" . $gd_city . "'";
1592
+		} else if ($gd_region != '') {
1593
+			if ($gd_region_actual != '') {
1594
+				$gd_region = $gd_region_actual;
1595
+			} else {
1596
+				$gd_region = preg_replace('/-(\d+)$/', '', $gd_region);
1597
+				$gd_region = preg_replace('/[_-]/', ' ', $gd_region);
1598
+				$gd_region = __(geodir_ucwords($gd_region), 'geodirectory');
1599
+			}
1651 1600
 
1652
-    /**
1653
-     * Filter page title to replace variables.
1654
-     *
1655
-     * @since 1.5.4
1656
-     * @param string $title The page title including variables.
1657
-     * @param string $gd_page The GeoDirectory page type if any.
1658
-     */
1659
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
1601
+			$list_title .= __(' in', 'geodirectory') . " '" . $gd_region . "'";
1602
+		} else if ($gd_country != '') {
1603
+			if ($gd_country_actual != '') {
1604
+				$gd_country = $gd_country_actual;
1605
+			} else {
1606
+				$gd_country = preg_replace('/-(\d+)$/', '', $gd_country);
1607
+				$gd_country = preg_replace('/[_-]/', ' ', $gd_country);
1608
+				$gd_country = __(geodir_ucwords($gd_country), 'geodirectory');
1609
+			}
1660 1610
 
1661
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
1662
-        /**
1663
-         * Filter the listing page title.
1664
-         *
1665
-         * @since 1.0.0
1666
-         * @param string $list_title The title for the category page.
1667
-         */
1668
-        apply_filters('geodir_listing_page_title', $title) . '</h1></header>';
1611
+			$list_title .= __(' in', 'geodirectory') . " '" . $gd_country . "'";
1612
+		}
1613
+	}
1614
+
1615
+	if (is_search()) {
1616
+		$list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
1617
+	}
1618
+	/** This action is documented in geodirectory_template_actions.php */
1619
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
1620
+	/** This action is documented in geodirectory_template_actions.php */
1621
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
1622
+
1623
+
1624
+	$title = $list_title;
1625
+	$gd_page = '';
1626
+	if(geodir_is_page('pt')){
1627
+		$gd_page = 'pt';
1628
+		$title  = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
1629
+	}
1630
+	elseif(geodir_is_page('listing')){
1631
+		$gd_page = 'listing';
1632
+		global $wp_query;
1633
+		$current_term = $wp_query->get_queried_object();
1634
+		if (strpos($current_term->taxonomy,'_tags') !== false) {
1635
+			$title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
1636
+		}else{
1637
+			$title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
1638
+		}
1639
+
1640
+	}
1641
+	elseif(geodir_is_page('author')){
1642
+		$gd_page = 'author';
1643
+		if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
1644
+			$title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
1645
+		}else{
1646
+			$title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
1647
+		}
1648
+
1649
+	}
1650
+
1651
+
1652
+	/**
1653
+	 * Filter page title to replace variables.
1654
+	 *
1655
+	 * @since 1.5.4
1656
+	 * @param string $title The page title including variables.
1657
+	 * @param string $gd_page The GeoDirectory page type if any.
1658
+	 */
1659
+	$title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
1660
+
1661
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
1662
+		/**
1663
+		 * Filter the listing page title.
1664
+		 *
1665
+		 * @since 1.0.0
1666
+		 * @param string $list_title The title for the category page.
1667
+		 */
1668
+		apply_filters('geodir_listing_page_title', $title) . '</h1></header>';
1669 1669
 }
1670 1670
 
1671 1671
 add_action('geodir_listings_page_description', 'geodir_action_listings_description', 10);
@@ -1678,46 +1678,46 @@  discard block
 block discarded – undo
1678 1678
  */
1679 1679
 function geodir_action_listings_description()
1680 1680
 {
1681
-    global $wp_query;
1682
-    $current_term = $wp_query->get_queried_object();
1681
+	global $wp_query;
1682
+	$current_term = $wp_query->get_queried_object();
1683 1683
 
1684
-    $gd_post_type = geodir_get_current_posttype();
1685
-    if (isset($current_term->term_id) && $current_term->term_id != '') {
1684
+	$gd_post_type = geodir_get_current_posttype();
1685
+	if (isset($current_term->term_id) && $current_term->term_id != '') {
1686 1686
 
1687
-        $term_desc = term_description($current_term->term_id, $gd_post_type . '_tags');
1688
-        $saved_data = stripslashes(get_tax_meta($current_term->term_id, 'ct_cat_top_desc', false, $gd_post_type));
1689
-        if ($term_desc && !$saved_data) {
1690
-            $saved_data = $term_desc;
1691
-        }
1687
+		$term_desc = term_description($current_term->term_id, $gd_post_type . '_tags');
1688
+		$saved_data = stripslashes(get_tax_meta($current_term->term_id, 'ct_cat_top_desc', false, $gd_post_type));
1689
+		if ($term_desc && !$saved_data) {
1690
+			$saved_data = $term_desc;
1691
+		}
1692 1692
 
1693
-        // stop payment manager filtering content length
1694
-        $filter_priority = has_filter( 'the_content', 'geodir_payments_the_content' );
1695
-        if ( false !== $filter_priority ) {
1696
-            remove_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1697
-        }
1693
+		// stop payment manager filtering content length
1694
+		$filter_priority = has_filter( 'the_content', 'geodir_payments_the_content' );
1695
+		if ( false !== $filter_priority ) {
1696
+			remove_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1697
+		}
1698 1698
 
1699
-        /**
1700
-         * Apply the core filter `the_content` filter to the variable string.
1701
-         *
1702
-         * This is a WordPress core filter that does many things.
1703
-         *
1704
-         * @since 1.0.0
1705
-         * @param string $var The string to apply the filter to.
1706
-         */
1707
-        $cat_description = apply_filters('the_content', $saved_data);
1699
+		/**
1700
+		 * Apply the core filter `the_content` filter to the variable string.
1701
+		 *
1702
+		 * This is a WordPress core filter that does many things.
1703
+		 *
1704
+		 * @since 1.0.0
1705
+		 * @param string $var The string to apply the filter to.
1706
+		 */
1707
+		$cat_description = apply_filters('the_content', $saved_data);
1708 1708
 
1709 1709
 
1710
-        if ( false !== $filter_priority ) {
1711
-            add_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1712
-        }
1710
+		if ( false !== $filter_priority ) {
1711
+			add_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1712
+		}
1713 1713
 
1714
-        if ($cat_description) {
1715
-            ?>
1714
+		if ($cat_description) {
1715
+			?>
1716 1716
 
1717 1717
             <div class="term_description"><?php echo $cat_description;?></div> <?php
1718
-        }
1718
+		}
1719 1719
 
1720
-    }
1720
+	}
1721 1721
 }
1722 1722
 
1723 1723
 // action for adding the listings page top widget area
@@ -1736,11 +1736,11 @@  discard block
 block discarded – undo
1736 1736
  */
1737 1737
 function geodir_action_geodir_sidebar_listings_top()
1738 1738
 {
1739
-    if (get_option('geodir_show_listing_top_section')) { ?>
1739
+	if (get_option('geodir_show_listing_top_section')) { ?>
1740 1740
         <div
1741 1741
             class="<?php
1742
-            /** This action is documented in geodirectory_template_actions.php */
1743
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_top'); ?>">
1742
+			/** This action is documented in geodirectory_template_actions.php */
1743
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_top'); ?>">
1744 1744
             <?php dynamic_sidebar('geodir_listing_top'); ?>
1745 1745
         </div><!-- clearfix ends here-->
1746 1746
     <?php }
@@ -1763,35 +1763,35 @@  discard block
 block discarded – undo
1763 1763
  */
1764 1764
 function geodir_action_sidebar_left_open($type = '', $id = '', $class = '', $itemtype = '')
1765 1765
 {
1766
-    if ($type == 'home-page' && $width = get_option('geodir_width_home_left_section')) {
1767
-        $width_css = 'style="width:' . $width . '%;"';
1768
-    } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_left_section')) {
1769
-        $width_css = 'style="width:' . $width . '%;"';
1770
-    } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_left_section')) {
1771
-        $width_css = 'style="width:' . $width . '%;"';
1772
-    } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_left_section')) {
1773
-        $width_css = 'style="width:' . $width . '%;"';
1774
-    } else {
1775
-        $width_css = '';
1776
-    }
1777
-
1778
-    $tc = get_option('theme_compatibility_setting');
1779
-    if (!empty($tc['geodir_sidebar_left_open_replace'])) {
1780
-        $text = $tc['geodir_sidebar_left_open_replace'];
1781
-    } else {
1782
-        $text = '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>';
1783
-    }
1784
-
1785
-    if (!empty($tc['geodir_sidebar_left_open_id'])) {
1786
-        $id = $tc['geodir_sidebar_left_open_id'];
1787
-    }
1788
-    if (!empty($tc['geodir_sidebar_left_open_class'])) {
1789
-        $class = $tc['geodir_sidebar_left_open_class'];
1790
-    }
1791
-
1792
-    $text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
1793
-
1794
-    echo $text;
1766
+	if ($type == 'home-page' && $width = get_option('geodir_width_home_left_section')) {
1767
+		$width_css = 'style="width:' . $width . '%;"';
1768
+	} elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_left_section')) {
1769
+		$width_css = 'style="width:' . $width . '%;"';
1770
+	} elseif ($type == 'search-page' && $width = get_option('geodir_width_search_left_section')) {
1771
+		$width_css = 'style="width:' . $width . '%;"';
1772
+	} elseif ($type == 'author-page' && $width = get_option('geodir_width_author_left_section')) {
1773
+		$width_css = 'style="width:' . $width . '%;"';
1774
+	} else {
1775
+		$width_css = '';
1776
+	}
1777
+
1778
+	$tc = get_option('theme_compatibility_setting');
1779
+	if (!empty($tc['geodir_sidebar_left_open_replace'])) {
1780
+		$text = $tc['geodir_sidebar_left_open_replace'];
1781
+	} else {
1782
+		$text = '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>';
1783
+	}
1784
+
1785
+	if (!empty($tc['geodir_sidebar_left_open_id'])) {
1786
+		$id = $tc['geodir_sidebar_left_open_id'];
1787
+	}
1788
+	if (!empty($tc['geodir_sidebar_left_open_class'])) {
1789
+		$class = $tc['geodir_sidebar_left_open_class'];
1790
+	}
1791
+
1792
+	$text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
1793
+
1794
+	echo $text;
1795 1795
 }
1796 1796
 
1797 1797
 // action for adding the primary div closing tag
@@ -1807,13 +1807,13 @@  discard block
 block discarded – undo
1807 1807
  */
1808 1808
 function geodir_action_sidebar_left_close($type = '')
1809 1809
 {
1810
-    $tc = get_option('theme_compatibility_setting');
1811
-    if (!empty($tc['geodir_sidebar_left_close_replace'])) {
1812
-        $text = $tc['geodir_sidebar_left_close_replace'];
1813
-    } else {
1814
-        $text = '</aside><!-- sidebar ends here-->';
1815
-    }
1816
-    echo $text;
1810
+	$tc = get_option('theme_compatibility_setting');
1811
+	if (!empty($tc['geodir_sidebar_left_close_replace'])) {
1812
+		$text = $tc['geodir_sidebar_left_close_replace'];
1813
+	} else {
1814
+		$text = '</aside><!-- sidebar ends here-->';
1815
+	}
1816
+	echo $text;
1817 1817
 }
1818 1818
 
1819 1819
 /**
@@ -1826,7 +1826,7 @@  discard block
 block discarded – undo
1826 1826
  */
1827 1827
 function geodir_listing_left_section()
1828 1828
 {
1829
-    if (get_option('geodir_show_listing_left_section')) { ?>
1829
+	if (get_option('geodir_show_listing_left_section')) { ?>
1830 1830
         <div class="geodir-content-left geodir-sidebar-wrap">
1831 1831
             <?php dynamic_sidebar('geodir_listing_left_sidebar'); ?>
1832 1832
         </div><!-- end geodir-content-left -->
@@ -1844,20 +1844,20 @@  discard block
 block discarded – undo
1844 1844
  */
1845 1845
 function geodir_action_listings_sidebar_left()
1846 1846
 {
1847
-    if (get_option('geodir_show_listing_left_section')) {
1848
-        /** This action is documented in geodirectory_template_actions.php */
1849
-        do_action('geodir_sidebar_left_open', 'listings-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'https://schema.org/WPSideBar');
1850
-        /**
1851
-         * Calls the listings page (category) left sidebar content.
1852
-         *
1853
-         * All the content for the listings page left sidebar is added via this hook.
1854
-         *
1855
-         * @since 1.0.0
1856
-         */
1857
-        do_action('geodir_listings_sidebar_left_inside');
1858
-        /** This action is documented in geodirectory_template_actions.php */
1859
-        do_action('geodir_sidebar_left_close', 'listings-page');
1860
-    }
1847
+	if (get_option('geodir_show_listing_left_section')) {
1848
+		/** This action is documented in geodirectory_template_actions.php */
1849
+		do_action('geodir_sidebar_left_open', 'listings-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'https://schema.org/WPSideBar');
1850
+		/**
1851
+		 * Calls the listings page (category) left sidebar content.
1852
+		 *
1853
+		 * All the content for the listings page left sidebar is added via this hook.
1854
+		 *
1855
+		 * @since 1.0.0
1856
+		 */
1857
+		do_action('geodir_listings_sidebar_left_inside');
1858
+		/** This action is documented in geodirectory_template_actions.php */
1859
+		do_action('geodir_sidebar_left_close', 'listings-page');
1860
+	}
1861 1861
 }
1862 1862
 
1863 1863
 /**
@@ -1870,7 +1870,7 @@  discard block
 block discarded – undo
1870 1870
  */
1871 1871
 function geodir_listing_right_section()
1872 1872
 {
1873
-    if (get_option('geodir_show_listing_right_section')) { ?>
1873
+	if (get_option('geodir_show_listing_right_section')) { ?>
1874 1874
         <div class="geodir-content-right geodir-sidebar-wrap">
1875 1875
             <?php dynamic_sidebar('geodir_listing_right_sidebar'); ?>
1876 1876
         </div><!-- end geodir-content-right -->
@@ -1888,20 +1888,20 @@  discard block
 block discarded – undo
1888 1888
  */
1889 1889
 function geodir_action_listings_sidebar_right()
1890 1890
 {
1891
-    if (get_option('geodir_show_listing_right_section')) {
1892
-        /** This action is documented in geodirectory_template_actions.php */
1893
-        do_action('geodir_sidebar_right_open', 'listings-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
1894
-        /**
1895
-         * Calls the listings page (category) right sidebar content.
1896
-         *
1897
-         * All the content for the listings page right sidebar is added via this hook.
1898
-         *
1899
-         * @since 1.0.0
1900
-         */
1901
-        do_action('geodir_listings_sidebar_right_inside');
1902
-        /** This action is documented in geodirectory_template_actions.php */
1903
-        do_action('geodir_sidebar_right_close', 'listings-page');
1904
-    }
1891
+	if (get_option('geodir_show_listing_right_section')) {
1892
+		/** This action is documented in geodirectory_template_actions.php */
1893
+		do_action('geodir_sidebar_right_open', 'listings-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
1894
+		/**
1895
+		 * Calls the listings page (category) right sidebar content.
1896
+		 *
1897
+		 * All the content for the listings page right sidebar is added via this hook.
1898
+		 *
1899
+		 * @since 1.0.0
1900
+		 */
1901
+		do_action('geodir_listings_sidebar_right_inside');
1902
+		/** This action is documented in geodirectory_template_actions.php */
1903
+		do_action('geodir_sidebar_right_close', 'listings-page');
1904
+	}
1905 1905
 }
1906 1906
 
1907 1907
 
@@ -1918,23 +1918,23 @@  discard block
 block discarded – undo
1918 1918
  */
1919 1919
 function geodir_action_main_content_open($type = '', $id = '', $class = '')
1920 1920
 {
1921
-    $tc = get_option('theme_compatibility_setting');
1922
-    if (!empty($tc['geodir_main_content_open_replace'])) {
1923
-        $text = $tc['geodir_main_content_open_replace'];
1924
-    } else {
1925
-        $text = '<main id="[id]" class="[class]" role="main">';
1926
-    }
1921
+	$tc = get_option('theme_compatibility_setting');
1922
+	if (!empty($tc['geodir_main_content_open_replace'])) {
1923
+		$text = $tc['geodir_main_content_open_replace'];
1924
+	} else {
1925
+		$text = '<main id="[id]" class="[class]" role="main">';
1926
+	}
1927 1927
 
1928
-    if (!empty($tc['geodir_main_content_open_id'])) {
1929
-        $id = $tc['geodir_main_content_open_id'];
1930
-    }
1931
-    if (!empty($tc['geodir_main_content_open_class'])) {
1932
-        $class = $tc['geodir_main_content_open_class'];
1933
-    }
1928
+	if (!empty($tc['geodir_main_content_open_id'])) {
1929
+		$id = $tc['geodir_main_content_open_id'];
1930
+	}
1931
+	if (!empty($tc['geodir_main_content_open_class'])) {
1932
+		$class = $tc['geodir_main_content_open_class'];
1933
+	}
1934 1934
 
1935
-    $text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
1935
+	$text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
1936 1936
 
1937
-    echo $text;
1937
+	echo $text;
1938 1938
 }
1939 1939
 
1940 1940
 // action for adding the primary div closing tag
@@ -1947,13 +1947,13 @@  discard block
 block discarded – undo
1947 1947
  */
1948 1948
 function geodir_action_main_content_close()
1949 1949
 {
1950
-    $tc = get_option('theme_compatibility_setting');
1951
-    if (!empty($tc['geodir_main_content_close_replace'])) {
1952
-        $text = $tc['geodir_main_content_close_replace'];
1953
-    } else {
1954
-        $text = '</main><!-- main ends here-->';
1955
-    }
1956
-    echo $text;
1950
+	$tc = get_option('theme_compatibility_setting');
1951
+	if (!empty($tc['geodir_main_content_close_replace'])) {
1952
+		$text = $tc['geodir_main_content_close_replace'];
1953
+	} else {
1954
+		$text = '</main><!-- main ends here-->';
1955
+	}
1956
+	echo $text;
1957 1957
 }
1958 1958
 
1959 1959
 /**
@@ -1965,14 +1965,14 @@  discard block
 block discarded – undo
1965 1965
  */
1966 1966
 function geodir_action_listings_content_inside()
1967 1967
 {
1968
-    global $gridview_columns;
1969
-    $listing_view = get_option('geodir_listing_view');
1970
-    if (strstr($listing_view, 'gridview')) {
1971
-        $gridview_columns = $listing_view;
1972
-        $listing_view_exp = explode('_', $listing_view);
1973
-        $listing_view = $listing_view_exp[0];
1974
-    }
1975
-    geodir_get_template_part('listing', 'listview');
1968
+	global $gridview_columns;
1969
+	$listing_view = get_option('geodir_listing_view');
1970
+	if (strstr($listing_view, 'gridview')) {
1971
+		$gridview_columns = $listing_view;
1972
+		$listing_view_exp = explode('_', $listing_view);
1973
+		$listing_view = $listing_view_exp[0];
1974
+	}
1975
+	geodir_get_template_part('listing', 'listview');
1976 1976
 }
1977 1977
 
1978 1978
 add_action('geodir_listings_content_inside', 'geodir_action_listings_content_inside', 10);
@@ -1988,47 +1988,47 @@  discard block
 block discarded – undo
1988 1988
  */
1989 1989
 function geodir_action_listings_content()
1990 1990
 {
1991
-    /**
1992
-     * This is used to add HTML opening wrappers to the main content of most pages including listings, author, search, home etc.
1993
-     *
1994
-     * @since 1.0.0
1995
-     * @param string $type The page type. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
1996
-     * @param string $id The id for the div. Usually 'geodir-main-content'.
1997
-     * @param string $class The class for the div. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
1998
-     * @see 'geodir_main_content_close' Where the oposing closing tag is added.
1999
-     */
2000
-    do_action('geodir_main_content_open', 'listings-page', 'geodir-main-content', 'listings-page');
2001
-    $extra_class = apply_filters('geodir_before_listing_wrapper_extra_class', '', 'listings-page');
2002
-    echo '<div class="clearfix '.$extra_class.'">';
2003
-    /**
2004
-     * Called before the listings page content, inside the outer wrapper. Used on listings pages and search and author pages.
2005
-     *
2006
-     * @since 1.0.0
2007
-     */
2008
-    do_action('geodir_before_listing');
2009
-    echo '</div>';
2010
-
2011
-    /**
2012
-     * This actions calls the listings list content. Used on listings pages and search and author pages.
2013
-     *
2014
-     * @since 1.0.0
2015
-     */
2016
-    do_action('geodir_listings_content_inside');
2017
-
2018
-    /**
2019
-     * Called after the listings content, inside the outer wrapper HTML. Used on listings pages and search and author pages.
2020
-     *
2021
-     * @since 1.0.0
2022
-     */
2023
-    do_action('geodir_after_listing');
2024
-
2025
-    /**
2026
-     * This is used to add HTML closing wrappers to the main content of most pages including listings, author, search, home etc.
2027
-     *
2028
-     * @since 1.0.0
2029
-     * @see 'geodir_main_content_open' Where the oposing opening tag is added.
2030
-     */
2031
-    do_action('geodir_main_content_close', 'listings-page');
1991
+	/**
1992
+	 * This is used to add HTML opening wrappers to the main content of most pages including listings, author, search, home etc.
1993
+	 *
1994
+	 * @since 1.0.0
1995
+	 * @param string $type The page type. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
1996
+	 * @param string $id The id for the div. Usually 'geodir-main-content'.
1997
+	 * @param string $class The class for the div. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
1998
+	 * @see 'geodir_main_content_close' Where the oposing closing tag is added.
1999
+	 */
2000
+	do_action('geodir_main_content_open', 'listings-page', 'geodir-main-content', 'listings-page');
2001
+	$extra_class = apply_filters('geodir_before_listing_wrapper_extra_class', '', 'listings-page');
2002
+	echo '<div class="clearfix '.$extra_class.'">';
2003
+	/**
2004
+	 * Called before the listings page content, inside the outer wrapper. Used on listings pages and search and author pages.
2005
+	 *
2006
+	 * @since 1.0.0
2007
+	 */
2008
+	do_action('geodir_before_listing');
2009
+	echo '</div>';
2010
+
2011
+	/**
2012
+	 * This actions calls the listings list content. Used on listings pages and search and author pages.
2013
+	 *
2014
+	 * @since 1.0.0
2015
+	 */
2016
+	do_action('geodir_listings_content_inside');
2017
+
2018
+	/**
2019
+	 * Called after the listings content, inside the outer wrapper HTML. Used on listings pages and search and author pages.
2020
+	 *
2021
+	 * @since 1.0.0
2022
+	 */
2023
+	do_action('geodir_after_listing');
2024
+
2025
+	/**
2026
+	 * This is used to add HTML closing wrappers to the main content of most pages including listings, author, search, home etc.
2027
+	 *
2028
+	 * @since 1.0.0
2029
+	 * @see 'geodir_main_content_open' Where the oposing opening tag is added.
2030
+	 */
2031
+	do_action('geodir_main_content_close', 'listings-page');
2032 2032
 }
2033 2033
 
2034 2034
 
@@ -2043,10 +2043,10 @@  discard block
 block discarded – undo
2043 2043
  */
2044 2044
 function geodir_action_sidebar_listings_bottom_section()
2045 2045
 {
2046
-    if (get_option('geodir_show_listing_bottom_section')) { ?>
2046
+	if (get_option('geodir_show_listing_bottom_section')) { ?>
2047 2047
         <div class="<?php
2048
-            /** This action is documented in geodirectory_template_actions.php */
2049
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_bottom'); ?>">
2048
+			/** This action is documented in geodirectory_template_actions.php */
2049
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_bottom'); ?>">
2050 2050
             <?php dynamic_sidebar('geodir_listing_bottom'); ?>
2051 2051
         </div><!-- clearfix ends here-->
2052 2052
     <?php }
@@ -2066,38 +2066,38 @@  discard block
 block discarded – undo
2066 2066
  */
2067 2067
 function geodir_action_add_listing_page_title()
2068 2068
 {
2069
-    if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '')
2070
-        $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2071
-    /** This action is documented in geodirectory_template_actions.php */
2072
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
2073
-    /** This action is documented in geodirectory_template_actions.php */
2074
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2075
-
2076
-    $title = apply_filters('geodir_add_listing_page_title_text', get_the_title());
2077
-
2078
-    if(geodir_is_page('add-listing')){
2079
-        $gd_page = 'add-listing';
2080
-        if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
2081
-            $title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
2082
-        }elseif(isset($listing_type)){
2083
-            $title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
2084
-        }
2069
+	if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '')
2070
+		$listing_type = sanitize_text_field($_REQUEST['listing_type']);
2071
+	/** This action is documented in geodirectory_template_actions.php */
2072
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
2073
+	/** This action is documented in geodirectory_template_actions.php */
2074
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2075
+
2076
+	$title = apply_filters('geodir_add_listing_page_title_text', get_the_title());
2077
+
2078
+	if(geodir_is_page('add-listing')){
2079
+		$gd_page = 'add-listing';
2080
+		if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
2081
+			$title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
2082
+		}elseif(isset($listing_type)){
2083
+			$title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
2084
+		}
2085 2085
 
2086
-    }
2086
+	}
2087 2087
 
2088 2088
 
2089
-    /**
2090
-     * Filter page title to replace variables.
2091
-     *
2092
-     * @since 1.5.4
2093
-     * @param string $title The page title including variables.
2094
-     * @param string $gd_page The GeoDirectory page type if any.
2095
-     */
2096
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2089
+	/**
2090
+	 * Filter page title to replace variables.
2091
+	 *
2092
+	 * @since 1.5.4
2093
+	 * @param string $title The page title including variables.
2094
+	 * @param string $gd_page The GeoDirectory page type if any.
2095
+	 */
2096
+	$title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2097 2097
 
2098
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">';
2099
-    echo $title;
2100
-    echo '</h1></header>';
2098
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">';
2099
+	echo $title;
2100
+	echo '</h1></header>';
2101 2101
 }
2102 2102
 
2103 2103
 add_action('geodir_add_listing_page_mandatory', 'geodir_action_add_listing_page_mandatory', 10);
@@ -2128,59 +2128,59 @@  discard block
 block discarded – undo
2128 2128
  */
2129 2129
 function geodir_action_add_listing_form()
2130 2130
 {
2131
-    global $cat_display, $post_cat, $current_user, $gd_session;
2132
-    $page_id = get_the_ID();
2133
-    $post = '';
2134
-    $title = '';
2135
-    $desc = '';
2136
-    $kw_tags = '';
2137
-    $required_msg = '';
2138
-    $submit_button = '';
2139
-
2140
-    $ajax_action = isset($_REQUEST['ajax_action']) ? $_REQUEST['ajax_action'] : 'add';
2141
-
2142
-    $thumb_img_arr = array();
2143
-    $curImages = '';
2144
-
2145
-    if (isset($_REQUEST['backandedit'])) {
2146
-        global $post;
2147
-        $post = (object)$gd_session->get('listing');
2148
-        $listing_type = $post->listing_type;
2149
-        $title = $post->post_title;
2150
-        $desc = $post->post_desc;
2151
-        $post_cat = $post->post_category;
2152
-
2153
-        $kw_tags = $post->post_tags;
2154
-        $curImages = isset($post->post_images) ? $post->post_images : '';
2155
-    } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2156
-        global $post, $post_images;
2157
-
2158
-        $post = geodir_get_post_info($_REQUEST['pid']);
2159
-        $thumb_img_arr = geodir_get_images($post->ID);
2160
-        if ($thumb_img_arr) {
2161
-            foreach ($thumb_img_arr as $post_img) {
2162
-                $curImages .= $post_img->src . ',';
2163
-            }
2164
-        }
2131
+	global $cat_display, $post_cat, $current_user, $gd_session;
2132
+	$page_id = get_the_ID();
2133
+	$post = '';
2134
+	$title = '';
2135
+	$desc = '';
2136
+	$kw_tags = '';
2137
+	$required_msg = '';
2138
+	$submit_button = '';
2139
+
2140
+	$ajax_action = isset($_REQUEST['ajax_action']) ? $_REQUEST['ajax_action'] : 'add';
2141
+
2142
+	$thumb_img_arr = array();
2143
+	$curImages = '';
2144
+
2145
+	if (isset($_REQUEST['backandedit'])) {
2146
+		global $post;
2147
+		$post = (object)$gd_session->get('listing');
2148
+		$listing_type = $post->listing_type;
2149
+		$title = $post->post_title;
2150
+		$desc = $post->post_desc;
2151
+		$post_cat = $post->post_category;
2152
+
2153
+		$kw_tags = $post->post_tags;
2154
+		$curImages = isset($post->post_images) ? $post->post_images : '';
2155
+	} elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2156
+		global $post, $post_images;
2157
+
2158
+		$post = geodir_get_post_info($_REQUEST['pid']);
2159
+		$thumb_img_arr = geodir_get_images($post->ID);
2160
+		if ($thumb_img_arr) {
2161
+			foreach ($thumb_img_arr as $post_img) {
2162
+				$curImages .= $post_img->src . ',';
2163
+			}
2164
+		}
2165 2165
 
2166
-        $listing_type = $post->post_type;
2167
-        $title = $post->post_title;
2168
-        $desc = $post->post_content;
2169
-        $kw_tags = $post->post_tags;
2170
-        $kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type . '_tags', array('fields' => 'names')));
2171
-    } else {
2172
-        $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2173
-    }
2166
+		$listing_type = $post->post_type;
2167
+		$title = $post->post_title;
2168
+		$desc = $post->post_content;
2169
+		$kw_tags = $post->post_tags;
2170
+		$kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type . '_tags', array('fields' => 'names')));
2171
+	} else {
2172
+		$listing_type = sanitize_text_field($_REQUEST['listing_type']);
2173
+	}
2174 2174
 
2175
-    if ($current_user->ID != '0') {
2176
-        $user_login = true;
2177
-    }
2175
+	if ($current_user->ID != '0') {
2176
+		$user_login = true;
2177
+	}
2178 2178
 
2179
-    $post_type_info = geodir_get_posttype_info($listing_type);
2179
+	$post_type_info = geodir_get_posttype_info($listing_type);
2180 2180
 
2181
-    $cpt_singular_name = (isset($post_type_info['labels']['singular_name']) && $post_type_info['labels']['singular_name']) ? $post_type_info['labels']['singular_name'] : __('Listing','geodirectory');
2181
+	$cpt_singular_name = (isset($post_type_info['labels']['singular_name']) && $post_type_info['labels']['singular_name']) ? $post_type_info['labels']['singular_name'] : __('Listing','geodirectory');
2182 2182
 
2183
-    ?>
2183
+	?>
2184 2184
     <form name="propertyform" id="propertyform" action="<?php echo get_page_link(geodir_preview_page_id());?>" method="post" enctype="multipart/form-data">
2185 2185
         <input type="hidden" name="preview" value="<?php echo sanitize_text_field($listing_type);?>"/>
2186 2186
         <input type="hidden" name="listing_type" value="<?php echo sanitize_text_field($listing_type);?>"/>
@@ -2191,103 +2191,103 @@  discard block
 block discarded – undo
2191 2191
         <?php } if (isset($_REQUEST['backandedit'])) { ?>
2192 2192
             <input type="hidden" name="backandedit" value="<?php echo sanitize_text_field($_REQUEST['backandedit']);?>"/>
2193 2193
         <?php
2194
-        } 
2195
-        /**
2196
-         * Called at the very top of the add listing page form for frontend.
2197
-         *
2198
-         * This is called just before the "Enter Listing Details" text.
2199
-         *
2200
-         * @since 1.0.0
2201
-         */
2202
-        do_action('geodir_before_detail_fields');
2203
-        ?>
2194
+		} 
2195
+		/**
2196
+		 * Called at the very top of the add listing page form for frontend.
2197
+		 *
2198
+		 * This is called just before the "Enter Listing Details" text.
2199
+		 *
2200
+		 * @since 1.0.0
2201
+		 */
2202
+		do_action('geodir_before_detail_fields');
2203
+		?>
2204 2204
         <h5 id="geodir_fieldset_details" class="geodir-fieldset-row" gd-fieldset="details"><?php echo LISTING_DETAILS_TEXT;?></h5>
2205 2205
         <?php
2206
-        /**
2207
-         * Called at the top of the add listing page form for frontend.
2208
-         *
2209
-         * This is called after the "Enter Listing Details" text.
2210
-         *
2211
-         * @since 1.0.0
2212
-         */
2213
-        do_action('geodir_before_main_form_fields');
2214
-        ?>
2206
+		/**
2207
+		 * Called at the top of the add listing page form for frontend.
2208
+		 *
2209
+		 * This is called after the "Enter Listing Details" text.
2210
+		 *
2211
+		 * @since 1.0.0
2212
+		 */
2213
+		do_action('geodir_before_main_form_fields');
2214
+		?>
2215 2215
         <div id="geodir_post_title_row" class="required_field geodir_form_row clearfix gd-fieldset-details">
2216 2216
             <label><?php
2217
-                /**
2218
-                 * Filter the add listing page title input label.
2219
-                 *
2220
-                 * @since 1.6.11
2221
-                 * @param string $title The title to be output.
2222
-                 * @param string $cpt_singular_name The singular title of the curent CPT.
2223
-                 * @param string $listing_type The CPT being requested. ie: gd_place.
2224
-                 */
2225
-                echo apply_filters('geodir_add_listing_title_label', sprintf( __('%s Title', 'geodirectory'), $cpt_singular_name ),$cpt_singular_name,$listing_type); ?><span>*</span> </label>
2217
+				/**
2218
+				 * Filter the add listing page title input label.
2219
+				 *
2220
+				 * @since 1.6.11
2221
+				 * @param string $title The title to be output.
2222
+				 * @param string $cpt_singular_name The singular title of the curent CPT.
2223
+				 * @param string $listing_type The CPT being requested. ie: gd_place.
2224
+				 */
2225
+				echo apply_filters('geodir_add_listing_title_label', sprintf( __('%s Title', 'geodirectory'), $cpt_singular_name ),$cpt_singular_name,$listing_type); ?><span>*</span> </label>
2226 2226
             <input type="text" field_type="text" name="post_title" id="post_title" class="geodir_textfield"
2227 2227
                    value="<?php echo esc_attr(stripslashes($title)); ?>"/>
2228 2228
             <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory');?></span>
2229 2229
         </div>
2230 2230
         <?php
2231
-        $show_editor = get_option('geodir_tiny_editor_on_add_listing');
2232
-
2233
-        $desc = $show_editor ? stripslashes($desc) : esc_attr(stripslashes($desc));
2234
-        $desc_limit = '';
2235
-        /**
2236
-         * Filter the add listing description field character limit number.
2237
-         *
2238
-         * @since 1.0.0
2239
-         * @param int $desc_limit The amount of characters to limit the description to.
2240
-         */
2241
-        $desc_limit = apply_filters('geodir_description_field_desc_limit', $desc_limit);
2242
-        /**
2243
-         * Filter the add listing description field text.
2244
-         *
2245
-         * @since 1.0.0
2246
-         * @param string $desc The text for the description field.
2247
-         * @param int $desc_limit The character limit number if any.
2248
-         */
2249
-        $desc = apply_filters('geodir_description_field_desc', $desc, $desc_limit);
2250
-        $desc_limit_msg = '';
2251
-        /**
2252
-         * Filter the add listing description limit message.
2253
-         *
2254
-         * This is the message shown if there is a limit applied to the amount of characters the description can use.
2255
-         *
2256
-         * @since 1.0.0
2257
-         * @param string $desc_limit_msg The limit message string if any.
2258
-         * @param int $desc_limit The character limit numer if any.
2259
-         */
2260
-        $desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit);
2231
+		$show_editor = get_option('geodir_tiny_editor_on_add_listing');
2232
+
2233
+		$desc = $show_editor ? stripslashes($desc) : esc_attr(stripslashes($desc));
2234
+		$desc_limit = '';
2235
+		/**
2236
+		 * Filter the add listing description field character limit number.
2237
+		 *
2238
+		 * @since 1.0.0
2239
+		 * @param int $desc_limit The amount of characters to limit the description to.
2240
+		 */
2241
+		$desc_limit = apply_filters('geodir_description_field_desc_limit', $desc_limit);
2242
+		/**
2243
+		 * Filter the add listing description field text.
2244
+		 *
2245
+		 * @since 1.0.0
2246
+		 * @param string $desc The text for the description field.
2247
+		 * @param int $desc_limit The character limit number if any.
2248
+		 */
2249
+		$desc = apply_filters('geodir_description_field_desc', $desc, $desc_limit);
2250
+		$desc_limit_msg = '';
2251
+		/**
2252
+		 * Filter the add listing description limit message.
2253
+		 *
2254
+		 * This is the message shown if there is a limit applied to the amount of characters the description can use.
2255
+		 *
2256
+		 * @since 1.0.0
2257
+		 * @param string $desc_limit_msg The limit message string if any.
2258
+		 * @param int $desc_limit The character limit numer if any.
2259
+		 */
2260
+		$desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit);
2261 2261
         
2262
-        $desc_class = '';
2263
-        if ($desc_limit === '' || (int)$desc_limit > 0) {
2264
-            /**
2265
-             * Called on the add listing page form for frontend just before the description field.
2266
-             *
2267
-             * @since 1.0.0
2268
-             */
2269
-            do_action('geodir_before_description_field');
2262
+		$desc_class = '';
2263
+		if ($desc_limit === '' || (int)$desc_limit > 0) {
2264
+			/**
2265
+			 * Called on the add listing page form for frontend just before the description field.
2266
+			 *
2267
+			 * @since 1.0.0
2268
+			 */
2269
+			do_action('geodir_before_description_field');
2270 2270
             
2271
-            $desc_class = ' required_field';
2272
-        } else {
2273
-            $desc_class = ' hidden';
2274
-        }
2275
-        ?>
2271
+			$desc_class = ' required_field';
2272
+		} else {
2273
+			$desc_class = ' hidden';
2274
+		}
2275
+		?>
2276 2276
         <div id="geodir_post_desc_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $desc_class;?>">
2277 2277
             <label><?php
2278
-                /**
2279
-                 * Filter the add listing page description input label.
2280
-                 *
2281
-                 * @since 1.6.11
2282
-                 * @param string $title The title to be output.
2283
-                 * @param string $cpt_singular_name The singular title of the curent CPT.
2284
-                 * @param string $listing_type The CPT being requested. ie: gd_place.
2285
-                 */
2286
-                echo apply_filters('geodir_add_listing_description_label',sprintf( __('%s Description', 'geodirectory'), $cpt_singular_name ),$cpt_singular_name,$listing_type); ?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label>
2278
+				/**
2279
+				 * Filter the add listing page description input label.
2280
+				 *
2281
+				 * @since 1.6.11
2282
+				 * @param string $title The title to be output.
2283
+				 * @param string $cpt_singular_name The singular title of the curent CPT.
2284
+				 * @param string $listing_type The CPT being requested. ie: gd_place.
2285
+				 */
2286
+				echo apply_filters('geodir_add_listing_description_label',sprintf( __('%s Description', 'geodirectory'), $cpt_singular_name ),$cpt_singular_name,$listing_type); ?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label>
2287 2287
             <?php
2288
-            if (!empty($show_editor) && in_array($listing_type, $show_editor)) {
2289
-                $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
2290
-            ?>
2288
+			if (!empty($show_editor) && in_array($listing_type, $show_editor)) {
2289
+				$editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
2290
+			?>
2291 2291
                 <div class="editor" field_id="post_desc" field_type="editor">
2292 2292
                     <?php wp_editor($desc, "post_desc", $editor_settings); ?>
2293 2293
                 </div>
@@ -2301,56 +2301,56 @@  discard block
 block discarded – undo
2301 2301
             <span class="geodir_message_error"><?php echo _e($required_msg, 'geodirectory');?></span>
2302 2302
         </div>
2303 2303
         <?php
2304
-        if ($desc_limit === '' || (int)$desc_limit > 0) {
2305
-            /**
2306
-             * Called on the add listing page form for frontend just after the description field.
2307
-             *
2308
-             * @since 1.0.0
2309
-             */
2310
-            do_action('geodir_after_description_field');
2311
-        }
2304
+		if ($desc_limit === '' || (int)$desc_limit > 0) {
2305
+			/**
2306
+			 * Called on the add listing page form for frontend just after the description field.
2307
+			 *
2308
+			 * @since 1.0.0
2309
+			 */
2310
+			do_action('geodir_after_description_field');
2311
+		}
2312 2312
         
2313
-        $kw_tags = esc_attr(stripslashes($kw_tags));
2314
-        $kw_tags_count = TAGKW_TEXT_COUNT;
2315
-        $kw_tags_msg = TAGKW_MSG;
2316
-        /**
2317
-         * Filter the add listing tags character limit.
2318
-         *
2319
-         * @since 1.0.0
2320
-         * @param int $kw_tags_count The character count limit if any.
2321
-         */
2322
-        $kw_tags_count = apply_filters('geodir_listing_tags_field_tags_count', $kw_tags_count);
2323
-        /**
2324
-         * Filter the add listing tags field value.
2325
-         *
2326
-         * You can use the $_REQUEST values to check if this is a go back and edit value etc.
2327
-         *
2328
-         * @since 1.0.0
2329
-         * @param string $kw_tags The tag field value, usually a comma separated list of tags.
2330
-         * @param int $kw_tags_count The character count limit if any.
2331
-         */
2332
-        $kw_tags = apply_filters('geodir_listing_tags_field_tags', $kw_tags, $kw_tags_count);
2333
-        /**
2334
-         * Filter the add listing tags field message text.
2335
-         *
2336
-         * @since 1.0.0
2337
-         * @param string $kw_tags_msg The message shown under the field.
2338
-         * @param int $kw_tags_count The character count limit if any.
2339
-         */
2340
-        $kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count);
2313
+		$kw_tags = esc_attr(stripslashes($kw_tags));
2314
+		$kw_tags_count = TAGKW_TEXT_COUNT;
2315
+		$kw_tags_msg = TAGKW_MSG;
2316
+		/**
2317
+		 * Filter the add listing tags character limit.
2318
+		 *
2319
+		 * @since 1.0.0
2320
+		 * @param int $kw_tags_count The character count limit if any.
2321
+		 */
2322
+		$kw_tags_count = apply_filters('geodir_listing_tags_field_tags_count', $kw_tags_count);
2323
+		/**
2324
+		 * Filter the add listing tags field value.
2325
+		 *
2326
+		 * You can use the $_REQUEST values to check if this is a go back and edit value etc.
2327
+		 *
2328
+		 * @since 1.0.0
2329
+		 * @param string $kw_tags The tag field value, usually a comma separated list of tags.
2330
+		 * @param int $kw_tags_count The character count limit if any.
2331
+		 */
2332
+		$kw_tags = apply_filters('geodir_listing_tags_field_tags', $kw_tags, $kw_tags_count);
2333
+		/**
2334
+		 * Filter the add listing tags field message text.
2335
+		 *
2336
+		 * @since 1.0.0
2337
+		 * @param string $kw_tags_msg The message shown under the field.
2338
+		 * @param int $kw_tags_count The character count limit if any.
2339
+		 */
2340
+		$kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count);
2341 2341
         
2342
-        $tags_class = '';
2343
-        if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2344
-            /**
2345
-             * Called on the add listing page form for frontend just before the tags field.
2346
-             *
2347
-             * @since 1.0.0
2348
-             */
2349
-            do_action('geodir_before_listing_tags_field');
2350
-        } else {
2351
-            $tags_class = ' hidden';
2352
-        }
2353
-        ?>
2342
+		$tags_class = '';
2343
+		if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2344
+			/**
2345
+			 * Called on the add listing page form for frontend just before the tags field.
2346
+			 *
2347
+			 * @since 1.0.0
2348
+			 */
2349
+			do_action('geodir_before_listing_tags_field');
2350
+		} else {
2351
+			$tags_class = ' hidden';
2352
+		}
2353
+		?>
2354 2354
         <div id="geodir_post_tags_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $tags_class;?>">
2355 2355
             <label><?php echo TAGKW_TEXT; ?></label>
2356 2356
             <input name="post_tags" id="post_tags" value="<?php echo $kw_tags; ?>" type="text" class="geodir_textfield"
@@ -2358,90 +2358,90 @@  discard block
 block discarded – undo
2358 2358
             <span class="geodir_message_note"><?php echo $kw_tags_msg;?></span>
2359 2359
         </div>
2360 2360
         <?php
2361
-        if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2362
-            /**
2363
-             * Called on the add listing page form for frontend just after the tags field.
2364
-             *
2365
-             * @since 1.0.0
2366
-             */
2367
-            do_action('geodir_after_listing_tags_field');
2368
-        }
2361
+		if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2362
+			/**
2363
+			 * Called on the add listing page form for frontend just after the tags field.
2364
+			 *
2365
+			 * @since 1.0.0
2366
+			 */
2367
+			do_action('geodir_after_listing_tags_field');
2368
+		}
2369 2369
         
2370
-        $package_info = array();
2371
-        $package_info = geodir_post_package_info($package_info, $post);
2370
+		$package_info = array();
2371
+		$package_info = geodir_post_package_info($package_info, $post);
2372 2372
         
2373
-        geodir_get_custom_fields_html($package_info->pid, 'all', $listing_type);
2373
+		geodir_get_custom_fields_html($package_info->pid, 'all', $listing_type);
2374 2374
         
2375
-        // adjust values here
2376
-        $id = "post_images"; // this will be the name of form field. Image url(s) will be submitted in $_POST using this key. So if $id == �img1� then $_POST[�img1�] will have all the image urls
2377
-
2378
-        $multiple = true; // allow multiple files upload
2375
+		// adjust values here
2376
+		$id = "post_images"; // this will be the name of form field. Image url(s) will be submitted in $_POST using this key. So if $id == �img1� then $_POST[�img1�] will have all the image urls
2379 2377
 
2380
-        $width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels)
2378
+		$multiple = true; // allow multiple files upload
2381 2379
 
2382
-        $height = geodir_media_image_large_height(); // If you want to automatically resize all uploaded images then provide height here (in pixels)
2380
+		$width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels)
2383 2381
 
2384
-        $thumb_img_arr = array();
2385
-        $totImg = 0;
2386
-        if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
2387
-            $post = (object)$gd_session->get('listing');
2388
-            if (isset($post->post_images))
2389
-                $curImages = trim($post->post_images, ",");
2382
+		$height = geodir_media_image_large_height(); // If you want to automatically resize all uploaded images then provide height here (in pixels)
2390 2383
 
2384
+		$thumb_img_arr = array();
2385
+		$totImg = 0;
2386
+		if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
2387
+			$post = (object)$gd_session->get('listing');
2388
+			if (isset($post->post_images))
2389
+				$curImages = trim($post->post_images, ",");
2391 2390
 
2392
-            if ($curImages != '') {
2393
-                $curImages_array = explode(',', $curImages);
2394
-                $totImg = count($curImages_array);
2395
-            }
2396 2391
 
2397
-            $listing_type = $post->listing_type;
2392
+			if ($curImages != '') {
2393
+				$curImages_array = explode(',', $curImages);
2394
+				$totImg = count($curImages_array);
2395
+			}
2398 2396
 
2399
-        } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2400
-            $post = geodir_get_post_info((int)$_REQUEST['pid']);
2401
-            $listing_type = $post->post_type;
2402
-            $thumb_img_arr = geodir_get_images($_REQUEST['pid']);
2397
+			$listing_type = $post->listing_type;
2403 2398
 
2404
-        } else {
2405
-            $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2406
-        }
2399
+		} elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2400
+			$post = geodir_get_post_info((int)$_REQUEST['pid']);
2401
+			$listing_type = $post->post_type;
2402
+			$thumb_img_arr = geodir_get_images($_REQUEST['pid']);
2407 2403
 
2404
+		} else {
2405
+			$listing_type = sanitize_text_field($_REQUEST['listing_type']);
2406
+		}
2408 2407
 
2409
-        if (!empty($thumb_img_arr)) {
2410
-            foreach ($thumb_img_arr as $img) {
2411
-                //$curImages = $img->src.",";
2412
-            }
2413 2408
 
2414
-            $totImg = count((array)$thumb_img_arr);
2415
-        }
2409
+		if (!empty($thumb_img_arr)) {
2410
+			foreach ($thumb_img_arr as $img) {
2411
+				//$curImages = $img->src.",";
2412
+			}
2416 2413
 
2417
-        if ($curImages != '')
2418
-            $svalue = $curImages; // this will be initial value of the above form field. Image urls.
2419
-        else
2420
-            $svalue = '';
2421
-
2422
-        $image_limit = isset($package_info->image_limit) ? $package_info->image_limit : '0';
2423
-        $show_image_input_box = ($image_limit != '0');
2424
-        /**
2425
-         * Filter to be able to show/hide the image upload section of the add listing form.
2426
-         *
2427
-         * @since 1.0.0
2428
-         * @param bool $show_image_input_box Set true to show. Set false to not show.
2429
-         * @param string $listing_type The custom post type slug.
2430
-         */
2431
-        $show_image_input_box = apply_filters('geodir_image_uploader_on_add_listing', $show_image_input_box, $listing_type);
2432
-        if ($show_image_input_box) {
2433
-            ?>
2414
+			$totImg = count((array)$thumb_img_arr);
2415
+		}
2416
+
2417
+		if ($curImages != '')
2418
+			$svalue = $curImages; // this will be initial value of the above form field. Image urls.
2419
+		else
2420
+			$svalue = '';
2421
+
2422
+		$image_limit = isset($package_info->image_limit) ? $package_info->image_limit : '0';
2423
+		$show_image_input_box = ($image_limit != '0');
2424
+		/**
2425
+		 * Filter to be able to show/hide the image upload section of the add listing form.
2426
+		 *
2427
+		 * @since 1.0.0
2428
+		 * @param bool $show_image_input_box Set true to show. Set false to not show.
2429
+		 * @param string $listing_type The custom post type slug.
2430
+		 */
2431
+		$show_image_input_box = apply_filters('geodir_image_uploader_on_add_listing', $show_image_input_box, $listing_type);
2432
+		if ($show_image_input_box) {
2433
+			?>
2434 2434
 
2435 2435
             <h5 id="geodir_form_title_row" class="geodir-form_title"> <?php echo PRO_PHOTO_TEXT;?>
2436 2436
                 <?php if ($image_limit == 1) {
2437
-                    echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
2438
-                } ?>
2437
+					echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
2438
+				} ?>
2439 2439
                 <?php if ($image_limit > 1) {
2440
-                    echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>';
2441
-                } ?>
2440
+					echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>';
2441
+				} ?>
2442 2442
                 <?php if ($image_limit == '') {
2443
-                    echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>';
2444
-                } ?>
2443
+					echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>';
2444
+				} ?>
2445 2445
             </h5>
2446 2446
 
2447 2447
             <div class="geodir_form_row clearfix" id="<?php echo $id; ?>dropbox"
@@ -2479,12 +2479,12 @@  discard block
 block discarded – undo
2479 2479
         <?php } ?>
2480 2480
 
2481 2481
         <?php
2482
-        /**
2483
-         * Called on the add listing page form for frontend just after the image upload field.
2484
-         *
2485
-         * @since 1.0.0
2486
-         */
2487
-        do_action('geodir_after_main_form_fields');?>
2482
+		/**
2483
+		 * Called on the add listing page form for frontend just after the image upload field.
2484
+		 *
2485
+		 * @since 1.0.0
2486
+		 */
2487
+		do_action('geodir_after_main_form_fields');?>
2488 2488
 
2489 2489
 
2490 2490
         <!-- add captcha code -->
@@ -2513,7 +2513,7 @@  discard block
 block discarded – undo
2513 2513
 
2514 2514
     </form>
2515 2515
     <?php
2516
-    wp_reset_query();
2516
+	wp_reset_query();
2517 2517
 }
2518 2518
 
2519 2519
 /**
@@ -2524,7 +2524,7 @@  discard block
 block discarded – undo
2524 2524
  */
2525 2525
 function geodir_add_listing_sidebar_widget_area()
2526 2526
 {
2527
-    dynamic_sidebar('geodir_add_listing_sidebar');
2527
+	dynamic_sidebar('geodir_add_listing_sidebar');
2528 2528
 }
2529 2529
 
2530 2530
 add_action('geodir_add_listing_sidebar_inside', 'geodir_add_listing_sidebar_widget_area', 10);
@@ -2539,16 +2539,16 @@  discard block
 block discarded – undo
2539 2539
  */
2540 2540
 function geodir_action_add_listing_sidebar()
2541 2541
 {
2542
-    /** This action is documented in geodirectory_template_actions.php */
2543
-    do_action('geodir_sidebar_right_open', 'add-listing-page', 'geodir-sidebar', 'geodir-sidebar-right', 'http://schema.org/WPSideBar');
2544
-    /**
2545
-     * This is used to add the content to the add listing page sidebar.
2546
-     *
2547
-     * @since 1.0.0
2548
-     */
2549
-    do_action('geodir_add_listing_sidebar_inside');
2550
-    /** This action is documented in geodirectory_template_actions.php */
2551
-    do_action('geodir_sidebar_right_close', 'details-page');
2542
+	/** This action is documented in geodirectory_template_actions.php */
2543
+	do_action('geodir_sidebar_right_open', 'add-listing-page', 'geodir-sidebar', 'geodir-sidebar-right', 'http://schema.org/WPSideBar');
2544
+	/**
2545
+	 * This is used to add the content to the add listing page sidebar.
2546
+	 *
2547
+	 * @since 1.0.0
2548
+	 */
2549
+	do_action('geodir_add_listing_sidebar_inside');
2550
+	/** This action is documented in geodirectory_template_actions.php */
2551
+	do_action('geodir_sidebar_right_close', 'details-page');
2552 2552
 }
2553 2553
 
2554 2554
 ###############################################
@@ -2565,11 +2565,11 @@  discard block
 block discarded – undo
2565 2565
  */
2566 2566
 function geodir_action_geodir_sidebar_signup_top()
2567 2567
 {
2568
-    ?>
2568
+	?>
2569 2569
     <div
2570 2570
         class="<?php
2571
-        /** This action is documented in geodirectory_template_actions.php */
2572
-        echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>">
2571
+		/** This action is documented in geodirectory_template_actions.php */
2572
+		echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>">
2573 2573
         <?php dynamic_sidebar('Reg/Login Top Section');?>
2574 2574
     </div><!-- clearfix ends here-->
2575 2575
 <?php
@@ -2588,9 +2588,9 @@  discard block
 block discarded – undo
2588 2588
 function geodir_action_signup_forms()
2589 2589
 {
2590 2590
 
2591
-    global $user_login;
2591
+	global $user_login;
2592 2592
 
2593
-    ?>
2593
+	?>
2594 2594
     <script type="text/javascript">
2595 2595
         <?php if ( $user_login ) { ?>
2596 2596
         setTimeout(function () {
@@ -2626,65 +2626,65 @@  discard block
 block discarded – undo
2626 2626
         <?php } ?>
2627 2627
     </script><?php
2628 2628
 
2629
-    global $errors;
2630
-    if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim')
2631
-        $errors->add('claim_login', LOGIN_CLAIM);
2632
-
2633
-    if (!empty($errors)) {
2634
-        foreach ($errors as $errorsObj) {
2635
-            foreach ($errorsObj as $key => $val) {
2636
-                for ($i = 0; $i < count($val); $i++) {
2637
-                    echo "<div class=error_msg_fix>" . $val[$i] . '</div>';
2638
-                    $registration_error_msg = 1;
2639
-                }
2640
-            }
2641
-        }
2642
-    }
2629
+	global $errors;
2630
+	if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim')
2631
+		$errors->add('claim_login', LOGIN_CLAIM);
2632
+
2633
+	if (!empty($errors)) {
2634
+		foreach ($errors as $errorsObj) {
2635
+			foreach ($errorsObj as $key => $val) {
2636
+				for ($i = 0; $i < count($val); $i++) {
2637
+					echo "<div class=error_msg_fix>" . $val[$i] . '</div>';
2638
+					$registration_error_msg = 1;
2639
+				}
2640
+			}
2641
+		}
2642
+	}
2643 2643
 
2644
-    if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_in') {
2645
-        ?>
2644
+	if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_in') {
2645
+		?>
2646 2646
 
2647 2647
         <div class="login_form">
2648 2648
             <?php
2649
-            /**
2650
-             * Contains login form template.
2651
-             *
2652
-             * @since 1.0.0
2653
-             */
2654
-            include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2649
+			/**
2650
+			 * Contains login form template.
2651
+			 *
2652
+			 * @since 1.0.0
2653
+			 */
2654
+			include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2655 2655
         </div>
2656 2656
 
2657 2657
     <?php } elseif (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_up') { ?>
2658 2658
 
2659 2659
         <div class="registration_form">
2660 2660
             <?php
2661
-            /**
2662
-             * Contains registration form template.
2663
-             *
2664
-             * @since 1.0.0
2665
-             */
2666
-            include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2661
+			/**
2662
+			 * Contains registration form template.
2663
+			 *
2664
+			 * @since 1.0.0
2665
+			 */
2666
+			include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2667 2667
         </div>
2668 2668
 
2669 2669
     <?php } else { ?>
2670 2670
 
2671 2671
         <div class="login_form_l">
2672 2672
             <?php
2673
-            /**
2674
-             * Contains login form template.
2675
-             *
2676
-             * @since 1.0.0
2677
-             */
2678
-            include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2673
+			/**
2674
+			 * Contains login form template.
2675
+			 *
2676
+			 * @since 1.0.0
2677
+			 */
2678
+			include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2679 2679
         </div>
2680 2680
         <div class="registration_form_r">
2681 2681
             <?php
2682
-            /**
2683
-             * Contains registration form template.
2684
-             *
2685
-             * @since 1.0.0
2686
-             */
2687
-            include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2682
+			/**
2683
+			 * Contains registration form template.
2684
+			 *
2685
+			 * @since 1.0.0
2686
+			 */
2687
+			include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2688 2688
         </div>
2689 2689
 
2690 2690
     <?php }?>
@@ -2715,66 +2715,66 @@  discard block
 block discarded – undo
2715 2715
  */
2716 2716
 function geodir_action_author_page_title()
2717 2717
 {
2718
-    global $term;
2718
+	global $term;
2719 2719
 
2720
-    $gd_post_type = geodir_get_current_posttype();
2721
-    $post_type_info = get_post_type_object($gd_post_type);
2720
+	$gd_post_type = geodir_get_current_posttype();
2721
+	$post_type_info = get_post_type_object($gd_post_type);
2722 2722
 
2723
-    $add_string_in_title = __('All', 'geodirectory') . ' ';
2724
-    if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
2725
-        $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
2726
-    }
2723
+	$add_string_in_title = __('All', 'geodirectory') . ' ';
2724
+	if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
2725
+		$add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
2726
+	}
2727 2727
 
2728
-    $list_title = $add_string_in_title . $post_type_info->labels->name;
2729
-    $single_name = $post_type_info->labels->singular_name;
2728
+	$list_title = $add_string_in_title . $post_type_info->labels->name;
2729
+	$single_name = $post_type_info->labels->singular_name;
2730 2730
 
2731
-    $taxonomy = geodir_get_taxonomies($gd_post_type);
2731
+	$taxonomy = geodir_get_taxonomies($gd_post_type);
2732 2732
 
2733
-    if (!empty($term)) {
2734
-        $current_term = get_term_by('slug', $term, $taxonomy[0]);
2735
-        if (!empty($current_term))
2736
-            $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
2737
-    }
2733
+	if (!empty($term)) {
2734
+		$current_term = get_term_by('slug', $term, $taxonomy[0]);
2735
+		if (!empty($current_term))
2736
+			$list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
2737
+	}
2738 2738
 
2739 2739
 
2740
-    if (is_search()) {
2741
-        $list_title = __('Search', 'geodirectory') . ' ' . __($post_type_info->labels->name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2740
+	if (is_search()) {
2741
+		$list_title = __('Search', 'geodirectory') . ' ' . __($post_type_info->labels->name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2742 2742
 
2743
-    }
2744
-    /** This action is documented in geodirectory_template_actions.php */
2745
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
2746
-    /** This action is documented in geodirectory_template_actions.php */
2747
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2743
+	}
2744
+	/** This action is documented in geodirectory_template_actions.php */
2745
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
2746
+	/** This action is documented in geodirectory_template_actions.php */
2747
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2748 2748
 
2749
-    $title = $list_title;
2750
-    if(geodir_is_page('author')){
2751
-        $gd_page = 'author';
2752
-        if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
2753
-            $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
2754
-        }else{
2755
-            $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
2756
-        }
2749
+	$title = $list_title;
2750
+	if(geodir_is_page('author')){
2751
+		$gd_page = 'author';
2752
+		if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
2753
+			$title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
2754
+		}else{
2755
+			$title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
2756
+		}
2757 2757
 
2758
-    }
2758
+	}
2759 2759
 
2760 2760
 
2761
-    /**
2762
-     * Filter page title to replace variables.
2763
-     *
2764
-     * @since 1.5.4
2765
-     * @param string $title The page title including variables.
2766
-     * @param string $gd_page The GeoDirectory page type if any.
2767
-     */
2768
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2761
+	/**
2762
+	 * Filter page title to replace variables.
2763
+	 *
2764
+	 * @since 1.5.4
2765
+	 * @param string $title The page title including variables.
2766
+	 * @param string $gd_page The GeoDirectory page type if any.
2767
+	 */
2768
+	$title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2769 2769
 
2770
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2771
-        /**
2772
-         * Filter the author page title text.
2773
-         *
2774
-         * @since 1.0.0
2775
-         * @param string $list_title The title for the page.
2776
-         */
2777
-        apply_filters('geodir_author_page_title_text', $title) . '</h1></header>';
2770
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2771
+		/**
2772
+		 * Filter the author page title text.
2773
+		 *
2774
+		 * @since 1.0.0
2775
+		 * @param string $list_title The title for the page.
2776
+		 */
2777
+		apply_filters('geodir_author_page_title_text', $title) . '</h1></header>';
2778 2778
 }
2779 2779
 
2780 2780
 
@@ -2792,11 +2792,11 @@  discard block
 block discarded – undo
2792 2792
  */
2793 2793
 function geodir_action_geodir_sidebar_author_top()
2794 2794
 {
2795
-    if (get_option('geodir_show_author_top_section')) { ?>
2795
+	if (get_option('geodir_show_author_top_section')) { ?>
2796 2796
         <div
2797 2797
             class="<?php
2798
-            /** This action is documented in geodirectory_template_actions.php */
2799
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_top'); ?>">
2798
+			/** This action is documented in geodirectory_template_actions.php */
2799
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_top'); ?>">
2800 2800
             <?php dynamic_sidebar('geodir_author_top'); ?>
2801 2801
         </div><!-- clearfix ends here-->
2802 2802
     <?php }
@@ -2812,7 +2812,7 @@  discard block
 block discarded – undo
2812 2812
  */
2813 2813
 function geodir_author_left_section()
2814 2814
 {
2815
-    if (get_option('geodir_show_author_left_section')) { ?>
2815
+	if (get_option('geodir_show_author_left_section')) { ?>
2816 2816
         <div class="geodir-content-left geodir-sidebar-wrap">
2817 2817
             <?php dynamic_sidebar('geodir_author_left_sidebar'); ?>
2818 2818
         </div><!-- end geodir-content-left -->
@@ -2833,19 +2833,19 @@  discard block
 block discarded – undo
2833 2833
  */
2834 2834
 function geodir_action_author_sidebar_left()
2835 2835
 {
2836
-    if (get_option('geodir_show_author_left_section')) {
2836
+	if (get_option('geodir_show_author_left_section')) {
2837 2837
 // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
2838
-        /** This action is documented in geodirectory_template_actions.php */
2839
-        do_action('geodir_sidebar_left_open', 'author-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
2840
-        /**
2841
-         * This is used to add the content to the author page left sidebar (if active).
2842
-         *
2843
-         * @since 1.0.0
2844
-         */
2845
-        do_action('geodir_author_sidebar_left_inside');
2846
-        /** This action is documented in geodirectory_template_actions.php */
2847
-        do_action('geodir_sidebar_left_close', 'author-page');
2848
-    }
2838
+		/** This action is documented in geodirectory_template_actions.php */
2839
+		do_action('geodir_sidebar_left_open', 'author-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
2840
+		/**
2841
+		 * This is used to add the content to the author page left sidebar (if active).
2842
+		 *
2843
+		 * @since 1.0.0
2844
+		 */
2845
+		do_action('geodir_author_sidebar_left_inside');
2846
+		/** This action is documented in geodirectory_template_actions.php */
2847
+		do_action('geodir_sidebar_left_close', 'author-page');
2848
+	}
2849 2849
 }
2850 2850
 
2851 2851
 /**
@@ -2858,7 +2858,7 @@  discard block
 block discarded – undo
2858 2858
  */
2859 2859
 function geodir_author_right_section()
2860 2860
 {
2861
-    if (get_option('geodir_show_author_right_section')) { ?>
2861
+	if (get_option('geodir_show_author_right_section')) { ?>
2862 2862
         <div class="geodir-content-right geodir-sidebar-wrap">
2863 2863
             <?php dynamic_sidebar('geodir_author_right_sidebar'); ?>
2864 2864
         </div><!-- end geodir-content-right -->
@@ -2878,18 +2878,18 @@  discard block
 block discarded – undo
2878 2878
  */
2879 2879
 function geodir_action_author_sidebar_right()
2880 2880
 {
2881
-    if (get_option('geodir_show_author_right_section')) {
2882
-        /** This action is documented in geodirectory_template_actions.php */
2883
-        do_action('geodir_sidebar_right_open', 'author-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
2884
-        /**
2885
-         * This is used to add the content to the author page right sidebar (if active).
2886
-         *
2887
-         * @since 1.0.0
2888
-         */
2889
-        do_action('geodir_author_sidebar_right_inside');
2890
-        /** This action is documented in geodirectory_template_actions.php */
2891
-        do_action('geodir_sidebar_right_close', 'author-page');
2892
-    }
2881
+	if (get_option('geodir_show_author_right_section')) {
2882
+		/** This action is documented in geodirectory_template_actions.php */
2883
+		do_action('geodir_sidebar_right_open', 'author-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
2884
+		/**
2885
+		 * This is used to add the content to the author page right sidebar (if active).
2886
+		 *
2887
+		 * @since 1.0.0
2888
+		 */
2889
+		do_action('geodir_author_sidebar_right_inside');
2890
+		/** This action is documented in geodirectory_template_actions.php */
2891
+		do_action('geodir_sidebar_right_close', 'author-page');
2892
+	}
2893 2893
 }
2894 2894
 
2895 2895
 /**
@@ -2901,14 +2901,14 @@  discard block
 block discarded – undo
2901 2901
  */
2902 2902
 function geodir_action_author_content_inside()
2903 2903
 {
2904
-    global $gridview_columns;
2905
-    $listing_view = get_option('geodir_author_view');
2906
-    if (strstr($listing_view, 'gridview')) {
2907
-        $gridview_columns = $listing_view;
2908
-        $listing_view_exp = explode('_', $listing_view);
2909
-        $listing_view = $listing_view_exp[0];
2910
-    }
2911
-    geodir_get_template_part('listing', 'listview');
2904
+	global $gridview_columns;
2905
+	$listing_view = get_option('geodir_author_view');
2906
+	if (strstr($listing_view, 'gridview')) {
2907
+		$gridview_columns = $listing_view;
2908
+		$listing_view_exp = explode('_', $listing_view);
2909
+		$listing_view = $listing_view_exp[0];
2910
+	}
2911
+	geodir_get_template_part('listing', 'listview');
2912 2912
 }
2913 2913
 
2914 2914
 add_action('geodir_author_content_inside', 'geodir_action_author_content_inside', 10);
@@ -2923,22 +2923,22 @@  discard block
 block discarded – undo
2923 2923
  */
2924 2924
 function geodir_action_author_content()
2925 2925
 {
2926
-    /** This action is documented in geodirectory_template_actions.php */
2927
-    do_action('geodir_main_content_open', 'author-page', 'geodir-main-content', 'author-page');
2928
-    echo '<div class="clearfix">';
2929
-    /** This action is documented in geodirectory_template_actions.php */
2930
-    do_action('geodir_before_listing');
2931
-    echo '</div>';
2932
-    /**
2933
-     * This is used to add the content to the author page main content.
2934
-     *
2935
-     * @since 1.0.0
2936
-     */
2937
-    do_action('geodir_author_content_inside');
2938
-    /** This action is documented in geodirectory_template_actions.php */
2939
-    do_action('geodir_after_listing');
2940
-    /** This action is documented in geodirectory_template_actions.php */
2941
-    do_action('geodir_main_content_close', 'author-page');
2926
+	/** This action is documented in geodirectory_template_actions.php */
2927
+	do_action('geodir_main_content_open', 'author-page', 'geodir-main-content', 'author-page');
2928
+	echo '<div class="clearfix">';
2929
+	/** This action is documented in geodirectory_template_actions.php */
2930
+	do_action('geodir_before_listing');
2931
+	echo '</div>';
2932
+	/**
2933
+	 * This is used to add the content to the author page main content.
2934
+	 *
2935
+	 * @since 1.0.0
2936
+	 */
2937
+	do_action('geodir_author_content_inside');
2938
+	/** This action is documented in geodirectory_template_actions.php */
2939
+	do_action('geodir_after_listing');
2940
+	/** This action is documented in geodirectory_template_actions.php */
2941
+	do_action('geodir_main_content_close', 'author-page');
2942 2942
 }
2943 2943
 
2944 2944
 add_action('geodir_sidebar_author_bottom_section', 'geodir_action_sidebar_author_bottom_section', 10);
@@ -2952,11 +2952,11 @@  discard block
 block discarded – undo
2952 2952
  */
2953 2953
 function geodir_action_sidebar_author_bottom_section()
2954 2954
 {
2955
-    if (get_option('geodir_show_author_bottom_section')) { ?>
2955
+	if (get_option('geodir_show_author_bottom_section')) { ?>
2956 2956
         <div
2957 2957
             class="<?php
2958
-            /** This action is documented in geodirectory_template_actions.php */
2959
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_bottom'); ?>">
2958
+			/** This action is documented in geodirectory_template_actions.php */
2959
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_bottom'); ?>">
2960 2960
             <?php dynamic_sidebar('geodir_author_bottom'); ?>
2961 2961
         </div><!-- clearfix ends here-->
2962 2962
     <?php }
@@ -2975,23 +2975,23 @@  discard block
 block discarded – undo
2975 2975
  */
2976 2976
 function geodir_action_search_page_title()
2977 2977
 {
2978
-    $gd_post_type = geodir_get_current_posttype();
2979
-    $post_type_info = get_post_type_object($gd_post_type);
2978
+	$gd_post_type = geodir_get_current_posttype();
2979
+	$post_type_info = get_post_type_object($gd_post_type);
2980 2980
 
2981
-    $pt_name = '';
2982
-    if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;}
2981
+	$pt_name = '';
2982
+	if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;}
2983 2983
 
2984
-    if (is_search()) {
2985
-        $list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2984
+	if (is_search()) {
2985
+		$list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2986 2986
 
2987
-    }
2988
-    /** This action is documented in geodirectory_template_actions.php */
2989
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
2990
-    /** This action is documented in geodirectory_template_actions.php */
2991
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2992
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2993
-        /** This action is documented in geodirectory_template_actions.php */
2994
-        apply_filters('geodir_listing_page_title', wptexturize($list_title)) . '</h1></header>';
2987
+	}
2988
+	/** This action is documented in geodirectory_template_actions.php */
2989
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
2990
+	/** This action is documented in geodirectory_template_actions.php */
2991
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2992
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2993
+		/** This action is documented in geodirectory_template_actions.php */
2994
+		apply_filters('geodir_listing_page_title', wptexturize($list_title)) . '</h1></header>';
2995 2995
 }
2996 2996
 
2997 2997
 // action for adding the listings page top widget area
@@ -3007,11 +3007,11 @@  discard block
 block discarded – undo
3007 3007
  */
3008 3008
 function geodir_action_geodir_sidebar_search_top()
3009 3009
 {
3010
-    if (get_option('geodir_show_search_top_section')) { ?>
3010
+	if (get_option('geodir_show_search_top_section')) { ?>
3011 3011
         <div
3012 3012
             class="<?php
3013
-            /** This action is documented in geodirectory_template_actions.php */
3014
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_top'); ?>">
3013
+			/** This action is documented in geodirectory_template_actions.php */
3014
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_top'); ?>">
3015 3015
             <?php dynamic_sidebar('geodir_search_top'); ?>
3016 3016
         </div><!-- clearfix ends here-->
3017 3017
     <?php }
@@ -3027,7 +3027,7 @@  discard block
 block discarded – undo
3027 3027
  */
3028 3028
 function geodir_search_left_section()
3029 3029
 {
3030
-    if (get_option('geodir_show_search_left_section')) { ?>
3030
+	if (get_option('geodir_show_search_left_section')) { ?>
3031 3031
         <div class="geodir-content-left geodir-sidebar-wrap">
3032 3032
             <?php dynamic_sidebar('geodir_search_left_sidebar'); ?>
3033 3033
         </div><!-- end geodir-content-left -->
@@ -3047,19 +3047,19 @@  discard block
 block discarded – undo
3047 3047
  */
3048 3048
 function geodir_action_search_sidebar_left()
3049 3049
 {
3050
-    if (get_option('geodir_show_search_left_section')) {
3050
+	if (get_option('geodir_show_search_left_section')) {
3051 3051
 // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
3052
-        /** This action is documented in geodirectory_template_actions.php */
3053
-        do_action('geodir_sidebar_left_open', 'search-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3054
-        /**
3055
-         * This is used to add the content to the search page left sidebar (if active).
3056
-         *
3057
-         * @since 1.0.0
3058
-         */
3059
-        do_action('geodir_search_sidebar_left_inside');
3060
-        /** This action is documented in geodirectory_template_actions.php */
3061
-        do_action('geodir_sidebar_left_close', 'search-page');
3062
-    }
3052
+		/** This action is documented in geodirectory_template_actions.php */
3053
+		do_action('geodir_sidebar_left_open', 'search-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3054
+		/**
3055
+		 * This is used to add the content to the search page left sidebar (if active).
3056
+		 *
3057
+		 * @since 1.0.0
3058
+		 */
3059
+		do_action('geodir_search_sidebar_left_inside');
3060
+		/** This action is documented in geodirectory_template_actions.php */
3061
+		do_action('geodir_sidebar_left_close', 'search-page');
3062
+	}
3063 3063
 }
3064 3064
 
3065 3065
 /**
@@ -3072,7 +3072,7 @@  discard block
 block discarded – undo
3072 3072
  */
3073 3073
 function geodir_search_right_section()
3074 3074
 {
3075
-    if (get_option('geodir_show_search_right_section')) { ?>
3075
+	if (get_option('geodir_show_search_right_section')) { ?>
3076 3076
         <div class="geodir-content-right geodir-sidebar-wrap">
3077 3077
             <?php dynamic_sidebar('geodir_search_right_sidebar'); ?>
3078 3078
         </div><!-- end geodir-content-right -->
@@ -3092,18 +3092,18 @@  discard block
 block discarded – undo
3092 3092
  */
3093 3093
 function geodir_action_search_sidebar_right()
3094 3094
 {
3095
-    if (get_option('geodir_show_search_right_section')) {
3096
-        /** This action is documented in geodirectory_template_actions.php */
3097
-        do_action('geodir_sidebar_right_open', 'search-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3098
-        /**
3099
-         * This is used to add the content to the search page right sidebar (if active).
3100
-         *
3101
-         * @since 1.0.0
3102
-         */
3103
-        do_action('geodir_search_sidebar_right_inside');
3104
-        /** This action is documented in geodirectory_template_actions.php */
3105
-        do_action('geodir_sidebar_right_close', 'search-page');
3106
-    }
3095
+	if (get_option('geodir_show_search_right_section')) {
3096
+		/** This action is documented in geodirectory_template_actions.php */
3097
+		do_action('geodir_sidebar_right_open', 'search-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3098
+		/**
3099
+		 * This is used to add the content to the search page right sidebar (if active).
3100
+		 *
3101
+		 * @since 1.0.0
3102
+		 */
3103
+		do_action('geodir_search_sidebar_right_inside');
3104
+		/** This action is documented in geodirectory_template_actions.php */
3105
+		do_action('geodir_sidebar_right_close', 'search-page');
3106
+	}
3107 3107
 }
3108 3108
 
3109 3109
 
@@ -3118,11 +3118,11 @@  discard block
 block discarded – undo
3118 3118
  */
3119 3119
 function geodir_action_sidebar_search_bottom_section()
3120 3120
 {
3121
-    if (get_option('geodir_show_search_bottom_section')) { ?>
3121
+	if (get_option('geodir_show_search_bottom_section')) { ?>
3122 3122
         <div
3123 3123
             class="<?php
3124
-            /** This action is documented in geodirectory_template_actions.php */
3125
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_bottom'); ?>">
3124
+			/** This action is documented in geodirectory_template_actions.php */
3125
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_bottom'); ?>">
3126 3126
             <?php dynamic_sidebar('geodir_search_bottom'); ?>
3127 3127
         </div><!-- clearfix ends here-->
3128 3128
     <?php }
@@ -3137,14 +3137,14 @@  discard block
 block discarded – undo
3137 3137
  */
3138 3138
 function geodir_action_search_content_inside()
3139 3139
 {
3140
-    global $gridview_columns;
3141
-    $listing_view = get_option('geodir_search_view');
3142
-    if (strstr($listing_view, 'gridview')) {
3143
-        $gridview_columns = $listing_view;
3144
-        $listing_view_exp = explode('_', $listing_view);
3145
-        $listing_view = $listing_view_exp[0];
3146
-    }
3147
-    geodir_get_template_part('listing', 'listview');
3140
+	global $gridview_columns;
3141
+	$listing_view = get_option('geodir_search_view');
3142
+	if (strstr($listing_view, 'gridview')) {
3143
+		$gridview_columns = $listing_view;
3144
+		$listing_view_exp = explode('_', $listing_view);
3145
+		$listing_view = $listing_view_exp[0];
3146
+	}
3147
+	geodir_get_template_part('listing', 'listview');
3148 3148
 }
3149 3149
 
3150 3150
 add_action('geodir_search_content_inside', 'geodir_action_search_content_inside', 10);
@@ -3160,22 +3160,22 @@  discard block
 block discarded – undo
3160 3160
  */
3161 3161
 function geodir_action_search_content()
3162 3162
 {
3163
-    /** This action is documented in geodirectory_template_actions.php */
3164
-    do_action('geodir_main_content_open', 'search-page', 'geodir-main-content', 'search-page');
3165
-    echo '<div class="clearfix">';
3166
-    /** This action is documented in geodirectory_template_actions.php */
3167
-    do_action('geodir_before_listing');
3168
-    echo '</div>';
3169
-    /**
3170
-     * This is used to add the content to the search page main content.
3171
-     *
3172
-     * @since 1.0.0
3173
-     */
3174
-    do_action('geodir_search_content_inside');
3175
-    /** This action is documented in geodirectory_template_actions.php */
3176
-    do_action('geodir_after_listing');
3177
-    /** This action is documented in geodirectory_template_actions.php */
3178
-    do_action('geodir_main_content_close', 'search-page');
3163
+	/** This action is documented in geodirectory_template_actions.php */
3164
+	do_action('geodir_main_content_open', 'search-page', 'geodir-main-content', 'search-page');
3165
+	echo '<div class="clearfix">';
3166
+	/** This action is documented in geodirectory_template_actions.php */
3167
+	do_action('geodir_before_listing');
3168
+	echo '</div>';
3169
+	/**
3170
+	 * This is used to add the content to the search page main content.
3171
+	 *
3172
+	 * @since 1.0.0
3173
+	 */
3174
+	do_action('geodir_search_content_inside');
3175
+	/** This action is documented in geodirectory_template_actions.php */
3176
+	do_action('geodir_after_listing');
3177
+	/** This action is documented in geodirectory_template_actions.php */
3178
+	do_action('geodir_main_content_close', 'search-page');
3179 3179
 }
3180 3180
 
3181 3181
 ###############################################
@@ -3198,11 +3198,11 @@  discard block
 block discarded – undo
3198 3198
  */
3199 3199
 function geodir_action_geodir_sidebar_home_top()
3200 3200
 {
3201
-    if (get_option('geodir_show_home_top_section')) { ?>
3201
+	if (get_option('geodir_show_home_top_section')) { ?>
3202 3202
         <div
3203 3203
             class="<?php
3204
-            /** This action is documented in geodirectory_template_actions.php */
3205
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_top'); ?>">
3204
+			/** This action is documented in geodirectory_template_actions.php */
3205
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_top'); ?>">
3206 3206
             <?php dynamic_sidebar('geodir_home_top'); ?>
3207 3207
         </div><!-- clearfix ends here-->
3208 3208
     <?php }
@@ -3218,7 +3218,7 @@  discard block
 block discarded – undo
3218 3218
  */
3219 3219
 function geodir_home_left_section()
3220 3220
 {
3221
-    if (get_option('geodir_show_home_left_section')) { ?>
3221
+	if (get_option('geodir_show_home_left_section')) { ?>
3222 3222
         <div class="geodir-content-left geodir-sidebar-wrap">
3223 3223
             <?php dynamic_sidebar('geodir_home_left'); ?>
3224 3224
         </div><!-- end geodir-content-left -->
@@ -3240,19 +3240,19 @@  discard block
 block discarded – undo
3240 3240
  */
3241 3241
 function geodir_action_home_sidebar_left()
3242 3242
 {
3243
-    if (get_option('geodir_show_home_left_section')) {
3243
+	if (get_option('geodir_show_home_left_section')) {
3244 3244
 // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
3245
-        /** This action is documented in geodirectory_template_actions.php */
3246
-        do_action('geodir_sidebar_left_open', 'home-page', 'geodir-sidebar-left', 'geodir-sidebar geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3247
-        /**
3248
-         * This is used to add the content to the home page left sidebar (if active).
3249
-         *
3250
-         * @since 1.0.0
3251
-         */
3252
-        do_action('geodir_home_sidebar_left_inside');
3253
-        /** This action is documented in geodirectory_template_actions.php */
3254
-        do_action('geodir_sidebar_left_close', 'home-page');
3255
-    }
3245
+		/** This action is documented in geodirectory_template_actions.php */
3246
+		do_action('geodir_sidebar_left_open', 'home-page', 'geodir-sidebar-left', 'geodir-sidebar geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3247
+		/**
3248
+		 * This is used to add the content to the home page left sidebar (if active).
3249
+		 *
3250
+		 * @since 1.0.0
3251
+		 */
3252
+		do_action('geodir_home_sidebar_left_inside');
3253
+		/** This action is documented in geodirectory_template_actions.php */
3254
+		do_action('geodir_sidebar_left_close', 'home-page');
3255
+	}
3256 3256
 }
3257 3257
 
3258 3258
 /**
@@ -3265,7 +3265,7 @@  discard block
 block discarded – undo
3265 3265
  */
3266 3266
 function geodir_home_right_section()
3267 3267
 {
3268
-    if (get_option('geodir_show_home_right_section')) { ?>
3268
+	if (get_option('geodir_show_home_right_section')) { ?>
3269 3269
         <div class="geodir-content-right geodir-sidebar-wrap">
3270 3270
             <?php dynamic_sidebar('geodir_home_right'); ?>
3271 3271
         </div><!-- end geodir-content-right -->
@@ -3286,18 +3286,18 @@  discard block
 block discarded – undo
3286 3286
  */
3287 3287
 function geodir_action_home_sidebar_right()
3288 3288
 {
3289
-    if (get_option('geodir_show_home_right_section')) {
3290
-        /** This action is documented in geodirectory_template_actions.php */
3291
-        do_action('geodir_sidebar_right_open', 'home-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3292
-        /**
3293
-         * This is used to add the content to the home page right sidebar (if active).
3294
-         *
3295
-         * @since 1.0.0
3296
-         */
3297
-        do_action('geodir_home_sidebar_right_inside');
3298
-        /** This action is documented in geodirectory_template_actions.php */
3299
-        do_action('geodir_sidebar_right_close', 'home-page');
3300
-    }
3289
+	if (get_option('geodir_show_home_right_section')) {
3290
+		/** This action is documented in geodirectory_template_actions.php */
3291
+		do_action('geodir_sidebar_right_open', 'home-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3292
+		/**
3293
+		 * This is used to add the content to the home page right sidebar (if active).
3294
+		 *
3295
+		 * @since 1.0.0
3296
+		 */
3297
+		do_action('geodir_home_sidebar_right_inside');
3298
+		/** This action is documented in geodirectory_template_actions.php */
3299
+		do_action('geodir_sidebar_right_close', 'home-page');
3300
+	}
3301 3301
 }
3302 3302
 
3303 3303
 /**
@@ -3308,7 +3308,7 @@  discard block
 block discarded – undo
3308 3308
  */
3309 3309
 function geodir_action_home_content_inside()
3310 3310
 {
3311
-    dynamic_sidebar('geodir_home_content');
3311
+	dynamic_sidebar('geodir_home_content');
3312 3312
 }
3313 3313
 
3314 3314
 add_action('geodir_home_content_inside', 'geodir_action_home_content_inside', 10);
@@ -3323,28 +3323,28 @@  discard block
 block discarded – undo
3323 3323
  */
3324 3324
 function geodir_action_home_content()
3325 3325
 {
3326
-    /** This action is documented in geodirectory_template_actions.php */
3327
-    do_action('geodir_main_content_open', 'home-page', 'geodir-main-content', 'home-page');
3328
-    /**
3329
-     * This called before the home page main content.
3330
-     *
3331
-     * @since 1.0.0
3332
-     */
3333
-    do_action('geodir_before_home_content');
3334
-    /**
3335
-     * This is used to add the content to the home page main content.
3336
-     *
3337
-     * @since 1.0.0
3338
-     */
3339
-    do_action('geodir_home_content_inside');
3340
-    /**
3341
-     * This is called after the homepage main content.
3342
-     *
3343
-     * @since 1.0.0
3344
-     */
3345
-    do_action('geodir_after_home_content');
3346
-    /** This action is documented in geodirectory_template_actions.php */
3347
-    do_action('geodir_main_content_close', 'home-page');
3326
+	/** This action is documented in geodirectory_template_actions.php */
3327
+	do_action('geodir_main_content_open', 'home-page', 'geodir-main-content', 'home-page');
3328
+	/**
3329
+	 * This called before the home page main content.
3330
+	 *
3331
+	 * @since 1.0.0
3332
+	 */
3333
+	do_action('geodir_before_home_content');
3334
+	/**
3335
+	 * This is used to add the content to the home page main content.
3336
+	 *
3337
+	 * @since 1.0.0
3338
+	 */
3339
+	do_action('geodir_home_content_inside');
3340
+	/**
3341
+	 * This is called after the homepage main content.
3342
+	 *
3343
+	 * @since 1.0.0
3344
+	 */
3345
+	do_action('geodir_after_home_content');
3346
+	/** This action is documented in geodirectory_template_actions.php */
3347
+	do_action('geodir_main_content_close', 'home-page');
3348 3348
 }
3349 3349
 
3350 3350
 add_action('geodir_sidebar_location_bottom_section', 'geodir_action_sidebar_home_bottom_section', 10);
@@ -3359,11 +3359,11 @@  discard block
 block discarded – undo
3359 3359
  */
3360 3360
 function geodir_action_sidebar_home_bottom_section()
3361 3361
 {
3362
-    if (get_option('geodir_show_home_bottom_section')) { ?>
3362
+	if (get_option('geodir_show_home_bottom_section')) { ?>
3363 3363
         <div
3364 3364
             class="<?php
3365
-            /** This action is documented in geodirectory_template_actions.php */
3366
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_bottom'); ?>">
3365
+			/** This action is documented in geodirectory_template_actions.php */
3366
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_bottom'); ?>">
3367 3367
             <?php dynamic_sidebar('geodir_home_bottom'); ?>
3368 3368
         </div><!-- clearfix ends here-->
3369 3369
     <?php }
@@ -3391,13 +3391,13 @@  discard block
 block discarded – undo
3391 3391
  */
3392 3392
 function geodir_filter_listing_page_title($list_title)
3393 3393
 {
3394
-    if (is_search() && trim(get_search_query()) == '') {
3395
-        $gd_post_type = geodir_get_current_posttype();
3396
-        $post_type_info = get_post_type_object($gd_post_type);
3394
+	if (is_search() && trim(get_search_query()) == '') {
3395
+		$gd_post_type = geodir_get_current_posttype();
3396
+		$post_type_info = get_post_type_object($gd_post_type);
3397 3397
 
3398
-        $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' :', 'geodirectory');
3399
-    }
3400
-    return $list_title;
3398
+		$list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' :', 'geodirectory');
3399
+	}
3400
+	return $list_title;
3401 3401
 }
3402 3402
 
3403 3403
 add_action('geodir_message_not_found_on_listing', 'geodir_display_message_not_found_on_listing');
@@ -3412,62 +3412,62 @@  discard block
 block discarded – undo
3412 3412
  * @param string $gd_page The geodirectory page type. Default null.
3413 3413
  */
3414 3414
 function geodir_add_page_content( $position = 'before', $gd_page = '' ) {
3415
-    global $post;
3416
-
3417
-    $gd_page_id = NULL;
3418
-    if ($gd_page == 'home-page' && geodir_is_page('home')) {
3419
-        $gd_page_id = geodir_home_page_id();
3420
-    } else if ($gd_page == 'details-page' && geodir_is_page('preview')) {
3421
-        $gd_page_id = geodir_preview_page_id();
3422
-    } else if ($gd_page == 'add-listing-page' && geodir_is_page('add-listing')) {
3423
-        $gd_page_id = geodir_add_listing_page_id();
3424
-    } else if ($gd_page == 'success-page' && geodir_is_page('listing-success')) {
3425
-        $gd_page_id = geodir_success_page_id();
3426
-    } else if ($gd_page == 'location-page' && geodir_is_page('location')) {
3427
-        $gd_page_id = geodir_location_page_id();
3428
-    } else if ($gd_page == 'info-page' && geodir_is_page('info')) {
3429
-        $gd_page_id = geodir_info_page_id();
3430
-    } else if ($gd_page == 'signup-page' && geodir_is_page('login')) {
3431
-        $gd_page_id = geodir_login_page_id();
3432
-    } else if ($gd_page == 'checkout-page' && geodir_is_page('checkout')) {
3433
-        $gd_page_id = geodir_payment_checkout_page_id();
3434
-    } else if ($gd_page == 'invoices-page' && geodir_is_page('invoices')) {
3435
-        $gd_page_id = geodir_payment_invoices_page_id();
3436
-    }
3437
-
3438
-    if (!$gd_page_id > 0) {
3439
-        return;
3440
-    }
3415
+	global $post;
3416
+
3417
+	$gd_page_id = NULL;
3418
+	if ($gd_page == 'home-page' && geodir_is_page('home')) {
3419
+		$gd_page_id = geodir_home_page_id();
3420
+	} else if ($gd_page == 'details-page' && geodir_is_page('preview')) {
3421
+		$gd_page_id = geodir_preview_page_id();
3422
+	} else if ($gd_page == 'add-listing-page' && geodir_is_page('add-listing')) {
3423
+		$gd_page_id = geodir_add_listing_page_id();
3424
+	} else if ($gd_page == 'success-page' && geodir_is_page('listing-success')) {
3425
+		$gd_page_id = geodir_success_page_id();
3426
+	} else if ($gd_page == 'location-page' && geodir_is_page('location')) {
3427
+		$gd_page_id = geodir_location_page_id();
3428
+	} else if ($gd_page == 'info-page' && geodir_is_page('info')) {
3429
+		$gd_page_id = geodir_info_page_id();
3430
+	} else if ($gd_page == 'signup-page' && geodir_is_page('login')) {
3431
+		$gd_page_id = geodir_login_page_id();
3432
+	} else if ($gd_page == 'checkout-page' && geodir_is_page('checkout')) {
3433
+		$gd_page_id = geodir_payment_checkout_page_id();
3434
+	} else if ($gd_page == 'invoices-page' && geodir_is_page('invoices')) {
3435
+		$gd_page_id = geodir_payment_invoices_page_id();
3436
+	}
3437
+
3438
+	if (!$gd_page_id > 0) {
3439
+		return;
3440
+	}
3441 3441
     
3442
-    $display = 'before';
3443
-    /**
3444
-     * Filter the position to display the page content.
3445
-     *
3446
-     * @since 1.6.3
3447
-     *
3448
-     * @param string $display Position to add the post content.
3449
-     * @param string $gd_page The geodirectory page type.
3450
-     */
3451
-    $display = apply_filters('geodir_add_page_content_position', $display, $gd_page);
3452
-
3453
-    if ($position !== $display) {
3454
-        return;
3455
-    }
3456
-
3457
-    $gd_post = $post;
3442
+	$display = 'before';
3443
+	/**
3444
+	 * Filter the position to display the page content.
3445
+	 *
3446
+	 * @since 1.6.3
3447
+	 *
3448
+	 * @param string $display Position to add the post content.
3449
+	 * @param string $gd_page The geodirectory page type.
3450
+	 */
3451
+	$display = apply_filters('geodir_add_page_content_position', $display, $gd_page);
3452
+
3453
+	if ($position !== $display) {
3454
+		return;
3455
+	}
3456
+
3457
+	$gd_post = $post;
3458 3458
     
3459
-    setup_postdata(get_post($gd_page_id));
3459
+	setup_postdata(get_post($gd_page_id));
3460 3460
 
3461
-    if (get_the_content()) {
3462
-        ?>
3461
+	if (get_the_content()) {
3462
+		?>
3463 3463
         <section class="entry-content clearfix" itemprop="articleBody"><?php the_content(); ?></section>
3464 3464
         <?php
3465
-    }
3465
+	}
3466 3466
 
3467
-    $post = $gd_post;
3468
-    if (!empty($gd_post) && is_object($gd_post)) {
3469
-        setup_postdata($gd_post);
3470
-    }
3467
+	$post = $gd_post;
3468
+	if (!empty($gd_post) && is_object($gd_post)) {
3469
+		setup_postdata($gd_post);
3470
+	}
3471 3471
 
3472 3472
 }
3473 3473
 add_action('geodir_add_page_content', 'geodir_add_page_content', 10, 2);
3474 3474
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +164 added lines, -164 removed lines patch added patch discarded remove patch
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
 
283 283
     //php
284 284
     if (!empty($tc['geodir_theme_compat_code'])) {
285
-        include_once('geodirectory-functions/compatibility/' . $tc['geodir_theme_compat_code'] . '.php');
285
+        include_once('geodirectory-functions/compatibility/'.$tc['geodir_theme_compat_code'].'.php');
286 286
     }
287 287
 
288 288
     //geodir_full_page_class
@@ -452,13 +452,13 @@  discard block
 block discarded – undo
452 452
 function geodir_action_wrapper_content_open($type = '', $id = '', $class = '')
453 453
 {
454 454
     if ($type == 'home-page' && $width = get_option('geodir_width_home_contant_section')) {
455
-        $width_css = 'style="width:' . $width . '%;"';
455
+        $width_css = 'style="width:'.$width.'%;"';
456 456
     } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_contant_section')) {
457
-        $width_css = 'style="width:' . $width . '%;"';
457
+        $width_css = 'style="width:'.$width.'%;"';
458 458
     } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_contant_section')) {
459
-        $width_css = 'style="width:' . $width . '%;"';
459
+        $width_css = 'style="width:'.$width.'%;"';
460 460
     } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_contant_section')) {
461
-        $width_css = 'style="width:' . $width . '%;"';
461
+        $width_css = 'style="width:'.$width.'%;"';
462 462
     } else {
463 463
         $width_css = '';
464 464
     }
@@ -572,13 +572,13 @@  discard block
 block discarded – undo
572 572
 function geodir_action_sidebar_right_open($type = '', $id = '', $class = '', $itemtype = '')
573 573
 {
574 574
     if ($type == 'home-page' && $width = get_option('geodir_width_home_right_section')) {
575
-        $width_css = 'style="width:' . $width . '%;"';
575
+        $width_css = 'style="width:'.$width.'%;"';
576 576
     } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_right_section')) {
577
-        $width_css = 'style="width:' . $width . '%;"';
577
+        $width_css = 'style="width:'.$width.'%;"';
578 578
     } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_right_section')) {
579
-        $width_css = 'style="width:' . $width . '%;"';
579
+        $width_css = 'style="width:'.$width.'%;"';
580 580
     } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_right_section')) {
581
-        $width_css = 'style="width:' . $width . '%;"';
581
+        $width_css = 'style="width:'.$width.'%;"';
582 582
     } else {
583 583
         $width_css = '';
584 584
     }
@@ -676,7 +676,7 @@  discard block
 block discarded – undo
676 676
         }
677 677
     }
678 678
 
679
-    $post = (object)$_REQUEST;
679
+    $post = (object) $_REQUEST;
680 680
 
681 681
 
682 682
     if (isset($post->video)) {
@@ -735,10 +735,10 @@  discard block
 block discarded – undo
735 735
 
736 736
     $json = '{';
737 737
     $json .= '"post_preview": "1",';
738
-    $json .= '"t": "' . $json_title . '",';
739
-    $json .= '"lt": "' . $post_latitude . '",';
740
-    $json .= '"ln": "' . $post_longitude . '",';
741
-    $json .= '"i":"' . $term_icon . '"';
738
+    $json .= '"t": "'.$json_title.'",';
739
+    $json .= '"lt": "'.$post_latitude.'",';
740
+    $json .= '"ln": "'.$post_longitude.'",';
741
+    $json .= '"i":"'.$term_icon.'"';
742 742
     $json .= '}';
743 743
 
744 744
     $post->marker_json = $json;
@@ -965,7 +965,7 @@  discard block
 block discarded – undo
965 965
      * @param string $class The class to use. Default is 'entry-header'.
966 966
      */
967 967
     $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
968
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . stripslashes(get_the_title()) . '</h1></header>';
968
+    echo '<header class="'.$class_header.'"><h1 class="'.$class.'">'.stripslashes(get_the_title()).'</h1></header>';
969 969
 }
970 970
 
971 971
 
@@ -1019,7 +1019,7 @@  discard block
 block discarded – undo
1019 1019
                     $height = !empty($sizes) && isset($sizes[1]) ? $sizes[1] : 0;
1020 1020
 
1021 1021
                     if ($image && $width && $height) {
1022
-                        $image = (object)array('src' => $image, 'width' => $width, 'height' => $height);
1022
+                        $image = (object) array('src' => $image, 'width' => $width, 'height' => $height);
1023 1023
                     }
1024 1024
 
1025 1025
                     if (isset($image->src)) {
@@ -1031,9 +1031,9 @@  discard block
 block discarded – undo
1031 1031
 
1032 1032
                         $image_title = isset($image->title) ? $image->title : '';
1033 1033
 
1034
-                        $main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />';
1035
-                        $main_slides .= '<img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:400px;margin:0 auto;" /></li>';
1036
-                        $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:48px;margin:0 auto;" /></li>';
1034
+                        $main_slides .= '<li><img src="'.geodir_plugin_url()."/geodirectory-assets/images/spacer.gif".'" alt="'.$image_title.'" title="'.$image_title.'" style="max-height:'.$spacer_height.'px;margin:0 auto;" />';
1035
+                        $main_slides .= '<img src="'.$image->src.'" alt="'.$image_title.'" title="'.$image_title.'" style="max-height:400px;margin:0 auto;" /></li>';
1036
+                        $nav_slides .= '<li><img src="'.$image->src.'" alt="'.$image_title.'" title="'.$image_title.'" style="max-height:48px;margin:0 auto;" /></li>';
1037 1037
                         $slides++;
1038 1038
                     }
1039 1039
                 }
@@ -1052,10 +1052,10 @@  discard block
 block discarded – undo
1052 1052
                 } else {
1053 1053
                     $spacer_height = ((400 - $image->height) / 2);
1054 1054
                 }
1055
-                $caption = '';//(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : '';
1056
-                $main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />';
1057
-                $main_slides .= '<img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>';
1058
-                $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:48px;margin:0 auto;" /></li>';
1055
+                $caption = ''; //(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : '';
1056
+                $main_slides .= '<li><img src="'.geodir_plugin_url()."/geodirectory-assets/images/spacer.gif".'" alt="'.$image->title.'" title="'.$image->title.'" style="max-height:'.$spacer_height.'px;margin:0 auto;" />';
1057
+                $main_slides .= '<img src="'.$image->src.'" alt="'.$image->title.'" title="'.$image->title.'" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>';
1058
+                $nav_slides .= '<li><img src="'.$image->src.'" alt="'.$image->title.'" title="'.$image->title.'" style="max-height:48px;margin:0 auto;" /></li>';
1059 1059
                 $slides++;
1060 1060
             }
1061 1061
         }// endfore
@@ -1090,7 +1090,7 @@  discard block
 block discarded – undo
1090 1090
  */
1091 1091
 function geodir_action_details_taxonomies()
1092 1092
 {
1093
-    global $preview, $post;?>
1093
+    global $preview, $post; ?>
1094 1094
     <p class="geodir_post_taxomomies clearfix">
1095 1095
     <?php
1096 1096
     $taxonomies = array();
@@ -1099,11 +1099,11 @@  discard block
 block discarded – undo
1099 1099
 
1100 1100
     if ($preview && !$is_backend_preview) {
1101 1101
         $post_type = $post->listing_type;
1102
-        $post_taxonomy = $post_type . 'category';
1102
+        $post_taxonomy = $post_type.'category';
1103 1103
         $post->{$post_taxonomy} = $post->post_category[$post_taxonomy];
1104 1104
     } else {
1105 1105
         $post_type = $post->post_type;
1106
-        $post_taxonomy = $post_type . 'category';
1106
+        $post_taxonomy = $post_type.'category';
1107 1107
     }
1108 1108
 //{	
1109 1109
     $post_type_info = get_post_type_object($post_type);
@@ -1111,7 +1111,7 @@  discard block
 block discarded – undo
1111 1111
 
1112 1112
     if (!empty($post->post_tags)) {
1113 1113
 
1114
-        if (taxonomy_exists($post_type . '_tags')):
1114
+        if (taxonomy_exists($post_type.'_tags')):
1115 1115
             $links = array();
1116 1116
             $terms = array();
1117 1117
             // to limit post tags
@@ -1138,8 +1138,8 @@  discard block
 block discarded – undo
1138 1138
                 $post_term = trim($post_term);
1139 1139
 
1140 1140
                 $priority_location = false;
1141
-                if ($insert_term = term_exists($post_term, $post_type . '_tags')) {
1142
-                    $term = get_term_by('id', $insert_term['term_id'], $post_type . '_tags');
1141
+                if ($insert_term = term_exists($post_term, $post_type.'_tags')) {
1142
+                    $term = get_term_by('id', $insert_term['term_id'], $post_type.'_tags');
1143 1143
                 } else {
1144 1144
                     $post_country = isset($_REQUEST['post_country']) && $_REQUEST['post_country'] != '' ? sanitize_text_field($_REQUEST['post_country']) : NULL;
1145 1145
                     $post_region = isset($_REQUEST['post_region']) && $_REQUEST['post_region'] != '' ? sanitize_text_field($_REQUEST['post_region']) : NULL;
@@ -1149,10 +1149,10 @@  discard block
 block discarded – undo
1149 1149
                     $match_city = $post_city && sanitize_title($post_term) == sanitize_title($post_city) ? true : false;
1150 1150
                     if ($match_country || $match_region || $match_city) {
1151 1151
                         $priority_location = true;
1152
-                        $term = get_term_by('name', $post_term, $post_type . '_tags');
1152
+                        $term = get_term_by('name', $post_term, $post_type.'_tags');
1153 1153
                     } else {
1154
-                        $insert_term = wp_insert_term($post_term, $post_type . '_tags');
1155
-                        $term = get_term_by('name', $post_term, $post_type . '_tags');
1154
+                        $insert_term = wp_insert_term($post_term, $post_type.'_tags');
1155
+                        $term = get_term_by('name', $post_term, $post_type.'_tags');
1156 1156
                     }
1157 1157
                 }
1158 1158
 
@@ -1169,12 +1169,12 @@  discard block
 block discarded – undo
1169 1169
                          * @param string $tag_link The tag link html.
1170 1170
                          * @param object $term The tag term object.
1171 1171
                          */
1172
-                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1172
+                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link', $tag_link, $term);
1173 1173
                         $links[] = $tag_link;
1174 1174
                     } else {
1175
-                        $tag_link = "<a href='" . esc_attr(get_term_link($term->term_id, $term->taxonomy)) . "'>$term->name</a>";
1175
+                        $tag_link = "<a href='".esc_attr(get_term_link($term->term_id, $term->taxonomy))."'>$term->name</a>";
1176 1176
                         /** This action is documented in geodirectory-template_actions.php */
1177
-                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1177
+                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link', $tag_link, $term);
1178 1178
                         $links[] = $tag_link;
1179 1179
                     }
1180 1180
                     $terms[] = $term;
@@ -1184,7 +1184,7 @@  discard block
 block discarded – undo
1184 1184
             if (!isset($listing_label)) {
1185 1185
                 $listing_label = '';
1186 1186
             }
1187
-            $taxonomies[$post_type . '_tags'] = wp_sprintf(__('%s Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1187
+            $taxonomies[$post_type.'_tags'] = wp_sprintf(__('%s Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object) $terms);
1188 1188
         endif;
1189 1189
 
1190 1190
     }
@@ -1212,7 +1212,7 @@  discard block
 block discarded – undo
1212 1212
                     $term = get_term_by('id', $post_term, $post_taxonomy);
1213 1213
 
1214 1214
                     if (is_object($term)) {
1215
-                        $term_link = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>$term->name</a>";
1215
+                        $term_link = "<a href='".esc_attr(get_term_link($term, $post_taxonomy))."'>$term->name</a>";
1216 1216
                         /**
1217 1217
                          * Filter the category name on the details page.
1218 1218
                          *
@@ -1220,7 +1220,7 @@  discard block
 block discarded – undo
1220 1220
                          * @param string $term_link The link html to the category.
1221 1221
                          * @param object $term The category term object.
1222 1222
                          */
1223
-                        $term_link = apply_filters('geodir_details_taxonomies_cat_link',$term_link,$term);
1223
+                        $term_link = apply_filters('geodir_details_taxonomies_cat_link', $term_link, $term);
1224 1224
                         $links[] = $term_link;
1225 1225
                         $terms[] = $term;
1226 1226
                     }
@@ -1238,7 +1238,7 @@  discard block
 block discarded – undo
1238 1238
         if (!isset($listing_label)) {
1239 1239
             $listing_label = '';
1240 1240
         }
1241
-        $taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1241
+        $taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object) $terms);
1242 1242
 
1243 1243
     }
1244 1244
 
@@ -1251,14 +1251,14 @@  discard block
 block discarded – undo
1251 1251
      * @param string $listing_label The post type label.
1252 1252
      * @param string $listing_label The post type label with ucwords function.
1253 1253
      */
1254
-    $taxonomies = apply_filters('geodir_details_taxonomies_output',$taxonomies,$post_type,$listing_label,geodir_ucwords($listing_label));
1254
+    $taxonomies = apply_filters('geodir_details_taxonomies_output', $taxonomies, $post_type, $listing_label, geodir_ucwords($listing_label));
1255 1255
 
1256 1256
     if (isset($taxonomies[$post_taxonomy])) {
1257
-        echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>';
1257
+        echo '<span class="geodir-category">'.$taxonomies[$post_taxonomy].'</span>';
1258 1258
     }
1259 1259
 
1260
-    if (isset($taxonomies[$post_type . '_tags']))
1261
-        echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>';
1260
+    if (isset($taxonomies[$post_type.'_tags']))
1261
+        echo '<span class="geodir-tags">'.$taxonomies[$post_type.'_tags'].'</span>';
1262 1262
 
1263 1263
     ?>
1264 1264
     </p><?php
@@ -1279,11 +1279,11 @@  discard block
 block discarded – undo
1279 1279
  * @param object $post Optional. The post object or blank.
1280 1280
  * @package GeoDirectory
1281 1281
  */
1282
-function geodir_action_details_micordata($post='')
1282
+function geodir_action_details_micordata($post = '')
1283 1283
 {
1284 1284
 
1285 1285
     global $preview;
1286
-    if(empty($post)){global $post;}
1286
+    if (empty($post)) {global $post; }
1287 1287
     if ($preview || !geodir_is_page('detail')) {
1288 1288
         return;
1289 1289
     }
@@ -1304,7 +1304,7 @@  discard block
 block discarded – undo
1304 1304
                 "description" => $review->comment_content,
1305 1305
                 "reviewRating" => array(
1306 1306
                     "@type" => "Rating",
1307
-                    "bestRating" => "5",// @todo this will need to be filtered for review manager if user changes the score.
1307
+                    "bestRating" => "5", // @todo this will need to be filtered for review manager if user changes the score.
1308 1308
                     "ratingValue" => geodir_get_commentoverall($review->comment_ID),
1309 1309
                     "worstRating" => "1"
1310 1310
                 )
@@ -1332,13 +1332,13 @@  discard block
 block discarded – undo
1332 1332
     }
1333 1333
     //print_r($post);
1334 1334
     // external links
1335
-    $external_links =  array();
1335
+    $external_links = array();
1336 1336
     $external_links[] = $post->geodir_website;
1337 1337
     $external_links[] = $post->geodir_twitter;
1338 1338
     $external_links[] = $post->geodir_facebook;
1339 1339
     $external_links = array_filter($external_links);
1340 1340
 
1341
-    if(!empty($external_links)){
1341
+    if (!empty($external_links)) {
1342 1342
         $external_links = array_values($external_links);
1343 1343
     }
1344 1344
 
@@ -1348,17 +1348,17 @@  discard block
 block discarded – undo
1348 1348
 
1349 1349
     // schema type
1350 1350
     $schema_type = 'LocalBusiness';
1351
-    if(isset($post->default_category) && $post->default_category){
1351
+    if (isset($post->default_category) && $post->default_category) {
1352 1352
         $cat_schema = get_tax_meta($post->default_category, 'ct_cat_schema', false, $post->post_type);
1353
-        if($cat_schema){$schema_type = $cat_schema;}
1354
-        if(!$schema_type && $post->post_type=='gd_event'){$schema_type = 'Event';}
1353
+        if ($cat_schema) {$schema_type = $cat_schema; }
1354
+        if (!$schema_type && $post->post_type == 'gd_event') {$schema_type = 'Event'; }
1355 1355
     }
1356 1356
 
1357 1357
     $schema = array();
1358 1358
     $schema['@context'] = "https://schema.org";
1359 1359
     $schema['@type'] = $schema_type;
1360 1360
     $schema['name'] = $post->post_title;
1361
-    $schema['description'] = wp_strip_all_tags( $post->post_content, true );
1361
+    $schema['description'] = wp_strip_all_tags($post->post_content, true);
1362 1362
     $schema['telephone'] = $post->geodir_contact;
1363 1363
     $schema['url'] = $c_url;
1364 1364
     $schema['sameAs'] = $external_links;
@@ -1372,7 +1372,7 @@  discard block
 block discarded – undo
1372 1372
         "postalCode" => $post->post_zip
1373 1373
     );
1374 1374
 
1375
-    if($post->post_latitude && $post->post_longitude) {
1375
+    if ($post->post_latitude && $post->post_longitude) {
1376 1376
         $schema['geo'] = array(
1377 1377
             "@type" => "GeoCoordinates",
1378 1378
             "latitude" => $post->post_latitude,
@@ -1380,7 +1380,7 @@  discard block
 block discarded – undo
1380 1380
         );
1381 1381
     }
1382 1382
 
1383
-    if($post_avgratings) {
1383
+    if ($post_avgratings) {
1384 1384
         $schema['aggregateRating'] = array(
1385 1385
             "@type" => "AggregateRating",
1386 1386
             "ratingValue" => $post_avgratings,
@@ -1399,10 +1399,10 @@  discard block
 block discarded – undo
1399 1399
      * @param array $schema The array of schema data to be filtered.
1400 1400
      * @param object $post The post object.
1401 1401
      */
1402
-    $schema = apply_filters('geodir_details_schema', $schema,$post);
1402
+    $schema = apply_filters('geodir_details_schema', $schema, $post);
1403 1403
 
1404 1404
 
1405
-    echo '<script type="application/ld+json">' . json_encode($schema) . '</script>';
1405
+    echo '<script type="application/ld+json">'.json_encode($schema).'</script>';
1406 1406
 
1407 1407
 
1408 1408
     $uploads = wp_upload_dir();
@@ -1415,7 +1415,7 @@  discard block
 block discarded – undo
1415 1415
      * @param string $facebook_og The open graph html to be filtered.
1416 1416
      * @param object $post The post object.
1417 1417
      */
1418
-    echo apply_filters('geodir_details_facebook_og', $facebook_og,$post);
1418
+    echo apply_filters('geodir_details_facebook_og', $facebook_og, $post);
1419 1419
 
1420 1420
 
1421 1421
 
@@ -1438,9 +1438,9 @@  discard block
 block discarded – undo
1438 1438
     ?>
1439 1439
     <div class="geodir-pos_navigation clearfix">
1440 1440
     <div
1441
-        class="geodir-post_left"><?php previous_post_link('%link', '' . __('Previous', 'geodirectory'), false) ?></div>
1441
+        class="geodir-post_left"><?php previous_post_link('%link', ''.__('Previous', 'geodirectory'), false) ?></div>
1442 1442
     <div
1443
-        class="geodir-post_right"><?php next_post_link('%link', __('Next', 'geodirectory') . '', false) ?></div>
1443
+        class="geodir-post_right"><?php next_post_link('%link', __('Next', 'geodirectory').'', false) ?></div>
1444 1444
     </div><?php
1445 1445
 }
1446 1446
 
@@ -1509,12 +1509,12 @@  discard block
 block discarded – undo
1509 1509
     $gd_post_type = geodir_get_current_posttype();
1510 1510
     $post_type_info = get_post_type_object($gd_post_type);
1511 1511
 
1512
-    $add_string_in_title = __('All', 'geodirectory') . ' ';
1512
+    $add_string_in_title = __('All', 'geodirectory').' ';
1513 1513
     if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
1514
-        $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
1514
+        $add_string_in_title = __('My Favorite', 'geodirectory').' ';
1515 1515
     }
1516 1516
 
1517
-    $list_title = $add_string_in_title . __(ucfirst($post_type_info->labels->name), 'geodirectory');
1517
+    $list_title = $add_string_in_title.__(ucfirst($post_type_info->labels->name), 'geodirectory');
1518 1518
     $single_name = $post_type_info->labels->singular_name;
1519 1519
 
1520 1520
     $taxonomy = geodir_get_taxonomies($gd_post_type, true);
@@ -1542,12 +1542,12 @@  discard block
 block discarded – undo
1542 1542
         $current_term = get_term_by('slug', $term, $taxonomy[0]);
1543 1543
         if (!empty($current_term)) {
1544 1544
             $current_term_name = __(ucfirst($current_term->name), 'geodirectory');
1545
-            if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1545
+            if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type.'category') {
1546 1546
                 $location_last_char = substr($location_name, -1);
1547 1547
                 $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1548
-                $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1548
+                $list_title .= __(' in', 'geodirectory').' '.$location_name.$location_name_attach.' '.$current_term_name;
1549 1549
             } else {
1550
-                $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1550
+                $list_title .= __(' in', 'geodirectory')." '".$current_term_name."'";
1551 1551
             }
1552 1552
         } else {
1553 1553
             if (count($taxonomy) > 1) {
@@ -1555,12 +1555,12 @@  discard block
 block discarded – undo
1555 1555
 
1556 1556
                 if (!empty($current_term)) {
1557 1557
                     $current_term_name = __(ucfirst($current_term->name), 'geodirectory');
1558
-                    if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1558
+                    if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type.'category') {
1559 1559
                         $location_last_char = substr($location_name, -1);
1560 1560
                         $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1561
-                        $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1561
+                        $list_title .= __(' in', 'geodirectory').' '.$location_name.$location_name_attach.' '.$current_term_name;
1562 1562
                     } else {
1563
-                        $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1563
+                        $list_title .= __(' in', 'geodirectory')." '".$current_term_name."'";
1564 1564
                     }
1565 1565
                 }
1566 1566
             }
@@ -1588,7 +1588,7 @@  discard block
 block discarded – undo
1588 1588
                 $gd_city = __(geodir_ucwords($gd_city), 'geodirectory');
1589 1589
             }
1590 1590
 
1591
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_city . "'";
1591
+            $list_title .= __(' in', 'geodirectory')." '".$gd_city."'";
1592 1592
         } else if ($gd_region != '') {
1593 1593
             if ($gd_region_actual != '') {
1594 1594
                 $gd_region = $gd_region_actual;
@@ -1598,7 +1598,7 @@  discard block
 block discarded – undo
1598 1598
                 $gd_region = __(geodir_ucwords($gd_region), 'geodirectory');
1599 1599
             }
1600 1600
 
1601
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_region . "'";
1601
+            $list_title .= __(' in', 'geodirectory')." '".$gd_region."'";
1602 1602
         } else if ($gd_country != '') {
1603 1603
             if ($gd_country_actual != '') {
1604 1604
                 $gd_country = $gd_country_actual;
@@ -1608,12 +1608,12 @@  discard block
 block discarded – undo
1608 1608
                 $gd_country = __(geodir_ucwords($gd_country), 'geodirectory');
1609 1609
             }
1610 1610
 
1611
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_country . "'";
1611
+            $list_title .= __(' in', 'geodirectory')." '".$gd_country."'";
1612 1612
         }
1613 1613
     }
1614 1614
 
1615 1615
     if (is_search()) {
1616
-        $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
1616
+        $list_title = __('Search', 'geodirectory').' '.__(ucfirst($post_type_info->labels->name), 'geodirectory').__(' For :', 'geodirectory')." '".get_search_query()."'";
1617 1617
     }
1618 1618
     /** This action is documented in geodirectory_template_actions.php */
1619 1619
     $class = apply_filters('geodir_page_title_class', 'entry-title fn');
@@ -1623,26 +1623,26 @@  discard block
 block discarded – undo
1623 1623
 
1624 1624
     $title = $list_title;
1625 1625
     $gd_page = '';
1626
-    if(geodir_is_page('pt')){
1626
+    if (geodir_is_page('pt')) {
1627 1627
         $gd_page = 'pt';
1628
-        $title  = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
1628
+        $title = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
1629 1629
     }
1630
-    elseif(geodir_is_page('listing')){
1630
+    elseif (geodir_is_page('listing')) {
1631 1631
         $gd_page = 'listing';
1632 1632
         global $wp_query;
1633 1633
         $current_term = $wp_query->get_queried_object();
1634
-        if (strpos($current_term->taxonomy,'_tags') !== false) {
1634
+        if (strpos($current_term->taxonomy, '_tags') !== false) {
1635 1635
             $title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
1636
-        }else{
1636
+        } else {
1637 1637
             $title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
1638 1638
         }
1639 1639
 
1640 1640
     }
1641
-    elseif(geodir_is_page('author')){
1641
+    elseif (geodir_is_page('author')) {
1642 1642
         $gd_page = 'author';
1643
-        if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
1643
+        if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
1644 1644
             $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
1645
-        }else{
1645
+        } else {
1646 1646
             $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
1647 1647
         }
1648 1648
 
@@ -1656,16 +1656,16 @@  discard block
 block discarded – undo
1656 1656
      * @param string $title The page title including variables.
1657 1657
      * @param string $gd_page The GeoDirectory page type if any.
1658 1658
      */
1659
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
1659
+    $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
1660 1660
 
1661
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
1661
+    echo '<header class="'.$class_header.'"><h1 class="'.$class.'">'.
1662 1662
         /**
1663 1663
          * Filter the listing page title.
1664 1664
          *
1665 1665
          * @since 1.0.0
1666 1666
          * @param string $list_title The title for the category page.
1667 1667
          */
1668
-        apply_filters('geodir_listing_page_title', $title) . '</h1></header>';
1668
+        apply_filters('geodir_listing_page_title', $title).'</h1></header>';
1669 1669
 }
1670 1670
 
1671 1671
 add_action('geodir_listings_page_description', 'geodir_action_listings_description', 10);
@@ -1684,16 +1684,16 @@  discard block
 block discarded – undo
1684 1684
     $gd_post_type = geodir_get_current_posttype();
1685 1685
     if (isset($current_term->term_id) && $current_term->term_id != '') {
1686 1686
 
1687
-        $term_desc = term_description($current_term->term_id, $gd_post_type . '_tags');
1687
+        $term_desc = term_description($current_term->term_id, $gd_post_type.'_tags');
1688 1688
         $saved_data = stripslashes(get_tax_meta($current_term->term_id, 'ct_cat_top_desc', false, $gd_post_type));
1689 1689
         if ($term_desc && !$saved_data) {
1690 1690
             $saved_data = $term_desc;
1691 1691
         }
1692 1692
 
1693 1693
         // stop payment manager filtering content length
1694
-        $filter_priority = has_filter( 'the_content', 'geodir_payments_the_content' );
1695
-        if ( false !== $filter_priority ) {
1696
-            remove_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1694
+        $filter_priority = has_filter('the_content', 'geodir_payments_the_content');
1695
+        if (false !== $filter_priority) {
1696
+            remove_filter('the_content', 'geodir_payments_the_content', $filter_priority);
1697 1697
         }
1698 1698
 
1699 1699
         /**
@@ -1707,14 +1707,14 @@  discard block
 block discarded – undo
1707 1707
         $cat_description = apply_filters('the_content', $saved_data);
1708 1708
 
1709 1709
 
1710
-        if ( false !== $filter_priority ) {
1711
-            add_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1710
+        if (false !== $filter_priority) {
1711
+            add_filter('the_content', 'geodir_payments_the_content', $filter_priority);
1712 1712
         }
1713 1713
 
1714 1714
         if ($cat_description) {
1715 1715
             ?>
1716 1716
 
1717
-            <div class="term_description"><?php echo $cat_description;?></div> <?php
1717
+            <div class="term_description"><?php echo $cat_description; ?></div> <?php
1718 1718
         }
1719 1719
 
1720 1720
     }
@@ -1764,13 +1764,13 @@  discard block
 block discarded – undo
1764 1764
 function geodir_action_sidebar_left_open($type = '', $id = '', $class = '', $itemtype = '')
1765 1765
 {
1766 1766
     if ($type == 'home-page' && $width = get_option('geodir_width_home_left_section')) {
1767
-        $width_css = 'style="width:' . $width . '%;"';
1767
+        $width_css = 'style="width:'.$width.'%;"';
1768 1768
     } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_left_section')) {
1769
-        $width_css = 'style="width:' . $width . '%;"';
1769
+        $width_css = 'style="width:'.$width.'%;"';
1770 1770
     } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_left_section')) {
1771
-        $width_css = 'style="width:' . $width . '%;"';
1771
+        $width_css = 'style="width:'.$width.'%;"';
1772 1772
     } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_left_section')) {
1773
-        $width_css = 'style="width:' . $width . '%;"';
1773
+        $width_css = 'style="width:'.$width.'%;"';
1774 1774
     } else {
1775 1775
         $width_css = '';
1776 1776
     }
@@ -2075,11 +2075,11 @@  discard block
 block discarded – undo
2075 2075
 
2076 2076
     $title = apply_filters('geodir_add_listing_page_title_text', get_the_title());
2077 2077
 
2078
-    if(geodir_is_page('add-listing')){
2078
+    if (geodir_is_page('add-listing')) {
2079 2079
         $gd_page = 'add-listing';
2080
-        if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
2080
+        if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2081 2081
             $title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
2082
-        }elseif(isset($listing_type)){
2082
+        }elseif (isset($listing_type)) {
2083 2083
             $title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
2084 2084
         }
2085 2085
 
@@ -2093,9 +2093,9 @@  discard block
 block discarded – undo
2093 2093
      * @param string $title The page title including variables.
2094 2094
      * @param string $gd_page The GeoDirectory page type if any.
2095 2095
      */
2096
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2096
+    $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2097 2097
 
2098
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">';
2098
+    echo '<header class="'.$class_header.'"><h1 class="'.$class.'">';
2099 2099
     echo $title;
2100 2100
     echo '</h1></header>';
2101 2101
 }
@@ -2109,7 +2109,7 @@  discard block
 block discarded – undo
2109 2109
  */
2110 2110
 function geodir_action_add_listing_page_mandatory()
2111 2111
 {?>
2112
-    <p class="geodir-note "><span class="geodir-required">*</span>&nbsp;<?php echo INDICATES_MANDATORY_FIELDS_TEXT;?></p>
2112
+    <p class="geodir-note "><span class="geodir-required">*</span>&nbsp;<?php echo INDICATES_MANDATORY_FIELDS_TEXT; ?></p>
2113 2113
 <?php
2114 2114
 }
2115 2115
 
@@ -2144,7 +2144,7 @@  discard block
 block discarded – undo
2144 2144
 
2145 2145
     if (isset($_REQUEST['backandedit'])) {
2146 2146
         global $post;
2147
-        $post = (object)$gd_session->get('listing');
2147
+        $post = (object) $gd_session->get('listing');
2148 2148
         $listing_type = $post->listing_type;
2149 2149
         $title = $post->post_title;
2150 2150
         $desc = $post->post_desc;
@@ -2159,7 +2159,7 @@  discard block
 block discarded – undo
2159 2159
         $thumb_img_arr = geodir_get_images($post->ID);
2160 2160
         if ($thumb_img_arr) {
2161 2161
             foreach ($thumb_img_arr as $post_img) {
2162
-                $curImages .= $post_img->src . ',';
2162
+                $curImages .= $post_img->src.',';
2163 2163
             }
2164 2164
         }
2165 2165
 
@@ -2167,7 +2167,7 @@  discard block
 block discarded – undo
2167 2167
         $title = $post->post_title;
2168 2168
         $desc = $post->post_content;
2169 2169
         $kw_tags = $post->post_tags;
2170
-        $kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type . '_tags', array('fields' => 'names')));
2170
+        $kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type.'_tags', array('fields' => 'names')));
2171 2171
     } else {
2172 2172
         $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2173 2173
     }
@@ -2178,18 +2178,18 @@  discard block
 block discarded – undo
2178 2178
 
2179 2179
     $post_type_info = geodir_get_posttype_info($listing_type);
2180 2180
 
2181
-    $cpt_singular_name = (isset($post_type_info['labels']['singular_name']) && $post_type_info['labels']['singular_name']) ? $post_type_info['labels']['singular_name'] : __('Listing','geodirectory');
2181
+    $cpt_singular_name = (isset($post_type_info['labels']['singular_name']) && $post_type_info['labels']['singular_name']) ? $post_type_info['labels']['singular_name'] : __('Listing', 'geodirectory');
2182 2182
 
2183 2183
     ?>
2184
-    <form name="propertyform" id="propertyform" action="<?php echo get_page_link(geodir_preview_page_id());?>" method="post" enctype="multipart/form-data">
2185
-        <input type="hidden" name="preview" value="<?php echo sanitize_text_field($listing_type);?>"/>
2186
-        <input type="hidden" name="listing_type" value="<?php echo sanitize_text_field($listing_type);?>"/>
2184
+    <form name="propertyform" id="propertyform" action="<?php echo get_page_link(geodir_preview_page_id()); ?>" method="post" enctype="multipart/form-data">
2185
+        <input type="hidden" name="preview" value="<?php echo sanitize_text_field($listing_type); ?>"/>
2186
+        <input type="hidden" name="listing_type" value="<?php echo sanitize_text_field($listing_type); ?>"/>
2187 2187
         <?php if ($page_id) { ?>
2188
-        <input type="hidden" name="add_listing_page_id" value="<?php echo $page_id;?>"/>
2188
+        <input type="hidden" name="add_listing_page_id" value="<?php echo $page_id; ?>"/>
2189 2189
         <?php } if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') { ?>
2190
-            <input type="hidden" name="pid" value="<?php echo sanitize_text_field($_REQUEST['pid']);?>"/>
2190
+            <input type="hidden" name="pid" value="<?php echo sanitize_text_field($_REQUEST['pid']); ?>"/>
2191 2191
         <?php } if (isset($_REQUEST['backandedit'])) { ?>
2192
-            <input type="hidden" name="backandedit" value="<?php echo sanitize_text_field($_REQUEST['backandedit']);?>"/>
2192
+            <input type="hidden" name="backandedit" value="<?php echo sanitize_text_field($_REQUEST['backandedit']); ?>"/>
2193 2193
         <?php
2194 2194
         } 
2195 2195
         /**
@@ -2201,7 +2201,7 @@  discard block
 block discarded – undo
2201 2201
          */
2202 2202
         do_action('geodir_before_detail_fields');
2203 2203
         ?>
2204
-        <h5 id="geodir_fieldset_details" class="geodir-fieldset-row" gd-fieldset="details"><?php echo LISTING_DETAILS_TEXT;?></h5>
2204
+        <h5 id="geodir_fieldset_details" class="geodir-fieldset-row" gd-fieldset="details"><?php echo LISTING_DETAILS_TEXT; ?></h5>
2205 2205
         <?php
2206 2206
         /**
2207 2207
          * Called at the top of the add listing page form for frontend.
@@ -2222,10 +2222,10 @@  discard block
 block discarded – undo
2222 2222
                  * @param string $cpt_singular_name The singular title of the curent CPT.
2223 2223
                  * @param string $listing_type The CPT being requested. ie: gd_place.
2224 2224
                  */
2225
-                echo apply_filters('geodir_add_listing_title_label', sprintf( __('%s Title', 'geodirectory'), $cpt_singular_name ),$cpt_singular_name,$listing_type); ?><span>*</span> </label>
2225
+                echo apply_filters('geodir_add_listing_title_label', sprintf(__('%s Title', 'geodirectory'), $cpt_singular_name), $cpt_singular_name, $listing_type); ?><span>*</span> </label>
2226 2226
             <input type="text" field_type="text" name="post_title" id="post_title" class="geodir_textfield"
2227 2227
                    value="<?php echo esc_attr(stripslashes($title)); ?>"/>
2228
-            <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory');?></span>
2228
+            <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span>
2229 2229
         </div>
2230 2230
         <?php
2231 2231
         $show_editor = get_option('geodir_tiny_editor_on_add_listing');
@@ -2260,7 +2260,7 @@  discard block
 block discarded – undo
2260 2260
         $desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit);
2261 2261
         
2262 2262
         $desc_class = '';
2263
-        if ($desc_limit === '' || (int)$desc_limit > 0) {
2263
+        if ($desc_limit === '' || (int) $desc_limit > 0) {
2264 2264
             /**
2265 2265
              * Called on the add listing page form for frontend just before the description field.
2266 2266
              *
@@ -2273,7 +2273,7 @@  discard block
 block discarded – undo
2273 2273
             $desc_class = ' hidden';
2274 2274
         }
2275 2275
         ?>
2276
-        <div id="geodir_post_desc_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $desc_class;?>">
2276
+        <div id="geodir_post_desc_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $desc_class; ?>">
2277 2277
             <label><?php
2278 2278
                 /**
2279 2279
                  * Filter the add listing page description input label.
@@ -2283,7 +2283,7 @@  discard block
 block discarded – undo
2283 2283
                  * @param string $cpt_singular_name The singular title of the curent CPT.
2284 2284
                  * @param string $listing_type The CPT being requested. ie: gd_place.
2285 2285
                  */
2286
-                echo apply_filters('geodir_add_listing_description_label',sprintf( __('%s Description', 'geodirectory'), $cpt_singular_name ),$cpt_singular_name,$listing_type); ?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label>
2286
+                echo apply_filters('geodir_add_listing_description_label', sprintf(__('%s Description', 'geodirectory'), $cpt_singular_name), $cpt_singular_name, $listing_type); ?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label>
2287 2287
             <?php
2288 2288
             if (!empty($show_editor) && in_array($listing_type, $show_editor)) {
2289 2289
                 $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
@@ -2292,16 +2292,16 @@  discard block
 block discarded – undo
2292 2292
                     <?php wp_editor($desc, "post_desc", $editor_settings); ?>
2293 2293
                 </div>
2294 2294
             <?php if ($desc_limit != '') { ?>
2295
-                <script type="text/javascript">jQuery('textarea#post_desc').attr('maxlength', "<?php echo $desc_limit;?>");</script>
2295
+                <script type="text/javascript">jQuery('textarea#post_desc').attr('maxlength', "<?php echo $desc_limit; ?>");</script>
2296 2296
             <?php } } else { ?>
2297 2297
                 <textarea field_type="textarea" name="post_desc" id="post_desc" class="geodir_textarea" maxlength="<?php echo $desc_limit; ?>"><?php echo $desc; ?></textarea>
2298 2298
             <?php } if ($desc_limit_msg != '') { ?>
2299 2299
                 <span class="geodir_message_note"><?php echo $desc_limit_msg; ?></span>
2300 2300
             <?php } ?>
2301
-            <span class="geodir_message_error"><?php echo _e($required_msg, 'geodirectory');?></span>
2301
+            <span class="geodir_message_error"><?php echo _e($required_msg, 'geodirectory'); ?></span>
2302 2302
         </div>
2303 2303
         <?php
2304
-        if ($desc_limit === '' || (int)$desc_limit > 0) {
2304
+        if ($desc_limit === '' || (int) $desc_limit > 0) {
2305 2305
             /**
2306 2306
              * Called on the add listing page form for frontend just after the description field.
2307 2307
              *
@@ -2340,7 +2340,7 @@  discard block
 block discarded – undo
2340 2340
         $kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count);
2341 2341
         
2342 2342
         $tags_class = '';
2343
-        if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2343
+        if ($kw_tags_count === '' || (int) $kw_tags_count > 0) {
2344 2344
             /**
2345 2345
              * Called on the add listing page form for frontend just before the tags field.
2346 2346
              *
@@ -2351,14 +2351,14 @@  discard block
 block discarded – undo
2351 2351
             $tags_class = ' hidden';
2352 2352
         }
2353 2353
         ?>
2354
-        <div id="geodir_post_tags_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $tags_class;?>">
2354
+        <div id="geodir_post_tags_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $tags_class; ?>">
2355 2355
             <label><?php echo TAGKW_TEXT; ?></label>
2356 2356
             <input name="post_tags" id="post_tags" value="<?php echo $kw_tags; ?>" type="text" class="geodir_textfield"
2357
-                   maxlength="<?php echo $kw_tags_count;?>"/>
2358
-            <span class="geodir_message_note"><?php echo $kw_tags_msg;?></span>
2357
+                   maxlength="<?php echo $kw_tags_count; ?>"/>
2358
+            <span class="geodir_message_note"><?php echo $kw_tags_msg; ?></span>
2359 2359
         </div>
2360 2360
         <?php
2361
-        if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2361
+        if ($kw_tags_count === '' || (int) $kw_tags_count > 0) {
2362 2362
             /**
2363 2363
              * Called on the add listing page form for frontend just after the tags field.
2364 2364
              *
@@ -2384,7 +2384,7 @@  discard block
 block discarded – undo
2384 2384
         $thumb_img_arr = array();
2385 2385
         $totImg = 0;
2386 2386
         if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
2387
-            $post = (object)$gd_session->get('listing');
2387
+            $post = (object) $gd_session->get('listing');
2388 2388
             if (isset($post->post_images))
2389 2389
                 $curImages = trim($post->post_images, ",");
2390 2390
 
@@ -2397,7 +2397,7 @@  discard block
 block discarded – undo
2397 2397
             $listing_type = $post->listing_type;
2398 2398
 
2399 2399
         } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2400
-            $post = geodir_get_post_info((int)$_REQUEST['pid']);
2400
+            $post = geodir_get_post_info((int) $_REQUEST['pid']);
2401 2401
             $listing_type = $post->post_type;
2402 2402
             $thumb_img_arr = geodir_get_images($_REQUEST['pid']);
2403 2403
 
@@ -2411,7 +2411,7 @@  discard block
 block discarded – undo
2411 2411
                 //$curImages = $img->src.",";
2412 2412
             }
2413 2413
 
2414
-            $totImg = count((array)$thumb_img_arr);
2414
+            $totImg = count((array) $thumb_img_arr);
2415 2415
         }
2416 2416
 
2417 2417
         if ($curImages != '')
@@ -2432,15 +2432,15 @@  discard block
 block discarded – undo
2432 2432
         if ($show_image_input_box) {
2433 2433
             ?>
2434 2434
 
2435
-            <h5 id="geodir_form_title_row" class="geodir-form_title"> <?php echo PRO_PHOTO_TEXT;?>
2435
+            <h5 id="geodir_form_title_row" class="geodir-form_title"> <?php echo PRO_PHOTO_TEXT; ?>
2436 2436
                 <?php if ($image_limit == 1) {
2437
-                    echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
2437
+                    echo '<br /><small>('.__('You can upload', 'geodirectory').' '.$image_limit.' '.__('image with this package', 'geodirectory').')</small>';
2438 2438
                 } ?>
2439 2439
                 <?php if ($image_limit > 1) {
2440
-                    echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>';
2440
+                    echo '<br /><small>('.__('You can upload', 'geodirectory').' '.$image_limit.' '.__('images with this package', 'geodirectory').')</small>';
2441 2441
                 } ?>
2442 2442
                 <?php if ($image_limit == '') {
2443
-                    echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>';
2443
+                    echo '<br /><small>('.__('You can upload unlimited images with this package', 'geodirectory').')</small>';
2444 2444
                 } ?>
2445 2445
             </h5>
2446 2446
 
@@ -2455,11 +2455,11 @@  discard block
 block discarded – undo
2455 2455
                 <div
2456 2456
                     class="plupload-upload-uic hide-if-no-js <?php if ($multiple): ?>plupload-upload-uic-multiple<?php endif; ?>"
2457 2457
                     id="<?php echo $id; ?>plupload-upload-ui">
2458
-                    <h4><?php _e('Drop files to upload', 'geodirectory');?></h4><br/>
2458
+                    <h4><?php _e('Drop files to upload', 'geodirectory'); ?></h4><br/>
2459 2459
                     <input id="<?php echo $id; ?>plupload-browse-button" type="button"
2460 2460
                            value="<?php esc_attr_e('Select Files', 'geodirectory'); ?>" class="geodir_button"/>
2461 2461
                     <span class="ajaxnonceplu"
2462
-                          id="ajaxnonceplu<?php echo wp_create_nonce($id . 'pluploadan'); ?>"></span>
2462
+                          id="ajaxnonceplu<?php echo wp_create_nonce($id.'pluploadan'); ?>"></span>
2463 2463
                     <?php if ($width && $height): ?>
2464 2464
                         <span class="plupload-resize"></span>
2465 2465
                         <span class="plupload-width" id="plupload-width<?php echo $width; ?>"></span>
@@ -2472,7 +2472,7 @@  discard block
 block discarded – undo
2472 2472
                      id="<?php echo $id; ?>plupload-thumbs" style="border-top:1px solid #ccc; padding-top:10px;">
2473 2473
                 </div>
2474 2474
                 <span
2475
-                    id="upload-msg"><?php _e('Please drag &amp; drop the images to rearrange the order', 'geodirectory');?></span>
2475
+                    id="upload-msg"><?php _e('Please drag &amp; drop the images to rearrange the order', 'geodirectory'); ?></span>
2476 2476
                 <span id="<?php echo $id; ?>upload-error" style="display:none"></span>
2477 2477
             </div>
2478 2478
 
@@ -2484,7 +2484,7 @@  discard block
 block discarded – undo
2484 2484
          *
2485 2485
          * @since 1.0.0
2486 2486
          */
2487
-        do_action('geodir_after_main_form_fields');?>
2487
+        do_action('geodir_after_main_form_fields'); ?>
2488 2488
 
2489 2489
 
2490 2490
         <!-- add captcha code -->
@@ -2495,7 +2495,7 @@  discard block
 block discarded – undo
2495 2495
         </script>
2496 2496
         <noscript>
2497 2497
             <div>
2498
-                <label><?php _e('Type 64 into this box', 'geodirectory');?></label>
2498
+                <label><?php _e('Type 64 into this box', 'geodirectory'); ?></label>
2499 2499
                 <input type="text" id="geodir_spamblocker_top_form" name="geodir_spamblocker" value="" maxlength="10"/>
2500 2500
             </div>
2501 2501
         </noscript>
@@ -2505,10 +2505,10 @@  discard block
 block discarded – undo
2505 2505
         <!-- end captcha code -->
2506 2506
 
2507 2507
         <div id="geodir-add-listing-submit" class="geodir_form_row clear_both" style="padding:2px;text-align:center;">
2508
-            <input type="submit" value="<?php echo PRO_PREVIEW_BUTTON;?>"
2509
-                   class="geodir_button" <?php echo $submit_button;?>/>
2508
+            <input type="submit" value="<?php echo PRO_PREVIEW_BUTTON; ?>"
2509
+                   class="geodir_button" <?php echo $submit_button; ?>/>
2510 2510
             <span class="geodir_message_note"
2511
-                  style="padding-left:0px;"> <?php _e('Note: You will be able to see a preview in the next page', 'geodirectory');?></span>
2511
+                  style="padding-left:0px;"> <?php _e('Note: You will be able to see a preview in the next page', 'geodirectory'); ?></span>
2512 2512
         </div>
2513 2513
 
2514 2514
     </form>
@@ -2570,7 +2570,7 @@  discard block
 block discarded – undo
2570 2570
         class="<?php
2571 2571
         /** This action is documented in geodirectory_template_actions.php */
2572 2572
         echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>">
2573
-        <?php dynamic_sidebar('Reg/Login Top Section');?>
2573
+        <?php dynamic_sidebar('Reg/Login Top Section'); ?>
2574 2574
     </div><!-- clearfix ends here-->
2575 2575
 <?php
2576 2576
 }
@@ -2592,7 +2592,7 @@  discard block
 block discarded – undo
2592 2592
 
2593 2593
     ?>
2594 2594
     <script type="text/javascript">
2595
-        <?php if ( $user_login ) { ?>
2595
+        <?php if ($user_login) { ?>
2596 2596
         setTimeout(function () {
2597 2597
             try {
2598 2598
                 d = document.getElementById('user_pass');
@@ -2609,7 +2609,7 @@  discard block
 block discarded – undo
2609 2609
         <?php } ?>
2610 2610
     </script>
2611 2611
     <script type="text/javascript">
2612
-        <?php if ( $user_login ) { ?>
2612
+        <?php if ($user_login) { ?>
2613 2613
         setTimeout(function () {
2614 2614
             try {
2615 2615
                 d = document.getElementById('user_pass');
@@ -2634,7 +2634,7 @@  discard block
 block discarded – undo
2634 2634
         foreach ($errors as $errorsObj) {
2635 2635
             foreach ($errorsObj as $key => $val) {
2636 2636
                 for ($i = 0; $i < count($val); $i++) {
2637
-                    echo "<div class=error_msg_fix>" . $val[$i] . '</div>';
2637
+                    echo "<div class=error_msg_fix>".$val[$i].'</div>';
2638 2638
                     $registration_error_msg = 1;
2639 2639
                 }
2640 2640
             }
@@ -2651,7 +2651,7 @@  discard block
 block discarded – undo
2651 2651
              *
2652 2652
              * @since 1.0.0
2653 2653
              */
2654
-            include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2654
+            include(geodir_plugin_path()."/geodirectory-templates/login_frm.php"); ?>
2655 2655
         </div>
2656 2656
 
2657 2657
     <?php } elseif (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_up') { ?>
@@ -2663,7 +2663,7 @@  discard block
 block discarded – undo
2663 2663
              *
2664 2664
              * @since 1.0.0
2665 2665
              */
2666
-            include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2666
+            include(geodir_plugin_path()."/geodirectory-templates/reg_frm.php"); ?>
2667 2667
         </div>
2668 2668
 
2669 2669
     <?php } else { ?>
@@ -2675,7 +2675,7 @@  discard block
 block discarded – undo
2675 2675
              *
2676 2676
              * @since 1.0.0
2677 2677
              */
2678
-            include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2678
+            include(geodir_plugin_path()."/geodirectory-templates/login_frm.php"); ?>
2679 2679
         </div>
2680 2680
         <div class="registration_form_r">
2681 2681
             <?php
@@ -2684,7 +2684,7 @@  discard block
 block discarded – undo
2684 2684
              *
2685 2685
              * @since 1.0.0
2686 2686
              */
2687
-            include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2687
+            include(geodir_plugin_path()."/geodirectory-templates/reg_frm.php"); ?>
2688 2688
         </div>
2689 2689
 
2690 2690
     <?php }?>
@@ -2720,12 +2720,12 @@  discard block
 block discarded – undo
2720 2720
     $gd_post_type = geodir_get_current_posttype();
2721 2721
     $post_type_info = get_post_type_object($gd_post_type);
2722 2722
 
2723
-    $add_string_in_title = __('All', 'geodirectory') . ' ';
2723
+    $add_string_in_title = __('All', 'geodirectory').' ';
2724 2724
     if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
2725
-        $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
2725
+        $add_string_in_title = __('My Favorite', 'geodirectory').' ';
2726 2726
     }
2727 2727
 
2728
-    $list_title = $add_string_in_title . $post_type_info->labels->name;
2728
+    $list_title = $add_string_in_title.$post_type_info->labels->name;
2729 2729
     $single_name = $post_type_info->labels->singular_name;
2730 2730
 
2731 2731
     $taxonomy = geodir_get_taxonomies($gd_post_type);
@@ -2733,12 +2733,12 @@  discard block
 block discarded – undo
2733 2733
     if (!empty($term)) {
2734 2734
         $current_term = get_term_by('slug', $term, $taxonomy[0]);
2735 2735
         if (!empty($current_term))
2736
-            $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
2736
+            $list_title .= __(' in', 'geodirectory')." '".geodir_ucwords($current_term->name)."'";
2737 2737
     }
2738 2738
 
2739 2739
 
2740 2740
     if (is_search()) {
2741
-        $list_title = __('Search', 'geodirectory') . ' ' . __($post_type_info->labels->name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2741
+        $list_title = __('Search', 'geodirectory').' '.__($post_type_info->labels->name, 'geodirectory').__(' For :', 'geodirectory')." '".get_search_query()."'";
2742 2742
 
2743 2743
     }
2744 2744
     /** This action is documented in geodirectory_template_actions.php */
@@ -2747,11 +2747,11 @@  discard block
 block discarded – undo
2747 2747
     $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2748 2748
 
2749 2749
     $title = $list_title;
2750
-    if(geodir_is_page('author')){
2750
+    if (geodir_is_page('author')) {
2751 2751
         $gd_page = 'author';
2752
-        if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
2752
+        if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
2753 2753
             $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
2754
-        }else{
2754
+        } else {
2755 2755
             $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
2756 2756
         }
2757 2757
 
@@ -2765,16 +2765,16 @@  discard block
 block discarded – undo
2765 2765
      * @param string $title The page title including variables.
2766 2766
      * @param string $gd_page The GeoDirectory page type if any.
2767 2767
      */
2768
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2768
+    $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2769 2769
 
2770
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2770
+    echo '<header class="'.$class_header.'"><h1 class="'.$class.'">'.
2771 2771
         /**
2772 2772
          * Filter the author page title text.
2773 2773
          *
2774 2774
          * @since 1.0.0
2775 2775
          * @param string $list_title The title for the page.
2776 2776
          */
2777
-        apply_filters('geodir_author_page_title_text', $title) . '</h1></header>';
2777
+        apply_filters('geodir_author_page_title_text', $title).'</h1></header>';
2778 2778
 }
2779 2779
 
2780 2780
 
@@ -2979,19 +2979,19 @@  discard block
 block discarded – undo
2979 2979
     $post_type_info = get_post_type_object($gd_post_type);
2980 2980
 
2981 2981
     $pt_name = '';
2982
-    if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;}
2982
+    if (isset($post_type_info->labels->name)) {$pt_name = $post_type_info->labels->name; }
2983 2983
 
2984 2984
     if (is_search()) {
2985
-        $list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2985
+        $list_title = __('Search', 'geodirectory').' '.__($pt_name, 'geodirectory').__(' For :', 'geodirectory')." '".get_search_query()."'";
2986 2986
 
2987 2987
     }
2988 2988
     /** This action is documented in geodirectory_template_actions.php */
2989 2989
     $class = apply_filters('geodir_page_title_class', 'entry-title fn');
2990 2990
     /** This action is documented in geodirectory_template_actions.php */
2991 2991
     $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2992
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2992
+    echo '<header class="'.$class_header.'"><h1 class="'.$class.'">'.
2993 2993
         /** This action is documented in geodirectory_template_actions.php */
2994
-        apply_filters('geodir_listing_page_title', wptexturize($list_title)) . '</h1></header>';
2994
+        apply_filters('geodir_listing_page_title', wptexturize($list_title)).'</h1></header>';
2995 2995
 }
2996 2996
 
2997 2997
 // action for adding the listings page top widget area
@@ -3395,7 +3395,7 @@  discard block
 block discarded – undo
3395 3395
         $gd_post_type = geodir_get_current_posttype();
3396 3396
         $post_type_info = get_post_type_object($gd_post_type);
3397 3397
 
3398
-        $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' :', 'geodirectory');
3398
+        $list_title = __('Search', 'geodirectory').' '.__(ucfirst($post_type_info->labels->name), 'geodirectory').__(' :', 'geodirectory');
3399 3399
     }
3400 3400
     return $list_title;
3401 3401
 }
@@ -3411,7 +3411,7 @@  discard block
 block discarded – undo
3411 3411
  * @param string $position Position to add the post content. 'before' or 'after'. Default 'before'.
3412 3412
  * @param string $gd_page The geodirectory page type. Default null.
3413 3413
  */
3414
-function geodir_add_page_content( $position = 'before', $gd_page = '' ) {
3414
+function geodir_add_page_content($position = 'before', $gd_page = '') {
3415 3415
     global $post;
3416 3416
 
3417 3417
     $gd_page_id = NULL;
Please login to merge, or discard this patch.
geodirectory-functions/listing_filters.php 3 patches
Braces   +30 added lines, -19 removed lines patch added patch discarded remove patch
@@ -16,7 +16,9 @@  discard block
 block discarded – undo
16 16
  */
17 17
 function geodir_session_start()
18 18
 {
19
-    if (!session_id()) session_start();
19
+    if (!session_id()) {
20
+    	session_start();
21
+    }
20 22
     global $geodir_add_location_url;
21 23
 
22 24
     $geodir_add_location_url = NULL;
@@ -86,7 +88,9 @@  discard block
 block discarded – undo
86 88
 
87 89
     if ((is_search() && isset($_REQUEST['geodir_search']) && $_REQUEST['geodir_search'] != '')):
88 90
 
89
-        if (isset($_REQUEST['scat']) && $_REQUEST['scat'] == 'all') $_REQUEST['scat'] = '';
91
+        if (isset($_REQUEST['scat']) && $_REQUEST['scat'] == 'all') {
92
+        	$_REQUEST['scat'] = '';
93
+        }
90 94
         //if(isset($_REQUEST['s']) && $_REQUEST['s'] == '+') $_REQUEST['s'] = '';
91 95
 
92 96
         if (isset($_REQUEST['sdist'])) {
@@ -198,8 +202,9 @@  discard block
 block discarded – undo
198 202
         add_filter('posts_fields', 'geodir_posts_fields', 1);
199 203
         add_filter('posts_join', 'geodir_posts_join', 1);
200 204
         geodir_post_where();
201
-        if (!is_admin())
202
-            add_filter('posts_orderby', 'geodir_posts_orderby', 1);
205
+        if (!is_admin()) {
206
+                    add_filter('posts_orderby', 'geodir_posts_orderby', 1);
207
+        }
203 208
 
204 209
         // advanced filter for popular post view widget
205 210
         global $wp_query;
@@ -346,8 +351,9 @@  discard block
 block discarded – undo
346 351
     $sort_by = '';
347 352
     $orderby = ' ';
348 353
 
349
-    if (get_query_var('order_by'))
350
-        $sort_by = get_query_var('order_by');
354
+    if (get_query_var('order_by')) {
355
+            $sort_by = get_query_var('order_by');
356
+    }
351 357
 
352 358
     /*if(isset($wp_query->tax_query->queries) && $wp_query->tax_query->queries){
353 359
         $current_term = $wp_query->get_queried_object();
@@ -367,14 +373,16 @@  discard block
 block discarded – undo
367 373
         $orderby .= " distance,";
368 374
     }
369 375
 
370
-    if (isset($_REQUEST['sort_by']) && $_REQUEST['sort_by'] != '' && is_main_query())
371
-        $sort_by = esc_attr($_REQUEST['sort_by']);
376
+    if (isset($_REQUEST['sort_by']) && $_REQUEST['sort_by'] != '' && is_main_query()) {
377
+            $sort_by = esc_attr($_REQUEST['sort_by']);
378
+    }
372 379
 
373 380
 
374 381
     if ($sort_by == '') {
375 382
         $default_sort = geodir_get_posts_default_sort($geodir_post_type);
376
-        if (!empty($default_sort))
377
-            $sort_by = $default_sort;
383
+        if (!empty($default_sort)) {
384
+                    $sort_by = $default_sort;
385
+        }
378 386
     }
379 387
 
380 388
     /*
@@ -562,8 +570,9 @@  discard block
 block discarded – undo
562 570
 
563 571
             add_filter('posts_where', 'searching_filter_where', 1);
564 572
 
565
-            if ($snear != '')
566
-                add_filter('posts_where', 'searching_filter_where', 1);
573
+            if ($snear != '') {
574
+                            add_filter('posts_where', 'searching_filter_where', 1);
575
+            }
567 576
 
568 577
             add_filter('posts_orderby', 'geodir_posts_orderby', 1);
569 578
 
@@ -731,10 +740,11 @@  discard block
 block discarded – undo
731 740
     }
732 741
 
733 742
     $better_search_terms = '';
734
-    if (isset($_REQUEST['stype']))
735
-        $post_types = esc_attr(wp_strip_all_tags($_REQUEST['stype']));
736
-    else
737
-        $post_types = 'gd_place';
743
+    if (isset($_REQUEST['stype'])) {
744
+            $post_types = esc_attr(wp_strip_all_tags($_REQUEST['stype']));
745
+    } else {
746
+            $post_types = 'gd_place';
747
+    }
738 748
 
739 749
     if ($s != '') {
740 750
         $keywords = explode(" ", $s);
@@ -762,7 +772,7 @@  discard block
 block discarded – undo
762 772
     if($taxonomies) {
763 773
         $taxonomies = implode("','", $taxonomies);
764 774
         $taxonomies = "'" . $taxonomies . "'";
765
-    }else{$taxonomies='';}
775
+    } else{$taxonomies='';}
766 776
 
767 777
     $content_where = $terms_where = '';
768 778
 	if ($s != '') {
@@ -878,8 +888,9 @@  discard block
 block discarded – undo
878 888
             $user_fav_posts = get_user_meta($user_id, 'gd_user_favourite_post', true);
879 889
             $user_fav_posts = !empty($user_fav_posts) && is_array($user_fav_posts) ? implode("','", $user_fav_posts) : '-1';
880 890
             $where .= " AND $wpdb->posts.ID IN ('$user_fav_posts')";
881
-        } else
882
-            $where .= " AND $wpdb->posts.post_author = $user_id";
891
+        } else {
892
+                    $where .= " AND $wpdb->posts.post_author = $user_id";
893
+        }
883 894
 
884 895
         if ($user_id == (int)get_current_user_id()) {
885 896
             $where .= " AND $wpdb->posts.post_status IN ('publish','draft','pending') ";
Please login to merge, or discard this patch.
Indentation   +518 added lines, -518 removed lines patch added patch discarded remove patch
@@ -16,10 +16,10 @@  discard block
 block discarded – undo
16 16
  */
17 17
 function geodir_session_start()
18 18
 {
19
-    if (!session_id()) session_start();
20
-    global $geodir_add_location_url;
19
+	if (!session_id()) session_start();
20
+	global $geodir_add_location_url;
21 21
 
22
-    $geodir_add_location_url = NULL;
22
+	$geodir_add_location_url = NULL;
23 23
 }
24 24
 
25 25
 /**
@@ -33,18 +33,18 @@  discard block
 block discarded – undo
33 33
  */
34 34
 function geodir_modified_query($query)
35 35
 {
36
-    if ($query->is_main_query() && (
37
-            (geodir_is_page('add-listing') && isset($_REQUEST['pid']) && $_REQUEST['pid'] != '')
38
-            || geodir_is_page('listing')
39
-            || geodir_is_page('author')
40
-            || geodir_is_page('search')
41
-            || geodir_is_page('detail'))
42
-    ) {
43
-
44
-        $query->set('is_geodir_loop', true);
45
-    }
36
+	if ($query->is_main_query() && (
37
+			(geodir_is_page('add-listing') && isset($_REQUEST['pid']) && $_REQUEST['pid'] != '')
38
+			|| geodir_is_page('listing')
39
+			|| geodir_is_page('author')
40
+			|| geodir_is_page('search')
41
+			|| geodir_is_page('detail'))
42
+	) {
43
+
44
+		$query->set('is_geodir_loop', true);
45
+	}
46 46
 
47
-    return $query;
47
+	return $query;
48 48
 }
49 49
 
50 50
 /**
@@ -67,81 +67,81 @@  discard block
 block discarded – undo
67 67
  */
68 68
 function set_listing_request($query )
69 69
 {
70
-    global $wp_query, $wpdb, $geodir_post_type, $table, $dist, $mylat, $mylon, $s, $snear, $s, $s_A, $s_SA;
70
+	global $wp_query, $wpdb, $geodir_post_type, $table, $dist, $mylat, $mylon, $s, $snear, $s, $s_A, $s_SA;
71 71
 
72 72
 
73
-    // fix woocommerce shop products filtered by language for GD + WPML + Woocommerce
74
-    if (!geodir_is_geodir_page()) {
75
-        return;
76
-    }
73
+	// fix woocommerce shop products filtered by language for GD + WPML + Woocommerce
74
+	if (!geodir_is_geodir_page()) {
75
+		return;
76
+	}
77 77
 
78
-    /* remove all pre filters */
79
-    remove_all_filters('query');
80
-    remove_all_filters('posts_search');
81
-    remove_all_filters('posts_fields');
82
-    remove_all_filters('posts_join');
83
-    remove_all_filters('posts_orderby');
84
-    remove_all_filters('posts_where');
78
+	/* remove all pre filters */
79
+	remove_all_filters('query');
80
+	remove_all_filters('posts_search');
81
+	remove_all_filters('posts_fields');
82
+	remove_all_filters('posts_join');
83
+	remove_all_filters('posts_orderby');
84
+	remove_all_filters('posts_where');
85 85
 
86 86
 
87
-    if ((is_search() && isset($_REQUEST['geodir_search']) && $_REQUEST['geodir_search'] != '')):
87
+	if ((is_search() && isset($_REQUEST['geodir_search']) && $_REQUEST['geodir_search'] != '')):
88 88
 
89
-        if (isset($_REQUEST['scat']) && $_REQUEST['scat'] == 'all') $_REQUEST['scat'] = '';
90
-        //if(isset($_REQUEST['s']) && $_REQUEST['s'] == '+') $_REQUEST['s'] = '';
89
+		if (isset($_REQUEST['scat']) && $_REQUEST['scat'] == 'all') $_REQUEST['scat'] = '';
90
+		//if(isset($_REQUEST['s']) && $_REQUEST['s'] == '+') $_REQUEST['s'] = '';
91 91
 
92
-        if (isset($_REQUEST['sdist'])) {
93
-            ($_REQUEST['sdist'] != '0' && $_REQUEST['sdist'] != '') ? $dist = esc_attr($_REQUEST['sdist']) : $dist = 25000;
94
-        } elseif (get_option('geodir_search_dist') != '') {
95
-            $dist = get_option('geodir_search_dist');
92
+		if (isset($_REQUEST['sdist'])) {
93
+			($_REQUEST['sdist'] != '0' && $_REQUEST['sdist'] != '') ? $dist = esc_attr($_REQUEST['sdist']) : $dist = 25000;
94
+		} elseif (get_option('geodir_search_dist') != '') {
95
+			$dist = get_option('geodir_search_dist');
96 96
 
97
-        } else {
98
-            $dist = 25000;
99
-        } //  Distance
97
+		} else {
98
+			$dist = 25000;
99
+		} //  Distance
100 100
 
101
-        if (isset($_REQUEST['sgeo_lat'])) {
102
-            $mylat = (float)esc_attr($_REQUEST['sgeo_lat']);
103
-        } else {
104
-            $mylat = (float)geodir_get_current_city_lat();
105
-        } //  Latatude
101
+		if (isset($_REQUEST['sgeo_lat'])) {
102
+			$mylat = (float)esc_attr($_REQUEST['sgeo_lat']);
103
+		} else {
104
+			$mylat = (float)geodir_get_current_city_lat();
105
+		} //  Latatude
106 106
 
107
-        if (isset($_REQUEST['sgeo_lon'])) {
108
-            $mylon = (float)esc_attr($_REQUEST['sgeo_lon']);
109
-        } else {
110
-            $mylon = (float)geodir_get_current_city_lng();
111
-        } //  Distance
107
+		if (isset($_REQUEST['sgeo_lon'])) {
108
+			$mylon = (float)esc_attr($_REQUEST['sgeo_lon']);
109
+		} else {
110
+			$mylon = (float)geodir_get_current_city_lng();
111
+		} //  Distance
112 112
 
113
-        if (isset($_REQUEST['snear'])) {
114
-            $snear = trim(esc_attr($_REQUEST['snear']));
115
-        }
113
+		if (isset($_REQUEST['snear'])) {
114
+			$snear = trim(esc_attr($_REQUEST['snear']));
115
+		}
116 116
 
117
-        if (isset($_REQUEST['s'])) {
118
-            $s = trim(esc_attr(wp_strip_all_tags($_REQUEST['s'])));
119
-        }
117
+		if (isset($_REQUEST['s'])) {
118
+			$s = trim(esc_attr(wp_strip_all_tags($_REQUEST['s'])));
119
+		}
120 120
 
121
-        if ($snear == 'NEAR ME') {
122
-            $ip = $_SERVER['REMOTE_ADDR'];
123
-            $addr_details = unserialize(file_get_contents('http://www.geoplugin.net/php.gp?ip=' . $ip));
124
-            $mylat = stripslashes(ucfirst($addr_details[geoplugin_latitude]));
125
-            $mylon = stripslashes(ucfirst($addr_details[geoplugin_longitude]));
126
-        }
121
+		if ($snear == 'NEAR ME') {
122
+			$ip = $_SERVER['REMOTE_ADDR'];
123
+			$addr_details = unserialize(file_get_contents('http://www.geoplugin.net/php.gp?ip=' . $ip));
124
+			$mylat = stripslashes(ucfirst($addr_details[geoplugin_latitude]));
125
+			$mylon = stripslashes(ucfirst($addr_details[geoplugin_longitude]));
126
+		}
127 127
 
128 128
 
129
-        if (strstr($s, ',')) {
130
-            $s_AA = str_replace(" ", "", $s);
131
-            $s_A = explode(",", $s_AA);
132
-            $s_A = implode('","', $s_A);
133
-            $s_A = '"' . $s_A . '"';
134
-        } else {
135
-            $s_A = '"' . $s . '"';
136
-        }
129
+		if (strstr($s, ',')) {
130
+			$s_AA = str_replace(" ", "", $s);
131
+			$s_A = explode(",", $s_AA);
132
+			$s_A = implode('","', $s_A);
133
+			$s_A = '"' . $s_A . '"';
134
+		} else {
135
+			$s_A = '"' . $s . '"';
136
+		}
137 137
 
138
-        if (strstr($s, ' ')) {
139
-            $s_SA = explode(" ", $s);
140
-        } else {
141
-            $s_SA = '';
142
-        }
138
+		if (strstr($s, ' ')) {
139
+			$s_SA = explode(" ", $s);
140
+		} else {
141
+			$s_SA = '';
142
+		}
143 143
 
144
-    endif;
144
+	endif;
145 145
 
146 146
 
147 147
 
@@ -162,56 +162,56 @@  discard block
 block discarded – undo
162 162
  */
163 163
 function geodir_listing_loop_filter($query)
164 164
 {
165
-    global $wp_query, $geodir_post_type, $table, $plugin_prefix, $table, $term;
165
+	global $wp_query, $geodir_post_type, $table, $plugin_prefix, $table, $term;
166 166
 
167
-    // fix wp_reset_query for popular post view widget
168
-    if (!geodir_is_geodir_page()) {
169
-        return;
170
-    }
167
+	// fix wp_reset_query for popular post view widget
168
+	if (!geodir_is_geodir_page()) {
169
+		return;
170
+	}
171 171
 
172
-    $geodir_post_type = geodir_get_current_posttype();
173
-
174
-    if (isset($wp_query->tax_query->queries) && $wp_query->tax_query->queries) {
175
-        $taxonomies = wp_list_pluck($wp_query->tax_query->queries, 'taxonomy');
176
-
177
-        if (isset($wp_query->query[$taxonomies[0]])) {
178
-            $request_term = explode("/", $wp_query->query[$taxonomies[0]]);
179
-            $request_term = end($request_term);
180
-            if (!term_exists($request_term)) {
181
-                $args = array('number' => '1',);
182
-                $terms_arr = get_terms($taxonomies[0], $args);
183
-                foreach ($terms_arr as $location_term) {
184
-                    $term_arr = $location_term;
185
-                    $term_arr->name = geodir_ucwords(str_replace('-', ' ', $request_term));
186
-                }
187
-                $wp_query->queried_object_id = 1;
188
-                $wp_query->queried_object = $term_arr;
189
-                //print_r($wp_query) ;
190
-            }
191
-        }
172
+	$geodir_post_type = geodir_get_current_posttype();
173
+
174
+	if (isset($wp_query->tax_query->queries) && $wp_query->tax_query->queries) {
175
+		$taxonomies = wp_list_pluck($wp_query->tax_query->queries, 'taxonomy');
176
+
177
+		if (isset($wp_query->query[$taxonomies[0]])) {
178
+			$request_term = explode("/", $wp_query->query[$taxonomies[0]]);
179
+			$request_term = end($request_term);
180
+			if (!term_exists($request_term)) {
181
+				$args = array('number' => '1',);
182
+				$terms_arr = get_terms($taxonomies[0], $args);
183
+				foreach ($terms_arr as $location_term) {
184
+					$term_arr = $location_term;
185
+					$term_arr->name = geodir_ucwords(str_replace('-', ' ', $request_term));
186
+				}
187
+				$wp_query->queried_object_id = 1;
188
+				$wp_query->queried_object = $term_arr;
189
+				//print_r($wp_query) ;
190
+			}
191
+		}
192 192
 
193
-    }
194
-    if (isset($query->query_vars['is_geodir_loop']) && $query->query_vars['is_geodir_loop']) {
195
-
196
-        $table = $plugin_prefix . $geodir_post_type . '_detail';
197
-
198
-        add_filter('posts_fields', 'geodir_posts_fields', 1);
199
-        add_filter('posts_join', 'geodir_posts_join', 1);
200
-        geodir_post_where();
201
-        if (!is_admin())
202
-            add_filter('posts_orderby', 'geodir_posts_orderby', 1);
203
-
204
-        // advanced filter for popular post view widget
205
-        global $wp_query;
206
-        if (!is_admin()) {
207
-            if (!empty($wp_query->query['with_pics_only'])) {
208
-                add_filter('posts_join', 'geodir_filter_widget_join', 1000);
209
-            }
210
-            add_filter('posts_where', 'geodir_filter_widget_where', 1000);
211
-        }
193
+	}
194
+	if (isset($query->query_vars['is_geodir_loop']) && $query->query_vars['is_geodir_loop']) {
212 195
 
213
-    }
214
-    return $query;
196
+		$table = $plugin_prefix . $geodir_post_type . '_detail';
197
+
198
+		add_filter('posts_fields', 'geodir_posts_fields', 1);
199
+		add_filter('posts_join', 'geodir_posts_join', 1);
200
+		geodir_post_where();
201
+		if (!is_admin())
202
+			add_filter('posts_orderby', 'geodir_posts_orderby', 1);
203
+
204
+		// advanced filter for popular post view widget
205
+		global $wp_query;
206
+		if (!is_admin()) {
207
+			if (!empty($wp_query->query['with_pics_only'])) {
208
+				add_filter('posts_join', 'geodir_filter_widget_join', 1000);
209
+			}
210
+			add_filter('posts_where', 'geodir_filter_widget_where', 1000);
211
+		}
212
+
213
+	}
214
+	return $query;
215 215
 }
216 216
 
217 217
 
@@ -230,67 +230,67 @@  discard block
 block discarded – undo
230 230
  * @return string Modified fields query string.
231 231
  */
232 232
 function geodir_posts_fields($fields) {
233
-    global $wp_query, $wpdb, $geodir_post_type, $table, $plugin_prefix, $dist, $mylat, $mylon, $snear, $gd_session;
233
+	global $wp_query, $wpdb, $geodir_post_type, $table, $plugin_prefix, $dist, $mylat, $mylon, $snear, $gd_session;
234 234
 
235
-    // Filter-Location-Manager to add location table.
236
-    $fields .= ", " . $table . ".* ";
235
+	// Filter-Location-Manager to add location table.
236
+	$fields .= ", " . $table . ".* ";
237 237
 
238 238
 	if ($snear != '' || $gd_session->get('all_near_me')) {
239
-        $DistanceRadius = geodir_getDistanceRadius(get_option('geodir_search_dist_1'));
239
+		$DistanceRadius = geodir_getDistanceRadius(get_option('geodir_search_dist_1'));
240 240
 
241 241
 		if ($gd_session->get('all_near_me')) {
242
-            $mylat = $gd_session->get('user_lat');
243
-            $mylon = $gd_session->get('user_lon');
244
-        }
245
-
246
-        $fields .= " , (" . $DistanceRadius . " * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(" . $table . ".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(" . $table . ".post_latitude) * pi()/180) *POWER(SIN(($mylon - " . $table . ".post_longitude) * pi()/180 / 2), 2) )))as distance ";
247
-    }
248
-
249
-    global $s;
250
-    if (is_search() && isset($_REQUEST['geodir_search']) && $s && trim($s) != '') {
251
-        $keywords = explode(" ", $s);
252
-
253
-        if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
254
-            foreach($keywords as $kkey=>$kword){
255
-                if(mb_strlen($kword, 'UTF-8')<=$klimit){
256
-                    unset($keywords[$kkey]);
257
-                }
258
-            }
259
-        }
242
+			$mylat = $gd_session->get('user_lat');
243
+			$mylon = $gd_session->get('user_lon');
244
+		}
260 245
 
246
+		$fields .= " , (" . $DistanceRadius . " * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(" . $table . ".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(" . $table . ".post_latitude) * pi()/180) *POWER(SIN(($mylon - " . $table . ".post_longitude) * pi()/180 / 2), 2) )))as distance ";
247
+	}
261 248
 
262
-        if (count($keywords) > 1) {
263
-            $parts = array(
264
-                'AND' => 'gd_alltitlematch_part',
265
-                'OR' => 'gd_titlematch_part'
266
-            );
267
-            $gd_titlematch_part = "";
268
-            foreach ($parts as $key => $part) {
269
-                $gd_titlematch_part .= " CASE WHEN ";
270
-                $count = 0;
271
-                foreach ($keywords as $keyword) {
272
-                    $keyword = trim($keyword);
273
-                    $keyword  = wp_specialchars_decode($keyword ,ENT_QUOTES);
249
+	global $s;
250
+	if (is_search() && isset($_REQUEST['geodir_search']) && $s && trim($s) != '') {
251
+		$keywords = explode(" ", $s);
252
+
253
+		if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
254
+			foreach($keywords as $kkey=>$kword){
255
+				if(mb_strlen($kword, 'UTF-8')<=$klimit){
256
+					unset($keywords[$kkey]);
257
+				}
258
+			}
259
+		}
260
+
261
+
262
+		if (count($keywords) > 1) {
263
+			$parts = array(
264
+				'AND' => 'gd_alltitlematch_part',
265
+				'OR' => 'gd_titlematch_part'
266
+			);
267
+			$gd_titlematch_part = "";
268
+			foreach ($parts as $key => $part) {
269
+				$gd_titlematch_part .= " CASE WHEN ";
270
+				$count = 0;
271
+				foreach ($keywords as $keyword) {
272
+					$keyword = trim($keyword);
273
+					$keyword  = wp_specialchars_decode($keyword ,ENT_QUOTES);
274 274
 					$count++;
275
-                    if ($count < count($keywords)) {
276
-                       // $gd_titlematch_part .= $wpdb->posts . ".post_title LIKE '%%" . $keyword . "%%' " . $key . " ";
275
+					if ($count < count($keywords)) {
276
+					   // $gd_titlematch_part .= $wpdb->posts . ".post_title LIKE '%%" . $keyword . "%%' " . $key . " ";
277 277
 						$gd_titlematch_part .= "( " . $wpdb->posts . ".post_title LIKE '" . $keyword . "' OR " . $wpdb->posts . ".post_title LIKE '" . $keyword . "%%' OR " . $wpdb->posts . ".post_title LIKE '%% " . $keyword . "%%' ) " . $key . " ";
278
-                    } else {
279
-                        //$gd_titlematch_part .= $wpdb->posts . ".post_title LIKE '%%" . $keyword . "%%' ";
278
+					} else {
279
+						//$gd_titlematch_part .= $wpdb->posts . ".post_title LIKE '%%" . $keyword . "%%' ";
280 280
 						$gd_titlematch_part .= "( " . $wpdb->posts . ".post_title LIKE '" . $keyword . "' OR " . $wpdb->posts . ".post_title LIKE '" . $keyword . "%%' OR " . $wpdb->posts . ".post_title LIKE '%% " . $keyword . "%%' ) ";
281
-                    }
282
-                }
283
-                $gd_titlematch_part .= "THEN 1 ELSE 0 END AS " . $part . ",";
284
-            }
285
-        } else {
286
-            $gd_titlematch_part = "";
287
-        }
288
-        $s = stripslashes_deep( $s );
289
-        $s = wp_specialchars_decode($s,ENT_QUOTES);
281
+					}
282
+				}
283
+				$gd_titlematch_part .= "THEN 1 ELSE 0 END AS " . $part . ",";
284
+			}
285
+		} else {
286
+			$gd_titlematch_part = "";
287
+		}
288
+		$s = stripslashes_deep( $s );
289
+		$s = wp_specialchars_decode($s,ENT_QUOTES);
290 290
 		$fields .= $wpdb->prepare(", CASE WHEN " . $table . ".is_featured='1' THEN 1 ELSE 0 END AS gd_featured, CASE WHEN " . $wpdb->posts . ".post_title LIKE %s THEN 1 ELSE 0 END AS gd_exacttitle," . $gd_titlematch_part . " CASE WHEN ( " . $wpdb->posts . ".post_title LIKE %s OR " . $wpdb->posts . ".post_title LIKE %s OR " . $wpdb->posts . ".post_title LIKE %s ) THEN 1 ELSE 0 END AS gd_titlematch, CASE WHEN ( " . $wpdb->posts . ".post_content LIKE %s OR " . $wpdb->posts . ".post_content LIKE %s OR " . $wpdb->posts . ".post_content LIKE %s OR " . $wpdb->posts . ".post_content LIKE %s ) THEN 1 ELSE 0 END AS gd_content", array($s, $s, $s . '%', '% ' . $s . '%', $s, $s . ' %', '% ' . $s . ' %', '% ' . $s));
291
-    }
291
+	}
292 292
 
293
-    return $fields;
293
+	return $fields;
294 294
 }
295 295
 
296 296
 
@@ -307,26 +307,26 @@  discard block
 block discarded – undo
307 307
  */
308 308
 function geodir_posts_join($join)
309 309
 {
310
-    global $wpdb, $geodir_post_type, $table, $table_prefix, $plugin_prefix;
310
+	global $wpdb, $geodir_post_type, $table, $table_prefix, $plugin_prefix;
311 311
 
312
-    ########### WPML ###########
312
+	########### WPML ###########
313 313
 
314
-    if (function_exists('icl_object_id')) {
315
-        global $sitepress;
316
-        $lang_code = ICL_LANGUAGE_CODE;
317
-        $default_lang_code = $sitepress->get_default_language();
318
-        if ($lang_code) {
319
-            $join .= "JOIN " . $table_prefix . "icl_translations icl_t ON icl_t.element_id = " . $table_prefix . "posts.ID";
320
-        }
314
+	if (function_exists('icl_object_id')) {
315
+		global $sitepress;
316
+		$lang_code = ICL_LANGUAGE_CODE;
317
+		$default_lang_code = $sitepress->get_default_language();
318
+		if ($lang_code) {
319
+			$join .= "JOIN " . $table_prefix . "icl_translations icl_t ON icl_t.element_id = " . $table_prefix . "posts.ID";
320
+		}
321 321
 
322
-    }
323
-    ########### WPML ###########
322
+	}
323
+	########### WPML ###########
324 324
 
325
-    $join .= " INNER JOIN " . $table . " ON (" . $table . ".post_id = $wpdb->posts.ID)  ";
326
-    //===old code start
327
-    //$join .= " INNER JOIN ".POST_LOCATION_TABLE." ON (".$table.".post_location_id = ".POST_LOCATION_TABLE.".location_id)  " ;//===old code end
325
+	$join .= " INNER JOIN " . $table . " ON (" . $table . ".post_id = $wpdb->posts.ID)  ";
326
+	//===old code start
327
+	//$join .= " INNER JOIN ".POST_LOCATION_TABLE." ON (".$table.".post_location_id = ".POST_LOCATION_TABLE.".location_id)  " ;//===old code end
328 328
 
329
-    return $join;
329
+	return $join;
330 330
 }
331 331
 
332 332
 
@@ -344,15 +344,15 @@  discard block
 block discarded – undo
344 344
  */
345 345
 function geodir_posts_orderby($orderby)
346 346
 {
347
-    global $wpdb, $wp_query, $geodir_post_type, $table, $plugin_prefix, $snear, $default_sort;
347
+	global $wpdb, $wp_query, $geodir_post_type, $table, $plugin_prefix, $snear, $default_sort;
348 348
 
349
-    $sort_by = '';
350
-    $orderby = ' ';
349
+	$sort_by = '';
350
+	$orderby = ' ';
351 351
 
352
-    if (get_query_var('order_by'))
353
-        $sort_by = get_query_var('order_by');
352
+	if (get_query_var('order_by'))
353
+		$sort_by = get_query_var('order_by');
354 354
 
355
-    /*if(isset($wp_query->tax_query->queries) && $wp_query->tax_query->queries){
355
+	/*if(isset($wp_query->tax_query->queries) && $wp_query->tax_query->queries){
356 356
         $current_term = $wp_query->get_queried_object();
357 357
     }
358 358
 
@@ -366,123 +366,123 @@  discard block
 block discarded – undo
366 366
     }*/
367 367
 
368 368
 
369
-    if ($snear != '') {
370
-        $orderby .= " distance,";
371
-    }
369
+	if ($snear != '') {
370
+		$orderby .= " distance,";
371
+	}
372 372
 
373
-    if (isset($_REQUEST['sort_by']) && $_REQUEST['sort_by'] != '' && is_main_query())
374
-        $sort_by = esc_attr($_REQUEST['sort_by']);
373
+	if (isset($_REQUEST['sort_by']) && $_REQUEST['sort_by'] != '' && is_main_query())
374
+		$sort_by = esc_attr($_REQUEST['sort_by']);
375 375
 
376 376
 
377
-    if ($sort_by == '') {
378
-        $default_sort = geodir_get_posts_default_sort($geodir_post_type);
379
-        if (!empty($default_sort))
380
-            $sort_by = $default_sort;
381
-    }
377
+	if ($sort_by == '') {
378
+		$default_sort = geodir_get_posts_default_sort($geodir_post_type);
379
+		if (!empty($default_sort))
380
+			$sort_by = $default_sort;
381
+	}
382 382
 
383
-    /*
383
+	/*
384 384
     if search by term & no location then order always "relevance"
385 385
     if search by location then order always "nearest"
386 386
     */
387
-    if (is_main_query() && geodir_is_page('search')) {
388
-        $search_term = get_query_var('s');
387
+	if (is_main_query() && geodir_is_page('search')) {
388
+		$search_term = get_query_var('s');
389 389
 
390
-        if (trim($search_term) != '' && !isset($_REQUEST['sort_by'])) {
391
-            $sort_by = 'az';
392
-        }
390
+		if (trim($search_term) != '' && !isset($_REQUEST['sort_by'])) {
391
+			$sort_by = 'az';
392
+		}
393 393
 
394
-        if ($snear != '' &&  $sort_by!='farthest') {
395
-            $sort_by = 'nearest';
396
-        }
397
-    }
394
+		if ($snear != '' &&  $sort_by!='farthest') {
395
+			$sort_by = 'nearest';
396
+		}
397
+	}
398 398
 
399
-    switch ($sort_by):
400
-        case 'newest':
401
-            $orderby = "$wpdb->posts.post_date desc, ";
402
-            break;
403
-        case 'oldest':
404
-            $orderby = "$wpdb->posts.post_date asc, ";
405
-            break;
406
-        case 'low_review':
407
-        case 'rating_count_asc':
408
-            $orderby = $table . ".rating_count ASC, " . $table . ".overall_rating ASC, ";
409
-            break;
410
-        case 'high_review':
411
-        case 'rating_count_desc':
399
+	switch ($sort_by):
400
+		case 'newest':
401
+			$orderby = "$wpdb->posts.post_date desc, ";
402
+			break;
403
+		case 'oldest':
404
+			$orderby = "$wpdb->posts.post_date asc, ";
405
+			break;
406
+		case 'low_review':
407
+		case 'rating_count_asc':
408
+			$orderby = $table . ".rating_count ASC, " . $table . ".overall_rating ASC, ";
409
+			break;
410
+		case 'high_review':
411
+		case 'rating_count_desc':
412 412
 			$orderby = $table . ".rating_count DESC, " . $table . ".overall_rating DESC, ";
413
-            break;
414
-        case 'low_rating':
415
-            $orderby = "( " . $table . ".overall_rating  ) ASC, " . $table . ".rating_count ASC,  ";
416
-            break;
417
-        case 'high_rating':
418
-            $orderby = " " . $table . ".overall_rating DESC, " . $table . ".rating_count DESC, ";
419
-            break;
420
-        case 'featured':
421
-            $orderby = $table . ".is_featured asc, ";
422
-            break;
423
-        case 'nearest':
424
-            $orderby = " distance asc, ";
425
-            break;
426
-        case 'farthest':
427
-            $orderby = " distance desc, ";
428
-            break;
429
-        case 'random':
430
-            $orderby = " rand(), ";
431
-            break;
432
-        case 'az':
433
-            $orderby = "$wpdb->posts.post_title asc, ";
434
-            break;
435
-        // sort by rating
436
-        case 'overall_rating_desc':
437
-            $orderby = " " . $table . ".overall_rating DESC, " . $table . ".rating_count DESC, ";
438
-            break;
439
-        case 'overall_rating_asc':
440
-            $orderby = " " . $table . ".overall_rating ASC, " . $table . ".rating_count ASC, ";
441
-            break;
442
-        default:
443
-
444
-            break;
445
-    endswitch;
446
-
447
-    global $s;
448
-
449
-    if (is_search() && isset($_REQUEST['geodir_search']) && $s && trim($s) != '') {
450
-        $keywords = explode(" ", $s);
451
-        if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
452
-            foreach($keywords as $kkey=>$kword){
453
-                if(mb_strlen($kword, 'UTF-8')<=$klimit){
454
-                    unset($keywords[$kkey]);
455
-                }
456
-            }
457
-        }
458
-        if ($sort_by == 'nearest' || $sort_by == 'farthest') {
459
-            if (count($keywords) > 1) {
460
-                $orderby = $orderby . " ( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_alltitlematch_part * 100 + gd_titlematch_part * 50 + gd_content * 1.5) DESC, ";
461
-            } else {
462
-                $orderby = $orderby . " ( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_content * 1.5) DESC, ";
463
-            }
464
-        } else {
465
-            if (count($keywords) > 1) {
466
-                $orderby = "( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_alltitlematch_part * 100 + gd_titlematch_part * 50 + gd_content * 1.5) DESC, " . $orderby;
467
-            } else {
468
-                $orderby = "( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_content * 1.5) DESC, " . $orderby;
469
-            }
470
-        }
471
-    }
413
+			break;
414
+		case 'low_rating':
415
+			$orderby = "( " . $table . ".overall_rating  ) ASC, " . $table . ".rating_count ASC,  ";
416
+			break;
417
+		case 'high_rating':
418
+			$orderby = " " . $table . ".overall_rating DESC, " . $table . ".rating_count DESC, ";
419
+			break;
420
+		case 'featured':
421
+			$orderby = $table . ".is_featured asc, ";
422
+			break;
423
+		case 'nearest':
424
+			$orderby = " distance asc, ";
425
+			break;
426
+		case 'farthest':
427
+			$orderby = " distance desc, ";
428
+			break;
429
+		case 'random':
430
+			$orderby = " rand(), ";
431
+			break;
432
+		case 'az':
433
+			$orderby = "$wpdb->posts.post_title asc, ";
434
+			break;
435
+		// sort by rating
436
+		case 'overall_rating_desc':
437
+			$orderby = " " . $table . ".overall_rating DESC, " . $table . ".rating_count DESC, ";
438
+			break;
439
+		case 'overall_rating_asc':
440
+			$orderby = " " . $table . ".overall_rating ASC, " . $table . ".rating_count ASC, ";
441
+			break;
442
+		default:
443
+
444
+			break;
445
+	endswitch;
446
+
447
+	global $s;
448
+
449
+	if (is_search() && isset($_REQUEST['geodir_search']) && $s && trim($s) != '') {
450
+		$keywords = explode(" ", $s);
451
+		if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
452
+			foreach($keywords as $kkey=>$kword){
453
+				if(mb_strlen($kword, 'UTF-8')<=$klimit){
454
+					unset($keywords[$kkey]);
455
+				}
456
+			}
457
+		}
458
+		if ($sort_by == 'nearest' || $sort_by == 'farthest') {
459
+			if (count($keywords) > 1) {
460
+				$orderby = $orderby . " ( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_alltitlematch_part * 100 + gd_titlematch_part * 50 + gd_content * 1.5) DESC, ";
461
+			} else {
462
+				$orderby = $orderby . " ( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_content * 1.5) DESC, ";
463
+			}
464
+		} else {
465
+			if (count($keywords) > 1) {
466
+				$orderby = "( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_alltitlematch_part * 100 + gd_titlematch_part * 50 + gd_content * 1.5) DESC, " . $orderby;
467
+			} else {
468
+				$orderby = "( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_content * 1.5) DESC, " . $orderby;
469
+			}
470
+		}
471
+	}
472 472
 
473
-    /**
474
-     * Filter order by SQL.
475
-     *
476
-     * @since 1.0.0
477
-     * @param string $orderby The orderby query string.
478
-     * @param string $sort_by Sortby query string.
479
-     * @param string $table Listing table name.
480
-     */
481
-    $orderby = apply_filters('geodir_posts_order_by_sort', $orderby, $sort_by, $table);
473
+	/**
474
+	 * Filter order by SQL.
475
+	 *
476
+	 * @since 1.0.0
477
+	 * @param string $orderby The orderby query string.
478
+	 * @param string $sort_by Sortby query string.
479
+	 * @param string $table Listing table name.
480
+	 */
481
+	$orderby = apply_filters('geodir_posts_order_by_sort', $orderby, $sort_by, $table);
482 482
 
483
-    $orderby .= $table . ".is_featured asc, $wpdb->posts.post_date desc, $wpdb->posts.post_title ";
483
+	$orderby .= $table . ".is_featured asc, $wpdb->posts.post_date desc, $wpdb->posts.post_title ";
484 484
 
485
-    return $orderby;
485
+	return $orderby;
486 486
 }
487 487
 
488 488
 
@@ -500,53 +500,53 @@  discard block
 block discarded – undo
500 500
 function geodir_posts_order_by_custom_sort($orderby, $sort_by, $table)
501 501
 {
502 502
 
503
-    global $wpdb;
503
+	global $wpdb;
504 504
 
505
-    if ($sort_by != '' && (!is_search() || ( isset($_REQUEST['s']) && isset($_REQUEST['snear']) && $_REQUEST['snear']=='' && ( $_REQUEST['s']=='' ||  $_REQUEST['s']==' ') ) )) {
505
+	if ($sort_by != '' && (!is_search() || ( isset($_REQUEST['s']) && isset($_REQUEST['snear']) && $_REQUEST['snear']=='' && ( $_REQUEST['s']=='' ||  $_REQUEST['s']==' ') ) )) {
506 506
 
507
-        $sort_array = explode('_', $sort_by);
507
+		$sort_array = explode('_', $sort_by);
508 508
 
509
-        $sort_by_count = count($sort_array);
509
+		$sort_by_count = count($sort_array);
510 510
 
511
-        $order = $sort_array[$sort_by_count - 1];
511
+		$order = $sort_array[$sort_by_count - 1];
512 512
 
513
-        if ($sort_by_count > 1 && ($order == 'asc' || $order == 'desc')) {
513
+		if ($sort_by_count > 1 && ($order == 'asc' || $order == 'desc')) {
514 514
 
515
-            $sort_by = str_replace('_' . $order, '', $sort_by);
515
+			$sort_by = str_replace('_' . $order, '', $sort_by);
516 516
 
517
-            switch ($sort_by):
517
+			switch ($sort_by):
518 518
 
519
-                case 'post_date':
520
-                case 'comment_count':
519
+				case 'post_date':
520
+				case 'comment_count':
521 521
 
522
-                    $orderby = "$wpdb->posts." . $sort_by . " " . $order . ", ".$table . ".overall_rating " . $order . ", ";
523
-                    break;
522
+					$orderby = "$wpdb->posts." . $sort_by . " " . $order . ", ".$table . ".overall_rating " . $order . ", ";
523
+					break;
524 524
 
525
-                case 'distance':
526
-                    $orderby = $sort_by . " " . $order . ", ";
527
-                    break;
525
+				case 'distance':
526
+					$orderby = $sort_by . " " . $order . ", ";
527
+					break;
528 528
 
529 529
 
530
-                // sort by rating
531
-                case 'overall_rating':
532
-                    $orderby = " " . $table . "." . $sort_by . "  " . $order . ", " . $table . ".rating_count " . $order . ", ";
530
+				// sort by rating
531
+				case 'overall_rating':
532
+					$orderby = " " . $table . "." . $sort_by . "  " . $order . ", " . $table . ".rating_count " . $order . ", ";
533 533
 
534
-                    break;
534
+					break;
535 535
 
536 536
 
537
-                default:
538
-                    if (geodir_column_exist($table, $sort_by)) {
537
+				default:
538
+					if (geodir_column_exist($table, $sort_by)) {
539 539
 						$orderby = $table . "." . $sort_by . " " . $order . ", ";
540 540
 					}
541
-                    break;
541
+					break;
542 542
 
543
-            endswitch;
543
+			endswitch;
544 544
 
545
-        }
545
+		}
546 546
 
547
-    }
547
+	}
548 548
 
549
-    return $orderby;
549
+	return $orderby;
550 550
 }
551 551
 
552 552
 /**
@@ -561,34 +561,34 @@  discard block
 block discarded – undo
561 561
 {
562 562
 
563 563
 
564
-    global $wpdb, $geodir_post_type, $table, $s, $snear;
564
+	global $wpdb, $geodir_post_type, $table, $s, $snear;
565 565
 
566
-    if (!is_admin()) {
566
+	if (!is_admin()) {
567 567
 
568
-        if (geodir_is_page('add-listing') && isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
569
-            add_filter('posts_where', 'geodir_edit_listing_where', 1);
568
+		if (geodir_is_page('add-listing') && isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
569
+			add_filter('posts_where', 'geodir_edit_listing_where', 1);
570 570
 
571
-        } elseif ((is_search() && $_REQUEST['geodir_search'])) {
571
+		} elseif ((is_search() && $_REQUEST['geodir_search'])) {
572 572
 
573
-            add_filter('posts_where', 'searching_filter_where', 1);
573
+			add_filter('posts_where', 'searching_filter_where', 1);
574 574
 
575
-            if ($snear != '')
576
-                add_filter('posts_where', 'searching_filter_where', 1);
575
+			if ($snear != '')
576
+				add_filter('posts_where', 'searching_filter_where', 1);
577 577
 
578
-            add_filter('posts_orderby', 'geodir_posts_orderby', 1);
578
+			add_filter('posts_orderby', 'geodir_posts_orderby', 1);
579 579
 
580
-        } elseif (geodir_is_page('author')) {
580
+		} elseif (geodir_is_page('author')) {
581 581
 
582
-            add_filter('posts_where', 'author_filter_where', 1);
582
+			add_filter('posts_where', 'author_filter_where', 1);
583 583
 
584
-        }
584
+		}
585 585
 
586
-        //if (!geodir_is_page('detail'))
587
-            add_filter('posts_where', 'geodir_default_where', 1);/**/
586
+		//if (!geodir_is_page('detail'))
587
+			add_filter('posts_where', 'geodir_default_where', 1);/**/
588 588
 
589
-        //add_filter( 'user_has_cap', 'geodir_preview_post_cap', 10, 3 );// let subscribers edit their own posts
589
+		//add_filter( 'user_has_cap', 'geodir_preview_post_cap', 10, 3 );// let subscribers edit their own posts
590 590
 
591
-    }
591
+	}
592 592
 }
593 593
 
594 594
 /**
@@ -603,13 +603,13 @@  discard block
 block discarded – undo
603 603
  */
604 604
 function geodir_preview_post_cap($allcaps, $caps, $args)
605 605
 {
606
-    $user_id = get_current_user_id();
607
-    if ($user_id && isset($_REQUEST['post_type']) && $_REQUEST['post_type'] != '' && isset($_REQUEST['p']) && $_REQUEST['p'] != '' && $args[0] == 'edit_post' && $_REQUEST['p'] == $args[2]) {
606
+	$user_id = get_current_user_id();
607
+	if ($user_id && isset($_REQUEST['post_type']) && $_REQUEST['post_type'] != '' && isset($_REQUEST['p']) && $_REQUEST['p'] != '' && $args[0] == 'edit_post' && $_REQUEST['p'] == $args[2]) {
608 608
 
609
-        $allcaps['edit_posts'] = true;
610
-    }
611
-    //print_r($allcaps);
612
-    return $allcaps;
609
+		$allcaps['edit_posts'] = true;
610
+	}
611
+	//print_r($allcaps);
612
+	return $allcaps;
613 613
 }
614 614
 
615 615
 
@@ -624,9 +624,9 @@  discard block
 block discarded – undo
624 624
  */
625 625
 function geodir_edit_listing_where($where)
626 626
 {
627
-    global $wpdb;
628
-    $where = $wpdb->prepare(" AND $wpdb->posts.ID = %d ", $_REQUEST['pid']);
629
-    return $where;
627
+	global $wpdb;
628
+	$where = $wpdb->prepare(" AND $wpdb->posts.ID = %d ", $_REQUEST['pid']);
629
+	return $where;
630 630
 }
631 631
 
632 632
 
@@ -643,29 +643,29 @@  discard block
 block discarded – undo
643 643
  */
644 644
 function geodir_default_where($where)
645 645
 {
646
-    global $wp_query, $wpdb;
647
-
648
-    //print_r($wp_query);
649
-    ########### WPML ###########
650
-
651
-    if (function_exists('icl_object_id')) {
652
-        global $sitepress, $table_prefix;
653
-        $lang_code = ICL_LANGUAGE_CODE;
654
-        $default_lang_code = $sitepress->get_default_language();
655
-        $q_post_type = isset($wp_query->query['post_type']) ? $wp_query->query['post_type'] : '';
656
-        //echo '##########'.$q_post_type;
657
-        if ($lang_code && $q_post_type) {
658
-            $where .= " AND icl_t.language_code = '$lang_code' AND icl_t.element_type IN('post_" . $q_post_type . "') ";
659
-            //$where .= " AND icl_t.language_code = '$lang_code' ";
660
-        }
646
+	global $wp_query, $wpdb;
661 647
 
662
-    }
663
-    ########### WPML ###########
648
+	//print_r($wp_query);
649
+	########### WPML ###########
664 650
 
651
+	if (function_exists('icl_object_id')) {
652
+		global $sitepress, $table_prefix;
653
+		$lang_code = ICL_LANGUAGE_CODE;
654
+		$default_lang_code = $sitepress->get_default_language();
655
+		$q_post_type = isset($wp_query->query['post_type']) ? $wp_query->query['post_type'] : '';
656
+		//echo '##########'.$q_post_type;
657
+		if ($lang_code && $q_post_type) {
658
+			$where .= " AND icl_t.language_code = '$lang_code' AND icl_t.element_type IN('post_" . $q_post_type . "') ";
659
+			//$where .= " AND icl_t.language_code = '$lang_code' ";
660
+		}
665 661
 
666
-    return $where = str_replace("0 = 1", "1=1", $where);
662
+	}
663
+	########### WPML ###########
667 664
 
668
-    /* ====== old code start ===
665
+
666
+	return $where = str_replace("0 = 1", "1=1", $where);
667
+
668
+	/* ====== old code start ===
669 669
     $where = str_replace("0 = 1", "1=1", $where);
670 670
     $country = get_query_var('gd_country');
671 671
     $region = get_query_var('gd_region');
@@ -706,108 +706,108 @@  discard block
 block discarded – undo
706 706
  * @return string Modified where query string.
707 707
  */
708 708
 function searching_filter_where($where) {
709
-    global $wpdb, $geodir_post_type, $table, $plugin_prefix, $dist, $mylat, $mylon, $s, $snear, $s_A, $s_SA, $search_term, $gd_session;
709
+	global $wpdb, $geodir_post_type, $table, $plugin_prefix, $dist, $mylat, $mylon, $s, $snear, $s_A, $s_SA, $search_term, $gd_session;
710 710
 
711
-    $search_term = 'OR';
712
-    $search_term = 'AND';
713
-    $geodir_custom_search = '';
714
-    $category_search_range = '';
711
+	$search_term = 'OR';
712
+	$search_term = 'AND';
713
+	$geodir_custom_search = '';
714
+	$category_search_range = '';
715 715
 
716
-    if (is_single() && get_query_var('post_type')) {
716
+	if (is_single() && get_query_var('post_type')) {
717 717
 		return $where;
718 718
 	}
719 719
 
720
-    if (is_tax()) {
720
+	if (is_tax()) {
721 721
 		return $where;
722 722
 	}
723 723
 
724 724
 	$s = trim($s);
725
-    $s  = wp_specialchars_decode($s ,ENT_QUOTES);
726
-    $s_A = wp_specialchars_decode($s_A ,ENT_QUOTES);
727
-
728
-    $where = '';
729
-    $better_search_terms = '';
730
-    if (isset($_REQUEST['stype']))
731
-        $post_types = esc_attr(wp_strip_all_tags($_REQUEST['stype']));
732
-    else
733
-        $post_types = 'gd_place';
734
-
735
-    if ($s != '') {
736
-        $keywords = explode(" ", $s);
737
-        if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
738
-            foreach($keywords as $kkey=>$kword){
739
-                if(mb_strlen($kword, 'UTF-8')<=$klimit){
740
-                    unset($keywords[$kkey]);
741
-                }
742
-            }
743
-        }
725
+	$s  = wp_specialchars_decode($s ,ENT_QUOTES);
726
+	$s_A = wp_specialchars_decode($s_A ,ENT_QUOTES);
744 727
 
745
-        if (!empty($keywords)) {
746
-            foreach ($keywords as $keyword) {
747
-                $keyword = trim($keyword);
748
-                $keyword  = wp_specialchars_decode($keyword ,ENT_QUOTES);
749
-                if ($keyword != '') {
750
-                    /**
751
-                     * Filter the search query keywords SQL.
752
-                     *
753
-                     * @since 1.5.9
754
-                     * @package GeoDirectory
755
-                     * @param string $better_search_terms The query values, default: `' OR ( ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '" OR ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '%" OR ' . $wpdb->posts . '.post_title LIKE "% ' . $keyword . '%" )'`.
756
-                     * @param array $keywords The array of keywords for the query.
757
-                     * @param string $keyword The single keyword being searched.
758
-                     */
728
+	$where = '';
729
+	$better_search_terms = '';
730
+	if (isset($_REQUEST['stype']))
731
+		$post_types = esc_attr(wp_strip_all_tags($_REQUEST['stype']));
732
+	else
733
+		$post_types = 'gd_place';
734
+
735
+	if ($s != '') {
736
+		$keywords = explode(" ", $s);
737
+		if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
738
+			foreach($keywords as $kkey=>$kword){
739
+				if(mb_strlen($kword, 'UTF-8')<=$klimit){
740
+					unset($keywords[$kkey]);
741
+				}
742
+			}
743
+		}
744
+
745
+		if (!empty($keywords)) {
746
+			foreach ($keywords as $keyword) {
747
+				$keyword = trim($keyword);
748
+				$keyword  = wp_specialchars_decode($keyword ,ENT_QUOTES);
749
+				if ($keyword != '') {
750
+					/**
751
+					 * Filter the search query keywords SQL.
752
+					 *
753
+					 * @since 1.5.9
754
+					 * @package GeoDirectory
755
+					 * @param string $better_search_terms The query values, default: `' OR ( ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '" OR ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '%" OR ' . $wpdb->posts . '.post_title LIKE "% ' . $keyword . '%" )'`.
756
+					 * @param array $keywords The array of keywords for the query.
757
+					 * @param string $keyword The single keyword being searched.
758
+					 */
759 759
 					$better_search_terms .= apply_filters("geodir_search_better_search_terms",' OR ( ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '" OR ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '%" OR ' . $wpdb->posts . '.post_title LIKE "% ' . $keyword . '%" )',$keywords,$keyword);
760
-                }
761
-            }
762
-        }
763
-    }
760
+				}
761
+			}
762
+		}
763
+	}
764 764
 
765
-    /* get taxonomy */
766
-    $taxonomies = geodir_get_taxonomies($post_types, true);
767
-    if($taxonomies) {
768
-        $taxonomies = implode("','", $taxonomies);
769
-        $taxonomies = "'" . $taxonomies . "'";
770
-    }else{$taxonomies='';}
765
+	/* get taxonomy */
766
+	$taxonomies = geodir_get_taxonomies($post_types, true);
767
+	if($taxonomies) {
768
+		$taxonomies = implode("','", $taxonomies);
769
+		$taxonomies = "'" . $taxonomies . "'";
770
+	}else{$taxonomies='';}
771 771
 
772
-    $content_where = $terms_where = '';
772
+	$content_where = $terms_where = '';
773 773
 	if ($s != '') {
774
-        /**
775
-         * Filter the search query content where values.
776
-         *
777
-         * @since 1.5.0
778
-         * @package GeoDirectory
779
-         * @param string $content_where The query values, default: `" OR ($wpdb->posts.post_content LIKE \"$s\" OR $wpdb->posts.post_content LIKE \"$s%\" OR $wpdb->posts.post_content LIKE \"% $s%\" OR $wpdb->posts.post_content LIKE \"%>$s%\" OR $wpdb->posts.post_content LIKE \"%\n$s%\") ") "`.
780
-         */
774
+		/**
775
+		 * Filter the search query content where values.
776
+		 *
777
+		 * @since 1.5.0
778
+		 * @package GeoDirectory
779
+		 * @param string $content_where The query values, default: `" OR ($wpdb->posts.post_content LIKE \"$s\" OR $wpdb->posts.post_content LIKE \"$s%\" OR $wpdb->posts.post_content LIKE \"% $s%\" OR $wpdb->posts.post_content LIKE \"%>$s%\" OR $wpdb->posts.post_content LIKE \"%\n$s%\") ") "`.
780
+		 */
781 781
 		$content_where = apply_filters("geodir_search_content_where"," OR ($wpdb->posts.post_content LIKE \"$s\" OR $wpdb->posts.post_content LIKE \"$s%\" OR $wpdb->posts.post_content LIKE \"% $s%\" OR $wpdb->posts.post_content LIKE \"%>$s%\" OR $wpdb->posts.post_content LIKE \"%\n$s%\") ");
782
-        /**
783
-         * Filter the search query term values.
784
-         *
785
-         * @since 1.5.0
786
-         * @package GeoDirectory
787
-         * @param string $terms_where The separator, default: `" AND ($wpdb->terms.name LIKE \"$s\" OR $wpdb->terms.name LIKE \"$s%\" OR $wpdb->terms.name LIKE \"% $s%\" OR $wpdb->terms.name IN ($s_A)) "`.
788
-         */
789
-        $terms_where = apply_filters("geodir_search_terms_where"," AND ($wpdb->terms.name LIKE \"$s\" OR $wpdb->terms.name LIKE \"$s%\" OR $wpdb->terms.name LIKE \"% $s%\" OR $wpdb->terms.name IN ($s_A)) ");
782
+		/**
783
+		 * Filter the search query term values.
784
+		 *
785
+		 * @since 1.5.0
786
+		 * @package GeoDirectory
787
+		 * @param string $terms_where The separator, default: `" AND ($wpdb->terms.name LIKE \"$s\" OR $wpdb->terms.name LIKE \"$s%\" OR $wpdb->terms.name LIKE \"% $s%\" OR $wpdb->terms.name IN ($s_A)) "`.
788
+		 */
789
+		$terms_where = apply_filters("geodir_search_terms_where"," AND ($wpdb->terms.name LIKE \"$s\" OR $wpdb->terms.name LIKE \"$s%\" OR $wpdb->terms.name LIKE \"% $s%\" OR $wpdb->terms.name IN ($s_A)) ");
790 790
 	}
791 791
 
792
-    if ($snear != '') {
792
+	if ($snear != '') {
793 793
 
794 794
 
795
-        if (is_numeric($gd_session->get('near_me_range')) && !isset($_REQUEST['sdist'])) {
796
-            $dist = $gd_session->get('near_me_range');
797
-        }
798
-        $lon1 = $mylon - $dist / abs(cos(deg2rad($mylat)) * 69);
799
-        $lon2 = $mylon + $dist / abs(cos(deg2rad($mylat)) * 69);
800
-        $lat1 = $mylat - ($dist / 69);
801
-        $lat2 = $mylat + ($dist / 69);
795
+		if (is_numeric($gd_session->get('near_me_range')) && !isset($_REQUEST['sdist'])) {
796
+			$dist = $gd_session->get('near_me_range');
797
+		}
798
+		$lon1 = $mylon - $dist / abs(cos(deg2rad($mylat)) * 69);
799
+		$lon2 = $mylon + $dist / abs(cos(deg2rad($mylat)) * 69);
800
+		$lat1 = $mylat - ($dist / 69);
801
+		$lat2 = $mylat + ($dist / 69);
802 802
 
803
-        $rlon1 = is_numeric(min($lon1, $lon2)) ? min($lon1, $lon2) : '';
804
-        $rlon2 = is_numeric(max($lon1, $lon2)) ? max($lon1, $lon2) : '';
805
-        $rlat1 = is_numeric(min($lat1, $lat2)) ? min($lat1, $lat2) : '';
806
-        $rlat2 = is_numeric(max($lat1, $lat2)) ? max($lat1, $lat2) : '';
803
+		$rlon1 = is_numeric(min($lon1, $lon2)) ? min($lon1, $lon2) : '';
804
+		$rlon2 = is_numeric(max($lon1, $lon2)) ? max($lon1, $lon2) : '';
805
+		$rlat1 = is_numeric(min($lat1, $lat2)) ? min($lat1, $lat2) : '';
806
+		$rlat2 = is_numeric(max($lat1, $lat2)) ? max($lat1, $lat2) : '';
807 807
 
808 808
 
809 809
 
810
-	    $where .= " AND ( ( $wpdb->posts.post_title LIKE \"$s\" $better_search_terms)
810
+		$where .= " AND ( ( $wpdb->posts.post_title LIKE \"$s\" $better_search_terms)
811 811
 			                    $content_where 
812 812
 								OR ($wpdb->posts.ID IN( 
813 813
 										SELECT $wpdb->term_relationships.object_id as post_id 
@@ -824,13 +824,13 @@  discard block
 block discarded – undo
824 824
 						AND ( " . $table . ".post_latitude between $rlat1 and $rlat2 )
825 825
 						AND ( " . $table . ".post_longitude between $rlon1 and $rlon2 ) ";
826 826
 
827
-        if (isset($_REQUEST['sdist']) && $_REQUEST['sdist'] != 'all') {
828
-            $DistanceRadius = geodir_getDistanceRadius(get_option('geodir_search_dist_1'));
829
-            $where .= " AND CONVERT((" . $DistanceRadius . " * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(" . $table . ".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(" . $table . ".post_latitude) * pi()/180) *POWER(SIN(($mylon - " . $table . ".post_longitude) * pi()/180 / 2), 2) ))),DECIMAL(64,4)) <= " . $dist;
830
-        }
827
+		if (isset($_REQUEST['sdist']) && $_REQUEST['sdist'] != 'all') {
828
+			$DistanceRadius = geodir_getDistanceRadius(get_option('geodir_search_dist_1'));
829
+			$where .= " AND CONVERT((" . $DistanceRadius . " * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(" . $table . ".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(" . $table . ".post_latitude) * pi()/180) *POWER(SIN(($mylon - " . $table . ".post_longitude) * pi()/180 / 2), 2) ))),DECIMAL(64,4)) <= " . $dist;
830
+		}
831 831
 
832
-    } else {
833
-        $where .= " AND (	( $wpdb->posts.post_title LIKE \"$s\" $better_search_terms)
832
+	} else {
833
+		$where .= " AND (	( $wpdb->posts.post_title LIKE \"$s\" $better_search_terms)
834 834
                             $content_where  
835 835
 							OR ( $wpdb->posts.ID IN(	
836 836
 									SELECT $wpdb->term_relationships.object_id as post_id                     
@@ -844,19 +844,19 @@  discard block
 block discarded – undo
844 844
 					) 
845 845
 				AND $wpdb->posts.post_type in ('$post_types')
846 846
 				AND ($wpdb->posts.post_status = 'publish') ";
847
-    }
847
+	}
848 848
 
849 849
 	########### WPML ###########
850
-    if ( function_exists( 'icl_object_id' ) ) {
850
+	if ( function_exists( 'icl_object_id' ) ) {
851 851
 		$lang_code = ICL_LANGUAGE_CODE;
852 852
 
853 853
 		if ($lang_code && $post_types) {
854
-            $where .= " AND icl_t.language_code = '".$lang_code."' AND icl_t.element_type IN('post_" . $post_types . "') ";
855
-        }
856
-    }
857
-    ########### WPML ###########
854
+			$where .= " AND icl_t.language_code = '".$lang_code."' AND icl_t.element_type IN('post_" . $post_types . "') ";
855
+		}
856
+	}
857
+	########### WPML ###########
858 858
 
859
-    return $where;
859
+	return $where;
860 860
 }
861 861
 
862 862
 
@@ -871,45 +871,45 @@  discard block
 block discarded – undo
871 871
  * @return string Modified where query string.
872 872
  */
873 873
 function author_filter_where($where) {
874
-    global $wpdb, $geodir_post_type, $table, $curr;
874
+	global $wpdb, $geodir_post_type, $table, $curr;
875 875
 
876
-    $curauth = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
877
-    $user_id = !empty($curauth->ID) ? (int)$curauth->ID : 0;
876
+	$curauth = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
877
+	$user_id = !empty($curauth->ID) ? (int)$curauth->ID : 0;
878 878
 
879
-    if (isset($_REQUEST['stype'])) {
880
-        $where = $wpdb->prepare(" AND $wpdb->posts.post_type IN (%s) ",$_REQUEST['stype']);
881
-    } else {
882
-        $where = " AND $wpdb->posts.post_type IN ('gd_place') ";
883
-    }
879
+	if (isset($_REQUEST['stype'])) {
880
+		$where = $wpdb->prepare(" AND $wpdb->posts.post_type IN (%s) ",$_REQUEST['stype']);
881
+	} else {
882
+		$where = " AND $wpdb->posts.post_type IN ('gd_place') ";
883
+	}
884 884
 
885
-    if ($user_id > 0) {
886
-        if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
887
-            $user_fav_posts = get_user_meta($user_id, 'gd_user_favourite_post', true);
888
-            $user_fav_posts = !empty($user_fav_posts) && is_array($user_fav_posts) ? implode("','", $user_fav_posts) : '-1';
889
-            $where .= " AND $wpdb->posts.ID IN ('$user_fav_posts')";
890
-        } else
891
-            $where .= " AND $wpdb->posts.post_author = $user_id";
892
-
893
-        if ($user_id == (int)get_current_user_id()) {
894
-            $where .= " AND $wpdb->posts.post_status IN ('publish','draft','pending') ";
895
-        } else {
896
-            $where .= " AND $wpdb->posts.post_status = 'publish' ";
897
-        }
898
-    } else {
899
-        $where .= " AND $wpdb->posts.post_author = '-1' AND $wpdb->posts.post_status = 'publish' ";
900
-    }
885
+	if ($user_id > 0) {
886
+		if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
887
+			$user_fav_posts = get_user_meta($user_id, 'gd_user_favourite_post', true);
888
+			$user_fav_posts = !empty($user_fav_posts) && is_array($user_fav_posts) ? implode("','", $user_fav_posts) : '-1';
889
+			$where .= " AND $wpdb->posts.ID IN ('$user_fav_posts')";
890
+		} else
891
+			$where .= " AND $wpdb->posts.post_author = $user_id";
892
+
893
+		if ($user_id == (int)get_current_user_id()) {
894
+			$where .= " AND $wpdb->posts.post_status IN ('publish','draft','pending') ";
895
+		} else {
896
+			$where .= " AND $wpdb->posts.post_status = 'publish' ";
897
+		}
898
+	} else {
899
+		$where .= " AND $wpdb->posts.post_author = '-1' AND $wpdb->posts.post_status = 'publish' ";
900
+	}
901 901
 
902
-    ########### WPML ###########
903
-    if (function_exists('icl_object_id')) {
904
-        $lang_code = ICL_LANGUAGE_CODE;
905
-        if ($lang_code) {
906
-            $where .= " AND icl_t.language_code='" . $lang_code . "' ";
907
-        }
902
+	########### WPML ###########
903
+	if (function_exists('icl_object_id')) {
904
+		$lang_code = ICL_LANGUAGE_CODE;
905
+		if ($lang_code) {
906
+			$where .= " AND icl_t.language_code='" . $lang_code . "' ";
907
+		}
908 908
 
909
-    }
910
-    ########### WPML ###########
909
+	}
910
+	########### WPML ###########
911 911
 
912
-    return $where;
912
+	return $where;
913 913
 }
914 914
 
915 915
 /**
@@ -924,11 +924,11 @@  discard block
 block discarded – undo
924 924
  */
925 925
 function geodir_filter_widget_join($join)
926 926
 {
927
-    global $wp_query, $table;
928
-    if (!empty($wp_query->query['with_pics_only'])) {
929
-        $join .= " LEFT JOIN " . GEODIR_ATTACHMENT_TABLE . " ON ( " . GEODIR_ATTACHMENT_TABLE . ".post_id=" . $table . ".post_id AND " . GEODIR_ATTACHMENT_TABLE . ".mime_type LIKE '%image%' )";
930
-    }
931
-    return $join;
927
+	global $wp_query, $table;
928
+	if (!empty($wp_query->query['with_pics_only'])) {
929
+		$join .= " LEFT JOIN " . GEODIR_ATTACHMENT_TABLE . " ON ( " . GEODIR_ATTACHMENT_TABLE . ".post_id=" . $table . ".post_id AND " . GEODIR_ATTACHMENT_TABLE . ".mime_type LIKE '%image%' )";
930
+	}
931
+	return $join;
932 932
 }
933 933
 
934 934
 /**
@@ -943,42 +943,42 @@  discard block
 block discarded – undo
943 943
  */
944 944
 function geodir_filter_widget_where($where)
945 945
 {
946
-    global $wp_query, $table;
947
-    if (!empty($wp_query->query['show_featured_only'])) {
948
-        $where .= " AND " . $table . ".is_featured = '1'";
949
-    }
950
-    if (!empty($wp_query->query['show_special_only'])) {
951
-        $where .= " AND ( " . $table . ".geodir_special_offers != '' AND " . $table . ".geodir_special_offers IS NOT NULL )";
952
-    }
953
-    if (!empty($wp_query->query['with_pics_only'])) {
954
-        $where .= " AND " . GEODIR_ATTACHMENT_TABLE . ".ID IS NOT NULL GROUP BY " . $table . ".post_id";
955
-    }
956
-    if (!empty($wp_query->query['with_videos_only'])) {
957
-        $where .= " AND ( " . $table . ".geodir_video != '' AND " . $table . ".geodir_video IS NOT NULL )";
958
-    }
959
-    return $where;
946
+	global $wp_query, $table;
947
+	if (!empty($wp_query->query['show_featured_only'])) {
948
+		$where .= " AND " . $table . ".is_featured = '1'";
949
+	}
950
+	if (!empty($wp_query->query['show_special_only'])) {
951
+		$where .= " AND ( " . $table . ".geodir_special_offers != '' AND " . $table . ".geodir_special_offers IS NOT NULL )";
952
+	}
953
+	if (!empty($wp_query->query['with_pics_only'])) {
954
+		$where .= " AND " . GEODIR_ATTACHMENT_TABLE . ".ID IS NOT NULL GROUP BY " . $table . ".post_id";
955
+	}
956
+	if (!empty($wp_query->query['with_videos_only'])) {
957
+		$where .= " AND ( " . $table . ".geodir_video != '' AND " . $table . ".geodir_video IS NOT NULL )";
958
+	}
959
+	return $where;
960 960
 }
961 961
 
962 962
 
963 963
 function geodir_related_posts_fields($fields) {
964
-    global $wp_query, $wpdb, $table, $post;
964
+	global $wp_query, $wpdb, $table, $post;
965 965
 
966
-    $fields .= ", " . $table . ".* ";
966
+	$fields .= ", " . $table . ".* ";
967 967
 
968
-    $DistanceRadius = geodir_getDistanceRadius(get_option('geodir_search_dist_1'));
968
+	$DistanceRadius = geodir_getDistanceRadius(get_option('geodir_search_dist_1'));
969 969
 
970
-    $mylat = $post->post_latitude;
971
-    $mylon = $post->post_longitude;
970
+	$mylat = $post->post_latitude;
971
+	$mylon = $post->post_longitude;
972 972
 
973
-    $fields .= " , (" . $DistanceRadius . " * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(" . $table . ".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(" . $table . ".post_latitude) * pi()/180) *POWER(SIN(($mylon - " . $table . ".post_longitude) * pi()/180 / 2), 2) )))as distance ";
974
-    return $fields;
973
+	$fields .= " , (" . $DistanceRadius . " * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(" . $table . ".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(" . $table . ".post_latitude) * pi()/180) *POWER(SIN(($mylon - " . $table . ".post_longitude) * pi()/180 / 2), 2) )))as distance ";
974
+	return $fields;
975 975
 }
976 976
 function geodir_related_posts_fields_filter($query) {
977
-    if ( isset($query->query_vars['is_geodir_loop']) && $query->query_vars['is_geodir_loop']
978
-        && isset($query->query_vars['order_by']) && $query->query_vars['order_by'] == 'nearest'
979
-        && isset($query->query_vars['related_listings']) && $query->query_vars['related_listings']
980
-    ) {
981
-        add_filter('posts_fields', 'geodir_related_posts_fields', 1);
982
-    }
977
+	if ( isset($query->query_vars['is_geodir_loop']) && $query->query_vars['is_geodir_loop']
978
+		&& isset($query->query_vars['order_by']) && $query->query_vars['order_by'] == 'nearest'
979
+		&& isset($query->query_vars['related_listings']) && $query->query_vars['related_listings']
980
+	) {
981
+		add_filter('posts_fields', 'geodir_related_posts_fields', 1);
982
+	}
983 983
 }
984 984
 add_action('pre_get_posts', 'geodir_related_posts_fields_filter', 1);
985 985
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +76 added lines, -76 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
  * @global string $s_A Extra parameters.
66 66
  * @global string $s_SA Extra parameters.
67 67
  */
68
-function set_listing_request($query )
68
+function set_listing_request($query)
69 69
 {
70 70
     global $wp_query, $wpdb, $geodir_post_type, $table, $dist, $mylat, $mylon, $s, $snear, $s, $s_A, $s_SA;
71 71
 
@@ -99,15 +99,15 @@  discard block
 block discarded – undo
99 99
         } //  Distance
100 100
 
101 101
         if (isset($_REQUEST['sgeo_lat'])) {
102
-            $mylat = (float)esc_attr($_REQUEST['sgeo_lat']);
102
+            $mylat = (float) esc_attr($_REQUEST['sgeo_lat']);
103 103
         } else {
104
-            $mylat = (float)geodir_get_current_city_lat();
104
+            $mylat = (float) geodir_get_current_city_lat();
105 105
         } //  Latatude
106 106
 
107 107
         if (isset($_REQUEST['sgeo_lon'])) {
108
-            $mylon = (float)esc_attr($_REQUEST['sgeo_lon']);
108
+            $mylon = (float) esc_attr($_REQUEST['sgeo_lon']);
109 109
         } else {
110
-            $mylon = (float)geodir_get_current_city_lng();
110
+            $mylon = (float) geodir_get_current_city_lng();
111 111
         } //  Distance
112 112
 
113 113
         if (isset($_REQUEST['snear'])) {
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 
121 121
         if ($snear == 'NEAR ME') {
122 122
             $ip = $_SERVER['REMOTE_ADDR'];
123
-            $addr_details = unserialize(file_get_contents('http://www.geoplugin.net/php.gp?ip=' . $ip));
123
+            $addr_details = unserialize(file_get_contents('http://www.geoplugin.net/php.gp?ip='.$ip));
124 124
             $mylat = stripslashes(ucfirst($addr_details[geoplugin_latitude]));
125 125
             $mylon = stripslashes(ucfirst($addr_details[geoplugin_longitude]));
126 126
         }
@@ -130,9 +130,9 @@  discard block
 block discarded – undo
130 130
             $s_AA = str_replace(" ", "", $s);
131 131
             $s_A = explode(",", $s_AA);
132 132
             $s_A = implode('","', $s_A);
133
-            $s_A = '"' . $s_A . '"';
133
+            $s_A = '"'.$s_A.'"';
134 134
         } else {
135
-            $s_A = '"' . $s . '"';
135
+            $s_A = '"'.$s.'"';
136 136
         }
137 137
 
138 138
         if (strstr($s, ' ')) {
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
     }
194 194
     if (isset($query->query_vars['is_geodir_loop']) && $query->query_vars['is_geodir_loop']) {
195 195
 
196
-        $table = $plugin_prefix . $geodir_post_type . '_detail';
196
+        $table = $plugin_prefix.$geodir_post_type.'_detail';
197 197
 
198 198
         add_filter('posts_fields', 'geodir_posts_fields', 1);
199 199
         add_filter('posts_join', 'geodir_posts_join', 1);
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
     global $wp_query, $wpdb, $geodir_post_type, $table, $plugin_prefix, $dist, $mylat, $mylon, $snear, $gd_session;
234 234
 
235 235
     // Filter-Location-Manager to add location table.
236
-    $fields .= ", " . $table . ".* ";
236
+    $fields .= ", ".$table.".* ";
237 237
 
238 238
 	if ($snear != '' || $gd_session->get('all_near_me')) {
239 239
         $DistanceRadius = geodir_getDistanceRadius(get_option('geodir_search_dist_1'));
@@ -243,16 +243,16 @@  discard block
 block discarded – undo
243 243
             $mylon = $gd_session->get('user_lon');
244 244
         }
245 245
 
246
-        $fields .= " , (" . $DistanceRadius . " * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(" . $table . ".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(" . $table . ".post_latitude) * pi()/180) *POWER(SIN(($mylon - " . $table . ".post_longitude) * pi()/180 / 2), 2) )))as distance ";
246
+        $fields .= " , (".$DistanceRadius." * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(".$table.".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(".$table.".post_latitude) * pi()/180) *POWER(SIN(($mylon - ".$table.".post_longitude) * pi()/180 / 2), 2) )))as distance ";
247 247
     }
248 248
 
249 249
     global $s;
250 250
     if (is_search() && isset($_REQUEST['geodir_search']) && $s && trim($s) != '') {
251 251
         $keywords = explode(" ", $s);
252 252
 
253
-        if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
254
-            foreach($keywords as $kkey=>$kword){
255
-                if(mb_strlen($kword, 'UTF-8')<=$klimit){
253
+        if (is_array($keywords) && $klimit = get_option('geodir_search_word_limit')) {
254
+            foreach ($keywords as $kkey=>$kword) {
255
+                if (mb_strlen($kword, 'UTF-8') <= $klimit) {
256 256
                     unset($keywords[$kkey]);
257 257
                 }
258 258
             }
@@ -270,24 +270,24 @@  discard block
 block discarded – undo
270 270
                 $count = 0;
271 271
                 foreach ($keywords as $keyword) {
272 272
                     $keyword = trim($keyword);
273
-                    $keyword  = wp_specialchars_decode($keyword ,ENT_QUOTES);
273
+                    $keyword = wp_specialchars_decode($keyword, ENT_QUOTES);
274 274
 					$count++;
275 275
                     if ($count < count($keywords)) {
276 276
                        // $gd_titlematch_part .= $wpdb->posts . ".post_title LIKE '%%" . $keyword . "%%' " . $key . " ";
277
-						$gd_titlematch_part .= "( " . $wpdb->posts . ".post_title LIKE '" . $keyword . "' OR " . $wpdb->posts . ".post_title LIKE '" . $keyword . "%%' OR " . $wpdb->posts . ".post_title LIKE '%% " . $keyword . "%%' ) " . $key . " ";
277
+						$gd_titlematch_part .= "( ".$wpdb->posts.".post_title LIKE '".$keyword."' OR ".$wpdb->posts.".post_title LIKE '".$keyword."%%' OR ".$wpdb->posts.".post_title LIKE '%% ".$keyword."%%' ) ".$key." ";
278 278
                     } else {
279 279
                         //$gd_titlematch_part .= $wpdb->posts . ".post_title LIKE '%%" . $keyword . "%%' ";
280
-						$gd_titlematch_part .= "( " . $wpdb->posts . ".post_title LIKE '" . $keyword . "' OR " . $wpdb->posts . ".post_title LIKE '" . $keyword . "%%' OR " . $wpdb->posts . ".post_title LIKE '%% " . $keyword . "%%' ) ";
280
+						$gd_titlematch_part .= "( ".$wpdb->posts.".post_title LIKE '".$keyword."' OR ".$wpdb->posts.".post_title LIKE '".$keyword."%%' OR ".$wpdb->posts.".post_title LIKE '%% ".$keyword."%%' ) ";
281 281
                     }
282 282
                 }
283
-                $gd_titlematch_part .= "THEN 1 ELSE 0 END AS " . $part . ",";
283
+                $gd_titlematch_part .= "THEN 1 ELSE 0 END AS ".$part.",";
284 284
             }
285 285
         } else {
286 286
             $gd_titlematch_part = "";
287 287
         }
288
-        $s = stripslashes_deep( $s );
289
-        $s = wp_specialchars_decode($s,ENT_QUOTES);
290
-		$fields .= $wpdb->prepare(", CASE WHEN " . $table . ".is_featured='1' THEN 1 ELSE 0 END AS gd_featured, CASE WHEN " . $wpdb->posts . ".post_title LIKE %s THEN 1 ELSE 0 END AS gd_exacttitle," . $gd_titlematch_part . " CASE WHEN ( " . $wpdb->posts . ".post_title LIKE %s OR " . $wpdb->posts . ".post_title LIKE %s OR " . $wpdb->posts . ".post_title LIKE %s ) THEN 1 ELSE 0 END AS gd_titlematch, CASE WHEN ( " . $wpdb->posts . ".post_content LIKE %s OR " . $wpdb->posts . ".post_content LIKE %s OR " . $wpdb->posts . ".post_content LIKE %s OR " . $wpdb->posts . ".post_content LIKE %s ) THEN 1 ELSE 0 END AS gd_content", array($s, $s, $s . '%', '% ' . $s . '%', $s, $s . ' %', '% ' . $s . ' %', '% ' . $s));
288
+        $s = stripslashes_deep($s);
289
+        $s = wp_specialchars_decode($s, ENT_QUOTES);
290
+		$fields .= $wpdb->prepare(", CASE WHEN ".$table.".is_featured='1' THEN 1 ELSE 0 END AS gd_featured, CASE WHEN ".$wpdb->posts.".post_title LIKE %s THEN 1 ELSE 0 END AS gd_exacttitle,".$gd_titlematch_part." CASE WHEN ( ".$wpdb->posts.".post_title LIKE %s OR ".$wpdb->posts.".post_title LIKE %s OR ".$wpdb->posts.".post_title LIKE %s ) THEN 1 ELSE 0 END AS gd_titlematch, CASE WHEN ( ".$wpdb->posts.".post_content LIKE %s OR ".$wpdb->posts.".post_content LIKE %s OR ".$wpdb->posts.".post_content LIKE %s OR ".$wpdb->posts.".post_content LIKE %s ) THEN 1 ELSE 0 END AS gd_content", array($s, $s, $s.'%', '% '.$s.'%', $s, $s.' %', '% '.$s.' %', '% '.$s));
291 291
     }
292 292
 
293 293
     return $fields;
@@ -316,13 +316,13 @@  discard block
 block discarded – undo
316 316
         $lang_code = ICL_LANGUAGE_CODE;
317 317
         $default_lang_code = $sitepress->get_default_language();
318 318
         if ($lang_code) {
319
-            $join .= "JOIN " . $table_prefix . "icl_translations icl_t ON icl_t.element_id = " . $table_prefix . "posts.ID";
319
+            $join .= "JOIN ".$table_prefix."icl_translations icl_t ON icl_t.element_id = ".$table_prefix."posts.ID";
320 320
         }
321 321
 
322 322
     }
323 323
     ########### WPML ###########
324 324
 
325
-    $join .= " INNER JOIN " . $table . " ON (" . $table . ".post_id = $wpdb->posts.ID)  ";
325
+    $join .= " INNER JOIN ".$table." ON (".$table.".post_id = $wpdb->posts.ID)  ";
326 326
     //===old code start
327 327
     //$join .= " INNER JOIN ".POST_LOCATION_TABLE." ON (".$table.".post_location_id = ".POST_LOCATION_TABLE.".location_id)  " ;//===old code end
328 328
 
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
             $sort_by = 'az';
392 392
         }
393 393
 
394
-        if ($snear != '' &&  $sort_by!='farthest') {
394
+        if ($snear != '' && $sort_by != 'farthest') {
395 395
             $sort_by = 'nearest';
396 396
         }
397 397
     }
@@ -405,20 +405,20 @@  discard block
 block discarded – undo
405 405
             break;
406 406
         case 'low_review':
407 407
         case 'rating_count_asc':
408
-            $orderby = $table . ".rating_count ASC, " . $table . ".overall_rating ASC, ";
408
+            $orderby = $table.".rating_count ASC, ".$table.".overall_rating ASC, ";
409 409
             break;
410 410
         case 'high_review':
411 411
         case 'rating_count_desc':
412
-			$orderby = $table . ".rating_count DESC, " . $table . ".overall_rating DESC, ";
412
+			$orderby = $table.".rating_count DESC, ".$table.".overall_rating DESC, ";
413 413
             break;
414 414
         case 'low_rating':
415
-            $orderby = "( " . $table . ".overall_rating  ) ASC, " . $table . ".rating_count ASC,  ";
415
+            $orderby = "( ".$table.".overall_rating  ) ASC, ".$table.".rating_count ASC,  ";
416 416
             break;
417 417
         case 'high_rating':
418
-            $orderby = " " . $table . ".overall_rating DESC, " . $table . ".rating_count DESC, ";
418
+            $orderby = " ".$table.".overall_rating DESC, ".$table.".rating_count DESC, ";
419 419
             break;
420 420
         case 'featured':
421
-            $orderby = $table . ".is_featured asc, ";
421
+            $orderby = $table.".is_featured asc, ";
422 422
             break;
423 423
         case 'nearest':
424 424
             $orderby = " distance asc, ";
@@ -434,10 +434,10 @@  discard block
 block discarded – undo
434 434
             break;
435 435
         // sort by rating
436 436
         case 'overall_rating_desc':
437
-            $orderby = " " . $table . ".overall_rating DESC, " . $table . ".rating_count DESC, ";
437
+            $orderby = " ".$table.".overall_rating DESC, ".$table.".rating_count DESC, ";
438 438
             break;
439 439
         case 'overall_rating_asc':
440
-            $orderby = " " . $table . ".overall_rating ASC, " . $table . ".rating_count ASC, ";
440
+            $orderby = " ".$table.".overall_rating ASC, ".$table.".rating_count ASC, ";
441 441
             break;
442 442
         default:
443 443
 
@@ -448,24 +448,24 @@  discard block
 block discarded – undo
448 448
 
449 449
     if (is_search() && isset($_REQUEST['geodir_search']) && $s && trim($s) != '') {
450 450
         $keywords = explode(" ", $s);
451
-        if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
452
-            foreach($keywords as $kkey=>$kword){
453
-                if(mb_strlen($kword, 'UTF-8')<=$klimit){
451
+        if (is_array($keywords) && $klimit = get_option('geodir_search_word_limit')) {
452
+            foreach ($keywords as $kkey=>$kword) {
453
+                if (mb_strlen($kword, 'UTF-8') <= $klimit) {
454 454
                     unset($keywords[$kkey]);
455 455
                 }
456 456
             }
457 457
         }
458 458
         if ($sort_by == 'nearest' || $sort_by == 'farthest') {
459 459
             if (count($keywords) > 1) {
460
-                $orderby = $orderby . " ( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_alltitlematch_part * 100 + gd_titlematch_part * 50 + gd_content * 1.5) DESC, ";
460
+                $orderby = $orderby." ( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_alltitlematch_part * 100 + gd_titlematch_part * 50 + gd_content * 1.5) DESC, ";
461 461
             } else {
462
-                $orderby = $orderby . " ( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_content * 1.5) DESC, ";
462
+                $orderby = $orderby." ( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_content * 1.5) DESC, ";
463 463
             }
464 464
         } else {
465 465
             if (count($keywords) > 1) {
466
-                $orderby = "( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_alltitlematch_part * 100 + gd_titlematch_part * 50 + gd_content * 1.5) DESC, " . $orderby;
466
+                $orderby = "( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_alltitlematch_part * 100 + gd_titlematch_part * 50 + gd_content * 1.5) DESC, ".$orderby;
467 467
             } else {
468
-                $orderby = "( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_content * 1.5) DESC, " . $orderby;
468
+                $orderby = "( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_content * 1.5) DESC, ".$orderby;
469 469
             }
470 470
         }
471 471
     }
@@ -480,7 +480,7 @@  discard block
 block discarded – undo
480 480
      */
481 481
     $orderby = apply_filters('geodir_posts_order_by_sort', $orderby, $sort_by, $table);
482 482
 
483
-    $orderby .= $table . ".is_featured asc, $wpdb->posts.post_date desc, $wpdb->posts.post_title ";
483
+    $orderby .= $table.".is_featured asc, $wpdb->posts.post_date desc, $wpdb->posts.post_title ";
484 484
 
485 485
     return $orderby;
486 486
 }
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
 
503 503
     global $wpdb;
504 504
 
505
-    if ($sort_by != '' && (!is_search() || ( isset($_REQUEST['s']) && isset($_REQUEST['snear']) && $_REQUEST['snear']=='' && ( $_REQUEST['s']=='' ||  $_REQUEST['s']==' ') ) )) {
505
+    if ($sort_by != '' && (!is_search() || (isset($_REQUEST['s']) && isset($_REQUEST['snear']) && $_REQUEST['snear'] == '' && ($_REQUEST['s'] == '' || $_REQUEST['s'] == ' ')))) {
506 506
 
507 507
         $sort_array = explode('_', $sort_by);
508 508
 
@@ -512,31 +512,31 @@  discard block
 block discarded – undo
512 512
 
513 513
         if ($sort_by_count > 1 && ($order == 'asc' || $order == 'desc')) {
514 514
 
515
-            $sort_by = str_replace('_' . $order, '', $sort_by);
515
+            $sort_by = str_replace('_'.$order, '', $sort_by);
516 516
 
517 517
             switch ($sort_by):
518 518
 
519 519
                 case 'post_date':
520 520
                 case 'comment_count':
521 521
 
522
-                    $orderby = "$wpdb->posts." . $sort_by . " " . $order . ", ".$table . ".overall_rating " . $order . ", ";
522
+                    $orderby = "$wpdb->posts.".$sort_by." ".$order.", ".$table.".overall_rating ".$order.", ";
523 523
                     break;
524 524
 
525 525
                 case 'distance':
526
-                    $orderby = $sort_by . " " . $order . ", ";
526
+                    $orderby = $sort_by." ".$order.", ";
527 527
                     break;
528 528
 
529 529
 
530 530
                 // sort by rating
531 531
                 case 'overall_rating':
532
-                    $orderby = " " . $table . "." . $sort_by . "  " . $order . ", " . $table . ".rating_count " . $order . ", ";
532
+                    $orderby = " ".$table.".".$sort_by."  ".$order.", ".$table.".rating_count ".$order.", ";
533 533
 
534 534
                     break;
535 535
 
536 536
 
537 537
                 default:
538 538
                     if (geodir_column_exist($table, $sort_by)) {
539
-						$orderby = $table . "." . $sort_by . " " . $order . ", ";
539
+						$orderby = $table.".".$sort_by." ".$order.", ";
540 540
 					}
541 541
                     break;
542 542
 
@@ -584,7 +584,7 @@  discard block
 block discarded – undo
584 584
         }
585 585
 
586 586
         //if (!geodir_is_page('detail'))
587
-            add_filter('posts_where', 'geodir_default_where', 1);/**/
587
+            add_filter('posts_where', 'geodir_default_where', 1); /**/
588 588
 
589 589
         //add_filter( 'user_has_cap', 'geodir_preview_post_cap', 10, 3 );// let subscribers edit their own posts
590 590
 
@@ -655,7 +655,7 @@  discard block
 block discarded – undo
655 655
         $q_post_type = isset($wp_query->query['post_type']) ? $wp_query->query['post_type'] : '';
656 656
         //echo '##########'.$q_post_type;
657 657
         if ($lang_code && $q_post_type) {
658
-            $where .= " AND icl_t.language_code = '$lang_code' AND icl_t.element_type IN('post_" . $q_post_type . "') ";
658
+            $where .= " AND icl_t.language_code = '$lang_code' AND icl_t.element_type IN('post_".$q_post_type."') ";
659 659
             //$where .= " AND icl_t.language_code = '$lang_code' ";
660 660
         }
661 661
 
@@ -722,8 +722,8 @@  discard block
 block discarded – undo
722 722
 	}
723 723
 
724 724
 	$s = trim($s);
725
-    $s  = wp_specialchars_decode($s ,ENT_QUOTES);
726
-    $s_A = wp_specialchars_decode($s_A ,ENT_QUOTES);
725
+    $s = wp_specialchars_decode($s, ENT_QUOTES);
726
+    $s_A = wp_specialchars_decode($s_A, ENT_QUOTES);
727 727
 
728 728
     $where = '';
729 729
     $better_search_terms = '';
@@ -734,9 +734,9 @@  discard block
 block discarded – undo
734 734
 
735 735
     if ($s != '') {
736 736
         $keywords = explode(" ", $s);
737
-        if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
738
-            foreach($keywords as $kkey=>$kword){
739
-                if(mb_strlen($kword, 'UTF-8')<=$klimit){
737
+        if (is_array($keywords) && $klimit = get_option('geodir_search_word_limit')) {
738
+            foreach ($keywords as $kkey=>$kword) {
739
+                if (mb_strlen($kword, 'UTF-8') <= $klimit) {
740 740
                     unset($keywords[$kkey]);
741 741
                 }
742 742
             }
@@ -745,7 +745,7 @@  discard block
 block discarded – undo
745 745
         if (!empty($keywords)) {
746 746
             foreach ($keywords as $keyword) {
747 747
                 $keyword = trim($keyword);
748
-                $keyword  = wp_specialchars_decode($keyword ,ENT_QUOTES);
748
+                $keyword = wp_specialchars_decode($keyword, ENT_QUOTES);
749 749
                 if ($keyword != '') {
750 750
                     /**
751 751
                      * Filter the search query keywords SQL.
@@ -756,7 +756,7 @@  discard block
 block discarded – undo
756 756
                      * @param array $keywords The array of keywords for the query.
757 757
                      * @param string $keyword The single keyword being searched.
758 758
                      */
759
-					$better_search_terms .= apply_filters("geodir_search_better_search_terms",' OR ( ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '" OR ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '%" OR ' . $wpdb->posts . '.post_title LIKE "% ' . $keyword . '%" )',$keywords,$keyword);
759
+					$better_search_terms .= apply_filters("geodir_search_better_search_terms", ' OR ( '.$wpdb->posts.'.post_title LIKE "'.$keyword.'" OR '.$wpdb->posts.'.post_title LIKE "'.$keyword.'%" OR '.$wpdb->posts.'.post_title LIKE "% '.$keyword.'%" )', $keywords, $keyword);
760 760
                 }
761 761
             }
762 762
         }
@@ -764,10 +764,10 @@  discard block
 block discarded – undo
764 764
 
765 765
     /* get taxonomy */
766 766
     $taxonomies = geodir_get_taxonomies($post_types, true);
767
-    if($taxonomies) {
767
+    if ($taxonomies) {
768 768
         $taxonomies = implode("','", $taxonomies);
769
-        $taxonomies = "'" . $taxonomies . "'";
770
-    }else{$taxonomies='';}
769
+        $taxonomies = "'".$taxonomies."'";
770
+    } else {$taxonomies = ''; }
771 771
 
772 772
     $content_where = $terms_where = '';
773 773
 	if ($s != '') {
@@ -778,7 +778,7 @@  discard block
 block discarded – undo
778 778
          * @package GeoDirectory
779 779
          * @param string $content_where The query values, default: `" OR ($wpdb->posts.post_content LIKE \"$s\" OR $wpdb->posts.post_content LIKE \"$s%\" OR $wpdb->posts.post_content LIKE \"% $s%\" OR $wpdb->posts.post_content LIKE \"%>$s%\" OR $wpdb->posts.post_content LIKE \"%\n$s%\") ") "`.
780 780
          */
781
-		$content_where = apply_filters("geodir_search_content_where"," OR ($wpdb->posts.post_content LIKE \"$s\" OR $wpdb->posts.post_content LIKE \"$s%\" OR $wpdb->posts.post_content LIKE \"% $s%\" OR $wpdb->posts.post_content LIKE \"%>$s%\" OR $wpdb->posts.post_content LIKE \"%\n$s%\") ");
781
+		$content_where = apply_filters("geodir_search_content_where", " OR ($wpdb->posts.post_content LIKE \"$s\" OR $wpdb->posts.post_content LIKE \"$s%\" OR $wpdb->posts.post_content LIKE \"% $s%\" OR $wpdb->posts.post_content LIKE \"%>$s%\" OR $wpdb->posts.post_content LIKE \"%\n$s%\") ");
782 782
         /**
783 783
          * Filter the search query term values.
784 784
          *
@@ -786,7 +786,7 @@  discard block
 block discarded – undo
786 786
          * @package GeoDirectory
787 787
          * @param string $terms_where The separator, default: `" AND ($wpdb->terms.name LIKE \"$s\" OR $wpdb->terms.name LIKE \"$s%\" OR $wpdb->terms.name LIKE \"% $s%\" OR $wpdb->terms.name IN ($s_A)) "`.
788 788
          */
789
-        $terms_where = apply_filters("geodir_search_terms_where"," AND ($wpdb->terms.name LIKE \"$s\" OR $wpdb->terms.name LIKE \"$s%\" OR $wpdb->terms.name LIKE \"% $s%\" OR $wpdb->terms.name IN ($s_A)) ");
789
+        $terms_where = apply_filters("geodir_search_terms_where", " AND ($wpdb->terms.name LIKE \"$s\" OR $wpdb->terms.name LIKE \"$s%\" OR $wpdb->terms.name LIKE \"% $s%\" OR $wpdb->terms.name IN ($s_A)) ");
790 790
 	}
791 791
 
792 792
     if ($snear != '') {
@@ -821,12 +821,12 @@  discard block
 block discarded – undo
821 821
 							)
822 822
 						AND $wpdb->posts.post_type in ('{$post_types}')
823 823
 						AND ($wpdb->posts.post_status = 'publish')
824
-						AND ( " . $table . ".post_latitude between $rlat1 and $rlat2 )
825
-						AND ( " . $table . ".post_longitude between $rlon1 and $rlon2 ) ";
824
+						AND ( ".$table.".post_latitude between $rlat1 and $rlat2 )
825
+						AND ( ".$table.".post_longitude between $rlon1 and $rlon2 ) ";
826 826
 
827 827
         if (isset($_REQUEST['sdist']) && $_REQUEST['sdist'] != 'all') {
828 828
             $DistanceRadius = geodir_getDistanceRadius(get_option('geodir_search_dist_1'));
829
-            $where .= " AND CONVERT((" . $DistanceRadius . " * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(" . $table . ".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(" . $table . ".post_latitude) * pi()/180) *POWER(SIN(($mylon - " . $table . ".post_longitude) * pi()/180 / 2), 2) ))),DECIMAL(64,4)) <= " . $dist;
829
+            $where .= " AND CONVERT((".$DistanceRadius." * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(".$table.".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(".$table.".post_latitude) * pi()/180) *POWER(SIN(($mylon - ".$table.".post_longitude) * pi()/180 / 2), 2) ))),DECIMAL(64,4)) <= ".$dist;
830 830
         }
831 831
 
832 832
     } else {
@@ -847,11 +847,11 @@  discard block
 block discarded – undo
847 847
     }
848 848
 
849 849
 	########### WPML ###########
850
-    if ( function_exists( 'icl_object_id' ) ) {
850
+    if (function_exists('icl_object_id')) {
851 851
 		$lang_code = ICL_LANGUAGE_CODE;
852 852
 
853 853
 		if ($lang_code && $post_types) {
854
-            $where .= " AND icl_t.language_code = '".$lang_code."' AND icl_t.element_type IN('post_" . $post_types . "') ";
854
+            $where .= " AND icl_t.language_code = '".$lang_code."' AND icl_t.element_type IN('post_".$post_types."') ";
855 855
         }
856 856
     }
857 857
     ########### WPML ###########
@@ -874,10 +874,10 @@  discard block
 block discarded – undo
874 874
     global $wpdb, $geodir_post_type, $table, $curr;
875 875
 
876 876
     $curauth = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
877
-    $user_id = !empty($curauth->ID) ? (int)$curauth->ID : 0;
877
+    $user_id = !empty($curauth->ID) ? (int) $curauth->ID : 0;
878 878
 
879 879
     if (isset($_REQUEST['stype'])) {
880
-        $where = $wpdb->prepare(" AND $wpdb->posts.post_type IN (%s) ",$_REQUEST['stype']);
880
+        $where = $wpdb->prepare(" AND $wpdb->posts.post_type IN (%s) ", $_REQUEST['stype']);
881 881
     } else {
882 882
         $where = " AND $wpdb->posts.post_type IN ('gd_place') ";
883 883
     }
@@ -890,7 +890,7 @@  discard block
 block discarded – undo
890 890
         } else
891 891
             $where .= " AND $wpdb->posts.post_author = $user_id";
892 892
 
893
-        if ($user_id == (int)get_current_user_id()) {
893
+        if ($user_id == (int) get_current_user_id()) {
894 894
             $where .= " AND $wpdb->posts.post_status IN ('publish','draft','pending') ";
895 895
         } else {
896 896
             $where .= " AND $wpdb->posts.post_status = 'publish' ";
@@ -903,7 +903,7 @@  discard block
 block discarded – undo
903 903
     if (function_exists('icl_object_id')) {
904 904
         $lang_code = ICL_LANGUAGE_CODE;
905 905
         if ($lang_code) {
906
-            $where .= " AND icl_t.language_code='" . $lang_code . "' ";
906
+            $where .= " AND icl_t.language_code='".$lang_code."' ";
907 907
         }
908 908
 
909 909
     }
@@ -926,7 +926,7 @@  discard block
 block discarded – undo
926 926
 {
927 927
     global $wp_query, $table;
928 928
     if (!empty($wp_query->query['with_pics_only'])) {
929
-        $join .= " LEFT JOIN " . GEODIR_ATTACHMENT_TABLE . " ON ( " . GEODIR_ATTACHMENT_TABLE . ".post_id=" . $table . ".post_id AND " . GEODIR_ATTACHMENT_TABLE . ".mime_type LIKE '%image%' )";
929
+        $join .= " LEFT JOIN ".GEODIR_ATTACHMENT_TABLE." ON ( ".GEODIR_ATTACHMENT_TABLE.".post_id=".$table.".post_id AND ".GEODIR_ATTACHMENT_TABLE.".mime_type LIKE '%image%' )";
930 930
     }
931 931
     return $join;
932 932
 }
@@ -945,16 +945,16 @@  discard block
 block discarded – undo
945 945
 {
946 946
     global $wp_query, $table;
947 947
     if (!empty($wp_query->query['show_featured_only'])) {
948
-        $where .= " AND " . $table . ".is_featured = '1'";
948
+        $where .= " AND ".$table.".is_featured = '1'";
949 949
     }
950 950
     if (!empty($wp_query->query['show_special_only'])) {
951
-        $where .= " AND ( " . $table . ".geodir_special_offers != '' AND " . $table . ".geodir_special_offers IS NOT NULL )";
951
+        $where .= " AND ( ".$table.".geodir_special_offers != '' AND ".$table.".geodir_special_offers IS NOT NULL )";
952 952
     }
953 953
     if (!empty($wp_query->query['with_pics_only'])) {
954
-        $where .= " AND " . GEODIR_ATTACHMENT_TABLE . ".ID IS NOT NULL GROUP BY " . $table . ".post_id";
954
+        $where .= " AND ".GEODIR_ATTACHMENT_TABLE.".ID IS NOT NULL GROUP BY ".$table.".post_id";
955 955
     }
956 956
     if (!empty($wp_query->query['with_videos_only'])) {
957
-        $where .= " AND ( " . $table . ".geodir_video != '' AND " . $table . ".geodir_video IS NOT NULL )";
957
+        $where .= " AND ( ".$table.".geodir_video != '' AND ".$table.".geodir_video IS NOT NULL )";
958 958
     }
959 959
     return $where;
960 960
 }
@@ -963,18 +963,18 @@  discard block
 block discarded – undo
963 963
 function geodir_related_posts_fields($fields) {
964 964
     global $wp_query, $wpdb, $table, $post;
965 965
 
966
-    $fields .= ", " . $table . ".* ";
966
+    $fields .= ", ".$table.".* ";
967 967
 
968 968
     $DistanceRadius = geodir_getDistanceRadius(get_option('geodir_search_dist_1'));
969 969
 
970 970
     $mylat = $post->post_latitude;
971 971
     $mylon = $post->post_longitude;
972 972
 
973
-    $fields .= " , (" . $DistanceRadius . " * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(" . $table . ".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(" . $table . ".post_latitude) * pi()/180) *POWER(SIN(($mylon - " . $table . ".post_longitude) * pi()/180 / 2), 2) )))as distance ";
973
+    $fields .= " , (".$DistanceRadius." * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(".$table.".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(".$table.".post_latitude) * pi()/180) *POWER(SIN(($mylon - ".$table.".post_longitude) * pi()/180 / 2), 2) )))as distance ";
974 974
     return $fields;
975 975
 }
976 976
 function geodir_related_posts_fields_filter($query) {
977
-    if ( isset($query->query_vars['is_geodir_loop']) && $query->query_vars['is_geodir_loop']
977
+    if (isset($query->query_vars['is_geodir_loop']) && $query->query_vars['is_geodir_loop']
978 978
         && isset($query->query_vars['order_by']) && $query->query_vars['order_by'] == 'nearest'
979 979
         && isset($query->query_vars['related_listings']) && $query->query_vars['related_listings']
980 980
     ) {
Please login to merge, or discard this patch.
geodirectory-admin/admin_install.php 2 patches
Indentation   +160 added lines, -160 removed lines patch added patch discarded remove patch
@@ -24,8 +24,8 @@  discard block
 block discarded – undo
24 24
 function geodir_activation()
25 25
 {
26 26
 
27
-    geodir_install();
28
-    add_action('wp_loaded', 'geodir_flush_activation');
27
+	geodir_install();
28
+	add_action('wp_loaded', 'geodir_flush_activation');
29 29
 }
30 30
 
31 31
 /**
@@ -36,9 +36,9 @@  discard block
 block discarded – undo
36 36
  */
37 37
 function geodir_flush_activation()
38 38
 {
39
-    // Remove rewrite rules and then recreate rewrite rules.
40
-    // flush late so everything is loaded
41
-    flush_rewrite_rules();
39
+	// Remove rewrite rules and then recreate rewrite rules.
40
+	// flush late so everything is loaded
41
+	flush_rewrite_rules();
42 42
 }
43 43
 
44 44
 /**
@@ -50,44 +50,44 @@  discard block
 block discarded – undo
50 50
  */
51 51
 function geodir_install()
52 52
 {
53
-    global $geodir_settings;
54
-
55
-    /**
56
-     * Called before the GD installation scripts have run.
57
-     *
58
-     * @since 1.0.0
59
-     * @see 'geodir_installation_end'
60
-     */
61
-    do_action('geodir_installation_start');
62
-
63
-    // Do install
64
-    if (!get_option('geodir_default_data_installed')) {
65
-        geodir_create_tables(); // in admin db install.php
66
-        geodir_register_defaults(); // geodir_functions/ taxonomy_functions.php
67
-        geodir_create_default_fields();
68
-        //geodir_default_taxonomies();
69
-        geodir_set_default_options();
70
-        geodir_create_pages();
71
-        geodir_set_default_widgets();
72
-        gd_install_theme_compat();
73
-
74
-        update_option('geodir_default_data_installed', 1);
75
-
76
-    }
77
-
78
-    if (!get_option('geodir_default_data_installed_1.2.8')) {
79
-        //geodir_create_tables(); // in admin db install.php
80
-        update_option('geodir_default_data_installed_1.2.8', 1);
81
-    }
82
-
83
-    geodir_installation_end();
84
-    /**
85
-     * Called after the GD installation scripts have run.
86
-     *
87
-     * @since 1.0.0
88
-     * @see 'geodir_installation_start'
89
-     */
90
-    do_action('geodir_installation_end');
53
+	global $geodir_settings;
54
+
55
+	/**
56
+	 * Called before the GD installation scripts have run.
57
+	 *
58
+	 * @since 1.0.0
59
+	 * @see 'geodir_installation_end'
60
+	 */
61
+	do_action('geodir_installation_start');
62
+
63
+	// Do install
64
+	if (!get_option('geodir_default_data_installed')) {
65
+		geodir_create_tables(); // in admin db install.php
66
+		geodir_register_defaults(); // geodir_functions/ taxonomy_functions.php
67
+		geodir_create_default_fields();
68
+		//geodir_default_taxonomies();
69
+		geodir_set_default_options();
70
+		geodir_create_pages();
71
+		geodir_set_default_widgets();
72
+		gd_install_theme_compat();
73
+
74
+		update_option('geodir_default_data_installed', 1);
75
+
76
+	}
77
+
78
+	if (!get_option('geodir_default_data_installed_1.2.8')) {
79
+		//geodir_create_tables(); // in admin db install.php
80
+		update_option('geodir_default_data_installed_1.2.8', 1);
81
+	}
82
+
83
+	geodir_installation_end();
84
+	/**
85
+	 * Called after the GD installation scripts have run.
86
+	 *
87
+	 * @since 1.0.0
88
+	 * @see 'geodir_installation_start'
89
+	 */
90
+	do_action('geodir_installation_end');
91 91
 
92 92
 
93 93
 }
@@ -104,16 +104,16 @@  discard block
 block discarded – undo
104 104
 function geodir_create_pages()
105 105
 {
106 106
 
107
-    //geodir_create_page( esc_sql( _x('home-map', 'page_slug', 'geodirectory') ), 'geodir_home_map_page', __('Home Map', 'geodirectory'), '',0,'publish' );
108
-    geodir_create_page(esc_sql(_x('gd-home', 'page_slug', 'geodirectory')), 'geodir_home_page', __('GD Home page', 'geodirectory'), '');
109
-    geodir_create_page(esc_sql(_x('add-listing', 'page_slug', 'geodirectory')), 'geodir_add_listing_page', __('Add Listing', 'geodirectory'), '');
110
-    geodir_create_page(esc_sql(_x('listing-preview', 'page_slug', 'geodirectory')), 'geodir_preview_page', __('Listing Preview', 'geodirectory'), '');
111
-    geodir_create_page(esc_sql(_x('listing-success', 'page_slug', 'geodirectory')), 'geodir_success_page', __('Listing Success', 'geodirectory'), '');
112
-    geodir_create_page(esc_sql(_x('location', 'page_slug', 'geodirectory')), 'geodir_location_page', __('Location', 'geodirectory'), '');
107
+	//geodir_create_page( esc_sql( _x('home-map', 'page_slug', 'geodirectory') ), 'geodir_home_map_page', __('Home Map', 'geodirectory'), '',0,'publish' );
108
+	geodir_create_page(esc_sql(_x('gd-home', 'page_slug', 'geodirectory')), 'geodir_home_page', __('GD Home page', 'geodirectory'), '');
109
+	geodir_create_page(esc_sql(_x('add-listing', 'page_slug', 'geodirectory')), 'geodir_add_listing_page', __('Add Listing', 'geodirectory'), '');
110
+	geodir_create_page(esc_sql(_x('listing-preview', 'page_slug', 'geodirectory')), 'geodir_preview_page', __('Listing Preview', 'geodirectory'), '');
111
+	geodir_create_page(esc_sql(_x('listing-success', 'page_slug', 'geodirectory')), 'geodir_success_page', __('Listing Success', 'geodirectory'), '');
112
+	geodir_create_page(esc_sql(_x('location', 'page_slug', 'geodirectory')), 'geodir_location_page', __('Location', 'geodirectory'), '');
113 113
 
114
-    //New since 1.5.3
115
-    geodir_create_page(esc_sql(_x('gd-info', 'page_slug', 'geodirectory')), 'geodir_info_page', __('Info', 'geodirectory'), '');
116
-    geodir_create_page(esc_sql(_x('gd-login', 'page_slug', 'geodirectory')), 'geodir_login_page', __('Login', 'geodirectory'), '');
114
+	//New since 1.5.3
115
+	geodir_create_page(esc_sql(_x('gd-info', 'page_slug', 'geodirectory')), 'geodir_info_page', __('Info', 'geodirectory'), '');
116
+	geodir_create_page(esc_sql(_x('gd-login', 'page_slug', 'geodirectory')), 'geodir_login_page', __('Login', 'geodirectory'), '');
117 117
 
118 118
 
119 119
 }
@@ -129,11 +129,11 @@  discard block
 block discarded – undo
129 129
  */
130 130
 function geodir_installation_end()
131 131
 {
132
-    //update_option( "geodir_db_version", GEODIRECTORY_VERSION );
132
+	//update_option( "geodir_db_version", GEODIRECTORY_VERSION );
133 133
 
134
-    update_option("geodir_installed", 1);
135
-    update_option("geodir_installation_redirect", 1);
136
-    update_option('skip_install_geodir_pages', 0);
134
+	update_option("geodir_installed", 1);
135
+	update_option("geodir_installation_redirect", 1);
136
+	update_option('skip_install_geodir_pages', 0);
137 137
 }
138 138
 
139 139
 /**
@@ -147,45 +147,45 @@  discard block
 block discarded – undo
147 147
  */
148 148
 function geodir_set_default_options()
149 149
 {
150
-    global $geodir_settings;
151
-    /**
152
-     * Contains settings array for general tab.
153
-     *
154
-     * @since 1.0.0
155
-     * @package GeoDirectory
156
-     */
157
-    include_once("option-pages/general_settings_array.php");
158
-    /**
159
-     * Contains settings array for design tab.
160
-     *
161
-     * @since 1.0.0
162
-     * @package GeoDirectory
163
-     */
164
-    include_once("option-pages/design_settings_array.php");
165
-    /**
166
-     * Contains settings array for notifications tab.
167
-     *
168
-     * @since 1.0.0
169
-     * @package GeoDirectory
170
-     */
171
-    include_once("option-pages/notifications_settings_array.php");
172
-    /**
173
-     * Contains settings array for permalink tab.
174
-     *
175
-     * @since 1.0.0
176
-     * @package GeoDirectory
177
-     */
178
-    include_once("option-pages/permalink_settings_array.php");
179
-    /**
180
-     * Contains settings array for title / meta tab.
181
-     *
182
-     * @since 1.5.4
183
-     * @package GeoDirectory
184
-     */
185
-    include_once("option-pages/title_meta_settings_array.php");
186
-    foreach ($geodir_settings as $value) {
187
-        geodir_update_options($value, true);
188
-    }
150
+	global $geodir_settings;
151
+	/**
152
+	 * Contains settings array for general tab.
153
+	 *
154
+	 * @since 1.0.0
155
+	 * @package GeoDirectory
156
+	 */
157
+	include_once("option-pages/general_settings_array.php");
158
+	/**
159
+	 * Contains settings array for design tab.
160
+	 *
161
+	 * @since 1.0.0
162
+	 * @package GeoDirectory
163
+	 */
164
+	include_once("option-pages/design_settings_array.php");
165
+	/**
166
+	 * Contains settings array for notifications tab.
167
+	 *
168
+	 * @since 1.0.0
169
+	 * @package GeoDirectory
170
+	 */
171
+	include_once("option-pages/notifications_settings_array.php");
172
+	/**
173
+	 * Contains settings array for permalink tab.
174
+	 *
175
+	 * @since 1.0.0
176
+	 * @package GeoDirectory
177
+	 */
178
+	include_once("option-pages/permalink_settings_array.php");
179
+	/**
180
+	 * Contains settings array for title / meta tab.
181
+	 *
182
+	 * @since 1.5.4
183
+	 * @package GeoDirectory
184
+	 */
185
+	include_once("option-pages/title_meta_settings_array.php");
186
+	foreach ($geodir_settings as $value) {
187
+		geodir_update_options($value, true);
188
+	}
189 189
 
190 190
 }
191 191
 
@@ -199,103 +199,103 @@  discard block
 block discarded – undo
199 199
 function geodir_set_default_widgets()
200 200
 {
201 201
 
202
-    $widget_option_list = array();
203
-    $widgetinfo = array();
204
-    $sidebarvalue_array = array();
205
-    $sidebars_widgets = array();
202
+	$widget_option_list = array();
203
+	$widgetinfo = array();
204
+	$sidebarvalue_array = array();
205
+	$sidebars_widgets = array();
206 206
 
207
-    /*===========================*/
208
-    /*  Widgets ON HOME PAGE     */
209
-    /*===========================*/
207
+	/*===========================*/
208
+	/*  Widgets ON HOME PAGE     */
209
+	/*===========================*/
210 210
 
211
-    $widget_option_list['geodir_home_top'] =
212
-        array('popular_post_category' => array("title" => __('Popular Categories', 'geodirectory')),
213
-            'geodir_map_v3_home_map' => array("autozoom" => 1, "width" => '100%', "heigh" => '425'),
214
-            'geodir_advance_search' => array());
211
+	$widget_option_list['geodir_home_top'] =
212
+		array('popular_post_category' => array("title" => __('Popular Categories', 'geodirectory')),
213
+			'geodir_map_v3_home_map' => array("autozoom" => 1, "width" => '100%', "heigh" => '425'),
214
+			'geodir_advance_search' => array());
215 215
 
216
-    $widget_option_list['geodir_home_content'] =
217
-        array('popular_post_view' => array("title" => __('Popular Places', 'geodirectory'), "layout" => 'list', "add_location_filter" => '1'));
216
+	$widget_option_list['geodir_home_content'] =
217
+		array('popular_post_view' => array("title" => __('Popular Places', 'geodirectory'), "layout" => 'list', "add_location_filter" => '1'));
218 218
 
219
-    $widget_option_list['geodir_home_right'] =
220
-        array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')),
221
-            'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1'));
219
+	$widget_option_list['geodir_home_right'] =
220
+		array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')),
221
+			'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1'));
222 222
 
223
-    /*===========================*/
224
-    /*  Widgets ON LISTING PAGE     */
225
-    /*===========================*/
223
+	/*===========================*/
224
+	/*  Widgets ON LISTING PAGE     */
225
+	/*===========================*/
226 226
 
227
-    $widget_option_list['geodir_listing_top'] =
228
-        array('popular_post_category' => array("title" => __('Popular Categories', 'geodirectory')),
229
-            'geodir_advance_search' => array());
227
+	$widget_option_list['geodir_listing_top'] =
228
+		array('popular_post_category' => array("title" => __('Popular Categories', 'geodirectory')),
229
+			'geodir_advance_search' => array());
230 230
 
231
-    $widget_option_list['geodir_listing_right_sidebar'] =
232
-        array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')),
233
-            'geodir_map_v3_listing_map' => array("autozoom" => 1, "sticky" => 1),
234
-            'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1'));
231
+	$widget_option_list['geodir_listing_right_sidebar'] =
232
+		array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')),
233
+			'geodir_map_v3_listing_map' => array("autozoom" => 1, "sticky" => 1),
234
+			'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1'));
235 235
 
236 236
 
237
-    /*===========================*/
238
-    /*  Widgets ON SEARCH PAGE     */
239
-    /*===========================*/
237
+	/*===========================*/
238
+	/*  Widgets ON SEARCH PAGE     */
239
+	/*===========================*/
240 240
 
241
-    $widget_option_list['geodir_search_top'] =
242
-        array('popular_post_category' => array("title" => __('Popular Categories', 'geodirectory')),
243
-            'geodir_advance_search' => array());
241
+	$widget_option_list['geodir_search_top'] =
242
+		array('popular_post_category' => array("title" => __('Popular Categories', 'geodirectory')),
243
+			'geodir_advance_search' => array());
244 244
 
245
-    $widget_option_list['geodir_search_right_sidebar'] =
246
-        array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')),
247
-            'geodir_map_v3_listing_map' => array("autozoom" => 1, "sticky" => 1),
248
-            'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1'));
245
+	$widget_option_list['geodir_search_right_sidebar'] =
246
+		array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')),
247
+			'geodir_map_v3_listing_map' => array("autozoom" => 1, "sticky" => 1),
248
+			'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1'));
249 249
 
250
-    /*===========================*/
251
-    /*  Widgets ON DETAIL/SINGLE PAGE     */
252
-    /*===========================*/
250
+	/*===========================*/
251
+	/*  Widgets ON DETAIL/SINGLE PAGE     */
252
+	/*===========================*/
253 253
 
254
-    $widget_option_list['geodir_detail_sidebar'] =
255
-        array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')),
256
-            'geodir_map_v3_listing_map' => array("autozoom" => 1, "sticky" => 1),
257
-            'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1'));
254
+	$widget_option_list['geodir_detail_sidebar'] =
255
+		array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')),
256
+			'geodir_map_v3_listing_map' => array("autozoom" => 1, "sticky" => 1),
257
+			'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1'));
258 258
 
259 259
 
260
-    /*===========================*/
261
-    /*  Widgets ON AUTHOR PAGE     */
262
-    /*===========================*/
260
+	/*===========================*/
261
+	/*  Widgets ON AUTHOR PAGE     */
262
+	/*===========================*/
263 263
 
264 264
 
265
-    $widget_option_list['geodir_author_right_sidebar'] =
266
-        array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')));
265
+	$widget_option_list['geodir_author_right_sidebar'] =
266
+		array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')));
267 267
 
268 268
 
269
-    $sidebars_widgets = get_option('sidebars_widgets');
269
+	$sidebars_widgets = get_option('sidebars_widgets');
270 270
 
271
-    foreach ($widget_option_list as $key => $widget_options) {
271
+	foreach ($widget_option_list as $key => $widget_options) {
272 272
 
273
-        foreach ($widget_options as $key2 => $widget_options_obj) {
274
-            $widgetid = 'widget_' . $key2;
273
+		foreach ($widget_options as $key2 => $widget_options_obj) {
274
+			$widgetid = 'widget_' . $key2;
275 275
 
276
-            $widgetinfo[$widgetid][] = $widget_options_obj;
276
+			$widgetinfo[$widgetid][] = $widget_options_obj;
277 277
 
278
-            $sidebarvalue_array[$key][] = $key2 . "-" . (count($widgetinfo[$widgetid]));
278
+			$sidebarvalue_array[$key][] = $key2 . "-" . (count($widgetinfo[$widgetid]));
279 279
 
280
-            $widget_update[$widgetid][count($widgetinfo[$widgetid])] = $widget_options_obj;
280
+			$widget_update[$widgetid][count($widgetinfo[$widgetid])] = $widget_options_obj;
281 281
 
282
-        }
282
+		}
283 283
 
284
-        if (!empty($sidebarvalue_array[$key])) {
284
+		if (!empty($sidebarvalue_array[$key])) {
285 285
 
286
-            $sidebars_widgets = get_option('sidebars_widgets');
287
-            $sidebars_widgets[$key] = $sidebarvalue_array[$key];
288
-            update_option('sidebars_widgets', $sidebars_widgets);
286
+			$sidebars_widgets = get_option('sidebars_widgets');
287
+			$sidebars_widgets[$key] = $sidebarvalue_array[$key];
288
+			update_option('sidebars_widgets', $sidebars_widgets);
289 289
 
290
-            foreach ($widget_update as $key => $value) {
290
+			foreach ($widget_update as $key => $value) {
291 291
 
292
-                update_option($key, $value);
292
+				update_option($key, $value);
293 293
 
294
-            }
294
+			}
295 295
 
296
-        }
296
+		}
297 297
 
298
-    }
298
+	}
299 299
 
300 300
 
301 301
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -271,11 +271,11 @@
 block discarded – undo
271 271
     foreach ($widget_option_list as $key => $widget_options) {
272 272
 
273 273
         foreach ($widget_options as $key2 => $widget_options_obj) {
274
-            $widgetid = 'widget_' . $key2;
274
+            $widgetid = 'widget_'.$key2;
275 275
 
276 276
             $widgetinfo[$widgetid][] = $widget_options_obj;
277 277
 
278
-            $sidebarvalue_array[$key][] = $key2 . "-" . (count($widgetinfo[$widgetid]));
278
+            $sidebarvalue_array[$key][] = $key2."-".(count($widgetinfo[$widgetid]));
279 279
 
280 280
             $widget_update[$widgetid][count($widgetinfo[$widgetid])] = $widget_options_obj;
281 281
 
Please login to merge, or discard this patch.
geodirectory-functions/compatibility/Jupiter.php 2 patches
Indentation   +141 added lines, -141 removed lines patch added patch discarded remove patch
@@ -16,28 +16,28 @@  discard block
 block discarded – undo
16 16
  */
17 17
 function jupiter_action_calls()
18 18
 {
19
-    // REMOVE BREADCRUMB
20
-    remove_action('geodir_detail_before_main_content', 'geodir_breadcrumb', 20);
21
-    remove_action('geodir_listings_before_main_content', 'geodir_breadcrumb', 20);
22
-    remove_action('geodir_author_before_main_content', 'geodir_breadcrumb', 20);
23
-    remove_action('geodir_search_before_main_content', 'geodir_breadcrumb', 20);
24
-    remove_action('geodir_home_before_main_content', 'geodir_breadcrumb', 20);
25
-    remove_action('geodir_location_before_main_content', 'geodir_breadcrumb', 20);
26
-
27
-    // REMOVE PAGE TITLES
28
-    remove_action('geodir_listings_page_title', 'geodir_action_listings_title', 10);
29
-    remove_action('geodir_add_listing_page_title', 'geodir_action_add_listing_page_title', 10);
30
-    remove_action('geodir_details_main_content', 'geodir_action_page_title', 20);
31
-    remove_action('geodir_search_page_title', 'geodir_action_search_page_title', 10);
32
-    remove_action('geodir_author_page_title', 'geodir_action_author_page_title', 10);
33
-
34
-
35
-    // CAHNGE PAGE TITLES
36
-    remove_action('page_title', 'mk_page_title');
37
-    add_action('page_title', 'gd_mk_page_title');
38
-    // CHANGE BREADCRUMS FOR GD PAGES
39
-    remove_action('theme_breadcrumbs', 'mk_theme_breadcrumbs');
40
-    add_action('theme_breadcrumbs', 'gd_mk_theme_breadcrumbs');
19
+	// REMOVE BREADCRUMB
20
+	remove_action('geodir_detail_before_main_content', 'geodir_breadcrumb', 20);
21
+	remove_action('geodir_listings_before_main_content', 'geodir_breadcrumb', 20);
22
+	remove_action('geodir_author_before_main_content', 'geodir_breadcrumb', 20);
23
+	remove_action('geodir_search_before_main_content', 'geodir_breadcrumb', 20);
24
+	remove_action('geodir_home_before_main_content', 'geodir_breadcrumb', 20);
25
+	remove_action('geodir_location_before_main_content', 'geodir_breadcrumb', 20);
26
+
27
+	// REMOVE PAGE TITLES
28
+	remove_action('geodir_listings_page_title', 'geodir_action_listings_title', 10);
29
+	remove_action('geodir_add_listing_page_title', 'geodir_action_add_listing_page_title', 10);
30
+	remove_action('geodir_details_main_content', 'geodir_action_page_title', 20);
31
+	remove_action('geodir_search_page_title', 'geodir_action_search_page_title', 10);
32
+	remove_action('geodir_author_page_title', 'geodir_action_author_page_title', 10);
33
+
34
+
35
+	// CAHNGE PAGE TITLES
36
+	remove_action('page_title', 'mk_page_title');
37
+	add_action('page_title', 'gd_mk_page_title');
38
+	// CHANGE BREADCRUMS FOR GD PAGES
39
+	remove_action('theme_breadcrumbs', 'mk_theme_breadcrumbs');
40
+	add_action('theme_breadcrumbs', 'gd_mk_theme_breadcrumbs');
41 41
 
42 42
 
43 43
 }
@@ -52,19 +52,19 @@  discard block
 block discarded – undo
52 52
 function gd_mk_theme_breadcrumbs()
53 53
 {
54 54
 
55
-    if (is_page_geodir_home() || geodir_is_page('location')) {
56
-        jupiter_geodir_breadcrumb();
57
-    } elseif (geodir_is_page('listing')) {
58
-        jupiter_geodir_breadcrumb();
59
-    } elseif (geodir_is_page('detail')) {
60
-        jupiter_geodir_breadcrumb();
61
-    } elseif (geodir_is_page('search')) {
62
-        jupiter_geodir_breadcrumb();
63
-    } elseif (geodir_is_page('author')) {
64
-        jupiter_geodir_breadcrumb();
65
-    } else {
66
-        mk_theme_breadcrumbs();
67
-    }
55
+	if (is_page_geodir_home() || geodir_is_page('location')) {
56
+		jupiter_geodir_breadcrumb();
57
+	} elseif (geodir_is_page('listing')) {
58
+		jupiter_geodir_breadcrumb();
59
+	} elseif (geodir_is_page('detail')) {
60
+		jupiter_geodir_breadcrumb();
61
+	} elseif (geodir_is_page('search')) {
62
+		jupiter_geodir_breadcrumb();
63
+	} elseif (geodir_is_page('author')) {
64
+		jupiter_geodir_breadcrumb();
65
+	} else {
66
+		mk_theme_breadcrumbs();
67
+	}
68 68
 }
69 69
 
70 70
 /**
@@ -76,35 +76,35 @@  discard block
 block discarded – undo
76 76
  */
77 77
 function gd_mk_page_title()
78 78
 {
79
-    global $wp;
80
-
81
-
82
-    if (is_page_geodir_home() || geodir_is_page('location')) {
83
-        jupiter_geodir_page_title();
84
-    } elseif (geodir_is_page('listing')) {
85
-        ob_start(); // Start buffering;
86
-        geodir_action_listings_title();
87
-        $gd_title = ob_get_clean();
88
-        $title_p = explode('">', $gd_title);
89
-        $title = str_replace('</h1></header>', "", $title_p[2]);
90
-        jupiter_geodir_page_title($title);
91
-    } elseif (geodir_is_page('search')) {
92
-        ob_start(); // Start buffering;
93
-        geodir_action_listings_title();
94
-        $gd_title = ob_get_clean();
95
-        $title_p = explode('">', $gd_title);
96
-        $title = str_replace('</h1></header>', "", $title_p[2]);
97
-        jupiter_geodir_page_title($title);
98
-    } elseif (geodir_is_page('author')) {
99
-        ob_start(); // Start buffering;
100
-        geodir_action_author_page_title();
101
-        $gd_title = ob_get_clean();
102
-        $gd_title = str_replace('<h1>', "", $gd_title);
103
-        $gd_title = str_replace('</h1>', "", $gd_title);
104
-        jupiter_geodir_page_title($gd_title);
105
-    } else {
106
-        mk_page_title();
107
-    }
79
+	global $wp;
80
+
81
+
82
+	if (is_page_geodir_home() || geodir_is_page('location')) {
83
+		jupiter_geodir_page_title();
84
+	} elseif (geodir_is_page('listing')) {
85
+		ob_start(); // Start buffering;
86
+		geodir_action_listings_title();
87
+		$gd_title = ob_get_clean();
88
+		$title_p = explode('">', $gd_title);
89
+		$title = str_replace('</h1></header>', "", $title_p[2]);
90
+		jupiter_geodir_page_title($title);
91
+	} elseif (geodir_is_page('search')) {
92
+		ob_start(); // Start buffering;
93
+		geodir_action_listings_title();
94
+		$gd_title = ob_get_clean();
95
+		$title_p = explode('">', $gd_title);
96
+		$title = str_replace('</h1></header>', "", $title_p[2]);
97
+		jupiter_geodir_page_title($title);
98
+	} elseif (geodir_is_page('author')) {
99
+		ob_start(); // Start buffering;
100
+		geodir_action_author_page_title();
101
+		$gd_title = ob_get_clean();
102
+		$gd_title = str_replace('<h1>', "", $gd_title);
103
+		$gd_title = str_replace('</h1>', "", $gd_title);
104
+		jupiter_geodir_page_title($gd_title);
105
+	} else {
106
+		mk_page_title();
107
+	}
108 108
 
109 109
 
110 110
 }
@@ -119,48 +119,48 @@  discard block
 block discarded – undo
119 119
  */
120 120
 function jupiter_geodir_breadcrumb()
121 121
 {
122
-    $item = '';
123
-    ob_start(); // Start buffering;
124
-    geodir_breadcrumb();
125
-    $gd_crums = ob_get_clean();
126
-    if ($gd_crums) {
127
-        $gd_crums = str_replace('<div class="geodir-breadcrumb clearfix"><ul id="breadcrumbs"><li>', "", $gd_crums);
128
-        $gd_crums = str_replace('</li></ul></div>', "", $gd_crums);
129
-        $gd_crums = str_replace('&nbsp;>&nbsp;', " > ", $gd_crums);
130
-        $gd_crums = str_replace('</li><li>', "", $gd_crums);
131
-        $gd_crums = explode(" > ", $gd_crums);
132
-        $trail_end = array_pop($gd_crums);
133
-        $gd_crums['trail_end'] = $trail_end;
134
-        //print_r($gd_crums);exit;
135
-        //print_r($trail);
136
-        $item = $gd_crums;
137
-
138
-    }
139
-    if (!$item) {
140
-        return;
141
-    }
142
-    global $mk_options, $post;
143
-    $post_id = global_get_post_id();
144
-
145
-    if ($post_id) {
146
-        $local_skining = get_post_meta($post_id, '_enable_local_backgrounds', true);
147
-        $breadcrumb_skin = get_post_meta($post_id, '_breadcrumb_skin', true);
148
-        if ($local_skining == 'true' && !empty($breadcrumb_skin)) {
149
-            $breadcrumb_skin_class = $breadcrumb_skin;
150
-        } else {
151
-            $breadcrumb_skin_class = $mk_options['breadcrumb_skin'];
152
-        }
153
-    } else {
154
-        $breadcrumb_skin_class = $mk_options['breadcrumb_skin'];
155
-    }
156
-
157
-
158
-    $delimiter = ' &#47; ';
159
-
160
-    echo '<div id="mk-breadcrumbs"><div class="mk-breadcrumbs-inner ' . $breadcrumb_skin_class . '-skin">';
161
-
162
-    echo implode($delimiter, $item);
163
-    echo "</div></div>";
122
+	$item = '';
123
+	ob_start(); // Start buffering;
124
+	geodir_breadcrumb();
125
+	$gd_crums = ob_get_clean();
126
+	if ($gd_crums) {
127
+		$gd_crums = str_replace('<div class="geodir-breadcrumb clearfix"><ul id="breadcrumbs"><li>', "", $gd_crums);
128
+		$gd_crums = str_replace('</li></ul></div>', "", $gd_crums);
129
+		$gd_crums = str_replace('&nbsp;>&nbsp;', " > ", $gd_crums);
130
+		$gd_crums = str_replace('</li><li>', "", $gd_crums);
131
+		$gd_crums = explode(" > ", $gd_crums);
132
+		$trail_end = array_pop($gd_crums);
133
+		$gd_crums['trail_end'] = $trail_end;
134
+		//print_r($gd_crums);exit;
135
+		//print_r($trail);
136
+		$item = $gd_crums;
137
+
138
+	}
139
+	if (!$item) {
140
+		return;
141
+	}
142
+	global $mk_options, $post;
143
+	$post_id = global_get_post_id();
144
+
145
+	if ($post_id) {
146
+		$local_skining = get_post_meta($post_id, '_enable_local_backgrounds', true);
147
+		$breadcrumb_skin = get_post_meta($post_id, '_breadcrumb_skin', true);
148
+		if ($local_skining == 'true' && !empty($breadcrumb_skin)) {
149
+			$breadcrumb_skin_class = $breadcrumb_skin;
150
+		} else {
151
+			$breadcrumb_skin_class = $mk_options['breadcrumb_skin'];
152
+		}
153
+	} else {
154
+		$breadcrumb_skin_class = $mk_options['breadcrumb_skin'];
155
+	}
156
+
157
+
158
+	$delimiter = ' &#47; ';
159
+
160
+	echo '<div id="mk-breadcrumbs"><div class="mk-breadcrumbs-inner ' . $breadcrumb_skin_class . '-skin">';
161
+
162
+	echo implode($delimiter, $item);
163
+	echo "</div></div>";
164 164
 
165 165
 }
166 166
 
@@ -174,41 +174,41 @@  discard block
 block discarded – undo
174 174
  */
175 175
 function jupiter_geodir_page_title($title = '', $subtitle = '')
176 176
 {
177
-    global $mk_options;
178
-
179
-    $post_id = global_get_post_id();
180
-    $shadow_css = '';
181
-    if ($mk_options['page_title_shadow'] == 'true') {
182
-        $shadow_css = 'mk-drop-shadow';
183
-    }
184
-
185
-    $align = !empty($align) ? $align : 'left';
186
-
187
-    //$title = 'xxxx';
188
-    echo '<section id="mk-page-introduce" class="intro-' . $align . '">';
189
-    echo '<div class="mk-grid">';
190
-    if (!empty($title)) {
191
-        echo '<h1 class="page-introduce-title ' . $shadow_css . '">' . $title . '</h1>';
192
-
193
-    }
194
-
195
-    if (!empty($subtitle)) {
196
-        echo '<div class="page-introduce-subtitle">';
197
-        echo $subtitle;
198
-        echo '</div>';
199
-    }
200
-    if ($mk_options['disable_breadcrumb'] == 'true') {
201
-        if (get_post_meta($post_id, '_disable_breadcrumb', true) != 'false') {
202
-            /**
203
-             * Calls the theme breadcrumbs for Jupiter theme.
204
-             *
205
-             * @since 1.4.0
206
-             */
207
-            do_action('theme_breadcrumbs', $post_id);
208
-        }
209
-    }
210
-
211
-    echo '<div class="clearboth"></div></div></section>';
177
+	global $mk_options;
178
+
179
+	$post_id = global_get_post_id();
180
+	$shadow_css = '';
181
+	if ($mk_options['page_title_shadow'] == 'true') {
182
+		$shadow_css = 'mk-drop-shadow';
183
+	}
184
+
185
+	$align = !empty($align) ? $align : 'left';
186
+
187
+	//$title = 'xxxx';
188
+	echo '<section id="mk-page-introduce" class="intro-' . $align . '">';
189
+	echo '<div class="mk-grid">';
190
+	if (!empty($title)) {
191
+		echo '<h1 class="page-introduce-title ' . $shadow_css . '">' . $title . '</h1>';
192
+
193
+	}
194
+
195
+	if (!empty($subtitle)) {
196
+		echo '<div class="page-introduce-subtitle">';
197
+		echo $subtitle;
198
+		echo '</div>';
199
+	}
200
+	if ($mk_options['disable_breadcrumb'] == 'true') {
201
+		if (get_post_meta($post_id, '_disable_breadcrumb', true) != 'false') {
202
+			/**
203
+			 * Calls the theme breadcrumbs for Jupiter theme.
204
+			 *
205
+			 * @since 1.4.0
206
+			 */
207
+			do_action('theme_breadcrumbs', $post_id);
208
+		}
209
+	}
210
+
211
+	echo '<div class="clearboth"></div></div></section>';
212 212
 
213 213
 
214 214
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 
158 158
     $delimiter = ' &#47; ';
159 159
 
160
-    echo '<div id="mk-breadcrumbs"><div class="mk-breadcrumbs-inner ' . $breadcrumb_skin_class . '-skin">';
160
+    echo '<div id="mk-breadcrumbs"><div class="mk-breadcrumbs-inner '.$breadcrumb_skin_class.'-skin">';
161 161
 
162 162
     echo implode($delimiter, $item);
163 163
     echo "</div></div>";
@@ -185,10 +185,10 @@  discard block
 block discarded – undo
185 185
     $align = !empty($align) ? $align : 'left';
186 186
 
187 187
     //$title = 'xxxx';
188
-    echo '<section id="mk-page-introduce" class="intro-' . $align . '">';
188
+    echo '<section id="mk-page-introduce" class="intro-'.$align.'">';
189 189
     echo '<div class="mk-grid">';
190 190
     if (!empty($title)) {
191
-        echo '<h1 class="page-introduce-title ' . $shadow_css . '">' . $title . '</h1>';
191
+        echo '<h1 class="page-introduce-title '.$shadow_css.'">'.$title.'</h1>';
192 192
 
193 193
     }
194 194
 
Please login to merge, or discard this patch.
geodirectory-templates/popup-forms.php 2 patches
Indentation   +76 added lines, -76 removed lines patch added patch discarded remove patch
@@ -29,23 +29,23 @@  discard block
 block discarded – undo
29 29
             <input type="hidden" id="send_to_Frnd_pid" name="pid" value="<?php echo $post_info->ID;?>"/>
30 30
 
31 31
             <h3><?php
32
-                /**
33
-                 * Filter the title for the send to friend popup form.
34
-                 *
35
-                 * @since 1.0.0
36
-                 * @param string $title The title for the form, defaults to global `SEND_TO_FRIEND` text.
37
-                 */
38
-                echo apply_filters('geodir_send_to_friend_page_title', SEND_TO_FRIEND);?></h3>
32
+				/**
33
+				 * Filter the title for the send to friend popup form.
34
+				 *
35
+				 * @since 1.0.0
36
+				 * @param string $title The title for the form, defaults to global `SEND_TO_FRIEND` text.
37
+				 */
38
+				echo apply_filters('geodir_send_to_friend_page_title', SEND_TO_FRIEND);?></h3>
39 39
 
40 40
             <p id="reply_send_success" class="sucess_msg" style="display:none;"></p>
41 41
             <?php
42
-            /**
43
-             * Called before each field in the send to friend popup template.
44
-             *
45
-             * @since 1.0.0
46
-             * @param string $field The field name the actions is called before.
47
-             */
48
-            do_action('geodir_before_stf_form_field', 'to_name');?>
42
+			/**
43
+			 * Called before each field in the send to friend popup template.
44
+			 *
45
+			 * @since 1.0.0
46
+			 * @param string $field The field name the actions is called before.
47
+			 */
48
+			do_action('geodir_before_stf_form_field', 'to_name');?>
49 49
             <div class="row clearfix">
50 50
                 <div class="geodir_popup_heading">
51 51
                     <label><?php _e('Friend Name', 'geodirectory');?> : <span>*</span></label></div>
@@ -54,16 +54,16 @@  discard block
 block discarded – undo
54 54
                     <span class="message_error2" id="to_nameInfo"></span></div>
55 55
             </div>
56 56
             <?php
57
-            /**
58
-             * Called after each field in the send to friend popup template.
59
-             *
60
-             * @since 1.0.0
61
-             * @param string $field The field name the actions is called after.
62
-             */
63
-            do_action('geodir_after_stf_form_field', 'to_name');?>
57
+			/**
58
+			 * Called after each field in the send to friend popup template.
59
+			 *
60
+			 * @since 1.0.0
61
+			 * @param string $field The field name the actions is called after.
62
+			 */
63
+			do_action('geodir_after_stf_form_field', 'to_name');?>
64 64
             <?php
65
-            /** This action is documented in geodirectory-templates/popup-forms.php */
66
-            do_action('geodir_before_stf_form_field', 'to_email');?>
65
+			/** This action is documented in geodirectory-templates/popup-forms.php */
66
+			do_action('geodir_before_stf_form_field', 'to_email');?>
67 67
             <div class="row  clearfix">
68 68
                 <div class="geodir_popup_heading">
69 69
                     <label> <?php _e('Email', 'geodirectory');?> : <span>*</span></label></div>
@@ -72,11 +72,11 @@  discard block
 block discarded – undo
72 72
                     <span class="message_error2" id="to_emailInfo"></span></div>
73 73
             </div>
74 74
             <?php
75
-            /** This action is documented in geodirectory-templates/popup-forms.php */
76
-            do_action('geodir_after_stf_form_field', 'to_email');?>
75
+			/** This action is documented in geodirectory-templates/popup-forms.php */
76
+			do_action('geodir_after_stf_form_field', 'to_email');?>
77 77
             <?php
78
-            /** This action is documented in geodirectory-templates/popup-forms.php */
79
-            do_action('geodir_before_stf_form_field', 'yourname');?>
78
+			/** This action is documented in geodirectory-templates/popup-forms.php */
79
+			do_action('geodir_before_stf_form_field', 'yourname');?>
80 80
             <div class="row  clearfix">
81 81
                 <div class="geodir_popup_heading">
82 82
                     <label><?php _e('Your Name', 'geodirectory');?> : <span>*</span></label></div>
@@ -85,11 +85,11 @@  discard block
 block discarded – undo
85 85
                     <span class="message_error2" id="yournameInfo"></span></div>
86 86
             </div>
87 87
             <?php
88
-            /** This action is documented in geodirectory-templates/popup-forms.php */
89
-            do_action('geodir_after_stf_form_field', 'yourname');?>
88
+			/** This action is documented in geodirectory-templates/popup-forms.php */
89
+			do_action('geodir_after_stf_form_field', 'yourname');?>
90 90
             <?php
91
-            /** This action is documented in geodirectory-templates/popup-forms.php */
92
-            do_action('geodir_before_stf_form_field', 'youremail');?>
91
+			/** This action is documented in geodirectory-templates/popup-forms.php */
92
+			do_action('geodir_before_stf_form_field', 'youremail');?>
93 93
             <div class="row  clearfix">
94 94
                 <div class="geodir_popup_heading">
95 95
                     <label> <?php _e('Email', 'geodirectory');?> : <span>*</span></label></div>
@@ -98,11 +98,11 @@  discard block
 block discarded – undo
98 98
                     <span class="message_error2" id="youremailInfo"></span></div>
99 99
             </div>
100 100
             <?php
101
-            /** This action is documented in geodirectory-templates/popup-forms.php */
102
-            do_action('geodir_after_stf_form_field', 'youremail');?>
101
+			/** This action is documented in geodirectory-templates/popup-forms.php */
102
+			do_action('geodir_after_stf_form_field', 'youremail');?>
103 103
             <?php
104
-            /** This action is documented in geodirectory-templates/popup-forms.php */
105
-            do_action('geodir_before_stf_form_field', 'frnd_subject');?>
104
+			/** This action is documented in geodirectory-templates/popup-forms.php */
105
+			do_action('geodir_before_stf_form_field', 'frnd_subject');?>
106 106
             <div class="row  clearfix">
107 107
                 <div class="geodir_popup_heading">
108 108
                     <label><?php _e('Subject', 'geodirectory');?> : <span>*</span></label></div>
@@ -113,11 +113,11 @@  discard block
 block discarded – undo
113 113
                     <span class="message_error2" id="frnd_subjectInfo"></span></div>
114 114
             </div>
115 115
             <?php
116
-            /** This action is documented in geodirectory-templates/popup-forms.php */
117
-            do_action('geodir_after_stf_form_field', 'frnd_subject');?>
116
+			/** This action is documented in geodirectory-templates/popup-forms.php */
117
+			do_action('geodir_after_stf_form_field', 'frnd_subject');?>
118 118
             <?php
119
-            /** This action is documented in geodirectory-templates/popup-forms.php */
120
-            do_action('geodir_before_stf_form_field', 'frnd_comments');?>
119
+			/** This action is documented in geodirectory-templates/popup-forms.php */
120
+			do_action('geodir_before_stf_form_field', 'frnd_comments');?>
121 121
             <div class="row  clearfix">
122 122
                 <div class="geodir_popup_heading">
123 123
                     <label><?php _e('Comments', 'geodirectory');?> : <span>*</span></label></div>
@@ -127,11 +127,11 @@  discard block
 block discarded – undo
127 127
                     <span class="message_error2" id="frnd_commentsInfo"></span></div>
128 128
             </div>
129 129
             <?php
130
-            /** This action is documented in geodirectory-templates/popup-forms.php */
131
-            do_action('geodir_after_stf_form_field', 'frnd_comments');?>
130
+			/** This action is documented in geodirectory-templates/popup-forms.php */
131
+			do_action('geodir_after_stf_form_field', 'frnd_comments');?>
132 132
             <?php if (function_exists('geodir_get_captch')) {
133
-                geodir_get_captch('-1');
134
-            }?>
133
+				geodir_get_captch('-1');
134
+			}?>
135 135
             <input name="Send" type="submit" value="<?php _e('Send', 'geodirectory')?> " class="button "/>
136 136
         </form>
137 137
     </div> <?php
@@ -145,23 +145,23 @@  discard block
 block discarded – undo
145 145
             <input type="hidden" name="pid" value="<?php echo $post_info->ID;?>"/>
146 146
 
147 147
             <h3><?php
148
-                /**
149
-                 * Filter the title for the send inquiry popup form.
150
-                 *
151
-                 * @since 1.0.0
152
-                 * @param string $title The title for the form, defaults to global `SEND_INQUIRY` text.
153
-                 */
154
-                echo apply_filters('geodir_send_inquiry_page_title', SEND_INQUIRY);?> </h3>
148
+				/**
149
+				 * Filter the title for the send inquiry popup form.
150
+				 *
151
+				 * @since 1.0.0
152
+				 * @param string $title The title for the form, defaults to global `SEND_INQUIRY` text.
153
+				 */
154
+				echo apply_filters('geodir_send_inquiry_page_title', SEND_INQUIRY);?> </h3>
155 155
 
156 156
             <p id="inquiry_send_success" class="sucess_msg" style="display:none;"></p>
157 157
             <?php
158
-            /**
159
-             * Called before each field in the send to friend inquiry template.
160
-             *
161
-             * @since 1.0.0
162
-             * @param string $field The field name the actions is called before.
163
-             */
164
-            do_action('geodir_before_inquiry_form_field', 'inq_name');?>
158
+			/**
159
+			 * Called before each field in the send to friend inquiry template.
160
+			 *
161
+			 * @since 1.0.0
162
+			 * @param string $field The field name the actions is called before.
163
+			 */
164
+			do_action('geodir_before_inquiry_form_field', 'inq_name');?>
165 165
             <div class="row  clearfix">
166 166
                 <div class="geodir_popup_heading"><label><?php _e('Your Name', 'geodirectory');?> :
167 167
                         <span>*</span></label></div>
@@ -170,16 +170,16 @@  discard block
 block discarded – undo
170 170
                     <span class="message_error2" id="span_agt_mail_name"></span></div>
171 171
             </div>
172 172
             <?php
173
-            /**
174
-             * Called after each field in the send to friend inquiry template.
175
-             *
176
-             * @since 1.0.0
177
-             * @param string $field The field name the actions is called after.
178
-             */
179
-            do_action('geodir_after_inquiry_form_field', 'inq_name');?>
173
+			/**
174
+			 * Called after each field in the send to friend inquiry template.
175
+			 *
176
+			 * @since 1.0.0
177
+			 * @param string $field The field name the actions is called after.
178
+			 */
179
+			do_action('geodir_after_inquiry_form_field', 'inq_name');?>
180 180
             <?php
181
-            /** This action is documented in geodirectory-templates/popup-forms.php */
182
-            do_action('geodir_before_inquiry_form_field', 'inq_email');?>
181
+			/** This action is documented in geodirectory-templates/popup-forms.php */
182
+			do_action('geodir_before_inquiry_form_field', 'inq_email');?>
183 183
             <div class="row  clearfix">
184 184
                 <div class="geodir_popup_heading">
185 185
                     <label><?php _e('Email', 'geodirectory');?> : <span>*</span></label></div>
@@ -189,11 +189,11 @@  discard block
 block discarded – undo
189 189
                 </div>
190 190
             </div>
191 191
             <?php
192
-            /** This action is documented in geodirectory-templates/popup-forms.php */
193
-            do_action('geodir_after_inquiry_form_field', 'inq_email');?>
192
+			/** This action is documented in geodirectory-templates/popup-forms.php */
193
+			do_action('geodir_after_inquiry_form_field', 'inq_email');?>
194 194
             <?php
195
-            /** This action is documented in geodirectory-templates/popup-forms.php */
196
-            do_action('geodir_before_inquiry_form_field', 'inq_phone');?>
195
+			/** This action is documented in geodirectory-templates/popup-forms.php */
196
+			do_action('geodir_before_inquiry_form_field', 'inq_phone');?>
197 197
             <div class="row  clearfix">
198 198
                 <div class="geodir_popup_heading">
199 199
                     <label><?php _e('Contact Info', 'geodirectory');?> :</label></div>
@@ -202,11 +202,11 @@  discard block
 block discarded – undo
202 202
                 </div>
203 203
             </div>
204 204
             <?php
205
-            /** This action is documented in geodirectory-templates/popup-forms.php */
206
-            do_action('geodir_after_inquiry_form_field', 'inq_phone');?>
205
+			/** This action is documented in geodirectory-templates/popup-forms.php */
206
+			do_action('geodir_after_inquiry_form_field', 'inq_phone');?>
207 207
             <?php
208
-            /** This action is documented in geodirectory-templates/popup-forms.php */
209
-            do_action('geodir_before_inquiry_form_field', 'inq_msg');?>
208
+			/** This action is documented in geodirectory-templates/popup-forms.php */
209
+			do_action('geodir_before_inquiry_form_field', 'inq_msg');?>
210 210
             <div class="row  clearfix">
211 211
                 <div class="geodir_popup_heading">
212 212
                     <label><?php _e('Comments', 'geodirectory');?> : <span>*</span></label></div>
@@ -216,8 +216,8 @@  discard block
 block discarded – undo
216 216
                     <span class="message_error2" id="span_agt_mail_msg"></span></div>
217 217
             </div>
218 218
             <?php
219
-            /** This action is documented in geodirectory-templates/popup-forms.php */
220
-            do_action('geodir_after_inquiry_form_field', 'inq_msg');?>
219
+			/** This action is documented in geodirectory-templates/popup-forms.php */
220
+			do_action('geodir_after_inquiry_form_field', 'inq_msg');?>
221 221
             <input name="Send" type="submit" value="<?php _e('Send', 'geodirectory');?>"
222 222
                    class="button clearfix"/>
223 223
         </form>
Please login to merge, or discard this patch.
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -19,14 +19,14 @@  discard block
 block discarded – undo
19 19
  * @param int $post_id The post id requested by the popup.
20 20
  * @param object $post_info The post object requested by the popup.
21 21
  */
22
-do_action('geodir_popup_forms_template_start',$post_id,$post_info);
22
+do_action('geodir_popup_forms_template_start', $post_id, $post_info);
23 23
 
24 24
 if ($_REQUEST['popuptype'] == 'b_sendtofriend') { ?>
25 25
 
26 26
     <div id="basic-modal-content" class="clearfix">
27 27
         <form name="send_to_frnd" id="send_to_frnd" action="<?php echo get_permalink($post_info->ID); ?>" method="post">
28 28
             <input type="hidden" name="sendact" value="email_frnd"/>
29
-            <input type="hidden" id="send_to_Frnd_pid" name="pid" value="<?php echo $post_info->ID;?>"/>
29
+            <input type="hidden" id="send_to_Frnd_pid" name="pid" value="<?php echo $post_info->ID; ?>"/>
30 30
 
31 31
             <h3><?php
32 32
                 /**
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
                  * @since 1.0.0
36 36
                  * @param string $title The title for the form, defaults to global `SEND_TO_FRIEND` text.
37 37
                  */
38
-                echo apply_filters('geodir_send_to_friend_page_title', SEND_TO_FRIEND);?></h3>
38
+                echo apply_filters('geodir_send_to_friend_page_title', SEND_TO_FRIEND); ?></h3>
39 39
 
40 40
             <p id="reply_send_success" class="sucess_msg" style="display:none;"></p>
41 41
             <?php
@@ -45,9 +45,9 @@  discard block
 block discarded – undo
45 45
              * @since 1.0.0
46 46
              * @param string $field The field name the actions is called before.
47 47
              */
48
-            do_action('geodir_before_stf_form_field', 'to_name');?>
48
+            do_action('geodir_before_stf_form_field', 'to_name'); ?>
49 49
             <div class="row clearfix">
50
-                    <input required field_type="text" name="to_name" id="to_name" type="text" value="" placeholder="<?php _e('Friend Name', 'geodirectory');?>"/>
50
+                    <input required field_type="text" name="to_name" id="to_name" type="text" value="" placeholder="<?php _e('Friend Name', 'geodirectory'); ?>"/>
51 51
             </div>
52 52
             <?php
53 53
             /**
@@ -56,55 +56,55 @@  discard block
 block discarded – undo
56 56
              * @since 1.0.0
57 57
              * @param string $field The field name the actions is called after.
58 58
              */
59
-            do_action('geodir_after_stf_form_field', 'to_name');?>
59
+            do_action('geodir_after_stf_form_field', 'to_name'); ?>
60 60
             <?php
61 61
             /** This action is documented in geodirectory-templates/popup-forms.php */
62
-            do_action('geodir_before_stf_form_field', 'to_email');?>
62
+            do_action('geodir_before_stf_form_field', 'to_email'); ?>
63 63
             <div class="row  clearfix">
64
-                    <input required field_type="email" name="to_email" id="to_email" type="email" value="" placeholder="<?php _e('Friend Email', 'geodirectory');?>"/>
64
+                    <input required field_type="email" name="to_email" id="to_email" type="email" value="" placeholder="<?php _e('Friend Email', 'geodirectory'); ?>"/>
65 65
             </div>
66 66
             <?php
67 67
             /** This action is documented in geodirectory-templates/popup-forms.php */
68
-            do_action('geodir_after_stf_form_field', 'to_email');?>
68
+            do_action('geodir_after_stf_form_field', 'to_email'); ?>
69 69
             <?php
70 70
             /** This action is documented in geodirectory-templates/popup-forms.php */
71
-            do_action('geodir_before_stf_form_field', 'yourname');?>
71
+            do_action('geodir_before_stf_form_field', 'yourname'); ?>
72 72
             <div class="row  clearfix">
73
-                    <input required field_type="text" name="yourname" id="yourname" type="text" value="" placeholder="<?php _e('Your Name', 'geodirectory');?>"/>
73
+                    <input required field_type="text" name="yourname" id="yourname" type="text" value="" placeholder="<?php _e('Your Name', 'geodirectory'); ?>"/>
74 74
             </div>
75 75
             <?php
76 76
             /** This action is documented in geodirectory-templates/popup-forms.php */
77
-            do_action('geodir_after_stf_form_field', 'yourname');?>
77
+            do_action('geodir_after_stf_form_field', 'yourname'); ?>
78 78
             <?php
79 79
             /** This action is documented in geodirectory-templates/popup-forms.php */
80
-            do_action('geodir_before_stf_form_field', 'youremail');?>
80
+            do_action('geodir_before_stf_form_field', 'youremail'); ?>
81 81
             <div class="row  clearfix">
82
-                    <input required field_type="email" name="youremail" id="youremail" type="email" value="" placeholder="<?php _e('Your Email', 'geodirectory');?>"/>
82
+                    <input required field_type="email" name="youremail" id="youremail" type="email" value="" placeholder="<?php _e('Your Email', 'geodirectory'); ?>"/>
83 83
             </div>
84 84
             <?php
85 85
             /** This action is documented in geodirectory-templates/popup-forms.php */
86
-            do_action('geodir_after_stf_form_field', 'youremail');?>
86
+            do_action('geodir_after_stf_form_field', 'youremail'); ?>
87 87
             <?php
88 88
             /** This action is documented in geodirectory-templates/popup-forms.php */
89
-            do_action('geodir_before_stf_form_field', 'frnd_subject');?>
89
+            do_action('geodir_before_stf_form_field', 'frnd_subject'); ?>
90 90
             <div class="row  clearfix">
91 91
                     <input required field_type="text" name="frnd_subject"
92
-                           value="<?php echo __('About', 'geodirectory') . ' ' . $post_info->post_title;?>"
93
-                           id="frnd_subject" type="text"  placeholder="<?php _e('Subject', 'geodirectory');?>"/>
92
+                           value="<?php echo __('About', 'geodirectory').' '.$post_info->post_title; ?>"
93
+                           id="frnd_subject" type="text"  placeholder="<?php _e('Subject', 'geodirectory'); ?>"/>
94 94
             </div>
95 95
             <?php
96 96
             /** This action is documented in geodirectory-templates/popup-forms.php */
97
-            do_action('geodir_after_stf_form_field', 'frnd_subject');?>
97
+            do_action('geodir_after_stf_form_field', 'frnd_subject'); ?>
98 98
             <?php
99 99
             /** This action is documented in geodirectory-templates/popup-forms.php */
100
-            do_action('geodir_before_stf_form_field', 'frnd_comments');?>
100
+            do_action('geodir_before_stf_form_field', 'frnd_comments'); ?>
101 101
             <div class="row  clearfix">
102 102
                     <textarea required field_type="textarea" name="frnd_comments" id="frnd_comments" cols=""
103
-                              rows="" placeholder="<?php echo SEND_TO_FRIEND_SAMPLE_CONTENT;?>"><?php echo SEND_TO_FRIEND_SAMPLE_CONTENT;?></textarea>
103
+                              rows="" placeholder="<?php echo SEND_TO_FRIEND_SAMPLE_CONTENT; ?>"><?php echo SEND_TO_FRIEND_SAMPLE_CONTENT; ?></textarea>
104 104
             </div>
105 105
             <?php
106 106
             /** This action is documented in geodirectory-templates/popup-forms.php */
107
-            do_action('geodir_after_stf_form_field', 'frnd_comments');?>
107
+            do_action('geodir_after_stf_form_field', 'frnd_comments'); ?>
108 108
             <?php if (function_exists('geodir_get_captch')) {
109 109
                 geodir_get_captch('-1');
110 110
             }?>
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
         <form method="post" name="agt_mail_agent" id="agt_mail_agent"
119 119
               action="<?php echo get_permalink($post_info->ID); ?>">
120 120
             <input type="hidden" name="sendact" value="send_inqury"/>
121
-            <input type="hidden" name="pid" value="<?php echo $post_info->ID;?>"/>
121
+            <input type="hidden" name="pid" value="<?php echo $post_info->ID; ?>"/>
122 122
 
123 123
             <h3><?php
124 124
                 /**
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
                  * @since 1.0.0
128 128
                  * @param string $title The title for the form, defaults to global `SEND_INQUIRY` text.
129 129
                  */
130
-                echo apply_filters('geodir_send_inquiry_page_title', SEND_INQUIRY);?> </h3>
130
+                echo apply_filters('geodir_send_inquiry_page_title', SEND_INQUIRY); ?> </h3>
131 131
 
132 132
             <p id="inquiry_send_success" class="sucess_msg" style="display:none;"></p>
133 133
             <?php
@@ -137,9 +137,9 @@  discard block
 block discarded – undo
137 137
              * @since 1.0.0
138 138
              * @param string $field The field name the actions is called before.
139 139
              */
140
-            do_action('geodir_before_inquiry_form_field', 'inq_name');?>
140
+            do_action('geodir_before_inquiry_form_field', 'inq_name'); ?>
141 141
             <div class="row  clearfix">
142
-                    <input required field_type="text" name="inq_name" type="text" value="" placeholder="<?php _e('Your Name', 'geodirectory');?>"/>
142
+                    <input required field_type="text" name="inq_name" type="text" value="" placeholder="<?php _e('Your Name', 'geodirectory'); ?>"/>
143 143
             </div>
144 144
             <?php
145 145
             /**
@@ -148,36 +148,36 @@  discard block
 block discarded – undo
148 148
              * @since 1.0.0
149 149
              * @param string $field The field name the actions is called after.
150 150
              */
151
-            do_action('geodir_after_inquiry_form_field', 'inq_name');?>
151
+            do_action('geodir_after_inquiry_form_field', 'inq_name'); ?>
152 152
             <?php
153 153
             /** This action is documented in geodirectory-templates/popup-forms.php */
154
-            do_action('geodir_before_inquiry_form_field', 'inq_email');?>
154
+            do_action('geodir_before_inquiry_form_field', 'inq_email'); ?>
155 155
             <div class="row  clearfix">
156
-                    <input required field_type="email" name="inq_email" type="email" value="" placeholder="<?php _e('Email', 'geodirectory');?>"/>
156
+                    <input required field_type="email" name="inq_email" type="email" value="" placeholder="<?php _e('Email', 'geodirectory'); ?>"/>
157 157
             </div>
158 158
             <?php
159 159
             /** This action is documented in geodirectory-templates/popup-forms.php */
160
-            do_action('geodir_after_inquiry_form_field', 'inq_email');?>
160
+            do_action('geodir_after_inquiry_form_field', 'inq_email'); ?>
161 161
             <?php
162 162
             /** This action is documented in geodirectory-templates/popup-forms.php */
163
-            do_action('geodir_before_inquiry_form_field', 'inq_phone');?>
163
+            do_action('geodir_before_inquiry_form_field', 'inq_phone'); ?>
164 164
             <div class="row  clearfix">
165
-                    <input name="inq_phone" id="agt_mail_phone" type="text" value="" placeholder="<?php _e('Phone number', 'geodirectory');?>"/>
165
+                    <input name="inq_phone" id="agt_mail_phone" type="text" value="" placeholder="<?php _e('Phone number', 'geodirectory'); ?>"/>
166 166
             </div>
167 167
             <?php
168 168
             /** This action is documented in geodirectory-templates/popup-forms.php */
169
-            do_action('geodir_after_inquiry_form_field', 'inq_phone');?>
169
+            do_action('geodir_after_inquiry_form_field', 'inq_phone'); ?>
170 170
             <?php
171 171
             /** This action is documented in geodirectory-templates/popup-forms.php */
172
-            do_action('geodir_before_inquiry_form_field', 'inq_msg');?>
172
+            do_action('geodir_before_inquiry_form_field', 'inq_msg'); ?>
173 173
             <div class="row  clearfix">
174 174
                     <textarea required field_type="textarea" name="inq_msg" cols=""
175
-                              rows="" placeholder="<?php echo SEND_INQUIRY_SAMPLE_CONTENT;?>"></textarea>
175
+                              rows="" placeholder="<?php echo SEND_INQUIRY_SAMPLE_CONTENT; ?>"></textarea>
176 176
             </div>
177 177
             <?php
178 178
             /** This action is documented in geodirectory-templates/popup-forms.php */
179
-            do_action('geodir_after_inquiry_form_field', 'inq_msg');?>
180
-            <input name="Send" type="submit" value="<?php _e('Send', 'geodirectory');?>"
179
+            do_action('geodir_after_inquiry_form_field', 'inq_msg'); ?>
180
+            <input name="Send" type="submit" value="<?php _e('Send', 'geodirectory'); ?>"
181 181
                    class="button clearfix"/>
182 182
         </form>
183 183
     </div> <?php
Please login to merge, or discard this patch.
geodirectory-templates/add-listing.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
 global $gd_session;
13 13
 
14 14
 if (!isset($_REQUEST['backandedit'])) {
15
-    $gd_session->un_set('listing');
15
+	$gd_session->un_set('listing');
16 16
 }
17 17
 // call header
18 18
 get_header();
Please login to merge, or discard this patch.
geodirectory-widgets/listing_map_widget.php 3 patches
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -198,7 +198,9 @@  discard block
 block discarded – undo
198 198
                 $mapview = $maptype;
199 199
             }
200 200
 
201
-            if (empty($mapzoom)) $mapzoom = $zoom;
201
+            if (empty($mapzoom)) {
202
+            	$mapzoom = $zoom;
203
+            }
202 204
 
203 205
             // Set default map options
204 206
             $map_args['ajax_url'] = geodir_get_ajax_url();
@@ -326,8 +328,9 @@  discard block
 block discarded – undo
326 328
 
327 329
                     foreach ($map_zoom_level as $level) {
328 330
                         $selected = '';
329
-                        if ($level == $zoom)
330
-                            $selected = 'selected="selected"';
331
+                        if ($level == $zoom) {
332
+                                                    $selected = 'selected="selected"';
333
+                        }
331 334
 
332 335
                         echo '<option ' . $selected . ' value="' . $level . '">' . $level . '</option>';
333 336
 
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
          * @param string $post->marker_json JSON representation of the post marker info.
46 46
          * @param object $post The post object.
47 47
          */
48
-        $list_map_json[] = apply_filters('geodir_create_list_jsondata',$post->marker_json,$post);
48
+        $list_map_json[] = apply_filters('geodir_create_list_jsondata', $post->marker_json, $post);
49 49
     }
50 50
 
51 51
 }
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
     if (!empty($cat_content_info)) {
73 73
         $json_content = substr(implode(',', $cat_content_info), 1);
74 74
         $json_content = htmlentities($json_content, ENT_QUOTES); // Quotes in csv title import break maps - FIXED by kiran on 2nd March, 2016
75
-        $list_json = '[{"totalcount":"' . $totalcount . '",' . $json_content . ']';
75
+        $list_json = '[{"totalcount":"'.$totalcount.'",'.$json_content.']';
76 76
     } else {
77 77
         $list_json = '[{"totalcount":"0"}]';
78 78
     }
@@ -160,8 +160,8 @@  discard block
 block discarded – undo
160 160
 			 *
161 161
              * @param bool $display true if map should be displayed, false if not.
162 162
              */
163
-			$show_map = apply_filters( 'geodir_show_map_listing', $display = true );
164
-			if ( !$show_map ) {
163
+			$show_map = apply_filters('geodir_show_map_listing', $display = true);
164
+			if (!$show_map) {
165 165
 				return;
166 166
 			}
167 167
 
@@ -260,7 +260,7 @@  discard block
 block discarded – undo
260 260
     public function form($instance)
261 261
     {
262 262
         //widgetform in backend
263
-        $instance = wp_parse_args((array)$instance, array('width' => '', 'heigh' => '', 'maptype' => '', 'zoom' => '', 'autozoom' => '', 'sticky' => '', 'scrollwheel' => '0', 'showall' => '0'));
263
+        $instance = wp_parse_args((array) $instance, array('width' => '', 'heigh' => '', 'maptype' => '', 'zoom' => '', 'autozoom' => '', 'sticky' => '', 'scrollwheel' => '0', 'showall' => '0'));
264 264
         $width = strip_tags($instance['width']);
265 265
         $heigh = strip_tags($instance['heigh']);
266 266
         $maptype = strip_tags($instance['maptype']);
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
                     <option <?php if (isset($maptype) && $maptype == 'HYBRID') {
307 307
                         echo 'selected="selected"';
308 308
                     } ?> value="HYBRID"><?php _e('Hybrid Map', 'geodirectory'); ?></option>
309
-					<option <?php selected($maptype, 'TERRAIN');?> 
309
+					<option <?php selected($maptype, 'TERRAIN'); ?> 
310 310
 							value="TERRAIN"><?php _e('Terrain Map', 'geodirectory'); ?></option>
311 311
                 </select>
312 312
             </label>
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
                         if ($level == $zoom)
330 330
                             $selected = 'selected="selected"';
331 331
 
332
-                        echo '<option ' . $selected . ' value="' . $level . '">' . $level . '</option>';
332
+                        echo '<option '.$selected.' value="'.$level.'">'.$level.'</option>';
333 333
 
334 334
                     } ?>
335 335
 
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
                 :
365 365
                 <input id="<?php echo $this->get_field_id('scrollwheel'); ?>"
366 366
                        name="<?php echo $this->get_field_name('scrollwheel'); ?>" type="checkbox" value="1"
367
-                       <?php if ($scrollwheel){ ?>checked="checked" <?php } ?> />
367
+                       <?php if ($scrollwheel) { ?>checked="checked" <?php } ?> />
368 368
             </label>
369 369
         </p>
370 370
 
Please login to merge, or discard this patch.
Indentation   +183 added lines, -183 removed lines patch added patch discarded remove patch
@@ -18,9 +18,9 @@  discard block
 block discarded – undo
18 18
  */
19 19
 function init_listing_map_script()
20 20
 {
21
-    global $list_map_json;
21
+	global $list_map_json;
22 22
 
23
-    $list_map_json = array();
23
+	$list_map_json = array();
24 24
 
25 25
 }
26 26
 
@@ -35,18 +35,18 @@  discard block
 block discarded – undo
35 35
  */
36 36
 function create_list_jsondata($post)
37 37
 {
38
-    global $wpdb, $list_map_json, $add_post_in_marker_array;
39
-
40
-    if ((is_main_query() || $add_post_in_marker_array) && isset($post->marker_json) && $post->marker_json != '') {
41
-        /**
42
-         * Filter the json data for search listing map.
43
-         *
44
-         * @since 1.5.7
45
-         * @param string $post->marker_json JSON representation of the post marker info.
46
-         * @param object $post The post object.
47
-         */
48
-        $list_map_json[] = apply_filters('geodir_create_list_jsondata',$post->marker_json,$post);
49
-    }
38
+	global $wpdb, $list_map_json, $add_post_in_marker_array;
39
+
40
+	if ((is_main_query() || $add_post_in_marker_array) && isset($post->marker_json) && $post->marker_json != '') {
41
+		/**
42
+		 * Filter the json data for search listing map.
43
+		 *
44
+		 * @since 1.5.7
45
+		 * @param string $post->marker_json JSON representation of the post marker info.
46
+		 * @param object $post The post object.
47
+		 */
48
+		$list_map_json[] = apply_filters('geodir_create_list_jsondata',$post->marker_json,$post);
49
+	}
50 50
 
51 51
 }
52 52
 
@@ -59,28 +59,28 @@  discard block
 block discarded – undo
59 59
  */
60 60
 function show_listing_widget_map()
61 61
 {
62
-    global $list_map_json;
62
+	global $list_map_json;
63 63
 
64
-    if (!empty($list_map_json)) {
65
-        $list_map_json = array_unique($list_map_json);
66
-        $cat_content_info[] = implode(',', $list_map_json);
67
-    }
64
+	if (!empty($list_map_json)) {
65
+		$list_map_json = array_unique($list_map_json);
66
+		$cat_content_info[] = implode(',', $list_map_json);
67
+	}
68 68
 
69
-    $totalcount = count(array_unique($list_map_json));
69
+	$totalcount = count(array_unique($list_map_json));
70 70
 
71 71
 
72
-    if (!empty($cat_content_info)) {
73
-        $json_content = substr(implode(',', $cat_content_info), 1);
74
-        $json_content = htmlentities($json_content, ENT_QUOTES, get_option('blog_charset')); // Quotes in csv title import break maps - FIXED by kiran on 2nd March, 2016
75
-        $list_json = '[{"totalcount":"' . $totalcount . '",' . $json_content . ']';
76
-    } else {
77
-        $list_json = '[{"totalcount":"0"}]';
78
-    }
72
+	if (!empty($cat_content_info)) {
73
+		$json_content = substr(implode(',', $cat_content_info), 1);
74
+		$json_content = htmlentities($json_content, ENT_QUOTES, get_option('blog_charset')); // Quotes in csv title import break maps - FIXED by kiran on 2nd March, 2016
75
+		$list_json = '[{"totalcount":"' . $totalcount . '",' . $json_content . ']';
76
+	} else {
77
+		$list_json = '[{"totalcount":"0"}]';
78
+	}
79 79
 
80
-    $listing_map_args = array('list_json' => $list_json);
80
+	$listing_map_args = array('list_json' => $list_json);
81 81
 
82
-    // Pass the json data in listing map script
83
-    wp_localize_script('geodir-listing-map-widget', 'listing_map_args', $listing_map_args);
82
+	// Pass the json data in listing map script
83
+	wp_localize_script('geodir-listing-map-widget', 'listing_map_args', $listing_map_args);
84 84
 
85 85
 }
86 86
 
@@ -92,184 +92,184 @@  discard block
 block discarded – undo
92 92
 class geodir_map_listingpage extends WP_Widget
93 93
 {
94 94
 
95
-    /**
95
+	/**
96 96
 	 * Register the listing page map widget.
97 97
 	 *
98 98
 	 * @since 1.0.0
99
-     * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct.
99
+	 * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct.
100 100
 	 */
101
-    public function __construct() {
102
-        $widget_ops = array('classname' => 'widget geodir-map-listing-page', 'description' => __('Google Map for Listing page. It will show you google map V3 for Listing page.', 'geodirectory'));
103
-        parent::__construct(
104
-            'geodir_map_v3_listing_map', // Base ID
105
-            __('GD > GMap - Listing page', 'geodirectory'), // Name
106
-            $widget_ops// Args
107
-        );
101
+	public function __construct() {
102
+		$widget_ops = array('classname' => 'widget geodir-map-listing-page', 'description' => __('Google Map for Listing page. It will show you google map V3 for Listing page.', 'geodirectory'));
103
+		parent::__construct(
104
+			'geodir_map_v3_listing_map', // Base ID
105
+			__('GD > GMap - Listing page', 'geodirectory'), // Name
106
+			$widget_ops// Args
107
+		);
108 108
 
109
-        add_action('wp_head', 'init_listing_map_script'); // Initialize the map object and marker array
109
+		add_action('wp_head', 'init_listing_map_script'); // Initialize the map object and marker array
110 110
 
111
-        add_action('the_post', 'create_list_jsondata'); // Add marker in json array
111
+		add_action('the_post', 'create_list_jsondata'); // Add marker in json array
112 112
 
113
-        add_action('wp_footer', 'show_listing_widget_map'); // Show map for listings with markers
114
-    }
113
+		add_action('wp_footer', 'show_listing_widget_map'); // Show map for listings with markers
114
+	}
115 115
 
116 116
 	/**
117 117
 	 * Front-end display content for listing page map widget.
118 118
 	 *
119 119
 	 * @since 1.0.0
120
-     * @since 1.5.1 Declare function public.
120
+	 * @since 1.5.1 Declare function public.
121
+	 *
122
+	 * @global object $post The current post object.
121 123
 	 *
122
-     * @global object $post The current post object.
123
-     *
124 124
 	 * @param array $args     Widget arguments.
125 125
 	 * @param array $instance Saved values from database.
126 126
 	 */
127
-    public function widget($args, $instance)
128
-    {
129
-
130
-        if (geodir_is_page('listing') || geodir_is_page('author') || geodir_is_page('search')
131
-            || geodir_is_page('detail')
132
-        ) :
133
-
134
-            extract($args, EXTR_SKIP);
135
-            /** This action is documented in geodirectory_shortcodes.php */
136
-            $width = empty($instance['width']) ? '294' : apply_filters('widget_width', $instance['width']);
137
-            /** This action is documented in geodirectory_shortcodes.php */
138
-            $height = empty($instance['heigh']) ? '370' : apply_filters('widget_heigh', $instance['heigh']);
139
-            /** This action is documented in geodirectory_shortcodes.php */
140
-            $maptype = empty($instance['maptype']) ? 'ROADMAP' : apply_filters('widget_maptype', $instance['maptype']);
141
-            /** This action is documented in geodirectory_shortcodes.php */
142
-            $zoom = empty($instance['zoom']) ? '13' : apply_filters('widget_zoom', $instance['zoom']);
143
-            /** This action is documented in geodirectory_shortcodes.php */
144
-            $autozoom = empty($instance['autozoom']) ? '' : apply_filters('widget_autozoom', $instance['autozoom']);
145
-            /**
146
-             * Filter the listing map value widget_sticky, to set if the map should be sticky or not (scroll with page).
147
-             *
148
-             * @since 1.0.0
149
-             * @param bool $sticky True if should be sticky, false if not
150
-             */
151
-            $sticky = empty($instance['sticky']) ? '' : apply_filters('widget_sticky', $instance['sticky']);
152
-            /** This action is documented in geodirectory_shortcodes.php */
153
-            $scrollwheel = empty($instance['scrollwheel']) ? '0' : apply_filters('widget_scrollwheel', $instance['scrollwheel']);
154
-            $showall = empty($instance['showall']) ? '0' : apply_filters('widget_showall', $instance['showall']);
127
+	public function widget($args, $instance)
128
+	{
129
+
130
+		if (geodir_is_page('listing') || geodir_is_page('author') || geodir_is_page('search')
131
+			|| geodir_is_page('detail')
132
+		) :
133
+
134
+			extract($args, EXTR_SKIP);
135
+			/** This action is documented in geodirectory_shortcodes.php */
136
+			$width = empty($instance['width']) ? '294' : apply_filters('widget_width', $instance['width']);
137
+			/** This action is documented in geodirectory_shortcodes.php */
138
+			$height = empty($instance['heigh']) ? '370' : apply_filters('widget_heigh', $instance['heigh']);
139
+			/** This action is documented in geodirectory_shortcodes.php */
140
+			$maptype = empty($instance['maptype']) ? 'ROADMAP' : apply_filters('widget_maptype', $instance['maptype']);
141
+			/** This action is documented in geodirectory_shortcodes.php */
142
+			$zoom = empty($instance['zoom']) ? '13' : apply_filters('widget_zoom', $instance['zoom']);
143
+			/** This action is documented in geodirectory_shortcodes.php */
144
+			$autozoom = empty($instance['autozoom']) ? '' : apply_filters('widget_autozoom', $instance['autozoom']);
145
+			/**
146
+			 * Filter the listing map value widget_sticky, to set if the map should be sticky or not (scroll with page).
147
+			 *
148
+			 * @since 1.0.0
149
+			 * @param bool $sticky True if should be sticky, false if not
150
+			 */
151
+			$sticky = empty($instance['sticky']) ? '' : apply_filters('widget_sticky', $instance['sticky']);
152
+			/** This action is documented in geodirectory_shortcodes.php */
153
+			$scrollwheel = empty($instance['scrollwheel']) ? '0' : apply_filters('widget_scrollwheel', $instance['scrollwheel']);
154
+			$showall = empty($instance['showall']) ? '0' : apply_filters('widget_showall', $instance['showall']);
155 155
 			
156 156
 			/**
157
-             * Filter the listing map should to be displayed or not.
158
-             *
159
-             * @since 1.4.6
157
+			 * Filter the listing map should to be displayed or not.
160 158
 			 *
161
-             * @param bool $display true if map should be displayed, false if not.
162
-             */
159
+			 * @since 1.4.6
160
+			 *
161
+			 * @param bool $display true if map should be displayed, false if not.
162
+			 */
163 163
 			$show_map = apply_filters( 'geodir_show_map_listing', $display = true );
164 164
 			if ( !$show_map ) {
165 165
 				return;
166 166
 			}
167 167
 
168
-            $map_args = array();
169
-            $map_args['map_canvas_name'] = str_replace('-', '_', $args['widget_id']);
170
-            $map_args['width'] = $width;
171
-            $map_args['height'] = $height;
172
-
173
-            $map_args['scrollwheel'] = $scrollwheel;
174
-            $map_args['showall'] = $showall;
175
-            $map_args['child_collapse'] = '0';
176
-            $map_args['sticky'] = $sticky;
177
-            $map_args['enable_cat_filters'] = false;
178
-            $map_args['enable_text_search'] = false;
179
-            $map_args['enable_post_type_filters'] = false;
180
-            $map_args['enable_location_filters'] = false;
181
-            $map_args['enable_jason_on_load'] = true;
168
+			$map_args = array();
169
+			$map_args['map_canvas_name'] = str_replace('-', '_', $args['widget_id']);
170
+			$map_args['width'] = $width;
171
+			$map_args['height'] = $height;
172
+
173
+			$map_args['scrollwheel'] = $scrollwheel;
174
+			$map_args['showall'] = $showall;
175
+			$map_args['child_collapse'] = '0';
176
+			$map_args['sticky'] = $sticky;
177
+			$map_args['enable_cat_filters'] = false;
178
+			$map_args['enable_text_search'] = false;
179
+			$map_args['enable_post_type_filters'] = false;
180
+			$map_args['enable_location_filters'] = false;
181
+			$map_args['enable_jason_on_load'] = true;
182 182
 			
183
-            if (is_single()) {
184
-
185
-                global $post;
186
-                $map_default_lat = $address_latitude = $post->post_latitude;
187
-                $map_default_lng = $address_longitude = $post->post_longitude;
188
-                $mapview = $post->post_mapview;
189
-                $mapzoom = $post->post_mapzoom;
190
-                $map_args['map_class_name'] = 'geodir-map-listing-page-single';
191
-
192
-            } else {
193
-                $default_location = geodir_get_default_location();
194
-
195
-                $map_default_lat = isset($default_location->city_latitude) ? $default_location->city_latitude : '';
196
-                $map_default_lng = isset($default_location->city_longitude) ? $default_location->city_longitude : '';
197
-                $map_args['map_class_name'] = 'geodir-map-listing-page';
198
-                $mapview = $maptype;
199
-            }
200
-
201
-            if (empty($mapzoom)) $mapzoom = $zoom;
202
-
203
-            // Set default map options
204
-            $map_args['ajax_url'] = geodir_get_ajax_url();
205
-            $map_args['latitude'] = $map_default_lat;
206
-            $map_args['longitude'] = $map_default_lng;
207
-            $map_args['zoom'] = $zoom;
208
-            //$map_args['scrollwheel'] = true;
209
-            $map_args['scrollwheel'] = $scrollwheel;
210
-            $map_args['showall'] = $showall;
211
-            $map_args['streetViewControl'] = true;
212
-            $map_args['maptype'] = $maptype;
213
-            $map_args['showPreview'] = '0';
214
-            $map_args['maxZoom'] = 21;
215
-            $map_args['autozoom'] = $autozoom;
216
-            $map_args['bubble_size'] = 'small';
217
-
218
-            echo $before_widget;
219
-            geodir_draw_map($map_args);
220
-            echo $after_widget;
221
-
222
-        endif;
223
-    }
183
+			if (is_single()) {
184
+
185
+				global $post;
186
+				$map_default_lat = $address_latitude = $post->post_latitude;
187
+				$map_default_lng = $address_longitude = $post->post_longitude;
188
+				$mapview = $post->post_mapview;
189
+				$mapzoom = $post->post_mapzoom;
190
+				$map_args['map_class_name'] = 'geodir-map-listing-page-single';
191
+
192
+			} else {
193
+				$default_location = geodir_get_default_location();
194
+
195
+				$map_default_lat = isset($default_location->city_latitude) ? $default_location->city_latitude : '';
196
+				$map_default_lng = isset($default_location->city_longitude) ? $default_location->city_longitude : '';
197
+				$map_args['map_class_name'] = 'geodir-map-listing-page';
198
+				$mapview = $maptype;
199
+			}
200
+
201
+			if (empty($mapzoom)) $mapzoom = $zoom;
202
+
203
+			// Set default map options
204
+			$map_args['ajax_url'] = geodir_get_ajax_url();
205
+			$map_args['latitude'] = $map_default_lat;
206
+			$map_args['longitude'] = $map_default_lng;
207
+			$map_args['zoom'] = $zoom;
208
+			//$map_args['scrollwheel'] = true;
209
+			$map_args['scrollwheel'] = $scrollwheel;
210
+			$map_args['showall'] = $showall;
211
+			$map_args['streetViewControl'] = true;
212
+			$map_args['maptype'] = $maptype;
213
+			$map_args['showPreview'] = '0';
214
+			$map_args['maxZoom'] = 21;
215
+			$map_args['autozoom'] = $autozoom;
216
+			$map_args['bubble_size'] = 'small';
217
+
218
+			echo $before_widget;
219
+			geodir_draw_map($map_args);
220
+			echo $after_widget;
221
+
222
+		endif;
223
+	}
224 224
 
225 225
 	/**
226 226
 	 * Sanitize listing page map widget form values as they are saved.
227 227
 	 *
228 228
 	 * @since 1.0.0
229
-     * @since 1.5.1 Declare function public.
229
+	 * @since 1.5.1 Declare function public.
230 230
 	 *
231 231
 	 * @param array $new_instance Values just sent to be saved.
232 232
 	 * @param array $old_instance Previously saved values from database.
233 233
 	 *
234 234
 	 * @return array Updated safe values to be saved.
235 235
 	 */
236
-    public function update($new_instance, $old_instance)
237
-    {
238
-        //save the widget
239
-        $instance = $old_instance;
240
-        $instance['width'] = strip_tags($new_instance['width']);
241
-        $instance['heigh'] = ($new_instance['heigh']);
242
-        $instance['maptype'] = ($new_instance['maptype']);
243
-        $instance['zoom'] = ($new_instance['zoom']);
244
-        $instance['autozoom'] = isset($new_instance['autozoom']) ? $new_instance['autozoom'] : '';
245
-        $instance['sticky'] = isset($new_instance['sticky']) ? $new_instance['sticky'] : '';
246
-        $instance['scrollwheel'] = isset($new_instance['scrollwheel']) ? ($new_instance['scrollwheel']) : '';
247
-        $instance['showall'] = isset($new_instance['showall']) ? ($new_instance['showall']) : '';
248
-
249
-        return $instance;
250
-    }
236
+	public function update($new_instance, $old_instance)
237
+	{
238
+		//save the widget
239
+		$instance = $old_instance;
240
+		$instance['width'] = strip_tags($new_instance['width']);
241
+		$instance['heigh'] = ($new_instance['heigh']);
242
+		$instance['maptype'] = ($new_instance['maptype']);
243
+		$instance['zoom'] = ($new_instance['zoom']);
244
+		$instance['autozoom'] = isset($new_instance['autozoom']) ? $new_instance['autozoom'] : '';
245
+		$instance['sticky'] = isset($new_instance['sticky']) ? $new_instance['sticky'] : '';
246
+		$instance['scrollwheel'] = isset($new_instance['scrollwheel']) ? ($new_instance['scrollwheel']) : '';
247
+		$instance['showall'] = isset($new_instance['showall']) ? ($new_instance['showall']) : '';
248
+
249
+		return $instance;
250
+	}
251 251
 
252 252
 	/**
253 253
 	 * Back-end listing page map widget settings form.
254 254
 	 *
255 255
 	 * @since 1.0.0
256
-     * @since 1.5.1 Declare function public.
256
+	 * @since 1.5.1 Declare function public.
257 257
 	 *
258 258
 	 * @param array $instance Previously saved values from database.
259 259
 	 */
260
-    public function form($instance)
261
-    {
262
-        //widgetform in backend
263
-        $instance = wp_parse_args((array)$instance, array('width' => '', 'heigh' => '', 'maptype' => '', 'zoom' => '', 'autozoom' => '', 'sticky' => '', 'scrollwheel' => '0', 'showall' => '0'));
264
-        $width = strip_tags($instance['width']);
265
-        $heigh = strip_tags($instance['heigh']);
266
-        $maptype = strip_tags($instance['maptype']);
267
-        $zoom = strip_tags($instance['zoom']);
268
-        $autozoom = strip_tags($instance['autozoom']);
269
-        $sticky = strip_tags($instance['sticky']);
270
-        $scrollwheel = strip_tags($instance['scrollwheel']);
271
-        $showall = strip_tags($instance['showall']);
272
-        ?>
260
+	public function form($instance)
261
+	{
262
+		//widgetform in backend
263
+		$instance = wp_parse_args((array)$instance, array('width' => '', 'heigh' => '', 'maptype' => '', 'zoom' => '', 'autozoom' => '', 'sticky' => '', 'scrollwheel' => '0', 'showall' => '0'));
264
+		$width = strip_tags($instance['width']);
265
+		$heigh = strip_tags($instance['heigh']);
266
+		$maptype = strip_tags($instance['maptype']);
267
+		$zoom = strip_tags($instance['zoom']);
268
+		$autozoom = strip_tags($instance['autozoom']);
269
+		$sticky = strip_tags($instance['sticky']);
270
+		$scrollwheel = strip_tags($instance['scrollwheel']);
271
+		$showall = strip_tags($instance['showall']);
272
+		?>
273 273
         <p>
274 274
             <label
275 275
                 for="<?php echo $this->get_field_id('width'); ?>"><?php _e('Map Width <small>(Default is : 294) you can use px or % here</small>', 'geodirectory'); ?>
@@ -298,14 +298,14 @@  discard block
 block discarded – undo
298 298
                         name="<?php echo $this->get_field_name('maptype'); ?>">
299 299
 
300 300
                     <option <?php if (isset($maptype) && $maptype == 'ROADMAP') {
301
-                        echo 'selected="selected"';
302
-                    } ?> value="ROADMAP"><?php _e('Road Map', 'geodirectory'); ?></option>
301
+						echo 'selected="selected"';
302
+					} ?> value="ROADMAP"><?php _e('Road Map', 'geodirectory'); ?></option>
303 303
                     <option <?php if (isset($maptype) && $maptype == 'SATELLITE') {
304
-                        echo 'selected="selected"';
305
-                    } ?> value="SATELLITE"><?php _e('Satellite Map', 'geodirectory'); ?></option>
304
+						echo 'selected="selected"';
305
+					} ?> value="SATELLITE"><?php _e('Satellite Map', 'geodirectory'); ?></option>
306 306
                     <option <?php if (isset($maptype) && $maptype == 'HYBRID') {
307
-                        echo 'selected="selected"';
308
-                    } ?> value="HYBRID"><?php _e('Hybrid Map', 'geodirectory'); ?></option>
307
+						echo 'selected="selected"';
308
+					} ?> value="HYBRID"><?php _e('Hybrid Map', 'geodirectory'); ?></option>
309 309
 					<option <?php selected($maptype, 'TERRAIN');?> 
310 310
 							value="TERRAIN"><?php _e('Terrain Map', 'geodirectory'); ?></option>
311 311
                 </select>
@@ -313,8 +313,8 @@  discard block
 block discarded – undo
313 313
         </p>
314 314
 
315 315
         <?php
316
-        $map_zoom_level = geodir_map_zoom_level();
317
-        ?>
316
+		$map_zoom_level = geodir_map_zoom_level();
317
+		?>
318 318
 
319 319
         <p>
320 320
             <label
@@ -324,14 +324,14 @@  discard block
 block discarded – undo
324 324
                 <select class="widefat" id="<?php echo $this->get_field_id('zoom'); ?>"
325 325
                         name="<?php echo $this->get_field_name('zoom'); ?>"> <?php
326 326
 
327
-                    foreach ($map_zoom_level as $level) {
328
-                        $selected = '';
329
-                        if ($level == $zoom)
330
-                            $selected = 'selected="selected"';
327
+					foreach ($map_zoom_level as $level) {
328
+						$selected = '';
329
+						if ($level == $zoom)
330
+							$selected = 'selected="selected"';
331 331
 
332
-                        echo '<option ' . $selected . ' value="' . $level . '">' . $level . '</option>';
332
+						echo '<option ' . $selected . ' value="' . $level . '">' . $level . '</option>';
333 333
 
334
-                    } ?>
334
+					} ?>
335 335
 
336 336
                 </select>
337 337
 
@@ -344,8 +344,8 @@  discard block
 block discarded – undo
344 344
                 :
345 345
                 <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('autozoom'); ?>"
346 346
                        name="<?php echo $this->get_field_name('autozoom'); ?>"<?php if ($autozoom) {
347
-                    echo 'checked="checked"';
348
-                } ?> /></label>
347
+					echo 'checked="checked"';
348
+				} ?> /></label>
349 349
         </p>
350 350
 
351 351
         <p>
@@ -354,8 +354,8 @@  discard block
 block discarded – undo
354 354
                 :
355 355
                 <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('sticky'); ?>"
356 356
                        name="<?php echo $this->get_field_name('sticky'); ?>"<?php if ($sticky) {
357
-                    echo 'checked="checked"';
358
-                } ?> /> </label>
357
+					echo 'checked="checked"';
358
+				} ?> /> </label>
359 359
         </p>
360 360
 
361 361
         <p>
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
     </p> -->
376 376
 
377 377
     <?php
378
-    }
378
+	}
379 379
 } // class geodir_map_listingpage
380 380
 
381 381
 register_widget('geodir_map_listingpage');
Please login to merge, or discard this patch.
geodirectory-templates/listing-listview.php 3 patches
Braces   +8 added lines, -3 removed lines patch added patch discarded remove patch
@@ -80,7 +80,10 @@  discard block
 block discarded – undo
80 80
                     echo ' geodir-listview ';
81 81
                 } ?> <?php if ($post_view_class) {
82 82
                     echo $post_view_class;
83
-                } ?>" <?php if (isset($listing_width) && $listing_width) echo "style='width:{$listing_width}%;'"; // Width for widget listing
83
+                } ?>" <?php if (isset($listing_width) && $listing_width) {
84
+                	echo "style='width:{$listing_width}%;'";
85
+                }
86
+                // Width for widget listing
84 87
 
85 88
                 echo " data-post-id='$post->ID' ";
86 89
                 /**
@@ -402,8 +405,10 @@  discard block
 block discarded – undo
402 405
              */
403 406
             do_action('geodir_after_listing_post_listview');
404 407
 
405
-        else:
406
-			$favorite = isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite' ? true : false;
408
+        else {
409
+        	:
410
+			$favorite = isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite' ? true : false;
411
+        }
407 412
             
408 413
 			/**
409 414
              * Called inside the `ul` of the listings template, when no listing found.
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
                 ?>
76 76
 
77 77
                 <li class="clearfix <?php if ($grid_view_class) {
78
-                    echo 'geodir-gridview ' . $grid_view_class;
78
+                    echo 'geodir-gridview '.$grid_view_class;
79 79
                 } else {
80 80
                     echo ' geodir-listview ';
81 81
                 } ?> <?php if ($post_view_class) {
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
                                     echo geodir_show_badges_on_image('featured', $post, get_permalink());
117 117
                                 }
118 118
 
119
-                                $geodir_days_new = (int)get_option('geodir_listing_new_days');
119
+                                $geodir_days_new = (int) get_option('geodir_listing_new_days');
120 120
 
121 121
                                 if (round(abs(strtotime($post->post_date) - strtotime(date('Y-m-d'))) / 86400) < $geodir_days_new) {
122 122
                                     echo geodir_show_badges_on_image('new', $post, get_permalink());
@@ -194,14 +194,14 @@  discard block
 block discarded – undo
194 194
                                         } else {
195 195
                                             $uom = __('meters', 'geodirectory');
196 196
                                         }
197
-                                        echo round($distance) . ' ' . $uom . '<br />';
197
+                                        echo round($distance).' '.$uom.'<br />';
198 198
                                     } else {
199 199
                                         if ($uom == 'miles') {
200 200
                                             $uom = __('miles', 'geodirectory');
201 201
                                         } else {
202 202
                                             $uom = __('km', 'geodirectory');
203 203
                                         }
204
-                                        echo round($distance, 2) . ' ' . $uom . '<br />';
204
+                                        echo round($distance, 2).' '.$uom.'<br />';
205 205
                                     }
206 206
                                     ?>
207 207
                                 </h3>
@@ -231,13 +231,13 @@  discard block
 block discarded – undo
231 231
                                  */
232 232
                                 $show_listing_excerpt = apply_filters('geodir_show_listing_post_excerpt', true, 'listview', $post);
233 233
                                 if ($show_listing_excerpt) {
234
-                                    if ( isset( $character_count ) && ( $character_count || $character_count == '0' ) ) {
235
-                                        $content_out = geodir_max_excerpt( $character_count );
234
+                                    if (isset($character_count) && ($character_count || $character_count == '0')) {
235
+                                        $content_out = geodir_max_excerpt($character_count);
236 236
                                     } else {
237 237
                                         $content_out = get_the_excerpt();
238 238
                                     }
239
-                                    if ( ! empty( $content_out ) ) {
240
-                                        echo "<p>" . $content_out . "</p>";
239
+                                    if (!empty($content_out)) {
240
+                                        echo "<p>".$content_out."</p>";
241 241
                                     }
242 242
                                 }
243 243
                                 ?></div>
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
                          * @param object $post The post object.
262 262
                          * @param string $view The view type, default 'listing'.
263 263
                          */
264
-                        do_action( 'geodir_after_listing_content', $post, 'listing' ); ?>
264
+                        do_action('geodir_after_listing_content', $post, 'listing'); ?>
265 265
                         <footer class="geodir-entry-meta <?php echo apply_filters('geodir_listing_listview_meta_extra_class', '', 'listing'); ?>">
266 266
                             <div class="geodir-addinfo clearfix <?php echo apply_filters('geodir_listing_listview_addinfo_extra_class', '', 'listing'); ?>">
267 267
 
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
                                  * @param object $post The post object.
274 274
                                  * @param string $view The view type, default 'listing'.
275 275
                                  */
276
-                                do_action( 'geodir_before_review_html', $post, 'listing' );
276
+                                do_action('geodir_before_review_html', $post, 'listing');
277 277
 
278 278
                                 $review_show = geodir_is_reviews_show('listview');
279 279
 
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
                                  *
317 317
                                  * @since 1.0.0
318 318
                                  */
319
-                                do_action( 'geodir_after_favorite_html', $post->ID, 'listing' );
319
+                                do_action('geodir_after_favorite_html', $post->ID, 'listing');
320 320
 
321 321
 
322 322
                                 /**
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
                                  * @param int $post->ID The post id.
328 328
                                  * @param object $post The post object.
329 329
                                  */
330
-                                do_action( 'geodir_listing_after_pinpoint', $post->ID ,$post);
330
+                                do_action('geodir_listing_after_pinpoint', $post->ID, $post);
331 331
 
332 332
                                 if ($post->post_author == get_current_user_id()) { ?>
333 333
                                     <?php
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
                                                    title="<?php _e('Edit Listing', 'geodirectory'); ?>">
357 357
                                                     <?php
358 358
                                                     $geodir_listing_edit_icon = apply_filters('geodir_listing_edit_icon', 'fa fa-edit');
359
-                                                    echo '<i class="'. $geodir_listing_edit_icon .'"></i>';
359
+                                                    echo '<i class="'.$geodir_listing_edit_icon.'"></i>';
360 360
                                                     ?>
361 361
                                                     <?php _e('Edit', 'geodirectory'); ?>
362 362
                                                 </a>
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
                                                    title="<?php _e('Delete Listing', 'geodirectory'); ?>">
365 365
                                                     <?php
366 366
                                                     $geodir_listing_delete_icon = apply_filters('geodir_listing_delete_icon', 'fa fa-close');
367
-                                                    echo '<i class="'. $geodir_listing_delete_icon .'"></i>';
367
+                                                    echo '<i class="'.$geodir_listing_delete_icon.'"></i>';
368 368
                                                     ?>
369 369
                                                     <?php _e('Delete', 'geodirectory'); ?>
370 370
                                                 </a>
Please login to merge, or discard this 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.