Passed
Push — master ( 905d4c...9c92c6 )
by Stiofan
09:42
created
geodirectory_hooks_actions.php 1 patch
Spacing   +177 added lines, -177 removed lines patch added patch discarded remove patch
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 /* ON TEMPLATE INCLUDE */
137 137
 /////////////////////////
138 138
 
139
-add_filter('template_include', 'geodir_template_loader',9);
139
+add_filter('template_include', 'geodir_template_loader', 9);
140 140
 
141 141
 /////////////////////////
142 142
 /* CATEGORY / TAXONOMY / CUSTOM POST ACTIONS */
@@ -176,9 +176,9 @@  discard block
 block discarded – undo
176 176
 /* WP REVIEW COUNT ACTIONS */
177 177
 ////////////////////////
178 178
 
179
-add_action('geodir_update_postrating', 'geodir_term_review_count_force_update_single_post', 100,1);
179
+add_action('geodir_update_postrating', 'geodir_term_review_count_force_update_single_post', 100, 1);
180 180
 //add_action('geodir_update_postrating', 'geodir_term_review_count_force_update', 100);
181
-add_action('transition_post_status', 'geodir_term_review_count_force_update', 100,3);
181
+add_action('transition_post_status', 'geodir_term_review_count_force_update', 100, 3);
182 182
 //add_action('created_term', 'geodir_term_review_count_force_update', 100);
183 183
 add_action('edited_term', 'geodir_term_review_count_force_update', 100);
184 184
 add_action('delete_term', 'geodir_term_review_count_force_update', 100);
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
  */
223 223
 function geodir_unset_prev_theme_nav_location($newname)
224 224
 {
225
-    $geodir_theme_location = get_option('geodir_theme_location_nav_' . $newname);
225
+    $geodir_theme_location = get_option('geodir_theme_location_nav_'.$newname);
226 226
     if ($geodir_theme_location) {
227 227
         update_option('geodir_theme_location_nav', $geodir_theme_location);
228 228
     } else {
@@ -320,8 +320,8 @@  discard block
 block discarded – undo
320 320
 
321 321
 /////// GEO DIRECOTORY CUSTOM HOOKS ///
322 322
 
323
-add_action('geodir_before_tab_content', 'geodir_before_tab_content');// this function is in custom_functions.php and it is used to wrap detail page tab content 
324
-add_action('geodir_after_tab_content', 'geodir_after_tab_content');// this function is in custom_functions.php and it is used to wrap detail page tab content
323
+add_action('geodir_before_tab_content', 'geodir_before_tab_content'); // this function is in custom_functions.php and it is used to wrap detail page tab content 
324
+add_action('geodir_after_tab_content', 'geodir_after_tab_content'); // this function is in custom_functions.php and it is used to wrap detail page tab content
325 325
 
326 326
 // Detail page sidebar content 
327 327
 add_action('geodir_detail_page_sidebar', 'geodir_detail_page_sidebar_content_sorting', 1);
@@ -422,8 +422,8 @@  discard block
 block discarded – undo
422 422
     do_action('geodir_after_social_sharing_buttons');
423 423
     $content_html = ob_get_clean();
424 424
     if (trim($content_html) != '')
425
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-social-sharing">' . $content_html . '</div>';
426
-    if ((int)get_option('geodir_disable_tfg_buttons_section') != 1) {
425
+        $content_html = '<div class="geodir-company_info geodir-details-sidebar-social-sharing">'.$content_html.'</div>';
426
+    if ((int) get_option('geodir_disable_tfg_buttons_section') != 1) {
427 427
         /**
428 428
          * Filter the geodir_social_sharing_buttons() function content.
429 429
          *
@@ -469,8 +469,8 @@  discard block
 block discarded – undo
469 469
     do_action('geodir_after_share_this_button');
470 470
     $content_html = ob_get_clean();
471 471
     if (trim($content_html) != '')
472
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-sharethis">' . $content_html . '</div>';
473
-    if ((int)get_option('geodir_disable_sharethis_button_section') != 1) {
472
+        $content_html = '<div class="geodir-company_info geodir-details-sidebar-sharethis">'.$content_html.'</div>';
473
+    if ((int) get_option('geodir_disable_sharethis_button_section') != 1) {
474 474
         /**
475 475
          * Filter the geodir_share_this_button() function content.
476 476
          *
@@ -509,12 +509,12 @@  discard block
 block discarded – undo
509 509
             $post_id = $post->ID;
510 510
             
511 511
             if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
512
-                $post_id = (int)$_REQUEST['pid'];
512
+                $post_id = (int) $_REQUEST['pid'];
513 513
             }
514 514
 
515 515
             $postlink = get_permalink(geodir_add_listing_page_id());
516 516
             $editlink = geodir_getlink($postlink, array('pid' => $post_id), false);
517
-            echo ' <p class="edit_link"><i class="fa fa-pencil"></i> <a href="' . esc_url($editlink) . '">' . __('Edit this Post', 'geodirectory') . '</a></p>';
517
+            echo ' <p class="edit_link"><i class="fa fa-pencil"></i> <a href="'.esc_url($editlink).'">'.__('Edit this Post', 'geodirectory').'</a></p>';
518 518
         }
519 519
     }// end of if, if its a preview or not
520 520
     /**
@@ -525,8 +525,8 @@  discard block
 block discarded – undo
525 525
     do_action('geodir_after_edit_post_link');
526 526
     $content_html = ob_get_clean();
527 527
     if (trim($content_html) != '')
528
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-user-links">' . $content_html . '</div>';
529
-    if ((int)get_option('geodir_disable_user_links_section') != 1) {
528
+        $content_html = '<div class="geodir-company_info geodir-details-sidebar-user-links">'.$content_html.'</div>';
529
+    if ((int) get_option('geodir_disable_user_links_section') != 1) {
530 530
         /**
531 531
          * Filter the geodir_edit_post_link() function content.
532 532
          *
@@ -579,14 +579,14 @@  discard block
 block discarded – undo
579 579
     $hide_refresh = get_option('geodir_ga_auto_refresh');
580 580
     
581 581
     $auto_refresh = $hide_refresh && $refresh_time && $refresh_time > 0 ? 1 : 0;
582
-    if (get_option('geodir_ga_stats') && is_user_logged_in() &&  (isset($package_info->google_analytics) && $package_info->google_analytics == '1') && (get_current_user_id()==$post->post_author || current_user_can( 'manage_options' )) ) {
582
+    if (get_option('geodir_ga_stats') && is_user_logged_in() && (isset($package_info->google_analytics) && $package_info->google_analytics == '1') && (get_current_user_id() == $post->post_author || current_user_can('manage_options'))) {
583 583
         $page_url = urlencode($_SERVER['REQUEST_URI']);
584 584
         ?>
585 585
         <script type="text/javascript">
586 586
             var gd_gaTimeOut;
587
-            var gd_gaTime = parseInt('<?php echo $refresh_time;?>');
588
-            var gd_gaHideRefresh = <?php echo (int)$hide_refresh;?>;
589
-            var gd_gaAutoRefresh = <?php echo $auto_refresh;?>;
587
+            var gd_gaTime = parseInt('<?php echo $refresh_time; ?>');
588
+            var gd_gaHideRefresh = <?php echo (int) $hide_refresh; ?>;
589
+            var gd_gaAutoRefresh = <?php echo $auto_refresh; ?>;
590 590
             ga_data1 = false;
591 591
             ga_data2 = false;
592 592
             ga_data3 = false;
@@ -727,7 +727,7 @@  discard block
 block discarded – undo
727 727
             }
728 728
 
729 729
             function gdga_noResults() {
730
-                jQuery('#gdga-chart-container').html('<?php _e('No results available','geodirectory');?>');
730
+                jQuery('#gdga-chart-container').html('<?php _e('No results available', 'geodirectory'); ?>');
731 731
                 jQuery('#gdga-legend-container').html('');
732 732
             }
733 733
 
@@ -759,18 +759,18 @@  discard block
 block discarded – undo
759 759
                     var data2 = results[1].rows.map(function(row) { return +row[2]; });
760 760
                     //var labelsN = results[0].rows.map(function(row) { return +row[1]; });
761 761
 
762
-                    var labels = ['<?php _e('Jan', 'geodirectory');?>',
763
-                        '<?php _e('Feb', 'geodirectory');?>',
764
-                        '<?php _e('Mar', 'geodirectory');?>',
765
-                        '<?php _e('Apr', 'geodirectory');?>',
766
-                        '<?php _e('May', 'geodirectory');?>',
767
-                        '<?php _e('Jun', 'geodirectory');?>',
768
-                        '<?php _e('Jul', 'geodirectory');?>',
769
-                        '<?php _e('Aug', 'geodirectory');?>',
770
-                        '<?php _e('Sep', 'geodirectory');?>',
771
-                        '<?php _e('Oct', 'geodirectory');?>',
772
-                        '<?php _e('Nov', 'geodirectory');?>',
773
-                        '<?php _e('Dec', 'geodirectory');?>'];
762
+                    var labels = ['<?php _e('Jan', 'geodirectory'); ?>',
763
+                        '<?php _e('Feb', 'geodirectory'); ?>',
764
+                        '<?php _e('Mar', 'geodirectory'); ?>',
765
+                        '<?php _e('Apr', 'geodirectory'); ?>',
766
+                        '<?php _e('May', 'geodirectory'); ?>',
767
+                        '<?php _e('Jun', 'geodirectory'); ?>',
768
+                        '<?php _e('Jul', 'geodirectory'); ?>',
769
+                        '<?php _e('Aug', 'geodirectory'); ?>',
770
+                        '<?php _e('Sep', 'geodirectory'); ?>',
771
+                        '<?php _e('Oct', 'geodirectory'); ?>',
772
+                        '<?php _e('Nov', 'geodirectory'); ?>',
773
+                        '<?php _e('Dec', 'geodirectory'); ?>'];
774 774
 
775 775
                     // Ensure the data arrays are at least as long as the labels array.
776 776
                     // Chart.js bar charts don't (yet) accept sparse datasets.
@@ -783,13 +783,13 @@  discard block
 block discarded – undo
783 783
                         labels : labels,
784 784
                         datasets : [
785 785
                             {
786
-                                label: '<?php _e('Last Year', 'geodirectory');?>',
786
+                                label: '<?php _e('Last Year', 'geodirectory'); ?>',
787 787
                                 fillColor : "rgba(220,220,220,0.5)",
788 788
                                 strokeColor : "rgba(220,220,220,1)",
789 789
                                 data : data2
790 790
                             },
791 791
                             {
792
-                                label: '<?php _e('This Year', 'geodirectory');?>',
792
+                                label: '<?php _e('This Year', 'geodirectory'); ?>',
793 793
                                 fillColor : "rgba(151,187,205,0.5)",
794 794
                                 strokeColor : "rgba(151,187,205,1)",
795 795
                                 data : data1
@@ -834,30 +834,30 @@  discard block
 block discarded – undo
834 834
 
835 835
                     <?php
836 836
                     // Here we list the shorthand days of the week so it can be used in translation.
837
-                    __("Mon",'geodirectory');
838
-                    __("Tue",'geodirectory');
839
-                    __("Wed",'geodirectory');
840
-                    __("Thu",'geodirectory');
841
-                    __("Fri",'geodirectory');
842
-                    __("Sat",'geodirectory');
843
-                    __("Sun",'geodirectory');
837
+                    __("Mon", 'geodirectory');
838
+                    __("Tue", 'geodirectory');
839
+                    __("Wed", 'geodirectory');
840
+                    __("Thu", 'geodirectory');
841
+                    __("Fri", 'geodirectory');
842
+                    __("Sat", 'geodirectory');
843
+                    __("Sun", 'geodirectory');
844 844
                     ?>
845 845
 
846 846
                     labels = [
847
-                        "<?php _e(date('D', strtotime("+1 day")),'geodirectory'); ?>",
848
-                        "<?php _e(date('D', strtotime("+2 day")),'geodirectory'); ?>",
849
-                        "<?php _e(date('D', strtotime("+3 day")),'geodirectory'); ?>",
850
-                        "<?php _e(date('D', strtotime("+4 day")),'geodirectory'); ?>",
851
-                        "<?php _e(date('D', strtotime("+5 day")),'geodirectory'); ?>",
852
-                        "<?php _e(date('D', strtotime("+6 day")),'geodirectory'); ?>",
853
-                        "<?php _e(date('D', strtotime("+7 day")),'geodirectory'); ?>"
847
+                        "<?php _e(date('D', strtotime("+1 day")), 'geodirectory'); ?>",
848
+                        "<?php _e(date('D', strtotime("+2 day")), 'geodirectory'); ?>",
849
+                        "<?php _e(date('D', strtotime("+3 day")), 'geodirectory'); ?>",
850
+                        "<?php _e(date('D', strtotime("+4 day")), 'geodirectory'); ?>",
851
+                        "<?php _e(date('D', strtotime("+5 day")), 'geodirectory'); ?>",
852
+                        "<?php _e(date('D', strtotime("+6 day")), 'geodirectory'); ?>",
853
+                        "<?php _e(date('D', strtotime("+7 day")), 'geodirectory'); ?>"
854 854
                     ];
855 855
 
856 856
                     var data = {
857 857
                         labels : labels,
858 858
                         datasets : [
859 859
                             {
860
-                                label: '<?php _e('Last Week', 'geodirectory');?>',
860
+                                label: '<?php _e('Last Week', 'geodirectory'); ?>',
861 861
                                 fillColor : "rgba(220,220,220,0.5)",
862 862
                                 strokeColor : "rgba(220,220,220,1)",
863 863
                                 pointColor : "rgba(220,220,220,1)",
@@ -865,7 +865,7 @@  discard block
 block discarded – undo
865 865
                                 data : data2
866 866
                             },
867 867
                             {
868
-                                label: '<?php _e('This Week', 'geodirectory');?>',
868
+                                label: '<?php _e('This Week', 'geodirectory'); ?>',
869 869
                                 fillColor : "rgba(151,187,205,0.5)",
870 870
                                 strokeColor : "rgba(151,187,205,1)",
871 871
                                 pointColor : "rgba(151,187,205,1)",
@@ -1072,18 +1072,18 @@  discard block
 block discarded – undo
1072 1072
         </style>
1073 1073
         <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.2/Chart.min.js"></script>
1074 1074
         <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.2/moment.min.js"></script>
1075
-        <button type="button" class="gdga-show-analytics"><?php _e('Show Google Analytics', 'geodirectory');?></button>
1075
+        <button type="button" class="gdga-show-analytics"><?php _e('Show Google Analytics', 'geodirectory'); ?></button>
1076 1076
         <span id="ga_stats" class="gdga-analytics-box" style="display:none">
1077
-            <div id="ga-analytics-title"><?php _e("Analytics", 'geodirectory');?></div>
1077
+            <div id="ga-analytics-title"><?php _e("Analytics", 'geodirectory'); ?></div>
1078 1078
             <div id="gd-active-users-container">
1079
-                <div class="gd-ActiveUsers"><i id="gdga-loader-icon" class="fa fa-refresh fa-spin" title="<?php esc_attr_e("Refresh", 'geodirectory');?>"></i><?php _e("Active Users:", 'geodirectory');?>
1079
+                <div class="gd-ActiveUsers"><i id="gdga-loader-icon" class="fa fa-refresh fa-spin" title="<?php esc_attr_e("Refresh", 'geodirectory'); ?>"></i><?php _e("Active Users:", 'geodirectory'); ?>
1080 1080
                     <b class="gd-ActiveUsers-value">0</b>
1081 1081
                 </div>
1082 1082
             </div>
1083 1083
             <select id="gdga-select-analytic" onchange="gdga_select_option();" style="display: none;">
1084
-                <option value="weeks"><?php _e("Last Week vs This Week", 'geodirectory');?></option>
1085
-                <option value="years"><?php _e("This Year vs Last Year", 'geodirectory');?></option>
1086
-                <option value="country"><?php _e("Top Countries", 'geodirectory');?></option>
1084
+                <option value="weeks"><?php _e("Last Week vs This Week", 'geodirectory'); ?></option>
1085
+                <option value="years"><?php _e("This Year vs Last Year", 'geodirectory'); ?></option>
1086
+                <option value="country"><?php _e("Top Countries", 'geodirectory'); ?></option>
1087 1087
             </select>
1088 1088
             <div class="Chartjs-figure" id="gdga-chart-container"></div>
1089 1089
             <ol class="Chartjs-legend" id="gdga-legend-container"></ol>
@@ -1099,8 +1099,8 @@  discard block
 block discarded – undo
1099 1099
     do_action('geodir_after_google_analytics');
1100 1100
     $content_html = ob_get_clean();
1101 1101
     if (trim($content_html) != '')
1102
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-google-analytics">' . $content_html . '</div>';
1103
-    if ((int)get_option('geodir_disable_google_analytics_section') != 1) {
1102
+        $content_html = '<div class="geodir-company_info geodir-details-sidebar-google-analytics">'.$content_html.'</div>';
1103
+    if ((int) get_option('geodir_disable_google_analytics_section') != 1) {
1104 1104
         /**
1105 1105
          * Filter the geodir_edit_post_link() function content.
1106 1106
          *
@@ -1156,10 +1156,10 @@  discard block
 block discarded – undo
1156 1156
        
1157 1157
 	   $reviews_text = $comment_count > 1 ? __("reviews", 'geodirectory') : __("review", 'geodirectory');
1158 1158
 	   
1159
-	   $html .= '<span itemprop="rating" itemscope itemtype="http://data-vocabulary.org/Rating"><span class="rating" itemprop="average" content="' . $post_avgratings . '">' . $post_avgratings . '</span> / <span itemprop="best" content="5">5</span> ' . __("based on", 'geodirectory') . ' </span><span class="count" itemprop="count" content="' . $comment_count . '">' . $comment_count . ' ' . $reviews_text . '</span><br />';
1159
+	   $html .= '<span itemprop="rating" itemscope itemtype="http://data-vocabulary.org/Rating"><span class="rating" itemprop="average" content="'.$post_avgratings.'">'.$post_avgratings.'</span> / <span itemprop="best" content="5">5</span> '.__("based on", 'geodirectory').' </span><span class="count" itemprop="count" content="'.$comment_count.'">'.$comment_count.' '.$reviews_text.'</span><br />';
1160 1160
 
1161 1161
         $html .= '<span class="item">';
1162
-        $html .= '<span class="fn" itemprop="itemreviewed">' . $post->post_title . '</span>';
1162
+        $html .= '<span class="fn" itemprop="itemreviewed">'.$post->post_title.'</span>';
1163 1163
 
1164 1164
         if ($post_images) {
1165 1165
             foreach ($post_images as $img) {
@@ -1169,7 +1169,7 @@  discard block
 block discarded – undo
1169 1169
         }
1170 1170
 
1171 1171
         if (isset($post_img) && $post_img) {
1172
-            $html .= '<br /><img src="' . $post_img . '" class="photo" alt="' . esc_attr($post->post_title) . '" itemprop="photo" content="' . $post_img . '" class="photo" />';
1172
+            $html .= '<br /><img src="'.$post_img.'" class="photo" alt="'.esc_attr($post->post_title).'" itemprop="photo" content="'.$post_img.'" class="photo" />';
1173 1173
         }
1174 1174
 
1175 1175
         $html .= '</span>';
@@ -1196,9 +1196,9 @@  discard block
 block discarded – undo
1196 1196
     do_action('geodir_after_detail_page_review_rating');
1197 1197
     $content_html = ob_get_clean();
1198 1198
     if (trim($content_html) != '') {
1199
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-rating">' . $content_html . '</div>';
1199
+        $content_html = '<div class="geodir-company_info geodir-details-sidebar-rating">'.$content_html.'</div>';
1200 1200
     }
1201
-    if ((int)get_option('geodir_disable_rating_info_section') != 1) {
1201
+    if ((int) get_option('geodir_disable_rating_info_section') != 1) {
1202 1202
         /**
1203 1203
          * Filter the geodir_detail_page_review_rating() function content.
1204 1204
          *
@@ -1237,8 +1237,8 @@  discard block
 block discarded – undo
1237 1237
 
1238 1238
     $content_html = ob_get_clean();
1239 1239
     if (trim($content_html) != '')
1240
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-listing-info">' . $content_html . '</div>';
1241
-    if ((int)get_option('geodir_disable_listing_info_section') != 1) {
1240
+        $content_html = '<div class="geodir-company_info geodir-details-sidebar-listing-info">'.$content_html.'</div>';
1241
+    if ((int) get_option('geodir_disable_listing_info_section') != 1) {
1242 1242
         /**
1243 1243
          * Filter the output html for function geodir_detail_page_more_info().
1244 1244
          *
@@ -1336,7 +1336,7 @@  discard block
 block discarded – undo
1336 1336
 		'gd_allowed_img_types' => !empty($allowed_img_types) ? implode(',', $allowed_img_types) : '',
1337 1337
 		'geodir_txt_form_wait' => __('Wait...', 'geodirectory'),
1338 1338
 		'geodir_txt_form_searching' => __('Searching...', 'geodirectory'),
1339
-		'fa_rating' => (int)get_option('geodir_reviewrating_enable_font_awesome') == 1 ? 1 : '',
1339
+		'fa_rating' => (int) get_option('geodir_reviewrating_enable_font_awesome') == 1 ? 1 : '',
1340 1340
 		'reviewrating' => defined('GEODIRREVIEWRATING_VERSION') ? 1 : '',
1341 1341
         'geodir_map_name' => geodir_map_name(),
1342 1342
     );
@@ -1354,10 +1354,10 @@  discard block
 block discarded – undo
1354 1354
     foreach ($arr_alert_msg as $key => $value) {
1355 1355
         if (!is_scalar($value))
1356 1356
             continue;
1357
-        $arr_alert_msg[$key] = html_entity_decode((string)$value, ENT_QUOTES, 'UTF-8');
1357
+        $arr_alert_msg[$key] = html_entity_decode((string) $value, ENT_QUOTES, 'UTF-8');
1358 1358
     }
1359 1359
 
1360
-    $script = "var geodir_all_js_msg = " . json_encode($arr_alert_msg) . ';';
1360
+    $script = "var geodir_all_js_msg = ".json_encode($arr_alert_msg).';';
1361 1361
     echo '<script>';
1362 1362
     echo $script;
1363 1363
     echo '</script>';
@@ -1445,7 +1445,7 @@  discard block
 block discarded – undo
1445 1445
         $geodir_old_sidebars = get_option('geodir_sidebars');
1446 1446
         if (is_array($geodir_old_sidebars)) {
1447 1447
             foreach ($geodir_old_sidebars as $key => $val) {
1448
-                if(0 === strpos($key, 'geodir_'))// if gd widget
1448
+                if (0 === strpos($key, 'geodir_'))// if gd widget
1449 1449
                 {
1450 1450
                     $sidebars_widgets[$key] = $geodir_old_sidebars[$key];
1451 1451
                 }
@@ -1524,7 +1524,7 @@  discard block
 block discarded – undo
1524 1524
         global $post;
1525 1525
         $term_condition = '';
1526 1526
         if (isset($_REQUEST['backandedit'])) {
1527
-            $post = (object)$gd_session->get('listing');
1527
+            $post = (object) $gd_session->get('listing');
1528 1528
             $term_condition = isset($post->geodir_accept_term_condition) ? $post->geodir_accept_term_condition : '';
1529 1529
         }
1530 1530
 
@@ -1538,7 +1538,7 @@  discard block
 block discarded – undo
1538 1538
                     echo 'checked="checked"';
1539 1539
                 } ?> field_type="checkbox" name="geodir_accept_term_condition" id="geodir_accept_term_condition"
1540 1540
                        class="geodir_textfield" value="1"
1541
-                       style="display:inline-block"/><a href="<?php $terms_page = get_option('geodir_term_condition_page'); if($terms_page){ echo get_permalink($terms_page);}?>" target="_blank"><?php _e('Please accept our terms and conditions', 'geodirectory'); ?></a>
1541
+                       style="display:inline-block"/><a href="<?php $terms_page = get_option('geodir_term_condition_page'); if ($terms_page) { echo get_permalink($terms_page); }?>" target="_blank"><?php _e('Please accept our terms and conditions', 'geodirectory'); ?></a>
1542 1542
 				</span>
1543 1543
             </div>
1544 1544
             <span class="geodir_message_error"><?php if (isset($required_msg)) {
@@ -1578,7 +1578,7 @@  discard block
 block discarded – undo
1578 1578
         /** This action is documented in geodirectory_template_actions.php */
1579 1579
         $desc_limit = apply_filters('geodir_description_field_desc_limit', '');
1580 1580
         
1581
-        if (!($desc_limit === '' || (int)$desc_limit > 0)) {
1581
+        if (!($desc_limit === '' || (int) $desc_limit > 0)) {
1582 1582
             $is_display = false;
1583 1583
         }
1584 1584
     }
@@ -1626,16 +1626,16 @@  discard block
 block discarded – undo
1626 1626
     global $wpdb, $plugin_prefix;
1627 1627
 	
1628 1628
 	// Remove unused virtual page
1629
-	$listings_page_id = (int)get_option('geodir_listing_page');
1629
+	$listings_page_id = (int) get_option('geodir_listing_page');
1630 1630
 	if ($listings_page_id) {
1631
-		$wpdb->query($wpdb->prepare("DELETE FROM " . $wpdb->posts . " WHERE ID=%d AND post_name = %s AND post_type=%s", array($listings_page_id, 'listings', 'page')));
1631
+		$wpdb->query($wpdb->prepare("DELETE FROM ".$wpdb->posts." WHERE ID=%d AND post_name = %s AND post_type=%s", array($listings_page_id, 'listings', 'page')));
1632 1632
         delete_option('geodir_listing_page');
1633 1633
 	}
1634 1634
 
1635 1635
     if (!get_option('geodir_changes_in_custom_fields_table')) {
1636 1636
         $wpdb->query(
1637 1637
             $wpdb->prepare(
1638
-                "UPDATE " . GEODIR_CUSTOM_FIELDS_TABLE . " SET is_default=%s, is_admin=%s WHERE is_default=%s",
1638
+                "UPDATE ".GEODIR_CUSTOM_FIELDS_TABLE." SET is_default=%s, is_admin=%s WHERE is_default=%s",
1639 1639
                 array('1', '1', 'admin')
1640 1640
             )
1641 1641
         );
@@ -1643,9 +1643,9 @@  discard block
 block discarded – undo
1643 1643
 
1644 1644
         /* --- terms meta value set --- */
1645 1645
 
1646
-        update_option('geodir_default_marker_icon', geodir_plugin_url() . '/geodirectory-functions/map-functions/icons/pin.png');
1646
+        update_option('geodir_default_marker_icon', geodir_plugin_url().'/geodirectory-functions/map-functions/icons/pin.png');
1647 1647
 
1648
-        $options_data = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "options WHERE option_name LIKE %s", array('%tax_meta_%')));
1648
+        $options_data = $wpdb->get_results($wpdb->prepare("SELECT * FROM ".$wpdb->prefix."options WHERE option_name LIKE %s", array('%tax_meta_%')));
1649 1649
 
1650 1650
         if (!empty($options_data)) {
1651 1651
 
@@ -1653,7 +1653,7 @@  discard block
 block discarded – undo
1653 1653
 
1654 1654
                 $option_val = str_replace('tax_meta_', '', $optobj->option_name);
1655 1655
 
1656
-                $taxonomies_data = $wpdb->get_results($wpdb->prepare("SELECT taxonomy FROM " . $wpdb->prefix . "term_taxonomy WHERE taxonomy LIKE %s AND term_id=%d", array('%category%', $option_val)));
1656
+                $taxonomies_data = $wpdb->get_results($wpdb->prepare("SELECT taxonomy FROM ".$wpdb->prefix."term_taxonomy WHERE taxonomy LIKE %s AND term_id=%d", array('%category%', $option_val)));
1657 1657
 
1658 1658
                 if (!empty($taxonomies_data)) {
1659 1659
 
@@ -1662,17 +1662,17 @@  discard block
 block discarded – undo
1662 1662
                         $taxObject = get_taxonomy($taxobj->taxonomy);
1663 1663
                         $post_type = $taxObject->object_type[0];
1664 1664
 
1665
-                        $opt_value = 'tax_meta_' . $post_type . '_' . $option_val;
1665
+                        $opt_value = 'tax_meta_'.$post_type.'_'.$option_val;
1666 1666
 
1667
-                        $duplicate_data = $wpdb->get_var($wpdb->prepare("SELECT option_id FROM " . $wpdb->prefix . "options WHERE option_name=%s", array('tax_meta_' . $option_val)));
1667
+                        $duplicate_data = $wpdb->get_var($wpdb->prepare("SELECT option_id FROM ".$wpdb->prefix."options WHERE option_name=%s", array('tax_meta_'.$option_val)));
1668 1668
 
1669 1669
                         if ($duplicate_data) {
1670 1670
 
1671
-                            $wpdb->query($wpdb->prepare("UPDATE " . $wpdb->prefix . "options SET	option_name=%s WHERE option_id=%d", array($opt_value, $optobj->option_id)));
1671
+                            $wpdb->query($wpdb->prepare("UPDATE ".$wpdb->prefix."options SET	option_name=%s WHERE option_id=%d", array($opt_value, $optobj->option_id)));
1672 1672
 
1673 1673
                         } else {
1674 1674
 
1675
-                            $wpdb->query($wpdb->prepare("INSERT INTO " . $wpdb->prefix . "options (option_name,option_value,autoload) VALUES (%s, %s, %s)", array($opt_value, $optobj->option_value, $optobj->autoload)));
1675
+                            $wpdb->query($wpdb->prepare("INSERT INTO ".$wpdb->prefix."options (option_name,option_value,autoload) VALUES (%s, %s, %s)", array($opt_value, $optobj->option_value, $optobj->autoload)));
1676 1676
 
1677 1677
                         }
1678 1678
 
@@ -1706,14 +1706,14 @@  discard block
 block discarded – undo
1706 1706
 
1707 1707
     global $wpdb, $table_prefix;
1708 1708
 
1709
-    $slug_exists = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($slug)));
1709
+    $slug_exists = $wpdb->get_var($wpdb->prepare("SELECT slug FROM ".$table_prefix."terms WHERE slug=%s", array($slug)));
1710 1710
 
1711 1711
     if ($slug_exists) {
1712 1712
 
1713 1713
         $suffix = 1;
1714 1714
         do {
1715
-            $alt_location_name = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix";
1716
-            $location_slug_check = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($alt_location_name)));
1715
+            $alt_location_name = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1))."-$suffix";
1716
+            $location_slug_check = $wpdb->get_var($wpdb->prepare("SELECT slug FROM ".$table_prefix."terms WHERE slug=%s", array($alt_location_name)));
1717 1717
             $suffix++;
1718 1718
         } while ($location_slug_check && $suffix < 100);
1719 1719
 
@@ -1767,7 +1767,7 @@  discard block
 block discarded – undo
1767 1767
 
1768 1768
         $suffix = 1;
1769 1769
         do {
1770
-            $new_slug = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix";
1770
+            $new_slug = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1))."-$suffix";
1771 1771
 
1772 1772
             /** This action is documented in geodirectory_hooks_actions.php */
1773 1773
             $term_slug_check = apply_filters('geodir_term_slug_is_exists', false, $new_slug, $term_id);
@@ -1779,7 +1779,7 @@  discard block
 block discarded – undo
1779 1779
 
1780 1780
         //wp_update_term( $term_id, $taxonomy, array('slug' => $slug) );
1781 1781
 
1782
-        $wpdb->query($wpdb->prepare("UPDATE " . $table_prefix . "terms SET slug=%s WHERE term_id=%d", array($slug, $term_id)));
1782
+        $wpdb->query($wpdb->prepare("UPDATE ".$table_prefix."terms SET slug=%s WHERE term_id=%d", array($slug, $term_id)));
1783 1783
 
1784 1784
     }
1785 1785
 	
@@ -1788,18 +1788,18 @@  discard block
 block discarded – undo
1788 1788
 	$post_type = !empty($taxonomy_obj) ? $taxonomy_obj->object_type[0] : NULL;
1789 1789
 	
1790 1790
 	$post_types = geodir_get_posttypes();
1791
-	if ($post_type && in_array($post_type, $post_types) && $post_type . '_tags' == $taxonomy) {		
1792
-		$posts_obj = $wpdb->get_results($wpdb->prepare("SELECT object_id FROM " . $wpdb->term_relationships . " WHERE term_taxonomy_id = %d", array($tt_id)));
1791
+	if ($post_type && in_array($post_type, $post_types) && $post_type.'_tags' == $taxonomy) {		
1792
+		$posts_obj = $wpdb->get_results($wpdb->prepare("SELECT object_id FROM ".$wpdb->term_relationships." WHERE term_taxonomy_id = %d", array($tt_id)));
1793 1793
 		
1794 1794
 		if (!empty($posts_obj)) {
1795 1795
 			foreach ($posts_obj as $post_obj) {
1796 1796
 				$post_id = $post_obj->object_id;
1797 1797
 				
1798
-				$raw_tags = wp_get_object_terms($post_id, $post_type . '_tags', array('fields' => 'names'));
1798
+				$raw_tags = wp_get_object_terms($post_id, $post_type.'_tags', array('fields' => 'names'));
1799 1799
 				$post_tags = !empty($raw_tags) ? implode(',', $raw_tags) : '';
1800 1800
 				
1801
-				$listing_table = $plugin_prefix . $post_type . '_detail';
1802
-				$wpdb->query($wpdb->prepare("UPDATE " . $listing_table . " SET post_tags=%s WHERE post_id =%d", array($post_tags, $post_id)));
1801
+				$listing_table = $plugin_prefix.$post_type.'_detail';
1802
+				$wpdb->query($wpdb->prepare("UPDATE ".$listing_table." SET post_tags=%s WHERE post_id =%d", array($post_tags, $post_id)));
1803 1803
 			}
1804 1804
 		}
1805 1805
 	}
@@ -1833,7 +1833,7 @@  discard block
 block discarded – undo
1833 1833
     if ($country_slug == $slug || $region_slug == $slug || $city_slug == $slug)
1834 1834
         return $slug_exists = true;
1835 1835
 
1836
-    if ($wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s AND term_id != %d", array($slug, $term_id))))
1836
+    if ($wpdb->get_var($wpdb->prepare("SELECT slug FROM ".$table_prefix."terms WHERE slug=%s AND term_id != %d", array($slug, $term_id))))
1837 1837
         return $slug_exists = true;
1838 1838
 
1839 1839
     return $slug_exists;
@@ -1873,43 +1873,43 @@  discard block
 block discarded – undo
1873 1873
 
1874 1874
 
1875 1875
     $gd_page = '';
1876
-    if(geodir_is_page('home')){
1876
+    if (geodir_is_page('home')) {
1877 1877
         $gd_page = 'home';
1878 1878
         $title = (get_option('geodir_meta_title_homepage')) ? get_option('geodir_meta_title_homepage') : $title;
1879 1879
     }
1880
-    elseif(geodir_is_page('detail')){
1880
+    elseif (geodir_is_page('detail')) {
1881 1881
         $gd_page = 'detail';
1882 1882
         $title = (get_option('geodir_meta_title_detail')) ? get_option('geodir_meta_title_detail') : $title;
1883 1883
     }
1884
-    elseif(geodir_is_page('pt')){
1884
+    elseif (geodir_is_page('pt')) {
1885 1885
         $gd_page = 'pt';
1886 1886
         $title = (get_option('geodir_meta_title_pt')) ? get_option('geodir_meta_title_pt') : $title;
1887 1887
     }
1888
-    elseif(geodir_is_page('listing')){
1888
+    elseif (geodir_is_page('listing')) {
1889 1889
         $gd_page = 'listing';
1890 1890
         $title = (get_option('geodir_meta_title_listing')) ? get_option('geodir_meta_title_listing') : $title;
1891 1891
     }
1892
-    elseif(geodir_is_page('location')){
1892
+    elseif (geodir_is_page('location')) {
1893 1893
         $gd_page = 'location';
1894 1894
         $title = (get_option('geodir_meta_title_location')) ? get_option('geodir_meta_title_location') : $title;
1895 1895
     }
1896
-    elseif(geodir_is_page('search')){
1896
+    elseif (geodir_is_page('search')) {
1897 1897
         $gd_page = 'search';
1898 1898
         $title = (get_option('geodir_meta_title_search')) ? get_option('geodir_meta_title_search') : $title;
1899 1899
     }
1900
-    elseif(geodir_is_page('add-listing')){
1900
+    elseif (geodir_is_page('add-listing')) {
1901 1901
         $gd_page = 'add-listing';
1902 1902
         $title = (get_option('geodir_meta_title_add-listing')) ? get_option('geodir_meta_title_add-listing') : $title;
1903 1903
     }
1904
-    elseif(geodir_is_page('author')){
1904
+    elseif (geodir_is_page('author')) {
1905 1905
         $gd_page = 'author';
1906 1906
         $title = (get_option('geodir_meta_title_author')) ? get_option('geodir_meta_title_author') : $title;
1907 1907
     }
1908
-    elseif(geodir_is_page('login')){
1908
+    elseif (geodir_is_page('login')) {
1909 1909
         $gd_page = 'login';
1910 1910
         $title = (get_option('geodir_meta_title_login')) ? get_option('geodir_meta_title_login') : $title;
1911 1911
     }
1912
-    elseif(geodir_is_page('listing-success')){
1912
+    elseif (geodir_is_page('listing-success')) {
1913 1913
         $gd_page = 'listing-success';
1914 1914
         $title = (get_option('geodir_meta_title_listing-success')) ? get_option('geodir_meta_title_listing-success') : $title;
1915 1915
     }
@@ -1941,8 +1941,8 @@  discard block
 block discarded – undo
1941 1941
 
1942 1942
     if (!get_option('geodir_set_post_attachments')) {
1943 1943
 
1944
-        require_once(ABSPATH . 'wp-admin/includes/image.php');
1945
-        require_once(ABSPATH . 'wp-admin/includes/file.php');
1944
+        require_once(ABSPATH.'wp-admin/includes/image.php');
1945
+        require_once(ABSPATH.'wp-admin/includes/file.php');
1946 1946
 
1947 1947
         $all_postypes = geodir_get_posttypes();
1948 1948
 
@@ -2143,7 +2143,7 @@  discard block
 block discarded – undo
2143 2143
 
2144 2144
         if (array_key_exists('post_video', $tabs_arr)) {
2145 2145
 
2146
-            $field_title = $wpdb->get_var($wpdb->prepare("select site_title from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array('geodir_video', $post_type)));
2146
+            $field_title = $wpdb->get_var($wpdb->prepare("select site_title from ".GEODIR_CUSTOM_FIELDS_TABLE." where htmlvar_name = %s and post_type = %s ", array('geodir_video', $post_type)));
2147 2147
 
2148 2148
             if (isset($tabs_arr['post_video']['heading_text']) && $field_title != '')
2149 2149
                 $tabs_arr['post_video']['heading_text'] = $field_title;
@@ -2151,7 +2151,7 @@  discard block
 block discarded – undo
2151 2151
 
2152 2152
         if (array_key_exists('special_offers', $tabs_arr)) {
2153 2153
 
2154
-            $field_title = $wpdb->get_var($wpdb->prepare("select site_title from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array('geodir_special_offers', $post_type)));
2154
+            $field_title = $wpdb->get_var($wpdb->prepare("select site_title from ".GEODIR_CUSTOM_FIELDS_TABLE." where htmlvar_name = %s and post_type = %s ", array('geodir_special_offers', $post_type)));
2155 2155
 
2156 2156
             if (isset($tabs_arr['special_offers']['heading_text']) && $field_title != '')
2157 2157
                 $tabs_arr['special_offers']['heading_text'] = $field_title;
@@ -2172,7 +2172,7 @@  discard block
 block discarded – undo
2172 2172
  */
2173 2173
 function geodir_remove_template_redirect_actions()
2174 2174
 {
2175
-    if (geodir_is_page('login')){
2175
+    if (geodir_is_page('login')) {
2176 2176
         remove_all_actions('template_redirect');
2177 2177
         remove_action('init', 'avia_modify_front', 10);
2178 2178
     }
@@ -2219,25 +2219,25 @@  discard block
 block discarded – undo
2219 2219
         $split_img_file_path = isset($split_img_path[1]) ? $split_img_path[1] : '';
2220 2220
 
2221 2221
         $wpdb->query(
2222
-            $wpdb->prepare("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id = %d AND file=%s ",
2222
+            $wpdb->prepare("DELETE FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id = %d AND file=%s ",
2223 2223
                 array($post_id, $split_img_file_path)
2224 2224
             )
2225 2225
         );
2226 2226
 
2227 2227
         $attachment_data = $wpdb->get_row(
2228
-            $wpdb->prepare("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=%d",
2228
+            $wpdb->prepare("SELECT ID, MIN(`menu_order`) FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id=%d",
2229 2229
                 array($post_id)
2230 2230
             )
2231 2231
         );
2232 2232
 
2233 2233
         if (!empty($attachment_data)) {
2234
-            $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
2234
+            $wpdb->query("UPDATE ".GEODIR_ATTACHMENT_TABLE." SET menu_order=1 WHERE ID=".$attachment_data->ID);
2235 2235
         }
2236 2236
 
2237 2237
 
2238
-        $table_name = $plugin_prefix . $post_type . '_detail';
2238
+        $table_name = $plugin_prefix.$post_type.'_detail';
2239 2239
 
2240
-        $wpdb->query("UPDATE " . $table_name . " SET featured_image='' WHERE post_id =" . $post_id);
2240
+        $wpdb->query("UPDATE ".$table_name." SET featured_image='' WHERE post_id =".$post_id);
2241 2241
 
2242 2242
         geodir_set_wp_featured_image($post_id);
2243 2243
 
@@ -2265,9 +2265,9 @@  discard block
 block discarded – undo
2265 2265
 
2266 2266
     foreach ($all_postypes as $posttype) {
2267 2267
 
2268
-        $tablename = $plugin_prefix . $posttype . '_detail';
2268
+        $tablename = $plugin_prefix.$posttype.'_detail';
2269 2269
 
2270
-        $get_post_data = $wpdb->get_results("SELECT post_id FROM " . $tablename);
2270
+        $get_post_data = $wpdb->get_results("SELECT post_id FROM ".$tablename);
2271 2271
 
2272 2272
         if (!empty($get_post_data)) {
2273 2273
 
@@ -2275,7 +2275,7 @@  discard block
 block discarded – undo
2275 2275
 
2276 2276
                 $post_id = $data->post_id;
2277 2277
 
2278
-                $attachment_data = $wpdb->get_results("SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id =" . $post_id . " AND file!=''");
2278
+                $attachment_data = $wpdb->get_results("SELECT * FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id =".$post_id." AND file!=''");
2279 2279
 
2280 2280
                 if (!empty($attachment_data)) {
2281 2281
 
@@ -2292,22 +2292,22 @@  discard block
 block discarded – undo
2292 2292
 
2293 2293
                         $file_name = $file_info['basename'];
2294 2294
 
2295
-                        $img_arr['path'] = $uploads_path . $sub_dir . '/' . $file_name;
2295
+                        $img_arr['path'] = $uploads_path.$sub_dir.'/'.$file_name;
2296 2296
 
2297 2297
                         if (!file_exists($img_arr['path'])) {
2298 2298
 
2299
-                            $wpdb->query("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE ID=" . $attach->ID);
2299
+                            $wpdb->query("DELETE FROM ".GEODIR_ATTACHMENT_TABLE." WHERE ID=".$attach->ID);
2300 2300
 
2301 2301
                         }
2302 2302
 
2303 2303
                     }
2304 2304
 
2305
-                    $attachment_data = $wpdb->get_row("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=" . $post_id . " GROUP BY post_id");
2305
+                    $attachment_data = $wpdb->get_row("SELECT ID, MIN(`menu_order`) FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id=".$post_id." GROUP BY post_id");
2306 2306
 
2307 2307
                     if (!empty($attachment_data)) {
2308 2308
 
2309 2309
                         if ($attachment_data->ID)
2310
-                            $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
2310
+                            $wpdb->query("UPDATE ".GEODIR_ATTACHMENT_TABLE." SET menu_order=1 WHERE ID=".$attachment_data->ID);
2311 2311
 
2312 2312
                     } else {
2313 2313
 
@@ -2321,7 +2321,7 @@  discard block
 block discarded – undo
2321 2321
 
2322 2322
                     }
2323 2323
 
2324
-                    $wpdb->query("UPDATE " . $tablename . " SET featured_image='' WHERE post_id =" . $post_id);
2324
+                    $wpdb->query("UPDATE ".$tablename." SET featured_image='' WHERE post_id =".$post_id);
2325 2325
 
2326 2326
                     geodir_set_wp_featured_image($post_id);
2327 2327
 
@@ -2350,7 +2350,7 @@  discard block
 block discarded – undo
2350 2350
 {
2351 2351
 
2352 2352
     if (!get_option('geodir_default_rating_star_icon')) {
2353
-        update_option('geodir_default_rating_star_icon', geodir_plugin_url() . '/geodirectory-assets/images/stars.png');
2353
+        update_option('geodir_default_rating_star_icon', geodir_plugin_url().'/geodirectory-assets/images/stars.png');
2354 2354
     }
2355 2355
 
2356 2356
 }
@@ -2367,10 +2367,10 @@  discard block
 block discarded – undo
2367 2367
  * @global string $plugin_prefix Geodirectory plugin table prefix.
2368 2368
  * @return array User listing count for each post type.
2369 2369
  */
2370
-function geodir_user_post_listing_count($user_id=null)
2370
+function geodir_user_post_listing_count($user_id = null)
2371 2371
 {
2372 2372
     global $wpdb, $plugin_prefix, $current_user;
2373
-    if(!$user_id){
2373
+    if (!$user_id) {
2374 2374
         $user_id = $current_user->ID;
2375 2375
     }
2376 2376
 
@@ -2381,7 +2381,7 @@  discard block
 block discarded – undo
2381 2381
     $user_listing = array();
2382 2382
     if (is_array($all_posts) && !empty($all_posts)) {
2383 2383
         foreach ($all_posts as $ptype) {
2384
-            $total_posts = $wpdb->get_var("SELECT count( ID ) FROM " . $wpdb->prefix . "posts WHERE post_author=" . $user_id . " AND post_type='" . $ptype . "' AND ( post_status = 'publish' OR post_status = 'draft' OR post_status = 'private' )");
2384
+            $total_posts = $wpdb->get_var("SELECT count( ID ) FROM ".$wpdb->prefix."posts WHERE post_author=".$user_id." AND post_type='".$ptype."' AND ( post_status = 'publish' OR post_status = 'draft' OR post_status = 'private' )");
2385 2385
 
2386 2386
             if ($total_posts > 0) {
2387 2387
                 $user_listing[$ptype] = $total_posts;
@@ -2482,9 +2482,9 @@  discard block
 block discarded – undo
2482 2482
                     }
2483 2483
 
2484 2484
                     if (strpos($type['field_icon'], 'http') !== false) {
2485
-                        $field_icon = ' background: url(' . $type['field_icon'] . ') no-repeat left center;background-size:18px 18px;padding-left: 21px;';
2485
+                        $field_icon = ' background: url('.$type['field_icon'].') no-repeat left center;background-size:18px 18px;padding-left: 21px;';
2486 2486
                     } elseif (strpos($type['field_icon'], 'fa fa-') !== false) {
2487
-                        $field_icon = '<i class="' . $type['field_icon'] . '"></i>';
2487
+                        $field_icon = '<i class="'.$type['field_icon'].'"></i>';
2488 2488
                     }
2489 2489
 
2490 2490
                     switch ($type['type']) {
@@ -2492,7 +2492,7 @@  discard block
 block discarded – undo
2492 2492
                             $i = 0;
2493 2493
                             $fieldset_count++;
2494 2494
                             $field_set_start = 1;
2495
-                            $fieldset_arr[$fieldset_count]['htmlvar_name'] = 'gd_tab_' . $fieldset_count;
2495
+                            $fieldset_arr[$fieldset_count]['htmlvar_name'] = 'gd_tab_'.$fieldset_count;
2496 2496
                             $fieldset_arr[$fieldset_count]['label'] = $label;
2497 2497
                         }
2498 2498
                             break;
@@ -2525,7 +2525,7 @@  discard block
 block discarded – undo
2525 2525
                             // all search engines that use the nofollow value exclude links that use it from their ranking calculation
2526 2526
                             $rel = strpos($website, get_site_url()) !== false ? '' : 'rel="nofollow"';
2527 2527
 
2528
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '"><span class="geodir-i-website" style="' . $field_icon . '">' . $field_icon_af . ' <a href="' . $website . '" target="_blank" ' . $rel . ' ><strong>' .
2528
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'"><span class="geodir-i-website" style="'.$field_icon.'">'.$field_icon_af.' <a href="'.$website.'" target="_blank" '.$rel.' ><strong>'.
2529 2529
                                 /**
2530 2530
                                  * Filer the custom field website name.
2531 2531
                                  *
@@ -2534,7 +2534,7 @@  discard block
 block discarded – undo
2534 2534
                                  * @param string $website The website address.
2535 2535
                                  * @param int $post->ID The post ID.
2536 2536
                                  */
2537
-                                apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID) . '</strong></a></span></div>';
2537
+                                apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID).'</strong></a></span></div>';
2538 2538
                         }
2539 2539
                             break;
2540 2540
                         case 'phone': {
@@ -2549,11 +2549,11 @@  discard block
 block discarded – undo
2549 2549
 
2550 2550
                             $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2551 2551
 
2552
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-contact" style="' . $field_icon . '">' . $field_icon_af;
2552
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-contact" style="'.$field_icon.'">'.$field_icon_af;
2553 2553
                             if ($field_set_start == 1 && $site_title != '') {
2554
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2554
+                                $html .= ' '.__($site_title, 'geodirectory').': ';
2555 2555
                             }
2556
-                            $html .= ' </span>' . stripslashes($post->{$type['htmlvar_name']}) . '</div>';
2556
+                            $html .= ' </span>'.stripslashes($post->{$type['htmlvar_name']}).'</div>';
2557 2557
                         }
2558 2558
                             break;
2559 2559
                         case 'time': {
@@ -2572,11 +2572,11 @@  discard block
 block discarded – undo
2572 2572
 
2573 2573
                             $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2574 2574
 
2575
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-time" style="' . $field_icon . '">' . $field_icon_af;
2575
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-time" style="'.$field_icon.'">'.$field_icon_af;
2576 2576
                             if ($field_set_start == 1 && $site_title != '') {
2577
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2577
+                                $html .= ' '.__($site_title, 'geodirectory').': ';
2578 2578
                             }
2579
-                            $html .= ' </span>' . stripslashes($value) . '</div>';
2579
+                            $html .= ' </span>'.stripslashes($value).'</div>';
2580 2580
                         }
2581 2581
                             break;
2582 2582
                         case 'datepicker': {
@@ -2586,8 +2586,8 @@  discard block
 block discarded – undo
2586 2586
                                 $date_format = $date_format['date_format'];
2587 2587
                             }
2588 2588
 
2589
-                            $search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format
2590
-                            $replace = array('d','j','l','m','n','F','Y');//PHP date format
2589
+                            $search = array('dd', 'd', 'DD', 'mm', 'm', 'MM', 'yy'); //jQuery UI datepicker format
2590
+                            $replace = array('d', 'j', 'l', 'm', 'n', 'F', 'Y'); //PHP date format
2591 2591
 
2592 2592
                             $date_format = str_replace($search, $replace, $date_format);
2593 2593
 
@@ -2608,11 +2608,11 @@  discard block
 block discarded – undo
2608 2608
 
2609 2609
                             $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2610 2610
 
2611
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-datepicker" style="' . $field_icon . '">' . $field_icon_af;
2611
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-datepicker" style="'.$field_icon.'">'.$field_icon_af;
2612 2612
                             if ($field_set_start == 1 && $site_title != '') {
2613
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2613
+                                $html .= ' '.__($site_title, 'geodirectory').': ';
2614 2614
                             }
2615
-                            $html .= ' </span>' . $value . '</div>';
2615
+                            $html .= ' </span>'.$value.'</div>';
2616 2616
                         }
2617 2617
                             break;
2618 2618
                         case 'text': {
@@ -2627,11 +2627,11 @@  discard block
 block discarded – undo
2627 2627
 
2628 2628
                             $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2629 2629
 
2630
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
2630
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-text" style="'.$field_icon.'">'.$field_icon_af;
2631 2631
                             if ($field_set_start == 1 && $site_title != '') {
2632
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2632
+                                $html .= ' '.__($site_title, 'geodirectory').': ';
2633 2633
                             }
2634
-                            $html .= ' </span>' . stripslashes($post->{$type['htmlvar_name']}) . '</div>';
2634
+                            $html .= ' </span>'.stripslashes($post->{$type['htmlvar_name']}).'</div>';
2635 2635
                         }
2636 2636
                             break;
2637 2637
                         case 'radio': {
@@ -2668,13 +2668,13 @@  discard block
 block discarded – undo
2668 2668
 
2669 2669
                                 $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2670 2670
 
2671
-                                $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-radio" style="' . $field_icon . '">' . $field_icon_af;
2671
+                                $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-radio" style="'.$field_icon.'">'.$field_icon_af;
2672 2672
 
2673 2673
                                 if ($field_set_start == 1 && $site_title != '') {
2674
-                                    $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2674
+                                    $html .= ' '.__($site_title, 'geodirectory').': ';
2675 2675
                                 }
2676 2676
 
2677
-                                $html .= ' </span>' . $html_val . '</div>';
2677
+                                $html .= ' </span>'.$html_val.'</div>';
2678 2678
                             }
2679 2679
                         }
2680 2680
                             break;
@@ -2682,7 +2682,7 @@  discard block
 block discarded – undo
2682 2682
                             $html_var = $type['htmlvar_name'];
2683 2683
                             $html_val = $type['htmlvar_name'];
2684 2684
 
2685
-                            if ((int)$post->{$html_var} == 1) {
2685
+                            if ((int) $post->{$html_var} == 1) {
2686 2686
 
2687 2687
                                 if ($post->{$type['htmlvar_name']} == '1') {
2688 2688
                                     $html_val = __('Yes', 'geodirectory');
@@ -2701,13 +2701,13 @@  discard block
 block discarded – undo
2701 2701
 
2702 2702
                                 $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2703 2703
 
2704
-                                $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-checkbox" style="' . $field_icon . '">' . $field_icon_af;
2704
+                                $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-checkbox" style="'.$field_icon.'">'.$field_icon_af;
2705 2705
 
2706 2706
                                 if ($field_set_start == 1 && $site_title != '') {
2707
-                                    $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2707
+                                    $html .= ' '.__($site_title, 'geodirectory').': ';
2708 2708
                                 }
2709 2709
 
2710
-                                $html .= ' </span>' . $html_val . '</div>';
2710
+                                $html .= ' </span>'.$html_val.'</div>';
2711 2711
                             }
2712 2712
                         }
2713 2713
                             break;
@@ -2737,11 +2737,11 @@  discard block
 block discarded – undo
2737 2737
 
2738 2738
                             $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2739 2739
 
2740
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
2740
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-select" style="'.$field_icon.'">'.$field_icon_af;
2741 2741
                             if ($field_set_start == 1 && $site_title != '') {
2742
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2742
+                                $html .= ' '.__($site_title, 'geodirectory').': ';
2743 2743
                             }
2744
-                            $html .= ' </span>' . $field_value . '</div>';
2744
+                            $html .= ' </span>'.$field_value.'</div>';
2745 2745
                         }
2746 2746
                             break;
2747 2747
                         case 'multiselect': {
@@ -2775,16 +2775,16 @@  discard block
 block discarded – undo
2775 2775
 
2776 2776
                             $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2777 2777
 
2778
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
2778
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-select" style="'.$field_icon.'">'.$field_icon_af;
2779 2779
                             if ($field_set_start == 1 && $site_title != '') {
2780
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2780
+                                $html .= ' '.__($site_title, 'geodirectory').': ';
2781 2781
                             }
2782 2782
                             $html .= ' </span>';
2783 2783
 
2784 2784
                             if (count($option_values) > 1) {
2785 2785
                                 $html .= '<ul>';
2786 2786
                                 foreach ($option_values as $val) {
2787
-                                    $html .= '<li>' . $val . '</li>';
2787
+                                    $html .= '<li>'.$val.'</li>';
2788 2788
                                 }
2789 2789
                                 $html .= '</ul>';
2790 2790
                             } else {
@@ -2805,11 +2805,11 @@  discard block
 block discarded – undo
2805 2805
 
2806 2806
                             $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2807 2807
 
2808
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af;
2808
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-email" style="'.$field_icon.'">'.$field_icon_af;
2809 2809
                             if ($field_set_start == 1 && $site_title != '') {
2810
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2810
+                                $html .= ' '.__($site_title, 'geodirectory').': ';
2811 2811
                             }
2812
-                            $html .= ' </span>' . stripslashes($post->{$type['htmlvar_name']}) . '</div>';
2812
+                            $html .= ' </span>'.stripslashes($post->{$type['htmlvar_name']}).'</div>';
2813 2813
                         }
2814 2814
                             break;
2815 2815
                         case 'textarea': {
@@ -2824,11 +2824,11 @@  discard block
 block discarded – undo
2824 2824
 
2825 2825
                             $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2826 2826
 
2827
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
2827
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-text" style="'.$field_icon.'">'.$field_icon_af;
2828 2828
                             if ($field_set_start == 1 && $site_title != '') {
2829
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2829
+                                $html .= ' '.__($site_title, 'geodirectory').': ';
2830 2830
                             }
2831
-                            $html .= '</span>' . wpautop(stripslashes($post->{$type['htmlvar_name']})) . '</div>';
2831
+                            $html .= '</span>'.wpautop(stripslashes($post->{$type['htmlvar_name']})).'</div>';
2832 2832
                         }
2833 2833
                             break;
2834 2834
                         case 'html': {
@@ -2843,11 +2843,11 @@  discard block
 block discarded – undo
2843 2843
 
2844 2844
                             $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2845 2845
 
2846
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
2846
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-text" style="'.$field_icon.'">'.$field_icon_af;
2847 2847
                             if ($field_set_start == 1 && $site_title != '') {
2848
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2848
+                                $html .= ' '.__($site_title, 'geodirectory').': ';
2849 2849
                             }
2850
-                            $html .= ' </span>' . wpautop(stripslashes($post->{$type['htmlvar_name']})) . '</div>';
2850
+                            $html .= ' </span>'.wpautop(stripslashes($post->{$type['htmlvar_name']})).'</div>';
2851 2851
                         }
2852 2852
                         break;
2853 2853
                         case 'file': {
@@ -2858,7 +2858,7 @@  discard block
 block discarded – undo
2858 2858
 
2859 2859
                                 if (!empty($files)) {
2860 2860
                                     $extra_fields = !empty($type['extra_fields']) ? maybe_unserialize($type['extra_fields']) : NULL;
2861
-                                    $allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types'] ) ? $extra_fields['gd_file_types'] : '';
2861
+                                    $allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types']) ? $extra_fields['gd_file_types'] : '';
2862 2862
                                
2863 2863
                                     $file_paths = '';
2864 2864
                                     foreach ($files as $file) {
@@ -2887,9 +2887,9 @@  discard block
 block discarded – undo
2887 2887
                                                 $file_paths .= '</a>';
2888 2888
                                                 $file_paths .= '</div>';
2889 2889
                                             } else {
2890
-                                                $ext_path = '_' . $html_var . '_';
2890
+                                                $ext_path = '_'.$html_var.'_';
2891 2891
                                                 $filename = explode($ext_path, $filename);
2892
-                                                $file_paths .= '<a href="' . $file . '" target="_blank">' . $filename[count($filename) - 1] . '</a>';
2892
+                                                $file_paths .= '<a href="'.$file.'" target="_blank">'.$filename[count($filename) - 1].'</a>';
2893 2893
                                             }
2894 2894
                                         }
2895 2895
                                     }
@@ -2906,13 +2906,13 @@  discard block
 block discarded – undo
2906 2906
                                     $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2907 2907
 
2908 2908
 
2909
-                                    $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . ' geodir-custom-file-box" style="clear:both;"><span class="geodir-i-file" style="display:inline-block;vertical-align:top;padding-right:14px;' . $field_icon . '">' . $field_icon_af;
2909
+                                    $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].' geodir-custom-file-box" style="clear:both;"><span class="geodir-i-file" style="display:inline-block;vertical-align:top;padding-right:14px;'.$field_icon.'">'.$field_icon_af;
2910 2910
 
2911 2911
                                     if ($field_set_start == 1 && $site_title != '') {
2912
-                                        $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2912
+                                        $html .= ' '.__($site_title, 'geodirectory').': ';
2913 2913
                                     }
2914 2914
 
2915
-                                    $html .= ' </span>' . $file_paths . '</div>';
2915
+                                    $html .= ' </span>'.$file_paths.'</div>';
2916 2916
                                 }
2917 2917
                             }
2918 2918
                         }
@@ -2963,7 +2963,7 @@  discard block
 block discarded – undo
2963 2963
                                  * @param string $htmlvar_name The field HTML var name.
2964 2964
                                  */
2965 2965
                                 'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, $htmlvar_name),
2966
-                                'tab_content' => '<div class="geodir-company_info field-group">' . $fieldset_html . '</html>'
2966
+                                'tab_content' => '<div class="geodir-company_info field-group">'.$fieldset_html.'</html>'
2967 2967
                             );
2968 2968
                         }
2969 2969
                     } else {
@@ -3023,7 +3023,7 @@  discard block
 block discarded – undo
3023 3023
             }
3024 3024
             $status .= ")</strong>";
3025 3025
 
3026
-            $html = '<span class="geodir-post-status">' . $status_icon . ' <font class="geodir-status-label">' . __('Status: ', 'geodirectory') . '</font>' . $status . '</span>';
3026
+            $html = '<span class="geodir-post-status">'.$status_icon.' <font class="geodir-status-label">'.__('Status: ', 'geodirectory').'</font>'.$status.'</span>';
3027 3027
         }
3028 3028
     }
3029 3029
 
@@ -3103,7 +3103,7 @@  discard block
 block discarded – undo
3103 3103
 function geodir_no_rating_comment_text($content, $comment = '')
3104 3104
 {
3105 3105
     if (!is_admin()) {
3106
-        return '<div class="description">' . $content . '</div>';
3106
+        return '<div class="description">'.$content.'</div>';
3107 3107
     } else {
3108 3108
         return $content;
3109 3109
     }
@@ -3181,7 +3181,7 @@  discard block
 block discarded – undo
3181 3181
         $classes[] = 'gd-no-rating';
3182 3182
     }
3183 3183
     
3184
-    $classes[] = 'gd-map-' . geodir_map_name();
3184
+    $classes[] = 'gd-map-'.geodir_map_name();
3185 3185
 
3186 3186
     return $classes;
3187 3187
 }
@@ -3201,7 +3201,7 @@  discard block
 block discarded – undo
3201 3201
         $class .= ' gd-no-rating';
3202 3202
     }
3203 3203
     
3204
-    $class .= ' gd-map-' . geodir_map_name();
3204
+    $class .= ' gd-map-'.geodir_map_name();
3205 3205
 
3206 3206
     return $class;
3207 3207
 }
@@ -3236,7 +3236,7 @@  discard block
 block discarded – undo
3236 3236
  * @return array Translation texts.
3237 3237
  */
3238 3238
 function geodir_load_gd_options_text_translation($translation_texts = array()) {
3239
-    $translation_texts = !empty( $translation_texts ) && is_array( $translation_texts ) ? $translation_texts : array();
3239
+    $translation_texts = !empty($translation_texts) && is_array($translation_texts) ? $translation_texts : array();
3240 3240
 
3241 3241
     $gd_options = array('geodir_post_submited_success_email_subject_admin', 'geodir_post_submited_success_email_content_admin', 'geodir_post_submited_success_email_subject', 'geodir_post_submited_success_email_content', 'geodir_forgot_password_subject', 'geodir_forgot_password_content', 'geodir_registration_success_email_subject', 'geodir_registration_success_email_content', 'geodir_post_published_email_subject', 'geodir_post_published_email_content', 'geodir_email_friend_subject', 'geodir_email_friend_content', 'geodir_email_enquiry_subject', 'geodir_email_enquiry_content', 'geodir_post_added_success_msg_content', 'geodir_post_edited_email_subject_admin', 'geodir_post_edited_email_content_admin');
3242 3242
 
Please login to merge, or discard this patch.
geodirectory_template_tags.php 1 patch
Spacing   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -38,21 +38,21 @@  discard block
 block discarded – undo
38 38
     $is_detail_page = false;
39 39
     $geodir_map_name = geodir_map_name();
40 40
 
41
-    if((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview') )) {
41
+    if ((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview'))) {
42 42
         $is_detail_page = true;
43 43
     }
44 44
 
45 45
     wp_enqueue_script('jquery');
46 46
 
47
-    wp_register_script('geodirectory-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory.min.js#asyncload', array(), GEODIRECTORY_VERSION);
47
+    wp_register_script('geodirectory-script', geodir_plugin_url().'/geodirectory-assets/js/geodirectory.min.js#asyncload', array(), GEODIRECTORY_VERSION);
48 48
     wp_enqueue_script('geodirectory-script');
49 49
 
50 50
     $geodir_vars_data = array(
51 51
         'siteurl' => get_option('siteurl'),
52 52
         'geodir_plugin_url' => geodir_plugin_url(),
53
-        'geodir_lazy_load' => get_option('geodir_lazy_load',1),
53
+        'geodir_lazy_load' => get_option('geodir_lazy_load', 1),
54 54
         'geodir_ajax_url' => geodir_get_ajax_url(),
55
-        'geodir_gd_modal' => (int)get_option('geodir_disable_gb_modal'),
55
+        'geodir_gd_modal' => (int) get_option('geodir_disable_gb_modal'),
56 56
         'is_rtl' => is_rtl() ? 1 : 0 // fix rtl issue
57 57
     );
58 58
 
@@ -73,23 +73,23 @@  discard block
 block discarded – undo
73 73
      *
74 74
      * }
75 75
      */
76
-    $geodir_vars_data = apply_filters('geodir_vars_data',$geodir_vars_data);
76
+    $geodir_vars_data = apply_filters('geodir_vars_data', $geodir_vars_data);
77 77
 
78 78
     wp_localize_script('geodirectory-script', 'geodir_var', $geodir_vars_data);
79 79
 
80
-    wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION,true);
81
-    if($is_detail_page){wp_enqueue_script('geodirectory-jquery-flexslider-js');}
80
+    wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url().'/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION, true);
81
+    if ($is_detail_page) {wp_enqueue_script('geodirectory-jquery-flexslider-js'); }
82 82
 
83
-    wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url() . '/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION,true);
83
+    wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url().'/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION, true);
84 84
     wp_enqueue_script('geodirectory-lightbox-jquery');
85 85
 
86
-    wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url() . '/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION,true);
86
+    wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url().'/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION, true);
87 87
     if ($is_detail_page) {
88 88
         wp_enqueue_script('geodirectory-jquery-simplemodal');
89 89
     }
90 90
 
91 91
     if (in_array($geodir_map_name, array('auto', 'google'))) {
92
-        $map_lang = "&language=" . geodir_get_map_default_language();
92
+        $map_lang = "&language=".geodir_get_map_default_language();
93 93
         /**
94 94
          * Filter the variables that are added to the end of the google maps script call.
95 95
          *
@@ -99,40 +99,40 @@  discard block
 block discarded – undo
99 99
          * @param string $var The string to filter, default is empty string.
100 100
          */
101 101
         $map_extra = apply_filters('geodir_googlemap_script_extra', '');
102
-        wp_enqueue_script('geodirectory-googlemap-script', '//maps.google.com/maps/api/js?' . $map_lang . $map_extra, '', NULL);
102
+        wp_enqueue_script('geodirectory-googlemap-script', '//maps.google.com/maps/api/js?'.$map_lang.$map_extra, '', NULL);
103 103
     }
104 104
     
105 105
     if ($geodir_map_name == 'osm') {
106 106
         // Leaflet OpenStreetMap
107
-        wp_register_style('geodirectory-leaflet-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
107
+        wp_register_style('geodirectory-leaflet-style', geodir_plugin_url().'/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
108 108
         wp_enqueue_style('geodirectory-leaflet-style');
109 109
             
110
-        wp_register_script('geodirectory-leaflet-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION);
110
+        wp_register_script('geodirectory-leaflet-script', geodir_plugin_url().'/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION);
111 111
         wp_enqueue_script('geodirectory-leaflet-script');
112 112
         
113
-        wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/osm.geocode.js', array(), GEODIRECTORY_VERSION);
113
+        wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url().'/geodirectory-assets/leaflet/osm.geocode.js', array(), GEODIRECTORY_VERSION);
114 114
         wp_enqueue_script('geodirectory-leaflet-geo-script');
115 115
     }
116
-    wp_enqueue_script( 'jquery-ui-autocomplete' );
116
+    wp_enqueue_script('jquery-ui-autocomplete');
117 117
     
118
-    wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION,true);
118
+    wp_register_script('geodirectory-goMap-script', geodir_plugin_url().'/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION, true);
119 119
     wp_enqueue_script('geodirectory-goMap-script');
120 120
 
121 121
 
122
-    wp_register_script('chosen', geodir_plugin_url() . '/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
122
+    wp_register_script('chosen', geodir_plugin_url().'/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
123 123
     wp_enqueue_script('chosen');
124 124
 
125
-    wp_register_script('geodirectory-choose-ajax', geodir_plugin_url() . '/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION);
125
+    wp_register_script('geodirectory-choose-ajax', geodir_plugin_url().'/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION);
126 126
     wp_enqueue_script('geodirectory-choose-ajax');
127 127
 
128
-    wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.ui.timepicker.min.js#asyncload', array('jquery-ui-datepicker', 'jquery-ui-slider', 'jquery-effects-core', 'jquery-effects-slide'), '', true);
128
+    wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url().'/geodirectory-assets/js/jquery.ui.timepicker.min.js#asyncload', array('jquery-ui-datepicker', 'jquery-ui-slider', 'jquery-effects-core', 'jquery-effects-slide'), '', true);
129 129
 
130 130
     if (is_page() && geodir_is_page('add-listing')) {
131 131
         // SCRIPT FOR UPLOAD
132 132
         wp_enqueue_script('plupload-all');
133 133
         wp_enqueue_script('jquery-ui-sortable');
134 134
 
135
-        wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION,true);
135
+        wp_register_script('geodirectory-plupload-script', geodir_plugin_url().'/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
136 136
         wp_enqueue_script('geodirectory-plupload-script');
137 137
         // SCRIPT FOR UPLOAD END
138 138
 
@@ -179,27 +179,27 @@  discard block
 block discarded – undo
179 179
 
180 180
         wp_localize_script('geodirectory-plupload-script', 'gd_plupload', $gd_plupload_init);
181 181
 
182
-        wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url() . '/geodirectory-assets/js/listing_validation.min.js#asyncload');
182
+        wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url().'/geodirectory-assets/js/listing_validation.min.js#asyncload');
183 183
     } // End if for add place page
184 184
 
185
-    wp_register_script('geodirectory-post-custom-js', geodir_plugin_url() . '/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
185
+    wp_register_script('geodirectory-post-custom-js', geodir_plugin_url().'/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
186 186
     if ($is_detail_page) {
187 187
 		wp_enqueue_script('geodirectory-post-custom-js');
188 188
 	}
189 189
 
190 190
     // font awesome rating script
191 191
 	if (get_option('geodir_reviewrating_enable_font_awesome')) {
192
-		wp_register_script('geodir-barrating-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION, true);
192
+		wp_register_script('geodir-barrating-js', geodir_plugin_url().'/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION, true);
193 193
 		wp_enqueue_script('geodir-barrating-js');
194 194
 	} else { // default rating script
195
-		wp_register_script('geodir-jRating-js', geodir_plugin_url() . '/geodirectory-assets/js/jRating.jquery.min.js', array(), GEODIRECTORY_VERSION, true);
195
+		wp_register_script('geodir-jRating-js', geodir_plugin_url().'/geodirectory-assets/js/jRating.jquery.min.js', array(), GEODIRECTORY_VERSION, true);
196 196
 		wp_enqueue_script('geodir-jRating-js');
197 197
 	}
198 198
 
199
-    wp_register_script('geodir-on-document-load', geodir_plugin_url() . '/geodirectory-assets/js/on_document_load.js#asyncload', array(), GEODIRECTORY_VERSION, true);
199
+    wp_register_script('geodir-on-document-load', geodir_plugin_url().'/geodirectory-assets/js/on_document_load.js#asyncload', array(), GEODIRECTORY_VERSION, true);
200 200
     wp_enqueue_script('geodir-on-document-load');
201 201
 
202
-    wp_register_script('google-geometa', geodir_plugin_url() . '/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
202
+    wp_register_script('google-geometa', geodir_plugin_url().'/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
203 203
     wp_enqueue_script('google-geometa');
204 204
 }
205 205
 
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
  */
215 215
 function geodir_header_scripts()
216 216
 {
217
-    echo '<style>' . stripslashes(get_option('geodir_coustem_css')) . '</style>';
217
+    echo '<style>'.stripslashes(get_option('geodir_coustem_css')).'</style>';
218 218
     echo stripslashes(get_option('geodir_header_scripts'));
219 219
 }
220 220
 
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
  */
246 246
 function geodir_add_async_forscript($url)
247 247
 {
248
-    if (strpos($url, '#asyncload')===false)
248
+    if (strpos($url, '#asyncload') === false)
249 249
         return $url;
250 250
     else if (is_admin())
251 251
         return str_replace('#asyncload', '', $url);
@@ -263,12 +263,12 @@  discard block
 block discarded – undo
263 263
 function geodir_templates_styles()
264 264
 {
265 265
 
266
-    wp_register_style('geodir-core-scss', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
266
+    wp_register_style('geodir-core-scss', geodir_plugin_url().'/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
267 267
     wp_enqueue_style('geodir-core-scss');
268
-    wp_register_style('geodir-core-scss-footer', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION);
268
+    wp_register_style('geodir-core-scss-footer', geodir_plugin_url().'/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION);
269 269
 
270
-    if(is_rtl()){
271
-    wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url() . '/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION);
270
+    if (is_rtl()) {
271
+    wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url().'/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION);
272 272
     wp_enqueue_style('geodirectory-frontend-rtl-style');
273 273
     }
274 274
 
@@ -342,18 +342,18 @@  discard block
 block discarded – undo
342 342
                 $term_id = get_queried_object_id();
343 343
                 $taxonomy = get_query_var('taxonomy');
344 344
 
345
-                if ($term_id && $post_type && get_query_var('taxonomy') == $post_type . 'category' ) {
346
-                    $term = get_term($term_id, $post_type . 'category');
345
+                if ($term_id && $post_type && get_query_var('taxonomy') == $post_type.'category') {
346
+                    $term = get_term($term_id, $post_type.'category');
347 347
                 }
348 348
             }
349 349
             
350
-            if (geodir_is_page('search') && !empty($_REQUEST['s' . $post_type . 'category'])) {
351
-                $taxonomy_search = $_REQUEST['s' . $post_type . 'category'];
350
+            if (geodir_is_page('search') && !empty($_REQUEST['s'.$post_type.'category'])) {
351
+                $taxonomy_search = $_REQUEST['s'.$post_type.'category'];
352 352
                 
353 353
                 if (!is_array($taxonomy_search)) {
354
-                    $term = get_term((int)$taxonomy_search, $post_type . 'category');
355
-                } else if(is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search
356
-                    $term = get_term((int)$taxonomy_search[0], $post_type . 'category');
354
+                    $term = get_term((int) $taxonomy_search, $post_type.'category');
355
+                } else if (is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search
356
+                    $term = get_term((int) $taxonomy_search[0], $post_type.'category');
357 357
                 }
358 358
             }
359 359
             
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
         if ($max_page > 1 || $always_show) {            
366 366
             // Extra pagination info
367 367
             $geodir_pagination_more_info = get_option('geodir_pagination_advance_info');
368
-            $start_no = ( $paged - 1 ) * $posts_per_page + 1;
368
+            $start_no = ($paged - 1) * $posts_per_page + 1;
369 369
             $end_no = min($paged * $posts_per_page, $numposts);
370 370
 
371 371
             if ($geodir_pagination_more_info != '') {
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
                 } else {
376 376
                     $pegination_desc = wp_sprintf(__('Showing listings %d-%d of %d', 'geodirectory'), $start_no, $end_no, $numposts);
377 377
                 }
378
-                $pagination_info = '<div class="gd-pagination-details">' . $pegination_desc . '</div>';
378
+                $pagination_info = '<div class="gd-pagination-details">'.$pegination_desc.'</div>';
379 379
                 /**
380 380
                  * Adds an extra pagination info above/under pagination.
381 381
                  *
@@ -391,15 +391,15 @@  discard block
 block discarded – undo
391 391
                 $pagination_info = apply_filters('geodir_pagination_advance_info', $pagination_info, $listing_type_name, $start_no, $end_no, $numposts, $post_type);
392 392
                 
393 393
                 if ($geodir_pagination_more_info == 'before') {
394
-                    $before = $before . $pagination_info;
394
+                    $before = $before.$pagination_info;
395 395
                 } else if ($geodir_pagination_more_info == 'after') {
396
-                    $after = $pagination_info . $after;
396
+                    $after = $pagination_info.$after;
397 397
                 }
398 398
             }
399 399
             
400 400
             echo "$before <div class='Navi gd-navi'>";
401 401
             if ($paged >= ($pages_to_show - 1)) {
402
-                echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link()) . '">&laquo;</a>';
402
+                echo '<a href="'.str_replace('&paged', '&amp;paged', get_pagenum_link()).'">&laquo;</a>';
403 403
             }
404 404
             previous_posts_link($prelabel);
405 405
             for ($i = $paged - $half_pages_to_show; $i <= $paged + $half_pages_to_show; $i++) {
@@ -407,13 +407,13 @@  discard block
 block discarded – undo
407 407
                     if ($i == $paged) {
408 408
                         echo "<strong class='on'>$i</strong>";
409 409
                     } else {
410
-                        echo ' <a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($i)) . '">' . $i . '</a> ';
410
+                        echo ' <a href="'.str_replace('&paged', '&amp;paged', get_pagenum_link($i)).'">'.$i.'</a> ';
411 411
                     }
412 412
                 }
413 413
             }
414 414
             next_posts_link($nxtlabel, $max_page);
415 415
             if (($paged + $half_pages_to_show) < ($max_page)) {
416
-                echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($max_page)) . '">&raquo;</a>';
416
+                echo '<a href="'.str_replace('&paged', '&amp;paged', get_pagenum_link($max_page)).'">&raquo;</a>';
417 417
             }
418 418
             echo "</div> $after";
419 419
         }
@@ -451,7 +451,7 @@  discard block
 block discarded – undo
451 451
         jQuery(function ($) {
452 452
             $("#distance_slider").slider({
453 453
                 range: true,
454
-                values: [0, <?php echo ($_REQUEST['sdist']!='') ? sanitize_text_field($_REQUEST['sdist']) : "0"; ?>],
454
+                values: [0, <?php echo ($_REQUEST['sdist'] != '') ? sanitize_text_field($_REQUEST['sdist']) : "0"; ?>],
455 455
                 min: 0,
456 456
                 max: <?php echo $dist; ?>,
457 457
                 step: <?php echo $dist_dif; ?>,
@@ -516,7 +516,7 @@  discard block
 block discarded – undo
516 516
 
517 517
 
518 518
     <script type="text/javascript">
519
-        var default_location = '<?php if($search_location = geodir_get_default_location())  echo $search_location->city ;?>';
519
+        var default_location = '<?php if ($search_location = geodir_get_default_location())  echo $search_location->city; ?>';
520 520
         var latlng;
521 521
         var address;
522 522
         var dist = 0;
@@ -529,7 +529,7 @@  discard block
 block discarded – undo
529 529
 				var $form = jQuery(this).closest('form');
530 530
 				
531 531
 				if (jQuery("#sdist input[type='radio']:checked").length != 0) dist = jQuery("#sdist input[type='radio']:checked").val();
532
-				if (jQuery('.search_text', $form).val() == '' || jQuery('.search_text', $form).val() == '<?php echo $default_search_for_text;?>') jQuery('.search_text', $form).val(s);
532
+				if (jQuery('.search_text', $form).val() == '' || jQuery('.search_text', $form).val() == '<?php echo $default_search_for_text; ?>') jQuery('.search_text', $form).val(s);
533 533
 				
534 534
 				// Disable location based search for disabled location post type.
535 535
 				if (jQuery('.search_by_post', $form).val() != '' && typeof gd_cpt_no_location == 'function') {
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
 					}
544 544
 				}
545 545
 				
546
-				if (dist > 0 || (jQuery('select[name="sort_by"]').val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest') || (jQuery(".snear", $form).val() != '' && jQuery(".snear", $form).val() != '<?php echo $default_near_text;?>')) {
546
+				if (dist > 0 || (jQuery('select[name="sort_by"]').val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest') || (jQuery(".snear", $form).val() != '' && jQuery(".snear", $form).val() != '<?php echo $default_near_text; ?>')) {
547 547
 					geodir_setsearch($form);
548 548
 				} else {
549 549
 					jQuery(".snear", $form).val('');
@@ -562,7 +562,7 @@  discard block
 block discarded – undo
562 562
         });
563 563
         
564 564
 		function geodir_setsearch($form) {
565
-			if ((dist > 0 || (jQuery('select[name="sort_by"]', $form).val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest')) && (jQuery(".snear", $form).val() == '' || jQuery(".snear", $form).val() == '<?php echo $default_near_text;?>')) jQuery(".snear", $form).val(default_location);
565
+			if ((dist > 0 || (jQuery('select[name="sort_by"]', $form).val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest')) && (jQuery(".snear", $form).val() == '' || jQuery(".snear", $form).val() == '<?php echo $default_near_text; ?>')) jQuery(".snear", $form).val(default_location);
566 566
 			geocodeAddress($form);
567 567
 		}
568 568
 
@@ -581,15 +581,15 @@  discard block
 block discarded – undo
581 581
             // Call the geocode function
582 582
             Sgeocoder = window.gdMaps == 'google' ? new google.maps.Geocoder() : null;
583 583
 
584
-            if (jQuery('.snear', $form).val() == '' || ( jQuery('.sgeo_lat').val() != '' && jQuery('.sgeo_lon').val() != ''  ) || jQuery('.snear', $form).val().match("^<?php _e('In:','geodirectory');?>")) {
585
-                if (jQuery('.snear', $form).val().match("^<?php _e('In:','geodirectory');?>")) {
584
+            if (jQuery('.snear', $form).val() == '' || ( jQuery('.sgeo_lat').val() != '' && jQuery('.sgeo_lon').val() != ''  ) || jQuery('.snear', $form).val().match("^<?php _e('In:', 'geodirectory'); ?>")) {
585
+                if (jQuery('.snear', $form).val().match("^<?php _e('In:', 'geodirectory'); ?>")) {
586 586
                     jQuery(".snear", $form).val('');
587 587
                 }
588 588
                 jQuery($form).submit();
589 589
             } else {
590 590
                 var address = jQuery(".snear", $form).val();
591 591
 
592
-                if (jQuery('.snear', $form).val() == '<?php echo $default_near_text;?>') {
592
+                if (jQuery('.snear', $form).val() == '<?php echo $default_near_text; ?>') {
593 593
                     initialise2();
594 594
                 } else {
595 595
                     <?php
@@ -602,12 +602,12 @@  discard block
 block discarded – undo
602 602
                     $near_add2 = apply_filters('geodir_search_near_addition', '');
603 603
                     ?>
604 604
                     if (window.gdMaps === 'google') {
605
-                        Sgeocoder.geocode({'address': address<?php echo ($near_add ? '+", ' . $near_add . '"' : '') . $near_add2;?>},
605
+                        Sgeocoder.geocode({'address': address<?php echo ($near_add ? '+", '.$near_add.'"' : '').$near_add2; ?>},
606 606
                             function (results, status) {
607 607
                                 if (status == google.maps.GeocoderStatus.OK) {
608 608
                                     updateSearchPosition(results[0].geometry.location, $form);
609 609
                                 } else {
610
-                                    alert("<?php esc_attr_e('Search was not successful for the following reason:', 'geodirectory');?>" + status);
610
+                                    alert("<?php esc_attr_e('Search was not successful for the following reason:', 'geodirectory'); ?>" + status);
611 611
                                 }
612 612
                             });
613 613
                     } else if (window.gdMaps === 'osm') {
@@ -616,7 +616,7 @@  discard block
 block discarded – undo
616 616
                                 if (typeof geo !== 'undefined' && geo.lat && geo.lon) {
617 617
                                     updateSearchPosition(geo, $form);
618 618
                                 } else {
619
-                                    alert("<?php esc_attr_e('Search was not successful for the requested address.', 'geodirectory');?>");
619
+                                    alert("<?php esc_attr_e('Search was not successful for the requested address.', 'geodirectory'); ?>");
620 620
                                 }
621 621
                             });
622 622
                     } else {
@@ -662,19 +662,19 @@  discard block
 block discarded – undo
662 662
             var msg;
663 663
             switch (err.code) {
664 664
                 case err.UNKNOWN_ERROR:
665
-                    msg = "<?php _e('Unable to find your location','geodirectory');?>";
665
+                    msg = "<?php _e('Unable to find your location', 'geodirectory'); ?>";
666 666
                     break;
667 667
                 case err.PERMISSION_DENINED:
668
-                    msg = "<?php _e('Permission denied in finding your location','geodirectory');?>";
668
+                    msg = "<?php _e('Permission denied in finding your location', 'geodirectory'); ?>";
669 669
                     break;
670 670
                 case err.POSITION_UNAVAILABLE:
671
-                    msg = "<?php _e('Your location is currently unknown','geodirectory');?>";
671
+                    msg = "<?php _e('Your location is currently unknown', 'geodirectory'); ?>";
672 672
                     break;
673 673
                 case err.BREAK:
674
-                    msg = "<?php _e('Attempt to find location took too long','geodirectory');?>";
674
+                    msg = "<?php _e('Attempt to find location took too long', 'geodirectory'); ?>";
675 675
                     break;
676 676
                 default:
677
-                    msg = "<?php _e('Location detection not supported in browser','geodirectory');?>";
677
+                    msg = "<?php _e('Location detection not supported in browser', 'geodirectory'); ?>";
678 678
             }
679 679
             jQuery('#info').html(msg);
680 680
         }
@@ -713,7 +713,7 @@  discard block
 block discarded – undo
713 713
              * @param object $post The post object.
714 714
              * @param string $link The link to the post.
715 715
              */
716
-            $return = apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img">&nbsp;</span></a>',$post,$link);
716
+            $return = apply_filters('geodir_featured_badge_on_image', '<a href="'.$link.'"><span class="geodir_featured_img">&nbsp;</span></a>', $post, $link);
717 717
             break;
718 718
         case 'new' :
719 719
             /**
@@ -723,7 +723,7 @@  discard block
 block discarded – undo
723 723
              * @param object $post The post object.
724 724
              * @param string $link The link to the post.
725 725
              */
726
-            $return = apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing">&nbsp;</span></a>',$post,$link);
726
+            $return = apply_filters('geodir_new_badge_on_image', '<a href="'.$link.'"><span class="geodir_new_listing">&nbsp;</span></a>', $post, $link);
727 727
             break;
728 728
 
729 729
     }
Please login to merge, or discard this patch.