Passed
Pull Request — master (#226)
by Viruthagiri
18:04
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   +78 added lines, -78 removed lines patch added patch discarded remove patch
@@ -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)) {
@@ -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)) {
@@ -1052,9 +1052,9 @@  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>' : '';
1055
+                $caption = ''; //(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : '';
1056 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>';
1057
+                $main_slides .= '<img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:400px;margin:0 auto;" />' . $caption . '</li>';
1058 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
             }
@@ -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();
@@ -1168,12 +1168,12 @@  discard block
 block discarded – undo
1168 1168
                          * @param string $tag_link The tag link html.
1169 1169
                          * @param object $term The tag term object.
1170 1170
                          */
1171
-                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1171
+                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link', $tag_link, $term);
1172 1172
                         $links[] = $tag_link;
1173 1173
                     } else {
1174 1174
                         $tag_link = "<a href='" . esc_attr(get_term_link($term->term_id, $term->taxonomy)) . "'>$term->name</a>";
1175 1175
                         /** This action is documented in geodirectory-template_actions.php */
1176
-                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1176
+                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link', $tag_link, $term);
1177 1177
                         $links[] = $tag_link;
1178 1178
                     }
1179 1179
                     $terms[] = $term;
@@ -1183,7 +1183,7 @@  discard block
 block discarded – undo
1183 1183
             if (!isset($listing_label)) {
1184 1184
                 $listing_label = '';
1185 1185
             }
1186
-            $taxonomies[$post_type . '_tags'] = wp_sprintf(__('%s Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1186
+            $taxonomies[$post_type . '_tags'] = wp_sprintf(__('%s Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object) $terms);
1187 1187
         endif;
1188 1188
 
1189 1189
     }
@@ -1219,7 +1219,7 @@  discard block
 block discarded – undo
1219 1219
                          * @param string $term_link The link html to the category.
1220 1220
                          * @param object $term The category term object.
1221 1221
                          */
1222
-                        $term_link = apply_filters('geodir_details_taxonomies_cat_link',$term_link,$term);
1222
+                        $term_link = apply_filters('geodir_details_taxonomies_cat_link', $term_link, $term);
1223 1223
                         $links[] = $term_link;
1224 1224
                         $terms[] = $term;
1225 1225
                     }
@@ -1237,7 +1237,7 @@  discard block
 block discarded – undo
1237 1237
         if (!isset($listing_label)) {
1238 1238
             $listing_label = '';
1239 1239
         }
1240
-        $taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1240
+        $taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object) $terms);
1241 1241
 
1242 1242
     }
1243 1243
 
@@ -1250,7 +1250,7 @@  discard block
 block discarded – undo
1250 1250
      * @param string $listing_label The post type label.
1251 1251
      * @param string $listing_label The post type label with ucwords function.
1252 1252
      */
1253
-    $taxonomies = apply_filters('geodir_details_taxonomies_output',$taxonomies,$post_type,$listing_label,geodir_ucwords($listing_label));
1253
+    $taxonomies = apply_filters('geodir_details_taxonomies_output', $taxonomies, $post_type, $listing_label, geodir_ucwords($listing_label));
1254 1254
 
1255 1255
     if (isset($taxonomies[$post_taxonomy])) {
1256 1256
         echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>';
@@ -1278,11 +1278,11 @@  discard block
 block discarded – undo
1278 1278
  * @param object $post Optional. The post object or blank.
1279 1279
  * @package GeoDirectory
1280 1280
  */
1281
-function geodir_action_details_micordata($post='')
1281
+function geodir_action_details_micordata($post = '')
1282 1282
 {
1283 1283
 
1284 1284
     global $preview;
1285
-    if(empty($post)){global $post;}
1285
+    if (empty($post)) {global $post; }
1286 1286
     if ($preview || !geodir_is_page('detail')) {
1287 1287
         return;
1288 1288
     }
@@ -1303,7 +1303,7 @@  discard block
 block discarded – undo
1303 1303
                 "description" => $review->comment_content,
1304 1304
                 "reviewRating" => array(
1305 1305
                     "@type" => "Rating",
1306
-                    "bestRating" => "5",// @todo this will need to be filtered for review manager if user changes the score.
1306
+                    "bestRating" => "5", // @todo this will need to be filtered for review manager if user changes the score.
1307 1307
                     "ratingValue" => geodir_get_commentoverall($review->comment_ID),
1308 1308
                     "worstRating" => "1"
1309 1309
                 )
@@ -1331,13 +1331,13 @@  discard block
 block discarded – undo
1331 1331
     }
1332 1332
     //print_r($post);
1333 1333
     // external links
1334
-    $external_links =  array();
1334
+    $external_links = array();
1335 1335
     $external_links[] = $post->geodir_website;
1336 1336
     $external_links[] = $post->geodir_twitter;
1337 1337
     $external_links[] = $post->geodir_facebook;
1338 1338
     $external_links = array_filter($external_links);
1339 1339
 
1340
-    if(!empty($external_links)){
1340
+    if (!empty($external_links)) {
1341 1341
         $external_links = array_values($external_links);
1342 1342
     }
1343 1343
 
@@ -1347,16 +1347,16 @@  discard block
 block discarded – undo
1347 1347
 
1348 1348
     // schema type
1349 1349
     $schema_type = 'LocalBusiness';
1350
-    if(isset($post->default_category) && $post->default_category){
1350
+    if (isset($post->default_category) && $post->default_category) {
1351 1351
         $schema_type = get_tax_meta($post->default_category, 'ct_cat_schema', false, $post->post_type);
1352
-        if(!$schema_type && $post->post_type=='gd_event'){$schema_type = 'Event';}
1352
+        if (!$schema_type && $post->post_type == 'gd_event') {$schema_type = 'Event'; }
1353 1353
     }
1354 1354
 
1355 1355
     $schema = array();
1356 1356
     $schema['@context'] = "http://schema.org";
1357 1357
     $schema['@type'] = $schema_type;
1358 1358
     $schema['name'] = $post->post_name;
1359
-    $schema['description'] = wp_strip_all_tags( $post->post_content, true );
1359
+    $schema['description'] = wp_strip_all_tags($post->post_content, true);
1360 1360
     $schema['telephone'] = $post->geodir_contact;
1361 1361
     $schema['url'] = $c_url;
1362 1362
     $schema['sameAs'] = $external_links;
@@ -1370,7 +1370,7 @@  discard block
 block discarded – undo
1370 1370
         "postalCode" => $post->post_zip
1371 1371
     );
1372 1372
 
1373
-    if($post->post_latitude && $post->post_longitude) {
1373
+    if ($post->post_latitude && $post->post_longitude) {
1374 1374
         $schema['geo'] = array(
1375 1375
             "@type" => "GeoCoordinates",
1376 1376
             "latitude" => $post->post_latitude,
@@ -1378,7 +1378,7 @@  discard block
 block discarded – undo
1378 1378
         );
1379 1379
     }
1380 1380
 
1381
-    if($post_avgratings) {
1381
+    if ($post_avgratings) {
1382 1382
         $schema['aggregateRating'] = array(
1383 1383
             "@type" => "AggregateRating",
1384 1384
             "ratingValue" => $post_avgratings,
@@ -1397,7 +1397,7 @@  discard block
 block discarded – undo
1397 1397
      * @param array $schema The array of schema data to be filtered.
1398 1398
      * @param object $post The post object.
1399 1399
      */
1400
-    $schema = apply_filters('geodir_details_schema', $schema,$post);
1400
+    $schema = apply_filters('geodir_details_schema', $schema, $post);
1401 1401
 
1402 1402
 
1403 1403
     echo '<script type="application/ld+json">' . json_encode($schema) . '</script>';
@@ -1605,26 +1605,26 @@  discard block
 block discarded – undo
1605 1605
 
1606 1606
 
1607 1607
     $title = $list_title;
1608
-    if(geodir_is_page('pt')){
1608
+    if (geodir_is_page('pt')) {
1609 1609
         $gd_page = 'pt';
1610
-        $title  = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
1610
+        $title = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
1611 1611
     }
1612
-    elseif(geodir_is_page('listing')){
1612
+    elseif (geodir_is_page('listing')) {
1613 1613
         $gd_page = 'listing';
1614 1614
         global $wp_query;
1615 1615
         $current_term = $wp_query->get_queried_object();
1616
-        if (strpos($current_term->taxonomy,'_tags') !== false) {
1616
+        if (strpos($current_term->taxonomy, '_tags') !== false) {
1617 1617
             $title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
1618
-        }else{
1618
+        } else {
1619 1619
             $title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
1620 1620
         }
1621 1621
 
1622 1622
     }
1623
-    elseif(geodir_is_page('author')){
1623
+    elseif (geodir_is_page('author')) {
1624 1624
         $gd_page = 'author';
1625
-        if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
1625
+        if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
1626 1626
             $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
1627
-        }else{
1627
+        } else {
1628 1628
             $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
1629 1629
         }
1630 1630
 
@@ -1638,7 +1638,7 @@  discard block
 block discarded – undo
1638 1638
      * @param string $title The page title including variables.
1639 1639
      * @param string $gd_page The GeoDirectory page type if any.
1640 1640
      */
1641
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
1641
+    $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
1642 1642
 
1643 1643
     echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
1644 1644
         /**
@@ -1683,7 +1683,7 @@  discard block
 block discarded – undo
1683 1683
         if ($cat_description) {
1684 1684
             ?>
1685 1685
 
1686
-            <div class="term_description"><?php echo $cat_description;?></div> <?php
1686
+            <div class="term_description"><?php echo $cat_description; ?></div> <?php
1687 1687
         }
1688 1688
 
1689 1689
     }
@@ -1968,7 +1968,7 @@  discard block
 block discarded – undo
1968 1968
      */
1969 1969
     do_action('geodir_main_content_open', 'listings-page', 'geodir-main-content', 'listings-page');
1970 1970
     $extra_class = apply_filters('geodir_before_listing_wrapper_extra_class', '', 'listings-page');
1971
-    echo '<div class="clearfix '.$extra_class.'">';
1971
+    echo '<div class="clearfix ' . $extra_class . '">';
1972 1972
     /**
1973 1973
      * Called before the listings page content, inside the outer wrapper. Used on listings pages and search and author pages.
1974 1974
      *
@@ -2044,11 +2044,11 @@  discard block
 block discarded – undo
2044 2044
 
2045 2045
     $title = apply_filters('geodir_add_listing_page_title_text', get_the_title());
2046 2046
 
2047
-    if(geodir_is_page('add-listing')){
2047
+    if (geodir_is_page('add-listing')) {
2048 2048
         $gd_page = 'add-listing';
2049
-        if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
2049
+        if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2050 2050
             $title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
2051
-        }elseif(isset($listing_type)){
2051
+        }elseif (isset($listing_type)) {
2052 2052
             $title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
2053 2053
         }
2054 2054
 
@@ -2062,7 +2062,7 @@  discard block
 block discarded – undo
2062 2062
      * @param string $title The page title including variables.
2063 2063
      * @param string $gd_page The GeoDirectory page type if any.
2064 2064
      */
2065
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2065
+    $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2066 2066
 
2067 2067
     echo '<header class="' . $class_header . '"><h1 class="' . $class . '">';
2068 2068
     echo $title;
@@ -2078,7 +2078,7 @@  discard block
 block discarded – undo
2078 2078
  */
2079 2079
 function geodir_action_add_listing_page_mandatory()
2080 2080
 {?>
2081
-    <p class="geodir-note "><span class="geodir-required">*</span>&nbsp;<?php echo INDICATES_MANDATORY_FIELDS_TEXT;?></p>
2081
+    <p class="geodir-note "><span class="geodir-required">*</span>&nbsp;<?php echo INDICATES_MANDATORY_FIELDS_TEXT; ?></p>
2082 2082
 <?php
2083 2083
 }
2084 2084
 
@@ -2113,7 +2113,7 @@  discard block
 block discarded – undo
2113 2113
 
2114 2114
     if (isset($_REQUEST['backandedit'])) {
2115 2115
         global $post;
2116
-        $post = (object)$gd_session->get('listing');
2116
+        $post = (object) $gd_session->get('listing');
2117 2117
         $listing_type = $post->listing_type;
2118 2118
         $title = $post->post_title;
2119 2119
         $desc = $post->post_desc;
@@ -2145,15 +2145,15 @@  discard block
 block discarded – undo
2145 2145
         $user_login = true;
2146 2146
     }
2147 2147
     ?>
2148
-    <form name="propertyform" id="propertyform" action="<?php echo get_page_link(geodir_preview_page_id());?>" method="post" enctype="multipart/form-data">
2149
-        <input type="hidden" name="preview" value="<?php echo sanitize_text_field($listing_type);?>"/>
2150
-        <input type="hidden" name="listing_type" value="<?php echo sanitize_text_field($listing_type);?>"/>
2148
+    <form name="propertyform" id="propertyform" action="<?php echo get_page_link(geodir_preview_page_id()); ?>" method="post" enctype="multipart/form-data">
2149
+        <input type="hidden" name="preview" value="<?php echo sanitize_text_field($listing_type); ?>"/>
2150
+        <input type="hidden" name="listing_type" value="<?php echo sanitize_text_field($listing_type); ?>"/>
2151 2151
         <?php if ($page_id) { ?>
2152
-        <input type="hidden" name="add_listing_page_id" value="<?php echo $page_id;?>"/>
2152
+        <input type="hidden" name="add_listing_page_id" value="<?php echo $page_id; ?>"/>
2153 2153
         <?php } if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') { ?>
2154
-            <input type="hidden" name="pid" value="<?php echo sanitize_text_field($_REQUEST['pid']);?>"/>
2154
+            <input type="hidden" name="pid" value="<?php echo sanitize_text_field($_REQUEST['pid']); ?>"/>
2155 2155
         <?php } if (isset($_REQUEST['backandedit'])) { ?>
2156
-            <input type="hidden" name="backandedit" value="<?php echo sanitize_text_field($_REQUEST['backandedit']);?>"/>
2156
+            <input type="hidden" name="backandedit" value="<?php echo sanitize_text_field($_REQUEST['backandedit']); ?>"/>
2157 2157
         <?php
2158 2158
         } 
2159 2159
         /**
@@ -2165,7 +2165,7 @@  discard block
 block discarded – undo
2165 2165
          */
2166 2166
         do_action('geodir_before_detail_fields');
2167 2167
         ?>
2168
-        <h5 id="geodir_fieldset_details" class="geodir-fieldset-row" gd-fieldset="details"><?php echo LISTING_DETAILS_TEXT;?></h5>
2168
+        <h5 id="geodir_fieldset_details" class="geodir-fieldset-row" gd-fieldset="details"><?php echo LISTING_DETAILS_TEXT; ?></h5>
2169 2169
         <?php
2170 2170
         /**
2171 2171
          * Called at the top of the add listing page form for frontend.
@@ -2177,10 +2177,10 @@  discard block
 block discarded – undo
2177 2177
         do_action('geodir_before_main_form_fields');
2178 2178
         ?>
2179 2179
         <div id="geodir_post_title_row" class="required_field geodir_form_row clearfix gd-fieldset-details">
2180
-            <label><?php echo PLACE_TITLE_TEXT;?><span>*</span> </label>
2180
+            <label><?php echo PLACE_TITLE_TEXT; ?><span>*</span> </label>
2181 2181
             <input type="text" field_type="text" name="post_title" id="post_title" class="geodir_textfield"
2182 2182
                    value="<?php echo esc_attr(stripslashes($title)); ?>"/>
2183
-            <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory');?></span>
2183
+            <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span>
2184 2184
         </div>
2185 2185
         <?php
2186 2186
         $show_editor = get_option('geodir_tiny_editor_on_add_listing');
@@ -2215,7 +2215,7 @@  discard block
 block discarded – undo
2215 2215
         $desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit);
2216 2216
         
2217 2217
         $desc_class = '';
2218
-        if ($desc_limit === '' || (int)$desc_limit > 0) {
2218
+        if ($desc_limit === '' || (int) $desc_limit > 0) {
2219 2219
             /**
2220 2220
              * Called on the add listing page form for frontend just before the description field.
2221 2221
              *
@@ -2228,8 +2228,8 @@  discard block
 block discarded – undo
2228 2228
             $desc_class = ' hidden';
2229 2229
         }
2230 2230
         ?>
2231
-        <div id="geodir_post_desc_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $desc_class;?>">
2232
-            <label><?php echo PLACE_DESC_TEXT;?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label>
2231
+        <div id="geodir_post_desc_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $desc_class; ?>">
2232
+            <label><?php echo PLACE_DESC_TEXT; ?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label>
2233 2233
             <?php
2234 2234
             if (!empty($show_editor) && in_array($listing_type, $show_editor)) {
2235 2235
                 $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
@@ -2238,16 +2238,16 @@  discard block
 block discarded – undo
2238 2238
                     <?php wp_editor($desc, "post_desc", $editor_settings); ?>
2239 2239
                 </div>
2240 2240
             <?php if ($desc_limit != '') { ?>
2241
-                <script type="text/javascript">jQuery('textarea#post_desc').attr('maxlength', "<?php echo $desc_limit;?>");</script>
2241
+                <script type="text/javascript">jQuery('textarea#post_desc').attr('maxlength', "<?php echo $desc_limit; ?>");</script>
2242 2242
             <?php } } else { ?>
2243 2243
                 <textarea field_type="textarea" name="post_desc" id="post_desc" class="geodir_textarea" maxlength="<?php echo $desc_limit; ?>"><?php echo $desc; ?></textarea>
2244 2244
             <?php } if ($desc_limit_msg != '') { ?>
2245 2245
                 <span class="geodir_message_note"><?php echo $desc_limit_msg; ?></span>
2246 2246
             <?php } ?>
2247
-            <span class="geodir_message_error"><?php echo _e($required_msg, 'geodirectory');?></span>
2247
+            <span class="geodir_message_error"><?php echo _e($required_msg, 'geodirectory'); ?></span>
2248 2248
         </div>
2249 2249
         <?php
2250
-        if ($desc_limit === '' || (int)$desc_limit > 0) {
2250
+        if ($desc_limit === '' || (int) $desc_limit > 0) {
2251 2251
             /**
2252 2252
              * Called on the add listing page form for frontend just after the description field.
2253 2253
              *
@@ -2286,7 +2286,7 @@  discard block
 block discarded – undo
2286 2286
         $kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count);
2287 2287
         
2288 2288
         $tags_class = '';
2289
-        if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2289
+        if ($kw_tags_count === '' || (int) $kw_tags_count > 0) {
2290 2290
             /**
2291 2291
              * Called on the add listing page form for frontend just before the tags field.
2292 2292
              *
@@ -2297,14 +2297,14 @@  discard block
 block discarded – undo
2297 2297
             $tags_class = ' hidden';
2298 2298
         }
2299 2299
         ?>
2300
-        <div id="geodir_post_tags_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $tags_class;?>">
2300
+        <div id="geodir_post_tags_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $tags_class; ?>">
2301 2301
             <label><?php echo TAGKW_TEXT; ?></label>
2302 2302
             <input name="post_tags" id="post_tags" value="<?php echo $kw_tags; ?>" type="text" class="geodir_textfield"
2303
-                   maxlength="<?php echo $kw_tags_count;?>"/>
2304
-            <span class="geodir_message_note"><?php echo $kw_tags_msg;?></span>
2303
+                   maxlength="<?php echo $kw_tags_count; ?>"/>
2304
+            <span class="geodir_message_note"><?php echo $kw_tags_msg; ?></span>
2305 2305
         </div>
2306 2306
         <?php
2307
-        if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2307
+        if ($kw_tags_count === '' || (int) $kw_tags_count > 0) {
2308 2308
             /**
2309 2309
              * Called on the add listing page form for frontend just after the tags field.
2310 2310
              *
@@ -2330,7 +2330,7 @@  discard block
 block discarded – undo
2330 2330
         $thumb_img_arr = array();
2331 2331
         $totImg = 0;
2332 2332
         if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
2333
-            $post = (object)$gd_session->get('listing');
2333
+            $post = (object) $gd_session->get('listing');
2334 2334
             if (isset($post->post_images))
2335 2335
                 $curImages = trim($post->post_images, ",");
2336 2336
 
@@ -2343,7 +2343,7 @@  discard block
 block discarded – undo
2343 2343
             $listing_type = $post->listing_type;
2344 2344
 
2345 2345
         } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2346
-            $post = geodir_get_post_info((int)$_REQUEST['pid']);
2346
+            $post = geodir_get_post_info((int) $_REQUEST['pid']);
2347 2347
             $listing_type = $post->post_type;
2348 2348
             $thumb_img_arr = geodir_get_images($_REQUEST['pid']);
2349 2349
 
@@ -2357,7 +2357,7 @@  discard block
 block discarded – undo
2357 2357
                 //$curImages = $img->src.",";
2358 2358
             }
2359 2359
 
2360
-            $totImg = count((array)$thumb_img_arr);
2360
+            $totImg = count((array) $thumb_img_arr);
2361 2361
         }
2362 2362
 
2363 2363
         if ($curImages != '')
@@ -2378,7 +2378,7 @@  discard block
 block discarded – undo
2378 2378
         if ($show_image_input_box) {
2379 2379
             ?>
2380 2380
 
2381
-            <h5 id="geodir_form_title_row" class="geodir-form_title"> <?php echo PRO_PHOTO_TEXT;?>
2381
+            <h5 id="geodir_form_title_row" class="geodir-form_title"> <?php echo PRO_PHOTO_TEXT; ?>
2382 2382
                 <?php if ($image_limit == 1) {
2383 2383
                     echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
2384 2384
                 } ?>
@@ -2401,7 +2401,7 @@  discard block
 block discarded – undo
2401 2401
                 <div
2402 2402
                     class="plupload-upload-uic hide-if-no-js <?php if ($multiple): ?>plupload-upload-uic-multiple<?php endif; ?>"
2403 2403
                     id="<?php echo $id; ?>plupload-upload-ui">
2404
-                    <h4><?php _e('Drop files to upload', 'geodirectory');?></h4><br/>
2404
+                    <h4><?php _e('Drop files to upload', 'geodirectory'); ?></h4><br/>
2405 2405
                     <input id="<?php echo $id; ?>plupload-browse-button" type="button"
2406 2406
                            value="<?php esc_attr_e('Select Files', 'geodirectory'); ?>" class="geodir_button"/>
2407 2407
                     <span class="ajaxnonceplu"
@@ -2418,7 +2418,7 @@  discard block
 block discarded – undo
2418 2418
                      id="<?php echo $id; ?>plupload-thumbs" style="border-top:1px solid #ccc; padding-top:10px;">
2419 2419
                 </div>
2420 2420
                 <span
2421
-                    id="upload-msg"><?php _e('Please drag &amp; drop the images to rearrange the order', 'geodirectory');?></span>
2421
+                    id="upload-msg"><?php _e('Please drag &amp; drop the images to rearrange the order', 'geodirectory'); ?></span>
2422 2422
                 <span id="<?php echo $id; ?>upload-error" style="display:none"></span>
2423 2423
             </div>
2424 2424
 
@@ -2430,7 +2430,7 @@  discard block
 block discarded – undo
2430 2430
          *
2431 2431
          * @since 1.0.0
2432 2432
          */
2433
-        do_action('geodir_after_main_form_fields');?>
2433
+        do_action('geodir_after_main_form_fields'); ?>
2434 2434
 
2435 2435
 
2436 2436
         <!-- add captcha code -->
@@ -2441,7 +2441,7 @@  discard block
 block discarded – undo
2441 2441
         </script>
2442 2442
         <noscript>
2443 2443
             <div>
2444
-                <label><?php _e('Type 64 into this box', 'geodirectory');?></label>
2444
+                <label><?php _e('Type 64 into this box', 'geodirectory'); ?></label>
2445 2445
                 <input type="text" id="geodir_spamblocker_top_form" name="geodir_spamblocker" value="" maxlength="10"/>
2446 2446
             </div>
2447 2447
         </noscript>
@@ -2451,10 +2451,10 @@  discard block
 block discarded – undo
2451 2451
         <!-- end captcha code -->
2452 2452
 
2453 2453
         <div id="geodir-add-listing-submit" class="geodir_form_row clear_both" style="padding:2px;text-align:center;">
2454
-            <input type="submit" value="<?php echo PRO_PREVIEW_BUTTON;?>"
2455
-                   class="geodir_button" <?php echo $submit_button;?>/>
2454
+            <input type="submit" value="<?php echo PRO_PREVIEW_BUTTON; ?>"
2455
+                   class="geodir_button" <?php echo $submit_button; ?>/>
2456 2456
             <span class="geodir_message_note"
2457
-                  style="padding-left:0px;"> <?php _e('Note: You will be able to see a preview in the next page', 'geodirectory');?></span>
2457
+                  style="padding-left:0px;"> <?php _e('Note: You will be able to see a preview in the next page', 'geodirectory'); ?></span>
2458 2458
         </div>
2459 2459
 
2460 2460
     </form>
@@ -2516,7 +2516,7 @@  discard block
 block discarded – undo
2516 2516
         class="<?php
2517 2517
         /** This action is documented in geodirectory_template_actions.php */
2518 2518
         echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>">
2519
-        <?php dynamic_sidebar('Reg/Login Top Section');?>
2519
+        <?php dynamic_sidebar('Reg/Login Top Section'); ?>
2520 2520
     </div><!-- clearfix ends here-->
2521 2521
 <?php
2522 2522
 }
@@ -2538,7 +2538,7 @@  discard block
 block discarded – undo
2538 2538
 
2539 2539
     ?>
2540 2540
     <script type="text/javascript">
2541
-        <?php if ( $user_login ) { ?>
2541
+        <?php if ($user_login) { ?>
2542 2542
         setTimeout(function () {
2543 2543
             try {
2544 2544
                 d = document.getElementById('user_pass');
@@ -2555,7 +2555,7 @@  discard block
 block discarded – undo
2555 2555
         <?php } ?>
2556 2556
     </script>
2557 2557
     <script type="text/javascript">
2558
-        <?php if ( $user_login ) { ?>
2558
+        <?php if ($user_login) { ?>
2559 2559
         setTimeout(function () {
2560 2560
             try {
2561 2561
                 d = document.getElementById('user_pass');
@@ -2693,11 +2693,11 @@  discard block
 block discarded – undo
2693 2693
     $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2694 2694
 
2695 2695
     $title = $list_title;
2696
-    if(geodir_is_page('author')){
2696
+    if (geodir_is_page('author')) {
2697 2697
         $gd_page = 'author';
2698
-        if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
2698
+        if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
2699 2699
             $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
2700
-        }else{
2700
+        } else {
2701 2701
             $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
2702 2702
         }
2703 2703
 
@@ -2711,7 +2711,7 @@  discard block
 block discarded – undo
2711 2711
      * @param string $title The page title including variables.
2712 2712
      * @param string $gd_page The GeoDirectory page type if any.
2713 2713
      */
2714
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2714
+    $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2715 2715
 
2716 2716
     echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2717 2717
         /**
@@ -2925,7 +2925,7 @@  discard block
 block discarded – undo
2925 2925
     $post_type_info = get_post_type_object($gd_post_type);
2926 2926
 
2927 2927
     $pt_name = '';
2928
-    if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;}
2928
+    if (isset($post_type_info->labels->name)) {$pt_name = $post_type_info->labels->name; }
2929 2929
 
2930 2930
     if (is_search()) {
2931 2931
         $list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
Please login to merge, or discard this patch.
Indentation   +1686 added lines, -1686 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Template functions that affect the output of most GeoDirectory pages
4
- *
5
- * @since 1.0.0
6
- * @package GeoDirectory
7
- */
3
+	 * Template functions that affect the output of most GeoDirectory pages
4
+	 *
5
+	 * @since 1.0.0
6
+	 * @package GeoDirectory
7
+	 */
8 8
 ###############################################
9 9
 ########### DYNAMIC CONTENT ###################
10 10
 ###############################################
@@ -17,10 +17,10 @@  discard block
 block discarded – undo
17 17
  */
18 18
 function gd_compat_styles()
19 19
 {
20
-    $tc = get_option('theme_compatibility_setting');
21
-    echo "<style id='gd-compat-styles' type='text/css'>";
22
-    echo $tc['geodir_theme_compat_css'];
23
-    echo "</style>";
20
+	$tc = get_option('theme_compatibility_setting');
21
+	echo "<style id='gd-compat-styles' type='text/css'>";
22
+	echo $tc['geodir_theme_compat_css'];
23
+	echo "</style>";
24 24
 }
25 25
 
26 26
 /**
@@ -31,10 +31,10 @@  discard block
 block discarded – undo
31 31
  */
32 32
 function gd_compat_script()
33 33
 {
34
-    $tc = get_option('theme_compatibility_setting');
35
-    echo "<script>";
36
-    echo $tc['geodir_theme_compat_js'];
37
-    echo " </script>";
34
+	$tc = get_option('theme_compatibility_setting');
35
+	echo "<script>";
36
+	echo $tc['geodir_theme_compat_js'];
37
+	echo " </script>";
38 38
 }
39 39
 
40 40
 /**
@@ -47,8 +47,8 @@  discard block
 block discarded – undo
47 47
  */
48 48
 function geodir_top_content_add_dynamic()
49 49
 {
50
-    $tc = get_option('theme_compatibility_setting');
51
-    echo $tc['geodir_top_content_add'];
50
+	$tc = get_option('theme_compatibility_setting');
51
+	echo $tc['geodir_top_content_add'];
52 52
 }
53 53
 
54 54
 /**
@@ -61,8 +61,8 @@  discard block
 block discarded – undo
61 61
  */
62 62
 function geodir_before_main_content_add_dynamic()
63 63
 {
64
-    $tc = get_option('theme_compatibility_setting');
65
-    echo $tc['geodir_before_main_content_add'];
64
+	$tc = get_option('theme_compatibility_setting');
65
+	echo $tc['geodir_before_main_content_add'];
66 66
 }
67 67
 
68 68
 /**
@@ -75,8 +75,8 @@  discard block
 block discarded – undo
75 75
  */
76 76
 function geodir_full_page_class_dynamic()
77 77
 {
78
-    $tc = get_option('theme_compatibility_setting');
79
-    return $tc['geodir_full_page_class_filter'];
78
+	$tc = get_option('theme_compatibility_setting');
79
+	return $tc['geodir_full_page_class_filter'];
80 80
 }
81 81
 
82 82
 /**
@@ -89,8 +89,8 @@  discard block
 block discarded – undo
89 89
  */
90 90
 function geodir_before_widget_dynamic()
91 91
 {
92
-    $tc = get_option('theme_compatibility_setting');
93
-    return $tc['geodir_before_widget_filter'];
92
+	$tc = get_option('theme_compatibility_setting');
93
+	return $tc['geodir_before_widget_filter'];
94 94
 }
95 95
 
96 96
 /**
@@ -103,8 +103,8 @@  discard block
 block discarded – undo
103 103
  */
104 104
 function geodir_after_widget_dynamic()
105 105
 {
106
-    $tc = get_option('theme_compatibility_setting');
107
-    return $tc['geodir_after_widget_filter'];
106
+	$tc = get_option('theme_compatibility_setting');
107
+	return $tc['geodir_after_widget_filter'];
108 108
 }
109 109
 
110 110
 /**
@@ -117,8 +117,8 @@  discard block
 block discarded – undo
117 117
  */
118 118
 function geodir_before_title_dynamic()
119 119
 {
120
-    $tc = get_option('theme_compatibility_setting');
121
-    return $tc['geodir_before_title_filter'];
120
+	$tc = get_option('theme_compatibility_setting');
121
+	return $tc['geodir_before_title_filter'];
122 122
 }
123 123
 
124 124
 /**
@@ -131,8 +131,8 @@  discard block
 block discarded – undo
131 131
  */
132 132
 function geodir_after_title_dynamic()
133 133
 {
134
-    $tc = get_option('theme_compatibility_setting');
135
-    return $tc['geodir_after_title_filter'];
134
+	$tc = get_option('theme_compatibility_setting');
135
+	return $tc['geodir_after_title_filter'];
136 136
 }
137 137
 
138 138
 /**
@@ -145,8 +145,8 @@  discard block
 block discarded – undo
145 145
  */
146 146
 function geodir_menu_li_class_dynamic()
147 147
 {
148
-    $tc = get_option('theme_compatibility_setting');
149
-    return $tc['geodir_menu_li_class_filter'];
148
+	$tc = get_option('theme_compatibility_setting');
149
+	return $tc['geodir_menu_li_class_filter'];
150 150
 }
151 151
 
152 152
 /**
@@ -159,8 +159,8 @@  discard block
 block discarded – undo
159 159
  */
160 160
 function geodir_sub_menu_ul_class_dynamic()
161 161
 {
162
-    $tc = get_option('theme_compatibility_setting');
163
-    return $tc['geodir_sub_menu_ul_class_filter'];
162
+	$tc = get_option('theme_compatibility_setting');
163
+	return $tc['geodir_sub_menu_ul_class_filter'];
164 164
 }
165 165
 
166 166
 /**
@@ -173,8 +173,8 @@  discard block
 block discarded – undo
173 173
  */
174 174
 function geodir_sub_menu_li_class_dynamic()
175 175
 {
176
-    $tc = get_option('theme_compatibility_setting');
177
-    return $tc['geodir_sub_menu_li_class_filter'];
176
+	$tc = get_option('theme_compatibility_setting');
177
+	return $tc['geodir_sub_menu_li_class_filter'];
178 178
 }
179 179
 
180 180
 /**
@@ -187,8 +187,8 @@  discard block
 block discarded – undo
187 187
  */
188 188
 function geodir_menu_a_class_dynamic()
189 189
 {
190
-    $tc = get_option('theme_compatibility_setting');
191
-    return $tc['geodir_menu_a_class_filter'];
190
+	$tc = get_option('theme_compatibility_setting');
191
+	return $tc['geodir_menu_a_class_filter'];
192 192
 }
193 193
 
194 194
 /**
@@ -201,8 +201,8 @@  discard block
 block discarded – undo
201 201
  */
202 202
 function geodir_sub_menu_a_class_dynamic()
203 203
 {
204
-    $tc = get_option('theme_compatibility_setting');
205
-    return $tc['geodir_sub_menu_a_class_filter'];
204
+	$tc = get_option('theme_compatibility_setting');
205
+	return $tc['geodir_sub_menu_a_class_filter'];
206 206
 }
207 207
 
208 208
 /**
@@ -215,8 +215,8 @@  discard block
 block discarded – undo
215 215
  */
216 216
 function geodir_location_switcher_menu_li_class_dynamic()
217 217
 {
218
-    $tc = get_option('theme_compatibility_setting');
219
-    return $tc['geodir_location_switcher_menu_li_class_filter'];
218
+	$tc = get_option('theme_compatibility_setting');
219
+	return $tc['geodir_location_switcher_menu_li_class_filter'];
220 220
 }
221 221
 
222 222
 /**
@@ -229,8 +229,8 @@  discard block
 block discarded – undo
229 229
  */
230 230
 function geodir_location_switcher_menu_a_class_dynamic()
231 231
 {
232
-    $tc = get_option('theme_compatibility_setting');
233
-    return $tc['geodir_location_switcher_menu_a_class_filter'];
232
+	$tc = get_option('theme_compatibility_setting');
233
+	return $tc['geodir_location_switcher_menu_a_class_filter'];
234 234
 }
235 235
 
236 236
 /**
@@ -243,8 +243,8 @@  discard block
 block discarded – undo
243 243
  */
244 244
 function geodir_location_switcher_menu_sub_ul_class_dynamic()
245 245
 {
246
-    $tc = get_option('theme_compatibility_setting');
247
-    return $tc['geodir_location_switcher_menu_sub_ul_class_filter'];
246
+	$tc = get_option('theme_compatibility_setting');
247
+	return $tc['geodir_location_switcher_menu_sub_ul_class_filter'];
248 248
 }
249 249
 
250 250
 /**
@@ -257,8 +257,8 @@  discard block
 block discarded – undo
257 257
  */
258 258
 function geodir_location_switcher_menu_sub_li_class_dynamic()
259 259
 {
260
-    $tc = get_option('theme_compatibility_setting');
261
-    return $tc['geodir_location_switcher_menu_sub_li_class_filter'];
260
+	$tc = get_option('theme_compatibility_setting');
261
+	return $tc['geodir_location_switcher_menu_sub_li_class_filter'];
262 262
 }
263 263
 
264 264
 
@@ -275,106 +275,106 @@  discard block
 block discarded – undo
275 275
 function geodir_content_actions_dynamic()
276 276
 {
277 277
 
278
-    $tc = get_option('theme_compatibility_setting');
279
-    if (empty($tc)) {
280
-        return;
281
-    }
278
+	$tc = get_option('theme_compatibility_setting');
279
+	if (empty($tc)) {
280
+		return;
281
+	}
282 282
 
283
-    //php
284
-    if (!empty($tc['geodir_theme_compat_code'])) {
285
-        include_once('geodirectory-functions/compatibility/' . $tc['geodir_theme_compat_code'] . '.php');
286
-    }
283
+	//php
284
+	if (!empty($tc['geodir_theme_compat_code'])) {
285
+		include_once('geodirectory-functions/compatibility/' . $tc['geodir_theme_compat_code'] . '.php');
286
+	}
287 287
 
288
-    //geodir_full_page_class
289
-    if (!empty($tc['geodir_full_page_class_filter'])) {
290
-        add_filter('geodir_full_page_class', 'geodir_full_page_class_dynamic', 10);
291
-    }
288
+	//geodir_full_page_class
289
+	if (!empty($tc['geodir_full_page_class_filter'])) {
290
+		add_filter('geodir_full_page_class', 'geodir_full_page_class_dynamic', 10);
291
+	}
292 292
 
293
-    //widget before filter
294
-    if (!empty($tc['geodir_before_widget_filter'])) {
295
-        add_filter('geodir_before_widget', 'geodir_before_widget_dynamic', 10);
296
-    }
293
+	//widget before filter
294
+	if (!empty($tc['geodir_before_widget_filter'])) {
295
+		add_filter('geodir_before_widget', 'geodir_before_widget_dynamic', 10);
296
+	}
297 297
 
298
-    //widget after filter
299
-    if (!empty($tc['geodir_after_widget_filter'])) {
300
-        add_filter('geodir_after_widget', 'geodir_after_widget_dynamic', 10);
301
-    }
298
+	//widget after filter
299
+	if (!empty($tc['geodir_after_widget_filter'])) {
300
+		add_filter('geodir_after_widget', 'geodir_after_widget_dynamic', 10);
301
+	}
302 302
 
303
-    //widget before title filter
304
-    if (!empty($tc['geodir_before_title_filter'])) {
305
-        add_filter('geodir_before_title', 'geodir_before_title_dynamic', 10);
306
-    }
303
+	//widget before title filter
304
+	if (!empty($tc['geodir_before_title_filter'])) {
305
+		add_filter('geodir_before_title', 'geodir_before_title_dynamic', 10);
306
+	}
307 307
 
308
-    //widget before title filter
309
-    if (!empty($tc['geodir_after_title_filter'])) {
310
-        add_filter('geodir_after_title', 'geodir_after_title_dynamic', 10);
311
-    }
308
+	//widget before title filter
309
+	if (!empty($tc['geodir_after_title_filter'])) {
310
+		add_filter('geodir_after_title', 'geodir_after_title_dynamic', 10);
311
+	}
312 312
 
313
-    //menu li class
314
-    if (!empty($tc['geodir_menu_li_class_filter'])) {
315
-        add_filter('geodir_menu_li_class', 'geodir_menu_li_class_dynamic', 10);
316
-    }
313
+	//menu li class
314
+	if (!empty($tc['geodir_menu_li_class_filter'])) {
315
+		add_filter('geodir_menu_li_class', 'geodir_menu_li_class_dynamic', 10);
316
+	}
317 317
 
318
-    //menu ul class
319
-    if (!empty($tc['geodir_sub_menu_ul_class_filter'])) {
320
-        add_filter('geodir_sub_menu_ul_class', 'geodir_sub_menu_ul_class_dynamic', 10);
321
-    }
318
+	//menu ul class
319
+	if (!empty($tc['geodir_sub_menu_ul_class_filter'])) {
320
+		add_filter('geodir_sub_menu_ul_class', 'geodir_sub_menu_ul_class_dynamic', 10);
321
+	}
322 322
 
323
-    //menu sub li class
324
-    if (!empty($tc['geodir_sub_menu_li_class_filter'])) {
325
-        add_filter('geodir_sub_menu_li_class', 'geodir_sub_menu_li_class_dynamic', 10);
326
-    }
323
+	//menu sub li class
324
+	if (!empty($tc['geodir_sub_menu_li_class_filter'])) {
325
+		add_filter('geodir_sub_menu_li_class', 'geodir_sub_menu_li_class_dynamic', 10);
326
+	}
327 327
 
328
-    //menu a class
329
-    if (!empty($tc['geodir_menu_a_class_filter'])) {
330
-        add_filter('geodir_menu_a_class', 'geodir_menu_a_class_dynamic', 10);
331
-    }
328
+	//menu a class
329
+	if (!empty($tc['geodir_menu_a_class_filter'])) {
330
+		add_filter('geodir_menu_a_class', 'geodir_menu_a_class_dynamic', 10);
331
+	}
332 332
 
333
-    //menu sub a class
334
-    if (!empty($tc['geodir_sub_menu_a_class_filter'])) {
335
-        add_filter('geodir_sub_menu_a_class', 'geodir_sub_menu_a_class_dynamic', 10);
336
-    }
333
+	//menu sub a class
334
+	if (!empty($tc['geodir_sub_menu_a_class_filter'])) {
335
+		add_filter('geodir_sub_menu_a_class', 'geodir_sub_menu_a_class_dynamic', 10);
336
+	}
337 337
 
338
-    //location menu li class
339
-    if (!empty($tc['geodir_location_switcher_menu_li_class_filter'])) {
340
-        add_filter('geodir_location_switcher_menu_li_class', 'geodir_location_switcher_menu_li_class_dynamic', 10);
341
-    }
338
+	//location menu li class
339
+	if (!empty($tc['geodir_location_switcher_menu_li_class_filter'])) {
340
+		add_filter('geodir_location_switcher_menu_li_class', 'geodir_location_switcher_menu_li_class_dynamic', 10);
341
+	}
342 342
 
343
-    //location menu sub ul class
344
-    if (!empty($tc['geodir_location_switcher_menu_sub_ul_class_filter'])) {
345
-        add_filter('geodir_location_switcher_menu_sub_ul_class', 'geodir_location_switcher_menu_sub_ul_class_dynamic', 10);
346
-    }
343
+	//location menu sub ul class
344
+	if (!empty($tc['geodir_location_switcher_menu_sub_ul_class_filter'])) {
345
+		add_filter('geodir_location_switcher_menu_sub_ul_class', 'geodir_location_switcher_menu_sub_ul_class_dynamic', 10);
346
+	}
347 347
 
348
-    //location menu sub li class
349
-    if (!empty($tc['geodir_location_switcher_menu_sub_li_class_filter'])) {
350
-        add_filter('geodir_location_switcher_menu_sub_li_class', 'geodir_location_switcher_menu_sub_li_class_dynamic', 10);
351
-    }
348
+	//location menu sub li class
349
+	if (!empty($tc['geodir_location_switcher_menu_sub_li_class_filter'])) {
350
+		add_filter('geodir_location_switcher_menu_sub_li_class', 'geodir_location_switcher_menu_sub_li_class_dynamic', 10);
351
+	}
352 352
 
353
-    //location menu a class
354
-    if (!empty($tc['geodir_location_switcher_menu_a_class_filter'])) {
355
-        add_filter('geodir_location_switcher_menu_a_class', 'geodir_location_switcher_menu_a_class_dynamic', 10);
356
-    }
353
+	//location menu a class
354
+	if (!empty($tc['geodir_location_switcher_menu_a_class_filter'])) {
355
+		add_filter('geodir_location_switcher_menu_a_class', 'geodir_location_switcher_menu_a_class_dynamic', 10);
356
+	}
357 357
 
358
-    // compat styles
359
-    if (!empty($tc['geodir_theme_compat_css'])) {
360
-        add_action('wp_head', 'gd_compat_styles');
361
-    }
358
+	// compat styles
359
+	if (!empty($tc['geodir_theme_compat_css'])) {
360
+		add_action('wp_head', 'gd_compat_styles');
361
+	}
362 362
 
363
-    // compat js
364
-    if (!empty($tc['geodir_theme_compat_js'])) {
365
-        add_action('wp_footer', 'gd_compat_script');
366
-    }
363
+	// compat js
364
+	if (!empty($tc['geodir_theme_compat_js'])) {
365
+		add_action('wp_footer', 'gd_compat_script');
366
+	}
367 367
 
368 368
 
369
-    // geodir_top_content_add
370
-    if (!empty($tc['geodir_top_content_add'])) {
371
-        add_action('geodir_top_content', 'geodir_top_content_add_dynamic', 10, 1);
372
-    }
369
+	// geodir_top_content_add
370
+	if (!empty($tc['geodir_top_content_add'])) {
371
+		add_action('geodir_top_content', 'geodir_top_content_add_dynamic', 10, 1);
372
+	}
373 373
 
374
-    // geodir_before_main_content_add
375
-    if (!empty($tc['geodir_before_main_content_add'])) {
376
-        add_action('geodir_before_main_content', 'geodir_before_main_content_add_dynamic', 10, 1);
377
-    }
374
+	// geodir_before_main_content_add
375
+	if (!empty($tc['geodir_before_main_content_add'])) {
376
+		add_action('geodir_before_main_content', 'geodir_before_main_content_add_dynamic', 10, 1);
377
+	}
378 378
 
379 379
 
380 380
 }
@@ -397,23 +397,23 @@  discard block
 block discarded – undo
397 397
  */
398 398
 function geodir_action_wrapper_open($type = '', $id = '', $class = '')
399 399
 {
400
-    $tc = get_option('theme_compatibility_setting');
401
-    if (!empty($tc['geodir_wrapper_open_replace'])) {
402
-        $text = $tc['geodir_wrapper_open_replace'];
403
-    } else {
404
-        $text = '<div id="[id]" class="[class]">';
405
-    }
400
+	$tc = get_option('theme_compatibility_setting');
401
+	if (!empty($tc['geodir_wrapper_open_replace'])) {
402
+		$text = $tc['geodir_wrapper_open_replace'];
403
+	} else {
404
+		$text = '<div id="[id]" class="[class]">';
405
+	}
406 406
 
407
-    if (!empty($tc['geodir_wrapper_open_id'])) {
408
-        $id = $tc['geodir_wrapper_open_id'];
409
-    }
410
-    if (!empty($tc['geodir_wrapper_open_class'])) {
411
-        $class = $tc['geodir_wrapper_open_class'];
412
-    }
407
+	if (!empty($tc['geodir_wrapper_open_id'])) {
408
+		$id = $tc['geodir_wrapper_open_id'];
409
+	}
410
+	if (!empty($tc['geodir_wrapper_open_class'])) {
411
+		$class = $tc['geodir_wrapper_open_class'];
412
+	}
413 413
 
414
-    $text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
414
+	$text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
415 415
 
416
-    echo $text;
416
+	echo $text;
417 417
 }
418 418
 
419 419
 // action for adding the wrapperdiv closing tag
@@ -428,14 +428,14 @@  discard block
 block discarded – undo
428 428
  */
429 429
 function geodir_action_wrapper_close($type = '')
430 430
 {
431
-    $tc = get_option('theme_compatibility_setting');
432
-    if (!empty($tc['geodir_wrapper_close_replace'])) {
433
-        $text = $tc['geodir_wrapper_close_replace'];
434
-    } else {
435
-        $text = '</div><!-- wrapper ends here-->';
436
-    }
431
+	$tc = get_option('theme_compatibility_setting');
432
+	if (!empty($tc['geodir_wrapper_close_replace'])) {
433
+		$text = $tc['geodir_wrapper_close_replace'];
434
+	} else {
435
+		$text = '</div><!-- wrapper ends here-->';
436
+	}
437 437
 
438
-    echo $text;
438
+	echo $text;
439 439
 }
440 440
 
441 441
 // action for adding the content div opening tag
@@ -451,35 +451,35 @@  discard block
 block discarded – undo
451 451
  */
452 452
 function geodir_action_wrapper_content_open($type = '', $id = '', $class = '')
453 453
 {
454
-    if ($type == 'home-page' && $width = get_option('geodir_width_home_contant_section')) {
455
-        $width_css = 'style="width:' . $width . '%;"';
456
-    } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_contant_section')) {
457
-        $width_css = 'style="width:' . $width . '%;"';
458
-    } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_contant_section')) {
459
-        $width_css = 'style="width:' . $width . '%;"';
460
-    } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_contant_section')) {
461
-        $width_css = 'style="width:' . $width . '%;"';
462
-    } else {
463
-        $width_css = '';
464
-    }
465
-
466
-    $tc = get_option('theme_compatibility_setting');
467
-    if (!empty($tc['geodir_wrapper_content_open_replace'])) {
468
-        $text = $tc['geodir_wrapper_content_open_replace'];
469
-    } else {
470
-        $text = '<div id="[id]" class="[class]" role="main" [width_css]>';
471
-    }
472
-
473
-    if (!empty($tc['geodir_wrapper_content_open_id'])) {
474
-        $id = $tc['geodir_wrapper_content_open_id'];
475
-    }
476
-    if (!empty($tc['geodir_wrapper_content_open_class'])) {
477
-        $class = $tc['geodir_wrapper_content_open_class'];
478
-    }
479
-
480
-    $text = str_replace(array("[id]", "[class]", "[width_css]"), array($id, $class, $width_css), $text);
481
-
482
-    echo $text;
454
+	if ($type == 'home-page' && $width = get_option('geodir_width_home_contant_section')) {
455
+		$width_css = 'style="width:' . $width . '%;"';
456
+	} elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_contant_section')) {
457
+		$width_css = 'style="width:' . $width . '%;"';
458
+	} elseif ($type == 'search-page' && $width = get_option('geodir_width_search_contant_section')) {
459
+		$width_css = 'style="width:' . $width . '%;"';
460
+	} elseif ($type == 'author-page' && $width = get_option('geodir_width_author_contant_section')) {
461
+		$width_css = 'style="width:' . $width . '%;"';
462
+	} else {
463
+		$width_css = '';
464
+	}
465
+
466
+	$tc = get_option('theme_compatibility_setting');
467
+	if (!empty($tc['geodir_wrapper_content_open_replace'])) {
468
+		$text = $tc['geodir_wrapper_content_open_replace'];
469
+	} else {
470
+		$text = '<div id="[id]" class="[class]" role="main" [width_css]>';
471
+	}
472
+
473
+	if (!empty($tc['geodir_wrapper_content_open_id'])) {
474
+		$id = $tc['geodir_wrapper_content_open_id'];
475
+	}
476
+	if (!empty($tc['geodir_wrapper_content_open_class'])) {
477
+		$class = $tc['geodir_wrapper_content_open_class'];
478
+	}
479
+
480
+	$text = str_replace(array("[id]", "[class]", "[width_css]"), array($id, $class, $width_css), $text);
481
+
482
+	echo $text;
483 483
 }
484 484
 
485 485
 // action for adding the primary div closing tag
@@ -493,13 +493,13 @@  discard block
 block discarded – undo
493 493
  */
494 494
 function geodir_action_wrapper_content_close($type = '')
495 495
 {
496
-    $tc = get_option('theme_compatibility_setting');
497
-    if (!empty($tc['geodir_wrapper_content_close_replace'])) {
498
-        $text = $tc['geodir_wrapper_content_close_replace'];
499
-    } else {
500
-        $text = '</div><!-- content ends here-->';
501
-    }
502
-    echo $text;
496
+	$tc = get_option('theme_compatibility_setting');
497
+	if (!empty($tc['geodir_wrapper_content_close_replace'])) {
498
+		$text = $tc['geodir_wrapper_content_close_replace'];
499
+	} else {
500
+		$text = '</div><!-- content ends here-->';
501
+	}
502
+	echo $text;
503 503
 }
504 504
 
505 505
 // action for adding the <article> opening tag
@@ -517,24 +517,24 @@  discard block
 block discarded – undo
517 517
  */
518 518
 function geodir_action_article_open($type = '', $id = '', $class = '', $itemtype = '')
519 519
 {
520
-    $class = implode(" ", $class);
521
-    $tc = get_option('theme_compatibility_setting');
522
-    if (!empty($tc['geodir_article_open_replace'])) {
523
-        $text = $tc['geodir_article_open_replace'];
524
-    } else {
525
-        $text = '<article  id="[id]" class="[class]" >';
526
-    }
520
+	$class = implode(" ", $class);
521
+	$tc = get_option('theme_compatibility_setting');
522
+	if (!empty($tc['geodir_article_open_replace'])) {
523
+		$text = $tc['geodir_article_open_replace'];
524
+	} else {
525
+		$text = '<article  id="[id]" class="[class]" >';
526
+	}
527 527
 
528
-    if (!empty($tc['geodir_article_open_id'])) {
529
-        $id = $tc['geodir_article_open_id'];
530
-    }
531
-    if (!empty($tc['geodir_article_open_class'])) {
532
-        $class = $tc['geodir_article_open_class'];
533
-    }
528
+	if (!empty($tc['geodir_article_open_id'])) {
529
+		$id = $tc['geodir_article_open_id'];
530
+	}
531
+	if (!empty($tc['geodir_article_open_class'])) {
532
+		$class = $tc['geodir_article_open_class'];
533
+	}
534 534
 
535
-    $text = str_replace(array("[id]", "[class]", "[itemtype]"), array($id, $class, $itemtype), $text);
535
+	$text = str_replace(array("[id]", "[class]", "[itemtype]"), array($id, $class, $itemtype), $text);
536 536
 
537
-    echo $text;
537
+	echo $text;
538 538
 }
539 539
 
540 540
 // action for adding the primary div closing tag
@@ -548,13 +548,13 @@  discard block
 block discarded – undo
548 548
  */
549 549
 function geodir_action_article_close($type = '')
550 550
 {
551
-    $tc = get_option('theme_compatibility_setting');
552
-    if (!empty($tc['geodir_article_close_replace'])) {
553
-        $text = $tc['geodir_article_close_replace'];
554
-    } else {
555
-        $text = '</article><!-- article ends here-->';
556
-    }
557
-    echo $text;
551
+	$tc = get_option('theme_compatibility_setting');
552
+	if (!empty($tc['geodir_article_close_replace'])) {
553
+		$text = $tc['geodir_article_close_replace'];
554
+	} else {
555
+		$text = '</article><!-- article ends here-->';
556
+	}
557
+	echo $text;
558 558
 }
559 559
 
560 560
 // action for adding the sidebar opening tag
@@ -571,35 +571,35 @@  discard block
 block discarded – undo
571 571
  */
572 572
 function geodir_action_sidebar_right_open($type = '', $id = '', $class = '', $itemtype = '')
573 573
 {
574
-    if ($type == 'home-page' && $width = get_option('geodir_width_home_right_section')) {
575
-        $width_css = 'style="width:' . $width . '%;"';
576
-    } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_right_section')) {
577
-        $width_css = 'style="width:' . $width . '%;"';
578
-    } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_right_section')) {
579
-        $width_css = 'style="width:' . $width . '%;"';
580
-    } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_right_section')) {
581
-        $width_css = 'style="width:' . $width . '%;"';
582
-    } else {
583
-        $width_css = '';
584
-    }
585
-
586
-    $tc = get_option('theme_compatibility_setting');
587
-    if (!empty($tc['geodir_sidebar_right_open_replace'])) {
588
-        $text = $tc['geodir_sidebar_right_open_replace'];
589
-    } else {
590
-        $text = '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>';
591
-    }
592
-
593
-    if (!empty($tc['geodir_sidebar_right_open_id'])) {
594
-        $id = $tc['geodir_sidebar_right_open_id'];
595
-    }
596
-    if (!empty($tc['geodir_sidebar_right_open_class'])) {
597
-        $class = $tc['geodir_sidebar_right_open_class'];
598
-    }
599
-
600
-    $text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
601
-
602
-    echo $text;
574
+	if ($type == 'home-page' && $width = get_option('geodir_width_home_right_section')) {
575
+		$width_css = 'style="width:' . $width . '%;"';
576
+	} elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_right_section')) {
577
+		$width_css = 'style="width:' . $width . '%;"';
578
+	} elseif ($type == 'search-page' && $width = get_option('geodir_width_search_right_section')) {
579
+		$width_css = 'style="width:' . $width . '%;"';
580
+	} elseif ($type == 'author-page' && $width = get_option('geodir_width_author_right_section')) {
581
+		$width_css = 'style="width:' . $width . '%;"';
582
+	} else {
583
+		$width_css = '';
584
+	}
585
+
586
+	$tc = get_option('theme_compatibility_setting');
587
+	if (!empty($tc['geodir_sidebar_right_open_replace'])) {
588
+		$text = $tc['geodir_sidebar_right_open_replace'];
589
+	} else {
590
+		$text = '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>';
591
+	}
592
+
593
+	if (!empty($tc['geodir_sidebar_right_open_id'])) {
594
+		$id = $tc['geodir_sidebar_right_open_id'];
595
+	}
596
+	if (!empty($tc['geodir_sidebar_right_open_class'])) {
597
+		$class = $tc['geodir_sidebar_right_open_class'];
598
+	}
599
+
600
+	$text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
601
+
602
+	echo $text;
603 603
 }
604 604
 
605 605
 // action for adding the primary div closing tag
@@ -613,13 +613,13 @@  discard block
 block discarded – undo
613 613
  */
614 614
 function geodir_action_sidebar_right_close($type = '')
615 615
 {
616
-    $tc = get_option('theme_compatibility_setting');
617
-    if (!empty($tc['geodir_sidebar_right_close_replace'])) {
618
-        $text = $tc['geodir_sidebar_right_close_replace'];
619
-    } else {
620
-        $text = '</aside><!-- sidebar ends here-->';
621
-    }
622
-    echo $text;
616
+	$tc = get_option('theme_compatibility_setting');
617
+	if (!empty($tc['geodir_sidebar_right_close_replace'])) {
618
+		$text = $tc['geodir_sidebar_right_close_replace'];
619
+	} else {
620
+		$text = '</aside><!-- sidebar ends here-->';
621
+	}
622
+	echo $text;
623 623
 }
624 624
 
625 625
 
@@ -640,121 +640,121 @@  discard block
 block discarded – undo
640 640
  */
641 641
 function geodir_action_geodir_set_preview_post()
642 642
 {
643
-    global $post, $preview, $gd_session;
644
-    $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
645
-    if (!$preview || $is_backend_preview) {
646
-        return;
647
-    }// bail if not previewing
648
-
649
-    $listing_type = isset($_REQUEST['listing_type']) ? sanitize_text_field($_REQUEST['listing_type']) : '';
650
-
651
-    $fields_info = geodir_get_custom_fields_type($listing_type);
652
-
653
-    foreach ($_REQUEST as $pkey => $pval) {
654
-        if ($pkey == 'geodir_video') {
655
-            $tags = '<iframe>';
656
-        } else if ($pkey == 'post_desc') {
657
-            $tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>';
658
-        } else if (is_array($fields_info) && isset($fields_info[$pkey]) && ($fields_info[$pkey] == 'textarea' || $fields_info[$pkey] == 'html')) {
659
-            $tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>';
660
-        } else if (is_array($_REQUEST[$pkey])) {
661
-            $tags = 'skip_field';
662
-        } else {
663
-            $tags = '';
664
-        }
665
-        /**
666
-         * Allows the filtering of the allowed HTML tags per field when submitting from frontend add listing page.
667
-         *
668
-         * @since 1.0.0
669
-         * @param string $tags The allowed HTML tags for the field. Can be many things, for example the description allows these tags '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>'.
670
-         * @param string|array $pkey The field id/name. If array then value is set as "skip_field".
671
-         */
672
-        $tags = apply_filters('geodir_save_post_key', $tags, $pkey);
673
-
674
-        if ($tags != 'skip_field') {
675
-            $_REQUEST[$pkey] = strip_tags($_REQUEST[$pkey], $tags);
676
-        }
677
-    }
678
-
679
-    $post = (object)$_REQUEST;
680
-
681
-
682
-    if (isset($post->video)) {
683
-        $post->video = stripslashes($post->video);
684
-    }
685
-
686
-    if (isset($post->Video2)) {
687
-        $post->Video2 = stripslashes($post->Video2);
688
-    }
689
-
690
-    $post_type = $post->listing_type;
691
-    $post_type_info = get_post_type_object($post_type);
692
-
693
-    $listing_label = $post_type_info->labels->singular_name;
694
-
695
-    $term_icon = '';
696
-
697
-    if (!empty($post->post_category)) {
698
-        foreach ($post->post_category as $post_taxonomy => $post_term) {
699
-
700
-            if ($post_term != '' && !is_array($post_term)) {
701
-                $post_term = explode(',', trim($post_term, ','));
702
-            }
643
+	global $post, $preview, $gd_session;
644
+	$is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
645
+	if (!$preview || $is_backend_preview) {
646
+		return;
647
+	}// bail if not previewing
648
+
649
+	$listing_type = isset($_REQUEST['listing_type']) ? sanitize_text_field($_REQUEST['listing_type']) : '';
650
+
651
+	$fields_info = geodir_get_custom_fields_type($listing_type);
652
+
653
+	foreach ($_REQUEST as $pkey => $pval) {
654
+		if ($pkey == 'geodir_video') {
655
+			$tags = '<iframe>';
656
+		} else if ($pkey == 'post_desc') {
657
+			$tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>';
658
+		} else if (is_array($fields_info) && isset($fields_info[$pkey]) && ($fields_info[$pkey] == 'textarea' || $fields_info[$pkey] == 'html')) {
659
+			$tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>';
660
+		} else if (is_array($_REQUEST[$pkey])) {
661
+			$tags = 'skip_field';
662
+		} else {
663
+			$tags = '';
664
+		}
665
+		/**
666
+		 * Allows the filtering of the allowed HTML tags per field when submitting from frontend add listing page.
667
+		 *
668
+		 * @since 1.0.0
669
+		 * @param string $tags The allowed HTML tags for the field. Can be many things, for example the description allows these tags '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>'.
670
+		 * @param string|array $pkey The field id/name. If array then value is set as "skip_field".
671
+		 */
672
+		$tags = apply_filters('geodir_save_post_key', $tags, $pkey);
673
+
674
+		if ($tags != 'skip_field') {
675
+			$_REQUEST[$pkey] = strip_tags($_REQUEST[$pkey], $tags);
676
+		}
677
+	}
678
+
679
+	$post = (object)$_REQUEST;
680
+
681
+
682
+	if (isset($post->video)) {
683
+		$post->video = stripslashes($post->video);
684
+	}
685
+
686
+	if (isset($post->Video2)) {
687
+		$post->Video2 = stripslashes($post->Video2);
688
+	}
689
+
690
+	$post_type = $post->listing_type;
691
+	$post_type_info = get_post_type_object($post_type);
692
+
693
+	$listing_label = $post_type_info->labels->singular_name;
694
+
695
+	$term_icon = '';
696
+
697
+	if (!empty($post->post_category)) {
698
+		foreach ($post->post_category as $post_taxonomy => $post_term) {
699
+
700
+			if ($post_term != '' && !is_array($post_term)) {
701
+				$post_term = explode(',', trim($post_term, ','));
702
+			}
703 703
 
704
-            if (is_array($post_term)) {
705
-                $post_term = array_unique($post_term);
706
-            }
704
+			if (is_array($post_term)) {
705
+				$post_term = array_unique($post_term);
706
+			}
707 707
 
708
-            if (!empty($post_term)) {
709
-                foreach ($post_term as $cat_id) {
710
-                    $cat_id = trim($cat_id);
711
-
712
-                    if ($cat_id != '') {
713
-                        $term_icon = get_option('geodir_default_marker_icon');
714
-
715
-                        if (isset($post->post_default_category) && $post->post_default_category == $cat_id) {
716
-                            if ($term_icon_url = get_tax_meta($cat_id, 'ct_cat_icon', false, $post_type)) {
717
-                                if (isset($term_icon_url['src']) && $term_icon_url['src'] != '')
718
-                                    $term_icon = $term_icon_url['src'];
719
-                                break;
720
-                            }
721
-                        }
722
-                    }
723
-                }
724
-            }
725
-        }
726
-    }
708
+			if (!empty($post_term)) {
709
+				foreach ($post_term as $cat_id) {
710
+					$cat_id = trim($cat_id);
711
+
712
+					if ($cat_id != '') {
713
+						$term_icon = get_option('geodir_default_marker_icon');
714
+
715
+						if (isset($post->post_default_category) && $post->post_default_category == $cat_id) {
716
+							if ($term_icon_url = get_tax_meta($cat_id, 'ct_cat_icon', false, $post_type)) {
717
+								if (isset($term_icon_url['src']) && $term_icon_url['src'] != '')
718
+									$term_icon = $term_icon_url['src'];
719
+								break;
720
+							}
721
+						}
722
+					}
723
+				}
724
+			}
725
+		}
726
+	}
727 727
 
728
-    $post_latitude = isset($post->post_latitude) ? $post->post_latitude : '';
729
-    $post_longitude = isset($post->post_longitude) ? $post->post_longitude : '';
728
+	$post_latitude = isset($post->post_latitude) ? $post->post_latitude : '';
729
+	$post_longitude = isset($post->post_longitude) ? $post->post_longitude : '';
730 730
 
731
-    $srcharr = array("'", "/", "-", '"', '\\');
732
-    $replarr = array("&prime;", "&frasl;", "&ndash;", "&ldquo;", '');
731
+	$srcharr = array("'", "/", "-", '"', '\\');
732
+	$replarr = array("&prime;", "&frasl;", "&ndash;", "&ldquo;", '');
733 733
 
734
-    $json_title = str_replace($srcharr, $replarr, $post->post_title);
734
+	$json_title = str_replace($srcharr, $replarr, $post->post_title);
735 735
 
736
-    $json = '{';
737
-    $json .= '"post_preview": "1",';
738
-    $json .= '"t": "' . $json_title . '",';
739
-    $json .= '"lt": "' . $post_latitude . '",';
740
-    $json .= '"ln": "' . $post_longitude . '",';
741
-    $json .= '"i":"' . $term_icon . '"';
742
-    $json .= '}';
736
+	$json = '{';
737
+	$json .= '"post_preview": "1",';
738
+	$json .= '"t": "' . $json_title . '",';
739
+	$json .= '"lt": "' . $post_latitude . '",';
740
+	$json .= '"ln": "' . $post_longitude . '",';
741
+	$json .= '"i":"' . $term_icon . '"';
742
+	$json .= '}';
743 743
 
744
-    $post->marker_json = $json;
744
+	$post->marker_json = $json;
745 745
 
746
-    $gd_session->set('listing', $_REQUEST);
746
+	$gd_session->set('listing', $_REQUEST);
747 747
 
748
-    // we need to define a few things to trick the setup_postdata
749
-    if (!isset($post->ID)) {
750
-        $post->ID = '';
751
-        $post->post_author = '';
752
-        $post->post_date = '';
753
-        $post->post_content = '';
754
-        $post->default_category = '';
755
-        $post->post_type = '';
756
-    }
757
-    setup_postdata($post);
748
+	// we need to define a few things to trick the setup_postdata
749
+	if (!isset($post->ID)) {
750
+		$post->ID = '';
751
+		$post->post_author = '';
752
+		$post->post_date = '';
753
+		$post->post_content = '';
754
+		$post->default_category = '';
755
+		$post->post_type = '';
756
+	}
757
+	setup_postdata($post);
758 758
 }
759 759
 
760 760
 /**
@@ -766,15 +766,15 @@  discard block
 block discarded – undo
766 766
  */
767 767
 function geodir_action_geodir_preview_code()
768 768
 {
769
-    global $preview;
769
+	global $preview;
770 770
 
771
-    $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
771
+	$is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
772 772
 
773
-    if (!$preview || $is_backend_preview) {
774
-        return;
775
-    }// bail if not previewing
773
+	if (!$preview || $is_backend_preview) {
774
+		return;
775
+	}// bail if not previewing
776 776
 
777
-    geodir_get_template_part('preview', 'buttons');
777
+	geodir_get_template_part('preview', 'buttons');
778 778
 }
779 779
 
780 780
 // action for adding the details page top widget area
@@ -790,20 +790,20 @@  discard block
 block discarded – undo
790 790
  */
791 791
 function geodir_action_geodir_sidebar_detail_top($class = '')
792 792
 {
793
-    if (get_option('geodir_show_detail_top_section')) { ?>
793
+	if (get_option('geodir_show_detail_top_section')) { ?>
794 794
         <div
795 795
             class="<?php
796
-            /**
797
-             * Filter the div class for the wrapper of the full width widget areas.
798
-             *
799
-             * Allows you to filter the class of the div for the HTML Container wrapper for the full width widget areas referred to as "Top Section" or "Bottom Section" in the widget areas.
800
-             *
801
-             * @since 1.0.0
802
-             * @param string $class The class of the div.
803
-             * @param string $type The page type the widget area is being used on. Values can be 'geodir_detail_top', 'geodir_detail_bottom', 'geodir_listing_top', 'geodir_listing_bottom', 'Reg/Login Top Section',
804
-             *               'geodir_author_top','geodir_author_bottom', 'geodir_search_top', 'geodir_search_bottom', 'geodir_home_top' or 'geodir_home_bottom'.
805
-             */
806
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_top'); ?> <?php echo $class; ?>">
796
+			/**
797
+			 * Filter the div class for the wrapper of the full width widget areas.
798
+			 *
799
+			 * Allows you to filter the class of the div for the HTML Container wrapper for the full width widget areas referred to as "Top Section" or "Bottom Section" in the widget areas.
800
+			 *
801
+			 * @since 1.0.0
802
+			 * @param string $class The class of the div.
803
+			 * @param string $type The page type the widget area is being used on. Values can be 'geodir_detail_top', 'geodir_detail_bottom', 'geodir_listing_top', 'geodir_listing_bottom', 'Reg/Login Top Section',
804
+			 *               'geodir_author_top','geodir_author_bottom', 'geodir_search_top', 'geodir_search_bottom', 'geodir_home_top' or 'geodir_home_bottom'.
805
+			 */
806
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_top'); ?> <?php echo $class; ?>">
807 807
             <?php dynamic_sidebar('geodir_detail_top'); ?>
808 808
         </div>
809 809
     <?php }
@@ -827,11 +827,11 @@  discard block
 block discarded – undo
827 827
  */
828 828
 function geodir_action_geodir_sidebar_detail_bottom_section($class = '')
829 829
 {
830
-    if (get_option('geodir_show_detail_bottom_section')) { ?>
830
+	if (get_option('geodir_show_detail_bottom_section')) { ?>
831 831
         <div
832 832
             class="<?php
833
-            /** This action is documented in geodirectory_template_actions.php */
834
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_bottom'); ?> <?php echo $class; ?>">
833
+			/** This action is documented in geodirectory_template_actions.php */
834
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_bottom'); ?> <?php echo $class; ?>">
835 835
             <?php dynamic_sidebar('geodir_detail_bottom'); ?>
836 836
         </div><!-- clearfix ends here-->
837 837
     <?php }
@@ -845,7 +845,7 @@  discard block
 block discarded – undo
845 845
  */
846 846
 function geodir_details_sidebar_widget_area()
847 847
 {
848
-    dynamic_sidebar('geodir_detail_sidebar');
848
+	dynamic_sidebar('geodir_detail_sidebar');
849 849
 }
850 850
 
851 851
 /**
@@ -856,12 +856,12 @@  discard block
 block discarded – undo
856 856
  */
857 857
 function geodir_details_sidebar_place_details()
858 858
 {
859
-    /**
860
-     * Used to add items to the details page sidebar.
861
-     *
862
-     * @since 1.0.0
863
-     */
864
-    do_action('geodir_detail_page_sidebar');
859
+	/**
860
+	 * Used to add items to the details page sidebar.
861
+	 *
862
+	 * @since 1.0.0
863
+	 */
864
+	do_action('geodir_detail_page_sidebar');
865 865
 }
866 866
 
867 867
 add_action('geodir_detail_sidebar_inside', 'geodir_details_sidebar_place_details', 10);
@@ -876,68 +876,68 @@  discard block
 block discarded – undo
876 876
  */
877 877
 function geodir_action_details_sidebar()
878 878
 {
879
-    // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
880
-    if (get_option('geodir_detail_sidebar_left_section')) {
881
-        /**
882
-         * Called before the details page left sidebar is opened.
883
-         *
884
-         * This is used to add opening wrapper HTML to the details page left sidebar.
885
-         *
886
-         * @since 1.0.0
887
-         * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
888
-         * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-left'.
889
-         * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-left geodir-details-sidebar-left'.
890
-         * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'.
891
-         */
892
-        do_action('geodir_sidebar_left_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-left geodir-details-sidebar-left', 'http://schema.org/WPSideBar');
893
-        ?>
879
+	// this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
880
+	if (get_option('geodir_detail_sidebar_left_section')) {
881
+		/**
882
+		 * Called before the details page left sidebar is opened.
883
+		 *
884
+		 * This is used to add opening wrapper HTML to the details page left sidebar.
885
+		 *
886
+		 * @since 1.0.0
887
+		 * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
888
+		 * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-left'.
889
+		 * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-left geodir-details-sidebar-left'.
890
+		 * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'.
891
+		 */
892
+		do_action('geodir_sidebar_left_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-left geodir-details-sidebar-left', 'http://schema.org/WPSideBar');
893
+		?>
894 894
         <div class="geodir-content-left geodir-sidebar-wrap"><?php
895
-        /**
896
-         * Called inside the HTML wrapper of the details sidebar for either the left and right sidebar.
897
-         *
898
-         * This is used to add all info to the details page sidebars.
899
-         *
900
-         * @since 1.0.0
901
-         */
902
-        do_action('geodir_detail_sidebar_inside');
903
-        ?></div><!-- end geodir-content-left --><?php
904
-        /**
905
-         * Called after the details page left sidebar.
906
-         *
907
-         * This is used to add closing wrapper HTML to the details page left sidebar.
908
-         *
909
-         * @since 1.0.0
910
-         * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
911
-         */
912
-        do_action('geodir_sidebar_left_close', 'details-page');
913
-    } else {
914
-        /**
915
-         * Called before the details page right sidebar is opened.
916
-         *
917
-         * This is used to add opening wrapper HTML to the details page right sidebar.
918
-         *
919
-         * @since 1.0.0
920
-         * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'add-listing-page', 'author-page', 'search-page' or 'home-page'.
921
-         * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-right'.
922
-         * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-right geodir-details-sidebar-right'.
923
-         * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'.
924
-         */
925
-        do_action('geodir_sidebar_right_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-right geodir-details-sidebar-right', 'http://schema.org/WPSideBar');
926
-        ?>
895
+		/**
896
+		 * Called inside the HTML wrapper of the details sidebar for either the left and right sidebar.
897
+		 *
898
+		 * This is used to add all info to the details page sidebars.
899
+		 *
900
+		 * @since 1.0.0
901
+		 */
902
+		do_action('geodir_detail_sidebar_inside');
903
+		?></div><!-- end geodir-content-left --><?php
904
+		/**
905
+		 * Called after the details page left sidebar.
906
+		 *
907
+		 * This is used to add closing wrapper HTML to the details page left sidebar.
908
+		 *
909
+		 * @since 1.0.0
910
+		 * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
911
+		 */
912
+		do_action('geodir_sidebar_left_close', 'details-page');
913
+	} else {
914
+		/**
915
+		 * Called before the details page right sidebar is opened.
916
+		 *
917
+		 * This is used to add opening wrapper HTML to the details page right sidebar.
918
+		 *
919
+		 * @since 1.0.0
920
+		 * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'add-listing-page', 'author-page', 'search-page' or 'home-page'.
921
+		 * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-right'.
922
+		 * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-right geodir-details-sidebar-right'.
923
+		 * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'.
924
+		 */
925
+		do_action('geodir_sidebar_right_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-right geodir-details-sidebar-right', 'http://schema.org/WPSideBar');
926
+		?>
927 927
         <div class="geodir-content-right geodir-sidebar-wrap"><?php
928
-        /** This action is documented in geodirectory_template_actions.php */
929
-        do_action('geodir_detail_sidebar_inside');
930
-        ?></div><!-- end geodir-content-right --><?php
931
-        /**
932
-         * Called after the details page right sidebar.
933
-         *
934
-         * This is used to add closing wrapper HTML to the details page right sidebar.
935
-         *
936
-         * @since 1.0.0
937
-         * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
938
-         */
939
-        do_action('geodir_sidebar_right_close', 'details-page');
940
-    }
928
+		/** This action is documented in geodirectory_template_actions.php */
929
+		do_action('geodir_detail_sidebar_inside');
930
+		?></div><!-- end geodir-content-right --><?php
931
+		/**
932
+		 * Called after the details page right sidebar.
933
+		 *
934
+		 * This is used to add closing wrapper HTML to the details page right sidebar.
935
+		 *
936
+		 * @since 1.0.0
937
+		 * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
938
+		 */
939
+		do_action('geodir_sidebar_right_close', 'details-page');
940
+	}
941 941
 }
942 942
 
943 943
 add_action('geodir_page_title', 'geodir_action_page_title', 10);
@@ -951,21 +951,21 @@  discard block
 block discarded – undo
951 951
  */
952 952
 function geodir_action_page_title()
953 953
 {
954
-    /**
955
-     * Filter the page title HTML h1 class.
956
-     *
957
-     * @since 1.0.0
958
-     * @param string $class The class to use. Default is 'entry-title fn'.
959
-     */
960
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
961
-    /**
962
-     * Filter the page title HTML header wrapper class.
963
-     *
964
-     * @since 1.0.0
965
-     * @param string $class The class to use. Default is 'entry-header'.
966
-     */
967
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
968
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . stripslashes(get_the_title()) . '</h1></header>';
954
+	/**
955
+	 * Filter the page title HTML h1 class.
956
+	 *
957
+	 * @since 1.0.0
958
+	 * @param string $class The class to use. Default is 'entry-title fn'.
959
+	 */
960
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
961
+	/**
962
+	 * Filter the page title HTML header wrapper class.
963
+	 *
964
+	 * @since 1.0.0
965
+	 * @param string $class The class to use. Default is 'entry-header'.
966
+	 */
967
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
968
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . stripslashes(get_the_title()) . '</h1></header>';
969 969
 }
970 970
 
971 971
 
@@ -982,87 +982,87 @@  discard block
 block discarded – undo
982 982
  */
983 983
 function geodir_action_details_slider()
984 984
 {
985
-    global $preview, $post;
986
-
987
-    $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // preview from backend
988
-
989
-    if ($is_backend_preview && !empty($post) && !empty($post->ID) && !isset($post->post_images)) {
990
-        $preview_get_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
985
+	global $preview, $post;
991 986
 
992
-        $preview_post_images = array();
993
-        if ($preview_get_images) {
994
-            foreach ($preview_get_images as $row) {
995
-                $preview_post_images[] = $row->src;
996
-            }
997
-        }
998
-        if (!empty($preview_post_images)) {
999
-            $post->post_images = implode(',', $preview_post_images);
1000
-        }
1001
-    }
987
+	$is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // preview from backend
1002 988
 
1003
-    if ($preview) {
1004
-        $post_images = array();
1005
-        if (isset($post->post_images) && !empty($post->post_images)) {
1006
-            $post->post_images = trim($post->post_images, ",");
1007
-            $post_images = explode(",", $post->post_images);
1008
-        }
989
+	if ($is_backend_preview && !empty($post) && !empty($post->ID) && !isset($post->post_images)) {
990
+		$preview_get_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
1009 991
 
1010
-        $main_slides = '';
1011
-        $nav_slides = '';
1012
-        $slides = 0;
1013
-
1014
-        if (!empty($post_images)) {
1015
-            foreach ($post_images as $image) {
1016
-                if (!empty($image)) {
1017
-                    $sizes = getimagesize(trim($image));
1018
-                    $width = !empty($sizes) && isset($sizes[0]) ? $sizes[0] : 0;
1019
-                    $height = !empty($sizes) && isset($sizes[1]) ? $sizes[1] : 0;
1020
-
1021
-                    if ($image && $width && $height) {
1022
-                        $image = (object)array('src' => $image, 'width' => $width, 'height' => $height);
1023
-                    }
1024
-
1025
-                    if (isset($image->src)) {
1026
-                        if ($image->height >= 400) {
1027
-                            $spacer_height = 0;
1028
-                        } else {
1029
-                            $spacer_height = ((400 - $image->height) / 2);
1030
-                        }
1031
-
1032
-                        $image_title = isset($image->title) ? $image->title : '';
1033
-
1034
-                        $main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />';
1035
-                        $main_slides .= '<img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:400px;margin:0 auto;" /></li>';
1036
-                        $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:48px;margin:0 auto;" /></li>';
1037
-                        $slides++;
1038
-                    }
1039
-                }
1040
-            }// endfore
1041
-        } //end if
1042
-    } else {
1043
-        $main_slides = '';
1044
-        $nav_slides = '';
1045
-        $post_images = geodir_get_images($post->ID, 'thumbnail', false); // Hide default image on listing preview/detail page.
1046
-        $slides = 0;
1047
-
1048
-        if (!empty($post_images)) {
1049
-            foreach ($post_images as $image) {
1050
-                if ($image->height >= 400) {
1051
-                    $spacer_height = 0;
1052
-                } else {
1053
-                    $spacer_height = ((400 - $image->height) / 2);
1054
-                }
1055
-                $caption = '';//(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : '';
1056
-                $main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />';
1057
-                $main_slides .= '<img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>';
1058
-                $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:48px;margin:0 auto;" /></li>';
1059
-                $slides++;
1060
-            }
1061
-        }// endfore
1062
-    }
992
+		$preview_post_images = array();
993
+		if ($preview_get_images) {
994
+			foreach ($preview_get_images as $row) {
995
+				$preview_post_images[] = $row->src;
996
+			}
997
+		}
998
+		if (!empty($preview_post_images)) {
999
+			$post->post_images = implode(',', $preview_post_images);
1000
+		}
1001
+	}
1002
+
1003
+	if ($preview) {
1004
+		$post_images = array();
1005
+		if (isset($post->post_images) && !empty($post->post_images)) {
1006
+			$post->post_images = trim($post->post_images, ",");
1007
+			$post_images = explode(",", $post->post_images);
1008
+		}
1009
+
1010
+		$main_slides = '';
1011
+		$nav_slides = '';
1012
+		$slides = 0;
1013
+
1014
+		if (!empty($post_images)) {
1015
+			foreach ($post_images as $image) {
1016
+				if (!empty($image)) {
1017
+					$sizes = getimagesize(trim($image));
1018
+					$width = !empty($sizes) && isset($sizes[0]) ? $sizes[0] : 0;
1019
+					$height = !empty($sizes) && isset($sizes[1]) ? $sizes[1] : 0;
1020
+
1021
+					if ($image && $width && $height) {
1022
+						$image = (object)array('src' => $image, 'width' => $width, 'height' => $height);
1023
+					}
1024
+
1025
+					if (isset($image->src)) {
1026
+						if ($image->height >= 400) {
1027
+							$spacer_height = 0;
1028
+						} else {
1029
+							$spacer_height = ((400 - $image->height) / 2);
1030
+						}
1031
+
1032
+						$image_title = isset($image->title) ? $image->title : '';
1033
+
1034
+						$main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />';
1035
+						$main_slides .= '<img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:400px;margin:0 auto;" /></li>';
1036
+						$nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:48px;margin:0 auto;" /></li>';
1037
+						$slides++;
1038
+					}
1039
+				}
1040
+			}// endfore
1041
+		} //end if
1042
+	} else {
1043
+		$main_slides = '';
1044
+		$nav_slides = '';
1045
+		$post_images = geodir_get_images($post->ID, 'thumbnail', false); // Hide default image on listing preview/detail page.
1046
+		$slides = 0;
1047
+
1048
+		if (!empty($post_images)) {
1049
+			foreach ($post_images as $image) {
1050
+				if ($image->height >= 400) {
1051
+					$spacer_height = 0;
1052
+				} else {
1053
+					$spacer_height = ((400 - $image->height) / 2);
1054
+				}
1055
+				$caption = '';//(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : '';
1056
+				$main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />';
1057
+				$main_slides .= '<img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>';
1058
+				$nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:48px;margin:0 auto;" /></li>';
1059
+				$slides++;
1060
+			}
1061
+		}// endfore
1062
+	}
1063 1063
 
1064
-    if (!empty($post_images)) {
1065
-        ?>
1064
+	if (!empty($post_images)) {
1065
+		?>
1066 1066
         <div class="geodir_flex-container">
1067 1067
             <div class="geodir_flex-loader"><i class="fa fa-refresh fa-spin"></i></div>
1068 1068
             <div id="geodir_slider" class="geodir_flexslider ">
@@ -1075,7 +1075,7 @@  discard block
 block discarded – undo
1075 1075
             <?php } ?>
1076 1076
         </div>
1077 1077
     <?php
1078
-    }
1078
+	}
1079 1079
 }
1080 1080
 
1081 1081
 add_action('geodir_details_taxonomies', 'geodir_action_details_taxonomies', 10);
@@ -1090,176 +1090,176 @@  discard block
 block discarded – undo
1090 1090
  */
1091 1091
 function geodir_action_details_taxonomies()
1092 1092
 {
1093
-    global $preview, $post;?>
1093
+	global $preview, $post;?>
1094 1094
     <p class="geodir_post_taxomomies clearfix">
1095 1095
     <?php
1096
-    $taxonomies = array();
1097
-
1098
-    $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
1099
-
1100
-    if ($preview && !$is_backend_preview) {
1101
-        $post_type = $post->listing_type;
1102
-        $post_taxonomy = $post_type . 'category';
1103
-        $post->{$post_taxonomy} = $post->post_category[$post_taxonomy];
1104
-    } else {
1105
-        $post_type = $post->post_type;
1106
-        $post_taxonomy = $post_type . 'category';
1107
-    }
1096
+	$taxonomies = array();
1097
+
1098
+	$is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
1099
+
1100
+	if ($preview && !$is_backend_preview) {
1101
+		$post_type = $post->listing_type;
1102
+		$post_taxonomy = $post_type . 'category';
1103
+		$post->{$post_taxonomy} = $post->post_category[$post_taxonomy];
1104
+	} else {
1105
+		$post_type = $post->post_type;
1106
+		$post_taxonomy = $post_type . 'category';
1107
+	}
1108 1108
 //{	
1109
-    $post_type_info = get_post_type_object($post_type);
1110
-    $listing_label = __($post_type_info->labels->singular_name, 'geodirectory');
1111
-
1112
-    if (!empty($post->post_tags)) {
1113
-
1114
-        if (taxonomy_exists($post_type . '_tags')):
1115
-            $links = array();
1116
-            $terms = array();
1117
-            // to limit post tags
1118
-            $post_tags = trim($post->post_tags, ",");
1119
-            $post_id = isset($post->ID) ? $post->ID : '';
1120
-            /**
1121
-             * Filter the post tags.
1122
-             *
1123
-             * Allows you to filter the post tags output on the details page of a post.
1124
-             *
1125
-             * @since 1.0.0
1126
-             * @param string $post_tags A comma seperated list of tags.
1127
-             * @param int $post_id The current post id.
1128
-             */
1129
-            $post_tags = apply_filters('geodir_action_details_post_tags', $post_tags, $post_id);
1130
-
1131
-            $post->post_tags = $post_tags;
1132
-            $post_tags = explode(",", trim($post->post_tags, ","));
1133
-
1134
-            foreach ($post_tags as $post_term) {
1135
-
1136
-                // fix slug creation order for tags & location
1137
-                $post_term = trim($post_term);
1138
-
1139
-                $priority_location = false;
1140
-                if ($insert_term = term_exists($post_term, $post_type . '_tags')) {
1141
-                    $term = get_term_by('name', $post_term, $post_type . '_tags');
1142
-                } else {
1143
-                    $post_country = isset($_REQUEST['post_country']) && $_REQUEST['post_country'] != '' ? sanitize_text_field($_REQUEST['post_country']) : NULL;
1144
-                    $post_region = isset($_REQUEST['post_region']) && $_REQUEST['post_region'] != '' ? sanitize_text_field($_REQUEST['post_region']) : NULL;
1145
-                    $post_city = isset($_REQUEST['post_city']) && $_REQUEST['post_city'] != '' ? sanitize_text_field($_REQUEST['post_city']) : NULL;
1146
-                    $match_country = $post_country && sanitize_title($post_term) == sanitize_title($post_country) ? true : false;
1147
-                    $match_region = $post_region && sanitize_title($post_term) == sanitize_title($post_region) ? true : false;
1148
-                    $match_city = $post_city && sanitize_title($post_term) == sanitize_title($post_city) ? true : false;
1149
-                    if ($match_country || $match_region || $match_city) {
1150
-                        $priority_location = true;
1151
-                        $term = get_term_by('name', $post_term, $post_type . '_tags');
1152
-                    } else {
1153
-                        $insert_term = wp_insert_term($post_term, $post_type . '_tags');
1154
-                        $term = get_term_by('name', $post_term, $post_type . '_tags');
1155
-                    }
1156
-                }
1157
-
1158
-                if (!is_wp_error($term) && is_object($term)) {
1159
-
1160
-                    // fix tag link on detail page
1161
-                    if ($priority_location) {
1162
-
1163
-                        $tag_link = "<a href=''>$post_term</a>";
1164
-                        /**
1165
-                         * Filter the tag name on the details page.
1166
-                         *
1167
-                         * @since 1.5.6
1168
-                         * @param string $tag_link The tag link html.
1169
-                         * @param object $term The tag term object.
1170
-                         */
1171
-                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1172
-                        $links[] = $tag_link;
1173
-                    } else {
1174
-                        $tag_link = "<a href='" . esc_attr(get_term_link($term->term_id, $term->taxonomy)) . "'>$term->name</a>";
1175
-                        /** This action is documented in geodirectory-template_actions.php */
1176
-                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1177
-                        $links[] = $tag_link;
1178
-                    }
1179
-                    $terms[] = $term;
1180
-                }
1181
-                //
1182
-            }
1183
-            if (!isset($listing_label)) {
1184
-                $listing_label = '';
1185
-            }
1186
-            $taxonomies[$post_type . '_tags'] = wp_sprintf(__('%s Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1187
-        endif;
1188
-
1189
-    }
1190
-
1191
-    if (!empty($post->{$post_taxonomy})) {
1192
-        $links = array();
1193
-        $terms = array();
1194
-        $termsOrdered = array();
1195
-        if (!is_array($post->{$post_taxonomy})) {
1196
-            $post_term = explode(",", trim($post->{$post_taxonomy}, ","));
1197
-        } else {
1198
-            $post_term = $post->{$post_taxonomy};
1109
+	$post_type_info = get_post_type_object($post_type);
1110
+	$listing_label = __($post_type_info->labels->singular_name, 'geodirectory');
1111
+
1112
+	if (!empty($post->post_tags)) {
1113
+
1114
+		if (taxonomy_exists($post_type . '_tags')):
1115
+			$links = array();
1116
+			$terms = array();
1117
+			// to limit post tags
1118
+			$post_tags = trim($post->post_tags, ",");
1119
+			$post_id = isset($post->ID) ? $post->ID : '';
1120
+			/**
1121
+			 * Filter the post tags.
1122
+			 *
1123
+			 * Allows you to filter the post tags output on the details page of a post.
1124
+			 *
1125
+			 * @since 1.0.0
1126
+			 * @param string $post_tags A comma seperated list of tags.
1127
+			 * @param int $post_id The current post id.
1128
+			 */
1129
+			$post_tags = apply_filters('geodir_action_details_post_tags', $post_tags, $post_id);
1130
+
1131
+			$post->post_tags = $post_tags;
1132
+			$post_tags = explode(",", trim($post->post_tags, ","));
1133
+
1134
+			foreach ($post_tags as $post_term) {
1135
+
1136
+				// fix slug creation order for tags & location
1137
+				$post_term = trim($post_term);
1138
+
1139
+				$priority_location = false;
1140
+				if ($insert_term = term_exists($post_term, $post_type . '_tags')) {
1141
+					$term = get_term_by('name', $post_term, $post_type . '_tags');
1142
+				} else {
1143
+					$post_country = isset($_REQUEST['post_country']) && $_REQUEST['post_country'] != '' ? sanitize_text_field($_REQUEST['post_country']) : NULL;
1144
+					$post_region = isset($_REQUEST['post_region']) && $_REQUEST['post_region'] != '' ? sanitize_text_field($_REQUEST['post_region']) : NULL;
1145
+					$post_city = isset($_REQUEST['post_city']) && $_REQUEST['post_city'] != '' ? sanitize_text_field($_REQUEST['post_city']) : NULL;
1146
+					$match_country = $post_country && sanitize_title($post_term) == sanitize_title($post_country) ? true : false;
1147
+					$match_region = $post_region && sanitize_title($post_term) == sanitize_title($post_region) ? true : false;
1148
+					$match_city = $post_city && sanitize_title($post_term) == sanitize_title($post_city) ? true : false;
1149
+					if ($match_country || $match_region || $match_city) {
1150
+						$priority_location = true;
1151
+						$term = get_term_by('name', $post_term, $post_type . '_tags');
1152
+					} else {
1153
+						$insert_term = wp_insert_term($post_term, $post_type . '_tags');
1154
+						$term = get_term_by('name', $post_term, $post_type . '_tags');
1155
+					}
1156
+				}
1157
+
1158
+				if (!is_wp_error($term) && is_object($term)) {
1159
+
1160
+					// fix tag link on detail page
1161
+					if ($priority_location) {
1162
+
1163
+						$tag_link = "<a href=''>$post_term</a>";
1164
+						/**
1165
+						 * Filter the tag name on the details page.
1166
+						 *
1167
+						 * @since 1.5.6
1168
+						 * @param string $tag_link The tag link html.
1169
+						 * @param object $term The tag term object.
1170
+						 */
1171
+						$tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1172
+						$links[] = $tag_link;
1173
+					} else {
1174
+						$tag_link = "<a href='" . esc_attr(get_term_link($term->term_id, $term->taxonomy)) . "'>$term->name</a>";
1175
+						/** This action is documented in geodirectory-template_actions.php */
1176
+						$tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1177
+						$links[] = $tag_link;
1178
+					}
1179
+					$terms[] = $term;
1180
+				}
1181
+				//
1182
+			}
1183
+			if (!isset($listing_label)) {
1184
+				$listing_label = '';
1185
+			}
1186
+			$taxonomies[$post_type . '_tags'] = wp_sprintf(__('%s Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1187
+		endif;
1188
+
1189
+	}
1190
+
1191
+	if (!empty($post->{$post_taxonomy})) {
1192
+		$links = array();
1193
+		$terms = array();
1194
+		$termsOrdered = array();
1195
+		if (!is_array($post->{$post_taxonomy})) {
1196
+			$post_term = explode(",", trim($post->{$post_taxonomy}, ","));
1197
+		} else {
1198
+			$post_term = $post->{$post_taxonomy};
1199 1199
 			
1200 1200
 			if ($preview && !$is_backend_preview) {
1201 1201
 				$post_term = geodir_add_parent_terms($post_term, $post_taxonomy);
1202 1202
 			}
1203
-        }
1203
+		}
1204
+
1205
+		$post_term = array_unique($post_term);
1206
+		if (!empty($post_term)) {
1207
+			foreach ($post_term as $post_term) {
1208
+				$post_term = trim($post_term);
1209
+
1210
+				if ($post_term != ''):
1211
+					$term = get_term_by('id', $post_term, $post_taxonomy);
1212
+
1213
+					if (is_object($term)) {
1214
+						$term_link = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>$term->name</a>";
1215
+						/**
1216
+						 * Filter the category name on the details page.
1217
+						 *
1218
+						 * @since 1.5.6
1219
+						 * @param string $term_link The link html to the category.
1220
+						 * @param object $term The category term object.
1221
+						 */
1222
+						$term_link = apply_filters('geodir_details_taxonomies_cat_link',$term_link,$term);
1223
+						$links[] = $term_link;
1224
+						$terms[] = $term;
1225
+					}
1226
+				endif;
1227
+			}
1228
+			// order alphabetically
1229
+			asort($links);
1230
+			foreach (array_keys($links) as $key) {
1231
+				$termsOrdered[$key] = $terms[$key];
1232
+			}
1233
+			$terms = $termsOrdered;
1204 1234
 
1205
-        $post_term = array_unique($post_term);
1206
-        if (!empty($post_term)) {
1207
-            foreach ($post_term as $post_term) {
1208
-                $post_term = trim($post_term);
1209
-
1210
-                if ($post_term != ''):
1211
-                    $term = get_term_by('id', $post_term, $post_taxonomy);
1212
-
1213
-                    if (is_object($term)) {
1214
-                        $term_link = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>$term->name</a>";
1215
-                        /**
1216
-                         * Filter the category name on the details page.
1217
-                         *
1218
-                         * @since 1.5.6
1219
-                         * @param string $term_link The link html to the category.
1220
-                         * @param object $term The category term object.
1221
-                         */
1222
-                        $term_link = apply_filters('geodir_details_taxonomies_cat_link',$term_link,$term);
1223
-                        $links[] = $term_link;
1224
-                        $terms[] = $term;
1225
-                    }
1226
-                endif;
1227
-            }
1228
-            // order alphabetically
1229
-            asort($links);
1230
-            foreach (array_keys($links) as $key) {
1231
-                $termsOrdered[$key] = $terms[$key];
1232
-            }
1233
-            $terms = $termsOrdered;
1235
+		}
1234 1236
 
1235
-        }
1237
+		if (!isset($listing_label)) {
1238
+			$listing_label = '';
1239
+		}
1240
+		$taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1236 1241
 
1237
-        if (!isset($listing_label)) {
1238
-            $listing_label = '';
1239
-        }
1240
-        $taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1241
-
1242
-    }
1242
+	}
1243 1243
 
1244
-    /**
1245
-     * Filter the taxonomies array before output.
1246
-     *
1247
-     * @since 1.5.9
1248
-     * @param array $taxonomies The array of cats and tags.
1249
-     * @param string $post_type The post type being output.
1250
-     * @param string $listing_label The post type label.
1251
-     * @param string $listing_label The post type label with ucwords function.
1252
-     */
1253
-    $taxonomies = apply_filters('geodir_details_taxonomies_output',$taxonomies,$post_type,$listing_label,geodir_ucwords($listing_label));
1244
+	/**
1245
+	 * Filter the taxonomies array before output.
1246
+	 *
1247
+	 * @since 1.5.9
1248
+	 * @param array $taxonomies The array of cats and tags.
1249
+	 * @param string $post_type The post type being output.
1250
+	 * @param string $listing_label The post type label.
1251
+	 * @param string $listing_label The post type label with ucwords function.
1252
+	 */
1253
+	$taxonomies = apply_filters('geodir_details_taxonomies_output',$taxonomies,$post_type,$listing_label,geodir_ucwords($listing_label));
1254 1254
 
1255
-    if (isset($taxonomies[$post_taxonomy])) {
1256
-        echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>';
1257
-    }
1255
+	if (isset($taxonomies[$post_taxonomy])) {
1256
+		echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>';
1257
+	}
1258 1258
 
1259
-    if (isset($taxonomies[$post_type . '_tags']))
1260
-        echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>';
1259
+	if (isset($taxonomies[$post_type . '_tags']))
1260
+		echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>';
1261 1261
 
1262
-    ?>
1262
+	?>
1263 1263
     </p><?php
1264 1264
 }
1265 1265
 
@@ -1281,126 +1281,126 @@  discard block
 block discarded – undo
1281 1281
 function geodir_action_details_micordata($post='')
1282 1282
 {
1283 1283
 
1284
-    global $preview;
1285
-    if(empty($post)){global $post;}
1286
-    if ($preview || !geodir_is_page('detail')) {
1287
-        return;
1288
-    }
1289
-
1290
-    // url
1291
-    $c_url = geodir_curPageURL();
1292
-
1293
-    // post reviews
1294
-    $post_reviews = get_comments(array('post_id' => $post->ID, 'status' => 'approve'));
1295
-    if (empty($post_reviews)) {
1296
-        $reviews = '';
1297
-    } else {
1298
-        foreach ($post_reviews as $review) {
1299
-            $reviews[] = array(
1300
-                "@type" => "Review",
1301
-                "author" => $review->comment_author,
1302
-                "datePublished" => $review->comment_date,
1303
-                "description" => $review->comment_content,
1304
-                "reviewRating" => array(
1305
-                    "@type" => "Rating",
1306
-                    "bestRating" => "5",// @todo this will need to be filtered for review manager if user changes the score.
1307
-                    "ratingValue" => geodir_get_commentoverall($review->comment_ID),
1308
-                    "worstRating" => "1"
1309
-                )
1310
-            );
1311
-        }
1312
-
1313
-    }
1314
-
1315
-    // post images
1316
-    $post_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
1317
-    if (empty($post_images)) {
1318
-        $images = '';
1319
-    } else {
1320
-        $i_arr = array();
1321
-        foreach ($post_images as $img) {
1322
-            $i_arr[] = $img->src;
1323
-        }
1324
-
1325
-        if (count($i_arr) == 1) {
1326
-            $images = $i_arr[0];
1327
-        } else {
1328
-            $images = $i_arr;
1329
-        }
1330
-
1331
-    }
1332
-    //print_r($post);
1333
-    // external links
1334
-    $external_links =  array();
1335
-    $external_links[] = $post->geodir_website;
1336
-    $external_links[] = $post->geodir_twitter;
1337
-    $external_links[] = $post->geodir_facebook;
1338
-    $external_links = array_filter($external_links);
1339
-
1340
-    if(!empty($external_links)){
1341
-        $external_links = array_values($external_links);
1342
-    }
1343
-
1344
-    // reviews
1345
-    $comment_count = geodir_get_review_count_total($post->ID);
1346
-    $post_avgratings = geodir_get_post_rating($post->ID);
1347
-
1348
-    // schema type
1349
-    $schema_type = 'LocalBusiness';
1350
-    if(isset($post->default_category) && $post->default_category){
1351
-        $schema_type = get_tax_meta($post->default_category, 'ct_cat_schema', false, $post->post_type);
1352
-        if(!$schema_type && $post->post_type=='gd_event'){$schema_type = 'Event';}
1353
-    }
1354
-
1355
-    $schema = array();
1356
-    $schema['@context'] = "http://schema.org";
1357
-    $schema['@type'] = $schema_type;
1358
-    $schema['name'] = $post->post_name;
1359
-    $schema['description'] = wp_strip_all_tags( $post->post_content, true );
1360
-    $schema['telephone'] = $post->geodir_contact;
1361
-    $schema['url'] = $c_url;
1362
-    $schema['sameAs'] = $external_links;
1363
-    $schema['image'] = $images;
1364
-    $schema['address'] = array(
1365
-        "@type" => "PostalAddress",
1366
-        "streetAddress" => $post->post_address,
1367
-        "addressLocality" => $post->post_city,
1368
-        "addressRegion" => $post->post_region,
1369
-        "addressCountry" => $post->post_country,
1370
-        "postalCode" => $post->post_zip
1371
-    );
1372
-
1373
-    if($post->post_latitude && $post->post_longitude) {
1374
-        $schema['geo'] = array(
1375
-            "@type" => "GeoCoordinates",
1376
-            "latitude" => $post->post_latitude,
1377
-            "longitude" => $post->post_longitude
1378
-        );
1379
-    }
1380
-
1381
-    if($post_avgratings) {
1382
-        $schema['aggregateRating'] = array(
1383
-            "@type" => "AggregateRating",
1384
-            "ratingValue" => $post_avgratings,
1385
-            "bestRating" => "5", // @todo this will need to be filtered for review manager if user changes the score.
1386
-            "worstRating" => "1",
1387
-            "ratingCount" => $comment_count
1388
-        );
1389
-    }
1390
-    $schema['review'] = $reviews;
1391
-
1392
-    /**
1393
-     * Allow the schema JSON-LD info to be filtered.
1394
-     *
1395
-     * @since 1.5.4
1396
-     * @since 1.5.7 Added $post variable.
1397
-     * @param array $schema The array of schema data to be filtered.
1398
-     * @param object $post The post object.
1399
-     */
1400
-    $schema = apply_filters('geodir_details_schema', $schema,$post);
1401
-
1402
-
1403
-    echo '<script type="application/ld+json">' . json_encode($schema) . '</script>';
1284
+	global $preview;
1285
+	if(empty($post)){global $post;}
1286
+	if ($preview || !geodir_is_page('detail')) {
1287
+		return;
1288
+	}
1289
+
1290
+	// url
1291
+	$c_url = geodir_curPageURL();
1292
+
1293
+	// post reviews
1294
+	$post_reviews = get_comments(array('post_id' => $post->ID, 'status' => 'approve'));
1295
+	if (empty($post_reviews)) {
1296
+		$reviews = '';
1297
+	} else {
1298
+		foreach ($post_reviews as $review) {
1299
+			$reviews[] = array(
1300
+				"@type" => "Review",
1301
+				"author" => $review->comment_author,
1302
+				"datePublished" => $review->comment_date,
1303
+				"description" => $review->comment_content,
1304
+				"reviewRating" => array(
1305
+					"@type" => "Rating",
1306
+					"bestRating" => "5",// @todo this will need to be filtered for review manager if user changes the score.
1307
+					"ratingValue" => geodir_get_commentoverall($review->comment_ID),
1308
+					"worstRating" => "1"
1309
+				)
1310
+			);
1311
+		}
1312
+
1313
+	}
1314
+
1315
+	// post images
1316
+	$post_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
1317
+	if (empty($post_images)) {
1318
+		$images = '';
1319
+	} else {
1320
+		$i_arr = array();
1321
+		foreach ($post_images as $img) {
1322
+			$i_arr[] = $img->src;
1323
+		}
1324
+
1325
+		if (count($i_arr) == 1) {
1326
+			$images = $i_arr[0];
1327
+		} else {
1328
+			$images = $i_arr;
1329
+		}
1330
+
1331
+	}
1332
+	//print_r($post);
1333
+	// external links
1334
+	$external_links =  array();
1335
+	$external_links[] = $post->geodir_website;
1336
+	$external_links[] = $post->geodir_twitter;
1337
+	$external_links[] = $post->geodir_facebook;
1338
+	$external_links = array_filter($external_links);
1339
+
1340
+	if(!empty($external_links)){
1341
+		$external_links = array_values($external_links);
1342
+	}
1343
+
1344
+	// reviews
1345
+	$comment_count = geodir_get_review_count_total($post->ID);
1346
+	$post_avgratings = geodir_get_post_rating($post->ID);
1347
+
1348
+	// schema type
1349
+	$schema_type = 'LocalBusiness';
1350
+	if(isset($post->default_category) && $post->default_category){
1351
+		$schema_type = get_tax_meta($post->default_category, 'ct_cat_schema', false, $post->post_type);
1352
+		if(!$schema_type && $post->post_type=='gd_event'){$schema_type = 'Event';}
1353
+	}
1354
+
1355
+	$schema = array();
1356
+	$schema['@context'] = "http://schema.org";
1357
+	$schema['@type'] = $schema_type;
1358
+	$schema['name'] = $post->post_name;
1359
+	$schema['description'] = wp_strip_all_tags( $post->post_content, true );
1360
+	$schema['telephone'] = $post->geodir_contact;
1361
+	$schema['url'] = $c_url;
1362
+	$schema['sameAs'] = $external_links;
1363
+	$schema['image'] = $images;
1364
+	$schema['address'] = array(
1365
+		"@type" => "PostalAddress",
1366
+		"streetAddress" => $post->post_address,
1367
+		"addressLocality" => $post->post_city,
1368
+		"addressRegion" => $post->post_region,
1369
+		"addressCountry" => $post->post_country,
1370
+		"postalCode" => $post->post_zip
1371
+	);
1372
+
1373
+	if($post->post_latitude && $post->post_longitude) {
1374
+		$schema['geo'] = array(
1375
+			"@type" => "GeoCoordinates",
1376
+			"latitude" => $post->post_latitude,
1377
+			"longitude" => $post->post_longitude
1378
+		);
1379
+	}
1380
+
1381
+	if($post_avgratings) {
1382
+		$schema['aggregateRating'] = array(
1383
+			"@type" => "AggregateRating",
1384
+			"ratingValue" => $post_avgratings,
1385
+			"bestRating" => "5", // @todo this will need to be filtered for review manager if user changes the score.
1386
+			"worstRating" => "1",
1387
+			"ratingCount" => $comment_count
1388
+		);
1389
+	}
1390
+	$schema['review'] = $reviews;
1391
+
1392
+	/**
1393
+	 * Allow the schema JSON-LD info to be filtered.
1394
+	 *
1395
+	 * @since 1.5.4
1396
+	 * @since 1.5.7 Added $post variable.
1397
+	 * @param array $schema The array of schema data to be filtered.
1398
+	 * @param object $post The post object.
1399
+	 */
1400
+	$schema = apply_filters('geodir_details_schema', $schema,$post);
1401
+
1402
+
1403
+	echo '<script type="application/ld+json">' . json_encode($schema) . '</script>';
1404 1404
 
1405 1405
 }
1406 1406
 
@@ -1418,7 +1418,7 @@  discard block
 block discarded – undo
1418 1418
  */
1419 1419
 function geodir_action_details_next_prev()
1420 1420
 {
1421
-    ?>
1421
+	?>
1422 1422
     <div class="geodir-pos_navigation clearfix">
1423 1423
     <div
1424 1424
         class="geodir-post_left"><?php previous_post_link('%link', '' . __('Previous', 'geodirectory'), false) ?></div>
@@ -1436,15 +1436,15 @@  discard block
 block discarded – undo
1436 1436
  */
1437 1437
 function geodir_action_before_single_post()
1438 1438
 {
1439
-    global $post;
1440
-    /**
1441
-     * Called at the very start fo the details page output, before the title section.
1442
-     *
1443
-     * @since 1.0.0
1444
-     * @param object $post The current post object.
1445
-     * @global WP_Post|null $post The current post, if available.
1446
-     */
1447
-    do_action('geodir_before_single_post', $post); // extra action	
1439
+	global $post;
1440
+	/**
1441
+	 * Called at the very start fo the details page output, before the title section.
1442
+	 *
1443
+	 * @since 1.0.0
1444
+	 * @param object $post The current post object.
1445
+	 * @global WP_Post|null $post The current post, if available.
1446
+	 */
1447
+	do_action('geodir_before_single_post', $post); // extra action	
1448 1448
 }
1449 1449
 
1450 1450
 /**
@@ -1455,13 +1455,13 @@  discard block
 block discarded – undo
1455 1455
  */
1456 1456
 function geodir_action_after_single_post($post)
1457 1457
 {
1458
-    /**
1459
-     * Called on the details page after the details page tabs section and before the next/prev buttons.
1460
-     *
1461
-     * @since 1.0.0
1462
-     * @param object $post The current post object.
1463
-     */
1464
-    do_action('geodir_after_single_post', $post); // extra action	
1458
+	/**
1459
+	 * Called on the details page after the details page tabs section and before the next/prev buttons.
1460
+	 *
1461
+	 * @since 1.0.0
1462
+	 * @param object $post The current post object.
1463
+	 */
1464
+	do_action('geodir_after_single_post', $post); // extra action	
1465 1465
 }
1466 1466
 
1467 1467
 add_action('geodir_details_main_content', 'geodir_action_before_single_post', 10);
@@ -1487,167 +1487,167 @@  discard block
 block discarded – undo
1487 1487
  */
1488 1488
 function geodir_action_listings_title()
1489 1489
 {
1490
-    global $wp, $term;
1491
-
1492
-    $gd_post_type = geodir_get_current_posttype();
1493
-    $post_type_info = get_post_type_object($gd_post_type);
1494
-
1495
-    $add_string_in_title = __('All', 'geodirectory') . ' ';
1496
-    if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
1497
-        $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
1498
-    }
1499
-
1500
-    $list_title = $add_string_in_title . __(ucfirst($post_type_info->labels->name), 'geodirectory');
1501
-    $single_name = $post_type_info->labels->singular_name;
1502
-
1503
-    $taxonomy = geodir_get_taxonomies($gd_post_type, true);
1490
+	global $wp, $term;
1504 1491
 
1505
-    $gd_country = get_query_var('gd_country');
1506
-    $gd_region = get_query_var('gd_region');
1507
-    $gd_city = get_query_var('gd_city');
1492
+	$gd_post_type = geodir_get_current_posttype();
1493
+	$post_type_info = get_post_type_object($gd_post_type);
1508 1494
 
1509
-    if (!empty($term)) {
1510
-        $location_name = '';
1511
-        if ($gd_country != '' || $gd_region != '' || $gd_city != '') {
1512
-            if ($gd_country != '') {
1513
-                $location_name = geodir_sanitize_location_name('gd_country', $gd_country);
1514
-            }
1515
-
1516
-            if ($gd_region != '') {
1517
-                $location_name = geodir_sanitize_location_name('gd_region', $gd_region);
1518
-            }
1519
-
1520
-            if ($gd_city != '') {
1521
-                $location_name = geodir_sanitize_location_name('gd_city', $gd_city);
1522
-            }
1523
-        }
1524
-
1525
-        $current_term = get_term_by('slug', $term, $taxonomy[0]);
1526
-        if (!empty($current_term)) {
1527
-            $current_term_name = __(ucfirst($current_term->name), 'geodirectory');
1528
-            if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1529
-                $location_last_char = substr($location_name, -1);
1530
-                $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1531
-                $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1532
-            } else {
1533
-                $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1534
-            }
1535
-        } else {
1536
-            if (count($taxonomy) > 1) {
1537
-                $current_term = get_term_by('slug', $term, $taxonomy[1]);
1538
-
1539
-                if (!empty($current_term)) {
1540
-                    $current_term_name = __(ucfirst($current_term->name), 'geodirectory');
1541
-                    if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1542
-                        $location_last_char = substr($location_name, -1);
1543
-                        $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1544
-                        $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1545
-                    } else {
1546
-                        $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1547
-                    }
1548
-                }
1549
-            }
1550
-        }
1495
+	$add_string_in_title = __('All', 'geodirectory') . ' ';
1496
+	if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
1497
+		$add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
1498
+	}
1551 1499
 
1552
-    } else {
1553
-        $gd_country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : '';
1554
-        $gd_region = (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') ? $wp->query_vars['gd_region'] : '';
1555
-        $gd_city = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : '';
1500
+	$list_title = $add_string_in_title . __(ucfirst($post_type_info->labels->name), 'geodirectory');
1501
+	$single_name = $post_type_info->labels->singular_name;
1556 1502
 
1557
-        $gd_country_actual = $gd_region_actual = $gd_city_actual = '';
1503
+	$taxonomy = geodir_get_taxonomies($gd_post_type, true);
1558 1504
 
1559
-        if (function_exists('get_actual_location_name')) {
1560
-            $gd_country_actual = $gd_country != '' ? get_actual_location_name('country', $gd_country, true) : $gd_country;
1561
-            $gd_region_actual = $gd_region != '' ? get_actual_location_name('region', $gd_region) : $gd_region;
1562
-            $gd_city_actual = $gd_city != '' ? get_actual_location_name('city', $gd_city) : $gd_city;
1563
-        }
1505
+	$gd_country = get_query_var('gd_country');
1506
+	$gd_region = get_query_var('gd_region');
1507
+	$gd_city = get_query_var('gd_city');
1564 1508
 
1565
-        if ($gd_city != '') {
1566
-            if ($gd_city_actual != '') {
1567
-                $gd_city = $gd_city_actual;
1568
-            } else {
1569
-                $gd_city = preg_replace('/-(\d+)$/', '', $gd_city);
1570
-                $gd_city = preg_replace('/[_-]/', ' ', $gd_city);
1571
-                $gd_city = __(geodir_ucwords($gd_city), 'geodirectory');
1572
-            }
1573
-
1574
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_city . "'";
1575
-        } else if ($gd_region != '') {
1576
-            if ($gd_region_actual != '') {
1577
-                $gd_region = $gd_region_actual;
1578
-            } else {
1579
-                $gd_region = preg_replace('/-(\d+)$/', '', $gd_region);
1580
-                $gd_region = preg_replace('/[_-]/', ' ', $gd_region);
1581
-                $gd_region = __(geodir_ucwords($gd_region), 'geodirectory');
1582
-            }
1583
-
1584
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_region . "'";
1585
-        } else if ($gd_country != '') {
1586
-            if ($gd_country_actual != '') {
1587
-                $gd_country = $gd_country_actual;
1588
-            } else {
1589
-                $gd_country = preg_replace('/-(\d+)$/', '', $gd_country);
1590
-                $gd_country = preg_replace('/[_-]/', ' ', $gd_country);
1591
-                $gd_country = __(geodir_ucwords($gd_country), 'geodirectory');
1592
-            }
1593
-
1594
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_country . "'";
1595
-        }
1596
-    }
1597
-
1598
-    if (is_search()) {
1599
-        $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
1600
-    }
1601
-    /** This action is documented in geodirectory_template_actions.php */
1602
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
1603
-    /** This action is documented in geodirectory_template_actions.php */
1604
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
1605
-
1606
-
1607
-    $title = $list_title;
1608
-    if(geodir_is_page('pt')){
1609
-        $gd_page = 'pt';
1610
-        $title  = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
1611
-    }
1612
-    elseif(geodir_is_page('listing')){
1613
-        $gd_page = 'listing';
1614
-        global $wp_query;
1615
-        $current_term = $wp_query->get_queried_object();
1616
-        if (strpos($current_term->taxonomy,'_tags') !== false) {
1617
-            $title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
1618
-        }else{
1619
-            $title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
1620
-        }
1509
+	if (!empty($term)) {
1510
+		$location_name = '';
1511
+		if ($gd_country != '' || $gd_region != '' || $gd_city != '') {
1512
+			if ($gd_country != '') {
1513
+				$location_name = geodir_sanitize_location_name('gd_country', $gd_country);
1514
+			}
1621 1515
 
1622
-    }
1623
-    elseif(geodir_is_page('author')){
1624
-        $gd_page = 'author';
1625
-        if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
1626
-            $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
1627
-        }else{
1628
-            $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
1629
-        }
1516
+			if ($gd_region != '') {
1517
+				$location_name = geodir_sanitize_location_name('gd_region', $gd_region);
1518
+			}
1630 1519
 
1631
-    }
1520
+			if ($gd_city != '') {
1521
+				$location_name = geodir_sanitize_location_name('gd_city', $gd_city);
1522
+			}
1523
+		}
1524
+
1525
+		$current_term = get_term_by('slug', $term, $taxonomy[0]);
1526
+		if (!empty($current_term)) {
1527
+			$current_term_name = __(ucfirst($current_term->name), 'geodirectory');
1528
+			if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1529
+				$location_last_char = substr($location_name, -1);
1530
+				$location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1531
+				$list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1532
+			} else {
1533
+				$list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1534
+			}
1535
+		} else {
1536
+			if (count($taxonomy) > 1) {
1537
+				$current_term = get_term_by('slug', $term, $taxonomy[1]);
1538
+
1539
+				if (!empty($current_term)) {
1540
+					$current_term_name = __(ucfirst($current_term->name), 'geodirectory');
1541
+					if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1542
+						$location_last_char = substr($location_name, -1);
1543
+						$location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1544
+						$list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1545
+					} else {
1546
+						$list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1547
+					}
1548
+				}
1549
+			}
1550
+		}
1551
+
1552
+	} else {
1553
+		$gd_country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : '';
1554
+		$gd_region = (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') ? $wp->query_vars['gd_region'] : '';
1555
+		$gd_city = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : '';
1556
+
1557
+		$gd_country_actual = $gd_region_actual = $gd_city_actual = '';
1558
+
1559
+		if (function_exists('get_actual_location_name')) {
1560
+			$gd_country_actual = $gd_country != '' ? get_actual_location_name('country', $gd_country, true) : $gd_country;
1561
+			$gd_region_actual = $gd_region != '' ? get_actual_location_name('region', $gd_region) : $gd_region;
1562
+			$gd_city_actual = $gd_city != '' ? get_actual_location_name('city', $gd_city) : $gd_city;
1563
+		}
1564
+
1565
+		if ($gd_city != '') {
1566
+			if ($gd_city_actual != '') {
1567
+				$gd_city = $gd_city_actual;
1568
+			} else {
1569
+				$gd_city = preg_replace('/-(\d+)$/', '', $gd_city);
1570
+				$gd_city = preg_replace('/[_-]/', ' ', $gd_city);
1571
+				$gd_city = __(geodir_ucwords($gd_city), 'geodirectory');
1572
+			}
1632 1573
 
1574
+			$list_title .= __(' in', 'geodirectory') . " '" . $gd_city . "'";
1575
+		} else if ($gd_region != '') {
1576
+			if ($gd_region_actual != '') {
1577
+				$gd_region = $gd_region_actual;
1578
+			} else {
1579
+				$gd_region = preg_replace('/-(\d+)$/', '', $gd_region);
1580
+				$gd_region = preg_replace('/[_-]/', ' ', $gd_region);
1581
+				$gd_region = __(geodir_ucwords($gd_region), 'geodirectory');
1582
+			}
1633 1583
 
1634
-    /**
1635
-     * Filter page title to replace variables.
1636
-     *
1637
-     * @since 1.5.4
1638
-     * @param string $title The page title including variables.
1639
-     * @param string $gd_page The GeoDirectory page type if any.
1640
-     */
1641
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
1584
+			$list_title .= __(' in', 'geodirectory') . " '" . $gd_region . "'";
1585
+		} else if ($gd_country != '') {
1586
+			if ($gd_country_actual != '') {
1587
+				$gd_country = $gd_country_actual;
1588
+			} else {
1589
+				$gd_country = preg_replace('/-(\d+)$/', '', $gd_country);
1590
+				$gd_country = preg_replace('/[_-]/', ' ', $gd_country);
1591
+				$gd_country = __(geodir_ucwords($gd_country), 'geodirectory');
1592
+			}
1642 1593
 
1643
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
1644
-        /**
1645
-         * Filter the listing page title.
1646
-         *
1647
-         * @since 1.0.0
1648
-         * @param string $list_title The title for the category page.
1649
-         */
1650
-        apply_filters('geodir_listing_page_title', $title) . '</h1></header>';
1594
+			$list_title .= __(' in', 'geodirectory') . " '" . $gd_country . "'";
1595
+		}
1596
+	}
1597
+
1598
+	if (is_search()) {
1599
+		$list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
1600
+	}
1601
+	/** This action is documented in geodirectory_template_actions.php */
1602
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
1603
+	/** This action is documented in geodirectory_template_actions.php */
1604
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
1605
+
1606
+
1607
+	$title = $list_title;
1608
+	if(geodir_is_page('pt')){
1609
+		$gd_page = 'pt';
1610
+		$title  = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
1611
+	}
1612
+	elseif(geodir_is_page('listing')){
1613
+		$gd_page = 'listing';
1614
+		global $wp_query;
1615
+		$current_term = $wp_query->get_queried_object();
1616
+		if (strpos($current_term->taxonomy,'_tags') !== false) {
1617
+			$title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
1618
+		}else{
1619
+			$title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
1620
+		}
1621
+
1622
+	}
1623
+	elseif(geodir_is_page('author')){
1624
+		$gd_page = 'author';
1625
+		if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
1626
+			$title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
1627
+		}else{
1628
+			$title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
1629
+		}
1630
+
1631
+	}
1632
+
1633
+
1634
+	/**
1635
+	 * Filter page title to replace variables.
1636
+	 *
1637
+	 * @since 1.5.4
1638
+	 * @param string $title The page title including variables.
1639
+	 * @param string $gd_page The GeoDirectory page type if any.
1640
+	 */
1641
+	$title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
1642
+
1643
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
1644
+		/**
1645
+		 * Filter the listing page title.
1646
+		 *
1647
+		 * @since 1.0.0
1648
+		 * @param string $list_title The title for the category page.
1649
+		 */
1650
+		apply_filters('geodir_listing_page_title', $title) . '</h1></header>';
1651 1651
 }
1652 1652
 
1653 1653
 add_action('geodir_listings_page_description', 'geodir_action_listings_description', 10);
@@ -1660,33 +1660,33 @@  discard block
 block discarded – undo
1660 1660
  */
1661 1661
 function geodir_action_listings_description()
1662 1662
 {
1663
-    global $wp_query;
1664
-    $current_term = $wp_query->get_queried_object();
1665
-
1666
-    $gd_post_type = geodir_get_current_posttype();
1667
-    if (isset($current_term->term_id) && $current_term->term_id != '') {
1668
-
1669
-        $term_desc = term_description($current_term->term_id, $gd_post_type . '_tags');
1670
-        $saved_data = stripslashes(get_tax_meta($current_term->term_id, 'ct_cat_top_desc', false, $gd_post_type));
1671
-        if ($term_desc && !$saved_data) {
1672
-            $saved_data = $term_desc;
1673
-        }
1674
-        /**
1675
-         * Apply the core filter `the_content` filter to the variable string.
1676
-         *
1677
-         * This is a WordPress core filter that does many things.
1678
-         *
1679
-         * @since 1.0.0
1680
-         * @param string $var The string to apply the filter to.
1681
-         */
1682
-        $cat_description = apply_filters('the_content', $saved_data);
1683
-        if ($cat_description) {
1684
-            ?>
1663
+	global $wp_query;
1664
+	$current_term = $wp_query->get_queried_object();
1665
+
1666
+	$gd_post_type = geodir_get_current_posttype();
1667
+	if (isset($current_term->term_id) && $current_term->term_id != '') {
1668
+
1669
+		$term_desc = term_description($current_term->term_id, $gd_post_type . '_tags');
1670
+		$saved_data = stripslashes(get_tax_meta($current_term->term_id, 'ct_cat_top_desc', false, $gd_post_type));
1671
+		if ($term_desc && !$saved_data) {
1672
+			$saved_data = $term_desc;
1673
+		}
1674
+		/**
1675
+		 * Apply the core filter `the_content` filter to the variable string.
1676
+		 *
1677
+		 * This is a WordPress core filter that does many things.
1678
+		 *
1679
+		 * @since 1.0.0
1680
+		 * @param string $var The string to apply the filter to.
1681
+		 */
1682
+		$cat_description = apply_filters('the_content', $saved_data);
1683
+		if ($cat_description) {
1684
+			?>
1685 1685
 
1686 1686
             <div class="term_description"><?php echo $cat_description;?></div> <?php
1687
-        }
1687
+		}
1688 1688
 
1689
-    }
1689
+	}
1690 1690
 }
1691 1691
 
1692 1692
 // action for adding the listings page top widget area
@@ -1705,11 +1705,11 @@  discard block
 block discarded – undo
1705 1705
  */
1706 1706
 function geodir_action_geodir_sidebar_listings_top()
1707 1707
 {
1708
-    if (get_option('geodir_show_listing_top_section')) { ?>
1708
+	if (get_option('geodir_show_listing_top_section')) { ?>
1709 1709
         <div
1710 1710
             class="<?php
1711
-            /** This action is documented in geodirectory_template_actions.php */
1712
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_top'); ?>">
1711
+			/** This action is documented in geodirectory_template_actions.php */
1712
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_top'); ?>">
1713 1713
             <?php dynamic_sidebar('geodir_listing_top'); ?>
1714 1714
         </div><!-- clearfix ends here-->
1715 1715
     <?php }
@@ -1732,35 +1732,35 @@  discard block
 block discarded – undo
1732 1732
  */
1733 1733
 function geodir_action_sidebar_left_open($type = '', $id = '', $class = '', $itemtype = '')
1734 1734
 {
1735
-    if ($type == 'home-page' && $width = get_option('geodir_width_home_left_section')) {
1736
-        $width_css = 'style="width:' . $width . '%;"';
1737
-    } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_left_section')) {
1738
-        $width_css = 'style="width:' . $width . '%;"';
1739
-    } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_left_section')) {
1740
-        $width_css = 'style="width:' . $width . '%;"';
1741
-    } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_left_section')) {
1742
-        $width_css = 'style="width:' . $width . '%;"';
1743
-    } else {
1744
-        $width_css = '';
1745
-    }
1746
-
1747
-    $tc = get_option('theme_compatibility_setting');
1748
-    if (!empty($tc['geodir_sidebar_left_open_replace'])) {
1749
-        $text = $tc['geodir_sidebar_left_open_replace'];
1750
-    } else {
1751
-        $text = '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>';
1752
-    }
1753
-
1754
-    if (!empty($tc['geodir_sidebar_left_open_id'])) {
1755
-        $id = $tc['geodir_sidebar_left_open_id'];
1756
-    }
1757
-    if (!empty($tc['geodir_sidebar_left_open_class'])) {
1758
-        $class = $tc['geodir_sidebar_left_open_class'];
1759
-    }
1760
-
1761
-    $text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
1762
-
1763
-    echo $text;
1735
+	if ($type == 'home-page' && $width = get_option('geodir_width_home_left_section')) {
1736
+		$width_css = 'style="width:' . $width . '%;"';
1737
+	} elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_left_section')) {
1738
+		$width_css = 'style="width:' . $width . '%;"';
1739
+	} elseif ($type == 'search-page' && $width = get_option('geodir_width_search_left_section')) {
1740
+		$width_css = 'style="width:' . $width . '%;"';
1741
+	} elseif ($type == 'author-page' && $width = get_option('geodir_width_author_left_section')) {
1742
+		$width_css = 'style="width:' . $width . '%;"';
1743
+	} else {
1744
+		$width_css = '';
1745
+	}
1746
+
1747
+	$tc = get_option('theme_compatibility_setting');
1748
+	if (!empty($tc['geodir_sidebar_left_open_replace'])) {
1749
+		$text = $tc['geodir_sidebar_left_open_replace'];
1750
+	} else {
1751
+		$text = '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>';
1752
+	}
1753
+
1754
+	if (!empty($tc['geodir_sidebar_left_open_id'])) {
1755
+		$id = $tc['geodir_sidebar_left_open_id'];
1756
+	}
1757
+	if (!empty($tc['geodir_sidebar_left_open_class'])) {
1758
+		$class = $tc['geodir_sidebar_left_open_class'];
1759
+	}
1760
+
1761
+	$text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
1762
+
1763
+	echo $text;
1764 1764
 }
1765 1765
 
1766 1766
 // action for adding the primary div closing tag
@@ -1776,13 +1776,13 @@  discard block
 block discarded – undo
1776 1776
  */
1777 1777
 function geodir_action_sidebar_left_close($type = '')
1778 1778
 {
1779
-    $tc = get_option('theme_compatibility_setting');
1780
-    if (!empty($tc['geodir_sidebar_left_close_replace'])) {
1781
-        $text = $tc['geodir_sidebar_left_close_replace'];
1782
-    } else {
1783
-        $text = '</aside><!-- sidebar ends here-->';
1784
-    }
1785
-    echo $text;
1779
+	$tc = get_option('theme_compatibility_setting');
1780
+	if (!empty($tc['geodir_sidebar_left_close_replace'])) {
1781
+		$text = $tc['geodir_sidebar_left_close_replace'];
1782
+	} else {
1783
+		$text = '</aside><!-- sidebar ends here-->';
1784
+	}
1785
+	echo $text;
1786 1786
 }
1787 1787
 
1788 1788
 /**
@@ -1795,7 +1795,7 @@  discard block
 block discarded – undo
1795 1795
  */
1796 1796
 function geodir_listing_left_section()
1797 1797
 {
1798
-    if (get_option('geodir_show_listing_left_section')) { ?>
1798
+	if (get_option('geodir_show_listing_left_section')) { ?>
1799 1799
         <div class="geodir-content-left geodir-sidebar-wrap">
1800 1800
             <?php dynamic_sidebar('geodir_listing_left_sidebar'); ?>
1801 1801
         </div><!-- end geodir-content-left -->
@@ -1813,20 +1813,20 @@  discard block
 block discarded – undo
1813 1813
  */
1814 1814
 function geodir_action_listings_sidebar_left()
1815 1815
 {
1816
-    if (get_option('geodir_show_listing_left_section')) {
1817
-        /** This action is documented in geodirectory_template_actions.php */
1818
-        do_action('geodir_sidebar_left_open', 'listings-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
1819
-        /**
1820
-         * Calls the listings page (category) left sidebar content.
1821
-         *
1822
-         * All the content for the listings page left sidebar is added via this hook.
1823
-         *
1824
-         * @since 1.0.0
1825
-         */
1826
-        do_action('geodir_listings_sidebar_left_inside');
1827
-        /** This action is documented in geodirectory_template_actions.php */
1828
-        do_action('geodir_sidebar_left_close', 'listings-page');
1829
-    }
1816
+	if (get_option('geodir_show_listing_left_section')) {
1817
+		/** This action is documented in geodirectory_template_actions.php */
1818
+		do_action('geodir_sidebar_left_open', 'listings-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
1819
+		/**
1820
+		 * Calls the listings page (category) left sidebar content.
1821
+		 *
1822
+		 * All the content for the listings page left sidebar is added via this hook.
1823
+		 *
1824
+		 * @since 1.0.0
1825
+		 */
1826
+		do_action('geodir_listings_sidebar_left_inside');
1827
+		/** This action is documented in geodirectory_template_actions.php */
1828
+		do_action('geodir_sidebar_left_close', 'listings-page');
1829
+	}
1830 1830
 }
1831 1831
 
1832 1832
 /**
@@ -1839,7 +1839,7 @@  discard block
 block discarded – undo
1839 1839
  */
1840 1840
 function geodir_listing_right_section()
1841 1841
 {
1842
-    if (get_option('geodir_show_listing_right_section')) { ?>
1842
+	if (get_option('geodir_show_listing_right_section')) { ?>
1843 1843
         <div class="geodir-content-right geodir-sidebar-wrap">
1844 1844
             <?php dynamic_sidebar('geodir_listing_right_sidebar'); ?>
1845 1845
         </div><!-- end geodir-content-right -->
@@ -1857,20 +1857,20 @@  discard block
 block discarded – undo
1857 1857
  */
1858 1858
 function geodir_action_listings_sidebar_right()
1859 1859
 {
1860
-    if (get_option('geodir_show_listing_right_section')) {
1861
-        /** This action is documented in geodirectory_template_actions.php */
1862
-        do_action('geodir_sidebar_right_open', 'listings-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
1863
-        /**
1864
-         * Calls the listings page (category) right sidebar content.
1865
-         *
1866
-         * All the content for the listings page right sidebar is added via this hook.
1867
-         *
1868
-         * @since 1.0.0
1869
-         */
1870
-        do_action('geodir_listings_sidebar_right_inside');
1871
-        /** This action is documented in geodirectory_template_actions.php */
1872
-        do_action('geodir_sidebar_right_close', 'listings-page');
1873
-    }
1860
+	if (get_option('geodir_show_listing_right_section')) {
1861
+		/** This action is documented in geodirectory_template_actions.php */
1862
+		do_action('geodir_sidebar_right_open', 'listings-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
1863
+		/**
1864
+		 * Calls the listings page (category) right sidebar content.
1865
+		 *
1866
+		 * All the content for the listings page right sidebar is added via this hook.
1867
+		 *
1868
+		 * @since 1.0.0
1869
+		 */
1870
+		do_action('geodir_listings_sidebar_right_inside');
1871
+		/** This action is documented in geodirectory_template_actions.php */
1872
+		do_action('geodir_sidebar_right_close', 'listings-page');
1873
+	}
1874 1874
 }
1875 1875
 
1876 1876
 
@@ -1887,23 +1887,23 @@  discard block
 block discarded – undo
1887 1887
  */
1888 1888
 function geodir_action_main_content_open($type = '', $id = '', $class = '')
1889 1889
 {
1890
-    $tc = get_option('theme_compatibility_setting');
1891
-    if (!empty($tc['geodir_main_content_open_replace'])) {
1892
-        $text = $tc['geodir_main_content_open_replace'];
1893
-    } else {
1894
-        $text = '<main id="[id]" class="[class]" role="main">';
1895
-    }
1890
+	$tc = get_option('theme_compatibility_setting');
1891
+	if (!empty($tc['geodir_main_content_open_replace'])) {
1892
+		$text = $tc['geodir_main_content_open_replace'];
1893
+	} else {
1894
+		$text = '<main id="[id]" class="[class]" role="main">';
1895
+	}
1896 1896
 
1897
-    if (!empty($tc['geodir_main_content_open_id'])) {
1898
-        $id = $tc['geodir_main_content_open_id'];
1899
-    }
1900
-    if (!empty($tc['geodir_main_content_open_class'])) {
1901
-        $class = $tc['geodir_main_content_open_class'];
1902
-    }
1897
+	if (!empty($tc['geodir_main_content_open_id'])) {
1898
+		$id = $tc['geodir_main_content_open_id'];
1899
+	}
1900
+	if (!empty($tc['geodir_main_content_open_class'])) {
1901
+		$class = $tc['geodir_main_content_open_class'];
1902
+	}
1903 1903
 
1904
-    $text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
1904
+	$text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
1905 1905
 
1906
-    echo $text;
1906
+	echo $text;
1907 1907
 }
1908 1908
 
1909 1909
 // action for adding the primary div closing tag
@@ -1916,13 +1916,13 @@  discard block
 block discarded – undo
1916 1916
  */
1917 1917
 function geodir_action_main_content_close()
1918 1918
 {
1919
-    $tc = get_option('theme_compatibility_setting');
1920
-    if (!empty($tc['geodir_main_content_close_replace'])) {
1921
-        $text = $tc['geodir_main_content_close_replace'];
1922
-    } else {
1923
-        $text = '</main><!-- main ends here-->';
1924
-    }
1925
-    echo $text;
1919
+	$tc = get_option('theme_compatibility_setting');
1920
+	if (!empty($tc['geodir_main_content_close_replace'])) {
1921
+		$text = $tc['geodir_main_content_close_replace'];
1922
+	} else {
1923
+		$text = '</main><!-- main ends here-->';
1924
+	}
1925
+	echo $text;
1926 1926
 }
1927 1927
 
1928 1928
 /**
@@ -1934,14 +1934,14 @@  discard block
 block discarded – undo
1934 1934
  */
1935 1935
 function geodir_action_listings_content_inside()
1936 1936
 {
1937
-    global $gridview_columns;
1938
-    $listing_view = get_option('geodir_listing_view');
1939
-    if (strstr($listing_view, 'gridview')) {
1940
-        $gridview_columns = $listing_view;
1941
-        $listing_view_exp = explode('_', $listing_view);
1942
-        $listing_view = $listing_view_exp[0];
1943
-    }
1944
-    geodir_get_template_part('listing', 'listview');
1937
+	global $gridview_columns;
1938
+	$listing_view = get_option('geodir_listing_view');
1939
+	if (strstr($listing_view, 'gridview')) {
1940
+		$gridview_columns = $listing_view;
1941
+		$listing_view_exp = explode('_', $listing_view);
1942
+		$listing_view = $listing_view_exp[0];
1943
+	}
1944
+	geodir_get_template_part('listing', 'listview');
1945 1945
 }
1946 1946
 
1947 1947
 add_action('geodir_listings_content_inside', 'geodir_action_listings_content_inside', 10);
@@ -1957,47 +1957,47 @@  discard block
 block discarded – undo
1957 1957
  */
1958 1958
 function geodir_action_listings_content()
1959 1959
 {
1960
-    /**
1961
-     * This is used to add HTML opening wrappers to the main content of most pages including listings, author, search, home etc.
1962
-     *
1963
-     * @since 1.0.0
1964
-     * @param string $type The page type. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
1965
-     * @param string $id The id for the div. Usually 'geodir-main-content'.
1966
-     * @param string $class The class for the div. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
1967
-     * @see 'geodir_main_content_close' Where the oposing closing tag is added.
1968
-     */
1969
-    do_action('geodir_main_content_open', 'listings-page', 'geodir-main-content', 'listings-page');
1970
-    $extra_class = apply_filters('geodir_before_listing_wrapper_extra_class', '', 'listings-page');
1971
-    echo '<div class="clearfix '.$extra_class.'">';
1972
-    /**
1973
-     * Called before the listings page content, inside the outer wrapper. Used on listings pages and search and author pages.
1974
-     *
1975
-     * @since 1.0.0
1976
-     */
1977
-    do_action('geodir_before_listing');
1978
-    echo '</div>';
1979
-
1980
-    /**
1981
-     * This actions calls the listings list content. Used on listings pages and search and author pages.
1982
-     *
1983
-     * @since 1.0.0
1984
-     */
1985
-    do_action('geodir_listings_content_inside');
1986
-
1987
-    /**
1988
-     * Called after the listings content, inside the outer wrapper HTML. Used on listings pages and search and author pages.
1989
-     *
1990
-     * @since 1.0.0
1991
-     */
1992
-    do_action('geodir_after_listing');
1993
-
1994
-    /**
1995
-     * This is used to add HTML closing wrappers to the main content of most pages including listings, author, search, home etc.
1996
-     *
1997
-     * @since 1.0.0
1998
-     * @see 'geodir_main_content_open' Where the oposing opening tag is added.
1999
-     */
2000
-    do_action('geodir_main_content_close', 'listings-page');
1960
+	/**
1961
+	 * This is used to add HTML opening wrappers to the main content of most pages including listings, author, search, home etc.
1962
+	 *
1963
+	 * @since 1.0.0
1964
+	 * @param string $type The page type. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
1965
+	 * @param string $id The id for the div. Usually 'geodir-main-content'.
1966
+	 * @param string $class The class for the div. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
1967
+	 * @see 'geodir_main_content_close' Where the oposing closing tag is added.
1968
+	 */
1969
+	do_action('geodir_main_content_open', 'listings-page', 'geodir-main-content', 'listings-page');
1970
+	$extra_class = apply_filters('geodir_before_listing_wrapper_extra_class', '', 'listings-page');
1971
+	echo '<div class="clearfix '.$extra_class.'">';
1972
+	/**
1973
+	 * Called before the listings page content, inside the outer wrapper. Used on listings pages and search and author pages.
1974
+	 *
1975
+	 * @since 1.0.0
1976
+	 */
1977
+	do_action('geodir_before_listing');
1978
+	echo '</div>';
1979
+
1980
+	/**
1981
+	 * This actions calls the listings list content. Used on listings pages and search and author pages.
1982
+	 *
1983
+	 * @since 1.0.0
1984
+	 */
1985
+	do_action('geodir_listings_content_inside');
1986
+
1987
+	/**
1988
+	 * Called after the listings content, inside the outer wrapper HTML. Used on listings pages and search and author pages.
1989
+	 *
1990
+	 * @since 1.0.0
1991
+	 */
1992
+	do_action('geodir_after_listing');
1993
+
1994
+	/**
1995
+	 * This is used to add HTML closing wrappers to the main content of most pages including listings, author, search, home etc.
1996
+	 *
1997
+	 * @since 1.0.0
1998
+	 * @see 'geodir_main_content_open' Where the oposing opening tag is added.
1999
+	 */
2000
+	do_action('geodir_main_content_close', 'listings-page');
2001 2001
 }
2002 2002
 
2003 2003
 
@@ -2012,10 +2012,10 @@  discard block
 block discarded – undo
2012 2012
  */
2013 2013
 function geodir_action_sidebar_listings_bottom_section()
2014 2014
 {
2015
-    if (get_option('geodir_show_listing_bottom_section')) { ?>
2015
+	if (get_option('geodir_show_listing_bottom_section')) { ?>
2016 2016
         <div class="<?php
2017
-            /** This action is documented in geodirectory_template_actions.php */
2018
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_bottom'); ?>">
2017
+			/** This action is documented in geodirectory_template_actions.php */
2018
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_bottom'); ?>">
2019 2019
             <?php dynamic_sidebar('geodir_listing_bottom'); ?>
2020 2020
         </div><!-- clearfix ends here-->
2021 2021
     <?php }
@@ -2035,38 +2035,38 @@  discard block
 block discarded – undo
2035 2035
  */
2036 2036
 function geodir_action_add_listing_page_title()
2037 2037
 {
2038
-    if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '')
2039
-        $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2040
-    /** This action is documented in geodirectory_template_actions.php */
2041
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
2042
-    /** This action is documented in geodirectory_template_actions.php */
2043
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2044
-
2045
-    $title = apply_filters('geodir_add_listing_page_title_text', get_the_title());
2046
-
2047
-    if(geodir_is_page('add-listing')){
2048
-        $gd_page = 'add-listing';
2049
-        if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
2050
-            $title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
2051
-        }elseif(isset($listing_type)){
2052
-            $title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
2053
-        }
2038
+	if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '')
2039
+		$listing_type = sanitize_text_field($_REQUEST['listing_type']);
2040
+	/** This action is documented in geodirectory_template_actions.php */
2041
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
2042
+	/** This action is documented in geodirectory_template_actions.php */
2043
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2044
+
2045
+	$title = apply_filters('geodir_add_listing_page_title_text', get_the_title());
2054 2046
 
2055
-    }
2047
+	if(geodir_is_page('add-listing')){
2048
+		$gd_page = 'add-listing';
2049
+		if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
2050
+			$title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
2051
+		}elseif(isset($listing_type)){
2052
+			$title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
2053
+		}
2056 2054
 
2055
+	}
2057 2056
 
2058
-    /**
2059
-     * Filter page title to replace variables.
2060
-     *
2061
-     * @since 1.5.4
2062
-     * @param string $title The page title including variables.
2063
-     * @param string $gd_page The GeoDirectory page type if any.
2064
-     */
2065
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2066 2057
 
2067
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">';
2068
-    echo $title;
2069
-    echo '</h1></header>';
2058
+	/**
2059
+	 * Filter page title to replace variables.
2060
+	 *
2061
+	 * @since 1.5.4
2062
+	 * @param string $title The page title including variables.
2063
+	 * @param string $gd_page The GeoDirectory page type if any.
2064
+	 */
2065
+	$title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2066
+
2067
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">';
2068
+	echo $title;
2069
+	echo '</h1></header>';
2070 2070
 }
2071 2071
 
2072 2072
 add_action('geodir_add_listing_page_mandatory', 'geodir_action_add_listing_page_mandatory', 10);
@@ -2097,54 +2097,54 @@  discard block
 block discarded – undo
2097 2097
  */
2098 2098
 function geodir_action_add_listing_form()
2099 2099
 {
2100
-    global $cat_display, $post_cat, $current_user, $gd_session;
2101
-    $page_id = get_the_ID();
2102
-    $post = '';
2103
-    $title = '';
2104
-    $desc = '';
2105
-    $kw_tags = '';
2106
-    $required_msg = '';
2107
-    $submit_button = '';
2108
-
2109
-    $ajax_action = isset($_REQUEST['ajax_action']) ? $_REQUEST['ajax_action'] : 'add';
2110
-
2111
-    $thumb_img_arr = array();
2112
-    $curImages = '';
2113
-
2114
-    if (isset($_REQUEST['backandedit'])) {
2115
-        global $post;
2116
-        $post = (object)$gd_session->get('listing');
2117
-        $listing_type = $post->listing_type;
2118
-        $title = $post->post_title;
2119
-        $desc = $post->post_desc;
2120
-        $post_cat = $post->post_category;
2121
-
2122
-        $kw_tags = $post->post_tags;
2123
-        $curImages = isset($post->post_images) ? $post->post_images : '';
2124
-    } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2125
-        global $post, $post_images;
2126
-
2127
-        $post = geodir_get_post_info($_REQUEST['pid']);
2128
-        $thumb_img_arr = geodir_get_images($post->ID);
2129
-        if ($thumb_img_arr) {
2130
-            foreach ($thumb_img_arr as $post_img) {
2131
-                $curImages .= $post_img->src . ',';
2132
-            }
2133
-        }
2134
-
2135
-        $listing_type = $post->post_type;
2136
-        $title = $post->post_title;
2137
-        $desc = $post->post_content;
2138
-        $kw_tags = $post->post_tags;
2139
-        $kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type . '_tags', array('fields' => 'names')));
2140
-    } else {
2141
-        $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2142
-    }
2143
-
2144
-    if ($current_user->ID != '0') {
2145
-        $user_login = true;
2146
-    }
2147
-    ?>
2100
+	global $cat_display, $post_cat, $current_user, $gd_session;
2101
+	$page_id = get_the_ID();
2102
+	$post = '';
2103
+	$title = '';
2104
+	$desc = '';
2105
+	$kw_tags = '';
2106
+	$required_msg = '';
2107
+	$submit_button = '';
2108
+
2109
+	$ajax_action = isset($_REQUEST['ajax_action']) ? $_REQUEST['ajax_action'] : 'add';
2110
+
2111
+	$thumb_img_arr = array();
2112
+	$curImages = '';
2113
+
2114
+	if (isset($_REQUEST['backandedit'])) {
2115
+		global $post;
2116
+		$post = (object)$gd_session->get('listing');
2117
+		$listing_type = $post->listing_type;
2118
+		$title = $post->post_title;
2119
+		$desc = $post->post_desc;
2120
+		$post_cat = $post->post_category;
2121
+
2122
+		$kw_tags = $post->post_tags;
2123
+		$curImages = isset($post->post_images) ? $post->post_images : '';
2124
+	} elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2125
+		global $post, $post_images;
2126
+
2127
+		$post = geodir_get_post_info($_REQUEST['pid']);
2128
+		$thumb_img_arr = geodir_get_images($post->ID);
2129
+		if ($thumb_img_arr) {
2130
+			foreach ($thumb_img_arr as $post_img) {
2131
+				$curImages .= $post_img->src . ',';
2132
+			}
2133
+		}
2134
+
2135
+		$listing_type = $post->post_type;
2136
+		$title = $post->post_title;
2137
+		$desc = $post->post_content;
2138
+		$kw_tags = $post->post_tags;
2139
+		$kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type . '_tags', array('fields' => 'names')));
2140
+	} else {
2141
+		$listing_type = sanitize_text_field($_REQUEST['listing_type']);
2142
+	}
2143
+
2144
+	if ($current_user->ID != '0') {
2145
+		$user_login = true;
2146
+	}
2147
+	?>
2148 2148
     <form name="propertyform" id="propertyform" action="<?php echo get_page_link(geodir_preview_page_id());?>" method="post" enctype="multipart/form-data">
2149 2149
         <input type="hidden" name="preview" value="<?php echo sanitize_text_field($listing_type);?>"/>
2150 2150
         <input type="hidden" name="listing_type" value="<?php echo sanitize_text_field($listing_type);?>"/>
@@ -2155,27 +2155,27 @@  discard block
 block discarded – undo
2155 2155
         <?php } if (isset($_REQUEST['backandedit'])) { ?>
2156 2156
             <input type="hidden" name="backandedit" value="<?php echo sanitize_text_field($_REQUEST['backandedit']);?>"/>
2157 2157
         <?php
2158
-        } 
2159
-        /**
2160
-         * Called at the very top of the add listing page form for frontend.
2161
-         *
2162
-         * This is called just before the "Enter Listing Details" text.
2163
-         *
2164
-         * @since 1.0.0
2165
-         */
2166
-        do_action('geodir_before_detail_fields');
2167
-        ?>
2158
+		} 
2159
+		/**
2160
+		 * Called at the very top of the add listing page form for frontend.
2161
+		 *
2162
+		 * This is called just before the "Enter Listing Details" text.
2163
+		 *
2164
+		 * @since 1.0.0
2165
+		 */
2166
+		do_action('geodir_before_detail_fields');
2167
+		?>
2168 2168
         <h5 id="geodir_fieldset_details" class="geodir-fieldset-row" gd-fieldset="details"><?php echo LISTING_DETAILS_TEXT;?></h5>
2169 2169
         <?php
2170
-        /**
2171
-         * Called at the top of the add listing page form for frontend.
2172
-         *
2173
-         * This is called after the "Enter Listing Details" text.
2174
-         *
2175
-         * @since 1.0.0
2176
-         */
2177
-        do_action('geodir_before_main_form_fields');
2178
-        ?>
2170
+		/**
2171
+		 * Called at the top of the add listing page form for frontend.
2172
+		 *
2173
+		 * This is called after the "Enter Listing Details" text.
2174
+		 *
2175
+		 * @since 1.0.0
2176
+		 */
2177
+		do_action('geodir_before_main_form_fields');
2178
+		?>
2179 2179
         <div id="geodir_post_title_row" class="required_field geodir_form_row clearfix gd-fieldset-details">
2180 2180
             <label><?php echo PLACE_TITLE_TEXT;?><span>*</span> </label>
2181 2181
             <input type="text" field_type="text" name="post_title" id="post_title" class="geodir_textfield"
@@ -2183,57 +2183,57 @@  discard block
 block discarded – undo
2183 2183
             <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory');?></span>
2184 2184
         </div>
2185 2185
         <?php
2186
-        $show_editor = get_option('geodir_tiny_editor_on_add_listing');
2187
-
2188
-        $desc = $show_editor ? stripslashes($desc) : esc_attr(stripslashes($desc));
2189
-        $desc_limit = '';
2190
-        /**
2191
-         * Filter the add listing description field character limit number.
2192
-         *
2193
-         * @since 1.0.0
2194
-         * @param int $desc_limit The amount of characters to limit the description to.
2195
-         */
2196
-        $desc_limit = apply_filters('geodir_description_field_desc_limit', $desc_limit);
2197
-        /**
2198
-         * Filter the add listing description field text.
2199
-         *
2200
-         * @since 1.0.0
2201
-         * @param string $desc The text for the description field.
2202
-         * @param int $desc_limit The character limit numer if any.
2203
-         */
2204
-        $desc = apply_filters('geodir_description_field_desc', $desc, $desc_limit);
2205
-        $desc_limit_msg = '';
2206
-        /**
2207
-         * Filter the add listing description limit message.
2208
-         *
2209
-         * This is the message shown if there is a limit applied to the amount of characters the description can use.
2210
-         *
2211
-         * @since 1.0.0
2212
-         * @param string $desc_limit_msg The limit message string if any.
2213
-         * @param int $desc_limit The character limit numer if any.
2214
-         */
2215
-        $desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit);
2186
+		$show_editor = get_option('geodir_tiny_editor_on_add_listing');
2187
+
2188
+		$desc = $show_editor ? stripslashes($desc) : esc_attr(stripslashes($desc));
2189
+		$desc_limit = '';
2190
+		/**
2191
+		 * Filter the add listing description field character limit number.
2192
+		 *
2193
+		 * @since 1.0.0
2194
+		 * @param int $desc_limit The amount of characters to limit the description to.
2195
+		 */
2196
+		$desc_limit = apply_filters('geodir_description_field_desc_limit', $desc_limit);
2197
+		/**
2198
+		 * Filter the add listing description field text.
2199
+		 *
2200
+		 * @since 1.0.0
2201
+		 * @param string $desc The text for the description field.
2202
+		 * @param int $desc_limit The character limit numer if any.
2203
+		 */
2204
+		$desc = apply_filters('geodir_description_field_desc', $desc, $desc_limit);
2205
+		$desc_limit_msg = '';
2206
+		/**
2207
+		 * Filter the add listing description limit message.
2208
+		 *
2209
+		 * This is the message shown if there is a limit applied to the amount of characters the description can use.
2210
+		 *
2211
+		 * @since 1.0.0
2212
+		 * @param string $desc_limit_msg The limit message string if any.
2213
+		 * @param int $desc_limit The character limit numer if any.
2214
+		 */
2215
+		$desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit);
2216 2216
         
2217
-        $desc_class = '';
2218
-        if ($desc_limit === '' || (int)$desc_limit > 0) {
2219
-            /**
2220
-             * Called on the add listing page form for frontend just before the description field.
2221
-             *
2222
-             * @since 1.0.0
2223
-             */
2224
-            do_action('geodir_before_description_field');
2217
+		$desc_class = '';
2218
+		if ($desc_limit === '' || (int)$desc_limit > 0) {
2219
+			/**
2220
+			 * Called on the add listing page form for frontend just before the description field.
2221
+			 *
2222
+			 * @since 1.0.0
2223
+			 */
2224
+			do_action('geodir_before_description_field');
2225 2225
             
2226
-            $desc_class = ' required_field';
2227
-        } else {
2228
-            $desc_class = ' hidden';
2229
-        }
2230
-        ?>
2226
+			$desc_class = ' required_field';
2227
+		} else {
2228
+			$desc_class = ' hidden';
2229
+		}
2230
+		?>
2231 2231
         <div id="geodir_post_desc_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $desc_class;?>">
2232 2232
             <label><?php echo PLACE_DESC_TEXT;?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label>
2233 2233
             <?php
2234
-            if (!empty($show_editor) && in_array($listing_type, $show_editor)) {
2235
-                $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
2236
-            ?>
2234
+			if (!empty($show_editor) && in_array($listing_type, $show_editor)) {
2235
+				$editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
2236
+			?>
2237 2237
                 <div class="editor" field_id="post_desc" field_type="editor">
2238 2238
                     <?php wp_editor($desc, "post_desc", $editor_settings); ?>
2239 2239
                 </div>
@@ -2247,56 +2247,56 @@  discard block
 block discarded – undo
2247 2247
             <span class="geodir_message_error"><?php echo _e($required_msg, 'geodirectory');?></span>
2248 2248
         </div>
2249 2249
         <?php
2250
-        if ($desc_limit === '' || (int)$desc_limit > 0) {
2251
-            /**
2252
-             * Called on the add listing page form for frontend just after the description field.
2253
-             *
2254
-             * @since 1.0.0
2255
-             */
2256
-            do_action('geodir_after_description_field');
2257
-        }
2250
+		if ($desc_limit === '' || (int)$desc_limit > 0) {
2251
+			/**
2252
+			 * Called on the add listing page form for frontend just after the description field.
2253
+			 *
2254
+			 * @since 1.0.0
2255
+			 */
2256
+			do_action('geodir_after_description_field');
2257
+		}
2258 2258
         
2259
-        $kw_tags = esc_attr(stripslashes($kw_tags));
2260
-        $kw_tags_count = TAGKW_TEXT_COUNT;
2261
-        $kw_tags_msg = TAGKW_MSG;
2262
-        /**
2263
-         * Filter the add listing tags character limit.
2264
-         *
2265
-         * @since 1.0.0
2266
-         * @param int $kw_tags_count The character count limit if any.
2267
-         */
2268
-        $kw_tags_count = apply_filters('geodir_listing_tags_field_tags_count', $kw_tags_count);
2269
-        /**
2270
-         * Filter the add listing tags field value.
2271
-         *
2272
-         * You can use the $_REQUEST values to check if this is a go back and edit value etc.
2273
-         *
2274
-         * @since 1.0.0
2275
-         * @param string $kw_tags The tag field value, usually a comma separated list of tags.
2276
-         * @param int $kw_tags_count The character count limit if any.
2277
-         */
2278
-        $kw_tags = apply_filters('geodir_listing_tags_field_tags', $kw_tags, $kw_tags_count);
2279
-        /**
2280
-         * Filter the add listing tags field message text.
2281
-         *
2282
-         * @since 1.0.0
2283
-         * @param string $kw_tags_msg The message shown under the field.
2284
-         * @param int $kw_tags_count The character count limit if any.
2285
-         */
2286
-        $kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count);
2259
+		$kw_tags = esc_attr(stripslashes($kw_tags));
2260
+		$kw_tags_count = TAGKW_TEXT_COUNT;
2261
+		$kw_tags_msg = TAGKW_MSG;
2262
+		/**
2263
+		 * Filter the add listing tags character limit.
2264
+		 *
2265
+		 * @since 1.0.0
2266
+		 * @param int $kw_tags_count The character count limit if any.
2267
+		 */
2268
+		$kw_tags_count = apply_filters('geodir_listing_tags_field_tags_count', $kw_tags_count);
2269
+		/**
2270
+		 * Filter the add listing tags field value.
2271
+		 *
2272
+		 * You can use the $_REQUEST values to check if this is a go back and edit value etc.
2273
+		 *
2274
+		 * @since 1.0.0
2275
+		 * @param string $kw_tags The tag field value, usually a comma separated list of tags.
2276
+		 * @param int $kw_tags_count The character count limit if any.
2277
+		 */
2278
+		$kw_tags = apply_filters('geodir_listing_tags_field_tags', $kw_tags, $kw_tags_count);
2279
+		/**
2280
+		 * Filter the add listing tags field message text.
2281
+		 *
2282
+		 * @since 1.0.0
2283
+		 * @param string $kw_tags_msg The message shown under the field.
2284
+		 * @param int $kw_tags_count The character count limit if any.
2285
+		 */
2286
+		$kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count);
2287 2287
         
2288
-        $tags_class = '';
2289
-        if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2290
-            /**
2291
-             * Called on the add listing page form for frontend just before the tags field.
2292
-             *
2293
-             * @since 1.0.0
2294
-             */
2295
-            do_action('geodir_before_listing_tags_field');
2296
-        } else {
2297
-            $tags_class = ' hidden';
2298
-        }
2299
-        ?>
2288
+		$tags_class = '';
2289
+		if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2290
+			/**
2291
+			 * Called on the add listing page form for frontend just before the tags field.
2292
+			 *
2293
+			 * @since 1.0.0
2294
+			 */
2295
+			do_action('geodir_before_listing_tags_field');
2296
+		} else {
2297
+			$tags_class = ' hidden';
2298
+		}
2299
+		?>
2300 2300
         <div id="geodir_post_tags_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $tags_class;?>">
2301 2301
             <label><?php echo TAGKW_TEXT; ?></label>
2302 2302
             <input name="post_tags" id="post_tags" value="<?php echo $kw_tags; ?>" type="text" class="geodir_textfield"
@@ -2304,90 +2304,90 @@  discard block
 block discarded – undo
2304 2304
             <span class="geodir_message_note"><?php echo $kw_tags_msg;?></span>
2305 2305
         </div>
2306 2306
         <?php
2307
-        if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2308
-            /**
2309
-             * Called on the add listing page form for frontend just after the tags field.
2310
-             *
2311
-             * @since 1.0.0
2312
-             */
2313
-            do_action('geodir_after_listing_tags_field');
2314
-        }
2307
+		if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2308
+			/**
2309
+			 * Called on the add listing page form for frontend just after the tags field.
2310
+			 *
2311
+			 * @since 1.0.0
2312
+			 */
2313
+			do_action('geodir_after_listing_tags_field');
2314
+		}
2315 2315
         
2316
-        $package_info = array();
2317
-        $package_info = geodir_post_package_info($package_info, $post);
2316
+		$package_info = array();
2317
+		$package_info = geodir_post_package_info($package_info, $post);
2318 2318
         
2319
-        geodir_get_custom_fields_html($package_info->pid, 'all', $listing_type);
2319
+		geodir_get_custom_fields_html($package_info->pid, 'all', $listing_type);
2320 2320
         
2321
-        // adjust values here
2322
-        $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
2321
+		// adjust values here
2322
+		$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
2323 2323
 
2324
-        $multiple = true; // allow multiple files upload
2324
+		$multiple = true; // allow multiple files upload
2325 2325
 
2326
-        $width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels)
2326
+		$width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels)
2327 2327
 
2328
-        $height = geodir_media_image_large_height(); // If you want to automatically resize all uploaded images then provide height here (in pixels)
2328
+		$height = geodir_media_image_large_height(); // If you want to automatically resize all uploaded images then provide height here (in pixels)
2329 2329
 
2330
-        $thumb_img_arr = array();
2331
-        $totImg = 0;
2332
-        if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
2333
-            $post = (object)$gd_session->get('listing');
2334
-            if (isset($post->post_images))
2335
-                $curImages = trim($post->post_images, ",");
2330
+		$thumb_img_arr = array();
2331
+		$totImg = 0;
2332
+		if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
2333
+			$post = (object)$gd_session->get('listing');
2334
+			if (isset($post->post_images))
2335
+				$curImages = trim($post->post_images, ",");
2336 2336
 
2337 2337
 
2338
-            if ($curImages != '') {
2339
-                $curImages_array = explode(',', $curImages);
2340
-                $totImg = count($curImages_array);
2341
-            }
2342
-
2343
-            $listing_type = $post->listing_type;
2338
+			if ($curImages != '') {
2339
+				$curImages_array = explode(',', $curImages);
2340
+				$totImg = count($curImages_array);
2341
+			}
2344 2342
 
2345
-        } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2346
-            $post = geodir_get_post_info((int)$_REQUEST['pid']);
2347
-            $listing_type = $post->post_type;
2348
-            $thumb_img_arr = geodir_get_images($_REQUEST['pid']);
2343
+			$listing_type = $post->listing_type;
2349 2344
 
2350
-        } else {
2351
-            $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2352
-        }
2345
+		} elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2346
+			$post = geodir_get_post_info((int)$_REQUEST['pid']);
2347
+			$listing_type = $post->post_type;
2348
+			$thumb_img_arr = geodir_get_images($_REQUEST['pid']);
2353 2349
 
2350
+		} else {
2351
+			$listing_type = sanitize_text_field($_REQUEST['listing_type']);
2352
+		}
2354 2353
 
2355
-        if (!empty($thumb_img_arr)) {
2356
-            foreach ($thumb_img_arr as $img) {
2357
-                //$curImages = $img->src.",";
2358
-            }
2359 2354
 
2360
-            $totImg = count((array)$thumb_img_arr);
2361
-        }
2355
+		if (!empty($thumb_img_arr)) {
2356
+			foreach ($thumb_img_arr as $img) {
2357
+				//$curImages = $img->src.",";
2358
+			}
2362 2359
 
2363
-        if ($curImages != '')
2364
-            $svalue = $curImages; // this will be initial value of the above form field. Image urls.
2365
-        else
2366
-            $svalue = '';
2367
-
2368
-        $image_limit = $package_info->image_limit;
2369
-        $show_image_input_box = ($image_limit != '0');
2370
-        /**
2371
-         * Filter to be able to show/hide the image upload section of the add listing form.
2372
-         *
2373
-         * @since 1.0.0
2374
-         * @param bool $show_image_input_box Set true to show. Set false to not show.
2375
-         * @param string $listing_type The custom post type slug.
2376
-         */
2377
-        $show_image_input_box = apply_filters('geodir_image_uploader_on_add_listing', $show_image_input_box, $listing_type);
2378
-        if ($show_image_input_box) {
2379
-            ?>
2360
+			$totImg = count((array)$thumb_img_arr);
2361
+		}
2362
+
2363
+		if ($curImages != '')
2364
+			$svalue = $curImages; // this will be initial value of the above form field. Image urls.
2365
+		else
2366
+			$svalue = '';
2367
+
2368
+		$image_limit = $package_info->image_limit;
2369
+		$show_image_input_box = ($image_limit != '0');
2370
+		/**
2371
+		 * Filter to be able to show/hide the image upload section of the add listing form.
2372
+		 *
2373
+		 * @since 1.0.0
2374
+		 * @param bool $show_image_input_box Set true to show. Set false to not show.
2375
+		 * @param string $listing_type The custom post type slug.
2376
+		 */
2377
+		$show_image_input_box = apply_filters('geodir_image_uploader_on_add_listing', $show_image_input_box, $listing_type);
2378
+		if ($show_image_input_box) {
2379
+			?>
2380 2380
 
2381 2381
             <h5 id="geodir_form_title_row" class="geodir-form_title"> <?php echo PRO_PHOTO_TEXT;?>
2382 2382
                 <?php if ($image_limit == 1) {
2383
-                    echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
2384
-                } ?>
2383
+					echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
2384
+				} ?>
2385 2385
                 <?php if ($image_limit > 1) {
2386
-                    echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>';
2387
-                } ?>
2386
+					echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>';
2387
+				} ?>
2388 2388
                 <?php if ($image_limit == '') {
2389
-                    echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>';
2390
-                } ?>
2389
+					echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>';
2390
+				} ?>
2391 2391
             </h5>
2392 2392
 
2393 2393
             <div class="geodir_form_row clearfix" id="<?php echo $id; ?>dropbox"
@@ -2425,12 +2425,12 @@  discard block
 block discarded – undo
2425 2425
         <?php } ?>
2426 2426
 
2427 2427
         <?php
2428
-        /**
2429
-         * Called on the add listing page form for frontend just after the image upload field.
2430
-         *
2431
-         * @since 1.0.0
2432
-         */
2433
-        do_action('geodir_after_main_form_fields');?>
2428
+		/**
2429
+		 * Called on the add listing page form for frontend just after the image upload field.
2430
+		 *
2431
+		 * @since 1.0.0
2432
+		 */
2433
+		do_action('geodir_after_main_form_fields');?>
2434 2434
 
2435 2435
 
2436 2436
         <!-- add captcha code -->
@@ -2459,7 +2459,7 @@  discard block
 block discarded – undo
2459 2459
 
2460 2460
     </form>
2461 2461
     <?php
2462
-    wp_reset_query();
2462
+	wp_reset_query();
2463 2463
 }
2464 2464
 
2465 2465
 /**
@@ -2470,7 +2470,7 @@  discard block
 block discarded – undo
2470 2470
  */
2471 2471
 function geodir_add_listing_sidebar_widget_area()
2472 2472
 {
2473
-    dynamic_sidebar('geodir_add_listing_sidebar');
2473
+	dynamic_sidebar('geodir_add_listing_sidebar');
2474 2474
 }
2475 2475
 
2476 2476
 add_action('geodir_add_listing_sidebar_inside', 'geodir_add_listing_sidebar_widget_area', 10);
@@ -2485,16 +2485,16 @@  discard block
 block discarded – undo
2485 2485
  */
2486 2486
 function geodir_action_add_listing_sidebar()
2487 2487
 {
2488
-    /** This action is documented in geodirectory_template_actions.php */
2489
-    do_action('geodir_sidebar_right_open', 'add-listing-page', 'geodir-sidebar', 'geodir-sidebar-right', 'http://schema.org/WPSideBar');
2490
-    /**
2491
-     * This is used to add the content to the add listing page sidebar.
2492
-     *
2493
-     * @since 1.0.0
2494
-     */
2495
-    do_action('geodir_add_listing_sidebar_inside');
2496
-    /** This action is documented in geodirectory_template_actions.php */
2497
-    do_action('geodir_sidebar_right_close', 'details-page');
2488
+	/** This action is documented in geodirectory_template_actions.php */
2489
+	do_action('geodir_sidebar_right_open', 'add-listing-page', 'geodir-sidebar', 'geodir-sidebar-right', 'http://schema.org/WPSideBar');
2490
+	/**
2491
+	 * This is used to add the content to the add listing page sidebar.
2492
+	 *
2493
+	 * @since 1.0.0
2494
+	 */
2495
+	do_action('geodir_add_listing_sidebar_inside');
2496
+	/** This action is documented in geodirectory_template_actions.php */
2497
+	do_action('geodir_sidebar_right_close', 'details-page');
2498 2498
 }
2499 2499
 
2500 2500
 ###############################################
@@ -2511,11 +2511,11 @@  discard block
 block discarded – undo
2511 2511
  */
2512 2512
 function geodir_action_geodir_sidebar_signup_top()
2513 2513
 {
2514
-    ?>
2514
+	?>
2515 2515
     <div
2516 2516
         class="<?php
2517
-        /** This action is documented in geodirectory_template_actions.php */
2518
-        echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>">
2517
+		/** This action is documented in geodirectory_template_actions.php */
2518
+		echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>">
2519 2519
         <?php dynamic_sidebar('Reg/Login Top Section');?>
2520 2520
     </div><!-- clearfix ends here-->
2521 2521
 <?php
@@ -2534,9 +2534,9 @@  discard block
 block discarded – undo
2534 2534
 function geodir_action_signup_forms()
2535 2535
 {
2536 2536
 
2537
-    global $user_login;
2537
+	global $user_login;
2538 2538
 
2539
-    ?>
2539
+	?>
2540 2540
     <script type="text/javascript">
2541 2541
         <?php if ( $user_login ) { ?>
2542 2542
         setTimeout(function () {
@@ -2572,65 +2572,65 @@  discard block
 block discarded – undo
2572 2572
         <?php } ?>
2573 2573
     </script><?php
2574 2574
 
2575
-    global $errors;
2576
-    if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim')
2577
-        $errors->add('claim_login', LOGIN_CLAIM);
2578
-
2579
-    if (!empty($errors)) {
2580
-        foreach ($errors as $errorsObj) {
2581
-            foreach ($errorsObj as $key => $val) {
2582
-                for ($i = 0; $i < count($val); $i++) {
2583
-                    echo "<div class=sucess_msg>" . $val[$i] . '</div>';
2584
-                    $registration_error_msg = 1;
2585
-                }
2586
-            }
2587
-        }
2588
-    }
2575
+	global $errors;
2576
+	if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim')
2577
+		$errors->add('claim_login', LOGIN_CLAIM);
2578
+
2579
+	if (!empty($errors)) {
2580
+		foreach ($errors as $errorsObj) {
2581
+			foreach ($errorsObj as $key => $val) {
2582
+				for ($i = 0; $i < count($val); $i++) {
2583
+					echo "<div class=sucess_msg>" . $val[$i] . '</div>';
2584
+					$registration_error_msg = 1;
2585
+				}
2586
+			}
2587
+		}
2588
+	}
2589 2589
 
2590
-    if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_in') {
2591
-        ?>
2590
+	if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_in') {
2591
+		?>
2592 2592
 
2593 2593
         <div class="login_form">
2594 2594
             <?php
2595
-            /**
2596
-             * Contains login form template.
2597
-             *
2598
-             * @since 1.0.0
2599
-             */
2600
-            include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2595
+			/**
2596
+			 * Contains login form template.
2597
+			 *
2598
+			 * @since 1.0.0
2599
+			 */
2600
+			include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2601 2601
         </div>
2602 2602
 
2603 2603
     <?php } elseif (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_up') { ?>
2604 2604
 
2605 2605
         <div class="registration_form">
2606 2606
             <?php
2607
-            /**
2608
-             * Contains registration form template.
2609
-             *
2610
-             * @since 1.0.0
2611
-             */
2612
-            include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2607
+			/**
2608
+			 * Contains registration form template.
2609
+			 *
2610
+			 * @since 1.0.0
2611
+			 */
2612
+			include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2613 2613
         </div>
2614 2614
 
2615 2615
     <?php } else { ?>
2616 2616
 
2617 2617
         <div class="login_form_l">
2618 2618
             <?php
2619
-            /**
2620
-             * Contains login form template.
2621
-             *
2622
-             * @since 1.0.0
2623
-             */
2624
-            include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2619
+			/**
2620
+			 * Contains login form template.
2621
+			 *
2622
+			 * @since 1.0.0
2623
+			 */
2624
+			include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2625 2625
         </div>
2626 2626
         <div class="registration_form_r">
2627 2627
             <?php
2628
-            /**
2629
-             * Contains registration form template.
2630
-             *
2631
-             * @since 1.0.0
2632
-             */
2633
-            include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2628
+			/**
2629
+			 * Contains registration form template.
2630
+			 *
2631
+			 * @since 1.0.0
2632
+			 */
2633
+			include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2634 2634
         </div>
2635 2635
 
2636 2636
     <?php }?>
@@ -2661,66 +2661,66 @@  discard block
 block discarded – undo
2661 2661
  */
2662 2662
 function geodir_action_author_page_title()
2663 2663
 {
2664
-    global $term;
2664
+	global $term;
2665 2665
 
2666
-    $gd_post_type = geodir_get_current_posttype();
2667
-    $post_type_info = get_post_type_object($gd_post_type);
2666
+	$gd_post_type = geodir_get_current_posttype();
2667
+	$post_type_info = get_post_type_object($gd_post_type);
2668 2668
 
2669
-    $add_string_in_title = __('All', 'geodirectory') . ' ';
2670
-    if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
2671
-        $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
2672
-    }
2669
+	$add_string_in_title = __('All', 'geodirectory') . ' ';
2670
+	if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
2671
+		$add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
2672
+	}
2673 2673
 
2674
-    $list_title = $add_string_in_title . $post_type_info->labels->name;
2675
-    $single_name = $post_type_info->labels->singular_name;
2674
+	$list_title = $add_string_in_title . $post_type_info->labels->name;
2675
+	$single_name = $post_type_info->labels->singular_name;
2676 2676
 
2677
-    $taxonomy = geodir_get_taxonomies($gd_post_type);
2677
+	$taxonomy = geodir_get_taxonomies($gd_post_type);
2678 2678
 
2679
-    if (!empty($term)) {
2680
-        $current_term = get_term_by('slug', $term, $taxonomy[0]);
2681
-        if (!empty($current_term))
2682
-            $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
2683
-    }
2679
+	if (!empty($term)) {
2680
+		$current_term = get_term_by('slug', $term, $taxonomy[0]);
2681
+		if (!empty($current_term))
2682
+			$list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
2683
+	}
2684 2684
 
2685 2685
 
2686
-    if (is_search()) {
2687
-        $list_title = __('Search', 'geodirectory') . ' ' . __($post_type_info->labels->name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2686
+	if (is_search()) {
2687
+		$list_title = __('Search', 'geodirectory') . ' ' . __($post_type_info->labels->name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2688 2688
 
2689
-    }
2690
-    /** This action is documented in geodirectory_template_actions.php */
2691
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
2692
-    /** This action is documented in geodirectory_template_actions.php */
2693
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2689
+	}
2690
+	/** This action is documented in geodirectory_template_actions.php */
2691
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
2692
+	/** This action is documented in geodirectory_template_actions.php */
2693
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2694 2694
 
2695
-    $title = $list_title;
2696
-    if(geodir_is_page('author')){
2697
-        $gd_page = 'author';
2698
-        if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
2699
-            $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
2700
-        }else{
2701
-            $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
2702
-        }
2695
+	$title = $list_title;
2696
+	if(geodir_is_page('author')){
2697
+		$gd_page = 'author';
2698
+		if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
2699
+			$title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
2700
+		}else{
2701
+			$title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
2702
+		}
2703 2703
 
2704
-    }
2704
+	}
2705 2705
 
2706 2706
 
2707
-    /**
2708
-     * Filter page title to replace variables.
2709
-     *
2710
-     * @since 1.5.4
2711
-     * @param string $title The page title including variables.
2712
-     * @param string $gd_page The GeoDirectory page type if any.
2713
-     */
2714
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2707
+	/**
2708
+	 * Filter page title to replace variables.
2709
+	 *
2710
+	 * @since 1.5.4
2711
+	 * @param string $title The page title including variables.
2712
+	 * @param string $gd_page The GeoDirectory page type if any.
2713
+	 */
2714
+	$title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2715 2715
 
2716
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2717
-        /**
2718
-         * Filter the author page title text.
2719
-         *
2720
-         * @since 1.0.0
2721
-         * @param string $list_title The title for the page.
2722
-         */
2723
-        apply_filters('geodir_author_page_title_text', $title) . '</h1></header>';
2716
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2717
+		/**
2718
+		 * Filter the author page title text.
2719
+		 *
2720
+		 * @since 1.0.0
2721
+		 * @param string $list_title The title for the page.
2722
+		 */
2723
+		apply_filters('geodir_author_page_title_text', $title) . '</h1></header>';
2724 2724
 }
2725 2725
 
2726 2726
 
@@ -2738,11 +2738,11 @@  discard block
 block discarded – undo
2738 2738
  */
2739 2739
 function geodir_action_geodir_sidebar_author_top()
2740 2740
 {
2741
-    if (get_option('geodir_show_author_top_section')) { ?>
2741
+	if (get_option('geodir_show_author_top_section')) { ?>
2742 2742
         <div
2743 2743
             class="<?php
2744
-            /** This action is documented in geodirectory_template_actions.php */
2745
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_top'); ?>">
2744
+			/** This action is documented in geodirectory_template_actions.php */
2745
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_top'); ?>">
2746 2746
             <?php dynamic_sidebar('geodir_author_top'); ?>
2747 2747
         </div><!-- clearfix ends here-->
2748 2748
     <?php }
@@ -2758,7 +2758,7 @@  discard block
 block discarded – undo
2758 2758
  */
2759 2759
 function geodir_author_left_section()
2760 2760
 {
2761
-    if (get_option('geodir_show_author_left_section')) { ?>
2761
+	if (get_option('geodir_show_author_left_section')) { ?>
2762 2762
         <div class="geodir-content-left geodir-sidebar-wrap">
2763 2763
             <?php dynamic_sidebar('geodir_author_left_sidebar'); ?>
2764 2764
         </div><!-- end geodir-content-left -->
@@ -2779,19 +2779,19 @@  discard block
 block discarded – undo
2779 2779
  */
2780 2780
 function geodir_action_author_sidebar_left()
2781 2781
 {
2782
-    if (get_option('geodir_show_author_left_section')) {
2782
+	if (get_option('geodir_show_author_left_section')) {
2783 2783
 // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
2784
-        /** This action is documented in geodirectory_template_actions.php */
2785
-        do_action('geodir_sidebar_left_open', 'author-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
2786
-        /**
2787
-         * This is used to add the content to the author page left sidebar (if active).
2788
-         *
2789
-         * @since 1.0.0
2790
-         */
2791
-        do_action('geodir_author_sidebar_left_inside');
2792
-        /** This action is documented in geodirectory_template_actions.php */
2793
-        do_action('geodir_sidebar_left_close', 'author-page');
2794
-    }
2784
+		/** This action is documented in geodirectory_template_actions.php */
2785
+		do_action('geodir_sidebar_left_open', 'author-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
2786
+		/**
2787
+		 * This is used to add the content to the author page left sidebar (if active).
2788
+		 *
2789
+		 * @since 1.0.0
2790
+		 */
2791
+		do_action('geodir_author_sidebar_left_inside');
2792
+		/** This action is documented in geodirectory_template_actions.php */
2793
+		do_action('geodir_sidebar_left_close', 'author-page');
2794
+	}
2795 2795
 }
2796 2796
 
2797 2797
 /**
@@ -2804,7 +2804,7 @@  discard block
 block discarded – undo
2804 2804
  */
2805 2805
 function geodir_author_right_section()
2806 2806
 {
2807
-    if (get_option('geodir_show_author_right_section')) { ?>
2807
+	if (get_option('geodir_show_author_right_section')) { ?>
2808 2808
         <div class="geodir-content-right geodir-sidebar-wrap">
2809 2809
             <?php dynamic_sidebar('geodir_author_right_sidebar'); ?>
2810 2810
         </div><!-- end geodir-content-right -->
@@ -2824,18 +2824,18 @@  discard block
 block discarded – undo
2824 2824
  */
2825 2825
 function geodir_action_author_sidebar_right()
2826 2826
 {
2827
-    if (get_option('geodir_show_author_right_section')) {
2828
-        /** This action is documented in geodirectory_template_actions.php */
2829
-        do_action('geodir_sidebar_right_open', 'author-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
2830
-        /**
2831
-         * This is used to add the content to the author page right sidebar (if active).
2832
-         *
2833
-         * @since 1.0.0
2834
-         */
2835
-        do_action('geodir_author_sidebar_right_inside');
2836
-        /** This action is documented in geodirectory_template_actions.php */
2837
-        do_action('geodir_sidebar_right_close', 'author-page');
2838
-    }
2827
+	if (get_option('geodir_show_author_right_section')) {
2828
+		/** This action is documented in geodirectory_template_actions.php */
2829
+		do_action('geodir_sidebar_right_open', 'author-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
2830
+		/**
2831
+		 * This is used to add the content to the author page right sidebar (if active).
2832
+		 *
2833
+		 * @since 1.0.0
2834
+		 */
2835
+		do_action('geodir_author_sidebar_right_inside');
2836
+		/** This action is documented in geodirectory_template_actions.php */
2837
+		do_action('geodir_sidebar_right_close', 'author-page');
2838
+	}
2839 2839
 }
2840 2840
 
2841 2841
 /**
@@ -2847,14 +2847,14 @@  discard block
 block discarded – undo
2847 2847
  */
2848 2848
 function geodir_action_author_content_inside()
2849 2849
 {
2850
-    global $gridview_columns;
2851
-    $listing_view = get_option('geodir_author_view');
2852
-    if (strstr($listing_view, 'gridview')) {
2853
-        $gridview_columns = $listing_view;
2854
-        $listing_view_exp = explode('_', $listing_view);
2855
-        $listing_view = $listing_view_exp[0];
2856
-    }
2857
-    geodir_get_template_part('listing', 'listview');
2850
+	global $gridview_columns;
2851
+	$listing_view = get_option('geodir_author_view');
2852
+	if (strstr($listing_view, 'gridview')) {
2853
+		$gridview_columns = $listing_view;
2854
+		$listing_view_exp = explode('_', $listing_view);
2855
+		$listing_view = $listing_view_exp[0];
2856
+	}
2857
+	geodir_get_template_part('listing', 'listview');
2858 2858
 }
2859 2859
 
2860 2860
 add_action('geodir_author_content_inside', 'geodir_action_author_content_inside', 10);
@@ -2869,22 +2869,22 @@  discard block
 block discarded – undo
2869 2869
  */
2870 2870
 function geodir_action_author_content()
2871 2871
 {
2872
-    /** This action is documented in geodirectory_template_actions.php */
2873
-    do_action('geodir_main_content_open', 'author-page', 'geodir-main-content', 'author-page');
2874
-    echo '<div class="clearfix">';
2875
-    /** This action is documented in geodirectory_template_actions.php */
2876
-    do_action('geodir_before_listing');
2877
-    echo '</div>';
2878
-    /**
2879
-     * This is used to add the content to the author page main content.
2880
-     *
2881
-     * @since 1.0.0
2882
-     */
2883
-    do_action('geodir_author_content_inside');
2884
-    /** This action is documented in geodirectory_template_actions.php */
2885
-    do_action('geodir_after_listing');
2886
-    /** This action is documented in geodirectory_template_actions.php */
2887
-    do_action('geodir_main_content_close', 'author-page');
2872
+	/** This action is documented in geodirectory_template_actions.php */
2873
+	do_action('geodir_main_content_open', 'author-page', 'geodir-main-content', 'author-page');
2874
+	echo '<div class="clearfix">';
2875
+	/** This action is documented in geodirectory_template_actions.php */
2876
+	do_action('geodir_before_listing');
2877
+	echo '</div>';
2878
+	/**
2879
+	 * This is used to add the content to the author page main content.
2880
+	 *
2881
+	 * @since 1.0.0
2882
+	 */
2883
+	do_action('geodir_author_content_inside');
2884
+	/** This action is documented in geodirectory_template_actions.php */
2885
+	do_action('geodir_after_listing');
2886
+	/** This action is documented in geodirectory_template_actions.php */
2887
+	do_action('geodir_main_content_close', 'author-page');
2888 2888
 }
2889 2889
 
2890 2890
 add_action('geodir_sidebar_author_bottom_section', 'geodir_action_sidebar_author_bottom_section', 10);
@@ -2898,11 +2898,11 @@  discard block
 block discarded – undo
2898 2898
  */
2899 2899
 function geodir_action_sidebar_author_bottom_section()
2900 2900
 {
2901
-    if (get_option('geodir_show_author_bottom_section')) { ?>
2901
+	if (get_option('geodir_show_author_bottom_section')) { ?>
2902 2902
         <div
2903 2903
             class="<?php
2904
-            /** This action is documented in geodirectory_template_actions.php */
2905
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_bottom'); ?>">
2904
+			/** This action is documented in geodirectory_template_actions.php */
2905
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_bottom'); ?>">
2906 2906
             <?php dynamic_sidebar('geodir_author_bottom'); ?>
2907 2907
         </div><!-- clearfix ends here-->
2908 2908
     <?php }
@@ -2921,23 +2921,23 @@  discard block
 block discarded – undo
2921 2921
  */
2922 2922
 function geodir_action_search_page_title()
2923 2923
 {
2924
-    $gd_post_type = geodir_get_current_posttype();
2925
-    $post_type_info = get_post_type_object($gd_post_type);
2924
+	$gd_post_type = geodir_get_current_posttype();
2925
+	$post_type_info = get_post_type_object($gd_post_type);
2926 2926
 
2927
-    $pt_name = '';
2928
-    if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;}
2927
+	$pt_name = '';
2928
+	if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;}
2929 2929
 
2930
-    if (is_search()) {
2931
-        $list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2930
+	if (is_search()) {
2931
+		$list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2932 2932
 
2933
-    }
2934
-    /** This action is documented in geodirectory_template_actions.php */
2935
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
2936
-    /** This action is documented in geodirectory_template_actions.php */
2937
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2938
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2939
-        /** This action is documented in geodirectory_template_actions.php */
2940
-        apply_filters('geodir_listing_page_title', wptexturize($list_title)) . '</h1></header>';
2933
+	}
2934
+	/** This action is documented in geodirectory_template_actions.php */
2935
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
2936
+	/** This action is documented in geodirectory_template_actions.php */
2937
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2938
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2939
+		/** This action is documented in geodirectory_template_actions.php */
2940
+		apply_filters('geodir_listing_page_title', wptexturize($list_title)) . '</h1></header>';
2941 2941
 }
2942 2942
 
2943 2943
 // action for adding the listings page top widget area
@@ -2953,11 +2953,11 @@  discard block
 block discarded – undo
2953 2953
  */
2954 2954
 function geodir_action_geodir_sidebar_search_top()
2955 2955
 {
2956
-    if (get_option('geodir_show_search_top_section')) { ?>
2956
+	if (get_option('geodir_show_search_top_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_search_top'); ?>">
2959
+			/** This action is documented in geodirectory_template_actions.php */
2960
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_top'); ?>">
2961 2961
             <?php dynamic_sidebar('geodir_search_top'); ?>
2962 2962
         </div><!-- clearfix ends here-->
2963 2963
     <?php }
@@ -2973,7 +2973,7 @@  discard block
 block discarded – undo
2973 2973
  */
2974 2974
 function geodir_search_left_section()
2975 2975
 {
2976
-    if (get_option('geodir_show_search_left_section')) { ?>
2976
+	if (get_option('geodir_show_search_left_section')) { ?>
2977 2977
         <div class="geodir-content-left geodir-sidebar-wrap">
2978 2978
             <?php dynamic_sidebar('geodir_search_left_sidebar'); ?>
2979 2979
         </div><!-- end geodir-content-left -->
@@ -2993,19 +2993,19 @@  discard block
 block discarded – undo
2993 2993
  */
2994 2994
 function geodir_action_search_sidebar_left()
2995 2995
 {
2996
-    if (get_option('geodir_show_search_left_section')) {
2996
+	if (get_option('geodir_show_search_left_section')) {
2997 2997
 // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
2998
-        /** This action is documented in geodirectory_template_actions.php */
2999
-        do_action('geodir_sidebar_left_open', 'search-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3000
-        /**
3001
-         * This is used to add the content to the search page left sidebar (if active).
3002
-         *
3003
-         * @since 1.0.0
3004
-         */
3005
-        do_action('geodir_search_sidebar_left_inside');
3006
-        /** This action is documented in geodirectory_template_actions.php */
3007
-        do_action('geodir_sidebar_left_close', 'search-page');
3008
-    }
2998
+		/** This action is documented in geodirectory_template_actions.php */
2999
+		do_action('geodir_sidebar_left_open', 'search-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3000
+		/**
3001
+		 * This is used to add the content to the search page left sidebar (if active).
3002
+		 *
3003
+		 * @since 1.0.0
3004
+		 */
3005
+		do_action('geodir_search_sidebar_left_inside');
3006
+		/** This action is documented in geodirectory_template_actions.php */
3007
+		do_action('geodir_sidebar_left_close', 'search-page');
3008
+	}
3009 3009
 }
3010 3010
 
3011 3011
 /**
@@ -3018,7 +3018,7 @@  discard block
 block discarded – undo
3018 3018
  */
3019 3019
 function geodir_search_right_section()
3020 3020
 {
3021
-    if (get_option('geodir_show_search_right_section')) { ?>
3021
+	if (get_option('geodir_show_search_right_section')) { ?>
3022 3022
         <div class="geodir-content-right geodir-sidebar-wrap">
3023 3023
             <?php dynamic_sidebar('geodir_search_right_sidebar'); ?>
3024 3024
         </div><!-- end geodir-content-right -->
@@ -3038,18 +3038,18 @@  discard block
 block discarded – undo
3038 3038
  */
3039 3039
 function geodir_action_search_sidebar_right()
3040 3040
 {
3041
-    if (get_option('geodir_show_search_right_section')) {
3042
-        /** This action is documented in geodirectory_template_actions.php */
3043
-        do_action('geodir_sidebar_right_open', 'search-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3044
-        /**
3045
-         * This is used to add the content to the search page right sidebar (if active).
3046
-         *
3047
-         * @since 1.0.0
3048
-         */
3049
-        do_action('geodir_search_sidebar_right_inside');
3050
-        /** This action is documented in geodirectory_template_actions.php */
3051
-        do_action('geodir_sidebar_right_close', 'search-page');
3052
-    }
3041
+	if (get_option('geodir_show_search_right_section')) {
3042
+		/** This action is documented in geodirectory_template_actions.php */
3043
+		do_action('geodir_sidebar_right_open', 'search-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3044
+		/**
3045
+		 * This is used to add the content to the search page right sidebar (if active).
3046
+		 *
3047
+		 * @since 1.0.0
3048
+		 */
3049
+		do_action('geodir_search_sidebar_right_inside');
3050
+		/** This action is documented in geodirectory_template_actions.php */
3051
+		do_action('geodir_sidebar_right_close', 'search-page');
3052
+	}
3053 3053
 }
3054 3054
 
3055 3055
 
@@ -3064,11 +3064,11 @@  discard block
 block discarded – undo
3064 3064
  */
3065 3065
 function geodir_action_sidebar_search_bottom_section()
3066 3066
 {
3067
-    if (get_option('geodir_show_search_bottom_section')) { ?>
3067
+	if (get_option('geodir_show_search_bottom_section')) { ?>
3068 3068
         <div
3069 3069
             class="<?php
3070
-            /** This action is documented in geodirectory_template_actions.php */
3071
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_bottom'); ?>">
3070
+			/** This action is documented in geodirectory_template_actions.php */
3071
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_bottom'); ?>">
3072 3072
             <?php dynamic_sidebar('geodir_search_bottom'); ?>
3073 3073
         </div><!-- clearfix ends here-->
3074 3074
     <?php }
@@ -3083,14 +3083,14 @@  discard block
 block discarded – undo
3083 3083
  */
3084 3084
 function geodir_action_search_content_inside()
3085 3085
 {
3086
-    global $gridview_columns;
3087
-    $listing_view = get_option('geodir_search_view');
3088
-    if (strstr($listing_view, 'gridview')) {
3089
-        $gridview_columns = $listing_view;
3090
-        $listing_view_exp = explode('_', $listing_view);
3091
-        $listing_view = $listing_view_exp[0];
3092
-    }
3093
-    geodir_get_template_part('listing', 'listview');
3086
+	global $gridview_columns;
3087
+	$listing_view = get_option('geodir_search_view');
3088
+	if (strstr($listing_view, 'gridview')) {
3089
+		$gridview_columns = $listing_view;
3090
+		$listing_view_exp = explode('_', $listing_view);
3091
+		$listing_view = $listing_view_exp[0];
3092
+	}
3093
+	geodir_get_template_part('listing', 'listview');
3094 3094
 }
3095 3095
 
3096 3096
 add_action('geodir_search_content_inside', 'geodir_action_search_content_inside', 10);
@@ -3106,22 +3106,22 @@  discard block
 block discarded – undo
3106 3106
  */
3107 3107
 function geodir_action_search_content()
3108 3108
 {
3109
-    /** This action is documented in geodirectory_template_actions.php */
3110
-    do_action('geodir_main_content_open', 'search-page', 'geodir-main-content', 'search-page');
3111
-    echo '<div class="clearfix">';
3112
-    /** This action is documented in geodirectory_template_actions.php */
3113
-    do_action('geodir_before_listing');
3114
-    echo '</div>';
3115
-    /**
3116
-     * This is used to add the content to the search page main content.
3117
-     *
3118
-     * @since 1.0.0
3119
-     */
3120
-    do_action('geodir_search_content_inside');
3121
-    /** This action is documented in geodirectory_template_actions.php */
3122
-    do_action('geodir_after_listing');
3123
-    /** This action is documented in geodirectory_template_actions.php */
3124
-    do_action('geodir_main_content_close', 'search-page');
3109
+	/** This action is documented in geodirectory_template_actions.php */
3110
+	do_action('geodir_main_content_open', 'search-page', 'geodir-main-content', 'search-page');
3111
+	echo '<div class="clearfix">';
3112
+	/** This action is documented in geodirectory_template_actions.php */
3113
+	do_action('geodir_before_listing');
3114
+	echo '</div>';
3115
+	/**
3116
+	 * This is used to add the content to the search page main content.
3117
+	 *
3118
+	 * @since 1.0.0
3119
+	 */
3120
+	do_action('geodir_search_content_inside');
3121
+	/** This action is documented in geodirectory_template_actions.php */
3122
+	do_action('geodir_after_listing');
3123
+	/** This action is documented in geodirectory_template_actions.php */
3124
+	do_action('geodir_main_content_close', 'search-page');
3125 3125
 }
3126 3126
 
3127 3127
 ###############################################
@@ -3144,11 +3144,11 @@  discard block
 block discarded – undo
3144 3144
  */
3145 3145
 function geodir_action_geodir_sidebar_home_top()
3146 3146
 {
3147
-    if (get_option('geodir_show_home_top_section')) { ?>
3147
+	if (get_option('geodir_show_home_top_section')) { ?>
3148 3148
         <div
3149 3149
             class="<?php
3150
-            /** This action is documented in geodirectory_template_actions.php */
3151
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_top'); ?>">
3150
+			/** This action is documented in geodirectory_template_actions.php */
3151
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_top'); ?>">
3152 3152
             <?php dynamic_sidebar('geodir_home_top'); ?>
3153 3153
         </div><!-- clearfix ends here-->
3154 3154
     <?php }
@@ -3164,7 +3164,7 @@  discard block
 block discarded – undo
3164 3164
  */
3165 3165
 function geodir_home_left_section()
3166 3166
 {
3167
-    if (get_option('geodir_show_home_left_section')) { ?>
3167
+	if (get_option('geodir_show_home_left_section')) { ?>
3168 3168
         <div class="geodir-content-left geodir-sidebar-wrap">
3169 3169
             <?php dynamic_sidebar('geodir_home_left'); ?>
3170 3170
         </div><!-- end geodir-content-left -->
@@ -3186,19 +3186,19 @@  discard block
 block discarded – undo
3186 3186
  */
3187 3187
 function geodir_action_home_sidebar_left()
3188 3188
 {
3189
-    if (get_option('geodir_show_home_left_section')) {
3189
+	if (get_option('geodir_show_home_left_section')) {
3190 3190
 // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
3191
-        /** This action is documented in geodirectory_template_actions.php */
3192
-        do_action('geodir_sidebar_left_open', 'home-page', 'geodir-sidebar-left', 'geodir-sidebar geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3193
-        /**
3194
-         * This is used to add the content to the home page left sidebar (if active).
3195
-         *
3196
-         * @since 1.0.0
3197
-         */
3198
-        do_action('geodir_home_sidebar_left_inside');
3199
-        /** This action is documented in geodirectory_template_actions.php */
3200
-        do_action('geodir_sidebar_left_close', 'home-page');
3201
-    }
3191
+		/** This action is documented in geodirectory_template_actions.php */
3192
+		do_action('geodir_sidebar_left_open', 'home-page', 'geodir-sidebar-left', 'geodir-sidebar geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3193
+		/**
3194
+		 * This is used to add the content to the home page left sidebar (if active).
3195
+		 *
3196
+		 * @since 1.0.0
3197
+		 */
3198
+		do_action('geodir_home_sidebar_left_inside');
3199
+		/** This action is documented in geodirectory_template_actions.php */
3200
+		do_action('geodir_sidebar_left_close', 'home-page');
3201
+	}
3202 3202
 }
3203 3203
 
3204 3204
 /**
@@ -3211,7 +3211,7 @@  discard block
 block discarded – undo
3211 3211
  */
3212 3212
 function geodir_home_right_section()
3213 3213
 {
3214
-    if (get_option('geodir_show_home_right_section')) { ?>
3214
+	if (get_option('geodir_show_home_right_section')) { ?>
3215 3215
         <div class="geodir-content-right geodir-sidebar-wrap">
3216 3216
             <?php dynamic_sidebar('geodir_home_right'); ?>
3217 3217
         </div><!-- end geodir-content-right -->
@@ -3232,18 +3232,18 @@  discard block
 block discarded – undo
3232 3232
  */
3233 3233
 function geodir_action_home_sidebar_right()
3234 3234
 {
3235
-    if (get_option('geodir_show_home_right_section')) {
3236
-        /** This action is documented in geodirectory_template_actions.php */
3237
-        do_action('geodir_sidebar_right_open', 'home-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3238
-        /**
3239
-         * This is used to add the content to the home page right sidebar (if active).
3240
-         *
3241
-         * @since 1.0.0
3242
-         */
3243
-        do_action('geodir_home_sidebar_right_inside');
3244
-        /** This action is documented in geodirectory_template_actions.php */
3245
-        do_action('geodir_sidebar_right_close', 'home-page');
3246
-    }
3235
+	if (get_option('geodir_show_home_right_section')) {
3236
+		/** This action is documented in geodirectory_template_actions.php */
3237
+		do_action('geodir_sidebar_right_open', 'home-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3238
+		/**
3239
+		 * This is used to add the content to the home page right sidebar (if active).
3240
+		 *
3241
+		 * @since 1.0.0
3242
+		 */
3243
+		do_action('geodir_home_sidebar_right_inside');
3244
+		/** This action is documented in geodirectory_template_actions.php */
3245
+		do_action('geodir_sidebar_right_close', 'home-page');
3246
+	}
3247 3247
 }
3248 3248
 
3249 3249
 /**
@@ -3254,7 +3254,7 @@  discard block
 block discarded – undo
3254 3254
  */
3255 3255
 function geodir_action_home_content_inside()
3256 3256
 {
3257
-    dynamic_sidebar('geodir_home_content');
3257
+	dynamic_sidebar('geodir_home_content');
3258 3258
 }
3259 3259
 
3260 3260
 add_action('geodir_home_content_inside', 'geodir_action_home_content_inside', 10);
@@ -3269,28 +3269,28 @@  discard block
 block discarded – undo
3269 3269
  */
3270 3270
 function geodir_action_home_content()
3271 3271
 {
3272
-    /** This action is documented in geodirectory_template_actions.php */
3273
-    do_action('geodir_main_content_open', 'home-page', 'geodir-main-content', 'home-page');
3274
-    /**
3275
-     * This called before the home page main content.
3276
-     *
3277
-     * @since 1.0.0
3278
-     */
3279
-    do_action('geodir_before_home_content');
3280
-    /**
3281
-     * This is used to add the content to the home page main content.
3282
-     *
3283
-     * @since 1.0.0
3284
-     */
3285
-    do_action('geodir_home_content_inside');
3286
-    /**
3287
-     * This is called after the homepage main content.
3288
-     *
3289
-     * @since 1.0.0
3290
-     */
3291
-    do_action('geodir_after_home_content');
3292
-    /** This action is documented in geodirectory_template_actions.php */
3293
-    do_action('geodir_main_content_close', 'home-page');
3272
+	/** This action is documented in geodirectory_template_actions.php */
3273
+	do_action('geodir_main_content_open', 'home-page', 'geodir-main-content', 'home-page');
3274
+	/**
3275
+	 * This called before the home page main content.
3276
+	 *
3277
+	 * @since 1.0.0
3278
+	 */
3279
+	do_action('geodir_before_home_content');
3280
+	/**
3281
+	 * This is used to add the content to the home page main content.
3282
+	 *
3283
+	 * @since 1.0.0
3284
+	 */
3285
+	do_action('geodir_home_content_inside');
3286
+	/**
3287
+	 * This is called after the homepage main content.
3288
+	 *
3289
+	 * @since 1.0.0
3290
+	 */
3291
+	do_action('geodir_after_home_content');
3292
+	/** This action is documented in geodirectory_template_actions.php */
3293
+	do_action('geodir_main_content_close', 'home-page');
3294 3294
 }
3295 3295
 
3296 3296
 add_action('geodir_sidebar_location_bottom_section', 'geodir_action_sidebar_home_bottom_section', 10);
@@ -3305,11 +3305,11 @@  discard block
 block discarded – undo
3305 3305
  */
3306 3306
 function geodir_action_sidebar_home_bottom_section()
3307 3307
 {
3308
-    if (get_option('geodir_show_home_bottom_section')) { ?>
3308
+	if (get_option('geodir_show_home_bottom_section')) { ?>
3309 3309
         <div
3310 3310
             class="<?php
3311
-            /** This action is documented in geodirectory_template_actions.php */
3312
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_bottom'); ?>">
3311
+			/** This action is documented in geodirectory_template_actions.php */
3312
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_bottom'); ?>">
3313 3313
             <?php dynamic_sidebar('geodir_home_bottom'); ?>
3314 3314
         </div><!-- clearfix ends here-->
3315 3315
     <?php }
@@ -3337,13 +3337,13 @@  discard block
 block discarded – undo
3337 3337
  */
3338 3338
 function geodir_filter_listing_page_title($list_title)
3339 3339
 {
3340
-    if (is_search() && trim(get_search_query()) == '') {
3341
-        $gd_post_type = geodir_get_current_posttype();
3342
-        $post_type_info = get_post_type_object($gd_post_type);
3340
+	if (is_search() && trim(get_search_query()) == '') {
3341
+		$gd_post_type = geodir_get_current_posttype();
3342
+		$post_type_info = get_post_type_object($gd_post_type);
3343 3343
 
3344
-        $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' :', 'geodirectory');
3345
-    }
3346
-    return $list_title;
3344
+		$list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' :', 'geodirectory');
3345
+	}
3346
+	return $list_title;
3347 3347
 }
3348 3348
 
3349 3349
 add_action('geodir_message_not_found_on_listing', 'geodir_display_message_not_found_on_listing');
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   +498 added lines, -498 removed lines patch added patch discarded remove patch
@@ -16,10 +16,10 @@  discard block
 block discarded – undo
16 16
  */
17 17
 function geodir_session_start()
18 18
 {
19
-    if (!session_id()) session_start();
20
-    global $geodir_add_location_url;
19
+	if (!session_id()) session_start();
20
+	global $geodir_add_location_url;
21 21
 
22
-    $geodir_add_location_url = NULL;
22
+	$geodir_add_location_url = NULL;
23 23
 }
24 24
 
25 25
 /**
@@ -33,18 +33,18 @@  discard block
 block discarded – undo
33 33
  */
34 34
 function geodir_modified_query($query)
35 35
 {
36
-    if ($query->is_main_query() && (
37
-            (geodir_is_page('add-listing') && isset($_REQUEST['pid']) && $_REQUEST['pid'] != '')
38
-            || geodir_is_page('listing')
39
-            || geodir_is_page('author')
40
-            || geodir_is_page('search')
41
-            || geodir_is_page('detail'))
42
-    ) {
43
-
44
-        $query->set('is_geodir_loop', true);
45
-    }
36
+	if ($query->is_main_query() && (
37
+			(geodir_is_page('add-listing') && isset($_REQUEST['pid']) && $_REQUEST['pid'] != '')
38
+			|| geodir_is_page('listing')
39
+			|| geodir_is_page('author')
40
+			|| geodir_is_page('search')
41
+			|| geodir_is_page('detail'))
42
+	) {
43
+
44
+		$query->set('is_geodir_loop', true);
45
+	}
46 46
 
47
-    return $query;
47
+	return $query;
48 48
 }
49 49
 
50 50
 /**
@@ -67,81 +67,81 @@  discard block
 block discarded – undo
67 67
  */
68 68
 function set_listing_request()
69 69
 {
70
-    global $wp_query, $wpdb, $geodir_post_type, $table, $dist, $mylat, $mylon, $s, $snear, $s, $s_A, $s_SA;
70
+	global $wp_query, $wpdb, $geodir_post_type, $table, $dist, $mylat, $mylon, $s, $snear, $s, $s_A, $s_SA;
71 71
 
72 72
 
73
-    // fix woocommerce shop products filtered by language for GD + WPML + Woocommerce
74
-    if (!geodir_is_geodir_page()) {
75
-        return;
76
-    }
73
+	// fix woocommerce shop products filtered by language for GD + WPML + Woocommerce
74
+	if (!geodir_is_geodir_page()) {
75
+		return;
76
+	}
77 77
 
78
-    /* remove all pre filters */
79
-    remove_all_filters('query');
80
-    remove_all_filters('posts_search');
81
-    remove_all_filters('posts_fields');
82
-    remove_all_filters('posts_join');
83
-    remove_all_filters('posts_orderby');
84
-    remove_all_filters('posts_where');
78
+	/* remove all pre filters */
79
+	remove_all_filters('query');
80
+	remove_all_filters('posts_search');
81
+	remove_all_filters('posts_fields');
82
+	remove_all_filters('posts_join');
83
+	remove_all_filters('posts_orderby');
84
+	remove_all_filters('posts_where');
85 85
 
86 86
 
87
-    if ((is_search() && isset($_REQUEST['geodir_search']) && $_REQUEST['geodir_search'] != '')):
87
+	if ((is_search() && isset($_REQUEST['geodir_search']) && $_REQUEST['geodir_search'] != '')):
88 88
 
89
-        if (isset($_REQUEST['scat']) && $_REQUEST['scat'] == 'all') $_REQUEST['scat'] = '';
90
-        //if(isset($_REQUEST['s']) && $_REQUEST['s'] == '+') $_REQUEST['s'] = '';
89
+		if (isset($_REQUEST['scat']) && $_REQUEST['scat'] == 'all') $_REQUEST['scat'] = '';
90
+		//if(isset($_REQUEST['s']) && $_REQUEST['s'] == '+') $_REQUEST['s'] = '';
91 91
 
92
-        if (isset($_REQUEST['sdist'])) {
93
-            ($_REQUEST['sdist'] != '0' && $_REQUEST['sdist'] != '') ? $dist = esc_attr($_REQUEST['sdist']) : $dist = 25000;
94
-        } elseif (get_option('geodir_search_dist') != '') {
95
-            $dist = get_option('geodir_search_dist');
92
+		if (isset($_REQUEST['sdist'])) {
93
+			($_REQUEST['sdist'] != '0' && $_REQUEST['sdist'] != '') ? $dist = esc_attr($_REQUEST['sdist']) : $dist = 25000;
94
+		} elseif (get_option('geodir_search_dist') != '') {
95
+			$dist = get_option('geodir_search_dist');
96 96
 
97
-        } else {
98
-            $dist = 25000;
99
-        } //  Distance
97
+		} else {
98
+			$dist = 25000;
99
+		} //  Distance
100 100
 
101
-        if (isset($_REQUEST['sgeo_lat'])) {
102
-            $mylat = (float)esc_attr($_REQUEST['sgeo_lat']);
103
-        } else {
104
-            $mylat = (float)geodir_get_current_city_lat();
105
-        } //  Latatude
101
+		if (isset($_REQUEST['sgeo_lat'])) {
102
+			$mylat = (float)esc_attr($_REQUEST['sgeo_lat']);
103
+		} else {
104
+			$mylat = (float)geodir_get_current_city_lat();
105
+		} //  Latatude
106 106
 
107
-        if (isset($_REQUEST['sgeo_lon'])) {
108
-            $mylon = (float)esc_attr($_REQUEST['sgeo_lon']);
109
-        } else {
110
-            $mylon = (float)geodir_get_current_city_lng();
111
-        } //  Distance
107
+		if (isset($_REQUEST['sgeo_lon'])) {
108
+			$mylon = (float)esc_attr($_REQUEST['sgeo_lon']);
109
+		} else {
110
+			$mylon = (float)geodir_get_current_city_lng();
111
+		} //  Distance
112 112
 
113
-        if (isset($_REQUEST['snear'])) {
114
-            $snear = trim(esc_attr($_REQUEST['snear']));
115
-        }
113
+		if (isset($_REQUEST['snear'])) {
114
+			$snear = trim(esc_attr($_REQUEST['snear']));
115
+		}
116 116
 
117
-        if (isset($_REQUEST['s'])) {
118
-            $s = trim(esc_attr(wp_strip_all_tags($_REQUEST['s'])));
119
-        }
117
+		if (isset($_REQUEST['s'])) {
118
+			$s = trim(esc_attr(wp_strip_all_tags($_REQUEST['s'])));
119
+		}
120 120
 
121
-        if ($snear == 'NEAR ME') {
122
-            $ip = $_SERVER['REMOTE_ADDR'];
123
-            $addr_details = unserialize(file_get_contents('http://www.geoplugin.net/php.gp?ip=' . $ip));
124
-            $mylat = stripslashes(ucfirst($addr_details[geoplugin_latitude]));
125
-            $mylon = stripslashes(ucfirst($addr_details[geoplugin_longitude]));
126
-        }
121
+		if ($snear == 'NEAR ME') {
122
+			$ip = $_SERVER['REMOTE_ADDR'];
123
+			$addr_details = unserialize(file_get_contents('http://www.geoplugin.net/php.gp?ip=' . $ip));
124
+			$mylat = stripslashes(ucfirst($addr_details[geoplugin_latitude]));
125
+			$mylon = stripslashes(ucfirst($addr_details[geoplugin_longitude]));
126
+		}
127 127
 
128 128
 
129
-        if (strstr($s, ',')) {
130
-            $s_AA = str_replace(" ", "", $s);
131
-            $s_A = explode(",", $s_AA);
132
-            $s_A = implode('","', $s_A);
133
-            $s_A = '"' . $s_A . '"';
134
-        } else {
135
-            $s_A = '"' . $s . '"';
136
-        }
129
+		if (strstr($s, ',')) {
130
+			$s_AA = str_replace(" ", "", $s);
131
+			$s_A = explode(",", $s_AA);
132
+			$s_A = implode('","', $s_A);
133
+			$s_A = '"' . $s_A . '"';
134
+		} else {
135
+			$s_A = '"' . $s . '"';
136
+		}
137 137
 
138
-        if (strstr($s, ' ')) {
139
-            $s_SA = explode(" ", $s);
140
-        } else {
141
-            $s_SA = '';
142
-        }
138
+		if (strstr($s, ' ')) {
139
+			$s_SA = explode(" ", $s);
140
+		} else {
141
+			$s_SA = '';
142
+		}
143 143
 
144
-    endif;
144
+	endif;
145 145
 
146 146
 
147 147
 
@@ -162,56 +162,56 @@  discard block
 block discarded – undo
162 162
  */
163 163
 function geodir_listing_loop_filter($query)
164 164
 {
165
-    global $wp_query, $geodir_post_type, $table, $plugin_prefix, $table, $term;
165
+	global $wp_query, $geodir_post_type, $table, $plugin_prefix, $table, $term;
166 166
 
167
-    // fix wp_reset_query for popular post view widget
168
-    if (!geodir_is_geodir_page()) {
169
-        return;
170
-    }
167
+	// fix wp_reset_query for popular post view widget
168
+	if (!geodir_is_geodir_page()) {
169
+		return;
170
+	}
171 171
 
172
-    $geodir_post_type = geodir_get_current_posttype();
173
-
174
-    if (isset($wp_query->tax_query->queries) && $wp_query->tax_query->queries) {
175
-        $taxonomies = wp_list_pluck($wp_query->tax_query->queries, 'taxonomy');
176
-
177
-        if (isset($wp_query->query[$taxonomies[0]])) {
178
-            $request_term = explode("/", $wp_query->query[$taxonomies[0]]);
179
-            $request_term = end($request_term);
180
-            if (!term_exists($request_term)) {
181
-                $args = array('number' => '1',);
182
-                $terms_arr = get_terms($taxonomies[0], $args);
183
-                foreach ($terms_arr as $location_term) {
184
-                    $term_arr = $location_term;
185
-                    $term_arr->name = geodir_ucwords(str_replace('-', ' ', $request_term));
186
-                }
187
-                $wp_query->queried_object_id = 1;
188
-                $wp_query->queried_object = $term_arr;
189
-                //print_r($wp_query) ;
190
-            }
191
-        }
172
+	$geodir_post_type = geodir_get_current_posttype();
173
+
174
+	if (isset($wp_query->tax_query->queries) && $wp_query->tax_query->queries) {
175
+		$taxonomies = wp_list_pluck($wp_query->tax_query->queries, 'taxonomy');
176
+
177
+		if (isset($wp_query->query[$taxonomies[0]])) {
178
+			$request_term = explode("/", $wp_query->query[$taxonomies[0]]);
179
+			$request_term = end($request_term);
180
+			if (!term_exists($request_term)) {
181
+				$args = array('number' => '1',);
182
+				$terms_arr = get_terms($taxonomies[0], $args);
183
+				foreach ($terms_arr as $location_term) {
184
+					$term_arr = $location_term;
185
+					$term_arr->name = geodir_ucwords(str_replace('-', ' ', $request_term));
186
+				}
187
+				$wp_query->queried_object_id = 1;
188
+				$wp_query->queried_object = $term_arr;
189
+				//print_r($wp_query) ;
190
+			}
191
+		}
192 192
 
193
-    }
194
-    if (isset($query->query_vars['is_geodir_loop']) && $query->query_vars['is_geodir_loop']) {
195
-
196
-        $table = $plugin_prefix . $geodir_post_type . '_detail';
197
-
198
-        add_filter('posts_fields', 'geodir_posts_fields', 1);
199
-        add_filter('posts_join', 'geodir_posts_join', 1);
200
-        geodir_post_where();
201
-        if (!is_admin())
202
-            add_filter('posts_orderby', 'geodir_posts_orderby', 1);
203
-
204
-        // advanced filter for popular post view widget
205
-        global $wp_query;
206
-        if (!is_admin()) {
207
-            if (!empty($wp_query->query['with_pics_only'])) {
208
-                add_filter('posts_join', 'geodir_filter_widget_join', 1000);
209
-            }
210
-            add_filter('posts_where', 'geodir_filter_widget_where', 1000);
211
-        }
193
+	}
194
+	if (isset($query->query_vars['is_geodir_loop']) && $query->query_vars['is_geodir_loop']) {
212 195
 
213
-    }
214
-    return $query;
196
+		$table = $plugin_prefix . $geodir_post_type . '_detail';
197
+
198
+		add_filter('posts_fields', 'geodir_posts_fields', 1);
199
+		add_filter('posts_join', 'geodir_posts_join', 1);
200
+		geodir_post_where();
201
+		if (!is_admin())
202
+			add_filter('posts_orderby', 'geodir_posts_orderby', 1);
203
+
204
+		// advanced filter for popular post view widget
205
+		global $wp_query;
206
+		if (!is_admin()) {
207
+			if (!empty($wp_query->query['with_pics_only'])) {
208
+				add_filter('posts_join', 'geodir_filter_widget_join', 1000);
209
+			}
210
+			add_filter('posts_where', 'geodir_filter_widget_where', 1000);
211
+		}
212
+
213
+	}
214
+	return $query;
215 215
 }
216 216
 
217 217
 
@@ -230,67 +230,67 @@  discard block
 block discarded – undo
230 230
  * @return string Modified fields query string.
231 231
  */
232 232
 function geodir_posts_fields($fields) {
233
-    global $wp_query, $wpdb, $geodir_post_type, $table, $plugin_prefix, $dist, $mylat, $mylon, $snear, $gd_session;
233
+	global $wp_query, $wpdb, $geodir_post_type, $table, $plugin_prefix, $dist, $mylat, $mylon, $snear, $gd_session;
234 234
 
235
-    // Filter-Location-Manager to add location table.
236
-    $fields .= ", " . $table . ".* ";
235
+	// Filter-Location-Manager to add location table.
236
+	$fields .= ", " . $table . ".* ";
237 237
     
238 238
 	if ($snear != '' || $gd_session->get('all_near_me')) {
239
-        $DistanceRadius = geodir_getDistanceRadius(get_option('geodir_search_dist_1'));
239
+		$DistanceRadius = geodir_getDistanceRadius(get_option('geodir_search_dist_1'));
240 240
         
241 241
 		if ($gd_session->get('all_near_me')) {
242
-            $mylat = $gd_session->get('user_lat');
243
-            $mylon = $gd_session->get('user_lon');
244
-        }
245
-
246
-        $fields .= " , (" . $DistanceRadius . " * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(" . $table . ".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(" . $table . ".post_latitude) * pi()/180) *POWER(SIN(($mylon - " . $table . ".post_longitude) * pi()/180 / 2), 2) )))as distance ";
247
-    }
248
-
249
-    global $s;
250
-    if (is_search() && isset($_REQUEST['geodir_search']) && $s && trim($s) != '') {
251
-        $keywords = explode(" ", $s);
252
-
253
-        if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
254
-            foreach($keywords as $kkey=>$kword){
255
-                if(mb_strlen($kword, 'UTF-8')<=$klimit){
256
-                    unset($keywords[$kkey]);
257
-                }
258
-            }
259
-        }
242
+			$mylat = $gd_session->get('user_lat');
243
+			$mylon = $gd_session->get('user_lon');
244
+		}
260 245
 
246
+		$fields .= " , (" . $DistanceRadius . " * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(" . $table . ".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(" . $table . ".post_latitude) * pi()/180) *POWER(SIN(($mylon - " . $table . ".post_longitude) * pi()/180 / 2), 2) )))as distance ";
247
+	}
261 248
 
262
-        if (count($keywords) > 1) {
263
-            $parts = array(
264
-                'AND' => 'gd_alltitlematch_part',
265
-                'OR' => 'gd_titlematch_part'
266
-            );
267
-            $gd_titlematch_part = "";
268
-            foreach ($parts as $key => $part) {
269
-                $gd_titlematch_part .= " CASE WHEN ";
270
-                $count = 0;
271
-                foreach ($keywords as $keyword) {
272
-                    $keyword = trim($keyword);
273
-                    $keyword  = wp_specialchars_decode($keyword ,ENT_QUOTES);
249
+	global $s;
250
+	if (is_search() && isset($_REQUEST['geodir_search']) && $s && trim($s) != '') {
251
+		$keywords = explode(" ", $s);
252
+
253
+		if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
254
+			foreach($keywords as $kkey=>$kword){
255
+				if(mb_strlen($kword, 'UTF-8')<=$klimit){
256
+					unset($keywords[$kkey]);
257
+				}
258
+			}
259
+		}
260
+
261
+
262
+		if (count($keywords) > 1) {
263
+			$parts = array(
264
+				'AND' => 'gd_alltitlematch_part',
265
+				'OR' => 'gd_titlematch_part'
266
+			);
267
+			$gd_titlematch_part = "";
268
+			foreach ($parts as $key => $part) {
269
+				$gd_titlematch_part .= " CASE WHEN ";
270
+				$count = 0;
271
+				foreach ($keywords as $keyword) {
272
+					$keyword = trim($keyword);
273
+					$keyword  = wp_specialchars_decode($keyword ,ENT_QUOTES);
274 274
 					$count++;
275
-                    if ($count < count($keywords)) {
276
-                       // $gd_titlematch_part .= $wpdb->posts . ".post_title LIKE '%%" . $keyword . "%%' " . $key . " ";
275
+					if ($count < count($keywords)) {
276
+					   // $gd_titlematch_part .= $wpdb->posts . ".post_title LIKE '%%" . $keyword . "%%' " . $key . " ";
277 277
 						$gd_titlematch_part .= "( " . $wpdb->posts . ".post_title LIKE '" . $keyword . "' OR " . $wpdb->posts . ".post_title LIKE '" . $keyword . "%%' OR " . $wpdb->posts . ".post_title LIKE '%% " . $keyword . "%%' ) " . $key . " ";
278
-                    } else {
279
-                        //$gd_titlematch_part .= $wpdb->posts . ".post_title LIKE '%%" . $keyword . "%%' ";
278
+					} else {
279
+						//$gd_titlematch_part .= $wpdb->posts . ".post_title LIKE '%%" . $keyword . "%%' ";
280 280
 						$gd_titlematch_part .= "( " . $wpdb->posts . ".post_title LIKE '" . $keyword . "' OR " . $wpdb->posts . ".post_title LIKE '" . $keyword . "%%' OR " . $wpdb->posts . ".post_title LIKE '%% " . $keyword . "%%' ) ";
281
-                    }
282
-                }
283
-                $gd_titlematch_part .= "THEN 1 ELSE 0 END AS " . $part . ",";
284
-            }
285
-        } else {
286
-            $gd_titlematch_part = "";
287
-        }
288
-        $s = stripslashes_deep( $s );
289
-        $s = wp_specialchars_decode($s,ENT_QUOTES);
281
+					}
282
+				}
283
+				$gd_titlematch_part .= "THEN 1 ELSE 0 END AS " . $part . ",";
284
+			}
285
+		} else {
286
+			$gd_titlematch_part = "";
287
+		}
288
+		$s = stripslashes_deep( $s );
289
+		$s = wp_specialchars_decode($s,ENT_QUOTES);
290 290
 		$fields .= $wpdb->prepare(", CASE WHEN " . $table . ".is_featured='1' THEN 1 ELSE 0 END AS gd_featured, CASE WHEN " . $wpdb->posts . ".post_title LIKE %s THEN 1 ELSE 0 END AS gd_exacttitle," . $gd_titlematch_part . " CASE WHEN ( " . $wpdb->posts . ".post_title LIKE %s OR " . $wpdb->posts . ".post_title LIKE %s OR " . $wpdb->posts . ".post_title LIKE %s ) THEN 1 ELSE 0 END AS gd_titlematch, CASE WHEN ( " . $wpdb->posts . ".post_content LIKE %s OR " . $wpdb->posts . ".post_content LIKE %s OR " . $wpdb->posts . ".post_content LIKE %s OR " . $wpdb->posts . ".post_content LIKE %s ) THEN 1 ELSE 0 END AS gd_content", array($s, $s, $s . '%', '% ' . $s . '%', $s, $s . ' %', '% ' . $s . ' %', '% ' . $s));
291
-    }
291
+	}
292 292
 
293
-    return $fields;
293
+	return $fields;
294 294
 }
295 295
 
296 296
 
@@ -307,26 +307,26 @@  discard block
 block discarded – undo
307 307
  */
308 308
 function geodir_posts_join($join)
309 309
 {
310
-    global $wpdb, $geodir_post_type, $table, $table_prefix, $plugin_prefix;
310
+	global $wpdb, $geodir_post_type, $table, $table_prefix, $plugin_prefix;
311 311
 
312
-    ########### WPML ###########
312
+	########### WPML ###########
313 313
 
314
-    if (function_exists('icl_object_id')) {
315
-        global $sitepress;
316
-        $lang_code = ICL_LANGUAGE_CODE;
317
-        $default_lang_code = $sitepress->get_default_language();
318
-        if ($lang_code) {
319
-            $join .= "JOIN " . $table_prefix . "icl_translations icl_t ON icl_t.element_id = " . $table_prefix . "posts.ID";
320
-        }
314
+	if (function_exists('icl_object_id')) {
315
+		global $sitepress;
316
+		$lang_code = ICL_LANGUAGE_CODE;
317
+		$default_lang_code = $sitepress->get_default_language();
318
+		if ($lang_code) {
319
+			$join .= "JOIN " . $table_prefix . "icl_translations icl_t ON icl_t.element_id = " . $table_prefix . "posts.ID";
320
+		}
321 321
 
322
-    }
323
-    ########### WPML ###########
322
+	}
323
+	########### WPML ###########
324 324
 
325
-    $join .= " INNER JOIN " . $table . " ON (" . $table . ".post_id = $wpdb->posts.ID)  ";
326
-    //===old code start
327
-    //$join .= " INNER JOIN ".POST_LOCATION_TABLE." ON (".$table.".post_location_id = ".POST_LOCATION_TABLE.".location_id)  " ;//===old code end
325
+	$join .= " INNER JOIN " . $table . " ON (" . $table . ".post_id = $wpdb->posts.ID)  ";
326
+	//===old code start
327
+	//$join .= " INNER JOIN ".POST_LOCATION_TABLE." ON (".$table.".post_location_id = ".POST_LOCATION_TABLE.".location_id)  " ;//===old code end
328 328
 
329
-    return $join;
329
+	return $join;
330 330
 }
331 331
 
332 332
 
@@ -344,15 +344,15 @@  discard block
 block discarded – undo
344 344
  */
345 345
 function geodir_posts_orderby($orderby)
346 346
 {
347
-    global $wpdb, $wp_query, $geodir_post_type, $table, $plugin_prefix, $snear, $default_sort;
347
+	global $wpdb, $wp_query, $geodir_post_type, $table, $plugin_prefix, $snear, $default_sort;
348 348
 
349
-    $sort_by = '';
350
-    $orderby = ' ';
349
+	$sort_by = '';
350
+	$orderby = ' ';
351 351
 
352
-    if (get_query_var('order_by'))
353
-        $sort_by = get_query_var('order_by');
352
+	if (get_query_var('order_by'))
353
+		$sort_by = get_query_var('order_by');
354 354
 
355
-    /*if(isset($wp_query->tax_query->queries) && $wp_query->tax_query->queries){
355
+	/*if(isset($wp_query->tax_query->queries) && $wp_query->tax_query->queries){
356 356
         $current_term = $wp_query->get_queried_object();
357 357
     }
358 358
 
@@ -366,116 +366,116 @@  discard block
 block discarded – undo
366 366
     }*/
367 367
 
368 368
 
369
-    if ($snear != '') {
370
-        $orderby .= " distance,";
371
-    }
369
+	if ($snear != '') {
370
+		$orderby .= " distance,";
371
+	}
372 372
 
373
-    if (isset($_REQUEST['sort_by']) && $_REQUEST['sort_by'] != '' && is_main_query())
374
-        $sort_by = esc_attr($_REQUEST['sort_by']);
373
+	if (isset($_REQUEST['sort_by']) && $_REQUEST['sort_by'] != '' && is_main_query())
374
+		$sort_by = esc_attr($_REQUEST['sort_by']);
375 375
 
376 376
 
377
-    if ($sort_by == '') {
378
-        $default_sort = geodir_get_posts_default_sort($geodir_post_type);
379
-        if (!empty($default_sort))
380
-            $sort_by = $default_sort;
381
-    }
377
+	if ($sort_by == '') {
378
+		$default_sort = geodir_get_posts_default_sort($geodir_post_type);
379
+		if (!empty($default_sort))
380
+			$sort_by = $default_sort;
381
+	}
382 382
 
383
-    /*
383
+	/*
384 384
     if search by term & no location then order always "relevance"
385 385
     if search by location then order always "nearest"
386 386
     */
387
-    if (is_main_query() && geodir_is_page('search')) {
388
-        $search_term = get_query_var('s');
387
+	if (is_main_query() && geodir_is_page('search')) {
388
+		$search_term = get_query_var('s');
389 389
 
390
-        if (trim($search_term) != '' && !isset($_REQUEST['sort_by'])) {
391
-            $sort_by = 'az';
392
-        }
390
+		if (trim($search_term) != '' && !isset($_REQUEST['sort_by'])) {
391
+			$sort_by = 'az';
392
+		}
393 393
 
394
-        if ($snear != '') {
395
-            $sort_by = 'nearest';
396
-        }
397
-    }
394
+		if ($snear != '') {
395
+			$sort_by = 'nearest';
396
+		}
397
+	}
398 398
 
399
-    switch ($sort_by):
400
-        case 'newest':
401
-            $orderby = "$wpdb->posts.post_date desc, ";
402
-            break;
403
-        case 'oldest':
404
-            $orderby = "$wpdb->posts.post_date asc, ";
405
-            break;
406
-        case 'low_review':
407
-        case 'rating_count_asc':
408
-            $orderby = $table . ".rating_count ASC, " . $table . ".overall_rating ASC, ";
409
-            break;
410
-        case 'high_review':
411
-        case 'rating_count_desc':
399
+	switch ($sort_by):
400
+		case 'newest':
401
+			$orderby = "$wpdb->posts.post_date desc, ";
402
+			break;
403
+		case 'oldest':
404
+			$orderby = "$wpdb->posts.post_date asc, ";
405
+			break;
406
+		case 'low_review':
407
+		case 'rating_count_asc':
408
+			$orderby = $table . ".rating_count ASC, " . $table . ".overall_rating ASC, ";
409
+			break;
410
+		case 'high_review':
411
+		case 'rating_count_desc':
412 412
 			$orderby = $table . ".rating_count DESC, " . $table . ".overall_rating DESC, ";
413
-            break;
414
-        case 'low_rating':
415
-            $orderby = "( " . $table . ".overall_rating  ) ASC, " . $table . ".rating_count ASC,  ";
416
-            break;
417
-        case 'high_rating':
418
-            $orderby = " " . $table . ".overall_rating DESC, " . $table . ".rating_count DESC, ";
419
-            break;
420
-        case 'featured':
421
-            $orderby = $table . ".is_featured asc, ";
422
-            break;
423
-        case 'nearest':
424
-            $orderby = " distance asc, ";
425
-            break;
426
-        case 'farthest':
427
-            $orderby = " distance desc, ";
428
-            break;
429
-        case 'random':
430
-            $orderby = " rand(), ";
431
-            break;
432
-        case 'az':
433
-            $orderby = "$wpdb->posts.post_title asc, ";
434
-            break;
435
-        default:
436
-
437
-            break;
438
-    endswitch;
439
-
440
-    global $s;
441
-
442
-    if (is_search() && isset($_REQUEST['geodir_search']) && $s && trim($s) != '') {
443
-        $keywords = explode(" ", $s);
444
-        if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
445
-            foreach($keywords as $kkey=>$kword){
446
-                if(mb_strlen($kword, 'UTF-8')<=$klimit){
447
-                    unset($keywords[$kkey]);
448
-                }
449
-            }
450
-        }
451
-        if ($sort_by == 'nearest' || $sort_by == 'farthest') {
452
-            if (count($keywords) > 1) {
453
-                $orderby = $orderby . " ( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_alltitlematch_part * 100 + gd_titlematch_part * 50 + gd_content * 1.5) DESC, ";
454
-            } else {
455
-                $orderby = $orderby . " ( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_content * 1.5) DESC, ";
456
-            }
457
-        } else {
458
-            if (count($keywords) > 1) {
459
-                $orderby = "( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_alltitlematch_part * 100 + gd_titlematch_part * 50 + gd_content * 1.5) DESC, " . $orderby;
460
-            } else {
461
-                $orderby = "( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_content * 1.5) DESC, " . $orderby;
462
-            }
463
-        }
464
-    }
413
+			break;
414
+		case 'low_rating':
415
+			$orderby = "( " . $table . ".overall_rating  ) ASC, " . $table . ".rating_count ASC,  ";
416
+			break;
417
+		case 'high_rating':
418
+			$orderby = " " . $table . ".overall_rating DESC, " . $table . ".rating_count DESC, ";
419
+			break;
420
+		case 'featured':
421
+			$orderby = $table . ".is_featured asc, ";
422
+			break;
423
+		case 'nearest':
424
+			$orderby = " distance asc, ";
425
+			break;
426
+		case 'farthest':
427
+			$orderby = " distance desc, ";
428
+			break;
429
+		case 'random':
430
+			$orderby = " rand(), ";
431
+			break;
432
+		case 'az':
433
+			$orderby = "$wpdb->posts.post_title asc, ";
434
+			break;
435
+		default:
436
+
437
+			break;
438
+	endswitch;
439
+
440
+	global $s;
441
+
442
+	if (is_search() && isset($_REQUEST['geodir_search']) && $s && trim($s) != '') {
443
+		$keywords = explode(" ", $s);
444
+		if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
445
+			foreach($keywords as $kkey=>$kword){
446
+				if(mb_strlen($kword, 'UTF-8')<=$klimit){
447
+					unset($keywords[$kkey]);
448
+				}
449
+			}
450
+		}
451
+		if ($sort_by == 'nearest' || $sort_by == 'farthest') {
452
+			if (count($keywords) > 1) {
453
+				$orderby = $orderby . " ( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_alltitlematch_part * 100 + gd_titlematch_part * 50 + gd_content * 1.5) DESC, ";
454
+			} else {
455
+				$orderby = $orderby . " ( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_content * 1.5) DESC, ";
456
+			}
457
+		} else {
458
+			if (count($keywords) > 1) {
459
+				$orderby = "( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_alltitlematch_part * 100 + gd_titlematch_part * 50 + gd_content * 1.5) DESC, " . $orderby;
460
+			} else {
461
+				$orderby = "( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_content * 1.5) DESC, " . $orderby;
462
+			}
463
+		}
464
+	}
465 465
 
466
-    /**
467
-     * Filter order by SQL.
468
-     *
469
-     * @since 1.0.0
470
-     * @param string $orderby The orderby query string.
471
-     * @param string $sort_by Sortby query string.
472
-     * @param string $table Listing table name.
473
-     */
474
-    $orderby = apply_filters('geodir_posts_order_by_sort', $orderby, $sort_by, $table);
466
+	/**
467
+	 * Filter order by SQL.
468
+	 *
469
+	 * @since 1.0.0
470
+	 * @param string $orderby The orderby query string.
471
+	 * @param string $sort_by Sortby query string.
472
+	 * @param string $table Listing table name.
473
+	 */
474
+	$orderby = apply_filters('geodir_posts_order_by_sort', $orderby, $sort_by, $table);
475 475
 
476
-    $orderby .= $table . ".is_featured asc, $wpdb->posts.post_date desc, $wpdb->posts.post_title ";
476
+	$orderby .= $table . ".is_featured asc, $wpdb->posts.post_date desc, $wpdb->posts.post_title ";
477 477
 
478
-    return $orderby;
478
+	return $orderby;
479 479
 }
480 480
 
481 481
 
@@ -493,53 +493,53 @@  discard block
 block discarded – undo
493 493
 function geodir_posts_order_by_custom_sort($orderby, $sort_by, $table)
494 494
 {
495 495
 
496
-    global $wpdb;
496
+	global $wpdb;
497 497
 
498
-    if ($sort_by != '' && !is_search()) {
498
+	if ($sort_by != '' && !is_search()) {
499 499
 
500
-        $sort_array = explode('_', $sort_by);
500
+		$sort_array = explode('_', $sort_by);
501 501
 
502
-        $sort_by_count = count($sort_array);
502
+		$sort_by_count = count($sort_array);
503 503
 
504
-        $order = $sort_array[$sort_by_count - 1];
504
+		$order = $sort_array[$sort_by_count - 1];
505 505
 
506
-        if ($sort_by_count > 1 && ($order == 'asc' || $order == 'desc')) {
506
+		if ($sort_by_count > 1 && ($order == 'asc' || $order == 'desc')) {
507 507
 
508
-            $sort_by = str_replace('_' . $order, '', $sort_by);
508
+			$sort_by = str_replace('_' . $order, '', $sort_by);
509 509
 
510
-            switch ($sort_by):
510
+			switch ($sort_by):
511 511
 
512
-                case 'post_date':
513
-                case 'comment_count':
512
+				case 'post_date':
513
+				case 'comment_count':
514 514
 
515
-                    $orderby = "$wpdb->posts." . $sort_by . " " . $order . ", ".$table . ".overall_rating " . $order . ", ";
516
-                    break;
515
+					$orderby = "$wpdb->posts." . $sort_by . " " . $order . ", ".$table . ".overall_rating " . $order . ", ";
516
+					break;
517 517
 
518
-                case 'distance':
519
-                    $orderby = $sort_by . " " . $order . ", ";
520
-                    break;
518
+				case 'distance':
519
+					$orderby = $sort_by . " " . $order . ", ";
520
+					break;
521 521
 
522 522
 
523
-                // sort by rating
524
-                case 'overall_rating':
525
-                    $orderby = " " . $table . "." . $sort_by . "  " . $order . ", " . $table . ".rating_count " . $order . ", ";
523
+				// sort by rating
524
+				case 'overall_rating':
525
+					$orderby = " " . $table . "." . $sort_by . "  " . $order . ", " . $table . ".rating_count " . $order . ", ";
526 526
 
527
-                    break;
527
+					break;
528 528
 
529 529
 
530
-                default:
531
-                    if (geodir_column_exist($table, $sort_by)) {
530
+				default:
531
+					if (geodir_column_exist($table, $sort_by)) {
532 532
 						$orderby = $table . "." . $sort_by . " " . $order . ", ";
533 533
 					}
534
-                    break;
534
+					break;
535 535
 
536
-            endswitch;
536
+			endswitch;
537 537
 
538
-        }
538
+		}
539 539
 
540
-    }
540
+	}
541 541
 
542
-    return $orderby;
542
+	return $orderby;
543 543
 }
544 544
 
545 545
 /**
@@ -554,34 +554,34 @@  discard block
 block discarded – undo
554 554
 {
555 555
 
556 556
 
557
-    global $wpdb, $geodir_post_type, $table, $s, $snear;
557
+	global $wpdb, $geodir_post_type, $table, $s, $snear;
558 558
 
559
-    if (!is_admin()) {
559
+	if (!is_admin()) {
560 560
 
561
-        if (geodir_is_page('add-listing') && isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
562
-            add_filter('posts_where', 'geodir_edit_listing_where', 1);
561
+		if (geodir_is_page('add-listing') && isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
562
+			add_filter('posts_where', 'geodir_edit_listing_where', 1);
563 563
 
564
-        } elseif ((is_search() && $_REQUEST['geodir_search'])) {
564
+		} elseif ((is_search() && $_REQUEST['geodir_search'])) {
565 565
 
566
-            add_filter('posts_where', 'searching_filter_where', 1);
566
+			add_filter('posts_where', 'searching_filter_where', 1);
567 567
 
568
-            if ($snear != '')
569
-                add_filter('posts_where', 'searching_filter_where', 1);
568
+			if ($snear != '')
569
+				add_filter('posts_where', 'searching_filter_where', 1);
570 570
 
571
-            add_filter('posts_orderby', 'geodir_posts_orderby', 1);
571
+			add_filter('posts_orderby', 'geodir_posts_orderby', 1);
572 572
 
573
-        } elseif (geodir_is_page('author')) {
573
+		} elseif (geodir_is_page('author')) {
574 574
 
575
-            add_filter('posts_where', 'author_filter_where', 1);
575
+			add_filter('posts_where', 'author_filter_where', 1);
576 576
 
577
-        }
577
+		}
578 578
 
579
-        //if (!geodir_is_page('detail'))
580
-            add_filter('posts_where', 'geodir_default_where', 1);/**/
579
+		//if (!geodir_is_page('detail'))
580
+			add_filter('posts_where', 'geodir_default_where', 1);/**/
581 581
 
582
-        //add_filter( 'user_has_cap', 'geodir_preview_post_cap', 10, 3 );// let subscribers edit their own posts
582
+		//add_filter( 'user_has_cap', 'geodir_preview_post_cap', 10, 3 );// let subscribers edit their own posts
583 583
 
584
-    }
584
+	}
585 585
 }
586 586
 
587 587
 /**
@@ -596,13 +596,13 @@  discard block
 block discarded – undo
596 596
  */
597 597
 function geodir_preview_post_cap($allcaps, $caps, $args)
598 598
 {
599
-    $user_id = get_current_user_id();
600
-    if ($user_id && isset($_REQUEST['post_type']) && $_REQUEST['post_type'] != '' && isset($_REQUEST['p']) && $_REQUEST['p'] != '' && $args[0] == 'edit_post' && $_REQUEST['p'] == $args[2]) {
599
+	$user_id = get_current_user_id();
600
+	if ($user_id && isset($_REQUEST['post_type']) && $_REQUEST['post_type'] != '' && isset($_REQUEST['p']) && $_REQUEST['p'] != '' && $args[0] == 'edit_post' && $_REQUEST['p'] == $args[2]) {
601 601
 
602
-        $allcaps['edit_posts'] = true;
603
-    }
604
-    //print_r($allcaps);
605
-    return $allcaps;
602
+		$allcaps['edit_posts'] = true;
603
+	}
604
+	//print_r($allcaps);
605
+	return $allcaps;
606 606
 }
607 607
 
608 608
 
@@ -617,9 +617,9 @@  discard block
 block discarded – undo
617 617
  */
618 618
 function geodir_edit_listing_where($where)
619 619
 {
620
-    global $wpdb;
621
-    $where = $wpdb->prepare(" AND $wpdb->posts.ID = %d ", $_REQUEST['pid']);
622
-    return $where;
620
+	global $wpdb;
621
+	$where = $wpdb->prepare(" AND $wpdb->posts.ID = %d ", $_REQUEST['pid']);
622
+	return $where;
623 623
 }
624 624
 
625 625
 
@@ -636,29 +636,29 @@  discard block
 block discarded – undo
636 636
  */
637 637
 function geodir_default_where($where)
638 638
 {
639
-    global $wp_query, $wpdb;
640
-
641
-    //print_r($wp_query);
642
-    ########### WPML ###########
643
-
644
-    if (function_exists('icl_object_id')) {
645
-        global $sitepress, $table_prefix;
646
-        $lang_code = ICL_LANGUAGE_CODE;
647
-        $default_lang_code = $sitepress->get_default_language();
648
-        $q_post_type = isset($wp_query->query['post_type']) ? $wp_query->query['post_type'] : '';
649
-        //echo '##########'.$q_post_type;
650
-        if ($lang_code && $q_post_type) {
651
-            $where .= " AND icl_t.language_code = '$lang_code' AND icl_t.element_type IN('post_" . $q_post_type . "') ";
652
-            //$where .= " AND icl_t.language_code = '$lang_code' ";
653
-        }
639
+	global $wp_query, $wpdb;
654 640
 
655
-    }
656
-    ########### WPML ###########
641
+	//print_r($wp_query);
642
+	########### WPML ###########
643
+
644
+	if (function_exists('icl_object_id')) {
645
+		global $sitepress, $table_prefix;
646
+		$lang_code = ICL_LANGUAGE_CODE;
647
+		$default_lang_code = $sitepress->get_default_language();
648
+		$q_post_type = isset($wp_query->query['post_type']) ? $wp_query->query['post_type'] : '';
649
+		//echo '##########'.$q_post_type;
650
+		if ($lang_code && $q_post_type) {
651
+			$where .= " AND icl_t.language_code = '$lang_code' AND icl_t.element_type IN('post_" . $q_post_type . "') ";
652
+			//$where .= " AND icl_t.language_code = '$lang_code' ";
653
+		}
654
+
655
+	}
656
+	########### WPML ###########
657 657
 
658 658
 
659
-    return $where = str_replace("0 = 1", "1=1", $where);
659
+	return $where = str_replace("0 = 1", "1=1", $where);
660 660
 
661
-    /* ====== old code start ===
661
+	/* ====== old code start ===
662 662
     $where = str_replace("0 = 1", "1=1", $where);
663 663
     $country = get_query_var('gd_country');
664 664
     $region = get_query_var('gd_region');
@@ -699,108 +699,108 @@  discard block
 block discarded – undo
699 699
  * @return string Modified where query string.
700 700
  */
701 701
 function searching_filter_where($where) {
702
-    global $wpdb, $geodir_post_type, $table, $plugin_prefix, $dist, $mylat, $mylon, $s, $snear, $s_A, $s_SA, $search_term, $gd_session;
702
+	global $wpdb, $geodir_post_type, $table, $plugin_prefix, $dist, $mylat, $mylon, $s, $snear, $s_A, $s_SA, $search_term, $gd_session;
703 703
 	
704
-    $search_term = 'OR';
705
-    $search_term = 'AND';
706
-    $geodir_custom_search = '';
707
-    $category_search_range = '';
704
+	$search_term = 'OR';
705
+	$search_term = 'AND';
706
+	$geodir_custom_search = '';
707
+	$category_search_range = '';
708 708
 
709
-    if (is_single() && get_query_var('post_type')) {
709
+	if (is_single() && get_query_var('post_type')) {
710 710
 		return $where;
711 711
 	}
712 712
 
713
-    if (is_tax()) {
713
+	if (is_tax()) {
714 714
 		return $where;
715 715
 	}
716 716
 	
717 717
 	$s = trim($s);
718
-    $s  = wp_specialchars_decode($s ,ENT_QUOTES);
719
-    $s_A = wp_specialchars_decode($s_A ,ENT_QUOTES);
720
-
721
-    $where = '';
722
-    $better_search_terms = '';
723
-    if (isset($_REQUEST['stype']))
724
-        $post_types = esc_attr(wp_strip_all_tags($_REQUEST['stype']));
725
-    else
726
-        $post_types = 'gd_place';
727
-
728
-    if ($s != '') {
729
-        $keywords = explode(" ", $s);
730
-        if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
731
-            foreach($keywords as $kkey=>$kword){
732
-                if(mb_strlen($kword, 'UTF-8')<=$klimit){
733
-                    unset($keywords[$kkey]);
734
-                }
735
-            }
736
-        }
718
+	$s  = wp_specialchars_decode($s ,ENT_QUOTES);
719
+	$s_A = wp_specialchars_decode($s_A ,ENT_QUOTES);
737 720
 
738
-        if (!empty($keywords)) {
739
-            foreach ($keywords as $keyword) {
740
-                $keyword = trim($keyword);
741
-                $keyword  = wp_specialchars_decode($keyword ,ENT_QUOTES);
742
-                if ($keyword != '') {
743
-                    /**
744
-                     * Filter the search query keywords SQL.
745
-                     *
746
-                     * @since 1.5.9
747
-                     * @package GeoDirectory
748
-                     * @param string $better_search_terms The query values, default: `' OR ( ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '" OR ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '%" OR ' . $wpdb->posts . '.post_title LIKE "% ' . $keyword . '%" )'`.
749
-                     * @param array $keywords The array of keywords for the query.
750
-                     * @param string $keyword The single keyword being searched.
751
-                     */
721
+	$where = '';
722
+	$better_search_terms = '';
723
+	if (isset($_REQUEST['stype']))
724
+		$post_types = esc_attr(wp_strip_all_tags($_REQUEST['stype']));
725
+	else
726
+		$post_types = 'gd_place';
727
+
728
+	if ($s != '') {
729
+		$keywords = explode(" ", $s);
730
+		if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
731
+			foreach($keywords as $kkey=>$kword){
732
+				if(mb_strlen($kword, 'UTF-8')<=$klimit){
733
+					unset($keywords[$kkey]);
734
+				}
735
+			}
736
+		}
737
+
738
+		if (!empty($keywords)) {
739
+			foreach ($keywords as $keyword) {
740
+				$keyword = trim($keyword);
741
+				$keyword  = wp_specialchars_decode($keyword ,ENT_QUOTES);
742
+				if ($keyword != '') {
743
+					/**
744
+					 * Filter the search query keywords SQL.
745
+					 *
746
+					 * @since 1.5.9
747
+					 * @package GeoDirectory
748
+					 * @param string $better_search_terms The query values, default: `' OR ( ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '" OR ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '%" OR ' . $wpdb->posts . '.post_title LIKE "% ' . $keyword . '%" )'`.
749
+					 * @param array $keywords The array of keywords for the query.
750
+					 * @param string $keyword The single keyword being searched.
751
+					 */
752 752
 					$better_search_terms .= apply_filters("geodir_search_better_search_terms",' OR ( ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '" OR ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '%" OR ' . $wpdb->posts . '.post_title LIKE "% ' . $keyword . '%" )',$keywords,$keyword);
753
-                }
754
-            }
755
-        }
756
-    }
753
+				}
754
+			}
755
+		}
756
+	}
757 757
 
758
-    /* get taxonomy */
759
-    $taxonomies = geodir_get_taxonomies($post_types, true);
760
-    if($taxonomies) {
761
-        $taxonomies = implode("','", $taxonomies);
762
-        $taxonomies = "'" . $taxonomies . "'";
763
-    }else{$taxonomies='';}
758
+	/* get taxonomy */
759
+	$taxonomies = geodir_get_taxonomies($post_types, true);
760
+	if($taxonomies) {
761
+		$taxonomies = implode("','", $taxonomies);
762
+		$taxonomies = "'" . $taxonomies . "'";
763
+	}else{$taxonomies='';}
764 764
 
765
-    $content_where = $terms_where = '';
765
+	$content_where = $terms_where = '';
766 766
 	if ($s != '') {
767
-        /**
768
-         * Filter the search query content where values.
769
-         *
770
-         * @since 1.5.0
771
-         * @package GeoDirectory
772
-         * @param string $content_where The query values, default: `" OR ($wpdb->posts.post_content LIKE \"$s\" OR $wpdb->posts.post_content LIKE \"$s%\" OR $wpdb->posts.post_content LIKE \"% $s%\" OR $wpdb->posts.post_content LIKE \"%>$s%\" OR $wpdb->posts.post_content LIKE \"%\n$s%\") ") "`.
773
-         */
767
+		/**
768
+		 * Filter the search query content where values.
769
+		 *
770
+		 * @since 1.5.0
771
+		 * @package GeoDirectory
772
+		 * @param string $content_where The query values, default: `" OR ($wpdb->posts.post_content LIKE \"$s\" OR $wpdb->posts.post_content LIKE \"$s%\" OR $wpdb->posts.post_content LIKE \"% $s%\" OR $wpdb->posts.post_content LIKE \"%>$s%\" OR $wpdb->posts.post_content LIKE \"%\n$s%\") ") "`.
773
+		 */
774 774
 		$content_where = apply_filters("geodir_search_content_where"," OR ($wpdb->posts.post_content LIKE \"$s\" OR $wpdb->posts.post_content LIKE \"$s%\" OR $wpdb->posts.post_content LIKE \"% $s%\" OR $wpdb->posts.post_content LIKE \"%>$s%\" OR $wpdb->posts.post_content LIKE \"%\n$s%\") ");
775
-        /**
776
-         * Filter the search query term values.
777
-         *
778
-         * @since 1.5.0
779
-         * @package GeoDirectory
780
-         * @param string $terms_where The separator, default: `" AND ($wpdb->terms.name LIKE \"$s\" OR $wpdb->terms.name LIKE \"$s%\" OR $wpdb->terms.name LIKE \"% $s%\" OR $wpdb->terms.name IN ($s_A)) "`.
781
-         */
782
-        $terms_where = apply_filters("geodir_search_terms_where"," AND ($wpdb->terms.name LIKE \"$s\" OR $wpdb->terms.name LIKE \"$s%\" OR $wpdb->terms.name LIKE \"% $s%\" OR $wpdb->terms.name IN ($s_A)) ");
775
+		/**
776
+		 * Filter the search query term values.
777
+		 *
778
+		 * @since 1.5.0
779
+		 * @package GeoDirectory
780
+		 * @param string $terms_where The separator, default: `" AND ($wpdb->terms.name LIKE \"$s\" OR $wpdb->terms.name LIKE \"$s%\" OR $wpdb->terms.name LIKE \"% $s%\" OR $wpdb->terms.name IN ($s_A)) "`.
781
+		 */
782
+		$terms_where = apply_filters("geodir_search_terms_where"," AND ($wpdb->terms.name LIKE \"$s\" OR $wpdb->terms.name LIKE \"$s%\" OR $wpdb->terms.name LIKE \"% $s%\" OR $wpdb->terms.name IN ($s_A)) ");
783 783
 	}
784 784
 		
785
-    if ($snear != '') {
785
+	if ($snear != '') {
786 786
 
787 787
 
788
-        if (is_numeric($gd_session->get('near_me_range')) && !isset($_REQUEST['sdist'])) {
789
-            $dist = $gd_session->get('near_me_range');
790
-        }
791
-        $lon1 = $mylon - $dist / abs(cos(deg2rad($mylat)) * 69);
792
-        $lon2 = $mylon + $dist / abs(cos(deg2rad($mylat)) * 69);
793
-        $lat1 = $mylat - ($dist / 69);
794
-        $lat2 = $mylat + ($dist / 69);
788
+		if (is_numeric($gd_session->get('near_me_range')) && !isset($_REQUEST['sdist'])) {
789
+			$dist = $gd_session->get('near_me_range');
790
+		}
791
+		$lon1 = $mylon - $dist / abs(cos(deg2rad($mylat)) * 69);
792
+		$lon2 = $mylon + $dist / abs(cos(deg2rad($mylat)) * 69);
793
+		$lat1 = $mylat - ($dist / 69);
794
+		$lat2 = $mylat + ($dist / 69);
795 795
 
796
-        $rlon1 = is_numeric(min($lon1, $lon2)) ? min($lon1, $lon2) : '';
797
-        $rlon2 = is_numeric(max($lon1, $lon2)) ? max($lon1, $lon2) : '';
798
-        $rlat1 = is_numeric(min($lat1, $lat2)) ? min($lat1, $lat2) : '';
799
-        $rlat2 = is_numeric(max($lat1, $lat2)) ? max($lat1, $lat2) : '';
796
+		$rlon1 = is_numeric(min($lon1, $lon2)) ? min($lon1, $lon2) : '';
797
+		$rlon2 = is_numeric(max($lon1, $lon2)) ? max($lon1, $lon2) : '';
798
+		$rlat1 = is_numeric(min($lat1, $lat2)) ? min($lat1, $lat2) : '';
799
+		$rlat2 = is_numeric(max($lat1, $lat2)) ? max($lat1, $lat2) : '';
800 800
 
801 801
 
802 802
 
803
-	    $where .= " AND ( ( $wpdb->posts.post_title LIKE \"$s\" $better_search_terms)
803
+		$where .= " AND ( ( $wpdb->posts.post_title LIKE \"$s\" $better_search_terms)
804 804
 			                    $content_where 
805 805
 								OR ($wpdb->posts.ID IN( 
806 806
 										SELECT $wpdb->term_relationships.object_id as post_id 
@@ -817,13 +817,13 @@  discard block
 block discarded – undo
817 817
 						AND ( " . $table . ".post_latitude between $rlat1 and $rlat2 )
818 818
 						AND ( " . $table . ".post_longitude between $rlon1 and $rlon2 ) ";
819 819
 
820
-        if (isset($_REQUEST['sdist']) && $_REQUEST['sdist'] != 'all') {
821
-            $DistanceRadius = geodir_getDistanceRadius(get_option('geodir_search_dist_1'));
822
-            $where .= " AND CONVERT((" . $DistanceRadius . " * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(" . $table . ".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(" . $table . ".post_latitude) * pi()/180) *POWER(SIN(($mylon - " . $table . ".post_longitude) * pi()/180 / 2), 2) ))),DECIMAL(64,4)) <= " . $dist;
823
-        }
820
+		if (isset($_REQUEST['sdist']) && $_REQUEST['sdist'] != 'all') {
821
+			$DistanceRadius = geodir_getDistanceRadius(get_option('geodir_search_dist_1'));
822
+			$where .= " AND CONVERT((" . $DistanceRadius . " * 2 * ASIN(SQRT( POWER(SIN((ABS($mylat) - ABS(" . $table . ".post_latitude)) * pi()/180 / 2), 2) +COS(ABS($mylat) * pi()/180) * COS( ABS(" . $table . ".post_latitude) * pi()/180) *POWER(SIN(($mylon - " . $table . ".post_longitude) * pi()/180 / 2), 2) ))),DECIMAL(64,4)) <= " . $dist;
823
+		}
824 824
 
825
-    } else {
826
-        $where .= " AND (	( $wpdb->posts.post_title LIKE \"$s\" $better_search_terms)
825
+	} else {
826
+		$where .= " AND (	( $wpdb->posts.post_title LIKE \"$s\" $better_search_terms)
827 827
                             $content_where  
828 828
 							OR ( $wpdb->posts.ID IN(	
829 829
 									SELECT $wpdb->term_relationships.object_id as post_id                     
@@ -837,19 +837,19 @@  discard block
 block discarded – undo
837 837
 					) 
838 838
 				AND $wpdb->posts.post_type in ('$post_types')
839 839
 				AND ($wpdb->posts.post_status = 'publish') ";
840
-    }
840
+	}
841 841
 	
842 842
 	########### WPML ###########
843
-    if ( function_exists( 'icl_object_id' ) ) {       
843
+	if ( function_exists( 'icl_object_id' ) ) {       
844 844
 		$lang_code = ICL_LANGUAGE_CODE;
845 845
 		
846 846
 		if ($lang_code && $post_types) {
847
-            $where .= " AND icl_t.language_code = '".$lang_code."' AND icl_t.element_type IN('post_" . $post_types . "') ";
848
-        }
849
-    }
850
-    ########### WPML ###########
847
+			$where .= " AND icl_t.language_code = '".$lang_code."' AND icl_t.element_type IN('post_" . $post_types . "') ";
848
+		}
849
+	}
850
+	########### WPML ###########
851 851
 	
852
-    return $where;
852
+	return $where;
853 853
 }
854 854
 
855 855
 
@@ -864,45 +864,45 @@  discard block
 block discarded – undo
864 864
  * @return string Modified where query string.
865 865
  */
866 866
 function author_filter_where($where) {
867
-    global $wpdb, $geodir_post_type, $table, $curr;
867
+	global $wpdb, $geodir_post_type, $table, $curr;
868 868
 
869
-    $curauth = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
870
-    $user_id = !empty($curauth->ID) ? (int)$curauth->ID : 0;
869
+	$curauth = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
870
+	$user_id = !empty($curauth->ID) ? (int)$curauth->ID : 0;
871 871
     
872
-    if (isset($_REQUEST['stype'])) {
873
-        $where = $wpdb->prepare(" AND $wpdb->posts.post_type IN (%s) ",$_REQUEST['stype']);
874
-    } else {
875
-        $where = " AND $wpdb->posts.post_type IN ('gd_place') ";
876
-    }
872
+	if (isset($_REQUEST['stype'])) {
873
+		$where = $wpdb->prepare(" AND $wpdb->posts.post_type IN (%s) ",$_REQUEST['stype']);
874
+	} else {
875
+		$where = " AND $wpdb->posts.post_type IN ('gd_place') ";
876
+	}
877 877
 
878
-    if ($user_id > 0) {
879
-        if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
880
-            $user_fav_posts = get_user_meta($user_id, 'gd_user_favourite_post', true);
881
-            $user_fav_posts = !empty($user_fav_posts) && is_array($user_fav_posts) ? implode("','", $user_fav_posts) : '-1';
882
-            $where .= " AND $wpdb->posts.ID IN ('$user_fav_posts')";
883
-        } else
884
-            $where .= " AND $wpdb->posts.post_author = $user_id";
885
-
886
-        if ($user_id == (int)get_current_user_id()) {
887
-            $where .= " AND $wpdb->posts.post_status IN ('publish','draft','pending') ";
888
-        } else {
889
-            $where .= " AND $wpdb->posts.post_status = 'publish' ";
890
-        }
891
-    } else {
892
-        $where .= " AND $wpdb->posts.post_author = '-1' AND $wpdb->posts.post_status = 'publish' ";
893
-    }
878
+	if ($user_id > 0) {
879
+		if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
880
+			$user_fav_posts = get_user_meta($user_id, 'gd_user_favourite_post', true);
881
+			$user_fav_posts = !empty($user_fav_posts) && is_array($user_fav_posts) ? implode("','", $user_fav_posts) : '-1';
882
+			$where .= " AND $wpdb->posts.ID IN ('$user_fav_posts')";
883
+		} else
884
+			$where .= " AND $wpdb->posts.post_author = $user_id";
885
+
886
+		if ($user_id == (int)get_current_user_id()) {
887
+			$where .= " AND $wpdb->posts.post_status IN ('publish','draft','pending') ";
888
+		} else {
889
+			$where .= " AND $wpdb->posts.post_status = 'publish' ";
890
+		}
891
+	} else {
892
+		$where .= " AND $wpdb->posts.post_author = '-1' AND $wpdb->posts.post_status = 'publish' ";
893
+	}
894 894
 
895
-    ########### WPML ###########
896
-    if (function_exists('icl_object_id')) {
897
-        $lang_code = ICL_LANGUAGE_CODE;
898
-        if ($lang_code) {
899
-            $where .= " AND icl_t.language_code='" . $lang_code . "' ";
900
-        }
895
+	########### WPML ###########
896
+	if (function_exists('icl_object_id')) {
897
+		$lang_code = ICL_LANGUAGE_CODE;
898
+		if ($lang_code) {
899
+			$where .= " AND icl_t.language_code='" . $lang_code . "' ";
900
+		}
901 901
 
902
-    }
903
-    ########### WPML ###########
902
+	}
903
+	########### WPML ###########
904 904
     
905
-    return $where;
905
+	return $where;
906 906
 }
907 907
 
908 908
 /**
@@ -917,11 +917,11 @@  discard block
 block discarded – undo
917 917
  */
918 918
 function geodir_filter_widget_join($join)
919 919
 {
920
-    global $wp_query, $table;
921
-    if (!empty($wp_query->query['with_pics_only'])) {
922
-        $join .= " LEFT JOIN " . GEODIR_ATTACHMENT_TABLE . " ON ( " . GEODIR_ATTACHMENT_TABLE . ".post_id=" . $table . ".post_id AND " . GEODIR_ATTACHMENT_TABLE . ".mime_type LIKE '%image%' )";
923
-    }
924
-    return $join;
920
+	global $wp_query, $table;
921
+	if (!empty($wp_query->query['with_pics_only'])) {
922
+		$join .= " LEFT JOIN " . GEODIR_ATTACHMENT_TABLE . " ON ( " . GEODIR_ATTACHMENT_TABLE . ".post_id=" . $table . ".post_id AND " . GEODIR_ATTACHMENT_TABLE . ".mime_type LIKE '%image%' )";
923
+	}
924
+	return $join;
925 925
 }
926 926
 
927 927
 /**
@@ -936,18 +936,18 @@  discard block
 block discarded – undo
936 936
  */
937 937
 function geodir_filter_widget_where($where)
938 938
 {
939
-    global $wp_query, $table;
940
-    if (!empty($wp_query->query['show_featured_only'])) {
941
-        $where .= " AND " . $table . ".is_featured = '1'";
942
-    }
943
-    if (!empty($wp_query->query['show_special_only'])) {
944
-        $where .= " AND ( " . $table . ".geodir_special_offers != '' AND " . $table . ".geodir_special_offers IS NOT NULL )";
945
-    }
946
-    if (!empty($wp_query->query['with_pics_only'])) {
947
-        $where .= " AND " . GEODIR_ATTACHMENT_TABLE . ".ID IS NOT NULL GROUP BY " . $table . ".post_id";
948
-    }
949
-    if (!empty($wp_query->query['with_videos_only'])) {
950
-        $where .= " AND ( " . $table . ".geodir_video != '' AND " . $table . ".geodir_video IS NOT NULL )";
951
-    }
952
-    return $where;
939
+	global $wp_query, $table;
940
+	if (!empty($wp_query->query['show_featured_only'])) {
941
+		$where .= " AND " . $table . ".is_featured = '1'";
942
+	}
943
+	if (!empty($wp_query->query['show_special_only'])) {
944
+		$where .= " AND ( " . $table . ".geodir_special_offers != '' AND " . $table . ".geodir_special_offers IS NOT NULL )";
945
+	}
946
+	if (!empty($wp_query->query['with_pics_only'])) {
947
+		$where .= " AND " . GEODIR_ATTACHMENT_TABLE . ".ID IS NOT NULL GROUP BY " . $table . ".post_id";
948
+	}
949
+	if (!empty($wp_query->query['with_videos_only'])) {
950
+		$where .= " AND ( " . $table . ".geodir_video != '' AND " . $table . ".geodir_video IS NOT NULL )";
951
+	}
952
+	return $where;
953 953
 }
954 954
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -99,15 +99,15 @@  discard block
 block discarded – undo
99 99
         } //  Distance
100 100
 
101 101
         if (isset($_REQUEST['sgeo_lat'])) {
102
-            $mylat = (float)esc_attr($_REQUEST['sgeo_lat']);
102
+            $mylat = (float) esc_attr($_REQUEST['sgeo_lat']);
103 103
         } else {
104
-            $mylat = (float)geodir_get_current_city_lat();
104
+            $mylat = (float) geodir_get_current_city_lat();
105 105
         } //  Latatude
106 106
 
107 107
         if (isset($_REQUEST['sgeo_lon'])) {
108
-            $mylon = (float)esc_attr($_REQUEST['sgeo_lon']);
108
+            $mylon = (float) esc_attr($_REQUEST['sgeo_lon']);
109 109
         } else {
110
-            $mylon = (float)geodir_get_current_city_lng();
110
+            $mylon = (float) geodir_get_current_city_lng();
111 111
         } //  Distance
112 112
 
113 113
         if (isset($_REQUEST['snear'])) {
@@ -250,9 +250,9 @@  discard block
 block discarded – undo
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,7 +270,7 @@  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 . " ";
@@ -285,8 +285,8 @@  discard block
 block discarded – undo
285 285
         } else {
286 286
             $gd_titlematch_part = "";
287 287
         }
288
-        $s = stripslashes_deep( $s );
289
-        $s = wp_specialchars_decode($s,ENT_QUOTES);
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
 
@@ -441,9 +441,9 @@  discard block
 block discarded – undo
441 441
 
442 442
     if (is_search() && isset($_REQUEST['geodir_search']) && $s && trim($s) != '') {
443 443
         $keywords = explode(" ", $s);
444
-        if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
445
-            foreach($keywords as $kkey=>$kword){
446
-                if(mb_strlen($kword, 'UTF-8')<=$klimit){
444
+        if (is_array($keywords) && $klimit = get_option('geodir_search_word_limit')) {
445
+            foreach ($keywords as $kkey=>$kword) {
446
+                if (mb_strlen($kword, 'UTF-8') <= $klimit) {
447 447
                     unset($keywords[$kkey]);
448 448
                 }
449 449
             }
@@ -512,7 +512,7 @@  discard block
 block discarded – undo
512 512
                 case 'post_date':
513 513
                 case 'comment_count':
514 514
 
515
-                    $orderby = "$wpdb->posts." . $sort_by . " " . $order . ", ".$table . ".overall_rating " . $order . ", ";
515
+                    $orderby = "$wpdb->posts." . $sort_by . " " . $order . ", " . $table . ".overall_rating " . $order . ", ";
516 516
                     break;
517 517
 
518 518
                 case 'distance':
@@ -577,7 +577,7 @@  discard block
 block discarded – undo
577 577
         }
578 578
 
579 579
         //if (!geodir_is_page('detail'))
580
-            add_filter('posts_where', 'geodir_default_where', 1);/**/
580
+            add_filter('posts_where', 'geodir_default_where', 1); /**/
581 581
 
582 582
         //add_filter( 'user_has_cap', 'geodir_preview_post_cap', 10, 3 );// let subscribers edit their own posts
583 583
 
@@ -715,8 +715,8 @@  discard block
 block discarded – undo
715 715
 	}
716 716
 	
717 717
 	$s = trim($s);
718
-    $s  = wp_specialchars_decode($s ,ENT_QUOTES);
719
-    $s_A = wp_specialchars_decode($s_A ,ENT_QUOTES);
718
+    $s = wp_specialchars_decode($s, ENT_QUOTES);
719
+    $s_A = wp_specialchars_decode($s_A, ENT_QUOTES);
720 720
 
721 721
     $where = '';
722 722
     $better_search_terms = '';
@@ -727,9 +727,9 @@  discard block
 block discarded – undo
727 727
 
728 728
     if ($s != '') {
729 729
         $keywords = explode(" ", $s);
730
-        if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
731
-            foreach($keywords as $kkey=>$kword){
732
-                if(mb_strlen($kword, 'UTF-8')<=$klimit){
730
+        if (is_array($keywords) && $klimit = get_option('geodir_search_word_limit')) {
731
+            foreach ($keywords as $kkey=>$kword) {
732
+                if (mb_strlen($kword, 'UTF-8') <= $klimit) {
733 733
                     unset($keywords[$kkey]);
734 734
                 }
735 735
             }
@@ -738,7 +738,7 @@  discard block
 block discarded – undo
738 738
         if (!empty($keywords)) {
739 739
             foreach ($keywords as $keyword) {
740 740
                 $keyword = trim($keyword);
741
-                $keyword  = wp_specialchars_decode($keyword ,ENT_QUOTES);
741
+                $keyword = wp_specialchars_decode($keyword, ENT_QUOTES);
742 742
                 if ($keyword != '') {
743 743
                     /**
744 744
                      * Filter the search query keywords SQL.
@@ -749,7 +749,7 @@  discard block
 block discarded – undo
749 749
                      * @param array $keywords The array of keywords for the query.
750 750
                      * @param string $keyword The single keyword being searched.
751 751
                      */
752
-					$better_search_terms .= apply_filters("geodir_search_better_search_terms",' OR ( ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '" OR ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '%" OR ' . $wpdb->posts . '.post_title LIKE "% ' . $keyword . '%" )',$keywords,$keyword);
752
+					$better_search_terms .= apply_filters("geodir_search_better_search_terms", ' OR ( ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '" OR ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '%" OR ' . $wpdb->posts . '.post_title LIKE "% ' . $keyword . '%" )', $keywords, $keyword);
753 753
                 }
754 754
             }
755 755
         }
@@ -757,10 +757,10 @@  discard block
 block discarded – undo
757 757
 
758 758
     /* get taxonomy */
759 759
     $taxonomies = geodir_get_taxonomies($post_types, true);
760
-    if($taxonomies) {
760
+    if ($taxonomies) {
761 761
         $taxonomies = implode("','", $taxonomies);
762 762
         $taxonomies = "'" . $taxonomies . "'";
763
-    }else{$taxonomies='';}
763
+    } else {$taxonomies = ''; }
764 764
 
765 765
     $content_where = $terms_where = '';
766 766
 	if ($s != '') {
@@ -771,7 +771,7 @@  discard block
 block discarded – undo
771 771
          * @package GeoDirectory
772 772
          * @param string $content_where The query values, default: `" OR ($wpdb->posts.post_content LIKE \"$s\" OR $wpdb->posts.post_content LIKE \"$s%\" OR $wpdb->posts.post_content LIKE \"% $s%\" OR $wpdb->posts.post_content LIKE \"%>$s%\" OR $wpdb->posts.post_content LIKE \"%\n$s%\") ") "`.
773 773
          */
774
-		$content_where = apply_filters("geodir_search_content_where"," OR ($wpdb->posts.post_content LIKE \"$s\" OR $wpdb->posts.post_content LIKE \"$s%\" OR $wpdb->posts.post_content LIKE \"% $s%\" OR $wpdb->posts.post_content LIKE \"%>$s%\" OR $wpdb->posts.post_content LIKE \"%\n$s%\") ");
774
+		$content_where = apply_filters("geodir_search_content_where", " OR ($wpdb->posts.post_content LIKE \"$s\" OR $wpdb->posts.post_content LIKE \"$s%\" OR $wpdb->posts.post_content LIKE \"% $s%\" OR $wpdb->posts.post_content LIKE \"%>$s%\" OR $wpdb->posts.post_content LIKE \"%\n$s%\") ");
775 775
         /**
776 776
          * Filter the search query term values.
777 777
          *
@@ -779,7 +779,7 @@  discard block
 block discarded – undo
779 779
          * @package GeoDirectory
780 780
          * @param string $terms_where The separator, default: `" AND ($wpdb->terms.name LIKE \"$s\" OR $wpdb->terms.name LIKE \"$s%\" OR $wpdb->terms.name LIKE \"% $s%\" OR $wpdb->terms.name IN ($s_A)) "`.
781 781
          */
782
-        $terms_where = apply_filters("geodir_search_terms_where"," AND ($wpdb->terms.name LIKE \"$s\" OR $wpdb->terms.name LIKE \"$s%\" OR $wpdb->terms.name LIKE \"% $s%\" OR $wpdb->terms.name IN ($s_A)) ");
782
+        $terms_where = apply_filters("geodir_search_terms_where", " AND ($wpdb->terms.name LIKE \"$s\" OR $wpdb->terms.name LIKE \"$s%\" OR $wpdb->terms.name LIKE \"% $s%\" OR $wpdb->terms.name IN ($s_A)) ");
783 783
 	}
784 784
 		
785 785
     if ($snear != '') {
@@ -840,11 +840,11 @@  discard block
 block discarded – undo
840 840
     }
841 841
 	
842 842
 	########### WPML ###########
843
-    if ( function_exists( 'icl_object_id' ) ) {       
843
+    if (function_exists('icl_object_id')) {       
844 844
 		$lang_code = ICL_LANGUAGE_CODE;
845 845
 		
846 846
 		if ($lang_code && $post_types) {
847
-            $where .= " AND icl_t.language_code = '".$lang_code."' AND icl_t.element_type IN('post_" . $post_types . "') ";
847
+            $where .= " AND icl_t.language_code = '" . $lang_code . "' AND icl_t.element_type IN('post_" . $post_types . "') ";
848 848
         }
849 849
     }
850 850
     ########### WPML ###########
@@ -867,10 +867,10 @@  discard block
 block discarded – undo
867 867
     global $wpdb, $geodir_post_type, $table, $curr;
868 868
 
869 869
     $curauth = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
870
-    $user_id = !empty($curauth->ID) ? (int)$curauth->ID : 0;
870
+    $user_id = !empty($curauth->ID) ? (int) $curauth->ID : 0;
871 871
     
872 872
     if (isset($_REQUEST['stype'])) {
873
-        $where = $wpdb->prepare(" AND $wpdb->posts.post_type IN (%s) ",$_REQUEST['stype']);
873
+        $where = $wpdb->prepare(" AND $wpdb->posts.post_type IN (%s) ", $_REQUEST['stype']);
874 874
     } else {
875 875
         $where = " AND $wpdb->posts.post_type IN ('gd_place') ";
876 876
     }
@@ -883,7 +883,7 @@  discard block
 block discarded – undo
883 883
         } else
884 884
             $where .= " AND $wpdb->posts.post_author = $user_id";
885 885
 
886
-        if ($user_id == (int)get_current_user_id()) {
886
+        if ($user_id == (int) get_current_user_id()) {
887 887
             $where .= " AND $wpdb->posts.post_status IN ('publish','draft','pending') ";
888 888
         } else {
889 889
             $where .= " AND $wpdb->posts.post_status = 'publish' ";
Please login to merge, or discard this patch.
geodirectory-admin/geodir_admin_ajax.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Admin ajax.
4
- *
5
- * @since 1.0.0
6
- * @package GeoDirectory
7
- */
3
+	 * Admin ajax.
4
+	 *
5
+	 * @since 1.0.0
6
+	 * @package GeoDirectory
7
+	 */
8 8
 
9 9
 if (isset($_REQUEST['create_field'])) {
10 10
 	/**
@@ -13,14 +13,14 @@  discard block
 block discarded – undo
13 13
 	 * @since 1.0.0
14 14
 	 */
15 15
 	include_once(geodir_plugin_path() . '/geodirectory-admin/option-pages/create_field.php');
16
-    die;
16
+	die;
17 17
 }
18 18
 
19 19
 
20 20
 if (isset($_REQUEST['ajax_action']) && $_REQUEST['ajax_action'] != '') {
21
-    switch ($_REQUEST['ajax_action']):
22
-        case 'get_cat_dl':
23
-            geodir_get_categories_dl($_REQUEST['post_type'], $_REQUEST['selected'], false, true);
24
-            break;
25
-    endswitch;
21
+	switch ($_REQUEST['ajax_action']):
22
+		case 'get_cat_dl':
23
+			geodir_get_categories_dl($_REQUEST['post_type'], $_REQUEST['selected'], false, true);
24
+			break;
25
+	endswitch;
26 26
 }
27 27
\ No newline at end of file
Please login to merge, or discard this patch.
db-language.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Translate language string stored in database. Ex: Custom Fields
4
- *
5
- * @package GeoDirectory
6
- * @since 1.4.2
7
- */
3
+	 * Translate language string stored in database. Ex: Custom Fields
4
+	 *
5
+	 * @package GeoDirectory
6
+	 * @since 1.4.2
7
+	 */
8 8
 
9 9
 // Language keys
Please login to merge, or discard this patch.
geodirectory_shortcodes.php 2 patches
Indentation   +656 added lines, -656 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
  */
8 8
 // If this file is called directly, abort.
9 9
 if (!defined('WPINC')) {
10
-    die;
10
+	die;
11 11
 }
12 12
 require_once('geodirectory-functions/shortcode_functions.php');
13 13
 
@@ -32,48 +32,48 @@  discard block
 block discarded – undo
32 32
  */
33 33
 function geodir_sc_add_listing($atts)
34 34
 {
35
-    ob_start();
36
-    $defaults = array(
37
-        'pid' => '',
38
-        'listing_type' => 'gd_place',
39
-        'login_msg' => __('You must login to post.', 'geodirectory'),
40
-        'show_login' => false,
41
-    );
42
-    $params = shortcode_atts($defaults, $atts);
43
-
44
-    foreach ($params as $key => $value) {
45
-        $_REQUEST[$key] = $value;
46
-    }
47
-
48
-    $user_id = get_current_user_id();
49
-    if (!$user_id) {
50
-        echo $params['login_msg'];
51
-        if ($params['show_login']) {
52
-            echo "<br />";
53
-            $defaults = array(
54
-                'before_widget' => '',
55
-                'after_widget' => '',
56
-                'before_title' => '',
57
-                'after_title' => '',
58
-            );
59
-
60
-            geodir_loginwidget_output($defaults, $defaults);
61
-        }
62
-
63
-
64
-    } else {
65
-        ###### MAIN CONTENT ######
66
-
67
-        /** This action is documented in geodirectory-templates/add-listing.php */
68
-        do_action('geodir_add_listing_page_mandatory');
69
-        /** This action is documented in geodirectory-templates/add-listing.php */
70
-        do_action('geodir_add_listing_form');
71
-    }
72
-    $output = ob_get_contents();
73
-
74
-    ob_end_clean();
75
-
76
-    return $output;
35
+	ob_start();
36
+	$defaults = array(
37
+		'pid' => '',
38
+		'listing_type' => 'gd_place',
39
+		'login_msg' => __('You must login to post.', 'geodirectory'),
40
+		'show_login' => false,
41
+	);
42
+	$params = shortcode_atts($defaults, $atts);
43
+
44
+	foreach ($params as $key => $value) {
45
+		$_REQUEST[$key] = $value;
46
+	}
47
+
48
+	$user_id = get_current_user_id();
49
+	if (!$user_id) {
50
+		echo $params['login_msg'];
51
+		if ($params['show_login']) {
52
+			echo "<br />";
53
+			$defaults = array(
54
+				'before_widget' => '',
55
+				'after_widget' => '',
56
+				'before_title' => '',
57
+				'after_title' => '',
58
+			);
59
+
60
+			geodir_loginwidget_output($defaults, $defaults);
61
+		}
62
+
63
+
64
+	} else {
65
+		###### MAIN CONTENT ######
66
+
67
+		/** This action is documented in geodirectory-templates/add-listing.php */
68
+		do_action('geodir_add_listing_page_mandatory');
69
+		/** This action is documented in geodirectory-templates/add-listing.php */
70
+		do_action('geodir_add_listing_form');
71
+	}
72
+	$output = ob_get_contents();
73
+
74
+	ob_end_clean();
75
+
76
+	return $output;
77 77
 }
78 78
 
79 79
 /**
@@ -101,136 +101,136 @@  discard block
 block discarded – undo
101 101
  */
102 102
 function geodir_sc_home_map($atts)
103 103
 {
104
-    ob_start();
105
-    $defaults = array(
106
-        'width' => '960',
107
-        'height' => '425',
108
-        'maptype' => 'ROADMAP',
109
-        'zoom' => '13',
110
-        'autozoom' => '',
111
-        'child_collapse' => '0',
112
-        'scrollwheel' => '0',
104
+	ob_start();
105
+	$defaults = array(
106
+		'width' => '960',
107
+		'height' => '425',
108
+		'maptype' => 'ROADMAP',
109
+		'zoom' => '13',
110
+		'autozoom' => '',
111
+		'child_collapse' => '0',
112
+		'scrollwheel' => '0',
113 113
 		'marker_cluster' => false,
114
-        'latitude' => '',
115
-        'longitude' => ''
116
-    );
117
-
118
-    $params = shortcode_atts($defaults, $atts);
119
-
120
-    $params = gdsc_validate_map_args($params);
121
-
122
-    $map_args = array(
123
-        'map_canvas_name' => 'gd_home_map',
124
-        'latitude' => $params['latitude'],
125
-        'longitude' => $params['longitude'],
126
-
127
-        /**
128
-         * Filter the widget width of the map on home/listings page.
129
-         *
130
-         * @since 1.0.0
131
-         * @param mixed(string|int|float) $params['width'] The map width.
132
-         */
133
-        'width' => apply_filters('widget_width', $params['width']),
134
-        /**
135
-         * Filter the widget height of the map on home/listings page.
136
-         *
137
-         * @since 1.0.0
138
-         * @param mixed(string|int|float) $params['height'] The map height.
139
-         */
140
-        'height' => apply_filters('widget_heigh', $params['height']),
141
-        /**
142
-         * Filter the widget maptype of the map on home/listings page.
143
-         *
144
-         * @since 1.0.0
114
+		'latitude' => '',
115
+		'longitude' => ''
116
+	);
117
+
118
+	$params = shortcode_atts($defaults, $atts);
119
+
120
+	$params = gdsc_validate_map_args($params);
121
+
122
+	$map_args = array(
123
+		'map_canvas_name' => 'gd_home_map',
124
+		'latitude' => $params['latitude'],
125
+		'longitude' => $params['longitude'],
126
+
127
+		/**
128
+		 * Filter the widget width of the map on home/listings page.
129
+		 *
130
+		 * @since 1.0.0
131
+		 * @param mixed(string|int|float) $params['width'] The map width.
132
+		 */
133
+		'width' => apply_filters('widget_width', $params['width']),
134
+		/**
135
+		 * Filter the widget height of the map on home/listings page.
136
+		 *
137
+		 * @since 1.0.0
138
+		 * @param mixed(string|int|float) $params['height'] The map height.
139
+		 */
140
+		'height' => apply_filters('widget_heigh', $params['height']),
141
+		/**
142
+		 * Filter the widget maptype of the map on home/listings page.
143
+		 *
144
+		 * @since 1.0.0
145 145
 		 * @since 1.5.2 Added TERRAIN map type.
146
-         * @param string $params['maptype'] The map type. Can be ROADMAP | SATELLITE | HYBRID | TERRAIN.
147
-         */
148
-        'maptype' => apply_filters('widget_maptype', $params['maptype']),
149
-        /**
150
-         * Filter the widget scrollwheel value of the map on home/listings page.
151
-         *
152
-         * Should the scrollwheel zoom the map or not.
153
-         *
154
-         * @since 1.0.0
155
-         * @param bool $params['scrollwheel'] True to allow scroll wheel to scroll map or false if not.
156
-         */
157
-        'scrollwheel' => apply_filters('widget_scrollwheel', $params['scrollwheel']),
158
-        /**
159
-         * Filter the widget zoom level of the map on home/listings page.
160
-         *
161
-         * @since 1.0.0
162
-         * @param int $params['zoom'] The zoom level of the map. Between 1-19.
163
-         */
164
-        'zoom' => apply_filters('widget_zoom', $params['zoom']),
165
-        /**
166
-         * Filter the widget auto zoom value of the map on home/listings page.
167
-         *
168
-         * If the map should autozoom to fit the markers shown.
169
-         *
170
-         * @since 1.0.0
171
-         * @param bool $params['autozoom'] True if the map should autozoom, false if not.
172
-         */
173
-        'autozoom' => apply_filters('widget_autozoom', $params['autozoom']),
174
-        /**
175
-         * Filter the widget child_collapse value of the map on home/listings page.
176
-         *
177
-         * If the map should auto collapse the child categories if the category bar is present.
178
-         *
179
-         * @since 1.0.0
180
-         * @param bool $params['child_collapse'] True if the map should collapse the categories, false if not.
181
-         */
182
-        'child_collapse' => apply_filters('widget_child_collapse', $params['child_collapse']),
183
-        'enable_cat_filters' => true,
184
-        'enable_text_search' => true,
185
-        'enable_post_type_filters' => true,
186
-        /**
187
-         * Filter the widget enable_location_filters value of the map on home/listings page.
188
-         *
189
-         * This is used when the location addon is used.
190
-         *
191
-         * @since 1.0.0
192
-         * @param bool $val True if location filters should be used, false if not.
193
-         */
194
-        'enable_location_filters' => apply_filters('geodir_home_map_enable_location_filters', false),
195
-        'enable_jason_on_load' => false,
196
-        'enable_marker_cluster' => false,
197
-        'enable_map_resize_button' => true,
198
-        'map_class_name' => 'geodir-map-home-page',
199
-        'is_geodir_home_map_widget' => true,
200
-    );
146
+		 * @param string $params['maptype'] The map type. Can be ROADMAP | SATELLITE | HYBRID | TERRAIN.
147
+		 */
148
+		'maptype' => apply_filters('widget_maptype', $params['maptype']),
149
+		/**
150
+		 * Filter the widget scrollwheel value of the map on home/listings page.
151
+		 *
152
+		 * Should the scrollwheel zoom the map or not.
153
+		 *
154
+		 * @since 1.0.0
155
+		 * @param bool $params['scrollwheel'] True to allow scroll wheel to scroll map or false if not.
156
+		 */
157
+		'scrollwheel' => apply_filters('widget_scrollwheel', $params['scrollwheel']),
158
+		/**
159
+		 * Filter the widget zoom level of the map on home/listings page.
160
+		 *
161
+		 * @since 1.0.0
162
+		 * @param int $params['zoom'] The zoom level of the map. Between 1-19.
163
+		 */
164
+		'zoom' => apply_filters('widget_zoom', $params['zoom']),
165
+		/**
166
+		 * Filter the widget auto zoom value of the map on home/listings page.
167
+		 *
168
+		 * If the map should autozoom to fit the markers shown.
169
+		 *
170
+		 * @since 1.0.0
171
+		 * @param bool $params['autozoom'] True if the map should autozoom, false if not.
172
+		 */
173
+		'autozoom' => apply_filters('widget_autozoom', $params['autozoom']),
174
+		/**
175
+		 * Filter the widget child_collapse value of the map on home/listings page.
176
+		 *
177
+		 * If the map should auto collapse the child categories if the category bar is present.
178
+		 *
179
+		 * @since 1.0.0
180
+		 * @param bool $params['child_collapse'] True if the map should collapse the categories, false if not.
181
+		 */
182
+		'child_collapse' => apply_filters('widget_child_collapse', $params['child_collapse']),
183
+		'enable_cat_filters' => true,
184
+		'enable_text_search' => true,
185
+		'enable_post_type_filters' => true,
186
+		/**
187
+		 * Filter the widget enable_location_filters value of the map on home/listings page.
188
+		 *
189
+		 * This is used when the location addon is used.
190
+		 *
191
+		 * @since 1.0.0
192
+		 * @param bool $val True if location filters should be used, false if not.
193
+		 */
194
+		'enable_location_filters' => apply_filters('geodir_home_map_enable_location_filters', false),
195
+		'enable_jason_on_load' => false,
196
+		'enable_marker_cluster' => false,
197
+		'enable_map_resize_button' => true,
198
+		'map_class_name' => 'geodir-map-home-page',
199
+		'is_geodir_home_map_widget' => true,
200
+	);
201 201
 
202 202
 	// Add marker cluster
203 203
 	if (isset($params['marker_cluster']) && gdsc_to_bool_val($params['marker_cluster']) && defined('GDCLUSTER_VERSION')) {
204
-        $map_args['enable_marker_cluster'] = true;
205
-        if(get_option('geodir_marker_cluster_type')) {
206
-            if ($map_args['autozoom']) {
207
-                $map_args['enable_marker_cluster_no_reposition'] = false;
208
-            } else {
209
-                $map_args['enable_marker_cluster_no_reposition'] = true;
210
-            }
204
+		$map_args['enable_marker_cluster'] = true;
205
+		if(get_option('geodir_marker_cluster_type')) {
206
+			if ($map_args['autozoom']) {
207
+				$map_args['enable_marker_cluster_no_reposition'] = false;
208
+			} else {
209
+				$map_args['enable_marker_cluster_no_reposition'] = true;
210
+			}
211 211
 
212
-            $map_args['enable_marker_cluster_server'] = true ;
212
+			$map_args['enable_marker_cluster_server'] = true ;
213 213
 
214
-        }
214
+		}
215 215
 	} else {
216 216
 		$map_args['enable_marker_cluster'] = false;
217 217
 	}
218 218
 
219
-    // if lat and long set in shortcode, hack it so the map is not repositioned
220
-    if(!empty($params['latitude']) && !empty($params['longitude']) ){
221
-        $map_args['enable_marker_cluster_no_reposition'] = true;
222
-    }
219
+	// if lat and long set in shortcode, hack it so the map is not repositioned
220
+	if(!empty($params['latitude']) && !empty($params['longitude']) ){
221
+		$map_args['enable_marker_cluster_no_reposition'] = true;
222
+	}
223 223
 
224 224
 
225
-    geodir_draw_map($map_args);
225
+	geodir_draw_map($map_args);
226 226
 
227
-    add_action('wp_footer', 'geodir_home_map_add_script', 100);
227
+	add_action('wp_footer', 'geodir_home_map_add_script', 100);
228 228
 
229
-    $output = ob_get_contents();
229
+	$output = ob_get_contents();
230 230
 
231
-    ob_end_clean();
231
+	ob_end_clean();
232 232
 
233
-    return $output;
233
+	return $output;
234 234
 }
235 235
 add_shortcode('gd_homepage_map', 'geodir_sc_home_map');
236 236
 
@@ -264,77 +264,77 @@  discard block
 block discarded – undo
264 264
  */
265 265
 function geodir_sc_listing_map($atts)
266 266
 {
267
-    ob_start();
268
-    add_action('wp_head', 'init_listing_map_script'); // Initialize the map object and marker array
269
-
270
-    add_action('the_post', 'create_list_jsondata'); // Add marker in json array
271
-
272
-    add_action('wp_footer', 'show_listing_widget_map'); // Show map for listings with markers
273
-
274
-    $defaults = array(
275
-        'width' => '294',
276
-        'height' => '370',
277
-        'zoom' => '13',
278
-        'autozoom' => '',
279
-        'sticky' => '',
280
-        'showall' => '0',
281
-        'scrollwheel' => '0',
282
-        'maptype' => 'ROADMAP',
283
-        'child_collapse' => 0,
267
+	ob_start();
268
+	add_action('wp_head', 'init_listing_map_script'); // Initialize the map object and marker array
269
+
270
+	add_action('the_post', 'create_list_jsondata'); // Add marker in json array
271
+
272
+	add_action('wp_footer', 'show_listing_widget_map'); // Show map for listings with markers
273
+
274
+	$defaults = array(
275
+		'width' => '294',
276
+		'height' => '370',
277
+		'zoom' => '13',
278
+		'autozoom' => '',
279
+		'sticky' => '',
280
+		'showall' => '0',
281
+		'scrollwheel' => '0',
282
+		'maptype' => 'ROADMAP',
283
+		'child_collapse' => 0,
284 284
 		'marker_cluster' => false
285
-    );
286
-
287
-    $params = shortcode_atts($defaults, $atts);
288
-
289
-    $params = gdsc_validate_map_args($params);
290
-
291
-    $map_args = array(
292
-        'map_canvas_name' => 'gd_listing_map',
293
-        'width' => $params['width'],
294
-        'height' => $params['height'],
295
-        'zoom' => $params['zoom'],
296
-        'autozoom' => $params['autozoom'],
297
-        'sticky' => $params['sticky'],
298
-        'showall' => $params['showall'],
299
-        'scrollwheel' => $params['scrollwheel'],
300
-        'child_collapse' => 0,
301
-        'enable_cat_filters' => false,
302
-        'enable_text_search' => false,
303
-        'enable_post_type_filters' => false,
304
-        'enable_location_filters' => false,
305
-        'enable_jason_on_load' => true,
306
-    );
307
-
308
-    if (is_single()) {
309
-
310
-        global $post;
311
-        $map_default_lat = $address_latitude = $post->post_latitude;
312
-        $map_default_lng = $address_longitude = $post->post_longitude;
313
-        $mapview = $post->post_mapview;
314
-        $map_args['zoom'] = $post->post_mapzoom;
315
-        $map_args['map_class_name'] = 'geodir-map-listing-page-single';
316
-
317
-    } else {
318
-        $default_location = geodir_get_default_location();
319
-
320
-        $map_default_lat = isset($default_location->city_latitude) ? $default_location->city_latitude : '';
321
-        $map_default_lng = isset($default_location->city_longitude) ? $default_location->city_longitude : '';
322
-        $map_args['map_class_name'] = 'geodir-map-listing-page';
323
-    }
324
-
325
-    if (empty($mapview)) {
326
-        $mapview = 'ROADMAP';
327
-    }
328
-
329
-    // Set default map options
330
-    $map_args['ajax_url'] = geodir_get_ajax_url();
331
-    $map_args['latitude'] = $map_default_lat;
332
-    $map_args['longitude'] = $map_default_lng;
333
-    $map_args['streetViewControl'] = true;
334
-    $map_args['maptype'] = $mapview;
335
-    $map_args['showPreview'] = '0';
336
-    $map_args['maxZoom'] = 21;
337
-    $map_args['bubble_size'] = 'small';
285
+	);
286
+
287
+	$params = shortcode_atts($defaults, $atts);
288
+
289
+	$params = gdsc_validate_map_args($params);
290
+
291
+	$map_args = array(
292
+		'map_canvas_name' => 'gd_listing_map',
293
+		'width' => $params['width'],
294
+		'height' => $params['height'],
295
+		'zoom' => $params['zoom'],
296
+		'autozoom' => $params['autozoom'],
297
+		'sticky' => $params['sticky'],
298
+		'showall' => $params['showall'],
299
+		'scrollwheel' => $params['scrollwheel'],
300
+		'child_collapse' => 0,
301
+		'enable_cat_filters' => false,
302
+		'enable_text_search' => false,
303
+		'enable_post_type_filters' => false,
304
+		'enable_location_filters' => false,
305
+		'enable_jason_on_load' => true,
306
+	);
307
+
308
+	if (is_single()) {
309
+
310
+		global $post;
311
+		$map_default_lat = $address_latitude = $post->post_latitude;
312
+		$map_default_lng = $address_longitude = $post->post_longitude;
313
+		$mapview = $post->post_mapview;
314
+		$map_args['zoom'] = $post->post_mapzoom;
315
+		$map_args['map_class_name'] = 'geodir-map-listing-page-single';
316
+
317
+	} else {
318
+		$default_location = geodir_get_default_location();
319
+
320
+		$map_default_lat = isset($default_location->city_latitude) ? $default_location->city_latitude : '';
321
+		$map_default_lng = isset($default_location->city_longitude) ? $default_location->city_longitude : '';
322
+		$map_args['map_class_name'] = 'geodir-map-listing-page';
323
+	}
324
+
325
+	if (empty($mapview)) {
326
+		$mapview = 'ROADMAP';
327
+	}
328
+
329
+	// Set default map options
330
+	$map_args['ajax_url'] = geodir_get_ajax_url();
331
+	$map_args['latitude'] = $map_default_lat;
332
+	$map_args['longitude'] = $map_default_lng;
333
+	$map_args['streetViewControl'] = true;
334
+	$map_args['maptype'] = $mapview;
335
+	$map_args['showPreview'] = '0';
336
+	$map_args['maxZoom'] = 21;
337
+	$map_args['bubble_size'] = 'small';
338 338
 	
339 339
 	// Add marker cluster
340 340
 	if (isset($params['marker_cluster']) && gdsc_to_bool_val($params['marker_cluster']) && defined('GDCLUSTER_VERSION')) {
@@ -343,13 +343,13 @@  discard block
 block discarded – undo
343 343
 		$map_args['enable_marker_cluster'] = false;
344 344
 	}
345 345
 
346
-    geodir_draw_map($map_args);
346
+	geodir_draw_map($map_args);
347 347
 
348
-    $output = ob_get_contents();
348
+	$output = ob_get_contents();
349 349
 
350
-    ob_end_clean();
350
+	ob_end_clean();
351 351
 
352
-    return $output;
352
+	return $output;
353 353
 }
354 354
 
355 355
 add_shortcode('gd_listing_slider', 'geodir_sc_listing_slider');
@@ -382,120 +382,120 @@  discard block
 block discarded – undo
382 382
  */
383 383
 function geodir_sc_listing_slider($atts)
384 384
 {
385
-    ob_start();
386
-    $defaults = array(
387
-        'post_type' => 'gd_place',
388
-        'category' => '0',
389
-        'post_number' => '5',
390
-        'slideshow' => '0',
391
-        'animation_loop' => 0,
392
-        'direction_nav' => 0,
393
-        'slideshow_speed' => 5000,
394
-        'animation_speed' => 600,
395
-        'animation' => 'slide',
396
-        'order_by' => 'latest',
397
-        'show_title' => '',
398
-        'show_featured_only' => '',
399
-        'title' => '',
400
-    );
401
-
402
-    $params = shortcode_atts($defaults, $atts);
403
-
404
-
405
-    /*
385
+	ob_start();
386
+	$defaults = array(
387
+		'post_type' => 'gd_place',
388
+		'category' => '0',
389
+		'post_number' => '5',
390
+		'slideshow' => '0',
391
+		'animation_loop' => 0,
392
+		'direction_nav' => 0,
393
+		'slideshow_speed' => 5000,
394
+		'animation_speed' => 600,
395
+		'animation' => 'slide',
396
+		'order_by' => 'latest',
397
+		'show_title' => '',
398
+		'show_featured_only' => '',
399
+		'title' => '',
400
+	);
401
+
402
+	$params = shortcode_atts($defaults, $atts);
403
+
404
+
405
+	/*
406 406
      *
407 407
      * Now we begin the validation of the attributes.
408 408
      */
409
-    // Check we have a valid post_type
410
-    if (!(gdsc_is_post_type_valid($params['post_type']))) {
411
-        $params['post_type'] = 'gd_place';
412
-    }
413
-
414
-    // Check we have a valid sort_order
415
-    $params['order_by'] = gdsc_validate_sort_choice($params['order_by']);
416
-
417
-    // Match the chosen animation to our options
418
-    $animation_list = array('slide', 'fade');
419
-    if (!(in_array($params['animation'], $animation_list))) {
420
-        $params['animation'] = 'slide';
421
-    }
422
-
423
-    // Post_number needs to be a positive integer
424
-    $params['post_number'] = absint($params['post_number']);
425
-    if (0 == $params['post_number']) {
426
-        $params['post_number'] = 1;
427
-    }
428
-
429
-    // Manage the entered categories
430
-    if (0 != $params['category'] || '' != $params['category']) {
431
-        $params['category'] = gdsc_manage_category_choice($params['post_type'], $params['category']);
432
-    }
433
-    // Convert show_title to a bool
434
-    $params['show_title'] = intval(gdsc_to_bool_val($params['show_title']));
435
-
436
-    // Convert show_featured_only to a bool
437
-    $params['show_featured_only'] = intval(gdsc_to_bool_val($params['show_featured_only']));
438
-
439
-    /*
409
+	// Check we have a valid post_type
410
+	if (!(gdsc_is_post_type_valid($params['post_type']))) {
411
+		$params['post_type'] = 'gd_place';
412
+	}
413
+
414
+	// Check we have a valid sort_order
415
+	$params['order_by'] = gdsc_validate_sort_choice($params['order_by']);
416
+
417
+	// Match the chosen animation to our options
418
+	$animation_list = array('slide', 'fade');
419
+	if (!(in_array($params['animation'], $animation_list))) {
420
+		$params['animation'] = 'slide';
421
+	}
422
+
423
+	// Post_number needs to be a positive integer
424
+	$params['post_number'] = absint($params['post_number']);
425
+	if (0 == $params['post_number']) {
426
+		$params['post_number'] = 1;
427
+	}
428
+
429
+	// Manage the entered categories
430
+	if (0 != $params['category'] || '' != $params['category']) {
431
+		$params['category'] = gdsc_manage_category_choice($params['post_type'], $params['category']);
432
+	}
433
+	// Convert show_title to a bool
434
+	$params['show_title'] = intval(gdsc_to_bool_val($params['show_title']));
435
+
436
+	// Convert show_featured_only to a bool
437
+	$params['show_featured_only'] = intval(gdsc_to_bool_val($params['show_featured_only']));
438
+
439
+	/*
440 440
      * Hopefully all attributes are now valid, and safe to pass forward
441 441
      */
442 442
 
443
-    // redeclare vars after validation
444
-
445
-    if (isset($params['direction_nav'])) {
446
-        $params['directionNav'] = $params['direction_nav'];
447
-    }
448
-    if (isset($params['animation_loop'])) {
449
-        $params['animationLoop'] = $params['animation_loop'];
450
-    }
451
-    if (isset($params['slideshow_speed'])) {
452
-        $params['slideshowSpeed'] = $params['slideshow_speed'];
453
-    }
454
-    if (isset($params['animation_speed'])) {
455
-        $params['animationSpeed'] = $params['animation_speed'];
456
-    }
457
-    if (isset($params['order_by'])) {
458
-        $params['list_sort'] = $params['order_by'];
459
-    }
460
-
461
-    $query_args = array(
462
-        'post_number' => $params['post_number'],
463
-        'is_geodir_loop' => true,
464
-        'post_type' => $params['post_type'],
465
-        'order_by' => $params['order_by']
466
-    );
467
-
468
-    if (1 == $params['show_featured_only']) {
469
-        $query_args['show_featured_only'] = 1;
470
-    }
471
-
472
-    if (0 != $params['category'] && '' != $params['category']) {
473
-        $category_taxonomy = geodir_get_taxonomies($params['post_type']);
474
-        $tax_query = array(
475
-            'taxonomy' => $category_taxonomy[0],
476
-            'field' => 'id',
477
-            'terms' => $params['category'],
478
-        );
479
-
480
-        $query_args['tax_query'] = array($tax_query);
481
-    }
482
-
483
-    $defaults = array(
484
-        'before_widget' => '',
485
-        'after_widget' => '',
486
-        'before_title' => '',
487
-        'after_title' => '',
488
-    );
489
-
490
-    $query_args = array_merge($query_args, $params);
491
-
492
-    geodir_listing_slider_widget_output($defaults, $query_args);
493
-
494
-    $output = ob_get_contents();
495
-
496
-    ob_end_clean();
497
-
498
-    return $output;
443
+	// redeclare vars after validation
444
+
445
+	if (isset($params['direction_nav'])) {
446
+		$params['directionNav'] = $params['direction_nav'];
447
+	}
448
+	if (isset($params['animation_loop'])) {
449
+		$params['animationLoop'] = $params['animation_loop'];
450
+	}
451
+	if (isset($params['slideshow_speed'])) {
452
+		$params['slideshowSpeed'] = $params['slideshow_speed'];
453
+	}
454
+	if (isset($params['animation_speed'])) {
455
+		$params['animationSpeed'] = $params['animation_speed'];
456
+	}
457
+	if (isset($params['order_by'])) {
458
+		$params['list_sort'] = $params['order_by'];
459
+	}
460
+
461
+	$query_args = array(
462
+		'post_number' => $params['post_number'],
463
+		'is_geodir_loop' => true,
464
+		'post_type' => $params['post_type'],
465
+		'order_by' => $params['order_by']
466
+	);
467
+
468
+	if (1 == $params['show_featured_only']) {
469
+		$query_args['show_featured_only'] = 1;
470
+	}
471
+
472
+	if (0 != $params['category'] && '' != $params['category']) {
473
+		$category_taxonomy = geodir_get_taxonomies($params['post_type']);
474
+		$tax_query = array(
475
+			'taxonomy' => $category_taxonomy[0],
476
+			'field' => 'id',
477
+			'terms' => $params['category'],
478
+		);
479
+
480
+		$query_args['tax_query'] = array($tax_query);
481
+	}
482
+
483
+	$defaults = array(
484
+		'before_widget' => '',
485
+		'after_widget' => '',
486
+		'before_title' => '',
487
+		'after_title' => '',
488
+	);
489
+
490
+	$query_args = array_merge($query_args, $params);
491
+
492
+	geodir_listing_slider_widget_output($defaults, $query_args);
493
+
494
+	$output = ob_get_contents();
495
+
496
+	ob_end_clean();
497
+
498
+	return $output;
499 499
 }
500 500
 
501 501
 add_shortcode('gd_login_box', 'geodir_sc_login_box');
@@ -519,22 +519,22 @@  discard block
 block discarded – undo
519 519
  */
520 520
 function geodir_sc_login_box($atts)
521 521
 {
522
-    ob_start();
522
+	ob_start();
523 523
 
524
-    $defaults = array(
525
-        'before_widget' => '',
526
-        'after_widget' => '',
527
-        'before_title' => '',
528
-        'after_title' => '',
529
-    );
524
+	$defaults = array(
525
+		'before_widget' => '',
526
+		'after_widget' => '',
527
+		'before_title' => '',
528
+		'after_title' => '',
529
+	);
530 530
 
531
-    geodir_loginwidget_output($defaults, $defaults);
531
+	geodir_loginwidget_output($defaults, $defaults);
532 532
 
533
-    $output = ob_get_contents();
533
+	$output = ob_get_contents();
534 534
 
535
-    ob_end_clean();
535
+	ob_end_clean();
536 536
 
537
-    return $output;
537
+	return $output;
538 538
 }
539 539
 
540 540
 add_shortcode('gd_popular_post_category', 'geodir_sc_popular_post_category');
@@ -563,28 +563,28 @@  discard block
 block discarded – undo
563 563
  */
564 564
 function geodir_sc_popular_post_category($atts)
565 565
 {
566
-    ob_start();
567
-    global $geodir_post_category_str;
568
-    $defaults = array(
569
-        'category_limit' => 15,
570
-        'before_widget' => '',
571
-        'after_widget' => '',
572
-        'before_title' => '',
573
-        'after_title' => '',
574
-        'title' => '',
566
+	ob_start();
567
+	global $geodir_post_category_str;
568
+	$defaults = array(
569
+		'category_limit' => 15,
570
+		'before_widget' => '',
571
+		'after_widget' => '',
572
+		'before_title' => '',
573
+		'after_title' => '',
574
+		'title' => '',
575 575
 		'default_post_type' => '',
576
-    );
576
+	);
577 577
 
578
-    $params = shortcode_atts($defaults, $atts, 'popular_post_category');
579
-    $params['category_limit'] = absint($params['category_limit']);
578
+	$params = shortcode_atts($defaults, $atts, 'popular_post_category');
579
+	$params['category_limit'] = absint($params['category_limit']);
580 580
 	$params['default_post_type'] = gdsc_is_post_type_valid($params['default_post_type']) ? $params['default_post_type'] : '';
581
-    geodir_popular_post_category_output($params, $params);
581
+	geodir_popular_post_category_output($params, $params);
582 582
 
583
-    $output = ob_get_contents();
583
+	$output = ob_get_contents();
584 584
 
585
-    ob_end_clean();
585
+	ob_end_clean();
586 586
 
587
-    return $output;
587
+	return $output;
588 588
 }
589 589
 
590 590
 add_shortcode('gd_popular_post_view', 'geodir_sc_popular_post_view');
@@ -624,97 +624,97 @@  discard block
 block discarded – undo
624 624
  */
625 625
 function geodir_sc_popular_post_view($atts)
626 626
 {
627
-    ob_start();
628
-    $defaults = array(
629
-        'post_type' => 'gd_place',
630
-        'category' => '0',
631
-        'post_number' => '5',
632
-        'layout' => 'gridview_onehalf',
633
-        'add_location_filter' => '0',
634
-        'list_sort' => 'latest',
635
-        'use_viewing_post_type' => '1',
636
-        'character_count' => '20',
637
-        'listing_width' => '',
638
-        'show_featured_only' => '0',
639
-        'show_special_only' => '0',
640
-        'with_pics_only' => '0',
641
-        'with_videos_only' => '0',
642
-        'before_widget' => '',
643
-        'after_widget' => '',
644
-        'before_title' => '<h3 class="widget-title">',
645
-        'after_title' => '</h3>',
646
-        'title' => '',
647
-        'category_title' => '',
648
-    );
649
-
650
-    $params = shortcode_atts($defaults, $atts);
651
-
652
-    /**
653
-     * Validate our incoming params
654
-     */
627
+	ob_start();
628
+	$defaults = array(
629
+		'post_type' => 'gd_place',
630
+		'category' => '0',
631
+		'post_number' => '5',
632
+		'layout' => 'gridview_onehalf',
633
+		'add_location_filter' => '0',
634
+		'list_sort' => 'latest',
635
+		'use_viewing_post_type' => '1',
636
+		'character_count' => '20',
637
+		'listing_width' => '',
638
+		'show_featured_only' => '0',
639
+		'show_special_only' => '0',
640
+		'with_pics_only' => '0',
641
+		'with_videos_only' => '0',
642
+		'before_widget' => '',
643
+		'after_widget' => '',
644
+		'before_title' => '<h3 class="widget-title">',
645
+		'after_title' => '</h3>',
646
+		'title' => '',
647
+		'category_title' => '',
648
+	);
655 649
 
656
-    // Validate the selected post type, default to gd_place on fail
657
-    if (!(gdsc_is_post_type_valid($params['post_type']))) {
658
-        $params['post_type'] = 'gd_place';
659
-    }
660
-
661
-    // Validate the selected category/ies - Grab the current list based on post_type
662
-    $category_taxonomy = geodir_get_taxonomies($params['post_type']);
663
-    $categories = get_terms($category_taxonomy, array('orderby' => 'count', 'order' => 'DESC', 'fields' => 'ids'));
664
-
665
-    // Make sure we have an array
666
-    if (!(is_array($params['category']))) {
667
-        $params['category'] = explode(',', $params['category']);
668
-    }
669
-
670
-    // Array_intersect returns only the items in $params['category'] that are also in our category list
671
-    // Otherwise it becomes empty and later on that will mean "All"
672
-    $params['category'] = array_intersect($params['category'], $categories);
673
-
674
-    // Post_number needs to be a positive integer
675
-    $params['post_number'] = absint($params['post_number']);
676
-    if (0 == $params['post_number']) {
677
-        $params['post_number'] = 1;
678
-    }
679
-
680
-    // Validate our layout choice
681
-    // Outside of the norm, I added some more simple terms to match the existing
682
-    // So now I just run the switch to set it properly.
683
-    $params['layout'] = gdsc_validate_layout_choice($params['layout']);
684
-
685
-    // Validate our sorting choice
686
-    $params['list_sort'] = gdsc_validate_sort_choice($params['list_sort']);
687
-
688
-    // Validate character_count
689
-    $params['character_count'] = absint($params['character_count']);
690
-    if (20 > $params['character_count']) {
691
-        $params['character_count'] = 20;
692
-    }
693
-
694
-    // Validate Listing width, used in the template widget-listing-listview.php
695
-    // The context is in width=$listing_width% - So we need a positive number between 0 & 100
696
-    $params['listing_width'] = gdsc_validate_listing_width($params['listing_width']);
697
-
698
-    // Validate the checkboxes used on the widget
699
-    $params['add_location_filter'] = gdsc_to_bool_val($params['add_location_filter']);
700
-    $params['show_featured_only'] = gdsc_to_bool_val($params['show_featured_only']);
701
-    $params['show_special_only'] = gdsc_to_bool_val($params['show_special_only']);
702
-    $params['with_pics_only'] = gdsc_to_bool_val($params['with_pics_only']);
703
-    $params['with_videos_only'] = gdsc_to_bool_val($params['with_videos_only']);
704
-    $params['use_viewing_post_type'] = gdsc_to_bool_val($params['use_viewing_post_type']);
705
-
706
-    /**
707
-     * End of validation
708
-     */
650
+	$params = shortcode_atts($defaults, $atts);
651
+
652
+	/**
653
+	 * Validate our incoming params
654
+	 */
655
+
656
+	// Validate the selected post type, default to gd_place on fail
657
+	if (!(gdsc_is_post_type_valid($params['post_type']))) {
658
+		$params['post_type'] = 'gd_place';
659
+	}
709 660
 
710
-    geodir_popular_postview_output($params, $params);
661
+	// Validate the selected category/ies - Grab the current list based on post_type
662
+	$category_taxonomy = geodir_get_taxonomies($params['post_type']);
663
+	$categories = get_terms($category_taxonomy, array('orderby' => 'count', 'order' => 'DESC', 'fields' => 'ids'));
711 664
 
665
+	// Make sure we have an array
666
+	if (!(is_array($params['category']))) {
667
+		$params['category'] = explode(',', $params['category']);
668
+	}
669
+
670
+	// Array_intersect returns only the items in $params['category'] that are also in our category list
671
+	// Otherwise it becomes empty and later on that will mean "All"
672
+	$params['category'] = array_intersect($params['category'], $categories);
673
+
674
+	// Post_number needs to be a positive integer
675
+	$params['post_number'] = absint($params['post_number']);
676
+	if (0 == $params['post_number']) {
677
+		$params['post_number'] = 1;
678
+	}
712 679
 
713
-    $output = ob_get_contents();
680
+	// Validate our layout choice
681
+	// Outside of the norm, I added some more simple terms to match the existing
682
+	// So now I just run the switch to set it properly.
683
+	$params['layout'] = gdsc_validate_layout_choice($params['layout']);
714 684
 
715
-    ob_end_clean();
685
+	// Validate our sorting choice
686
+	$params['list_sort'] = gdsc_validate_sort_choice($params['list_sort']);
716 687
 
717
-    return $output;
688
+	// Validate character_count
689
+	$params['character_count'] = absint($params['character_count']);
690
+	if (20 > $params['character_count']) {
691
+		$params['character_count'] = 20;
692
+	}
693
+
694
+	// Validate Listing width, used in the template widget-listing-listview.php
695
+	// The context is in width=$listing_width% - So we need a positive number between 0 & 100
696
+	$params['listing_width'] = gdsc_validate_listing_width($params['listing_width']);
697
+
698
+	// Validate the checkboxes used on the widget
699
+	$params['add_location_filter'] = gdsc_to_bool_val($params['add_location_filter']);
700
+	$params['show_featured_only'] = gdsc_to_bool_val($params['show_featured_only']);
701
+	$params['show_special_only'] = gdsc_to_bool_val($params['show_special_only']);
702
+	$params['with_pics_only'] = gdsc_to_bool_val($params['with_pics_only']);
703
+	$params['with_videos_only'] = gdsc_to_bool_val($params['with_videos_only']);
704
+	$params['use_viewing_post_type'] = gdsc_to_bool_val($params['use_viewing_post_type']);
705
+
706
+	/**
707
+	 * End of validation
708
+	 */
709
+
710
+	geodir_popular_postview_output($params, $params);
711
+
712
+
713
+	$output = ob_get_contents();
714
+
715
+	ob_end_clean();
716
+
717
+	return $output;
718 718
 }
719 719
 
720 720
 add_shortcode('gd_recent_reviews', 'geodir_sc_recent_reviews');
@@ -736,37 +736,37 @@  discard block
 block discarded – undo
736 736
  * @return string Recent reviews HTML.
737 737
  */
738 738
 function geodir_sc_recent_reviews($atts) {
739
-    ob_start();
740
-    $defaults = array(
739
+	ob_start();
740
+	$defaults = array(
741 741
 		'title' => '',
742 742
 		'count' => 5,
743
-    );
743
+	);
744 744
 
745
-    $params = shortcode_atts($defaults, $atts);
745
+	$params = shortcode_atts($defaults, $atts);
746 746
 
747
-    $count = absint($params['count']);
748
-    if (0 == $count) {
749
-        $count = 1;
750
-    }
747
+	$count = absint($params['count']);
748
+	if (0 == $count) {
749
+		$count = 1;
750
+	}
751 751
 	
752 752
 	$title = !empty($params['title']) ? __($params['title'], 'geodirectory') : '';
753 753
 
754
-    $comments_li = geodir_get_recent_reviews(30, $count, 100, false);
754
+	$comments_li = geodir_get_recent_reviews(30, $count, 100, false);
755 755
 
756
-    if ($comments_li) {
757
-        if ($title != '') { ?>
756
+	if ($comments_li) {
757
+		if ($title != '') { ?>
758 758
 		<h3 class="geodir-sc-recent-reviews-title widget-title"><?php echo $title; ?></h3>
759 759
 		<?php } ?>
760 760
         <div class="geodir_sc_recent_reviews_section">
761 761
             <ul class="geodir_sc_recent_reviews"><?php echo $comments_li; ?></ul>
762 762
         </div>
763 763
     <?php
764
-    }
765
-    $output = ob_get_contents();
764
+	}
765
+	$output = ob_get_contents();
766 766
 
767
-    ob_end_clean();
767
+	ob_end_clean();
768 768
 
769
-    return $output;
769
+	return $output;
770 770
 }
771 771
 
772 772
 add_shortcode('gd_related_listings', 'geodir_sc_related_listings');
@@ -796,64 +796,64 @@  discard block
 block discarded – undo
796 796
  */
797 797
 function geodir_sc_related_listings($atts)
798 798
 {
799
-    ob_start();
800
-    $defaults = array(
801
-        'post_number' => 5,
802
-        'relate_to' => 'category',
803
-        'layout' => 'gridview_onehalf',
804
-        'add_location_filter' => 0,
805
-        'listing_width' => '',
806
-        'list_sort' => 'latest',
807
-        'character_count' => 20,
808
-        'is_widget' => 1,
809
-        'before_title' => '<style type="text/css">.geodir_category_list_view li{margin:0px!important}</style>',
810
-    );
811
-    // The "before_title" code is an ugly & terrible hack. But it works for now. I should enqueue a new stylesheet.
812
-
813
-    $params = shortcode_atts($defaults, $atts);
814
-
815
-    /**
816
-     * Begin validating parameters
817
-     */
799
+	ob_start();
800
+	$defaults = array(
801
+		'post_number' => 5,
802
+		'relate_to' => 'category',
803
+		'layout' => 'gridview_onehalf',
804
+		'add_location_filter' => 0,
805
+		'listing_width' => '',
806
+		'list_sort' => 'latest',
807
+		'character_count' => 20,
808
+		'is_widget' => 1,
809
+		'before_title' => '<style type="text/css">.geodir_category_list_view li{margin:0px!important}</style>',
810
+	);
811
+	// The "before_title" code is an ugly & terrible hack. But it works for now. I should enqueue a new stylesheet.
812
+
813
+	$params = shortcode_atts($defaults, $atts);
814
+
815
+	/**
816
+	 * Begin validating parameters
817
+	 */
818 818
 
819
-    // Validate that post_number is a number and is 1 or higher
820
-    $params['post_number'] = absint($params['post_number']);
821
-    if (0 === $params['post_number']) {
822
-        $params['post_number'] = 1;
823
-    }
819
+	// Validate that post_number is a number and is 1 or higher
820
+	$params['post_number'] = absint($params['post_number']);
821
+	if (0 === $params['post_number']) {
822
+		$params['post_number'] = 1;
823
+	}
824 824
 
825
-    // Validate relate_to - only category or tags
826
-    $params['relate_to'] = geodir_strtolower($params['relate_to']);
827
-    if ('category' != $params['relate_to'] && 'tags' != $params['relate_to']) {
828
-        $params['relate_to'] = 'category';
829
-    }
825
+	// Validate relate_to - only category or tags
826
+	$params['relate_to'] = geodir_strtolower($params['relate_to']);
827
+	if ('category' != $params['relate_to'] && 'tags' != $params['relate_to']) {
828
+		$params['relate_to'] = 'category';
829
+	}
830 830
 
831
-    // Validate layout selection
832
-    $params['layout'] = gdsc_validate_layout_choice($params['layout']);
831
+	// Validate layout selection
832
+	$params['layout'] = gdsc_validate_layout_choice($params['layout']);
833 833
 
834
-    // Validate sorting option
835
-    $params['list_sort'] = gdsc_validate_sort_choice($params['list_sort']);
834
+	// Validate sorting option
835
+	$params['list_sort'] = gdsc_validate_sort_choice($params['list_sort']);
836 836
 
837
-    // Validate add_location_filter
838
-    $params['add_location_filter'] = gdsc_to_bool_val($params['add_location_filter']);
837
+	// Validate add_location_filter
838
+	$params['add_location_filter'] = gdsc_to_bool_val($params['add_location_filter']);
839 839
 
840
-    // Validate listing_width
841
-    $params['listing_width'] = gdsc_validate_listing_width($params['listing_width']);
840
+	// Validate listing_width
841
+	$params['listing_width'] = gdsc_validate_listing_width($params['listing_width']);
842 842
 
843
-    // Validate character_count
844
-    $params['character_count'] = absint($params['character_count']);
845
-    if (20 > $params['character_count']) {
846
-        $params['character_count'] = 20;
847
-    }
843
+	// Validate character_count
844
+	$params['character_count'] = absint($params['character_count']);
845
+	if (20 > $params['character_count']) {
846
+		$params['character_count'] = 20;
847
+	}
848 848
 
849
-    if ($related_display = geodir_related_posts_display($params)) {
850
-        echo $related_display;
851
-    }
852
-    $output = ob_get_contents();
849
+	if ($related_display = geodir_related_posts_display($params)) {
850
+		echo $related_display;
851
+	}
852
+	$output = ob_get_contents();
853 853
 
854
-    ob_end_clean();
854
+	ob_end_clean();
855 855
 
856
-    return $output;
856
+	return $output;
857 857
 }
858 858
 
859 859
 /**
@@ -877,12 +877,12 @@  discard block
 block discarded – undo
877 877
  * @return string Advanced search widget HTML.
878 878
  */
879 879
 function geodir_sc_advanced_search($atts) {
880
-    $defaults = array(
880
+	$defaults = array(
881 881
 		'title' => '',
882 882
 		'before_widget' => '<section id="geodir_advanced_search-1" class="widget geodir-widget geodir_advanced_search_widget">',
883
-        'after_widget' => '</section>',
884
-        'before_title' => '<h3 class="widget-title">',
885
-        'after_title' => '</h3>',
883
+		'after_widget' => '</section>',
884
+		'before_title' => '<h3 class="widget-title">',
885
+		'after_title' => '</h3>',
886 886
 		'show_adv_search' => 'default'
887 887
 	);
888 888
 	
@@ -906,9 +906,9 @@  discard block
 block discarded – undo
906 906
 	the_widget('geodir_advance_search_widget', $params, $params );
907 907
 	
908 908
 	$output = ob_get_contents();
909
-    ob_end_clean();
909
+	ob_end_clean();
910 910
 
911
-    return $output;
911
+	return $output;
912 912
 }
913 913
 add_shortcode('gd_advanced_search', 'geodir_sc_advanced_search');
914 914
 
@@ -954,48 +954,48 @@  discard block
 block discarded – undo
954 954
 		'add_location_filter' => '1',
955 955
 		'tab_layout' => 'bestof-tabs-on-top',
956 956
 		'before_widget' => '<section id="bestof_widget-1" class="widget geodir-widget geodir_bestof_widget geodir_sc_bestof_widget">',
957
-        'after_widget' => '</section>',
958
-        'before_title' => '<h3 class="widget-title">',
959
-        'after_title' => '</h3>',
957
+		'after_widget' => '</section>',
958
+		'before_title' => '<h3 class="widget-title">',
959
+		'after_title' => '</h3>',
960 960
 	);
961 961
 	$params = shortcode_atts($defaults, $atts);
962 962
 
963
-    /**
964
-     * Validate our incoming params
965
-     */
963
+	/**
964
+	 * Validate our incoming params
965
+	 */
966 966
 
967
-    // Validate the selected post type, default to gd_place on fail
968
-    if (!(gdsc_is_post_type_valid($params['post_type']))) {
969
-        $params['post_type'] = 'gd_place';
970
-    }
967
+	// Validate the selected post type, default to gd_place on fail
968
+	if (!(gdsc_is_post_type_valid($params['post_type']))) {
969
+		$params['post_type'] = 'gd_place';
970
+	}
971 971
 	
972 972
 	// Post limit needs to be a positive integer
973
-    $params['post_limit'] = absint($params['post_limit']);
974
-    if (0 == $params['post_limit']) {
975
-        $params['post_limit'] = 5;
976
-    }
973
+	$params['post_limit'] = absint($params['post_limit']);
974
+	if (0 == $params['post_limit']) {
975
+		$params['post_limit'] = 5;
976
+	}
977 977
 	
978 978
 	// Category limit needs to be a positive integer
979
-    $params['categ_limit'] = absint($params['categ_limit']);
980
-    if (0 == $params['categ_limit']) {
981
-        $params['categ_limit'] = 3;
982
-    }
979
+	$params['categ_limit'] = absint($params['categ_limit']);
980
+	if (0 == $params['categ_limit']) {
981
+		$params['categ_limit'] = 3;
982
+	}
983 983
 	
984 984
 	// Tab layout validation
985
-    $params['tab_layout'] = $params['tab_layout'];
986
-    if (!in_array($params['tab_layout'], array('bestof-tabs-on-top', 'bestof-tabs-on-left', 'bestof-tabs-as-dropdown'))) {
987
-        $params['tab_layout'] = 'bestof-tabs-on-top';
988
-    }
985
+	$params['tab_layout'] = $params['tab_layout'];
986
+	if (!in_array($params['tab_layout'], array('bestof-tabs-on-top', 'bestof-tabs-on-left', 'bestof-tabs-as-dropdown'))) {
987
+		$params['tab_layout'] = 'bestof-tabs-on-top';
988
+	}
989 989
 	
990 990
 	// Validate character_count
991
-    $params['character_count'] = $params['character_count'];
991
+	$params['character_count'] = $params['character_count'];
992 992
 
993 993
 	ob_start();
994 994
 	the_widget('geodir_bestof_widget', $params, $params);
995
-    $output = ob_get_contents();
996
-    ob_end_clean();
995
+	$output = ob_get_contents();
996
+	ob_end_clean();
997 997
 
998
-    return $output;
998
+	return $output;
999 999
 }
1000 1000
 add_shortcode('gd_bestof_widget', 'geodir_sc_bestof_widget');
1001 1001
 
@@ -1041,105 +1041,105 @@  discard block
 block discarded – undo
1041 1041
  * @return string HTML content to display geodirectory listings.
1042 1042
  */
1043 1043
 function geodir_sc_gd_listings($atts, $content = '') {
1044
-    global $post;
1044
+	global $post;
1045 1045
     
1046
-    $defaults = array(
1047
-        'title'                 => '',
1048
-        'post_type'             => 'gd_place',
1049
-        'category'              => 0,
1050
-        'list_sort'             => 'latest',
1051
-        'event_type'            => '',
1052
-        'post_number'           => 10,
1053
-        'post_author'           => '',
1054
-        'layout'                => 'gridview_onehalf',
1055
-        'listing_width'         => '',
1056
-        'character_count'       => 20,
1057
-        'add_location_filter'   => 1,
1058
-        'show_featured_only'    => '',
1059
-        'show_special_only'     => '',
1060
-        'with_pics_only'        => '',
1061
-        'with_videos_only'      => '',
1062
-        'with_pagination'       => '1',
1063
-        'top_pagination'        => '0',
1064
-        'bottom_pagination'     => '1',
1065
-    );
1066
-    $params = shortcode_atts($defaults, $atts);
1067
-
1068
-    $params['title']        = wp_strip_all_tags($params['title']);
1069
-    $params['post_type']    = gdsc_is_post_type_valid($params['post_type']) ? $params['post_type'] : 'gd_place';
1070
-
1071
-    // Validate the selected category/ies - Grab the current list based on post_type
1072
-    $category_taxonomy      = geodir_get_taxonomies($params['post_type']);
1073
-    $categories             = get_terms($category_taxonomy, array('orderby' => 'count', 'order' => 'DESC', 'fields' => 'ids'));
1074
-
1075
-    // Make sure we have an array
1076
-    if (!(is_array($params['category']))) {
1077
-        $params['category'] = explode(',', $params['category']);
1078
-    }
1079
-
1080
-    // Array_intersect returns only the items in $params['category'] that are also in our category list
1081
-    // Otherwise it becomes empty and later on that will mean "All"
1082
-    $params['category']     = array_intersect($params['category'], $categories);
1083
-
1084
-    // Post_number needs to be a positive integer
1085
-    $params['post_number']  = absint($params['post_number']);
1086
-    $params['post_number']  = $params['post_number'] > 0 ? $params['post_number'] : 10;
1046
+	$defaults = array(
1047
+		'title'                 => '',
1048
+		'post_type'             => 'gd_place',
1049
+		'category'              => 0,
1050
+		'list_sort'             => 'latest',
1051
+		'event_type'            => '',
1052
+		'post_number'           => 10,
1053
+		'post_author'           => '',
1054
+		'layout'                => 'gridview_onehalf',
1055
+		'listing_width'         => '',
1056
+		'character_count'       => 20,
1057
+		'add_location_filter'   => 1,
1058
+		'show_featured_only'    => '',
1059
+		'show_special_only'     => '',
1060
+		'with_pics_only'        => '',
1061
+		'with_videos_only'      => '',
1062
+		'with_pagination'       => '1',
1063
+		'top_pagination'        => '0',
1064
+		'bottom_pagination'     => '1',
1065
+	);
1066
+	$params = shortcode_atts($defaults, $atts);
1067
+
1068
+	$params['title']        = wp_strip_all_tags($params['title']);
1069
+	$params['post_type']    = gdsc_is_post_type_valid($params['post_type']) ? $params['post_type'] : 'gd_place';
1070
+
1071
+	// Validate the selected category/ies - Grab the current list based on post_type
1072
+	$category_taxonomy      = geodir_get_taxonomies($params['post_type']);
1073
+	$categories             = get_terms($category_taxonomy, array('orderby' => 'count', 'order' => 'DESC', 'fields' => 'ids'));
1074
+
1075
+	// Make sure we have an array
1076
+	if (!(is_array($params['category']))) {
1077
+		$params['category'] = explode(',', $params['category']);
1078
+	}
1079
+
1080
+	// Array_intersect returns only the items in $params['category'] that are also in our category list
1081
+	// Otherwise it becomes empty and later on that will mean "All"
1082
+	$params['category']     = array_intersect($params['category'], $categories);
1083
+
1084
+	// Post_number needs to be a positive integer
1085
+	$params['post_number']  = absint($params['post_number']);
1086
+	$params['post_number']  = $params['post_number'] > 0 ? $params['post_number'] : 10;
1087 1087
     
1088
-    // Post_number needs to be a positive integer
1089
-    if (!empty($atts['post_author'])) {
1090
-        if ($atts['post_author'] == 'current' && !empty($post) && isset($post->post_author) && $post->post_type != 'page') {
1091
-            $params['post_author'] = $post->post_author;
1092
-        } else if ($atts['post_author'] != 'current' && absint($atts['post_author']) > 0) {
1093
-            $params['post_author'] = absint($atts['post_author']);
1094
-        } else {
1095
-            unset($params['post_author']);
1096
-        }
1097
-    } else {
1098
-        unset($params['post_author']);
1099
-    }
1100
-
1101
-    // Validate character_count
1102
-    //todo: is this necessary?
1103
-    $params['character_count']  = $params['character_count'];
1104
-
1105
-    // Validate our layout choice
1106
-    // Outside of the norm, I added some more simple terms to match the existing
1107
-    // So now I just run the switch to set it properly.
1108
-    $params['layout']           = gdsc_validate_layout_choice($params['layout']);
1109
-
1110
-    // Validate our sorting choice
1111
-    $params['list_sort']        = gdsc_validate_sort_choice($params['list_sort']);
1112
-
1113
-    // Validate Listing width, used in the template widget-listing-listview.php
1114
-    // The context is in width=$listing_width% - So we need a positive number between 0 & 100
1115
-    $params['listing_width']    = gdsc_validate_listing_width($params['listing_width']);
1116
-
1117
-    // Validate the checkboxes used on the widget
1118
-    $params['add_location_filter']  = gdsc_to_bool_val($params['add_location_filter']);
1119
-    $params['show_featured_only']   = gdsc_to_bool_val($params['show_featured_only']);
1120
-    $params['show_special_only']    = gdsc_to_bool_val($params['show_special_only']);
1121
-    $params['with_pics_only']       = gdsc_to_bool_val($params['with_pics_only']);
1122
-    $params['with_videos_only']     = gdsc_to_bool_val($params['with_videos_only']);
1123
-    $params['with_pagination']      = gdsc_to_bool_val($params['with_pagination']);
1124
-    $params['top_pagination']       = gdsc_to_bool_val($params['top_pagination']);
1125
-    $params['bottom_pagination']    = gdsc_to_bool_val($params['bottom_pagination']);
1126
-
1127
-    /**
1128
-     * End of validation
1129
-     */
1130
-    if (isset($atts['geodir_ajax'])) {
1131
-        $params['geodir_ajax'] = $atts['geodir_ajax'];
1132
-        unset($atts['geodir_ajax']);
1133
-    }
1134
-    if (isset($atts['pageno'])) {
1135
-        $params['pageno'] = $atts['pageno'];
1136
-        unset($atts['pageno']);
1137
-    }
1138
-    $params['shortcode_atts']       = $atts;
1139
-
1140
-    $output = geodir_sc_gd_listings_output($params);
1141
-
1142
-    return $output;
1088
+	// Post_number needs to be a positive integer
1089
+	if (!empty($atts['post_author'])) {
1090
+		if ($atts['post_author'] == 'current' && !empty($post) && isset($post->post_author) && $post->post_type != 'page') {
1091
+			$params['post_author'] = $post->post_author;
1092
+		} else if ($atts['post_author'] != 'current' && absint($atts['post_author']) > 0) {
1093
+			$params['post_author'] = absint($atts['post_author']);
1094
+		} else {
1095
+			unset($params['post_author']);
1096
+		}
1097
+	} else {
1098
+		unset($params['post_author']);
1099
+	}
1100
+
1101
+	// Validate character_count
1102
+	//todo: is this necessary?
1103
+	$params['character_count']  = $params['character_count'];
1104
+
1105
+	// Validate our layout choice
1106
+	// Outside of the norm, I added some more simple terms to match the existing
1107
+	// So now I just run the switch to set it properly.
1108
+	$params['layout']           = gdsc_validate_layout_choice($params['layout']);
1109
+
1110
+	// Validate our sorting choice
1111
+	$params['list_sort']        = gdsc_validate_sort_choice($params['list_sort']);
1112
+
1113
+	// Validate Listing width, used in the template widget-listing-listview.php
1114
+	// The context is in width=$listing_width% - So we need a positive number between 0 & 100
1115
+	$params['listing_width']    = gdsc_validate_listing_width($params['listing_width']);
1116
+
1117
+	// Validate the checkboxes used on the widget
1118
+	$params['add_location_filter']  = gdsc_to_bool_val($params['add_location_filter']);
1119
+	$params['show_featured_only']   = gdsc_to_bool_val($params['show_featured_only']);
1120
+	$params['show_special_only']    = gdsc_to_bool_val($params['show_special_only']);
1121
+	$params['with_pics_only']       = gdsc_to_bool_val($params['with_pics_only']);
1122
+	$params['with_videos_only']     = gdsc_to_bool_val($params['with_videos_only']);
1123
+	$params['with_pagination']      = gdsc_to_bool_val($params['with_pagination']);
1124
+	$params['top_pagination']       = gdsc_to_bool_val($params['top_pagination']);
1125
+	$params['bottom_pagination']    = gdsc_to_bool_val($params['bottom_pagination']);
1126
+
1127
+	/**
1128
+	 * End of validation
1129
+	 */
1130
+	if (isset($atts['geodir_ajax'])) {
1131
+		$params['geodir_ajax'] = $atts['geodir_ajax'];
1132
+		unset($atts['geodir_ajax']);
1133
+	}
1134
+	if (isset($atts['pageno'])) {
1135
+		$params['pageno'] = $atts['pageno'];
1136
+		unset($atts['pageno']);
1137
+	}
1138
+	$params['shortcode_atts']       = $atts;
1139
+
1140
+	$output = geodir_sc_gd_listings_output($params);
1141
+
1142
+	return $output;
1143 1143
 }
1144 1144
 add_shortcode('gd_listings', 'geodir_sc_gd_listings');
1145 1145
 
@@ -1187,23 +1187,23 @@  discard block
 block discarded – undo
1187 1187
 		'max_count' => 'all',
1188 1188
 		'max_level' => '1',
1189 1189
 		'before_widget' => '<section id="geodir_cpt_categories_widget-1" class="widget geodir-widget geodir_cpt_categories_widget geodir_sc_cpt_categories_widget">',
1190
-        'after_widget' => '</section>',
1191
-        'before_title' => '<h3 class="widget-title">',
1192
-        'after_title' => '</h3>',
1190
+		'after_widget' => '</section>',
1191
+		'before_title' => '<h3 class="widget-title">',
1192
+		'after_title' => '</h3>',
1193 1193
 	);
1194 1194
 	$params = shortcode_atts($defaults, $atts);
1195 1195
 
1196
-    /**
1197
-     * Validate our incoming params
1198
-     */
1196
+	/**
1197
+	 * Validate our incoming params
1198
+	 */
1199 1199
 	// Make sure we have an array
1200
-    $params['post_type'] = !is_array($params['post_type']) && trim($params['post_type']) != '' ? explode(',', trim($params['post_type'])) : array();
1200
+	$params['post_type'] = !is_array($params['post_type']) && trim($params['post_type']) != '' ? explode(',', trim($params['post_type'])) : array();
1201 1201
 	 
1202 1202
 	// Validate the checkboxes used on the widget
1203
-    $params['hide_empty'] 	= gdsc_to_bool_val($params['hide_empty']);
1204
-    $params['show_count'] 	= gdsc_to_bool_val($params['show_count']);
1205
-    $params['hide_icon'] 	= gdsc_to_bool_val($params['hide_icon']);
1206
-    $params['cpt_left'] 	= gdsc_to_bool_val($params['cpt_left']);
1203
+	$params['hide_empty'] 	= gdsc_to_bool_val($params['hide_empty']);
1204
+	$params['show_count'] 	= gdsc_to_bool_val($params['show_count']);
1205
+	$params['hide_icon'] 	= gdsc_to_bool_val($params['hide_icon']);
1206
+	$params['cpt_left'] 	= gdsc_to_bool_val($params['cpt_left']);
1207 1207
 	
1208 1208
 	if ($params['max_count'] != 'all') {
1209 1209
 		$params['max_count'] = absint($params['max_count']);
@@ -1217,10 +1217,10 @@  discard block
 block discarded – undo
1217 1217
 
1218 1218
 	ob_start();
1219 1219
 	the_widget('geodir_cpt_categories_widget', $params, $params);
1220
-    $output = ob_get_contents();
1221
-    ob_end_clean();
1220
+	$output = ob_get_contents();
1221
+	ob_end_clean();
1222 1222
 
1223
-    return $output;
1223
+	return $output;
1224 1224
 }
1225 1225
 add_shortcode('gd_cpt_categories', 'geodir_sc_cpt_categories_widget');
1226 1226
 ?>
1227 1227
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -202,14 +202,14 @@  discard block
 block discarded – undo
202 202
 	// Add marker cluster
203 203
 	if (isset($params['marker_cluster']) && gdsc_to_bool_val($params['marker_cluster']) && defined('GDCLUSTER_VERSION')) {
204 204
         $map_args['enable_marker_cluster'] = true;
205
-        if(get_option('geodir_marker_cluster_type')) {
205
+        if (get_option('geodir_marker_cluster_type')) {
206 206
             if ($map_args['autozoom']) {
207 207
                 $map_args['enable_marker_cluster_no_reposition'] = false;
208 208
             } else {
209 209
                 $map_args['enable_marker_cluster_no_reposition'] = true;
210 210
             }
211 211
 
212
-            $map_args['enable_marker_cluster_server'] = true ;
212
+            $map_args['enable_marker_cluster_server'] = true;
213 213
 
214 214
         }
215 215
 	} else {
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 	}
218 218
 
219 219
     // if lat and long set in shortcode, hack it so the map is not repositioned
220
-    if(!empty($params['latitude']) && !empty($params['longitude']) ){
220
+    if (!empty($params['latitude']) && !empty($params['longitude'])) {
221 221
         $map_args['enable_marker_cluster_no_reposition'] = true;
222 222
     }
223 223
 
@@ -890,7 +890,7 @@  discard block
 block discarded – undo
890 890
 	
891 891
 	$show_adv_search = isset($params['show_adv_search']) && in_array($params['show_adv_search'], array('default', 'always', 'searched')) ? $params['show_adv_search'] : '';
892 892
 	
893
-	if ($show_adv_search != '' ) {
893
+	if ($show_adv_search != '') {
894 894
 		$show_adv_class = 'geodir-advance-search-' . $show_adv_search . ' ';
895 895
 		if ($show_adv_search == 'searched' && geodir_is_page('search')) {
896 896
 			$show_adv_search = 'search';
@@ -903,7 +903,7 @@  discard block
 block discarded – undo
903 903
 	ob_start();
904 904
 	
905 905
 	//geodir_get_template_part('listing', 'filter-form');
906
-	the_widget('geodir_advance_search_widget', $params, $params );
906
+	the_widget('geodir_advance_search_widget', $params, $params);
907 907
 	
908 908
 	$output = ob_get_contents();
909 909
     ob_end_clean();
@@ -1100,7 +1100,7 @@  discard block
 block discarded – undo
1100 1100
 
1101 1101
     // Validate character_count
1102 1102
     //todo: is this necessary?
1103
-    $params['character_count']  = $params['character_count'];
1103
+    $params['character_count'] = $params['character_count'];
1104 1104
 
1105 1105
     // Validate our layout choice
1106 1106
     // Outside of the norm, I added some more simple terms to match the existing
@@ -1112,7 +1112,7 @@  discard block
 block discarded – undo
1112 1112
 
1113 1113
     // Validate Listing width, used in the template widget-listing-listview.php
1114 1114
     // The context is in width=$listing_width% - So we need a positive number between 0 & 100
1115
-    $params['listing_width']    = gdsc_validate_listing_width($params['listing_width']);
1115
+    $params['listing_width'] = gdsc_validate_listing_width($params['listing_width']);
1116 1116
 
1117 1117
     // Validate the checkboxes used on the widget
1118 1118
     $params['add_location_filter']  = gdsc_to_bool_val($params['add_location_filter']);
@@ -1135,7 +1135,7 @@  discard block
 block discarded – undo
1135 1135
         $params['pageno'] = $atts['pageno'];
1136 1136
         unset($atts['pageno']);
1137 1137
     }
1138
-    $params['shortcode_atts']       = $atts;
1138
+    $params['shortcode_atts'] = $atts;
1139 1139
 
1140 1140
     $output = geodir_sc_gd_listings_output($params);
1141 1141
 
@@ -1202,8 +1202,8 @@  discard block
 block discarded – undo
1202 1202
 	// Validate the checkboxes used on the widget
1203 1203
     $params['hide_empty'] 	= gdsc_to_bool_val($params['hide_empty']);
1204 1204
     $params['show_count'] 	= gdsc_to_bool_val($params['show_count']);
1205
-    $params['hide_icon'] 	= gdsc_to_bool_val($params['hide_icon']);
1206
-    $params['cpt_left'] 	= gdsc_to_bool_val($params['cpt_left']);
1205
+    $params['hide_icon'] = gdsc_to_bool_val($params['hide_icon']);
1206
+    $params['cpt_left'] = gdsc_to_bool_val($params['cpt_left']);
1207 1207
 	
1208 1208
 	if ($params['max_count'] != 'all') {
1209 1209
 		$params['max_count'] = absint($params['max_count']);
Please login to merge, or discard this patch.
geodirectory-templates/reg_frm.php 1 patch
Indentation   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -9,13 +9,13 @@  discard block
 block discarded – undo
9 9
  * @package GeoDirectory
10 10
  */
11 11
 if (isset($_GET['redirect_to']) && $_GET['redirect_to'] != '') {
12
-    $redirect_to = $_GET['redirect_to'];
12
+	$redirect_to = $_GET['redirect_to'];
13 13
 } else {
14
-    //echo $_SERVER['HTTP_HOST'] ;
15
-    $redirect_to = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
16
-    if (strpos($redirect_to, $_SERVER['HTTP_HOST']) === false) {
17
-        $redirect_to = home_url();
18
-    }
14
+	//echo $_SERVER['HTTP_HOST'] ;
15
+	$redirect_to = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
16
+	if (strpos($redirect_to, $_SERVER['HTTP_HOST']) === false) {
17
+		$redirect_to = home_url();
18
+	}
19 19
 }
20 20
 ?>
21 21
 <div id="sign_up">
@@ -26,28 +26,28 @@  discard block
 block discarded – undo
26 26
         <h4>
27 27
             <?php
28 28
 
29
-            /**
30
-             * Filter the `REGISTRATION_NOW_TEXT` title text on the register form template.
31
-             *
32
-             * @since 1.0.0
33
-             */
34
-            echo apply_filters('geodir_registration_page_title', REGISTRATION_NOW_TEXT);
29
+			/**
30
+			 * Filter the `REGISTRATION_NOW_TEXT` title text on the register form template.
31
+			 *
32
+			 * @since 1.0.0
33
+			 */
34
+			echo apply_filters('geodir_registration_page_title', REGISTRATION_NOW_TEXT);
35 35
 
36
-            ?>
36
+			?>
37 37
         </h4>
38 38
         <?php
39
-        global $geodir_signup_error;
40
-        if ($geodir_signup_error != '') {
41
-            echo '<p class="error_msg">' . $geodir_signup_error . '</p>';
42
-            unset($geodir_signup_error);
43
-        } else {
44
-            if (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 1) {
45
-                echo '<p class="error_msg">' . EMAIL_USERNAME_EXIST_MSG . '</p>';
46
-            } else if (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 'regnewusr') {
47
-                echo '<p class="error_msg">' . REGISTRATION_DESABLED_MSG . '</p>';
48
-            }
49
-        }
50
-        ?>
39
+		global $geodir_signup_error;
40
+		if ($geodir_signup_error != '') {
41
+			echo '<p class="error_msg">' . $geodir_signup_error . '</p>';
42
+			unset($geodir_signup_error);
43
+		} else {
44
+			if (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 1) {
45
+				echo '<p class="error_msg">' . EMAIL_USERNAME_EXIST_MSG . '</p>';
46
+			} else if (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 'regnewusr') {
47
+				echo '<p class="error_msg">' . REGISTRATION_DESABLED_MSG . '</p>';
48
+			}
49
+		}
50
+		?>
51 51
 
52 52
         <form name="cus_registerform" id="cus_registerform"
53 53
               action="<?php echo htmlspecialchars(geodir_curPageURL()); ?>" method="post">
@@ -57,10 +57,10 @@  discard block
 block discarded – undo
57 57
             <div class="form_row clearfix">
58 58
                 <input placeholder='<?php echo EMAIL_TEXT; ?>' type="text" name="user_email" id="user_email"
59 59
                        class="textfield" value="<?php global $user_email;
60
-                if (!isset($user_email)) {
61
-                    $user_email = '';
62
-                }
63
-                echo esc_attr(stripslashes($user_email)); ?>" size="25"/>
60
+				if (!isset($user_email)) {
61
+					$user_email = '';
62
+				}
63
+				echo esc_attr(stripslashes($user_email)); ?>" size="25"/>
64 64
 
65 65
                 <?php if (!get_option('geodir_allow_cpass')) { ?>
66 66
 				<div id="reg_passmail">
@@ -74,8 +74,8 @@  discard block
 block discarded – undo
74 74
                 <div class="form_row clearfix">
75 75
                     <input placeholder='<?php echo FIRST_NAME_TEXT; ?>' type="text" name="user_fname" id="user_fname"
76 76
                            class="textfield" value="<?php if (isset($user_fname)) {
77
-                        echo esc_attr(stripslashes($user_fname));
78
-                    } ?>" size="25"/>
77
+						echo esc_attr(stripslashes($user_fname));
78
+					} ?>" size="25"/>
79 79
                     <span id="user_fnameInfo"></span>
80 80
                 </div>
81 81
             </div>
@@ -101,14 +101,14 @@  discard block
 block discarded – undo
101 101
             <?php } ?>
102 102
 
103 103
             <?php
104
-            /**
105
-             * Called just before the register new user button on the register form template.
106
-             *
107
-             * Also used by other plugins to add social connect buttons.
108
-             *
109
-             * @since 1.0.0
110
-             */
111
-            do_action('social_connect_form'); ?>
104
+			/**
105
+			 * Called just before the register new user button on the register form template.
106
+			 *
107
+			 * Also used by other plugins to add social connect buttons.
108
+			 *
109
+			 * @since 1.0.0
110
+			 */
111
+			do_action('social_connect_form'); ?>
112 112
             <input type="submit" name="registernow" value="<?php echo REGISTER_NOW_TEXT; ?>" class="geodir_button"/>
113 113
         </form>
114 114
     </div>
Please login to merge, or discard this patch.
geodirectory-functions/compatibility/Genesis.php 1 patch
Indentation   +180 added lines, -180 removed lines patch added patch discarded remove patch
@@ -1,42 +1,42 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Genesis theme compatibility functions.
4
- *
5
- * This file lets the GeoDirectory Plugin use the Genesis theme HTML wrappers to fit and work perfectly.
6
- *
7
- * @since 1.0.0
8
- * @package GeoDirectory
9
- */
3
+	 * Genesis theme compatibility functions.
4
+	 *
5
+	 * This file lets the GeoDirectory Plugin use the Genesis theme HTML wrappers to fit and work perfectly.
6
+	 *
7
+	 * @since 1.0.0
8
+	 * @package GeoDirectory
9
+	 */
10 10
 add_action('after_setup_theme', 'gd_compat_php_genesis', 11);
11 11
 /**
12
- * Action calls for genesis theme compatibility.
13
- *
14
- * @since 1.0.0
15
- * @package GeoDirectory
16
- */
12
+	 * Action calls for genesis theme compatibility.
13
+	 *
14
+	 * @since 1.0.0
15
+	 * @package GeoDirectory
16
+	 */
17 17
 function gd_compat_php_genesis()
18 18
 {
19 19
 // REPLACE GENESIS BREADCRUMBS WITH GD BREADCRUMBS
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);
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 26
 
27 27
 
28
-    // make top section wide
29
-    remove_action('geodir_home_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10);
30
-    remove_action('geodir_location_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10);
31
-    remove_action('geodir_author_before_main_content', 'geodir_action_geodir_sidebar_author_top', 10);
32
-    remove_action('geodir_search_before_main_content', 'geodir_action_geodir_sidebar_search_top', 10);
33
-    remove_action('geodir_detail_before_main_content', 'geodir_action_geodir_sidebar_detail_top', 10);
34
-    remove_action('geodir_listings_before_main_content', 'geodir_action_geodir_sidebar_listings_top', 10);
28
+	// make top section wide
29
+	remove_action('geodir_home_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10);
30
+	remove_action('geodir_location_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10);
31
+	remove_action('geodir_author_before_main_content', 'geodir_action_geodir_sidebar_author_top', 10);
32
+	remove_action('geodir_search_before_main_content', 'geodir_action_geodir_sidebar_search_top', 10);
33
+	remove_action('geodir_detail_before_main_content', 'geodir_action_geodir_sidebar_detail_top', 10);
34
+	remove_action('geodir_listings_before_main_content', 'geodir_action_geodir_sidebar_listings_top', 10);
35 35
 
36
-    // REMOVE PAGE TITLES
37
-    remove_action('geodir_listings_page_title', 'geodir_action_listings_title', 10);
38
-    remove_action('geodir_search_page_title', 'geodir_action_search_page_title', 10);
39
-    remove_action('geodir_author_page_title', 'geodir_action_author_page_title', 10);
36
+	// REMOVE PAGE TITLES
37
+	remove_action('geodir_listings_page_title', 'geodir_action_listings_title', 10);
38
+	remove_action('geodir_search_page_title', 'geodir_action_search_page_title', 10);
39
+	remove_action('geodir_author_page_title', 'geodir_action_author_page_title', 10);
40 40
 
41 41
 
42 42
 }
@@ -53,25 +53,25 @@  discard block
 block discarded – undo
53 53
 function gd_genesis_compat_left_sidebars()
54 54
 {
55 55
 
56
-    if (is_page_geodir_home()) {
57
-        remove_action('geodir_home_sidebar_left', 'geodir_action_home_sidebar_left', 10);
58
-        add_action('geodir_wrapper_close', 'geodir_action_home_sidebar_left', 11);
59
-    } elseif (geodir_is_page('location')) {
60
-        remove_action('geodir_location_sidebar_left', 'geodir_action_home_sidebar_left', 10);
61
-        add_action('geodir_wrapper_close', 'geodir_action_home_sidebar_left', 11);
62
-    } elseif (geodir_is_page('listing')) {
63
-        remove_action('geodir_listings_sidebar_left', 'geodir_action_listings_sidebar_left', 10);
64
-        add_action('geodir_wrapper_close', 'geodir_action_listings_sidebar_left', 11);
65
-    } elseif (geodir_is_page('detail') && get_option('geodir_detail_sidebar_left_section')) {
66
-        //remove_action( 'geodir_detail_sidebar', 'geodir_action_details_sidebar', 10 );
67
-        //add_action( 'geodir_wrapper_close', 'geodir_action_details_sidebar', 11 );
68
-    } elseif (geodir_is_page('search')) {
69
-        remove_action('geodir_search_sidebar_left', 'geodir_action_search_sidebar_left', 10);
70
-        add_action('geodir_wrapper_close', 'geodir_action_search_sidebar_left', 11);
71
-    } elseif (geodir_is_page('author')) {
72
-        remove_action('geodir_author_sidebar_left', 'geodir_action_author_sidebar_left', 10);
73
-        add_action('geodir_wrapper_close', 'geodir_action_author_sidebar_left', 11);
74
-    }
56
+	if (is_page_geodir_home()) {
57
+		remove_action('geodir_home_sidebar_left', 'geodir_action_home_sidebar_left', 10);
58
+		add_action('geodir_wrapper_close', 'geodir_action_home_sidebar_left', 11);
59
+	} elseif (geodir_is_page('location')) {
60
+		remove_action('geodir_location_sidebar_left', 'geodir_action_home_sidebar_left', 10);
61
+		add_action('geodir_wrapper_close', 'geodir_action_home_sidebar_left', 11);
62
+	} elseif (geodir_is_page('listing')) {
63
+		remove_action('geodir_listings_sidebar_left', 'geodir_action_listings_sidebar_left', 10);
64
+		add_action('geodir_wrapper_close', 'geodir_action_listings_sidebar_left', 11);
65
+	} elseif (geodir_is_page('detail') && get_option('geodir_detail_sidebar_left_section')) {
66
+		//remove_action( 'geodir_detail_sidebar', 'geodir_action_details_sidebar', 10 );
67
+		//add_action( 'geodir_wrapper_close', 'geodir_action_details_sidebar', 11 );
68
+	} elseif (geodir_is_page('search')) {
69
+		remove_action('geodir_search_sidebar_left', 'geodir_action_search_sidebar_left', 10);
70
+		add_action('geodir_wrapper_close', 'geodir_action_search_sidebar_left', 11);
71
+	} elseif (geodir_is_page('author')) {
72
+		remove_action('geodir_author_sidebar_left', 'geodir_action_author_sidebar_left', 10);
73
+		add_action('geodir_wrapper_close', 'geodir_action_author_sidebar_left', 11);
74
+	}
75 75
 
76 76
 
77 77
 }
@@ -88,65 +88,65 @@  discard block
 block discarded – undo
88 88
  */
89 89
 function geodir_set_body_scs($classes)
90 90
 {
91
-    $remove_class = false;
92
-    $new_class = '';
93
-    if (is_page_geodir_home() || geodir_is_page('location')) {
94
-        $remove_class = true;
95
-        if (get_option('geodir_show_home_left_section')) {
96
-            $new_class .= 'sidebar-';
97
-        }
98
-        if (get_option('geodir_show_home_contant_section')) {
99
-            $new_class .= 'content';
100
-        }
101
-        if (get_option('geodir_show_home_right_section')) {
102
-            $new_class .= '-sidebar';
103
-        }
104
-    } elseif (geodir_is_page('listing')) {
105
-        $remove_class = true;
106
-        if (get_option('geodir_show_listing_left_section')) {
107
-            $new_class .= 'sidebar-';
108
-        }
109
-        $new_class .= 'content';
110
-        if (get_option('geodir_show_listing_right_section')) {
111
-            $new_class .= '-sidebar';
112
-        }
113
-    } elseif (geodir_is_page('detail')) {
114
-        $remove_class = true;
115
-        if (get_option('geodir_detail_sidebar_left_section')) {
116
-            $new_class .= 'sidebar-content gd-details-sidebar-left';
117
-        } else {
118
-            $new_class .= 'content-sidebar';
119
-        }
120
-    } elseif (geodir_is_page('search')) {
121
-        $remove_class = true;
122
-        if (get_option('geodir_show_search_left_section')) {
123
-            $new_class .= 'sidebar-';
124
-        }
125
-        $new_class .= 'content';
126
-        if (get_option('geodir_show_search_right_section')) {
127
-            $new_class .= '-sidebar';
128
-        }
129
-    } elseif (geodir_is_page('author')) {
130
-        $remove_class = true;
131
-        if (get_option('geodir_show_author_left_section')) {
132
-            $new_class .= 'sidebar-';
133
-        }
134
-        $new_class .= 'content';
135
-        if (get_option('geodir_show_author_right_section')) {
136
-            $new_class .= '-sidebar';
137
-        }
138
-    } elseif (geodir_is_page('add-listing')) {
139
-        $remove_class = true;
140
-        $new_class .= 'content-sidebar';
141
-    }
142
-
143
-    if ($remove_class) {
144
-        $classes = array_diff($classes, array('content-sidebar', 'sidebar-content', 'content-sidebar-sidebar', 'sidebar-sidebar-content', 'sidebar-content-sidebar', 'full-width-content'));
145
-        //str_replace(array('content-sidebar','sidebar-content','content-sidebar-sidebar','sidebar-sidebar-content','sidebar-content-sidebar','full-width-content'),array('','','','','',''),$classes);
146
-        $classes[] = $new_class;
147
-    }
148
-
149
-    return $classes;
91
+	$remove_class = false;
92
+	$new_class = '';
93
+	if (is_page_geodir_home() || geodir_is_page('location')) {
94
+		$remove_class = true;
95
+		if (get_option('geodir_show_home_left_section')) {
96
+			$new_class .= 'sidebar-';
97
+		}
98
+		if (get_option('geodir_show_home_contant_section')) {
99
+			$new_class .= 'content';
100
+		}
101
+		if (get_option('geodir_show_home_right_section')) {
102
+			$new_class .= '-sidebar';
103
+		}
104
+	} elseif (geodir_is_page('listing')) {
105
+		$remove_class = true;
106
+		if (get_option('geodir_show_listing_left_section')) {
107
+			$new_class .= 'sidebar-';
108
+		}
109
+		$new_class .= 'content';
110
+		if (get_option('geodir_show_listing_right_section')) {
111
+			$new_class .= '-sidebar';
112
+		}
113
+	} elseif (geodir_is_page('detail')) {
114
+		$remove_class = true;
115
+		if (get_option('geodir_detail_sidebar_left_section')) {
116
+			$new_class .= 'sidebar-content gd-details-sidebar-left';
117
+		} else {
118
+			$new_class .= 'content-sidebar';
119
+		}
120
+	} elseif (geodir_is_page('search')) {
121
+		$remove_class = true;
122
+		if (get_option('geodir_show_search_left_section')) {
123
+			$new_class .= 'sidebar-';
124
+		}
125
+		$new_class .= 'content';
126
+		if (get_option('geodir_show_search_right_section')) {
127
+			$new_class .= '-sidebar';
128
+		}
129
+	} elseif (geodir_is_page('author')) {
130
+		$remove_class = true;
131
+		if (get_option('geodir_show_author_left_section')) {
132
+			$new_class .= 'sidebar-';
133
+		}
134
+		$new_class .= 'content';
135
+		if (get_option('geodir_show_author_right_section')) {
136
+			$new_class .= '-sidebar';
137
+		}
138
+	} elseif (geodir_is_page('add-listing')) {
139
+		$remove_class = true;
140
+		$new_class .= 'content-sidebar';
141
+	}
142
+
143
+	if ($remove_class) {
144
+		$classes = array_diff($classes, array('content-sidebar', 'sidebar-content', 'content-sidebar-sidebar', 'sidebar-sidebar-content', 'sidebar-content-sidebar', 'full-width-content'));
145
+		//str_replace(array('content-sidebar','sidebar-content','content-sidebar-sidebar','sidebar-sidebar-content','sidebar-content-sidebar','full-width-content'),array('','','','','',''),$classes);
146
+		$classes[] = $new_class;
147
+	}
148
+
149
+	return $classes;
150 150
 
151 151
 }
152 152
 
@@ -160,17 +160,17 @@  discard block
 block discarded – undo
160 160
 function gd_genesis_compat_add_top_section_back()
161 161
 {
162 162
 
163
-    if (is_page_geodir_home() || geodir_is_page('location')) {
164
-        geodir_action_geodir_sidebar_home_top();
165
-    } elseif (geodir_is_page('listing')) {
166
-        geodir_action_geodir_sidebar_listings_top();
167
-    } elseif (geodir_is_page('detail')) {
168
-        geodir_action_geodir_sidebar_detail_top();
169
-    } elseif (geodir_is_page('search')) {
170
-        geodir_action_geodir_sidebar_search_top();
171
-    } elseif (geodir_is_page('author')) {
172
-        geodir_action_geodir_sidebar_author_top();
173
-    }
163
+	if (is_page_geodir_home() || geodir_is_page('location')) {
164
+		geodir_action_geodir_sidebar_home_top();
165
+	} elseif (geodir_is_page('listing')) {
166
+		geodir_action_geodir_sidebar_listings_top();
167
+	} elseif (geodir_is_page('detail')) {
168
+		geodir_action_geodir_sidebar_detail_top();
169
+	} elseif (geodir_is_page('search')) {
170
+		geodir_action_geodir_sidebar_search_top();
171
+	} elseif (geodir_is_page('author')) {
172
+		geodir_action_geodir_sidebar_author_top();
173
+	}
174 174
 
175 175
 
176 176
 }
@@ -183,12 +183,12 @@  discard block
 block discarded – undo
183 183
  */
184 184
 function geodir_replace_breadcrumb()
185 185
 {
186
-    if (is_front_page() && get_option('geodir_set_as_home') && !geodir_is_page('login')) {
187
-    } else {
188
-        echo '<div class="geodir-breadcrumb-bar"><div class="wrap">';
189
-        geodir_breadcrumb();
190
-        echo '</div></div>';
191
-    }
186
+	if (is_front_page() && get_option('geodir_set_as_home') && !geodir_is_page('login')) {
187
+	} else {
188
+		echo '<div class="geodir-breadcrumb-bar"><div class="wrap">';
189
+		geodir_breadcrumb();
190
+		echo '</div></div>';
191
+	}
192 192
 }
193 193
 
194 194
 // Force Full Width on signup page
@@ -201,9 +201,9 @@  discard block
 block discarded – undo
201 201
  */
202 202
 function geodir_genesis_meta()
203 203
 {
204
-    if (geodir_is_page('login')) {
205
-        add_filter('genesis_pre_get_option_site_layout', '__genesis_return_full_width_content');
206
-    }
204
+	if (geodir_is_page('login')) {
205
+		add_filter('genesis_pre_get_option_site_layout', '__genesis_return_full_width_content');
206
+	}
207 207
 }
208 208
 
209 209
 add_action('geodir_add_listing_page_title', 'geodir_add_listing_page_title_genesis_before', 8);
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 function geodir_add_listing_page_title_genesis_before()
217 217
 {
218 218
 
219
-    echo "<div class='entry' >";
219
+	echo "<div class='entry' >";
220 220
 }
221 221
 
222 222
 
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
 function geodir_add_listing_form_genesis_after()
231 231
 {
232 232
 
233
-    echo "</div>";
233
+	echo "</div>";
234 234
 }
235 235
 
236 236
 
@@ -249,38 +249,38 @@  discard block
 block discarded – undo
249 249
 {
250 250
 
251 251
 
252
-    $title = '';
253
-    $subtitle = '';
254
-
255
-    if (geodir_is_page('listing')) {
256
-        echo '<div class="wrap gd-title-wrap">';
257
-        geodir_action_listings_title();
258
-        echo '</div>';
259
-    }
260
-
261
-    if (geodir_is_page('add-listing')) {
262
-        echo '<div class="wrap gd-title-wrap">';
263
-        geodir_action_add_listing_page_title();
264
-        echo '</div>';
265
-    }
266
-
267
-    if (geodir_is_page('author')) {
268
-        echo '<div class="wrap gd-title-wrap">';
269
-        geodir_action_author_page_title();
270
-        echo '</div>';
271
-    }
272
-
273
-    if (geodir_is_page('detail') || geodir_is_page('preview')) {
274
-        echo '<div class="wrap gd-title-wrap">';
275
-        echo get_the_title();
276
-        echo '</div>';
277
-    }
278
-
279
-    if (geodir_is_page('search')) {
280
-        echo '<div class="wrap gd-title-wrap">';
281
-        geodir_action_search_page_title();
282
-        echo '</div>';
283
-    }
252
+	$title = '';
253
+	$subtitle = '';
254
+
255
+	if (geodir_is_page('listing')) {
256
+		echo '<div class="wrap gd-title-wrap">';
257
+		geodir_action_listings_title();
258
+		echo '</div>';
259
+	}
260
+
261
+	if (geodir_is_page('add-listing')) {
262
+		echo '<div class="wrap gd-title-wrap">';
263
+		geodir_action_add_listing_page_title();
264
+		echo '</div>';
265
+	}
266
+
267
+	if (geodir_is_page('author')) {
268
+		echo '<div class="wrap gd-title-wrap">';
269
+		geodir_action_author_page_title();
270
+		echo '</div>';
271
+	}
272
+
273
+	if (geodir_is_page('detail') || geodir_is_page('preview')) {
274
+		echo '<div class="wrap gd-title-wrap">';
275
+		echo get_the_title();
276
+		echo '</div>';
277
+	}
278
+
279
+	if (geodir_is_page('search')) {
280
+		echo '<div class="wrap gd-title-wrap">';
281
+		geodir_action_search_page_title();
282
+		echo '</div>';
283
+	}
284 284
 }
285 285
 
286 286
 
@@ -293,8 +293,8 @@  discard block
 block discarded – undo
293 293
  */
294 294
 function gd_genesis_listing_page_title_bar()
295 295
 {
296
-    geodir_action_listings_title();
297
-    //geodir_action_listings_description();
296
+	geodir_action_listings_title();
297
+	//geodir_action_listings_description();
298 298
 }
299 299
 
300 300
 
@@ -307,19 +307,19 @@  discard block
 block discarded – undo
307 307
  */
308 308
 function gd_compat_php_genesis_geo_1280_fix()
309 309
 {
310
-    if (function_exists('geo1280_search_bar')) {
311
-        remove_action('genesis_after_header', 'geo1280_search_bar', 20);
312
-        add_action('genesis_after_header', 'geo1280_search_bar_fix', 4);
310
+	if (function_exists('geo1280_search_bar')) {
311
+		remove_action('genesis_after_header', 'geo1280_search_bar', 20);
312
+		add_action('genesis_after_header', 'geo1280_search_bar_fix', 4);
313 313
 
314
-        //
314
+		//
315 315
 
316
-        remove_action('genesis_after_header', 'geodir_replace_breadcrumb', 20);
317
-        remove_action('genesis_before_content_sidebar_wrap', 'geodir_replace_breadcrumb', 20);
318
-        add_action('geodir_wrapper_open', 'geodir_replace_breadcrumb', 105);
316
+		remove_action('genesis_after_header', 'geodir_replace_breadcrumb', 20);
317
+		remove_action('genesis_before_content_sidebar_wrap', 'geodir_replace_breadcrumb', 20);
318
+		add_action('geodir_wrapper_open', 'geodir_replace_breadcrumb', 105);
319 319
 
320
-        remove_action('genesis_before_content_sidebar_wrap', 'geo1280_page_title', 10);
321
-        add_action('geodir_wrapper_open', 'geo1280_page_title', 101);
322
-    }
320
+		remove_action('genesis_before_content_sidebar_wrap', 'geo1280_page_title', 10);
321
+		add_action('geodir_wrapper_open', 'geo1280_page_title', 101);
322
+	}
323 323
 }
324 324
 
325 325
 /**
@@ -331,11 +331,11 @@  discard block
 block discarded – undo
331 331
 function geo1280_search_bar_fix()
332 332
 {
333 333
 
334
-    echo '<div class="geo1280-placeholder"></div>';
335
-    if (is_active_sidebar('search-bar')) {
336
-        genesis_widget_area('search-bar', array(
337
-            'before' => '<div class="search-bar widget-area"><div class="wrap">',
338
-            'after' => '</div></div>',
339
-        ));
340
-    }
334
+	echo '<div class="geo1280-placeholder"></div>';
335
+	if (is_active_sidebar('search-bar')) {
336
+		genesis_widget_area('search-bar', array(
337
+			'before' => '<div class="search-bar widget-area"><div class="wrap">',
338
+			'after' => '</div></div>',
339
+		));
340
+	}
341 341
 }
Please login to merge, or discard this patch.
geodirectory.php 3 patches
Braces   +27 added lines, -9 removed lines patch added patch discarded remove patch
@@ -76,29 +76,45 @@  discard block
 block discarded – undo
76 76
 /**
77 77
  * Do not store any revisions (except the one autosave per post).
78 78
  */
79
-if (!defined('WP_POST_REVISIONS')) define('WP_POST_REVISIONS', 0);
79
+if (!defined('WP_POST_REVISIONS')) {
80
+	define('WP_POST_REVISIONS', 0);
81
+}
80 82
 
81 83
 /**
82 84
  * Define constants
83 85
  */
84
-if(!defined('GEODIRECTORY_PLUGIN_DIR')) define('GEODIRECTORY_PLUGIN_DIR', plugin_dir_path( __FILE__ ));
86
+if(!defined('GEODIRECTORY_PLUGIN_DIR')) {
87
+	define('GEODIRECTORY_PLUGIN_DIR', plugin_dir_path( __FILE__ ));
88
+}
85 89
 
86 90
 /*
87 91
  * Declare database table names. All since version 1.0.0
88 92
  */
89 93
 
90 94
 /** Define the database name for the countries table. */
91
-if (!defined('GEODIR_COUNTRIES_TABLE')) define('GEODIR_COUNTRIES_TABLE', $plugin_prefix . 'countries');
95
+if (!defined('GEODIR_COUNTRIES_TABLE')) {
96
+	define('GEODIR_COUNTRIES_TABLE', $plugin_prefix . 'countries');
97
+}
92 98
 /** Define the database name for the custom fields table. */
93
-if (!defined('GEODIR_CUSTOM_FIELDS_TABLE')) define('GEODIR_CUSTOM_FIELDS_TABLE', $plugin_prefix . 'custom_fields');
99
+if (!defined('GEODIR_CUSTOM_FIELDS_TABLE')) {
100
+	define('GEODIR_CUSTOM_FIELDS_TABLE', $plugin_prefix . 'custom_fields');
101
+}
94 102
 /** Define the database name for the icons table. */
95
-if (!defined('GEODIR_ICON_TABLE')) define('GEODIR_ICON_TABLE', $plugin_prefix . 'post_icon');
103
+if (!defined('GEODIR_ICON_TABLE')) {
104
+	define('GEODIR_ICON_TABLE', $plugin_prefix . 'post_icon');
105
+}
96 106
 /** Define the database name for the attachments table. */
97
-if (!defined('GEODIR_ATTACHMENT_TABLE')) define('GEODIR_ATTACHMENT_TABLE', $plugin_prefix . 'attachments');
107
+if (!defined('GEODIR_ATTACHMENT_TABLE')) {
108
+	define('GEODIR_ATTACHMENT_TABLE', $plugin_prefix . 'attachments');
109
+}
98 110
 /** Define the database name for the review table. */
99
-if (!defined('GEODIR_REVIEW_TABLE')) define('GEODIR_REVIEW_TABLE', $plugin_prefix . 'post_review');
111
+if (!defined('GEODIR_REVIEW_TABLE')) {
112
+	define('GEODIR_REVIEW_TABLE', $plugin_prefix . 'post_review');
113
+}
100 114
 /** Define the database name for the custom sort fields table. */
101
-if (!defined('GEODIR_CUSTOM_SORT_FIELDS_TABLE')) define('GEODIR_CUSTOM_SORT_FIELDS_TABLE', $plugin_prefix . 'custom_sort_fields');
115
+if (!defined('GEODIR_CUSTOM_SORT_FIELDS_TABLE')) {
116
+	define('GEODIR_CUSTOM_SORT_FIELDS_TABLE', $plugin_prefix . 'custom_sort_fields');
117
+}
102 118
 
103 119
 
104 120
 if ($_SERVER['REQUEST_URI'] == '' || $_SERVER['REQUEST_URI'] == '/') {
@@ -113,7 +129,9 @@  discard block
 block discarded – undo
113 129
 /*
114 130
  * Localisation items.
115 131
  */
116
-if (!defined('GEODIRECTORY_TEXTDOMAIN')) define('GEODIRECTORY_TEXTDOMAIN', 'geodirectory');
132
+if (!defined('GEODIRECTORY_TEXTDOMAIN')) {
133
+	define('GEODIRECTORY_TEXTDOMAIN', 'geodirectory');
134
+}
117 135
 
118 136
 // Load geodirectory plugin textdomain.
119 137
 add_action( 'plugins_loaded', 'geodir_load_textdomain' );
Please login to merge, or discard this patch.
Indentation   +88 added lines, -88 removed lines patch added patch discarded remove patch
@@ -30,30 +30,30 @@  discard block
 block discarded – undo
30 30
  * CHECK FOR OLD COMPATIBILITY PACKS AND DISABLE IF THEY ARE ACTIVE
31 31
  */
32 32
 if (is_admin()) {
33
-    /**
34
-     * Include WordPress core file so we can use core functions to check for active plugins.
35
-     */
36
-    include_once(ABSPATH . 'wp-admin/includes/plugin.php');
33
+	/**
34
+	 * Include WordPress core file so we can use core functions to check for active plugins.
35
+	 */
36
+	include_once(ABSPATH . 'wp-admin/includes/plugin.php');
37 37
 
38
-    if (is_plugin_active('geodirectory-genesis-compatibility-pack/geodir_genesis_compatibility.php')) {
39
-        deactivate_plugins('geodirectory-genesis-compatibility-pack/geodir_genesis_compatibility.php');
40
-    }
38
+	if (is_plugin_active('geodirectory-genesis-compatibility-pack/geodir_genesis_compatibility.php')) {
39
+		deactivate_plugins('geodirectory-genesis-compatibility-pack/geodir_genesis_compatibility.php');
40
+	}
41 41
 
42
-    if (is_plugin_active('geodirectory-x-theme-compatibility-pack/geodir_x_compatibility.php')) {
43
-        deactivate_plugins('geodirectory-x-theme-compatibility-pack/geodir_x_compatibility.php');
44
-    }
42
+	if (is_plugin_active('geodirectory-x-theme-compatibility-pack/geodir_x_compatibility.php')) {
43
+		deactivate_plugins('geodirectory-x-theme-compatibility-pack/geodir_x_compatibility.php');
44
+	}
45 45
 
46
-    if (is_plugin_active('geodirectory-enfold-theme-compatibility-pack/geodir_enfold_compatibility.php')) {
47
-        deactivate_plugins('geodirectory-enfold-theme-compatibility-pack/geodir_enfold_compatibility.php');
48
-    }
46
+	if (is_plugin_active('geodirectory-enfold-theme-compatibility-pack/geodir_enfold_compatibility.php')) {
47
+		deactivate_plugins('geodirectory-enfold-theme-compatibility-pack/geodir_enfold_compatibility.php');
48
+	}
49 49
 
50
-    if (is_plugin_active('geodir_avada_compatibility/geodir_avada_compatibility.php')) {
51
-        deactivate_plugins('geodir_avada_compatibility/geodir_avada_compatibility.php');
52
-    }
50
+	if (is_plugin_active('geodir_avada_compatibility/geodir_avada_compatibility.php')) {
51
+		deactivate_plugins('geodir_avada_compatibility/geodir_avada_compatibility.php');
52
+	}
53 53
 
54
-    if (is_plugin_active('geodir_compat_pack_divi/geodir_divi_compatibility.php')) {
55
-        deactivate_plugins('geodir_compat_pack_divi/geodir_divi_compatibility.php');
56
-    }
54
+	if (is_plugin_active('geodir_compat_pack_divi/geodir_divi_compatibility.php')) {
55
+		deactivate_plugins('geodir_compat_pack_divi/geodir_divi_compatibility.php');
56
+	}
57 57
 
58 58
 }
59 59
 
@@ -104,11 +104,11 @@  discard block
 block discarded – undo
104 104
 
105 105
 
106 106
 if ($_SERVER['REQUEST_URI'] == '' || $_SERVER['REQUEST_URI'] == '/') {
107
-    /**
108
-     * This tries to disable cache on homepage as it can be very dynamic.
109
-     */
110
-    define('DONOTCACHEPAGE', TRUE);
111
-    $_SERVER['DONOTCACHEPAGE']= TRUE;
107
+	/**
108
+	 * This tries to disable cache on homepage as it can be very dynamic.
109
+	 */
110
+	define('DONOTCACHEPAGE', TRUE);
111
+	$_SERVER['DONOTCACHEPAGE']= TRUE;
112 112
 }
113 113
 
114 114
 
@@ -130,19 +130,19 @@  discard block
 block discarded – undo
130 130
  * @package GeoDirectory
131 131
  */
132 132
 function geodir_error_log($log){
133
-    /*
133
+	/*
134 134
      * A filter to override the WP_DEBUG setting for function geodir_error_log().
135 135
      *
136 136
      * @since 1.5.7
137 137
      */
138
-    $should_log = apply_filters( 'geodir_log_errors', WP_DEBUG);
139
-    if ( true === $should_log ) {
140
-        if ( is_array( $log ) || is_object( $log ) ) {
141
-            error_log( print_r( $log, true ) );
142
-        } else {
143
-            error_log( $log );
144
-        }
145
-    }
138
+	$should_log = apply_filters( 'geodir_log_errors', WP_DEBUG);
139
+	if ( true === $should_log ) {
140
+		if ( is_array( $log ) || is_object( $log ) ) {
141
+			error_log( print_r( $log, true ) );
142
+		} else {
143
+			error_log( $log );
144
+		}
145
+	}
146 146
 }
147 147
 
148 148
 /**
@@ -182,62 +182,62 @@  discard block
 block discarded – undo
182 182
  */
183 183
 if (is_admin() || geodir_is_testing_mode()) {
184 184
 
185
-    /**
186
-     * Include functions used in admin area only.
187
-     *
188
-     * @since 1.0.0
189
-     */
190
-    require_once('geodirectory-admin/admin_functions.php');
191
-    /**
192
-     * Most actions/hooks used in admin area only are called from here.
193
-     *
194
-     * @since 1.0.0
195
-     */
196
-    require_once('geodirectory-admin/admin_hooks_actions.php');
197
-    /**
198
-     * Most admin JS and CSS is called from here.
199
-     *
200
-     * @since 1.0.0
201
-     */
202
-    require_once('geodirectory-admin/admin_template_tags.php');
203
-    /**
204
-     * Include any functions needed for upgrades.
205
-     *
206
-     * @since 1.0.0
207
-     */
208
-    require_once(geodir_plugin_path() . '/upgrade.php');
209
-    if (get_option('geodir_installed') != 1) {
210
-        /**
211
-         * Define language constants, here as they are not loaded yet.
212
-         *
213
-         * @since 1.0.0
214
-         */
215
-        require_once(geodir_plugin_path() . '/language.php');
216
-        /**
217
-         * Include the plugin install file that sets up the databases and any options on first run.
218
-         *
219
-         * @since 1.0.0
220
-         */
221
-        require_once('geodirectory-admin/admin_install.php');
222
-        register_activation_hook(__FILE__, 'geodir_activation');
223
-    }
224
-    register_deactivation_hook(__FILE__, 'geodir_deactivation');
225
-    register_uninstall_hook(__FILE__, 'geodir_uninstall');
185
+	/**
186
+	 * Include functions used in admin area only.
187
+	 *
188
+	 * @since 1.0.0
189
+	 */
190
+	require_once('geodirectory-admin/admin_functions.php');
191
+	/**
192
+	 * Most actions/hooks used in admin area only are called from here.
193
+	 *
194
+	 * @since 1.0.0
195
+	 */
196
+	require_once('geodirectory-admin/admin_hooks_actions.php');
197
+	/**
198
+	 * Most admin JS and CSS is called from here.
199
+	 *
200
+	 * @since 1.0.0
201
+	 */
202
+	require_once('geodirectory-admin/admin_template_tags.php');
203
+	/**
204
+	 * Include any functions needed for upgrades.
205
+	 *
206
+	 * @since 1.0.0
207
+	 */
208
+	require_once(geodir_plugin_path() . '/upgrade.php');
209
+	if (get_option('geodir_installed') != 1) {
210
+		/**
211
+		 * Define language constants, here as they are not loaded yet.
212
+		 *
213
+		 * @since 1.0.0
214
+		 */
215
+		require_once(geodir_plugin_path() . '/language.php');
216
+		/**
217
+		 * Include the plugin install file that sets up the databases and any options on first run.
218
+		 *
219
+		 * @since 1.0.0
220
+		 */
221
+		require_once('geodirectory-admin/admin_install.php');
222
+		register_activation_hook(__FILE__, 'geodir_activation');
223
+	}
224
+	register_deactivation_hook(__FILE__, 'geodir_deactivation');
225
+	register_uninstall_hook(__FILE__, 'geodir_uninstall');
226 226
 
227
-    /*
227
+	/*
228 228
      * Show a upgrade warning message if applicable.
229 229
      *
230 230
      * @since 1.5.6
231 231
      */
232
-    global $pagenow;
232
+	global $pagenow;
233 233
    if ( 'plugins.php' === $pagenow )
234
-    {
235
-        // Better update message
236
-        $file   = basename( __FILE__ );
237
-        $folder = basename( dirname( __FILE__ ) );
238
-        $hook = "in_plugin_update_message-{$folder}/{$file}";
239
-        add_action( $hook, 'geodire_admin_upgrade_notice', 20, 2 );
240
-    }
234
+	{
235
+		// Better update message
236
+		$file   = basename( __FILE__ );
237
+		$folder = basename( dirname( __FILE__ ) );
238
+		$hook = "in_plugin_update_message-{$folder}/{$file}";
239
+		add_action( $hook, 'geodire_admin_upgrade_notice', 20, 2 );
240
+	}
241 241
 
242 242
 }
243 243
 
@@ -249,9 +249,9 @@  discard block
 block discarded – undo
249 249
  * @since 1.5.7
250 250
  */
251 251
 function geodir_is_testing_mode() {
252
-    if ( defined( 'GD_TESTING_MODE' ) && GD_TESTING_MODE ) {
253
-        return true;
254
-    } else {
255
-        return false;
256
-    }
252
+	if ( defined( 'GD_TESTING_MODE' ) && GD_TESTING_MODE ) {
253
+		return true;
254
+	} else {
255
+		return false;
256
+	}
257 257
 }
258 258
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 /**
84 84
  * Define constants
85 85
  */
86
-if(!defined('GEODIRECTORY_PLUGIN_DIR')) define('GEODIRECTORY_PLUGIN_DIR', plugin_dir_path( __FILE__ ));
86
+if (!defined('GEODIRECTORY_PLUGIN_DIR')) define('GEODIRECTORY_PLUGIN_DIR', plugin_dir_path(__FILE__));
87 87
 
88 88
 /*
89 89
  * Declare database table names. All since version 1.0.0
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
      * This tries to disable cache on homepage as it can be very dynamic.
109 109
      */
110 110
     define('DONOTCACHEPAGE', TRUE);
111
-    $_SERVER['DONOTCACHEPAGE']= TRUE;
111
+    $_SERVER['DONOTCACHEPAGE'] = TRUE;
112 112
 }
113 113
 
114 114
 
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
 if (!defined('GEODIRECTORY_TEXTDOMAIN')) define('GEODIRECTORY_TEXTDOMAIN', 'geodirectory');
119 119
 
120 120
 // Load geodirectory plugin textdomain.
121
-add_action( 'plugins_loaded', 'geodir_load_textdomain' );
121
+add_action('plugins_loaded', 'geodir_load_textdomain');
122 122
 
123 123
 /*
124 124
  * A function to log GD errors no matter the type given.
@@ -129,18 +129,18 @@  discard block
 block discarded – undo
129 129
  * @param mixed $log The thing that should be logged.
130 130
  * @package GeoDirectory
131 131
  */
132
-function geodir_error_log($log){
132
+function geodir_error_log($log) {
133 133
     /*
134 134
      * A filter to override the WP_DEBUG setting for function geodir_error_log().
135 135
      *
136 136
      * @since 1.5.7
137 137
      */
138
-    $should_log = apply_filters( 'geodir_log_errors', WP_DEBUG);
139
-    if ( true === $should_log ) {
140
-        if ( is_array( $log ) || is_object( $log ) ) {
141
-            error_log( print_r( $log, true ) );
138
+    $should_log = apply_filters('geodir_log_errors', WP_DEBUG);
139
+    if (true === $should_log) {
140
+        if (is_array($log) || is_object($log)) {
141
+            error_log(print_r($log, true));
142 142
         } else {
143
-            error_log( $log );
143
+            error_log($log);
144 144
         }
145 145
     }
146 146
 }
@@ -230,13 +230,13 @@  discard block
 block discarded – undo
230 230
      * @since 1.5.6
231 231
      */
232 232
     global $pagenow;
233
-   if ( 'plugins.php' === $pagenow )
233
+   if ('plugins.php' === $pagenow)
234 234
     {
235 235
         // Better update message
236
-        $file   = basename( __FILE__ );
237
-        $folder = basename( dirname( __FILE__ ) );
236
+        $file   = basename(__FILE__);
237
+        $folder = basename(dirname(__FILE__));
238 238
         $hook = "in_plugin_update_message-{$folder}/{$file}";
239
-        add_action( $hook, 'geodire_admin_upgrade_notice', 20, 2 );
239
+        add_action($hook, 'geodire_admin_upgrade_notice', 20, 2);
240 240
     }
241 241
 
242 242
 }
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
  * @since 1.5.7
250 250
  */
251 251
 function geodir_is_testing_mode() {
252
-    if ( defined( 'GD_TESTING_MODE' ) && GD_TESTING_MODE ) {
252
+    if (defined('GD_TESTING_MODE') && GD_TESTING_MODE) {
253 253
         return true;
254 254
     } else {
255 255
         return false;
Please login to merge, or discard this patch.
geodirectory-templates/geodir-search.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Template for the GD search page
4
- *
5
- * You can make most changes via hooks or see the link below for info on how to replace the template in your theme.
6
- *
7
- * @link http://docs.wpgeodirectory.com/customizing-geodirectory-templates/
8
- * @since 1.0.0
9
- * @package GeoDirectory
10
- */
3
+		 * Template for the GD search page
4
+		 *
5
+		 * You can make most changes via hooks or see the link below for info on how to replace the template in your theme.
6
+		 *
7
+		 * @link http://docs.wpgeodirectory.com/customizing-geodirectory-templates/
8
+		 * @since 1.0.0
9
+		 * @package GeoDirectory
10
+		 */
11 11
 
12 12
 // get header
13 13
 get_header();
Please login to merge, or discard this patch.