Passed
Pull Request — master (#244)
by Kiran
14:02
created
geodirectory_template_tags.php 1 patch
Spacing   +75 added lines, -75 removed lines patch added patch discarded remove patch
@@ -38,20 +38,20 @@  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 53
         'geodir_ajax_url' => geodir_get_ajax_url(),
54
-        'geodir_gd_modal' => (int)get_option('geodir_disable_gb_modal'),
54
+        'geodir_gd_modal' => (int) get_option('geodir_disable_gb_modal'),
55 55
         'is_rtl' => is_rtl() ? 1 : 0 // fix rtl issue
56 56
     );
57 57
 
@@ -72,23 +72,23 @@  discard block
 block discarded – undo
72 72
      *
73 73
      * }
74 74
      */
75
-    $geodir_vars_data = apply_filters('geodir_vars_data',$geodir_vars_data);
75
+    $geodir_vars_data = apply_filters('geodir_vars_data', $geodir_vars_data);
76 76
 
77 77
     wp_localize_script('geodirectory-script', 'geodir_var', $geodir_vars_data);
78 78
 
79
-    wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION,true);
80
-    if($is_detail_page){wp_enqueue_script('geodirectory-jquery-flexslider-js');}
79
+    wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url().'/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION, true);
80
+    if ($is_detail_page) {wp_enqueue_script('geodirectory-jquery-flexslider-js'); }
81 81
 
82
-    wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url() . '/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION,true);
82
+    wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url().'/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION, true);
83 83
     wp_enqueue_script('geodirectory-lightbox-jquery');
84 84
 
85
-    wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url() . '/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION,true);
85
+    wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url().'/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION, true);
86 86
     if ($is_detail_page) {
87 87
         wp_enqueue_script('geodirectory-jquery-simplemodal');
88 88
     }
89 89
 
90 90
     if (in_array($geodir_map_name, array('auto', 'google'))) {
91
-        $map_lang = "&language=" . geodir_get_map_default_language();
91
+        $map_lang = "&language=".geodir_get_map_default_language();
92 92
         /**
93 93
          * Filter the variables that are added to the end of the google maps script call.
94 94
          *
@@ -98,40 +98,40 @@  discard block
 block discarded – undo
98 98
          * @param string $var The string to filter, default is empty string.
99 99
          */
100 100
         $map_extra = apply_filters('geodir_googlemap_script_extra', '');
101
-        wp_enqueue_script('geodirectory-googlemap-script', '//maps.google.com/maps/api/js?' . $map_lang . $map_extra, '', NULL);
101
+        wp_enqueue_script('geodirectory-googlemap-script', '//maps.google.com/maps/api/js?'.$map_lang.$map_extra, '', NULL);
102 102
     }
103 103
     
104 104
     if ($geodir_map_name == 'osm') {
105 105
         // Leaflet OpenStreetMap
106
-        wp_register_style('geodirectory-leaflet-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
106
+        wp_register_style('geodirectory-leaflet-style', geodir_plugin_url().'/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
107 107
         wp_enqueue_style('geodirectory-leaflet-style');
108 108
             
109
-        wp_register_script('geodirectory-leaflet-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION);
109
+        wp_register_script('geodirectory-leaflet-script', geodir_plugin_url().'/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION);
110 110
         wp_enqueue_script('geodirectory-leaflet-script');
111 111
         
112
-        wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/osm.geocode.js', array(), GEODIRECTORY_VERSION);
112
+        wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url().'/geodirectory-assets/leaflet/osm.geocode.js', array(), GEODIRECTORY_VERSION);
113 113
         wp_enqueue_script('geodirectory-leaflet-geo-script');
114 114
     }
115
-    wp_enqueue_script( 'jquery-ui-autocomplete' );
115
+    wp_enqueue_script('jquery-ui-autocomplete');
116 116
     
117
-    wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION,true);
117
+    wp_register_script('geodirectory-goMap-script', geodir_plugin_url().'/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION, true);
118 118
     wp_enqueue_script('geodirectory-goMap-script');
119 119
 
120 120
 
121
-    wp_register_script('chosen', geodir_plugin_url() . '/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
121
+    wp_register_script('chosen', geodir_plugin_url().'/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
122 122
     wp_enqueue_script('chosen');
123 123
 
124
-    wp_register_script('geodirectory-choose-ajax', geodir_plugin_url() . '/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION);
124
+    wp_register_script('geodirectory-choose-ajax', geodir_plugin_url().'/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION);
125 125
     wp_enqueue_script('geodirectory-choose-ajax');
126 126
 
127
-    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);
127
+    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 128
 
129 129
     if (is_page() && geodir_is_page('add-listing')) {
130 130
         // SCRIPT FOR UPLOAD
131 131
         wp_enqueue_script('plupload-all');
132 132
         wp_enqueue_script('jquery-ui-sortable');
133 133
 
134
-        wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION,true);
134
+        wp_register_script('geodirectory-plupload-script', geodir_plugin_url().'/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
135 135
         wp_enqueue_script('geodirectory-plupload-script');
136 136
         // SCRIPT FOR UPLOAD END
137 137
 
@@ -178,27 +178,27 @@  discard block
 block discarded – undo
178 178
 
179 179
         wp_localize_script('geodirectory-plupload-script', 'gd_plupload', $gd_plupload_init);
180 180
 
181
-        wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url() . '/geodirectory-assets/js/listing_validation.min.js#asyncload');
181
+        wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url().'/geodirectory-assets/js/listing_validation.min.js#asyncload');
182 182
     } // End if for add place page
183 183
 
184
-    wp_register_script('geodirectory-post-custom-js', geodir_plugin_url() . '/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
184
+    wp_register_script('geodirectory-post-custom-js', geodir_plugin_url().'/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
185 185
     if ($is_detail_page) {
186 186
 		wp_enqueue_script('geodirectory-post-custom-js');
187 187
 	}
188 188
 
189 189
     // font awesome rating script
190 190
 	if (get_option('geodir_reviewrating_enable_font_awesome')) {
191
-		wp_register_script('geodir-barrating-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION, true);
191
+		wp_register_script('geodir-barrating-js', geodir_plugin_url().'/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION, true);
192 192
 		wp_enqueue_script('geodir-barrating-js');
193 193
 	} else { // default rating script
194
-		wp_register_script('geodir-jRating-js', geodir_plugin_url() . '/geodirectory-assets/js/jRating.jquery.min.js', array(), GEODIRECTORY_VERSION, true);
194
+		wp_register_script('geodir-jRating-js', geodir_plugin_url().'/geodirectory-assets/js/jRating.jquery.min.js', array(), GEODIRECTORY_VERSION, true);
195 195
 		wp_enqueue_script('geodir-jRating-js');
196 196
 	}
197 197
 
198
-    wp_register_script('geodir-on-document-load', geodir_plugin_url() . '/geodirectory-assets/js/on_document_load.js#asyncload', array(), GEODIRECTORY_VERSION, true);
198
+    wp_register_script('geodir-on-document-load', geodir_plugin_url().'/geodirectory-assets/js/on_document_load.js#asyncload', array(), GEODIRECTORY_VERSION, true);
199 199
     wp_enqueue_script('geodir-on-document-load');
200 200
 
201
-    wp_register_script('google-geometa', geodir_plugin_url() . '/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
201
+    wp_register_script('google-geometa', geodir_plugin_url().'/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
202 202
     wp_enqueue_script('google-geometa');
203 203
 }
204 204
 
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
  */
214 214
 function geodir_header_scripts()
215 215
 {
216
-    echo '<style>' . stripslashes(get_option('geodir_coustem_css')) . '</style>';
216
+    echo '<style>'.stripslashes(get_option('geodir_coustem_css')).'</style>';
217 217
     echo stripslashes(get_option('geodir_header_scripts'));
218 218
 }
219 219
 
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
  */
245 245
 function geodir_add_async_forscript($url)
246 246
 {
247
-    if (strpos($url, '#asyncload')===false)
247
+    if (strpos($url, '#asyncload') === false)
248 248
         return $url;
249 249
     else if (is_admin())
250 250
         return str_replace('#asyncload', '', $url);
@@ -263,50 +263,50 @@  discard block
 block discarded – undo
263 263
 {
264 264
 
265 265
 
266
-    if(get_option('geodir_scss_core')) {
266
+    if (get_option('geodir_scss_core')) {
267 267
 
268 268
 
269
-        wp_register_style('geodirectory-frontend-style', geodir_plugin_url() . '/geodirectory-assets/css/style.css', array(), GEODIRECTORY_VERSION);
269
+        wp_register_style('geodirectory-frontend-style', geodir_plugin_url().'/geodirectory-assets/css/style.css', array(), GEODIRECTORY_VERSION);
270 270
         wp_enqueue_style('geodirectory-frontend-style');
271 271
 
272
-        wp_register_style('geodirectory-media-style', geodir_plugin_url() . '/geodirectory-assets/css/media.css', array(), GEODIRECTORY_VERSION);
272
+        wp_register_style('geodirectory-media-style', geodir_plugin_url().'/geodirectory-assets/css/media.css', array(), GEODIRECTORY_VERSION);
273 273
         wp_enqueue_style('geodirectory-media-style');
274 274
 
275 275
 
276
-        wp_register_style('geodirectory-jquery-ui-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery-ui.css', array(), GEODIRECTORY_VERSION);
276
+        wp_register_style('geodirectory-jquery-ui-css', geodir_plugin_url().'/geodirectory-assets/css/jquery-ui.css', array(), GEODIRECTORY_VERSION);
277 277
         wp_enqueue_style('geodirectory-jquery-ui-css');
278 278
 
279
-        wp_register_style('geodirectory-jquery-ui-timepicker-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery.ui.timepicker.css', array(), GEODIRECTORY_VERSION);
279
+        wp_register_style('geodirectory-jquery-ui-timepicker-css', geodir_plugin_url().'/geodirectory-assets/css/jquery.ui.timepicker.css', array(), GEODIRECTORY_VERSION);
280 280
         wp_enqueue_style('geodirectory-jquery-ui-timepicker-css');
281 281
 
282
-        wp_register_style('geodirectory-flexslider-css', geodir_plugin_url() . '/geodirectory-assets/css/flexslider.css', array(), GEODIRECTORY_VERSION);
282
+        wp_register_style('geodirectory-flexslider-css', geodir_plugin_url().'/geodirectory-assets/css/flexslider.css', array(), GEODIRECTORY_VERSION);
283 283
         wp_enqueue_style('geodirectory-flexslider-css');
284 284
 
285
-        wp_register_style('geodirectory-thic-box-css', geodir_plugin_url() . '/geodirectory-assets/css/thic-box.css', array(), GEODIRECTORY_VERSION);
285
+        wp_register_style('geodirectory-thic-box-css', geodir_plugin_url().'/geodirectory-assets/css/thic-box.css', array(), GEODIRECTORY_VERSION);
286 286
         wp_enqueue_style('geodirectory-thic-box-css');
287 287
 
288
-        wp_register_style('geodirectory-pluplodar-css', geodir_plugin_url() . '/geodirectory-assets/css/pluploader.css', array(), GEODIRECTORY_VERSION);
288
+        wp_register_style('geodirectory-pluplodar-css', geodir_plugin_url().'/geodirectory-assets/css/pluploader.css', array(), GEODIRECTORY_VERSION);
289 289
         wp_enqueue_style('geodirectory-pluplodar-css');
290 290
 
291
-        wp_register_style('geodirectory-lightbox-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery.lightbox-0.5.css', array(), GEODIRECTORY_VERSION);
291
+        wp_register_style('geodirectory-lightbox-css', geodir_plugin_url().'/geodirectory-assets/css/jquery.lightbox-0.5.css', array(), GEODIRECTORY_VERSION);
292 292
         wp_enqueue_style('geodirectory-lightbox-css');
293 293
 
294
-        wp_register_style('geodir-rating-style', geodir_plugin_url() . '/geodirectory-assets/css/jRating.jquery.css', array(), GEODIRECTORY_VERSION);
294
+        wp_register_style('geodir-rating-style', geodir_plugin_url().'/geodirectory-assets/css/jRating.jquery.css', array(), GEODIRECTORY_VERSION);
295 295
         wp_enqueue_style('geodir-rating-style');
296 296
 
297
-        wp_register_style('geodir-chosen-style', geodir_plugin_url() . '/geodirectory-assets/css/chosen.css', array(), GEODIRECTORY_VERSION);
297
+        wp_register_style('geodir-chosen-style', geodir_plugin_url().'/geodirectory-assets/css/chosen.css', array(), GEODIRECTORY_VERSION);
298 298
         wp_enqueue_style('geodir-chosen-style');
299 299
 
300
-    }else{
301
-        wp_register_style('geodir-core-scss', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
300
+    } else {
301
+        wp_register_style('geodir-core-scss', geodir_plugin_url().'/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
302 302
         wp_enqueue_style('geodir-core-scss');
303 303
 
304
-        wp_register_style('geodir-core-scss-footer', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION);
304
+        wp_register_style('geodir-core-scss-footer', geodir_plugin_url().'/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION);
305 305
 
306 306
     }
307 307
 
308
-    if(is_rtl()){
309
-    wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url() . '/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION);
308
+    if (is_rtl()) {
309
+    wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url().'/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION);
310 310
     wp_enqueue_style('geodirectory-frontend-rtl-style');
311 311
     }
312 312
 
@@ -380,18 +380,18 @@  discard block
 block discarded – undo
380 380
                 $term_id = get_queried_object_id();
381 381
                 $taxonomy = get_query_var('taxonomy');
382 382
 
383
-                if ($term_id && $post_type && get_query_var('taxonomy') == $post_type . 'category' ) {
384
-                    $term = get_term($term_id, $post_type . 'category');
383
+                if ($term_id && $post_type && get_query_var('taxonomy') == $post_type.'category') {
384
+                    $term = get_term($term_id, $post_type.'category');
385 385
                 }
386 386
             }
387 387
             
388
-            if (geodir_is_page('search') && !empty($_REQUEST['s' . $post_type . 'category'])) {
389
-                $taxonomy_search = $_REQUEST['s' . $post_type . 'category'];
388
+            if (geodir_is_page('search') && !empty($_REQUEST['s'.$post_type.'category'])) {
389
+                $taxonomy_search = $_REQUEST['s'.$post_type.'category'];
390 390
                 
391 391
                 if (!is_array($taxonomy_search)) {
392
-                    $term = get_term((int)$taxonomy_search, $post_type . 'category');
393
-                } else if(is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search
394
-                    $term = get_term((int)$taxonomy_search[0], $post_type . 'category');
392
+                    $term = get_term((int) $taxonomy_search, $post_type.'category');
393
+                } else if (is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search
394
+                    $term = get_term((int) $taxonomy_search[0], $post_type.'category');
395 395
                 }
396 396
             }
397 397
             
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
         if ($max_page > 1 || $always_show) {            
404 404
             // Extra pagination info
405 405
             $geodir_pagination_more_info = get_option('geodir_pagination_advance_info');
406
-            $start_no = ( $paged - 1 ) * $posts_per_page + 1;
406
+            $start_no = ($paged - 1) * $posts_per_page + 1;
407 407
             $end_no = min($paged * $posts_per_page, $numposts);
408 408
 
409 409
             if ($geodir_pagination_more_info != '') {
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
                 } else {
414 414
                     $pegination_desc = wp_sprintf(__('Showing listings %d-%d of %d', 'geodirectory'), $start_no, $end_no, $numposts);
415 415
                 }
416
-                $pagination_info = '<div class="gd-pagination-details">' . $pegination_desc . '</div>';
416
+                $pagination_info = '<div class="gd-pagination-details">'.$pegination_desc.'</div>';
417 417
                 /**
418 418
                  * Adds an extra pagination info above/under pagination.
419 419
                  *
@@ -429,15 +429,15 @@  discard block
 block discarded – undo
429 429
                 $pagination_info = apply_filters('geodir_pagination_advance_info', $pagination_info, $listing_type_name, $start_no, $end_no, $numposts, $post_type);
430 430
                 
431 431
                 if ($geodir_pagination_more_info == 'before') {
432
-                    $before = $before . $pagination_info;
432
+                    $before = $before.$pagination_info;
433 433
                 } else if ($geodir_pagination_more_info == 'after') {
434
-                    $after = $pagination_info . $after;
434
+                    $after = $pagination_info.$after;
435 435
                 }
436 436
             }
437 437
             
438 438
             echo "$before <div class='Navi'>";
439 439
             if ($paged >= ($pages_to_show - 1)) {
440
-                echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link()) . '">&laquo;</a>';
440
+                echo '<a href="'.str_replace('&paged', '&amp;paged', get_pagenum_link()).'">&laquo;</a>';
441 441
             }
442 442
             previous_posts_link($prelabel);
443 443
             for ($i = $paged - $half_pages_to_show; $i <= $paged + $half_pages_to_show; $i++) {
@@ -445,13 +445,13 @@  discard block
 block discarded – undo
445 445
                     if ($i == $paged) {
446 446
                         echo "<strong class='on'>$i</strong>";
447 447
                     } else {
448
-                        echo ' <a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($i)) . '">' . $i . '</a> ';
448
+                        echo ' <a href="'.str_replace('&paged', '&amp;paged', get_pagenum_link($i)).'">'.$i.'</a> ';
449 449
                     }
450 450
                 }
451 451
             }
452 452
             next_posts_link($nxtlabel, $max_page);
453 453
             if (($paged + $half_pages_to_show) < ($max_page)) {
454
-                echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($max_page)) . '">&raquo;</a>';
454
+                echo '<a href="'.str_replace('&paged', '&amp;paged', get_pagenum_link($max_page)).'">&raquo;</a>';
455 455
             }
456 456
             echo "</div> $after";
457 457
         }
@@ -489,7 +489,7 @@  discard block
 block discarded – undo
489 489
         jQuery(function ($) {
490 490
             $("#distance_slider").slider({
491 491
                 range: true,
492
-                values: [0, <?php echo ($_REQUEST['sdist']!='') ? sanitize_text_field($_REQUEST['sdist']) : "0"; ?>],
492
+                values: [0, <?php echo ($_REQUEST['sdist'] != '') ? sanitize_text_field($_REQUEST['sdist']) : "0"; ?>],
493 493
                 min: 0,
494 494
                 max: <?php echo $dist; ?>,
495 495
                 step: <?php echo $dist_dif; ?>,
@@ -554,7 +554,7 @@  discard block
 block discarded – undo
554 554
 
555 555
 
556 556
     <script type="text/javascript">
557
-        var default_location = '<?php if($search_location = geodir_get_default_location())  echo $search_location->city ;?>';
557
+        var default_location = '<?php if ($search_location = geodir_get_default_location())  echo $search_location->city; ?>';
558 558
         var latlng;
559 559
         var address;
560 560
         var dist = 0;
@@ -567,7 +567,7 @@  discard block
 block discarded – undo
567 567
 				var $form = jQuery(this).closest('form');
568 568
 				
569 569
 				if (jQuery("#sdist input[type='radio']:checked").length != 0) dist = jQuery("#sdist input[type='radio']:checked").val();
570
-				if (jQuery('.search_text', $form).val() == '' || jQuery('.search_text', $form).val() == '<?php echo $default_search_for_text;?>') jQuery('.search_text', $form).val(s);
570
+				if (jQuery('.search_text', $form).val() == '' || jQuery('.search_text', $form).val() == '<?php echo $default_search_for_text; ?>') jQuery('.search_text', $form).val(s);
571 571
 				
572 572
 				// Disable location based search for disabled location post type.
573 573
 				if (jQuery('.search_by_post', $form).val() != '' && typeof gd_cpt_no_location == 'function') {
@@ -581,7 +581,7 @@  discard block
 block discarded – undo
581 581
 					}
582 582
 				}
583 583
 				
584
-				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;?>')) {
584
+				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; ?>')) {
585 585
 					geodir_setsearch($form);
586 586
 				} else {
587 587
 					jQuery(".snear", $form).val('');
@@ -600,7 +600,7 @@  discard block
 block discarded – undo
600 600
         });
601 601
         
602 602
 		function geodir_setsearch($form) {
603
-			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);
603
+			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);
604 604
 			geocodeAddress($form);
605 605
 		}
606 606
 
@@ -619,15 +619,15 @@  discard block
 block discarded – undo
619 619
             // Call the geocode function
620 620
             Sgeocoder = window.gdMaps == 'google' ? new google.maps.Geocoder() : null;
621 621
 
622
-            if (jQuery('.snear', $form).val() == '' || ( jQuery('.sgeo_lat').val() != '' && jQuery('.sgeo_lon').val() != ''  ) || jQuery('.snear', $form).val().match("^<?php _e('In:','geodirectory');?>")) {
623
-                if (jQuery('.snear', $form).val().match("^<?php _e('In:','geodirectory');?>")) {
622
+            if (jQuery('.snear', $form).val() == '' || ( jQuery('.sgeo_lat').val() != '' && jQuery('.sgeo_lon').val() != ''  ) || jQuery('.snear', $form).val().match("^<?php _e('In:', 'geodirectory'); ?>")) {
623
+                if (jQuery('.snear', $form).val().match("^<?php _e('In:', 'geodirectory'); ?>")) {
624 624
                     jQuery(".snear", $form).val('');
625 625
                 }
626 626
                 jQuery($form).submit();
627 627
             } else {
628 628
                 var address = jQuery(".snear", $form).val();
629 629
 
630
-                if (jQuery('.snear', $form).val() == '<?php echo $default_near_text;?>') {
630
+                if (jQuery('.snear', $form).val() == '<?php echo $default_near_text; ?>') {
631 631
                     initialise2();
632 632
                 } else {
633 633
                     <?php
@@ -640,12 +640,12 @@  discard block
 block discarded – undo
640 640
                     $near_add2 = apply_filters('geodir_search_near_addition', '');
641 641
                     ?>
642 642
                     if (window.gdMaps === 'google') {
643
-                        Sgeocoder.geocode({'address': address<?php echo ($near_add ? '+", ' . $near_add . '"' : '') . $near_add2;?>},
643
+                        Sgeocoder.geocode({'address': address<?php echo ($near_add ? '+", '.$near_add.'"' : '').$near_add2; ?>},
644 644
                             function (results, status) {
645 645
                                 if (status == google.maps.GeocoderStatus.OK) {
646 646
                                     updateSearchPosition(results[0].geometry.location, $form);
647 647
                                 } else {
648
-                                    alert("<?php esc_attr_e('Search was not successful for the following reason:', 'geodirectory');?>" + status);
648
+                                    alert("<?php esc_attr_e('Search was not successful for the following reason:', 'geodirectory'); ?>" + status);
649 649
                                 }
650 650
                             });
651 651
                     } else if (window.gdMaps === 'osm') {
@@ -654,7 +654,7 @@  discard block
 block discarded – undo
654 654
                                 if (typeof geo !== 'undefined' && geo.lat && geo.lon) {
655 655
                                     updateSearchPosition(geo, $form);
656 656
                                 } else {
657
-                                    alert("<?php esc_attr_e('Search was not successful for the requested address.', 'geodirectory');?>");
657
+                                    alert("<?php esc_attr_e('Search was not successful for the requested address.', 'geodirectory'); ?>");
658 658
                                 }
659 659
                             });
660 660
                     } else {
@@ -700,19 +700,19 @@  discard block
 block discarded – undo
700 700
             var msg;
701 701
             switch (err.code) {
702 702
                 case err.UNKNOWN_ERROR:
703
-                    msg = "<?php _e('Unable to find your location','geodirectory');?>";
703
+                    msg = "<?php _e('Unable to find your location', 'geodirectory'); ?>";
704 704
                     break;
705 705
                 case err.PERMISSION_DENINED:
706
-                    msg = "<?php _e('Permission denied in finding your location','geodirectory');?>";
706
+                    msg = "<?php _e('Permission denied in finding your location', 'geodirectory'); ?>";
707 707
                     break;
708 708
                 case err.POSITION_UNAVAILABLE:
709
-                    msg = "<?php _e('Your location is currently unknown','geodirectory');?>";
709
+                    msg = "<?php _e('Your location is currently unknown', 'geodirectory'); ?>";
710 710
                     break;
711 711
                 case err.BREAK:
712
-                    msg = "<?php _e('Attempt to find location took too long','geodirectory');?>";
712
+                    msg = "<?php _e('Attempt to find location took too long', 'geodirectory'); ?>";
713 713
                     break;
714 714
                 default:
715
-                    msg = "<?php _e('Location detection not supported in browser','geodirectory');?>";
715
+                    msg = "<?php _e('Location detection not supported in browser', 'geodirectory'); ?>";
716 716
             }
717 717
             jQuery('#info').html(msg);
718 718
         }
@@ -751,7 +751,7 @@  discard block
 block discarded – undo
751 751
              * @param object $post The post object.
752 752
              * @param string $link The link to the post.
753 753
              */
754
-            $return = apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img">&nbsp;</span></a>',$post,$link);
754
+            $return = apply_filters('geodir_featured_badge_on_image', '<a href="'.$link.'"><span class="geodir_featured_img">&nbsp;</span></a>', $post, $link);
755 755
             break;
756 756
         case 'new' :
757 757
             /**
@@ -761,7 +761,7 @@  discard block
 block discarded – undo
761 761
              * @param object $post The post object.
762 762
              * @param string $link The link to the post.
763 763
              */
764
-            $return = apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing">&nbsp;</span></a>',$post,$link);
764
+            $return = apply_filters('geodir_new_badge_on_image', '<a href="'.$link.'"><span class="geodir_new_listing">&nbsp;</span></a>', $post, $link);
765 765
             break;
766 766
 
767 767
     }
Please login to merge, or discard this patch.