|
@@ -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', array(), GEODIRECTORY_VERSION);
|
|
|
47
|
+ wp_register_script('geodirectory-script', geodir_plugin_url().'/geodirectory-assets/js/geodirectory.min.js', 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,24 +73,24 @@ 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();
|
|
93
|
|
- $map_key = "&key=" . geodir_get_map_api_key();
|
|
|
92
|
+ $map_lang = "&language=".geodir_get_map_default_language();
|
|
|
93
|
+ $map_key = "&key=".geodir_get_map_api_key();
|
|
94
|
94
|
/**
|
|
95
|
95
|
* Filter the variables that are added to the end of the google maps script call.
|
|
96
|
96
|
*
|
|
@@ -100,48 +100,48 @@ discard block |
|
|
block discarded – undo |
|
100
|
100
|
* @param string $var The string to filter, default is empty string.
|
|
101
|
101
|
*/
|
|
102
|
102
|
$map_extra = apply_filters('geodir_googlemap_script_extra', '');
|
|
103
|
|
- wp_enqueue_script('geodirectory-googlemap-script', 'https://maps.google.com/maps/api/js?' . $map_lang . $map_key . $map_extra , '', NULL);
|
|
|
103
|
+ wp_enqueue_script('geodirectory-googlemap-script', 'https://maps.google.com/maps/api/js?'.$map_lang.$map_key.$map_extra, '', NULL);
|
|
104
|
104
|
}
|
|
105
|
105
|
|
|
106
|
106
|
if ($geodir_map_name == 'osm') {
|
|
107
|
107
|
// Leaflet OpenStreetMap
|
|
108
|
|
- wp_register_style('geodirectory-leaflet-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
|
|
|
108
|
+ wp_register_style('geodirectory-leaflet-style', geodir_plugin_url().'/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
|
|
109
|
109
|
wp_enqueue_style('geodirectory-leaflet-style');
|
|
110
|
110
|
|
|
111
|
|
- wp_register_script('geodirectory-leaflet-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION);
|
|
|
111
|
+ wp_register_script('geodirectory-leaflet-script', geodir_plugin_url().'/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION);
|
|
112
|
112
|
wp_enqueue_script('geodirectory-leaflet-script');
|
|
113
|
113
|
|
|
114
|
|
- wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/osm.geocode.js', array(), GEODIRECTORY_VERSION);
|
|
|
114
|
+ wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url().'/geodirectory-assets/leaflet/osm.geocode.js', array(), GEODIRECTORY_VERSION);
|
|
115
|
115
|
wp_enqueue_script('geodirectory-leaflet-geo-script');
|
|
116
|
116
|
|
|
117
|
117
|
if ($is_detail_page) {
|
|
118
|
|
- wp_register_style('geodirectory-leaflet-routing-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/routing/leaflet-routing-machine.css', array(), GEODIRECTORY_VERSION);
|
|
|
118
|
+ wp_register_style('geodirectory-leaflet-routing-style', geodir_plugin_url().'/geodirectory-assets/leaflet/routing/leaflet-routing-machine.css', array(), GEODIRECTORY_VERSION);
|
|
119
|
119
|
wp_enqueue_style('geodirectory-leaflet-routing-style');
|
|
120
|
120
|
|
|
121
|
|
- wp_register_script('geodirectory-leaflet-routing-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/routing/leaflet-routing-machine.js', array(), GEODIRECTORY_VERSION);
|
|
|
121
|
+ wp_register_script('geodirectory-leaflet-routing-script', geodir_plugin_url().'/geodirectory-assets/leaflet/routing/leaflet-routing-machine.js', array(), GEODIRECTORY_VERSION);
|
|
122
|
122
|
wp_enqueue_script('geodirectory-leaflet-routing-script');
|
|
123
|
123
|
}
|
|
124
|
124
|
}
|
|
125
|
|
- wp_enqueue_script( 'jquery-ui-autocomplete' );
|
|
|
125
|
+ wp_enqueue_script('jquery-ui-autocomplete');
|
|
126
|
126
|
|
|
127
|
|
- wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION,true);
|
|
|
127
|
+ wp_register_script('geodirectory-goMap-script', geodir_plugin_url().'/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION, true);
|
|
128
|
128
|
wp_enqueue_script('geodirectory-goMap-script');
|
|
129
|
129
|
|
|
130
|
130
|
|
|
131
|
|
- wp_register_script('chosen', geodir_plugin_url() . '/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
|
|
|
131
|
+ wp_register_script('chosen', geodir_plugin_url().'/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
|
|
132
|
132
|
wp_enqueue_script('chosen');
|
|
133
|
133
|
|
|
134
|
|
- wp_register_script('geodirectory-choose-ajax', geodir_plugin_url() . '/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION);
|
|
|
134
|
+ wp_register_script('geodirectory-choose-ajax', geodir_plugin_url().'/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION);
|
|
135
|
135
|
wp_enqueue_script('geodirectory-choose-ajax');
|
|
136
|
136
|
|
|
137
|
|
- wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.ui.timepicker.min.js', array('jquery-ui-datepicker', 'jquery-ui-slider', 'jquery-effects-core', 'jquery-effects-slide'), '', true);
|
|
|
137
|
+ wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url().'/geodirectory-assets/js/jquery.ui.timepicker.min.js', array('jquery-ui-datepicker', 'jquery-ui-slider', 'jquery-effects-core', 'jquery-effects-slide'), '', true);
|
|
138
|
138
|
|
|
139
|
139
|
if (is_page() && geodir_is_page('add-listing')) {
|
|
140
|
140
|
// SCRIPT FOR UPLOAD
|
|
141
|
141
|
wp_enqueue_script('plupload-all');
|
|
142
|
142
|
wp_enqueue_script('jquery-ui-sortable');
|
|
143
|
143
|
|
|
144
|
|
- wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION,true);
|
|
|
144
|
+ wp_register_script('geodirectory-plupload-script', geodir_plugin_url().'/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
|
|
145
|
145
|
wp_enqueue_script('geodirectory-plupload-script');
|
|
146
|
146
|
// SCRIPT FOR UPLOAD END
|
|
147
|
147
|
|
|
@@ -188,27 +188,27 @@ discard block |
|
|
block discarded – undo |
|
188
|
188
|
|
|
189
|
189
|
wp_localize_script('geodirectory-plupload-script', 'gd_plupload', $gd_plupload_init);
|
|
190
|
190
|
|
|
191
|
|
- wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url() . '/geodirectory-assets/js/listing_validation.min.js#asyncload');
|
|
|
191
|
+ wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url().'/geodirectory-assets/js/listing_validation.min.js#asyncload');
|
|
192
|
192
|
} // End if for add place page
|
|
193
|
193
|
|
|
194
|
|
- wp_register_script('geodirectory-post-custom-js', geodir_plugin_url() . '/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
|
|
|
194
|
+ wp_register_script('geodirectory-post-custom-js', geodir_plugin_url().'/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
|
|
195
|
195
|
if ($is_detail_page) {
|
|
196
|
196
|
wp_enqueue_script('geodirectory-post-custom-js');
|
|
197
|
197
|
}
|
|
198
|
198
|
|
|
199
|
199
|
// font awesome rating script
|
|
200
|
200
|
if (get_option('geodir_reviewrating_enable_font_awesome')) {
|
|
201
|
|
- wp_register_script('geodir-barrating-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION, true);
|
|
|
201
|
+ wp_register_script('geodir-barrating-js', geodir_plugin_url().'/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION, true);
|
|
202
|
202
|
wp_enqueue_script('geodir-barrating-js');
|
|
203
|
203
|
} else { // default rating script
|
|
204
|
|
- wp_register_script('geodir-jRating-js', geodir_plugin_url() . '/geodirectory-assets/js/jRating.jquery.min.js', array(), GEODIRECTORY_VERSION, true);
|
|
|
204
|
+ wp_register_script('geodir-jRating-js', geodir_plugin_url().'/geodirectory-assets/js/jRating.jquery.min.js', array(), GEODIRECTORY_VERSION, true);
|
|
205
|
205
|
wp_enqueue_script('geodir-jRating-js');
|
|
206
|
206
|
}
|
|
207
|
207
|
|
|
208
|
|
- wp_register_script('geodir-on-document-load', geodir_plugin_url() . '/geodirectory-assets/js/on_document_load.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
|
|
|
208
|
+ wp_register_script('geodir-on-document-load', geodir_plugin_url().'/geodirectory-assets/js/on_document_load.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
|
|
209
|
209
|
wp_enqueue_script('geodir-on-document-load');
|
|
210
|
210
|
|
|
211
|
|
- wp_register_script('google-geometa', geodir_plugin_url() . '/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
|
|
|
211
|
+ wp_register_script('google-geometa', geodir_plugin_url().'/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
|
|
212
|
212
|
wp_enqueue_script('google-geometa');
|
|
213
|
213
|
}
|
|
214
|
214
|
|
|
@@ -223,7 +223,7 @@ discard block |
|
|
block discarded – undo |
|
223
|
223
|
*/
|
|
224
|
224
|
function geodir_header_scripts()
|
|
225
|
225
|
{
|
|
226
|
|
- echo '<style>' . stripslashes(get_option('geodir_coustem_css')) . '</style>';
|
|
|
226
|
+ echo '<style>'.stripslashes(get_option('geodir_coustem_css')).'</style>';
|
|
227
|
227
|
echo stripslashes(get_option('geodir_header_scripts'));
|
|
228
|
228
|
}
|
|
229
|
229
|
|
|
@@ -237,7 +237,7 @@ discard block |
|
|
block discarded – undo |
|
237
|
237
|
*/
|
|
238
|
238
|
function geodir_google_analytics_tracking_code()
|
|
239
|
239
|
{
|
|
240
|
|
- if(get_option('geodir_ga_add_tracking_code') && get_option('geodir_ga_account_id')){?>
|
|
|
240
|
+ if (get_option('geodir_ga_add_tracking_code') && get_option('geodir_ga_account_id')) {?>
|
|
241
|
241
|
|
|
242
|
242
|
<script>
|
|
243
|
243
|
(function(i,s,o,g,r,a,m){ i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
|
@@ -245,14 +245,14 @@ discard block |
|
|
block discarded – undo |
|
245
|
245
|
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
|
246
|
246
|
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
|
|
247
|
247
|
|
|
248
|
|
- ga('create', '<?php echo esc_attr(get_option('geodir_ga_account_id'));?>', 'auto');
|
|
249
|
|
- <?php if(get_option('geodir_ga_anonymize_ip')){echo "ga('set', 'anonymizeIP', true);";}?>
|
|
|
248
|
+ ga('create', '<?php echo esc_attr(get_option('geodir_ga_account_id')); ?>', 'auto');
|
|
|
249
|
+ <?php if (get_option('geodir_ga_anonymize_ip')) {echo "ga('set', 'anonymizeIP', true);"; }?>
|
|
250
|
250
|
ga('send', 'pageview');
|
|
251
|
251
|
|
|
252
|
252
|
</script>
|
|
253
|
253
|
|
|
254
|
254
|
<?php
|
|
255
|
|
- }elseif(get_option('geodir_ga_tracking_code') && !get_option('geodir_ga_account_id')){
|
|
|
255
|
+ }elseif (get_option('geodir_ga_tracking_code') && !get_option('geodir_ga_account_id')) {
|
|
256
|
256
|
echo stripslashes(get_option('geodir_ga_tracking_code'));
|
|
257
|
257
|
}
|
|
258
|
258
|
}
|
|
@@ -275,7 +275,7 @@ discard block |
|
|
block discarded – undo |
|
275
|
275
|
*
|
|
276
|
276
|
* Flexbox wont wrap on ios for search form items
|
|
277
|
277
|
*/
|
|
278
|
|
- if ( !empty( $_SERVER['HTTP_USER_AGENT'] ) && preg_match( '/iPad|iPod|iPhone|Safari/', $_SERVER['HTTP_USER_AGENT'] ) ) {
|
|
|
278
|
+ if (!empty($_SERVER['HTTP_USER_AGENT']) && preg_match('/iPad|iPod|iPhone|Safari/', $_SERVER['HTTP_USER_AGENT'])) {
|
|
279
|
279
|
echo "<style>body .geodir-listing-search.gd-search-bar-style .geodir-loc-bar .clearfix.geodir-loc-bar-in .geodir-search .gd-search-input-wrapper{flex:50 1 auto !important;min-width: initial !important;width:auto !important;}.geodir-filter-container .geodir-filter-cat{width:auto !important;}</style>";
|
|
280
|
280
|
}
|
|
281
|
281
|
}
|
|
@@ -291,7 +291,7 @@ discard block |
|
|
block discarded – undo |
|
291
|
291
|
*/
|
|
292
|
292
|
function geodir_add_async_forscript($url)
|
|
293
|
293
|
{
|
|
294
|
|
- if (strpos($url, '#asyncload')===false)
|
|
|
294
|
+ if (strpos($url, '#asyncload') === false)
|
|
295
|
295
|
return $url;
|
|
296
|
296
|
else if (is_admin())
|
|
297
|
297
|
return str_replace('#asyncload', '', $url);
|
|
@@ -309,12 +309,12 @@ discard block |
|
|
block discarded – undo |
|
309
|
309
|
function geodir_templates_styles()
|
|
310
|
310
|
{
|
|
311
|
311
|
|
|
312
|
|
- wp_register_style('geodir-core-scss', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
|
|
|
312
|
+ wp_register_style('geodir-core-scss', geodir_plugin_url().'/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
|
|
313
|
313
|
wp_enqueue_style('geodir-core-scss');
|
|
314
|
|
- wp_register_style('geodir-core-scss-footer', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION);
|
|
|
314
|
+ wp_register_style('geodir-core-scss-footer', geodir_plugin_url().'/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION);
|
|
315
|
315
|
|
|
316
|
|
- if(is_rtl()){
|
|
317
|
|
- wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url() . '/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION);
|
|
|
316
|
+ if (is_rtl()) {
|
|
|
317
|
+ wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url().'/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION);
|
|
318
|
318
|
wp_enqueue_style('geodirectory-frontend-rtl-style');
|
|
319
|
319
|
}
|
|
320
|
320
|
|
|
@@ -388,18 +388,18 @@ discard block |
|
|
block discarded – undo |
|
388
|
388
|
$term_id = get_queried_object_id();
|
|
389
|
389
|
$taxonomy = get_query_var('taxonomy');
|
|
390
|
390
|
|
|
391
|
|
- if ($term_id && $post_type && get_query_var('taxonomy') == $post_type . 'category' ) {
|
|
392
|
|
- $term = get_term($term_id, $post_type . 'category');
|
|
|
391
|
+ if ($term_id && $post_type && get_query_var('taxonomy') == $post_type.'category') {
|
|
|
392
|
+ $term = get_term($term_id, $post_type.'category');
|
|
393
|
393
|
}
|
|
394
|
394
|
}
|
|
395
|
395
|
|
|
396
|
|
- if (geodir_is_page('search') && !empty($_REQUEST['s' . $post_type . 'category'])) {
|
|
397
|
|
- $taxonomy_search = $_REQUEST['s' . $post_type . 'category'];
|
|
|
396
|
+ if (geodir_is_page('search') && !empty($_REQUEST['s'.$post_type.'category'])) {
|
|
|
397
|
+ $taxonomy_search = $_REQUEST['s'.$post_type.'category'];
|
|
398
|
398
|
|
|
399
|
399
|
if (!is_array($taxonomy_search)) {
|
|
400
|
|
- $term = get_term((int)$taxonomy_search, $post_type . 'category');
|
|
401
|
|
- } else if(is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search
|
|
402
|
|
- $term = get_term((int)$taxonomy_search[0], $post_type . 'category');
|
|
|
400
|
+ $term = get_term((int) $taxonomy_search, $post_type.'category');
|
|
|
401
|
+ } else if (is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search
|
|
|
402
|
+ $term = get_term((int) $taxonomy_search[0], $post_type.'category');
|
|
403
|
403
|
}
|
|
404
|
404
|
}
|
|
405
|
405
|
|
|
@@ -411,7 +411,7 @@ discard block |
|
|
block discarded – undo |
|
411
|
411
|
if ($max_page > 1 || $always_show) {
|
|
412
|
412
|
// Extra pagination info
|
|
413
|
413
|
$geodir_pagination_more_info = get_option('geodir_pagination_advance_info');
|
|
414
|
|
- $start_no = ( $paged - 1 ) * $posts_per_page + 1;
|
|
|
414
|
+ $start_no = ($paged - 1) * $posts_per_page + 1;
|
|
415
|
415
|
$end_no = min($paged * $posts_per_page, $numposts);
|
|
416
|
416
|
|
|
417
|
417
|
if ($geodir_pagination_more_info != '') {
|
|
@@ -421,7 +421,7 @@ discard block |
|
|
block discarded – undo |
|
421
|
421
|
} else {
|
|
422
|
422
|
$pegination_desc = wp_sprintf(__('Showing listings %d-%d of %d', 'geodirectory'), $start_no, $end_no, $numposts);
|
|
423
|
423
|
}
|
|
424
|
|
- $pagination_info = '<div class="gd-pagination-details">' . $pegination_desc . '</div>';
|
|
|
424
|
+ $pagination_info = '<div class="gd-pagination-details">'.$pegination_desc.'</div>';
|
|
425
|
425
|
/**
|
|
426
|
426
|
* Adds an extra pagination info above/under pagination.
|
|
427
|
427
|
*
|
|
@@ -437,15 +437,15 @@ discard block |
|
|
block discarded – undo |
|
437
|
437
|
$pagination_info = apply_filters('geodir_pagination_advance_info', $pagination_info, $listing_type_name, $start_no, $end_no, $numposts, $post_type);
|
|
438
|
438
|
|
|
439
|
439
|
if ($geodir_pagination_more_info == 'before') {
|
|
440
|
|
- $before = $before . $pagination_info;
|
|
|
440
|
+ $before = $before.$pagination_info;
|
|
441
|
441
|
} else if ($geodir_pagination_more_info == 'after') {
|
|
442
|
|
- $after = $pagination_info . $after;
|
|
|
442
|
+ $after = $pagination_info.$after;
|
|
443
|
443
|
}
|
|
444
|
444
|
}
|
|
445
|
445
|
|
|
446
|
446
|
echo "$before <div class='Navi gd-navi'>";
|
|
447
|
447
|
if ($paged >= ($pages_to_show - 1)) {
|
|
448
|
|
- echo '<a href="' . str_replace('&paged', '&paged', get_pagenum_link()) . '">«</a>';
|
|
|
448
|
+ echo '<a href="'.str_replace('&paged', '&paged', get_pagenum_link()).'">«</a>';
|
|
449
|
449
|
}
|
|
450
|
450
|
previous_posts_link($prelabel);
|
|
451
|
451
|
for ($i = $paged - $half_pages_to_show; $i <= $paged + $half_pages_to_show; $i++) {
|
|
@@ -453,13 +453,13 @@ discard block |
|
|
block discarded – undo |
|
453
|
453
|
if ($i == $paged) {
|
|
454
|
454
|
echo "<strong class='on'>$i</strong>";
|
|
455
|
455
|
} else {
|
|
456
|
|
- echo ' <a href="' . str_replace('&paged', '&paged', get_pagenum_link($i)) . '">' . $i . '</a> ';
|
|
|
456
|
+ echo ' <a href="'.str_replace('&paged', '&paged', get_pagenum_link($i)).'">'.$i.'</a> ';
|
|
457
|
457
|
}
|
|
458
|
458
|
}
|
|
459
|
459
|
}
|
|
460
|
460
|
next_posts_link($nxtlabel, $max_page);
|
|
461
|
461
|
if (($paged + $half_pages_to_show) < ($max_page)) {
|
|
462
|
|
- echo '<a href="' . str_replace('&paged', '&paged', get_pagenum_link($max_page)) . '">»</a>';
|
|
|
462
|
+ echo '<a href="'.str_replace('&paged', '&paged', get_pagenum_link($max_page)).'">»</a>';
|
|
463
|
463
|
}
|
|
464
|
464
|
echo "</div> $after";
|
|
465
|
465
|
}
|
|
@@ -497,7 +497,7 @@ discard block |
|
|
block discarded – undo |
|
497
|
497
|
jQuery(function ($) {
|
|
498
|
498
|
$("#distance_slider").slider({
|
|
499
|
499
|
range: true,
|
|
500
|
|
- values: [0, <?php echo ($_REQUEST['sdist']!='') ? sanitize_text_field($_REQUEST['sdist']) : "0"; ?>],
|
|
|
500
|
+ values: [0, <?php echo ($_REQUEST['sdist'] != '') ? sanitize_text_field($_REQUEST['sdist']) : "0"; ?>],
|
|
501
|
501
|
min: 0,
|
|
502
|
502
|
max: <?php echo $dist; ?>,
|
|
503
|
503
|
step: <?php echo $dist_dif; ?>,
|
|
@@ -564,7 +564,7 @@ discard block |
|
|
block discarded – undo |
|
564
|
564
|
$city = !empty($search_location) ? addslashes(stripslashes($search_location->city)) : '';
|
|
565
|
565
|
?>
|
|
566
|
566
|
<script type="text/javascript">
|
|
567
|
|
- var default_location = '<?php echo $city ;?>';
|
|
|
567
|
+ var default_location = '<?php echo $city; ?>';
|
|
568
|
568
|
var latlng;
|
|
569
|
569
|
var address;
|
|
570
|
570
|
var dist = 0;
|
|
@@ -580,7 +580,7 @@ discard block |
|
|
block discarded – undo |
|
580
|
580
|
var $form = jQuery(this).closest('form');
|
|
581
|
581
|
|
|
582
|
582
|
if (jQuery("#sdist input[type='radio']:checked").length != 0) dist = jQuery("#sdist input[type='radio']:checked").val();
|
|
583
|
|
- if (jQuery('.search_text', $form).val() == '' || jQuery('.search_text', $form).val() == '<?php echo $default_search_for_text;?>') jQuery('.search_text', $form).val(s);
|
|
|
583
|
+ if (jQuery('.search_text', $form).val() == '' || jQuery('.search_text', $form).val() == '<?php echo $default_search_for_text; ?>') jQuery('.search_text', $form).val(s);
|
|
584
|
584
|
|
|
585
|
585
|
// Disable location based search for disabled location post type.
|
|
586
|
586
|
if (jQuery('.search_by_post', $form).val() != '' && typeof gd_cpt_no_location == 'function') {
|
|
@@ -594,7 +594,7 @@ discard block |
|
|
block discarded – undo |
|
594
|
594
|
}
|
|
595
|
595
|
}
|
|
596
|
596
|
|
|
597
|
|
- 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;?>')) {
|
|
|
597
|
+ 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; ?>')) {
|
|
598
|
598
|
geodir_setsearch($form);
|
|
599
|
599
|
} else {
|
|
600
|
600
|
jQuery(".snear", $form).val('');
|
|
@@ -612,7 +612,7 @@ discard block |
|
|
block discarded – undo |
|
612
|
612
|
});
|
|
613
|
613
|
|
|
614
|
614
|
function geodir_setsearch($form) {
|
|
615
|
|
- 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);
|
|
|
615
|
+ 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);
|
|
616
|
616
|
geocodeAddress($form);
|
|
617
|
617
|
}
|
|
618
|
618
|
|
|
@@ -631,15 +631,15 @@ discard block |
|
|
block discarded – undo |
|
631
|
631
|
// Call the geocode function
|
|
632
|
632
|
Sgeocoder = window.gdMaps == 'google' ? new google.maps.Geocoder() : null;
|
|
633
|
633
|
|
|
634
|
|
- if (jQuery('.snear', $form).val() == '' || ( jQuery('.sgeo_lat').val() != '' && jQuery('.sgeo_lon').val() != '' ) || jQuery('.snear', $form).val().match("^<?php _e('In:','geodirectory');?>")) {
|
|
635
|
|
- if (jQuery('.snear', $form).val().match("^<?php _e('In:','geodirectory');?>")) {
|
|
|
634
|
+ if (jQuery('.snear', $form).val() == '' || ( jQuery('.sgeo_lat').val() != '' && jQuery('.sgeo_lon').val() != '' ) || jQuery('.snear', $form).val().match("^<?php _e('In:', 'geodirectory'); ?>")) {
|
|
|
635
|
+ if (jQuery('.snear', $form).val().match("^<?php _e('In:', 'geodirectory'); ?>")) {
|
|
636
|
636
|
jQuery(".snear", $form).val('');
|
|
637
|
637
|
}
|
|
638
|
638
|
jQuery($form).submit();
|
|
639
|
639
|
} else {
|
|
640
|
640
|
var address = jQuery(".snear", $form).val();
|
|
641
|
641
|
|
|
642
|
|
- if (jQuery('.snear', $form).val() == '<?php echo $default_near_text;?>') {
|
|
|
642
|
+ if (jQuery('.snear', $form).val() == '<?php echo $default_near_text; ?>') {
|
|
643
|
643
|
initialise2();
|
|
644
|
644
|
} else {
|
|
645
|
645
|
<?php
|
|
@@ -652,12 +652,12 @@ discard block |
|
|
block discarded – undo |
|
652
|
652
|
$near_add2 = apply_filters('geodir_search_near_addition', '');
|
|
653
|
653
|
?>
|
|
654
|
654
|
if (window.gdMaps === 'google') {
|
|
655
|
|
- Sgeocoder.geocode({'address': address<?php echo ($near_add ? '+", ' . $near_add . '"' : '') . $near_add2;?>},
|
|
|
655
|
+ Sgeocoder.geocode({'address': address<?php echo ($near_add ? '+", '.$near_add.'"' : '').$near_add2; ?>},
|
|
656
|
656
|
function (results, status) {
|
|
657
|
657
|
if (status == google.maps.GeocoderStatus.OK) {
|
|
658
|
658
|
updateSearchPosition(results[0].geometry.location, $form);
|
|
659
|
659
|
} else {
|
|
660
|
|
- alert("<?php esc_attr_e('Search was not successful for the following reason :', 'geodirectory');?>" + status);
|
|
|
660
|
+ alert("<?php esc_attr_e('Search was not successful for the following reason :', 'geodirectory'); ?>" + status);
|
|
661
|
661
|
}
|
|
662
|
662
|
});
|
|
663
|
663
|
} else if (window.gdMaps === 'osm') {
|
|
@@ -666,7 +666,7 @@ discard block |
|
|
block discarded – undo |
|
666
|
666
|
if (typeof geo !== 'undefined' && geo.lat && geo.lon) {
|
|
667
|
667
|
updateSearchPosition(geo, $form);
|
|
668
|
668
|
} else {
|
|
669
|
|
- alert("<?php esc_attr_e('Search was not successful for the requested address.', 'geodirectory');?>");
|
|
|
669
|
+ alert("<?php esc_attr_e('Search was not successful for the requested address.', 'geodirectory'); ?>");
|
|
670
|
670
|
}
|
|
671
|
671
|
});
|
|
672
|
672
|
} else {
|
|
@@ -712,19 +712,19 @@ discard block |
|
|
block discarded – undo |
|
712
|
712
|
var msg;
|
|
713
|
713
|
switch (err.code) {
|
|
714
|
714
|
case err.UNKNOWN_ERROR:
|
|
715
|
|
- msg = "<?php _e('Unable to find your location','geodirectory');?>";
|
|
|
715
|
+ msg = "<?php _e('Unable to find your location', 'geodirectory'); ?>";
|
|
716
|
716
|
break;
|
|
717
|
717
|
case err.PERMISSION_DENINED:
|
|
718
|
|
- msg = "<?php _e('Permission denied in finding your location','geodirectory');?>";
|
|
|
718
|
+ msg = "<?php _e('Permission denied in finding your location', 'geodirectory'); ?>";
|
|
719
|
719
|
break;
|
|
720
|
720
|
case err.POSITION_UNAVAILABLE:
|
|
721
|
|
- msg = "<?php _e('Your location is currently unknown','geodirectory');?>";
|
|
|
721
|
+ msg = "<?php _e('Your location is currently unknown', 'geodirectory'); ?>";
|
|
722
|
722
|
break;
|
|
723
|
723
|
case err.BREAK:
|
|
724
|
|
- msg = "<?php _e('Attempt to find location took too long','geodirectory');?>";
|
|
|
724
|
+ msg = "<?php _e('Attempt to find location took too long', 'geodirectory'); ?>";
|
|
725
|
725
|
break;
|
|
726
|
726
|
default:
|
|
727
|
|
- msg = "<?php _e('Location detection not supported in browser','geodirectory');?>";
|
|
|
727
|
+ msg = "<?php _e('Location detection not supported in browser', 'geodirectory'); ?>";
|
|
728
|
728
|
}
|
|
729
|
729
|
jQuery('#info').html(msg);
|
|
730
|
730
|
}
|
|
@@ -763,7 +763,7 @@ discard block |
|
|
block discarded – undo |
|
763
|
763
|
* @param object $post The post object.
|
|
764
|
764
|
* @param string $link The link to the post.
|
|
765
|
765
|
*/
|
|
766
|
|
- $return = apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img"> </span></a>',$post,$link);
|
|
|
766
|
+ $return = apply_filters('geodir_featured_badge_on_image', '<a href="'.$link.'"><span class="geodir_featured_img"> </span></a>', $post, $link);
|
|
767
|
767
|
break;
|
|
768
|
768
|
case 'new' :
|
|
769
|
769
|
/**
|
|
@@ -773,7 +773,7 @@ discard block |
|
|
block discarded – undo |
|
773
|
773
|
* @param object $post The post object.
|
|
774
|
774
|
* @param string $link The link to the post.
|
|
775
|
775
|
*/
|
|
776
|
|
- $return = apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing"> </span></a>',$post,$link);
|
|
|
776
|
+ $return = apply_filters('geodir_new_badge_on_image', '<a href="'.$link.'"><span class="geodir_new_listing"> </span></a>', $post, $link);
|
|
777
|
777
|
break;
|
|
778
|
778
|
|
|
779
|
779
|
}
|