Test Failed
Pull Request — master (#306)
by Kiran
16:19
created
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.
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.
Indentation   +1791 added lines, -1791 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,107 +275,107 @@  discard block
 block discarded – undo
275 275
 function geodir_content_actions_dynamic()
276 276
 {
277 277
 
278
-    $tc = get_option('theme_compatibility_setting');
278
+	$tc = get_option('theme_compatibility_setting');
279 279
 //print_r($tc);
280
-    if (empty($tc)) {
281
-        return;
282
-    }
283
-
284
-    //php
285
-    if (!empty($tc['geodir_theme_compat_code'])) {
286
-        include_once('geodirectory-functions/compatibility/' . $tc['geodir_theme_compat_code'] . '.php');
287
-    }
288
-
289
-    //geodir_full_page_class
290
-    if (!empty($tc['geodir_full_page_class_filter'])) {
291
-        add_filter('geodir_full_page_class', 'geodir_full_page_class_dynamic', 10);
292
-    }
293
-
294
-    //widget before filter
295
-    if (!empty($tc['geodir_before_widget_filter'])) {
296
-        add_filter('geodir_before_widget', 'geodir_before_widget_dynamic', 10);
297
-    }
298
-
299
-    //widget after filter
300
-    if (!empty($tc['geodir_after_widget_filter'])) {
301
-        add_filter('geodir_after_widget', 'geodir_after_widget_dynamic', 10);
302
-    }
303
-
304
-    //widget before title filter
305
-    if (!empty($tc['geodir_before_title_filter'])) {
306
-        add_filter('geodir_before_title', 'geodir_before_title_dynamic', 10);
307
-    }
308
-
309
-    //widget before title filter
310
-    if (!empty($tc['geodir_after_title_filter'])) {
311
-        add_filter('geodir_after_title', 'geodir_after_title_dynamic', 10);
312
-    }
313
-
314
-    //menu li class
315
-    if (!empty($tc['geodir_menu_li_class_filter'])) {
316
-        add_filter('geodir_menu_li_class', 'geodir_menu_li_class_dynamic', 10);
317
-    }
318
-
319
-    //menu ul class
320
-    if (!empty($tc['geodir_sub_menu_ul_class_filter'])) {
321
-        add_filter('geodir_sub_menu_ul_class', 'geodir_sub_menu_ul_class_dynamic', 10);
322
-    }
323
-
324
-    //menu sub li class
325
-    if (!empty($tc['geodir_sub_menu_li_class_filter'])) {
326
-        add_filter('geodir_sub_menu_li_class', 'geodir_sub_menu_li_class_dynamic', 10);
327
-    }
328
-
329
-    //menu a class
330
-    if (!empty($tc['geodir_menu_a_class_filter'])) {
331
-        add_filter('geodir_menu_a_class', 'geodir_menu_a_class_dynamic', 10);
332
-    }
333
-
334
-    //menu sub a class
335
-    if (!empty($tc['geodir_sub_menu_a_class_filter'])) {
336
-        add_filter('geodir_sub_menu_a_class', 'geodir_sub_menu_a_class_dynamic', 10);
337
-    }
338
-
339
-    //location menu li class
340
-    if (!empty($tc['geodir_location_switcher_menu_li_class_filter'])) {
341
-        add_filter('geodir_location_switcher_menu_li_class', 'geodir_location_switcher_menu_li_class_dynamic', 10);
342
-    }
343
-
344
-    //location menu sub ul class
345
-    if (!empty($tc['geodir_location_switcher_menu_sub_ul_class_filter'])) {
346
-        add_filter('geodir_location_switcher_menu_sub_ul_class', 'geodir_location_switcher_menu_sub_ul_class_dynamic', 10);
347
-    }
348
-
349
-    //location menu sub li class
350
-    if (!empty($tc['geodir_location_switcher_menu_sub_li_class_filter'])) {
351
-        add_filter('geodir_location_switcher_menu_sub_li_class', 'geodir_location_switcher_menu_sub_li_class_dynamic', 10);
352
-    }
353
-
354
-    //location menu a class
355
-    if (!empty($tc['geodir_location_switcher_menu_a_class_filter'])) {
356
-        add_filter('geodir_location_switcher_menu_a_class', 'geodir_location_switcher_menu_a_class_dynamic', 10);
357
-    }
358
-
359
-    // compat styles
360
-    if (!empty($tc['geodir_theme_compat_css'])) {
361
-        add_action('wp_head', 'gd_compat_styles');
362
-    }
363
-
364
-    // compat js
365
-    if (!empty($tc['geodir_theme_compat_js'])) {
366
-        add_action('wp_footer', 'gd_compat_script');
367
-    }
368
-
369
-
370
-    // geodir_top_content_add
371
-    if (!empty($tc['geodir_top_content_add'])) {
372
-        add_action('geodir_top_content', 'geodir_top_content_add_dynamic', 10, 1);
373
-    }
374
-
375
-    // geodir_before_main_content_add
376
-    if (!empty($tc['geodir_before_main_content_add'])) {
377
-        add_action('geodir_before_main_content', 'geodir_before_main_content_add_dynamic', 10, 1);
378
-    }
280
+	if (empty($tc)) {
281
+		return;
282
+	}
283
+
284
+	//php
285
+	if (!empty($tc['geodir_theme_compat_code'])) {
286
+		include_once('geodirectory-functions/compatibility/' . $tc['geodir_theme_compat_code'] . '.php');
287
+	}
288
+
289
+	//geodir_full_page_class
290
+	if (!empty($tc['geodir_full_page_class_filter'])) {
291
+		add_filter('geodir_full_page_class', 'geodir_full_page_class_dynamic', 10);
292
+	}
293
+
294
+	//widget before filter
295
+	if (!empty($tc['geodir_before_widget_filter'])) {
296
+		add_filter('geodir_before_widget', 'geodir_before_widget_dynamic', 10);
297
+	}
298
+
299
+	//widget after filter
300
+	if (!empty($tc['geodir_after_widget_filter'])) {
301
+		add_filter('geodir_after_widget', 'geodir_after_widget_dynamic', 10);
302
+	}
303
+
304
+	//widget before title filter
305
+	if (!empty($tc['geodir_before_title_filter'])) {
306
+		add_filter('geodir_before_title', 'geodir_before_title_dynamic', 10);
307
+	}
308
+
309
+	//widget before title filter
310
+	if (!empty($tc['geodir_after_title_filter'])) {
311
+		add_filter('geodir_after_title', 'geodir_after_title_dynamic', 10);
312
+	}
313
+
314
+	//menu li class
315
+	if (!empty($tc['geodir_menu_li_class_filter'])) {
316
+		add_filter('geodir_menu_li_class', 'geodir_menu_li_class_dynamic', 10);
317
+	}
318
+
319
+	//menu ul class
320
+	if (!empty($tc['geodir_sub_menu_ul_class_filter'])) {
321
+		add_filter('geodir_sub_menu_ul_class', 'geodir_sub_menu_ul_class_dynamic', 10);
322
+	}
323
+
324
+	//menu sub li class
325
+	if (!empty($tc['geodir_sub_menu_li_class_filter'])) {
326
+		add_filter('geodir_sub_menu_li_class', 'geodir_sub_menu_li_class_dynamic', 10);
327
+	}
328
+
329
+	//menu a class
330
+	if (!empty($tc['geodir_menu_a_class_filter'])) {
331
+		add_filter('geodir_menu_a_class', 'geodir_menu_a_class_dynamic', 10);
332
+	}
333
+
334
+	//menu sub a class
335
+	if (!empty($tc['geodir_sub_menu_a_class_filter'])) {
336
+		add_filter('geodir_sub_menu_a_class', 'geodir_sub_menu_a_class_dynamic', 10);
337
+	}
338
+
339
+	//location menu li class
340
+	if (!empty($tc['geodir_location_switcher_menu_li_class_filter'])) {
341
+		add_filter('geodir_location_switcher_menu_li_class', 'geodir_location_switcher_menu_li_class_dynamic', 10);
342
+	}
343
+
344
+	//location menu sub ul class
345
+	if (!empty($tc['geodir_location_switcher_menu_sub_ul_class_filter'])) {
346
+		add_filter('geodir_location_switcher_menu_sub_ul_class', 'geodir_location_switcher_menu_sub_ul_class_dynamic', 10);
347
+	}
348
+
349
+	//location menu sub li class
350
+	if (!empty($tc['geodir_location_switcher_menu_sub_li_class_filter'])) {
351
+		add_filter('geodir_location_switcher_menu_sub_li_class', 'geodir_location_switcher_menu_sub_li_class_dynamic', 10);
352
+	}
353
+
354
+	//location menu a class
355
+	if (!empty($tc['geodir_location_switcher_menu_a_class_filter'])) {
356
+		add_filter('geodir_location_switcher_menu_a_class', 'geodir_location_switcher_menu_a_class_dynamic', 10);
357
+	}
358
+
359
+	// compat styles
360
+	if (!empty($tc['geodir_theme_compat_css'])) {
361
+		add_action('wp_head', 'gd_compat_styles');
362
+	}
363
+
364
+	// compat js
365
+	if (!empty($tc['geodir_theme_compat_js'])) {
366
+		add_action('wp_footer', 'gd_compat_script');
367
+	}
368
+
369
+
370
+	// geodir_top_content_add
371
+	if (!empty($tc['geodir_top_content_add'])) {
372
+		add_action('geodir_top_content', 'geodir_top_content_add_dynamic', 10, 1);
373
+	}
374
+
375
+	// geodir_before_main_content_add
376
+	if (!empty($tc['geodir_before_main_content_add'])) {
377
+		add_action('geodir_before_main_content', 'geodir_before_main_content_add_dynamic', 10, 1);
378
+	}
379 379
 
380 380
 
381 381
 }
@@ -398,23 +398,23 @@  discard block
 block discarded – undo
398 398
  */
399 399
 function geodir_action_wrapper_open($type = '', $id = '', $class = '')
400 400
 {
401
-    $tc = get_option('theme_compatibility_setting');
402
-    if (!empty($tc['geodir_wrapper_open_replace'])) {
403
-        $text = $tc['geodir_wrapper_open_replace'];
404
-    } else {
405
-        $text = '<div id="[id]" class="[class]">';
406
-    }
401
+	$tc = get_option('theme_compatibility_setting');
402
+	if (!empty($tc['geodir_wrapper_open_replace'])) {
403
+		$text = $tc['geodir_wrapper_open_replace'];
404
+	} else {
405
+		$text = '<div id="[id]" class="[class]">';
406
+	}
407 407
 
408
-    if (!empty($tc['geodir_wrapper_open_id'])) {
409
-        $id = $tc['geodir_wrapper_open_id'];
410
-    }
411
-    if (!empty($tc['geodir_wrapper_open_class'])) {
412
-        $class = $tc['geodir_wrapper_open_class'];
413
-    }
408
+	if (!empty($tc['geodir_wrapper_open_id'])) {
409
+		$id = $tc['geodir_wrapper_open_id'];
410
+	}
411
+	if (!empty($tc['geodir_wrapper_open_class'])) {
412
+		$class = $tc['geodir_wrapper_open_class'];
413
+	}
414 414
 
415
-    $text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
415
+	$text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
416 416
 
417
-    echo $text;
417
+	echo $text;
418 418
 }
419 419
 
420 420
 // action for adding the wrapperdiv closing tag
@@ -429,14 +429,14 @@  discard block
 block discarded – undo
429 429
  */
430 430
 function geodir_action_wrapper_close($type = '')
431 431
 {
432
-    $tc = get_option('theme_compatibility_setting');
433
-    if (!empty($tc['geodir_wrapper_close_replace'])) {
434
-        $text = $tc['geodir_wrapper_close_replace'];
435
-    } else {
436
-        $text = '</div><!-- wrapper ends here-->';
437
-    }
432
+	$tc = get_option('theme_compatibility_setting');
433
+	if (!empty($tc['geodir_wrapper_close_replace'])) {
434
+		$text = $tc['geodir_wrapper_close_replace'];
435
+	} else {
436
+		$text = '</div><!-- wrapper ends here-->';
437
+	}
438 438
 
439
-    echo $text;
439
+	echo $text;
440 440
 }
441 441
 
442 442
 // action for adding the content div opening tag
@@ -452,35 +452,35 @@  discard block
 block discarded – undo
452 452
  */
453 453
 function geodir_action_wrapper_content_open($type = '', $id = '', $class = '')
454 454
 {
455
-    if ($type == 'home-page' && $width = get_option('geodir_width_home_contant_section')) {
456
-        $width_css = 'style="width:' . $width . '%;"';
457
-    } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_contant_section')) {
458
-        $width_css = 'style="width:' . $width . '%;"';
459
-    } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_contant_section')) {
460
-        $width_css = 'style="width:' . $width . '%;"';
461
-    } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_contant_section')) {
462
-        $width_css = 'style="width:' . $width . '%;"';
463
-    } else {
464
-        $width_css = '';
465
-    }
466
-
467
-    $tc = get_option('theme_compatibility_setting');
468
-    if (!empty($tc['geodir_wrapper_content_open_replace'])) {
469
-        $text = $tc['geodir_wrapper_content_open_replace'];
470
-    } else {
471
-        $text = '<div id="[id]" class="[class]" role="main" [width_css]>';
472
-    }
473
-
474
-    if (!empty($tc['geodir_wrapper_content_open_id'])) {
475
-        $id = $tc['geodir_wrapper_content_open_id'];
476
-    }
477
-    if (!empty($tc['geodir_wrapper_content_open_class'])) {
478
-        $class = $tc['geodir_wrapper_content_open_class'];
479
-    }
480
-
481
-    $text = str_replace(array("[id]", "[class]", "[width_css]"), array($id, $class, $width_css), $text);
482
-
483
-    echo $text;
455
+	if ($type == 'home-page' && $width = get_option('geodir_width_home_contant_section')) {
456
+		$width_css = 'style="width:' . $width . '%;"';
457
+	} elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_contant_section')) {
458
+		$width_css = 'style="width:' . $width . '%;"';
459
+	} elseif ($type == 'search-page' && $width = get_option('geodir_width_search_contant_section')) {
460
+		$width_css = 'style="width:' . $width . '%;"';
461
+	} elseif ($type == 'author-page' && $width = get_option('geodir_width_author_contant_section')) {
462
+		$width_css = 'style="width:' . $width . '%;"';
463
+	} else {
464
+		$width_css = '';
465
+	}
466
+
467
+	$tc = get_option('theme_compatibility_setting');
468
+	if (!empty($tc['geodir_wrapper_content_open_replace'])) {
469
+		$text = $tc['geodir_wrapper_content_open_replace'];
470
+	} else {
471
+		$text = '<div id="[id]" class="[class]" role="main" [width_css]>';
472
+	}
473
+
474
+	if (!empty($tc['geodir_wrapper_content_open_id'])) {
475
+		$id = $tc['geodir_wrapper_content_open_id'];
476
+	}
477
+	if (!empty($tc['geodir_wrapper_content_open_class'])) {
478
+		$class = $tc['geodir_wrapper_content_open_class'];
479
+	}
480
+
481
+	$text = str_replace(array("[id]", "[class]", "[width_css]"), array($id, $class, $width_css), $text);
482
+
483
+	echo $text;
484 484
 }
485 485
 
486 486
 // action for adding the primary div closing tag
@@ -494,13 +494,13 @@  discard block
 block discarded – undo
494 494
  */
495 495
 function geodir_action_wrapper_content_close($type = '')
496 496
 {
497
-    $tc = get_option('theme_compatibility_setting');
498
-    if (!empty($tc['geodir_wrapper_content_close_replace'])) {
499
-        $text = $tc['geodir_wrapper_content_close_replace'];
500
-    } else {
501
-        $text = '</div><!-- content ends here-->';
502
-    }
503
-    echo $text;
497
+	$tc = get_option('theme_compatibility_setting');
498
+	if (!empty($tc['geodir_wrapper_content_close_replace'])) {
499
+		$text = $tc['geodir_wrapper_content_close_replace'];
500
+	} else {
501
+		$text = '</div><!-- content ends here-->';
502
+	}
503
+	echo $text;
504 504
 }
505 505
 
506 506
 // action for adding the <article> opening tag
@@ -518,24 +518,24 @@  discard block
 block discarded – undo
518 518
  */
519 519
 function geodir_action_article_open($type = '', $id = '', $class = '', $itemtype = '')
520 520
 {
521
-    $class = implode(" ", $class);
522
-    $tc = get_option('theme_compatibility_setting');
523
-    if (!empty($tc['geodir_article_open_replace'])) {
524
-        $text = $tc['geodir_article_open_replace'];
525
-    } else {
526
-        $text = '<article  id="[id]" class="[class]" >';
527
-    }
521
+	$class = implode(" ", $class);
522
+	$tc = get_option('theme_compatibility_setting');
523
+	if (!empty($tc['geodir_article_open_replace'])) {
524
+		$text = $tc['geodir_article_open_replace'];
525
+	} else {
526
+		$text = '<article  id="[id]" class="[class]" >';
527
+	}
528 528
 
529
-    if (!empty($tc['geodir_article_open_id'])) {
530
-        $id = $tc['geodir_article_open_id'];
531
-    }
532
-    if (!empty($tc['geodir_article_open_class'])) {
533
-        $class = $tc['geodir_article_open_class'];
534
-    }
529
+	if (!empty($tc['geodir_article_open_id'])) {
530
+		$id = $tc['geodir_article_open_id'];
531
+	}
532
+	if (!empty($tc['geodir_article_open_class'])) {
533
+		$class = $tc['geodir_article_open_class'];
534
+	}
535 535
 
536
-    $text = str_replace(array("[id]", "[class]", "[itemtype]"), array($id, $class, $itemtype), $text);
536
+	$text = str_replace(array("[id]", "[class]", "[itemtype]"), array($id, $class, $itemtype), $text);
537 537
 
538
-    echo $text;
538
+	echo $text;
539 539
 }
540 540
 
541 541
 // action for adding the primary div closing tag
@@ -549,13 +549,13 @@  discard block
 block discarded – undo
549 549
  */
550 550
 function geodir_action_article_close($type = '')
551 551
 {
552
-    $tc = get_option('theme_compatibility_setting');
553
-    if (!empty($tc['geodir_article_close_replace'])) {
554
-        $text = $tc['geodir_article_close_replace'];
555
-    } else {
556
-        $text = '</article><!-- article ends here-->';
557
-    }
558
-    echo $text;
552
+	$tc = get_option('theme_compatibility_setting');
553
+	if (!empty($tc['geodir_article_close_replace'])) {
554
+		$text = $tc['geodir_article_close_replace'];
555
+	} else {
556
+		$text = '</article><!-- article ends here-->';
557
+	}
558
+	echo $text;
559 559
 }
560 560
 
561 561
 // action for adding the sidebar opening tag
@@ -572,35 +572,35 @@  discard block
 block discarded – undo
572 572
  */
573 573
 function geodir_action_sidebar_right_open($type = '', $id = '', $class = '', $itemtype = '')
574 574
 {
575
-    if ($type == 'home-page' && $width = get_option('geodir_width_home_right_section')) {
576
-        $width_css = 'style="width:' . $width . '%;"';
577
-    } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_right_section')) {
578
-        $width_css = 'style="width:' . $width . '%;"';
579
-    } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_right_section')) {
580
-        $width_css = 'style="width:' . $width . '%;"';
581
-    } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_right_section')) {
582
-        $width_css = 'style="width:' . $width . '%;"';
583
-    } else {
584
-        $width_css = '';
585
-    }
586
-
587
-    $tc = get_option('theme_compatibility_setting');
588
-    if (!empty($tc['geodir_sidebar_right_open_replace'])) {
589
-        $text = $tc['geodir_sidebar_right_open_replace'];
590
-    } else {
591
-        $text = '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>';
592
-    }
593
-
594
-    if (!empty($tc['geodir_sidebar_right_open_id'])) {
595
-        $id = $tc['geodir_sidebar_right_open_id'];
596
-    }
597
-    if (!empty($tc['geodir_sidebar_right_open_class'])) {
598
-        $class = $tc['geodir_sidebar_right_open_class'];
599
-    }
600
-
601
-    $text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
602
-
603
-    echo $text;
575
+	if ($type == 'home-page' && $width = get_option('geodir_width_home_right_section')) {
576
+		$width_css = 'style="width:' . $width . '%;"';
577
+	} elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_right_section')) {
578
+		$width_css = 'style="width:' . $width . '%;"';
579
+	} elseif ($type == 'search-page' && $width = get_option('geodir_width_search_right_section')) {
580
+		$width_css = 'style="width:' . $width . '%;"';
581
+	} elseif ($type == 'author-page' && $width = get_option('geodir_width_author_right_section')) {
582
+		$width_css = 'style="width:' . $width . '%;"';
583
+	} else {
584
+		$width_css = '';
585
+	}
586
+
587
+	$tc = get_option('theme_compatibility_setting');
588
+	if (!empty($tc['geodir_sidebar_right_open_replace'])) {
589
+		$text = $tc['geodir_sidebar_right_open_replace'];
590
+	} else {
591
+		$text = '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>';
592
+	}
593
+
594
+	if (!empty($tc['geodir_sidebar_right_open_id'])) {
595
+		$id = $tc['geodir_sidebar_right_open_id'];
596
+	}
597
+	if (!empty($tc['geodir_sidebar_right_open_class'])) {
598
+		$class = $tc['geodir_sidebar_right_open_class'];
599
+	}
600
+
601
+	$text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
602
+
603
+	echo $text;
604 604
 }
605 605
 
606 606
 // action for adding the primary div closing tag
@@ -614,13 +614,13 @@  discard block
 block discarded – undo
614 614
  */
615 615
 function geodir_action_sidebar_right_close($type = '')
616 616
 {
617
-    $tc = get_option('theme_compatibility_setting');
618
-    if (!empty($tc['geodir_sidebar_right_close_replace'])) {
619
-        $text = $tc['geodir_sidebar_right_close_replace'];
620
-    } else {
621
-        $text = '</aside><!-- sidebar ends here-->';
622
-    }
623
-    echo $text;
617
+	$tc = get_option('theme_compatibility_setting');
618
+	if (!empty($tc['geodir_sidebar_right_close_replace'])) {
619
+		$text = $tc['geodir_sidebar_right_close_replace'];
620
+	} else {
621
+		$text = '</aside><!-- sidebar ends here-->';
622
+	}
623
+	echo $text;
624 624
 }
625 625
 
626 626
 
@@ -641,121 +641,121 @@  discard block
 block discarded – undo
641 641
  */
642 642
 function geodir_action_geodir_set_preview_post()
643 643
 {
644
-    global $post, $preview, $gd_session;
645
-    $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
646
-    if (!$preview || $is_backend_preview) {
647
-        return;
648
-    }// bail if not previewing
649
-
650
-    $listing_type = isset($_REQUEST['listing_type']) ? sanitize_text_field($_REQUEST['listing_type']) : '';
651
-
652
-    $fields_info = geodir_get_custom_fields_type($listing_type);
653
-
654
-    foreach ($_REQUEST as $pkey => $pval) {
655
-        if ($pkey == 'geodir_video') {
656
-            $tags = '<iframe>';
657
-        } else if ($pkey == 'post_desc') {
658
-            $tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>';
659
-        } else if (is_array($fields_info) && isset($fields_info[$pkey]) && ($fields_info[$pkey] == 'textarea' || $fields_info[$pkey] == 'html')) {
660
-            $tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>';
661
-        } else if (is_array($_REQUEST[$pkey])) {
662
-            $tags = 'skip_field';
663
-        } else {
664
-            $tags = '';
665
-        }
666
-        /**
667
-         * Allows the filtering of the allowed HTML tags per field when submitting from frontend add listing page.
668
-         *
669
-         * @since 1.0.0
670
-         * @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>'.
671
-         * @param string|array $pkey The field id/name. If array then value is set as "skip_field".
672
-         */
673
-        $tags = apply_filters('geodir_save_post_key', $tags, $pkey);
674
-
675
-        if ($tags != 'skip_field') {
676
-            $_REQUEST[$pkey] = strip_tags($_REQUEST[$pkey], $tags);
677
-        }
678
-    }
679
-
680
-    $post = (object)$_REQUEST;
681
-
682
-
683
-    if (isset($post->video)) {
684
-        $post->video = stripslashes($post->video);
685
-    }
686
-
687
-    if (isset($post->Video2)) {
688
-        $post->Video2 = stripslashes($post->Video2);
689
-    }
690
-
691
-    $post_type = $post->listing_type;
692
-    $post_type_info = get_post_type_object($post_type);
693
-
694
-    $listing_label = $post_type_info->labels->singular_name;
695
-
696
-    $term_icon = '';
697
-
698
-    if (!empty($post->post_category)) {
699
-        foreach ($post->post_category as $post_taxonomy => $post_term) {
700
-
701
-            if ($post_term != '' && !is_array($post_term)) {
702
-                $post_term = explode(',', trim($post_term, ','));
703
-            }
644
+	global $post, $preview, $gd_session;
645
+	$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
646
+	if (!$preview || $is_backend_preview) {
647
+		return;
648
+	}// bail if not previewing
649
+
650
+	$listing_type = isset($_REQUEST['listing_type']) ? sanitize_text_field($_REQUEST['listing_type']) : '';
651
+
652
+	$fields_info = geodir_get_custom_fields_type($listing_type);
653
+
654
+	foreach ($_REQUEST as $pkey => $pval) {
655
+		if ($pkey == 'geodir_video') {
656
+			$tags = '<iframe>';
657
+		} else if ($pkey == 'post_desc') {
658
+			$tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>';
659
+		} else if (is_array($fields_info) && isset($fields_info[$pkey]) && ($fields_info[$pkey] == 'textarea' || $fields_info[$pkey] == 'html')) {
660
+			$tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>';
661
+		} else if (is_array($_REQUEST[$pkey])) {
662
+			$tags = 'skip_field';
663
+		} else {
664
+			$tags = '';
665
+		}
666
+		/**
667
+		 * Allows the filtering of the allowed HTML tags per field when submitting from frontend add listing page.
668
+		 *
669
+		 * @since 1.0.0
670
+		 * @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>'.
671
+		 * @param string|array $pkey The field id/name. If array then value is set as "skip_field".
672
+		 */
673
+		$tags = apply_filters('geodir_save_post_key', $tags, $pkey);
674
+
675
+		if ($tags != 'skip_field') {
676
+			$_REQUEST[$pkey] = strip_tags($_REQUEST[$pkey], $tags);
677
+		}
678
+	}
679
+
680
+	$post = (object)$_REQUEST;
681
+
682
+
683
+	if (isset($post->video)) {
684
+		$post->video = stripslashes($post->video);
685
+	}
686
+
687
+	if (isset($post->Video2)) {
688
+		$post->Video2 = stripslashes($post->Video2);
689
+	}
690
+
691
+	$post_type = $post->listing_type;
692
+	$post_type_info = get_post_type_object($post_type);
693
+
694
+	$listing_label = $post_type_info->labels->singular_name;
695
+
696
+	$term_icon = '';
697
+
698
+	if (!empty($post->post_category)) {
699
+		foreach ($post->post_category as $post_taxonomy => $post_term) {
700
+
701
+			if ($post_term != '' && !is_array($post_term)) {
702
+				$post_term = explode(',', trim($post_term, ','));
703
+			}
704 704
 
705
-            if (is_array($post_term)) {
706
-                $post_term = array_unique($post_term);
707
-            }
705
+			if (is_array($post_term)) {
706
+				$post_term = array_unique($post_term);
707
+			}
708 708
 
709
-            if (!empty($post_term)) {
710
-                foreach ($post_term as $cat_id) {
711
-                    $cat_id = trim($cat_id);
712
-
713
-                    if ($cat_id != '') {
714
-                        $term_icon = get_option('geodir_default_marker_icon');
715
-
716
-                        if (isset($post->post_default_category) && $post->post_default_category == $cat_id) {
717
-                            if ($term_icon_url = get_tax_meta($cat_id, 'ct_cat_icon', false, $post_type)) {
718
-                                if (isset($term_icon_url['src']) && $term_icon_url['src'] != '')
719
-                                    $term_icon = $term_icon_url['src'];
720
-                                break;
721
-                            }
722
-                        }
723
-                    }
724
-                }
725
-            }
726
-        }
727
-    }
709
+			if (!empty($post_term)) {
710
+				foreach ($post_term as $cat_id) {
711
+					$cat_id = trim($cat_id);
712
+
713
+					if ($cat_id != '') {
714
+						$term_icon = get_option('geodir_default_marker_icon');
715
+
716
+						if (isset($post->post_default_category) && $post->post_default_category == $cat_id) {
717
+							if ($term_icon_url = get_tax_meta($cat_id, 'ct_cat_icon', false, $post_type)) {
718
+								if (isset($term_icon_url['src']) && $term_icon_url['src'] != '')
719
+									$term_icon = $term_icon_url['src'];
720
+								break;
721
+							}
722
+						}
723
+					}
724
+				}
725
+			}
726
+		}
727
+	}
728 728
 
729
-    $post_latitude = isset($post->post_latitude) ? $post->post_latitude : '';
730
-    $post_longitude = isset($post->post_longitude) ? $post->post_longitude : '';
729
+	$post_latitude = isset($post->post_latitude) ? $post->post_latitude : '';
730
+	$post_longitude = isset($post->post_longitude) ? $post->post_longitude : '';
731 731
 
732
-    $srcharr = array("'", "/", "-", '"', '\\');
733
-    $replarr = array("&prime;", "&frasl;", "&ndash;", "&ldquo;", '');
732
+	$srcharr = array("'", "/", "-", '"', '\\');
733
+	$replarr = array("&prime;", "&frasl;", "&ndash;", "&ldquo;", '');
734 734
 
735
-    $json_title = str_replace($srcharr, $replarr, $post->post_title);
735
+	$json_title = str_replace($srcharr, $replarr, $post->post_title);
736 736
 
737
-    $json = '{';
738
-    $json .= '"post_preview": "1",';
739
-    $json .= '"t": "' . $json_title . '",';
740
-    $json .= '"lt": "' . $post_latitude . '",';
741
-    $json .= '"ln": "' . $post_longitude . '",';
742
-    $json .= '"i":"' . $term_icon . '"';
743
-    $json .= '}';
737
+	$json = '{';
738
+	$json .= '"post_preview": "1",';
739
+	$json .= '"t": "' . $json_title . '",';
740
+	$json .= '"lt": "' . $post_latitude . '",';
741
+	$json .= '"ln": "' . $post_longitude . '",';
742
+	$json .= '"i":"' . $term_icon . '"';
743
+	$json .= '}';
744 744
 
745
-    $post->marker_json = $json;
745
+	$post->marker_json = $json;
746 746
 
747
-    $gd_session->set('listing', $_REQUEST);
747
+	$gd_session->set('listing', $_REQUEST);
748 748
 
749
-    // we need to define a few things to trick the setup_postdata
750
-    if (!isset($post->ID)) {
751
-        $post->ID = '';
752
-        $post->post_author = '';
753
-        $post->post_date = '';
754
-        $post->post_content = '';
755
-        $post->default_category = '';
756
-        $post->post_type = '';
757
-    }
758
-    setup_postdata($post);
749
+	// we need to define a few things to trick the setup_postdata
750
+	if (!isset($post->ID)) {
751
+		$post->ID = '';
752
+		$post->post_author = '';
753
+		$post->post_date = '';
754
+		$post->post_content = '';
755
+		$post->default_category = '';
756
+		$post->post_type = '';
757
+	}
758
+	setup_postdata($post);
759 759
 }
760 760
 
761 761
 /**
@@ -767,15 +767,15 @@  discard block
 block discarded – undo
767 767
  */
768 768
 function geodir_action_geodir_preview_code()
769 769
 {
770
-    global $preview;
770
+	global $preview;
771 771
 
772
-    $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
+	$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
773 773
 
774
-    if (!$preview || $is_backend_preview) {
775
-        return;
776
-    }// bail if not previewing
774
+	if (!$preview || $is_backend_preview) {
775
+		return;
776
+	}// bail if not previewing
777 777
 
778
-    geodir_get_template_part('preview', 'buttons');
778
+	geodir_get_template_part('preview', 'buttons');
779 779
 }
780 780
 
781 781
 // action for adding the details page top widget area
@@ -791,20 +791,20 @@  discard block
 block discarded – undo
791 791
  */
792 792
 function geodir_action_geodir_sidebar_detail_top($class = '')
793 793
 {
794
-    if (get_option('geodir_show_detail_top_section')) { ?>
794
+	if (get_option('geodir_show_detail_top_section')) { ?>
795 795
         <div
796 796
             class="<?php
797
-            /**
798
-             * Filter the div class for the wrapper of the full width widget areas.
799
-             *
800
-             * 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.
801
-             *
802
-             * @since 1.0.0
803
-             * @param string $class The class of the div.
804
-             * @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',
805
-             *               'geodir_author_top','geodir_author_bottom', 'geodir_search_top', 'geodir_search_bottom', 'geodir_home_top' or 'geodir_home_bottom'.
806
-             */
807
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_top'); ?> <?php echo $class; ?>">
797
+			/**
798
+			 * Filter the div class for the wrapper of the full width widget areas.
799
+			 *
800
+			 * 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.
801
+			 *
802
+			 * @since 1.0.0
803
+			 * @param string $class The class of the div.
804
+			 * @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',
805
+			 *               'geodir_author_top','geodir_author_bottom', 'geodir_search_top', 'geodir_search_bottom', 'geodir_home_top' or 'geodir_home_bottom'.
806
+			 */
807
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_top'); ?> <?php echo $class; ?>">
808 808
             <?php dynamic_sidebar('geodir_detail_top'); ?>
809 809
         </div>
810 810
     <?php }
@@ -828,11 +828,11 @@  discard block
 block discarded – undo
828 828
  */
829 829
 function geodir_action_geodir_sidebar_detail_bottom_section($class = '')
830 830
 {
831
-    if (get_option('geodir_show_detail_bottom_section')) { ?>
831
+	if (get_option('geodir_show_detail_bottom_section')) { ?>
832 832
         <div
833 833
             class="<?php
834
-            /** This action is documented in geodirectory_template_actions.php */
835
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_bottom'); ?> <?php echo $class; ?>">
834
+			/** This action is documented in geodirectory_template_actions.php */
835
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_bottom'); ?> <?php echo $class; ?>">
836 836
             <?php dynamic_sidebar('geodir_detail_bottom'); ?>
837 837
         </div><!-- clearfix ends here-->
838 838
     <?php }
@@ -846,7 +846,7 @@  discard block
 block discarded – undo
846 846
  */
847 847
 function geodir_details_sidebar_widget_area()
848 848
 {
849
-    dynamic_sidebar('geodir_detail_sidebar');
849
+	dynamic_sidebar('geodir_detail_sidebar');
850 850
 }
851 851
 
852 852
 /**
@@ -857,12 +857,12 @@  discard block
 block discarded – undo
857 857
  */
858 858
 function geodir_details_sidebar_place_details()
859 859
 {
860
-    /**
861
-     * Used to add items to the details page sidebar.
862
-     *
863
-     * @since 1.0.0
864
-     */
865
-    do_action('geodir_detail_page_sidebar');
860
+	/**
861
+	 * Used to add items to the details page sidebar.
862
+	 *
863
+	 * @since 1.0.0
864
+	 */
865
+	do_action('geodir_detail_page_sidebar');
866 866
 }
867 867
 
868 868
 add_action('geodir_detail_sidebar_inside', 'geodir_details_sidebar_place_details', 10);
@@ -877,68 +877,68 @@  discard block
 block discarded – undo
877 877
  */
878 878
 function geodir_action_details_sidebar()
879 879
 {
880
-    // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
881
-    if (get_option('geodir_detail_sidebar_left_section')) {
882
-        /**
883
-         * Called before the details page left sidebar is opened.
884
-         *
885
-         * This is used to add opening wrapper HTML to the details page left sidebar.
886
-         *
887
-         * @since 1.0.0
888
-         * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
889
-         * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-left'.
890
-         * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-left geodir-details-sidebar-left'.
891
-         * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'.
892
-         */
893
-        do_action('geodir_sidebar_left_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-left geodir-details-sidebar-left', 'https://schema.org/WPSideBar');
894
-        ?>
880
+	// this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
881
+	if (get_option('geodir_detail_sidebar_left_section')) {
882
+		/**
883
+		 * Called before the details page left sidebar is opened.
884
+		 *
885
+		 * This is used to add opening wrapper HTML to the details page left sidebar.
886
+		 *
887
+		 * @since 1.0.0
888
+		 * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
889
+		 * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-left'.
890
+		 * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-left geodir-details-sidebar-left'.
891
+		 * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'.
892
+		 */
893
+		do_action('geodir_sidebar_left_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-left geodir-details-sidebar-left', 'https://schema.org/WPSideBar');
894
+		?>
895 895
         <div class="geodir-content-left geodir-sidebar-wrap"><?php
896
-        /**
897
-         * Called inside the HTML wrapper of the details sidebar for either the left and right sidebar.
898
-         *
899
-         * This is used to add all info to the details page sidebars.
900
-         *
901
-         * @since 1.0.0
902
-         */
903
-        do_action('geodir_detail_sidebar_inside');
904
-        ?></div><!-- end geodir-content-left --><?php
905
-        /**
906
-         * Called after the details page left sidebar.
907
-         *
908
-         * This is used to add closing wrapper HTML to the details page left sidebar.
909
-         *
910
-         * @since 1.0.0
911
-         * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
912
-         */
913
-        do_action('geodir_sidebar_left_close', 'details-page');
914
-    } else {
915
-        /**
916
-         * Called before the details page right sidebar is opened.
917
-         *
918
-         * This is used to add opening wrapper HTML to the details page right sidebar.
919
-         *
920
-         * @since 1.0.0
921
-         * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'add-listing-page', 'author-page', 'search-page' or 'home-page'.
922
-         * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-right'.
923
-         * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-right geodir-details-sidebar-right'.
924
-         * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'.
925
-         */
926
-        do_action('geodir_sidebar_right_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-right geodir-details-sidebar-right', 'http://schema.org/WPSideBar');
927
-        ?>
896
+		/**
897
+		 * Called inside the HTML wrapper of the details sidebar for either the left and right sidebar.
898
+		 *
899
+		 * This is used to add all info to the details page sidebars.
900
+		 *
901
+		 * @since 1.0.0
902
+		 */
903
+		do_action('geodir_detail_sidebar_inside');
904
+		?></div><!-- end geodir-content-left --><?php
905
+		/**
906
+		 * Called after the details page left sidebar.
907
+		 *
908
+		 * This is used to add closing wrapper HTML to the details page left sidebar.
909
+		 *
910
+		 * @since 1.0.0
911
+		 * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
912
+		 */
913
+		do_action('geodir_sidebar_left_close', 'details-page');
914
+	} else {
915
+		/**
916
+		 * Called before the details page right sidebar is opened.
917
+		 *
918
+		 * This is used to add opening wrapper HTML to the details page right sidebar.
919
+		 *
920
+		 * @since 1.0.0
921
+		 * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'add-listing-page', 'author-page', 'search-page' or 'home-page'.
922
+		 * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-right'.
923
+		 * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-right geodir-details-sidebar-right'.
924
+		 * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'.
925
+		 */
926
+		do_action('geodir_sidebar_right_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-right geodir-details-sidebar-right', 'http://schema.org/WPSideBar');
927
+		?>
928 928
         <div class="geodir-content-right geodir-sidebar-wrap"><?php
929
-        /** This action is documented in geodirectory_template_actions.php */
930
-        do_action('geodir_detail_sidebar_inside');
931
-        ?></div><!-- end geodir-content-right --><?php
932
-        /**
933
-         * Called after the details page right sidebar.
934
-         *
935
-         * This is used to add closing wrapper HTML to the details page right sidebar.
936
-         *
937
-         * @since 1.0.0
938
-         * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
939
-         */
940
-        do_action('geodir_sidebar_right_close', 'details-page');
941
-    }
929
+		/** This action is documented in geodirectory_template_actions.php */
930
+		do_action('geodir_detail_sidebar_inside');
931
+		?></div><!-- end geodir-content-right --><?php
932
+		/**
933
+		 * Called after the details page right sidebar.
934
+		 *
935
+		 * This is used to add closing wrapper HTML to the details page right sidebar.
936
+		 *
937
+		 * @since 1.0.0
938
+		 * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
939
+		 */
940
+		do_action('geodir_sidebar_right_close', 'details-page');
941
+	}
942 942
 }
943 943
 
944 944
 add_action('geodir_page_title', 'geodir_action_page_title', 10);
@@ -952,21 +952,21 @@  discard block
 block discarded – undo
952 952
  */
953 953
 function geodir_action_page_title()
954 954
 {
955
-    /**
956
-     * Filter the page title HTML h1 class.
957
-     *
958
-     * @since 1.0.0
959
-     * @param string $class The class to use. Default is 'entry-title fn'.
960
-     */
961
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
962
-    /**
963
-     * Filter the page title HTML header wrapper class.
964
-     *
965
-     * @since 1.0.0
966
-     * @param string $class The class to use. Default is 'entry-header'.
967
-     */
968
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
969
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . stripslashes(get_the_title()) . '</h1></header>';
955
+	/**
956
+	 * Filter the page title HTML h1 class.
957
+	 *
958
+	 * @since 1.0.0
959
+	 * @param string $class The class to use. Default is 'entry-title fn'.
960
+	 */
961
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
962
+	/**
963
+	 * Filter the page title HTML header wrapper class.
964
+	 *
965
+	 * @since 1.0.0
966
+	 * @param string $class The class to use. Default is 'entry-header'.
967
+	 */
968
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
969
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . stripslashes(get_the_title()) . '</h1></header>';
970 970
 }
971 971
 
972 972
 
@@ -983,87 +983,87 @@  discard block
 block discarded – undo
983 983
  */
984 984
 function geodir_action_details_slider()
985 985
 {
986
-    global $preview, $post;
986
+	global $preview, $post;
987 987
 
988
-    $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // preview from backend
988
+	$is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // preview from backend
989 989
 
990
-    if ($is_backend_preview && !empty($post) && !empty($post->ID) && !isset($post->post_images)) {
991
-        $preview_get_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
990
+	if ($is_backend_preview && !empty($post) && !empty($post->ID) && !isset($post->post_images)) {
991
+		$preview_get_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
992 992
 
993
-        $preview_post_images = array();
994
-        if ($preview_get_images) {
995
-            foreach ($preview_get_images as $row) {
996
-                $preview_post_images[] = $row->src;
997
-            }
998
-        }
999
-        if (!empty($preview_post_images)) {
1000
-            $post->post_images = implode(',', $preview_post_images);
1001
-        }
1002
-    }
1003
-
1004
-    if ($preview) {
1005
-        $post_images = array();
1006
-        if (isset($post->post_images) && !empty($post->post_images)) {
1007
-            $post->post_images = trim($post->post_images, ",");
1008
-            $post_images = explode(",", $post->post_images);
1009
-        }
1010
-
1011
-        $main_slides = '';
1012
-        $nav_slides = '';
1013
-        $slides = 0;
1014
-
1015
-        if (!empty($post_images)) {
1016
-            foreach ($post_images as $image) {
1017
-                if (!empty($image)) {
1018
-                    $sizes = getimagesize(trim($image));
1019
-                    $width = !empty($sizes) && isset($sizes[0]) ? $sizes[0] : 0;
1020
-                    $height = !empty($sizes) && isset($sizes[1]) ? $sizes[1] : 0;
1021
-
1022
-                    if ($image && $width && $height) {
1023
-                        $image = (object)array('src' => $image, 'width' => $width, 'height' => $height);
1024
-                    }
1025
-
1026
-                    if (isset($image->src)) {
1027
-                        if ($image->height >= 400) {
1028
-                            $spacer_height = 0;
1029
-                        } else {
1030
-                            $spacer_height = ((400 - $image->height) / 2);
1031
-                        }
1032
-
1033
-                        $image_title = isset($image->title) ? $image->title : '';
1034
-
1035
-                        $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;" />';
1036
-                        $main_slides .= '<img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:400px;margin:0 auto;" /></li>';
1037
-                        $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:48px;margin:0 auto;" /></li>';
1038
-                        $slides++;
1039
-                    }
1040
-                }
1041
-            }// endfore
1042
-        } //end if
1043
-    } else {
1044
-        $main_slides = '';
1045
-        $nav_slides = '';
1046
-        $post_images = geodir_get_images($post->ID, 'thumbnail', false); // Hide default image on listing preview/detail page.
1047
-        $slides = 0;
1048
-
1049
-        if (!empty($post_images)) {
1050
-            foreach ($post_images as $image) {
1051
-                if ($image->height >= 400) {
1052
-                    $spacer_height = 0;
1053
-                } else {
1054
-                    $spacer_height = ((400 - $image->height) / 2);
1055
-                }
1056
-                $caption = '';//(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : '';
1057
-                $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;" />';
1058
-                $main_slides .= '<img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>';
1059
-                $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:48px;margin:0 auto;" /></li>';
1060
-                $slides++;
1061
-            }
1062
-        }// endfore
1063
-    }
993
+		$preview_post_images = array();
994
+		if ($preview_get_images) {
995
+			foreach ($preview_get_images as $row) {
996
+				$preview_post_images[] = $row->src;
997
+			}
998
+		}
999
+		if (!empty($preview_post_images)) {
1000
+			$post->post_images = implode(',', $preview_post_images);
1001
+		}
1002
+	}
1003
+
1004
+	if ($preview) {
1005
+		$post_images = array();
1006
+		if (isset($post->post_images) && !empty($post->post_images)) {
1007
+			$post->post_images = trim($post->post_images, ",");
1008
+			$post_images = explode(",", $post->post_images);
1009
+		}
1010
+
1011
+		$main_slides = '';
1012
+		$nav_slides = '';
1013
+		$slides = 0;
1014
+
1015
+		if (!empty($post_images)) {
1016
+			foreach ($post_images as $image) {
1017
+				if (!empty($image)) {
1018
+					$sizes = getimagesize(trim($image));
1019
+					$width = !empty($sizes) && isset($sizes[0]) ? $sizes[0] : 0;
1020
+					$height = !empty($sizes) && isset($sizes[1]) ? $sizes[1] : 0;
1021
+
1022
+					if ($image && $width && $height) {
1023
+						$image = (object)array('src' => $image, 'width' => $width, 'height' => $height);
1024
+					}
1025
+
1026
+					if (isset($image->src)) {
1027
+						if ($image->height >= 400) {
1028
+							$spacer_height = 0;
1029
+						} else {
1030
+							$spacer_height = ((400 - $image->height) / 2);
1031
+						}
1032
+
1033
+						$image_title = isset($image->title) ? $image->title : '';
1034
+
1035
+						$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;" />';
1036
+						$main_slides .= '<img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:400px;margin:0 auto;" /></li>';
1037
+						$nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:48px;margin:0 auto;" /></li>';
1038
+						$slides++;
1039
+					}
1040
+				}
1041
+			}// endfore
1042
+		} //end if
1043
+	} else {
1044
+		$main_slides = '';
1045
+		$nav_slides = '';
1046
+		$post_images = geodir_get_images($post->ID, 'thumbnail', false); // Hide default image on listing preview/detail page.
1047
+		$slides = 0;
1048
+
1049
+		if (!empty($post_images)) {
1050
+			foreach ($post_images as $image) {
1051
+				if ($image->height >= 400) {
1052
+					$spacer_height = 0;
1053
+				} else {
1054
+					$spacer_height = ((400 - $image->height) / 2);
1055
+				}
1056
+				$caption = '';//(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : '';
1057
+				$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;" />';
1058
+				$main_slides .= '<img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>';
1059
+				$nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:48px;margin:0 auto;" /></li>';
1060
+				$slides++;
1061
+			}
1062
+		}// endfore
1063
+	}
1064 1064
 
1065
-    if (!empty($post_images)) {
1066
-        ?>
1065
+	if (!empty($post_images)) {
1066
+		?>
1067 1067
         <div class="geodir_flex-container">
1068 1068
             <div class="geodir_flex-loader"><i class="fa fa-refresh fa-spin"></i></div>
1069 1069
             <div id="geodir_slider" class="geodir_flexslider ">
@@ -1076,7 +1076,7 @@  discard block
 block discarded – undo
1076 1076
             <?php } ?>
1077 1077
         </div>
1078 1078
     <?php
1079
-    }
1079
+	}
1080 1080
 }
1081 1081
 
1082 1082
 add_action('geodir_details_taxonomies', 'geodir_action_details_taxonomies', 10);
@@ -1091,177 +1091,177 @@  discard block
 block discarded – undo
1091 1091
  */
1092 1092
 function geodir_action_details_taxonomies()
1093 1093
 {
1094
-    global $preview, $post;?>
1094
+	global $preview, $post;?>
1095 1095
     <p class="geodir_post_taxomomies clearfix">
1096 1096
     <?php
1097
-    $taxonomies = array();
1098
-
1099
-    $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
1100
-
1101
-    if ($preview && !$is_backend_preview) {
1102
-        $post_type = $post->listing_type;
1103
-        $post_taxonomy = $post_type . 'category';
1104
-        $post->{$post_taxonomy} = $post->post_category[$post_taxonomy];
1105
-    } else {
1106
-        $post_type = $post->post_type;
1107
-        $post_taxonomy = $post_type . 'category';
1108
-    }
1097
+	$taxonomies = array();
1098
+
1099
+	$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
1100
+
1101
+	if ($preview && !$is_backend_preview) {
1102
+		$post_type = $post->listing_type;
1103
+		$post_taxonomy = $post_type . 'category';
1104
+		$post->{$post_taxonomy} = $post->post_category[$post_taxonomy];
1105
+	} else {
1106
+		$post_type = $post->post_type;
1107
+		$post_taxonomy = $post_type . 'category';
1108
+	}
1109 1109
 //{	
1110
-    $post_type_info = get_post_type_object($post_type);
1111
-    $listing_label = __($post_type_info->labels->singular_name, 'geodirectory');
1112
-
1113
-    if (!empty($post->post_tags)) {
1114
-
1115
-        if (taxonomy_exists($post_type . '_tags')):
1116
-            $links = array();
1117
-            $terms = array();
1118
-            // to limit post tags
1119
-            $post_tags = trim($post->post_tags, ",");
1120
-            $post_id = isset($post->ID) ? $post->ID : '';
1121
-            /**
1122
-             * Filter the post tags.
1123
-             *
1124
-             * Allows you to filter the post tags output on the details page of a post.
1125
-             *
1126
-             * @since 1.0.0
1127
-             * @param string $post_tags A comma seperated list of tags.
1128
-             * @param int $post_id The current post id.
1129
-             */
1130
-            $post_tags = apply_filters('geodir_action_details_post_tags', $post_tags, $post_id);
1131
-
1132
-            $post->post_tags = $post_tags;
1133
-            $post_tags = explode(",", trim($post->post_tags, ","));
1134
-
1135
-
1136
-            foreach ($post_tags as $post_term) {
1137
-
1138
-                // fix slug creation order for tags & location
1139
-                $post_term = trim($post_term);
1140
-
1141
-                $priority_location = false;
1142
-                if ($insert_term = term_exists($post_term, $post_type . '_tags')) {
1143
-                    $term = get_term_by('id', $insert_term['term_id'], $post_type . '_tags');
1144
-                } else {
1145
-                    $post_country = isset($_REQUEST['post_country']) && $_REQUEST['post_country'] != '' ? sanitize_text_field($_REQUEST['post_country']) : NULL;
1146
-                    $post_region = isset($_REQUEST['post_region']) && $_REQUEST['post_region'] != '' ? sanitize_text_field($_REQUEST['post_region']) : NULL;
1147
-                    $post_city = isset($_REQUEST['post_city']) && $_REQUEST['post_city'] != '' ? sanitize_text_field($_REQUEST['post_city']) : NULL;
1148
-                    $match_country = $post_country && sanitize_title($post_term) == sanitize_title($post_country) ? true : false;
1149
-                    $match_region = $post_region && sanitize_title($post_term) == sanitize_title($post_region) ? true : false;
1150
-                    $match_city = $post_city && sanitize_title($post_term) == sanitize_title($post_city) ? true : false;
1151
-                    if ($match_country || $match_region || $match_city) {
1152
-                        $priority_location = true;
1153
-                        $term = get_term_by('name', $post_term, $post_type . '_tags');
1154
-                    } else {
1155
-                        $insert_term = wp_insert_term($post_term, $post_type . '_tags');
1156
-                        $term = get_term_by('name', $post_term, $post_type . '_tags');
1157
-                    }
1158
-                }
1159
-
1160
-                if (!is_wp_error($term) && is_object($term)) {
1161
-
1162
-                    // fix tag link on detail page
1163
-                    if ($priority_location) {
1164
-
1165
-                        $tag_link = "<a href=''>$post_term</a>";
1166
-                        /**
1167
-                         * Filter the tag name on the details page.
1168
-                         *
1169
-                         * @since 1.5.6
1170
-                         * @param string $tag_link The tag link html.
1171
-                         * @param object $term The tag term object.
1172
-                         */
1173
-                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1174
-                        $links[] = $tag_link;
1175
-                    } else {
1176
-                        $tag_link = "<a href='" . esc_attr(get_term_link($term->term_id, $term->taxonomy)) . "'>$term->name</a>";
1177
-                        /** This action is documented in geodirectory-template_actions.php */
1178
-                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1179
-                        $links[] = $tag_link;
1180
-                    }
1181
-                    $terms[] = $term;
1182
-                }
1183
-                //
1184
-            }
1185
-            if (!isset($listing_label)) {
1186
-                $listing_label = '';
1187
-            }
1188
-            $taxonomies[$post_type . '_tags'] = wp_sprintf(__('%s Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1189
-        endif;
1190
-
1191
-    }
1192
-
1193
-    if (!empty($post->{$post_taxonomy})) {
1194
-        $links = array();
1195
-        $terms = array();
1196
-        $termsOrdered = array();
1197
-        if (!is_array($post->{$post_taxonomy})) {
1198
-            $post_term = explode(",", trim($post->{$post_taxonomy}, ","));
1199
-        } else {
1200
-            $post_term = $post->{$post_taxonomy};
1110
+	$post_type_info = get_post_type_object($post_type);
1111
+	$listing_label = __($post_type_info->labels->singular_name, 'geodirectory');
1112
+
1113
+	if (!empty($post->post_tags)) {
1114
+
1115
+		if (taxonomy_exists($post_type . '_tags')):
1116
+			$links = array();
1117
+			$terms = array();
1118
+			// to limit post tags
1119
+			$post_tags = trim($post->post_tags, ",");
1120
+			$post_id = isset($post->ID) ? $post->ID : '';
1121
+			/**
1122
+			 * Filter the post tags.
1123
+			 *
1124
+			 * Allows you to filter the post tags output on the details page of a post.
1125
+			 *
1126
+			 * @since 1.0.0
1127
+			 * @param string $post_tags A comma seperated list of tags.
1128
+			 * @param int $post_id The current post id.
1129
+			 */
1130
+			$post_tags = apply_filters('geodir_action_details_post_tags', $post_tags, $post_id);
1131
+
1132
+			$post->post_tags = $post_tags;
1133
+			$post_tags = explode(",", trim($post->post_tags, ","));
1134
+
1135
+
1136
+			foreach ($post_tags as $post_term) {
1137
+
1138
+				// fix slug creation order for tags & location
1139
+				$post_term = trim($post_term);
1140
+
1141
+				$priority_location = false;
1142
+				if ($insert_term = term_exists($post_term, $post_type . '_tags')) {
1143
+					$term = get_term_by('id', $insert_term['term_id'], $post_type . '_tags');
1144
+				} else {
1145
+					$post_country = isset($_REQUEST['post_country']) && $_REQUEST['post_country'] != '' ? sanitize_text_field($_REQUEST['post_country']) : NULL;
1146
+					$post_region = isset($_REQUEST['post_region']) && $_REQUEST['post_region'] != '' ? sanitize_text_field($_REQUEST['post_region']) : NULL;
1147
+					$post_city = isset($_REQUEST['post_city']) && $_REQUEST['post_city'] != '' ? sanitize_text_field($_REQUEST['post_city']) : NULL;
1148
+					$match_country = $post_country && sanitize_title($post_term) == sanitize_title($post_country) ? true : false;
1149
+					$match_region = $post_region && sanitize_title($post_term) == sanitize_title($post_region) ? true : false;
1150
+					$match_city = $post_city && sanitize_title($post_term) == sanitize_title($post_city) ? true : false;
1151
+					if ($match_country || $match_region || $match_city) {
1152
+						$priority_location = true;
1153
+						$term = get_term_by('name', $post_term, $post_type . '_tags');
1154
+					} else {
1155
+						$insert_term = wp_insert_term($post_term, $post_type . '_tags');
1156
+						$term = get_term_by('name', $post_term, $post_type . '_tags');
1157
+					}
1158
+				}
1159
+
1160
+				if (!is_wp_error($term) && is_object($term)) {
1161
+
1162
+					// fix tag link on detail page
1163
+					if ($priority_location) {
1164
+
1165
+						$tag_link = "<a href=''>$post_term</a>";
1166
+						/**
1167
+						 * Filter the tag name on the details page.
1168
+						 *
1169
+						 * @since 1.5.6
1170
+						 * @param string $tag_link The tag link html.
1171
+						 * @param object $term The tag term object.
1172
+						 */
1173
+						$tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1174
+						$links[] = $tag_link;
1175
+					} else {
1176
+						$tag_link = "<a href='" . esc_attr(get_term_link($term->term_id, $term->taxonomy)) . "'>$term->name</a>";
1177
+						/** This action is documented in geodirectory-template_actions.php */
1178
+						$tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1179
+						$links[] = $tag_link;
1180
+					}
1181
+					$terms[] = $term;
1182
+				}
1183
+				//
1184
+			}
1185
+			if (!isset($listing_label)) {
1186
+				$listing_label = '';
1187
+			}
1188
+			$taxonomies[$post_type . '_tags'] = wp_sprintf(__('%s Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1189
+		endif;
1190
+
1191
+	}
1192
+
1193
+	if (!empty($post->{$post_taxonomy})) {
1194
+		$links = array();
1195
+		$terms = array();
1196
+		$termsOrdered = array();
1197
+		if (!is_array($post->{$post_taxonomy})) {
1198
+			$post_term = explode(",", trim($post->{$post_taxonomy}, ","));
1199
+		} else {
1200
+			$post_term = $post->{$post_taxonomy};
1201 1201
 			
1202 1202
 			if ($preview && !$is_backend_preview) {
1203 1203
 				$post_term = geodir_add_parent_terms($post_term, $post_taxonomy);
1204 1204
 			}
1205
-        }
1206
-
1207
-        $post_term = array_unique($post_term);
1208
-        if (!empty($post_term)) {
1209
-            foreach ($post_term as $post_term) {
1210
-                $post_term = trim($post_term);
1211
-
1212
-                if ($post_term != ''):
1213
-                    $term = get_term_by('id', $post_term, $post_taxonomy);
1214
-
1215
-                    if (is_object($term)) {
1216
-                        $term_link = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>$term->name</a>";
1217
-                        /**
1218
-                         * Filter the category name on the details page.
1219
-                         *
1220
-                         * @since 1.5.6
1221
-                         * @param string $term_link The link html to the category.
1222
-                         * @param object $term The category term object.
1223
-                         */
1224
-                        $term_link = apply_filters('geodir_details_taxonomies_cat_link',$term_link,$term);
1225
-                        $links[] = $term_link;
1226
-                        $terms[] = $term;
1227
-                    }
1228
-                endif;
1229
-            }
1230
-            // order alphabetically
1231
-            asort($links);
1232
-            foreach (array_keys($links) as $key) {
1233
-                $termsOrdered[$key] = $terms[$key];
1234
-            }
1235
-            $terms = $termsOrdered;
1205
+		}
1206
+
1207
+		$post_term = array_unique($post_term);
1208
+		if (!empty($post_term)) {
1209
+			foreach ($post_term as $post_term) {
1210
+				$post_term = trim($post_term);
1211
+
1212
+				if ($post_term != ''):
1213
+					$term = get_term_by('id', $post_term, $post_taxonomy);
1214
+
1215
+					if (is_object($term)) {
1216
+						$term_link = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>$term->name</a>";
1217
+						/**
1218
+						 * Filter the category name on the details page.
1219
+						 *
1220
+						 * @since 1.5.6
1221
+						 * @param string $term_link The link html to the category.
1222
+						 * @param object $term The category term object.
1223
+						 */
1224
+						$term_link = apply_filters('geodir_details_taxonomies_cat_link',$term_link,$term);
1225
+						$links[] = $term_link;
1226
+						$terms[] = $term;
1227
+					}
1228
+				endif;
1229
+			}
1230
+			// order alphabetically
1231
+			asort($links);
1232
+			foreach (array_keys($links) as $key) {
1233
+				$termsOrdered[$key] = $terms[$key];
1234
+			}
1235
+			$terms = $termsOrdered;
1236 1236
 
1237
-        }
1237
+		}
1238 1238
 
1239
-        if (!isset($listing_label)) {
1240
-            $listing_label = '';
1241
-        }
1242
-        $taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1239
+		if (!isset($listing_label)) {
1240
+			$listing_label = '';
1241
+		}
1242
+		$taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1243 1243
 
1244
-    }
1244
+	}
1245 1245
 
1246
-    /**
1247
-     * Filter the taxonomies array before output.
1248
-     *
1249
-     * @since 1.5.9
1250
-     * @param array $taxonomies The array of cats and tags.
1251
-     * @param string $post_type The post type being output.
1252
-     * @param string $listing_label The post type label.
1253
-     * @param string $listing_label The post type label with ucwords function.
1254
-     */
1255
-    $taxonomies = apply_filters('geodir_details_taxonomies_output',$taxonomies,$post_type,$listing_label,geodir_ucwords($listing_label));
1246
+	/**
1247
+	 * Filter the taxonomies array before output.
1248
+	 *
1249
+	 * @since 1.5.9
1250
+	 * @param array $taxonomies The array of cats and tags.
1251
+	 * @param string $post_type The post type being output.
1252
+	 * @param string $listing_label The post type label.
1253
+	 * @param string $listing_label The post type label with ucwords function.
1254
+	 */
1255
+	$taxonomies = apply_filters('geodir_details_taxonomies_output',$taxonomies,$post_type,$listing_label,geodir_ucwords($listing_label));
1256 1256
 
1257
-    if (isset($taxonomies[$post_taxonomy])) {
1258
-        echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>';
1259
-    }
1257
+	if (isset($taxonomies[$post_taxonomy])) {
1258
+		echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>';
1259
+	}
1260 1260
 
1261
-    if (isset($taxonomies[$post_type . '_tags']))
1262
-        echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>';
1261
+	if (isset($taxonomies[$post_type . '_tags']))
1262
+		echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>';
1263 1263
 
1264
-    ?>
1264
+	?>
1265 1265
     </p><?php
1266 1266
 }
1267 1267
 
@@ -1283,140 +1283,140 @@  discard block
 block discarded – undo
1283 1283
 function geodir_action_details_micordata($post='')
1284 1284
 {
1285 1285
 
1286
-    global $preview;
1287
-    if(empty($post)){global $post;}
1288
-    if ($preview || !geodir_is_page('detail')) {
1289
-        return;
1290
-    }
1291
-
1292
-    // url
1293
-    $c_url = geodir_curPageURL();
1294
-
1295
-    // post reviews
1296
-    $post_reviews = get_comments(array('post_id' => $post->ID, 'status' => 'approve'));
1297
-    if (empty($post_reviews)) {
1298
-        $reviews = '';
1299
-    } else {
1300
-        foreach ($post_reviews as $review) {
1301
-            $reviews[] = array(
1302
-                "@type" => "Review",
1303
-                "author" => $review->comment_author,
1304
-                "datePublished" => $review->comment_date,
1305
-                "description" => $review->comment_content,
1306
-                "reviewRating" => array(
1307
-                    "@type" => "Rating",
1308
-                    "bestRating" => "5",// @todo this will need to be filtered for review manager if user changes the score.
1309
-                    "ratingValue" => geodir_get_commentoverall($review->comment_ID),
1310
-                    "worstRating" => "1"
1311
-                )
1312
-            );
1313
-        }
1314
-
1315
-    }
1316
-
1317
-    // post images
1318
-    $post_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
1319
-    if (empty($post_images)) {
1320
-        $images = '';
1321
-    } else {
1322
-        $i_arr = array();
1323
-        foreach ($post_images as $img) {
1324
-            $i_arr[] = $img->src;
1325
-        }
1326
-
1327
-        if (count($i_arr) == 1) {
1328
-            $images = $i_arr[0];
1329
-        } else {
1330
-            $images = $i_arr;
1331
-        }
1332
-
1333
-    }
1334
-    //print_r($post);
1335
-    // external links
1336
-    $external_links =  array();
1337
-    $external_links[] = $post->geodir_website;
1338
-    $external_links[] = $post->geodir_twitter;
1339
-    $external_links[] = $post->geodir_facebook;
1340
-    $external_links = array_filter($external_links);
1341
-
1342
-    if(!empty($external_links)){
1343
-        $external_links = array_values($external_links);
1344
-    }
1345
-
1346
-    // reviews
1347
-    $comment_count = geodir_get_review_count_total($post->ID);
1348
-    $post_avgratings = geodir_get_post_rating($post->ID);
1349
-
1350
-    // schema type
1351
-    $schema_type = 'LocalBusiness';
1352
-    if(isset($post->default_category) && $post->default_category){
1353
-        $cat_schema = get_tax_meta($post->default_category, 'ct_cat_schema', false, $post->post_type);
1354
-        if($cat_schema){$schema_type = $cat_schema;}
1355
-        if(!$schema_type && $post->post_type=='gd_event'){$schema_type = 'Event';}
1356
-    }
1357
-
1358
-    $schema = array();
1359
-    $schema['@context'] = "https://schema.org";
1360
-    $schema['@type'] = $schema_type;
1361
-    $schema['name'] = $post->post_title;
1362
-    $schema['description'] = wp_strip_all_tags( $post->post_content, true );
1363
-    $schema['telephone'] = $post->geodir_contact;
1364
-    $schema['url'] = $c_url;
1365
-    $schema['sameAs'] = $external_links;
1366
-    $schema['image'] = $images;
1367
-    $schema['address'] = array(
1368
-        "@type" => "PostalAddress",
1369
-        "streetAddress" => $post->post_address,
1370
-        "addressLocality" => $post->post_city,
1371
-        "addressRegion" => $post->post_region,
1372
-        "addressCountry" => $post->post_country,
1373
-        "postalCode" => $post->post_zip
1374
-    );
1375
-
1376
-    if($post->post_latitude && $post->post_longitude) {
1377
-        $schema['geo'] = array(
1378
-            "@type" => "GeoCoordinates",
1379
-            "latitude" => $post->post_latitude,
1380
-            "longitude" => $post->post_longitude
1381
-        );
1382
-    }
1383
-
1384
-    if($post_avgratings) {
1385
-        $schema['aggregateRating'] = array(
1386
-            "@type" => "AggregateRating",
1387
-            "ratingValue" => $post_avgratings,
1388
-            "bestRating" => "5", // @todo this will need to be filtered for review manager if user changes the score.
1389
-            "worstRating" => "1",
1390
-            "ratingCount" => $comment_count
1391
-        );
1392
-    }
1393
-    $schema['review'] = $reviews;
1394
-
1395
-    /**
1396
-     * Allow the schema JSON-LD info to be filtered.
1397
-     *
1398
-     * @since 1.5.4
1399
-     * @since 1.5.7 Added $post variable.
1400
-     * @param array $schema The array of schema data to be filtered.
1401
-     * @param object $post The post object.
1402
-     */
1403
-    $schema = apply_filters('geodir_details_schema', $schema,$post);
1404
-
1405
-
1406
-    echo '<script type="application/ld+json">' . json_encode($schema) . '</script>';
1407
-
1408
-
1409
-    $uploads = wp_upload_dir();
1410
-    $facebook_og = (isset($post->featured_image) && $post->featured_image) ? '<meta property="og:image" content="'.$uploads['baseurl'].$post->featured_image.'"/>' : '';
1411
-
1412
-    /**
1413
-     * Show facebook open graph meta info
1414
-     *
1415
-     * @since 1.6.6
1416
-     * @param string $facebook_og The open graph html to be filtered.
1417
-     * @param object $post The post object.
1418
-     */
1419
-    echo apply_filters('geodir_details_facebook_og', $facebook_og,$post);
1286
+	global $preview;
1287
+	if(empty($post)){global $post;}
1288
+	if ($preview || !geodir_is_page('detail')) {
1289
+		return;
1290
+	}
1291
+
1292
+	// url
1293
+	$c_url = geodir_curPageURL();
1294
+
1295
+	// post reviews
1296
+	$post_reviews = get_comments(array('post_id' => $post->ID, 'status' => 'approve'));
1297
+	if (empty($post_reviews)) {
1298
+		$reviews = '';
1299
+	} else {
1300
+		foreach ($post_reviews as $review) {
1301
+			$reviews[] = array(
1302
+				"@type" => "Review",
1303
+				"author" => $review->comment_author,
1304
+				"datePublished" => $review->comment_date,
1305
+				"description" => $review->comment_content,
1306
+				"reviewRating" => array(
1307
+					"@type" => "Rating",
1308
+					"bestRating" => "5",// @todo this will need to be filtered for review manager if user changes the score.
1309
+					"ratingValue" => geodir_get_commentoverall($review->comment_ID),
1310
+					"worstRating" => "1"
1311
+				)
1312
+			);
1313
+		}
1314
+
1315
+	}
1316
+
1317
+	// post images
1318
+	$post_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
1319
+	if (empty($post_images)) {
1320
+		$images = '';
1321
+	} else {
1322
+		$i_arr = array();
1323
+		foreach ($post_images as $img) {
1324
+			$i_arr[] = $img->src;
1325
+		}
1326
+
1327
+		if (count($i_arr) == 1) {
1328
+			$images = $i_arr[0];
1329
+		} else {
1330
+			$images = $i_arr;
1331
+		}
1332
+
1333
+	}
1334
+	//print_r($post);
1335
+	// external links
1336
+	$external_links =  array();
1337
+	$external_links[] = $post->geodir_website;
1338
+	$external_links[] = $post->geodir_twitter;
1339
+	$external_links[] = $post->geodir_facebook;
1340
+	$external_links = array_filter($external_links);
1341
+
1342
+	if(!empty($external_links)){
1343
+		$external_links = array_values($external_links);
1344
+	}
1345
+
1346
+	// reviews
1347
+	$comment_count = geodir_get_review_count_total($post->ID);
1348
+	$post_avgratings = geodir_get_post_rating($post->ID);
1349
+
1350
+	// schema type
1351
+	$schema_type = 'LocalBusiness';
1352
+	if(isset($post->default_category) && $post->default_category){
1353
+		$cat_schema = get_tax_meta($post->default_category, 'ct_cat_schema', false, $post->post_type);
1354
+		if($cat_schema){$schema_type = $cat_schema;}
1355
+		if(!$schema_type && $post->post_type=='gd_event'){$schema_type = 'Event';}
1356
+	}
1357
+
1358
+	$schema = array();
1359
+	$schema['@context'] = "https://schema.org";
1360
+	$schema['@type'] = $schema_type;
1361
+	$schema['name'] = $post->post_title;
1362
+	$schema['description'] = wp_strip_all_tags( $post->post_content, true );
1363
+	$schema['telephone'] = $post->geodir_contact;
1364
+	$schema['url'] = $c_url;
1365
+	$schema['sameAs'] = $external_links;
1366
+	$schema['image'] = $images;
1367
+	$schema['address'] = array(
1368
+		"@type" => "PostalAddress",
1369
+		"streetAddress" => $post->post_address,
1370
+		"addressLocality" => $post->post_city,
1371
+		"addressRegion" => $post->post_region,
1372
+		"addressCountry" => $post->post_country,
1373
+		"postalCode" => $post->post_zip
1374
+	);
1375
+
1376
+	if($post->post_latitude && $post->post_longitude) {
1377
+		$schema['geo'] = array(
1378
+			"@type" => "GeoCoordinates",
1379
+			"latitude" => $post->post_latitude,
1380
+			"longitude" => $post->post_longitude
1381
+		);
1382
+	}
1383
+
1384
+	if($post_avgratings) {
1385
+		$schema['aggregateRating'] = array(
1386
+			"@type" => "AggregateRating",
1387
+			"ratingValue" => $post_avgratings,
1388
+			"bestRating" => "5", // @todo this will need to be filtered for review manager if user changes the score.
1389
+			"worstRating" => "1",
1390
+			"ratingCount" => $comment_count
1391
+		);
1392
+	}
1393
+	$schema['review'] = $reviews;
1394
+
1395
+	/**
1396
+	 * Allow the schema JSON-LD info to be filtered.
1397
+	 *
1398
+	 * @since 1.5.4
1399
+	 * @since 1.5.7 Added $post variable.
1400
+	 * @param array $schema The array of schema data to be filtered.
1401
+	 * @param object $post The post object.
1402
+	 */
1403
+	$schema = apply_filters('geodir_details_schema', $schema,$post);
1404
+
1405
+
1406
+	echo '<script type="application/ld+json">' . json_encode($schema) . '</script>';
1407
+
1408
+
1409
+	$uploads = wp_upload_dir();
1410
+	$facebook_og = (isset($post->featured_image) && $post->featured_image) ? '<meta property="og:image" content="'.$uploads['baseurl'].$post->featured_image.'"/>' : '';
1411
+
1412
+	/**
1413
+	 * Show facebook open graph meta info
1414
+	 *
1415
+	 * @since 1.6.6
1416
+	 * @param string $facebook_og The open graph html to be filtered.
1417
+	 * @param object $post The post object.
1418
+	 */
1419
+	echo apply_filters('geodir_details_facebook_og', $facebook_og,$post);
1420 1420
 
1421 1421
 
1422 1422
 
@@ -1436,7 +1436,7 @@  discard block
 block discarded – undo
1436 1436
  */
1437 1437
 function geodir_action_details_next_prev()
1438 1438
 {
1439
-    ?>
1439
+	?>
1440 1440
     <div class="geodir-pos_navigation clearfix">
1441 1441
     <div
1442 1442
         class="geodir-post_left"><?php previous_post_link('%link', '' . __('Previous', 'geodirectory'), false) ?></div>
@@ -1454,15 +1454,15 @@  discard block
 block discarded – undo
1454 1454
  */
1455 1455
 function geodir_action_before_single_post()
1456 1456
 {
1457
-    global $post;
1458
-    /**
1459
-     * Called at the very start of the details page output, before the title section.
1460
-     *
1461
-     * @since 1.0.0
1462
-     * @param object $post The current post object.
1463
-     * @global WP_Post|null $post The current post, if available.
1464
-     */
1465
-    do_action('geodir_before_single_post', $post); // extra action	
1457
+	global $post;
1458
+	/**
1459
+	 * Called at the very start of the details page output, before the title section.
1460
+	 *
1461
+	 * @since 1.0.0
1462
+	 * @param object $post The current post object.
1463
+	 * @global WP_Post|null $post The current post, if available.
1464
+	 */
1465
+	do_action('geodir_before_single_post', $post); // extra action	
1466 1466
 }
1467 1467
 
1468 1468
 /**
@@ -1473,13 +1473,13 @@  discard block
 block discarded – undo
1473 1473
  */
1474 1474
 function geodir_action_after_single_post($post)
1475 1475
 {
1476
-    /**
1477
-     * Called on the details page after the details page tabs section and before the next/prev buttons.
1478
-     *
1479
-     * @since 1.0.0
1480
-     * @param object $post The current post object.
1481
-     */
1482
-    do_action('geodir_after_single_post', $post); // extra action	
1476
+	/**
1477
+	 * Called on the details page after the details page tabs section and before the next/prev buttons.
1478
+	 *
1479
+	 * @since 1.0.0
1480
+	 * @param object $post The current post object.
1481
+	 */
1482
+	do_action('geodir_after_single_post', $post); // extra action	
1483 1483
 }
1484 1484
 
1485 1485
 add_action('geodir_details_main_content', 'geodir_action_before_single_post', 10);
@@ -1505,168 +1505,168 @@  discard block
 block discarded – undo
1505 1505
  */
1506 1506
 function geodir_action_listings_title()
1507 1507
 {
1508
-    global $wp, $term;
1508
+	global $wp, $term;
1509 1509
 
1510
-    $gd_post_type = geodir_get_current_posttype();
1511
-    $post_type_info = get_post_type_object($gd_post_type);
1510
+	$gd_post_type = geodir_get_current_posttype();
1511
+	$post_type_info = get_post_type_object($gd_post_type);
1512 1512
 
1513
-    $add_string_in_title = __('All', 'geodirectory') . ' ';
1514
-    if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
1515
-        $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
1516
-    }
1513
+	$add_string_in_title = __('All', 'geodirectory') . ' ';
1514
+	if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
1515
+		$add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
1516
+	}
1517 1517
 
1518
-    $list_title = $add_string_in_title . __(ucfirst($post_type_info->labels->name), 'geodirectory');
1519
-    $single_name = $post_type_info->labels->singular_name;
1518
+	$list_title = $add_string_in_title . __(ucfirst($post_type_info->labels->name), 'geodirectory');
1519
+	$single_name = $post_type_info->labels->singular_name;
1520 1520
 
1521
-    $taxonomy = geodir_get_taxonomies($gd_post_type, true);
1521
+	$taxonomy = geodir_get_taxonomies($gd_post_type, true);
1522 1522
 
1523
-    $gd_country = get_query_var('gd_country');
1524
-    $gd_region = get_query_var('gd_region');
1525
-    $gd_city = get_query_var('gd_city');
1523
+	$gd_country = get_query_var('gd_country');
1524
+	$gd_region = get_query_var('gd_region');
1525
+	$gd_city = get_query_var('gd_city');
1526 1526
 
1527
-    if (!empty($term)) {
1528
-        $location_name = '';
1529
-        if ($gd_country != '' || $gd_region != '' || $gd_city != '') {
1530
-            if ($gd_country != '') {
1531
-                $location_name = geodir_sanitize_location_name('gd_country', $gd_country);
1532
-            }
1533
-
1534
-            if ($gd_region != '') {
1535
-                $location_name = geodir_sanitize_location_name('gd_region', $gd_region);
1536
-            }
1537
-
1538
-            if ($gd_city != '') {
1539
-                $location_name = geodir_sanitize_location_name('gd_city', $gd_city);
1540
-            }
1541
-        }
1542
-
1543
-        $current_term = get_term_by('slug', $term, $taxonomy[0]);
1544
-        if (!empty($current_term)) {
1545
-            $current_term_name = __(ucfirst($current_term->name), 'geodirectory');
1546
-            if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1547
-                $location_last_char = substr($location_name, -1);
1548
-                $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1549
-                $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1550
-            } else {
1551
-                $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1552
-            }
1553
-        } else {
1554
-            if (count($taxonomy) > 1) {
1555
-                $current_term = get_term_by('slug', $term, $taxonomy[1]);
1556
-
1557
-                if (!empty($current_term)) {
1558
-                    $current_term_name = __(ucfirst($current_term->name), 'geodirectory');
1559
-                    if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1560
-                        $location_last_char = substr($location_name, -1);
1561
-                        $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1562
-                        $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1563
-                    } else {
1564
-                        $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1565
-                    }
1566
-                }
1567
-            }
1568
-        }
1569
-
1570
-    } else {
1571
-        $gd_country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : '';
1572
-        $gd_region = (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') ? $wp->query_vars['gd_region'] : '';
1573
-        $gd_city = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : '';
1574
-
1575
-        $gd_country_actual = $gd_region_actual = $gd_city_actual = '';
1576
-
1577
-        if (function_exists('get_actual_location_name')) {
1578
-            $gd_country_actual = $gd_country != '' ? get_actual_location_name('country', $gd_country, true) : $gd_country;
1579
-            $gd_region_actual = $gd_region != '' ? get_actual_location_name('region', $gd_region) : $gd_region;
1580
-            $gd_city_actual = $gd_city != '' ? get_actual_location_name('city', $gd_city) : $gd_city;
1581
-        }
1582
-
1583
-        if ($gd_city != '') {
1584
-            if ($gd_city_actual != '') {
1585
-                $gd_city = $gd_city_actual;
1586
-            } else {
1587
-                $gd_city = preg_replace('/-(\d+)$/', '', $gd_city);
1588
-                $gd_city = preg_replace('/[_-]/', ' ', $gd_city);
1589
-                $gd_city = __(geodir_ucwords($gd_city), 'geodirectory');
1590
-            }
1591
-
1592
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_city . "'";
1593
-        } else if ($gd_region != '') {
1594
-            if ($gd_region_actual != '') {
1595
-                $gd_region = $gd_region_actual;
1596
-            } else {
1597
-                $gd_region = preg_replace('/-(\d+)$/', '', $gd_region);
1598
-                $gd_region = preg_replace('/[_-]/', ' ', $gd_region);
1599
-                $gd_region = __(geodir_ucwords($gd_region), 'geodirectory');
1600
-            }
1601
-
1602
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_region . "'";
1603
-        } else if ($gd_country != '') {
1604
-            if ($gd_country_actual != '') {
1605
-                $gd_country = $gd_country_actual;
1606
-            } else {
1607
-                $gd_country = preg_replace('/-(\d+)$/', '', $gd_country);
1608
-                $gd_country = preg_replace('/[_-]/', ' ', $gd_country);
1609
-                $gd_country = __(geodir_ucwords($gd_country), 'geodirectory');
1610
-            }
1611
-
1612
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_country . "'";
1613
-        }
1614
-    }
1615
-
1616
-    if (is_search()) {
1617
-        $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
1618
-    }
1619
-    /** This action is documented in geodirectory_template_actions.php */
1620
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
1621
-    /** This action is documented in geodirectory_template_actions.php */
1622
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
1623
-
1624
-
1625
-    $title = $list_title;
1626
-    $gd_page = '';
1627
-    if(geodir_is_page('pt')){
1628
-        $gd_page = 'pt';
1629
-        $title  = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
1630
-    }
1631
-    elseif(geodir_is_page('listing')){
1632
-        $gd_page = 'listing';
1633
-        global $wp_query;
1634
-        $current_term = $wp_query->get_queried_object();
1635
-        if (strpos($current_term->taxonomy,'_tags') !== false) {
1636
-            $title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
1637
-        }else{
1638
-            $title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
1639
-        }
1527
+	if (!empty($term)) {
1528
+		$location_name = '';
1529
+		if ($gd_country != '' || $gd_region != '' || $gd_city != '') {
1530
+			if ($gd_country != '') {
1531
+				$location_name = geodir_sanitize_location_name('gd_country', $gd_country);
1532
+			}
1640 1533
 
1641
-    }
1642
-    elseif(geodir_is_page('author')){
1643
-        $gd_page = 'author';
1644
-        if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
1645
-            $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
1646
-        }else{
1647
-            $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
1648
-        }
1534
+			if ($gd_region != '') {
1535
+				$location_name = geodir_sanitize_location_name('gd_region', $gd_region);
1536
+			}
1649 1537
 
1650
-    }
1538
+			if ($gd_city != '') {
1539
+				$location_name = geodir_sanitize_location_name('gd_city', $gd_city);
1540
+			}
1541
+		}
1542
+
1543
+		$current_term = get_term_by('slug', $term, $taxonomy[0]);
1544
+		if (!empty($current_term)) {
1545
+			$current_term_name = __(ucfirst($current_term->name), 'geodirectory');
1546
+			if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1547
+				$location_last_char = substr($location_name, -1);
1548
+				$location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1549
+				$list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1550
+			} else {
1551
+				$list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1552
+			}
1553
+		} else {
1554
+			if (count($taxonomy) > 1) {
1555
+				$current_term = get_term_by('slug', $term, $taxonomy[1]);
1556
+
1557
+				if (!empty($current_term)) {
1558
+					$current_term_name = __(ucfirst($current_term->name), 'geodirectory');
1559
+					if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1560
+						$location_last_char = substr($location_name, -1);
1561
+						$location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1562
+						$list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1563
+					} else {
1564
+						$list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1565
+					}
1566
+				}
1567
+			}
1568
+		}
1569
+
1570
+	} else {
1571
+		$gd_country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : '';
1572
+		$gd_region = (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') ? $wp->query_vars['gd_region'] : '';
1573
+		$gd_city = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : '';
1574
+
1575
+		$gd_country_actual = $gd_region_actual = $gd_city_actual = '';
1576
+
1577
+		if (function_exists('get_actual_location_name')) {
1578
+			$gd_country_actual = $gd_country != '' ? get_actual_location_name('country', $gd_country, true) : $gd_country;
1579
+			$gd_region_actual = $gd_region != '' ? get_actual_location_name('region', $gd_region) : $gd_region;
1580
+			$gd_city_actual = $gd_city != '' ? get_actual_location_name('city', $gd_city) : $gd_city;
1581
+		}
1582
+
1583
+		if ($gd_city != '') {
1584
+			if ($gd_city_actual != '') {
1585
+				$gd_city = $gd_city_actual;
1586
+			} else {
1587
+				$gd_city = preg_replace('/-(\d+)$/', '', $gd_city);
1588
+				$gd_city = preg_replace('/[_-]/', ' ', $gd_city);
1589
+				$gd_city = __(geodir_ucwords($gd_city), 'geodirectory');
1590
+			}
1651 1591
 
1592
+			$list_title .= __(' in', 'geodirectory') . " '" . $gd_city . "'";
1593
+		} else if ($gd_region != '') {
1594
+			if ($gd_region_actual != '') {
1595
+				$gd_region = $gd_region_actual;
1596
+			} else {
1597
+				$gd_region = preg_replace('/-(\d+)$/', '', $gd_region);
1598
+				$gd_region = preg_replace('/[_-]/', ' ', $gd_region);
1599
+				$gd_region = __(geodir_ucwords($gd_region), 'geodirectory');
1600
+			}
1652 1601
 
1653
-    /**
1654
-     * Filter page title to replace variables.
1655
-     *
1656
-     * @since 1.5.4
1657
-     * @param string $title The page title including variables.
1658
-     * @param string $gd_page The GeoDirectory page type if any.
1659
-     */
1660
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
1602
+			$list_title .= __(' in', 'geodirectory') . " '" . $gd_region . "'";
1603
+		} else if ($gd_country != '') {
1604
+			if ($gd_country_actual != '') {
1605
+				$gd_country = $gd_country_actual;
1606
+			} else {
1607
+				$gd_country = preg_replace('/-(\d+)$/', '', $gd_country);
1608
+				$gd_country = preg_replace('/[_-]/', ' ', $gd_country);
1609
+				$gd_country = __(geodir_ucwords($gd_country), 'geodirectory');
1610
+			}
1661 1611
 
1662
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
1663
-        /**
1664
-         * Filter the listing page title.
1665
-         *
1666
-         * @since 1.0.0
1667
-         * @param string $list_title The title for the category page.
1668
-         */
1669
-        apply_filters('geodir_listing_page_title', $title) . '</h1></header>';
1612
+			$list_title .= __(' in', 'geodirectory') . " '" . $gd_country . "'";
1613
+		}
1614
+	}
1615
+
1616
+	if (is_search()) {
1617
+		$list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
1618
+	}
1619
+	/** This action is documented in geodirectory_template_actions.php */
1620
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
1621
+	/** This action is documented in geodirectory_template_actions.php */
1622
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
1623
+
1624
+
1625
+	$title = $list_title;
1626
+	$gd_page = '';
1627
+	if(geodir_is_page('pt')){
1628
+		$gd_page = 'pt';
1629
+		$title  = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
1630
+	}
1631
+	elseif(geodir_is_page('listing')){
1632
+		$gd_page = 'listing';
1633
+		global $wp_query;
1634
+		$current_term = $wp_query->get_queried_object();
1635
+		if (strpos($current_term->taxonomy,'_tags') !== false) {
1636
+			$title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
1637
+		}else{
1638
+			$title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
1639
+		}
1640
+
1641
+	}
1642
+	elseif(geodir_is_page('author')){
1643
+		$gd_page = 'author';
1644
+		if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
1645
+			$title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
1646
+		}else{
1647
+			$title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
1648
+		}
1649
+
1650
+	}
1651
+
1652
+
1653
+	/**
1654
+	 * Filter page title to replace variables.
1655
+	 *
1656
+	 * @since 1.5.4
1657
+	 * @param string $title The page title including variables.
1658
+	 * @param string $gd_page The GeoDirectory page type if any.
1659
+	 */
1660
+	$title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
1661
+
1662
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
1663
+		/**
1664
+		 * Filter the listing page title.
1665
+		 *
1666
+		 * @since 1.0.0
1667
+		 * @param string $list_title The title for the category page.
1668
+		 */
1669
+		apply_filters('geodir_listing_page_title', $title) . '</h1></header>';
1670 1670
 }
1671 1671
 
1672 1672
 add_action('geodir_listings_page_description', 'geodir_action_listings_description', 10);
@@ -1679,46 +1679,46 @@  discard block
 block discarded – undo
1679 1679
  */
1680 1680
 function geodir_action_listings_description()
1681 1681
 {
1682
-    global $wp_query;
1683
-    $current_term = $wp_query->get_queried_object();
1682
+	global $wp_query;
1683
+	$current_term = $wp_query->get_queried_object();
1684 1684
 
1685
-    $gd_post_type = geodir_get_current_posttype();
1686
-    if (isset($current_term->term_id) && $current_term->term_id != '') {
1685
+	$gd_post_type = geodir_get_current_posttype();
1686
+	if (isset($current_term->term_id) && $current_term->term_id != '') {
1687 1687
 
1688
-        $term_desc = term_description($current_term->term_id, $gd_post_type . '_tags');
1689
-        $saved_data = stripslashes(get_tax_meta($current_term->term_id, 'ct_cat_top_desc', false, $gd_post_type));
1690
-        if ($term_desc && !$saved_data) {
1691
-            $saved_data = $term_desc;
1692
-        }
1688
+		$term_desc = term_description($current_term->term_id, $gd_post_type . '_tags');
1689
+		$saved_data = stripslashes(get_tax_meta($current_term->term_id, 'ct_cat_top_desc', false, $gd_post_type));
1690
+		if ($term_desc && !$saved_data) {
1691
+			$saved_data = $term_desc;
1692
+		}
1693 1693
 
1694
-        // stop payment manager filtering content length
1695
-        $filter_priority = has_filter( 'the_content', 'geodir_payments_the_content' );
1696
-        if ( false !== $filter_priority ) {
1697
-            remove_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1698
-        }
1694
+		// stop payment manager filtering content length
1695
+		$filter_priority = has_filter( 'the_content', 'geodir_payments_the_content' );
1696
+		if ( false !== $filter_priority ) {
1697
+			remove_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1698
+		}
1699 1699
 
1700
-        /**
1701
-         * Apply the core filter `the_content` filter to the variable string.
1702
-         *
1703
-         * This is a WordPress core filter that does many things.
1704
-         *
1705
-         * @since 1.0.0
1706
-         * @param string $var The string to apply the filter to.
1707
-         */
1708
-        $cat_description = apply_filters('the_content', $saved_data);
1700
+		/**
1701
+		 * Apply the core filter `the_content` filter to the variable string.
1702
+		 *
1703
+		 * This is a WordPress core filter that does many things.
1704
+		 *
1705
+		 * @since 1.0.0
1706
+		 * @param string $var The string to apply the filter to.
1707
+		 */
1708
+		$cat_description = apply_filters('the_content', $saved_data);
1709 1709
 
1710 1710
 
1711
-        if ( false !== $filter_priority ) {
1712
-            add_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1713
-        }
1711
+		if ( false !== $filter_priority ) {
1712
+			add_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1713
+		}
1714 1714
 
1715
-        if ($cat_description) {
1716
-            ?>
1715
+		if ($cat_description) {
1716
+			?>
1717 1717
 
1718 1718
             <div class="term_description"><?php echo $cat_description;?></div> <?php
1719
-        }
1719
+		}
1720 1720
 
1721
-    }
1721
+	}
1722 1722
 }
1723 1723
 
1724 1724
 // action for adding the listings page top widget area
@@ -1737,11 +1737,11 @@  discard block
 block discarded – undo
1737 1737
  */
1738 1738
 function geodir_action_geodir_sidebar_listings_top()
1739 1739
 {
1740
-    if (get_option('geodir_show_listing_top_section')) { ?>
1740
+	if (get_option('geodir_show_listing_top_section')) { ?>
1741 1741
         <div
1742 1742
             class="<?php
1743
-            /** This action is documented in geodirectory_template_actions.php */
1744
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_top'); ?>">
1743
+			/** This action is documented in geodirectory_template_actions.php */
1744
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_top'); ?>">
1745 1745
             <?php dynamic_sidebar('geodir_listing_top'); ?>
1746 1746
         </div><!-- clearfix ends here-->
1747 1747
     <?php }
@@ -1764,35 +1764,35 @@  discard block
 block discarded – undo
1764 1764
  */
1765 1765
 function geodir_action_sidebar_left_open($type = '', $id = '', $class = '', $itemtype = '')
1766 1766
 {
1767
-    if ($type == 'home-page' && $width = get_option('geodir_width_home_left_section')) {
1768
-        $width_css = 'style="width:' . $width . '%;"';
1769
-    } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_left_section')) {
1770
-        $width_css = 'style="width:' . $width . '%;"';
1771
-    } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_left_section')) {
1772
-        $width_css = 'style="width:' . $width . '%;"';
1773
-    } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_left_section')) {
1774
-        $width_css = 'style="width:' . $width . '%;"';
1775
-    } else {
1776
-        $width_css = '';
1777
-    }
1778
-
1779
-    $tc = get_option('theme_compatibility_setting');
1780
-    if (!empty($tc['geodir_sidebar_left_open_replace'])) {
1781
-        $text = $tc['geodir_sidebar_left_open_replace'];
1782
-    } else {
1783
-        $text = '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>';
1784
-    }
1785
-
1786
-    if (!empty($tc['geodir_sidebar_left_open_id'])) {
1787
-        $id = $tc['geodir_sidebar_left_open_id'];
1788
-    }
1789
-    if (!empty($tc['geodir_sidebar_left_open_class'])) {
1790
-        $class = $tc['geodir_sidebar_left_open_class'];
1791
-    }
1792
-
1793
-    $text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
1794
-
1795
-    echo $text;
1767
+	if ($type == 'home-page' && $width = get_option('geodir_width_home_left_section')) {
1768
+		$width_css = 'style="width:' . $width . '%;"';
1769
+	} elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_left_section')) {
1770
+		$width_css = 'style="width:' . $width . '%;"';
1771
+	} elseif ($type == 'search-page' && $width = get_option('geodir_width_search_left_section')) {
1772
+		$width_css = 'style="width:' . $width . '%;"';
1773
+	} elseif ($type == 'author-page' && $width = get_option('geodir_width_author_left_section')) {
1774
+		$width_css = 'style="width:' . $width . '%;"';
1775
+	} else {
1776
+		$width_css = '';
1777
+	}
1778
+
1779
+	$tc = get_option('theme_compatibility_setting');
1780
+	if (!empty($tc['geodir_sidebar_left_open_replace'])) {
1781
+		$text = $tc['geodir_sidebar_left_open_replace'];
1782
+	} else {
1783
+		$text = '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>';
1784
+	}
1785
+
1786
+	if (!empty($tc['geodir_sidebar_left_open_id'])) {
1787
+		$id = $tc['geodir_sidebar_left_open_id'];
1788
+	}
1789
+	if (!empty($tc['geodir_sidebar_left_open_class'])) {
1790
+		$class = $tc['geodir_sidebar_left_open_class'];
1791
+	}
1792
+
1793
+	$text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
1794
+
1795
+	echo $text;
1796 1796
 }
1797 1797
 
1798 1798
 // action for adding the primary div closing tag
@@ -1808,13 +1808,13 @@  discard block
 block discarded – undo
1808 1808
  */
1809 1809
 function geodir_action_sidebar_left_close($type = '')
1810 1810
 {
1811
-    $tc = get_option('theme_compatibility_setting');
1812
-    if (!empty($tc['geodir_sidebar_left_close_replace'])) {
1813
-        $text = $tc['geodir_sidebar_left_close_replace'];
1814
-    } else {
1815
-        $text = '</aside><!-- sidebar ends here-->';
1816
-    }
1817
-    echo $text;
1811
+	$tc = get_option('theme_compatibility_setting');
1812
+	if (!empty($tc['geodir_sidebar_left_close_replace'])) {
1813
+		$text = $tc['geodir_sidebar_left_close_replace'];
1814
+	} else {
1815
+		$text = '</aside><!-- sidebar ends here-->';
1816
+	}
1817
+	echo $text;
1818 1818
 }
1819 1819
 
1820 1820
 /**
@@ -1827,7 +1827,7 @@  discard block
 block discarded – undo
1827 1827
  */
1828 1828
 function geodir_listing_left_section()
1829 1829
 {
1830
-    if (get_option('geodir_show_listing_left_section')) { ?>
1830
+	if (get_option('geodir_show_listing_left_section')) { ?>
1831 1831
         <div class="geodir-content-left geodir-sidebar-wrap">
1832 1832
             <?php dynamic_sidebar('geodir_listing_left_sidebar'); ?>
1833 1833
         </div><!-- end geodir-content-left -->
@@ -1845,20 +1845,20 @@  discard block
 block discarded – undo
1845 1845
  */
1846 1846
 function geodir_action_listings_sidebar_left()
1847 1847
 {
1848
-    if (get_option('geodir_show_listing_left_section')) {
1849
-        /** This action is documented in geodirectory_template_actions.php */
1850
-        do_action('geodir_sidebar_left_open', 'listings-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'https://schema.org/WPSideBar');
1851
-        /**
1852
-         * Calls the listings page (category) left sidebar content.
1853
-         *
1854
-         * All the content for the listings page left sidebar is added via this hook.
1855
-         *
1856
-         * @since 1.0.0
1857
-         */
1858
-        do_action('geodir_listings_sidebar_left_inside');
1859
-        /** This action is documented in geodirectory_template_actions.php */
1860
-        do_action('geodir_sidebar_left_close', 'listings-page');
1861
-    }
1848
+	if (get_option('geodir_show_listing_left_section')) {
1849
+		/** This action is documented in geodirectory_template_actions.php */
1850
+		do_action('geodir_sidebar_left_open', 'listings-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'https://schema.org/WPSideBar');
1851
+		/**
1852
+		 * Calls the listings page (category) left sidebar content.
1853
+		 *
1854
+		 * All the content for the listings page left sidebar is added via this hook.
1855
+		 *
1856
+		 * @since 1.0.0
1857
+		 */
1858
+		do_action('geodir_listings_sidebar_left_inside');
1859
+		/** This action is documented in geodirectory_template_actions.php */
1860
+		do_action('geodir_sidebar_left_close', 'listings-page');
1861
+	}
1862 1862
 }
1863 1863
 
1864 1864
 /**
@@ -1871,7 +1871,7 @@  discard block
 block discarded – undo
1871 1871
  */
1872 1872
 function geodir_listing_right_section()
1873 1873
 {
1874
-    if (get_option('geodir_show_listing_right_section')) { ?>
1874
+	if (get_option('geodir_show_listing_right_section')) { ?>
1875 1875
         <div class="geodir-content-right geodir-sidebar-wrap">
1876 1876
             <?php dynamic_sidebar('geodir_listing_right_sidebar'); ?>
1877 1877
         </div><!-- end geodir-content-right -->
@@ -1889,20 +1889,20 @@  discard block
 block discarded – undo
1889 1889
  */
1890 1890
 function geodir_action_listings_sidebar_right()
1891 1891
 {
1892
-    if (get_option('geodir_show_listing_right_section')) {
1893
-        /** This action is documented in geodirectory_template_actions.php */
1894
-        do_action('geodir_sidebar_right_open', 'listings-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
1895
-        /**
1896
-         * Calls the listings page (category) right sidebar content.
1897
-         *
1898
-         * All the content for the listings page right sidebar is added via this hook.
1899
-         *
1900
-         * @since 1.0.0
1901
-         */
1902
-        do_action('geodir_listings_sidebar_right_inside');
1903
-        /** This action is documented in geodirectory_template_actions.php */
1904
-        do_action('geodir_sidebar_right_close', 'listings-page');
1905
-    }
1892
+	if (get_option('geodir_show_listing_right_section')) {
1893
+		/** This action is documented in geodirectory_template_actions.php */
1894
+		do_action('geodir_sidebar_right_open', 'listings-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
1895
+		/**
1896
+		 * Calls the listings page (category) right sidebar content.
1897
+		 *
1898
+		 * All the content for the listings page right sidebar is added via this hook.
1899
+		 *
1900
+		 * @since 1.0.0
1901
+		 */
1902
+		do_action('geodir_listings_sidebar_right_inside');
1903
+		/** This action is documented in geodirectory_template_actions.php */
1904
+		do_action('geodir_sidebar_right_close', 'listings-page');
1905
+	}
1906 1906
 }
1907 1907
 
1908 1908
 
@@ -1919,23 +1919,23 @@  discard block
 block discarded – undo
1919 1919
  */
1920 1920
 function geodir_action_main_content_open($type = '', $id = '', $class = '')
1921 1921
 {
1922
-    $tc = get_option('theme_compatibility_setting');
1923
-    if (!empty($tc['geodir_main_content_open_replace'])) {
1924
-        $text = $tc['geodir_main_content_open_replace'];
1925
-    } else {
1926
-        $text = '<main id="[id]" class="[class]" role="main">';
1927
-    }
1922
+	$tc = get_option('theme_compatibility_setting');
1923
+	if (!empty($tc['geodir_main_content_open_replace'])) {
1924
+		$text = $tc['geodir_main_content_open_replace'];
1925
+	} else {
1926
+		$text = '<main id="[id]" class="[class]" role="main">';
1927
+	}
1928 1928
 
1929
-    if (!empty($tc['geodir_main_content_open_id'])) {
1930
-        $id = $tc['geodir_main_content_open_id'];
1931
-    }
1932
-    if (!empty($tc['geodir_main_content_open_class'])) {
1933
-        $class = $tc['geodir_main_content_open_class'];
1934
-    }
1929
+	if (!empty($tc['geodir_main_content_open_id'])) {
1930
+		$id = $tc['geodir_main_content_open_id'];
1931
+	}
1932
+	if (!empty($tc['geodir_main_content_open_class'])) {
1933
+		$class = $tc['geodir_main_content_open_class'];
1934
+	}
1935 1935
 
1936
-    $text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
1936
+	$text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
1937 1937
 
1938
-    echo $text;
1938
+	echo $text;
1939 1939
 }
1940 1940
 
1941 1941
 // action for adding the primary div closing tag
@@ -1948,13 +1948,13 @@  discard block
 block discarded – undo
1948 1948
  */
1949 1949
 function geodir_action_main_content_close()
1950 1950
 {
1951
-    $tc = get_option('theme_compatibility_setting');
1952
-    if (!empty($tc['geodir_main_content_close_replace'])) {
1953
-        $text = $tc['geodir_main_content_close_replace'];
1954
-    } else {
1955
-        $text = '</main><!-- main ends here-->';
1956
-    }
1957
-    echo $text;
1951
+	$tc = get_option('theme_compatibility_setting');
1952
+	if (!empty($tc['geodir_main_content_close_replace'])) {
1953
+		$text = $tc['geodir_main_content_close_replace'];
1954
+	} else {
1955
+		$text = '</main><!-- main ends here-->';
1956
+	}
1957
+	echo $text;
1958 1958
 }
1959 1959
 
1960 1960
 /**
@@ -1966,14 +1966,14 @@  discard block
 block discarded – undo
1966 1966
  */
1967 1967
 function geodir_action_listings_content_inside()
1968 1968
 {
1969
-    global $gridview_columns;
1970
-    $listing_view = get_option('geodir_listing_view');
1971
-    if (strstr($listing_view, 'gridview')) {
1972
-        $gridview_columns = $listing_view;
1973
-        $listing_view_exp = explode('_', $listing_view);
1974
-        $listing_view = $listing_view_exp[0];
1975
-    }
1976
-    geodir_get_template_part('listing', 'listview');
1969
+	global $gridview_columns;
1970
+	$listing_view = get_option('geodir_listing_view');
1971
+	if (strstr($listing_view, 'gridview')) {
1972
+		$gridview_columns = $listing_view;
1973
+		$listing_view_exp = explode('_', $listing_view);
1974
+		$listing_view = $listing_view_exp[0];
1975
+	}
1976
+	geodir_get_template_part('listing', 'listview');
1977 1977
 }
1978 1978
 
1979 1979
 add_action('geodir_listings_content_inside', 'geodir_action_listings_content_inside', 10);
@@ -1989,47 +1989,47 @@  discard block
 block discarded – undo
1989 1989
  */
1990 1990
 function geodir_action_listings_content()
1991 1991
 {
1992
-    /**
1993
-     * This is used to add HTML opening wrappers to the main content of most pages including listings, author, search, home etc.
1994
-     *
1995
-     * @since 1.0.0
1996
-     * @param string $type The page type. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
1997
-     * @param string $id The id for the div. Usually 'geodir-main-content'.
1998
-     * @param string $class The class for the div. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
1999
-     * @see 'geodir_main_content_close' Where the oposing closing tag is added.
2000
-     */
2001
-    do_action('geodir_main_content_open', 'listings-page', 'geodir-main-content', 'listings-page');
2002
-    $extra_class = apply_filters('geodir_before_listing_wrapper_extra_class', '', 'listings-page');
2003
-    echo '<div class="clearfix '.$extra_class.'">';
2004
-    /**
2005
-     * Called before the listings page content, inside the outer wrapper. Used on listings pages and search and author pages.
2006
-     *
2007
-     * @since 1.0.0
2008
-     */
2009
-    do_action('geodir_before_listing');
2010
-    echo '</div>';
2011
-
2012
-    /**
2013
-     * This actions calls the listings list content. Used on listings pages and search and author pages.
2014
-     *
2015
-     * @since 1.0.0
2016
-     */
2017
-    do_action('geodir_listings_content_inside');
2018
-
2019
-    /**
2020
-     * Called after the listings content, inside the outer wrapper HTML. Used on listings pages and search and author pages.
2021
-     *
2022
-     * @since 1.0.0
2023
-     */
2024
-    do_action('geodir_after_listing');
2025
-
2026
-    /**
2027
-     * This is used to add HTML closing wrappers to the main content of most pages including listings, author, search, home etc.
2028
-     *
2029
-     * @since 1.0.0
2030
-     * @see 'geodir_main_content_open' Where the oposing opening tag is added.
2031
-     */
2032
-    do_action('geodir_main_content_close', 'listings-page');
1992
+	/**
1993
+	 * This is used to add HTML opening wrappers to the main content of most pages including listings, author, search, home etc.
1994
+	 *
1995
+	 * @since 1.0.0
1996
+	 * @param string $type The page type. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
1997
+	 * @param string $id The id for the div. Usually 'geodir-main-content'.
1998
+	 * @param string $class The class for the div. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
1999
+	 * @see 'geodir_main_content_close' Where the oposing closing tag is added.
2000
+	 */
2001
+	do_action('geodir_main_content_open', 'listings-page', 'geodir-main-content', 'listings-page');
2002
+	$extra_class = apply_filters('geodir_before_listing_wrapper_extra_class', '', 'listings-page');
2003
+	echo '<div class="clearfix '.$extra_class.'">';
2004
+	/**
2005
+	 * Called before the listings page content, inside the outer wrapper. Used on listings pages and search and author pages.
2006
+	 *
2007
+	 * @since 1.0.0
2008
+	 */
2009
+	do_action('geodir_before_listing');
2010
+	echo '</div>';
2011
+
2012
+	/**
2013
+	 * This actions calls the listings list content. Used on listings pages and search and author pages.
2014
+	 *
2015
+	 * @since 1.0.0
2016
+	 */
2017
+	do_action('geodir_listings_content_inside');
2018
+
2019
+	/**
2020
+	 * Called after the listings content, inside the outer wrapper HTML. Used on listings pages and search and author pages.
2021
+	 *
2022
+	 * @since 1.0.0
2023
+	 */
2024
+	do_action('geodir_after_listing');
2025
+
2026
+	/**
2027
+	 * This is used to add HTML closing wrappers to the main content of most pages including listings, author, search, home etc.
2028
+	 *
2029
+	 * @since 1.0.0
2030
+	 * @see 'geodir_main_content_open' Where the oposing opening tag is added.
2031
+	 */
2032
+	do_action('geodir_main_content_close', 'listings-page');
2033 2033
 }
2034 2034
 
2035 2035
 
@@ -2044,10 +2044,10 @@  discard block
 block discarded – undo
2044 2044
  */
2045 2045
 function geodir_action_sidebar_listings_bottom_section()
2046 2046
 {
2047
-    if (get_option('geodir_show_listing_bottom_section')) { ?>
2047
+	if (get_option('geodir_show_listing_bottom_section')) { ?>
2048 2048
         <div class="<?php
2049
-            /** This action is documented in geodirectory_template_actions.php */
2050
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_bottom'); ?>">
2049
+			/** This action is documented in geodirectory_template_actions.php */
2050
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_bottom'); ?>">
2051 2051
             <?php dynamic_sidebar('geodir_listing_bottom'); ?>
2052 2052
         </div><!-- clearfix ends here-->
2053 2053
     <?php }
@@ -2067,38 +2067,38 @@  discard block
 block discarded – undo
2067 2067
  */
2068 2068
 function geodir_action_add_listing_page_title()
2069 2069
 {
2070
-    if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '')
2071
-        $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2072
-    /** This action is documented in geodirectory_template_actions.php */
2073
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
2074
-    /** This action is documented in geodirectory_template_actions.php */
2075
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2076
-
2077
-    $title = apply_filters('geodir_add_listing_page_title_text', get_the_title());
2078
-
2079
-    if(geodir_is_page('add-listing')){
2080
-        $gd_page = 'add-listing';
2081
-        if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
2082
-            $title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
2083
-        }elseif(isset($listing_type)){
2084
-            $title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
2085
-        }
2070
+	if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '')
2071
+		$listing_type = sanitize_text_field($_REQUEST['listing_type']);
2072
+	/** This action is documented in geodirectory_template_actions.php */
2073
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
2074
+	/** This action is documented in geodirectory_template_actions.php */
2075
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2076
+
2077
+	$title = apply_filters('geodir_add_listing_page_title_text', get_the_title());
2078
+
2079
+	if(geodir_is_page('add-listing')){
2080
+		$gd_page = 'add-listing';
2081
+		if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
2082
+			$title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
2083
+		}elseif(isset($listing_type)){
2084
+			$title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
2085
+		}
2086 2086
 
2087
-    }
2087
+	}
2088 2088
 
2089 2089
 
2090
-    /**
2091
-     * Filter page title to replace variables.
2092
-     *
2093
-     * @since 1.5.4
2094
-     * @param string $title The page title including variables.
2095
-     * @param string $gd_page The GeoDirectory page type if any.
2096
-     */
2097
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2090
+	/**
2091
+	 * Filter page title to replace variables.
2092
+	 *
2093
+	 * @since 1.5.4
2094
+	 * @param string $title The page title including variables.
2095
+	 * @param string $gd_page The GeoDirectory page type if any.
2096
+	 */
2097
+	$title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2098 2098
 
2099
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">';
2100
-    echo $title;
2101
-    echo '</h1></header>';
2099
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">';
2100
+	echo $title;
2101
+	echo '</h1></header>';
2102 2102
 }
2103 2103
 
2104 2104
 add_action('geodir_add_listing_page_mandatory', 'geodir_action_add_listing_page_mandatory', 10);
@@ -2129,59 +2129,59 @@  discard block
 block discarded – undo
2129 2129
  */
2130 2130
 function geodir_action_add_listing_form()
2131 2131
 {
2132
-    global $cat_display, $post_cat, $current_user, $gd_session;
2133
-    $page_id = get_the_ID();
2134
-    $post = '';
2135
-    $title = '';
2136
-    $desc = '';
2137
-    $kw_tags = '';
2138
-    $required_msg = '';
2139
-    $submit_button = '';
2140
-
2141
-    $ajax_action = isset($_REQUEST['ajax_action']) ? $_REQUEST['ajax_action'] : 'add';
2142
-
2143
-    $thumb_img_arr = array();
2144
-    $curImages = '';
2145
-
2146
-    if (isset($_REQUEST['backandedit'])) {
2147
-        global $post;
2148
-        $post = (object)$gd_session->get('listing');
2149
-        $listing_type = $post->listing_type;
2150
-        $title = $post->post_title;
2151
-        $desc = $post->post_desc;
2152
-        $post_cat = $post->post_category;
2153
-
2154
-        $kw_tags = $post->post_tags;
2155
-        $curImages = isset($post->post_images) ? $post->post_images : '';
2156
-    } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2157
-        global $post, $post_images;
2158
-
2159
-        $post = geodir_get_post_info($_REQUEST['pid']);
2160
-        $thumb_img_arr = geodir_get_images($post->ID);
2161
-        if ($thumb_img_arr) {
2162
-            foreach ($thumb_img_arr as $post_img) {
2163
-                $curImages .= $post_img->src . ',';
2164
-            }
2165
-        }
2132
+	global $cat_display, $post_cat, $current_user, $gd_session;
2133
+	$page_id = get_the_ID();
2134
+	$post = '';
2135
+	$title = '';
2136
+	$desc = '';
2137
+	$kw_tags = '';
2138
+	$required_msg = '';
2139
+	$submit_button = '';
2140
+
2141
+	$ajax_action = isset($_REQUEST['ajax_action']) ? $_REQUEST['ajax_action'] : 'add';
2142
+
2143
+	$thumb_img_arr = array();
2144
+	$curImages = '';
2145
+
2146
+	if (isset($_REQUEST['backandedit'])) {
2147
+		global $post;
2148
+		$post = (object)$gd_session->get('listing');
2149
+		$listing_type = $post->listing_type;
2150
+		$title = $post->post_title;
2151
+		$desc = $post->post_desc;
2152
+		$post_cat = $post->post_category;
2153
+
2154
+		$kw_tags = $post->post_tags;
2155
+		$curImages = isset($post->post_images) ? $post->post_images : '';
2156
+	} elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2157
+		global $post, $post_images;
2158
+
2159
+		$post = geodir_get_post_info($_REQUEST['pid']);
2160
+		$thumb_img_arr = geodir_get_images($post->ID);
2161
+		if ($thumb_img_arr) {
2162
+			foreach ($thumb_img_arr as $post_img) {
2163
+				$curImages .= $post_img->src . ',';
2164
+			}
2165
+		}
2166 2166
 
2167
-        $listing_type = $post->post_type;
2168
-        $title = $post->post_title;
2169
-        $desc = $post->post_content;
2170
-        $kw_tags = $post->post_tags;
2171
-        $kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type . '_tags', array('fields' => 'names')));
2172
-    } else {
2173
-        $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2174
-    }
2167
+		$listing_type = $post->post_type;
2168
+		$title = $post->post_title;
2169
+		$desc = $post->post_content;
2170
+		$kw_tags = $post->post_tags;
2171
+		$kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type . '_tags', array('fields' => 'names')));
2172
+	} else {
2173
+		$listing_type = sanitize_text_field($_REQUEST['listing_type']);
2174
+	}
2175 2175
 
2176
-    if ($current_user->ID != '0') {
2177
-        $user_login = true;
2178
-    }
2176
+	if ($current_user->ID != '0') {
2177
+		$user_login = true;
2178
+	}
2179 2179
 
2180
-    $post_type_info = geodir_get_posttype_info($listing_type);
2180
+	$post_type_info = geodir_get_posttype_info($listing_type);
2181 2181
 
2182
-    $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
+	$cpt_singular_name = (isset($post_type_info['labels']['singular_name']) && $post_type_info['labels']['singular_name']) ? $post_type_info['labels']['singular_name'] : __('Listing','geodirectory');
2183 2183
 
2184
-    ?>
2184
+	?>
2185 2185
     <form name="propertyform" id="propertyform" action="<?php echo get_page_link(geodir_preview_page_id());?>" method="post" enctype="multipart/form-data">
2186 2186
         <input type="hidden" name="preview" value="<?php echo sanitize_text_field($listing_type);?>"/>
2187 2187
         <input type="hidden" name="listing_type" value="<?php echo sanitize_text_field($listing_type);?>"/>
@@ -2192,103 +2192,103 @@  discard block
 block discarded – undo
2192 2192
         <?php } if (isset($_REQUEST['backandedit'])) { ?>
2193 2193
             <input type="hidden" name="backandedit" value="<?php echo sanitize_text_field($_REQUEST['backandedit']);?>"/>
2194 2194
         <?php
2195
-        } 
2196
-        /**
2197
-         * Called at the very top of the add listing page form for frontend.
2198
-         *
2199
-         * This is called just before the "Enter Listing Details" text.
2200
-         *
2201
-         * @since 1.0.0
2202
-         */
2203
-        do_action('geodir_before_detail_fields');
2204
-        ?>
2195
+		} 
2196
+		/**
2197
+		 * Called at the very top of the add listing page form for frontend.
2198
+		 *
2199
+		 * This is called just before the "Enter Listing Details" text.
2200
+		 *
2201
+		 * @since 1.0.0
2202
+		 */
2203
+		do_action('geodir_before_detail_fields');
2204
+		?>
2205 2205
         <h5 id="geodir_fieldset_details" class="geodir-fieldset-row" gd-fieldset="details"><?php echo LISTING_DETAILS_TEXT;?></h5>
2206 2206
         <?php
2207
-        /**
2208
-         * Called at the top of the add listing page form for frontend.
2209
-         *
2210
-         * This is called after the "Enter Listing Details" text.
2211
-         *
2212
-         * @since 1.0.0
2213
-         */
2214
-        do_action('geodir_before_main_form_fields');
2215
-        ?>
2207
+		/**
2208
+		 * Called at the top of the add listing page form for frontend.
2209
+		 *
2210
+		 * This is called after the "Enter Listing Details" text.
2211
+		 *
2212
+		 * @since 1.0.0
2213
+		 */
2214
+		do_action('geodir_before_main_form_fields');
2215
+		?>
2216 2216
         <div id="geodir_post_title_row" class="required_field geodir_form_row clearfix gd-fieldset-details">
2217 2217
             <label><?php
2218
-                /**
2219
-                 * Filter the add listing page title input label.
2220
-                 *
2221
-                 * @since 1.6.11
2222
-                 * @param string $title The title to be output.
2223
-                 * @param string $cpt_singular_name The singular title of the curent CPT.
2224
-                 * @param string $listing_type The CPT being requested. ie: gd_place.
2225
-                 */
2226
-                echo apply_filters('geodir_add_listing_title_label', sprintf( __('%s Title', 'geodirectory'), $cpt_singular_name ),$cpt_singular_name,$listing_type); ?><span>*</span> </label>
2218
+				/**
2219
+				 * Filter the add listing page title input label.
2220
+				 *
2221
+				 * @since 1.6.11
2222
+				 * @param string $title The title to be output.
2223
+				 * @param string $cpt_singular_name The singular title of the curent CPT.
2224
+				 * @param string $listing_type The CPT being requested. ie: gd_place.
2225
+				 */
2226
+				echo apply_filters('geodir_add_listing_title_label', sprintf( __('%s Title', 'geodirectory'), $cpt_singular_name ),$cpt_singular_name,$listing_type); ?><span>*</span> </label>
2227 2227
             <input type="text" field_type="text" name="post_title" id="post_title" class="geodir_textfield"
2228 2228
                    value="<?php echo esc_attr(stripslashes($title)); ?>"/>
2229 2229
             <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory');?></span>
2230 2230
         </div>
2231 2231
         <?php
2232
-        $show_editor = get_option('geodir_tiny_editor_on_add_listing');
2233
-
2234
-        $desc = $show_editor ? stripslashes($desc) : esc_attr(stripslashes($desc));
2235
-        $desc_limit = '';
2236
-        /**
2237
-         * Filter the add listing description field character limit number.
2238
-         *
2239
-         * @since 1.0.0
2240
-         * @param int $desc_limit The amount of characters to limit the description to.
2241
-         */
2242
-        $desc_limit = apply_filters('geodir_description_field_desc_limit', $desc_limit);
2243
-        /**
2244
-         * Filter the add listing description field text.
2245
-         *
2246
-         * @since 1.0.0
2247
-         * @param string $desc The text for the description field.
2248
-         * @param int $desc_limit The character limit number if any.
2249
-         */
2250
-        $desc = apply_filters('geodir_description_field_desc', $desc, $desc_limit);
2251
-        $desc_limit_msg = '';
2252
-        /**
2253
-         * Filter the add listing description limit message.
2254
-         *
2255
-         * This is the message shown if there is a limit applied to the amount of characters the description can use.
2256
-         *
2257
-         * @since 1.0.0
2258
-         * @param string $desc_limit_msg The limit message string if any.
2259
-         * @param int $desc_limit The character limit numer if any.
2260
-         */
2261
-        $desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit);
2232
+		$show_editor = get_option('geodir_tiny_editor_on_add_listing');
2233
+
2234
+		$desc = $show_editor ? stripslashes($desc) : esc_attr(stripslashes($desc));
2235
+		$desc_limit = '';
2236
+		/**
2237
+		 * Filter the add listing description field character limit number.
2238
+		 *
2239
+		 * @since 1.0.0
2240
+		 * @param int $desc_limit The amount of characters to limit the description to.
2241
+		 */
2242
+		$desc_limit = apply_filters('geodir_description_field_desc_limit', $desc_limit);
2243
+		/**
2244
+		 * Filter the add listing description field text.
2245
+		 *
2246
+		 * @since 1.0.0
2247
+		 * @param string $desc The text for the description field.
2248
+		 * @param int $desc_limit The character limit number if any.
2249
+		 */
2250
+		$desc = apply_filters('geodir_description_field_desc', $desc, $desc_limit);
2251
+		$desc_limit_msg = '';
2252
+		/**
2253
+		 * Filter the add listing description limit message.
2254
+		 *
2255
+		 * This is the message shown if there is a limit applied to the amount of characters the description can use.
2256
+		 *
2257
+		 * @since 1.0.0
2258
+		 * @param string $desc_limit_msg The limit message string if any.
2259
+		 * @param int $desc_limit The character limit numer if any.
2260
+		 */
2261
+		$desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit);
2262 2262
         
2263
-        $desc_class = '';
2264
-        if ($desc_limit === '' || (int)$desc_limit > 0) {
2265
-            /**
2266
-             * Called on the add listing page form for frontend just before the description field.
2267
-             *
2268
-             * @since 1.0.0
2269
-             */
2270
-            do_action('geodir_before_description_field');
2263
+		$desc_class = '';
2264
+		if ($desc_limit === '' || (int)$desc_limit > 0) {
2265
+			/**
2266
+			 * Called on the add listing page form for frontend just before the description field.
2267
+			 *
2268
+			 * @since 1.0.0
2269
+			 */
2270
+			do_action('geodir_before_description_field');
2271 2271
             
2272
-            $desc_class = ' required_field';
2273
-        } else {
2274
-            $desc_class = ' hidden';
2275
-        }
2276
-        ?>
2272
+			$desc_class = ' required_field';
2273
+		} else {
2274
+			$desc_class = ' hidden';
2275
+		}
2276
+		?>
2277 2277
         <div id="geodir_post_desc_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $desc_class;?>">
2278 2278
             <label><?php
2279
-                /**
2280
-                 * Filter the add listing page description input label.
2281
-                 *
2282
-                 * @since 1.6.11
2283
-                 * @param string $title The title to be output.
2284
-                 * @param string $cpt_singular_name The singular title of the curent CPT.
2285
-                 * @param string $listing_type The CPT being requested. ie: gd_place.
2286
-                 */
2287
-                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>
2279
+				/**
2280
+				 * Filter the add listing page description input label.
2281
+				 *
2282
+				 * @since 1.6.11
2283
+				 * @param string $title The title to be output.
2284
+				 * @param string $cpt_singular_name The singular title of the curent CPT.
2285
+				 * @param string $listing_type The CPT being requested. ie: gd_place.
2286
+				 */
2287
+				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>
2288 2288
             <?php
2289
-            if (!empty($show_editor) && in_array($listing_type, $show_editor)) {
2290
-                $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
2291
-            ?>
2289
+			if (!empty($show_editor) && in_array($listing_type, $show_editor)) {
2290
+				$editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
2291
+			?>
2292 2292
                 <div class="editor" field_id="post_desc" field_type="editor">
2293 2293
                     <?php wp_editor($desc, "post_desc", $editor_settings); ?>
2294 2294
                 </div>
@@ -2302,56 +2302,56 @@  discard block
 block discarded – undo
2302 2302
             <span class="geodir_message_error"><?php echo _e($required_msg, 'geodirectory');?></span>
2303 2303
         </div>
2304 2304
         <?php
2305
-        if ($desc_limit === '' || (int)$desc_limit > 0) {
2306
-            /**
2307
-             * Called on the add listing page form for frontend just after the description field.
2308
-             *
2309
-             * @since 1.0.0
2310
-             */
2311
-            do_action('geodir_after_description_field');
2312
-        }
2305
+		if ($desc_limit === '' || (int)$desc_limit > 0) {
2306
+			/**
2307
+			 * Called on the add listing page form for frontend just after the description field.
2308
+			 *
2309
+			 * @since 1.0.0
2310
+			 */
2311
+			do_action('geodir_after_description_field');
2312
+		}
2313 2313
         
2314
-        $kw_tags = esc_attr(stripslashes($kw_tags));
2315
-        $kw_tags_count = TAGKW_TEXT_COUNT;
2316
-        $kw_tags_msg = TAGKW_MSG;
2317
-        /**
2318
-         * Filter the add listing tags character limit.
2319
-         *
2320
-         * @since 1.0.0
2321
-         * @param int $kw_tags_count The character count limit if any.
2322
-         */
2323
-        $kw_tags_count = apply_filters('geodir_listing_tags_field_tags_count', $kw_tags_count);
2324
-        /**
2325
-         * Filter the add listing tags field value.
2326
-         *
2327
-         * You can use the $_REQUEST values to check if this is a go back and edit value etc.
2328
-         *
2329
-         * @since 1.0.0
2330
-         * @param string $kw_tags The tag field value, usually a comma separated list of tags.
2331
-         * @param int $kw_tags_count The character count limit if any.
2332
-         */
2333
-        $kw_tags = apply_filters('geodir_listing_tags_field_tags', $kw_tags, $kw_tags_count);
2334
-        /**
2335
-         * Filter the add listing tags field message text.
2336
-         *
2337
-         * @since 1.0.0
2338
-         * @param string $kw_tags_msg The message shown under the field.
2339
-         * @param int $kw_tags_count The character count limit if any.
2340
-         */
2341
-        $kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count);
2314
+		$kw_tags = esc_attr(stripslashes($kw_tags));
2315
+		$kw_tags_count = TAGKW_TEXT_COUNT;
2316
+		$kw_tags_msg = TAGKW_MSG;
2317
+		/**
2318
+		 * Filter the add listing tags character limit.
2319
+		 *
2320
+		 * @since 1.0.0
2321
+		 * @param int $kw_tags_count The character count limit if any.
2322
+		 */
2323
+		$kw_tags_count = apply_filters('geodir_listing_tags_field_tags_count', $kw_tags_count);
2324
+		/**
2325
+		 * Filter the add listing tags field value.
2326
+		 *
2327
+		 * You can use the $_REQUEST values to check if this is a go back and edit value etc.
2328
+		 *
2329
+		 * @since 1.0.0
2330
+		 * @param string $kw_tags The tag field value, usually a comma separated list of tags.
2331
+		 * @param int $kw_tags_count The character count limit if any.
2332
+		 */
2333
+		$kw_tags = apply_filters('geodir_listing_tags_field_tags', $kw_tags, $kw_tags_count);
2334
+		/**
2335
+		 * Filter the add listing tags field message text.
2336
+		 *
2337
+		 * @since 1.0.0
2338
+		 * @param string $kw_tags_msg The message shown under the field.
2339
+		 * @param int $kw_tags_count The character count limit if any.
2340
+		 */
2341
+		$kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count);
2342 2342
         
2343
-        $tags_class = '';
2344
-        if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2345
-            /**
2346
-             * Called on the add listing page form for frontend just before the tags field.
2347
-             *
2348
-             * @since 1.0.0
2349
-             */
2350
-            do_action('geodir_before_listing_tags_field');
2351
-        } else {
2352
-            $tags_class = ' hidden';
2353
-        }
2354
-        ?>
2343
+		$tags_class = '';
2344
+		if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2345
+			/**
2346
+			 * Called on the add listing page form for frontend just before the tags field.
2347
+			 *
2348
+			 * @since 1.0.0
2349
+			 */
2350
+			do_action('geodir_before_listing_tags_field');
2351
+		} else {
2352
+			$tags_class = ' hidden';
2353
+		}
2354
+		?>
2355 2355
         <div id="geodir_post_tags_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $tags_class;?>">
2356 2356
             <label><?php echo TAGKW_TEXT; ?></label>
2357 2357
             <input name="post_tags" id="post_tags" value="<?php echo $kw_tags; ?>" type="text" class="geodir_textfield"
@@ -2359,90 +2359,90 @@  discard block
 block discarded – undo
2359 2359
             <span class="geodir_message_note"><?php echo $kw_tags_msg;?></span>
2360 2360
         </div>
2361 2361
         <?php
2362
-        if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2363
-            /**
2364
-             * Called on the add listing page form for frontend just after the tags field.
2365
-             *
2366
-             * @since 1.0.0
2367
-             */
2368
-            do_action('geodir_after_listing_tags_field');
2369
-        }
2362
+		if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2363
+			/**
2364
+			 * Called on the add listing page form for frontend just after the tags field.
2365
+			 *
2366
+			 * @since 1.0.0
2367
+			 */
2368
+			do_action('geodir_after_listing_tags_field');
2369
+		}
2370 2370
         
2371
-        $package_info = array();
2372
-        $package_info = geodir_post_package_info($package_info, $post);
2371
+		$package_info = array();
2372
+		$package_info = geodir_post_package_info($package_info, $post);
2373 2373
         
2374
-        geodir_get_custom_fields_html($package_info->pid, 'all', $listing_type);
2374
+		geodir_get_custom_fields_html($package_info->pid, 'all', $listing_type);
2375 2375
         
2376
-        // adjust values here
2377
-        $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
2378
-
2379
-        $multiple = true; // allow multiple files upload
2376
+		// adjust values here
2377
+		$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
2380 2378
 
2381
-        $width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels)
2379
+		$multiple = true; // allow multiple files upload
2382 2380
 
2383
-        $height = geodir_media_image_large_height(); // If you want to automatically resize all uploaded images then provide height here (in pixels)
2381
+		$width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels)
2384 2382
 
2385
-        $thumb_img_arr = array();
2386
-        $totImg = 0;
2387
-        if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
2388
-            $post = (object)$gd_session->get('listing');
2389
-            if (isset($post->post_images))
2390
-                $curImages = trim($post->post_images, ",");
2383
+		$height = geodir_media_image_large_height(); // If you want to automatically resize all uploaded images then provide height here (in pixels)
2391 2384
 
2385
+		$thumb_img_arr = array();
2386
+		$totImg = 0;
2387
+		if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
2388
+			$post = (object)$gd_session->get('listing');
2389
+			if (isset($post->post_images))
2390
+				$curImages = trim($post->post_images, ",");
2392 2391
 
2393
-            if ($curImages != '') {
2394
-                $curImages_array = explode(',', $curImages);
2395
-                $totImg = count($curImages_array);
2396
-            }
2397 2392
 
2398
-            $listing_type = $post->listing_type;
2393
+			if ($curImages != '') {
2394
+				$curImages_array = explode(',', $curImages);
2395
+				$totImg = count($curImages_array);
2396
+			}
2399 2397
 
2400
-        } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2401
-            $post = geodir_get_post_info((int)$_REQUEST['pid']);
2402
-            $listing_type = $post->post_type;
2403
-            $thumb_img_arr = geodir_get_images($_REQUEST['pid']);
2398
+			$listing_type = $post->listing_type;
2404 2399
 
2405
-        } else {
2406
-            $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2407
-        }
2400
+		} elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2401
+			$post = geodir_get_post_info((int)$_REQUEST['pid']);
2402
+			$listing_type = $post->post_type;
2403
+			$thumb_img_arr = geodir_get_images($_REQUEST['pid']);
2408 2404
 
2405
+		} else {
2406
+			$listing_type = sanitize_text_field($_REQUEST['listing_type']);
2407
+		}
2409 2408
 
2410
-        if (!empty($thumb_img_arr)) {
2411
-            foreach ($thumb_img_arr as $img) {
2412
-                //$curImages = $img->src.",";
2413
-            }
2414 2409
 
2415
-            $totImg = count((array)$thumb_img_arr);
2416
-        }
2410
+		if (!empty($thumb_img_arr)) {
2411
+			foreach ($thumb_img_arr as $img) {
2412
+				//$curImages = $img->src.",";
2413
+			}
2417 2414
 
2418
-        if ($curImages != '')
2419
-            $svalue = $curImages; // this will be initial value of the above form field. Image urls.
2420
-        else
2421
-            $svalue = '';
2422
-
2423
-        $image_limit = isset($package_info->image_limit) ? $package_info->image_limit : '0';
2424
-        $show_image_input_box = ($image_limit != '0');
2425
-        /**
2426
-         * Filter to be able to show/hide the image upload section of the add listing form.
2427
-         *
2428
-         * @since 1.0.0
2429
-         * @param bool $show_image_input_box Set true to show. Set false to not show.
2430
-         * @param string $listing_type The custom post type slug.
2431
-         */
2432
-        $show_image_input_box = apply_filters('geodir_image_uploader_on_add_listing', $show_image_input_box, $listing_type);
2433
-        if ($show_image_input_box) {
2434
-            ?>
2415
+			$totImg = count((array)$thumb_img_arr);
2416
+		}
2417
+
2418
+		if ($curImages != '')
2419
+			$svalue = $curImages; // this will be initial value of the above form field. Image urls.
2420
+		else
2421
+			$svalue = '';
2422
+
2423
+		$image_limit = isset($package_info->image_limit) ? $package_info->image_limit : '0';
2424
+		$show_image_input_box = ($image_limit != '0');
2425
+		/**
2426
+		 * Filter to be able to show/hide the image upload section of the add listing form.
2427
+		 *
2428
+		 * @since 1.0.0
2429
+		 * @param bool $show_image_input_box Set true to show. Set false to not show.
2430
+		 * @param string $listing_type The custom post type slug.
2431
+		 */
2432
+		$show_image_input_box = apply_filters('geodir_image_uploader_on_add_listing', $show_image_input_box, $listing_type);
2433
+		if ($show_image_input_box) {
2434
+			?>
2435 2435
 
2436 2436
             <h5 id="geodir_form_title_row" class="geodir-form_title"> <?php echo PRO_PHOTO_TEXT;?>
2437 2437
                 <?php if ($image_limit == 1) {
2438
-                    echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
2439
-                } ?>
2438
+					echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
2439
+				} ?>
2440 2440
                 <?php if ($image_limit > 1) {
2441
-                    echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>';
2442
-                } ?>
2441
+					echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>';
2442
+				} ?>
2443 2443
                 <?php if ($image_limit == '') {
2444
-                    echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>';
2445
-                } ?>
2444
+					echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>';
2445
+				} ?>
2446 2446
             </h5>
2447 2447
 
2448 2448
             <div class="geodir_form_row clearfix" id="<?php echo $id; ?>dropbox"
@@ -2480,12 +2480,12 @@  discard block
 block discarded – undo
2480 2480
         <?php } ?>
2481 2481
 
2482 2482
         <?php
2483
-        /**
2484
-         * Called on the add listing page form for frontend just after the image upload field.
2485
-         *
2486
-         * @since 1.0.0
2487
-         */
2488
-        do_action('geodir_after_main_form_fields');?>
2483
+		/**
2484
+		 * Called on the add listing page form for frontend just after the image upload field.
2485
+		 *
2486
+		 * @since 1.0.0
2487
+		 */
2488
+		do_action('geodir_after_main_form_fields');?>
2489 2489
 
2490 2490
 
2491 2491
         <!-- add captcha code -->
@@ -2514,7 +2514,7 @@  discard block
 block discarded – undo
2514 2514
 
2515 2515
     </form>
2516 2516
     <?php
2517
-    wp_reset_query();
2517
+	wp_reset_query();
2518 2518
 }
2519 2519
 
2520 2520
 /**
@@ -2525,7 +2525,7 @@  discard block
 block discarded – undo
2525 2525
  */
2526 2526
 function geodir_add_listing_sidebar_widget_area()
2527 2527
 {
2528
-    dynamic_sidebar('geodir_add_listing_sidebar');
2528
+	dynamic_sidebar('geodir_add_listing_sidebar');
2529 2529
 }
2530 2530
 
2531 2531
 add_action('geodir_add_listing_sidebar_inside', 'geodir_add_listing_sidebar_widget_area', 10);
@@ -2540,16 +2540,16 @@  discard block
 block discarded – undo
2540 2540
  */
2541 2541
 function geodir_action_add_listing_sidebar()
2542 2542
 {
2543
-    /** This action is documented in geodirectory_template_actions.php */
2544
-    do_action('geodir_sidebar_right_open', 'add-listing-page', 'geodir-sidebar', 'geodir-sidebar-right', 'http://schema.org/WPSideBar');
2545
-    /**
2546
-     * This is used to add the content to the add listing page sidebar.
2547
-     *
2548
-     * @since 1.0.0
2549
-     */
2550
-    do_action('geodir_add_listing_sidebar_inside');
2551
-    /** This action is documented in geodirectory_template_actions.php */
2552
-    do_action('geodir_sidebar_right_close', 'details-page');
2543
+	/** This action is documented in geodirectory_template_actions.php */
2544
+	do_action('geodir_sidebar_right_open', 'add-listing-page', 'geodir-sidebar', 'geodir-sidebar-right', 'http://schema.org/WPSideBar');
2545
+	/**
2546
+	 * This is used to add the content to the add listing page sidebar.
2547
+	 *
2548
+	 * @since 1.0.0
2549
+	 */
2550
+	do_action('geodir_add_listing_sidebar_inside');
2551
+	/** This action is documented in geodirectory_template_actions.php */
2552
+	do_action('geodir_sidebar_right_close', 'details-page');
2553 2553
 }
2554 2554
 
2555 2555
 ###############################################
@@ -2566,11 +2566,11 @@  discard block
 block discarded – undo
2566 2566
  */
2567 2567
 function geodir_action_geodir_sidebar_signup_top()
2568 2568
 {
2569
-    ?>
2569
+	?>
2570 2570
     <div
2571 2571
         class="<?php
2572
-        /** This action is documented in geodirectory_template_actions.php */
2573
-        echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>">
2572
+		/** This action is documented in geodirectory_template_actions.php */
2573
+		echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>">
2574 2574
         <?php dynamic_sidebar('Reg/Login Top Section');?>
2575 2575
     </div><!-- clearfix ends here-->
2576 2576
 <?php
@@ -2589,9 +2589,9 @@  discard block
 block discarded – undo
2589 2589
 function geodir_action_signup_forms()
2590 2590
 {
2591 2591
 
2592
-    global $user_login;
2592
+	global $user_login;
2593 2593
 
2594
-    ?>
2594
+	?>
2595 2595
     <script type="text/javascript">
2596 2596
         <?php if ( $user_login ) { ?>
2597 2597
         setTimeout(function () {
@@ -2627,65 +2627,65 @@  discard block
 block discarded – undo
2627 2627
         <?php } ?>
2628 2628
     </script><?php
2629 2629
 
2630
-    global $errors;
2631
-    if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim')
2632
-        $errors->add('claim_login', LOGIN_CLAIM);
2633
-
2634
-    if (!empty($errors)) {
2635
-        foreach ($errors as $errorsObj) {
2636
-            foreach ($errorsObj as $key => $val) {
2637
-                for ($i = 0; $i < count($val); $i++) {
2638
-                    echo "<div class=error_msg_fix>" . $val[$i] . '</div>';
2639
-                    $registration_error_msg = 1;
2640
-                }
2641
-            }
2642
-        }
2643
-    }
2630
+	global $errors;
2631
+	if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim')
2632
+		$errors->add('claim_login', LOGIN_CLAIM);
2633
+
2634
+	if (!empty($errors)) {
2635
+		foreach ($errors as $errorsObj) {
2636
+			foreach ($errorsObj as $key => $val) {
2637
+				for ($i = 0; $i < count($val); $i++) {
2638
+					echo "<div class=error_msg_fix>" . $val[$i] . '</div>';
2639
+					$registration_error_msg = 1;
2640
+				}
2641
+			}
2642
+		}
2643
+	}
2644 2644
 
2645
-    if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_in') {
2646
-        ?>
2645
+	if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_in') {
2646
+		?>
2647 2647
 
2648 2648
         <div class="login_form">
2649 2649
             <?php
2650
-            /**
2651
-             * Contains login form template.
2652
-             *
2653
-             * @since 1.0.0
2654
-             */
2655
-            include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2650
+			/**
2651
+			 * Contains login form template.
2652
+			 *
2653
+			 * @since 1.0.0
2654
+			 */
2655
+			include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2656 2656
         </div>
2657 2657
 
2658 2658
     <?php } elseif (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_up') { ?>
2659 2659
 
2660 2660
         <div class="registration_form">
2661 2661
             <?php
2662
-            /**
2663
-             * Contains registration form template.
2664
-             *
2665
-             * @since 1.0.0
2666
-             */
2667
-            include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2662
+			/**
2663
+			 * Contains registration form template.
2664
+			 *
2665
+			 * @since 1.0.0
2666
+			 */
2667
+			include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2668 2668
         </div>
2669 2669
 
2670 2670
     <?php } else { ?>
2671 2671
 
2672 2672
         <div class="login_form_l">
2673 2673
             <?php
2674
-            /**
2675
-             * Contains login form template.
2676
-             *
2677
-             * @since 1.0.0
2678
-             */
2679
-            include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2674
+			/**
2675
+			 * Contains login form template.
2676
+			 *
2677
+			 * @since 1.0.0
2678
+			 */
2679
+			include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2680 2680
         </div>
2681 2681
         <div class="registration_form_r">
2682 2682
             <?php
2683
-            /**
2684
-             * Contains registration form template.
2685
-             *
2686
-             * @since 1.0.0
2687
-             */
2688
-            include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2683
+			/**
2684
+			 * Contains registration form template.
2685
+			 *
2686
+			 * @since 1.0.0
2687
+			 */
2688
+			include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2689 2689
         </div>
2690 2690
 
2691 2691
     <?php }?>
@@ -2716,66 +2716,66 @@  discard block
 block discarded – undo
2716 2716
  */
2717 2717
 function geodir_action_author_page_title()
2718 2718
 {
2719
-    global $term;
2719
+	global $term;
2720 2720
 
2721
-    $gd_post_type = geodir_get_current_posttype();
2722
-    $post_type_info = get_post_type_object($gd_post_type);
2721
+	$gd_post_type = geodir_get_current_posttype();
2722
+	$post_type_info = get_post_type_object($gd_post_type);
2723 2723
 
2724
-    $add_string_in_title = __('All', 'geodirectory') . ' ';
2725
-    if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
2726
-        $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
2727
-    }
2724
+	$add_string_in_title = __('All', 'geodirectory') . ' ';
2725
+	if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
2726
+		$add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
2727
+	}
2728 2728
 
2729
-    $list_title = $add_string_in_title . $post_type_info->labels->name;
2730
-    $single_name = $post_type_info->labels->singular_name;
2729
+	$list_title = $add_string_in_title . $post_type_info->labels->name;
2730
+	$single_name = $post_type_info->labels->singular_name;
2731 2731
 
2732
-    $taxonomy = geodir_get_taxonomies($gd_post_type);
2732
+	$taxonomy = geodir_get_taxonomies($gd_post_type);
2733 2733
 
2734
-    if (!empty($term)) {
2735
-        $current_term = get_term_by('slug', $term, $taxonomy[0]);
2736
-        if (!empty($current_term))
2737
-            $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
2738
-    }
2734
+	if (!empty($term)) {
2735
+		$current_term = get_term_by('slug', $term, $taxonomy[0]);
2736
+		if (!empty($current_term))
2737
+			$list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
2738
+	}
2739 2739
 
2740 2740
 
2741
-    if (is_search()) {
2742
-        $list_title = __('Search', 'geodirectory') . ' ' . __($post_type_info->labels->name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2741
+	if (is_search()) {
2742
+		$list_title = __('Search', 'geodirectory') . ' ' . __($post_type_info->labels->name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2743 2743
 
2744
-    }
2745
-    /** This action is documented in geodirectory_template_actions.php */
2746
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
2747
-    /** This action is documented in geodirectory_template_actions.php */
2748
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2744
+	}
2745
+	/** This action is documented in geodirectory_template_actions.php */
2746
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
2747
+	/** This action is documented in geodirectory_template_actions.php */
2748
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2749 2749
 
2750
-    $title = $list_title;
2751
-    if(geodir_is_page('author')){
2752
-        $gd_page = 'author';
2753
-        if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
2754
-            $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
2755
-        }else{
2756
-            $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
2757
-        }
2750
+	$title = $list_title;
2751
+	if(geodir_is_page('author')){
2752
+		$gd_page = 'author';
2753
+		if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
2754
+			$title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
2755
+		}else{
2756
+			$title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
2757
+		}
2758 2758
 
2759
-    }
2759
+	}
2760 2760
 
2761 2761
 
2762
-    /**
2763
-     * Filter page title to replace variables.
2764
-     *
2765
-     * @since 1.5.4
2766
-     * @param string $title The page title including variables.
2767
-     * @param string $gd_page The GeoDirectory page type if any.
2768
-     */
2769
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2762
+	/**
2763
+	 * Filter page title to replace variables.
2764
+	 *
2765
+	 * @since 1.5.4
2766
+	 * @param string $title The page title including variables.
2767
+	 * @param string $gd_page The GeoDirectory page type if any.
2768
+	 */
2769
+	$title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2770 2770
 
2771
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2772
-        /**
2773
-         * Filter the author page title text.
2774
-         *
2775
-         * @since 1.0.0
2776
-         * @param string $list_title The title for the page.
2777
-         */
2778
-        apply_filters('geodir_author_page_title_text', $title) . '</h1></header>';
2771
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2772
+		/**
2773
+		 * Filter the author page title text.
2774
+		 *
2775
+		 * @since 1.0.0
2776
+		 * @param string $list_title The title for the page.
2777
+		 */
2778
+		apply_filters('geodir_author_page_title_text', $title) . '</h1></header>';
2779 2779
 }
2780 2780
 
2781 2781
 
@@ -2793,11 +2793,11 @@  discard block
 block discarded – undo
2793 2793
  */
2794 2794
 function geodir_action_geodir_sidebar_author_top()
2795 2795
 {
2796
-    if (get_option('geodir_show_author_top_section')) { ?>
2796
+	if (get_option('geodir_show_author_top_section')) { ?>
2797 2797
         <div
2798 2798
             class="<?php
2799
-            /** This action is documented in geodirectory_template_actions.php */
2800
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_top'); ?>">
2799
+			/** This action is documented in geodirectory_template_actions.php */
2800
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_top'); ?>">
2801 2801
             <?php dynamic_sidebar('geodir_author_top'); ?>
2802 2802
         </div><!-- clearfix ends here-->
2803 2803
     <?php }
@@ -2813,7 +2813,7 @@  discard block
 block discarded – undo
2813 2813
  */
2814 2814
 function geodir_author_left_section()
2815 2815
 {
2816
-    if (get_option('geodir_show_author_left_section')) { ?>
2816
+	if (get_option('geodir_show_author_left_section')) { ?>
2817 2817
         <div class="geodir-content-left geodir-sidebar-wrap">
2818 2818
             <?php dynamic_sidebar('geodir_author_left_sidebar'); ?>
2819 2819
         </div><!-- end geodir-content-left -->
@@ -2834,19 +2834,19 @@  discard block
 block discarded – undo
2834 2834
  */
2835 2835
 function geodir_action_author_sidebar_left()
2836 2836
 {
2837
-    if (get_option('geodir_show_author_left_section')) {
2837
+	if (get_option('geodir_show_author_left_section')) {
2838 2838
 // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
2839
-        /** This action is documented in geodirectory_template_actions.php */
2840
-        do_action('geodir_sidebar_left_open', 'author-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
2841
-        /**
2842
-         * This is used to add the content to the author page left sidebar (if active).
2843
-         *
2844
-         * @since 1.0.0
2845
-         */
2846
-        do_action('geodir_author_sidebar_left_inside');
2847
-        /** This action is documented in geodirectory_template_actions.php */
2848
-        do_action('geodir_sidebar_left_close', 'author-page');
2849
-    }
2839
+		/** This action is documented in geodirectory_template_actions.php */
2840
+		do_action('geodir_sidebar_left_open', 'author-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
2841
+		/**
2842
+		 * This is used to add the content to the author page left sidebar (if active).
2843
+		 *
2844
+		 * @since 1.0.0
2845
+		 */
2846
+		do_action('geodir_author_sidebar_left_inside');
2847
+		/** This action is documented in geodirectory_template_actions.php */
2848
+		do_action('geodir_sidebar_left_close', 'author-page');
2849
+	}
2850 2850
 }
2851 2851
 
2852 2852
 /**
@@ -2859,7 +2859,7 @@  discard block
 block discarded – undo
2859 2859
  */
2860 2860
 function geodir_author_right_section()
2861 2861
 {
2862
-    if (get_option('geodir_show_author_right_section')) { ?>
2862
+	if (get_option('geodir_show_author_right_section')) { ?>
2863 2863
         <div class="geodir-content-right geodir-sidebar-wrap">
2864 2864
             <?php dynamic_sidebar('geodir_author_right_sidebar'); ?>
2865 2865
         </div><!-- end geodir-content-right -->
@@ -2879,18 +2879,18 @@  discard block
 block discarded – undo
2879 2879
  */
2880 2880
 function geodir_action_author_sidebar_right()
2881 2881
 {
2882
-    if (get_option('geodir_show_author_right_section')) {
2883
-        /** This action is documented in geodirectory_template_actions.php */
2884
-        do_action('geodir_sidebar_right_open', 'author-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
2885
-        /**
2886
-         * This is used to add the content to the author page right sidebar (if active).
2887
-         *
2888
-         * @since 1.0.0
2889
-         */
2890
-        do_action('geodir_author_sidebar_right_inside');
2891
-        /** This action is documented in geodirectory_template_actions.php */
2892
-        do_action('geodir_sidebar_right_close', 'author-page');
2893
-    }
2882
+	if (get_option('geodir_show_author_right_section')) {
2883
+		/** This action is documented in geodirectory_template_actions.php */
2884
+		do_action('geodir_sidebar_right_open', 'author-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
2885
+		/**
2886
+		 * This is used to add the content to the author page right sidebar (if active).
2887
+		 *
2888
+		 * @since 1.0.0
2889
+		 */
2890
+		do_action('geodir_author_sidebar_right_inside');
2891
+		/** This action is documented in geodirectory_template_actions.php */
2892
+		do_action('geodir_sidebar_right_close', 'author-page');
2893
+	}
2894 2894
 }
2895 2895
 
2896 2896
 /**
@@ -2902,14 +2902,14 @@  discard block
 block discarded – undo
2902 2902
  */
2903 2903
 function geodir_action_author_content_inside()
2904 2904
 {
2905
-    global $gridview_columns;
2906
-    $listing_view = get_option('geodir_author_view');
2907
-    if (strstr($listing_view, 'gridview')) {
2908
-        $gridview_columns = $listing_view;
2909
-        $listing_view_exp = explode('_', $listing_view);
2910
-        $listing_view = $listing_view_exp[0];
2911
-    }
2912
-    geodir_get_template_part('listing', 'listview');
2905
+	global $gridview_columns;
2906
+	$listing_view = get_option('geodir_author_view');
2907
+	if (strstr($listing_view, 'gridview')) {
2908
+		$gridview_columns = $listing_view;
2909
+		$listing_view_exp = explode('_', $listing_view);
2910
+		$listing_view = $listing_view_exp[0];
2911
+	}
2912
+	geodir_get_template_part('listing', 'listview');
2913 2913
 }
2914 2914
 
2915 2915
 add_action('geodir_author_content_inside', 'geodir_action_author_content_inside', 10);
@@ -2924,22 +2924,22 @@  discard block
 block discarded – undo
2924 2924
  */
2925 2925
 function geodir_action_author_content()
2926 2926
 {
2927
-    /** This action is documented in geodirectory_template_actions.php */
2928
-    do_action('geodir_main_content_open', 'author-page', 'geodir-main-content', 'author-page');
2929
-    echo '<div class="clearfix">';
2930
-    /** This action is documented in geodirectory_template_actions.php */
2931
-    do_action('geodir_before_listing');
2932
-    echo '</div>';
2933
-    /**
2934
-     * This is used to add the content to the author page main content.
2935
-     *
2936
-     * @since 1.0.0
2937
-     */
2938
-    do_action('geodir_author_content_inside');
2939
-    /** This action is documented in geodirectory_template_actions.php */
2940
-    do_action('geodir_after_listing');
2941
-    /** This action is documented in geodirectory_template_actions.php */
2942
-    do_action('geodir_main_content_close', 'author-page');
2927
+	/** This action is documented in geodirectory_template_actions.php */
2928
+	do_action('geodir_main_content_open', 'author-page', 'geodir-main-content', 'author-page');
2929
+	echo '<div class="clearfix">';
2930
+	/** This action is documented in geodirectory_template_actions.php */
2931
+	do_action('geodir_before_listing');
2932
+	echo '</div>';
2933
+	/**
2934
+	 * This is used to add the content to the author page main content.
2935
+	 *
2936
+	 * @since 1.0.0
2937
+	 */
2938
+	do_action('geodir_author_content_inside');
2939
+	/** This action is documented in geodirectory_template_actions.php */
2940
+	do_action('geodir_after_listing');
2941
+	/** This action is documented in geodirectory_template_actions.php */
2942
+	do_action('geodir_main_content_close', 'author-page');
2943 2943
 }
2944 2944
 
2945 2945
 add_action('geodir_sidebar_author_bottom_section', 'geodir_action_sidebar_author_bottom_section', 10);
@@ -2953,11 +2953,11 @@  discard block
 block discarded – undo
2953 2953
  */
2954 2954
 function geodir_action_sidebar_author_bottom_section()
2955 2955
 {
2956
-    if (get_option('geodir_show_author_bottom_section')) { ?>
2956
+	if (get_option('geodir_show_author_bottom_section')) { ?>
2957 2957
         <div
2958 2958
             class="<?php
2959
-            /** This action is documented in geodirectory_template_actions.php */
2960
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_bottom'); ?>">
2959
+			/** This action is documented in geodirectory_template_actions.php */
2960
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_bottom'); ?>">
2961 2961
             <?php dynamic_sidebar('geodir_author_bottom'); ?>
2962 2962
         </div><!-- clearfix ends here-->
2963 2963
     <?php }
@@ -2976,23 +2976,23 @@  discard block
 block discarded – undo
2976 2976
  */
2977 2977
 function geodir_action_search_page_title()
2978 2978
 {
2979
-    $gd_post_type = geodir_get_current_posttype();
2980
-    $post_type_info = get_post_type_object($gd_post_type);
2979
+	$gd_post_type = geodir_get_current_posttype();
2980
+	$post_type_info = get_post_type_object($gd_post_type);
2981 2981
 
2982
-    $pt_name = '';
2983
-    if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;}
2982
+	$pt_name = '';
2983
+	if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;}
2984 2984
 
2985
-    if (is_search()) {
2986
-        $list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2985
+	if (is_search()) {
2986
+		$list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2987 2987
 
2988
-    }
2989
-    /** This action is documented in geodirectory_template_actions.php */
2990
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
2991
-    /** This action is documented in geodirectory_template_actions.php */
2992
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2993
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2994
-        /** This action is documented in geodirectory_template_actions.php */
2995
-        apply_filters('geodir_listing_page_title', wptexturize($list_title)) . '</h1></header>';
2988
+	}
2989
+	/** This action is documented in geodirectory_template_actions.php */
2990
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
2991
+	/** This action is documented in geodirectory_template_actions.php */
2992
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2993
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2994
+		/** This action is documented in geodirectory_template_actions.php */
2995
+		apply_filters('geodir_listing_page_title', wptexturize($list_title)) . '</h1></header>';
2996 2996
 }
2997 2997
 
2998 2998
 // action for adding the listings page top widget area
@@ -3008,11 +3008,11 @@  discard block
 block discarded – undo
3008 3008
  */
3009 3009
 function geodir_action_geodir_sidebar_search_top()
3010 3010
 {
3011
-    if (get_option('geodir_show_search_top_section')) { ?>
3011
+	if (get_option('geodir_show_search_top_section')) { ?>
3012 3012
         <div
3013 3013
             class="<?php
3014
-            /** This action is documented in geodirectory_template_actions.php */
3015
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_top'); ?>">
3014
+			/** This action is documented in geodirectory_template_actions.php */
3015
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_top'); ?>">
3016 3016
             <?php dynamic_sidebar('geodir_search_top'); ?>
3017 3017
         </div><!-- clearfix ends here-->
3018 3018
     <?php }
@@ -3028,7 +3028,7 @@  discard block
 block discarded – undo
3028 3028
  */
3029 3029
 function geodir_search_left_section()
3030 3030
 {
3031
-    if (get_option('geodir_show_search_left_section')) { ?>
3031
+	if (get_option('geodir_show_search_left_section')) { ?>
3032 3032
         <div class="geodir-content-left geodir-sidebar-wrap">
3033 3033
             <?php dynamic_sidebar('geodir_search_left_sidebar'); ?>
3034 3034
         </div><!-- end geodir-content-left -->
@@ -3048,19 +3048,19 @@  discard block
 block discarded – undo
3048 3048
  */
3049 3049
 function geodir_action_search_sidebar_left()
3050 3050
 {
3051
-    if (get_option('geodir_show_search_left_section')) {
3051
+	if (get_option('geodir_show_search_left_section')) {
3052 3052
 // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
3053
-        /** This action is documented in geodirectory_template_actions.php */
3054
-        do_action('geodir_sidebar_left_open', 'search-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3055
-        /**
3056
-         * This is used to add the content to the search page left sidebar (if active).
3057
-         *
3058
-         * @since 1.0.0
3059
-         */
3060
-        do_action('geodir_search_sidebar_left_inside');
3061
-        /** This action is documented in geodirectory_template_actions.php */
3062
-        do_action('geodir_sidebar_left_close', 'search-page');
3063
-    }
3053
+		/** This action is documented in geodirectory_template_actions.php */
3054
+		do_action('geodir_sidebar_left_open', 'search-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3055
+		/**
3056
+		 * This is used to add the content to the search page left sidebar (if active).
3057
+		 *
3058
+		 * @since 1.0.0
3059
+		 */
3060
+		do_action('geodir_search_sidebar_left_inside');
3061
+		/** This action is documented in geodirectory_template_actions.php */
3062
+		do_action('geodir_sidebar_left_close', 'search-page');
3063
+	}
3064 3064
 }
3065 3065
 
3066 3066
 /**
@@ -3073,7 +3073,7 @@  discard block
 block discarded – undo
3073 3073
  */
3074 3074
 function geodir_search_right_section()
3075 3075
 {
3076
-    if (get_option('geodir_show_search_right_section')) { ?>
3076
+	if (get_option('geodir_show_search_right_section')) { ?>
3077 3077
         <div class="geodir-content-right geodir-sidebar-wrap">
3078 3078
             <?php dynamic_sidebar('geodir_search_right_sidebar'); ?>
3079 3079
         </div><!-- end geodir-content-right -->
@@ -3093,18 +3093,18 @@  discard block
 block discarded – undo
3093 3093
  */
3094 3094
 function geodir_action_search_sidebar_right()
3095 3095
 {
3096
-    if (get_option('geodir_show_search_right_section')) {
3097
-        /** This action is documented in geodirectory_template_actions.php */
3098
-        do_action('geodir_sidebar_right_open', 'search-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3099
-        /**
3100
-         * This is used to add the content to the search page right sidebar (if active).
3101
-         *
3102
-         * @since 1.0.0
3103
-         */
3104
-        do_action('geodir_search_sidebar_right_inside');
3105
-        /** This action is documented in geodirectory_template_actions.php */
3106
-        do_action('geodir_sidebar_right_close', 'search-page');
3107
-    }
3096
+	if (get_option('geodir_show_search_right_section')) {
3097
+		/** This action is documented in geodirectory_template_actions.php */
3098
+		do_action('geodir_sidebar_right_open', 'search-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3099
+		/**
3100
+		 * This is used to add the content to the search page right sidebar (if active).
3101
+		 *
3102
+		 * @since 1.0.0
3103
+		 */
3104
+		do_action('geodir_search_sidebar_right_inside');
3105
+		/** This action is documented in geodirectory_template_actions.php */
3106
+		do_action('geodir_sidebar_right_close', 'search-page');
3107
+	}
3108 3108
 }
3109 3109
 
3110 3110
 
@@ -3119,11 +3119,11 @@  discard block
 block discarded – undo
3119 3119
  */
3120 3120
 function geodir_action_sidebar_search_bottom_section()
3121 3121
 {
3122
-    if (get_option('geodir_show_search_bottom_section')) { ?>
3122
+	if (get_option('geodir_show_search_bottom_section')) { ?>
3123 3123
         <div
3124 3124
             class="<?php
3125
-            /** This action is documented in geodirectory_template_actions.php */
3126
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_bottom'); ?>">
3125
+			/** This action is documented in geodirectory_template_actions.php */
3126
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_bottom'); ?>">
3127 3127
             <?php dynamic_sidebar('geodir_search_bottom'); ?>
3128 3128
         </div><!-- clearfix ends here-->
3129 3129
     <?php }
@@ -3138,14 +3138,14 @@  discard block
 block discarded – undo
3138 3138
  */
3139 3139
 function geodir_action_search_content_inside()
3140 3140
 {
3141
-    global $gridview_columns;
3142
-    $listing_view = get_option('geodir_search_view');
3143
-    if (strstr($listing_view, 'gridview')) {
3144
-        $gridview_columns = $listing_view;
3145
-        $listing_view_exp = explode('_', $listing_view);
3146
-        $listing_view = $listing_view_exp[0];
3147
-    }
3148
-    geodir_get_template_part('listing', 'listview');
3141
+	global $gridview_columns;
3142
+	$listing_view = get_option('geodir_search_view');
3143
+	if (strstr($listing_view, 'gridview')) {
3144
+		$gridview_columns = $listing_view;
3145
+		$listing_view_exp = explode('_', $listing_view);
3146
+		$listing_view = $listing_view_exp[0];
3147
+	}
3148
+	geodir_get_template_part('listing', 'listview');
3149 3149
 }
3150 3150
 
3151 3151
 add_action('geodir_search_content_inside', 'geodir_action_search_content_inside', 10);
@@ -3161,22 +3161,22 @@  discard block
 block discarded – undo
3161 3161
  */
3162 3162
 function geodir_action_search_content()
3163 3163
 {
3164
-    /** This action is documented in geodirectory_template_actions.php */
3165
-    do_action('geodir_main_content_open', 'search-page', 'geodir-main-content', 'search-page');
3166
-    echo '<div class="clearfix">';
3167
-    /** This action is documented in geodirectory_template_actions.php */
3168
-    do_action('geodir_before_listing');
3169
-    echo '</div>';
3170
-    /**
3171
-     * This is used to add the content to the search page main content.
3172
-     *
3173
-     * @since 1.0.0
3174
-     */
3175
-    do_action('geodir_search_content_inside');
3176
-    /** This action is documented in geodirectory_template_actions.php */
3177
-    do_action('geodir_after_listing');
3178
-    /** This action is documented in geodirectory_template_actions.php */
3179
-    do_action('geodir_main_content_close', 'search-page');
3164
+	/** This action is documented in geodirectory_template_actions.php */
3165
+	do_action('geodir_main_content_open', 'search-page', 'geodir-main-content', 'search-page');
3166
+	echo '<div class="clearfix">';
3167
+	/** This action is documented in geodirectory_template_actions.php */
3168
+	do_action('geodir_before_listing');
3169
+	echo '</div>';
3170
+	/**
3171
+	 * This is used to add the content to the search page main content.
3172
+	 *
3173
+	 * @since 1.0.0
3174
+	 */
3175
+	do_action('geodir_search_content_inside');
3176
+	/** This action is documented in geodirectory_template_actions.php */
3177
+	do_action('geodir_after_listing');
3178
+	/** This action is documented in geodirectory_template_actions.php */
3179
+	do_action('geodir_main_content_close', 'search-page');
3180 3180
 }
3181 3181
 
3182 3182
 ###############################################
@@ -3199,11 +3199,11 @@  discard block
 block discarded – undo
3199 3199
  */
3200 3200
 function geodir_action_geodir_sidebar_home_top()
3201 3201
 {
3202
-    if (get_option('geodir_show_home_top_section')) { ?>
3202
+	if (get_option('geodir_show_home_top_section')) { ?>
3203 3203
         <div
3204 3204
             class="<?php
3205
-            /** This action is documented in geodirectory_template_actions.php */
3206
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_top'); ?>">
3205
+			/** This action is documented in geodirectory_template_actions.php */
3206
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_top'); ?>">
3207 3207
             <?php dynamic_sidebar('geodir_home_top'); ?>
3208 3208
         </div><!-- clearfix ends here-->
3209 3209
     <?php }
@@ -3219,7 +3219,7 @@  discard block
 block discarded – undo
3219 3219
  */
3220 3220
 function geodir_home_left_section()
3221 3221
 {
3222
-    if (get_option('geodir_show_home_left_section')) { ?>
3222
+	if (get_option('geodir_show_home_left_section')) { ?>
3223 3223
         <div class="geodir-content-left geodir-sidebar-wrap">
3224 3224
             <?php dynamic_sidebar('geodir_home_left'); ?>
3225 3225
         </div><!-- end geodir-content-left -->
@@ -3241,19 +3241,19 @@  discard block
 block discarded – undo
3241 3241
  */
3242 3242
 function geodir_action_home_sidebar_left()
3243 3243
 {
3244
-    if (get_option('geodir_show_home_left_section')) {
3244
+	if (get_option('geodir_show_home_left_section')) {
3245 3245
 // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
3246
-        /** This action is documented in geodirectory_template_actions.php */
3247
-        do_action('geodir_sidebar_left_open', 'home-page', 'geodir-sidebar-left', 'geodir-sidebar geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3248
-        /**
3249
-         * This is used to add the content to the home page left sidebar (if active).
3250
-         *
3251
-         * @since 1.0.0
3252
-         */
3253
-        do_action('geodir_home_sidebar_left_inside');
3254
-        /** This action is documented in geodirectory_template_actions.php */
3255
-        do_action('geodir_sidebar_left_close', 'home-page');
3256
-    }
3246
+		/** This action is documented in geodirectory_template_actions.php */
3247
+		do_action('geodir_sidebar_left_open', 'home-page', 'geodir-sidebar-left', 'geodir-sidebar geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3248
+		/**
3249
+		 * This is used to add the content to the home page left sidebar (if active).
3250
+		 *
3251
+		 * @since 1.0.0
3252
+		 */
3253
+		do_action('geodir_home_sidebar_left_inside');
3254
+		/** This action is documented in geodirectory_template_actions.php */
3255
+		do_action('geodir_sidebar_left_close', 'home-page');
3256
+	}
3257 3257
 }
3258 3258
 
3259 3259
 /**
@@ -3266,7 +3266,7 @@  discard block
 block discarded – undo
3266 3266
  */
3267 3267
 function geodir_home_right_section()
3268 3268
 {
3269
-    if (get_option('geodir_show_home_right_section')) { ?>
3269
+	if (get_option('geodir_show_home_right_section')) { ?>
3270 3270
         <div class="geodir-content-right geodir-sidebar-wrap">
3271 3271
             <?php dynamic_sidebar('geodir_home_right'); ?>
3272 3272
         </div><!-- end geodir-content-right -->
@@ -3287,18 +3287,18 @@  discard block
 block discarded – undo
3287 3287
  */
3288 3288
 function geodir_action_home_sidebar_right()
3289 3289
 {
3290
-    if (get_option('geodir_show_home_right_section')) {
3291
-        /** This action is documented in geodirectory_template_actions.php */
3292
-        do_action('geodir_sidebar_right_open', 'home-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3293
-        /**
3294
-         * This is used to add the content to the home page right sidebar (if active).
3295
-         *
3296
-         * @since 1.0.0
3297
-         */
3298
-        do_action('geodir_home_sidebar_right_inside');
3299
-        /** This action is documented in geodirectory_template_actions.php */
3300
-        do_action('geodir_sidebar_right_close', 'home-page');
3301
-    }
3290
+	if (get_option('geodir_show_home_right_section')) {
3291
+		/** This action is documented in geodirectory_template_actions.php */
3292
+		do_action('geodir_sidebar_right_open', 'home-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3293
+		/**
3294
+		 * This is used to add the content to the home page right sidebar (if active).
3295
+		 *
3296
+		 * @since 1.0.0
3297
+		 */
3298
+		do_action('geodir_home_sidebar_right_inside');
3299
+		/** This action is documented in geodirectory_template_actions.php */
3300
+		do_action('geodir_sidebar_right_close', 'home-page');
3301
+	}
3302 3302
 }
3303 3303
 
3304 3304
 /**
@@ -3309,7 +3309,7 @@  discard block
 block discarded – undo
3309 3309
  */
3310 3310
 function geodir_action_home_content_inside()
3311 3311
 {
3312
-    dynamic_sidebar('geodir_home_content');
3312
+	dynamic_sidebar('geodir_home_content');
3313 3313
 }
3314 3314
 
3315 3315
 add_action('geodir_home_content_inside', 'geodir_action_home_content_inside', 10);
@@ -3324,28 +3324,28 @@  discard block
 block discarded – undo
3324 3324
  */
3325 3325
 function geodir_action_home_content()
3326 3326
 {
3327
-    /** This action is documented in geodirectory_template_actions.php */
3328
-    do_action('geodir_main_content_open', 'home-page', 'geodir-main-content', 'home-page');
3329
-    /**
3330
-     * This called before the home page main content.
3331
-     *
3332
-     * @since 1.0.0
3333
-     */
3334
-    do_action('geodir_before_home_content');
3335
-    /**
3336
-     * This is used to add the content to the home page main content.
3337
-     *
3338
-     * @since 1.0.0
3339
-     */
3340
-    do_action('geodir_home_content_inside');
3341
-    /**
3342
-     * This is called after the homepage main content.
3343
-     *
3344
-     * @since 1.0.0
3345
-     */
3346
-    do_action('geodir_after_home_content');
3347
-    /** This action is documented in geodirectory_template_actions.php */
3348
-    do_action('geodir_main_content_close', 'home-page');
3327
+	/** This action is documented in geodirectory_template_actions.php */
3328
+	do_action('geodir_main_content_open', 'home-page', 'geodir-main-content', 'home-page');
3329
+	/**
3330
+	 * This called before the home page main content.
3331
+	 *
3332
+	 * @since 1.0.0
3333
+	 */
3334
+	do_action('geodir_before_home_content');
3335
+	/**
3336
+	 * This is used to add the content to the home page main content.
3337
+	 *
3338
+	 * @since 1.0.0
3339
+	 */
3340
+	do_action('geodir_home_content_inside');
3341
+	/**
3342
+	 * This is called after the homepage main content.
3343
+	 *
3344
+	 * @since 1.0.0
3345
+	 */
3346
+	do_action('geodir_after_home_content');
3347
+	/** This action is documented in geodirectory_template_actions.php */
3348
+	do_action('geodir_main_content_close', 'home-page');
3349 3349
 }
3350 3350
 
3351 3351
 add_action('geodir_sidebar_location_bottom_section', 'geodir_action_sidebar_home_bottom_section', 10);
@@ -3360,11 +3360,11 @@  discard block
 block discarded – undo
3360 3360
  */
3361 3361
 function geodir_action_sidebar_home_bottom_section()
3362 3362
 {
3363
-    if (get_option('geodir_show_home_bottom_section')) { ?>
3363
+	if (get_option('geodir_show_home_bottom_section')) { ?>
3364 3364
         <div
3365 3365
             class="<?php
3366
-            /** This action is documented in geodirectory_template_actions.php */
3367
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_bottom'); ?>">
3366
+			/** This action is documented in geodirectory_template_actions.php */
3367
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_bottom'); ?>">
3368 3368
             <?php dynamic_sidebar('geodir_home_bottom'); ?>
3369 3369
         </div><!-- clearfix ends here-->
3370 3370
     <?php }
@@ -3392,13 +3392,13 @@  discard block
 block discarded – undo
3392 3392
  */
3393 3393
 function geodir_filter_listing_page_title($list_title)
3394 3394
 {
3395
-    if (is_search() && trim(get_search_query()) == '') {
3396
-        $gd_post_type = geodir_get_current_posttype();
3397
-        $post_type_info = get_post_type_object($gd_post_type);
3395
+	if (is_search() && trim(get_search_query()) == '') {
3396
+		$gd_post_type = geodir_get_current_posttype();
3397
+		$post_type_info = get_post_type_object($gd_post_type);
3398 3398
 
3399
-        $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' :', 'geodirectory');
3400
-    }
3401
-    return $list_title;
3399
+		$list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' :', 'geodirectory');
3400
+	}
3401
+	return $list_title;
3402 3402
 }
3403 3403
 
3404 3404
 add_action('geodir_message_not_found_on_listing', 'geodir_display_message_not_found_on_listing');
@@ -3413,62 +3413,62 @@  discard block
 block discarded – undo
3413 3413
  * @param string $gd_page The geodirectory page type. Default null.
3414 3414
  */
3415 3415
 function geodir_add_page_content( $position = 'before', $gd_page = '' ) {
3416
-    global $post;
3417
-
3418
-    $gd_page_id = NULL;
3419
-    if ($gd_page == 'home-page' && geodir_is_page('home')) {
3420
-        $gd_page_id = geodir_home_page_id();
3421
-    } else if ($gd_page == 'details-page' && geodir_is_page('preview')) {
3422
-        $gd_page_id = geodir_preview_page_id();
3423
-    } else if ($gd_page == 'add-listing-page' && geodir_is_page('add-listing')) {
3424
-        $gd_page_id = geodir_add_listing_page_id();
3425
-    } else if ($gd_page == 'success-page' && geodir_is_page('listing-success')) {
3426
-        $gd_page_id = geodir_success_page_id();
3427
-    } else if ($gd_page == 'location-page' && geodir_is_page('location')) {
3428
-        $gd_page_id = geodir_location_page_id();
3429
-    } else if ($gd_page == 'info-page' && geodir_is_page('info')) {
3430
-        $gd_page_id = geodir_info_page_id();
3431
-    } else if ($gd_page == 'signup-page' && geodir_is_page('login')) {
3432
-        $gd_page_id = geodir_login_page_id();
3433
-    } else if ($gd_page == 'checkout-page' && geodir_is_page('checkout')) {
3434
-        $gd_page_id = geodir_payment_checkout_page_id();
3435
-    } else if ($gd_page == 'invoices-page' && geodir_is_page('invoices')) {
3436
-        $gd_page_id = geodir_payment_invoices_page_id();
3437
-    }
3438
-
3439
-    if (!$gd_page_id > 0) {
3440
-        return;
3441
-    }
3416
+	global $post;
3417
+
3418
+	$gd_page_id = NULL;
3419
+	if ($gd_page == 'home-page' && geodir_is_page('home')) {
3420
+		$gd_page_id = geodir_home_page_id();
3421
+	} else if ($gd_page == 'details-page' && geodir_is_page('preview')) {
3422
+		$gd_page_id = geodir_preview_page_id();
3423
+	} else if ($gd_page == 'add-listing-page' && geodir_is_page('add-listing')) {
3424
+		$gd_page_id = geodir_add_listing_page_id();
3425
+	} else if ($gd_page == 'success-page' && geodir_is_page('listing-success')) {
3426
+		$gd_page_id = geodir_success_page_id();
3427
+	} else if ($gd_page == 'location-page' && geodir_is_page('location')) {
3428
+		$gd_page_id = geodir_location_page_id();
3429
+	} else if ($gd_page == 'info-page' && geodir_is_page('info')) {
3430
+		$gd_page_id = geodir_info_page_id();
3431
+	} else if ($gd_page == 'signup-page' && geodir_is_page('login')) {
3432
+		$gd_page_id = geodir_login_page_id();
3433
+	} else if ($gd_page == 'checkout-page' && geodir_is_page('checkout')) {
3434
+		$gd_page_id = geodir_payment_checkout_page_id();
3435
+	} else if ($gd_page == 'invoices-page' && geodir_is_page('invoices')) {
3436
+		$gd_page_id = geodir_payment_invoices_page_id();
3437
+	}
3438
+
3439
+	if (!$gd_page_id > 0) {
3440
+		return;
3441
+	}
3442 3442
     
3443
-    $display = 'before';
3444
-    /**
3445
-     * Filter the position to display the page content.
3446
-     *
3447
-     * @since 1.6.3
3448
-     *
3449
-     * @param string $display Position to add the post content.
3450
-     * @param string $gd_page The geodirectory page type.
3451
-     */
3452
-    $display = apply_filters('geodir_add_page_content_position', $display, $gd_page);
3453
-
3454
-    if ($position !== $display) {
3455
-        return;
3456
-    }
3457
-
3458
-    $gd_post = $post;
3443
+	$display = 'before';
3444
+	/**
3445
+	 * Filter the position to display the page content.
3446
+	 *
3447
+	 * @since 1.6.3
3448
+	 *
3449
+	 * @param string $display Position to add the post content.
3450
+	 * @param string $gd_page The geodirectory page type.
3451
+	 */
3452
+	$display = apply_filters('geodir_add_page_content_position', $display, $gd_page);
3453
+
3454
+	if ($position !== $display) {
3455
+		return;
3456
+	}
3457
+
3458
+	$gd_post = $post;
3459 3459
     
3460
-    setup_postdata(get_post($gd_page_id));
3460
+	setup_postdata(get_post($gd_page_id));
3461 3461
 
3462
-    if (get_the_content()) {
3463
-        ?>
3462
+	if (get_the_content()) {
3463
+		?>
3464 3464
         <section class="entry-content clearfix" itemprop="articleBody"><?php the_content(); ?></section>
3465 3465
         <?php
3466
-    }
3466
+	}
3467 3467
 
3468
-    $post = $gd_post;
3469
-    if (!empty($gd_post) && is_object($gd_post)) {
3470
-        setup_postdata($gd_post);
3471
-    }
3468
+	$post = $gd_post;
3469
+	if (!empty($gd_post) && is_object($gd_post)) {
3470
+		setup_postdata($gd_post);
3471
+	}
3472 3472
 
3473 3473
 }
3474 3474
 add_action('geodir_add_page_content', 'geodir_add_page_content', 10, 2);
3475 3475
\ No newline at end of file
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.
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,29 +59,29 @@  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
-        $json_content = wp_specialchars_decode($json_content); // Fixed #post-320722 on 2016-12-08
76
-        $list_json = '[{"totalcount":"' . $totalcount . '",' . $json_content . ']';
77
-    } else {
78
-        $list_json = '[{"totalcount":"0"}]';
79
-    }
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
+		$json_content = wp_specialchars_decode($json_content); // Fixed #post-320722 on 2016-12-08
76
+		$list_json = '[{"totalcount":"' . $totalcount . '",' . $json_content . ']';
77
+	} else {
78
+		$list_json = '[{"totalcount":"0"}]';
79
+	}
80 80
 
81
-    $listing_map_args = array('list_json' => $list_json);
81
+	$listing_map_args = array('list_json' => $list_json);
82 82
 
83
-    // Pass the json data in listing map script
84
-    wp_localize_script('geodir-listing-map-widget', 'listing_map_args', $listing_map_args);
83
+	// Pass the json data in listing map script
84
+	wp_localize_script('geodir-listing-map-widget', 'listing_map_args', $listing_map_args);
85 85
 
86 86
 }
87 87
 
@@ -93,187 +93,187 @@  discard block
 block discarded – undo
93 93
 class geodir_map_listingpage extends WP_Widget
94 94
 {
95 95
 
96
-    /**
96
+	/**
97 97
 	 * Register the listing page map widget.
98 98
 	 *
99 99
 	 * @since 1.0.0
100
-     * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct.
100
+	 * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct.
101 101
 	 */
102
-    public function __construct() {
103
-        $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'));
104
-        parent::__construct(
105
-            'geodir_map_v3_listing_map', // Base ID
106
-            __('GD > GMap - Listing page', 'geodirectory'), // Name
107
-            $widget_ops// Args
108
-        );
102
+	public function __construct() {
103
+		$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'));
104
+		parent::__construct(
105
+			'geodir_map_v3_listing_map', // Base ID
106
+			__('GD > GMap - Listing page', 'geodirectory'), // Name
107
+			$widget_ops// Args
108
+		);
109 109
 
110
-        add_action('wp_head', 'init_listing_map_script'); // Initialize the map object and marker array
110
+		add_action('wp_head', 'init_listing_map_script'); // Initialize the map object and marker array
111 111
 
112
-        add_action('the_post', 'create_list_jsondata'); // Add marker in json array
112
+		add_action('the_post', 'create_list_jsondata'); // Add marker in json array
113 113
 
114
-        add_action('wp_footer', 'show_listing_widget_map'); // Show map for listings with markers
115
-    }
114
+		add_action('wp_footer', 'show_listing_widget_map'); // Show map for listings with markers
115
+	}
116 116
 
117 117
 	/**
118 118
 	 * Front-end display content for listing page map widget.
119 119
 	 *
120 120
 	 * @since 1.0.0
121
-     * @since 1.5.1 Declare function public.
121
+	 * @since 1.5.1 Declare function public.
122
+	 *
123
+	 * @global object $post The current post object.
122 124
 	 *
123
-     * @global object $post The current post object.
124
-     *
125 125
 	 * @param array $args     Widget arguments.
126 126
 	 * @param array $instance Saved values from database.
127 127
 	 */
128
-    public function widget($args, $instance)
129
-    {
130
-
131
-        if (geodir_is_page('listing') || geodir_is_page('author') || geodir_is_page('search')
132
-            || geodir_is_page('detail')
133
-        ) :
134
-
135
-            extract($args, EXTR_SKIP);
136
-            /** This action is documented in geodirectory_shortcodes.php */
137
-            $width = empty($instance['width']) ? '294' : apply_filters('widget_width', $instance['width']);
138
-            /** This action is documented in geodirectory_shortcodes.php */
139
-            $height = empty($instance['heigh']) ? '370' : apply_filters('widget_heigh', $instance['heigh']);
140
-            /** This action is documented in geodirectory_shortcodes.php */
141
-            $maptype = empty($instance['maptype']) ? 'ROADMAP' : apply_filters('widget_maptype', $instance['maptype']);
142
-            /** This action is documented in geodirectory_shortcodes.php */
143
-            $zoom = empty($instance['zoom']) ? '13' : apply_filters('widget_zoom', $instance['zoom']);
144
-            /** This action is documented in geodirectory_shortcodes.php */
145
-            $autozoom = empty($instance['autozoom']) ? '' : apply_filters('widget_autozoom', $instance['autozoom']);
146
-            /**
147
-             * Filter the listing map value widget_sticky, to set if the map should be sticky or not (scroll with page).
148
-             *
149
-             * @since 1.0.0
150
-             * @param bool $sticky True if should be sticky, false if not
151
-             */
152
-            $sticky = empty($instance['sticky']) ? '' : apply_filters('widget_sticky', $instance['sticky']);
153
-            /** This action is documented in geodirectory_shortcodes.php */
154
-            $scrollwheel = empty($instance['scrollwheel']) ? '0' : apply_filters('widget_scrollwheel', $instance['scrollwheel']);
155
-            $showall = empty($instance['showall']) ? '0' : apply_filters('widget_showall', $instance['showall']);
128
+	public function widget($args, $instance)
129
+	{
130
+
131
+		if (geodir_is_page('listing') || geodir_is_page('author') || geodir_is_page('search')
132
+			|| geodir_is_page('detail')
133
+		) :
134
+
135
+			extract($args, EXTR_SKIP);
136
+			/** This action is documented in geodirectory_shortcodes.php */
137
+			$width = empty($instance['width']) ? '294' : apply_filters('widget_width', $instance['width']);
138
+			/** This action is documented in geodirectory_shortcodes.php */
139
+			$height = empty($instance['heigh']) ? '370' : apply_filters('widget_heigh', $instance['heigh']);
140
+			/** This action is documented in geodirectory_shortcodes.php */
141
+			$maptype = empty($instance['maptype']) ? 'ROADMAP' : apply_filters('widget_maptype', $instance['maptype']);
142
+			/** This action is documented in geodirectory_shortcodes.php */
143
+			$zoom = empty($instance['zoom']) ? '13' : apply_filters('widget_zoom', $instance['zoom']);
144
+			/** This action is documented in geodirectory_shortcodes.php */
145
+			$autozoom = empty($instance['autozoom']) ? '' : apply_filters('widget_autozoom', $instance['autozoom']);
146
+			/**
147
+			 * Filter the listing map value widget_sticky, to set if the map should be sticky or not (scroll with page).
148
+			 *
149
+			 * @since 1.0.0
150
+			 * @param bool $sticky True if should be sticky, false if not
151
+			 */
152
+			$sticky = empty($instance['sticky']) ? '' : apply_filters('widget_sticky', $instance['sticky']);
153
+			/** This action is documented in geodirectory_shortcodes.php */
154
+			$scrollwheel = empty($instance['scrollwheel']) ? '0' : apply_filters('widget_scrollwheel', $instance['scrollwheel']);
155
+			$showall = empty($instance['showall']) ? '0' : apply_filters('widget_showall', $instance['showall']);
156 156
 			
157 157
 			/**
158
-             * Filter the listing map should to be displayed or not.
159
-             *
160
-             * @since 1.4.6
158
+			 * Filter the listing map should to be displayed or not.
161 159
 			 *
162
-             * @param bool $display true if map should be displayed, false if not.
163
-             */
160
+			 * @since 1.4.6
161
+			 *
162
+			 * @param bool $display true if map should be displayed, false if not.
163
+			 */
164 164
 			$show_map = apply_filters( 'geodir_show_map_listing', $display = true );
165 165
 			if ( !$show_map ) {
166 166
 				return;
167 167
 			}
168 168
 
169
-            $map_args = array();
170
-            $map_args['map_canvas_name'] = str_replace('-', '_', $args['widget_id']);
171
-            $map_args['width'] = $width;
172
-            $map_args['height'] = $height;
173
-
174
-            $map_args['scrollwheel'] = $scrollwheel;
175
-            $map_args['showall'] = $showall;
176
-            $map_args['child_collapse'] = '0';
177
-            $map_args['sticky'] = $sticky;
178
-            $map_args['enable_cat_filters'] = false;
179
-            $map_args['enable_text_search'] = false;
180
-            $map_args['enable_post_type_filters'] = false;
181
-            $map_args['enable_location_filters'] = false;
182
-            $map_args['enable_jason_on_load'] = true;
169
+			$map_args = array();
170
+			$map_args['map_canvas_name'] = str_replace('-', '_', $args['widget_id']);
171
+			$map_args['width'] = $width;
172
+			$map_args['height'] = $height;
173
+
174
+			$map_args['scrollwheel'] = $scrollwheel;
175
+			$map_args['showall'] = $showall;
176
+			$map_args['child_collapse'] = '0';
177
+			$map_args['sticky'] = $sticky;
178
+			$map_args['enable_cat_filters'] = false;
179
+			$map_args['enable_text_search'] = false;
180
+			$map_args['enable_post_type_filters'] = false;
181
+			$map_args['enable_location_filters'] = false;
182
+			$map_args['enable_jason_on_load'] = true;
183 183
 			
184
-            if (is_single()) {
185
-
186
-                global $post;
187
-                $map_default_lat = $address_latitude = $post->post_latitude;
188
-                $map_default_lng = $address_longitude = $post->post_longitude;
189
-                $mapview = $post->post_mapview;
190
-                $mapzoom = $post->post_mapzoom;
191
-                $map_args['map_class_name'] = 'geodir-map-listing-page-single';
192
-
193
-            } else {
194
-                $default_location = geodir_get_default_location();
195
-
196
-                $map_default_lat = isset($default_location->city_latitude) ? $default_location->city_latitude : '';
197
-                $map_default_lng = isset($default_location->city_longitude) ? $default_location->city_longitude : '';
198
-                $map_args['map_class_name'] = 'geodir-map-listing-page';
199
-                $mapview = $maptype;
200
-            }
201
-
202
-            if (empty($mapzoom)) $mapzoom = $zoom;
203
-
204
-            // Set default map options
205
-            $map_args['ajax_url'] = geodir_get_ajax_url();
206
-            $map_args['latitude'] = $map_default_lat;
207
-            $map_args['longitude'] = $map_default_lng;
208
-            $map_args['zoom'] = $zoom;
209
-            //$map_args['scrollwheel'] = true;
210
-            $map_args['scrollwheel'] = $scrollwheel;
211
-            $map_args['showall'] = $showall;
212
-            $map_args['streetViewControl'] = true;
213
-            $map_args['maptype'] = $maptype;
214
-            $map_args['showPreview'] = '0';
215
-            $map_args['maxZoom'] = 21;
216
-            $map_args['autozoom'] = $autozoom;
217
-            $map_args['bubble_size'] = 'small';
184
+			if (is_single()) {
185
+
186
+				global $post;
187
+				$map_default_lat = $address_latitude = $post->post_latitude;
188
+				$map_default_lng = $address_longitude = $post->post_longitude;
189
+				$mapview = $post->post_mapview;
190
+				$mapzoom = $post->post_mapzoom;
191
+				$map_args['map_class_name'] = 'geodir-map-listing-page-single';
192
+
193
+			} else {
194
+				$default_location = geodir_get_default_location();
195
+
196
+				$map_default_lat = isset($default_location->city_latitude) ? $default_location->city_latitude : '';
197
+				$map_default_lng = isset($default_location->city_longitude) ? $default_location->city_longitude : '';
198
+				$map_args['map_class_name'] = 'geodir-map-listing-page';
199
+				$mapview = $maptype;
200
+			}
201
+
202
+			if (empty($mapzoom)) $mapzoom = $zoom;
203
+
204
+			// Set default map options
205
+			$map_args['ajax_url'] = geodir_get_ajax_url();
206
+			$map_args['latitude'] = $map_default_lat;
207
+			$map_args['longitude'] = $map_default_lng;
208
+			$map_args['zoom'] = $zoom;
209
+			//$map_args['scrollwheel'] = true;
210
+			$map_args['scrollwheel'] = $scrollwheel;
211
+			$map_args['showall'] = $showall;
212
+			$map_args['streetViewControl'] = true;
213
+			$map_args['maptype'] = $maptype;
214
+			$map_args['showPreview'] = '0';
215
+			$map_args['maxZoom'] = 21;
216
+			$map_args['autozoom'] = $autozoom;
217
+			$map_args['bubble_size'] = 'small';
218 218
             
219
-            $map_args['enable_marker_cluster'] = defined('GDCLUSTER_VERSION') && !empty($instance['marker_cluster']) ? true : false;
219
+			$map_args['enable_marker_cluster'] = defined('GDCLUSTER_VERSION') && !empty($instance['marker_cluster']) ? true : false;
220 220
 
221
-            echo $before_widget;
222
-            geodir_draw_map($map_args);
223
-            echo $after_widget;
221
+			echo $before_widget;
222
+			geodir_draw_map($map_args);
223
+			echo $after_widget;
224 224
 
225
-        endif;
226
-    }
225
+		endif;
226
+	}
227 227
 
228 228
 	/**
229 229
 	 * Sanitize listing page map widget form values as they are saved.
230 230
 	 *
231 231
 	 * @since 1.0.0
232
-     * @since 1.5.1 Declare function public.
232
+	 * @since 1.5.1 Declare function public.
233 233
 	 *
234 234
 	 * @param array $new_instance Values just sent to be saved.
235 235
 	 * @param array $old_instance Previously saved values from database.
236 236
 	 *
237 237
 	 * @return array Updated safe values to be saved.
238 238
 	 */
239
-    public function update($new_instance, $old_instance) {
240
-        //save the widget
241
-        $instance = $old_instance;
242
-        $instance['width'] = strip_tags($new_instance['width']);
243
-        $instance['heigh'] = ($new_instance['heigh']);
244
-        $instance['maptype'] = ($new_instance['maptype']);
245
-        $instance['zoom'] = ($new_instance['zoom']);
246
-        $instance['autozoom'] = isset($new_instance['autozoom']) ? $new_instance['autozoom'] : '';
247
-        $instance['sticky'] = isset($new_instance['sticky']) ? $new_instance['sticky'] : '';
248
-        $instance['scrollwheel'] = isset($new_instance['scrollwheel']) ? ($new_instance['scrollwheel']) : '';
249
-        $instance['showall'] = isset($new_instance['showall']) ? ($new_instance['showall']) : '';
250
-        $instance['marker_cluster'] = defined('GDCLUSTER_VERSION') && !empty($new_instance['marker_cluster']) ? 1 : '';
251
-
252
-        return $instance;
253
-    }
239
+	public function update($new_instance, $old_instance) {
240
+		//save the widget
241
+		$instance = $old_instance;
242
+		$instance['width'] = strip_tags($new_instance['width']);
243
+		$instance['heigh'] = ($new_instance['heigh']);
244
+		$instance['maptype'] = ($new_instance['maptype']);
245
+		$instance['zoom'] = ($new_instance['zoom']);
246
+		$instance['autozoom'] = isset($new_instance['autozoom']) ? $new_instance['autozoom'] : '';
247
+		$instance['sticky'] = isset($new_instance['sticky']) ? $new_instance['sticky'] : '';
248
+		$instance['scrollwheel'] = isset($new_instance['scrollwheel']) ? ($new_instance['scrollwheel']) : '';
249
+		$instance['showall'] = isset($new_instance['showall']) ? ($new_instance['showall']) : '';
250
+		$instance['marker_cluster'] = defined('GDCLUSTER_VERSION') && !empty($new_instance['marker_cluster']) ? 1 : '';
251
+
252
+		return $instance;
253
+	}
254 254
 
255 255
 	/**
256 256
 	 * Back-end listing page map widget settings form.
257 257
 	 *
258 258
 	 * @since 1.0.0
259
-     * @since 1.5.1 Declare function public.
259
+	 * @since 1.5.1 Declare function public.
260 260
 	 *
261 261
 	 * @param array $instance Previously saved values from database.
262 262
 	 */
263
-    public function form($instance) {
264
-        // widget form in backend
265
-        $instance = wp_parse_args((array)$instance, array('width' => '', 'heigh' => '', 'maptype' => '', 'zoom' => '', 'autozoom' => '', 'sticky' => '', 'scrollwheel' => '0', 'showall' => '0', 'marker_cluster' => '0'));
263
+	public function form($instance) {
264
+		// widget form in backend
265
+		$instance = wp_parse_args((array)$instance, array('width' => '', 'heigh' => '', 'maptype' => '', 'zoom' => '', 'autozoom' => '', 'sticky' => '', 'scrollwheel' => '0', 'showall' => '0', 'marker_cluster' => '0'));
266 266
         
267
-        $width = strip_tags($instance['width']);
268
-        $heigh = strip_tags($instance['heigh']);
269
-        $maptype = strip_tags($instance['maptype']);
270
-        $zoom = strip_tags($instance['zoom']);
271
-        $autozoom = strip_tags($instance['autozoom']);
272
-        $sticky = strip_tags($instance['sticky']);
273
-        $scrollwheel = strip_tags($instance['scrollwheel']);
274
-        $showall = strip_tags($instance['showall']);
275
-        $marker_cluster = (int)$instance['marker_cluster'];
276
-        ?>
267
+		$width = strip_tags($instance['width']);
268
+		$heigh = strip_tags($instance['heigh']);
269
+		$maptype = strip_tags($instance['maptype']);
270
+		$zoom = strip_tags($instance['zoom']);
271
+		$autozoom = strip_tags($instance['autozoom']);
272
+		$sticky = strip_tags($instance['sticky']);
273
+		$scrollwheel = strip_tags($instance['scrollwheel']);
274
+		$showall = strip_tags($instance['showall']);
275
+		$marker_cluster = (int)$instance['marker_cluster'];
276
+		?>
277 277
         <p>
278 278
             <label
279 279
                 for="<?php echo $this->get_field_id('width'); ?>"><?php _e('Map Width <small>(Default is : 294) you can use px or % here</small>', 'geodirectory'); ?>
@@ -302,14 +302,14 @@  discard block
 block discarded – undo
302 302
                         name="<?php echo $this->get_field_name('maptype'); ?>">
303 303
 
304 304
                     <option <?php if (isset($maptype) && $maptype == 'ROADMAP') {
305
-                        echo 'selected="selected"';
306
-                    } ?> value="ROADMAP"><?php _e('Road Map', 'geodirectory'); ?></option>
305
+						echo 'selected="selected"';
306
+					} ?> value="ROADMAP"><?php _e('Road Map', 'geodirectory'); ?></option>
307 307
                     <option <?php if (isset($maptype) && $maptype == 'SATELLITE') {
308
-                        echo 'selected="selected"';
309
-                    } ?> value="SATELLITE"><?php _e('Satellite Map', 'geodirectory'); ?></option>
308
+						echo 'selected="selected"';
309
+					} ?> value="SATELLITE"><?php _e('Satellite Map', 'geodirectory'); ?></option>
310 310
                     <option <?php if (isset($maptype) && $maptype == 'HYBRID') {
311
-                        echo 'selected="selected"';
312
-                    } ?> value="HYBRID"><?php _e('Hybrid Map', 'geodirectory'); ?></option>
311
+						echo 'selected="selected"';
312
+					} ?> value="HYBRID"><?php _e('Hybrid Map', 'geodirectory'); ?></option>
313 313
 					<option <?php selected($maptype, 'TERRAIN');?> 
314 314
 							value="TERRAIN"><?php _e('Terrain Map', 'geodirectory'); ?></option>
315 315
                 </select>
@@ -317,8 +317,8 @@  discard block
 block discarded – undo
317 317
         </p>
318 318
 
319 319
         <?php
320
-        $map_zoom_level = geodir_map_zoom_level();
321
-        ?>
320
+		$map_zoom_level = geodir_map_zoom_level();
321
+		?>
322 322
 
323 323
         <p>
324 324
             <label
@@ -328,14 +328,14 @@  discard block
 block discarded – undo
328 328
                 <select class="widefat" id="<?php echo $this->get_field_id('zoom'); ?>"
329 329
                         name="<?php echo $this->get_field_name('zoom'); ?>"> <?php
330 330
 
331
-                    foreach ($map_zoom_level as $level) {
332
-                        $selected = '';
333
-                        if ($level == $zoom)
334
-                            $selected = 'selected="selected"';
331
+					foreach ($map_zoom_level as $level) {
332
+						$selected = '';
333
+						if ($level == $zoom)
334
+							$selected = 'selected="selected"';
335 335
 
336
-                        echo '<option ' . $selected . ' value="' . $level . '">' . $level . '</option>';
336
+						echo '<option ' . $selected . ' value="' . $level . '">' . $level . '</option>';
337 337
 
338
-                    } ?>
338
+					} ?>
339 339
 
340 340
                 </select>
341 341
 
@@ -347,8 +347,8 @@  discard block
 block discarded – undo
347 347
                 for="<?php echo $this->get_field_id('autozoom'); ?>">
348 348
                 <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('autozoom'); ?>"
349 349
                        name="<?php echo $this->get_field_name('autozoom'); ?>"<?php if ($autozoom) {
350
-                    echo 'checked="checked"';
351
-                } ?> /> <?php _e('Map Auto Zoom ?', 'geodirectory'); ?></label>
350
+					echo 'checked="checked"';
351
+				} ?> /> <?php _e('Map Auto Zoom ?', 'geodirectory'); ?></label>
352 352
         </p>
353 353
 
354 354
         <p>
@@ -356,8 +356,8 @@  discard block
 block discarded – undo
356 356
                 for="<?php echo $this->get_field_id('sticky'); ?>">
357 357
                 <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('sticky'); ?>"
358 358
                        name="<?php echo $this->get_field_name('sticky'); ?>"<?php if ($sticky) {
359
-                    echo 'checked="checked"';
360
-                } ?> /> <?php _e('Map Sticky(should stick to the right of screen) ?', 'geodirectory'); ?>
359
+					echo 'checked="checked"';
360
+				} ?> /> <?php _e('Map Sticky(should stick to the right of screen) ?', 'geodirectory'); ?>
361 361
             </label>
362 362
         </p>
363 363
 
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
     </p> -->
384 384
 
385 385
     <?php
386
-    }
386
+	}
387 387
 } // class geodir_map_listingpage
388 388
 
389 389
 register_widget('geodir_map_listingpage');
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 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
 }
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
         $json_content = substr(implode(',', $cat_content_info), 1);
74 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 75
         $json_content = wp_specialchars_decode($json_content); // Fixed #post-320722 on 2016-12-08
76
-        $list_json = '[{"totalcount":"' . $totalcount . '",' . $json_content . ']';
76
+        $list_json = '[{"totalcount":"'.$totalcount.'",'.$json_content.']';
77 77
     } else {
78 78
         $list_json = '[{"totalcount":"0"}]';
79 79
     }
@@ -161,8 +161,8 @@  discard block
 block discarded – undo
161 161
 			 *
162 162
              * @param bool $display true if map should be displayed, false if not.
163 163
              */
164
-			$show_map = apply_filters( 'geodir_show_map_listing', $display = true );
165
-			if ( !$show_map ) {
164
+			$show_map = apply_filters('geodir_show_map_listing', $display = true);
165
+			if (!$show_map) {
166 166
 				return;
167 167
 			}
168 168
 
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
 	 */
263 263
     public function form($instance) {
264 264
         // widget form in backend
265
-        $instance = wp_parse_args((array)$instance, array('width' => '', 'heigh' => '', 'maptype' => '', 'zoom' => '', 'autozoom' => '', 'sticky' => '', 'scrollwheel' => '0', 'showall' => '0', 'marker_cluster' => '0'));
265
+        $instance = wp_parse_args((array) $instance, array('width' => '', 'heigh' => '', 'maptype' => '', 'zoom' => '', 'autozoom' => '', 'sticky' => '', 'scrollwheel' => '0', 'showall' => '0', 'marker_cluster' => '0'));
266 266
         
267 267
         $width = strip_tags($instance['width']);
268 268
         $heigh = strip_tags($instance['heigh']);
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
         $sticky = strip_tags($instance['sticky']);
273 273
         $scrollwheel = strip_tags($instance['scrollwheel']);
274 274
         $showall = strip_tags($instance['showall']);
275
-        $marker_cluster = (int)$instance['marker_cluster'];
275
+        $marker_cluster = (int) $instance['marker_cluster'];
276 276
         ?>
277 277
         <p>
278 278
             <label
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
                     <option <?php if (isset($maptype) && $maptype == 'HYBRID') {
311 311
                         echo 'selected="selected"';
312 312
                     } ?> value="HYBRID"><?php _e('Hybrid Map', 'geodirectory'); ?></option>
313
-					<option <?php selected($maptype, 'TERRAIN');?> 
313
+					<option <?php selected($maptype, 'TERRAIN'); ?> 
314 314
 							value="TERRAIN"><?php _e('Terrain Map', 'geodirectory'); ?></option>
315 315
                 </select>
316 316
             </label>
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
                         if ($level == $zoom)
334 334
                             $selected = 'selected="selected"';
335 335
 
336
-                        echo '<option ' . $selected . ' value="' . $level . '">' . $level . '</option>';
336
+                        echo '<option '.$selected.' value="'.$level.'">'.$level.'</option>';
337 337
 
338 338
                     } ?>
339 339
 
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
                 for="<?php echo $this->get_field_id('scrollwheel'); ?>">
367 367
                 <input id="<?php echo $this->get_field_id('scrollwheel'); ?>"
368 368
                        name="<?php echo $this->get_field_name('scrollwheel'); ?>" type="checkbox" value="1"
369
-                       <?php if ($scrollwheel){ ?>checked="checked" <?php } ?> /> <?php _e('Enable mouse scroll zoom ?', 'geodirectory'); ?>
369
+                       <?php if ($scrollwheel) { ?>checked="checked" <?php } ?> /> <?php _e('Enable mouse scroll zoom ?', 'geodirectory'); ?>
370 370
             </label>
371 371
         </p>
372 372
         <?php if (defined('GDCLUSTER_VERSION')) { ?>
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.
geodirectory-templates/widget-listing-listview.php 2 patches
Indentation   +157 added lines, -157 removed lines patch added patch discarded remove patch
@@ -20,72 +20,72 @@  discard block
 block discarded – undo
20 20
 /** This action is documented in geodirectory-templates/listing-listview.php */
21 21
 $grid_view_class = apply_filters('geodir_grid_view_widget_columns', $gridview_columns_widget);
22 22
 if ($gd_session->get('gd_listing_view') && !isset($before_widget)) {
23
-    $grid_view_class = geodir_convert_listing_view_class($gd_session->get('gd_listing_view'));
23
+	$grid_view_class = geodir_convert_listing_view_class($gd_session->get('gd_listing_view'));
24 24
 }
25 25
 ?>
26 26
     <ul class="geodir_category_list_view clearfix <?php echo apply_filters('geodir_listing_listview_ul_extra_class', '', 'widget'); ?>">
27 27
         <?php
28
-        if (!empty($widget_listings)) {
29
-            /** This action is documented in geodirectory-templates/listing-listview.php */
30
-            do_action('geodir_before_listing_post_listview');
31
-            $all_postypes = geodir_get_posttypes();
32
-            $geodir_days_new = (int)get_option('geodir_listing_new_days');
33
-            foreach ($widget_listings as $widget_listing) {
34
-                global $gd_widget_listing_type;
35
-                $post = $widget_listing;
28
+		if (!empty($widget_listings)) {
29
+			/** This action is documented in geodirectory-templates/listing-listview.php */
30
+			do_action('geodir_before_listing_post_listview');
31
+			$all_postypes = geodir_get_posttypes();
32
+			$geodir_days_new = (int)get_option('geodir_listing_new_days');
33
+			foreach ($widget_listings as $widget_listing) {
34
+				global $gd_widget_listing_type;
35
+				$post = $widget_listing;
36 36
 
37
-                $GLOBALS['post'] = $post;
38
-                setup_postdata($post);
37
+				$GLOBALS['post'] = $post;
38
+				setup_postdata($post);
39 39
 
40
-                $gd_widget_listing_type = $post->post_type;
40
+				$gd_widget_listing_type = $post->post_type;
41 41
 
42
-                /** This action is documented in geodirectory-templates/listing-listview.php */
43
-                $post_view_class = apply_filters('geodir_post_view_extra_class', '', $all_postypes);
42
+				/** This action is documented in geodirectory-templates/listing-listview.php */
43
+				$post_view_class = apply_filters('geodir_post_view_extra_class', '', $all_postypes);
44 44
 
45
-                /** This action is documented in geodirectory-templates/listing-listview.php */
46
-                $post_view_article_class = apply_filters('geodir_post_view_article_extra_class', '');
47
-                ?>
45
+				/** This action is documented in geodirectory-templates/listing-listview.php */
46
+				$post_view_article_class = apply_filters('geodir_post_view_article_extra_class', '');
47
+				?>
48 48
                 <li class="clearfix <?php if ($grid_view_class) {
49
-                    echo 'geodir-gridview ' . $grid_view_class;
50
-                } else {
51
-                    echo ' geodir-listview ';
52
-                } ?> <?php if ($post_view_class) {
53
-                    echo $post_view_class;
54
-                } ?>" <?php if (isset($listing_width) && $listing_width) {
55
-                    echo "style='width:{$listing_width}%;'";
56
-                }
49
+					echo 'geodir-gridview ' . $grid_view_class;
50
+				} else {
51
+					echo ' geodir-listview ';
52
+				} ?> <?php if ($post_view_class) {
53
+					echo $post_view_class;
54
+				} ?>" <?php if (isset($listing_width) && $listing_width) {
55
+					echo "style='width:{$listing_width}%;'";
56
+				}
57 57
 
58
-                echo " data-post-id='$post->ID' ";
59
-                /** This action is documented in geodirectory-templates/listing-listview.php */
60
-                do_action('geodir_listview_inside_li', $post, 'widget');
61
-                ?>>
58
+				echo " data-post-id='$post->ID' ";
59
+				/** This action is documented in geodirectory-templates/listing-listview.php */
60
+				do_action('geodir_listview_inside_li', $post, 'widget');
61
+				?>>
62 62
                     <article class="geodir-category-listing <?php if ($post_view_article_class) {
63
-                        echo $post_view_article_class;
64
-                    } ?>">
63
+						echo $post_view_article_class;
64
+					} ?>">
65 65
                         <div class="geodir-post-img <?php echo apply_filters('geodir_listing_listview_thumb_extra_class', '', 'widget'); ?>">
66 66
                             <?php if ($fimage = geodir_show_featured_image($post->ID, 'list-thumb', true, false, $post->featured_image)) { ?>
67 67
                                 <a href="<?php the_permalink(); ?>"><?php echo $fimage; ?></a>
68 68
                                 <?php
69
-                                /** This action is documented in geodirectory-templates/listing-listview.php */
70
-                                do_action('geodir_before_badge_on_image', $post);
71
-                                if ($post->is_featured) {
72
-                                    echo geodir_show_badges_on_image('featured', $post, get_permalink());
73
-                                }
69
+								/** This action is documented in geodirectory-templates/listing-listview.php */
70
+								do_action('geodir_before_badge_on_image', $post);
71
+								if ($post->is_featured) {
72
+									echo geodir_show_badges_on_image('featured', $post, get_permalink());
73
+								}
74 74
 
75 75
 
76
-                                if (round(abs(strtotime($post->post_date) - strtotime(date('Y-m-d'))) / 86400) < $geodir_days_new) {
77
-                                    echo geodir_show_badges_on_image('new', $post, get_permalink());
78
-                                }
76
+								if (round(abs(strtotime($post->post_date) - strtotime(date('Y-m-d'))) / 86400) < $geodir_days_new) {
77
+									echo geodir_show_badges_on_image('new', $post, get_permalink());
78
+								}
79 79
 
80
-                                /** This action is documented in geodirectory-templates/listing-listview.php */
81
-                                do_action('geodir_after_badge_on_image', $post);
82
-                            }
83
-                            ?>
80
+								/** This action is documented in geodirectory-templates/listing-listview.php */
81
+								do_action('geodir_after_badge_on_image', $post);
82
+							}
83
+							?>
84 84
                         </div>
85 85
                         <div class="geodir-content <?php echo apply_filters('geodir_listing_listview_content_extra_class', '', 'widget'); ?>">
86 86
                             <?php
87
-                            /** This action is documented in geodirectory-templates/listing-listview.php */
88
-                            do_action('geodir_before_listing_post_title', 'listview', $post); ?>
87
+							/** This action is documented in geodirectory-templates/listing-listview.php */
88
+							do_action('geodir_before_listing_post_title', 'listview', $post); ?>
89 89
                             <header class="geodir-entry-header">
90 90
                                 <h3 class="geodir-entry-title">
91 91
                                     <a href="<?php the_permalink(); ?>"
@@ -94,158 +94,158 @@  discard block
 block discarded – undo
94 94
                             </header>
95 95
                             <!-- .entry-header -->
96 96
                             <?php
97
-                            /** This action is documented in geodirectory-templates/listing-listview.php */
98
-                            do_action('geodir_after_listing_post_title', 'listview', $post); ?>
97
+							/** This action is documented in geodirectory-templates/listing-listview.php */
98
+							do_action('geodir_after_listing_post_title', 'listview', $post); ?>
99 99
                             <?php /// Print Distance
100
-                            if (isset($_REQUEST['sgeo_lat']) && $_REQUEST['sgeo_lat'] != '') {
101
-                                $startPoint = array('latitude' => $_REQUEST['sgeo_lat'], 'longitude' => $_REQUEST['sgeo_lon']);
100
+							if (isset($_REQUEST['sgeo_lat']) && $_REQUEST['sgeo_lat'] != '') {
101
+								$startPoint = array('latitude' => $_REQUEST['sgeo_lat'], 'longitude' => $_REQUEST['sgeo_lon']);
102 102
 
103
-                                $endLat = $post->post_latitude;
104
-                                $endLon = $post->post_longitude;
105
-                                $endPoint = array('latitude' => $endLat, 'longitude' => $endLon);
106
-                                $uom = get_option('geodir_search_dist_1');
107
-                                $distance = geodir_calculateDistanceFromLatLong($startPoint, $endPoint, $uom);
108
-                                ?>
103
+								$endLat = $post->post_latitude;
104
+								$endLon = $post->post_longitude;
105
+								$endPoint = array('latitude' => $endLat, 'longitude' => $endLon);
106
+								$uom = get_option('geodir_search_dist_1');
107
+								$distance = geodir_calculateDistanceFromLatLong($startPoint, $endPoint, $uom);
108
+								?>
109 109
                                 <h3>
110 110
                                     <?php
111
-                                    if (round($distance, 2) == 0) {
112
-                                        $uom = get_option('geodir_search_dist_2');
113
-                                        $distance = geodir_calculateDistanceFromLatLong($startPoint, $endPoint, $uom);
114
-                                        if ($uom == 'feet') {
115
-                                            $uom = __('feet', 'geodirectory');
116
-                                        } else {
117
-                                            $uom = __('meters', 'geodirectory');
118
-                                        }
119
-                                        echo round($distance) . ' ' . __($uom, 'geodirectory') . '
111
+									if (round($distance, 2) == 0) {
112
+										$uom = get_option('geodir_search_dist_2');
113
+										$distance = geodir_calculateDistanceFromLatLong($startPoint, $endPoint, $uom);
114
+										if ($uom == 'feet') {
115
+											$uom = __('feet', 'geodirectory');
116
+										} else {
117
+											$uom = __('meters', 'geodirectory');
118
+										}
119
+										echo round($distance) . ' ' . __($uom, 'geodirectory') . '
120 120
 			<br />
121 121
 			';
122
-                                    } else {
123
-                                        if ($uom == 'miles') {
124
-                                            $uom = __('miles', 'geodirectory');
125
-                                        } else {
126
-                                            $uom = __('km', 'geodirectory');
127
-                                        }
128
-                                        echo round($distance, 2) . ' ' . __($uom, 'geodirectory') . '
122
+									} else {
123
+										if ($uom == 'miles') {
124
+											$uom = __('miles', 'geodirectory');
125
+										} else {
126
+											$uom = __('km', 'geodirectory');
127
+										}
128
+										echo round($distance, 2) . ' ' . __($uom, 'geodirectory') . '
129 129
 			<br />
130 130
 			';
131
-                                    }
132
-                                    ?>
131
+									}
132
+									?>
133 133
                                 </h3>
134 134
                             <?php } ?>
135 135
                             <?php
136
-                            /** This action is documented in geodirectory-templates/listing-listview.php */
137
-                            do_action('geodir_before_listing_post_excerpt', $post); ?>
136
+							/** This action is documented in geodirectory-templates/listing-listview.php */
137
+							do_action('geodir_before_listing_post_excerpt', $post); ?>
138 138
                             <?php echo geodir_show_listing_info('listing'); ?>
139 139
                             <?php if (isset($character_count) && $character_count == '0') {
140
-                            } else { ?>
140
+							} else { ?>
141 141
                                 <div class="geodir-entry-content">
142 142
                                     <?php
143
-                                    /**
144
-                                     * Filter to hide the listing excerpt
145
-                                     *
146
-                                     * @since 1.5.3
147
-                                     * @param bool $display Display the excerpt or not. Default true.
148
-                                     * @param object $post The post object.
149
-                                     */
150
-                                    $show_listing_excerpt = apply_filters('geodir_show_listing_post_excerpt', true, 'widget', $post);
151
-                                    if ($show_listing_excerpt) {
152
-                                        if ( isset( $character_count ) && ( $character_count || $character_count == '0' ) ) {
153
-                                            $content_out = geodir_max_excerpt( $character_count );
154
-                                        } else {
155
-                                            $content_out = get_the_excerpt();
156
-                                        }
157
-                                        if ( ! empty( $content_out ) ) {
158
-                                            echo "<p>" . $content_out . "</p>";
159
-                                        }
160
-                                    }
161
-                                    ?>
143
+									/**
144
+									 * Filter to hide the listing excerpt
145
+									 *
146
+									 * @since 1.5.3
147
+									 * @param bool $display Display the excerpt or not. Default true.
148
+									 * @param object $post The post object.
149
+									 */
150
+									$show_listing_excerpt = apply_filters('geodir_show_listing_post_excerpt', true, 'widget', $post);
151
+									if ($show_listing_excerpt) {
152
+										if ( isset( $character_count ) && ( $character_count || $character_count == '0' ) ) {
153
+											$content_out = geodir_max_excerpt( $character_count );
154
+										} else {
155
+											$content_out = get_the_excerpt();
156
+										}
157
+										if ( ! empty( $content_out ) ) {
158
+											echo "<p>" . $content_out . "</p>";
159
+										}
160
+									}
161
+									?>
162 162
                                 </div>
163 163
                             <?php } ?>
164 164
                             <?php
165
-                            /** This action is documented in geodirectory-templates/listing-listview.php */
166
-                            do_action('geodir_after_listing_post_excerpt', $post); ?>
165
+							/** This action is documented in geodirectory-templates/listing-listview.php */
166
+							do_action('geodir_after_listing_post_excerpt', $post); ?>
167 167
                         </div>
168 168
                         <!-- gd-content ends here-->
169 169
                         <?php
170
-                        /**
171
-                         * Called after printing listing content.
172
-                         *
173
-                         * @since 1.5.3
174
-                         * @param object $post The post object.
175
-                         * @param string $view The view type, default 'widget'.
176
-                         */
177
-                        do_action( 'geodir_after_listing_content', $post, 'widget' ); ?>
170
+						/**
171
+						 * Called after printing listing content.
172
+						 *
173
+						 * @since 1.5.3
174
+						 * @param object $post The post object.
175
+						 * @param string $view The view type, default 'widget'.
176
+						 */
177
+						do_action( 'geodir_after_listing_content', $post, 'widget' ); ?>
178 178
                         <footer class="geodir-entry-meta <?php echo apply_filters('geodir_listing_listview_meta_extra_class', '', 'widget'); ?>">
179 179
                             <div class="geodir-addinfo clearfix <?php echo apply_filters('geodir_listing_listview_addinfo_extra_class', '', 'widget'); ?>">
180 180
                                 <?php
181
-                                /**
182
-                                 * Called before printing review stars html.
183
-                                 *
184
-                                 * @since 1.5.3
185
-                                 * @param object $post The post object.
186
-                                 * @param string $view The view type, default 'widget'.
187
-                                 */
188
-                                do_action( 'geodir_before_review_html', $post, 'widget' );
189
-                                $review_show = geodir_is_reviews_show('listview');
190
-                                if ($review_show) {
181
+								/**
182
+								 * Called before printing review stars html.
183
+								 *
184
+								 * @since 1.5.3
185
+								 * @param object $post The post object.
186
+								 * @param string $view The view type, default 'widget'.
187
+								 */
188
+								do_action( 'geodir_before_review_html', $post, 'widget' );
189
+								$review_show = geodir_is_reviews_show('listview');
190
+								if ($review_show) {
191 191
 
192
-                                    $post_avgratings = geodir_get_post_rating($post->ID);
192
+									$post_avgratings = geodir_get_post_rating($post->ID);
193 193
 
194
-                                    /** This action is documented in geodirectory-templates/listing-listview.php */
195
-                                    do_action('geodir_before_review_rating_stars_on_listview', $post_avgratings, $post->ID);
194
+									/** This action is documented in geodirectory-templates/listing-listview.php */
195
+									do_action('geodir_before_review_rating_stars_on_listview', $post_avgratings, $post->ID);
196 196
 
197
-                                    echo geodir_get_rating_stars($post_avgratings, $post->ID);
197
+									echo geodir_get_rating_stars($post_avgratings, $post->ID);
198 198
 
199
-                                    /** This action is documented in geodirectory-templates/listing-listview.php */
200
-                                    do_action('geodir_after_review_rating_stars_on_listview', $post_avgratings, $post->ID);
201
-                                    ?><a href="<?php comments_link(); ?>" class="geodir-pcomments"><i
199
+									/** This action is documented in geodirectory-templates/listing-listview.php */
200
+									do_action('geodir_after_review_rating_stars_on_listview', $post_avgratings, $post->ID);
201
+									?><a href="<?php comments_link(); ?>" class="geodir-pcomments"><i
202 202
                                         class="fa fa-comments"></i> <?php geodir_comments_number($post->rating_count); ?>
203 203
                                     </a>
204 204
                                 <?php
205
-                                }
205
+								}
206 206
 
207 207
 
208
-                                /**
209
-                                 * Called after printing favorite html.
210
-                                 *
211
-                                 * @since 1.0.0
212
-                                 */
213
-                                do_action( 'geodir_after_favorite_html', $post->ID, 'widget' );
208
+								/**
209
+								 * Called after printing favorite html.
210
+								 *
211
+								 * @since 1.0.0
212
+								 */
213
+								do_action( 'geodir_after_favorite_html', $post->ID, 'widget' );
214 214
 
215
-                                if ($post->post_author == get_current_user_id()) {
216
-                                    $addplacelink = get_permalink(geodir_add_listing_page_id());
217
-                                    $editlink = geodir_getlink($addplacelink, array('pid' => $post->ID), false);
218
-                                    $upgradelink = geodir_getlink($editlink, array('upgrade' => '1'), false);
215
+								if ($post->post_author == get_current_user_id()) {
216
+									$addplacelink = get_permalink(geodir_add_listing_page_id());
217
+									$editlink = geodir_getlink($addplacelink, array('pid' => $post->ID), false);
218
+									$upgradelink = geodir_getlink($editlink, array('upgrade' => '1'), false);
219 219
 
220
-                                    $ajaxlink = geodir_get_ajax_url();
221
-                                    $deletelink = geodir_getlink($ajaxlink, array('geodir_ajax' => 'add_listing', 'ajax_action' => 'delete', 'pid' => $post->ID), false);
222
-                                    ?>
220
+									$ajaxlink = geodir_get_ajax_url();
221
+									$deletelink = geodir_getlink($ajaxlink, array('geodir_ajax' => 'add_listing', 'ajax_action' => 'delete', 'pid' => $post->ID), false);
222
+									?>
223 223
                                     <span class="geodir-authorlink clearfix">
224 224
                                 <?php
225
-                if (isset($_REQUEST['geodir_dashbord']) && $_REQUEST['geodir_dashbord']) {
226
-                    /** This action is documented in geodirectory-templates/listing-listview.php */
227
-                    do_action('geodir_before_edit_post_link_on_listing');
228
-                    ?>
225
+				if (isset($_REQUEST['geodir_dashbord']) && $_REQUEST['geodir_dashbord']) {
226
+					/** This action is documented in geodirectory-templates/listing-listview.php */
227
+					do_action('geodir_before_edit_post_link_on_listing');
228
+					?>
229 229
                     <a href="<?php echo esc_url($editlink); ?>" class="geodir-edit"
230 230
                        title="<?php _e('Edit Listing', 'geodirectory'); ?>">
231 231
                         <?php
232
-                        $geodir_listing_edit_icon = apply_filters('geodir_listing_edit_icon', 'fa fa-edit');
233
-                        echo '<i class="'. $geodir_listing_edit_icon .'"></i>';
234
-                        ?>
232
+						$geodir_listing_edit_icon = apply_filters('geodir_listing_edit_icon', 'fa fa-edit');
233
+						echo '<i class="'. $geodir_listing_edit_icon .'"></i>';
234
+						?>
235 235
                         <?php _e('Edit', 'geodirectory'); ?>
236 236
                     </a>
237 237
                     <a href="<?php echo esc_url($deletelink); ?>" class="geodir-delete"
238 238
                        title="<?php _e('Delete Listing', 'geodirectory'); ?>">
239 239
                         <?php
240
-                        $geodir_listing_delete_icon = apply_filters('geodir_listing_delete_icon', 'fa fa-close');
241
-                        echo '<i class="'. $geodir_listing_delete_icon .'"></i>';
242
-                        ?>
240
+						$geodir_listing_delete_icon = apply_filters('geodir_listing_delete_icon', 'fa fa-close');
241
+						echo '<i class="'. $geodir_listing_delete_icon .'"></i>';
242
+						?>
243 243
                         <?php _e('Delete', 'geodirectory'); ?>
244 244
                     </a>
245 245
                     <?php
246
-                    /** This action is documented in geodirectory-templates/listing-listview.php */
247
-                    do_action('geodir_after_edit_post_link_on_listing');
248
-                } ?>
246
+					/** This action is documented in geodirectory-templates/listing-listview.php */
247
+					do_action('geodir_after_edit_post_link_on_listing');
248
+				} ?>
249 249
 					</span>
250 250
                                 <?php } ?>
251 251
                             </div>
@@ -255,17 +255,17 @@  discard block
 block discarded – undo
255 255
                     </article>
256 256
                 </li>
257 257
                 <?php
258
-                unset($gd_widget_listing_type);
259
-            }
260
-            /** This action is documented in geodirectory-templates/listing-listview.php */
261
-            do_action('geodir_after_listing_post_listview');
262
-        } else {
258
+				unset($gd_widget_listing_type);
259
+			}
260
+			/** This action is documented in geodirectory-templates/listing-listview.php */
261
+			do_action('geodir_after_listing_post_listview');
262
+		} else {
263 263
 			$favorite = isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite' ? true : false;
264 264
             
265 265
 			/** This action is documented in geodirectory-templates/listing-listview.php */
266
-            do_action('geodir_message_not_found_on_listing', 'widget-listing-listview', $favorite);
267
-        }
268
-        ?>
266
+			do_action('geodir_message_not_found_on_listing', 'widget-listing-listview', $favorite);
267
+		}
268
+		?>
269 269
     </ul>  <!-- geodir_category_list_view ends here-->
270 270
     <div class="clear"></div>
271 271
 <?php
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
             /** This action is documented in geodirectory-templates/listing-listview.php */
30 30
             do_action('geodir_before_listing_post_listview');
31 31
             $all_postypes = geodir_get_posttypes();
32
-            $geodir_days_new = (int)get_option('geodir_listing_new_days');
32
+            $geodir_days_new = (int) get_option('geodir_listing_new_days');
33 33
             foreach ($widget_listings as $widget_listing) {
34 34
                 global $gd_widget_listing_type;
35 35
                 $post = $widget_listing;
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
                 $post_view_article_class = apply_filters('geodir_post_view_article_extra_class', '');
47 47
                 ?>
48 48
                 <li class="clearfix <?php if ($grid_view_class) {
49
-                    echo 'geodir-gridview ' . $grid_view_class;
49
+                    echo 'geodir-gridview '.$grid_view_class;
50 50
                 } else {
51 51
                     echo ' geodir-listview ';
52 52
                 } ?> <?php if ($post_view_class) {
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
                                         } else {
117 117
                                             $uom = __('meters', 'geodirectory');
118 118
                                         }
119
-                                        echo round($distance) . ' ' . __($uom, 'geodirectory') . '
119
+                                        echo round($distance).' '.__($uom, 'geodirectory').'
120 120
 			<br />
121 121
 			';
122 122
                                     } else {
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
                                         } else {
126 126
                                             $uom = __('km', 'geodirectory');
127 127
                                         }
128
-                                        echo round($distance, 2) . ' ' . __($uom, 'geodirectory') . '
128
+                                        echo round($distance, 2).' '.__($uom, 'geodirectory').'
129 129
 			<br />
130 130
 			';
131 131
                                     }
@@ -149,13 +149,13 @@  discard block
 block discarded – undo
149 149
                                      */
150 150
                                     $show_listing_excerpt = apply_filters('geodir_show_listing_post_excerpt', true, 'widget', $post);
151 151
                                     if ($show_listing_excerpt) {
152
-                                        if ( isset( $character_count ) && ( $character_count || $character_count == '0' ) ) {
153
-                                            $content_out = geodir_max_excerpt( $character_count );
152
+                                        if (isset($character_count) && ($character_count || $character_count == '0')) {
153
+                                            $content_out = geodir_max_excerpt($character_count);
154 154
                                         } else {
155 155
                                             $content_out = get_the_excerpt();
156 156
                                         }
157
-                                        if ( ! empty( $content_out ) ) {
158
-                                            echo "<p>" . $content_out . "</p>";
157
+                                        if (!empty($content_out)) {
158
+                                            echo "<p>".$content_out."</p>";
159 159
                                         }
160 160
                                     }
161 161
                                     ?>
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
                          * @param object $post The post object.
175 175
                          * @param string $view The view type, default 'widget'.
176 176
                          */
177
-                        do_action( 'geodir_after_listing_content', $post, 'widget' ); ?>
177
+                        do_action('geodir_after_listing_content', $post, 'widget'); ?>
178 178
                         <footer class="geodir-entry-meta <?php echo apply_filters('geodir_listing_listview_meta_extra_class', '', 'widget'); ?>">
179 179
                             <div class="geodir-addinfo clearfix <?php echo apply_filters('geodir_listing_listview_addinfo_extra_class', '', 'widget'); ?>">
180 180
                                 <?php
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
                                  * @param object $post The post object.
186 186
                                  * @param string $view The view type, default 'widget'.
187 187
                                  */
188
-                                do_action( 'geodir_before_review_html', $post, 'widget' );
188
+                                do_action('geodir_before_review_html', $post, 'widget');
189 189
                                 $review_show = geodir_is_reviews_show('listview');
190 190
                                 if ($review_show) {
191 191
 
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
                                  *
211 211
                                  * @since 1.0.0
212 212
                                  */
213
-                                do_action( 'geodir_after_favorite_html', $post->ID, 'widget' );
213
+                                do_action('geodir_after_favorite_html', $post->ID, 'widget');
214 214
 
215 215
                                 if ($post->post_author == get_current_user_id()) {
216 216
                                     $addplacelink = get_permalink(geodir_add_listing_page_id());
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
                        title="<?php _e('Edit Listing', 'geodirectory'); ?>">
231 231
                         <?php
232 232
                         $geodir_listing_edit_icon = apply_filters('geodir_listing_edit_icon', 'fa fa-edit');
233
-                        echo '<i class="'. $geodir_listing_edit_icon .'"></i>';
233
+                        echo '<i class="'.$geodir_listing_edit_icon.'"></i>';
234 234
                         ?>
235 235
                         <?php _e('Edit', 'geodirectory'); ?>
236 236
                     </a>
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
                        title="<?php _e('Delete Listing', 'geodirectory'); ?>">
239 239
                         <?php
240 240
                         $geodir_listing_delete_icon = apply_filters('geodir_listing_delete_icon', 'fa fa-close');
241
-                        echo '<i class="'. $geodir_listing_delete_icon .'"></i>';
241
+                        echo '<i class="'.$geodir_listing_delete_icon.'"></i>';
242 242
                         ?>
243 243
                         <?php _e('Delete', 'geodirectory'); ?>
244 244
                     </a>
Please login to merge, or discard this patch.