Passed
Pull Request — master (#220)
by Viruthagiri
11:11
created
geodirectory_template_actions.php 3 patches
Spacing   +77 added lines, -77 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: %l', geodir_ucwords($listing_label . ' ' . __('Tags', 'geodirectory')), $links, (object)$terms);
1186
+            $taxonomies[$post_type . '_tags'] = wp_sprintf('%s: %l', geodir_ucwords($listing_label . ' ' . __('Tags', 'geodirectory')), $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: %l', geodir_ucwords($listing_label . ' ' . __('Category', 'geodirectory')), $links, (object)$terms);
1240
+        $taxonomies[$post_taxonomy] = wp_sprintf('%s: %l', geodir_ucwords($listing_label . ' ' . __('Category', 'geodirectory')), $links, (object) $terms);
1241 1241
 
1242 1242
     }
1243 1243
 
@@ -1268,11 +1268,11 @@  discard block
 block discarded – undo
1268 1268
  * @param object $post Optional. The post object or blank.
1269 1269
  * @package GeoDirectory
1270 1270
  */
1271
-function geodir_action_details_micordata($post='')
1271
+function geodir_action_details_micordata($post = '')
1272 1272
 {
1273 1273
 
1274 1274
     global $preview;
1275
-    if(empty($post)){global $post;}
1275
+    if (empty($post)) {global $post; }
1276 1276
     if ($preview || !geodir_is_page('detail')) {
1277 1277
         return;
1278 1278
     }
@@ -1293,7 +1293,7 @@  discard block
 block discarded – undo
1293 1293
                 "description" => $review->comment_content,
1294 1294
                 "reviewRating" => array(
1295 1295
                     "@type" => "Rating",
1296
-                    "bestRating" => "5",// @todo this will need to be filtered for review manager if user changes the score.
1296
+                    "bestRating" => "5", // @todo this will need to be filtered for review manager if user changes the score.
1297 1297
                     "ratingValue" => geodir_get_commentoverall($review->comment_ID),
1298 1298
                     "worstRating" => "1"
1299 1299
                 )
@@ -1321,13 +1321,13 @@  discard block
 block discarded – undo
1321 1321
     }
1322 1322
     //print_r($post);
1323 1323
     // external links
1324
-    $external_links =  array();
1324
+    $external_links = array();
1325 1325
     $external_links[] = $post->geodir_website;
1326 1326
     $external_links[] = $post->geodir_twitter;
1327 1327
     $external_links[] = $post->geodir_facebook;
1328 1328
     $external_links = array_filter($external_links);
1329 1329
 
1330
-    if(!empty($external_links)){
1330
+    if (!empty($external_links)) {
1331 1331
         $external_links = array_values($external_links);
1332 1332
     }
1333 1333
 
@@ -1337,16 +1337,16 @@  discard block
 block discarded – undo
1337 1337
 
1338 1338
     // schema type
1339 1339
     $schema_type = 'LocalBusiness';
1340
-    if(isset($post->default_category) && $post->default_category){
1340
+    if (isset($post->default_category) && $post->default_category) {
1341 1341
         $schema_type = get_tax_meta($post->default_category, 'ct_cat_schema', false, $post->post_type);
1342
-        if(!$schema_type && $post->post_type=='gd_event'){$schema_type = 'Event';}
1342
+        if (!$schema_type && $post->post_type == 'gd_event') {$schema_type = 'Event'; }
1343 1343
     }
1344 1344
 
1345 1345
     $schema = array();
1346 1346
     $schema['@context'] = "http://schema.org";
1347 1347
     $schema['@type'] = $schema_type;
1348 1348
     $schema['name'] = $post->post_name;
1349
-    $schema['description'] = wp_strip_all_tags( $post->post_content, true );
1349
+    $schema['description'] = wp_strip_all_tags($post->post_content, true);
1350 1350
     $schema['telephone'] = $post->geodir_contact;
1351 1351
     $schema['url'] = $c_url;
1352 1352
     $schema['sameAs'] = $external_links;
@@ -1360,7 +1360,7 @@  discard block
 block discarded – undo
1360 1360
         "postalCode" => $post->post_zip
1361 1361
     );
1362 1362
 
1363
-    if($post->post_latitude && $post->post_longitude) {
1363
+    if ($post->post_latitude && $post->post_longitude) {
1364 1364
         $schema['geo'] = array(
1365 1365
             "@type" => "GeoCoordinates",
1366 1366
             "latitude" => $post->post_latitude,
@@ -1368,7 +1368,7 @@  discard block
 block discarded – undo
1368 1368
         );
1369 1369
     }
1370 1370
 
1371
-    if($post_avgratings) {
1371
+    if ($post_avgratings) {
1372 1372
         $schema['aggregateRating'] = array(
1373 1373
             "@type" => "AggregateRating",
1374 1374
             "ratingValue" => $post_avgratings,
@@ -1387,7 +1387,7 @@  discard block
 block discarded – undo
1387 1387
      * @param array $schema The array of schema data to be filtered.
1388 1388
      * @param object $post The post object.
1389 1389
      */
1390
-    $schema = apply_filters('geodir_details_schema', $schema,$post);
1390
+    $schema = apply_filters('geodir_details_schema', $schema, $post);
1391 1391
 
1392 1392
 
1393 1393
     echo '<script type="application/ld+json">' . json_encode($schema) . '</script>';
@@ -1595,26 +1595,26 @@  discard block
 block discarded – undo
1595 1595
 
1596 1596
 
1597 1597
     $title = $list_title;
1598
-    if(geodir_is_page('pt')){
1598
+    if (geodir_is_page('pt')) {
1599 1599
         $gd_page = 'pt';
1600
-        $title  = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
1600
+        $title = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
1601 1601
     }
1602
-    elseif(geodir_is_page('listing')){
1602
+    elseif (geodir_is_page('listing')) {
1603 1603
         $gd_page = 'listing';
1604 1604
         global $wp_query;
1605 1605
         $current_term = $wp_query->get_queried_object();
1606
-        if (strpos($current_term->taxonomy,'_tags') !== false) {
1606
+        if (strpos($current_term->taxonomy, '_tags') !== false) {
1607 1607
             $title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
1608
-        }else{
1608
+        } else {
1609 1609
             $title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
1610 1610
         }
1611 1611
 
1612 1612
     }
1613
-    elseif(geodir_is_page('author')){
1613
+    elseif (geodir_is_page('author')) {
1614 1614
         $gd_page = 'author';
1615
-        if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
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
 
@@ -1628,7 +1628,7 @@  discard block
 block discarded – undo
1628 1628
      * @param string $title The page title including variables.
1629 1629
      * @param string $gd_page The GeoDirectory page type if any.
1630 1630
      */
1631
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
1631
+    $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
1632 1632
 
1633 1633
     echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
1634 1634
         /**
@@ -1673,7 +1673,7 @@  discard block
 block discarded – undo
1673 1673
         if ($cat_description) {
1674 1674
             ?>
1675 1675
 
1676
-            <div class="term_description"><?php echo $cat_description;?></div> <?php
1676
+            <div class="term_description"><?php echo $cat_description; ?></div> <?php
1677 1677
         }
1678 1678
 
1679 1679
     }
@@ -1958,7 +1958,7 @@  discard block
 block discarded – undo
1958 1958
      */
1959 1959
     do_action('geodir_main_content_open', 'listings-page', 'geodir-main-content', 'listings-page');
1960 1960
     $extra_class = apply_filters('geodir_before_listing_wrapper_extra_class', '', 'listings-page');
1961
-    echo '<div class="clearfix '.$extra_class.'">';
1961
+    echo '<div class="clearfix ' . $extra_class . '">';
1962 1962
     /**
1963 1963
      * Called before the listings page content, inside the outer wrapper. Used on listings pages and search and author pages.
1964 1964
      *
@@ -2034,11 +2034,11 @@  discard block
 block discarded – undo
2034 2034
 
2035 2035
     $title = apply_filters('geodir_add_listing_page_title_text', get_the_title());
2036 2036
 
2037
-    if(geodir_is_page('add-listing')){
2037
+    if (geodir_is_page('add-listing')) {
2038 2038
         $gd_page = 'add-listing';
2039
-        if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
2039
+        if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2040 2040
             $title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
2041
-        }elseif(isset($listing_type)){
2041
+        }elseif (isset($listing_type)) {
2042 2042
             $title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
2043 2043
         }
2044 2044
 
@@ -2052,7 +2052,7 @@  discard block
 block discarded – undo
2052 2052
      * @param string $title The page title including variables.
2053 2053
      * @param string $gd_page The GeoDirectory page type if any.
2054 2054
      */
2055
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2055
+    $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2056 2056
 
2057 2057
     echo '<header class="' . $class_header . '"><h1 class="' . $class . '">';
2058 2058
     echo $title;
@@ -2068,7 +2068,7 @@  discard block
 block discarded – undo
2068 2068
  */
2069 2069
 function geodir_action_add_listing_page_mandatory()
2070 2070
 {?>
2071
-    <p class="geodir-note "><span class="geodir-required">*</span>&nbsp;<?php echo INDICATES_MANDATORY_FIELDS_TEXT;?></p>
2071
+    <p class="geodir-note "><span class="geodir-required">*</span>&nbsp;<?php echo INDICATES_MANDATORY_FIELDS_TEXT; ?></p>
2072 2072
 <?php
2073 2073
 }
2074 2074
 
@@ -2103,7 +2103,7 @@  discard block
 block discarded – undo
2103 2103
 
2104 2104
     if (isset($_REQUEST['backandedit'])) {
2105 2105
         global $post;
2106
-        $post = (object)$gd_session->get('listing');
2106
+        $post = (object) $gd_session->get('listing');
2107 2107
         $listing_type = $post->listing_type;
2108 2108
         $title = $post->post_title;
2109 2109
         $desc = $post->post_desc;
@@ -2135,15 +2135,15 @@  discard block
 block discarded – undo
2135 2135
         $user_login = true;
2136 2136
     }
2137 2137
     ?>
2138
-    <form name="propertyform" id="propertyform" action="<?php echo get_page_link(geodir_preview_page_id());?>" method="post" enctype="multipart/form-data">
2139
-        <input type="hidden" name="preview" value="<?php echo sanitize_text_field($listing_type);?>"/>
2140
-        <input type="hidden" name="listing_type" value="<?php echo sanitize_text_field($listing_type);?>"/>
2138
+    <form name="propertyform" id="propertyform" action="<?php echo get_page_link(geodir_preview_page_id()); ?>" method="post" enctype="multipart/form-data">
2139
+        <input type="hidden" name="preview" value="<?php echo sanitize_text_field($listing_type); ?>"/>
2140
+        <input type="hidden" name="listing_type" value="<?php echo sanitize_text_field($listing_type); ?>"/>
2141 2141
         <?php if ($page_id) { ?>
2142
-        <input type="hidden" name="add_listing_page_id" value="<?php echo $page_id;?>"/>
2142
+        <input type="hidden" name="add_listing_page_id" value="<?php echo $page_id; ?>"/>
2143 2143
         <?php } if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') { ?>
2144
-            <input type="hidden" name="pid" value="<?php echo sanitize_text_field($_REQUEST['pid']);?>"/>
2144
+            <input type="hidden" name="pid" value="<?php echo sanitize_text_field($_REQUEST['pid']); ?>"/>
2145 2145
         <?php } if (isset($_REQUEST['backandedit'])) { ?>
2146
-            <input type="hidden" name="backandedit" value="<?php echo sanitize_text_field($_REQUEST['backandedit']);?>"/>
2146
+            <input type="hidden" name="backandedit" value="<?php echo sanitize_text_field($_REQUEST['backandedit']); ?>"/>
2147 2147
         <?php
2148 2148
         } 
2149 2149
         /**
@@ -2155,7 +2155,7 @@  discard block
 block discarded – undo
2155 2155
          */
2156 2156
         do_action('geodir_before_detail_fields');
2157 2157
         ?>
2158
-        <h5 id="geodir_fieldset_details" class="geodir-fieldset-row" gd-fieldset="details"><?php echo LISTING_DETAILS_TEXT;?></h5>
2158
+        <h5 id="geodir_fieldset_details" class="geodir-fieldset-row" gd-fieldset="details"><?php echo LISTING_DETAILS_TEXT; ?></h5>
2159 2159
         <?php
2160 2160
         /**
2161 2161
          * Called at the top of the add listing page form for frontend.
@@ -2167,10 +2167,10 @@  discard block
 block discarded – undo
2167 2167
         do_action('geodir_before_main_form_fields');
2168 2168
         ?>
2169 2169
         <div id="geodir_post_title_row" class="required_field geodir_form_row clearfix gd-fieldset-details">
2170
-            <label><?php echo PLACE_TITLE_TEXT;?><span>*</span> </label>
2170
+            <label><?php echo PLACE_TITLE_TEXT; ?><span>*</span> </label>
2171 2171
             <input type="text" field_type="text" name="post_title" id="post_title" class="geodir_textfield"
2172 2172
                    value="<?php echo esc_attr(stripslashes($title)); ?>"/>
2173
-            <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory');?></span>
2173
+            <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span>
2174 2174
         </div>
2175 2175
         <?php
2176 2176
         $show_editor = get_option('geodir_tiny_editor_on_add_listing');
@@ -2205,7 +2205,7 @@  discard block
 block discarded – undo
2205 2205
         $desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit);
2206 2206
         
2207 2207
         $desc_class = '';
2208
-        if ($desc_limit === '' || (int)$desc_limit > 0) {
2208
+        if ($desc_limit === '' || (int) $desc_limit > 0) {
2209 2209
             /**
2210 2210
              * Called on the add listing page form for frontend just before the description field.
2211 2211
              *
@@ -2218,8 +2218,8 @@  discard block
 block discarded – undo
2218 2218
             $desc_class = ' hidden';
2219 2219
         }
2220 2220
         ?>
2221
-        <div id="geodir_post_desc_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $desc_class;?>">
2222
-            <label><?php echo PLACE_DESC_TEXT;?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label>
2221
+        <div id="geodir_post_desc_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $desc_class; ?>">
2222
+            <label><?php echo PLACE_DESC_TEXT; ?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label>
2223 2223
             <?php
2224 2224
             if (!empty($show_editor) && in_array($listing_type, $show_editor)) {
2225 2225
                 $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
@@ -2228,16 +2228,16 @@  discard block
 block discarded – undo
2228 2228
                     <?php wp_editor($desc, "post_desc", $editor_settings); ?>
2229 2229
                 </div>
2230 2230
             <?php if ($desc_limit != '') { ?>
2231
-                <script type="text/javascript">jQuery('textarea#post_desc').attr('maxlength', "<?php echo $desc_limit;?>");</script>
2231
+                <script type="text/javascript">jQuery('textarea#post_desc').attr('maxlength', "<?php echo $desc_limit; ?>");</script>
2232 2232
             <?php } } else { ?>
2233 2233
                 <textarea field_type="textarea" name="post_desc" id="post_desc" class="geodir_textarea" maxlength="<?php echo $desc_limit; ?>"><?php echo $desc; ?></textarea>
2234 2234
             <?php } if ($desc_limit_msg != '') { ?>
2235 2235
                 <span class="geodir_message_note"><?php echo $desc_limit_msg; ?></span>
2236 2236
             <?php } ?>
2237
-            <span class="geodir_message_error"><?php echo _e($required_msg, 'geodirectory');?></span>
2237
+            <span class="geodir_message_error"><?php echo _e($required_msg, 'geodirectory'); ?></span>
2238 2238
         </div>
2239 2239
         <?php
2240
-        if ($desc_limit === '' || (int)$desc_limit > 0) {
2240
+        if ($desc_limit === '' || (int) $desc_limit > 0) {
2241 2241
             /**
2242 2242
              * Called on the add listing page form for frontend just after the description field.
2243 2243
              *
@@ -2276,7 +2276,7 @@  discard block
 block discarded – undo
2276 2276
         $kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count);
2277 2277
         
2278 2278
         $tags_class = '';
2279
-        if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2279
+        if ($kw_tags_count === '' || (int) $kw_tags_count > 0) {
2280 2280
             /**
2281 2281
              * Called on the add listing page form for frontend just before the tags field.
2282 2282
              *
@@ -2287,14 +2287,14 @@  discard block
 block discarded – undo
2287 2287
             $tags_class = ' hidden';
2288 2288
         }
2289 2289
         ?>
2290
-        <div id="geodir_post_tags_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $tags_class;?>">
2290
+        <div id="geodir_post_tags_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $tags_class; ?>">
2291 2291
             <label><?php echo TAGKW_TEXT; ?></label>
2292 2292
             <input name="post_tags" id="post_tags" value="<?php echo $kw_tags; ?>" type="text" class="geodir_textfield"
2293
-                   maxlength="<?php echo $kw_tags_count;?>"/>
2294
-            <span class="geodir_message_note"><?php echo $kw_tags_msg;?></span>
2293
+                   maxlength="<?php echo $kw_tags_count; ?>"/>
2294
+            <span class="geodir_message_note"><?php echo $kw_tags_msg; ?></span>
2295 2295
         </div>
2296 2296
         <?php
2297
-        if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2297
+        if ($kw_tags_count === '' || (int) $kw_tags_count > 0) {
2298 2298
             /**
2299 2299
              * Called on the add listing page form for frontend just after the tags field.
2300 2300
              *
@@ -2320,7 +2320,7 @@  discard block
 block discarded – undo
2320 2320
         $thumb_img_arr = array();
2321 2321
         $totImg = 0;
2322 2322
         if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
2323
-            $post = (object)$gd_session->get('listing');
2323
+            $post = (object) $gd_session->get('listing');
2324 2324
             if (isset($post->post_images))
2325 2325
                 $curImages = trim($post->post_images, ",");
2326 2326
 
@@ -2333,7 +2333,7 @@  discard block
 block discarded – undo
2333 2333
             $listing_type = $post->listing_type;
2334 2334
 
2335 2335
         } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2336
-            $post = geodir_get_post_info((int)$_REQUEST['pid']);
2336
+            $post = geodir_get_post_info((int) $_REQUEST['pid']);
2337 2337
             $listing_type = $post->post_type;
2338 2338
             $thumb_img_arr = geodir_get_images($_REQUEST['pid']);
2339 2339
 
@@ -2347,7 +2347,7 @@  discard block
 block discarded – undo
2347 2347
                 //$curImages = $img->src.",";
2348 2348
             }
2349 2349
 
2350
-            $totImg = count((array)$thumb_img_arr);
2350
+            $totImg = count((array) $thumb_img_arr);
2351 2351
         }
2352 2352
 
2353 2353
         if ($curImages != '')
@@ -2368,7 +2368,7 @@  discard block
 block discarded – undo
2368 2368
         if ($show_image_input_box) {
2369 2369
             ?>
2370 2370
 
2371
-            <h5 id="geodir_form_title_row" class="geodir-form_title"> <?php echo PRO_PHOTO_TEXT;?>
2371
+            <h5 id="geodir_form_title_row" class="geodir-form_title"> <?php echo PRO_PHOTO_TEXT; ?>
2372 2372
                 <?php if ($image_limit == 1) {
2373 2373
                     echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
2374 2374
                 } ?>
@@ -2391,7 +2391,7 @@  discard block
 block discarded – undo
2391 2391
                 <div
2392 2392
                     class="plupload-upload-uic hide-if-no-js <?php if ($multiple): ?>plupload-upload-uic-multiple<?php endif; ?>"
2393 2393
                     id="<?php echo $id; ?>plupload-upload-ui">
2394
-                    <h4><?php _e('Drop files to upload', 'geodirectory');?></h4><br/>
2394
+                    <h4><?php _e('Drop files to upload', 'geodirectory'); ?></h4><br/>
2395 2395
                     <input id="<?php echo $id; ?>plupload-browse-button" type="button"
2396 2396
                            value="<?php esc_attr_e('Select Files', 'geodirectory'); ?>" class="geodir_button"/>
2397 2397
                     <span class="ajaxnonceplu"
@@ -2408,7 +2408,7 @@  discard block
 block discarded – undo
2408 2408
                      id="<?php echo $id; ?>plupload-thumbs" style="border-top:1px solid #ccc; padding-top:10px;">
2409 2409
                 </div>
2410 2410
                 <span
2411
-                    id="upload-msg"><?php _e('Please drag &amp; drop the images to rearrange the order', 'geodirectory');?></span>
2411
+                    id="upload-msg"><?php _e('Please drag &amp; drop the images to rearrange the order', 'geodirectory'); ?></span>
2412 2412
                 <span id="<?php echo $id; ?>upload-error" style="display:none"></span>
2413 2413
             </div>
2414 2414
 
@@ -2420,7 +2420,7 @@  discard block
 block discarded – undo
2420 2420
          *
2421 2421
          * @since 1.0.0
2422 2422
          */
2423
-        do_action('geodir_after_main_form_fields');?>
2423
+        do_action('geodir_after_main_form_fields'); ?>
2424 2424
 
2425 2425
 
2426 2426
         <!-- add captcha code -->
@@ -2431,7 +2431,7 @@  discard block
 block discarded – undo
2431 2431
         </script>
2432 2432
         <noscript>
2433 2433
             <div>
2434
-                <label><?php _e('Type 64 into this box', 'geodirectory');?></label>
2434
+                <label><?php _e('Type 64 into this box', 'geodirectory'); ?></label>
2435 2435
                 <input type="text" id="geodir_spamblocker_top_form" name="geodir_spamblocker" value="" maxlength="10"/>
2436 2436
             </div>
2437 2437
         </noscript>
@@ -2441,10 +2441,10 @@  discard block
 block discarded – undo
2441 2441
         <!-- end captcha code -->
2442 2442
 
2443 2443
         <div id="geodir-add-listing-submit" class="geodir_form_row clear_both" style="padding:2px;text-align:center;">
2444
-            <input type="submit" value="<?php echo PRO_PREVIEW_BUTTON;?>"
2445
-                   class="geodir_button" <?php echo $submit_button;?>/>
2444
+            <input type="submit" value="<?php echo PRO_PREVIEW_BUTTON; ?>"
2445
+                   class="geodir_button" <?php echo $submit_button; ?>/>
2446 2446
             <span class="geodir_message_note"
2447
-                  style="padding-left:0px;"> <?php _e('Note: You will be able to see a preview in the next page', 'geodirectory');?></span>
2447
+                  style="padding-left:0px;"> <?php _e('Note: You will be able to see a preview in the next page', 'geodirectory'); ?></span>
2448 2448
         </div>
2449 2449
 
2450 2450
     </form>
@@ -2506,7 +2506,7 @@  discard block
 block discarded – undo
2506 2506
         class="<?php
2507 2507
         /** This action is documented in geodirectory_template_actions.php */
2508 2508
         echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>">
2509
-        <?php dynamic_sidebar('Reg/Login Top Section');?>
2509
+        <?php dynamic_sidebar('Reg/Login Top Section'); ?>
2510 2510
     </div><!-- clearfix ends here-->
2511 2511
 <?php
2512 2512
 }
@@ -2528,7 +2528,7 @@  discard block
 block discarded – undo
2528 2528
 
2529 2529
     ?>
2530 2530
     <script type="text/javascript">
2531
-        <?php if ( $user_login ) { ?>
2531
+        <?php if ($user_login) { ?>
2532 2532
         setTimeout(function () {
2533 2533
             try {
2534 2534
                 d = document.getElementById('user_pass');
@@ -2545,7 +2545,7 @@  discard block
 block discarded – undo
2545 2545
         <?php } ?>
2546 2546
     </script>
2547 2547
     <script type="text/javascript">
2548
-        <?php if ( $user_login ) { ?>
2548
+        <?php if ($user_login) { ?>
2549 2549
         setTimeout(function () {
2550 2550
             try {
2551 2551
                 d = document.getElementById('user_pass');
@@ -2683,11 +2683,11 @@  discard block
 block discarded – undo
2683 2683
     $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2684 2684
 
2685 2685
     $title = $list_title;
2686
-    if(geodir_is_page('author')){
2686
+    if (geodir_is_page('author')) {
2687 2687
         $gd_page = 'author';
2688
-        if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
2688
+        if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
2689 2689
             $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
2690
-        }else{
2690
+        } else {
2691 2691
             $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
2692 2692
         }
2693 2693
 
@@ -2701,7 +2701,7 @@  discard block
 block discarded – undo
2701 2701
      * @param string $title The page title including variables.
2702 2702
      * @param string $gd_page The GeoDirectory page type if any.
2703 2703
      */
2704
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2704
+    $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2705 2705
 
2706 2706
     echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2707 2707
         /**
@@ -2915,7 +2915,7 @@  discard block
 block discarded – undo
2915 2915
     $post_type_info = get_post_type_object($gd_post_type);
2916 2916
 
2917 2917
     $pt_name = '';
2918
-    if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;}
2918
+    if (isset($post_type_info->labels->name)) {$pt_name = $post_type_info->labels->name; }
2919 2919
 
2920 2920
     if (is_search()) {
2921 2921
         $list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
Please login to merge, or discard this patch.
Braces   +31 added lines, -24 removed lines patch added patch discarded remove patch
@@ -714,8 +714,9 @@  discard block
 block discarded – undo
714 714
 
715 715
                         if (isset($post->post_default_category) && $post->post_default_category == $cat_id) {
716 716
                             if ($term_icon_url = get_tax_meta($cat_id, 'ct_cat_icon', false, $post_type)) {
717
-                                if (isset($term_icon_url['src']) && $term_icon_url['src'] != '')
718
-                                    $term_icon = $term_icon_url['src'];
717
+                                if (isset($term_icon_url['src']) && $term_icon_url['src'] != '') {
718
+                                                                    $term_icon = $term_icon_url['src'];
719
+                                }
719 720
                                 break;
720 721
                             }
721 722
                         }
@@ -1246,8 +1247,9 @@  discard block
 block discarded – undo
1246 1247
         echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>';
1247 1248
     }
1248 1249
 
1249
-    if (isset($taxonomies[$post_type . '_tags']))
1250
-        echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>';
1250
+    if (isset($taxonomies[$post_type . '_tags'])) {
1251
+            echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>';
1252
+    }
1251 1253
 
1252 1254
     ?>
1253 1255
     </p><?php
@@ -1598,23 +1600,21 @@  discard block
 block discarded – undo
1598 1600
     if(geodir_is_page('pt')){
1599 1601
         $gd_page = 'pt';
1600 1602
         $title  = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
1601
-    }
1602
-    elseif(geodir_is_page('listing')){
1603
+    } elseif(geodir_is_page('listing')){
1603 1604
         $gd_page = 'listing';
1604 1605
         global $wp_query;
1605 1606
         $current_term = $wp_query->get_queried_object();
1606 1607
         if (strpos($current_term->taxonomy,'_tags') !== false) {
1607 1608
             $title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
1608
-        }else{
1609
+        } else{
1609 1610
             $title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
1610 1611
         }
1611 1612
 
1612
-    }
1613
-    elseif(geodir_is_page('author')){
1613
+    } elseif(geodir_is_page('author')){
1614 1614
         $gd_page = 'author';
1615 1615
         if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
1616 1616
             $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
1617
-        }else{
1617
+        } else{
1618 1618
             $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
1619 1619
         }
1620 1620
 
@@ -2025,8 +2025,9 @@  discard block
 block discarded – undo
2025 2025
  */
2026 2026
 function geodir_action_add_listing_page_title()
2027 2027
 {
2028
-    if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '')
2029
-        $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2028
+    if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '') {
2029
+            $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2030
+    }
2030 2031
     /** This action is documented in geodirectory_template_actions.php */
2031 2032
     $class = apply_filters('geodir_page_title_class', 'entry-title fn');
2032 2033
     /** This action is documented in geodirectory_template_actions.php */
@@ -2038,7 +2039,7 @@  discard block
 block discarded – undo
2038 2039
         $gd_page = 'add-listing';
2039 2040
         if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
2040 2041
             $title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
2041
-        }elseif(isset($listing_type)){
2042
+        } elseif(isset($listing_type)){
2042 2043
             $title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
2043 2044
         }
2044 2045
 
@@ -2321,8 +2322,9 @@  discard block
 block discarded – undo
2321 2322
         $totImg = 0;
2322 2323
         if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
2323 2324
             $post = (object)$gd_session->get('listing');
2324
-            if (isset($post->post_images))
2325
-                $curImages = trim($post->post_images, ",");
2325
+            if (isset($post->post_images)) {
2326
+                            $curImages = trim($post->post_images, ",");
2327
+            }
2326 2328
 
2327 2329
 
2328 2330
             if ($curImages != '') {
@@ -2350,10 +2352,13 @@  discard block
 block discarded – undo
2350 2352
             $totImg = count((array)$thumb_img_arr);
2351 2353
         }
2352 2354
 
2353
-        if ($curImages != '')
2354
-            $svalue = $curImages; // this will be initial value of the above form field. Image urls.
2355
-        else
2356
-            $svalue = '';
2355
+        if ($curImages != '') {
2356
+                    $svalue = $curImages;
2357
+        }
2358
+        // this will be initial value of the above form field. Image urls.
2359
+        else {
2360
+                    $svalue = '';
2361
+        }
2357 2362
 
2358 2363
         $image_limit = $package_info->image_limit;
2359 2364
         $show_image_input_box = ($image_limit != '0');
@@ -2563,8 +2568,9 @@  discard block
 block discarded – undo
2563 2568
     </script><?php
2564 2569
 
2565 2570
     global $errors;
2566
-    if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim')
2567
-        $errors->add('claim_login', LOGIN_CLAIM);
2571
+    if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim') {
2572
+            $errors->add('claim_login', LOGIN_CLAIM);
2573
+    }
2568 2574
 
2569 2575
     if (!empty($errors)) {
2570 2576
         foreach ($errors as $errorsObj) {
@@ -2668,8 +2674,9 @@  discard block
 block discarded – undo
2668 2674
 
2669 2675
     if (!empty($term)) {
2670 2676
         $current_term = get_term_by('slug', $term, $taxonomy[0]);
2671
-        if (!empty($current_term))
2672
-            $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
2677
+        if (!empty($current_term)) {
2678
+                    $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
2679
+        }
2673 2680
     }
2674 2681
 
2675 2682
 
@@ -2687,7 +2694,7 @@  discard block
 block discarded – undo
2687 2694
         $gd_page = 'author';
2688 2695
         if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
2689 2696
             $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
2690
-        }else{
2697
+        } else{
2691 2698
             $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
2692 2699
         }
2693 2700
 
Please login to merge, or discard this patch.
Indentation   +1671 added lines, -1671 removed lines patch added patch discarded remove patch
@@ -17,10 +17,10 @@  discard block
 block discarded – undo
17 17
  */
18 18
 function gd_compat_styles()
19 19
 {
20
-    $tc = get_option('theme_compatibility_setting');
21
-    echo "<style id='gd-compat-styles' type='text/css'>";
22
-    echo $tc['geodir_theme_compat_css'];
23
-    echo "</style>";
20
+	$tc = get_option('theme_compatibility_setting');
21
+	echo "<style id='gd-compat-styles' type='text/css'>";
22
+	echo $tc['geodir_theme_compat_css'];
23
+	echo "</style>";
24 24
 }
25 25
 
26 26
 /**
@@ -31,10 +31,10 @@  discard block
 block discarded – undo
31 31
  */
32 32
 function gd_compat_script()
33 33
 {
34
-    $tc = get_option('theme_compatibility_setting');
35
-    echo "<script>";
36
-    echo $tc['geodir_theme_compat_js'];
37
-    echo " </script>";
34
+	$tc = get_option('theme_compatibility_setting');
35
+	echo "<script>";
36
+	echo $tc['geodir_theme_compat_js'];
37
+	echo " </script>";
38 38
 }
39 39
 
40 40
 /**
@@ -47,8 +47,8 @@  discard block
 block discarded – undo
47 47
  */
48 48
 function geodir_top_content_add_dynamic()
49 49
 {
50
-    $tc = get_option('theme_compatibility_setting');
51
-    echo $tc['geodir_top_content_add'];
50
+	$tc = get_option('theme_compatibility_setting');
51
+	echo $tc['geodir_top_content_add'];
52 52
 }
53 53
 
54 54
 /**
@@ -61,8 +61,8 @@  discard block
 block discarded – undo
61 61
  */
62 62
 function geodir_before_main_content_add_dynamic()
63 63
 {
64
-    $tc = get_option('theme_compatibility_setting');
65
-    echo $tc['geodir_before_main_content_add'];
64
+	$tc = get_option('theme_compatibility_setting');
65
+	echo $tc['geodir_before_main_content_add'];
66 66
 }
67 67
 
68 68
 /**
@@ -75,8 +75,8 @@  discard block
 block discarded – undo
75 75
  */
76 76
 function geodir_full_page_class_dynamic()
77 77
 {
78
-    $tc = get_option('theme_compatibility_setting');
79
-    return $tc['geodir_full_page_class_filter'];
78
+	$tc = get_option('theme_compatibility_setting');
79
+	return $tc['geodir_full_page_class_filter'];
80 80
 }
81 81
 
82 82
 /**
@@ -89,8 +89,8 @@  discard block
 block discarded – undo
89 89
  */
90 90
 function geodir_before_widget_dynamic()
91 91
 {
92
-    $tc = get_option('theme_compatibility_setting');
93
-    return $tc['geodir_before_widget_filter'];
92
+	$tc = get_option('theme_compatibility_setting');
93
+	return $tc['geodir_before_widget_filter'];
94 94
 }
95 95
 
96 96
 /**
@@ -103,8 +103,8 @@  discard block
 block discarded – undo
103 103
  */
104 104
 function geodir_after_widget_dynamic()
105 105
 {
106
-    $tc = get_option('theme_compatibility_setting');
107
-    return $tc['geodir_after_widget_filter'];
106
+	$tc = get_option('theme_compatibility_setting');
107
+	return $tc['geodir_after_widget_filter'];
108 108
 }
109 109
 
110 110
 /**
@@ -117,8 +117,8 @@  discard block
 block discarded – undo
117 117
  */
118 118
 function geodir_before_title_dynamic()
119 119
 {
120
-    $tc = get_option('theme_compatibility_setting');
121
-    return $tc['geodir_before_title_filter'];
120
+	$tc = get_option('theme_compatibility_setting');
121
+	return $tc['geodir_before_title_filter'];
122 122
 }
123 123
 
124 124
 /**
@@ -131,8 +131,8 @@  discard block
 block discarded – undo
131 131
  */
132 132
 function geodir_after_title_dynamic()
133 133
 {
134
-    $tc = get_option('theme_compatibility_setting');
135
-    return $tc['geodir_after_title_filter'];
134
+	$tc = get_option('theme_compatibility_setting');
135
+	return $tc['geodir_after_title_filter'];
136 136
 }
137 137
 
138 138
 /**
@@ -145,8 +145,8 @@  discard block
 block discarded – undo
145 145
  */
146 146
 function geodir_menu_li_class_dynamic()
147 147
 {
148
-    $tc = get_option('theme_compatibility_setting');
149
-    return $tc['geodir_menu_li_class_filter'];
148
+	$tc = get_option('theme_compatibility_setting');
149
+	return $tc['geodir_menu_li_class_filter'];
150 150
 }
151 151
 
152 152
 /**
@@ -159,8 +159,8 @@  discard block
 block discarded – undo
159 159
  */
160 160
 function geodir_sub_menu_ul_class_dynamic()
161 161
 {
162
-    $tc = get_option('theme_compatibility_setting');
163
-    return $tc['geodir_sub_menu_ul_class_filter'];
162
+	$tc = get_option('theme_compatibility_setting');
163
+	return $tc['geodir_sub_menu_ul_class_filter'];
164 164
 }
165 165
 
166 166
 /**
@@ -173,8 +173,8 @@  discard block
 block discarded – undo
173 173
  */
174 174
 function geodir_sub_menu_li_class_dynamic()
175 175
 {
176
-    $tc = get_option('theme_compatibility_setting');
177
-    return $tc['geodir_sub_menu_li_class_filter'];
176
+	$tc = get_option('theme_compatibility_setting');
177
+	return $tc['geodir_sub_menu_li_class_filter'];
178 178
 }
179 179
 
180 180
 /**
@@ -187,8 +187,8 @@  discard block
 block discarded – undo
187 187
  */
188 188
 function geodir_menu_a_class_dynamic()
189 189
 {
190
-    $tc = get_option('theme_compatibility_setting');
191
-    return $tc['geodir_menu_a_class_filter'];
190
+	$tc = get_option('theme_compatibility_setting');
191
+	return $tc['geodir_menu_a_class_filter'];
192 192
 }
193 193
 
194 194
 /**
@@ -201,8 +201,8 @@  discard block
 block discarded – undo
201 201
  */
202 202
 function geodir_sub_menu_a_class_dynamic()
203 203
 {
204
-    $tc = get_option('theme_compatibility_setting');
205
-    return $tc['geodir_sub_menu_a_class_filter'];
204
+	$tc = get_option('theme_compatibility_setting');
205
+	return $tc['geodir_sub_menu_a_class_filter'];
206 206
 }
207 207
 
208 208
 /**
@@ -215,8 +215,8 @@  discard block
 block discarded – undo
215 215
  */
216 216
 function geodir_location_switcher_menu_li_class_dynamic()
217 217
 {
218
-    $tc = get_option('theme_compatibility_setting');
219
-    return $tc['geodir_location_switcher_menu_li_class_filter'];
218
+	$tc = get_option('theme_compatibility_setting');
219
+	return $tc['geodir_location_switcher_menu_li_class_filter'];
220 220
 }
221 221
 
222 222
 /**
@@ -229,8 +229,8 @@  discard block
 block discarded – undo
229 229
  */
230 230
 function geodir_location_switcher_menu_a_class_dynamic()
231 231
 {
232
-    $tc = get_option('theme_compatibility_setting');
233
-    return $tc['geodir_location_switcher_menu_a_class_filter'];
232
+	$tc = get_option('theme_compatibility_setting');
233
+	return $tc['geodir_location_switcher_menu_a_class_filter'];
234 234
 }
235 235
 
236 236
 /**
@@ -243,8 +243,8 @@  discard block
 block discarded – undo
243 243
  */
244 244
 function geodir_location_switcher_menu_sub_ul_class_dynamic()
245 245
 {
246
-    $tc = get_option('theme_compatibility_setting');
247
-    return $tc['geodir_location_switcher_menu_sub_ul_class_filter'];
246
+	$tc = get_option('theme_compatibility_setting');
247
+	return $tc['geodir_location_switcher_menu_sub_ul_class_filter'];
248 248
 }
249 249
 
250 250
 /**
@@ -257,8 +257,8 @@  discard block
 block discarded – undo
257 257
  */
258 258
 function geodir_location_switcher_menu_sub_li_class_dynamic()
259 259
 {
260
-    $tc = get_option('theme_compatibility_setting');
261
-    return $tc['geodir_location_switcher_menu_sub_li_class_filter'];
260
+	$tc = get_option('theme_compatibility_setting');
261
+	return $tc['geodir_location_switcher_menu_sub_li_class_filter'];
262 262
 }
263 263
 
264 264
 
@@ -275,106 +275,106 @@  discard block
 block discarded – undo
275 275
 function geodir_content_actions_dynamic()
276 276
 {
277 277
 
278
-    $tc = get_option('theme_compatibility_setting');
279
-    if (empty($tc)) {
280
-        return;
281
-    }
278
+	$tc = get_option('theme_compatibility_setting');
279
+	if (empty($tc)) {
280
+		return;
281
+	}
282 282
 
283
-    //php
284
-    if (!empty($tc['geodir_theme_compat_code'])) {
285
-        include_once('geodirectory-functions/compatibility/' . $tc['geodir_theme_compat_code'] . '.php');
286
-    }
283
+	//php
284
+	if (!empty($tc['geodir_theme_compat_code'])) {
285
+		include_once('geodirectory-functions/compatibility/' . $tc['geodir_theme_compat_code'] . '.php');
286
+	}
287 287
 
288
-    //geodir_full_page_class
289
-    if (!empty($tc['geodir_full_page_class_filter'])) {
290
-        add_filter('geodir_full_page_class', 'geodir_full_page_class_dynamic', 10);
291
-    }
288
+	//geodir_full_page_class
289
+	if (!empty($tc['geodir_full_page_class_filter'])) {
290
+		add_filter('geodir_full_page_class', 'geodir_full_page_class_dynamic', 10);
291
+	}
292 292
 
293
-    //widget before filter
294
-    if (!empty($tc['geodir_before_widget_filter'])) {
295
-        add_filter('geodir_before_widget', 'geodir_before_widget_dynamic', 10);
296
-    }
293
+	//widget before filter
294
+	if (!empty($tc['geodir_before_widget_filter'])) {
295
+		add_filter('geodir_before_widget', 'geodir_before_widget_dynamic', 10);
296
+	}
297 297
 
298
-    //widget after filter
299
-    if (!empty($tc['geodir_after_widget_filter'])) {
300
-        add_filter('geodir_after_widget', 'geodir_after_widget_dynamic', 10);
301
-    }
298
+	//widget after filter
299
+	if (!empty($tc['geodir_after_widget_filter'])) {
300
+		add_filter('geodir_after_widget', 'geodir_after_widget_dynamic', 10);
301
+	}
302 302
 
303
-    //widget before title filter
304
-    if (!empty($tc['geodir_before_title_filter'])) {
305
-        add_filter('geodir_before_title', 'geodir_before_title_dynamic', 10);
306
-    }
303
+	//widget before title filter
304
+	if (!empty($tc['geodir_before_title_filter'])) {
305
+		add_filter('geodir_before_title', 'geodir_before_title_dynamic', 10);
306
+	}
307 307
 
308
-    //widget before title filter
309
-    if (!empty($tc['geodir_after_title_filter'])) {
310
-        add_filter('geodir_after_title', 'geodir_after_title_dynamic', 10);
311
-    }
308
+	//widget before title filter
309
+	if (!empty($tc['geodir_after_title_filter'])) {
310
+		add_filter('geodir_after_title', 'geodir_after_title_dynamic', 10);
311
+	}
312 312
 
313
-    //menu li class
314
-    if (!empty($tc['geodir_menu_li_class_filter'])) {
315
-        add_filter('geodir_menu_li_class', 'geodir_menu_li_class_dynamic', 10);
316
-    }
313
+	//menu li class
314
+	if (!empty($tc['geodir_menu_li_class_filter'])) {
315
+		add_filter('geodir_menu_li_class', 'geodir_menu_li_class_dynamic', 10);
316
+	}
317 317
 
318
-    //menu ul class
319
-    if (!empty($tc['geodir_sub_menu_ul_class_filter'])) {
320
-        add_filter('geodir_sub_menu_ul_class', 'geodir_sub_menu_ul_class_dynamic', 10);
321
-    }
318
+	//menu ul class
319
+	if (!empty($tc['geodir_sub_menu_ul_class_filter'])) {
320
+		add_filter('geodir_sub_menu_ul_class', 'geodir_sub_menu_ul_class_dynamic', 10);
321
+	}
322 322
 
323
-    //menu sub li class
324
-    if (!empty($tc['geodir_sub_menu_li_class_filter'])) {
325
-        add_filter('geodir_sub_menu_li_class', 'geodir_sub_menu_li_class_dynamic', 10);
326
-    }
323
+	//menu sub li class
324
+	if (!empty($tc['geodir_sub_menu_li_class_filter'])) {
325
+		add_filter('geodir_sub_menu_li_class', 'geodir_sub_menu_li_class_dynamic', 10);
326
+	}
327 327
 
328
-    //menu a class
329
-    if (!empty($tc['geodir_menu_a_class_filter'])) {
330
-        add_filter('geodir_menu_a_class', 'geodir_menu_a_class_dynamic', 10);
331
-    }
328
+	//menu a class
329
+	if (!empty($tc['geodir_menu_a_class_filter'])) {
330
+		add_filter('geodir_menu_a_class', 'geodir_menu_a_class_dynamic', 10);
331
+	}
332 332
 
333
-    //menu sub a class
334
-    if (!empty($tc['geodir_sub_menu_a_class_filter'])) {
335
-        add_filter('geodir_sub_menu_a_class', 'geodir_sub_menu_a_class_dynamic', 10);
336
-    }
333
+	//menu sub a class
334
+	if (!empty($tc['geodir_sub_menu_a_class_filter'])) {
335
+		add_filter('geodir_sub_menu_a_class', 'geodir_sub_menu_a_class_dynamic', 10);
336
+	}
337 337
 
338
-    //location menu li class
339
-    if (!empty($tc['geodir_location_switcher_menu_li_class_filter'])) {
340
-        add_filter('geodir_location_switcher_menu_li_class', 'geodir_location_switcher_menu_li_class_dynamic', 10);
341
-    }
338
+	//location menu li class
339
+	if (!empty($tc['geodir_location_switcher_menu_li_class_filter'])) {
340
+		add_filter('geodir_location_switcher_menu_li_class', 'geodir_location_switcher_menu_li_class_dynamic', 10);
341
+	}
342 342
 
343
-    //location menu sub ul class
344
-    if (!empty($tc['geodir_location_switcher_menu_sub_ul_class_filter'])) {
345
-        add_filter('geodir_location_switcher_menu_sub_ul_class', 'geodir_location_switcher_menu_sub_ul_class_dynamic', 10);
346
-    }
343
+	//location menu sub ul class
344
+	if (!empty($tc['geodir_location_switcher_menu_sub_ul_class_filter'])) {
345
+		add_filter('geodir_location_switcher_menu_sub_ul_class', 'geodir_location_switcher_menu_sub_ul_class_dynamic', 10);
346
+	}
347 347
 
348
-    //location menu sub li class
349
-    if (!empty($tc['geodir_location_switcher_menu_sub_li_class_filter'])) {
350
-        add_filter('geodir_location_switcher_menu_sub_li_class', 'geodir_location_switcher_menu_sub_li_class_dynamic', 10);
351
-    }
348
+	//location menu sub li class
349
+	if (!empty($tc['geodir_location_switcher_menu_sub_li_class_filter'])) {
350
+		add_filter('geodir_location_switcher_menu_sub_li_class', 'geodir_location_switcher_menu_sub_li_class_dynamic', 10);
351
+	}
352 352
 
353
-    //location menu a class
354
-    if (!empty($tc['geodir_location_switcher_menu_a_class_filter'])) {
355
-        add_filter('geodir_location_switcher_menu_a_class', 'geodir_location_switcher_menu_a_class_dynamic', 10);
356
-    }
353
+	//location menu a class
354
+	if (!empty($tc['geodir_location_switcher_menu_a_class_filter'])) {
355
+		add_filter('geodir_location_switcher_menu_a_class', 'geodir_location_switcher_menu_a_class_dynamic', 10);
356
+	}
357 357
 
358
-    // compat styles
359
-    if (!empty($tc['geodir_theme_compat_css'])) {
360
-        add_action('wp_head', 'gd_compat_styles');
361
-    }
358
+	// compat styles
359
+	if (!empty($tc['geodir_theme_compat_css'])) {
360
+		add_action('wp_head', 'gd_compat_styles');
361
+	}
362 362
 
363
-    // compat js
364
-    if (!empty($tc['geodir_theme_compat_js'])) {
365
-        add_action('wp_footer', 'gd_compat_script');
366
-    }
363
+	// compat js
364
+	if (!empty($tc['geodir_theme_compat_js'])) {
365
+		add_action('wp_footer', 'gd_compat_script');
366
+	}
367 367
 
368 368
 
369
-    // geodir_top_content_add
370
-    if (!empty($tc['geodir_top_content_add'])) {
371
-        add_action('geodir_top_content', 'geodir_top_content_add_dynamic', 10, 1);
372
-    }
369
+	// geodir_top_content_add
370
+	if (!empty($tc['geodir_top_content_add'])) {
371
+		add_action('geodir_top_content', 'geodir_top_content_add_dynamic', 10, 1);
372
+	}
373 373
 
374
-    // geodir_before_main_content_add
375
-    if (!empty($tc['geodir_before_main_content_add'])) {
376
-        add_action('geodir_before_main_content', 'geodir_before_main_content_add_dynamic', 10, 1);
377
-    }
374
+	// geodir_before_main_content_add
375
+	if (!empty($tc['geodir_before_main_content_add'])) {
376
+		add_action('geodir_before_main_content', 'geodir_before_main_content_add_dynamic', 10, 1);
377
+	}
378 378
 
379 379
 
380 380
 }
@@ -397,23 +397,23 @@  discard block
 block discarded – undo
397 397
  */
398 398
 function geodir_action_wrapper_open($type = '', $id = '', $class = '')
399 399
 {
400
-    $tc = get_option('theme_compatibility_setting');
401
-    if (!empty($tc['geodir_wrapper_open_replace'])) {
402
-        $text = $tc['geodir_wrapper_open_replace'];
403
-    } else {
404
-        $text = '<div id="[id]" class="[class]">';
405
-    }
400
+	$tc = get_option('theme_compatibility_setting');
401
+	if (!empty($tc['geodir_wrapper_open_replace'])) {
402
+		$text = $tc['geodir_wrapper_open_replace'];
403
+	} else {
404
+		$text = '<div id="[id]" class="[class]">';
405
+	}
406 406
 
407
-    if (!empty($tc['geodir_wrapper_open_id'])) {
408
-        $id = $tc['geodir_wrapper_open_id'];
409
-    }
410
-    if (!empty($tc['geodir_wrapper_open_class'])) {
411
-        $class = $tc['geodir_wrapper_open_class'];
412
-    }
407
+	if (!empty($tc['geodir_wrapper_open_id'])) {
408
+		$id = $tc['geodir_wrapper_open_id'];
409
+	}
410
+	if (!empty($tc['geodir_wrapper_open_class'])) {
411
+		$class = $tc['geodir_wrapper_open_class'];
412
+	}
413 413
 
414
-    $text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
414
+	$text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
415 415
 
416
-    echo $text;
416
+	echo $text;
417 417
 }
418 418
 
419 419
 // action for adding the wrapperdiv closing tag
@@ -428,14 +428,14 @@  discard block
 block discarded – undo
428 428
  */
429 429
 function geodir_action_wrapper_close($type = '')
430 430
 {
431
-    $tc = get_option('theme_compatibility_setting');
432
-    if (!empty($tc['geodir_wrapper_close_replace'])) {
433
-        $text = $tc['geodir_wrapper_close_replace'];
434
-    } else {
435
-        $text = '</div><!-- wrapper ends here-->';
436
-    }
431
+	$tc = get_option('theme_compatibility_setting');
432
+	if (!empty($tc['geodir_wrapper_close_replace'])) {
433
+		$text = $tc['geodir_wrapper_close_replace'];
434
+	} else {
435
+		$text = '</div><!-- wrapper ends here-->';
436
+	}
437 437
 
438
-    echo $text;
438
+	echo $text;
439 439
 }
440 440
 
441 441
 // action for adding the content div opening tag
@@ -451,35 +451,35 @@  discard block
 block discarded – undo
451 451
  */
452 452
 function geodir_action_wrapper_content_open($type = '', $id = '', $class = '')
453 453
 {
454
-    if ($type == 'home-page' && $width = get_option('geodir_width_home_contant_section')) {
455
-        $width_css = 'style="width:' . $width . '%;"';
456
-    } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_contant_section')) {
457
-        $width_css = 'style="width:' . $width . '%;"';
458
-    } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_contant_section')) {
459
-        $width_css = 'style="width:' . $width . '%;"';
460
-    } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_contant_section')) {
461
-        $width_css = 'style="width:' . $width . '%;"';
462
-    } else {
463
-        $width_css = '';
464
-    }
465
-
466
-    $tc = get_option('theme_compatibility_setting');
467
-    if (!empty($tc['geodir_wrapper_content_open_replace'])) {
468
-        $text = $tc['geodir_wrapper_content_open_replace'];
469
-    } else {
470
-        $text = '<div id="[id]" class="[class]" role="main" [width_css]>';
471
-    }
472
-
473
-    if (!empty($tc['geodir_wrapper_content_open_id'])) {
474
-        $id = $tc['geodir_wrapper_content_open_id'];
475
-    }
476
-    if (!empty($tc['geodir_wrapper_content_open_class'])) {
477
-        $class = $tc['geodir_wrapper_content_open_class'];
478
-    }
479
-
480
-    $text = str_replace(array("[id]", "[class]", "[width_css]"), array($id, $class, $width_css), $text);
481
-
482
-    echo $text;
454
+	if ($type == 'home-page' && $width = get_option('geodir_width_home_contant_section')) {
455
+		$width_css = 'style="width:' . $width . '%;"';
456
+	} elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_contant_section')) {
457
+		$width_css = 'style="width:' . $width . '%;"';
458
+	} elseif ($type == 'search-page' && $width = get_option('geodir_width_search_contant_section')) {
459
+		$width_css = 'style="width:' . $width . '%;"';
460
+	} elseif ($type == 'author-page' && $width = get_option('geodir_width_author_contant_section')) {
461
+		$width_css = 'style="width:' . $width . '%;"';
462
+	} else {
463
+		$width_css = '';
464
+	}
465
+
466
+	$tc = get_option('theme_compatibility_setting');
467
+	if (!empty($tc['geodir_wrapper_content_open_replace'])) {
468
+		$text = $tc['geodir_wrapper_content_open_replace'];
469
+	} else {
470
+		$text = '<div id="[id]" class="[class]" role="main" [width_css]>';
471
+	}
472
+
473
+	if (!empty($tc['geodir_wrapper_content_open_id'])) {
474
+		$id = $tc['geodir_wrapper_content_open_id'];
475
+	}
476
+	if (!empty($tc['geodir_wrapper_content_open_class'])) {
477
+		$class = $tc['geodir_wrapper_content_open_class'];
478
+	}
479
+
480
+	$text = str_replace(array("[id]", "[class]", "[width_css]"), array($id, $class, $width_css), $text);
481
+
482
+	echo $text;
483 483
 }
484 484
 
485 485
 // action for adding the primary div closing tag
@@ -493,13 +493,13 @@  discard block
 block discarded – undo
493 493
  */
494 494
 function geodir_action_wrapper_content_close($type = '')
495 495
 {
496
-    $tc = get_option('theme_compatibility_setting');
497
-    if (!empty($tc['geodir_wrapper_content_close_replace'])) {
498
-        $text = $tc['geodir_wrapper_content_close_replace'];
499
-    } else {
500
-        $text = '</div><!-- content ends here-->';
501
-    }
502
-    echo $text;
496
+	$tc = get_option('theme_compatibility_setting');
497
+	if (!empty($tc['geodir_wrapper_content_close_replace'])) {
498
+		$text = $tc['geodir_wrapper_content_close_replace'];
499
+	} else {
500
+		$text = '</div><!-- content ends here-->';
501
+	}
502
+	echo $text;
503 503
 }
504 504
 
505 505
 // action for adding the <article> opening tag
@@ -517,24 +517,24 @@  discard block
 block discarded – undo
517 517
  */
518 518
 function geodir_action_article_open($type = '', $id = '', $class = '', $itemtype = '')
519 519
 {
520
-    $class = implode(" ", $class);
521
-    $tc = get_option('theme_compatibility_setting');
522
-    if (!empty($tc['geodir_article_open_replace'])) {
523
-        $text = $tc['geodir_article_open_replace'];
524
-    } else {
525
-        $text = '<article  id="[id]" class="[class]" >';
526
-    }
520
+	$class = implode(" ", $class);
521
+	$tc = get_option('theme_compatibility_setting');
522
+	if (!empty($tc['geodir_article_open_replace'])) {
523
+		$text = $tc['geodir_article_open_replace'];
524
+	} else {
525
+		$text = '<article  id="[id]" class="[class]" >';
526
+	}
527 527
 
528
-    if (!empty($tc['geodir_article_open_id'])) {
529
-        $id = $tc['geodir_article_open_id'];
530
-    }
531
-    if (!empty($tc['geodir_article_open_class'])) {
532
-        $class = $tc['geodir_article_open_class'];
533
-    }
528
+	if (!empty($tc['geodir_article_open_id'])) {
529
+		$id = $tc['geodir_article_open_id'];
530
+	}
531
+	if (!empty($tc['geodir_article_open_class'])) {
532
+		$class = $tc['geodir_article_open_class'];
533
+	}
534 534
 
535
-    $text = str_replace(array("[id]", "[class]", "[itemtype]"), array($id, $class, $itemtype), $text);
535
+	$text = str_replace(array("[id]", "[class]", "[itemtype]"), array($id, $class, $itemtype), $text);
536 536
 
537
-    echo $text;
537
+	echo $text;
538 538
 }
539 539
 
540 540
 // action for adding the primary div closing tag
@@ -548,13 +548,13 @@  discard block
 block discarded – undo
548 548
  */
549 549
 function geodir_action_article_close($type = '')
550 550
 {
551
-    $tc = get_option('theme_compatibility_setting');
552
-    if (!empty($tc['geodir_article_close_replace'])) {
553
-        $text = $tc['geodir_article_close_replace'];
554
-    } else {
555
-        $text = '</article><!-- article ends here-->';
556
-    }
557
-    echo $text;
551
+	$tc = get_option('theme_compatibility_setting');
552
+	if (!empty($tc['geodir_article_close_replace'])) {
553
+		$text = $tc['geodir_article_close_replace'];
554
+	} else {
555
+		$text = '</article><!-- article ends here-->';
556
+	}
557
+	echo $text;
558 558
 }
559 559
 
560 560
 // action for adding the sidebar opening tag
@@ -571,35 +571,35 @@  discard block
 block discarded – undo
571 571
  */
572 572
 function geodir_action_sidebar_right_open($type = '', $id = '', $class = '', $itemtype = '')
573 573
 {
574
-    if ($type == 'home-page' && $width = get_option('geodir_width_home_right_section')) {
575
-        $width_css = 'style="width:' . $width . '%;"';
576
-    } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_right_section')) {
577
-        $width_css = 'style="width:' . $width . '%;"';
578
-    } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_right_section')) {
579
-        $width_css = 'style="width:' . $width . '%;"';
580
-    } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_right_section')) {
581
-        $width_css = 'style="width:' . $width . '%;"';
582
-    } else {
583
-        $width_css = '';
584
-    }
585
-
586
-    $tc = get_option('theme_compatibility_setting');
587
-    if (!empty($tc['geodir_sidebar_right_open_replace'])) {
588
-        $text = $tc['geodir_sidebar_right_open_replace'];
589
-    } else {
590
-        $text = '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>';
591
-    }
592
-
593
-    if (!empty($tc['geodir_sidebar_right_open_id'])) {
594
-        $id = $tc['geodir_sidebar_right_open_id'];
595
-    }
596
-    if (!empty($tc['geodir_sidebar_right_open_class'])) {
597
-        $class = $tc['geodir_sidebar_right_open_class'];
598
-    }
599
-
600
-    $text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
601
-
602
-    echo $text;
574
+	if ($type == 'home-page' && $width = get_option('geodir_width_home_right_section')) {
575
+		$width_css = 'style="width:' . $width . '%;"';
576
+	} elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_right_section')) {
577
+		$width_css = 'style="width:' . $width . '%;"';
578
+	} elseif ($type == 'search-page' && $width = get_option('geodir_width_search_right_section')) {
579
+		$width_css = 'style="width:' . $width . '%;"';
580
+	} elseif ($type == 'author-page' && $width = get_option('geodir_width_author_right_section')) {
581
+		$width_css = 'style="width:' . $width . '%;"';
582
+	} else {
583
+		$width_css = '';
584
+	}
585
+
586
+	$tc = get_option('theme_compatibility_setting');
587
+	if (!empty($tc['geodir_sidebar_right_open_replace'])) {
588
+		$text = $tc['geodir_sidebar_right_open_replace'];
589
+	} else {
590
+		$text = '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>';
591
+	}
592
+
593
+	if (!empty($tc['geodir_sidebar_right_open_id'])) {
594
+		$id = $tc['geodir_sidebar_right_open_id'];
595
+	}
596
+	if (!empty($tc['geodir_sidebar_right_open_class'])) {
597
+		$class = $tc['geodir_sidebar_right_open_class'];
598
+	}
599
+
600
+	$text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
601
+
602
+	echo $text;
603 603
 }
604 604
 
605 605
 // action for adding the primary div closing tag
@@ -613,13 +613,13 @@  discard block
 block discarded – undo
613 613
  */
614 614
 function geodir_action_sidebar_right_close($type = '')
615 615
 {
616
-    $tc = get_option('theme_compatibility_setting');
617
-    if (!empty($tc['geodir_sidebar_right_close_replace'])) {
618
-        $text = $tc['geodir_sidebar_right_close_replace'];
619
-    } else {
620
-        $text = '</aside><!-- sidebar ends here-->';
621
-    }
622
-    echo $text;
616
+	$tc = get_option('theme_compatibility_setting');
617
+	if (!empty($tc['geodir_sidebar_right_close_replace'])) {
618
+		$text = $tc['geodir_sidebar_right_close_replace'];
619
+	} else {
620
+		$text = '</aside><!-- sidebar ends here-->';
621
+	}
622
+	echo $text;
623 623
 }
624 624
 
625 625
 
@@ -640,121 +640,121 @@  discard block
 block discarded – undo
640 640
  */
641 641
 function geodir_action_geodir_set_preview_post()
642 642
 {
643
-    global $post, $preview, $gd_session;
644
-    $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
645
-    if (!$preview || $is_backend_preview) {
646
-        return;
647
-    }// bail if not previewing
648
-
649
-    $listing_type = isset($_REQUEST['listing_type']) ? sanitize_text_field($_REQUEST['listing_type']) : '';
650
-
651
-    $fields_info = geodir_get_custom_fields_type($listing_type);
652
-
653
-    foreach ($_REQUEST as $pkey => $pval) {
654
-        if ($pkey == 'geodir_video') {
655
-            $tags = '<iframe>';
656
-        } else if ($pkey == 'post_desc') {
657
-            $tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>';
658
-        } else if (is_array($fields_info) && isset($fields_info[$pkey]) && ($fields_info[$pkey] == 'textarea' || $fields_info[$pkey] == 'html')) {
659
-            $tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>';
660
-        } else if (is_array($_REQUEST[$pkey])) {
661
-            $tags = 'skip_field';
662
-        } else {
663
-            $tags = '';
664
-        }
665
-        /**
666
-         * Allows the filtering of the allowed HTML tags per field when submitting from frontend add listing page.
667
-         *
668
-         * @since 1.0.0
669
-         * @param string $tags The allowed HTML tags for the field. Can be many things, for example the description allows these tags '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>'.
670
-         * @param string|array $pkey The field id/name. If array then value is set as "skip_field".
671
-         */
672
-        $tags = apply_filters('geodir_save_post_key', $tags, $pkey);
673
-
674
-        if ($tags != 'skip_field') {
675
-            $_REQUEST[$pkey] = strip_tags($_REQUEST[$pkey], $tags);
676
-        }
677
-    }
678
-
679
-    $post = (object)$_REQUEST;
680
-
681
-
682
-    if (isset($post->video)) {
683
-        $post->video = stripslashes($post->video);
684
-    }
685
-
686
-    if (isset($post->Video2)) {
687
-        $post->Video2 = stripslashes($post->Video2);
688
-    }
689
-
690
-    $post_type = $post->listing_type;
691
-    $post_type_info = get_post_type_object($post_type);
692
-
693
-    $listing_label = $post_type_info->labels->singular_name;
694
-
695
-    $term_icon = '';
696
-
697
-    if (!empty($post->post_category)) {
698
-        foreach ($post->post_category as $post_taxonomy => $post_term) {
699
-
700
-            if ($post_term != '' && !is_array($post_term)) {
701
-                $post_term = explode(',', trim($post_term, ','));
702
-            }
643
+	global $post, $preview, $gd_session;
644
+	$is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
645
+	if (!$preview || $is_backend_preview) {
646
+		return;
647
+	}// bail if not previewing
648
+
649
+	$listing_type = isset($_REQUEST['listing_type']) ? sanitize_text_field($_REQUEST['listing_type']) : '';
650
+
651
+	$fields_info = geodir_get_custom_fields_type($listing_type);
652
+
653
+	foreach ($_REQUEST as $pkey => $pval) {
654
+		if ($pkey == 'geodir_video') {
655
+			$tags = '<iframe>';
656
+		} else if ($pkey == 'post_desc') {
657
+			$tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>';
658
+		} else if (is_array($fields_info) && isset($fields_info[$pkey]) && ($fields_info[$pkey] == 'textarea' || $fields_info[$pkey] == 'html')) {
659
+			$tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>';
660
+		} else if (is_array($_REQUEST[$pkey])) {
661
+			$tags = 'skip_field';
662
+		} else {
663
+			$tags = '';
664
+		}
665
+		/**
666
+		 * Allows the filtering of the allowed HTML tags per field when submitting from frontend add listing page.
667
+		 *
668
+		 * @since 1.0.0
669
+		 * @param string $tags The allowed HTML tags for the field. Can be many things, for example the description allows these tags '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>'.
670
+		 * @param string|array $pkey The field id/name. If array then value is set as "skip_field".
671
+		 */
672
+		$tags = apply_filters('geodir_save_post_key', $tags, $pkey);
673
+
674
+		if ($tags != 'skip_field') {
675
+			$_REQUEST[$pkey] = strip_tags($_REQUEST[$pkey], $tags);
676
+		}
677
+	}
678
+
679
+	$post = (object)$_REQUEST;
680
+
681
+
682
+	if (isset($post->video)) {
683
+		$post->video = stripslashes($post->video);
684
+	}
685
+
686
+	if (isset($post->Video2)) {
687
+		$post->Video2 = stripslashes($post->Video2);
688
+	}
689
+
690
+	$post_type = $post->listing_type;
691
+	$post_type_info = get_post_type_object($post_type);
692
+
693
+	$listing_label = $post_type_info->labels->singular_name;
694
+
695
+	$term_icon = '';
696
+
697
+	if (!empty($post->post_category)) {
698
+		foreach ($post->post_category as $post_taxonomy => $post_term) {
699
+
700
+			if ($post_term != '' && !is_array($post_term)) {
701
+				$post_term = explode(',', trim($post_term, ','));
702
+			}
703 703
 
704
-            if (is_array($post_term)) {
705
-                $post_term = array_unique($post_term);
706
-            }
704
+			if (is_array($post_term)) {
705
+				$post_term = array_unique($post_term);
706
+			}
707 707
 
708
-            if (!empty($post_term)) {
709
-                foreach ($post_term as $cat_id) {
710
-                    $cat_id = trim($cat_id);
711
-
712
-                    if ($cat_id != '') {
713
-                        $term_icon = get_option('geodir_default_marker_icon');
714
-
715
-                        if (isset($post->post_default_category) && $post->post_default_category == $cat_id) {
716
-                            if ($term_icon_url = get_tax_meta($cat_id, 'ct_cat_icon', false, $post_type)) {
717
-                                if (isset($term_icon_url['src']) && $term_icon_url['src'] != '')
718
-                                    $term_icon = $term_icon_url['src'];
719
-                                break;
720
-                            }
721
-                        }
722
-                    }
723
-                }
724
-            }
725
-        }
726
-    }
708
+			if (!empty($post_term)) {
709
+				foreach ($post_term as $cat_id) {
710
+					$cat_id = trim($cat_id);
711
+
712
+					if ($cat_id != '') {
713
+						$term_icon = get_option('geodir_default_marker_icon');
714
+
715
+						if (isset($post->post_default_category) && $post->post_default_category == $cat_id) {
716
+							if ($term_icon_url = get_tax_meta($cat_id, 'ct_cat_icon', false, $post_type)) {
717
+								if (isset($term_icon_url['src']) && $term_icon_url['src'] != '')
718
+									$term_icon = $term_icon_url['src'];
719
+								break;
720
+							}
721
+						}
722
+					}
723
+				}
724
+			}
725
+		}
726
+	}
727 727
 
728
-    $post_latitude = isset($post->post_latitude) ? $post->post_latitude : '';
729
-    $post_longitude = isset($post->post_longitude) ? $post->post_longitude : '';
728
+	$post_latitude = isset($post->post_latitude) ? $post->post_latitude : '';
729
+	$post_longitude = isset($post->post_longitude) ? $post->post_longitude : '';
730 730
 
731
-    $srcharr = array("'", "/", "-", '"', '\\');
732
-    $replarr = array("&prime;", "&frasl;", "&ndash;", "&ldquo;", '');
731
+	$srcharr = array("'", "/", "-", '"', '\\');
732
+	$replarr = array("&prime;", "&frasl;", "&ndash;", "&ldquo;", '');
733 733
 
734
-    $json_title = str_replace($srcharr, $replarr, $post->post_title);
734
+	$json_title = str_replace($srcharr, $replarr, $post->post_title);
735 735
 
736
-    $json = '{';
737
-    $json .= '"post_preview": "1",';
738
-    $json .= '"t": "' . $json_title . '",';
739
-    $json .= '"lt": "' . $post_latitude . '",';
740
-    $json .= '"ln": "' . $post_longitude . '",';
741
-    $json .= '"i":"' . $term_icon . '"';
742
-    $json .= '}';
736
+	$json = '{';
737
+	$json .= '"post_preview": "1",';
738
+	$json .= '"t": "' . $json_title . '",';
739
+	$json .= '"lt": "' . $post_latitude . '",';
740
+	$json .= '"ln": "' . $post_longitude . '",';
741
+	$json .= '"i":"' . $term_icon . '"';
742
+	$json .= '}';
743 743
 
744
-    $post->marker_json = $json;
744
+	$post->marker_json = $json;
745 745
 
746
-    $gd_session->set('listing', $_REQUEST);
746
+	$gd_session->set('listing', $_REQUEST);
747 747
 
748
-    // we need to define a few things to trick the setup_postdata
749
-    if (!isset($post->ID)) {
750
-        $post->ID = '';
751
-        $post->post_author = '';
752
-        $post->post_date = '';
753
-        $post->post_content = '';
754
-        $post->default_category = '';
755
-        $post->post_type = '';
756
-    }
757
-    setup_postdata($post);
748
+	// we need to define a few things to trick the setup_postdata
749
+	if (!isset($post->ID)) {
750
+		$post->ID = '';
751
+		$post->post_author = '';
752
+		$post->post_date = '';
753
+		$post->post_content = '';
754
+		$post->default_category = '';
755
+		$post->post_type = '';
756
+	}
757
+	setup_postdata($post);
758 758
 }
759 759
 
760 760
 /**
@@ -766,15 +766,15 @@  discard block
 block discarded – undo
766 766
  */
767 767
 function geodir_action_geodir_preview_code()
768 768
 {
769
-    global $preview;
769
+	global $preview;
770 770
 
771
-    $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
771
+	$is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
772 772
 
773
-    if (!$preview || $is_backend_preview) {
774
-        return;
775
-    }// bail if not previewing
773
+	if (!$preview || $is_backend_preview) {
774
+		return;
775
+	}// bail if not previewing
776 776
 
777
-    geodir_get_template_part('preview', 'buttons');
777
+	geodir_get_template_part('preview', 'buttons');
778 778
 }
779 779
 
780 780
 // action for adding the details page top widget area
@@ -790,20 +790,20 @@  discard block
 block discarded – undo
790 790
  */
791 791
 function geodir_action_geodir_sidebar_detail_top($class = '')
792 792
 {
793
-    if (get_option('geodir_show_detail_top_section')) { ?>
793
+	if (get_option('geodir_show_detail_top_section')) { ?>
794 794
         <div
795 795
             class="<?php
796
-            /**
797
-             * Filter the div class for the wrapper of the full width widget areas.
798
-             *
799
-             * Allows you to filter the class of the div for the HTML Container wrapper for the full width widget areas referred to as "Top Section" or "Bottom Section" in the widget areas.
800
-             *
801
-             * @since 1.0.0
802
-             * @param string $class The class of the div.
803
-             * @param string $type The page type the widget area is being used on. Values can be 'geodir_detail_top', 'geodir_detail_bottom', 'geodir_listing_top', 'geodir_listing_bottom', 'Reg/Login Top Section',
804
-             *               'geodir_author_top','geodir_author_bottom', 'geodir_search_top', 'geodir_search_bottom', 'geodir_home_top' or 'geodir_home_bottom'.
805
-             */
806
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_top'); ?> <?php echo $class; ?>">
796
+			/**
797
+			 * Filter the div class for the wrapper of the full width widget areas.
798
+			 *
799
+			 * Allows you to filter the class of the div for the HTML Container wrapper for the full width widget areas referred to as "Top Section" or "Bottom Section" in the widget areas.
800
+			 *
801
+			 * @since 1.0.0
802
+			 * @param string $class The class of the div.
803
+			 * @param string $type The page type the widget area is being used on. Values can be 'geodir_detail_top', 'geodir_detail_bottom', 'geodir_listing_top', 'geodir_listing_bottom', 'Reg/Login Top Section',
804
+			 *               'geodir_author_top','geodir_author_bottom', 'geodir_search_top', 'geodir_search_bottom', 'geodir_home_top' or 'geodir_home_bottom'.
805
+			 */
806
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_top'); ?> <?php echo $class; ?>">
807 807
             <?php dynamic_sidebar('geodir_detail_top'); ?>
808 808
         </div>
809 809
     <?php }
@@ -827,11 +827,11 @@  discard block
 block discarded – undo
827 827
  */
828 828
 function geodir_action_geodir_sidebar_detail_bottom_section($class = '')
829 829
 {
830
-    if (get_option('geodir_show_detail_bottom_section')) { ?>
830
+	if (get_option('geodir_show_detail_bottom_section')) { ?>
831 831
         <div
832 832
             class="<?php
833
-            /** This action is documented in geodirectory_template_actions.php */
834
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_bottom'); ?> <?php echo $class; ?>">
833
+			/** This action is documented in geodirectory_template_actions.php */
834
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_bottom'); ?> <?php echo $class; ?>">
835 835
             <?php dynamic_sidebar('geodir_detail_bottom'); ?>
836 836
         </div><!-- clearfix ends here-->
837 837
     <?php }
@@ -845,7 +845,7 @@  discard block
 block discarded – undo
845 845
  */
846 846
 function geodir_details_sidebar_widget_area()
847 847
 {
848
-    dynamic_sidebar('geodir_detail_sidebar');
848
+	dynamic_sidebar('geodir_detail_sidebar');
849 849
 }
850 850
 
851 851
 /**
@@ -856,12 +856,12 @@  discard block
 block discarded – undo
856 856
  */
857 857
 function geodir_details_sidebar_place_details()
858 858
 {
859
-    /**
860
-     * Used to add items to the details page sidebar.
861
-     *
862
-     * @since 1.0.0
863
-     */
864
-    do_action('geodir_detail_page_sidebar');
859
+	/**
860
+	 * Used to add items to the details page sidebar.
861
+	 *
862
+	 * @since 1.0.0
863
+	 */
864
+	do_action('geodir_detail_page_sidebar');
865 865
 }
866 866
 
867 867
 add_action('geodir_detail_sidebar_inside', 'geodir_details_sidebar_place_details', 10);
@@ -876,68 +876,68 @@  discard block
 block discarded – undo
876 876
  */
877 877
 function geodir_action_details_sidebar()
878 878
 {
879
-    // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
880
-    if (get_option('geodir_detail_sidebar_left_section')) {
881
-        /**
882
-         * Called before the details page left sidebar is opened.
883
-         *
884
-         * This is used to add opening wrapper HTML to the details page left sidebar.
885
-         *
886
-         * @since 1.0.0
887
-         * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
888
-         * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-left'.
889
-         * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-left geodir-details-sidebar-left'.
890
-         * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'.
891
-         */
892
-        do_action('geodir_sidebar_left_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-left geodir-details-sidebar-left', '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;
985
+	global $preview, $post;
986 986
 
987
-    $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // preview from backend
987
+	$is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // preview from backend
988 988
 
989
-    if ($is_backend_preview && !empty($post) && !empty($post->ID) && !isset($post->post_images)) {
990
-        $preview_get_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
989
+	if ($is_backend_preview && !empty($post) && !empty($post->ID) && !isset($post->post_images)) {
990
+		$preview_get_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
991 991
 
992
-        $preview_post_images = array();
993
-        if ($preview_get_images) {
994
-            foreach ($preview_get_images as $row) {
995
-                $preview_post_images[] = $row->src;
996
-            }
997
-        }
998
-        if (!empty($preview_post_images)) {
999
-            $post->post_images = implode(',', $preview_post_images);
1000
-        }
1001
-    }
1002
-
1003
-    if ($preview) {
1004
-        $post_images = array();
1005
-        if (isset($post->post_images) && !empty($post->post_images)) {
1006
-            $post->post_images = trim($post->post_images, ",");
1007
-            $post_images = explode(",", $post->post_images);
1008
-        }
1009
-
1010
-        $main_slides = '';
1011
-        $nav_slides = '';
1012
-        $slides = 0;
1013
-
1014
-        if (!empty($post_images)) {
1015
-            foreach ($post_images as $image) {
1016
-                if (!empty($image)) {
1017
-                    $sizes = getimagesize(trim($image));
1018
-                    $width = !empty($sizes) && isset($sizes[0]) ? $sizes[0] : 0;
1019
-                    $height = !empty($sizes) && isset($sizes[1]) ? $sizes[1] : 0;
1020
-
1021
-                    if ($image && $width && $height) {
1022
-                        $image = (object)array('src' => $image, 'width' => $width, 'height' => $height);
1023
-                    }
1024
-
1025
-                    if (isset($image->src)) {
1026
-                        if ($image->height >= 400) {
1027
-                            $spacer_height = 0;
1028
-                        } else {
1029
-                            $spacer_height = ((400 - $image->height) / 2);
1030
-                        }
1031
-
1032
-                        $image_title = isset($image->title) ? $image->title : '';
1033
-
1034
-                        $main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />';
1035
-                        $main_slides .= '<img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:400px;margin:0 auto;" /></li>';
1036
-                        $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:48px;margin:0 auto;" /></li>';
1037
-                        $slides++;
1038
-                    }
1039
-                }
1040
-            }// endfore
1041
-        } //end if
1042
-    } else {
1043
-        $main_slides = '';
1044
-        $nav_slides = '';
1045
-        $post_images = geodir_get_images($post->ID, 'thumbnail', false); // Hide default image on listing preview/detail page.
1046
-        $slides = 0;
1047
-
1048
-        if (!empty($post_images)) {
1049
-            foreach ($post_images as $image) {
1050
-                if ($image->height >= 400) {
1051
-                    $spacer_height = 0;
1052
-                } else {
1053
-                    $spacer_height = ((400 - $image->height) / 2);
1054
-                }
1055
-                $caption = '';//(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : '';
1056
-                $main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />';
1057
-                $main_slides .= '<img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>';
1058
-                $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:48px;margin:0 auto;" /></li>';
1059
-                $slides++;
1060
-            }
1061
-        }// endfore
1062
-    }
992
+		$preview_post_images = array();
993
+		if ($preview_get_images) {
994
+			foreach ($preview_get_images as $row) {
995
+				$preview_post_images[] = $row->src;
996
+			}
997
+		}
998
+		if (!empty($preview_post_images)) {
999
+			$post->post_images = implode(',', $preview_post_images);
1000
+		}
1001
+	}
1002
+
1003
+	if ($preview) {
1004
+		$post_images = array();
1005
+		if (isset($post->post_images) && !empty($post->post_images)) {
1006
+			$post->post_images = trim($post->post_images, ",");
1007
+			$post_images = explode(",", $post->post_images);
1008
+		}
1009
+
1010
+		$main_slides = '';
1011
+		$nav_slides = '';
1012
+		$slides = 0;
1013
+
1014
+		if (!empty($post_images)) {
1015
+			foreach ($post_images as $image) {
1016
+				if (!empty($image)) {
1017
+					$sizes = getimagesize(trim($image));
1018
+					$width = !empty($sizes) && isset($sizes[0]) ? $sizes[0] : 0;
1019
+					$height = !empty($sizes) && isset($sizes[1]) ? $sizes[1] : 0;
1020
+
1021
+					if ($image && $width && $height) {
1022
+						$image = (object)array('src' => $image, 'width' => $width, 'height' => $height);
1023
+					}
1024
+
1025
+					if (isset($image->src)) {
1026
+						if ($image->height >= 400) {
1027
+							$spacer_height = 0;
1028
+						} else {
1029
+							$spacer_height = ((400 - $image->height) / 2);
1030
+						}
1031
+
1032
+						$image_title = isset($image->title) ? $image->title : '';
1033
+
1034
+						$main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />';
1035
+						$main_slides .= '<img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:400px;margin:0 auto;" /></li>';
1036
+						$nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:48px;margin:0 auto;" /></li>';
1037
+						$slides++;
1038
+					}
1039
+				}
1040
+			}// endfore
1041
+		} //end if
1042
+	} else {
1043
+		$main_slides = '';
1044
+		$nav_slides = '';
1045
+		$post_images = geodir_get_images($post->ID, 'thumbnail', false); // Hide default image on listing preview/detail page.
1046
+		$slides = 0;
1047
+
1048
+		if (!empty($post_images)) {
1049
+			foreach ($post_images as $image) {
1050
+				if ($image->height >= 400) {
1051
+					$spacer_height = 0;
1052
+				} else {
1053
+					$spacer_height = ((400 - $image->height) / 2);
1054
+				}
1055
+				$caption = '';//(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : '';
1056
+				$main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />';
1057
+				$main_slides .= '<img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>';
1058
+				$nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:48px;margin:0 auto;" /></li>';
1059
+				$slides++;
1060
+			}
1061
+		}// endfore
1062
+	}
1063 1063
 
1064
-    if (!empty($post_images)) {
1065
-        ?>
1064
+	if (!empty($post_images)) {
1065
+		?>
1066 1066
         <div class="geodir_flex-container">
1067 1067
             <div class="geodir_flex-loader"><i class="fa fa-refresh fa-spin"></i></div>
1068 1068
             <div id="geodir_slider" class="geodir_flexslider ">
@@ -1075,7 +1075,7 @@  discard block
 block discarded – undo
1075 1075
             <?php } ?>
1076 1076
         </div>
1077 1077
     <?php
1078
-    }
1078
+	}
1079 1079
 }
1080 1080
 
1081 1081
 add_action('geodir_details_taxonomies', 'geodir_action_details_taxonomies', 10);
@@ -1090,166 +1090,166 @@  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;
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: %l', geodir_ucwords($listing_label . ' ' . __('Tags', 'geodirectory')), $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;
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: %l', geodir_ucwords($listing_label . ' ' . __('Tags', 'geodirectory')), $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
-        }
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;
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;
1234 1234
 
1235
-        }
1235
+		}
1236 1236
 
1237
-        if (!isset($listing_label)) {
1238
-            $listing_label = '';
1239
-        }
1240
-        $taxonomies[$post_taxonomy] = wp_sprintf('%s: %l', geodir_ucwords($listing_label . ' ' . __('Category', 'geodirectory')), $links, (object)$terms);
1237
+		if (!isset($listing_label)) {
1238
+			$listing_label = '';
1239
+		}
1240
+		$taxonomies[$post_taxonomy] = wp_sprintf('%s: %l', geodir_ucwords($listing_label . ' ' . __('Category', 'geodirectory')), $links, (object)$terms);
1241 1241
 
1242
-    }
1242
+	}
1243 1243
 
1244 1244
 
1245
-    if (isset($taxonomies[$post_taxonomy])) {
1246
-        echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>';
1247
-    }
1245
+	if (isset($taxonomies[$post_taxonomy])) {
1246
+		echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>';
1247
+	}
1248 1248
 
1249
-    if (isset($taxonomies[$post_type . '_tags']))
1250
-        echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>';
1249
+	if (isset($taxonomies[$post_type . '_tags']))
1250
+		echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>';
1251 1251
 
1252
-    ?>
1252
+	?>
1253 1253
     </p><?php
1254 1254
 }
1255 1255
 
@@ -1271,126 +1271,126 @@  discard block
 block discarded – undo
1271 1271
 function geodir_action_details_micordata($post='')
1272 1272
 {
1273 1273
 
1274
-    global $preview;
1275
-    if(empty($post)){global $post;}
1276
-    if ($preview || !geodir_is_page('detail')) {
1277
-        return;
1278
-    }
1279
-
1280
-    // url
1281
-    $c_url = geodir_curPageURL();
1282
-
1283
-    // post reviews
1284
-    $post_reviews = get_comments(array('post_id' => $post->ID, 'status' => 'approve'));
1285
-    if (empty($post_reviews)) {
1286
-        $reviews = '';
1287
-    } else {
1288
-        foreach ($post_reviews as $review) {
1289
-            $reviews[] = array(
1290
-                "@type" => "Review",
1291
-                "author" => $review->comment_author,
1292
-                "datePublished" => $review->comment_date,
1293
-                "description" => $review->comment_content,
1294
-                "reviewRating" => array(
1295
-                    "@type" => "Rating",
1296
-                    "bestRating" => "5",// @todo this will need to be filtered for review manager if user changes the score.
1297
-                    "ratingValue" => geodir_get_commentoverall($review->comment_ID),
1298
-                    "worstRating" => "1"
1299
-                )
1300
-            );
1301
-        }
1302
-
1303
-    }
1304
-
1305
-    // post images
1306
-    $post_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
1307
-    if (empty($post_images)) {
1308
-        $images = '';
1309
-    } else {
1310
-        $i_arr = array();
1311
-        foreach ($post_images as $img) {
1312
-            $i_arr[] = $img->src;
1313
-        }
1314
-
1315
-        if (count($i_arr) == 1) {
1316
-            $images = $i_arr[0];
1317
-        } else {
1318
-            $images = $i_arr;
1319
-        }
1320
-
1321
-    }
1322
-    //print_r($post);
1323
-    // external links
1324
-    $external_links =  array();
1325
-    $external_links[] = $post->geodir_website;
1326
-    $external_links[] = $post->geodir_twitter;
1327
-    $external_links[] = $post->geodir_facebook;
1328
-    $external_links = array_filter($external_links);
1329
-
1330
-    if(!empty($external_links)){
1331
-        $external_links = array_values($external_links);
1332
-    }
1333
-
1334
-    // reviews
1335
-    $comment_count = geodir_get_review_count_total($post->ID);
1336
-    $post_avgratings = geodir_get_post_rating($post->ID);
1337
-
1338
-    // schema type
1339
-    $schema_type = 'LocalBusiness';
1340
-    if(isset($post->default_category) && $post->default_category){
1341
-        $schema_type = get_tax_meta($post->default_category, 'ct_cat_schema', false, $post->post_type);
1342
-        if(!$schema_type && $post->post_type=='gd_event'){$schema_type = 'Event';}
1343
-    }
1344
-
1345
-    $schema = array();
1346
-    $schema['@context'] = "http://schema.org";
1347
-    $schema['@type'] = $schema_type;
1348
-    $schema['name'] = $post->post_name;
1349
-    $schema['description'] = wp_strip_all_tags( $post->post_content, true );
1350
-    $schema['telephone'] = $post->geodir_contact;
1351
-    $schema['url'] = $c_url;
1352
-    $schema['sameAs'] = $external_links;
1353
-    $schema['image'] = $images;
1354
-    $schema['address'] = array(
1355
-        "@type" => "PostalAddress",
1356
-        "streetAddress" => $post->post_address,
1357
-        "addressLocality" => $post->post_city,
1358
-        "addressRegion" => $post->post_region,
1359
-        "addressCountry" => $post->post_country,
1360
-        "postalCode" => $post->post_zip
1361
-    );
1362
-
1363
-    if($post->post_latitude && $post->post_longitude) {
1364
-        $schema['geo'] = array(
1365
-            "@type" => "GeoCoordinates",
1366
-            "latitude" => $post->post_latitude,
1367
-            "longitude" => $post->post_longitude
1368
-        );
1369
-    }
1370
-
1371
-    if($post_avgratings) {
1372
-        $schema['aggregateRating'] = array(
1373
-            "@type" => "AggregateRating",
1374
-            "ratingValue" => $post_avgratings,
1375
-            "bestRating" => "5", // @todo this will need to be filtered for review manager if user changes the score.
1376
-            "worstRating" => "1",
1377
-            "ratingCount" => $comment_count
1378
-        );
1379
-    }
1380
-    $schema['review'] = $reviews;
1381
-
1382
-    /**
1383
-     * Allow the schema JSON-LD info to be filtered.
1384
-     *
1385
-     * @since 1.5.4
1386
-     * @since 1.5.7 Added $post variable.
1387
-     * @param array $schema The array of schema data to be filtered.
1388
-     * @param object $post The post object.
1389
-     */
1390
-    $schema = apply_filters('geodir_details_schema', $schema,$post);
1391
-
1392
-
1393
-    echo '<script type="application/ld+json">' . json_encode($schema) . '</script>';
1274
+	global $preview;
1275
+	if(empty($post)){global $post;}
1276
+	if ($preview || !geodir_is_page('detail')) {
1277
+		return;
1278
+	}
1279
+
1280
+	// url
1281
+	$c_url = geodir_curPageURL();
1282
+
1283
+	// post reviews
1284
+	$post_reviews = get_comments(array('post_id' => $post->ID, 'status' => 'approve'));
1285
+	if (empty($post_reviews)) {
1286
+		$reviews = '';
1287
+	} else {
1288
+		foreach ($post_reviews as $review) {
1289
+			$reviews[] = array(
1290
+				"@type" => "Review",
1291
+				"author" => $review->comment_author,
1292
+				"datePublished" => $review->comment_date,
1293
+				"description" => $review->comment_content,
1294
+				"reviewRating" => array(
1295
+					"@type" => "Rating",
1296
+					"bestRating" => "5",// @todo this will need to be filtered for review manager if user changes the score.
1297
+					"ratingValue" => geodir_get_commentoverall($review->comment_ID),
1298
+					"worstRating" => "1"
1299
+				)
1300
+			);
1301
+		}
1302
+
1303
+	}
1304
+
1305
+	// post images
1306
+	$post_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
1307
+	if (empty($post_images)) {
1308
+		$images = '';
1309
+	} else {
1310
+		$i_arr = array();
1311
+		foreach ($post_images as $img) {
1312
+			$i_arr[] = $img->src;
1313
+		}
1314
+
1315
+		if (count($i_arr) == 1) {
1316
+			$images = $i_arr[0];
1317
+		} else {
1318
+			$images = $i_arr;
1319
+		}
1320
+
1321
+	}
1322
+	//print_r($post);
1323
+	// external links
1324
+	$external_links =  array();
1325
+	$external_links[] = $post->geodir_website;
1326
+	$external_links[] = $post->geodir_twitter;
1327
+	$external_links[] = $post->geodir_facebook;
1328
+	$external_links = array_filter($external_links);
1329
+
1330
+	if(!empty($external_links)){
1331
+		$external_links = array_values($external_links);
1332
+	}
1333
+
1334
+	// reviews
1335
+	$comment_count = geodir_get_review_count_total($post->ID);
1336
+	$post_avgratings = geodir_get_post_rating($post->ID);
1337
+
1338
+	// schema type
1339
+	$schema_type = 'LocalBusiness';
1340
+	if(isset($post->default_category) && $post->default_category){
1341
+		$schema_type = get_tax_meta($post->default_category, 'ct_cat_schema', false, $post->post_type);
1342
+		if(!$schema_type && $post->post_type=='gd_event'){$schema_type = 'Event';}
1343
+	}
1344
+
1345
+	$schema = array();
1346
+	$schema['@context'] = "http://schema.org";
1347
+	$schema['@type'] = $schema_type;
1348
+	$schema['name'] = $post->post_name;
1349
+	$schema['description'] = wp_strip_all_tags( $post->post_content, true );
1350
+	$schema['telephone'] = $post->geodir_contact;
1351
+	$schema['url'] = $c_url;
1352
+	$schema['sameAs'] = $external_links;
1353
+	$schema['image'] = $images;
1354
+	$schema['address'] = array(
1355
+		"@type" => "PostalAddress",
1356
+		"streetAddress" => $post->post_address,
1357
+		"addressLocality" => $post->post_city,
1358
+		"addressRegion" => $post->post_region,
1359
+		"addressCountry" => $post->post_country,
1360
+		"postalCode" => $post->post_zip
1361
+	);
1362
+
1363
+	if($post->post_latitude && $post->post_longitude) {
1364
+		$schema['geo'] = array(
1365
+			"@type" => "GeoCoordinates",
1366
+			"latitude" => $post->post_latitude,
1367
+			"longitude" => $post->post_longitude
1368
+		);
1369
+	}
1370
+
1371
+	if($post_avgratings) {
1372
+		$schema['aggregateRating'] = array(
1373
+			"@type" => "AggregateRating",
1374
+			"ratingValue" => $post_avgratings,
1375
+			"bestRating" => "5", // @todo this will need to be filtered for review manager if user changes the score.
1376
+			"worstRating" => "1",
1377
+			"ratingCount" => $comment_count
1378
+		);
1379
+	}
1380
+	$schema['review'] = $reviews;
1381
+
1382
+	/**
1383
+	 * Allow the schema JSON-LD info to be filtered.
1384
+	 *
1385
+	 * @since 1.5.4
1386
+	 * @since 1.5.7 Added $post variable.
1387
+	 * @param array $schema The array of schema data to be filtered.
1388
+	 * @param object $post The post object.
1389
+	 */
1390
+	$schema = apply_filters('geodir_details_schema', $schema,$post);
1391
+
1392
+
1393
+	echo '<script type="application/ld+json">' . json_encode($schema) . '</script>';
1394 1394
 
1395 1395
 }
1396 1396
 
@@ -1408,7 +1408,7 @@  discard block
 block discarded – undo
1408 1408
  */
1409 1409
 function geodir_action_details_next_prev()
1410 1410
 {
1411
-    ?>
1411
+	?>
1412 1412
     <div class="geodir-pos_navigation clearfix">
1413 1413
     <div
1414 1414
         class="geodir-post_left"><?php previous_post_link('%link', '' . __('Previous', 'geodirectory'), false) ?></div>
@@ -1426,15 +1426,15 @@  discard block
 block discarded – undo
1426 1426
  */
1427 1427
 function geodir_action_before_single_post()
1428 1428
 {
1429
-    global $post;
1430
-    /**
1431
-     * Called at the very start fo the details page output, before the title section.
1432
-     *
1433
-     * @since 1.0.0
1434
-     * @param object $post The current post object.
1435
-     * @global WP_Post|null $post The current post, if available.
1436
-     */
1437
-    do_action('geodir_before_single_post', $post); // extra action	
1429
+	global $post;
1430
+	/**
1431
+	 * Called at the very start fo the details page output, before the title section.
1432
+	 *
1433
+	 * @since 1.0.0
1434
+	 * @param object $post The current post object.
1435
+	 * @global WP_Post|null $post The current post, if available.
1436
+	 */
1437
+	do_action('geodir_before_single_post', $post); // extra action	
1438 1438
 }
1439 1439
 
1440 1440
 /**
@@ -1445,13 +1445,13 @@  discard block
 block discarded – undo
1445 1445
  */
1446 1446
 function geodir_action_after_single_post($post)
1447 1447
 {
1448
-    /**
1449
-     * Called on the details page after the details page tabs section and before the next/prev buttons.
1450
-     *
1451
-     * @since 1.0.0
1452
-     * @param object $post The current post object.
1453
-     */
1454
-    do_action('geodir_after_single_post', $post); // extra action	
1448
+	/**
1449
+	 * Called on the details page after the details page tabs section and before the next/prev buttons.
1450
+	 *
1451
+	 * @since 1.0.0
1452
+	 * @param object $post The current post object.
1453
+	 */
1454
+	do_action('geodir_after_single_post', $post); // extra action	
1455 1455
 }
1456 1456
 
1457 1457
 add_action('geodir_details_main_content', 'geodir_action_before_single_post', 10);
@@ -1477,167 +1477,167 @@  discard block
 block discarded – undo
1477 1477
  */
1478 1478
 function geodir_action_listings_title()
1479 1479
 {
1480
-    global $wp, $term;
1481
-
1482
-    $gd_post_type = geodir_get_current_posttype();
1483
-    $post_type_info = get_post_type_object($gd_post_type);
1484
-
1485
-    $add_string_in_title = __('All', 'geodirectory') . ' ';
1486
-    if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
1487
-        $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
1488
-    }
1489
-
1490
-    $list_title = $add_string_in_title . __(ucfirst($post_type_info->labels->name), 'geodirectory');
1491
-    $single_name = $post_type_info->labels->singular_name;
1492
-
1493
-    $taxonomy = geodir_get_taxonomies($gd_post_type, true);
1494
-
1495
-    $gd_country = get_query_var('gd_country');
1496
-    $gd_region = get_query_var('gd_region');
1497
-    $gd_city = get_query_var('gd_city');
1498
-
1499
-    if (!empty($term)) {
1500
-        $location_name = '';
1501
-        if ($gd_country != '' || $gd_region != '' || $gd_city != '') {
1502
-            if ($gd_country != '') {
1503
-                $location_name = geodir_sanitize_location_name('gd_country', $gd_country);
1504
-            }
1480
+	global $wp, $term;
1505 1481
 
1506
-            if ($gd_region != '') {
1507
-                $location_name = geodir_sanitize_location_name('gd_region', $gd_region);
1508
-            }
1482
+	$gd_post_type = geodir_get_current_posttype();
1483
+	$post_type_info = get_post_type_object($gd_post_type);
1509 1484
 
1510
-            if ($gd_city != '') {
1511
-                $location_name = geodir_sanitize_location_name('gd_city', $gd_city);
1512
-            }
1513
-        }
1485
+	$add_string_in_title = __('All', 'geodirectory') . ' ';
1486
+	if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
1487
+		$add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
1488
+	}
1514 1489
 
1515
-        $current_term = get_term_by('slug', $term, $taxonomy[0]);
1516
-        if (!empty($current_term)) {
1517
-            $current_term_name = __(ucfirst($current_term->name), 'geodirectory');
1518
-            if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1519
-                $location_last_char = substr($location_name, -1);
1520
-                $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1521
-                $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1522
-            } else {
1523
-                $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1524
-            }
1525
-        } else {
1526
-            if (count($taxonomy) > 1) {
1527
-                $current_term = get_term_by('slug', $term, $taxonomy[1]);
1528
-
1529
-                if (!empty($current_term)) {
1530
-                    $current_term_name = __(ucfirst($current_term->name), 'geodirectory');
1531
-                    if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1532
-                        $location_last_char = substr($location_name, -1);
1533
-                        $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1534
-                        $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1535
-                    } else {
1536
-                        $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1537
-                    }
1538
-                }
1539
-            }
1540
-        }
1541
-
1542
-    } else {
1543
-        $gd_country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : '';
1544
-        $gd_region = (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') ? $wp->query_vars['gd_region'] : '';
1545
-        $gd_city = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : '';
1546
-
1547
-        $gd_country_actual = $gd_region_actual = $gd_city_actual = '';
1548
-
1549
-        if (function_exists('get_actual_location_name')) {
1550
-            $gd_country_actual = $gd_country != '' ? get_actual_location_name('country', $gd_country, true) : $gd_country;
1551
-            $gd_region_actual = $gd_region != '' ? get_actual_location_name('region', $gd_region) : $gd_region;
1552
-            $gd_city_actual = $gd_city != '' ? get_actual_location_name('city', $gd_city) : $gd_city;
1553
-        }
1554
-
1555
-        if ($gd_city != '') {
1556
-            if ($gd_city_actual != '') {
1557
-                $gd_city = $gd_city_actual;
1558
-            } else {
1559
-                $gd_city = preg_replace('/-(\d+)$/', '', $gd_city);
1560
-                $gd_city = preg_replace('/[_-]/', ' ', $gd_city);
1561
-                $gd_city = __(geodir_ucwords($gd_city), 'geodirectory');
1562
-            }
1490
+	$list_title = $add_string_in_title . __(ucfirst($post_type_info->labels->name), 'geodirectory');
1491
+	$single_name = $post_type_info->labels->singular_name;
1563 1492
 
1564
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_city . "'";
1565
-        } else if ($gd_region != '') {
1566
-            if ($gd_region_actual != '') {
1567
-                $gd_region = $gd_region_actual;
1568
-            } else {
1569
-                $gd_region = preg_replace('/-(\d+)$/', '', $gd_region);
1570
-                $gd_region = preg_replace('/[_-]/', ' ', $gd_region);
1571
-                $gd_region = __(geodir_ucwords($gd_region), 'geodirectory');
1572
-            }
1493
+	$taxonomy = geodir_get_taxonomies($gd_post_type, true);
1573 1494
 
1574
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_region . "'";
1575
-        } else if ($gd_country != '') {
1576
-            if ($gd_country_actual != '') {
1577
-                $gd_country = $gd_country_actual;
1578
-            } else {
1579
-                $gd_country = preg_replace('/-(\d+)$/', '', $gd_country);
1580
-                $gd_country = preg_replace('/[_-]/', ' ', $gd_country);
1581
-                $gd_country = __(geodir_ucwords($gd_country), 'geodirectory');
1582
-            }
1495
+	$gd_country = get_query_var('gd_country');
1496
+	$gd_region = get_query_var('gd_region');
1497
+	$gd_city = get_query_var('gd_city');
1583 1498
 
1584
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_country . "'";
1585
-        }
1586
-    }
1587
-
1588
-    if (is_search()) {
1589
-        $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
1590
-    }
1591
-    /** This action is documented in geodirectory_template_actions.php */
1592
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
1593
-    /** This action is documented in geodirectory_template_actions.php */
1594
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
1595
-
1596
-
1597
-    $title = $list_title;
1598
-    if(geodir_is_page('pt')){
1599
-        $gd_page = 'pt';
1600
-        $title  = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
1601
-    }
1602
-    elseif(geodir_is_page('listing')){
1603
-        $gd_page = 'listing';
1604
-        global $wp_query;
1605
-        $current_term = $wp_query->get_queried_object();
1606
-        if (strpos($current_term->taxonomy,'_tags') !== false) {
1607
-            $title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
1608
-        }else{
1609
-            $title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
1610
-        }
1499
+	if (!empty($term)) {
1500
+		$location_name = '';
1501
+		if ($gd_country != '' || $gd_region != '' || $gd_city != '') {
1502
+			if ($gd_country != '') {
1503
+				$location_name = geodir_sanitize_location_name('gd_country', $gd_country);
1504
+			}
1611 1505
 
1612
-    }
1613
-    elseif(geodir_is_page('author')){
1614
-        $gd_page = 'author';
1615
-        if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
1616
-            $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
1617
-        }else{
1618
-            $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
1619
-        }
1506
+			if ($gd_region != '') {
1507
+				$location_name = geodir_sanitize_location_name('gd_region', $gd_region);
1508
+			}
1620 1509
 
1621
-    }
1510
+			if ($gd_city != '') {
1511
+				$location_name = geodir_sanitize_location_name('gd_city', $gd_city);
1512
+			}
1513
+		}
1514
+
1515
+		$current_term = get_term_by('slug', $term, $taxonomy[0]);
1516
+		if (!empty($current_term)) {
1517
+			$current_term_name = __(ucfirst($current_term->name), 'geodirectory');
1518
+			if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1519
+				$location_last_char = substr($location_name, -1);
1520
+				$location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1521
+				$list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1522
+			} else {
1523
+				$list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1524
+			}
1525
+		} else {
1526
+			if (count($taxonomy) > 1) {
1527
+				$current_term = get_term_by('slug', $term, $taxonomy[1]);
1528
+
1529
+				if (!empty($current_term)) {
1530
+					$current_term_name = __(ucfirst($current_term->name), 'geodirectory');
1531
+					if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1532
+						$location_last_char = substr($location_name, -1);
1533
+						$location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1534
+						$list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1535
+					} else {
1536
+						$list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1537
+					}
1538
+				}
1539
+			}
1540
+		}
1541
+
1542
+	} else {
1543
+		$gd_country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : '';
1544
+		$gd_region = (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') ? $wp->query_vars['gd_region'] : '';
1545
+		$gd_city = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : '';
1546
+
1547
+		$gd_country_actual = $gd_region_actual = $gd_city_actual = '';
1548
+
1549
+		if (function_exists('get_actual_location_name')) {
1550
+			$gd_country_actual = $gd_country != '' ? get_actual_location_name('country', $gd_country, true) : $gd_country;
1551
+			$gd_region_actual = $gd_region != '' ? get_actual_location_name('region', $gd_region) : $gd_region;
1552
+			$gd_city_actual = $gd_city != '' ? get_actual_location_name('city', $gd_city) : $gd_city;
1553
+		}
1554
+
1555
+		if ($gd_city != '') {
1556
+			if ($gd_city_actual != '') {
1557
+				$gd_city = $gd_city_actual;
1558
+			} else {
1559
+				$gd_city = preg_replace('/-(\d+)$/', '', $gd_city);
1560
+				$gd_city = preg_replace('/[_-]/', ' ', $gd_city);
1561
+				$gd_city = __(geodir_ucwords($gd_city), 'geodirectory');
1562
+			}
1622 1563
 
1564
+			$list_title .= __(' in', 'geodirectory') . " '" . $gd_city . "'";
1565
+		} else if ($gd_region != '') {
1566
+			if ($gd_region_actual != '') {
1567
+				$gd_region = $gd_region_actual;
1568
+			} else {
1569
+				$gd_region = preg_replace('/-(\d+)$/', '', $gd_region);
1570
+				$gd_region = preg_replace('/[_-]/', ' ', $gd_region);
1571
+				$gd_region = __(geodir_ucwords($gd_region), 'geodirectory');
1572
+			}
1623 1573
 
1624
-    /**
1625
-     * Filter page title to replace variables.
1626
-     *
1627
-     * @since 1.5.4
1628
-     * @param string $title The page title including variables.
1629
-     * @param string $gd_page The GeoDirectory page type if any.
1630
-     */
1631
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
1574
+			$list_title .= __(' in', 'geodirectory') . " '" . $gd_region . "'";
1575
+		} else if ($gd_country != '') {
1576
+			if ($gd_country_actual != '') {
1577
+				$gd_country = $gd_country_actual;
1578
+			} else {
1579
+				$gd_country = preg_replace('/-(\d+)$/', '', $gd_country);
1580
+				$gd_country = preg_replace('/[_-]/', ' ', $gd_country);
1581
+				$gd_country = __(geodir_ucwords($gd_country), 'geodirectory');
1582
+			}
1632 1583
 
1633
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
1634
-        /**
1635
-         * Filter the listing page title.
1636
-         *
1637
-         * @since 1.0.0
1638
-         * @param string $list_title The title for the category page.
1639
-         */
1640
-        apply_filters('geodir_listing_page_title', $title) . '</h1></header>';
1584
+			$list_title .= __(' in', 'geodirectory') . " '" . $gd_country . "'";
1585
+		}
1586
+	}
1587
+
1588
+	if (is_search()) {
1589
+		$list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
1590
+	}
1591
+	/** This action is documented in geodirectory_template_actions.php */
1592
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
1593
+	/** This action is documented in geodirectory_template_actions.php */
1594
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
1595
+
1596
+
1597
+	$title = $list_title;
1598
+	if(geodir_is_page('pt')){
1599
+		$gd_page = 'pt';
1600
+		$title  = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
1601
+	}
1602
+	elseif(geodir_is_page('listing')){
1603
+		$gd_page = 'listing';
1604
+		global $wp_query;
1605
+		$current_term = $wp_query->get_queried_object();
1606
+		if (strpos($current_term->taxonomy,'_tags') !== false) {
1607
+			$title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
1608
+		}else{
1609
+			$title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
1610
+		}
1611
+
1612
+	}
1613
+	elseif(geodir_is_page('author')){
1614
+		$gd_page = 'author';
1615
+		if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
1616
+			$title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
1617
+		}else{
1618
+			$title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
1619
+		}
1620
+
1621
+	}
1622
+
1623
+
1624
+	/**
1625
+	 * Filter page title to replace variables.
1626
+	 *
1627
+	 * @since 1.5.4
1628
+	 * @param string $title The page title including variables.
1629
+	 * @param string $gd_page The GeoDirectory page type if any.
1630
+	 */
1631
+	$title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
1632
+
1633
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
1634
+		/**
1635
+		 * Filter the listing page title.
1636
+		 *
1637
+		 * @since 1.0.0
1638
+		 * @param string $list_title The title for the category page.
1639
+		 */
1640
+		apply_filters('geodir_listing_page_title', $title) . '</h1></header>';
1641 1641
 }
1642 1642
 
1643 1643
 add_action('geodir_listings_page_description', 'geodir_action_listings_description', 10);
@@ -1650,33 +1650,33 @@  discard block
 block discarded – undo
1650 1650
  */
1651 1651
 function geodir_action_listings_description()
1652 1652
 {
1653
-    global $wp_query;
1654
-    $current_term = $wp_query->get_queried_object();
1655
-
1656
-    $gd_post_type = geodir_get_current_posttype();
1657
-    if (isset($current_term->term_id) && $current_term->term_id != '') {
1658
-
1659
-        $term_desc = term_description($current_term->term_id, $gd_post_type . '_tags');
1660
-        $saved_data = stripslashes(get_tax_meta($current_term->term_id, 'ct_cat_top_desc', false, $gd_post_type));
1661
-        if ($term_desc && !$saved_data) {
1662
-            $saved_data = $term_desc;
1663
-        }
1664
-        /**
1665
-         * Apply the core filter `the_content` filter to the variable string.
1666
-         *
1667
-         * This is a WordPress core filter that does many things.
1668
-         *
1669
-         * @since 1.0.0
1670
-         * @param string $var The string to apply the filter to.
1671
-         */
1672
-        $cat_description = apply_filters('the_content', $saved_data);
1673
-        if ($cat_description) {
1674
-            ?>
1653
+	global $wp_query;
1654
+	$current_term = $wp_query->get_queried_object();
1655
+
1656
+	$gd_post_type = geodir_get_current_posttype();
1657
+	if (isset($current_term->term_id) && $current_term->term_id != '') {
1658
+
1659
+		$term_desc = term_description($current_term->term_id, $gd_post_type . '_tags');
1660
+		$saved_data = stripslashes(get_tax_meta($current_term->term_id, 'ct_cat_top_desc', false, $gd_post_type));
1661
+		if ($term_desc && !$saved_data) {
1662
+			$saved_data = $term_desc;
1663
+		}
1664
+		/**
1665
+		 * Apply the core filter `the_content` filter to the variable string.
1666
+		 *
1667
+		 * This is a WordPress core filter that does many things.
1668
+		 *
1669
+		 * @since 1.0.0
1670
+		 * @param string $var The string to apply the filter to.
1671
+		 */
1672
+		$cat_description = apply_filters('the_content', $saved_data);
1673
+		if ($cat_description) {
1674
+			?>
1675 1675
 
1676 1676
             <div class="term_description"><?php echo $cat_description;?></div> <?php
1677
-        }
1677
+		}
1678 1678
 
1679
-    }
1679
+	}
1680 1680
 }
1681 1681
 
1682 1682
 // action for adding the listings page top widget area
@@ -1695,11 +1695,11 @@  discard block
 block discarded – undo
1695 1695
  */
1696 1696
 function geodir_action_geodir_sidebar_listings_top()
1697 1697
 {
1698
-    if (get_option('geodir_show_listing_top_section')) { ?>
1698
+	if (get_option('geodir_show_listing_top_section')) { ?>
1699 1699
         <div
1700 1700
             class="<?php
1701
-            /** This action is documented in geodirectory_template_actions.php */
1702
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_top'); ?>">
1701
+			/** This action is documented in geodirectory_template_actions.php */
1702
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_top'); ?>">
1703 1703
             <?php dynamic_sidebar('geodir_listing_top'); ?>
1704 1704
         </div><!-- clearfix ends here-->
1705 1705
     <?php }
@@ -1722,35 +1722,35 @@  discard block
 block discarded – undo
1722 1722
  */
1723 1723
 function geodir_action_sidebar_left_open($type = '', $id = '', $class = '', $itemtype = '')
1724 1724
 {
1725
-    if ($type == 'home-page' && $width = get_option('geodir_width_home_left_section')) {
1726
-        $width_css = 'style="width:' . $width . '%;"';
1727
-    } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_left_section')) {
1728
-        $width_css = 'style="width:' . $width . '%;"';
1729
-    } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_left_section')) {
1730
-        $width_css = 'style="width:' . $width . '%;"';
1731
-    } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_left_section')) {
1732
-        $width_css = 'style="width:' . $width . '%;"';
1733
-    } else {
1734
-        $width_css = '';
1735
-    }
1736
-
1737
-    $tc = get_option('theme_compatibility_setting');
1738
-    if (!empty($tc['geodir_sidebar_left_open_replace'])) {
1739
-        $text = $tc['geodir_sidebar_left_open_replace'];
1740
-    } else {
1741
-        $text = '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>';
1742
-    }
1743
-
1744
-    if (!empty($tc['geodir_sidebar_left_open_id'])) {
1745
-        $id = $tc['geodir_sidebar_left_open_id'];
1746
-    }
1747
-    if (!empty($tc['geodir_sidebar_left_open_class'])) {
1748
-        $class = $tc['geodir_sidebar_left_open_class'];
1749
-    }
1750
-
1751
-    $text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
1752
-
1753
-    echo $text;
1725
+	if ($type == 'home-page' && $width = get_option('geodir_width_home_left_section')) {
1726
+		$width_css = 'style="width:' . $width . '%;"';
1727
+	} elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_left_section')) {
1728
+		$width_css = 'style="width:' . $width . '%;"';
1729
+	} elseif ($type == 'search-page' && $width = get_option('geodir_width_search_left_section')) {
1730
+		$width_css = 'style="width:' . $width . '%;"';
1731
+	} elseif ($type == 'author-page' && $width = get_option('geodir_width_author_left_section')) {
1732
+		$width_css = 'style="width:' . $width . '%;"';
1733
+	} else {
1734
+		$width_css = '';
1735
+	}
1736
+
1737
+	$tc = get_option('theme_compatibility_setting');
1738
+	if (!empty($tc['geodir_sidebar_left_open_replace'])) {
1739
+		$text = $tc['geodir_sidebar_left_open_replace'];
1740
+	} else {
1741
+		$text = '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>';
1742
+	}
1743
+
1744
+	if (!empty($tc['geodir_sidebar_left_open_id'])) {
1745
+		$id = $tc['geodir_sidebar_left_open_id'];
1746
+	}
1747
+	if (!empty($tc['geodir_sidebar_left_open_class'])) {
1748
+		$class = $tc['geodir_sidebar_left_open_class'];
1749
+	}
1750
+
1751
+	$text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
1752
+
1753
+	echo $text;
1754 1754
 }
1755 1755
 
1756 1756
 // action for adding the primary div closing tag
@@ -1766,13 +1766,13 @@  discard block
 block discarded – undo
1766 1766
  */
1767 1767
 function geodir_action_sidebar_left_close($type = '')
1768 1768
 {
1769
-    $tc = get_option('theme_compatibility_setting');
1770
-    if (!empty($tc['geodir_sidebar_left_close_replace'])) {
1771
-        $text = $tc['geodir_sidebar_left_close_replace'];
1772
-    } else {
1773
-        $text = '</aside><!-- sidebar ends here-->';
1774
-    }
1775
-    echo $text;
1769
+	$tc = get_option('theme_compatibility_setting');
1770
+	if (!empty($tc['geodir_sidebar_left_close_replace'])) {
1771
+		$text = $tc['geodir_sidebar_left_close_replace'];
1772
+	} else {
1773
+		$text = '</aside><!-- sidebar ends here-->';
1774
+	}
1775
+	echo $text;
1776 1776
 }
1777 1777
 
1778 1778
 /**
@@ -1785,7 +1785,7 @@  discard block
 block discarded – undo
1785 1785
  */
1786 1786
 function geodir_listing_left_section()
1787 1787
 {
1788
-    if (get_option('geodir_show_listing_left_section')) { ?>
1788
+	if (get_option('geodir_show_listing_left_section')) { ?>
1789 1789
         <div class="geodir-content-left geodir-sidebar-wrap">
1790 1790
             <?php dynamic_sidebar('geodir_listing_left_sidebar'); ?>
1791 1791
         </div><!-- end geodir-content-left -->
@@ -1803,20 +1803,20 @@  discard block
 block discarded – undo
1803 1803
  */
1804 1804
 function geodir_action_listings_sidebar_left()
1805 1805
 {
1806
-    if (get_option('geodir_show_listing_left_section')) {
1807
-        /** This action is documented in geodirectory_template_actions.php */
1808
-        do_action('geodir_sidebar_left_open', 'listings-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
1809
-        /**
1810
-         * Calls the listings page (category) left sidebar content.
1811
-         *
1812
-         * All the content for the listings page left sidebar is added via this hook.
1813
-         *
1814
-         * @since 1.0.0
1815
-         */
1816
-        do_action('geodir_listings_sidebar_left_inside');
1817
-        /** This action is documented in geodirectory_template_actions.php */
1818
-        do_action('geodir_sidebar_left_close', 'listings-page');
1819
-    }
1806
+	if (get_option('geodir_show_listing_left_section')) {
1807
+		/** This action is documented in geodirectory_template_actions.php */
1808
+		do_action('geodir_sidebar_left_open', 'listings-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
1809
+		/**
1810
+		 * Calls the listings page (category) left sidebar content.
1811
+		 *
1812
+		 * All the content for the listings page left sidebar is added via this hook.
1813
+		 *
1814
+		 * @since 1.0.0
1815
+		 */
1816
+		do_action('geodir_listings_sidebar_left_inside');
1817
+		/** This action is documented in geodirectory_template_actions.php */
1818
+		do_action('geodir_sidebar_left_close', 'listings-page');
1819
+	}
1820 1820
 }
1821 1821
 
1822 1822
 /**
@@ -1829,7 +1829,7 @@  discard block
 block discarded – undo
1829 1829
  */
1830 1830
 function geodir_listing_right_section()
1831 1831
 {
1832
-    if (get_option('geodir_show_listing_right_section')) { ?>
1832
+	if (get_option('geodir_show_listing_right_section')) { ?>
1833 1833
         <div class="geodir-content-right geodir-sidebar-wrap">
1834 1834
             <?php dynamic_sidebar('geodir_listing_right_sidebar'); ?>
1835 1835
         </div><!-- end geodir-content-right -->
@@ -1847,20 +1847,20 @@  discard block
 block discarded – undo
1847 1847
  */
1848 1848
 function geodir_action_listings_sidebar_right()
1849 1849
 {
1850
-    if (get_option('geodir_show_listing_right_section')) {
1851
-        /** This action is documented in geodirectory_template_actions.php */
1852
-        do_action('geodir_sidebar_right_open', 'listings-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
1853
-        /**
1854
-         * Calls the listings page (category) right sidebar content.
1855
-         *
1856
-         * All the content for the listings page right sidebar is added via this hook.
1857
-         *
1858
-         * @since 1.0.0
1859
-         */
1860
-        do_action('geodir_listings_sidebar_right_inside');
1861
-        /** This action is documented in geodirectory_template_actions.php */
1862
-        do_action('geodir_sidebar_right_close', 'listings-page');
1863
-    }
1850
+	if (get_option('geodir_show_listing_right_section')) {
1851
+		/** This action is documented in geodirectory_template_actions.php */
1852
+		do_action('geodir_sidebar_right_open', 'listings-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
1853
+		/**
1854
+		 * Calls the listings page (category) right sidebar content.
1855
+		 *
1856
+		 * All the content for the listings page right sidebar is added via this hook.
1857
+		 *
1858
+		 * @since 1.0.0
1859
+		 */
1860
+		do_action('geodir_listings_sidebar_right_inside');
1861
+		/** This action is documented in geodirectory_template_actions.php */
1862
+		do_action('geodir_sidebar_right_close', 'listings-page');
1863
+	}
1864 1864
 }
1865 1865
 
1866 1866
 
@@ -1877,23 +1877,23 @@  discard block
 block discarded – undo
1877 1877
  */
1878 1878
 function geodir_action_main_content_open($type = '', $id = '', $class = '')
1879 1879
 {
1880
-    $tc = get_option('theme_compatibility_setting');
1881
-    if (!empty($tc['geodir_main_content_open_replace'])) {
1882
-        $text = $tc['geodir_main_content_open_replace'];
1883
-    } else {
1884
-        $text = '<main id="[id]" class="[class]" role="main">';
1885
-    }
1880
+	$tc = get_option('theme_compatibility_setting');
1881
+	if (!empty($tc['geodir_main_content_open_replace'])) {
1882
+		$text = $tc['geodir_main_content_open_replace'];
1883
+	} else {
1884
+		$text = '<main id="[id]" class="[class]" role="main">';
1885
+	}
1886 1886
 
1887
-    if (!empty($tc['geodir_main_content_open_id'])) {
1888
-        $id = $tc['geodir_main_content_open_id'];
1889
-    }
1890
-    if (!empty($tc['geodir_main_content_open_class'])) {
1891
-        $class = $tc['geodir_main_content_open_class'];
1892
-    }
1887
+	if (!empty($tc['geodir_main_content_open_id'])) {
1888
+		$id = $tc['geodir_main_content_open_id'];
1889
+	}
1890
+	if (!empty($tc['geodir_main_content_open_class'])) {
1891
+		$class = $tc['geodir_main_content_open_class'];
1892
+	}
1893 1893
 
1894
-    $text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
1894
+	$text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
1895 1895
 
1896
-    echo $text;
1896
+	echo $text;
1897 1897
 }
1898 1898
 
1899 1899
 // action for adding the primary div closing tag
@@ -1906,13 +1906,13 @@  discard block
 block discarded – undo
1906 1906
  */
1907 1907
 function geodir_action_main_content_close()
1908 1908
 {
1909
-    $tc = get_option('theme_compatibility_setting');
1910
-    if (!empty($tc['geodir_main_content_close_replace'])) {
1911
-        $text = $tc['geodir_main_content_close_replace'];
1912
-    } else {
1913
-        $text = '</main><!-- main ends here-->';
1914
-    }
1915
-    echo $text;
1909
+	$tc = get_option('theme_compatibility_setting');
1910
+	if (!empty($tc['geodir_main_content_close_replace'])) {
1911
+		$text = $tc['geodir_main_content_close_replace'];
1912
+	} else {
1913
+		$text = '</main><!-- main ends here-->';
1914
+	}
1915
+	echo $text;
1916 1916
 }
1917 1917
 
1918 1918
 /**
@@ -1924,14 +1924,14 @@  discard block
 block discarded – undo
1924 1924
  */
1925 1925
 function geodir_action_listings_content_inside()
1926 1926
 {
1927
-    global $gridview_columns;
1928
-    $listing_view = get_option('geodir_listing_view');
1929
-    if (strstr($listing_view, 'gridview')) {
1930
-        $gridview_columns = $listing_view;
1931
-        $listing_view_exp = explode('_', $listing_view);
1932
-        $listing_view = $listing_view_exp[0];
1933
-    }
1934
-    geodir_get_template_part('listing', 'listview');
1927
+	global $gridview_columns;
1928
+	$listing_view = get_option('geodir_listing_view');
1929
+	if (strstr($listing_view, 'gridview')) {
1930
+		$gridview_columns = $listing_view;
1931
+		$listing_view_exp = explode('_', $listing_view);
1932
+		$listing_view = $listing_view_exp[0];
1933
+	}
1934
+	geodir_get_template_part('listing', 'listview');
1935 1935
 }
1936 1936
 
1937 1937
 add_action('geodir_listings_content_inside', 'geodir_action_listings_content_inside', 10);
@@ -1947,47 +1947,47 @@  discard block
 block discarded – undo
1947 1947
  */
1948 1948
 function geodir_action_listings_content()
1949 1949
 {
1950
-    /**
1951
-     * This is used to add HTML opening wrappers to the main content of most pages including listings, author, search, home etc.
1952
-     *
1953
-     * @since 1.0.0
1954
-     * @param string $type The page type. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
1955
-     * @param string $id The id for the div. Usually 'geodir-main-content'.
1956
-     * @param string $class The class for the div. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
1957
-     * @see 'geodir_main_content_close' Where the oposing closing tag is added.
1958
-     */
1959
-    do_action('geodir_main_content_open', 'listings-page', 'geodir-main-content', 'listings-page');
1960
-    $extra_class = apply_filters('geodir_before_listing_wrapper_extra_class', '', 'listings-page');
1961
-    echo '<div class="clearfix '.$extra_class.'">';
1962
-    /**
1963
-     * Called before the listings page content, inside the outer wrapper. Used on listings pages and search and author pages.
1964
-     *
1965
-     * @since 1.0.0
1966
-     */
1967
-    do_action('geodir_before_listing');
1968
-    echo '</div>';
1969
-
1970
-    /**
1971
-     * This actions calls the listings list content. Used on listings pages and search and author pages.
1972
-     *
1973
-     * @since 1.0.0
1974
-     */
1975
-    do_action('geodir_listings_content_inside');
1976
-
1977
-    /**
1978
-     * Called after the listings content, inside the outer wrapper HTML. Used on listings pages and search and author pages.
1979
-     *
1980
-     * @since 1.0.0
1981
-     */
1982
-    do_action('geodir_after_listing');
1983
-
1984
-    /**
1985
-     * This is used to add HTML closing wrappers to the main content of most pages including listings, author, search, home etc.
1986
-     *
1987
-     * @since 1.0.0
1988
-     * @see 'geodir_main_content_open' Where the oposing opening tag is added.
1989
-     */
1990
-    do_action('geodir_main_content_close', 'listings-page');
1950
+	/**
1951
+	 * This is used to add HTML opening wrappers to the main content of most pages including listings, author, search, home etc.
1952
+	 *
1953
+	 * @since 1.0.0
1954
+	 * @param string $type The page type. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
1955
+	 * @param string $id The id for the div. Usually 'geodir-main-content'.
1956
+	 * @param string $class The class for the div. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
1957
+	 * @see 'geodir_main_content_close' Where the oposing closing tag is added.
1958
+	 */
1959
+	do_action('geodir_main_content_open', 'listings-page', 'geodir-main-content', 'listings-page');
1960
+	$extra_class = apply_filters('geodir_before_listing_wrapper_extra_class', '', 'listings-page');
1961
+	echo '<div class="clearfix '.$extra_class.'">';
1962
+	/**
1963
+	 * Called before the listings page content, inside the outer wrapper. Used on listings pages and search and author pages.
1964
+	 *
1965
+	 * @since 1.0.0
1966
+	 */
1967
+	do_action('geodir_before_listing');
1968
+	echo '</div>';
1969
+
1970
+	/**
1971
+	 * This actions calls the listings list content. Used on listings pages and search and author pages.
1972
+	 *
1973
+	 * @since 1.0.0
1974
+	 */
1975
+	do_action('geodir_listings_content_inside');
1976
+
1977
+	/**
1978
+	 * Called after the listings content, inside the outer wrapper HTML. Used on listings pages and search and author pages.
1979
+	 *
1980
+	 * @since 1.0.0
1981
+	 */
1982
+	do_action('geodir_after_listing');
1983
+
1984
+	/**
1985
+	 * This is used to add HTML closing wrappers to the main content of most pages including listings, author, search, home etc.
1986
+	 *
1987
+	 * @since 1.0.0
1988
+	 * @see 'geodir_main_content_open' Where the oposing opening tag is added.
1989
+	 */
1990
+	do_action('geodir_main_content_close', 'listings-page');
1991 1991
 }
1992 1992
 
1993 1993
 
@@ -2002,10 +2002,10 @@  discard block
 block discarded – undo
2002 2002
  */
2003 2003
 function geodir_action_sidebar_listings_bottom_section()
2004 2004
 {
2005
-    if (get_option('geodir_show_listing_bottom_section')) { ?>
2005
+	if (get_option('geodir_show_listing_bottom_section')) { ?>
2006 2006
         <div class="<?php
2007
-            /** This action is documented in geodirectory_template_actions.php */
2008
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_bottom'); ?>">
2007
+			/** This action is documented in geodirectory_template_actions.php */
2008
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_bottom'); ?>">
2009 2009
             <?php dynamic_sidebar('geodir_listing_bottom'); ?>
2010 2010
         </div><!-- clearfix ends here-->
2011 2011
     <?php }
@@ -2025,38 +2025,38 @@  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']);
2030
-    /** This action is documented in geodirectory_template_actions.php */
2031
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
2032
-    /** This action is documented in geodirectory_template_actions.php */
2033
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2034
-
2035
-    $title = apply_filters('geodir_add_listing_page_title_text', get_the_title());
2036
-
2037
-    if(geodir_is_page('add-listing')){
2038
-        $gd_page = 'add-listing';
2039
-        if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
2040
-            $title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
2041
-        }elseif(isset($listing_type)){
2042
-            $title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
2043
-        }
2028
+	if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '')
2029
+		$listing_type = sanitize_text_field($_REQUEST['listing_type']);
2030
+	/** This action is documented in geodirectory_template_actions.php */
2031
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
2032
+	/** This action is documented in geodirectory_template_actions.php */
2033
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2034
+
2035
+	$title = apply_filters('geodir_add_listing_page_title_text', get_the_title());
2036
+
2037
+	if(geodir_is_page('add-listing')){
2038
+		$gd_page = 'add-listing';
2039
+		if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
2040
+			$title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
2041
+		}elseif(isset($listing_type)){
2042
+			$title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
2043
+		}
2044 2044
 
2045
-    }
2045
+	}
2046 2046
 
2047 2047
 
2048
-    /**
2049
-     * Filter page title to replace variables.
2050
-     *
2051
-     * @since 1.5.4
2052
-     * @param string $title The page title including variables.
2053
-     * @param string $gd_page The GeoDirectory page type if any.
2054
-     */
2055
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2048
+	/**
2049
+	 * Filter page title to replace variables.
2050
+	 *
2051
+	 * @since 1.5.4
2052
+	 * @param string $title The page title including variables.
2053
+	 * @param string $gd_page The GeoDirectory page type if any.
2054
+	 */
2055
+	$title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2056 2056
 
2057
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">';
2058
-    echo $title;
2059
-    echo '</h1></header>';
2057
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">';
2058
+	echo $title;
2059
+	echo '</h1></header>';
2060 2060
 }
2061 2061
 
2062 2062
 add_action('geodir_add_listing_page_mandatory', 'geodir_action_add_listing_page_mandatory', 10);
@@ -2087,54 +2087,54 @@  discard block
 block discarded – undo
2087 2087
  */
2088 2088
 function geodir_action_add_listing_form()
2089 2089
 {
2090
-    global $cat_display, $post_cat, $current_user, $gd_session;
2091
-    $page_id = get_the_ID();
2092
-    $post = '';
2093
-    $title = '';
2094
-    $desc = '';
2095
-    $kw_tags = '';
2096
-    $required_msg = '';
2097
-    $submit_button = '';
2098
-
2099
-    $ajax_action = isset($_REQUEST['ajax_action']) ? $_REQUEST['ajax_action'] : 'add';
2100
-
2101
-    $thumb_img_arr = array();
2102
-    $curImages = '';
2103
-
2104
-    if (isset($_REQUEST['backandedit'])) {
2105
-        global $post;
2106
-        $post = (object)$gd_session->get('listing');
2107
-        $listing_type = $post->listing_type;
2108
-        $title = $post->post_title;
2109
-        $desc = $post->post_desc;
2110
-        $post_cat = $post->post_category;
2111
-
2112
-        $kw_tags = $post->post_tags;
2113
-        $curImages = isset($post->post_images) ? $post->post_images : '';
2114
-    } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2115
-        global $post, $post_images;
2116
-
2117
-        $post = geodir_get_post_info($_REQUEST['pid']);
2118
-        $thumb_img_arr = geodir_get_images($post->ID);
2119
-        if ($thumb_img_arr) {
2120
-            foreach ($thumb_img_arr as $post_img) {
2121
-                $curImages .= $post_img->src . ',';
2122
-            }
2123
-        }
2124
-
2125
-        $listing_type = $post->post_type;
2126
-        $title = $post->post_title;
2127
-        $desc = $post->post_content;
2128
-        $kw_tags = $post->post_tags;
2129
-        $kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type . '_tags', array('fields' => 'names')));
2130
-    } else {
2131
-        $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2132
-    }
2133
-
2134
-    if ($current_user->ID != '0') {
2135
-        $user_login = true;
2136
-    }
2137
-    ?>
2090
+	global $cat_display, $post_cat, $current_user, $gd_session;
2091
+	$page_id = get_the_ID();
2092
+	$post = '';
2093
+	$title = '';
2094
+	$desc = '';
2095
+	$kw_tags = '';
2096
+	$required_msg = '';
2097
+	$submit_button = '';
2098
+
2099
+	$ajax_action = isset($_REQUEST['ajax_action']) ? $_REQUEST['ajax_action'] : 'add';
2100
+
2101
+	$thumb_img_arr = array();
2102
+	$curImages = '';
2103
+
2104
+	if (isset($_REQUEST['backandedit'])) {
2105
+		global $post;
2106
+		$post = (object)$gd_session->get('listing');
2107
+		$listing_type = $post->listing_type;
2108
+		$title = $post->post_title;
2109
+		$desc = $post->post_desc;
2110
+		$post_cat = $post->post_category;
2111
+
2112
+		$kw_tags = $post->post_tags;
2113
+		$curImages = isset($post->post_images) ? $post->post_images : '';
2114
+	} elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2115
+		global $post, $post_images;
2116
+
2117
+		$post = geodir_get_post_info($_REQUEST['pid']);
2118
+		$thumb_img_arr = geodir_get_images($post->ID);
2119
+		if ($thumb_img_arr) {
2120
+			foreach ($thumb_img_arr as $post_img) {
2121
+				$curImages .= $post_img->src . ',';
2122
+			}
2123
+		}
2124
+
2125
+		$listing_type = $post->post_type;
2126
+		$title = $post->post_title;
2127
+		$desc = $post->post_content;
2128
+		$kw_tags = $post->post_tags;
2129
+		$kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type . '_tags', array('fields' => 'names')));
2130
+	} else {
2131
+		$listing_type = sanitize_text_field($_REQUEST['listing_type']);
2132
+	}
2133
+
2134
+	if ($current_user->ID != '0') {
2135
+		$user_login = true;
2136
+	}
2137
+	?>
2138 2138
     <form name="propertyform" id="propertyform" action="<?php echo get_page_link(geodir_preview_page_id());?>" method="post" enctype="multipart/form-data">
2139 2139
         <input type="hidden" name="preview" value="<?php echo sanitize_text_field($listing_type);?>"/>
2140 2140
         <input type="hidden" name="listing_type" value="<?php echo sanitize_text_field($listing_type);?>"/>
@@ -2145,27 +2145,27 @@  discard block
 block discarded – undo
2145 2145
         <?php } if (isset($_REQUEST['backandedit'])) { ?>
2146 2146
             <input type="hidden" name="backandedit" value="<?php echo sanitize_text_field($_REQUEST['backandedit']);?>"/>
2147 2147
         <?php
2148
-        } 
2149
-        /**
2150
-         * Called at the very top of the add listing page form for frontend.
2151
-         *
2152
-         * This is called just before the "Enter Listing Details" text.
2153
-         *
2154
-         * @since 1.0.0
2155
-         */
2156
-        do_action('geodir_before_detail_fields');
2157
-        ?>
2148
+		} 
2149
+		/**
2150
+		 * Called at the very top of the add listing page form for frontend.
2151
+		 *
2152
+		 * This is called just before the "Enter Listing Details" text.
2153
+		 *
2154
+		 * @since 1.0.0
2155
+		 */
2156
+		do_action('geodir_before_detail_fields');
2157
+		?>
2158 2158
         <h5 id="geodir_fieldset_details" class="geodir-fieldset-row" gd-fieldset="details"><?php echo LISTING_DETAILS_TEXT;?></h5>
2159 2159
         <?php
2160
-        /**
2161
-         * Called at the top of the add listing page form for frontend.
2162
-         *
2163
-         * This is called after the "Enter Listing Details" text.
2164
-         *
2165
-         * @since 1.0.0
2166
-         */
2167
-        do_action('geodir_before_main_form_fields');
2168
-        ?>
2160
+		/**
2161
+		 * Called at the top of the add listing page form for frontend.
2162
+		 *
2163
+		 * This is called after the "Enter Listing Details" text.
2164
+		 *
2165
+		 * @since 1.0.0
2166
+		 */
2167
+		do_action('geodir_before_main_form_fields');
2168
+		?>
2169 2169
         <div id="geodir_post_title_row" class="required_field geodir_form_row clearfix gd-fieldset-details">
2170 2170
             <label><?php echo PLACE_TITLE_TEXT;?><span>*</span> </label>
2171 2171
             <input type="text" field_type="text" name="post_title" id="post_title" class="geodir_textfield"
@@ -2173,57 +2173,57 @@  discard block
 block discarded – undo
2173 2173
             <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory');?></span>
2174 2174
         </div>
2175 2175
         <?php
2176
-        $show_editor = get_option('geodir_tiny_editor_on_add_listing');
2177
-
2178
-        $desc = $show_editor ? stripslashes($desc) : esc_attr(stripslashes($desc));
2179
-        $desc_limit = '';
2180
-        /**
2181
-         * Filter the add listing description field character limit number.
2182
-         *
2183
-         * @since 1.0.0
2184
-         * @param int $desc_limit The amount of characters to limit the description to.
2185
-         */
2186
-        $desc_limit = apply_filters('geodir_description_field_desc_limit', $desc_limit);
2187
-        /**
2188
-         * Filter the add listing description field text.
2189
-         *
2190
-         * @since 1.0.0
2191
-         * @param string $desc The text for the description field.
2192
-         * @param int $desc_limit The character limit numer if any.
2193
-         */
2194
-        $desc = apply_filters('geodir_description_field_desc', $desc, $desc_limit);
2195
-        $desc_limit_msg = '';
2196
-        /**
2197
-         * Filter the add listing description limit message.
2198
-         *
2199
-         * This is the message shown if there is a limit applied to the amount of characters the description can use.
2200
-         *
2201
-         * @since 1.0.0
2202
-         * @param string $desc_limit_msg The limit message string if any.
2203
-         * @param int $desc_limit The character limit numer if any.
2204
-         */
2205
-        $desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit);
2176
+		$show_editor = get_option('geodir_tiny_editor_on_add_listing');
2177
+
2178
+		$desc = $show_editor ? stripslashes($desc) : esc_attr(stripslashes($desc));
2179
+		$desc_limit = '';
2180
+		/**
2181
+		 * Filter the add listing description field character limit number.
2182
+		 *
2183
+		 * @since 1.0.0
2184
+		 * @param int $desc_limit The amount of characters to limit the description to.
2185
+		 */
2186
+		$desc_limit = apply_filters('geodir_description_field_desc_limit', $desc_limit);
2187
+		/**
2188
+		 * Filter the add listing description field text.
2189
+		 *
2190
+		 * @since 1.0.0
2191
+		 * @param string $desc The text for the description field.
2192
+		 * @param int $desc_limit The character limit numer if any.
2193
+		 */
2194
+		$desc = apply_filters('geodir_description_field_desc', $desc, $desc_limit);
2195
+		$desc_limit_msg = '';
2196
+		/**
2197
+		 * Filter the add listing description limit message.
2198
+		 *
2199
+		 * This is the message shown if there is a limit applied to the amount of characters the description can use.
2200
+		 *
2201
+		 * @since 1.0.0
2202
+		 * @param string $desc_limit_msg The limit message string if any.
2203
+		 * @param int $desc_limit The character limit numer if any.
2204
+		 */
2205
+		$desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit);
2206 2206
         
2207
-        $desc_class = '';
2208
-        if ($desc_limit === '' || (int)$desc_limit > 0) {
2209
-            /**
2210
-             * Called on the add listing page form for frontend just before the description field.
2211
-             *
2212
-             * @since 1.0.0
2213
-             */
2214
-            do_action('geodir_before_description_field');
2207
+		$desc_class = '';
2208
+		if ($desc_limit === '' || (int)$desc_limit > 0) {
2209
+			/**
2210
+			 * Called on the add listing page form for frontend just before the description field.
2211
+			 *
2212
+			 * @since 1.0.0
2213
+			 */
2214
+			do_action('geodir_before_description_field');
2215 2215
             
2216
-            $desc_class = ' required_field';
2217
-        } else {
2218
-            $desc_class = ' hidden';
2219
-        }
2220
-        ?>
2216
+			$desc_class = ' required_field';
2217
+		} else {
2218
+			$desc_class = ' hidden';
2219
+		}
2220
+		?>
2221 2221
         <div id="geodir_post_desc_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $desc_class;?>">
2222 2222
             <label><?php echo PLACE_DESC_TEXT;?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label>
2223 2223
             <?php
2224
-            if (!empty($show_editor) && in_array($listing_type, $show_editor)) {
2225
-                $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
2226
-            ?>
2224
+			if (!empty($show_editor) && in_array($listing_type, $show_editor)) {
2225
+				$editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
2226
+			?>
2227 2227
                 <div class="editor" field_id="post_desc" field_type="editor">
2228 2228
                     <?php wp_editor($desc, "post_desc", $editor_settings); ?>
2229 2229
                 </div>
@@ -2237,56 +2237,56 @@  discard block
 block discarded – undo
2237 2237
             <span class="geodir_message_error"><?php echo _e($required_msg, 'geodirectory');?></span>
2238 2238
         </div>
2239 2239
         <?php
2240
-        if ($desc_limit === '' || (int)$desc_limit > 0) {
2241
-            /**
2242
-             * Called on the add listing page form for frontend just after the description field.
2243
-             *
2244
-             * @since 1.0.0
2245
-             */
2246
-            do_action('geodir_after_description_field');
2247
-        }
2240
+		if ($desc_limit === '' || (int)$desc_limit > 0) {
2241
+			/**
2242
+			 * Called on the add listing page form for frontend just after the description field.
2243
+			 *
2244
+			 * @since 1.0.0
2245
+			 */
2246
+			do_action('geodir_after_description_field');
2247
+		}
2248 2248
         
2249
-        $kw_tags = esc_attr(stripslashes($kw_tags));
2250
-        $kw_tags_count = TAGKW_TEXT_COUNT;
2251
-        $kw_tags_msg = TAGKW_MSG;
2252
-        /**
2253
-         * Filter the add listing tags character limit.
2254
-         *
2255
-         * @since 1.0.0
2256
-         * @param int $kw_tags_count The character count limit if any.
2257
-         */
2258
-        $kw_tags_count = apply_filters('geodir_listing_tags_field_tags_count', $kw_tags_count);
2259
-        /**
2260
-         * Filter the add listing tags field value.
2261
-         *
2262
-         * You can use the $_REQUEST values to check if this is a go back and edit value etc.
2263
-         *
2264
-         * @since 1.0.0
2265
-         * @param string $kw_tags The tag field value, usually a comma separated list of tags.
2266
-         * @param int $kw_tags_count The character count limit if any.
2267
-         */
2268
-        $kw_tags = apply_filters('geodir_listing_tags_field_tags', $kw_tags, $kw_tags_count);
2269
-        /**
2270
-         * Filter the add listing tags field message text.
2271
-         *
2272
-         * @since 1.0.0
2273
-         * @param string $kw_tags_msg The message shown under the field.
2274
-         * @param int $kw_tags_count The character count limit if any.
2275
-         */
2276
-        $kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count);
2249
+		$kw_tags = esc_attr(stripslashes($kw_tags));
2250
+		$kw_tags_count = TAGKW_TEXT_COUNT;
2251
+		$kw_tags_msg = TAGKW_MSG;
2252
+		/**
2253
+		 * Filter the add listing tags character limit.
2254
+		 *
2255
+		 * @since 1.0.0
2256
+		 * @param int $kw_tags_count The character count limit if any.
2257
+		 */
2258
+		$kw_tags_count = apply_filters('geodir_listing_tags_field_tags_count', $kw_tags_count);
2259
+		/**
2260
+		 * Filter the add listing tags field value.
2261
+		 *
2262
+		 * You can use the $_REQUEST values to check if this is a go back and edit value etc.
2263
+		 *
2264
+		 * @since 1.0.0
2265
+		 * @param string $kw_tags The tag field value, usually a comma separated list of tags.
2266
+		 * @param int $kw_tags_count The character count limit if any.
2267
+		 */
2268
+		$kw_tags = apply_filters('geodir_listing_tags_field_tags', $kw_tags, $kw_tags_count);
2269
+		/**
2270
+		 * Filter the add listing tags field message text.
2271
+		 *
2272
+		 * @since 1.0.0
2273
+		 * @param string $kw_tags_msg The message shown under the field.
2274
+		 * @param int $kw_tags_count The character count limit if any.
2275
+		 */
2276
+		$kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count);
2277 2277
         
2278
-        $tags_class = '';
2279
-        if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2280
-            /**
2281
-             * Called on the add listing page form for frontend just before the tags field.
2282
-             *
2283
-             * @since 1.0.0
2284
-             */
2285
-            do_action('geodir_before_listing_tags_field');
2286
-        } else {
2287
-            $tags_class = ' hidden';
2288
-        }
2289
-        ?>
2278
+		$tags_class = '';
2279
+		if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2280
+			/**
2281
+			 * Called on the add listing page form for frontend just before the tags field.
2282
+			 *
2283
+			 * @since 1.0.0
2284
+			 */
2285
+			do_action('geodir_before_listing_tags_field');
2286
+		} else {
2287
+			$tags_class = ' hidden';
2288
+		}
2289
+		?>
2290 2290
         <div id="geodir_post_tags_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $tags_class;?>">
2291 2291
             <label><?php echo TAGKW_TEXT; ?></label>
2292 2292
             <input name="post_tags" id="post_tags" value="<?php echo $kw_tags; ?>" type="text" class="geodir_textfield"
@@ -2294,90 +2294,90 @@  discard block
 block discarded – undo
2294 2294
             <span class="geodir_message_note"><?php echo $kw_tags_msg;?></span>
2295 2295
         </div>
2296 2296
         <?php
2297
-        if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2298
-            /**
2299
-             * Called on the add listing page form for frontend just after the tags field.
2300
-             *
2301
-             * @since 1.0.0
2302
-             */
2303
-            do_action('geodir_after_listing_tags_field');
2304
-        }
2297
+		if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2298
+			/**
2299
+			 * Called on the add listing page form for frontend just after the tags field.
2300
+			 *
2301
+			 * @since 1.0.0
2302
+			 */
2303
+			do_action('geodir_after_listing_tags_field');
2304
+		}
2305 2305
         
2306
-        $package_info = array();
2307
-        $package_info = geodir_post_package_info($package_info, $post);
2306
+		$package_info = array();
2307
+		$package_info = geodir_post_package_info($package_info, $post);
2308 2308
         
2309
-        geodir_get_custom_fields_html($package_info->pid, 'all', $listing_type);
2309
+		geodir_get_custom_fields_html($package_info->pid, 'all', $listing_type);
2310 2310
         
2311
-        // adjust values here
2312
-        $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
2311
+		// adjust values here
2312
+		$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
2313 2313
 
2314
-        $multiple = true; // allow multiple files upload
2314
+		$multiple = true; // allow multiple files upload
2315 2315
 
2316
-        $width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels)
2316
+		$width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels)
2317 2317
 
2318
-        $height = geodir_media_image_large_height(); // If you want to automatically resize all uploaded images then provide height here (in pixels)
2318
+		$height = geodir_media_image_large_height(); // If you want to automatically resize all uploaded images then provide height here (in pixels)
2319 2319
 
2320
-        $thumb_img_arr = array();
2321
-        $totImg = 0;
2322
-        if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
2323
-            $post = (object)$gd_session->get('listing');
2324
-            if (isset($post->post_images))
2325
-                $curImages = trim($post->post_images, ",");
2320
+		$thumb_img_arr = array();
2321
+		$totImg = 0;
2322
+		if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
2323
+			$post = (object)$gd_session->get('listing');
2324
+			if (isset($post->post_images))
2325
+				$curImages = trim($post->post_images, ",");
2326 2326
 
2327 2327
 
2328
-            if ($curImages != '') {
2329
-                $curImages_array = explode(',', $curImages);
2330
-                $totImg = count($curImages_array);
2331
-            }
2332
-
2333
-            $listing_type = $post->listing_type;
2328
+			if ($curImages != '') {
2329
+				$curImages_array = explode(',', $curImages);
2330
+				$totImg = count($curImages_array);
2331
+			}
2334 2332
 
2335
-        } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2336
-            $post = geodir_get_post_info((int)$_REQUEST['pid']);
2337
-            $listing_type = $post->post_type;
2338
-            $thumb_img_arr = geodir_get_images($_REQUEST['pid']);
2333
+			$listing_type = $post->listing_type;
2339 2334
 
2340
-        } else {
2341
-            $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2342
-        }
2335
+		} elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2336
+			$post = geodir_get_post_info((int)$_REQUEST['pid']);
2337
+			$listing_type = $post->post_type;
2338
+			$thumb_img_arr = geodir_get_images($_REQUEST['pid']);
2343 2339
 
2340
+		} else {
2341
+			$listing_type = sanitize_text_field($_REQUEST['listing_type']);
2342
+		}
2344 2343
 
2345
-        if (!empty($thumb_img_arr)) {
2346
-            foreach ($thumb_img_arr as $img) {
2347
-                //$curImages = $img->src.",";
2348
-            }
2349 2344
 
2350
-            $totImg = count((array)$thumb_img_arr);
2351
-        }
2345
+		if (!empty($thumb_img_arr)) {
2346
+			foreach ($thumb_img_arr as $img) {
2347
+				//$curImages = $img->src.",";
2348
+			}
2352 2349
 
2353
-        if ($curImages != '')
2354
-            $svalue = $curImages; // this will be initial value of the above form field. Image urls.
2355
-        else
2356
-            $svalue = '';
2357
-
2358
-        $image_limit = $package_info->image_limit;
2359
-        $show_image_input_box = ($image_limit != '0');
2360
-        /**
2361
-         * Filter to be able to show/hide the image upload section of the add listing form.
2362
-         *
2363
-         * @since 1.0.0
2364
-         * @param bool $show_image_input_box Set true to show. Set false to not show.
2365
-         * @param string $listing_type The custom post type slug.
2366
-         */
2367
-        $show_image_input_box = apply_filters('geodir_image_uploader_on_add_listing', $show_image_input_box, $listing_type);
2368
-        if ($show_image_input_box) {
2369
-            ?>
2350
+			$totImg = count((array)$thumb_img_arr);
2351
+		}
2352
+
2353
+		if ($curImages != '')
2354
+			$svalue = $curImages; // this will be initial value of the above form field. Image urls.
2355
+		else
2356
+			$svalue = '';
2357
+
2358
+		$image_limit = $package_info->image_limit;
2359
+		$show_image_input_box = ($image_limit != '0');
2360
+		/**
2361
+		 * Filter to be able to show/hide the image upload section of the add listing form.
2362
+		 *
2363
+		 * @since 1.0.0
2364
+		 * @param bool $show_image_input_box Set true to show. Set false to not show.
2365
+		 * @param string $listing_type The custom post type slug.
2366
+		 */
2367
+		$show_image_input_box = apply_filters('geodir_image_uploader_on_add_listing', $show_image_input_box, $listing_type);
2368
+		if ($show_image_input_box) {
2369
+			?>
2370 2370
 
2371 2371
             <h5 id="geodir_form_title_row" class="geodir-form_title"> <?php echo PRO_PHOTO_TEXT;?>
2372 2372
                 <?php if ($image_limit == 1) {
2373
-                    echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
2374
-                } ?>
2373
+					echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
2374
+				} ?>
2375 2375
                 <?php if ($image_limit > 1) {
2376
-                    echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>';
2377
-                } ?>
2376
+					echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>';
2377
+				} ?>
2378 2378
                 <?php if ($image_limit == '') {
2379
-                    echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>';
2380
-                } ?>
2379
+					echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>';
2380
+				} ?>
2381 2381
             </h5>
2382 2382
 
2383 2383
             <div class="geodir_form_row clearfix" id="<?php echo $id; ?>dropbox"
@@ -2415,12 +2415,12 @@  discard block
 block discarded – undo
2415 2415
         <?php } ?>
2416 2416
 
2417 2417
         <?php
2418
-        /**
2419
-         * Called on the add listing page form for frontend just after the image upload field.
2420
-         *
2421
-         * @since 1.0.0
2422
-         */
2423
-        do_action('geodir_after_main_form_fields');?>
2418
+		/**
2419
+		 * Called on the add listing page form for frontend just after the image upload field.
2420
+		 *
2421
+		 * @since 1.0.0
2422
+		 */
2423
+		do_action('geodir_after_main_form_fields');?>
2424 2424
 
2425 2425
 
2426 2426
         <!-- add captcha code -->
@@ -2449,7 +2449,7 @@  discard block
 block discarded – undo
2449 2449
 
2450 2450
     </form>
2451 2451
     <?php
2452
-    wp_reset_query();
2452
+	wp_reset_query();
2453 2453
 }
2454 2454
 
2455 2455
 /**
@@ -2460,7 +2460,7 @@  discard block
 block discarded – undo
2460 2460
  */
2461 2461
 function geodir_add_listing_sidebar_widget_area()
2462 2462
 {
2463
-    dynamic_sidebar('geodir_add_listing_sidebar');
2463
+	dynamic_sidebar('geodir_add_listing_sidebar');
2464 2464
 }
2465 2465
 
2466 2466
 add_action('geodir_add_listing_sidebar_inside', 'geodir_add_listing_sidebar_widget_area', 10);
@@ -2475,16 +2475,16 @@  discard block
 block discarded – undo
2475 2475
  */
2476 2476
 function geodir_action_add_listing_sidebar()
2477 2477
 {
2478
-    /** This action is documented in geodirectory_template_actions.php */
2479
-    do_action('geodir_sidebar_right_open', 'add-listing-page', 'geodir-sidebar', 'geodir-sidebar-right', 'http://schema.org/WPSideBar');
2480
-    /**
2481
-     * This is used to add the content to the add listing page sidebar.
2482
-     *
2483
-     * @since 1.0.0
2484
-     */
2485
-    do_action('geodir_add_listing_sidebar_inside');
2486
-    /** This action is documented in geodirectory_template_actions.php */
2487
-    do_action('geodir_sidebar_right_close', 'details-page');
2478
+	/** This action is documented in geodirectory_template_actions.php */
2479
+	do_action('geodir_sidebar_right_open', 'add-listing-page', 'geodir-sidebar', 'geodir-sidebar-right', 'http://schema.org/WPSideBar');
2480
+	/**
2481
+	 * This is used to add the content to the add listing page sidebar.
2482
+	 *
2483
+	 * @since 1.0.0
2484
+	 */
2485
+	do_action('geodir_add_listing_sidebar_inside');
2486
+	/** This action is documented in geodirectory_template_actions.php */
2487
+	do_action('geodir_sidebar_right_close', 'details-page');
2488 2488
 }
2489 2489
 
2490 2490
 ###############################################
@@ -2501,11 +2501,11 @@  discard block
 block discarded – undo
2501 2501
  */
2502 2502
 function geodir_action_geodir_sidebar_signup_top()
2503 2503
 {
2504
-    ?>
2504
+	?>
2505 2505
     <div
2506 2506
         class="<?php
2507
-        /** This action is documented in geodirectory_template_actions.php */
2508
-        echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>">
2507
+		/** This action is documented in geodirectory_template_actions.php */
2508
+		echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>">
2509 2509
         <?php dynamic_sidebar('Reg/Login Top Section');?>
2510 2510
     </div><!-- clearfix ends here-->
2511 2511
 <?php
@@ -2524,9 +2524,9 @@  discard block
 block discarded – undo
2524 2524
 function geodir_action_signup_forms()
2525 2525
 {
2526 2526
 
2527
-    global $user_login;
2527
+	global $user_login;
2528 2528
 
2529
-    ?>
2529
+	?>
2530 2530
     <script type="text/javascript">
2531 2531
         <?php if ( $user_login ) { ?>
2532 2532
         setTimeout(function () {
@@ -2562,65 +2562,65 @@  discard block
 block discarded – undo
2562 2562
         <?php } ?>
2563 2563
     </script><?php
2564 2564
 
2565
-    global $errors;
2566
-    if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim')
2567
-        $errors->add('claim_login', LOGIN_CLAIM);
2568
-
2569
-    if (!empty($errors)) {
2570
-        foreach ($errors as $errorsObj) {
2571
-            foreach ($errorsObj as $key => $val) {
2572
-                for ($i = 0; $i < count($val); $i++) {
2573
-                    echo "<div class=sucess_msg>" . $val[$i] . '</div>';
2574
-                    $registration_error_msg = 1;
2575
-                }
2576
-            }
2577
-        }
2578
-    }
2565
+	global $errors;
2566
+	if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim')
2567
+		$errors->add('claim_login', LOGIN_CLAIM);
2568
+
2569
+	if (!empty($errors)) {
2570
+		foreach ($errors as $errorsObj) {
2571
+			foreach ($errorsObj as $key => $val) {
2572
+				for ($i = 0; $i < count($val); $i++) {
2573
+					echo "<div class=sucess_msg>" . $val[$i] . '</div>';
2574
+					$registration_error_msg = 1;
2575
+				}
2576
+			}
2577
+		}
2578
+	}
2579 2579
 
2580
-    if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_in') {
2581
-        ?>
2580
+	if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_in') {
2581
+		?>
2582 2582
 
2583 2583
         <div class="login_form">
2584 2584
             <?php
2585
-            /**
2586
-             * Contains login form template.
2587
-             *
2588
-             * @since 1.0.0
2589
-             */
2590
-            include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2585
+			/**
2586
+			 * Contains login form template.
2587
+			 *
2588
+			 * @since 1.0.0
2589
+			 */
2590
+			include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2591 2591
         </div>
2592 2592
 
2593 2593
     <?php } elseif (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_up') { ?>
2594 2594
 
2595 2595
         <div class="registration_form">
2596 2596
             <?php
2597
-            /**
2598
-             * Contains registration form template.
2599
-             *
2600
-             * @since 1.0.0
2601
-             */
2602
-            include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2597
+			/**
2598
+			 * Contains registration form template.
2599
+			 *
2600
+			 * @since 1.0.0
2601
+			 */
2602
+			include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2603 2603
         </div>
2604 2604
 
2605 2605
     <?php } else { ?>
2606 2606
 
2607 2607
         <div class="login_form_l">
2608 2608
             <?php
2609
-            /**
2610
-             * Contains login form template.
2611
-             *
2612
-             * @since 1.0.0
2613
-             */
2614
-            include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2609
+			/**
2610
+			 * Contains login form template.
2611
+			 *
2612
+			 * @since 1.0.0
2613
+			 */
2614
+			include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2615 2615
         </div>
2616 2616
         <div class="registration_form_r">
2617 2617
             <?php
2618
-            /**
2619
-             * Contains registration form template.
2620
-             *
2621
-             * @since 1.0.0
2622
-             */
2623
-            include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2618
+			/**
2619
+			 * Contains registration form template.
2620
+			 *
2621
+			 * @since 1.0.0
2622
+			 */
2623
+			include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2624 2624
         </div>
2625 2625
 
2626 2626
     <?php }?>
@@ -2651,66 +2651,66 @@  discard block
 block discarded – undo
2651 2651
  */
2652 2652
 function geodir_action_author_page_title()
2653 2653
 {
2654
-    global $term;
2654
+	global $term;
2655 2655
 
2656
-    $gd_post_type = geodir_get_current_posttype();
2657
-    $post_type_info = get_post_type_object($gd_post_type);
2656
+	$gd_post_type = geodir_get_current_posttype();
2657
+	$post_type_info = get_post_type_object($gd_post_type);
2658 2658
 
2659
-    $add_string_in_title = __('All', 'geodirectory') . ' ';
2660
-    if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
2661
-        $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
2662
-    }
2659
+	$add_string_in_title = __('All', 'geodirectory') . ' ';
2660
+	if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
2661
+		$add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
2662
+	}
2663 2663
 
2664
-    $list_title = $add_string_in_title . $post_type_info->labels->name;
2665
-    $single_name = $post_type_info->labels->singular_name;
2664
+	$list_title = $add_string_in_title . $post_type_info->labels->name;
2665
+	$single_name = $post_type_info->labels->singular_name;
2666 2666
 
2667
-    $taxonomy = geodir_get_taxonomies($gd_post_type);
2667
+	$taxonomy = geodir_get_taxonomies($gd_post_type);
2668 2668
 
2669
-    if (!empty($term)) {
2670
-        $current_term = get_term_by('slug', $term, $taxonomy[0]);
2671
-        if (!empty($current_term))
2672
-            $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
2673
-    }
2669
+	if (!empty($term)) {
2670
+		$current_term = get_term_by('slug', $term, $taxonomy[0]);
2671
+		if (!empty($current_term))
2672
+			$list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
2673
+	}
2674 2674
 
2675 2675
 
2676
-    if (is_search()) {
2677
-        $list_title = __('Search', 'geodirectory') . ' ' . __($post_type_info->labels->name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2676
+	if (is_search()) {
2677
+		$list_title = __('Search', 'geodirectory') . ' ' . __($post_type_info->labels->name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2678 2678
 
2679
-    }
2680
-    /** This action is documented in geodirectory_template_actions.php */
2681
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
2682
-    /** This action is documented in geodirectory_template_actions.php */
2683
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2679
+	}
2680
+	/** This action is documented in geodirectory_template_actions.php */
2681
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
2682
+	/** This action is documented in geodirectory_template_actions.php */
2683
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2684 2684
 
2685
-    $title = $list_title;
2686
-    if(geodir_is_page('author')){
2687
-        $gd_page = 'author';
2688
-        if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
2689
-            $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
2690
-        }else{
2691
-            $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
2692
-        }
2685
+	$title = $list_title;
2686
+	if(geodir_is_page('author')){
2687
+		$gd_page = 'author';
2688
+		if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
2689
+			$title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
2690
+		}else{
2691
+			$title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
2692
+		}
2693 2693
 
2694
-    }
2694
+	}
2695 2695
 
2696 2696
 
2697
-    /**
2698
-     * Filter page title to replace variables.
2699
-     *
2700
-     * @since 1.5.4
2701
-     * @param string $title The page title including variables.
2702
-     * @param string $gd_page The GeoDirectory page type if any.
2703
-     */
2704
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2697
+	/**
2698
+	 * Filter page title to replace variables.
2699
+	 *
2700
+	 * @since 1.5.4
2701
+	 * @param string $title The page title including variables.
2702
+	 * @param string $gd_page The GeoDirectory page type if any.
2703
+	 */
2704
+	$title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2705 2705
 
2706
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2707
-        /**
2708
-         * Filter the author page title text.
2709
-         *
2710
-         * @since 1.0.0
2711
-         * @param string $list_title The title for the page.
2712
-         */
2713
-        apply_filters('geodir_author_page_title_text', $title) . '</h1></header>';
2706
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2707
+		/**
2708
+		 * Filter the author page title text.
2709
+		 *
2710
+		 * @since 1.0.0
2711
+		 * @param string $list_title The title for the page.
2712
+		 */
2713
+		apply_filters('geodir_author_page_title_text', $title) . '</h1></header>';
2714 2714
 }
2715 2715
 
2716 2716
 
@@ -2728,11 +2728,11 @@  discard block
 block discarded – undo
2728 2728
  */
2729 2729
 function geodir_action_geodir_sidebar_author_top()
2730 2730
 {
2731
-    if (get_option('geodir_show_author_top_section')) { ?>
2731
+	if (get_option('geodir_show_author_top_section')) { ?>
2732 2732
         <div
2733 2733
             class="<?php
2734
-            /** This action is documented in geodirectory_template_actions.php */
2735
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_top'); ?>">
2734
+			/** This action is documented in geodirectory_template_actions.php */
2735
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_top'); ?>">
2736 2736
             <?php dynamic_sidebar('geodir_author_top'); ?>
2737 2737
         </div><!-- clearfix ends here-->
2738 2738
     <?php }
@@ -2748,7 +2748,7 @@  discard block
 block discarded – undo
2748 2748
  */
2749 2749
 function geodir_author_left_section()
2750 2750
 {
2751
-    if (get_option('geodir_show_author_left_section')) { ?>
2751
+	if (get_option('geodir_show_author_left_section')) { ?>
2752 2752
         <div class="geodir-content-left geodir-sidebar-wrap">
2753 2753
             <?php dynamic_sidebar('geodir_author_left_sidebar'); ?>
2754 2754
         </div><!-- end geodir-content-left -->
@@ -2769,19 +2769,19 @@  discard block
 block discarded – undo
2769 2769
  */
2770 2770
 function geodir_action_author_sidebar_left()
2771 2771
 {
2772
-    if (get_option('geodir_show_author_left_section')) {
2772
+	if (get_option('geodir_show_author_left_section')) {
2773 2773
 // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
2774
-        /** This action is documented in geodirectory_template_actions.php */
2775
-        do_action('geodir_sidebar_left_open', 'author-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
2776
-        /**
2777
-         * This is used to add the content to the author page left sidebar (if active).
2778
-         *
2779
-         * @since 1.0.0
2780
-         */
2781
-        do_action('geodir_author_sidebar_left_inside');
2782
-        /** This action is documented in geodirectory_template_actions.php */
2783
-        do_action('geodir_sidebar_left_close', 'author-page');
2784
-    }
2774
+		/** This action is documented in geodirectory_template_actions.php */
2775
+		do_action('geodir_sidebar_left_open', 'author-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
2776
+		/**
2777
+		 * This is used to add the content to the author page left sidebar (if active).
2778
+		 *
2779
+		 * @since 1.0.0
2780
+		 */
2781
+		do_action('geodir_author_sidebar_left_inside');
2782
+		/** This action is documented in geodirectory_template_actions.php */
2783
+		do_action('geodir_sidebar_left_close', 'author-page');
2784
+	}
2785 2785
 }
2786 2786
 
2787 2787
 /**
@@ -2794,7 +2794,7 @@  discard block
 block discarded – undo
2794 2794
  */
2795 2795
 function geodir_author_right_section()
2796 2796
 {
2797
-    if (get_option('geodir_show_author_right_section')) { ?>
2797
+	if (get_option('geodir_show_author_right_section')) { ?>
2798 2798
         <div class="geodir-content-right geodir-sidebar-wrap">
2799 2799
             <?php dynamic_sidebar('geodir_author_right_sidebar'); ?>
2800 2800
         </div><!-- end geodir-content-right -->
@@ -2814,18 +2814,18 @@  discard block
 block discarded – undo
2814 2814
  */
2815 2815
 function geodir_action_author_sidebar_right()
2816 2816
 {
2817
-    if (get_option('geodir_show_author_right_section')) {
2818
-        /** This action is documented in geodirectory_template_actions.php */
2819
-        do_action('geodir_sidebar_right_open', 'author-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
2820
-        /**
2821
-         * This is used to add the content to the author page right sidebar (if active).
2822
-         *
2823
-         * @since 1.0.0
2824
-         */
2825
-        do_action('geodir_author_sidebar_right_inside');
2826
-        /** This action is documented in geodirectory_template_actions.php */
2827
-        do_action('geodir_sidebar_right_close', 'author-page');
2828
-    }
2817
+	if (get_option('geodir_show_author_right_section')) {
2818
+		/** This action is documented in geodirectory_template_actions.php */
2819
+		do_action('geodir_sidebar_right_open', 'author-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
2820
+		/**
2821
+		 * This is used to add the content to the author page right sidebar (if active).
2822
+		 *
2823
+		 * @since 1.0.0
2824
+		 */
2825
+		do_action('geodir_author_sidebar_right_inside');
2826
+		/** This action is documented in geodirectory_template_actions.php */
2827
+		do_action('geodir_sidebar_right_close', 'author-page');
2828
+	}
2829 2829
 }
2830 2830
 
2831 2831
 /**
@@ -2837,14 +2837,14 @@  discard block
 block discarded – undo
2837 2837
  */
2838 2838
 function geodir_action_author_content_inside()
2839 2839
 {
2840
-    global $gridview_columns;
2841
-    $listing_view = get_option('geodir_author_view');
2842
-    if (strstr($listing_view, 'gridview')) {
2843
-        $gridview_columns = $listing_view;
2844
-        $listing_view_exp = explode('_', $listing_view);
2845
-        $listing_view = $listing_view_exp[0];
2846
-    }
2847
-    geodir_get_template_part('listing', 'listview');
2840
+	global $gridview_columns;
2841
+	$listing_view = get_option('geodir_author_view');
2842
+	if (strstr($listing_view, 'gridview')) {
2843
+		$gridview_columns = $listing_view;
2844
+		$listing_view_exp = explode('_', $listing_view);
2845
+		$listing_view = $listing_view_exp[0];
2846
+	}
2847
+	geodir_get_template_part('listing', 'listview');
2848 2848
 }
2849 2849
 
2850 2850
 add_action('geodir_author_content_inside', 'geodir_action_author_content_inside', 10);
@@ -2859,22 +2859,22 @@  discard block
 block discarded – undo
2859 2859
  */
2860 2860
 function geodir_action_author_content()
2861 2861
 {
2862
-    /** This action is documented in geodirectory_template_actions.php */
2863
-    do_action('geodir_main_content_open', 'author-page', 'geodir-main-content', 'author-page');
2864
-    echo '<div class="clearfix">';
2865
-    /** This action is documented in geodirectory_template_actions.php */
2866
-    do_action('geodir_before_listing');
2867
-    echo '</div>';
2868
-    /**
2869
-     * This is used to add the content to the author page main content.
2870
-     *
2871
-     * @since 1.0.0
2872
-     */
2873
-    do_action('geodir_author_content_inside');
2874
-    /** This action is documented in geodirectory_template_actions.php */
2875
-    do_action('geodir_after_listing');
2876
-    /** This action is documented in geodirectory_template_actions.php */
2877
-    do_action('geodir_main_content_close', 'author-page');
2862
+	/** This action is documented in geodirectory_template_actions.php */
2863
+	do_action('geodir_main_content_open', 'author-page', 'geodir-main-content', 'author-page');
2864
+	echo '<div class="clearfix">';
2865
+	/** This action is documented in geodirectory_template_actions.php */
2866
+	do_action('geodir_before_listing');
2867
+	echo '</div>';
2868
+	/**
2869
+	 * This is used to add the content to the author page main content.
2870
+	 *
2871
+	 * @since 1.0.0
2872
+	 */
2873
+	do_action('geodir_author_content_inside');
2874
+	/** This action is documented in geodirectory_template_actions.php */
2875
+	do_action('geodir_after_listing');
2876
+	/** This action is documented in geodirectory_template_actions.php */
2877
+	do_action('geodir_main_content_close', 'author-page');
2878 2878
 }
2879 2879
 
2880 2880
 add_action('geodir_sidebar_author_bottom_section', 'geodir_action_sidebar_author_bottom_section', 10);
@@ -2888,11 +2888,11 @@  discard block
 block discarded – undo
2888 2888
  */
2889 2889
 function geodir_action_sidebar_author_bottom_section()
2890 2890
 {
2891
-    if (get_option('geodir_show_author_bottom_section')) { ?>
2891
+	if (get_option('geodir_show_author_bottom_section')) { ?>
2892 2892
         <div
2893 2893
             class="<?php
2894
-            /** This action is documented in geodirectory_template_actions.php */
2895
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_bottom'); ?>">
2894
+			/** This action is documented in geodirectory_template_actions.php */
2895
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_bottom'); ?>">
2896 2896
             <?php dynamic_sidebar('geodir_author_bottom'); ?>
2897 2897
         </div><!-- clearfix ends here-->
2898 2898
     <?php }
@@ -2911,23 +2911,23 @@  discard block
 block discarded – undo
2911 2911
  */
2912 2912
 function geodir_action_search_page_title()
2913 2913
 {
2914
-    $gd_post_type = geodir_get_current_posttype();
2915
-    $post_type_info = get_post_type_object($gd_post_type);
2914
+	$gd_post_type = geodir_get_current_posttype();
2915
+	$post_type_info = get_post_type_object($gd_post_type);
2916 2916
 
2917
-    $pt_name = '';
2918
-    if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;}
2917
+	$pt_name = '';
2918
+	if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;}
2919 2919
 
2920
-    if (is_search()) {
2921
-        $list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2920
+	if (is_search()) {
2921
+		$list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2922 2922
 
2923
-    }
2924
-    /** This action is documented in geodirectory_template_actions.php */
2925
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
2926
-    /** This action is documented in geodirectory_template_actions.php */
2927
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2928
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2929
-        /** This action is documented in geodirectory_template_actions.php */
2930
-        apply_filters('geodir_listing_page_title', wptexturize($list_title)) . '</h1></header>';
2923
+	}
2924
+	/** This action is documented in geodirectory_template_actions.php */
2925
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
2926
+	/** This action is documented in geodirectory_template_actions.php */
2927
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2928
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2929
+		/** This action is documented in geodirectory_template_actions.php */
2930
+		apply_filters('geodir_listing_page_title', wptexturize($list_title)) . '</h1></header>';
2931 2931
 }
2932 2932
 
2933 2933
 // action for adding the listings page top widget area
@@ -2943,11 +2943,11 @@  discard block
 block discarded – undo
2943 2943
  */
2944 2944
 function geodir_action_geodir_sidebar_search_top()
2945 2945
 {
2946
-    if (get_option('geodir_show_search_top_section')) { ?>
2946
+	if (get_option('geodir_show_search_top_section')) { ?>
2947 2947
         <div
2948 2948
             class="<?php
2949
-            /** This action is documented in geodirectory_template_actions.php */
2950
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_top'); ?>">
2949
+			/** This action is documented in geodirectory_template_actions.php */
2950
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_top'); ?>">
2951 2951
             <?php dynamic_sidebar('geodir_search_top'); ?>
2952 2952
         </div><!-- clearfix ends here-->
2953 2953
     <?php }
@@ -2963,7 +2963,7 @@  discard block
 block discarded – undo
2963 2963
  */
2964 2964
 function geodir_search_left_section()
2965 2965
 {
2966
-    if (get_option('geodir_show_search_left_section')) { ?>
2966
+	if (get_option('geodir_show_search_left_section')) { ?>
2967 2967
         <div class="geodir-content-left geodir-sidebar-wrap">
2968 2968
             <?php dynamic_sidebar('geodir_search_left_sidebar'); ?>
2969 2969
         </div><!-- end geodir-content-left -->
@@ -2983,19 +2983,19 @@  discard block
 block discarded – undo
2983 2983
  */
2984 2984
 function geodir_action_search_sidebar_left()
2985 2985
 {
2986
-    if (get_option('geodir_show_search_left_section')) {
2986
+	if (get_option('geodir_show_search_left_section')) {
2987 2987
 // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
2988
-        /** This action is documented in geodirectory_template_actions.php */
2989
-        do_action('geodir_sidebar_left_open', 'search-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
2990
-        /**
2991
-         * This is used to add the content to the search page left sidebar (if active).
2992
-         *
2993
-         * @since 1.0.0
2994
-         */
2995
-        do_action('geodir_search_sidebar_left_inside');
2996
-        /** This action is documented in geodirectory_template_actions.php */
2997
-        do_action('geodir_sidebar_left_close', 'search-page');
2998
-    }
2988
+		/** This action is documented in geodirectory_template_actions.php */
2989
+		do_action('geodir_sidebar_left_open', 'search-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
2990
+		/**
2991
+		 * This is used to add the content to the search page left sidebar (if active).
2992
+		 *
2993
+		 * @since 1.0.0
2994
+		 */
2995
+		do_action('geodir_search_sidebar_left_inside');
2996
+		/** This action is documented in geodirectory_template_actions.php */
2997
+		do_action('geodir_sidebar_left_close', 'search-page');
2998
+	}
2999 2999
 }
3000 3000
 
3001 3001
 /**
@@ -3008,7 +3008,7 @@  discard block
 block discarded – undo
3008 3008
  */
3009 3009
 function geodir_search_right_section()
3010 3010
 {
3011
-    if (get_option('geodir_show_search_right_section')) { ?>
3011
+	if (get_option('geodir_show_search_right_section')) { ?>
3012 3012
         <div class="geodir-content-right geodir-sidebar-wrap">
3013 3013
             <?php dynamic_sidebar('geodir_search_right_sidebar'); ?>
3014 3014
         </div><!-- end geodir-content-right -->
@@ -3028,18 +3028,18 @@  discard block
 block discarded – undo
3028 3028
  */
3029 3029
 function geodir_action_search_sidebar_right()
3030 3030
 {
3031
-    if (get_option('geodir_show_search_right_section')) {
3032
-        /** This action is documented in geodirectory_template_actions.php */
3033
-        do_action('geodir_sidebar_right_open', 'search-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3034
-        /**
3035
-         * This is used to add the content to the search page right sidebar (if active).
3036
-         *
3037
-         * @since 1.0.0
3038
-         */
3039
-        do_action('geodir_search_sidebar_right_inside');
3040
-        /** This action is documented in geodirectory_template_actions.php */
3041
-        do_action('geodir_sidebar_right_close', 'search-page');
3042
-    }
3031
+	if (get_option('geodir_show_search_right_section')) {
3032
+		/** This action is documented in geodirectory_template_actions.php */
3033
+		do_action('geodir_sidebar_right_open', 'search-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3034
+		/**
3035
+		 * This is used to add the content to the search page right sidebar (if active).
3036
+		 *
3037
+		 * @since 1.0.0
3038
+		 */
3039
+		do_action('geodir_search_sidebar_right_inside');
3040
+		/** This action is documented in geodirectory_template_actions.php */
3041
+		do_action('geodir_sidebar_right_close', 'search-page');
3042
+	}
3043 3043
 }
3044 3044
 
3045 3045
 
@@ -3054,11 +3054,11 @@  discard block
 block discarded – undo
3054 3054
  */
3055 3055
 function geodir_action_sidebar_search_bottom_section()
3056 3056
 {
3057
-    if (get_option('geodir_show_search_bottom_section')) { ?>
3057
+	if (get_option('geodir_show_search_bottom_section')) { ?>
3058 3058
         <div
3059 3059
             class="<?php
3060
-            /** This action is documented in geodirectory_template_actions.php */
3061
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_bottom'); ?>">
3060
+			/** This action is documented in geodirectory_template_actions.php */
3061
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_bottom'); ?>">
3062 3062
             <?php dynamic_sidebar('geodir_search_bottom'); ?>
3063 3063
         </div><!-- clearfix ends here-->
3064 3064
     <?php }
@@ -3073,14 +3073,14 @@  discard block
 block discarded – undo
3073 3073
  */
3074 3074
 function geodir_action_search_content_inside()
3075 3075
 {
3076
-    global $gridview_columns;
3077
-    $listing_view = get_option('geodir_search_view');
3078
-    if (strstr($listing_view, 'gridview')) {
3079
-        $gridview_columns = $listing_view;
3080
-        $listing_view_exp = explode('_', $listing_view);
3081
-        $listing_view = $listing_view_exp[0];
3082
-    }
3083
-    geodir_get_template_part('listing', 'listview');
3076
+	global $gridview_columns;
3077
+	$listing_view = get_option('geodir_search_view');
3078
+	if (strstr($listing_view, 'gridview')) {
3079
+		$gridview_columns = $listing_view;
3080
+		$listing_view_exp = explode('_', $listing_view);
3081
+		$listing_view = $listing_view_exp[0];
3082
+	}
3083
+	geodir_get_template_part('listing', 'listview');
3084 3084
 }
3085 3085
 
3086 3086
 add_action('geodir_search_content_inside', 'geodir_action_search_content_inside', 10);
@@ -3096,22 +3096,22 @@  discard block
 block discarded – undo
3096 3096
  */
3097 3097
 function geodir_action_search_content()
3098 3098
 {
3099
-    /** This action is documented in geodirectory_template_actions.php */
3100
-    do_action('geodir_main_content_open', 'search-page', 'geodir-main-content', 'search-page');
3101
-    echo '<div class="clearfix">';
3102
-    /** This action is documented in geodirectory_template_actions.php */
3103
-    do_action('geodir_before_listing');
3104
-    echo '</div>';
3105
-    /**
3106
-     * This is used to add the content to the search page main content.
3107
-     *
3108
-     * @since 1.0.0
3109
-     */
3110
-    do_action('geodir_search_content_inside');
3111
-    /** This action is documented in geodirectory_template_actions.php */
3112
-    do_action('geodir_after_listing');
3113
-    /** This action is documented in geodirectory_template_actions.php */
3114
-    do_action('geodir_main_content_close', 'search-page');
3099
+	/** This action is documented in geodirectory_template_actions.php */
3100
+	do_action('geodir_main_content_open', 'search-page', 'geodir-main-content', 'search-page');
3101
+	echo '<div class="clearfix">';
3102
+	/** This action is documented in geodirectory_template_actions.php */
3103
+	do_action('geodir_before_listing');
3104
+	echo '</div>';
3105
+	/**
3106
+	 * This is used to add the content to the search page main content.
3107
+	 *
3108
+	 * @since 1.0.0
3109
+	 */
3110
+	do_action('geodir_search_content_inside');
3111
+	/** This action is documented in geodirectory_template_actions.php */
3112
+	do_action('geodir_after_listing');
3113
+	/** This action is documented in geodirectory_template_actions.php */
3114
+	do_action('geodir_main_content_close', 'search-page');
3115 3115
 }
3116 3116
 
3117 3117
 ###############################################
@@ -3134,11 +3134,11 @@  discard block
 block discarded – undo
3134 3134
  */
3135 3135
 function geodir_action_geodir_sidebar_home_top()
3136 3136
 {
3137
-    if (get_option('geodir_show_home_top_section')) { ?>
3137
+	if (get_option('geodir_show_home_top_section')) { ?>
3138 3138
         <div
3139 3139
             class="<?php
3140
-            /** This action is documented in geodirectory_template_actions.php */
3141
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_top'); ?>">
3140
+			/** This action is documented in geodirectory_template_actions.php */
3141
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_top'); ?>">
3142 3142
             <?php dynamic_sidebar('geodir_home_top'); ?>
3143 3143
         </div><!-- clearfix ends here-->
3144 3144
     <?php }
@@ -3154,7 +3154,7 @@  discard block
 block discarded – undo
3154 3154
  */
3155 3155
 function geodir_home_left_section()
3156 3156
 {
3157
-    if (get_option('geodir_show_home_left_section')) { ?>
3157
+	if (get_option('geodir_show_home_left_section')) { ?>
3158 3158
         <div class="geodir-content-left geodir-sidebar-wrap">
3159 3159
             <?php dynamic_sidebar('geodir_home_left'); ?>
3160 3160
         </div><!-- end geodir-content-left -->
@@ -3176,19 +3176,19 @@  discard block
 block discarded – undo
3176 3176
  */
3177 3177
 function geodir_action_home_sidebar_left()
3178 3178
 {
3179
-    if (get_option('geodir_show_home_left_section')) {
3179
+	if (get_option('geodir_show_home_left_section')) {
3180 3180
 // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
3181
-        /** This action is documented in geodirectory_template_actions.php */
3182
-        do_action('geodir_sidebar_left_open', 'home-page', 'geodir-sidebar-left', 'geodir-sidebar geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3183
-        /**
3184
-         * This is used to add the content to the home page left sidebar (if active).
3185
-         *
3186
-         * @since 1.0.0
3187
-         */
3188
-        do_action('geodir_home_sidebar_left_inside');
3189
-        /** This action is documented in geodirectory_template_actions.php */
3190
-        do_action('geodir_sidebar_left_close', 'home-page');
3191
-    }
3181
+		/** This action is documented in geodirectory_template_actions.php */
3182
+		do_action('geodir_sidebar_left_open', 'home-page', 'geodir-sidebar-left', 'geodir-sidebar geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3183
+		/**
3184
+		 * This is used to add the content to the home page left sidebar (if active).
3185
+		 *
3186
+		 * @since 1.0.0
3187
+		 */
3188
+		do_action('geodir_home_sidebar_left_inside');
3189
+		/** This action is documented in geodirectory_template_actions.php */
3190
+		do_action('geodir_sidebar_left_close', 'home-page');
3191
+	}
3192 3192
 }
3193 3193
 
3194 3194
 /**
@@ -3201,7 +3201,7 @@  discard block
 block discarded – undo
3201 3201
  */
3202 3202
 function geodir_home_right_section()
3203 3203
 {
3204
-    if (get_option('geodir_show_home_right_section')) { ?>
3204
+	if (get_option('geodir_show_home_right_section')) { ?>
3205 3205
         <div class="geodir-content-right geodir-sidebar-wrap">
3206 3206
             <?php dynamic_sidebar('geodir_home_right'); ?>
3207 3207
         </div><!-- end geodir-content-right -->
@@ -3222,18 +3222,18 @@  discard block
 block discarded – undo
3222 3222
  */
3223 3223
 function geodir_action_home_sidebar_right()
3224 3224
 {
3225
-    if (get_option('geodir_show_home_right_section')) {
3226
-        /** This action is documented in geodirectory_template_actions.php */
3227
-        do_action('geodir_sidebar_right_open', 'home-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3228
-        /**
3229
-         * This is used to add the content to the home page right sidebar (if active).
3230
-         *
3231
-         * @since 1.0.0
3232
-         */
3233
-        do_action('geodir_home_sidebar_right_inside');
3234
-        /** This action is documented in geodirectory_template_actions.php */
3235
-        do_action('geodir_sidebar_right_close', 'home-page');
3236
-    }
3225
+	if (get_option('geodir_show_home_right_section')) {
3226
+		/** This action is documented in geodirectory_template_actions.php */
3227
+		do_action('geodir_sidebar_right_open', 'home-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3228
+		/**
3229
+		 * This is used to add the content to the home page right sidebar (if active).
3230
+		 *
3231
+		 * @since 1.0.0
3232
+		 */
3233
+		do_action('geodir_home_sidebar_right_inside');
3234
+		/** This action is documented in geodirectory_template_actions.php */
3235
+		do_action('geodir_sidebar_right_close', 'home-page');
3236
+	}
3237 3237
 }
3238 3238
 
3239 3239
 /**
@@ -3244,7 +3244,7 @@  discard block
 block discarded – undo
3244 3244
  */
3245 3245
 function geodir_action_home_content_inside()
3246 3246
 {
3247
-    dynamic_sidebar('geodir_home_content');
3247
+	dynamic_sidebar('geodir_home_content');
3248 3248
 }
3249 3249
 
3250 3250
 add_action('geodir_home_content_inside', 'geodir_action_home_content_inside', 10);
@@ -3259,28 +3259,28 @@  discard block
 block discarded – undo
3259 3259
  */
3260 3260
 function geodir_action_home_content()
3261 3261
 {
3262
-    /** This action is documented in geodirectory_template_actions.php */
3263
-    do_action('geodir_main_content_open', 'home-page', 'geodir-main-content', 'home-page');
3264
-    /**
3265
-     * This called before the home page main content.
3266
-     *
3267
-     * @since 1.0.0
3268
-     */
3269
-    do_action('geodir_before_home_content');
3270
-    /**
3271
-     * This is used to add the content to the home page main content.
3272
-     *
3273
-     * @since 1.0.0
3274
-     */
3275
-    do_action('geodir_home_content_inside');
3276
-    /**
3277
-     * This is called after the homepage main content.
3278
-     *
3279
-     * @since 1.0.0
3280
-     */
3281
-    do_action('geodir_after_home_content');
3282
-    /** This action is documented in geodirectory_template_actions.php */
3283
-    do_action('geodir_main_content_close', 'home-page');
3262
+	/** This action is documented in geodirectory_template_actions.php */
3263
+	do_action('geodir_main_content_open', 'home-page', 'geodir-main-content', 'home-page');
3264
+	/**
3265
+	 * This called before the home page main content.
3266
+	 *
3267
+	 * @since 1.0.0
3268
+	 */
3269
+	do_action('geodir_before_home_content');
3270
+	/**
3271
+	 * This is used to add the content to the home page main content.
3272
+	 *
3273
+	 * @since 1.0.0
3274
+	 */
3275
+	do_action('geodir_home_content_inside');
3276
+	/**
3277
+	 * This is called after the homepage main content.
3278
+	 *
3279
+	 * @since 1.0.0
3280
+	 */
3281
+	do_action('geodir_after_home_content');
3282
+	/** This action is documented in geodirectory_template_actions.php */
3283
+	do_action('geodir_main_content_close', 'home-page');
3284 3284
 }
3285 3285
 
3286 3286
 add_action('geodir_sidebar_location_bottom_section', 'geodir_action_sidebar_home_bottom_section', 10);
@@ -3295,11 +3295,11 @@  discard block
 block discarded – undo
3295 3295
  */
3296 3296
 function geodir_action_sidebar_home_bottom_section()
3297 3297
 {
3298
-    if (get_option('geodir_show_home_bottom_section')) { ?>
3298
+	if (get_option('geodir_show_home_bottom_section')) { ?>
3299 3299
         <div
3300 3300
             class="<?php
3301
-            /** This action is documented in geodirectory_template_actions.php */
3302
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_bottom'); ?>">
3301
+			/** This action is documented in geodirectory_template_actions.php */
3302
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_bottom'); ?>">
3303 3303
             <?php dynamic_sidebar('geodir_home_bottom'); ?>
3304 3304
         </div><!-- clearfix ends here-->
3305 3305
     <?php }
@@ -3327,13 +3327,13 @@  discard block
 block discarded – undo
3327 3327
  */
3328 3328
 function geodir_filter_listing_page_title($list_title)
3329 3329
 {
3330
-    if (is_search() && trim(get_search_query()) == '') {
3331
-        $gd_post_type = geodir_get_current_posttype();
3332
-        $post_type_info = get_post_type_object($gd_post_type);
3330
+	if (is_search() && trim(get_search_query()) == '') {
3331
+		$gd_post_type = geodir_get_current_posttype();
3332
+		$post_type_info = get_post_type_object($gd_post_type);
3333 3333
 
3334
-        $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' :', 'geodirectory');
3335
-    }
3336
-    return $list_title;
3334
+		$list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' :', 'geodirectory');
3335
+	}
3336
+	return $list_title;
3337 3337
 }
3338 3338
 
3339 3339
 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
Indentation   +502 added lines, -502 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Contains all function for filtering listing.
4
- *
5
- * @since 1.0.0
6
- * @package GeoDirectory
7
- */
3
+	 * Contains all function for filtering listing.
4
+	 *
5
+	 * @since 1.0.0
6
+	 * @package GeoDirectory
7
+	 */
8 8
  
9 9
 /**
10 10
  * Starts session if not started.
@@ -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,64 +230,64 @@  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);
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 273
 					$count++;
274
-                    if ($count < count($keywords)) {
275
-                       // $gd_titlematch_part .= $wpdb->posts . ".post_title LIKE '%%" . $keyword . "%%' " . $key . " ";
274
+					if ($count < count($keywords)) {
275
+					   // $gd_titlematch_part .= $wpdb->posts . ".post_title LIKE '%%" . $keyword . "%%' " . $key . " ";
276 276
 						$gd_titlematch_part .= "( " . $wpdb->posts . ".post_title LIKE '" . $keyword . "' OR " . $wpdb->posts . ".post_title LIKE '" . $keyword . "%%' OR " . $wpdb->posts . ".post_title LIKE '%% " . $keyword . "%%' ) " . $key . " ";
277
-                    } else {
278
-                        //$gd_titlematch_part .= $wpdb->posts . ".post_title LIKE '%%" . $keyword . "%%' ";
277
+					} else {
278
+						//$gd_titlematch_part .= $wpdb->posts . ".post_title LIKE '%%" . $keyword . "%%' ";
279 279
 						$gd_titlematch_part .= "( " . $wpdb->posts . ".post_title LIKE '" . $keyword . "' OR " . $wpdb->posts . ".post_title LIKE '" . $keyword . "%%' OR " . $wpdb->posts . ".post_title LIKE '%% " . $keyword . "%%' ) ";
280
-                    }
281
-                }
282
-                $gd_titlematch_part .= "THEN 1 ELSE 0 END AS " . $part . ",";
283
-            }
284
-        } else {
285
-            $gd_titlematch_part = "";
286
-        }
287
-        //$fields .= $wpdb->prepare(", CASE WHEN " . $table . ".is_featured='1' THEN 1 ELSE 0 END AS gd_featured, CASE WHEN " . $wpdb->posts . ".post_title=%s THEN 1 ELSE 0 END AS gd_exacttitle," . $gd_titlematch_part . " CASE WHEN " . $wpdb->posts . ".post_title LIKE %s THEN 1 ELSE 0 END AS gd_titlematch, CASE WHEN " . $wpdb->posts . ".post_content LIKE %s THEN 1 ELSE 0 END AS gd_content", array($s, '%' . $s . '%', '%' . $s . '%'));
280
+					}
281
+				}
282
+				$gd_titlematch_part .= "THEN 1 ELSE 0 END AS " . $part . ",";
283
+			}
284
+		} else {
285
+			$gd_titlematch_part = "";
286
+		}
287
+		//$fields .= $wpdb->prepare(", CASE WHEN " . $table . ".is_featured='1' THEN 1 ELSE 0 END AS gd_featured, CASE WHEN " . $wpdb->posts . ".post_title=%s THEN 1 ELSE 0 END AS gd_exacttitle," . $gd_titlematch_part . " CASE WHEN " . $wpdb->posts . ".post_title LIKE %s THEN 1 ELSE 0 END AS gd_titlematch, CASE WHEN " . $wpdb->posts . ".post_content LIKE %s THEN 1 ELSE 0 END AS gd_content", array($s, '%' . $s . '%', '%' . $s . '%'));
288 288
 		$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));
289
-    }
290
-    return $fields;
289
+	}
290
+	return $fields;
291 291
 }
292 292
 
293 293
 
@@ -304,26 +304,26 @@  discard block
 block discarded – undo
304 304
  */
305 305
 function geodir_posts_join($join)
306 306
 {
307
-    global $wpdb, $geodir_post_type, $table, $table_prefix, $plugin_prefix;
307
+	global $wpdb, $geodir_post_type, $table, $table_prefix, $plugin_prefix;
308 308
 
309
-    ########### WPML ###########
309
+	########### WPML ###########
310 310
 
311
-    if (function_exists('icl_object_id')) {
312
-        global $sitepress;
313
-        $lang_code = ICL_LANGUAGE_CODE;
314
-        $default_lang_code = $sitepress->get_default_language();
315
-        if ($lang_code) {
316
-            $join .= "JOIN " . $table_prefix . "icl_translations icl_t ON icl_t.element_id = " . $table_prefix . "posts.ID";
317
-        }
311
+	if (function_exists('icl_object_id')) {
312
+		global $sitepress;
313
+		$lang_code = ICL_LANGUAGE_CODE;
314
+		$default_lang_code = $sitepress->get_default_language();
315
+		if ($lang_code) {
316
+			$join .= "JOIN " . $table_prefix . "icl_translations icl_t ON icl_t.element_id = " . $table_prefix . "posts.ID";
317
+		}
318 318
 
319
-    }
320
-    ########### WPML ###########
319
+	}
320
+	########### WPML ###########
321 321
 
322
-    $join .= " INNER JOIN " . $table . " ON (" . $table . ".post_id = $wpdb->posts.ID)  ";
323
-    //===old code start
324
-    //$join .= " INNER JOIN ".POST_LOCATION_TABLE." ON (".$table.".post_location_id = ".POST_LOCATION_TABLE.".location_id)  " ;//===old code end
322
+	$join .= " INNER JOIN " . $table . " ON (" . $table . ".post_id = $wpdb->posts.ID)  ";
323
+	//===old code start
324
+	//$join .= " INNER JOIN ".POST_LOCATION_TABLE." ON (".$table.".post_location_id = ".POST_LOCATION_TABLE.".location_id)  " ;//===old code end
325 325
 
326
-    return $join;
326
+	return $join;
327 327
 }
328 328
 
329 329
 
@@ -341,15 +341,15 @@  discard block
 block discarded – undo
341 341
  */
342 342
 function geodir_posts_orderby($orderby)
343 343
 {
344
-    global $wpdb, $wp_query, $geodir_post_type, $table, $plugin_prefix, $snear, $default_sort;
344
+	global $wpdb, $wp_query, $geodir_post_type, $table, $plugin_prefix, $snear, $default_sort;
345 345
 
346
-    $sort_by = '';
347
-    $orderby = ' ';
346
+	$sort_by = '';
347
+	$orderby = ' ';
348 348
 
349
-    if (get_query_var('order_by'))
350
-        $sort_by = get_query_var('order_by');
349
+	if (get_query_var('order_by'))
350
+		$sort_by = get_query_var('order_by');
351 351
 
352
-    /*if(isset($wp_query->tax_query->queries) && $wp_query->tax_query->queries){
352
+	/*if(isset($wp_query->tax_query->queries) && $wp_query->tax_query->queries){
353 353
         $current_term = $wp_query->get_queried_object();
354 354
     }
355 355
 
@@ -363,116 +363,116 @@  discard block
 block discarded – undo
363 363
     }*/
364 364
 
365 365
 
366
-    if ($snear != '') {
367
-        $orderby .= " distance,";
368
-    }
366
+	if ($snear != '') {
367
+		$orderby .= " distance,";
368
+	}
369 369
 
370
-    if (isset($_REQUEST['sort_by']) && $_REQUEST['sort_by'] != '' && is_main_query())
371
-        $sort_by = esc_attr($_REQUEST['sort_by']);
370
+	if (isset($_REQUEST['sort_by']) && $_REQUEST['sort_by'] != '' && is_main_query())
371
+		$sort_by = esc_attr($_REQUEST['sort_by']);
372 372
 
373 373
 
374
-    if ($sort_by == '') {
375
-        $default_sort = geodir_get_posts_default_sort($geodir_post_type);
376
-        if (!empty($default_sort))
377
-            $sort_by = $default_sort;
378
-    }
374
+	if ($sort_by == '') {
375
+		$default_sort = geodir_get_posts_default_sort($geodir_post_type);
376
+		if (!empty($default_sort))
377
+			$sort_by = $default_sort;
378
+	}
379 379
 
380
-    /*
380
+	/*
381 381
     if search by term & no location then order always "relevance"
382 382
     if search by location then order always "nearest"
383 383
     */
384
-    if (is_main_query() && geodir_is_page('search')) {
385
-        $search_term = get_query_var('s');
384
+	if (is_main_query() && geodir_is_page('search')) {
385
+		$search_term = get_query_var('s');
386 386
 
387
-        if (trim($search_term) != '' && !isset($_REQUEST['sort_by'])) {
388
-            $sort_by = 'az';
389
-        }
387
+		if (trim($search_term) != '' && !isset($_REQUEST['sort_by'])) {
388
+			$sort_by = 'az';
389
+		}
390 390
 
391
-        if ($snear != '') {
392
-            $sort_by = 'nearest';
393
-        }
394
-    }
391
+		if ($snear != '') {
392
+			$sort_by = 'nearest';
393
+		}
394
+	}
395 395
 
396
-    switch ($sort_by):
397
-        case 'newest':
398
-            $orderby = "$wpdb->posts.post_date desc, ";
399
-            break;
400
-        case 'oldest':
401
-            $orderby = "$wpdb->posts.post_date asc, ";
402
-            break;
403
-        case 'low_review':
404
-        case 'rating_count_asc':
405
-            $orderby = $table . ".rating_count ASC, " . $table . ".overall_rating ASC, ";
406
-            break;
407
-        case 'high_review':
408
-        case 'rating_count_desc':
396
+	switch ($sort_by):
397
+		case 'newest':
398
+			$orderby = "$wpdb->posts.post_date desc, ";
399
+			break;
400
+		case 'oldest':
401
+			$orderby = "$wpdb->posts.post_date asc, ";
402
+			break;
403
+		case 'low_review':
404
+		case 'rating_count_asc':
405
+			$orderby = $table . ".rating_count ASC, " . $table . ".overall_rating ASC, ";
406
+			break;
407
+		case 'high_review':
408
+		case 'rating_count_desc':
409 409
 			$orderby = $table . ".rating_count DESC, " . $table . ".overall_rating DESC, ";
410
-            break;
411
-        case 'low_rating':
412
-            $orderby = "( " . $table . ".overall_rating  ) ASC, " . $table . ".rating_count ASC,  ";
413
-            break;
414
-        case 'high_rating':
415
-            $orderby = " " . $table . ".overall_rating DESC, " . $table . ".rating_count DESC, ";
416
-            break;
417
-        case 'featured':
418
-            $orderby = $table . ".is_featured asc, ";
419
-            break;
420
-        case 'nearest':
421
-            $orderby = " distance asc, ";
422
-            break;
423
-        case 'farthest':
424
-            $orderby = " distance desc, ";
425
-            break;
426
-        case 'random':
427
-            $orderby = " rand(), ";
428
-            break;
429
-        case 'az':
430
-            $orderby = "$wpdb->posts.post_title asc, ";
431
-            break;
432
-        default:
433
-
434
-            break;
435
-    endswitch;
436
-
437
-    global $s;
438
-
439
-    if (is_search() && isset($_REQUEST['geodir_search']) && $s && trim($s) != '') {
440
-        $keywords = explode(" ", $s);
441
-        if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
442
-            foreach($keywords as $kkey=>$kword){
443
-                if(mb_strlen($kword, 'UTF-8')<=$klimit){
444
-                    unset($keywords[$kkey]);
445
-                }
446
-            }
447
-        }
448
-        if ($sort_by == 'nearest' || $sort_by == 'farthest') {
449
-            if (count($keywords) > 1) {
450
-                $orderby = $orderby . " ( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_alltitlematch_part * 100 + gd_titlematch_part * 50 + gd_content * 1.5) DESC, ";
451
-            } else {
452
-                $orderby = $orderby . " ( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_content * 1.5) DESC, ";
453
-            }
454
-        } else {
455
-            if (count($keywords) > 1) {
456
-                $orderby = "( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_alltitlematch_part * 100 + gd_titlematch_part * 50 + gd_content * 1.5) DESC, " . $orderby;
457
-            } else {
458
-                $orderby = "( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_content * 1.5) DESC, " . $orderby;
459
-            }
460
-        }
461
-    }
410
+			break;
411
+		case 'low_rating':
412
+			$orderby = "( " . $table . ".overall_rating  ) ASC, " . $table . ".rating_count ASC,  ";
413
+			break;
414
+		case 'high_rating':
415
+			$orderby = " " . $table . ".overall_rating DESC, " . $table . ".rating_count DESC, ";
416
+			break;
417
+		case 'featured':
418
+			$orderby = $table . ".is_featured asc, ";
419
+			break;
420
+		case 'nearest':
421
+			$orderby = " distance asc, ";
422
+			break;
423
+		case 'farthest':
424
+			$orderby = " distance desc, ";
425
+			break;
426
+		case 'random':
427
+			$orderby = " rand(), ";
428
+			break;
429
+		case 'az':
430
+			$orderby = "$wpdb->posts.post_title asc, ";
431
+			break;
432
+		default:
433
+
434
+			break;
435
+	endswitch;
436
+
437
+	global $s;
438
+
439
+	if (is_search() && isset($_REQUEST['geodir_search']) && $s && trim($s) != '') {
440
+		$keywords = explode(" ", $s);
441
+		if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
442
+			foreach($keywords as $kkey=>$kword){
443
+				if(mb_strlen($kword, 'UTF-8')<=$klimit){
444
+					unset($keywords[$kkey]);
445
+				}
446
+			}
447
+		}
448
+		if ($sort_by == 'nearest' || $sort_by == 'farthest') {
449
+			if (count($keywords) > 1) {
450
+				$orderby = $orderby . " ( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_alltitlematch_part * 100 + gd_titlematch_part * 50 + gd_content * 1.5) DESC, ";
451
+			} else {
452
+				$orderby = $orderby . " ( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_content * 1.5) DESC, ";
453
+			}
454
+		} else {
455
+			if (count($keywords) > 1) {
456
+				$orderby = "( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_alltitlematch_part * 100 + gd_titlematch_part * 50 + gd_content * 1.5) DESC, " . $orderby;
457
+			} else {
458
+				$orderby = "( gd_titlematch * 2 + gd_featured * 5 + gd_exacttitle * 10 + gd_content * 1.5) DESC, " . $orderby;
459
+			}
460
+		}
461
+	}
462 462
 
463
-    /**
464
-     * Filter order by SQL.
465
-     *
466
-     * @since 1.0.0
467
-     * @param string $orderby The orderby query string.
468
-     * @param string $sort_by Sortby query string.
469
-     * @param string $table Listing table name.
470
-     */
471
-    $orderby = apply_filters('geodir_posts_order_by_sort', $orderby, $sort_by, $table);
463
+	/**
464
+	 * Filter order by SQL.
465
+	 *
466
+	 * @since 1.0.0
467
+	 * @param string $orderby The orderby query string.
468
+	 * @param string $sort_by Sortby query string.
469
+	 * @param string $table Listing table name.
470
+	 */
471
+	$orderby = apply_filters('geodir_posts_order_by_sort', $orderby, $sort_by, $table);
472 472
 
473
-    $orderby .= $table . ".is_featured asc, $wpdb->posts.post_date desc, $wpdb->posts.post_title ";
473
+	$orderby .= $table . ".is_featured asc, $wpdb->posts.post_date desc, $wpdb->posts.post_title ";
474 474
 
475
-    return $orderby;
475
+	return $orderby;
476 476
 }
477 477
 
478 478
 
@@ -490,53 +490,53 @@  discard block
 block discarded – undo
490 490
 function geodir_posts_order_by_custom_sort($orderby, $sort_by, $table)
491 491
 {
492 492
 
493
-    global $wpdb;
493
+	global $wpdb;
494 494
 
495
-    if ($sort_by != '' && !is_search()) {
495
+	if ($sort_by != '' && !is_search()) {
496 496
 
497
-        $sort_array = explode('_', $sort_by);
497
+		$sort_array = explode('_', $sort_by);
498 498
 
499
-        $sort_by_count = count($sort_array);
499
+		$sort_by_count = count($sort_array);
500 500
 
501
-        $order = $sort_array[$sort_by_count - 1];
501
+		$order = $sort_array[$sort_by_count - 1];
502 502
 
503
-        if ($sort_by_count > 1 && ($order == 'asc' || $order == 'desc')) {
503
+		if ($sort_by_count > 1 && ($order == 'asc' || $order == 'desc')) {
504 504
 
505
-            $sort_by = str_replace('_' . $order, '', $sort_by);
505
+			$sort_by = str_replace('_' . $order, '', $sort_by);
506 506
 
507
-            switch ($sort_by):
507
+			switch ($sort_by):
508 508
 
509
-                case 'post_date':
510
-                case 'comment_count':
509
+				case 'post_date':
510
+				case 'comment_count':
511 511
 
512
-                    $orderby = "$wpdb->posts." . $sort_by . " " . $order . ", ".$table . ".overall_rating " . $order . ", ";
513
-                    break;
512
+					$orderby = "$wpdb->posts." . $sort_by . " " . $order . ", ".$table . ".overall_rating " . $order . ", ";
513
+					break;
514 514
 
515
-                case 'distance':
516
-                    $orderby = $sort_by . " " . $order . ", ";
517
-                    break;
515
+				case 'distance':
516
+					$orderby = $sort_by . " " . $order . ", ";
517
+					break;
518 518
 
519 519
 
520
-                // sort by rating
521
-                case 'overall_rating':
522
-                    $orderby = " " . $table . "." . $sort_by . "  " . $order . ", " . $table . ".rating_count " . $order . ", ";
520
+				// sort by rating
521
+				case 'overall_rating':
522
+					$orderby = " " . $table . "." . $sort_by . "  " . $order . ", " . $table . ".rating_count " . $order . ", ";
523 523
 
524
-                    break;
524
+					break;
525 525
 
526 526
 
527
-                default:
528
-                    if (geodir_column_exist($table, $sort_by)) {
527
+				default:
528
+					if (geodir_column_exist($table, $sort_by)) {
529 529
 						$orderby = $table . "." . $sort_by . " " . $order . ", ";
530 530
 					}
531
-                    break;
531
+					break;
532 532
 
533
-            endswitch;
533
+			endswitch;
534 534
 
535
-        }
535
+		}
536 536
 
537
-    }
537
+	}
538 538
 
539
-    return $orderby;
539
+	return $orderby;
540 540
 }
541 541
 
542 542
 /**
@@ -551,34 +551,34 @@  discard block
 block discarded – undo
551 551
 {
552 552
 
553 553
 
554
-    global $wpdb, $geodir_post_type, $table, $s, $snear;
554
+	global $wpdb, $geodir_post_type, $table, $s, $snear;
555 555
 
556
-    if (!is_admin()) {
556
+	if (!is_admin()) {
557 557
 
558
-        if (geodir_is_page('add-listing') && isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
559
-            add_filter('posts_where', 'geodir_edit_listing_where', 1);
558
+		if (geodir_is_page('add-listing') && isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
559
+			add_filter('posts_where', 'geodir_edit_listing_where', 1);
560 560
 
561
-        } elseif ((is_search() && $_REQUEST['geodir_search'])) {
561
+		} elseif ((is_search() && $_REQUEST['geodir_search'])) {
562 562
 
563
-            add_filter('posts_where', 'searching_filter_where', 1);
563
+			add_filter('posts_where', 'searching_filter_where', 1);
564 564
 
565
-            if ($snear != '')
566
-                add_filter('posts_where', 'searching_filter_where', 1);
565
+			if ($snear != '')
566
+				add_filter('posts_where', 'searching_filter_where', 1);
567 567
 
568
-            add_filter('posts_orderby', 'geodir_posts_orderby', 1);
568
+			add_filter('posts_orderby', 'geodir_posts_orderby', 1);
569 569
 
570
-        } elseif (geodir_is_page('author')) {
570
+		} elseif (geodir_is_page('author')) {
571 571
 
572
-            add_filter('posts_where', 'author_filter_where', 1);
572
+			add_filter('posts_where', 'author_filter_where', 1);
573 573
 
574
-        }
574
+		}
575 575
 
576
-        //if (!geodir_is_page('detail'))
577
-            add_filter('posts_where', 'geodir_default_where', 1);/**/
576
+		//if (!geodir_is_page('detail'))
577
+			add_filter('posts_where', 'geodir_default_where', 1);/**/
578 578
 
579
-        //add_filter( 'user_has_cap', 'geodir_preview_post_cap', 10, 3 );// let subscribers edit their own posts
579
+		//add_filter( 'user_has_cap', 'geodir_preview_post_cap', 10, 3 );// let subscribers edit their own posts
580 580
 
581
-    }
581
+	}
582 582
 }
583 583
 
584 584
 /**
@@ -593,13 +593,13 @@  discard block
 block discarded – undo
593 593
  */
594 594
 function geodir_preview_post_cap($allcaps, $caps, $args)
595 595
 {
596
-    $user_id = get_current_user_id();
597
-    if ($user_id && isset($_REQUEST['post_type']) && $_REQUEST['post_type'] != '' && isset($_REQUEST['p']) && $_REQUEST['p'] != '' && $args[0] == 'edit_post' && $_REQUEST['p'] == $args[2]) {
596
+	$user_id = get_current_user_id();
597
+	if ($user_id && isset($_REQUEST['post_type']) && $_REQUEST['post_type'] != '' && isset($_REQUEST['p']) && $_REQUEST['p'] != '' && $args[0] == 'edit_post' && $_REQUEST['p'] == $args[2]) {
598 598
 
599
-        $allcaps['edit_posts'] = true;
600
-    }
601
-    //print_r($allcaps);
602
-    return $allcaps;
599
+		$allcaps['edit_posts'] = true;
600
+	}
601
+	//print_r($allcaps);
602
+	return $allcaps;
603 603
 }
604 604
 
605 605
 
@@ -614,9 +614,9 @@  discard block
 block discarded – undo
614 614
  */
615 615
 function geodir_edit_listing_where($where)
616 616
 {
617
-    global $wpdb;
618
-    $where = $wpdb->prepare(" AND $wpdb->posts.ID = %d ", $_REQUEST['pid']);
619
-    return $where;
617
+	global $wpdb;
618
+	$where = $wpdb->prepare(" AND $wpdb->posts.ID = %d ", $_REQUEST['pid']);
619
+	return $where;
620 620
 }
621 621
 
622 622
 
@@ -633,29 +633,29 @@  discard block
 block discarded – undo
633 633
  */
634 634
 function geodir_default_where($where)
635 635
 {
636
-    global $wp_query, $wpdb;
637
-
638
-    //print_r($wp_query);
639
-    ########### WPML ###########
640
-
641
-    if (function_exists('icl_object_id')) {
642
-        global $sitepress, $table_prefix;
643
-        $lang_code = ICL_LANGUAGE_CODE;
644
-        $default_lang_code = $sitepress->get_default_language();
645
-        $q_post_type = isset($wp_query->query['post_type']) ? $wp_query->query['post_type'] : '';
646
-        //echo '##########'.$q_post_type;
647
-        if ($lang_code && $q_post_type) {
648
-            $where .= " AND icl_t.language_code = '$lang_code' AND icl_t.element_type IN('post_" . $q_post_type . "') ";
649
-            //$where .= " AND icl_t.language_code = '$lang_code' ";
650
-        }
636
+	global $wp_query, $wpdb;
651 637
 
652
-    }
653
-    ########### WPML ###########
638
+	//print_r($wp_query);
639
+	########### WPML ###########
654 640
 
641
+	if (function_exists('icl_object_id')) {
642
+		global $sitepress, $table_prefix;
643
+		$lang_code = ICL_LANGUAGE_CODE;
644
+		$default_lang_code = $sitepress->get_default_language();
645
+		$q_post_type = isset($wp_query->query['post_type']) ? $wp_query->query['post_type'] : '';
646
+		//echo '##########'.$q_post_type;
647
+		if ($lang_code && $q_post_type) {
648
+			$where .= " AND icl_t.language_code = '$lang_code' AND icl_t.element_type IN('post_" . $q_post_type . "') ";
649
+			//$where .= " AND icl_t.language_code = '$lang_code' ";
650
+		}
651
+
652
+	}
653
+	########### WPML ###########
655 654
 
656
-    return $where = str_replace("0 = 1", "1=1", $where);
657 655
 
658
-    /* ====== old code start ===
656
+	return $where = str_replace("0 = 1", "1=1", $where);
657
+
658
+	/* ====== old code start ===
659 659
     $where = str_replace("0 = 1", "1=1", $where);
660 660
     $country = get_query_var('gd_country');
661 661
     $region = get_query_var('gd_region');
@@ -696,109 +696,109 @@  discard block
 block discarded – undo
696 696
  * @return string Modified where query string.
697 697
  */
698 698
 function searching_filter_where($where) {
699
-    global $wpdb, $geodir_post_type, $table, $plugin_prefix, $dist, $mylat, $mylon, $s, $snear, $s, $s_A, $s_SA, $search_term, $gd_session;
699
+	global $wpdb, $geodir_post_type, $table, $plugin_prefix, $dist, $mylat, $mylon, $s, $snear, $s, $s_A, $s_SA, $search_term, $gd_session;
700 700
 	
701
-    $search_term = 'OR';
702
-    $search_term = 'AND';
703
-    $geodir_custom_search = '';
704
-    $category_search_range = '';
701
+	$search_term = 'OR';
702
+	$search_term = 'AND';
703
+	$geodir_custom_search = '';
704
+	$category_search_range = '';
705 705
 
706
-    if (is_single() && get_query_var('post_type')) {
706
+	if (is_single() && get_query_var('post_type')) {
707 707
 		return $where;
708 708
 	}
709 709
 
710
-    if (is_tax()) {
710
+	if (is_tax()) {
711 711
 		return $where;
712 712
 	}
713 713
 	
714 714
 	$s = trim($s);
715 715
 
716
-    $where = '';
716
+	$where = '';
717 717
 
718
-    $better_search_terms = '';
719
-    $better_search = array();
718
+	$better_search_terms = '';
719
+	$better_search = array();
720 720
 
721
-    if (!empty($s_SA)) {
722
-        foreach ($s_SA as $s_term) {
723
-            //$s_term = esc_attr($s_term);
724
-            //$better_search[] = " OR $wpdb->posts.post_title LIKE\"%$s_term%\" ";
721
+	if (!empty($s_SA)) {
722
+		foreach ($s_SA as $s_term) {
723
+			//$s_term = esc_attr($s_term);
724
+			//$better_search[] = " OR $wpdb->posts.post_title LIKE\"%$s_term%\" ";
725 725
 			$better_search[] = " OR ( $wpdb->posts.post_title LIKE \"$s_term\" OR $wpdb->posts.post_title LIKE \"$s_term%\" OR $wpdb->posts.post_title LIKE \"% $s_term%\" ) ";
726
-        }
727
-    }
726
+		}
727
+	}
728 728
 
729
-    if (is_array($better_search)) {
730
-        $better_search_terms = implode(' ', $better_search);
731
-    }
729
+	if (is_array($better_search)) {
730
+		$better_search_terms = implode(' ', $better_search);
731
+	}
732 732
 
733
-    $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';
738
-
739
-    if ($s != '') {
740
-        $keywords = explode(" ", $s);
741
-        if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
742
-            foreach($keywords as $kkey=>$kword){
743
-                if(mb_strlen($kword, 'UTF-8')<=$klimit){
744
-                    unset($keywords[$kkey]);
745
-                }
746
-            }
747
-        }
733
+	$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';
748 738
 
749
-        if (!empty($keywords)) {
750
-            foreach ($keywords as $keyword) {
751
-                $keyword = trim($keyword);
752
-                if ($keyword != '') {
753
-                    //$better_search_terms .= ' OR ' . $wpdb->posts . '.post_title LIKE "%' . $adv_search_val . '%"';
739
+	if ($s != '') {
740
+		$keywords = explode(" ", $s);
741
+		if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
742
+			foreach($keywords as $kkey=>$kword){
743
+				if(mb_strlen($kword, 'UTF-8')<=$klimit){
744
+					unset($keywords[$kkey]);
745
+				}
746
+			}
747
+		}
748
+
749
+		if (!empty($keywords)) {
750
+			foreach ($keywords as $keyword) {
751
+				$keyword = trim($keyword);
752
+				if ($keyword != '') {
753
+					//$better_search_terms .= ' OR ' . $wpdb->posts . '.post_title LIKE "%' . $adv_search_val . '%"';
754 754
 					$better_search_terms .= ' OR ( ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '" OR ' . $wpdb->posts . '.post_title LIKE "' . $keyword . '%" OR ' . $wpdb->posts . '.post_title LIKE "% ' . $keyword . '%" )';
755
-                }
756
-            }
757
-        }
758
-    }
755
+				}
756
+			}
757
+		}
758
+	}
759 759
 
760
-    /* get taxonomy */
761
-    $taxonomies = geodir_get_taxonomies($post_types, true);
762
-    if($taxonomies) {
763
-        $taxonomies = implode("','", $taxonomies);
764
-        $taxonomies = "'" . $taxonomies . "'";
765
-    }else{$taxonomies='';}
760
+	/* get taxonomy */
761
+	$taxonomies = geodir_get_taxonomies($post_types, true);
762
+	if($taxonomies) {
763
+		$taxonomies = implode("','", $taxonomies);
764
+		$taxonomies = "'" . $taxonomies . "'";
765
+	}else{$taxonomies='';}
766 766
 
767
-    $content_where = $terms_where = '';
767
+	$content_where = $terms_where = '';
768 768
 	if ($s != '') {
769
-        /**
770
-         * Filter the search query content where values.
771
-         *
772
-         * @since 1.5.0
773
-         * @package GeoDirectory
774
-         * @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%\") ") "`.
775
-         */
769
+		/**
770
+		 * Filter the search query content where values.
771
+		 *
772
+		 * @since 1.5.0
773
+		 * @package GeoDirectory
774
+		 * @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%\") ") "`.
775
+		 */
776 776
 		$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%\") ");
777
-        /**
778
-         * Filter the search query term values.
779
-         *
780
-         * @since 1.5.0
781
-         * @package GeoDirectory
782
-         * @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)) "`.
783
-         */
784
-        $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)) ");
777
+		/**
778
+		 * Filter the search query term values.
779
+		 *
780
+		 * @since 1.5.0
781
+		 * @package GeoDirectory
782
+		 * @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)) "`.
783
+		 */
784
+		$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)) ");
785 785
 	}
786 786
 		
787
-    if ($snear != '') {
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
-
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
-
801
-	    $where .= " AND ( ( $wpdb->posts.post_title LIKE \"$s\" $better_search_terms)
787
+	if ($snear != '') {
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
+
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
+
801
+		$where .= " AND ( ( $wpdb->posts.post_title LIKE \"$s\" $better_search_terms)
802 802
 			                    $content_where 
803 803
 								OR ($wpdb->posts.ID IN( 
804 804
 										SELECT $wpdb->term_relationships.object_id as post_id 
@@ -815,13 +815,13 @@  discard block
 block discarded – undo
815 815
 						AND ( " . $table . ".post_latitude between $rlat1 and $rlat2 )
816 816
 						AND ( " . $table . ".post_longitude between $rlon1 and $rlon2 ) ";
817 817
 
818
-        if (isset($_REQUEST['sdist']) && $_REQUEST['sdist'] != 'all') {
819
-            $DistanceRadius = geodir_getDistanceRadius(get_option('geodir_search_dist_1'));
820
-            $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;
821
-        }
818
+		if (isset($_REQUEST['sdist']) && $_REQUEST['sdist'] != 'all') {
819
+			$DistanceRadius = geodir_getDistanceRadius(get_option('geodir_search_dist_1'));
820
+			$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;
821
+		}
822 822
 
823
-    } else {
824
-        $where .= " AND (	( $wpdb->posts.post_title LIKE \"$s\" $better_search_terms)
823
+	} else {
824
+		$where .= " AND (	( $wpdb->posts.post_title LIKE \"$s\" $better_search_terms)
825 825
                             $content_where  
826 826
 							OR ( $wpdb->posts.ID IN(	
827 827
 									SELECT $wpdb->term_relationships.object_id as post_id                     
@@ -835,19 +835,19 @@  discard block
 block discarded – undo
835 835
 					) 
836 836
 				AND $wpdb->posts.post_type in ('$post_types')
837 837
 				AND ($wpdb->posts.post_status = 'publish') ";
838
-    }
838
+	}
839 839
 	
840 840
 	########### WPML ###########
841
-    if ( function_exists( 'icl_object_id' ) ) {       
841
+	if ( function_exists( 'icl_object_id' ) ) {       
842 842
 		$lang_code = ICL_LANGUAGE_CODE;
843 843
 		
844 844
 		if ($lang_code && $post_types) {
845
-            $where .= " AND icl_t.language_code = '".$lang_code."' AND icl_t.element_type IN('post_" . $post_types . "') ";
846
-        }
847
-    }
848
-    ########### WPML ###########
845
+			$where .= " AND icl_t.language_code = '".$lang_code."' AND icl_t.element_type IN('post_" . $post_types . "') ";
846
+		}
847
+	}
848
+	########### WPML ###########
849 849
 	
850
-    return $where;
850
+	return $where;
851 851
 }
852 852
 
853 853
 
@@ -862,45 +862,45 @@  discard block
 block discarded – undo
862 862
  * @return string Modified where query string.
863 863
  */
864 864
 function author_filter_where($where) {
865
-    global $wpdb, $geodir_post_type, $table, $curr;
865
+	global $wpdb, $geodir_post_type, $table, $curr;
866 866
 
867
-    $curauth = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
868
-    $user_id = !empty($curauth->ID) ? (int)$curauth->ID : 0;
867
+	$curauth = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
868
+	$user_id = !empty($curauth->ID) ? (int)$curauth->ID : 0;
869 869
     
870
-    if (isset($_REQUEST['stype'])) {
871
-        $where = $wpdb->prepare(" AND $wpdb->posts.post_type IN (%s) ",$_REQUEST['stype']);
872
-    } else {
873
-        $where = " AND $wpdb->posts.post_type IN ('gd_place') ";
874
-    }
870
+	if (isset($_REQUEST['stype'])) {
871
+		$where = $wpdb->prepare(" AND $wpdb->posts.post_type IN (%s) ",$_REQUEST['stype']);
872
+	} else {
873
+		$where = " AND $wpdb->posts.post_type IN ('gd_place') ";
874
+	}
875 875
 
876
-    if ($user_id > 0) {
877
-        if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
878
-            $user_fav_posts = get_user_meta($user_id, 'gd_user_favourite_post', true);
879
-            $user_fav_posts = !empty($user_fav_posts) && is_array($user_fav_posts) ? implode("','", $user_fav_posts) : '-1';
880
-            $where .= " AND $wpdb->posts.ID IN ('$user_fav_posts')";
881
-        } else
882
-            $where .= " AND $wpdb->posts.post_author = $user_id";
883
-
884
-        if ($user_id == (int)get_current_user_id()) {
885
-            $where .= " AND $wpdb->posts.post_status IN ('publish','draft','pending') ";
886
-        } else {
887
-            $where .= " AND $wpdb->posts.post_status = 'publish' ";
888
-        }
889
-    } else {
890
-        $where .= " AND $wpdb->posts.post_author = '-1' AND $wpdb->posts.post_status = 'publish' ";
891
-    }
876
+	if ($user_id > 0) {
877
+		if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
878
+			$user_fav_posts = get_user_meta($user_id, 'gd_user_favourite_post', true);
879
+			$user_fav_posts = !empty($user_fav_posts) && is_array($user_fav_posts) ? implode("','", $user_fav_posts) : '-1';
880
+			$where .= " AND $wpdb->posts.ID IN ('$user_fav_posts')";
881
+		} else
882
+			$where .= " AND $wpdb->posts.post_author = $user_id";
883
+
884
+		if ($user_id == (int)get_current_user_id()) {
885
+			$where .= " AND $wpdb->posts.post_status IN ('publish','draft','pending') ";
886
+		} else {
887
+			$where .= " AND $wpdb->posts.post_status = 'publish' ";
888
+		}
889
+	} else {
890
+		$where .= " AND $wpdb->posts.post_author = '-1' AND $wpdb->posts.post_status = 'publish' ";
891
+	}
892 892
 
893
-    ########### WPML ###########
894
-    if (function_exists('icl_object_id')) {
895
-        $lang_code = ICL_LANGUAGE_CODE;
896
-        if ($lang_code) {
897
-            $where .= " AND icl_t.language_code='" . $lang_code . "' ";
898
-        }
893
+	########### WPML ###########
894
+	if (function_exists('icl_object_id')) {
895
+		$lang_code = ICL_LANGUAGE_CODE;
896
+		if ($lang_code) {
897
+			$where .= " AND icl_t.language_code='" . $lang_code . "' ";
898
+		}
899 899
 
900
-    }
901
-    ########### WPML ###########
900
+	}
901
+	########### WPML ###########
902 902
     
903
-    return $where;
903
+	return $where;
904 904
 }
905 905
 
906 906
 /**
@@ -915,11 +915,11 @@  discard block
 block discarded – undo
915 915
  */
916 916
 function geodir_filter_widget_join($join)
917 917
 {
918
-    global $wp_query, $table;
919
-    if (!empty($wp_query->query['with_pics_only'])) {
920
-        $join .= " LEFT JOIN " . GEODIR_ATTACHMENT_TABLE . " ON ( " . GEODIR_ATTACHMENT_TABLE . ".post_id=" . $table . ".post_id AND " . GEODIR_ATTACHMENT_TABLE . ".mime_type LIKE '%image%' )";
921
-    }
922
-    return $join;
918
+	global $wp_query, $table;
919
+	if (!empty($wp_query->query['with_pics_only'])) {
920
+		$join .= " LEFT JOIN " . GEODIR_ATTACHMENT_TABLE . " ON ( " . GEODIR_ATTACHMENT_TABLE . ".post_id=" . $table . ".post_id AND " . GEODIR_ATTACHMENT_TABLE . ".mime_type LIKE '%image%' )";
921
+	}
922
+	return $join;
923 923
 }
924 924
 
925 925
 /**
@@ -934,18 +934,18 @@  discard block
 block discarded – undo
934 934
  */
935 935
 function geodir_filter_widget_where($where)
936 936
 {
937
-    global $wp_query, $table;
938
-    if (!empty($wp_query->query['show_featured_only'])) {
939
-        $where .= " AND " . $table . ".is_featured = '1'";
940
-    }
941
-    if (!empty($wp_query->query['show_special_only'])) {
942
-        $where .= " AND ( " . $table . ".geodir_special_offers != '' AND " . $table . ".geodir_special_offers IS NOT NULL )";
943
-    }
944
-    if (!empty($wp_query->query['with_pics_only'])) {
945
-        $where .= " AND " . GEODIR_ATTACHMENT_TABLE . ".ID IS NOT NULL GROUP BY " . $table . ".post_id";
946
-    }
947
-    if (!empty($wp_query->query['with_videos_only'])) {
948
-        $where .= " AND ( " . $table . ".geodir_video != '' AND " . $table . ".geodir_video IS NOT NULL )";
949
-    }
950
-    return $where;
937
+	global $wp_query, $table;
938
+	if (!empty($wp_query->query['show_featured_only'])) {
939
+		$where .= " AND " . $table . ".is_featured = '1'";
940
+	}
941
+	if (!empty($wp_query->query['show_special_only'])) {
942
+		$where .= " AND ( " . $table . ".geodir_special_offers != '' AND " . $table . ".geodir_special_offers IS NOT NULL )";
943
+	}
944
+	if (!empty($wp_query->query['with_pics_only'])) {
945
+		$where .= " AND " . GEODIR_ATTACHMENT_TABLE . ".ID IS NOT NULL GROUP BY " . $table . ".post_id";
946
+	}
947
+	if (!empty($wp_query->query['with_videos_only'])) {
948
+		$where .= " AND ( " . $table . ".geodir_video != '' AND " . $table . ".geodir_video IS NOT NULL )";
949
+	}
950
+	return $where;
951 951
 }
952 952
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +24 added lines, -24 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
             }
@@ -438,9 +438,9 @@  discard block
 block discarded – undo
438 438
 
439 439
     if (is_search() && isset($_REQUEST['geodir_search']) && $s && trim($s) != '') {
440 440
         $keywords = explode(" ", $s);
441
-        if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
442
-            foreach($keywords as $kkey=>$kword){
443
-                if(mb_strlen($kword, 'UTF-8')<=$klimit){
441
+        if (is_array($keywords) && $klimit = get_option('geodir_search_word_limit')) {
442
+            foreach ($keywords as $kkey=>$kword) {
443
+                if (mb_strlen($kword, 'UTF-8') <= $klimit) {
444 444
                     unset($keywords[$kkey]);
445 445
                 }
446 446
             }
@@ -509,7 +509,7 @@  discard block
 block discarded – undo
509 509
                 case 'post_date':
510 510
                 case 'comment_count':
511 511
 
512
-                    $orderby = "$wpdb->posts." . $sort_by . " " . $order . ", ".$table . ".overall_rating " . $order . ", ";
512
+                    $orderby = "$wpdb->posts." . $sort_by . " " . $order . ", " . $table . ".overall_rating " . $order . ", ";
513 513
                     break;
514 514
 
515 515
                 case 'distance':
@@ -574,7 +574,7 @@  discard block
 block discarded – undo
574 574
         }
575 575
 
576 576
         //if (!geodir_is_page('detail'))
577
-            add_filter('posts_where', 'geodir_default_where', 1);/**/
577
+            add_filter('posts_where', 'geodir_default_where', 1); /**/
578 578
 
579 579
         //add_filter( 'user_has_cap', 'geodir_preview_post_cap', 10, 3 );// let subscribers edit their own posts
580 580
 
@@ -738,9 +738,9 @@  discard block
 block discarded – undo
738 738
 
739 739
     if ($s != '') {
740 740
         $keywords = explode(" ", $s);
741
-        if(is_array($keywords) && $klimit = get_option('geodir_search_word_limit')){
742
-            foreach($keywords as $kkey=>$kword){
743
-                if(mb_strlen($kword, 'UTF-8')<=$klimit){
741
+        if (is_array($keywords) && $klimit = get_option('geodir_search_word_limit')) {
742
+            foreach ($keywords as $kkey=>$kword) {
743
+                if (mb_strlen($kword, 'UTF-8') <= $klimit) {
744 744
                     unset($keywords[$kkey]);
745 745
                 }
746 746
             }
@@ -759,10 +759,10 @@  discard block
 block discarded – undo
759 759
 
760 760
     /* get taxonomy */
761 761
     $taxonomies = geodir_get_taxonomies($post_types, true);
762
-    if($taxonomies) {
762
+    if ($taxonomies) {
763 763
         $taxonomies = implode("','", $taxonomies);
764 764
         $taxonomies = "'" . $taxonomies . "'";
765
-    }else{$taxonomies='';}
765
+    } else {$taxonomies = ''; }
766 766
 
767 767
     $content_where = $terms_where = '';
768 768
 	if ($s != '') {
@@ -773,7 +773,7 @@  discard block
 block discarded – undo
773 773
          * @package GeoDirectory
774 774
          * @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%\") ") "`.
775 775
          */
776
-		$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%\") ");
776
+		$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%\") ");
777 777
         /**
778 778
          * Filter the search query term values.
779 779
          *
@@ -781,7 +781,7 @@  discard block
 block discarded – undo
781 781
          * @package GeoDirectory
782 782
          * @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)) "`.
783 783
          */
784
-        $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)) ");
784
+        $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)) ");
785 785
 	}
786 786
 		
787 787
     if ($snear != '') {
@@ -838,11 +838,11 @@  discard block
 block discarded – undo
838 838
     }
839 839
 	
840 840
 	########### WPML ###########
841
-    if ( function_exists( 'icl_object_id' ) ) {       
841
+    if (function_exists('icl_object_id')) {       
842 842
 		$lang_code = ICL_LANGUAGE_CODE;
843 843
 		
844 844
 		if ($lang_code && $post_types) {
845
-            $where .= " AND icl_t.language_code = '".$lang_code."' AND icl_t.element_type IN('post_" . $post_types . "') ";
845
+            $where .= " AND icl_t.language_code = '" . $lang_code . "' AND icl_t.element_type IN('post_" . $post_types . "') ";
846 846
         }
847 847
     }
848 848
     ########### WPML ###########
@@ -865,10 +865,10 @@  discard block
 block discarded – undo
865 865
     global $wpdb, $geodir_post_type, $table, $curr;
866 866
 
867 867
     $curauth = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
868
-    $user_id = !empty($curauth->ID) ? (int)$curauth->ID : 0;
868
+    $user_id = !empty($curauth->ID) ? (int) $curauth->ID : 0;
869 869
     
870 870
     if (isset($_REQUEST['stype'])) {
871
-        $where = $wpdb->prepare(" AND $wpdb->posts.post_type IN (%s) ",$_REQUEST['stype']);
871
+        $where = $wpdb->prepare(" AND $wpdb->posts.post_type IN (%s) ", $_REQUEST['stype']);
872 872
     } else {
873 873
         $where = " AND $wpdb->posts.post_type IN ('gd_place') ";
874 874
     }
@@ -881,7 +881,7 @@  discard block
 block discarded – undo
881 881
         } else
882 882
             $where .= " AND $wpdb->posts.post_author = $user_id";
883 883
 
884
-        if ($user_id == (int)get_current_user_id()) {
884
+        if ($user_id == (int) get_current_user_id()) {
885 885
             $where .= " AND $wpdb->posts.post_status IN ('publish','draft','pending') ";
886 886
         } else {
887 887
             $where .= " AND $wpdb->posts.post_status = 'publish' ";
Please login to merge, or discard this patch.
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.
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.
geodirectory-admin/admin_install.php 1 patch
Indentation   +160 added lines, -160 removed lines patch added patch discarded remove patch
@@ -24,8 +24,8 @@  discard block
 block discarded – undo
24 24
 function geodir_activation()
25 25
 {
26 26
 
27
-    geodir_install();
28
-    add_action('wp_loaded', 'geodir_flush_activation');
27
+	geodir_install();
28
+	add_action('wp_loaded', 'geodir_flush_activation');
29 29
 }
30 30
 
31 31
 /**
@@ -36,9 +36,9 @@  discard block
 block discarded – undo
36 36
  */
37 37
 function geodir_flush_activation()
38 38
 {
39
-    // Remove rewrite rules and then recreate rewrite rules.
40
-    // flush late so everything is loaded
41
-    flush_rewrite_rules();
39
+	// Remove rewrite rules and then recreate rewrite rules.
40
+	// flush late so everything is loaded
41
+	flush_rewrite_rules();
42 42
 }
43 43
 
44 44
 /**
@@ -50,44 +50,44 @@  discard block
 block discarded – undo
50 50
  */
51 51
 function geodir_install()
52 52
 {
53
-    global $geodir_settings;
54
-
55
-    /**
56
-     * Called before the GD installation scripts have run.
57
-     *
58
-     * @since 1.0.0
59
-     * @see 'geodir_installation_end'
60
-     */
61
-    do_action('geodir_installation_start');
62
-
63
-    // Do install
64
-    if (!get_option('geodir_default_data_installed')) {
65
-        geodir_create_tables(); // in admin db install.php
66
-        geodir_register_defaults(); // geodir_functions/ taxonomy_functions.php
67
-        geodir_create_default_fields();
68
-        //geodir_default_taxonomies();
69
-        geodir_set_default_options();
70
-        geodir_create_pages();
71
-        geodir_set_default_widgets();
72
-        gd_install_theme_compat();
73
-
74
-        update_option('geodir_default_data_installed', 1);
75
-
76
-    }
77
-
78
-    if (!get_option('geodir_default_data_installed_1.2.8')) {
79
-        //geodir_create_tables(); // in admin db install.php
80
-        update_option('geodir_default_data_installed_1.2.8', 1);
81
-    }
82
-
83
-    geodir_installation_end();
84
-    /**
85
-     * Called after the GD installation scripts have run.
86
-     *
87
-     * @since 1.0.0
88
-     * @see 'geodir_installation_start'
89
-     */
90
-    do_action('geodir_installation_end');
53
+	global $geodir_settings;
54
+
55
+	/**
56
+	 * Called before the GD installation scripts have run.
57
+	 *
58
+	 * @since 1.0.0
59
+	 * @see 'geodir_installation_end'
60
+	 */
61
+	do_action('geodir_installation_start');
62
+
63
+	// Do install
64
+	if (!get_option('geodir_default_data_installed')) {
65
+		geodir_create_tables(); // in admin db install.php
66
+		geodir_register_defaults(); // geodir_functions/ taxonomy_functions.php
67
+		geodir_create_default_fields();
68
+		//geodir_default_taxonomies();
69
+		geodir_set_default_options();
70
+		geodir_create_pages();
71
+		geodir_set_default_widgets();
72
+		gd_install_theme_compat();
73
+
74
+		update_option('geodir_default_data_installed', 1);
75
+
76
+	}
77
+
78
+	if (!get_option('geodir_default_data_installed_1.2.8')) {
79
+		//geodir_create_tables(); // in admin db install.php
80
+		update_option('geodir_default_data_installed_1.2.8', 1);
81
+	}
82
+
83
+	geodir_installation_end();
84
+	/**
85
+	 * Called after the GD installation scripts have run.
86
+	 *
87
+	 * @since 1.0.0
88
+	 * @see 'geodir_installation_start'
89
+	 */
90
+	do_action('geodir_installation_end');
91 91
 
92 92
 
93 93
 }
@@ -104,16 +104,16 @@  discard block
 block discarded – undo
104 104
 function geodir_create_pages()
105 105
 {
106 106
 
107
-    //geodir_create_page( esc_sql( _x('home-map', 'page_slug', 'geodirectory') ), 'geodir_home_map_page', __('Home Map', 'geodirectory'), '',0,'publish' );
108
-    geodir_create_page(esc_sql(_x('gd-home', 'page_slug', 'geodirectory')), 'geodir_home_page', __('GD Home page', 'geodirectory'), '');
109
-    geodir_create_page(esc_sql(_x('add-listing', 'page_slug', 'geodirectory')), 'geodir_add_listing_page', __('Add Listing', 'geodirectory'), '');
110
-    geodir_create_page(esc_sql(_x('listing-preview', 'page_slug', 'geodirectory')), 'geodir_preview_page', __('Listing Preview', 'geodirectory'), '');
111
-    geodir_create_page(esc_sql(_x('listing-success', 'page_slug', 'geodirectory')), 'geodir_success_page', __('Listing Success', 'geodirectory'), '');
112
-    geodir_create_page(esc_sql(_x('location', 'page_slug', 'geodirectory')), 'geodir_location_page', __('Location', 'geodirectory'), '');
107
+	//geodir_create_page( esc_sql( _x('home-map', 'page_slug', 'geodirectory') ), 'geodir_home_map_page', __('Home Map', 'geodirectory'), '',0,'publish' );
108
+	geodir_create_page(esc_sql(_x('gd-home', 'page_slug', 'geodirectory')), 'geodir_home_page', __('GD Home page', 'geodirectory'), '');
109
+	geodir_create_page(esc_sql(_x('add-listing', 'page_slug', 'geodirectory')), 'geodir_add_listing_page', __('Add Listing', 'geodirectory'), '');
110
+	geodir_create_page(esc_sql(_x('listing-preview', 'page_slug', 'geodirectory')), 'geodir_preview_page', __('Listing Preview', 'geodirectory'), '');
111
+	geodir_create_page(esc_sql(_x('listing-success', 'page_slug', 'geodirectory')), 'geodir_success_page', __('Listing Success', 'geodirectory'), '');
112
+	geodir_create_page(esc_sql(_x('location', 'page_slug', 'geodirectory')), 'geodir_location_page', __('Location', 'geodirectory'), '');
113 113
 
114
-    //New since 1.5.3
115
-    geodir_create_page(esc_sql(_x('gd-info', 'page_slug', 'geodirectory')), 'geodir_info_page', __('Info', 'geodirectory'), '');
116
-    geodir_create_page(esc_sql(_x('gd-login', 'page_slug', 'geodirectory')), 'geodir_login_page', __('Login', 'geodirectory'), '');
114
+	//New since 1.5.3
115
+	geodir_create_page(esc_sql(_x('gd-info', 'page_slug', 'geodirectory')), 'geodir_info_page', __('Info', 'geodirectory'), '');
116
+	geodir_create_page(esc_sql(_x('gd-login', 'page_slug', 'geodirectory')), 'geodir_login_page', __('Login', 'geodirectory'), '');
117 117
 
118 118
 
119 119
 }
@@ -129,11 +129,11 @@  discard block
 block discarded – undo
129 129
  */
130 130
 function geodir_installation_end()
131 131
 {
132
-    //update_option( "geodir_db_version", GEODIRECTORY_VERSION );
132
+	//update_option( "geodir_db_version", GEODIRECTORY_VERSION );
133 133
 
134
-    update_option("geodir_installed", 1);
135
-    update_option("geodir_installation_redirect", 1);
136
-    update_option('skip_install_geodir_pages', 0);
134
+	update_option("geodir_installed", 1);
135
+	update_option("geodir_installation_redirect", 1);
136
+	update_option('skip_install_geodir_pages', 0);
137 137
 }
138 138
 
139 139
 /**
@@ -147,45 +147,45 @@  discard block
 block discarded – undo
147 147
  */
148 148
 function geodir_set_default_options()
149 149
 {
150
-    global $geodir_settings;
151
-    /**
152
-     * Contains settings array for general tab.
153
-     *
154
-     * @since 1.0.0
155
-     * @package GeoDirectory
156
-     */
157
-    include_once("option-pages/general_settings_array.php");
158
-    /**
159
-     * Contains settings array for design tab.
160
-     *
161
-     * @since 1.0.0
162
-     * @package GeoDirectory
163
-     */
164
-    include_once("option-pages/design_settings_array.php");
165
-    /**
166
-     * Contains settings array for notifications tab.
167
-     *
168
-     * @since 1.0.0
169
-     * @package GeoDirectory
170
-     */
171
-    include_once("option-pages/notifications_settings_array.php");
172
-    /**
173
-     * Contains settings array for permalink tab.
174
-     *
175
-     * @since 1.0.0
176
-     * @package GeoDirectory
177
-     */
178
-    include_once("option-pages/permalink_settings_array.php");
179
-    /**
180
-     * Contains settings array for title / meta tab.
181
-     *
182
-     * @since 1.5.4
183
-     * @package GeoDirectory
184
-     */
185
-    include_once("option-pages/title_meta_settings_array.php");
186
-    foreach ($geodir_settings as $value) {
187
-        geodir_update_options($value, true);
188
-    }
150
+	global $geodir_settings;
151
+	/**
152
+	 * Contains settings array for general tab.
153
+	 *
154
+	 * @since 1.0.0
155
+	 * @package GeoDirectory
156
+	 */
157
+	include_once("option-pages/general_settings_array.php");
158
+	/**
159
+	 * Contains settings array for design tab.
160
+	 *
161
+	 * @since 1.0.0
162
+	 * @package GeoDirectory
163
+	 */
164
+	include_once("option-pages/design_settings_array.php");
165
+	/**
166
+	 * Contains settings array for notifications tab.
167
+	 *
168
+	 * @since 1.0.0
169
+	 * @package GeoDirectory
170
+	 */
171
+	include_once("option-pages/notifications_settings_array.php");
172
+	/**
173
+	 * Contains settings array for permalink tab.
174
+	 *
175
+	 * @since 1.0.0
176
+	 * @package GeoDirectory
177
+	 */
178
+	include_once("option-pages/permalink_settings_array.php");
179
+	/**
180
+	 * Contains settings array for title / meta tab.
181
+	 *
182
+	 * @since 1.5.4
183
+	 * @package GeoDirectory
184
+	 */
185
+	include_once("option-pages/title_meta_settings_array.php");
186
+	foreach ($geodir_settings as $value) {
187
+		geodir_update_options($value, true);
188
+	}
189 189
 
190 190
 }
191 191
 
@@ -199,103 +199,103 @@  discard block
 block discarded – undo
199 199
 function geodir_set_default_widgets()
200 200
 {
201 201
 
202
-    $widget_option_list = array();
203
-    $widgetinfo = array();
204
-    $sidebarvalue_array = array();
205
-    $sidebars_widgets = array();
202
+	$widget_option_list = array();
203
+	$widgetinfo = array();
204
+	$sidebarvalue_array = array();
205
+	$sidebars_widgets = array();
206 206
 
207
-    /*===========================*/
208
-    /*  Widgets ON HOME PAGE     */
209
-    /*===========================*/
207
+	/*===========================*/
208
+	/*  Widgets ON HOME PAGE     */
209
+	/*===========================*/
210 210
 
211
-    $widget_option_list['geodir_home_top'] =
212
-        array('popular_post_category' => array("title" => __('Popular Categories', 'geodirectory')),
213
-            'geodir_map_v3_home_map' => array("autozoom" => 1, "width" => '100%', "heigh" => '425'),
214
-            'geodir_advance_search' => array());
211
+	$widget_option_list['geodir_home_top'] =
212
+		array('popular_post_category' => array("title" => __('Popular Categories', 'geodirectory')),
213
+			'geodir_map_v3_home_map' => array("autozoom" => 1, "width" => '100%', "heigh" => '425'),
214
+			'geodir_advance_search' => array());
215 215
 
216
-    $widget_option_list['geodir_home_content'] =
217
-        array('popular_post_view' => array("title" => __('Popular Places', 'geodirectory'), "layout" => 'list', "add_location_filter" => '1'));
216
+	$widget_option_list['geodir_home_content'] =
217
+		array('popular_post_view' => array("title" => __('Popular Places', 'geodirectory'), "layout" => 'list', "add_location_filter" => '1'));
218 218
 
219
-    $widget_option_list['geodir_home_right'] =
220
-        array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')),
221
-            'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1'));
219
+	$widget_option_list['geodir_home_right'] =
220
+		array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')),
221
+			'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1'));
222 222
 
223
-    /*===========================*/
224
-    /*  Widgets ON LISTING PAGE     */
225
-    /*===========================*/
223
+	/*===========================*/
224
+	/*  Widgets ON LISTING PAGE     */
225
+	/*===========================*/
226 226
 
227
-    $widget_option_list['geodir_listing_top'] =
228
-        array('popular_post_category' => array("title" => __('Popular Categories', 'geodirectory')),
229
-            'geodir_advance_search' => array());
227
+	$widget_option_list['geodir_listing_top'] =
228
+		array('popular_post_category' => array("title" => __('Popular Categories', 'geodirectory')),
229
+			'geodir_advance_search' => array());
230 230
 
231
-    $widget_option_list['geodir_listing_right_sidebar'] =
232
-        array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')),
233
-            'geodir_map_v3_listing_map' => array("autozoom" => 1, "sticky" => 1),
234
-            'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1'));
231
+	$widget_option_list['geodir_listing_right_sidebar'] =
232
+		array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')),
233
+			'geodir_map_v3_listing_map' => array("autozoom" => 1, "sticky" => 1),
234
+			'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1'));
235 235
 
236 236
 
237
-    /*===========================*/
238
-    /*  Widgets ON SEARCH PAGE     */
239
-    /*===========================*/
237
+	/*===========================*/
238
+	/*  Widgets ON SEARCH PAGE     */
239
+	/*===========================*/
240 240
 
241
-    $widget_option_list['geodir_search_top'] =
242
-        array('popular_post_category' => array("title" => __('Popular Categories', 'geodirectory')),
243
-            'geodir_advance_search' => array());
241
+	$widget_option_list['geodir_search_top'] =
242
+		array('popular_post_category' => array("title" => __('Popular Categories', 'geodirectory')),
243
+			'geodir_advance_search' => array());
244 244
 
245
-    $widget_option_list['geodir_search_right_sidebar'] =
246
-        array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')),
247
-            'geodir_map_v3_listing_map' => array("autozoom" => 1, "sticky" => 1),
248
-            'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1'));
245
+	$widget_option_list['geodir_search_right_sidebar'] =
246
+		array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')),
247
+			'geodir_map_v3_listing_map' => array("autozoom" => 1, "sticky" => 1),
248
+			'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1'));
249 249
 
250
-    /*===========================*/
251
-    /*  Widgets ON DETAIL/SINGLE PAGE     */
252
-    /*===========================*/
250
+	/*===========================*/
251
+	/*  Widgets ON DETAIL/SINGLE PAGE     */
252
+	/*===========================*/
253 253
 
254
-    $widget_option_list['geodir_detail_sidebar'] =
255
-        array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')),
256
-            'geodir_map_v3_listing_map' => array("autozoom" => 1, "sticky" => 1),
257
-            'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1'));
254
+	$widget_option_list['geodir_detail_sidebar'] =
255
+		array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')),
256
+			'geodir_map_v3_listing_map' => array("autozoom" => 1, "sticky" => 1),
257
+			'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1'));
258 258
 
259 259
 
260
-    /*===========================*/
261
-    /*  Widgets ON AUTHOR PAGE     */
262
-    /*===========================*/
260
+	/*===========================*/
261
+	/*  Widgets ON AUTHOR PAGE     */
262
+	/*===========================*/
263 263
 
264 264
 
265
-    $widget_option_list['geodir_author_right_sidebar'] =
266
-        array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')));
265
+	$widget_option_list['geodir_author_right_sidebar'] =
266
+		array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')));
267 267
 
268 268
 
269
-    $sidebars_widgets = get_option('sidebars_widgets');
269
+	$sidebars_widgets = get_option('sidebars_widgets');
270 270
 
271
-    foreach ($widget_option_list as $key => $widget_options) {
271
+	foreach ($widget_option_list as $key => $widget_options) {
272 272
 
273
-        foreach ($widget_options as $key2 => $widget_options_obj) {
274
-            $widgetid = 'widget_' . $key2;
273
+		foreach ($widget_options as $key2 => $widget_options_obj) {
274
+			$widgetid = 'widget_' . $key2;
275 275
 
276
-            $widgetinfo[$widgetid][] = $widget_options_obj;
276
+			$widgetinfo[$widgetid][] = $widget_options_obj;
277 277
 
278
-            $sidebarvalue_array[$key][] = $key2 . "-" . (count($widgetinfo[$widgetid]));
278
+			$sidebarvalue_array[$key][] = $key2 . "-" . (count($widgetinfo[$widgetid]));
279 279
 
280
-            $widget_update[$widgetid][count($widgetinfo[$widgetid])] = $widget_options_obj;
280
+			$widget_update[$widgetid][count($widgetinfo[$widgetid])] = $widget_options_obj;
281 281
 
282
-        }
282
+		}
283 283
 
284
-        if (!empty($sidebarvalue_array[$key])) {
284
+		if (!empty($sidebarvalue_array[$key])) {
285 285
 
286
-            $sidebars_widgets = get_option('sidebars_widgets');
287
-            $sidebars_widgets[$key] = $sidebarvalue_array[$key];
288
-            update_option('sidebars_widgets', $sidebars_widgets);
286
+			$sidebars_widgets = get_option('sidebars_widgets');
287
+			$sidebars_widgets[$key] = $sidebarvalue_array[$key];
288
+			update_option('sidebars_widgets', $sidebars_widgets);
289 289
 
290
-            foreach ($widget_update as $key => $value) {
290
+			foreach ($widget_update as $key => $value) {
291 291
 
292
-                update_option($key, $value);
292
+				update_option($key, $value);
293 293
 
294
-            }
294
+			}
295 295
 
296
-        }
296
+		}
297 297
 
298
-    }
298
+	}
299 299
 
300 300
 
301 301
 }
Please login to merge, or discard this patch.
geodirectory-functions/compatibility/Jupiter.php 1 patch
Indentation   +141 added lines, -141 removed lines patch added patch discarded remove patch
@@ -16,28 +16,28 @@  discard block
 block discarded – undo
16 16
  */
17 17
 function jupiter_action_calls()
18 18
 {
19
-    // REMOVE BREADCRUMB
20
-    remove_action('geodir_detail_before_main_content', 'geodir_breadcrumb', 20);
21
-    remove_action('geodir_listings_before_main_content', 'geodir_breadcrumb', 20);
22
-    remove_action('geodir_author_before_main_content', 'geodir_breadcrumb', 20);
23
-    remove_action('geodir_search_before_main_content', 'geodir_breadcrumb', 20);
24
-    remove_action('geodir_home_before_main_content', 'geodir_breadcrumb', 20);
25
-    remove_action('geodir_location_before_main_content', 'geodir_breadcrumb', 20);
26
-
27
-    // REMOVE PAGE TITLES
28
-    remove_action('geodir_listings_page_title', 'geodir_action_listings_title', 10);
29
-    remove_action('geodir_add_listing_page_title', 'geodir_action_add_listing_page_title', 10);
30
-    remove_action('geodir_details_main_content', 'geodir_action_page_title', 20);
31
-    remove_action('geodir_search_page_title', 'geodir_action_search_page_title', 10);
32
-    remove_action('geodir_author_page_title', 'geodir_action_author_page_title', 10);
33
-
34
-
35
-    // CAHNGE PAGE TITLES
36
-    remove_action('page_title', 'mk_page_title');
37
-    add_action('page_title', 'gd_mk_page_title');
38
-    // CHANGE BREADCRUMS FOR GD PAGES
39
-    remove_action('theme_breadcrumbs', 'mk_theme_breadcrumbs');
40
-    add_action('theme_breadcrumbs', 'gd_mk_theme_breadcrumbs');
19
+	// REMOVE BREADCRUMB
20
+	remove_action('geodir_detail_before_main_content', 'geodir_breadcrumb', 20);
21
+	remove_action('geodir_listings_before_main_content', 'geodir_breadcrumb', 20);
22
+	remove_action('geodir_author_before_main_content', 'geodir_breadcrumb', 20);
23
+	remove_action('geodir_search_before_main_content', 'geodir_breadcrumb', 20);
24
+	remove_action('geodir_home_before_main_content', 'geodir_breadcrumb', 20);
25
+	remove_action('geodir_location_before_main_content', 'geodir_breadcrumb', 20);
26
+
27
+	// REMOVE PAGE TITLES
28
+	remove_action('geodir_listings_page_title', 'geodir_action_listings_title', 10);
29
+	remove_action('geodir_add_listing_page_title', 'geodir_action_add_listing_page_title', 10);
30
+	remove_action('geodir_details_main_content', 'geodir_action_page_title', 20);
31
+	remove_action('geodir_search_page_title', 'geodir_action_search_page_title', 10);
32
+	remove_action('geodir_author_page_title', 'geodir_action_author_page_title', 10);
33
+
34
+
35
+	// CAHNGE PAGE TITLES
36
+	remove_action('page_title', 'mk_page_title');
37
+	add_action('page_title', 'gd_mk_page_title');
38
+	// CHANGE BREADCRUMS FOR GD PAGES
39
+	remove_action('theme_breadcrumbs', 'mk_theme_breadcrumbs');
40
+	add_action('theme_breadcrumbs', 'gd_mk_theme_breadcrumbs');
41 41
 
42 42
 
43 43
 }
@@ -52,19 +52,19 @@  discard block
 block discarded – undo
52 52
 function gd_mk_theme_breadcrumbs()
53 53
 {
54 54
 
55
-    if (is_page_geodir_home() || geodir_is_page('location')) {
56
-        jupiter_geodir_breadcrumb();
57
-    } elseif (geodir_is_page('listing')) {
58
-        jupiter_geodir_breadcrumb();
59
-    } elseif (geodir_is_page('detail')) {
60
-        jupiter_geodir_breadcrumb();
61
-    } elseif (geodir_is_page('search')) {
62
-        jupiter_geodir_breadcrumb();
63
-    } elseif (geodir_is_page('author')) {
64
-        jupiter_geodir_breadcrumb();
65
-    } else {
66
-        mk_theme_breadcrumbs();
67
-    }
55
+	if (is_page_geodir_home() || geodir_is_page('location')) {
56
+		jupiter_geodir_breadcrumb();
57
+	} elseif (geodir_is_page('listing')) {
58
+		jupiter_geodir_breadcrumb();
59
+	} elseif (geodir_is_page('detail')) {
60
+		jupiter_geodir_breadcrumb();
61
+	} elseif (geodir_is_page('search')) {
62
+		jupiter_geodir_breadcrumb();
63
+	} elseif (geodir_is_page('author')) {
64
+		jupiter_geodir_breadcrumb();
65
+	} else {
66
+		mk_theme_breadcrumbs();
67
+	}
68 68
 }
69 69
 
70 70
 /**
@@ -76,35 +76,35 @@  discard block
 block discarded – undo
76 76
  */
77 77
 function gd_mk_page_title()
78 78
 {
79
-    global $wp;
80
-
81
-
82
-    if (is_page_geodir_home() || geodir_is_page('location')) {
83
-        jupiter_geodir_page_title();
84
-    } elseif (geodir_is_page('listing')) {
85
-        ob_start(); // Start buffering;
86
-        geodir_action_listings_title();
87
-        $gd_title = ob_get_clean();
88
-        $title_p = explode('">', $gd_title);
89
-        $title = str_replace('</h1></header>', "", $title_p[2]);
90
-        jupiter_geodir_page_title($title);
91
-    } elseif (geodir_is_page('search')) {
92
-        ob_start(); // Start buffering;
93
-        geodir_action_listings_title();
94
-        $gd_title = ob_get_clean();
95
-        $title_p = explode('">', $gd_title);
96
-        $title = str_replace('</h1></header>', "", $title_p[2]);
97
-        jupiter_geodir_page_title($title);
98
-    } elseif (geodir_is_page('author')) {
99
-        ob_start(); // Start buffering;
100
-        geodir_action_author_page_title();
101
-        $gd_title = ob_get_clean();
102
-        $gd_title = str_replace('<h1>', "", $gd_title);
103
-        $gd_title = str_replace('</h1>', "", $gd_title);
104
-        jupiter_geodir_page_title($gd_title);
105
-    } else {
106
-        mk_page_title();
107
-    }
79
+	global $wp;
80
+
81
+
82
+	if (is_page_geodir_home() || geodir_is_page('location')) {
83
+		jupiter_geodir_page_title();
84
+	} elseif (geodir_is_page('listing')) {
85
+		ob_start(); // Start buffering;
86
+		geodir_action_listings_title();
87
+		$gd_title = ob_get_clean();
88
+		$title_p = explode('">', $gd_title);
89
+		$title = str_replace('</h1></header>', "", $title_p[2]);
90
+		jupiter_geodir_page_title($title);
91
+	} elseif (geodir_is_page('search')) {
92
+		ob_start(); // Start buffering;
93
+		geodir_action_listings_title();
94
+		$gd_title = ob_get_clean();
95
+		$title_p = explode('">', $gd_title);
96
+		$title = str_replace('</h1></header>', "", $title_p[2]);
97
+		jupiter_geodir_page_title($title);
98
+	} elseif (geodir_is_page('author')) {
99
+		ob_start(); // Start buffering;
100
+		geodir_action_author_page_title();
101
+		$gd_title = ob_get_clean();
102
+		$gd_title = str_replace('<h1>', "", $gd_title);
103
+		$gd_title = str_replace('</h1>', "", $gd_title);
104
+		jupiter_geodir_page_title($gd_title);
105
+	} else {
106
+		mk_page_title();
107
+	}
108 108
 
109 109
 
110 110
 }
@@ -119,48 +119,48 @@  discard block
 block discarded – undo
119 119
  */
120 120
 function jupiter_geodir_breadcrumb()
121 121
 {
122
-    $item = '';
123
-    ob_start(); // Start buffering;
124
-    geodir_breadcrumb();
125
-    $gd_crums = ob_get_clean();
126
-    if ($gd_crums) {
127
-        $gd_crums = str_replace('<div class="geodir-breadcrumb clearfix"><ul id="breadcrumbs"><li>', "", $gd_crums);
128
-        $gd_crums = str_replace('</li></ul></div>', "", $gd_crums);
129
-        $gd_crums = str_replace('&nbsp;>&nbsp;', " > ", $gd_crums);
130
-        $gd_crums = str_replace('</li><li>', "", $gd_crums);
131
-        $gd_crums = explode(" > ", $gd_crums);
132
-        $trail_end = array_pop($gd_crums);
133
-        $gd_crums['trail_end'] = $trail_end;
134
-        //print_r($gd_crums);exit;
135
-        //print_r($trail);
136
-        $item = $gd_crums;
137
-
138
-    }
139
-    if (!$item) {
140
-        return;
141
-    }
142
-    global $mk_options, $post;
143
-    $post_id = global_get_post_id();
144
-
145
-    if ($post_id) {
146
-        $local_skining = get_post_meta($post_id, '_enable_local_backgrounds', true);
147
-        $breadcrumb_skin = get_post_meta($post_id, '_breadcrumb_skin', true);
148
-        if ($local_skining == 'true' && !empty($breadcrumb_skin)) {
149
-            $breadcrumb_skin_class = $breadcrumb_skin;
150
-        } else {
151
-            $breadcrumb_skin_class = $mk_options['breadcrumb_skin'];
152
-        }
153
-    } else {
154
-        $breadcrumb_skin_class = $mk_options['breadcrumb_skin'];
155
-    }
156
-
157
-
158
-    $delimiter = ' &#47; ';
159
-
160
-    echo '<div id="mk-breadcrumbs"><div class="mk-breadcrumbs-inner ' . $breadcrumb_skin_class . '-skin">';
161
-
162
-    echo implode($delimiter, $item);
163
-    echo "</div></div>";
122
+	$item = '';
123
+	ob_start(); // Start buffering;
124
+	geodir_breadcrumb();
125
+	$gd_crums = ob_get_clean();
126
+	if ($gd_crums) {
127
+		$gd_crums = str_replace('<div class="geodir-breadcrumb clearfix"><ul id="breadcrumbs"><li>', "", $gd_crums);
128
+		$gd_crums = str_replace('</li></ul></div>', "", $gd_crums);
129
+		$gd_crums = str_replace('&nbsp;>&nbsp;', " > ", $gd_crums);
130
+		$gd_crums = str_replace('</li><li>', "", $gd_crums);
131
+		$gd_crums = explode(" > ", $gd_crums);
132
+		$trail_end = array_pop($gd_crums);
133
+		$gd_crums['trail_end'] = $trail_end;
134
+		//print_r($gd_crums);exit;
135
+		//print_r($trail);
136
+		$item = $gd_crums;
137
+
138
+	}
139
+	if (!$item) {
140
+		return;
141
+	}
142
+	global $mk_options, $post;
143
+	$post_id = global_get_post_id();
144
+
145
+	if ($post_id) {
146
+		$local_skining = get_post_meta($post_id, '_enable_local_backgrounds', true);
147
+		$breadcrumb_skin = get_post_meta($post_id, '_breadcrumb_skin', true);
148
+		if ($local_skining == 'true' && !empty($breadcrumb_skin)) {
149
+			$breadcrumb_skin_class = $breadcrumb_skin;
150
+		} else {
151
+			$breadcrumb_skin_class = $mk_options['breadcrumb_skin'];
152
+		}
153
+	} else {
154
+		$breadcrumb_skin_class = $mk_options['breadcrumb_skin'];
155
+	}
156
+
157
+
158
+	$delimiter = ' &#47; ';
159
+
160
+	echo '<div id="mk-breadcrumbs"><div class="mk-breadcrumbs-inner ' . $breadcrumb_skin_class . '-skin">';
161
+
162
+	echo implode($delimiter, $item);
163
+	echo "</div></div>";
164 164
 
165 165
 }
166 166
 
@@ -174,41 +174,41 @@  discard block
 block discarded – undo
174 174
  */
175 175
 function jupiter_geodir_page_title($title = '', $subtitle = '')
176 176
 {
177
-    global $mk_options;
178
-
179
-    $post_id = global_get_post_id();
180
-    $shadow_css = '';
181
-    if ($mk_options['page_title_shadow'] == 'true') {
182
-        $shadow_css = 'mk-drop-shadow';
183
-    }
184
-
185
-    $align = !empty($align) ? $align : 'left';
186
-
187
-    //$title = 'xxxx';
188
-    echo '<section id="mk-page-introduce" class="intro-' . $align . '">';
189
-    echo '<div class="mk-grid">';
190
-    if (!empty($title)) {
191
-        echo '<h1 class="page-introduce-title ' . $shadow_css . '">' . $title . '</h1>';
192
-
193
-    }
194
-
195
-    if (!empty($subtitle)) {
196
-        echo '<div class="page-introduce-subtitle">';
197
-        echo $subtitle;
198
-        echo '</div>';
199
-    }
200
-    if ($mk_options['disable_breadcrumb'] == 'true') {
201
-        if (get_post_meta($post_id, '_disable_breadcrumb', true) != 'false') {
202
-            /**
203
-             * Calls the theme breadcrumbs for Jupiter theme.
204
-             *
205
-             * @since 1.4.0
206
-             */
207
-            do_action('theme_breadcrumbs', $post_id);
208
-        }
209
-    }
210
-
211
-    echo '<div class="clearboth"></div></div></section>';
177
+	global $mk_options;
178
+
179
+	$post_id = global_get_post_id();
180
+	$shadow_css = '';
181
+	if ($mk_options['page_title_shadow'] == 'true') {
182
+		$shadow_css = 'mk-drop-shadow';
183
+	}
184
+
185
+	$align = !empty($align) ? $align : 'left';
186
+
187
+	//$title = 'xxxx';
188
+	echo '<section id="mk-page-introduce" class="intro-' . $align . '">';
189
+	echo '<div class="mk-grid">';
190
+	if (!empty($title)) {
191
+		echo '<h1 class="page-introduce-title ' . $shadow_css . '">' . $title . '</h1>';
192
+
193
+	}
194
+
195
+	if (!empty($subtitle)) {
196
+		echo '<div class="page-introduce-subtitle">';
197
+		echo $subtitle;
198
+		echo '</div>';
199
+	}
200
+	if ($mk_options['disable_breadcrumb'] == 'true') {
201
+		if (get_post_meta($post_id, '_disable_breadcrumb', true) != 'false') {
202
+			/**
203
+			 * Calls the theme breadcrumbs for Jupiter theme.
204
+			 *
205
+			 * @since 1.4.0
206
+			 */
207
+			do_action('theme_breadcrumbs', $post_id);
208
+		}
209
+	}
210
+
211
+	echo '<div class="clearboth"></div></div></section>';
212 212
 
213 213
 
214 214
 }
Please login to merge, or discard this patch.
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/add-listing.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
 global $gd_session;
13 13
 
14 14
 if (!isset($_REQUEST['backandedit'])) {
15
-    $gd_session->un_set('listing');
15
+	$gd_session->un_set('listing');
16 16
 }
17 17
 // call header
18 18
 get_header();
Please login to merge, or discard this patch.
geodirectory-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-templates/geodir-signup.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,20 +1,20 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Template for the GD register/signup 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 register/signup 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
 /*
13 13
  * If user is not signed in, redirect home.
14 14
  */
15 15
 if (get_current_user_id()) {
16
-    wp_redirect(home_url(), 302);
17
-    exit;
16
+	wp_redirect(home_url(), 302);
17
+	exit;
18 18
 }
19 19
 
20 20
 // call header
Please login to merge, or discard this patch.