Passed
Push — master ( 8a4cf0...7a5fda )
by Stiofan
09:58
created
geodirectory-admin/option-pages/design_settings_array.php 1 patch
Indentation   +945 added lines, -945 removed lines patch added patch discarded remove patch
@@ -17,14 +17,14 @@  discard block
 block discarded – undo
17 17
  */
18 18
 function geodir_post_type_setting_fun()
19 19
 {
20
-    $post_type_arr = array();
20
+	$post_type_arr = array();
21 21
 
22
-    $post_types = geodir_get_posttypes('object');
22
+	$post_types = geodir_get_posttypes('object');
23 23
 
24
-    foreach ($post_types as $key => $post_types_obj) {
25
-        $post_type_arr[$key] = $post_types_obj->labels->singular_name;
26
-    }
27
-    return $post_type_arr;
24
+	foreach ($post_types as $key => $post_types_obj) {
25
+		$post_type_arr[$key] = $post_types_obj->labels->singular_name;
26
+	}
27
+	return $post_type_arr;
28 28
 }
29 29
 
30 30
 /**
@@ -35,17 +35,17 @@  discard block
 block discarded – undo
35 35
  */
36 36
 function geodir_theme_location_setting_fun()
37 37
 {
38
-    $post_type_arr = array();
39
-    $geodir_all_nav_locations = get_registered_nav_menus();
40
-    $geodir_active_nav_locations = get_nav_menu_locations();
41
-    if (!empty($geodir_active_nav_locations) && is_array($geodir_active_nav_locations)) {
42
-        foreach ($geodir_active_nav_locations as $key => $theme_location) {
43
-            if (!empty($geodir_all_nav_locations) && is_array($geodir_all_nav_locations) && array_key_exists($key, $geodir_all_nav_locations))
44
-                $post_type_arr[$key] = $geodir_all_nav_locations[$key];
45
-        }
46
-    }
47
-
48
-    return $post_type_arr;
38
+	$post_type_arr = array();
39
+	$geodir_all_nav_locations = get_registered_nav_menus();
40
+	$geodir_active_nav_locations = get_nav_menu_locations();
41
+	if (!empty($geodir_active_nav_locations) && is_array($geodir_active_nav_locations)) {
42
+		foreach ($geodir_active_nav_locations as $key => $theme_location) {
43
+			if (!empty($geodir_all_nav_locations) && is_array($geodir_all_nav_locations) && array_key_exists($key, $geodir_all_nav_locations))
44
+				$post_type_arr[$key] = $geodir_all_nav_locations[$key];
45
+		}
46
+	}
47
+
48
+	return $post_type_arr;
49 49
 }
50 50
 /**
51 51
  * Filter GD design settings array.
@@ -55,543 +55,543 @@  discard block
 block discarded – undo
55 55
  */
56 56
 $geodir_settings['design_settings'] = apply_filters('geodir_design_settings', array(
57 57
 
58
-    /* Home Layout Settings start */
59
-    array('name' => __('Home', 'geodirectory'), 'type' => 'title', 'desc' => 'Setting to set home page layout', 'id' => 'home_page_settings '),
58
+	/* Home Layout Settings start */
59
+	array('name' => __('Home', 'geodirectory'), 'type' => 'title', 'desc' => 'Setting to set home page layout', 'id' => 'home_page_settings '),
60 60
 
61 61
 
62
-    array('name' => __('Home Top Section Settings', 'geodirectory'),
63
-        'type' => 'sectionstart',
64
-        'desc' => '',
65
-        'id' => 'geodir_home_top_section'),
62
+	array('name' => __('Home Top Section Settings', 'geodirectory'),
63
+		'type' => 'sectionstart',
64
+		'desc' => '',
65
+		'id' => 'geodir_home_top_section'),
66 66
 
67
-    array(
68
-        'name' => __('Geodirectory home page', 'geodirectory'),
69
-        'desc' => __('Set geodirectory home page as your home. <b style="color:red;">This setting has been depreciated and will be removed in the next version, instead please set the GD home page in GD>Permalinks and then set this page to the front page under Settings>Reading>Front Page</b>', 'geodirectory'),
70
-        'id' => 'geodir_set_as_home',
71
-        'type' => 'checkbox',
72
-        'std' => '0' // Default value to show home top section
73
-    ),
67
+	array(
68
+		'name' => __('Geodirectory home page', 'geodirectory'),
69
+		'desc' => __('Set geodirectory home page as your home. <b style="color:red;">This setting has been depreciated and will be removed in the next version, instead please set the GD home page in GD>Permalinks and then set this page to the front page under Settings>Reading>Front Page</b>', 'geodirectory'),
70
+		'id' => 'geodir_set_as_home',
71
+		'type' => 'checkbox',
72
+		'std' => '0' // Default value to show home top section
73
+	),
74 74
 
75
-    array(
76
-        'name' => __('Home top section', 'geodirectory'),
77
-        'desc' => __('Show the top section of home page', 'geodirectory'),
78
-        'id' => 'geodir_show_home_top_section',
79
-        'type' => 'checkbox',
80
-        'std' => '1' // Default value to show home top section
81
-    ),
75
+	array(
76
+		'name' => __('Home top section', 'geodirectory'),
77
+		'desc' => __('Show the top section of home page', 'geodirectory'),
78
+		'id' => 'geodir_show_home_top_section',
79
+		'type' => 'checkbox',
80
+		'std' => '1' // Default value to show home top section
81
+	),
82 82
 
83 83
 
84
-    array('type' => 'sectionend', 'id' => 'geodir_home_top_section'),
84
+	array('type' => 'sectionend', 'id' => 'geodir_home_top_section'),
85 85
 
86 86
 
87
-    array('name' => __('Home Page Layout Settings', 'geodirectory'),
88
-        'type' => 'sectionstart',
89
-        'desc' => '',
90
-        'id' => 'geodir_home_layout'),
87
+	array('name' => __('Home Page Layout Settings', 'geodirectory'),
88
+		'type' => 'sectionstart',
89
+		'desc' => '',
90
+		'id' => 'geodir_home_layout'),
91 91
 
92
-    array(
93
-        'name' => __('Home right section', 'geodirectory'),
94
-        'desc' => __('Show the right section of home page', 'geodirectory'),
95
-        'id' => 'geodir_show_home_right_section',
96
-        'type' => 'checkbox',
97
-        'std' => '1' // Default value to show home top section
98
-    ),
92
+	array(
93
+		'name' => __('Home right section', 'geodirectory'),
94
+		'desc' => __('Show the right section of home page', 'geodirectory'),
95
+		'id' => 'geodir_show_home_right_section',
96
+		'type' => 'checkbox',
97
+		'std' => '1' // Default value to show home top section
98
+	),
99 99
 
100
-    array(
101
-        'name' => __('Width of home right section', 'geodirectory'),
102
-        'desc' => __('Enter the width of right section of home page in %', 'geodirectory'),
103
-        'id' => 'geodir_width_home_right_section',
104
-        'type' => 'text',
105
-        'css' => 'min-width:300px;',
106
-        'std' => '30' // Default value to show home top section
107
-    ),
100
+	array(
101
+		'name' => __('Width of home right section', 'geodirectory'),
102
+		'desc' => __('Enter the width of right section of home page in %', 'geodirectory'),
103
+		'id' => 'geodir_width_home_right_section',
104
+		'type' => 'text',
105
+		'css' => 'min-width:300px;',
106
+		'std' => '30' // Default value to show home top section
107
+	),
108 108
 
109
-    array(
110
-        'name' => __('Home content section', 'geodirectory'),
111
-        'desc' => __('Show the content section of home page', 'geodirectory'),
112
-        'id' => 'geodir_show_home_contant_section',
113
-        'type' => 'checkbox',
114
-        'std' => '1' // Default value to show home top section
115
-    ),
109
+	array(
110
+		'name' => __('Home content section', 'geodirectory'),
111
+		'desc' => __('Show the content section of home page', 'geodirectory'),
112
+		'id' => 'geodir_show_home_contant_section',
113
+		'type' => 'checkbox',
114
+		'std' => '1' // Default value to show home top section
115
+	),
116 116
 
117
-    array(
118
-        'name' => __('Width of home content section', 'geodirectory'),
119
-        'desc' => __('Enter the width of content section of home page in %', 'geodirectory'),
120
-        'id' => 'geodir_width_home_contant_section',
121
-        'type' => 'text',
122
-        'css' => 'min-width:300px;',
123
-        'std' => '63' // Default value to show home top section
124
-    ),
117
+	array(
118
+		'name' => __('Width of home content section', 'geodirectory'),
119
+		'desc' => __('Enter the width of content section of home page in %', 'geodirectory'),
120
+		'id' => 'geodir_width_home_contant_section',
121
+		'type' => 'text',
122
+		'css' => 'min-width:300px;',
123
+		'std' => '63' // Default value to show home top section
124
+	),
125 125
 
126
-    array(
127
-        'name' => __('Home left section', 'geodirectory'),
128
-        'desc' => __('Show the left section of home page', 'geodirectory'),
129
-        'id' => 'geodir_show_home_left_section',
130
-        'type' => 'checkbox',
131
-        'std' => '0' // Default value to show home top section
132
-    ),
126
+	array(
127
+		'name' => __('Home left section', 'geodirectory'),
128
+		'desc' => __('Show the left section of home page', 'geodirectory'),
129
+		'id' => 'geodir_show_home_left_section',
130
+		'type' => 'checkbox',
131
+		'std' => '0' // Default value to show home top section
132
+	),
133 133
 
134
-    array(
135
-        'name' => __('Width of home left section', 'geodirectory'),
136
-        'desc' => __('Enter the width of left section of home page in %', 'geodirectory'),
137
-        'id' => 'geodir_width_home_left_section',
138
-        'type' => 'text',
139
-        'css' => 'min-width:300px;',
140
-        'std' => '30' // Default value to show home top section
141
-    ),
134
+	array(
135
+		'name' => __('Width of home left section', 'geodirectory'),
136
+		'desc' => __('Enter the width of left section of home page in %', 'geodirectory'),
137
+		'id' => 'geodir_width_home_left_section',
138
+		'type' => 'text',
139
+		'css' => 'min-width:300px;',
140
+		'std' => '30' // Default value to show home top section
141
+	),
142 142
 
143
-    array(
144
-        'name' => __('Home bottom section', 'geodirectory'),
145
-        'desc' => __('Show the bottom section of home page', 'geodirectory'),
146
-        'id' => 'geodir_show_home_bottom_section',
147
-        'type' => 'checkbox',
148
-        'std' => '0' // Default value to show home top section
149
-    ),
150
-    array(
151
-        'name' => __('Resize image large size', 'geodirectory'),
152
-        'desc' => sprintf(__('Use default wordpress media image large size ( %s ) for featured image upload. If unchecked then default geodirectory image large size ( 800x800 ) will be used.', 'geodirectory'), get_option('large_size_w') . 'x' . get_option('large_size_h')),
153
-        'id' => 'geodir_use_wp_media_large_size',
154
-        'type' => 'checkbox',
155
-        'std' => '0'
156
-    ),
143
+	array(
144
+		'name' => __('Home bottom section', 'geodirectory'),
145
+		'desc' => __('Show the bottom section of home page', 'geodirectory'),
146
+		'id' => 'geodir_show_home_bottom_section',
147
+		'type' => 'checkbox',
148
+		'std' => '0' // Default value to show home top section
149
+	),
150
+	array(
151
+		'name' => __('Resize image large size', 'geodirectory'),
152
+		'desc' => sprintf(__('Use default wordpress media image large size ( %s ) for featured image upload. If unchecked then default geodirectory image large size ( 800x800 ) will be used.', 'geodirectory'), get_option('large_size_w') . 'x' . get_option('large_size_h')),
153
+		'id' => 'geodir_use_wp_media_large_size',
154
+		'type' => 'checkbox',
155
+		'std' => '0'
156
+	),
157 157
 
158
-    array('type' => 'sectionend', 'id' => 'geodir_home_layout'),
158
+	array('type' => 'sectionend', 'id' => 'geodir_home_layout'),
159 159
 
160 160
 
161
-    /* Home Layout Settings end */
161
+	/* Home Layout Settings end */
162 162
 
163 163
 
164
-    /* Listing Layout Settings end */
164
+	/* Listing Layout Settings end */
165 165
 
166
-    array('name' => __('Listings', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_listing_settings '),
166
+	array('name' => __('Listings', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_listing_settings '),
167 167
 
168 168
 
169
-    array('name' => __('Listing Page Layout Settings', 'geodirectory'),
170
-        'type' => 'sectionstart',
171
-        'desc' => '',
172
-        'id' => 'geodir_listing_layout'),
169
+	array('name' => __('Listing Page Layout Settings', 'geodirectory'),
170
+		'type' => 'sectionstart',
171
+		'desc' => '',
172
+		'id' => 'geodir_listing_layout'),
173 173
 
174
-    array(
175
-        'name' => __('Listing top section', 'geodirectory'),
176
-        'desc' => __('Show the top section of listing page', 'geodirectory'),
177
-        'id' => 'geodir_show_listing_top_section',
178
-        'type' => 'checkbox',
179
-        'std' => '1' // Default value to show home top section
180
-    ),
174
+	array(
175
+		'name' => __('Listing top section', 'geodirectory'),
176
+		'desc' => __('Show the top section of listing page', 'geodirectory'),
177
+		'id' => 'geodir_show_listing_top_section',
178
+		'type' => 'checkbox',
179
+		'std' => '1' // Default value to show home top section
180
+	),
181 181
 
182
-    array(
183
-        'name' => __('Listing right section', 'geodirectory'),
184
-        'desc' => __('Show the right section of listing page', 'geodirectory'),
185
-        'id' => 'geodir_show_listing_right_section',
186
-        'type' => 'checkbox',
187
-        'std' => '1' // Default value to show home top section
188
-    ),
182
+	array(
183
+		'name' => __('Listing right section', 'geodirectory'),
184
+		'desc' => __('Show the right section of listing page', 'geodirectory'),
185
+		'id' => 'geodir_show_listing_right_section',
186
+		'type' => 'checkbox',
187
+		'std' => '1' // Default value to show home top section
188
+	),
189 189
 
190
-    array(
191
-        'name' => __('Width of listing right section', 'geodirectory'),
192
-        'desc' => __('Enter the width of right section of listing page in %', 'geodirectory'),
193
-        'id' => 'geodir_width_listing_right_section',
194
-        'type' => 'text',
195
-        'css' => 'min-width:300px;',
196
-        'std' => '30' // Default value to show home top section
197
-    ),
190
+	array(
191
+		'name' => __('Width of listing right section', 'geodirectory'),
192
+		'desc' => __('Enter the width of right section of listing page in %', 'geodirectory'),
193
+		'id' => 'geodir_width_listing_right_section',
194
+		'type' => 'text',
195
+		'css' => 'min-width:300px;',
196
+		'std' => '30' // Default value to show home top section
197
+	),
198 198
 
199 199
 
200
-    array(
201
-        'name' => __('Listing content section view', 'geodirectory'),
202
-        'desc' => __('Set the listing view of listing page', 'geodirectory'),
203
-        'id' => 'geodir_listing_view',
204
-        'css' => 'min-width:300px;',
205
-        'std' => 'gridview_onehalf',
206
-        'type' => 'select',
207
-        'class' => 'chosen_select',
208
-        'options' => array_unique(array(
209
-            'gridview_onehalf' => __('Grid View (Two Columns)', 'geodirectory'),
210
-            'gridview_onethird' => __('Grid View (Three Columns)', 'geodirectory'),
211
-            'gridview_onefourth' => __('Grid View (Four Columns)', 'geodirectory'),
212
-            'gridview_onefifth' => __('Grid View (Five Columns)', 'geodirectory'),
213
-            'listview' => __('List view', 'geodirectory'),
214
-        ))
215
-    ),
200
+	array(
201
+		'name' => __('Listing content section view', 'geodirectory'),
202
+		'desc' => __('Set the listing view of listing page', 'geodirectory'),
203
+		'id' => 'geodir_listing_view',
204
+		'css' => 'min-width:300px;',
205
+		'std' => 'gridview_onehalf',
206
+		'type' => 'select',
207
+		'class' => 'chosen_select',
208
+		'options' => array_unique(array(
209
+			'gridview_onehalf' => __('Grid View (Two Columns)', 'geodirectory'),
210
+			'gridview_onethird' => __('Grid View (Three Columns)', 'geodirectory'),
211
+			'gridview_onefourth' => __('Grid View (Four Columns)', 'geodirectory'),
212
+			'gridview_onefifth' => __('Grid View (Five Columns)', 'geodirectory'),
213
+			'listview' => __('List view', 'geodirectory'),
214
+		))
215
+	),
216 216
 
217
-    array(
218
-        'name' => __('Width of listing content section', 'geodirectory'),
219
-        'desc' => __('Enter the width of content section of listing page in %', 'geodirectory'),
220
-        'id' => 'geodir_width_listing_contant_section',
221
-        'type' => 'text',
222
-        'css' => 'min-width:300px;',
223
-        'std' => '63' // Default value to show home top section
224
-    ),
217
+	array(
218
+		'name' => __('Width of listing content section', 'geodirectory'),
219
+		'desc' => __('Enter the width of content section of listing page in %', 'geodirectory'),
220
+		'id' => 'geodir_width_listing_contant_section',
221
+		'type' => 'text',
222
+		'css' => 'min-width:300px;',
223
+		'std' => '63' // Default value to show home top section
224
+	),
225 225
 
226
-    array(
227
-        'name' => __('Listing left section', 'geodirectory'),
228
-        'desc' => __('Show the left section of listing page', 'geodirectory'),
229
-        'id' => 'geodir_show_listing_left_section',
230
-        'type' => 'checkbox',
231
-        'std' => '0' // Default value to show home top section
232
-    ),
226
+	array(
227
+		'name' => __('Listing left section', 'geodirectory'),
228
+		'desc' => __('Show the left section of listing page', 'geodirectory'),
229
+		'id' => 'geodir_show_listing_left_section',
230
+		'type' => 'checkbox',
231
+		'std' => '0' // Default value to show home top section
232
+	),
233 233
 
234
-    array(
235
-        'name' => __('Width of listing left section', 'geodirectory'),
236
-        'desc' => __('Enter the width of left section of listing in %', 'geodirectory'),
237
-        'id' => 'geodir_width_listing_left_section',
238
-        'type' => 'text',
239
-        'css' => 'min-width:300px;',
240
-        'std' => '30' // Default value to show home top section
241
-    ),
234
+	array(
235
+		'name' => __('Width of listing left section', 'geodirectory'),
236
+		'desc' => __('Enter the width of left section of listing in %', 'geodirectory'),
237
+		'id' => 'geodir_width_listing_left_section',
238
+		'type' => 'text',
239
+		'css' => 'min-width:300px;',
240
+		'std' => '30' // Default value to show home top section
241
+	),
242 242
 
243
-    array(
244
-        'name' => __('Listing bottom section', 'geodirectory'),
245
-        'desc' => __('Show the bottom section of listing page', 'geodirectory'),
246
-        'id' => 'geodir_show_listing_bottom_section',
247
-        'type' => 'checkbox',
248
-        'std' => '0' // Default value to show home top section
249
-    ),
243
+	array(
244
+		'name' => __('Listing bottom section', 'geodirectory'),
245
+		'desc' => __('Show the bottom section of listing page', 'geodirectory'),
246
+		'id' => 'geodir_show_listing_bottom_section',
247
+		'type' => 'checkbox',
248
+		'std' => '0' // Default value to show home top section
249
+	),
250 250
 
251
-    array(
252
-        'name' => __('Upload listing no image', 'geodirectory'),
253
-        'desc' => '',
254
-        'id' => 'geodir_listing_no_img',
255
-        'type' => 'file',
256
-        'std' => '0' // Default value to show home top section
257
-    ),
251
+	array(
252
+		'name' => __('Upload listing no image', 'geodirectory'),
253
+		'desc' => '',
254
+		'id' => 'geodir_listing_no_img',
255
+		'type' => 'file',
256
+		'std' => '0' // Default value to show home top section
257
+	),
258 258
 
259
-    array(
260
-        'name' => __('Description word limit', 'geodirectory'),
261
-        'desc' => '',
262
-        'id' => 'geodir_desc_word_limit',
263
-        'type' => 'text',
264
-        'css' => 'min-width:300px;',
265
-        'std' => '50' // Default value to show home top section
266
-    ),
259
+	array(
260
+		'name' => __('Description word limit', 'geodirectory'),
261
+		'desc' => '',
262
+		'id' => 'geodir_desc_word_limit',
263
+		'type' => 'text',
264
+		'css' => 'min-width:300px;',
265
+		'std' => '50' // Default value to show home top section
266
+	),
267 267
 
268
-    array(
269
-        'name' => __('Hover listing map animation', 'geodirectory'),
270
-        'desc' => __('Bounce map pin if listing hovered', 'geodirectory'),
271
-        'id' => 'geodir_listing_hover_bounce_map_pin',
272
-        'type' => 'checkbox',
273
-        'std' => '1' // Default value to show home top section
274
-    ),
268
+	array(
269
+		'name' => __('Hover listing map animation', 'geodirectory'),
270
+		'desc' => __('Bounce map pin if listing hovered', 'geodirectory'),
271
+		'id' => 'geodir_listing_hover_bounce_map_pin',
272
+		'type' => 'checkbox',
273
+		'std' => '1' // Default value to show home top section
274
+	),
275 275
 
276
-    array('type' => 'sectionend', 'id' => 'geodir_listing_layout'),
276
+	array('type' => 'sectionend', 'id' => 'geodir_listing_layout'),
277 277
 
278 278
 
279
-    array('name' => __('Listing General Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_listing_gen_settings '),
279
+	array('name' => __('Listing General Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_listing_gen_settings '),
280 280
 
281
-    array(
282
-        'name' => __('New listing default status', 'geodirectory'),
283
-        'desc' => __('Select new listing default status.', 'geodirectory'),
284
-        'tip' => '',
285
-        'id' => 'geodir_new_post_default_status',
286
-        'css' => 'min-width:300px;',
287
-        'std' => 'publish',
288
-        'type' => 'select',
289
-        'class' => 'chosen_select',
290
-        'options' => array_unique(array(
291
-            'publish' => __('publish', 'geodirectory'),
292
-            'draft' => __('draft', 'geodirectory'),
293
-        ))
294
-    ),
281
+	array(
282
+		'name' => __('New listing default status', 'geodirectory'),
283
+		'desc' => __('Select new listing default status.', 'geodirectory'),
284
+		'tip' => '',
285
+		'id' => 'geodir_new_post_default_status',
286
+		'css' => 'min-width:300px;',
287
+		'std' => 'publish',
288
+		'type' => 'select',
289
+		'class' => 'chosen_select',
290
+		'options' => array_unique(array(
291
+			'publish' => __('publish', 'geodirectory'),
292
+			'draft' => __('draft', 'geodirectory'),
293
+		))
294
+	),
295 295
 
296
-    array(
297
-        'name' => __('New listings settings', 'geodirectory'),
298
-        'desc' => __('Enter number of days a listing will appear new.(enter 0 to disable feature)', 'geodirectory'),
299
-        'id' => 'geodir_listing_new_days',
300
-        'type' => 'text',
301
-        'css' => 'min-width:300px;',
302
-        'std' => '30' // Default value for the page title - changed in settings
303
-    ),
296
+	array(
297
+		'name' => __('New listings settings', 'geodirectory'),
298
+		'desc' => __('Enter number of days a listing will appear new.(enter 0 to disable feature)', 'geodirectory'),
299
+		'id' => 'geodir_listing_new_days',
300
+		'type' => 'text',
301
+		'css' => 'min-width:300px;',
302
+		'std' => '30' // Default value for the page title - changed in settings
303
+	),
304 304
 
305
-    array('type' => 'sectionend', 'id' => 'geodir_listing_gen_settings'),
305
+	array('type' => 'sectionend', 'id' => 'geodir_listing_gen_settings'),
306 306
 
307 307
 
308
-    array('name' => __('Add Listing Form Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_add_listing_gen_settings'),
308
+	array('name' => __('Add Listing Form Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_add_listing_gen_settings'),
309 309
 
310
-    array(
311
-        'name' => __('Enable "Accept Terms and Conditions"', 'geodirectory'),
312
-        'desc' => __('Show the "Accept Terms and Conditions" field on add listing.', 'geodirectory'),
313
-        'id' => 'geodir_accept_term_condition',
314
-        'type' => 'checkbox',
315
-        'std' => '1' // Default value to show home top section
316
-    ),
310
+	array(
311
+		'name' => __('Enable "Accept Terms and Conditions"', 'geodirectory'),
312
+		'desc' => __('Show the "Accept Terms and Conditions" field on add listing.', 'geodirectory'),
313
+		'id' => 'geodir_accept_term_condition',
314
+		'type' => 'checkbox',
315
+		'std' => '1' // Default value to show home top section
316
+	),
317 317
 
318 318
 
319
-    array(
320
-        'name' => __('Show description field as editor', 'geodirectory'),
321
-        'desc' => __('Select post types to show advanced editor on add listing page.', 'geodirectory'),
322
-        'tip' => '',
323
-        'id' => 'geodir_tiny_editor_on_add_listing',
324
-        'css' => 'min-width:300px;',
325
-        'std' => array(),
326
-        'type' => 'multiselect',
327
-        'placeholder_text' => __('Select post types', 'geodirectory'),
328
-        'class' => 'chosen_select',
329
-        'options' => array_unique(geodir_post_type_setting_fun())
330
-    ),
319
+	array(
320
+		'name' => __('Show description field as editor', 'geodirectory'),
321
+		'desc' => __('Select post types to show advanced editor on add listing page.', 'geodirectory'),
322
+		'tip' => '',
323
+		'id' => 'geodir_tiny_editor_on_add_listing',
324
+		'css' => 'min-width:300px;',
325
+		'std' => array(),
326
+		'type' => 'multiselect',
327
+		'placeholder_text' => __('Select post types', 'geodirectory'),
328
+		'class' => 'chosen_select',
329
+		'options' => array_unique(geodir_post_type_setting_fun())
330
+	),
331 331
 
332
-    array('type' => 'sectionend', 'id' => 'geodir_add_listing_gen_settings'),
333
-    /* Listing Layout Settings end */
332
+	array('type' => 'sectionend', 'id' => 'geodir_add_listing_gen_settings'),
333
+	/* Listing Layout Settings end */
334 334
 
335 335
 
336
-    /* Search Layout Settings end */
336
+	/* Search Layout Settings end */
337 337
 
338
-    array('name' => __('Search', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_search_settings '),
338
+	array('name' => __('Search', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_search_settings '),
339 339
 
340 340
 
341
-    array('name' => __('Search Page Layout Settings', 'geodirectory'),
342
-        'type' => 'sectionstart',
343
-        'desc' => '',
344
-        'id' => 'geodir_search_layout'),
341
+	array('name' => __('Search Page Layout Settings', 'geodirectory'),
342
+		'type' => 'sectionstart',
343
+		'desc' => '',
344
+		'id' => 'geodir_search_layout'),
345 345
 
346
-    array(
347
-        'name' => __('Search top section', 'geodirectory'),
348
-        'desc' => __('Show the top section of search page', 'geodirectory'),
349
-        'id' => 'geodir_show_search_top_section',
350
-        'type' => 'checkbox',
351
-        'std' => '1' // Default value to show home top section
352
-    ),
346
+	array(
347
+		'name' => __('Search top section', 'geodirectory'),
348
+		'desc' => __('Show the top section of search page', 'geodirectory'),
349
+		'id' => 'geodir_show_search_top_section',
350
+		'type' => 'checkbox',
351
+		'std' => '1' // Default value to show home top section
352
+	),
353 353
 
354
-    array(
355
-        'name' => __('Search right section', 'geodirectory'),
356
-        'desc' => __('Show the right section of search page', 'geodirectory'),
357
-        'id' => 'geodir_show_search_right_section',
358
-        'type' => 'checkbox',
359
-        'std' => '1' // Default value to show home top section
360
-    ),
354
+	array(
355
+		'name' => __('Search right section', 'geodirectory'),
356
+		'desc' => __('Show the right section of search page', 'geodirectory'),
357
+		'id' => 'geodir_show_search_right_section',
358
+		'type' => 'checkbox',
359
+		'std' => '1' // Default value to show home top section
360
+	),
361 361
 
362
-    array(
363
-        'name' => __('Width of search right section', 'geodirectory'),
364
-        'desc' => __('Enter the width of right section of search page in %', 'geodirectory'),
365
-        'id' => 'geodir_width_search_right_section',
366
-        'type' => 'text',
367
-        'css' => 'min-width:300px;',
368
-        'std' => '30' // Default value to show home top section
369
-    ),
362
+	array(
363
+		'name' => __('Width of search right section', 'geodirectory'),
364
+		'desc' => __('Enter the width of right section of search page in %', 'geodirectory'),
365
+		'id' => 'geodir_width_search_right_section',
366
+		'type' => 'text',
367
+		'css' => 'min-width:300px;',
368
+		'std' => '30' // Default value to show home top section
369
+	),
370 370
 
371 371
 
372
-    array(
373
-        'name' => __('Search content section view', 'geodirectory'),
374
-        'desc' => __('Set the listing view of search page', 'geodirectory'),
375
-        'id' => 'geodir_search_view',
376
-        'css' => 'min-width:300px;',
377
-        'std' => 'gridview_onehalf',
378
-        'type' => 'select',
379
-        'class' => 'chosen_select',
380
-        'options' => array_unique(array(
381
-            'gridview_onehalf' => __('Grid View (Two Columns)', 'geodirectory'),
382
-            'gridview_onethird' => __('Grid View (Three Columns)', 'geodirectory'),
383
-            'gridview_onefourth' => __('Grid View (Four Columns)', 'geodirectory'),
384
-            'gridview_onefifth' => __('Grid View (Five Columns)', 'geodirectory'),
385
-            'listview' => __('List view', 'geodirectory'),
386
-        ))
387
-    ),
372
+	array(
373
+		'name' => __('Search content section view', 'geodirectory'),
374
+		'desc' => __('Set the listing view of search page', 'geodirectory'),
375
+		'id' => 'geodir_search_view',
376
+		'css' => 'min-width:300px;',
377
+		'std' => 'gridview_onehalf',
378
+		'type' => 'select',
379
+		'class' => 'chosen_select',
380
+		'options' => array_unique(array(
381
+			'gridview_onehalf' => __('Grid View (Two Columns)', 'geodirectory'),
382
+			'gridview_onethird' => __('Grid View (Three Columns)', 'geodirectory'),
383
+			'gridview_onefourth' => __('Grid View (Four Columns)', 'geodirectory'),
384
+			'gridview_onefifth' => __('Grid View (Five Columns)', 'geodirectory'),
385
+			'listview' => __('List view', 'geodirectory'),
386
+		))
387
+	),
388 388
 
389
-    array(
390
-        'name' => __('Width of search content section', 'geodirectory'),
391
-        'desc' => __('Enter the width of content section of search page in %', 'geodirectory'),
392
-        'id' => 'geodir_width_search_contant_section',
393
-        'type' => 'text',
394
-        'css' => 'min-width:300px;',
395
-        'std' => '63' // Default value to show home top section
396
-    ),
389
+	array(
390
+		'name' => __('Width of search content section', 'geodirectory'),
391
+		'desc' => __('Enter the width of content section of search page in %', 'geodirectory'),
392
+		'id' => 'geodir_width_search_contant_section',
393
+		'type' => 'text',
394
+		'css' => 'min-width:300px;',
395
+		'std' => '63' // Default value to show home top section
396
+	),
397 397
 
398
-    array(
399
-        'name' => __('Search left section', 'geodirectory'),
400
-        'desc' => __('Show the left section of search page', 'geodirectory'),
401
-        'id' => 'geodir_show_search_left_section',
402
-        'type' => 'checkbox',
403
-        'std' => '0' // Default value to show home top section
404
-    ),
398
+	array(
399
+		'name' => __('Search left section', 'geodirectory'),
400
+		'desc' => __('Show the left section of search page', 'geodirectory'),
401
+		'id' => 'geodir_show_search_left_section',
402
+		'type' => 'checkbox',
403
+		'std' => '0' // Default value to show home top section
404
+	),
405 405
 
406
-    array(
407
-        'name' => __('Width of search left section', 'geodirectory'),
408
-        'desc' => __('Enter the width of left section of search in %', 'geodirectory'),
409
-        'id' => 'geodir_width_search_left_section',
410
-        'type' => 'text',
411
-        'css' => 'min-width:300px;',
412
-        'std' => '30' // Default value to show home top section
413
-    ),
406
+	array(
407
+		'name' => __('Width of search left section', 'geodirectory'),
408
+		'desc' => __('Enter the width of left section of search in %', 'geodirectory'),
409
+		'id' => 'geodir_width_search_left_section',
410
+		'type' => 'text',
411
+		'css' => 'min-width:300px;',
412
+		'std' => '30' // Default value to show home top section
413
+	),
414 414
 
415
-    array(
416
-        'name' => __('Search bottom section', 'geodirectory'),
417
-        'desc' => __('Show the bottom section of search page', 'geodirectory'),
418
-        'id' => 'geodir_show_search_bottom_section',
419
-        'type' => 'checkbox',
420
-        'std' => '0' // Default value to show home top section
421
-    ),
415
+	array(
416
+		'name' => __('Search bottom section', 'geodirectory'),
417
+		'desc' => __('Show the bottom section of search page', 'geodirectory'),
418
+		'id' => 'geodir_show_search_bottom_section',
419
+		'type' => 'checkbox',
420
+		'std' => '0' // Default value to show home top section
421
+	),
422 422
 	
423 423
 	array(
424
-        'name' => __('Show advanced pagination details', 'geodirectory'),
425
-        'desc' => __('This will add extra pagination info like "Showing listings x-y of z" after/before pagination.', 'geodirectory'),
426
-        'id' => 'geodir_pagination_advance_info',
427
-        'css' => 'min-width:300px;',
428
-        'std' => '',
429
-        'type' => 'select',
430
-        'class' => 'chosen_select',
431
-        'options' => array(
424
+		'name' => __('Show advanced pagination details', 'geodirectory'),
425
+		'desc' => __('This will add extra pagination info like "Showing listings x-y of z" after/before pagination.', 'geodirectory'),
426
+		'id' => 'geodir_pagination_advance_info',
427
+		'css' => 'min-width:300px;',
428
+		'std' => '',
429
+		'type' => 'select',
430
+		'class' => 'chosen_select',
431
+		'options' => array(
432 432
 						'' => __('Never Display', 'geodirectory'),
433 433
 						'after' => __('After Pagination', 'geodirectory'),
434 434
 						'before' => __('Before Pagination', 'geodirectory')
435 435
 					)
436
-    ),
436
+	),
437 437
 
438
-    array('type' => 'sectionend', 'id' => 'geodir_search_layout'),
438
+	array('type' => 'sectionend', 'id' => 'geodir_search_layout'),
439 439
 
440 440
 
441
-    array('name' => __('Search form default text settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_search_form_default_text_settings'),
441
+	array('name' => __('Search form default text settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_search_form_default_text_settings'),
442 442
 
443
-    array(
444
-        'name' => __('Search field default value', 'geodirectory'),
445
-        'desc' => __('Show the search text box \'placeholder\' value on search form.', 'geodirectory'),
446
-        'id' => 'geodir_search_field_default_text',
447
-        'type' => 'text',
448
-        'css' => 'min-width:300px;',
449
-        'std' => 'Search for' // show on the listing page.
450
-    ),
443
+	array(
444
+		'name' => __('Search field default value', 'geodirectory'),
445
+		'desc' => __('Show the search text box \'placeholder\' value on search form.', 'geodirectory'),
446
+		'id' => 'geodir_search_field_default_text',
447
+		'type' => 'text',
448
+		'css' => 'min-width:300px;',
449
+		'std' => 'Search for' // show on the listing page.
450
+	),
451 451
 
452
-    array(
453
-        'name' => __('Near field default value', 'geodirectory'),
454
-        'desc' => __('Show the near text box \'placeholder\' value on search form.', 'geodirectory'),
455
-        'id' => 'geodir_near_field_default_text',
456
-        'type' => 'text',
457
-        'css' => 'min-width:300px;',
458
-        'std' => 'Near' // show on the listing page.
459
-    ),
452
+	array(
453
+		'name' => __('Near field default value', 'geodirectory'),
454
+		'desc' => __('Show the near text box \'placeholder\' value on search form.', 'geodirectory'),
455
+		'id' => 'geodir_near_field_default_text',
456
+		'type' => 'text',
457
+		'css' => 'min-width:300px;',
458
+		'std' => 'Near' // show on the listing page.
459
+	),
460 460
 
461
-    array(
462
-        'name' => __('Search button label', 'geodirectory'),
463
-        'desc' => __('Show the search button label on search form.', 'geodirectory'),
464
-        'id' => 'geodir_search_button_label',
465
-        'type' => 'text',
466
-        'css' => 'min-width:300px;',
467
-        'std' => 'Search' // show on the listing page.
468
-    ),
461
+	array(
462
+		'name' => __('Search button label', 'geodirectory'),
463
+		'desc' => __('Show the search button label on search form.', 'geodirectory'),
464
+		'id' => 'geodir_search_button_label',
465
+		'type' => 'text',
466
+		'css' => 'min-width:300px;',
467
+		'std' => 'Search' // show on the listing page.
468
+	),
469 469
 
470
-    array('type' => 'sectionend', 'id' => 'geodir_search_form_default_text_settings'),
470
+	array('type' => 'sectionend', 'id' => 'geodir_search_form_default_text_settings'),
471 471
 
472
-    /* Listing Layout Settings end */
472
+	/* Listing Layout Settings end */
473 473
 
474 474
 
475
-    /* Detail Layout Settings end */
475
+	/* Detail Layout Settings end */
476 476
 
477
-    array('name' => __('Detail', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_detail_settings '),
477
+	array('name' => __('Detail', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_detail_settings '),
478 478
 
479
-    array('name' => __('Detail/Single Page Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'detail_page_settings '),
479
+	array('name' => __('Detail/Single Page Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'detail_page_settings '),
480 480
 
481
-    array(
482
-        'name' => __('Detail top section', 'geodirectory'),
483
-        'desc' => __('Show the top section of listing page', 'geodirectory'),
484
-        'id' => 'geodir_show_detail_top_section',
485
-        'type' => 'checkbox',
486
-        'std' => '1' // Default value to show home top section
487
-    ),
481
+	array(
482
+		'name' => __('Detail top section', 'geodirectory'),
483
+		'desc' => __('Show the top section of listing page', 'geodirectory'),
484
+		'id' => 'geodir_show_detail_top_section',
485
+		'type' => 'checkbox',
486
+		'std' => '1' // Default value to show home top section
487
+	),
488 488
 
489
-    array(
490
-        'name' => __('Detail bottom section', 'geodirectory'),
491
-        'desc' => __('Show the bottom section of listing page', 'geodirectory'),
492
-        'id' => 'geodir_show_detail_bottom_section',
493
-        'type' => 'checkbox',
494
-        'std' => '1' // Default value to show home top section
495
-    ),
496
-    array(
497
-        'name' => __('Detail sidebar section on left side', 'geodirectory'),
498
-        'desc' => __('Display detail sidebar section on left side of the detail page', 'geodirectory'),
499
-        'id' => 'geodir_detail_sidebar_left_section',
500
-        'type' => 'checkbox',
501
-        'std' => '0'
502
-    ),
503
-    array(
504
-        'name' => __('Disable GD modal', 'geodirectory'),
505
-        'desc' => __('Disable GD modal that displays slideshow images in popup', 'geodirectory'),
506
-        'id' => 'geodir_disable_gb_modal',
507
-        'type' => 'checkbox',
508
-        'std' => '0'
509
-    ),
510
-    array(
511
-        'name' => __('Disable Tweet, Fb Like, Google+ buttons section', 'geodirectory'),
512
-        'desc' => __('Disable Tweet, Fb Like, Google+ buttons section that displays on Detail page sidebar', 'geodirectory'),
513
-        'id' => 'geodir_disable_tfg_buttons_section',
514
-        'type' => 'checkbox',
515
-        'std' => '0'
516
-    ),
517
-    array(
518
-        'name' => __('Disable share this button section', 'geodirectory'),
519
-        'desc' => __('Disable share this button section that displays on Detail page sidebar', 'geodirectory'),
520
-        'id' => 'geodir_disable_sharethis_button_section',
521
-        'type' => 'checkbox',
522
-        'std' => '0'
523
-    ),
524
-    array(
525
-        'name' => __('Disable Google Analytics section', 'geodirectory'),
526
-        'desc' => __('Disable Google Analytics section that displays on Detail page sidebar', 'geodirectory'),
527
-        'id' => 'geodir_disable_google_analytics_section',
528
-        'type' => 'checkbox',
529
-        'std' => '0'
530
-    ),
531
-    array(
532
-        'name' => __('Disable User Links section', 'geodirectory'),
533
-        'desc' => __('Disable User Links section (Edit post, Favorite etc..) that displays on Detail page sidebar', 'geodirectory'),
534
-        'id' => 'geodir_disable_user_links_section',
535
-        'type' => 'checkbox',
536
-        'std' => '0'
537
-    ),
538
-    array(
539
-        'name' => __('Disable Rating Info section', 'geodirectory'),
540
-        'desc' => __('Disable Rating Info section that displays on Detail page sidebar', 'geodirectory'),
541
-        'id' => 'geodir_disable_rating_info_section',
542
-        'type' => 'checkbox',
543
-        'std' => '0'
544
-    ),
545
-    array(
546
-        'name' => __('Disable Listing Info section', 'geodirectory'),
547
-        'desc' => __('Disable Listing Info section that displays on Detail page sidebar', 'geodirectory'),
548
-        'id' => 'geodir_disable_listing_info_section',
549
-        'type' => 'checkbox',
550
-        'std' => '0'
551
-    ),
489
+	array(
490
+		'name' => __('Detail bottom section', 'geodirectory'),
491
+		'desc' => __('Show the bottom section of listing page', 'geodirectory'),
492
+		'id' => 'geodir_show_detail_bottom_section',
493
+		'type' => 'checkbox',
494
+		'std' => '1' // Default value to show home top section
495
+	),
496
+	array(
497
+		'name' => __('Detail sidebar section on left side', 'geodirectory'),
498
+		'desc' => __('Display detail sidebar section on left side of the detail page', 'geodirectory'),
499
+		'id' => 'geodir_detail_sidebar_left_section',
500
+		'type' => 'checkbox',
501
+		'std' => '0'
502
+	),
503
+	array(
504
+		'name' => __('Disable GD modal', 'geodirectory'),
505
+		'desc' => __('Disable GD modal that displays slideshow images in popup', 'geodirectory'),
506
+		'id' => 'geodir_disable_gb_modal',
507
+		'type' => 'checkbox',
508
+		'std' => '0'
509
+	),
510
+	array(
511
+		'name' => __('Disable Tweet, Fb Like, Google+ buttons section', 'geodirectory'),
512
+		'desc' => __('Disable Tweet, Fb Like, Google+ buttons section that displays on Detail page sidebar', 'geodirectory'),
513
+		'id' => 'geodir_disable_tfg_buttons_section',
514
+		'type' => 'checkbox',
515
+		'std' => '0'
516
+	),
517
+	array(
518
+		'name' => __('Disable share this button section', 'geodirectory'),
519
+		'desc' => __('Disable share this button section that displays on Detail page sidebar', 'geodirectory'),
520
+		'id' => 'geodir_disable_sharethis_button_section',
521
+		'type' => 'checkbox',
522
+		'std' => '0'
523
+	),
524
+	array(
525
+		'name' => __('Disable Google Analytics section', 'geodirectory'),
526
+		'desc' => __('Disable Google Analytics section that displays on Detail page sidebar', 'geodirectory'),
527
+		'id' => 'geodir_disable_google_analytics_section',
528
+		'type' => 'checkbox',
529
+		'std' => '0'
530
+	),
531
+	array(
532
+		'name' => __('Disable User Links section', 'geodirectory'),
533
+		'desc' => __('Disable User Links section (Edit post, Favorite etc..) that displays on Detail page sidebar', 'geodirectory'),
534
+		'id' => 'geodir_disable_user_links_section',
535
+		'type' => 'checkbox',
536
+		'std' => '0'
537
+	),
538
+	array(
539
+		'name' => __('Disable Rating Info section', 'geodirectory'),
540
+		'desc' => __('Disable Rating Info section that displays on Detail page sidebar', 'geodirectory'),
541
+		'id' => 'geodir_disable_rating_info_section',
542
+		'type' => 'checkbox',
543
+		'std' => '0'
544
+	),
545
+	array(
546
+		'name' => __('Disable Listing Info section', 'geodirectory'),
547
+		'desc' => __('Disable Listing Info section that displays on Detail page sidebar', 'geodirectory'),
548
+		'id' => 'geodir_disable_listing_info_section',
549
+		'type' => 'checkbox',
550
+		'std' => '0'
551
+	),
552 552
 
553
-    array('type' => 'sectionend', 'id' => 'detail_page_settings'),
553
+	array('type' => 'sectionend', 'id' => 'detail_page_settings'),
554 554
 
555 555
 
556
-    /* ---------- DETAIL PAGE TAB SETTING START*/
556
+	/* ---------- DETAIL PAGE TAB SETTING START*/
557 557
 
558
-    array('name' => __('Detail Page Tab Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_detail_page_tab_settings '),
558
+	array('name' => __('Detail Page Tab Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_detail_page_tab_settings '),
559 559
 
560
-    array(
561
-        'name' => __('Exclude selected tabs from detail page', 'geodirectory'),
562
-        'desc' => __('Select tabs to exclude from the list of all appearing tabs on detail page.', 'geodirectory'),
563
-        'tip' => '',
564
-        'id' => 'geodir_detail_page_tabs_excluded',
565
-        'css' => 'min-width:300px;',
566
-        'std' => geodir_get_posttypes(),
567
-        'type' => 'multiselect',
568
-        'placeholder_text' => __('Select tabs', 'geodirectory'),
569
-        'class' => 'chosen_select',
570
-        'options' => array_unique(geodir_detail_page_tabs_key_value_array())
571
-    ),
560
+	array(
561
+		'name' => __('Exclude selected tabs from detail page', 'geodirectory'),
562
+		'desc' => __('Select tabs to exclude from the list of all appearing tabs on detail page.', 'geodirectory'),
563
+		'tip' => '',
564
+		'id' => 'geodir_detail_page_tabs_excluded',
565
+		'css' => 'min-width:300px;',
566
+		'std' => geodir_get_posttypes(),
567
+		'type' => 'multiselect',
568
+		'placeholder_text' => __('Select tabs', 'geodirectory'),
569
+		'class' => 'chosen_select',
570
+		'options' => array_unique(geodir_detail_page_tabs_key_value_array())
571
+	),
572 572
     
573
-    array(
574
-        'name' => __('Show as list', 'geodirectory'),
575
-        'desc' => __('Show as list instead of tabs', 'geodirectory'),
576
-        'id' => 'geodir_disable_tabs',
577
-        'type' => 'checkbox',
578
-        'std' => '0'
579
-    ),
573
+	array(
574
+		'name' => __('Show as list', 'geodirectory'),
575
+		'desc' => __('Show as list instead of tabs', 'geodirectory'),
576
+		'id' => 'geodir_disable_tabs',
577
+		'type' => 'checkbox',
578
+		'std' => '0'
579
+	),
580 580
 
581
-    array('type' => 'sectionend', 'id' => 'geodir_detail_page_tab_settings'),
582
-    /* ---------- DETAIL PAGE TAB SETTING END*/
581
+	array('type' => 'sectionend', 'id' => 'geodir_detail_page_tab_settings'),
582
+	/* ---------- DETAIL PAGE TAB SETTING END*/
583 583
 
584
-    /* START DEFAULT STAR IMAGE*/
585
-    array('name' => __('Default Rating Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_rating_settings '),
584
+	/* START DEFAULT STAR IMAGE*/
585
+	array('name' => __('Default Rating Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_rating_settings '),
586 586
 
587
-    array(
588
-        'name' => __('Upload default rating star icon', 'geodirectory'),
589
-        'desc' => '',
590
-        'id' => 'geodir_default_rating_star_icon',
591
-        'type' => 'file',
592
-        'std' => '0',
593
-        'value' => geodir_plugin_url() . '/geodirectory-assets/images/stars.png'// Default value to show home top section
594
-    ),
587
+	array(
588
+		'name' => __('Upload default rating star icon', 'geodirectory'),
589
+		'desc' => '',
590
+		'id' => 'geodir_default_rating_star_icon',
591
+		'type' => 'file',
592
+		'std' => '0',
593
+		'value' => geodir_plugin_url() . '/geodirectory-assets/images/stars.png'// Default value to show home top section
594
+	),
595 595
 	array(
596 596
 		'name' => __('Enable Font Awesome', 'geodirectory'),
597 597
 		'desc' => __('When enabled all rating images will be using font awesome rating icons as images.', 'geodirectory' ),
@@ -607,368 +607,368 @@  discard block
 block discarded – undo
607 607
 		'std' => '#757575'
608 608
 	),
609 609
 
610
-    array('type' => 'sectionend', 'id' => 'geodir_detail_page_tab_settings'),
610
+	array('type' => 'sectionend', 'id' => 'geodir_detail_page_tab_settings'),
611 611
 
612
-    /* END DEFAULT STAR IMAGE*/
612
+	/* END DEFAULT STAR IMAGE*/
613 613
 
614
-    /* Detail related post settings start */
614
+	/* Detail related post settings start */
615 615
 
616
-    array('name' => __('Related Post Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'detail_page_related_post_settings '),
616
+	array('name' => __('Related Post Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'detail_page_related_post_settings '),
617 617
 
618
-    array(
619
-        'name' => __('Show related post listing on', 'geodirectory'),
620
-        'desc' => __('Select the post types to display related listing on detail page.', 'geodirectory'),
621
-        'tip' => '',
622
-        'id' => 'geodir_add_related_listing_posttypes',
623
-        'css' => 'min-width:300px;',
624
-        'std' => geodir_get_posttypes(),
625
-        'type' => 'multiselect',
626
-        'placeholder_text' => __('Select post types', 'geodirectory'),
627
-        'class' => 'chosen_select',
628
-        'options' => array_unique(geodir_post_type_setting_fun())
629
-    ),
618
+	array(
619
+		'name' => __('Show related post listing on', 'geodirectory'),
620
+		'desc' => __('Select the post types to display related listing on detail page.', 'geodirectory'),
621
+		'tip' => '',
622
+		'id' => 'geodir_add_related_listing_posttypes',
623
+		'css' => 'min-width:300px;',
624
+		'std' => geodir_get_posttypes(),
625
+		'type' => 'multiselect',
626
+		'placeholder_text' => __('Select post types', 'geodirectory'),
627
+		'class' => 'chosen_select',
628
+		'options' => array_unique(geodir_post_type_setting_fun())
629
+	),
630 630
 
631
-    array(
632
-        'name' => __('Relate to', 'geodirectory'),
633
-        'desc' => __('Set the relation between current post to related posts.', 'geodirectory'),
634
-        'id' => 'geodir_related_post_relate_to',
635
-        'css' => 'min-width:300px;',
636
-        'std' => 'category',
637
-        'type' => 'select',
638
-        'class' => 'chosen_select',
639
-        'options' => array_unique(array(
640
-            'category' => __('Categories', 'geodirectory'),
641
-            'tags' => __('Tags', 'geodirectory'),
642
-        ))
643
-    ),
631
+	array(
632
+		'name' => __('Relate to', 'geodirectory'),
633
+		'desc' => __('Set the relation between current post to related posts.', 'geodirectory'),
634
+		'id' => 'geodir_related_post_relate_to',
635
+		'css' => 'min-width:300px;',
636
+		'std' => 'category',
637
+		'type' => 'select',
638
+		'class' => 'chosen_select',
639
+		'options' => array_unique(array(
640
+			'category' => __('Categories', 'geodirectory'),
641
+			'tags' => __('Tags', 'geodirectory'),
642
+		))
643
+	),
644 644
 
645
-    array(
646
-        'name' => __('Layout', 'geodirectory'),
647
-        'desc' => __('Set the listing view of relate post on detail page', 'geodirectory'),
648
-        'id' => 'geodir_related_post_listing_view',
649
-        'css' => 'min-width:300px;',
650
-        'std' => 'gridview_onehalf',
651
-        'type' => 'select',
652
-        'class' => 'chosen_select',
653
-        'options' => array_unique(array(
654
-            'gridview_onehalf' => __('Grid View (Two Columns)', 'geodirectory'),
655
-            'gridview_onethird' => __('Grid View (Three Columns)', 'geodirectory'),
656
-            'gridview_onefourth' => __('Grid View (Four Columns)', 'geodirectory'),
657
-            'gridview_onefifth' => __('Grid View (Five Columns)', 'geodirectory'),
658
-            'listview' => __('List view', 'geodirectory'),
659
-        ))
660
-    ),
645
+	array(
646
+		'name' => __('Layout', 'geodirectory'),
647
+		'desc' => __('Set the listing view of relate post on detail page', 'geodirectory'),
648
+		'id' => 'geodir_related_post_listing_view',
649
+		'css' => 'min-width:300px;',
650
+		'std' => 'gridview_onehalf',
651
+		'type' => 'select',
652
+		'class' => 'chosen_select',
653
+		'options' => array_unique(array(
654
+			'gridview_onehalf' => __('Grid View (Two Columns)', 'geodirectory'),
655
+			'gridview_onethird' => __('Grid View (Three Columns)', 'geodirectory'),
656
+			'gridview_onefourth' => __('Grid View (Four Columns)', 'geodirectory'),
657
+			'gridview_onefifth' => __('Grid View (Five Columns)', 'geodirectory'),
658
+			'listview' => __('List view', 'geodirectory'),
659
+		))
660
+	),
661 661
 
662
-    array(
663
-        'name' => __('Sort by', 'geodirectory'),
664
-        'desc' => __('Set the related post listing sort by view', 'geodirectory'),
665
-        'id' => 'geodir_related_post_sortby',
666
-        'css' => 'min-width:300px;',
667
-        'std' => 'latest',
668
-        'type' => 'select',
669
-        'class' => 'chosen_select',
670
-        'options' => array_unique(array(
671
-            'latest' => __('Latest', 'geodirectory'),
672
-            'featured' => __('Featured', 'geodirectory'),
673
-            'high_review' => __('Review', 'geodirectory'),
674
-            'high_rating' => __('Rating', 'geodirectory'),
675
-            'random' => __('Random', 'geodirectory'),
676
-        ))
677
-    ),
662
+	array(
663
+		'name' => __('Sort by', 'geodirectory'),
664
+		'desc' => __('Set the related post listing sort by view', 'geodirectory'),
665
+		'id' => 'geodir_related_post_sortby',
666
+		'css' => 'min-width:300px;',
667
+		'std' => 'latest',
668
+		'type' => 'select',
669
+		'class' => 'chosen_select',
670
+		'options' => array_unique(array(
671
+			'latest' => __('Latest', 'geodirectory'),
672
+			'featured' => __('Featured', 'geodirectory'),
673
+			'high_review' => __('Review', 'geodirectory'),
674
+			'high_rating' => __('Rating', 'geodirectory'),
675
+			'random' => __('Random', 'geodirectory'),
676
+		))
677
+	),
678 678
 
679
-    array(
680
-        'name' => __('Number of posts:', 'geodirectory'),
681
-        'desc' => __('Enter number of posts to display on related posts listing', 'geodirectory'),
682
-        'id' => 'geodir_related_post_count',
683
-        'type' => 'text',
684
-        'css' => 'min-width:300px;',
685
-        'std' => '5' // Default value to show home top section
686
-    ),
679
+	array(
680
+		'name' => __('Number of posts:', 'geodirectory'),
681
+		'desc' => __('Enter number of posts to display on related posts listing', 'geodirectory'),
682
+		'id' => 'geodir_related_post_count',
683
+		'type' => 'text',
684
+		'css' => 'min-width:300px;',
685
+		'std' => '5' // Default value to show home top section
686
+	),
687 687
 
688
-    array(
689
-        'name' => __('Post excerpt', 'geodirectory'),
690
-        'desc' => __('Post content excerpt character count', 'geodirectory'),
691
-        'id' => 'geodir_related_post_excerpt',
692
-        'type' => 'text',
693
-        'css' => 'min-width:300px;',
694
-        'std' => '20' // Default value to show home top section
695
-    ),
688
+	array(
689
+		'name' => __('Post excerpt', 'geodirectory'),
690
+		'desc' => __('Post content excerpt character count', 'geodirectory'),
691
+		'id' => 'geodir_related_post_excerpt',
692
+		'type' => 'text',
693
+		'css' => 'min-width:300px;',
694
+		'std' => '20' // Default value to show home top section
695
+	),
696 696
 
697 697
 
698
-    array('type' => 'sectionend', 'id' => 'detail_page_related_post_settings'),
699
-    /* Detail Layout Settings end */
698
+	array('type' => 'sectionend', 'id' => 'detail_page_related_post_settings'),
699
+	/* Detail Layout Settings end */
700 700
 
701
-    /* Author Layout Settings Start */
701
+	/* Author Layout Settings Start */
702 702
 
703
-    array('name' => __('Author', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_author_settings '),
703
+	array('name' => __('Author', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_author_settings '),
704 704
 
705 705
 
706
-    array('name' => __('Author Page Layout Settings', 'geodirectory'),
707
-        'type' => 'sectionstart',
708
-        'desc' => '',
709
-        'id' => 'geodir_author_layout'),
706
+	array('name' => __('Author Page Layout Settings', 'geodirectory'),
707
+		'type' => 'sectionstart',
708
+		'desc' => '',
709
+		'id' => 'geodir_author_layout'),
710 710
 
711
-    array(
712
-        'name' => __('Author top section', 'geodirectory'),
713
-        'desc' => __('Show the top section of author page', 'geodirectory'),
714
-        'id' => 'geodir_show_author_top_section',
715
-        'type' => 'checkbox',
716
-        'std' => '1' // Default value to show home top section
717
-    ),
711
+	array(
712
+		'name' => __('Author top section', 'geodirectory'),
713
+		'desc' => __('Show the top section of author page', 'geodirectory'),
714
+		'id' => 'geodir_show_author_top_section',
715
+		'type' => 'checkbox',
716
+		'std' => '1' // Default value to show home top section
717
+	),
718 718
 
719
-    array(
720
-        'name' => __('Author right section', 'geodirectory'),
721
-        'desc' => __('Show the right section of author page', 'geodirectory'),
722
-        'id' => 'geodir_show_author_right_section',
723
-        'type' => 'checkbox',
724
-        'std' => '1' // Default value to show home top section
725
-    ),
719
+	array(
720
+		'name' => __('Author right section', 'geodirectory'),
721
+		'desc' => __('Show the right section of author page', 'geodirectory'),
722
+		'id' => 'geodir_show_author_right_section',
723
+		'type' => 'checkbox',
724
+		'std' => '1' // Default value to show home top section
725
+	),
726 726
 
727
-    array(
728
-        'name' => __('Width of author right section', 'geodirectory'),
729
-        'desc' => __('Enter the width of right section of author page in %', 'geodirectory'),
730
-        'id' => 'geodir_width_author_right_section',
731
-        'type' => 'text',
732
-        'css' => 'min-width:300px;',
733
-        'std' => '30' // Default value to show home top section
734
-    ),
727
+	array(
728
+		'name' => __('Width of author right section', 'geodirectory'),
729
+		'desc' => __('Enter the width of right section of author page in %', 'geodirectory'),
730
+		'id' => 'geodir_width_author_right_section',
731
+		'type' => 'text',
732
+		'css' => 'min-width:300px;',
733
+		'std' => '30' // Default value to show home top section
734
+	),
735 735
 
736
-    array(
737
-        'name' => __('Author content section view', 'geodirectory'),
738
-        'desc' => __('Set the listing view of author page', 'geodirectory'),
739
-        'id' => 'geodir_author_view',
740
-        'css' => 'min-width:300px;',
741
-        'std' => 'gridview_onehalf',
742
-        'type' => 'select',
743
-        'class' => 'chosen_select',
744
-        'options' => array_unique(array(
745
-            'gridview_onehalf' => __('Grid View (Two Columns)', 'geodirectory'),
746
-            'gridview_onethird' => __('Grid View (Three Columns)', 'geodirectory'),
747
-            'gridview_onefourth' => __('Grid View (Four Columns)', 'geodirectory'),
748
-            'gridview_onefifth' => __('Grid View (Five Columns)', 'geodirectory'),
749
-            'listview' => __('List view', 'geodirectory'),
750
-        ))
751
-    ),
736
+	array(
737
+		'name' => __('Author content section view', 'geodirectory'),
738
+		'desc' => __('Set the listing view of author page', 'geodirectory'),
739
+		'id' => 'geodir_author_view',
740
+		'css' => 'min-width:300px;',
741
+		'std' => 'gridview_onehalf',
742
+		'type' => 'select',
743
+		'class' => 'chosen_select',
744
+		'options' => array_unique(array(
745
+			'gridview_onehalf' => __('Grid View (Two Columns)', 'geodirectory'),
746
+			'gridview_onethird' => __('Grid View (Three Columns)', 'geodirectory'),
747
+			'gridview_onefourth' => __('Grid View (Four Columns)', 'geodirectory'),
748
+			'gridview_onefifth' => __('Grid View (Five Columns)', 'geodirectory'),
749
+			'listview' => __('List view', 'geodirectory'),
750
+		))
751
+	),
752 752
 
753
-    array(
754
-        'name' => __('Width of author content section', 'geodirectory'),
755
-        'desc' => __('Enter the width of content section of author page in %', 'geodirectory'),
756
-        'id' => 'geodir_width_author_contant_section',
757
-        'type' => 'text',
758
-        'css' => 'min-width:300px;',
759
-        'std' => '63' // Default value to show home top section
760
-    ),
753
+	array(
754
+		'name' => __('Width of author content section', 'geodirectory'),
755
+		'desc' => __('Enter the width of content section of author page in %', 'geodirectory'),
756
+		'id' => 'geodir_width_author_contant_section',
757
+		'type' => 'text',
758
+		'css' => 'min-width:300px;',
759
+		'std' => '63' // Default value to show home top section
760
+	),
761 761
 
762
-    array(
763
-        'name' => __('Author left section', 'geodirectory'),
764
-        'desc' => __('Show the left section of author page', 'geodirectory'),
765
-        'id' => 'geodir_show_author_left_section',
766
-        'type' => 'checkbox',
767
-        'std' => '0' // Default value to show home top section
768
-    ),
762
+	array(
763
+		'name' => __('Author left section', 'geodirectory'),
764
+		'desc' => __('Show the left section of author page', 'geodirectory'),
765
+		'id' => 'geodir_show_author_left_section',
766
+		'type' => 'checkbox',
767
+		'std' => '0' // Default value to show home top section
768
+	),
769 769
 
770
-    array(
771
-        'name' => __('Width of author left section', 'geodirectory'),
772
-        'desc' => __('Enter the width of left section of home page in %', 'geodirectory'),
773
-        'id' => 'geodir_width_author_left_section',
774
-        'type' => 'text',
775
-        'css' => 'min-width:300px;',
776
-        'std' => '30' // Default value to show home top section
777
-    ),
770
+	array(
771
+		'name' => __('Width of author left section', 'geodirectory'),
772
+		'desc' => __('Enter the width of left section of home page in %', 'geodirectory'),
773
+		'id' => 'geodir_width_author_left_section',
774
+		'type' => 'text',
775
+		'css' => 'min-width:300px;',
776
+		'std' => '30' // Default value to show home top section
777
+	),
778 778
 
779
-    array(
780
-        'name' => __('Author bottom section', 'geodirectory'),
781
-        'desc' => __('Show the bottom section of author page', 'geodirectory'),
782
-        'id' => 'geodir_show_author_bottom_section',
783
-        'type' => 'checkbox',
784
-        'std' => '0' // Default value to show home top section
785
-    ),
779
+	array(
780
+		'name' => __('Author bottom section', 'geodirectory'),
781
+		'desc' => __('Show the bottom section of author page', 'geodirectory'),
782
+		'id' => 'geodir_show_author_bottom_section',
783
+		'type' => 'checkbox',
784
+		'std' => '0' // Default value to show home top section
785
+	),
786 786
 
787 787
 
788
-    array(
789
-        'name' => __('Description word limit', 'geodirectory'),
790
-        'desc' => '',
791
-        'id' => 'geodir_author_desc_word_limit',
792
-        'type' => 'text',
793
-        'css' => 'min-width:300px;',
794
-        'std' => '50' // Default value to show home top section
795
-    ),
788
+	array(
789
+		'name' => __('Description word limit', 'geodirectory'),
790
+		'desc' => '',
791
+		'id' => 'geodir_author_desc_word_limit',
792
+		'type' => 'text',
793
+		'css' => 'min-width:300px;',
794
+		'std' => '50' // Default value to show home top section
795
+	),
796 796
 
797
-    array('type' => 'sectionend', 'id' => 'geodir_author_layout'),
798
-    /* Author Layout Settings end */
797
+	array('type' => 'sectionend', 'id' => 'geodir_author_layout'),
798
+	/* Author Layout Settings end */
799 799
 
800 800
 
801
-    /* Post Type Navigation Settings Start */
802
-    array('name' => __('Navigation', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_navigation_settings'),
801
+	/* Post Type Navigation Settings Start */
802
+	array('name' => __('Navigation', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_navigation_settings'),
803 803
 
804 804
 
805
-    /* Post Type Navigation Settings Start */
805
+	/* Post Type Navigation Settings Start */
806 806
 
807
-    array('name' => __('Navigation Locations', 'geodirectory'),
808
-        'type' => 'sectionstart',
809
-        'desc' => '',
810
-        'id' => 'geodir_navigation_locations'),
807
+	array('name' => __('Navigation Locations', 'geodirectory'),
808
+		'type' => 'sectionstart',
809
+		'desc' => '',
810
+		'id' => 'geodir_navigation_locations'),
811 811
 
812
-    array(
813
-        'name' => __('Show geodirectory navigation in selected menu locations', 'geodirectory'),
814
-        'desc' => '',
815
-        'tip' => '',
816
-        'id' => 'geodir_theme_location_nav',
817
-        'css' => 'min-width:300px;',
818
-        'std' => array(),
819
-        'type' => 'multiselect',
820
-        'placeholder_text' => __('Select menu locations', 'geodirectory'),
821
-        'class' => 'chosen_select',
822
-        'options' => array_unique(geodir_theme_location_setting_fun())
823
-    ),
824
-    array('type' => 'sectionend', 'id' => 'geodir_navigation_options'),
825
-
826
-
827
-    array('name' => __('Navigation Settings', 'geodirectory'),
828
-        'type' => 'sectionstart',
829
-        'desc' => '',
830
-        'id' => 'geodir_navigation_options'),
812
+	array(
813
+		'name' => __('Show geodirectory navigation in selected menu locations', 'geodirectory'),
814
+		'desc' => '',
815
+		'tip' => '',
816
+		'id' => 'geodir_theme_location_nav',
817
+		'css' => 'min-width:300px;',
818
+		'std' => array(),
819
+		'type' => 'multiselect',
820
+		'placeholder_text' => __('Select menu locations', 'geodirectory'),
821
+		'class' => 'chosen_select',
822
+		'options' => array_unique(geodir_theme_location_setting_fun())
823
+	),
824
+	array('type' => 'sectionend', 'id' => 'geodir_navigation_options'),
831 825
 
832 826
 
833
-    array(
834
-        'name' => __('Show add listing navigation in menu', 'geodirectory'),
835
-        'desc' => sprintf(__('Show add listing navigation in main menu? (untick to disable) If you disable this option, none of the add listing link will appear in main navigation.', 'geodirectory')),
836
-        'id' => 'geodir_show_addlisting_nav',
837
-        'std' => '1',
838
-        'type' => 'checkbox'
839
-    ),
827
+	array('name' => __('Navigation Settings', 'geodirectory'),
828
+		'type' => 'sectionstart',
829
+		'desc' => '',
830
+		'id' => 'geodir_navigation_options'),
840 831
 
841
-    array(
842
-        'name' => __('Show listings navigation in menu', 'geodirectory'),
843
-        'desc' => sprintf(__('Show listing navigation in main menu? (untick to disable) If you disable this option, none of the listing link will appear in main navigation.', 'geodirectory')),
844
-        'id' => 'geodir_show_listing_nav',
845
-        'std' => '1',
846
-        'type' => 'checkbox'
847
-    ),
848 832
 
849
-    array('type' => 'sectionend', 'id' => 'geodir_navigation_options'),
833
+	array(
834
+		'name' => __('Show add listing navigation in menu', 'geodirectory'),
835
+		'desc' => sprintf(__('Show add listing navigation in main menu? (untick to disable) If you disable this option, none of the add listing link will appear in main navigation.', 'geodirectory')),
836
+		'id' => 'geodir_show_addlisting_nav',
837
+		'std' => '1',
838
+		'type' => 'checkbox'
839
+	),
850 840
 
841
+	array(
842
+		'name' => __('Show listings navigation in menu', 'geodirectory'),
843
+		'desc' => sprintf(__('Show listing navigation in main menu? (untick to disable) If you disable this option, none of the listing link will appear in main navigation.', 'geodirectory')),
844
+		'id' => 'geodir_show_listing_nav',
845
+		'std' => '1',
846
+		'type' => 'checkbox'
847
+	),
851 848
 
852
-    array('name' => __('Post Type Navigation Settings', 'geodirectory'),
853
-        'type' => 'sectionstart',
854
-        'desc' => '',
855
-        'id' => 'geodir_post_type_navigation_layout'),
856
-    array(
857
-        'name' => __('Show listing link in main navigation', 'geodirectory'),
858
-        'desc' => '',
859
-        'tip' => '',
860
-        'id' => 'geodir_add_posttype_in_main_nav',
861
-        'css' => 'min-width:300px;',
862
-        'std' => array(),
863
-        'type' => 'multiselect',
864
-        'placeholder_text' => __('Select post types', 'geodirectory'),
865
-        'class' => 'chosen_select',
866
-        'options' => array_unique(geodir_post_type_setting_fun())
867
-    ),
849
+	array('type' => 'sectionend', 'id' => 'geodir_navigation_options'),
868 850
 
869
-    array(
870
-        'name' => __('Show listing link in listing navigation', 'geodirectory'),
871
-        'desc' => '',
872
-        'tip' => '',
873
-        'id' => 'geodir_add_posttype_in_listing_nav',
874
-        'css' => 'min-width:300px;',
875
-        'std' => geodir_get_posttypes(),
876
-        'type' => 'multiselect',
877
-        'placeholder_text' => __('Select post types', 'geodirectory'),
878
-        'class' => 'chosen_select',
879
-        'options' => array_unique(geodir_post_type_setting_fun())
880
-    ),
881 851
 
882
-    array(
883
-        'name' => __('Allow post type to add from frontend', 'geodirectory'),
884
-        'desc' => '',
885
-        'tip' => '',
886
-        'id' => 'geodir_allow_posttype_frontend',
887
-        'css' => 'min-width:300px;',
888
-        'std' => geodir_get_posttypes(),
889
-        'type' => 'multiselect',
890
-        'placeholder_text' => __('Select post types', 'geodirectory'),
891
-        'class' => 'chosen_select',
892
-        'options' => array_unique(geodir_post_type_setting_fun())
893
-    ),
852
+	array('name' => __('Post Type Navigation Settings', 'geodirectory'),
853
+		'type' => 'sectionstart',
854
+		'desc' => '',
855
+		'id' => 'geodir_post_type_navigation_layout'),
856
+	array(
857
+		'name' => __('Show listing link in main navigation', 'geodirectory'),
858
+		'desc' => '',
859
+		'tip' => '',
860
+		'id' => 'geodir_add_posttype_in_main_nav',
861
+		'css' => 'min-width:300px;',
862
+		'std' => array(),
863
+		'type' => 'multiselect',
864
+		'placeholder_text' => __('Select post types', 'geodirectory'),
865
+		'class' => 'chosen_select',
866
+		'options' => array_unique(geodir_post_type_setting_fun())
867
+	),
894 868
 
895
-    array(
896
-        'name' => __('Show add listing link in main navigation', 'geodirectory'),
897
-        'desc' => '',
898
-        'tip' => '',
899
-        'id' => 'geodir_add_listing_link_main_nav',
900
-        'css' => 'min-width:300px;',
901
-        'std' => array(),
902
-        'type' => 'multiselect',
903
-        'placeholder_text' => __('Select post types', 'geodirectory'),
904
-        'class' => 'chosen_select',
905
-        'options' => array_unique(geodir_post_type_setting_fun())
906
-    ),
869
+	array(
870
+		'name' => __('Show listing link in listing navigation', 'geodirectory'),
871
+		'desc' => '',
872
+		'tip' => '',
873
+		'id' => 'geodir_add_posttype_in_listing_nav',
874
+		'css' => 'min-width:300px;',
875
+		'std' => geodir_get_posttypes(),
876
+		'type' => 'multiselect',
877
+		'placeholder_text' => __('Select post types', 'geodirectory'),
878
+		'class' => 'chosen_select',
879
+		'options' => array_unique(geodir_post_type_setting_fun())
880
+	),
907 881
 
908
-    array(
909
-        'name' => __('Show add listing link in add listing navigation', 'geodirectory'),
910
-        'desc' => '',
911
-        'tip' => '',
912
-        'id' => 'geodir_add_listing_link_add_listing_nav',
913
-        'css' => 'min-width:300px;',
914
-        'std' => geodir_get_posttypes(),
915
-        'type' => 'multiselect',
916
-        'class' => 'chosen_select',
917
-        'options' => array_unique(geodir_post_type_setting_fun())
918
-    ),
882
+	array(
883
+		'name' => __('Allow post type to add from frontend', 'geodirectory'),
884
+		'desc' => '',
885
+		'tip' => '',
886
+		'id' => 'geodir_allow_posttype_frontend',
887
+		'css' => 'min-width:300px;',
888
+		'std' => geodir_get_posttypes(),
889
+		'type' => 'multiselect',
890
+		'placeholder_text' => __('Select post types', 'geodirectory'),
891
+		'class' => 'chosen_select',
892
+		'options' => array_unique(geodir_post_type_setting_fun())
893
+	),
919 894
 
920
-    array('type' => 'sectionend', 'id' => 'geodir_post_type_navigation_layout'),
895
+	array(
896
+		'name' => __('Show add listing link in main navigation', 'geodirectory'),
897
+		'desc' => '',
898
+		'tip' => '',
899
+		'id' => 'geodir_add_listing_link_main_nav',
900
+		'css' => 'min-width:300px;',
901
+		'std' => array(),
902
+		'type' => 'multiselect',
903
+		'placeholder_text' => __('Select post types', 'geodirectory'),
904
+		'class' => 'chosen_select',
905
+		'options' => array_unique(geodir_post_type_setting_fun())
906
+	),
921 907
 
908
+	array(
909
+		'name' => __('Show add listing link in add listing navigation', 'geodirectory'),
910
+		'desc' => '',
911
+		'tip' => '',
912
+		'id' => 'geodir_add_listing_link_add_listing_nav',
913
+		'css' => 'min-width:300px;',
914
+		'std' => geodir_get_posttypes(),
915
+		'type' => 'multiselect',
916
+		'class' => 'chosen_select',
917
+		'options' => array_unique(geodir_post_type_setting_fun())
918
+	),
922 919
 
923
-    array('name' => __('User Dashboard Post Type Navigation Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_user_dashboard_post_type '),
920
+	array('type' => 'sectionend', 'id' => 'geodir_post_type_navigation_layout'),
924 921
 
925 922
 
926
-    array(
927
-        'name' => __('Show add listing link in user dashboard', 'geodirectory'),
928
-        'desc' => '',
929
-        'tip' => '',
930
-        'id' => 'geodir_add_listing_link_user_dashboard',
931
-        'css' => 'min-width:300px;',
932
-        'std' => geodir_get_posttypes(),
933
-        'type' => 'multiselect',
934
-        'placeholder_text' => __('Select post types', 'geodirectory'),
935
-        'class' => 'chosen_select',
936
-        'options' => array_unique(geodir_post_type_setting_fun())
937
-    ),
923
+	array('name' => __('User Dashboard Post Type Navigation Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_user_dashboard_post_type '),
938 924
 
939
-    array(
940
-        'name' => __('Show favorite link in user dashboard', 'geodirectory'),
941
-        'desc' => __('Option will not appear if user does not have a favorite of that post type', 'geodirectory'),
942
-        'tip' => '',
943
-        'id' => 'geodir_favorite_link_user_dashboard',
944
-        'css' => 'min-width:300px;',
945
-        'std' => geodir_get_posttypes(),
946
-        'type' => 'multiselect',
947
-        'placeholder_text' => __('Select post types', 'geodirectory'),
948
-        'class' => 'chosen_select',
949
-        'options' => array_unique(geodir_post_type_setting_fun())
950
-    ),
951 925
 
952
-    array(
953
-        'name' => __('Show listing link in user dashboard', 'geodirectory'),
954
-        'desc' => __('Option will not appear if user does not have his/her own listing of that post type', 'geodirectory'),
955
-        'tip' => '',
956
-        'id' => 'geodir_listing_link_user_dashboard',
957
-        'css' => 'min-width:300px;',
958
-        'std' => geodir_get_posttypes(),
959
-        'type' => 'multiselect',
960
-        'placeholder_text' => __('Select post types', 'geodirectory'),
961
-        'class' => 'chosen_select',
962
-        'options' => array_unique(geodir_post_type_setting_fun())
963
-    ),
964
-
965
-    array('type' => 'sectionend', 'id' => 'geodir_user_dashboard_post_type'),
966
-    /* Post Type Navigation Settings End */
967
-
968
-    /* Script Settings Start */
969
-    array('name' => __('Scripts', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_script_settings '),
970
-
971
-    /*
926
+	array(
927
+		'name' => __('Show add listing link in user dashboard', 'geodirectory'),
928
+		'desc' => '',
929
+		'tip' => '',
930
+		'id' => 'geodir_add_listing_link_user_dashboard',
931
+		'css' => 'min-width:300px;',
932
+		'std' => geodir_get_posttypes(),
933
+		'type' => 'multiselect',
934
+		'placeholder_text' => __('Select post types', 'geodirectory'),
935
+		'class' => 'chosen_select',
936
+		'options' => array_unique(geodir_post_type_setting_fun())
937
+	),
938
+
939
+	array(
940
+		'name' => __('Show favorite link in user dashboard', 'geodirectory'),
941
+		'desc' => __('Option will not appear if user does not have a favorite of that post type', 'geodirectory'),
942
+		'tip' => '',
943
+		'id' => 'geodir_favorite_link_user_dashboard',
944
+		'css' => 'min-width:300px;',
945
+		'std' => geodir_get_posttypes(),
946
+		'type' => 'multiselect',
947
+		'placeholder_text' => __('Select post types', 'geodirectory'),
948
+		'class' => 'chosen_select',
949
+		'options' => array_unique(geodir_post_type_setting_fun())
950
+	),
951
+
952
+	array(
953
+		'name' => __('Show listing link in user dashboard', 'geodirectory'),
954
+		'desc' => __('Option will not appear if user does not have his/her own listing of that post type', 'geodirectory'),
955
+		'tip' => '',
956
+		'id' => 'geodir_listing_link_user_dashboard',
957
+		'css' => 'min-width:300px;',
958
+		'std' => geodir_get_posttypes(),
959
+		'type' => 'multiselect',
960
+		'placeholder_text' => __('Select post types', 'geodirectory'),
961
+		'class' => 'chosen_select',
962
+		'options' => array_unique(geodir_post_type_setting_fun())
963
+	),
964
+
965
+	array('type' => 'sectionend', 'id' => 'geodir_user_dashboard_post_type'),
966
+	/* Post Type Navigation Settings End */
967
+
968
+	/* Script Settings Start */
969
+	array('name' => __('Scripts', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_script_settings '),
970
+
971
+	/*
972 972
     array( 	'name' => __( 'Add/Remove Scripts', 'geodirectory' ),
973 973
                 'type' => 'sectionstart',
974 974
                 'desc' => '',
@@ -994,190 +994,190 @@  discard block
 block discarded – undo
994 994
 
995 995
     */
996 996
 
997
-    array('name' => __('GD Lazy Load Images', 'geodirectory'),
998
-        'type' => 'sectionstart',
999
-        'desc' => '',
1000
-        'id' => 'geodir_gdll_settings'),
997
+	array('name' => __('GD Lazy Load Images', 'geodirectory'),
998
+		'type' => 'sectionstart',
999
+		'desc' => '',
1000
+		'id' => 'geodir_gdll_settings'),
1001 1001
 
1002
-    array(
1003
-        'name' => __('Enable lazy load images?', 'geodirectory'),
1004
-        'desc' => __('GD images will be loaded only when visible on the page', 'geodirectory'),
1005
-        'id' => 'geodir_lazy_load',
1006
-        'type' => 'checkbox',
1007
-        'std' => '1' // Default value to show home top section
1008
-    ),
1009
-    array('type' => 'sectionend', 'id' => 'geodir_gdll_settings'),
1002
+	array(
1003
+		'name' => __('Enable lazy load images?', 'geodirectory'),
1004
+		'desc' => __('GD images will be loaded only when visible on the page', 'geodirectory'),
1005
+		'id' => 'geodir_lazy_load',
1006
+		'type' => 'checkbox',
1007
+		'std' => '1' // Default value to show home top section
1008
+	),
1009
+	array('type' => 'sectionend', 'id' => 'geodir_gdll_settings'),
1010 1010
     
1011 1011
 
1012
-    array('name' => __('Script Settings', 'geodirectory'),
1013
-        'type' => 'sectionstart',
1014
-        'desc' => '',
1015
-        'id' => 'geodir_script_settings'),
1012
+	array('name' => __('Script Settings', 'geodirectory'),
1013
+		'type' => 'sectionstart',
1014
+		'desc' => '',
1015
+		'id' => 'geodir_script_settings'),
1016 1016
 
1017
-    array(
1018
-        'name' => __('Custom style css code', 'geodirectory'),
1019
-        'desc' => '',
1020
-        'id' => 'geodir_coustem_css',
1021
-        'type' => 'textarea',
1022
-        'css' => 'min-width:300px;',
1023
-        'std' => '' // Default value for the page title - changed in settings
1024
-    ),
1017
+	array(
1018
+		'name' => __('Custom style css code', 'geodirectory'),
1019
+		'desc' => '',
1020
+		'id' => 'geodir_coustem_css',
1021
+		'type' => 'textarea',
1022
+		'css' => 'min-width:300px;',
1023
+		'std' => '' // Default value for the page title - changed in settings
1024
+	),
1025 1025
 
1026
-    array(
1027
-        'name' => __('Header script code', 'geodirectory'),
1028
-        'desc' => '',
1029
-        'id' => 'geodir_header_scripts',
1030
-        'type' => 'textarea',
1031
-        'css' => 'min-width:300px;',
1032
-        'std' => '' // Default value for the page title - changed in settings
1033
-    ),
1026
+	array(
1027
+		'name' => __('Header script code', 'geodirectory'),
1028
+		'desc' => '',
1029
+		'id' => 'geodir_header_scripts',
1030
+		'type' => 'textarea',
1031
+		'css' => 'min-width:300px;',
1032
+		'std' => '' // Default value for the page title - changed in settings
1033
+	),
1034 1034
 
1035
-    array(
1036
-        'name' => __('Footer script code', 'geodirectory'),
1037
-        'desc' => '',
1038
-        'id' => 'geodir_footer_scripts',
1039
-        'type' => 'textarea',
1040
-        'css' => 'min-width:300px;',
1041
-        'std' => '' // Default value for the page title - changed in settings
1042
-    ),
1035
+	array(
1036
+		'name' => __('Footer script code', 'geodirectory'),
1037
+		'desc' => '',
1038
+		'id' => 'geodir_footer_scripts',
1039
+		'type' => 'textarea',
1040
+		'css' => 'min-width:300px;',
1041
+		'std' => '' // Default value for the page title - changed in settings
1042
+	),
1043 1043
 
1044
-    array('type' => 'sectionend', 'id' => 'geodir_script_settings'),
1045
-    /* Script Settings End */
1044
+	array('type' => 'sectionend', 'id' => 'geodir_script_settings'),
1045
+	/* Script Settings End */
1046 1046
 
1047
-    /* Map Settings Start */
1048
-    array('name' => __('Map', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_map_settings '),
1047
+	/* Map Settings Start */
1048
+	array('name' => __('Map', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_map_settings '),
1049 1049
 
1050 1050
 
1051
-    // Google API key
1052
-    array(
1053
-        'name' => __('Google Maps API KEY', 'geodirectory'),
1054
-        'type' => 'sectionstart',
1055
-        'desc' => '',
1056
-        'id' => 'geodir_google_api_key'
1057
-    ),
1058
-    array(
1059
-        'name' => __('Google Maps API KEY', 'geodirectory'),
1060
-        'desc' => sprintf(
1061
-            __('This is a requirement to use Google Maps, you can get a key from <a href="%s" target="_blank">here</a> OR you can set GD to use Open Street Maps below under Select Maps API setting.   (<a href="%s" target="_blank">How to add a Google API KEY?</a>)', 'geodirectory'),
1062
-            'https://console.developers.google.com/flows/enableapi?apiid=maps_backend,geocoding_backend,directions_backend,distance_matrix_backend,elevation_backend&keyType=CLIENT_SIDE&reusekey=true','https://wpgeodirectory.com/docs/add-google-api-key/' ),
1063
-        'tip' => '',
1064
-        'id' => 'geodir_google_api_key',
1065
-        'css' => 'min-width:300px;',
1066
-        'std' => '',
1067
-        'type' => 'text',
1068
-    ),
1069
-    array(
1070
-        'type' => 'sectionend',
1071
-        'id' => 'geodir_google_api_key'
1072
-    ),
1051
+	// Google API key
1052
+	array(
1053
+		'name' => __('Google Maps API KEY', 'geodirectory'),
1054
+		'type' => 'sectionstart',
1055
+		'desc' => '',
1056
+		'id' => 'geodir_google_api_key'
1057
+	),
1058
+	array(
1059
+		'name' => __('Google Maps API KEY', 'geodirectory'),
1060
+		'desc' => sprintf(
1061
+			__('This is a requirement to use Google Maps, you can get a key from <a href="%s" target="_blank">here</a> OR you can set GD to use Open Street Maps below under Select Maps API setting.   (<a href="%s" target="_blank">How to add a Google API KEY?</a>)', 'geodirectory'),
1062
+			'https://console.developers.google.com/flows/enableapi?apiid=maps_backend,geocoding_backend,directions_backend,distance_matrix_backend,elevation_backend&keyType=CLIENT_SIDE&reusekey=true','https://wpgeodirectory.com/docs/add-google-api-key/' ),
1063
+		'tip' => '',
1064
+		'id' => 'geodir_google_api_key',
1065
+		'css' => 'min-width:300px;',
1066
+		'std' => '',
1067
+		'type' => 'text',
1068
+	),
1069
+	array(
1070
+		'type' => 'sectionend',
1071
+		'id' => 'geodir_google_api_key'
1072
+	),
1073 1073
 
1074
-    /* Untick the category by default on home map */
1075
-    array(
1076
-        'name' => __('Home Map Settings', 'geodirectory'),
1077
-        'type' => 'sectionstart',
1078
-        'desc' => '',
1079
-        'id' => 'geodir_home_map_section'
1080
-    ),
1081
-    array(
1082
-        'name' => __('Select category to untick by default on map', 'geodirectory'),
1083
-        'desc' => __('Select category to untick by default on the home map.', 'geodirectory'),
1084
-        'tip' => '',
1085
-        'id' => 'geodir_home_map_untick',
1086
-        'css' => 'min-width:300px;',
1087
-        'std' => '',
1088
-        'type' => 'multiselect',
1089
-        'placeholder_text' => __('Select category', 'geodirectory'),
1090
-        'class' => 'chosen_select',
1091
-        'options' => geodir_home_map_cats_key_value_array()
1092
-    ),
1093
-    array(
1094
-        'type' => 'sectionend',
1095
-        'id' => 'geodir_home_map_section'
1096
-    ),
1074
+	/* Untick the category by default on home map */
1075
+	array(
1076
+		'name' => __('Home Map Settings', 'geodirectory'),
1077
+		'type' => 'sectionstart',
1078
+		'desc' => '',
1079
+		'id' => 'geodir_home_map_section'
1080
+	),
1081
+	array(
1082
+		'name' => __('Select category to untick by default on map', 'geodirectory'),
1083
+		'desc' => __('Select category to untick by default on the home map.', 'geodirectory'),
1084
+		'tip' => '',
1085
+		'id' => 'geodir_home_map_untick',
1086
+		'css' => 'min-width:300px;',
1087
+		'std' => '',
1088
+		'type' => 'multiselect',
1089
+		'placeholder_text' => __('Select category', 'geodirectory'),
1090
+		'class' => 'chosen_select',
1091
+		'options' => geodir_home_map_cats_key_value_array()
1092
+	),
1093
+	array(
1094
+		'type' => 'sectionend',
1095
+		'id' => 'geodir_home_map_section'
1096
+	),
1097 1097
 
1098
-    array(
1099
-        'name' => __('Add Listing Map Settings', 'geodirectory'),
1100
-        'type' => 'sectionstart',
1101
-        'desc' => '',
1102
-        'id' => 'geodir_add_listing_map_section'
1103
-    ),
1104
-    array(
1105
-        'name' => __('Disable mouse scroll', 'geodirectory'),
1106
-        'desc' => __('Stops the mouse scroll zooming the map', 'geodirectory'),
1107
-        'id' => 'geodir_add_listing_mouse_scroll',
1108
-        'type' => 'checkbox',
1109
-        'std' => '0' // Default value to show home top section
1110
-    ),
1111
-    array(
1112
-        'type' => 'sectionend',
1113
-        'id' => 'geodir_add_listing_map_section'
1114
-    ),
1098
+	array(
1099
+		'name' => __('Add Listing Map Settings', 'geodirectory'),
1100
+		'type' => 'sectionstart',
1101
+		'desc' => '',
1102
+		'id' => 'geodir_add_listing_map_section'
1103
+	),
1104
+	array(
1105
+		'name' => __('Disable mouse scroll', 'geodirectory'),
1106
+		'desc' => __('Stops the mouse scroll zooming the map', 'geodirectory'),
1107
+		'id' => 'geodir_add_listing_mouse_scroll',
1108
+		'type' => 'checkbox',
1109
+		'std' => '0' // Default value to show home top section
1110
+	),
1111
+	array(
1112
+		'type' => 'sectionend',
1113
+		'id' => 'geodir_add_listing_map_section'
1114
+	),
1115 1115
 
1116 1116
 
1117
-    array('name' => __('Default map settings', 'geodirectory'),
1118
-        'type' => 'sectionstart',
1119
-        'desc' => '',
1120
-        'id' => 'geodir_map_default_settings'),
1117
+	array('name' => __('Default map settings', 'geodirectory'),
1118
+		'type' => 'sectionstart',
1119
+		'desc' => '',
1120
+		'id' => 'geodir_map_default_settings'),
1121 1121
 
1122
-    array(
1123
-        'name' => '',
1124
-        'desc' => '',
1125
-        'id' => 'map_default_settings',
1126
-        'type' => 'map_default_settings',
1127
-        'css' => 'min-width:300px;',
1128
-        'std' => '' // Default value for the page title - changed in settings
1129
-    ),
1122
+	array(
1123
+		'name' => '',
1124
+		'desc' => '',
1125
+		'id' => 'map_default_settings',
1126
+		'type' => 'map_default_settings',
1127
+		'css' => 'min-width:300px;',
1128
+		'std' => '' // Default value for the page title - changed in settings
1129
+	),
1130 1130
 
1131
-    array(
1132
-        'name' => __('Upload map default marker icon', 'geodirectory'),
1133
-        'desc' => '',
1134
-        'id' => 'geodir_default_marker_icon',
1135
-        'type' => 'file',
1136
-        'std' => '0',
1137
-        'value' => geodir_plugin_url() . '/geodirectory-functions/map-functions/icons/pin.png'// Default value to show home top section
1138
-    ),
1139
-    // add option that allows enable/disable map dragging to phone devices
1140
-    array(
1141
-        'name' => __('Show button control on map to enable/disable dragging', 'geodirectory'),
1142
-        'desc' => __('If checked, it displays button control to enable/disable dragging on google maps for phone devices', 'geodirectory'),
1143
-        'id' => 'geodir_map_onoff_dragging',
1144
-        'type' => 'checkbox',
1145
-        'std' => '0' // Default value to show home top section
1146
-    ),
1147
-    array(
1148
-        'name' => __('Select Maps API', 'geodirectory'),
1149
-        'desc' => __('- Google Maps API will force to load Google JS library only.<br>- OpenStreetMap API will force to load OpenStreetMap JS library only.<br>- Load Automatic will load Google JS library first, but if Google maps JS library not loaded it then loads the OpenStreetMap JS library to load the maps (recommended for regions where Google maps banned).<br>- Disable Maps will disable and hides maps for entire site.', 'geodirectory'),
1150
-        'tip' => '',
1151
-        'id' => 'geodir_load_map',
1152
-        'css' => 'min-width:300px;',
1153
-        'std' => 'auto',
1154
-        'type' => 'select',
1155
-        'placeholder_text' => __('Select Map', 'geodirectory'),
1156
-        'options' => array(
1157
-                        'auto' => __('Load Automatic', 'geodirectory'),
1158
-                        'google' => __('Load Google Maps API', 'geodirectory'),
1159
-                        'osm' => __('Load OpenStreetMap API', 'geodirectory'),
1160
-                        'none' => __('Disable Maps', 'geodirectory')
1161
-                    )
1162
-    ),
1163
-
1164
-    array('type' => 'sectionend', 'id' => 'geodir_map_default_settings'),
1165
-
1166
-    array('name' => __('Show / hide post type and category on map', 'geodirectory'),
1167
-        'type' => 'sectionstart',
1168
-        'desc' => '',
1169
-        'id' => 'geodir_map_settings'),
1131
+	array(
1132
+		'name' => __('Upload map default marker icon', 'geodirectory'),
1133
+		'desc' => '',
1134
+		'id' => 'geodir_default_marker_icon',
1135
+		'type' => 'file',
1136
+		'std' => '0',
1137
+		'value' => geodir_plugin_url() . '/geodirectory-functions/map-functions/icons/pin.png'// Default value to show home top section
1138
+	),
1139
+	// add option that allows enable/disable map dragging to phone devices
1140
+	array(
1141
+		'name' => __('Show button control on map to enable/disable dragging', 'geodirectory'),
1142
+		'desc' => __('If checked, it displays button control to enable/disable dragging on google maps for phone devices', 'geodirectory'),
1143
+		'id' => 'geodir_map_onoff_dragging',
1144
+		'type' => 'checkbox',
1145
+		'std' => '0' // Default value to show home top section
1146
+	),
1147
+	array(
1148
+		'name' => __('Select Maps API', 'geodirectory'),
1149
+		'desc' => __('- Google Maps API will force to load Google JS library only.<br>- OpenStreetMap API will force to load OpenStreetMap JS library only.<br>- Load Automatic will load Google JS library first, but if Google maps JS library not loaded it then loads the OpenStreetMap JS library to load the maps (recommended for regions where Google maps banned).<br>- Disable Maps will disable and hides maps for entire site.', 'geodirectory'),
1150
+		'tip' => '',
1151
+		'id' => 'geodir_load_map',
1152
+		'css' => 'min-width:300px;',
1153
+		'std' => 'auto',
1154
+		'type' => 'select',
1155
+		'placeholder_text' => __('Select Map', 'geodirectory'),
1156
+		'options' => array(
1157
+						'auto' => __('Load Automatic', 'geodirectory'),
1158
+						'google' => __('Load Google Maps API', 'geodirectory'),
1159
+						'osm' => __('Load OpenStreetMap API', 'geodirectory'),
1160
+						'none' => __('Disable Maps', 'geodirectory')
1161
+					)
1162
+	),
1170 1163
 
1171
-    array(
1172
-        'name' => __('Select Map Category', 'geodirectory'),
1173
-        'desc' => '',
1174
-        'id' => 'geodir_map_settings',
1175
-        'type' => 'map',
1176
-        'css' => 'min-width:300px;',
1177
-        'std' => '' // Default value for the page title - changed in settings
1178
-    ),
1179
-
1180
-    array('type' => 'sectionend', 'id' => 'geodir_map_settings'),
1181
-    /* Map Settings End */
1164
+	array('type' => 'sectionend', 'id' => 'geodir_map_default_settings'),
1165
+
1166
+	array('name' => __('Show / hide post type and category on map', 'geodirectory'),
1167
+		'type' => 'sectionstart',
1168
+		'desc' => '',
1169
+		'id' => 'geodir_map_settings'),
1170
+
1171
+	array(
1172
+		'name' => __('Select Map Category', 'geodirectory'),
1173
+		'desc' => '',
1174
+		'id' => 'geodir_map_settings',
1175
+		'type' => 'map',
1176
+		'css' => 'min-width:300px;',
1177
+		'std' => '' // Default value for the page title - changed in settings
1178
+	),
1179
+
1180
+	array('type' => 'sectionend', 'id' => 'geodir_map_settings'),
1181
+	/* Map Settings End */
1182 1182
 
1183 1183
 )); // End Design settings
Please login to merge, or discard this patch.
geodirectory-functions/map-functions/map_functions.php 2 patches
Indentation   +198 added lines, -198 removed lines patch added patch discarded remove patch
@@ -15,8 +15,8 @@  discard block
 block discarded – undo
15 15
  */
16 16
 function  geodir_init_map_jason()
17 17
 {
18
-    global $map_jason;
19
-    $map_jason = array();
18
+	global $map_jason;
19
+	$map_jason = array();
20 20
 }
21 21
 
22 22
 /**
@@ -28,8 +28,8 @@  discard block
 block discarded – undo
28 28
  */
29 29
 function geodir_init_map_canvas_array()
30 30
 {
31
-    global $map_canvas_arr;
32
-    $map_canvas_arr = array();
31
+	global $map_canvas_arr;
32
+	$map_canvas_arr = array();
33 33
 }
34 34
 
35 35
 
@@ -50,47 +50,47 @@  discard block
 block discarded – undo
50 50
  */
51 51
 function create_marker_jason_of_posts($post)
52 52
 {
53
-    global $wpdb, $map_jason, $add_post_in_marker_array, $geodir_cat_icons, $gd_marker_sizes;
53
+	global $wpdb, $map_jason, $add_post_in_marker_array, $geodir_cat_icons, $gd_marker_sizes;
54 54
 
55
-    if (!empty($post) && isset($post->ID) && $post->ID > 0 && (is_main_query() || $add_post_in_marker_array) && $post->marker_json != '') {
56
-        $srcharr = array("'", "/", "-", '"', '\\');
57
-        $replarr = array("&prime;", "&frasl;", "&ndash;", "&ldquo;", '');
55
+	if (!empty($post) && isset($post->ID) && $post->ID > 0 && (is_main_query() || $add_post_in_marker_array) && $post->marker_json != '') {
56
+		$srcharr = array("'", "/", "-", '"', '\\');
57
+		$replarr = array("&prime;", "&frasl;", "&ndash;", "&ldquo;", '');
58 58
 
59 59
 
60
-        $geodir_cat_icons = geodir_get_term_icon();
61
-        $icon = !empty($geodir_cat_icons) && isset($geodir_cat_icons[$post->default_category]) ? $geodir_cat_icons[$post->default_category] : '';
60
+		$geodir_cat_icons = geodir_get_term_icon();
61
+		$icon = !empty($geodir_cat_icons) && isset($geodir_cat_icons[$post->default_category]) ? $geodir_cat_icons[$post->default_category] : '';
62 62
 
63
-        $post_title = $post->post_title;
64
-        $title = str_replace($srcharr, $replarr, $post_title);
63
+		$post_title = $post->post_title;
64
+		$title = str_replace($srcharr, $replarr, $post_title);
65 65
 
66
-        if (is_ssl()) {
67
-            $icon = str_replace("http:","https:",$icon );
68
-        }
66
+		if (is_ssl()) {
67
+			$icon = str_replace("http:","https:",$icon );
68
+		}
69 69
         
70
-        if ($icon != '') {
71
-            $gd_marker_sizes = empty($gd_marker_sizes) ? array() : $gd_marker_sizes;
70
+		if ($icon != '') {
71
+			$gd_marker_sizes = empty($gd_marker_sizes) ? array() : $gd_marker_sizes;
72 72
             
73
-            if (isset($gd_marker_sizes[$icon])) {
74
-                $icon_size = $gd_marker_sizes[$icon];
75
-            } else {
76
-                $icon_size = geodir_get_marker_size($icon);
77
-                $gd_marker_sizes[$icon] = $icon_size;
78
-            }               
79
-        } else {
80
-            $icon_size = array('w' => 36, 'h' => 45);
81
-        }
82
-
83
-        $post_json = '{"id":"' . $post->ID . '","t": "' . $title . '","lt": "' . $post->post_latitude . '","ln": "' . $post->post_longitude . '","mk_id":"' . $post->ID . '_' . $post->default_category . '","i":"' . $icon . '","w":"' . $icon_size['w'] . '","h":"' . $icon_size['h'] . '"}';
84
-
85
-        /**
86
-         * Filter the json data when creating output for post json marker..
87
-         *
88
-         * @since 1.5.7
89
-         * @param string $post_json JSON representation of the post marker info.
90
-         * @param object $post The post object.
91
-         */
92
-        $map_jason[] = apply_filters('geodir_create_marker_jason_of_posts',$post_json, $post);
93
-    }
73
+			if (isset($gd_marker_sizes[$icon])) {
74
+				$icon_size = $gd_marker_sizes[$icon];
75
+			} else {
76
+				$icon_size = geodir_get_marker_size($icon);
77
+				$gd_marker_sizes[$icon] = $icon_size;
78
+			}               
79
+		} else {
80
+			$icon_size = array('w' => 36, 'h' => 45);
81
+		}
82
+
83
+		$post_json = '{"id":"' . $post->ID . '","t": "' . $title . '","lt": "' . $post->post_latitude . '","ln": "' . $post->post_longitude . '","mk_id":"' . $post->ID . '_' . $post->default_category . '","i":"' . $icon . '","w":"' . $icon_size['w'] . '","h":"' . $icon_size['h'] . '"}';
84
+
85
+		/**
86
+		 * Filter the json data when creating output for post json marker..
87
+		 *
88
+		 * @since 1.5.7
89
+		 * @param string $post_json JSON representation of the post marker info.
90
+		 * @param object $post The post object.
91
+		 */
92
+		$map_jason[] = apply_filters('geodir_create_marker_jason_of_posts',$post_json, $post);
93
+	}
94 94
 }
95 95
 
96 96
 /**
@@ -103,60 +103,60 @@  discard block
 block discarded – undo
103 103
  */
104 104
 function send_marker_jason_to_js()
105 105
 {
106
-    global $map_jason, $map_canvas_arr;
107
-
108
-    if (is_array($map_canvas_arr) && !empty($map_canvas_arr)) {
109
-        foreach ($map_canvas_arr as $canvas => $jason) {
110
-            if (is_array($map_jason) && !empty($map_jason)) {
111
-
112
-                $canvas_jason = $canvas . "_jason";
113
-                $map_canvas_arr[$canvas] = array_unique($map_jason);
114
-                unset($cat_content_info);
115
-                $cat_content_info[] = implode(',', $map_canvas_arr[$canvas]);
116
-                $totalcount = count(array_unique($map_jason));
117
-                if (!empty($cat_content_info)) {
118
-                    $json_content = substr(implode(',', $cat_content_info), 1);
119
-                    $json_content = htmlentities($json_content, ENT_QUOTES); // Quotes in csv title import break maps - FIXED by kiran on 2nd March, 2016
120
-                    $canvas_jason = '[{"totalcount":"' . $totalcount . '",' . $json_content . ']';
121
-                } else {
122
-                    $canvas_jason = '[{"totalcount":"0"}]';
123
-                }
124
-
125
-                $map_canvas_jason_args = array($canvas . '_jason' => $canvas_jason);
126
-
127
-                /**
128
-                 * Filter the send_marker_jason_to_js() function map canvas json args.
129
-                 *
130
-                 * You can use this filter to modify map canvas json args.
131
-                 *
132
-                 * @since 1.0.0
133
-                 * @package GeoDirectory
134
-                 * @param string $canvas Map canvas array key.
135
-                 * @param array $map_canvas_jason_args Map canvas args.
136
-                 */
137
-                $map_canvas_jason_args = apply_filters('geodir_map_canvas_jason_' . $canvas, $map_canvas_jason_args);
138
-
139
-                wp_localize_script('geodir-map-widget', $canvas . '_jason_args', $map_canvas_jason_args);
140
-            } else {
141
-                $canvas_jason = '[{"totalcount":"0"}]';
142
-                $map_canvas_jason_args = array($canvas . '_jason' => $canvas_jason);
143
-
144
-                /**
145
-                 * Filter the send_marker_jason_to_js() function map canvas json args.
146
-                 *
147
-                 * You can use this filter to modify map canvas json args.
148
-                 *
149
-                 * @since 1.0.0
150
-                 * @package GeoDirectory
151
-                 * @param string $canvas Map canvas array key.
152
-                 * @param array $map_canvas_jason_args Map canvas args.
153
-                 */
154
-                $map_canvas_jason_args = apply_filters('geodir_map_canvas_jason_' . $canvas, $map_canvas_jason_args);
155
-                wp_localize_script('geodir-map-widget', $canvas . '_jason_args', $map_canvas_jason_args);
156
-            }
157
-        }
158
-
159
-    }
106
+	global $map_jason, $map_canvas_arr;
107
+
108
+	if (is_array($map_canvas_arr) && !empty($map_canvas_arr)) {
109
+		foreach ($map_canvas_arr as $canvas => $jason) {
110
+			if (is_array($map_jason) && !empty($map_jason)) {
111
+
112
+				$canvas_jason = $canvas . "_jason";
113
+				$map_canvas_arr[$canvas] = array_unique($map_jason);
114
+				unset($cat_content_info);
115
+				$cat_content_info[] = implode(',', $map_canvas_arr[$canvas]);
116
+				$totalcount = count(array_unique($map_jason));
117
+				if (!empty($cat_content_info)) {
118
+					$json_content = substr(implode(',', $cat_content_info), 1);
119
+					$json_content = htmlentities($json_content, ENT_QUOTES); // Quotes in csv title import break maps - FIXED by kiran on 2nd March, 2016
120
+					$canvas_jason = '[{"totalcount":"' . $totalcount . '",' . $json_content . ']';
121
+				} else {
122
+					$canvas_jason = '[{"totalcount":"0"}]';
123
+				}
124
+
125
+				$map_canvas_jason_args = array($canvas . '_jason' => $canvas_jason);
126
+
127
+				/**
128
+				 * Filter the send_marker_jason_to_js() function map canvas json args.
129
+				 *
130
+				 * You can use this filter to modify map canvas json args.
131
+				 *
132
+				 * @since 1.0.0
133
+				 * @package GeoDirectory
134
+				 * @param string $canvas Map canvas array key.
135
+				 * @param array $map_canvas_jason_args Map canvas args.
136
+				 */
137
+				$map_canvas_jason_args = apply_filters('geodir_map_canvas_jason_' . $canvas, $map_canvas_jason_args);
138
+
139
+				wp_localize_script('geodir-map-widget', $canvas . '_jason_args', $map_canvas_jason_args);
140
+			} else {
141
+				$canvas_jason = '[{"totalcount":"0"}]';
142
+				$map_canvas_jason_args = array($canvas . '_jason' => $canvas_jason);
143
+
144
+				/**
145
+				 * Filter the send_marker_jason_to_js() function map canvas json args.
146
+				 *
147
+				 * You can use this filter to modify map canvas json args.
148
+				 *
149
+				 * @since 1.0.0
150
+				 * @package GeoDirectory
151
+				 * @param string $canvas Map canvas array key.
152
+				 * @param array $map_canvas_jason_args Map canvas args.
153
+				 */
154
+				$map_canvas_jason_args = apply_filters('geodir_map_canvas_jason_' . $canvas, $map_canvas_jason_args);
155
+				wp_localize_script('geodir-map-widget', $canvas . '_jason_args', $map_canvas_jason_args);
156
+			}
157
+		}
158
+
159
+	}
160 160
 }
161 161
 
162 162
 /**
@@ -175,92 +175,92 @@  discard block
 block discarded – undo
175 175
  */
176 176
 function home_map_taxonomy_walker($cat_taxonomy, $cat_parent = 0, $hide_empty = true, $pading = 0, $map_canvas_name = '', $child_collapse, $is_home_map = false)
177 177
 {
178
-    global $cat_count, $geodir_cat_icons;
178
+	global $cat_count, $geodir_cat_icons;
179 179
 
180
-    $exclude_categories = get_option('geodir_exclude_cat_on_map');
181
-    $exclude_categories_new = get_option('geodir_exclude_cat_on_map_upgrade');
180
+	$exclude_categories = get_option('geodir_exclude_cat_on_map');
181
+	$exclude_categories_new = get_option('geodir_exclude_cat_on_map_upgrade');
182 182
 
183
-    // check if exclude categories saved before fix of categories identical names
184
-    if ($exclude_categories_new) {
185
-        $gd_cat_taxonomy = isset($cat_taxonomy[0]) ? $cat_taxonomy[0] : '';
186
-        $exclude_categories = !empty($exclude_categories[$gd_cat_taxonomy]) && is_array($exclude_categories[$gd_cat_taxonomy]) ? array_unique($exclude_categories[$gd_cat_taxonomy]) : array();
187
-    }
183
+	// check if exclude categories saved before fix of categories identical names
184
+	if ($exclude_categories_new) {
185
+		$gd_cat_taxonomy = isset($cat_taxonomy[0]) ? $cat_taxonomy[0] : '';
186
+		$exclude_categories = !empty($exclude_categories[$gd_cat_taxonomy]) && is_array($exclude_categories[$gd_cat_taxonomy]) ? array_unique($exclude_categories[$gd_cat_taxonomy]) : array();
187
+	}
188 188
 
189
-    $exclude_cat_str = implode(',', $exclude_categories);
189
+	$exclude_cat_str = implode(',', $exclude_categories);
190 190
 
191
-    if ($exclude_cat_str == '') {
192
-        $exclude_cat_str = '0';
193
-    }
191
+	if ($exclude_cat_str == '') {
192
+		$exclude_cat_str = '0';
193
+	}
194 194
 
195
-    $cat_terms = get_terms($cat_taxonomy, array('parent' => $cat_parent, 'exclude' => $exclude_cat_str, 'hide_empty ' => $hide_empty));
195
+	$cat_terms = get_terms($cat_taxonomy, array('parent' => $cat_parent, 'exclude' => $exclude_cat_str, 'hide_empty ' => $hide_empty));
196 196
 
197
-    if ($hide_empty) {
198
-        $cat_terms = geodir_filter_empty_terms($cat_terms);
199
-    }
197
+	if ($hide_empty) {
198
+		$cat_terms = geodir_filter_empty_terms($cat_terms);
199
+	}
200 200
 
201
-    $main_list_class = '';
202
-    //If there are terms, start displaying
203
-    if (count($cat_terms) > 0) {
204
-        //Displaying as a list
205
-        $p = $pading * 15;
206
-        $pading++;
201
+	$main_list_class = '';
202
+	//If there are terms, start displaying
203
+	if (count($cat_terms) > 0) {
204
+		//Displaying as a list
205
+		$p = $pading * 15;
206
+		$pading++;
207 207
 
208
-        if ($cat_parent == 0) {
209
-            $list_class = 'main_list';
210
-            $display = '';
211
-        } else {
212
-            $list_class = 'sub_list';
213
-            $display = !$child_collapse ? '' : 'display:none';
214
-        }
208
+		if ($cat_parent == 0) {
209
+			$list_class = 'main_list';
210
+			$display = '';
211
+		} else {
212
+			$list_class = 'sub_list';
213
+			$display = !$child_collapse ? '' : 'display:none';
214
+		}
215 215
 
216 216
 
217
-        $out = '<ul class="treeview ' . $list_class . '" style="margin-left:' . $p . 'px;' . $display . ';">';
217
+		$out = '<ul class="treeview ' . $list_class . '" style="margin-left:' . $p . 'px;' . $display . ';">';
218 218
 
219
-        $geodir_cat_icons = geodir_get_term_icon();
219
+		$geodir_cat_icons = geodir_get_term_icon();
220 220
 
221
-        $geodir_default_map_search_pt = (get_option('geodir_default_map_search_pt')) ? get_option('geodir_default_map_search_pt') :  'gd_place';
222
-        $post_type = isset($_REQUEST['post_type']) ? $_REQUEST['post_type'] : $geodir_default_map_search_pt;
223
-        foreach ($cat_terms as $cat_term):
221
+		$geodir_default_map_search_pt = (get_option('geodir_default_map_search_pt')) ? get_option('geodir_default_map_search_pt') :  'gd_place';
222
+		$post_type = isset($_REQUEST['post_type']) ? $_REQUEST['post_type'] : $geodir_default_map_search_pt;
223
+		foreach ($cat_terms as $cat_term):
224 224
 
225 225
 
226 226
 
227
-            $icon = !empty($geodir_cat_icons) && isset($geodir_cat_icons[$cat_term->term_id]) ? $geodir_cat_icons[$cat_term->term_id] : '';
227
+			$icon = !empty($geodir_cat_icons) && isset($geodir_cat_icons[$cat_term->term_id]) ? $geodir_cat_icons[$cat_term->term_id] : '';
228 228
 
229
-            if (!in_array($cat_term->term_id, $exclude_categories)):
230
-                //Secret sauce.  Function calls itself to display child elements, if any
231
-                $checked = 'checked="checked"';
229
+			if (!in_array($cat_term->term_id, $exclude_categories)):
230
+				//Secret sauce.  Function calls itself to display child elements, if any
231
+				$checked = 'checked="checked"';
232 232
 
233
-                // Untick the category by default on home map
234
-                if ($is_home_map && $geodir_home_map_untick = get_option('geodir_home_map_untick')) {
235
-                    if (!empty($geodir_home_map_untick) && in_array($post_type . '_' . $cat_term->term_id, $geodir_home_map_untick)) {
236
-                        $checked = '';
237
-                    }
238
-                }
233
+				// Untick the category by default on home map
234
+				if ($is_home_map && $geodir_home_map_untick = get_option('geodir_home_map_untick')) {
235
+					if (!empty($geodir_home_map_untick) && in_array($post_type . '_' . $cat_term->term_id, $geodir_home_map_untick)) {
236
+						$checked = '';
237
+					}
238
+				}
239 239
 
240
-                $term_check = '<input type="checkbox" ' . $checked . ' id="' .$map_canvas_name.'_tick_cat_'. $cat_term->term_id . '" class="group_selector ' . $main_list_class . '"';
241
-                $term_check .= ' name="' . $map_canvas_name . '_cat[]" ';
242
-                $term_check .= '  title="' . esc_attr(ucfirst($cat_term->name)) . '" value="' . $cat_term->term_id . '" onclick="javascript:build_map_ajax_search_param(\'' . $map_canvas_name . '\',false, this)">';
243
-                $term_img = '<img height="15" width="15" alt="' . $cat_term->taxonomy . '" src="' . $icon . '" title="' . ucfirst($cat_term->name) . '"/>';
244
-                $out .= '<li>' . $term_check . '<label for="' . $map_canvas_name.'_tick_cat_'. $cat_term->term_id . '">' . $term_img . ucfirst($cat_term->name) . '</label><i class="fa fa-long-arrow-down"></i>';
240
+				$term_check = '<input type="checkbox" ' . $checked . ' id="' .$map_canvas_name.'_tick_cat_'. $cat_term->term_id . '" class="group_selector ' . $main_list_class . '"';
241
+				$term_check .= ' name="' . $map_canvas_name . '_cat[]" ';
242
+				$term_check .= '  title="' . esc_attr(ucfirst($cat_term->name)) . '" value="' . $cat_term->term_id . '" onclick="javascript:build_map_ajax_search_param(\'' . $map_canvas_name . '\',false, this)">';
243
+				$term_img = '<img height="15" width="15" alt="' . $cat_term->taxonomy . '" src="' . $icon . '" title="' . ucfirst($cat_term->name) . '"/>';
244
+				$out .= '<li>' . $term_check . '<label for="' . $map_canvas_name.'_tick_cat_'. $cat_term->term_id . '">' . $term_img . ucfirst($cat_term->name) . '</label><i class="fa fa-long-arrow-down"></i>';
245 245
 
246
-            endif;
246
+			endif;
247 247
 
248 248
 
249
-            // get sub category by recursion
250
-            $out .= home_map_taxonomy_walker($cat_taxonomy, $cat_term->term_id, $hide_empty, $pading, $map_canvas_name, $child_collapse, $is_home_map);
249
+			// get sub category by recursion
250
+			$out .= home_map_taxonomy_walker($cat_taxonomy, $cat_term->term_id, $hide_empty, $pading, $map_canvas_name, $child_collapse, $is_home_map);
251 251
 
252
-            $out .= '</li>';
252
+			$out .= '</li>';
253 253
 
254
-        endforeach;
254
+		endforeach;
255 255
 
256
-        $out .= '</ul>';
256
+		$out .= '</ul>';
257 257
 
258
-        return $out;
259
-    } else {
260
-        if ($cat_parent == 0)
261
-            return _e('No category', 'geodirectory');
262
-    }
263
-    return;
258
+		return $out;
259
+	} else {
260
+		if ($cat_parent == 0)
261
+			return _e('No category', 'geodirectory');
262
+	}
263
+	return;
264 264
 }
265 265
 
266 266
 /**
@@ -272,19 +272,19 @@  discard block
 block discarded – undo
272 272
  * @return string The map API provider name.
273 273
  */
274 274
 function geodir_map_name() {
275
-    $geodir_map_name = get_option('geodir_load_map', 'google');
275
+	$geodir_map_name = get_option('geodir_load_map', 'google');
276 276
     
277
-    if (!in_array($geodir_map_name, array('none', 'auto', 'google', 'osm'))) {
278
-        $geodir_map_name = 'auto';
279
-    }
280
-
281
-    /**
282
-     * Filter the map JS API provider name.
283
-     *
284
-     * @since 1.6.1
285
-     * @param string $geodir_map_name The map API provider name.
286
-     */
287
-    return apply_filters('geodir_map_name', $geodir_map_name);
277
+	if (!in_array($geodir_map_name, array('none', 'auto', 'google', 'osm'))) {
278
+		$geodir_map_name = 'auto';
279
+	}
280
+
281
+	/**
282
+	 * Filter the map JS API provider name.
283
+	 *
284
+	 * @since 1.6.1
285
+	 * @param string $geodir_map_name The map API provider name.
286
+	 */
287
+	return apply_filters('geodir_map_name', $geodir_map_name);
288 288
 }
289 289
 
290 290
 /**
@@ -300,48 +300,48 @@  discard block
 block discarded – undo
300 300
  * @return array The icon size.
301 301
  */
302 302
 function geodir_get_marker_size($icon, $default_size = array('w' => 36, 'h' => 45)) {
303
-    global $gd_marker_sizes;
303
+	global $gd_marker_sizes;
304 304
     
305
-    if (empty($gd_marker_sizes)) {
306
-        $gd_marker_sizes = array();
307
-    }
305
+	if (empty($gd_marker_sizes)) {
306
+		$gd_marker_sizes = array();
307
+	}
308 308
       
309
-    if (!empty($gd_marker_sizes[$icon])) {
310
-        return $gd_marker_sizes[$icon];
311
-    }
309
+	if (!empty($gd_marker_sizes[$icon])) {
310
+		return $gd_marker_sizes[$icon];
311
+	}
312 312
     
313
-    if (empty($icon)) {
314
-        $gd_marker_sizes[$icon] = $default_size;
313
+	if (empty($icon)) {
314
+		$gd_marker_sizes[$icon] = $default_size;
315 315
         
316
-        return $default_size;
317
-    }
316
+		return $default_size;
317
+	}
318 318
     
319
-    $icon_url = $icon;
319
+	$icon_url = $icon;
320 320
     
321
-    $uploads = wp_upload_dir(); // Array of key => value pairs
321
+	$uploads = wp_upload_dir(); // Array of key => value pairs
322 322
       
323
-    if (!path_is_absolute($icon)) {
324
-        $icon = str_replace($uploads['baseurl'], $uploads['basedir'], $icon);
325
-    }
323
+	if (!path_is_absolute($icon)) {
324
+		$icon = str_replace($uploads['baseurl'], $uploads['basedir'], $icon);
325
+	}
326 326
     
327
-    if (!path_is_absolute($icon) && strpos($icon, WP_CONTENT_URL) !== false) {
328
-        $icon = str_replace(WP_CONTENT_URL, WP_CONTENT_DIR, $icon);
329
-    }
327
+	if (!path_is_absolute($icon) && strpos($icon, WP_CONTENT_URL) !== false) {
328
+		$icon = str_replace(WP_CONTENT_URL, WP_CONTENT_DIR, $icon);
329
+	}
330 330
     
331
-    $sizes = array();
332
-    if (is_file($icon) && file_exists($icon)) {
333
-        $size = getimagesize(trim($icon));
331
+	$sizes = array();
332
+	if (is_file($icon) && file_exists($icon)) {
333
+		$size = getimagesize(trim($icon));
334 334
         
335
-        if (!empty($size[0]) && !empty($size[1])) {
336
-            $sizes = array('w' => $size[0], 'h' => $size[1]);
337
-        }
338
-    }
335
+		if (!empty($size[0]) && !empty($size[1])) {
336
+			$sizes = array('w' => $size[0], 'h' => $size[1]);
337
+		}
338
+	}
339 339
     
340
-    $sizes = !empty($sizes) ? $sizes : $default_size;
340
+	$sizes = !empty($sizes) ? $sizes : $default_size;
341 341
     
342
-    $gd_marker_sizes[$icon_url] = $sizes;
342
+	$gd_marker_sizes[$icon_url] = $sizes;
343 343
     
344
-    return $sizes;
344
+	return $sizes;
345 345
 }
346 346
 
347 347
 add_action('wp_head', 'geodir_map_load_style', 10);
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
  * @package GeoDirectory
354 354
  */
355 355
 function geodir_map_load_style() {    
356
-    if (in_array(geodir_map_name(), array('auto', 'google')) && wp_script_is( 'geodirectory-googlemap-script', 'done')) {
356
+	if (in_array(geodir_map_name(), array('auto', 'google')) && wp_script_is( 'geodirectory-googlemap-script', 'done')) {
357 357
 ?>
358 358
 <script type="text/javascript">
359 359
 if (!(window.google && typeof google.maps !== 'undefined')) {
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
 }
362 362
 </script>
363 363
 <?php
364
-    }
364
+	}
365 365
 }
366 366
 
367 367
 add_action('wp_footer', 'geodir_map_load_script', 10);
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
  * @package GeoDirectory
374 374
  */
375 375
 function geodir_map_load_script() {
376
-    if (in_array(geodir_map_name(), array('auto', 'google')) && wp_script_is( 'geodirectory-googlemap-script', 'done')) {
376
+	if (in_array(geodir_map_name(), array('auto', 'google')) && wp_script_is( 'geodirectory-googlemap-script', 'done')) {
377 377
 ?>
378 378
 <script type="text/javascript">
379 379
 if (!(window.google && typeof google.maps !== 'undefined')) {
@@ -382,5 +382,5 @@  discard block
 block discarded – undo
382 382
 }
383 383
 </script>
384 384
 <?php
385
-    }
385
+	}
386 386
 }
387 387
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
         $title = str_replace($srcharr, $replarr, $post_title);
65 65
 
66 66
         if (is_ssl()) {
67
-            $icon = str_replace("http:","https:",$icon );
67
+            $icon = str_replace("http:", "https:", $icon);
68 68
         }
69 69
         
70 70
         if ($icon != '') {
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
             $icon_size = array('w' => 36, 'h' => 45);
81 81
         }
82 82
 
83
-        $post_json = '{"id":"' . $post->ID . '","t": "' . $title . '","lt": "' . $post->post_latitude . '","ln": "' . $post->post_longitude . '","mk_id":"' . $post->ID . '_' . $post->default_category . '","i":"' . $icon . '","w":"' . $icon_size['w'] . '","h":"' . $icon_size['h'] . '"}';
83
+        $post_json = '{"id":"'.$post->ID.'","t": "'.$title.'","lt": "'.$post->post_latitude.'","ln": "'.$post->post_longitude.'","mk_id":"'.$post->ID.'_'.$post->default_category.'","i":"'.$icon.'","w":"'.$icon_size['w'].'","h":"'.$icon_size['h'].'"}';
84 84
 
85 85
         /**
86 86
          * Filter the json data when creating output for post json marker..
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
          * @param string $post_json JSON representation of the post marker info.
90 90
          * @param object $post The post object.
91 91
          */
92
-        $map_jason[] = apply_filters('geodir_create_marker_jason_of_posts',$post_json, $post);
92
+        $map_jason[] = apply_filters('geodir_create_marker_jason_of_posts', $post_json, $post);
93 93
     }
94 94
 }
95 95
 
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
         foreach ($map_canvas_arr as $canvas => $jason) {
110 110
             if (is_array($map_jason) && !empty($map_jason)) {
111 111
 
112
-                $canvas_jason = $canvas . "_jason";
112
+                $canvas_jason = $canvas."_jason";
113 113
                 $map_canvas_arr[$canvas] = array_unique($map_jason);
114 114
                 unset($cat_content_info);
115 115
                 $cat_content_info[] = implode(',', $map_canvas_arr[$canvas]);
@@ -117,12 +117,12 @@  discard block
 block discarded – undo
117 117
                 if (!empty($cat_content_info)) {
118 118
                     $json_content = substr(implode(',', $cat_content_info), 1);
119 119
                     $json_content = htmlentities($json_content, ENT_QUOTES); // Quotes in csv title import break maps - FIXED by kiran on 2nd March, 2016
120
-                    $canvas_jason = '[{"totalcount":"' . $totalcount . '",' . $json_content . ']';
120
+                    $canvas_jason = '[{"totalcount":"'.$totalcount.'",'.$json_content.']';
121 121
                 } else {
122 122
                     $canvas_jason = '[{"totalcount":"0"}]';
123 123
                 }
124 124
 
125
-                $map_canvas_jason_args = array($canvas . '_jason' => $canvas_jason);
125
+                $map_canvas_jason_args = array($canvas.'_jason' => $canvas_jason);
126 126
 
127 127
                 /**
128 128
                  * Filter the send_marker_jason_to_js() function map canvas json args.
@@ -134,12 +134,12 @@  discard block
 block discarded – undo
134 134
                  * @param string $canvas Map canvas array key.
135 135
                  * @param array $map_canvas_jason_args Map canvas args.
136 136
                  */
137
-                $map_canvas_jason_args = apply_filters('geodir_map_canvas_jason_' . $canvas, $map_canvas_jason_args);
137
+                $map_canvas_jason_args = apply_filters('geodir_map_canvas_jason_'.$canvas, $map_canvas_jason_args);
138 138
 
139
-                wp_localize_script('geodir-map-widget', $canvas . '_jason_args', $map_canvas_jason_args);
139
+                wp_localize_script('geodir-map-widget', $canvas.'_jason_args', $map_canvas_jason_args);
140 140
             } else {
141 141
                 $canvas_jason = '[{"totalcount":"0"}]';
142
-                $map_canvas_jason_args = array($canvas . '_jason' => $canvas_jason);
142
+                $map_canvas_jason_args = array($canvas.'_jason' => $canvas_jason);
143 143
 
144 144
                 /**
145 145
                  * Filter the send_marker_jason_to_js() function map canvas json args.
@@ -151,8 +151,8 @@  discard block
 block discarded – undo
151 151
                  * @param string $canvas Map canvas array key.
152 152
                  * @param array $map_canvas_jason_args Map canvas args.
153 153
                  */
154
-                $map_canvas_jason_args = apply_filters('geodir_map_canvas_jason_' . $canvas, $map_canvas_jason_args);
155
-                wp_localize_script('geodir-map-widget', $canvas . '_jason_args', $map_canvas_jason_args);
154
+                $map_canvas_jason_args = apply_filters('geodir_map_canvas_jason_'.$canvas, $map_canvas_jason_args);
155
+                wp_localize_script('geodir-map-widget', $canvas.'_jason_args', $map_canvas_jason_args);
156 156
             }
157 157
         }
158 158
 
@@ -214,11 +214,11 @@  discard block
 block discarded – undo
214 214
         }
215 215
 
216 216
 
217
-        $out = '<ul class="treeview ' . $list_class . '" style="margin-left:' . $p . 'px;' . $display . ';">';
217
+        $out = '<ul class="treeview '.$list_class.'" style="margin-left:'.$p.'px;'.$display.';">';
218 218
 
219 219
         $geodir_cat_icons = geodir_get_term_icon();
220 220
 
221
-        $geodir_default_map_search_pt = (get_option('geodir_default_map_search_pt')) ? get_option('geodir_default_map_search_pt') :  'gd_place';
221
+        $geodir_default_map_search_pt = (get_option('geodir_default_map_search_pt')) ? get_option('geodir_default_map_search_pt') : 'gd_place';
222 222
         $post_type = isset($_REQUEST['post_type']) ? $_REQUEST['post_type'] : $geodir_default_map_search_pt;
223 223
         foreach ($cat_terms as $cat_term):
224 224
 
@@ -232,16 +232,16 @@  discard block
 block discarded – undo
232 232
 
233 233
                 // Untick the category by default on home map
234 234
                 if ($is_home_map && $geodir_home_map_untick = get_option('geodir_home_map_untick')) {
235
-                    if (!empty($geodir_home_map_untick) && in_array($post_type . '_' . $cat_term->term_id, $geodir_home_map_untick)) {
235
+                    if (!empty($geodir_home_map_untick) && in_array($post_type.'_'.$cat_term->term_id, $geodir_home_map_untick)) {
236 236
                         $checked = '';
237 237
                     }
238 238
                 }
239 239
 
240
-                $term_check = '<input type="checkbox" ' . $checked . ' id="' .$map_canvas_name.'_tick_cat_'. $cat_term->term_id . '" class="group_selector ' . $main_list_class . '"';
241
-                $term_check .= ' name="' . $map_canvas_name . '_cat[]" ';
242
-                $term_check .= '  title="' . esc_attr(ucfirst($cat_term->name)) . '" value="' . $cat_term->term_id . '" onclick="javascript:build_map_ajax_search_param(\'' . $map_canvas_name . '\',false, this)">';
243
-                $term_img = '<img height="15" width="15" alt="' . $cat_term->taxonomy . '" src="' . $icon . '" title="' . ucfirst($cat_term->name) . '"/>';
244
-                $out .= '<li>' . $term_check . '<label for="' . $map_canvas_name.'_tick_cat_'. $cat_term->term_id . '">' . $term_img . ucfirst($cat_term->name) . '</label><i class="fa fa-long-arrow-down"></i>';
240
+                $term_check = '<input type="checkbox" '.$checked.' id="'.$map_canvas_name.'_tick_cat_'.$cat_term->term_id.'" class="group_selector '.$main_list_class.'"';
241
+                $term_check .= ' name="'.$map_canvas_name.'_cat[]" ';
242
+                $term_check .= '  title="'.esc_attr(ucfirst($cat_term->name)).'" value="'.$cat_term->term_id.'" onclick="javascript:build_map_ajax_search_param(\''.$map_canvas_name.'\',false, this)">';
243
+                $term_img = '<img height="15" width="15" alt="'.$cat_term->taxonomy.'" src="'.$icon.'" title="'.ucfirst($cat_term->name).'"/>';
244
+                $out .= '<li>'.$term_check.'<label for="'.$map_canvas_name.'_tick_cat_'.$cat_term->term_id.'">'.$term_img.ucfirst($cat_term->name).'</label><i class="fa fa-long-arrow-down"></i>';
245 245
 
246 246
             endif;
247 247
 
@@ -353,11 +353,11 @@  discard block
 block discarded – undo
353 353
  * @package GeoDirectory
354 354
  */
355 355
 function geodir_map_load_style() {    
356
-    if (in_array(geodir_map_name(), array('auto', 'google')) && wp_script_is( 'geodirectory-googlemap-script', 'done')) {
356
+    if (in_array(geodir_map_name(), array('auto', 'google')) && wp_script_is('geodirectory-googlemap-script', 'done')) {
357 357
 ?>
358 358
 <script type="text/javascript">
359 359
 if (!(window.google && typeof google.maps !== 'undefined')) {
360
-    document.write('<' + 'link id="geodirectory-leaflet-style-css" media="all" type="text/css" href="<?php echo geodir_plugin_url();?>/geodirectory-assets/leaflet/leaflet.css?ver=<?php echo GEODIRECTORY_VERSION;?>" rel="stylesheet"' + '>');
360
+    document.write('<' + 'link id="geodirectory-leaflet-style-css" media="all" type="text/css" href="<?php echo geodir_plugin_url(); ?>/geodirectory-assets/leaflet/leaflet.css?ver=<?php echo GEODIRECTORY_VERSION; ?>" rel="stylesheet"' + '>');
361 361
 }
362 362
 </script>
363 363
 <?php
@@ -373,12 +373,12 @@  discard block
 block discarded – undo
373 373
  * @package GeoDirectory
374 374
  */
375 375
 function geodir_map_load_script() {
376
-    if (in_array(geodir_map_name(), array('auto', 'google')) && wp_script_is( 'geodirectory-googlemap-script', 'done')) {
376
+    if (in_array(geodir_map_name(), array('auto', 'google')) && wp_script_is('geodirectory-googlemap-script', 'done')) {
377 377
 ?>
378 378
 <script type="text/javascript">
379 379
 if (!(window.google && typeof google.maps !== 'undefined')) {
380
-    document.write('<' + 'script id="geodirectory-leaflet-script" src="<?php echo geodir_plugin_url();?>/geodirectory-assets/leaflet/leaflet.min.js?ver=<?php echo GEODIRECTORY_VERSION;?>" type="text/javascript"><' + '/script>');
381
-    document.write('<' + 'script id="geodirectory-leaflet-geo-script" src="<?php echo geodir_plugin_url();?>/geodirectory-assets/leaflet/osm.geocode.js?ver=<?php echo GEODIRECTORY_VERSION;?>" type="text/javascript"><' + '/script>');
380
+    document.write('<' + 'script id="geodirectory-leaflet-script" src="<?php echo geodir_plugin_url(); ?>/geodirectory-assets/leaflet/leaflet.min.js?ver=<?php echo GEODIRECTORY_VERSION; ?>" type="text/javascript"><' + '/script>');
381
+    document.write('<' + 'script id="geodirectory-leaflet-geo-script" src="<?php echo geodir_plugin_url(); ?>/geodirectory-assets/leaflet/osm.geocode.js?ver=<?php echo GEODIRECTORY_VERSION; ?>" type="text/javascript"><' + '/script>');
382 382
 }
383 383
 </script>
384 384
 <?php
Please login to merge, or discard this patch.
geodirectory-functions/general_functions.php 2 patches
Indentation   +3377 added lines, -3377 removed lines patch added patch discarded remove patch
@@ -28,11 +28,11 @@  discard block
 block discarded – undo
28 28
 function geodir_plugin_url()
29 29
 {
30 30
 
31
-    if (is_ssl()) :
32
-        return str_replace('http://', 'https://', WP_PLUGIN_URL) . "/" . plugin_basename(dirname(dirname(__FILE__)));
33
-    else :
34
-        return WP_PLUGIN_URL . "/" . plugin_basename(dirname(dirname(__FILE__)));
35
-    endif;
31
+	if (is_ssl()) :
32
+		return str_replace('http://', 'https://', WP_PLUGIN_URL) . "/" . plugin_basename(dirname(dirname(__FILE__)));
33
+	else :
34
+		return WP_PLUGIN_URL . "/" . plugin_basename(dirname(dirname(__FILE__)));
35
+	endif;
36 36
 }
37 37
 
38 38
 
@@ -47,11 +47,11 @@  discard block
 block discarded – undo
47 47
  */
48 48
 function geodir_plugin_path()
49 49
 {
50
-    if ( defined( 'GD_TESTING_MODE' ) && GD_TESTING_MODE ) {
51
-        return dirname(dirname(__FILE__));
52
-    } else {
53
-        return WP_PLUGIN_DIR . "/" . plugin_basename(dirname(dirname(__FILE__)));
54
-    }
50
+	if ( defined( 'GD_TESTING_MODE' ) && GD_TESTING_MODE ) {
51
+		return dirname(dirname(__FILE__));
52
+	} else {
53
+		return WP_PLUGIN_DIR . "/" . plugin_basename(dirname(dirname(__FILE__)));
54
+	}
55 55
 }
56 56
 
57 57
 /**
@@ -65,11 +65,11 @@  discard block
 block discarded – undo
65 65
  */
66 66
 function geodir_is_plugin_active($plugin)
67 67
 {
68
-    $active_plugins = get_option('active_plugins');
69
-    foreach ($active_plugins as $key => $active_plugin) {
70
-        if (strstr($active_plugin, $plugin)) return true;
71
-    }
72
-    return false;
68
+	$active_plugins = get_option('active_plugins');
69
+	foreach ($active_plugins as $key => $active_plugin) {
70
+		if (strstr($active_plugin, $plugin)) return true;
71
+	}
72
+	return false;
73 73
 }
74 74
 
75 75
 
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
  */
86 86
 function geodir_get_formated_date($date)
87 87
 {
88
-    return mysql2date(get_option('date_format'), $date);
88
+	return mysql2date(get_option('date_format'), $date);
89 89
 }
90 90
 
91 91
 /**
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
  */
101 101
 function geodir_get_formated_time($time)
102 102
 {
103
-    return mysql2date(get_option('time_format'), $time, $translate = true);
103
+	return mysql2date(get_option('time_format'), $time, $translate = true);
104 104
 }
105 105
 
106 106
 
@@ -118,26 +118,26 @@  discard block
 block discarded – undo
118 118
  */
119 119
 function geodir_getlink($url, $params = array(), $use_existing_arguments = false)
120 120
 {
121
-    if ($use_existing_arguments) $params = $params + $_GET;
122
-    if (!$params) return $url;
123
-    $link = $url;
124
-    if (strpos($link, '?') === false) $link .= '?'; //If there is no '?' add one at the end
125
-    elseif (strpos($link, '//maps.google.com/maps/api/js?language=')) $link .= '&amp;'; //If there is no '&' at the END, add one.
126
-    elseif (!preg_match('/(\?|\&(amp;)?)$/', $link)) $link .= '&'; //If there is no '&' at the END, add one.
127
-
128
-    $params_arr = array();
129
-    foreach ($params as $key => $value) {
130
-        if (gettype($value) == 'array') { //Handle array data properly
131
-            foreach ($value as $val) {
132
-                $params_arr[] = $key . '[]=' . urlencode($val);
133
-            }
134
-        } else {
135
-            $params_arr[] = $key . '=' . urlencode($value);
136
-        }
137
-    }
138
-    $link .= implode('&', $params_arr);
139
-
140
-    return $link;
121
+	if ($use_existing_arguments) $params = $params + $_GET;
122
+	if (!$params) return $url;
123
+	$link = $url;
124
+	if (strpos($link, '?') === false) $link .= '?'; //If there is no '?' add one at the end
125
+	elseif (strpos($link, '//maps.google.com/maps/api/js?language=')) $link .= '&amp;'; //If there is no '&' at the END, add one.
126
+	elseif (!preg_match('/(\?|\&(amp;)?)$/', $link)) $link .= '&'; //If there is no '&' at the END, add one.
127
+
128
+	$params_arr = array();
129
+	foreach ($params as $key => $value) {
130
+		if (gettype($value) == 'array') { //Handle array data properly
131
+			foreach ($value as $val) {
132
+				$params_arr[] = $key . '[]=' . urlencode($val);
133
+			}
134
+		} else {
135
+			$params_arr[] = $key . '=' . urlencode($value);
136
+		}
137
+	}
138
+	$link .= implode('&', $params_arr);
139
+
140
+	return $link;
141 141
 }
142 142
 
143 143
 
@@ -152,17 +152,17 @@  discard block
 block discarded – undo
152 152
  */
153 153
 function geodir_get_addlisting_link($post_type = '')
154 154
 {
155
-    global $wpdb;
155
+	global $wpdb;
156 156
 
157
-    //$check_pkg  = $wpdb->get_var("SELECT pid FROM ".GEODIR_PRICE_TABLE." WHERE post_type='".$post_type."' and status != '0'");
158
-    $check_pkg = 1;
159
-    if (post_type_exists($post_type) && $check_pkg) {
157
+	//$check_pkg  = $wpdb->get_var("SELECT pid FROM ".GEODIR_PRICE_TABLE." WHERE post_type='".$post_type."' and status != '0'");
158
+	$check_pkg = 1;
159
+	if (post_type_exists($post_type) && $check_pkg) {
160 160
 
161
-        $add_listing_link = get_page_link(geodir_add_listing_page_id());
161
+		$add_listing_link = get_page_link(geodir_add_listing_page_id());
162 162
 
163
-        return esc_url( add_query_arg(array('listing_type' => $post_type), $add_listing_link) );
164
-    } else
165
-        return get_bloginfo('url');
163
+		return esc_url( add_query_arg(array('listing_type' => $post_type), $add_listing_link) );
164
+	} else
165
+		return get_bloginfo('url');
166 166
 }
167 167
 
168 168
 /**
@@ -175,19 +175,19 @@  discard block
 block discarded – undo
175 175
  */
176 176
 function geodir_curPageURL()
177 177
 {
178
-    $pageURL = 'http';
179
-    if (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on") {
180
-        $pageURL .= "s";
181
-    }
182
-    $pageURL .= "://";
183
-    $pageURL .= $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"];
184
-    /**
185
-     * Filter the current page URL returned by function geodir_curPageURL().
186
-     *
187
-     * @since 1.4.1
188
-     * @param string $pageURL The URL of the current page.
189
-     */
190
-    return apply_filters('geodir_curPageURL', $pageURL);
178
+	$pageURL = 'http';
179
+	if (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on") {
180
+		$pageURL .= "s";
181
+	}
182
+	$pageURL .= "://";
183
+	$pageURL .= $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"];
184
+	/**
185
+	 * Filter the current page URL returned by function geodir_curPageURL().
186
+	 *
187
+	 * @since 1.4.1
188
+	 * @param string $pageURL The URL of the current page.
189
+	 */
190
+	return apply_filters('geodir_curPageURL', $pageURL);
191 191
 }
192 192
 
193 193
 
@@ -204,12 +204,12 @@  discard block
 block discarded – undo
204 204
 function geodir_clean($string)
205 205
 {
206 206
 
207
-    $string = trim(strip_tags(stripslashes($string)));
208
-    $string = str_replace(" ", "-", $string); // Replaces all spaces with hyphens.
209
-    $string = preg_replace('/[^A-Za-z0-9\-\_]/', '', $string); // Removes special chars.
210
-    $string = preg_replace('/-+/', '-', $string); // Replaces multiple hyphens with single one.
207
+	$string = trim(strip_tags(stripslashes($string)));
208
+	$string = str_replace(" ", "-", $string); // Replaces all spaces with hyphens.
209
+	$string = preg_replace('/[^A-Za-z0-9\-\_]/', '', $string); // Removes special chars.
210
+	$string = preg_replace('/-+/', '-', $string); // Replaces multiple hyphens with single one.
211 211
 
212
-    return $string;
212
+	return $string;
213 213
 }
214 214
 
215 215
 /**
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
  */
222 222
 function geodir_get_weekday()
223 223
 {
224
-    return array(__('Sunday', 'geodirectory'), __('Monday', 'geodirectory'), __('Tuesday', 'geodirectory'), __('Wednesday', 'geodirectory'), __('Thursday', 'geodirectory'), __('Friday', 'geodirectory'), __('Saturday', 'geodirectory'));
224
+	return array(__('Sunday', 'geodirectory'), __('Monday', 'geodirectory'), __('Tuesday', 'geodirectory'), __('Wednesday', 'geodirectory'), __('Thursday', 'geodirectory'), __('Friday', 'geodirectory'), __('Saturday', 'geodirectory'));
225 225
 }
226 226
 
227 227
 /**
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
  */
234 234
 function geodir_get_weeks()
235 235
 {
236
-    return array(__('First', 'geodirectory'), __('Second', 'geodirectory'), __('Third', 'geodirectory'), __('Fourth', 'geodirectory'), __('Last', 'geodirectory'));
236
+	return array(__('First', 'geodirectory'), __('Second', 'geodirectory'), __('Third', 'geodirectory'), __('Fourth', 'geodirectory'), __('Last', 'geodirectory'));
237 237
 }
238 238
 
239 239
 
@@ -252,103 +252,103 @@  discard block
 block discarded – undo
252 252
 function geodir_is_page($gdpage = '')
253 253
 {
254 254
 
255
-    global $wp_query, $post,$wp;
256
-    //if(!is_admin()):
257
-
258
-    switch ($gdpage):
259
-        case 'add-listing':
260
-
261
-            if (is_page() && get_query_var('page_id') == geodir_add_listing_page_id()) {
262
-                return true;
263
-            } elseif (is_page() && isset($post->post_content) && has_shortcode($post->post_content, 'gd_add_listing')) {
264
-                return true;
265
-            }
266
-
267
-            break;
268
-        case 'preview':
269
-            if ((is_page() && get_query_var('page_id') == geodir_preview_page_id()) && isset($_REQUEST['listing_type'])
270
-                && in_array($_REQUEST['listing_type'], geodir_get_posttypes())
271
-            )
272
-                return true;
273
-            break;
274
-        case 'listing-success':
275
-            if (is_page() && get_query_var('page_id') == geodir_success_page_id())
276
-                return true;
277
-            break;
278
-        case 'detail':
279
-            $post_type = get_query_var('post_type');
280
-            if(is_array($post_type)){$post_type = reset($post_type);}
281
-            if (is_single() && in_array($post_type, geodir_get_posttypes()))
282
-                return true;
283
-            break;
284
-        case 'pt':
285
-            $post_type = get_query_var('post_type');
286
-            if(is_array($post_type)){$post_type = reset($post_type);}
287
-            if (is_post_type_archive() && in_array($post_type , geodir_get_posttypes()) && !is_tax())
288
-                return true;
289
-
290
-            break;
291
-        case 'listing':
292
-            if (is_tax() && geodir_get_taxonomy_posttype()) {
293
-                global $current_term, $taxonomy, $term;
294
-
295
-                return true;
296
-            }
297
-            $post_type = get_query_var('post_type');
298
-            if(is_array($post_type)){$post_type = reset($post_type);}
299
-            if (is_post_type_archive() && in_array($post_type, geodir_get_posttypes()))
300
-                return true;
301
-
302
-            break;
303
-        case 'home':
304
-
305
-            if ((is_page() && get_query_var('page_id') == geodir_home_page_id()) || is_page_geodir_home())
306
-                return true;
307
-
308
-            break;
309
-        case 'location':
310
-            if (is_page() && get_query_var('page_id') == geodir_location_page_id())
311
-                return true;
312
-            break;
313
-        case 'author':
314
-            if (is_author() && isset($_REQUEST['geodir_dashbord']))
315
-                return true;
255
+	global $wp_query, $post,$wp;
256
+	//if(!is_admin()):
257
+
258
+	switch ($gdpage):
259
+		case 'add-listing':
260
+
261
+			if (is_page() && get_query_var('page_id') == geodir_add_listing_page_id()) {
262
+				return true;
263
+			} elseif (is_page() && isset($post->post_content) && has_shortcode($post->post_content, 'gd_add_listing')) {
264
+				return true;
265
+			}
266
+
267
+			break;
268
+		case 'preview':
269
+			if ((is_page() && get_query_var('page_id') == geodir_preview_page_id()) && isset($_REQUEST['listing_type'])
270
+				&& in_array($_REQUEST['listing_type'], geodir_get_posttypes())
271
+			)
272
+				return true;
273
+			break;
274
+		case 'listing-success':
275
+			if (is_page() && get_query_var('page_id') == geodir_success_page_id())
276
+				return true;
277
+			break;
278
+		case 'detail':
279
+			$post_type = get_query_var('post_type');
280
+			if(is_array($post_type)){$post_type = reset($post_type);}
281
+			if (is_single() && in_array($post_type, geodir_get_posttypes()))
282
+				return true;
283
+			break;
284
+		case 'pt':
285
+			$post_type = get_query_var('post_type');
286
+			if(is_array($post_type)){$post_type = reset($post_type);}
287
+			if (is_post_type_archive() && in_array($post_type , geodir_get_posttypes()) && !is_tax())
288
+				return true;
289
+
290
+			break;
291
+		case 'listing':
292
+			if (is_tax() && geodir_get_taxonomy_posttype()) {
293
+				global $current_term, $taxonomy, $term;
294
+
295
+				return true;
296
+			}
297
+			$post_type = get_query_var('post_type');
298
+			if(is_array($post_type)){$post_type = reset($post_type);}
299
+			if (is_post_type_archive() && in_array($post_type, geodir_get_posttypes()))
300
+				return true;
301
+
302
+			break;
303
+		case 'home':
304
+
305
+			if ((is_page() && get_query_var('page_id') == geodir_home_page_id()) || is_page_geodir_home())
306
+				return true;
307
+
308
+			break;
309
+		case 'location':
310
+			if (is_page() && get_query_var('page_id') == geodir_location_page_id())
311
+				return true;
312
+			break;
313
+		case 'author':
314
+			if (is_author() && isset($_REQUEST['geodir_dashbord']))
315
+				return true;
316 316
 			
317 317
 			if (function_exists('bp_loggedin_user_id') && function_exists('bp_displayed_user_id') && $my_id = (int)bp_loggedin_user_id()) {
318 318
 				if (((bool)bp_is_current_component('listings') || (bool)bp_is_current_component('favorites')) && $my_id > 0 && $my_id == (int)bp_displayed_user_id()) {
319 319
 					return true;
320 320
 				}
321 321
 			}
322
-            break;
323
-        case 'search':
324
-            if (is_search() && isset($_REQUEST['geodir_search']))
325
-                return true;
326
-            break;
327
-        case 'info':
328
-            if (is_page() && get_query_var('page_id') == geodir_info_page_id())
329
-                return true;
330
-            break;
331
-        case 'login':
332
-            if (is_page() && get_query_var('page_id') == geodir_login_page_id())
333
-                return true;
334
-            break;
335
-        case 'checkout':
336
-            if (is_page() && function_exists('geodir_payment_checkout_page_id') && get_query_var('page_id') == geodir_payment_checkout_page_id())
337
-                return true;
338
-            break;
339
-        case 'invoices':
340
-            if (is_page() && function_exists('geodir_payment_invoices_page_id') && get_query_var('page_id') == geodir_payment_invoices_page_id())
341
-                return true;
342
-            break;
343
-        default:
344
-            return false;
345
-            break;
346
-
347
-    endswitch;
348
-
349
-    //endif;
350
-
351
-    return false;
322
+			break;
323
+		case 'search':
324
+			if (is_search() && isset($_REQUEST['geodir_search']))
325
+				return true;
326
+			break;
327
+		case 'info':
328
+			if (is_page() && get_query_var('page_id') == geodir_info_page_id())
329
+				return true;
330
+			break;
331
+		case 'login':
332
+			if (is_page() && get_query_var('page_id') == geodir_login_page_id())
333
+				return true;
334
+			break;
335
+		case 'checkout':
336
+			if (is_page() && function_exists('geodir_payment_checkout_page_id') && get_query_var('page_id') == geodir_payment_checkout_page_id())
337
+				return true;
338
+			break;
339
+		case 'invoices':
340
+			if (is_page() && function_exists('geodir_payment_invoices_page_id') && get_query_var('page_id') == geodir_payment_invoices_page_id())
341
+				return true;
342
+			break;
343
+		default:
344
+			return false;
345
+			break;
346
+
347
+	endswitch;
348
+
349
+	//endif;
350
+
351
+	return false;
352 352
 }
353 353
 
354 354
 /**
@@ -362,97 +362,97 @@  discard block
 block discarded – undo
362 362
  */
363 363
 function geodir_set_is_geodir_page($wp)
364 364
 {
365
-    if (!is_admin()) {
366
-        //$wp->query_vars['gd_is_geodir_page'] = false;
367
-        //print_r()
368
-        if (empty($wp->query_vars) || !array_diff(array_keys($wp->query_vars), array('preview', 'page', 'paged', 'cpage'))) {
369
-            if (get_option('geodir_set_as_home'))
370
-                $wp->query_vars['gd_is_geodir_page'] = true;
371
-            if(geodir_is_page('home')){
372
-                $wp->query_vars['gd_is_geodir_page'] = true;
373
-            }
374
-
375
-
376
-        }
377
-
378
-        if (!isset($wp->query_vars['gd_is_geodir_page']) && isset($wp->query_vars['page_id'])) {
379
-            if (
380
-                $wp->query_vars['page_id'] == geodir_add_listing_page_id()
381
-                || $wp->query_vars['page_id'] == geodir_preview_page_id()
382
-                || $wp->query_vars['page_id'] == geodir_success_page_id()
383
-                || $wp->query_vars['page_id'] == geodir_location_page_id()
384
-                || $wp->query_vars['page_id'] == geodir_home_page_id()
385
-                || $wp->query_vars['page_id'] == geodir_info_page_id()
386
-                || $wp->query_vars['page_id'] == geodir_login_page_id()
387
-                || (function_exists('geodir_payment_checkout_page_id') && $wp->query_vars['page_id'] == geodir_payment_checkout_page_id())
388
-                || (function_exists('geodir_payment_invoices_page_id') && $wp->query_vars['page_id'] == geodir_payment_invoices_page_id())
389
-            )
390
-                $wp->query_vars['gd_is_geodir_page'] = true;
391
-        }
392
-
393
-        if (!isset($wp->query_vars['gd_is_geodir_page']) && isset($wp->query_vars['pagename'])) {
394
-            $page = get_page_by_path($wp->query_vars['pagename']);
395
-
396
-            if (!empty($page) && (
397
-                    $page->ID == geodir_add_listing_page_id()
398
-                    || $page->ID == geodir_preview_page_id()
399
-                    || $page->ID == geodir_success_page_id()
400
-                    || $page->ID == geodir_location_page_id()
401
-                    || (isset($wp->query_vars['page_id']) && $wp->query_vars['page_id'] == geodir_home_page_id())
402
-                    || (isset($wp->query_vars['page_id']) && $wp->query_vars['page_id'] == geodir_info_page_id())
403
-                    || (isset($wp->query_vars['page_id']) && $wp->query_vars['page_id'] == geodir_login_page_id())
404
-                    || (isset($wp->query_vars['page_id']) && function_exists('geodir_payment_checkout_page_id') && $wp->query_vars['page_id'] == geodir_payment_checkout_page_id())
405
-                    || (isset($wp->query_vars['page_id']) && function_exists('geodir_payment_invoices_page_id') && $wp->query_vars['page_id'] == geodir_payment_invoices_page_id())
406
-                )
407
-            )
408
-                $wp->query_vars['gd_is_geodir_page'] = true;
409
-        }
410
-
411
-
412
-        if (!isset($wp->query_vars['gd_is_geodir_page']) && isset($wp->query_vars['post_type']) && $wp->query_vars['post_type'] != '') {
413
-            $requested_post_type = $wp->query_vars['post_type'];
414
-            // check if this post type is geodirectory post types 
415
-            $post_type_array = geodir_get_posttypes();
416
-            if (in_array($requested_post_type, $post_type_array)) {
417
-                $wp->query_vars['gd_is_geodir_page'] = true;
418
-            }
419
-        }
420
-
421
-        if (!isset($wp->query_vars['gd_is_geodir_page'])) {
422
-            $geodir_taxonomis = geodir_get_taxonomies('', true);
423
-            if(!empty($geodir_taxonomis)){
424
-                foreach ($geodir_taxonomis as $taxonomy) {
425
-                    if (array_key_exists($taxonomy, $wp->query_vars)) {
426
-                        $wp->query_vars['gd_is_geodir_page'] = true;
427
-                        break;
428
-                    }
429
-                }
430
-            }
431
-
432
-        }
433
-
434
-        if (!isset($wp->query_vars['gd_is_geodir_page']) && isset($wp->query_vars['author_name']) && isset($_REQUEST['geodir_dashbord']))
435
-            $wp->query_vars['gd_is_geodir_page'] = true;
436
-
437
-
438
-        if (!isset($wp->query_vars['gd_is_geodir_page']) && isset($_REQUEST['geodir_search']))
439
-            $wp->query_vars['gd_is_geodir_page'] = true;
365
+	if (!is_admin()) {
366
+		//$wp->query_vars['gd_is_geodir_page'] = false;
367
+		//print_r()
368
+		if (empty($wp->query_vars) || !array_diff(array_keys($wp->query_vars), array('preview', 'page', 'paged', 'cpage'))) {
369
+			if (get_option('geodir_set_as_home'))
370
+				$wp->query_vars['gd_is_geodir_page'] = true;
371
+			if(geodir_is_page('home')){
372
+				$wp->query_vars['gd_is_geodir_page'] = true;
373
+			}
374
+
375
+
376
+		}
377
+
378
+		if (!isset($wp->query_vars['gd_is_geodir_page']) && isset($wp->query_vars['page_id'])) {
379
+			if (
380
+				$wp->query_vars['page_id'] == geodir_add_listing_page_id()
381
+				|| $wp->query_vars['page_id'] == geodir_preview_page_id()
382
+				|| $wp->query_vars['page_id'] == geodir_success_page_id()
383
+				|| $wp->query_vars['page_id'] == geodir_location_page_id()
384
+				|| $wp->query_vars['page_id'] == geodir_home_page_id()
385
+				|| $wp->query_vars['page_id'] == geodir_info_page_id()
386
+				|| $wp->query_vars['page_id'] == geodir_login_page_id()
387
+				|| (function_exists('geodir_payment_checkout_page_id') && $wp->query_vars['page_id'] == geodir_payment_checkout_page_id())
388
+				|| (function_exists('geodir_payment_invoices_page_id') && $wp->query_vars['page_id'] == geodir_payment_invoices_page_id())
389
+			)
390
+				$wp->query_vars['gd_is_geodir_page'] = true;
391
+		}
392
+
393
+		if (!isset($wp->query_vars['gd_is_geodir_page']) && isset($wp->query_vars['pagename'])) {
394
+			$page = get_page_by_path($wp->query_vars['pagename']);
395
+
396
+			if (!empty($page) && (
397
+					$page->ID == geodir_add_listing_page_id()
398
+					|| $page->ID == geodir_preview_page_id()
399
+					|| $page->ID == geodir_success_page_id()
400
+					|| $page->ID == geodir_location_page_id()
401
+					|| (isset($wp->query_vars['page_id']) && $wp->query_vars['page_id'] == geodir_home_page_id())
402
+					|| (isset($wp->query_vars['page_id']) && $wp->query_vars['page_id'] == geodir_info_page_id())
403
+					|| (isset($wp->query_vars['page_id']) && $wp->query_vars['page_id'] == geodir_login_page_id())
404
+					|| (isset($wp->query_vars['page_id']) && function_exists('geodir_payment_checkout_page_id') && $wp->query_vars['page_id'] == geodir_payment_checkout_page_id())
405
+					|| (isset($wp->query_vars['page_id']) && function_exists('geodir_payment_invoices_page_id') && $wp->query_vars['page_id'] == geodir_payment_invoices_page_id())
406
+				)
407
+			)
408
+				$wp->query_vars['gd_is_geodir_page'] = true;
409
+		}
410
+
411
+
412
+		if (!isset($wp->query_vars['gd_is_geodir_page']) && isset($wp->query_vars['post_type']) && $wp->query_vars['post_type'] != '') {
413
+			$requested_post_type = $wp->query_vars['post_type'];
414
+			// check if this post type is geodirectory post types 
415
+			$post_type_array = geodir_get_posttypes();
416
+			if (in_array($requested_post_type, $post_type_array)) {
417
+				$wp->query_vars['gd_is_geodir_page'] = true;
418
+			}
419
+		}
420
+
421
+		if (!isset($wp->query_vars['gd_is_geodir_page'])) {
422
+			$geodir_taxonomis = geodir_get_taxonomies('', true);
423
+			if(!empty($geodir_taxonomis)){
424
+				foreach ($geodir_taxonomis as $taxonomy) {
425
+					if (array_key_exists($taxonomy, $wp->query_vars)) {
426
+						$wp->query_vars['gd_is_geodir_page'] = true;
427
+						break;
428
+					}
429
+				}
430
+			}
431
+
432
+		}
433
+
434
+		if (!isset($wp->query_vars['gd_is_geodir_page']) && isset($wp->query_vars['author_name']) && isset($_REQUEST['geodir_dashbord']))
435
+			$wp->query_vars['gd_is_geodir_page'] = true;
436
+
437
+
438
+		if (!isset($wp->query_vars['gd_is_geodir_page']) && isset($_REQUEST['geodir_search']))
439
+			$wp->query_vars['gd_is_geodir_page'] = true;
440 440
 
441 441
 
442 442
 //check if homepage
443
-        if(!isset($wp->query_vars['gd_is_geodir_page'])
444
-            && !isset($wp->query_vars['page_id'])
445
-            && !isset($wp->query_vars['pagename'])
446
-            && is_page_geodir_home()){
447
-            $wp->query_vars['gd_is_geodir_page'] = true;
448
-        }
449
-        //echo $wp->query_vars['gd_is_geodir_page'] ;
450
-        /*echo "<pre>" ;
443
+		if(!isset($wp->query_vars['gd_is_geodir_page'])
444
+			&& !isset($wp->query_vars['page_id'])
445
+			&& !isset($wp->query_vars['pagename'])
446
+			&& is_page_geodir_home()){
447
+			$wp->query_vars['gd_is_geodir_page'] = true;
448
+		}
449
+		//echo $wp->query_vars['gd_is_geodir_page'] ;
450
+		/*echo "<pre>" ;
451 451
 		print_r($wp) ;
452 452
 		echo "</pre>" ;
453 453
 	//	exit();
454 454
 			*/
455
-    } // end of is admin
455
+	} // end of is admin
456 456
 }
457 457
 
458 458
 /**
@@ -465,56 +465,56 @@  discard block
 block discarded – undo
465 465
  */
466 466
 function geodir_is_geodir_page()
467 467
 {
468
-    global $wp;
469
-    if (isset($wp->query_vars['gd_is_geodir_page']) && $wp->query_vars['gd_is_geodir_page'])
470
-        return true;
471
-    else
472
-        return false;
468
+	global $wp;
469
+	if (isset($wp->query_vars['gd_is_geodir_page']) && $wp->query_vars['gd_is_geodir_page'])
470
+		return true;
471
+	else
472
+		return false;
473 473
 }
474 474
 
475 475
 if (!function_exists('geodir_get_imagesize')) {
476
-    /**
477
-     * Get image size using the size key .
478
-     *
479
-     * @since 1.0.0
480
-     * @package GeoDirectory
481
-     * @param string $size The image size key.
482
-     * @return array|mixed|void|WP_Error If valid returns image size. Else returns error.
483
-     */
484
-    function geodir_get_imagesize($size = '')
485
-    {
486
-
487
-        $imagesizes = array('list-thumb' => array('w' => 283, 'h' => 188),
488
-            'thumbnail' => array('w' => 125, 'h' => 125),
489
-            'widget-thumb' => array('w' => 50, 'h' => 50),
490
-            'slider-thumb' => array('w' => 100, 'h' => 100)
491
-        );
492
-
493
-        /**
494
-         * Filter the image sizes array.
495
-         *
496
-         * @since 1.0.0
497
-         * @param array $imagesizes Image size array.
498
-         */
499
-        $imagesizes = apply_filters('geodir_imagesizes', $imagesizes);
500
-
501
-        if (!empty($size) && array_key_exists($size, $imagesizes)) {
502
-            /**
503
-             * Filters image size of the passed key.
504
-             *
505
-             * @since 1.0.0
506
-             * @param array $imagesizes[$size] Image size array of the passed key.
507
-             */
508
-            return apply_filters('geodir_get_imagesize_' . $size, $imagesizes[$size]);
509
-
510
-        } elseif (!empty($size)) {
511
-
512
-            return new WP_Error('geodir_no_imagesize', __("Given image size is not valid", 'geodirectory'));
513
-
514
-        }
515
-
516
-        return $imagesizes;
517
-    }
476
+	/**
477
+	 * Get image size using the size key .
478
+	 *
479
+	 * @since 1.0.0
480
+	 * @package GeoDirectory
481
+	 * @param string $size The image size key.
482
+	 * @return array|mixed|void|WP_Error If valid returns image size. Else returns error.
483
+	 */
484
+	function geodir_get_imagesize($size = '')
485
+	{
486
+
487
+		$imagesizes = array('list-thumb' => array('w' => 283, 'h' => 188),
488
+			'thumbnail' => array('w' => 125, 'h' => 125),
489
+			'widget-thumb' => array('w' => 50, 'h' => 50),
490
+			'slider-thumb' => array('w' => 100, 'h' => 100)
491
+		);
492
+
493
+		/**
494
+		 * Filter the image sizes array.
495
+		 *
496
+		 * @since 1.0.0
497
+		 * @param array $imagesizes Image size array.
498
+		 */
499
+		$imagesizes = apply_filters('geodir_imagesizes', $imagesizes);
500
+
501
+		if (!empty($size) && array_key_exists($size, $imagesizes)) {
502
+			/**
503
+			 * Filters image size of the passed key.
504
+			 *
505
+			 * @since 1.0.0
506
+			 * @param array $imagesizes[$size] Image size array of the passed key.
507
+			 */
508
+			return apply_filters('geodir_get_imagesize_' . $size, $imagesizes[$size]);
509
+
510
+		} elseif (!empty($size)) {
511
+
512
+			return new WP_Error('geodir_no_imagesize', __("Given image size is not valid", 'geodirectory'));
513
+
514
+		}
515
+
516
+		return $imagesizes;
517
+	}
518 518
 }
519 519
 
520 520
 /**
@@ -534,151 +534,151 @@  discard block
 block discarded – undo
534 534
 
535 535
 
536 536
 if (!function_exists('createRandomString')) {
537
-    /**
538
-     * Creates random string.
539
-     *
540
-     * @since 1.0.0
541
-     * @package GeoDirectory
542
-     * @return string Random string.
543
-     */
544
-    function createRandomString()
545
-    {
546
-        $chars = "abcdefghijkmlnopqrstuvwxyz1023456789";
547
-        srand((double)microtime() * 1000000);
548
-        $i = 0;
549
-        $rstring = '';
550
-        while ($i <= 25) {
551
-            $num = rand() % 33;
552
-            $tmp = substr($chars, $num, 1);
553
-            $rstring = $rstring . $tmp;
554
-            $i++;
555
-        }
556
-        return $rstring;
557
-    }
537
+	/**
538
+	 * Creates random string.
539
+	 *
540
+	 * @since 1.0.0
541
+	 * @package GeoDirectory
542
+	 * @return string Random string.
543
+	 */
544
+	function createRandomString()
545
+	{
546
+		$chars = "abcdefghijkmlnopqrstuvwxyz1023456789";
547
+		srand((double)microtime() * 1000000);
548
+		$i = 0;
549
+		$rstring = '';
550
+		while ($i <= 25) {
551
+			$num = rand() % 33;
552
+			$tmp = substr($chars, $num, 1);
553
+			$rstring = $rstring . $tmp;
554
+			$i++;
555
+		}
556
+		return $rstring;
557
+	}
558 558
 }
559 559
 
560 560
 if (!function_exists('geodir_getDistanceRadius')) {
561
-    /**
562
-     * Calculates the distance radius.
563
-     *
564
-     * @since 1.0.0
565
-     * @package GeoDirectory
566
-     * @param string $uom Measurement unit type.
567
-     * @return float The mean radius.
568
-     */
569
-    function geodir_getDistanceRadius($uom = 'km')
570
-    {
561
+	/**
562
+	 * Calculates the distance radius.
563
+	 *
564
+	 * @since 1.0.0
565
+	 * @package GeoDirectory
566
+	 * @param string $uom Measurement unit type.
567
+	 * @return float The mean radius.
568
+	 */
569
+	function geodir_getDistanceRadius($uom = 'km')
570
+	{
571 571
 //	Use Haversine formula to calculate the great circle distance between two points identified by longitude and latitude
572
-        switch (geodir_strtolower($uom)):
573
-            case 'km'    :
574
-                $earthMeanRadius = 6371.009; // km
575
-                break;
576
-            case 'm'    :
577
-            case 'meters'    :
578
-                $earthMeanRadius = 6371.009 * 1000; // km
579
-                break;
580
-            case 'miles'    :
581
-                $earthMeanRadius = 3958.761; // miles
582
-                break;
583
-            case 'yards'    :
584
-            case 'yds'    :
585
-                $earthMeanRadius = 3958.761 * 1760; // yards
586
-                break;
587
-            case 'feet'    :
588
-            case 'ft'    :
589
-                $earthMeanRadius = 3958.761 * 1760 * 3; // feet
590
-                break;
591
-            case 'nm'    :
592
-                $earthMeanRadius = 3440.069; //  miles
593
-                break;
594
-            default:
595
-                $earthMeanRadius = 3958.761; // miles
596
-                break;
597
-        endswitch;
598
-        return $earthMeanRadius;
599
-    }
572
+		switch (geodir_strtolower($uom)):
573
+			case 'km'    :
574
+				$earthMeanRadius = 6371.009; // km
575
+				break;
576
+			case 'm'    :
577
+			case 'meters'    :
578
+				$earthMeanRadius = 6371.009 * 1000; // km
579
+				break;
580
+			case 'miles'    :
581
+				$earthMeanRadius = 3958.761; // miles
582
+				break;
583
+			case 'yards'    :
584
+			case 'yds'    :
585
+				$earthMeanRadius = 3958.761 * 1760; // yards
586
+				break;
587
+			case 'feet'    :
588
+			case 'ft'    :
589
+				$earthMeanRadius = 3958.761 * 1760 * 3; // feet
590
+				break;
591
+			case 'nm'    :
592
+				$earthMeanRadius = 3440.069; //  miles
593
+				break;
594
+			default:
595
+				$earthMeanRadius = 3958.761; // miles
596
+				break;
597
+		endswitch;
598
+		return $earthMeanRadius;
599
+	}
600 600
 }
601 601
 
602 602
 
603 603
 if (!function_exists('geodir_calculateDistanceFromLatLong')) {
604
-    /**
605
-     * Calculate the great circle distance between two points identified by longitude and latitude.
606
-     *
607
-     * @since 1.0.0
608
-     * @package GeoDirectory
609
-     * @param array $point1 Latitude and Longitude of point 1.
610
-     * @param array $point2 Latitude and Longitude of point 2.
611
-     * @param string $uom Unit of measurement.
612
-     * @return float The distance.
613
-     */
614
-    function geodir_calculateDistanceFromLatLong($point1, $point2, $uom = 'km')
615
-    {
604
+	/**
605
+	 * Calculate the great circle distance between two points identified by longitude and latitude.
606
+	 *
607
+	 * @since 1.0.0
608
+	 * @package GeoDirectory
609
+	 * @param array $point1 Latitude and Longitude of point 1.
610
+	 * @param array $point2 Latitude and Longitude of point 2.
611
+	 * @param string $uom Unit of measurement.
612
+	 * @return float The distance.
613
+	 */
614
+	function geodir_calculateDistanceFromLatLong($point1, $point2, $uom = 'km')
615
+	{
616 616
 //	Use Haversine formula to calculate the great circle distance between two points identified by longitude and latitude
617 617
 
618
-        $earthMeanRadius = geodir_getDistanceRadius($uom);
618
+		$earthMeanRadius = geodir_getDistanceRadius($uom);
619 619
 
620
-        $deltaLatitude = deg2rad((float) $point2['latitude'] - (float) $point1['latitude']);
621
-        $deltaLongitude = deg2rad((float) $point2['longitude'] - (float) $point1['longitude']);
622
-        $a = sin($deltaLatitude / 2) * sin($deltaLatitude / 2) +
623
-            cos(deg2rad((float) $point1['latitude'])) * cos(deg2rad((float) $point2['latitude'])) *
624
-            sin($deltaLongitude / 2) * sin($deltaLongitude / 2);
625
-        $c = 2 * atan2(sqrt($a), sqrt(1 - $a));
626
-        $distance = $earthMeanRadius * $c;
627
-        return $distance;
620
+		$deltaLatitude = deg2rad((float) $point2['latitude'] - (float) $point1['latitude']);
621
+		$deltaLongitude = deg2rad((float) $point2['longitude'] - (float) $point1['longitude']);
622
+		$a = sin($deltaLatitude / 2) * sin($deltaLatitude / 2) +
623
+			cos(deg2rad((float) $point1['latitude'])) * cos(deg2rad((float) $point2['latitude'])) *
624
+			sin($deltaLongitude / 2) * sin($deltaLongitude / 2);
625
+		$c = 2 * atan2(sqrt($a), sqrt(1 - $a));
626
+		$distance = $earthMeanRadius * $c;
627
+		return $distance;
628 628
 
629
-    }
629
+	}
630 630
 }
631 631
 
632 632
 
633 633
 if (!function_exists('geodir_sendEmail')) {
634
-    /**
635
-     * The main function that send transactional emails using the args provided.
636
-     *
637
-     * @since 1.0.0
638
-     * @since 1.5.7 Added db translations for notifications subject and content.
639
-     * @package GeoDirectory
640
-     * @param string $fromEmail Sender email address.
641
-     * @param string $fromEmailName Sender name.
642
-     * @param string $toEmail Receiver email address.
643
-     * @param string $toEmailName Receiver name.
644
-     * @param string $to_subject Email subject.
645
-     * @param string $to_message Email content.
646
-     * @param string $extra Not being used.
647
-     * @param string $message_type The message type. Can be send_friend, send_enquiry, forgot_password, registration, post_submit, listing_published.
648
-     * @param string $post_id The post ID.
649
-     * @param string $user_id The user ID.
650
-     */
651
-    function geodir_sendEmail($fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra = '', $message_type, $post_id = '', $user_id = '') {
652
-        $login_details = '';
653
-
654
-        // strip slashes from subject & message text
655
-        $to_subject = stripslashes_deep($to_subject);
656
-        $to_message = stripslashes_deep($to_message);
657
-
658
-        if ($message_type == 'send_friend') {
659
-            $subject = get_option('geodir_email_friend_subject');
660
-            $message = get_option('geodir_email_friend_content');
661
-        } elseif ($message_type == 'send_enquiry') {
662
-            $subject = get_option('geodir_email_enquiry_subject');
663
-            $message = get_option('geodir_email_enquiry_content');
664
-        } elseif ($message_type == 'forgot_password') {
665
-            $subject = get_option('geodir_forgot_password_subject');
666
-            $message = get_option('geodir_forgot_password_content');
667
-            $login_details = $to_message;
668
-        } elseif ($message_type == 'registration') {
669
-            $subject = get_option('geodir_registration_success_email_subject');
670
-            $message = get_option('geodir_registration_success_email_content');
671
-            $login_details = $to_message;
672
-        } elseif ($message_type == 'post_submit') {
673
-            $subject = get_option('geodir_post_submited_success_email_subject');
674
-            $message = get_option('geodir_post_submited_success_email_content');
675
-        } elseif ($message_type == 'listing_published') {
676
-            $subject = get_option('geodir_post_published_email_subject');
677
-            $message = get_option('geodir_post_published_email_content');
678
-        } elseif ($message_type == 'listing_edited') {
679
-            $subject = get_option('geodir_post_edited_email_subject_admin');
680
-            $message = get_option('geodir_post_edited_email_content_admin');
681
-        }
634
+	/**
635
+	 * The main function that send transactional emails using the args provided.
636
+	 *
637
+	 * @since 1.0.0
638
+	 * @since 1.5.7 Added db translations for notifications subject and content.
639
+	 * @package GeoDirectory
640
+	 * @param string $fromEmail Sender email address.
641
+	 * @param string $fromEmailName Sender name.
642
+	 * @param string $toEmail Receiver email address.
643
+	 * @param string $toEmailName Receiver name.
644
+	 * @param string $to_subject Email subject.
645
+	 * @param string $to_message Email content.
646
+	 * @param string $extra Not being used.
647
+	 * @param string $message_type The message type. Can be send_friend, send_enquiry, forgot_password, registration, post_submit, listing_published.
648
+	 * @param string $post_id The post ID.
649
+	 * @param string $user_id The user ID.
650
+	 */
651
+	function geodir_sendEmail($fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra = '', $message_type, $post_id = '', $user_id = '') {
652
+		$login_details = '';
653
+
654
+		// strip slashes from subject & message text
655
+		$to_subject = stripslashes_deep($to_subject);
656
+		$to_message = stripslashes_deep($to_message);
657
+
658
+		if ($message_type == 'send_friend') {
659
+			$subject = get_option('geodir_email_friend_subject');
660
+			$message = get_option('geodir_email_friend_content');
661
+		} elseif ($message_type == 'send_enquiry') {
662
+			$subject = get_option('geodir_email_enquiry_subject');
663
+			$message = get_option('geodir_email_enquiry_content');
664
+		} elseif ($message_type == 'forgot_password') {
665
+			$subject = get_option('geodir_forgot_password_subject');
666
+			$message = get_option('geodir_forgot_password_content');
667
+			$login_details = $to_message;
668
+		} elseif ($message_type == 'registration') {
669
+			$subject = get_option('geodir_registration_success_email_subject');
670
+			$message = get_option('geodir_registration_success_email_content');
671
+			$login_details = $to_message;
672
+		} elseif ($message_type == 'post_submit') {
673
+			$subject = get_option('geodir_post_submited_success_email_subject');
674
+			$message = get_option('geodir_post_submited_success_email_content');
675
+		} elseif ($message_type == 'listing_published') {
676
+			$subject = get_option('geodir_post_published_email_subject');
677
+			$message = get_option('geodir_post_published_email_content');
678
+		} elseif ($message_type == 'listing_edited') {
679
+			$subject = get_option('geodir_post_edited_email_subject_admin');
680
+			$message = get_option('geodir_post_edited_email_content_admin');
681
+		}
682 682
 		
683 683
 		if (!empty($subject)) {
684 684
 			$subject = __(stripslashes_deep($subject),'geodirectory');
@@ -688,203 +688,203 @@  discard block
 block discarded – undo
688 688
 			$message = __(stripslashes_deep($message),'geodirectory');
689 689
 		}
690 690
 
691
-        $to_message = nl2br($to_message);
692
-        $sitefromEmail = get_option('site_email');
693
-        $sitefromEmailName = get_site_emailName();
694
-        $productlink = get_permalink($post_id);
695
-
696
-        $user_login = '';
697
-        if ($user_id > 0 && $user_info = get_userdata($user_id)) {
698
-            $user_login = $user_info->user_login;
699
-        }
700
-
701
-        $posted_date = '';
702
-        $listingLink = '';
703
-
704
-        $post_info = get_post($post_id);
705
-
706
-        if ($post_info) {
707
-            $posted_date = $post_info->post_date;
708
-            $listingLink = '<a href="' . $productlink . '"><b>' . $post_info->post_title . '</b></a>';
709
-        }
710
-        $siteurl = home_url();
711
-        $siteurl_link = '<a href="' . $siteurl . '">' . $siteurl . '</a>';
712
-        $loginurl = geodir_login_url();
713
-        $loginurl_link = '<a href="' . $loginurl . '">login</a>';
691
+		$to_message = nl2br($to_message);
692
+		$sitefromEmail = get_option('site_email');
693
+		$sitefromEmailName = get_site_emailName();
694
+		$productlink = get_permalink($post_id);
695
+
696
+		$user_login = '';
697
+		if ($user_id > 0 && $user_info = get_userdata($user_id)) {
698
+			$user_login = $user_info->user_login;
699
+		}
700
+
701
+		$posted_date = '';
702
+		$listingLink = '';
703
+
704
+		$post_info = get_post($post_id);
705
+
706
+		if ($post_info) {
707
+			$posted_date = $post_info->post_date;
708
+			$listingLink = '<a href="' . $productlink . '"><b>' . $post_info->post_title . '</b></a>';
709
+		}
710
+		$siteurl = home_url();
711
+		$siteurl_link = '<a href="' . $siteurl . '">' . $siteurl . '</a>';
712
+		$loginurl = geodir_login_url();
713
+		$loginurl_link = '<a href="' . $loginurl . '">login</a>';
714 714
         
715
-        $post_author_id = !empty($post_info) ? $post_info->post_author : 0;
716
-        $post_author_name = geodir_get_client_name($post_author_id);
717
-        $current_date = date_i18n('Y-m-d H:i:s', current_time('timestamp'));
718
-
719
-        if ($fromEmail == '') {
720
-            $fromEmail = get_option('site_email');
721
-        }
722
-
723
-        if ($fromEmailName == '') {
724
-            $fromEmailName = get_option('site_email_name');
725
-        }
726
-
727
-        $search_array = array('[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#to_name#]', '[#from_name#]', '[#subject#]', '[#comments#]', '[#login_url#]', '[#login_details#]', '[#client_name#]', '[#posted_date#]','[#from_email#]','[#user_login#]','[#username#]','[#post_author_id#]','[#post_author_name#]','[#current_date#]');
728
-        $replace_array = array($listingLink, $siteurl_link, $post_id, $sitefromEmailName, $toEmailName, $fromEmailName, $to_subject, $to_message, $loginurl_link, $login_details, $toEmailName, $posted_date,$fromEmail, $user_login, $user_login, $post_author_id, $post_author_name, $current_date);
729
-        $message = str_replace($search_array, $replace_array, $message);
730
-
731
-        $search_array = array('[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#to_name#]', '[#from_name#]', '[#subject#]', '[#client_name#]', '[#posted_date#]','[#from_email#]','[#user_login#]','[#username#]','[#post_author_id#]','[#post_author_name#]','[#current_date#]');
732
-        $replace_array = array($listingLink, $siteurl_link, $post_id, $sitefromEmailName, $toEmailName, $fromEmailName, $to_subject, $toEmailName, $posted_date,$fromEmail, $user_login, $user_login, $post_author_id, $post_author_name, $current_date);
733
-        $subject = str_replace($search_array, $replace_array, $subject);
734
-
735
-        $headers = 'MIME-Version: 1.0' . "\r\n";
736
-        $headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n";
737
-        $headers .= "Reply-To: " . $fromEmail . "\r\n";
738
-        $headers .= 'From: ' . $sitefromEmailName . ' <' . $sitefromEmail . '>' . "\r\n";
739
-
740
-        $to = $toEmail;
741
-
742
-        /**
743
-         * Filter the client email to address.
744
-         *
745
-         * @since 1.6.1
746
-         * @package GeoDirectory
747
-         * @param string $to The email address the email is being sent to.
748
-         * @param string $fromEmail Sender email address.
749
-         * @param string $fromEmailName Sender name.
750
-         * @param string $toEmail Receiver email address.
751
-         * @param string $toEmailName Receiver name.
752
-         * @param string $to_subject Email subject.
753
-         * @param string $to_message Email content.
754
-         * @param string $extra Not being used.
755
-         * @param string $message_type The message type. Can be send_friend, send_enquiry, forgot_password, registration, post_submit, listing_published.
756
-         * @param string $post_id The post ID.
757
-         * @param string $user_id The user ID.
758
-         */
759
-        $to = apply_filters('geodir_sendEmail_to',$to,$fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id );
760
-        /**
761
-         * Filter the client email subject.
762
-         *
763
-         * @since 1.6.1
764
-         * @package GeoDirectory_Payment_Manager
765
-         * @param string $subject The email subject.
766
-         * @param string $fromEmail Sender email address.
767
-         * @param string $fromEmailName Sender name.
768
-         * @param string $toEmail Receiver email address.
769
-         * @param string $toEmailName Receiver name.
770
-         * @param string $to_subject Email subject.
771
-         * @param string $to_message Email content.
772
-         * @param string $extra Not being used.
773
-         * @param string $message_type The message type. Can be send_friend, send_enquiry, forgot_password, registration, post_submit, listing_published.
774
-         * @param string $post_id The post ID.
775
-         * @param string $user_id The user ID.
776
-         */
777
-        $subject = apply_filters('geodir_sendEmail_subject',$subject,$fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id );
778
-        /**
779
-         * Filter the client email message.
780
-         *
781
-         * @since 1.6.1
782
-         * @package GeoDirectory_Payment_Manager
783
-         * @param string $message The email message text.
784
-         * @param string $fromEmail Sender email address.
785
-         * @param string $fromEmailName Sender name.
786
-         * @param string $toEmail Receiver email address.
787
-         * @param string $toEmailName Receiver name.
788
-         * @param string $to_subject Email subject.
789
-         * @param string $to_message Email content.
790
-         * @param string $extra Not being used.
791
-         * @param string $message_type The message type. Can be send_friend, send_enquiry, forgot_password, registration, post_submit, listing_published.
792
-         * @param string $post_id The post ID.
793
-         * @param string $user_id The user ID.
794
-         */
795
-        $message = apply_filters('geodir_sendEmail_message',$message,$fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id );
796
-        /**
797
-         * Filter the client email headers.
798
-         *
799
-         * @since 1.6.1
800
-         * @package GeoDirectory_Payment_Manager
801
-         * @param string $headers The email headers.
802
-         * @param string $fromEmail Sender email address.
803
-         * @param string $fromEmailName Sender name.
804
-         * @param string $toEmail Receiver email address.
805
-         * @param string $toEmailName Receiver name.
806
-         * @param string $to_subject Email subject.
807
-         * @param string $to_message Email content.
808
-         * @param string $extra Not being used.
809
-         * @param string $message_type The message type. Can be send_friend, send_enquiry, forgot_password, registration, post_submit, listing_published.
810
-         * @param string $post_id The post ID.
811
-         * @param string $user_id The user ID.
812
-         */
813
-        $headers = apply_filters('geodir_sendEmail_headers',$headers,$fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id );
814
-
815
-        $sent = wp_mail($to, $subject, $message, $headers);
816
-
817
-        if( ! $sent ) {
818
-            if ( is_array( $to ) ) {
819
-                $to = implode( ',', $to );
820
-            }
821
-            $log_message = sprintf(
822
-                __( "Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory' ),
823
-                $message_type,
824
-                date_i18n( 'F j Y H:i:s', current_time( 'timestamp' ) ),
825
-                $to,
826
-                $subject
827
-            );
828
-            geodir_error_log( $log_message );
829
-        }
830
-
831
-        ///////// ADMIN BCC EMIALS
832
-        $adminEmail = get_bloginfo('admin_email');
833
-        $to = $adminEmail;
834
-
835
-        $admin_bcc = false;
836
-        if ($message_type == 'post_submit') {
837
-            $subject = __(stripslashes_deep(get_option('geodir_post_submited_success_email_subject_admin')), 'geodirectory');
838
-            $message = __(stripslashes_deep(get_option('geodir_post_submited_success_email_content_admin')), 'geodirectory');
839
-
840
-            $search_array = array('[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#to_name#]', '[#from_name#]', '[#subject#]', '[#comments#]', '[#login_url#]', '[#login_details#]', '[#client_name#]', '[#posted_date#]','[#user_login#]','[#username#]');
841
-            $replace_array = array($listingLink, $siteurl_link, $post_id, $sitefromEmailName, $toEmailName, $fromEmailName, $to_subject, $to_message, $loginurl_link, $login_details, $toEmailName, $posted_date, $user_login, $user_login);
842
-            $message = str_replace($search_array, $replace_array, $message);
843
-
844
-            $search_array = array('[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#to_name#]', '[#from_name#]', '[#subject#]', '[#client_name#]', '[#posted_date#]','[#user_login#]','[#username#]');
845
-            $replace_array = array($listingLink, $siteurl_link, $post_id, $sitefromEmailName, $toEmailName, $fromEmailName, $to_subject, $toEmailName, $posted_date, $user_login, $user_login);
846
-            $subject = str_replace($search_array, $replace_array, $subject);
847
-
848
-            $subject .= ' - ADMIN BCC COPY';
849
-            $admin_bcc = true;
850
-
851
-        }
852
-        elseif ($message_type == 'registration' && get_option('geodir_bcc_new_user')) {
853
-            $subject .= ' - ADMIN BCC COPY';
854
-            $admin_bcc = true;
855
-        }
856
-        elseif ($message_type == 'send_friend' && get_option('geodir_bcc_friend')) {
857
-            $subject .= ' - ADMIN BCC COPY';
858
-            $admin_bcc = true;
859
-        }
860
-        elseif ($message_type == 'send_enquiry' && get_option('geodir_bcc_enquiry')) {
861
-            $subject .= ' - ADMIN BCC COPY';
862
-            $admin_bcc = true;
863
-        }
864
-        elseif ($message_type == 'listing_published' && get_option('geodir_bcc_listing_published')) {
865
-            $subject .= ' - ADMIN BCC COPY';
866
-            $admin_bcc = true;
867
-        }
868
-
869
-        if($admin_bcc===true){
870
-            $sent = wp_mail($to, $subject, $message, $headers);
871
-
872
-            if( ! $sent ) {
873
-                if ( is_array( $to ) ) {
874
-                    $to = implode( ',', $to );
875
-                }
876
-                $log_message = sprintf(
877
-                    __( "Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory' ),
878
-                    $message_type,
879
-                    date_i18n( 'F j Y H:i:s', current_time( 'timestamp' ) ),
880
-                    $to,
881
-                    $subject
882
-                );
883
-                geodir_error_log( $log_message );
884
-            }
885
-        }
886
-
887
-    }
715
+		$post_author_id = !empty($post_info) ? $post_info->post_author : 0;
716
+		$post_author_name = geodir_get_client_name($post_author_id);
717
+		$current_date = date_i18n('Y-m-d H:i:s', current_time('timestamp'));
718
+
719
+		if ($fromEmail == '') {
720
+			$fromEmail = get_option('site_email');
721
+		}
722
+
723
+		if ($fromEmailName == '') {
724
+			$fromEmailName = get_option('site_email_name');
725
+		}
726
+
727
+		$search_array = array('[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#to_name#]', '[#from_name#]', '[#subject#]', '[#comments#]', '[#login_url#]', '[#login_details#]', '[#client_name#]', '[#posted_date#]','[#from_email#]','[#user_login#]','[#username#]','[#post_author_id#]','[#post_author_name#]','[#current_date#]');
728
+		$replace_array = array($listingLink, $siteurl_link, $post_id, $sitefromEmailName, $toEmailName, $fromEmailName, $to_subject, $to_message, $loginurl_link, $login_details, $toEmailName, $posted_date,$fromEmail, $user_login, $user_login, $post_author_id, $post_author_name, $current_date);
729
+		$message = str_replace($search_array, $replace_array, $message);
730
+
731
+		$search_array = array('[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#to_name#]', '[#from_name#]', '[#subject#]', '[#client_name#]', '[#posted_date#]','[#from_email#]','[#user_login#]','[#username#]','[#post_author_id#]','[#post_author_name#]','[#current_date#]');
732
+		$replace_array = array($listingLink, $siteurl_link, $post_id, $sitefromEmailName, $toEmailName, $fromEmailName, $to_subject, $toEmailName, $posted_date,$fromEmail, $user_login, $user_login, $post_author_id, $post_author_name, $current_date);
733
+		$subject = str_replace($search_array, $replace_array, $subject);
734
+
735
+		$headers = 'MIME-Version: 1.0' . "\r\n";
736
+		$headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n";
737
+		$headers .= "Reply-To: " . $fromEmail . "\r\n";
738
+		$headers .= 'From: ' . $sitefromEmailName . ' <' . $sitefromEmail . '>' . "\r\n";
739
+
740
+		$to = $toEmail;
741
+
742
+		/**
743
+		 * Filter the client email to address.
744
+		 *
745
+		 * @since 1.6.1
746
+		 * @package GeoDirectory
747
+		 * @param string $to The email address the email is being sent to.
748
+		 * @param string $fromEmail Sender email address.
749
+		 * @param string $fromEmailName Sender name.
750
+		 * @param string $toEmail Receiver email address.
751
+		 * @param string $toEmailName Receiver name.
752
+		 * @param string $to_subject Email subject.
753
+		 * @param string $to_message Email content.
754
+		 * @param string $extra Not being used.
755
+		 * @param string $message_type The message type. Can be send_friend, send_enquiry, forgot_password, registration, post_submit, listing_published.
756
+		 * @param string $post_id The post ID.
757
+		 * @param string $user_id The user ID.
758
+		 */
759
+		$to = apply_filters('geodir_sendEmail_to',$to,$fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id );
760
+		/**
761
+		 * Filter the client email subject.
762
+		 *
763
+		 * @since 1.6.1
764
+		 * @package GeoDirectory_Payment_Manager
765
+		 * @param string $subject The email subject.
766
+		 * @param string $fromEmail Sender email address.
767
+		 * @param string $fromEmailName Sender name.
768
+		 * @param string $toEmail Receiver email address.
769
+		 * @param string $toEmailName Receiver name.
770
+		 * @param string $to_subject Email subject.
771
+		 * @param string $to_message Email content.
772
+		 * @param string $extra Not being used.
773
+		 * @param string $message_type The message type. Can be send_friend, send_enquiry, forgot_password, registration, post_submit, listing_published.
774
+		 * @param string $post_id The post ID.
775
+		 * @param string $user_id The user ID.
776
+		 */
777
+		$subject = apply_filters('geodir_sendEmail_subject',$subject,$fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id );
778
+		/**
779
+		 * Filter the client email message.
780
+		 *
781
+		 * @since 1.6.1
782
+		 * @package GeoDirectory_Payment_Manager
783
+		 * @param string $message The email message text.
784
+		 * @param string $fromEmail Sender email address.
785
+		 * @param string $fromEmailName Sender name.
786
+		 * @param string $toEmail Receiver email address.
787
+		 * @param string $toEmailName Receiver name.
788
+		 * @param string $to_subject Email subject.
789
+		 * @param string $to_message Email content.
790
+		 * @param string $extra Not being used.
791
+		 * @param string $message_type The message type. Can be send_friend, send_enquiry, forgot_password, registration, post_submit, listing_published.
792
+		 * @param string $post_id The post ID.
793
+		 * @param string $user_id The user ID.
794
+		 */
795
+		$message = apply_filters('geodir_sendEmail_message',$message,$fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id );
796
+		/**
797
+		 * Filter the client email headers.
798
+		 *
799
+		 * @since 1.6.1
800
+		 * @package GeoDirectory_Payment_Manager
801
+		 * @param string $headers The email headers.
802
+		 * @param string $fromEmail Sender email address.
803
+		 * @param string $fromEmailName Sender name.
804
+		 * @param string $toEmail Receiver email address.
805
+		 * @param string $toEmailName Receiver name.
806
+		 * @param string $to_subject Email subject.
807
+		 * @param string $to_message Email content.
808
+		 * @param string $extra Not being used.
809
+		 * @param string $message_type The message type. Can be send_friend, send_enquiry, forgot_password, registration, post_submit, listing_published.
810
+		 * @param string $post_id The post ID.
811
+		 * @param string $user_id The user ID.
812
+		 */
813
+		$headers = apply_filters('geodir_sendEmail_headers',$headers,$fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id );
814
+
815
+		$sent = wp_mail($to, $subject, $message, $headers);
816
+
817
+		if( ! $sent ) {
818
+			if ( is_array( $to ) ) {
819
+				$to = implode( ',', $to );
820
+			}
821
+			$log_message = sprintf(
822
+				__( "Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory' ),
823
+				$message_type,
824
+				date_i18n( 'F j Y H:i:s', current_time( 'timestamp' ) ),
825
+				$to,
826
+				$subject
827
+			);
828
+			geodir_error_log( $log_message );
829
+		}
830
+
831
+		///////// ADMIN BCC EMIALS
832
+		$adminEmail = get_bloginfo('admin_email');
833
+		$to = $adminEmail;
834
+
835
+		$admin_bcc = false;
836
+		if ($message_type == 'post_submit') {
837
+			$subject = __(stripslashes_deep(get_option('geodir_post_submited_success_email_subject_admin')), 'geodirectory');
838
+			$message = __(stripslashes_deep(get_option('geodir_post_submited_success_email_content_admin')), 'geodirectory');
839
+
840
+			$search_array = array('[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#to_name#]', '[#from_name#]', '[#subject#]', '[#comments#]', '[#login_url#]', '[#login_details#]', '[#client_name#]', '[#posted_date#]','[#user_login#]','[#username#]');
841
+			$replace_array = array($listingLink, $siteurl_link, $post_id, $sitefromEmailName, $toEmailName, $fromEmailName, $to_subject, $to_message, $loginurl_link, $login_details, $toEmailName, $posted_date, $user_login, $user_login);
842
+			$message = str_replace($search_array, $replace_array, $message);
843
+
844
+			$search_array = array('[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#to_name#]', '[#from_name#]', '[#subject#]', '[#client_name#]', '[#posted_date#]','[#user_login#]','[#username#]');
845
+			$replace_array = array($listingLink, $siteurl_link, $post_id, $sitefromEmailName, $toEmailName, $fromEmailName, $to_subject, $toEmailName, $posted_date, $user_login, $user_login);
846
+			$subject = str_replace($search_array, $replace_array, $subject);
847
+
848
+			$subject .= ' - ADMIN BCC COPY';
849
+			$admin_bcc = true;
850
+
851
+		}
852
+		elseif ($message_type == 'registration' && get_option('geodir_bcc_new_user')) {
853
+			$subject .= ' - ADMIN BCC COPY';
854
+			$admin_bcc = true;
855
+		}
856
+		elseif ($message_type == 'send_friend' && get_option('geodir_bcc_friend')) {
857
+			$subject .= ' - ADMIN BCC COPY';
858
+			$admin_bcc = true;
859
+		}
860
+		elseif ($message_type == 'send_enquiry' && get_option('geodir_bcc_enquiry')) {
861
+			$subject .= ' - ADMIN BCC COPY';
862
+			$admin_bcc = true;
863
+		}
864
+		elseif ($message_type == 'listing_published' && get_option('geodir_bcc_listing_published')) {
865
+			$subject .= ' - ADMIN BCC COPY';
866
+			$admin_bcc = true;
867
+		}
868
+
869
+		if($admin_bcc===true){
870
+			$sent = wp_mail($to, $subject, $message, $headers);
871
+
872
+			if( ! $sent ) {
873
+				if ( is_array( $to ) ) {
874
+					$to = implode( ',', $to );
875
+				}
876
+				$log_message = sprintf(
877
+					__( "Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory' ),
878
+					$message_type,
879
+					date_i18n( 'F j Y H:i:s', current_time( 'timestamp' ) ),
880
+					$to,
881
+					$subject
882
+				);
883
+				geodir_error_log( $log_message );
884
+			}
885
+		}
886
+
887
+	}
888 888
 }
889 889
 
890 890
 
@@ -897,27 +897,27 @@  discard block
 block discarded – undo
897 897
 function geodir_taxonomy_breadcrumb()
898 898
 {
899 899
 
900
-    $term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy'));
901
-    $parent = $term->parent;
900
+	$term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy'));
901
+	$parent = $term->parent;
902 902
 
903
-    while ($parent):
904
-        $parents[] = $parent;
905
-        $new_parent = get_term_by('id', $parent, get_query_var('taxonomy'));
906
-        $parent = $new_parent->parent;
907
-    endwhile;
903
+	while ($parent):
904
+		$parents[] = $parent;
905
+		$new_parent = get_term_by('id', $parent, get_query_var('taxonomy'));
906
+		$parent = $new_parent->parent;
907
+	endwhile;
908 908
 
909
-    if (!empty($parents)):
910
-        $parents = array_reverse($parents);
909
+	if (!empty($parents)):
910
+		$parents = array_reverse($parents);
911 911
 
912
-        foreach ($parents as $parent):
913
-            $item = get_term_by('id', $parent, get_query_var('taxonomy'));
914
-            $url = get_term_link($item, get_query_var('taxonomy'));
915
-            echo '<li> > <a href="' . $url . '">' . $item->name . '</a></li>';
916
-        endforeach;
912
+		foreach ($parents as $parent):
913
+			$item = get_term_by('id', $parent, get_query_var('taxonomy'));
914
+			$url = get_term_link($item, get_query_var('taxonomy'));
915
+			echo '<li> > <a href="' . $url . '">' . $item->name . '</a></li>';
916
+		endforeach;
917 917
 
918
-    endif;
918
+	endif;
919 919
 
920
-    echo '<li> > ' . $term->name . '</li>';
920
+	echo '<li> > ' . $term->name . '</li>';
921 921
 }
922 922
 
923 923
 
@@ -933,369 +933,369 @@  discard block
 block discarded – undo
933 933
  */
934 934
 function geodir_breadcrumb()
935 935
 {
936
-    global $wp_query, $geodir_add_location_url;
937
-
938
-    /**
939
-     * Filter breadcrumb separator.
940
-     *
941
-     * @since 1.0.0
942
-     */
943
-    $separator = apply_filters('geodir_breadcrumb_separator', ' > ');
944
-
945
-    if (!geodir_is_page('home')) {
946
-        $breadcrumb = '';
947
-        $url_categoris = '';
948
-        $breadcrumb .= '<div class="geodir-breadcrumb clearfix"><ul id="breadcrumbs">';
949
-        /**
950
-         * Filter breadcrumb's first link.
951
-         *
952
-         * @since 1.0.0
953
-         */
954
-        $breadcrumb .= '<li>' . apply_filters('geodir_breadcrumb_first_link', '<a href="' . home_url() . '">' . __('Home', 'geodirectory') . '</a>') . '</li>';
955
-
956
-        $gd_post_type = geodir_get_current_posttype();
957
-        $post_type_info = get_post_type_object($gd_post_type);
958
-
959
-        remove_filter('post_type_archive_link', 'geodir_get_posttype_link');
960
-
961
-        $listing_link = get_post_type_archive_link($gd_post_type);
962
-
963
-        add_filter('post_type_archive_link', 'geodir_get_posttype_link', 10, 2);
964
-        $listing_link = rtrim($listing_link, '/');
965
-        $listing_link .= '/';
966
-
967
-        $post_type_for_location_link = $listing_link;
968
-        $location_terms = geodir_get_current_location_terms('query_vars', $gd_post_type);
969
-
970
-        global $wp, $gd_session;
971
-        $location_link = $post_type_for_location_link;
972
-
973
-        if (geodir_is_page('detail') || geodir_is_page('listing')) {
974
-            global $post;
975
-            $location_manager = defined('POST_LOCATION_TABLE') ? true : false;
936
+	global $wp_query, $geodir_add_location_url;
937
+
938
+	/**
939
+	 * Filter breadcrumb separator.
940
+	 *
941
+	 * @since 1.0.0
942
+	 */
943
+	$separator = apply_filters('geodir_breadcrumb_separator', ' > ');
944
+
945
+	if (!geodir_is_page('home')) {
946
+		$breadcrumb = '';
947
+		$url_categoris = '';
948
+		$breadcrumb .= '<div class="geodir-breadcrumb clearfix"><ul id="breadcrumbs">';
949
+		/**
950
+		 * Filter breadcrumb's first link.
951
+		 *
952
+		 * @since 1.0.0
953
+		 */
954
+		$breadcrumb .= '<li>' . apply_filters('geodir_breadcrumb_first_link', '<a href="' . home_url() . '">' . __('Home', 'geodirectory') . '</a>') . '</li>';
955
+
956
+		$gd_post_type = geodir_get_current_posttype();
957
+		$post_type_info = get_post_type_object($gd_post_type);
958
+
959
+		remove_filter('post_type_archive_link', 'geodir_get_posttype_link');
960
+
961
+		$listing_link = get_post_type_archive_link($gd_post_type);
962
+
963
+		add_filter('post_type_archive_link', 'geodir_get_posttype_link', 10, 2);
964
+		$listing_link = rtrim($listing_link, '/');
965
+		$listing_link .= '/';
966
+
967
+		$post_type_for_location_link = $listing_link;
968
+		$location_terms = geodir_get_current_location_terms('query_vars', $gd_post_type);
969
+
970
+		global $wp, $gd_session;
971
+		$location_link = $post_type_for_location_link;
972
+
973
+		if (geodir_is_page('detail') || geodir_is_page('listing')) {
974
+			global $post;
975
+			$location_manager = defined('POST_LOCATION_TABLE') ? true : false;
976 976
 			$neighbourhood_active = $location_manager && get_option('location_neighbourhoods') ? true : false;
977 977
 				
978 978
 			if(geodir_is_page('detail') && isset($post->country_slug)){
979
-                $location_terms = array(
980
-                    'gd_country' => $post->country_slug,
981
-                    'gd_region' => $post->region_slug,
982
-                    'gd_city' => $post->city_slug
983
-                );
979
+				$location_terms = array(
980
+					'gd_country' => $post->country_slug,
981
+					'gd_region' => $post->region_slug,
982
+					'gd_city' => $post->city_slug
983
+				);
984 984
 				
985 985
 				if ($neighbourhood_active && !empty($location_terms['gd_city']) && $gd_ses_neighbourhood = $gd_session->get('gd_neighbourhood')) {
986 986
 					$location_terms['gd_neighbourhood'] = $gd_ses_neighbourhood;
987 987
 				}
988
-            }
989
-
990
-            $geodir_show_location_url = get_option('geodir_show_location_url');
991
-
992
-            $hide_url_part = array();
993
-            if ($location_manager) {
994
-                $hide_country_part = get_option('geodir_location_hide_country_part');
995
-                $hide_region_part = get_option('geodir_location_hide_region_part');
996
-
997
-                if ($hide_region_part && $hide_country_part) {
998
-                    $hide_url_part = array('gd_country', 'gd_region');
999
-                } else if ($hide_region_part && !$hide_country_part) {
1000
-                    $hide_url_part = array('gd_region');
1001
-                } else if (!$hide_region_part && $hide_country_part) {
1002
-                    $hide_url_part = array('gd_country');
1003
-                }
1004
-            }
1005
-
1006
-            $hide_text_part = array();
1007
-            if ($geodir_show_location_url == 'country_city') {
1008
-                $hide_text_part = array('gd_region');
1009
-
1010
-                if (isset($location_terms['gd_region']) && !$location_manager) {
1011
-                    unset($location_terms['gd_region']);
1012
-                }
1013
-            } else if ($geodir_show_location_url == 'region_city') {
1014
-                $hide_text_part = array('gd_country');
1015
-
1016
-                if (isset($location_terms['gd_country']) && !$location_manager) {
1017
-                    unset($location_terms['gd_country']);
1018
-                }
1019
-            } else if ($geodir_show_location_url == 'city') {
1020
-                $hide_text_part = array('gd_country', 'gd_region');
1021
-
1022
-                if (isset($location_terms['gd_country']) && !$location_manager) {
1023
-                    unset($location_terms['gd_country']);
1024
-                }
1025
-                if (isset($location_terms['gd_region']) && !$location_manager) {
1026
-                    unset($location_terms['gd_region']);
1027
-                }
1028
-            }
1029
-
1030
-            $is_location_last = '';
1031
-            $is_taxonomy_last = '';
1032
-            $breadcrumb .= '<li>';
1033
-            if (get_query_var($gd_post_type . 'category'))
1034
-                $gd_taxonomy = $gd_post_type . 'category';
1035
-            elseif (get_query_var($gd_post_type . '_tags'))
1036
-                $gd_taxonomy = $gd_post_type . '_tags';
1037
-
1038
-            $breadcrumb .= $separator . '<a href="' . $listing_link . '">' . __(ucfirst($post_type_info->label), 'geodirectory') . '</a>';
1039
-            if (!empty($gd_taxonomy) || geodir_is_page('detail'))
1040
-                $is_location_last = false;
1041
-            else
1042
-                $is_location_last = true;
1043
-
1044
-            if (!empty($gd_taxonomy) && geodir_is_page('listing'))
1045
-                $is_taxonomy_last = true;
1046
-            else
1047
-                $is_taxonomy_last = false;
1048
-
1049
-            if (!empty($location_terms)) {
1050
-                $geodir_get_locations = function_exists('get_actual_location_name') ? true : false;
1051
-
1052
-                foreach ($location_terms as $key => $location_term) {
1053
-                    if ($location_term != '') {
1054
-                        if (!empty($hide_url_part) && in_array($key, $hide_url_part)) { // Hide location part from url & breadcrumb.
1055
-                            continue;
1056
-                        }
988
+			}
1057 989
 
1058
-                        $gd_location_link_text = preg_replace('/-(\d+)$/', '', $location_term);
1059
-                        $gd_location_link_text = preg_replace('/[_-]/', ' ', $gd_location_link_text);
1060
-                        $gd_location_link_text = ucfirst($gd_location_link_text);
1061
-
1062
-                        $location_term_actual_country = '';
1063
-                        $location_term_actual_region = '';
1064
-                        $location_term_actual_city = '';
1065
-                        if ($geodir_get_locations) {
1066
-                            if ($key == 'gd_country') {
1067
-                                $location_term_actual_country = get_actual_location_name('country', $location_term, true);
1068
-                            } else if ($key == 'gd_region') {
1069
-                                $location_term_actual_region = get_actual_location_name('region', $location_term, true);
1070
-                            } else if ($key == 'gd_city') {
1071
-                                $location_term_actual_city = get_actual_location_name('city', $location_term, true);
1072
-                            }
1073
-                        } else {
1074
-                            $location_info = geodir_get_location();
1075
-
1076
-                            if (!empty($location_info) && isset($location_info->location_id)) {
1077
-                                if ($key == 'gd_country') {
1078
-                                    $location_term_actual_country = __($location_info->country, 'geodirectory');
1079
-                                } else if ($key == 'gd_region') {
1080
-                                    $location_term_actual_region = __($location_info->region, 'geodirectory');
1081
-                                } else if ($key == 'gd_city') {
1082
-                                    $location_term_actual_city = __($location_info->city, 'geodirectory');
1083
-                                }
1084
-                            }
1085
-                        }
990
+			$geodir_show_location_url = get_option('geodir_show_location_url');
1086 991
 
1087
-                        if ($is_location_last && $key == 'gd_country' && !(isset($location_terms['gd_region']) && $location_terms['gd_region'] != '') && !(isset($location_terms['gd_city']) && $location_terms['gd_city'] != '')) {
1088
-                            $breadcrumb .= $location_term_actual_country != '' ? $separator . $location_term_actual_country : $separator . $gd_location_link_text;
1089
-                        } else if ($is_location_last && $key == 'gd_region' && !(isset($location_terms['gd_city']) && $location_terms['gd_city'] != '')) {
1090
-                            $breadcrumb .= $location_term_actual_region != '' ? $separator . $location_term_actual_region : $separator . $gd_location_link_text;
1091
-                        } else if ($is_location_last && $key == 'gd_city' && empty($location_terms['gd_neighbourhood'])) {
1092
-                            $breadcrumb .= $location_term_actual_city != '' ? $separator . $location_term_actual_city : $separator . $gd_location_link_text;
1093
-                        } else if ($is_location_last && $key == 'gd_neighbourhood') {
1094
-                            $breadcrumb .= $separator . $gd_location_link_text;
1095
-                        } else {
1096
-                            if (get_option('permalink_structure') != '') {
1097
-                                $location_link .= $location_term . '/';
1098
-                            } else {
1099
-                                $location_link .= "&$key=" . $location_term;
1100
-                            }
992
+			$hide_url_part = array();
993
+			if ($location_manager) {
994
+				$hide_country_part = get_option('geodir_location_hide_country_part');
995
+				$hide_region_part = get_option('geodir_location_hide_region_part');
1101 996
 
1102
-                            if ($key == 'gd_country' && $location_term_actual_country != '') {
1103
-                                $gd_location_link_text = $location_term_actual_country;
1104
-                            } else if ($key == 'gd_region' && $location_term_actual_region != '') {
1105
-                                $gd_location_link_text = $location_term_actual_region;
1106
-                            } else if ($key == 'gd_city' && $location_term_actual_city != '') {
1107
-                                $gd_location_link_text = $location_term_actual_city;
1108
-                            }
997
+				if ($hide_region_part && $hide_country_part) {
998
+					$hide_url_part = array('gd_country', 'gd_region');
999
+				} else if ($hide_region_part && !$hide_country_part) {
1000
+					$hide_url_part = array('gd_region');
1001
+				} else if (!$hide_region_part && $hide_country_part) {
1002
+					$hide_url_part = array('gd_country');
1003
+				}
1004
+			}
1005
+
1006
+			$hide_text_part = array();
1007
+			if ($geodir_show_location_url == 'country_city') {
1008
+				$hide_text_part = array('gd_region');
1009
+
1010
+				if (isset($location_terms['gd_region']) && !$location_manager) {
1011
+					unset($location_terms['gd_region']);
1012
+				}
1013
+			} else if ($geodir_show_location_url == 'region_city') {
1014
+				$hide_text_part = array('gd_country');
1015
+
1016
+				if (isset($location_terms['gd_country']) && !$location_manager) {
1017
+					unset($location_terms['gd_country']);
1018
+				}
1019
+			} else if ($geodir_show_location_url == 'city') {
1020
+				$hide_text_part = array('gd_country', 'gd_region');
1021
+
1022
+				if (isset($location_terms['gd_country']) && !$location_manager) {
1023
+					unset($location_terms['gd_country']);
1024
+				}
1025
+				if (isset($location_terms['gd_region']) && !$location_manager) {
1026
+					unset($location_terms['gd_region']);
1027
+				}
1028
+			}
1109 1029
 
1110
-                            /*
1030
+			$is_location_last = '';
1031
+			$is_taxonomy_last = '';
1032
+			$breadcrumb .= '<li>';
1033
+			if (get_query_var($gd_post_type . 'category'))
1034
+				$gd_taxonomy = $gd_post_type . 'category';
1035
+			elseif (get_query_var($gd_post_type . '_tags'))
1036
+				$gd_taxonomy = $gd_post_type . '_tags';
1037
+
1038
+			$breadcrumb .= $separator . '<a href="' . $listing_link . '">' . __(ucfirst($post_type_info->label), 'geodirectory') . '</a>';
1039
+			if (!empty($gd_taxonomy) || geodir_is_page('detail'))
1040
+				$is_location_last = false;
1041
+			else
1042
+				$is_location_last = true;
1043
+
1044
+			if (!empty($gd_taxonomy) && geodir_is_page('listing'))
1045
+				$is_taxonomy_last = true;
1046
+			else
1047
+				$is_taxonomy_last = false;
1048
+
1049
+			if (!empty($location_terms)) {
1050
+				$geodir_get_locations = function_exists('get_actual_location_name') ? true : false;
1051
+
1052
+				foreach ($location_terms as $key => $location_term) {
1053
+					if ($location_term != '') {
1054
+						if (!empty($hide_url_part) && in_array($key, $hide_url_part)) { // Hide location part from url & breadcrumb.
1055
+							continue;
1056
+						}
1057
+
1058
+						$gd_location_link_text = preg_replace('/-(\d+)$/', '', $location_term);
1059
+						$gd_location_link_text = preg_replace('/[_-]/', ' ', $gd_location_link_text);
1060
+						$gd_location_link_text = ucfirst($gd_location_link_text);
1061
+
1062
+						$location_term_actual_country = '';
1063
+						$location_term_actual_region = '';
1064
+						$location_term_actual_city = '';
1065
+						if ($geodir_get_locations) {
1066
+							if ($key == 'gd_country') {
1067
+								$location_term_actual_country = get_actual_location_name('country', $location_term, true);
1068
+							} else if ($key == 'gd_region') {
1069
+								$location_term_actual_region = get_actual_location_name('region', $location_term, true);
1070
+							} else if ($key == 'gd_city') {
1071
+								$location_term_actual_city = get_actual_location_name('city', $location_term, true);
1072
+							}
1073
+						} else {
1074
+							$location_info = geodir_get_location();
1075
+
1076
+							if (!empty($location_info) && isset($location_info->location_id)) {
1077
+								if ($key == 'gd_country') {
1078
+									$location_term_actual_country = __($location_info->country, 'geodirectory');
1079
+								} else if ($key == 'gd_region') {
1080
+									$location_term_actual_region = __($location_info->region, 'geodirectory');
1081
+								} else if ($key == 'gd_city') {
1082
+									$location_term_actual_city = __($location_info->city, 'geodirectory');
1083
+								}
1084
+							}
1085
+						}
1086
+
1087
+						if ($is_location_last && $key == 'gd_country' && !(isset($location_terms['gd_region']) && $location_terms['gd_region'] != '') && !(isset($location_terms['gd_city']) && $location_terms['gd_city'] != '')) {
1088
+							$breadcrumb .= $location_term_actual_country != '' ? $separator . $location_term_actual_country : $separator . $gd_location_link_text;
1089
+						} else if ($is_location_last && $key == 'gd_region' && !(isset($location_terms['gd_city']) && $location_terms['gd_city'] != '')) {
1090
+							$breadcrumb .= $location_term_actual_region != '' ? $separator . $location_term_actual_region : $separator . $gd_location_link_text;
1091
+						} else if ($is_location_last && $key == 'gd_city' && empty($location_terms['gd_neighbourhood'])) {
1092
+							$breadcrumb .= $location_term_actual_city != '' ? $separator . $location_term_actual_city : $separator . $gd_location_link_text;
1093
+						} else if ($is_location_last && $key == 'gd_neighbourhood') {
1094
+							$breadcrumb .= $separator . $gd_location_link_text;
1095
+						} else {
1096
+							if (get_option('permalink_structure') != '') {
1097
+								$location_link .= $location_term . '/';
1098
+							} else {
1099
+								$location_link .= "&$key=" . $location_term;
1100
+							}
1101
+
1102
+							if ($key == 'gd_country' && $location_term_actual_country != '') {
1103
+								$gd_location_link_text = $location_term_actual_country;
1104
+							} else if ($key == 'gd_region' && $location_term_actual_region != '') {
1105
+								$gd_location_link_text = $location_term_actual_region;
1106
+							} else if ($key == 'gd_city' && $location_term_actual_city != '') {
1107
+								$gd_location_link_text = $location_term_actual_city;
1108
+							}
1109
+
1110
+							/*
1111 1111
                             if (geodir_is_page('detail') && !empty($hide_text_part) && in_array($key, $hide_text_part)) {
1112 1112
                                 continue;
1113 1113
                             }
1114 1114
                             */
1115 1115
 
1116
-                            $breadcrumb .= $separator . '<a href="' . $location_link . '">' . $gd_location_link_text . '</a>';
1117
-                        }
1118
-                    }
1119
-                }
1120
-            }
1121
-
1122
-            if (!empty($gd_taxonomy)) {
1123
-                $term_index = 1;
1124
-
1125
-                //if(get_option('geodir_add_categories_url'))
1126
-                {
1127
-                    if (get_query_var($gd_post_type . '_tags')) {
1128
-                        $cat_link = $listing_link . 'tags/';
1129
-                    } else
1130
-                        $cat_link = $listing_link;
1131
-
1132
-                    foreach ($location_terms as $key => $location_term) {
1133
-                        if ($location_manager && in_array($key, $hide_url_part)) {
1134
-                            continue;
1135
-                        }
1116
+							$breadcrumb .= $separator . '<a href="' . $location_link . '">' . $gd_location_link_text . '</a>';
1117
+						}
1118
+					}
1119
+				}
1120
+			}
1136 1121
 
1137
-                        if ($location_term != '') {
1138
-                            if (get_option('permalink_structure') != '') {
1139
-                                $cat_link .= $location_term . '/';
1140
-                            }
1141
-                        }
1142
-                    }
1143
-
1144
-                    $term_array = explode("/", trim($wp_query->query[$gd_taxonomy], "/"));
1145
-                    foreach ($term_array as $term) {
1146
-                        $term_link_text = preg_replace('/-(\d+)$/', '', $term);
1147
-                        $term_link_text = preg_replace('/[_-]/', ' ', $term_link_text);
1148
-
1149
-                        // get term actual name
1150
-                        $term_info = get_term_by('slug', $term, $gd_taxonomy, 'ARRAY_A');
1151
-                        if (!empty($term_info) && isset($term_info['name']) && $term_info['name'] != '') {
1152
-                            $term_link_text = urldecode($term_info['name']);
1153
-                        } else {
1154
-                            $term_link_text = geodir_ucwords(urldecode($term_link_text));
1155
-                        }
1122
+			if (!empty($gd_taxonomy)) {
1123
+				$term_index = 1;
1156 1124
 
1157
-                        if ($term_index == count($term_array) && $is_taxonomy_last)
1158
-                            $breadcrumb .= $separator . $term_link_text;
1159
-                        else {
1160
-                            $cat_link .= $term . '/';
1161
-                            $breadcrumb .= $separator . '<a href="' . $cat_link . '">' . $term_link_text . '</a>';
1162
-                        }
1163
-                        $term_index++;
1164
-                    }
1165
-                }
1166
-
1167
-
1168
-            }
1169
-
1170
-            if (geodir_is_page('detail'))
1171
-                $breadcrumb .= $separator . get_the_title();
1172
-
1173
-            $breadcrumb .= '</li>';
1174
-
1175
-
1176
-        } elseif (geodir_is_page('author')) {
1177
-            $user_id = get_current_user_id();
1178
-            $author_link = get_author_posts_url($user_id);
1179
-            $default_author_link = geodir_getlink($author_link, array('geodir_dashbord' => 'true', 'stype' => 'gd_place'), false);
1180
-
1181
-            /**
1182
-             * Filter author page link.
1183
-             *
1184
-             * @since 1.0.0
1185
-             * @param string $default_author_link Default author link.
1186
-             * @param int $user_id Author ID.
1187
-             */
1188
-            $default_author_link = apply_filters('geodir_dashboard_author_link', $default_author_link, $user_id);
1189
-
1190
-            $breadcrumb .= '<li>';
1191
-            $breadcrumb .= $separator . '<a href="' . $default_author_link . '">' . __('My Dashboard', 'geodirectory') . '</a>';
1192
-
1193
-            if (isset($_REQUEST['list'])) {
1194
-                $author_link = geodir_getlink($author_link, array('geodir_dashbord' => 'true', 'stype' => $_REQUEST['stype']), false);
1195
-
1196
-                /**
1197
-                 * Filter author page link.
1198
-                 *
1199
-                 * @since 1.0.0
1200
-                 * @param string $author_link Author page link.
1201
-                 * @param int $user_id Author ID.
1202
-                 * @param string $_REQUEST['stype'] Post type.
1203
-                 */
1204
-                $author_link = apply_filters('geodir_dashboard_author_link', $author_link, $user_id, $_REQUEST['stype']);
1205
-
1206
-                $breadcrumb .= $separator . '<a href="' . $author_link . '">' . __(ucfirst($post_type_info->label), 'geodirectory') . '</a>';
1207
-                $breadcrumb .= $separator . ucfirst(__('My', 'geodirectory') . ' ' . $_REQUEST['list']);
1208
-            } else
1209
-                $breadcrumb .= $separator . __(ucfirst($post_type_info->label), 'geodirectory');
1210
-
1211
-            $breadcrumb .= '</li>';
1212
-        } elseif (is_category() || is_single()) {
1213
-            $category = get_the_category();
1214
-            if (is_category()) {
1215
-                $breadcrumb .= '<li>' . $separator . $category[0]->cat_name . '</li>';
1216
-            }
1217
-            if (is_single()) {
1218
-                $breadcrumb .= '<li>' . $separator . '<a href="' . get_category_link($category[0]->term_id) . '">' . $category[0]->cat_name . '</a></li>';
1219
-                $breadcrumb .= '<li>' . $separator . get_the_title() . '</li>';
1220
-            }
1221
-            /* End of my version ##################################################### */
1222
-        } else if (is_page()) {
1223
-            $page_title = get_the_title();
1224
-
1225
-            if (geodir_is_page('location')) {
1226
-                $location_page_id = geodir_location_page_id();
1227
-                $loc_post = get_post( $location_page_id );
1228
-                $post_name = $loc_post->post_name;
1229
-                $slug= ucwords(str_replace('-',' ',$post_name));
1230
-                $page_title = !empty($slug )? $slug : __('Location', 'geodirectory');
1231
-            }
1232
-
1233
-            $breadcrumb .= '<li>' . $separator;
1234
-            $breadcrumb .= stripslashes_deep($page_title);
1235
-            $breadcrumb .= '</li>';
1236
-        } else if (is_tag()) {
1237
-            $breadcrumb .=  "<li> " . $separator . single_tag_title('',false) . '</li>';
1238
-        } else if (is_day()) {
1239
-            $breadcrumb .= "<li> " . $separator . __(" Archive for", 'geodirectory') . " ";
1240
-            the_time('F jS, Y');
1241
-            $breadcrumb .= '</li>';
1242
-        } else if (is_month()) {
1243
-            $breadcrumb .= "<li> " . $separator . __(" Archive for", 'geodirectory') . " ";
1244
-            the_time('F, Y');
1245
-            $breadcrumb .= '</li>';
1246
-        } else if (is_year()) {
1247
-            $breadcrumb .= "<li> " . $separator . __(" Archive for", 'geodirectory') . " ";
1248
-            the_time('Y');
1249
-            $breadcrumb .= '</li>';
1250
-        } else if (is_author()) {
1251
-            $breadcrumb .= "<li> " . $separator . __(" Author Archive", 'geodirectory');
1252
-            $breadcrumb .= '</li>';
1253
-        } else if (isset($_GET['paged']) && !empty($_GET['paged'])) {
1254
-            $breadcrumb .= "<li>" . $separator . __("Blog Archives", 'geodirectory');
1255
-            $breadcrumb .= '</li>';
1256
-        } else if (is_search()) {
1257
-            $breadcrumb .= "<li> " . $separator . __(" Search Results", 'geodirectory');
1258
-            $breadcrumb .= '</li>';
1259
-        }
1260
-        $breadcrumb .= '</ul></div>';
1261
-
1262
-        /**
1263
-         * Filter breadcrumb html output.
1264
-         *
1265
-         * @since 1.0.0
1266
-         * @param string $breadcrumb Breadcrumb HTML.
1267
-         * @param string $separator Breadcrumb separator.
1268
-         */
1269
-        echo $breadcrumb = apply_filters('geodir_breadcrumb', $breadcrumb, $separator);
1270
-    }
1125
+				//if(get_option('geodir_add_categories_url'))
1126
+				{
1127
+					if (get_query_var($gd_post_type . '_tags')) {
1128
+						$cat_link = $listing_link . 'tags/';
1129
+					} else
1130
+						$cat_link = $listing_link;
1131
+
1132
+					foreach ($location_terms as $key => $location_term) {
1133
+						if ($location_manager && in_array($key, $hide_url_part)) {
1134
+							continue;
1135
+						}
1136
+
1137
+						if ($location_term != '') {
1138
+							if (get_option('permalink_structure') != '') {
1139
+								$cat_link .= $location_term . '/';
1140
+							}
1141
+						}
1142
+					}
1143
+
1144
+					$term_array = explode("/", trim($wp_query->query[$gd_taxonomy], "/"));
1145
+					foreach ($term_array as $term) {
1146
+						$term_link_text = preg_replace('/-(\d+)$/', '', $term);
1147
+						$term_link_text = preg_replace('/[_-]/', ' ', $term_link_text);
1148
+
1149
+						// get term actual name
1150
+						$term_info = get_term_by('slug', $term, $gd_taxonomy, 'ARRAY_A');
1151
+						if (!empty($term_info) && isset($term_info['name']) && $term_info['name'] != '') {
1152
+							$term_link_text = urldecode($term_info['name']);
1153
+						} else {
1154
+							$term_link_text = geodir_ucwords(urldecode($term_link_text));
1155
+						}
1156
+
1157
+						if ($term_index == count($term_array) && $is_taxonomy_last)
1158
+							$breadcrumb .= $separator . $term_link_text;
1159
+						else {
1160
+							$cat_link .= $term . '/';
1161
+							$breadcrumb .= $separator . '<a href="' . $cat_link . '">' . $term_link_text . '</a>';
1162
+						}
1163
+						$term_index++;
1164
+					}
1165
+				}
1166
+
1167
+
1168
+			}
1169
+
1170
+			if (geodir_is_page('detail'))
1171
+				$breadcrumb .= $separator . get_the_title();
1172
+
1173
+			$breadcrumb .= '</li>';
1174
+
1175
+
1176
+		} elseif (geodir_is_page('author')) {
1177
+			$user_id = get_current_user_id();
1178
+			$author_link = get_author_posts_url($user_id);
1179
+			$default_author_link = geodir_getlink($author_link, array('geodir_dashbord' => 'true', 'stype' => 'gd_place'), false);
1180
+
1181
+			/**
1182
+			 * Filter author page link.
1183
+			 *
1184
+			 * @since 1.0.0
1185
+			 * @param string $default_author_link Default author link.
1186
+			 * @param int $user_id Author ID.
1187
+			 */
1188
+			$default_author_link = apply_filters('geodir_dashboard_author_link', $default_author_link, $user_id);
1189
+
1190
+			$breadcrumb .= '<li>';
1191
+			$breadcrumb .= $separator . '<a href="' . $default_author_link . '">' . __('My Dashboard', 'geodirectory') . '</a>';
1192
+
1193
+			if (isset($_REQUEST['list'])) {
1194
+				$author_link = geodir_getlink($author_link, array('geodir_dashbord' => 'true', 'stype' => $_REQUEST['stype']), false);
1195
+
1196
+				/**
1197
+				 * Filter author page link.
1198
+				 *
1199
+				 * @since 1.0.0
1200
+				 * @param string $author_link Author page link.
1201
+				 * @param int $user_id Author ID.
1202
+				 * @param string $_REQUEST['stype'] Post type.
1203
+				 */
1204
+				$author_link = apply_filters('geodir_dashboard_author_link', $author_link, $user_id, $_REQUEST['stype']);
1205
+
1206
+				$breadcrumb .= $separator . '<a href="' . $author_link . '">' . __(ucfirst($post_type_info->label), 'geodirectory') . '</a>';
1207
+				$breadcrumb .= $separator . ucfirst(__('My', 'geodirectory') . ' ' . $_REQUEST['list']);
1208
+			} else
1209
+				$breadcrumb .= $separator . __(ucfirst($post_type_info->label), 'geodirectory');
1210
+
1211
+			$breadcrumb .= '</li>';
1212
+		} elseif (is_category() || is_single()) {
1213
+			$category = get_the_category();
1214
+			if (is_category()) {
1215
+				$breadcrumb .= '<li>' . $separator . $category[0]->cat_name . '</li>';
1216
+			}
1217
+			if (is_single()) {
1218
+				$breadcrumb .= '<li>' . $separator . '<a href="' . get_category_link($category[0]->term_id) . '">' . $category[0]->cat_name . '</a></li>';
1219
+				$breadcrumb .= '<li>' . $separator . get_the_title() . '</li>';
1220
+			}
1221
+			/* End of my version ##################################################### */
1222
+		} else if (is_page()) {
1223
+			$page_title = get_the_title();
1224
+
1225
+			if (geodir_is_page('location')) {
1226
+				$location_page_id = geodir_location_page_id();
1227
+				$loc_post = get_post( $location_page_id );
1228
+				$post_name = $loc_post->post_name;
1229
+				$slug= ucwords(str_replace('-',' ',$post_name));
1230
+				$page_title = !empty($slug )? $slug : __('Location', 'geodirectory');
1231
+			}
1232
+
1233
+			$breadcrumb .= '<li>' . $separator;
1234
+			$breadcrumb .= stripslashes_deep($page_title);
1235
+			$breadcrumb .= '</li>';
1236
+		} else if (is_tag()) {
1237
+			$breadcrumb .=  "<li> " . $separator . single_tag_title('',false) . '</li>';
1238
+		} else if (is_day()) {
1239
+			$breadcrumb .= "<li> " . $separator . __(" Archive for", 'geodirectory') . " ";
1240
+			the_time('F jS, Y');
1241
+			$breadcrumb .= '</li>';
1242
+		} else if (is_month()) {
1243
+			$breadcrumb .= "<li> " . $separator . __(" Archive for", 'geodirectory') . " ";
1244
+			the_time('F, Y');
1245
+			$breadcrumb .= '</li>';
1246
+		} else if (is_year()) {
1247
+			$breadcrumb .= "<li> " . $separator . __(" Archive for", 'geodirectory') . " ";
1248
+			the_time('Y');
1249
+			$breadcrumb .= '</li>';
1250
+		} else if (is_author()) {
1251
+			$breadcrumb .= "<li> " . $separator . __(" Author Archive", 'geodirectory');
1252
+			$breadcrumb .= '</li>';
1253
+		} else if (isset($_GET['paged']) && !empty($_GET['paged'])) {
1254
+			$breadcrumb .= "<li>" . $separator . __("Blog Archives", 'geodirectory');
1255
+			$breadcrumb .= '</li>';
1256
+		} else if (is_search()) {
1257
+			$breadcrumb .= "<li> " . $separator . __(" Search Results", 'geodirectory');
1258
+			$breadcrumb .= '</li>';
1259
+		}
1260
+		$breadcrumb .= '</ul></div>';
1261
+
1262
+		/**
1263
+		 * Filter breadcrumb html output.
1264
+		 *
1265
+		 * @since 1.0.0
1266
+		 * @param string $breadcrumb Breadcrumb HTML.
1267
+		 * @param string $separator Breadcrumb separator.
1268
+		 */
1269
+		echo $breadcrumb = apply_filters('geodir_breadcrumb', $breadcrumb, $separator);
1270
+	}
1271 1271
 }
1272 1272
 
1273 1273
 
1274 1274
 add_action("admin_init", "geodir_allow_wpadmin"); // check user is admin
1275 1275
 if (!function_exists('geodir_allow_wpadmin')) {
1276
-    /**
1277
-     * Allow only admins to access wp-admin.
1278
-     *
1279
-     * Normal users will be redirected to home page.
1280
-     *
1281
-     * @since 1.0.0
1282
-     * @package GeoDirectory
1283
-     * @global object $wpdb WordPress Database object.
1284
-     */
1285
-    function geodir_allow_wpadmin()
1286
-    {
1287
-        global $wpdb;
1288
-        if (get_option('geodir_allow_wpadmin') == '0' && is_user_logged_in() && (!isset($_REQUEST['action']))) // checking action in request to allow ajax request go through
1289
-        {
1290
-            if (current_user_can('manage_options')) {
1291
-            } else {
1292
-
1293
-                wp_redirect(home_url());
1294
-                exit;
1295
-            }
1296
-
1297
-        }
1298
-    }
1276
+	/**
1277
+	 * Allow only admins to access wp-admin.
1278
+	 *
1279
+	 * Normal users will be redirected to home page.
1280
+	 *
1281
+	 * @since 1.0.0
1282
+	 * @package GeoDirectory
1283
+	 * @global object $wpdb WordPress Database object.
1284
+	 */
1285
+	function geodir_allow_wpadmin()
1286
+	{
1287
+		global $wpdb;
1288
+		if (get_option('geodir_allow_wpadmin') == '0' && is_user_logged_in() && (!isset($_REQUEST['action']))) // checking action in request to allow ajax request go through
1289
+		{
1290
+			if (current_user_can('manage_options')) {
1291
+			} else {
1292
+
1293
+				wp_redirect(home_url());
1294
+				exit;
1295
+			}
1296
+
1297
+		}
1298
+	}
1299 1299
 }
1300 1300
 
1301 1301
 
@@ -1309,84 +1309,84 @@  discard block
 block discarded – undo
1309 1309
  */
1310 1310
 function fetch_remote_file($url)
1311 1311
 {
1312
-    // extract the file name and extension from the url
1313
-    require_once(ABSPATH . 'wp-includes/pluggable.php');
1314
-    $file_name = basename($url);
1315
-    if (strpos($file_name, '?') !== false) {
1316
-        list($file_name) = explode('?', $file_name);
1317
-    }
1318
-    $dummy = false;
1319
-    $add_to_cache = false;
1320
-    $key = null;
1321
-    if (strpos($url, '/dummy/') !== false) {
1322
-        $dummy = true;
1323
-        $key = "dummy_".str_replace('.', '_', $file_name);
1324
-        $value = get_transient('cached_dummy_images');
1325
-        if ($value) {
1326
-            if (isset($value[$key])) {
1327
-                return $value[$key];
1328
-            } else {
1329
-                $add_to_cache = true;
1330
-            }
1331
-        } else {
1332
-            $add_to_cache = true;
1333
-        }
1334
-    }
1335
-
1336
-    // get placeholder file in the upload dir with a unique, sanitized filename
1337
-
1338
-    $post_upload_date = isset($post['upload_date']) ? $post['upload_date'] : '';
1339
-
1340
-    $upload = wp_upload_bits($file_name, 0, '', $post_upload_date);
1341
-    if ($upload['error'])
1342
-        return new WP_Error('upload_dir_error', $upload['error']);
1343
-
1344
-
1345
-    sleep(0.3);// if multiple remote file this can cause the remote server to timeout so we add a slight delay
1346
-
1347
-    // fetch the remote url and write it to the placeholder file
1348
-    $headers = wp_remote_get($url, array('stream' => true,'filename' => $upload['file']));
1349
-
1350
-    $log_message = '';
1351
-    if( is_wp_error( $headers  ) ) {
1352
-        echo 'file: '.$url;
1353
-        return new WP_Error('import_file_error',$headers->get_error_message());
1354
-    }
1355
-
1356
-    $filesize = filesize($upload['file']);
1357
-    // request failed
1358
-    if (!$headers) {
1359
-        $log_message = __('Remote server did not respond', 'geodirectory');
1360
-    }
1361
-    // make sure the fetch was successful
1362
-    elseif ($headers['response']['code'] != '200') {
1363
-        $log_message = sprintf(__('Remote server returned error response %1$d %2$s', 'geodirectory'), esc_html($headers['response']), get_status_header_desc($headers['response']));
1364
-    }
1365
-    elseif (isset($headers['headers']['content-length']) && $filesize != $headers['headers']['content-length']) {
1366
-        $log_message =  __('Remote file is incorrect size', 'geodirectory');
1367
-    }
1368
-    elseif (0 == $filesize) {
1369
-        $log_message = __('Zero size file downloaded', 'geodirectory');
1370
-    }
1371
-
1372
-    if($log_message){
1373
-        $del = unlink($upload['file']);
1374
-        if(!$del){geodir_error_log(__('GeoDirectory: fetch_remote_file() failed to delete temp file.', 'geodirectory'));}
1375
-        return new WP_Error('import_file_error',$log_message );
1376
-    }
1377
-
1378
-    if ($dummy && $add_to_cache && is_array($upload)) {
1379
-        $images = get_transient('cached_dummy_images');
1380
-        if(is_array($images))
1381
-            $images[$key] = $upload;
1382
-        else
1383
-            $images = array($key => $upload);
1384
-
1385
-        //setting the cache using the WP Transient API
1386
-        set_transient('cached_dummy_images', $images, 60 * 10); //10 minutes cache
1387
-    }
1388
-
1389
-    return $upload;
1312
+	// extract the file name and extension from the url
1313
+	require_once(ABSPATH . 'wp-includes/pluggable.php');
1314
+	$file_name = basename($url);
1315
+	if (strpos($file_name, '?') !== false) {
1316
+		list($file_name) = explode('?', $file_name);
1317
+	}
1318
+	$dummy = false;
1319
+	$add_to_cache = false;
1320
+	$key = null;
1321
+	if (strpos($url, '/dummy/') !== false) {
1322
+		$dummy = true;
1323
+		$key = "dummy_".str_replace('.', '_', $file_name);
1324
+		$value = get_transient('cached_dummy_images');
1325
+		if ($value) {
1326
+			if (isset($value[$key])) {
1327
+				return $value[$key];
1328
+			} else {
1329
+				$add_to_cache = true;
1330
+			}
1331
+		} else {
1332
+			$add_to_cache = true;
1333
+		}
1334
+	}
1335
+
1336
+	// get placeholder file in the upload dir with a unique, sanitized filename
1337
+
1338
+	$post_upload_date = isset($post['upload_date']) ? $post['upload_date'] : '';
1339
+
1340
+	$upload = wp_upload_bits($file_name, 0, '', $post_upload_date);
1341
+	if ($upload['error'])
1342
+		return new WP_Error('upload_dir_error', $upload['error']);
1343
+
1344
+
1345
+	sleep(0.3);// if multiple remote file this can cause the remote server to timeout so we add a slight delay
1346
+
1347
+	// fetch the remote url and write it to the placeholder file
1348
+	$headers = wp_remote_get($url, array('stream' => true,'filename' => $upload['file']));
1349
+
1350
+	$log_message = '';
1351
+	if( is_wp_error( $headers  ) ) {
1352
+		echo 'file: '.$url;
1353
+		return new WP_Error('import_file_error',$headers->get_error_message());
1354
+	}
1355
+
1356
+	$filesize = filesize($upload['file']);
1357
+	// request failed
1358
+	if (!$headers) {
1359
+		$log_message = __('Remote server did not respond', 'geodirectory');
1360
+	}
1361
+	// make sure the fetch was successful
1362
+	elseif ($headers['response']['code'] != '200') {
1363
+		$log_message = sprintf(__('Remote server returned error response %1$d %2$s', 'geodirectory'), esc_html($headers['response']), get_status_header_desc($headers['response']));
1364
+	}
1365
+	elseif (isset($headers['headers']['content-length']) && $filesize != $headers['headers']['content-length']) {
1366
+		$log_message =  __('Remote file is incorrect size', 'geodirectory');
1367
+	}
1368
+	elseif (0 == $filesize) {
1369
+		$log_message = __('Zero size file downloaded', 'geodirectory');
1370
+	}
1371
+
1372
+	if($log_message){
1373
+		$del = unlink($upload['file']);
1374
+		if(!$del){geodir_error_log(__('GeoDirectory: fetch_remote_file() failed to delete temp file.', 'geodirectory'));}
1375
+		return new WP_Error('import_file_error',$log_message );
1376
+	}
1377
+
1378
+	if ($dummy && $add_to_cache && is_array($upload)) {
1379
+		$images = get_transient('cached_dummy_images');
1380
+		if(is_array($images))
1381
+			$images[$key] = $upload;
1382
+		else
1383
+			$images = array($key => $upload);
1384
+
1385
+		//setting the cache using the WP Transient API
1386
+		set_transient('cached_dummy_images', $images, 60 * 10); //10 minutes cache
1387
+	}
1388
+
1389
+	return $upload;
1390 1390
 }
1391 1391
 
1392 1392
 /**
@@ -1398,21 +1398,21 @@  discard block
 block discarded – undo
1398 1398
  */
1399 1399
 function geodir_max_upload_size()
1400 1400
 {
1401
-    $max_filesize = (float)get_option('geodir_upload_max_filesize', 2);
1402
-
1403
-    if ($max_filesize > 0 && $max_filesize < 1) {
1404
-        $max_filesize = (int)($max_filesize * 1024) . 'kb';
1405
-    } else {
1406
-        $max_filesize = $max_filesize > 0 ? $max_filesize . 'mb' : '2mb';
1407
-    }
1408
-
1409
-    /**
1410
-     * Filter default image upload size limit.
1411
-     *
1412
-     * @since 1.0.0
1413
-     * @param string $max_filesize Max file upload size. Ex. 10mb, 512kb.
1414
-     */
1415
-    return apply_filters('geodir_default_image_upload_size_limit', $max_filesize);
1401
+	$max_filesize = (float)get_option('geodir_upload_max_filesize', 2);
1402
+
1403
+	if ($max_filesize > 0 && $max_filesize < 1) {
1404
+		$max_filesize = (int)($max_filesize * 1024) . 'kb';
1405
+	} else {
1406
+		$max_filesize = $max_filesize > 0 ? $max_filesize . 'mb' : '2mb';
1407
+	}
1408
+
1409
+	/**
1410
+	 * Filter default image upload size limit.
1411
+	 *
1412
+	 * @since 1.0.0
1413
+	 * @param string $max_filesize Max file upload size. Ex. 10mb, 512kb.
1414
+	 */
1415
+	return apply_filters('geodir_default_image_upload_size_limit', $max_filesize);
1416 1416
 }
1417 1417
 
1418 1418
 /**
@@ -1426,11 +1426,11 @@  discard block
 block discarded – undo
1426 1426
  */
1427 1427
 function geodir_dummy_folder_exists()
1428 1428
 {
1429
-    $path = geodir_plugin_path() . '/geodirectory-admin/dummy/';
1430
-    if (!is_dir($path))
1431
-        return false;
1432
-    else
1433
-        return true;
1429
+	$path = geodir_plugin_path() . '/geodirectory-admin/dummy/';
1430
+	if (!is_dir($path))
1431
+		return false;
1432
+	else
1433
+		return true;
1434 1434
 
1435 1435
 }
1436 1436
 
@@ -1445,290 +1445,290 @@  discard block
 block discarded – undo
1445 1445
  */
1446 1446
 function  geodir_get_author_info($aid)
1447 1447
 {
1448
-    global $wpdb;
1449
-    /*$infosql = "select * from $wpdb->users where ID=$aid";*/
1450
-    $infosql = $wpdb->prepare("select * from $wpdb->users where ID=%d", array($aid));
1451
-    $info = $wpdb->get_results($infosql);
1452
-    if ($info) {
1453
-        return $info[0];
1454
-    }
1448
+	global $wpdb;
1449
+	/*$infosql = "select * from $wpdb->users where ID=$aid";*/
1450
+	$infosql = $wpdb->prepare("select * from $wpdb->users where ID=%d", array($aid));
1451
+	$info = $wpdb->get_results($infosql);
1452
+	if ($info) {
1453
+		return $info[0];
1454
+	}
1455 1455
 }
1456 1456
 
1457 1457
 if (!function_exists('adminEmail')) {
1458
-    /**
1459
-     * Send emails to client on post submission, renew etc.
1460
-     *
1461
-     * @since 1.0.0
1462
-     * @package GeoDirectory
1463
-     * @global object $wpdb WordPress Database object.
1464
-     * @param int|string $page_id Page ID.
1465
-     * @param int|string $user_id User ID.
1466
-     * @param string $message_type Can be 'expiration','post_submited','renew','upgrade','claim_approved','claim_rejected','claim_requested','auto_claim','payment_success','payment_fail'.
1467
-     * @param string $custom_1 Custom data to be sent.
1468
-     */
1469
-    function adminEmail($page_id, $user_id, $message_type, $custom_1 = '')
1470
-    {
1471
-        global $wpdb;
1472
-        if ($message_type == 'expiration') {
1473
-            $subject = stripslashes(__(get_option('renew_email_subject'),'geodirectory'));
1474
-            $client_message = stripslashes(__(get_option('renew_email_content'),'geodirectory'));
1475
-        } elseif ($message_type == 'post_submited') {
1476
-            $subject = __(get_option('post_submited_success_email_subject_admin'),'geodirectory');
1477
-            $client_message = __(get_option('post_submited_success_email_content_admin'),'geodirectory');
1478
-        } elseif ($message_type == 'renew') {
1479
-            $subject = __(get_option('post_renew_success_email_subject_admin'),'geodirectory');
1480
-            $client_message = __(get_option('post_renew_success_email_content_admin'),'geodirectory');
1481
-        } elseif ($message_type == 'upgrade') {
1482
-            $subject = __(get_option('post_upgrade_success_email_subject_admin'),'geodirectory');
1483
-            $client_message = __(get_option('post_upgrade_success_email_content_admin'),'geodirectory');
1484
-        } elseif ($message_type == 'claim_approved') {
1485
-            $subject = __(get_option('claim_approved_email_subject'),'geodirectory');
1486
-            $client_message = __(get_option('claim_approved_email_content'),'geodirectory');
1487
-        } elseif ($message_type == 'claim_rejected') {
1488
-            $subject = __(get_option('claim_rejected_email_subject'),'geodirectory');
1489
-            $client_message = __(get_option('claim_rejected_email_content'),'geodirectory');
1490
-        } elseif ($message_type == 'claim_requested') {
1491
-            $subject = __(get_option('claim_email_subject_admin'),'geodirectory');
1492
-            $client_message = __(get_option('claim_email_content_admin'),'geodirectory');
1493
-        } elseif ($message_type == 'auto_claim') {
1494
-            $subject = __(get_option('auto_claim_email_subject'),'geodirectory');
1495
-            $client_message = __(get_option('auto_claim_email_content'),'geodirectory');
1496
-        } elseif ($message_type == 'payment_success') {
1497
-            $subject = __(get_option('post_payment_success_admin_email_subject'),'geodirectory');
1498
-            $client_message = __(get_option('post_payment_success_admin_email_content'),'geodirectory');
1499
-        } elseif ($message_type == 'payment_fail') {
1500
-            $subject = __(get_option('post_payment_fail_admin_email_subject'),'geodirectory');
1501
-            $client_message = __(get_option('post_payment_fail_admin_email_content'),'geodirectory');
1502
-        }
1503
-        $transaction_details = $custom_1;
1504
-        $fromEmail = get_option('site_email');
1505
-        $fromEmailName = get_site_emailName();
1458
+	/**
1459
+	 * Send emails to client on post submission, renew etc.
1460
+	 *
1461
+	 * @since 1.0.0
1462
+	 * @package GeoDirectory
1463
+	 * @global object $wpdb WordPress Database object.
1464
+	 * @param int|string $page_id Page ID.
1465
+	 * @param int|string $user_id User ID.
1466
+	 * @param string $message_type Can be 'expiration','post_submited','renew','upgrade','claim_approved','claim_rejected','claim_requested','auto_claim','payment_success','payment_fail'.
1467
+	 * @param string $custom_1 Custom data to be sent.
1468
+	 */
1469
+	function adminEmail($page_id, $user_id, $message_type, $custom_1 = '')
1470
+	{
1471
+		global $wpdb;
1472
+		if ($message_type == 'expiration') {
1473
+			$subject = stripslashes(__(get_option('renew_email_subject'),'geodirectory'));
1474
+			$client_message = stripslashes(__(get_option('renew_email_content'),'geodirectory'));
1475
+		} elseif ($message_type == 'post_submited') {
1476
+			$subject = __(get_option('post_submited_success_email_subject_admin'),'geodirectory');
1477
+			$client_message = __(get_option('post_submited_success_email_content_admin'),'geodirectory');
1478
+		} elseif ($message_type == 'renew') {
1479
+			$subject = __(get_option('post_renew_success_email_subject_admin'),'geodirectory');
1480
+			$client_message = __(get_option('post_renew_success_email_content_admin'),'geodirectory');
1481
+		} elseif ($message_type == 'upgrade') {
1482
+			$subject = __(get_option('post_upgrade_success_email_subject_admin'),'geodirectory');
1483
+			$client_message = __(get_option('post_upgrade_success_email_content_admin'),'geodirectory');
1484
+		} elseif ($message_type == 'claim_approved') {
1485
+			$subject = __(get_option('claim_approved_email_subject'),'geodirectory');
1486
+			$client_message = __(get_option('claim_approved_email_content'),'geodirectory');
1487
+		} elseif ($message_type == 'claim_rejected') {
1488
+			$subject = __(get_option('claim_rejected_email_subject'),'geodirectory');
1489
+			$client_message = __(get_option('claim_rejected_email_content'),'geodirectory');
1490
+		} elseif ($message_type == 'claim_requested') {
1491
+			$subject = __(get_option('claim_email_subject_admin'),'geodirectory');
1492
+			$client_message = __(get_option('claim_email_content_admin'),'geodirectory');
1493
+		} elseif ($message_type == 'auto_claim') {
1494
+			$subject = __(get_option('auto_claim_email_subject'),'geodirectory');
1495
+			$client_message = __(get_option('auto_claim_email_content'),'geodirectory');
1496
+		} elseif ($message_type == 'payment_success') {
1497
+			$subject = __(get_option('post_payment_success_admin_email_subject'),'geodirectory');
1498
+			$client_message = __(get_option('post_payment_success_admin_email_content'),'geodirectory');
1499
+		} elseif ($message_type == 'payment_fail') {
1500
+			$subject = __(get_option('post_payment_fail_admin_email_subject'),'geodirectory');
1501
+			$client_message = __(get_option('post_payment_fail_admin_email_content'),'geodirectory');
1502
+		}
1503
+		$transaction_details = $custom_1;
1504
+		$fromEmail = get_option('site_email');
1505
+		$fromEmailName = get_site_emailName();
1506 1506
 //$alivedays = get_post_meta($page_id,'alive_days',true);
1507
-        $pkg_limit = get_property_price_info_listing($page_id);
1508
-        $alivedays = $pkg_limit['days'];
1509
-        $productlink = get_permalink($page_id);
1510
-        $post_info = get_post($page_id);
1511
-        $post_date = date('dS F,Y', strtotime($post_info->post_date));
1512
-        $listingLink = '<a href="' . $productlink . '"><b>' . $post_info->post_title . '</b></a>';
1513
-        $loginurl = geodir_login_url();
1514
-        $loginurl_link = '<a href="' . $loginurl . '">login</a>';
1515
-        $siteurl = home_url();
1516
-        $siteurl_link = '<a href="' . $siteurl . '">' . $fromEmailName . '</a>';
1517
-        $user_info = get_userdata($user_id);
1518
-        $user_email = $user_info->user_email;
1519
-        $display_name = geodir_get_client_name($user_id);
1520
-        $user_login = $user_info->user_login;
1521
-        $number_of_grace_days = get_option('ptthemes_listing_preexpiry_notice_days');
1522
-        if ($number_of_grace_days == '') {
1523
-            $number_of_grace_days = 1;
1524
-        }
1525
-        if ($post_info->post_type == 'event') {
1526
-            $post_type = 'event';
1527
-        } else {
1528
-            $post_type = 'listing';
1529
-        }
1530
-        $renew_link = '<a href="' . $siteurl . '?ptype=post_' . $post_type . '&renew=1&pid=' . $page_id . '">' . RENEW_LINK . '</a>';
1531
-        $search_array = array('[#client_name#]', '[#listing_link#]', '[#posted_date#]', '[#number_of_days#]', '[#number_of_grace_days#]', '[#login_url#]', '[#username#]', '[#user_email#]', '[#site_name_url#]', '[#renew_link#]', '[#post_id#]', '[#site_name#]', '[#transaction_details#]');
1532
-        $replace_array = array($display_name, $listingLink, $post_date, $alivedays, $number_of_grace_days, $loginurl_link, $user_login, $user_email, $siteurl_link, $renew_link, $page_id, $fromEmailName, $transaction_details);
1533
-        $client_message = str_replace($search_array, $replace_array, $client_message);
1534
-        $subject = str_replace($search_array, $replace_array, $subject);
1535
-        $headers = 'MIME-Version: 1.0' . "\r\n";
1536
-        $headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n";
1537
-        $headers .= 'From: ' . $fromEmailName . ' <' . $fromEmail . '>' . "\r\n";
1538
-
1539
-        $to = $fromEmail;
1540
-        $message = $client_message;
1541
-
1542
-
1543
-        /**
1544
-         * Filter the admin email to address.
1545
-         *
1546
-         * @since 1.6.1
1547
-         * @package GeoDirectory
1548
-         * @param string $to The email address the email is being sent to.
1549
-         * @param int|string $page_id Page ID.
1550
-         * @param int|string $user_id User ID.
1551
-         * @param string $message_type Can be 'expiration','post_submited','renew','upgrade','claim_approved','claim_rejected','claim_requested','auto_claim','payment_success','payment_fail'.
1552
-         * @param string $custom_1 Custom data to be sent.
1553
-         */
1554
-        $to = apply_filters('geodir_adminEmail_to',$to,$page_id, $user_id, $message_type, $custom_1 );
1555
-        /**
1556
-         * Filter the admin email subject.
1557
-         *
1558
-         * @since 1.6.1
1559
-         * @package GeoDirectory_Payment_Manager
1560
-         * @param string $subject The email subject.
1561
-         * @param int|string $page_id Page ID.
1562
-         * @param int|string $user_id User ID.
1563
-         * @param string $message_type Can be 'expiration','post_submited','renew','upgrade','claim_approved','claim_rejected','claim_requested','auto_claim','payment_success','payment_fail'.
1564
-         * @param string $custom_1 Custom data to be sent.
1565
-         */
1566
-        $subject = apply_filters('geodir_adminEmail_subject',$subject,$page_id, $user_id, $message_type, $custom_1);
1567
-        /**
1568
-         * Filter the admin email message.
1569
-         *
1570
-         * @since 1.6.1
1571
-         * @package GeoDirectory_Payment_Manager
1572
-         * @param string $message The email message text.
1573
-         * @param int|string $page_id Page ID.
1574
-         * @param int|string $user_id User ID.
1575
-         * @param string $message_type Can be 'expiration','post_submited','renew','upgrade','claim_approved','claim_rejected','claim_requested','auto_claim','payment_success','payment_fail'.
1576
-         * @param string $custom_1 Custom data to be sent.
1577
-         */
1578
-        $message = apply_filters('geodir_adminEmail_message',$message,$page_id, $user_id, $message_type, $custom_1);
1579
-        /**
1580
-         * Filter the admin email headers.
1581
-         *
1582
-         * @since 1.6.1
1583
-         * @package GeoDirectory_Payment_Manager
1584
-         * @param string $headers The email headers.
1585
-         * @param int|string $page_id Page ID.
1586
-         * @param int|string $user_id User ID.
1587
-         * @param string $message_type Can be 'expiration','post_submited','renew','upgrade','claim_approved','claim_rejected','claim_requested','auto_claim','payment_success','payment_fail'.
1588
-         * @param string $custom_1 Custom data to be sent.
1589
-         */
1590
-        $headers = apply_filters('geodir_adminEmail_headers',$headers,$page_id, $user_id, $message_type, $custom_1);
1591
-
1592
-
1593
-
1594
-        $sent = wp_mail($to, $subject, $message, $headers);
1595
-        if( ! $sent ) {
1596
-            if ( is_array( $to ) ) {
1597
-                $to = implode( ',', $to );
1598
-            }
1599
-            $log_message = sprintf(
1600
-                __( "Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory' ),
1601
-                $message_type,
1602
-                date_i18n( 'F j Y H:i:s', current_time( 'timestamp' ) ),
1603
-                $to,
1604
-                $subject
1605
-            );
1606
-            geodir_error_log( $log_message );
1607
-        }
1608
-    }
1507
+		$pkg_limit = get_property_price_info_listing($page_id);
1508
+		$alivedays = $pkg_limit['days'];
1509
+		$productlink = get_permalink($page_id);
1510
+		$post_info = get_post($page_id);
1511
+		$post_date = date('dS F,Y', strtotime($post_info->post_date));
1512
+		$listingLink = '<a href="' . $productlink . '"><b>' . $post_info->post_title . '</b></a>';
1513
+		$loginurl = geodir_login_url();
1514
+		$loginurl_link = '<a href="' . $loginurl . '">login</a>';
1515
+		$siteurl = home_url();
1516
+		$siteurl_link = '<a href="' . $siteurl . '">' . $fromEmailName . '</a>';
1517
+		$user_info = get_userdata($user_id);
1518
+		$user_email = $user_info->user_email;
1519
+		$display_name = geodir_get_client_name($user_id);
1520
+		$user_login = $user_info->user_login;
1521
+		$number_of_grace_days = get_option('ptthemes_listing_preexpiry_notice_days');
1522
+		if ($number_of_grace_days == '') {
1523
+			$number_of_grace_days = 1;
1524
+		}
1525
+		if ($post_info->post_type == 'event') {
1526
+			$post_type = 'event';
1527
+		} else {
1528
+			$post_type = 'listing';
1529
+		}
1530
+		$renew_link = '<a href="' . $siteurl . '?ptype=post_' . $post_type . '&renew=1&pid=' . $page_id . '">' . RENEW_LINK . '</a>';
1531
+		$search_array = array('[#client_name#]', '[#listing_link#]', '[#posted_date#]', '[#number_of_days#]', '[#number_of_grace_days#]', '[#login_url#]', '[#username#]', '[#user_email#]', '[#site_name_url#]', '[#renew_link#]', '[#post_id#]', '[#site_name#]', '[#transaction_details#]');
1532
+		$replace_array = array($display_name, $listingLink, $post_date, $alivedays, $number_of_grace_days, $loginurl_link, $user_login, $user_email, $siteurl_link, $renew_link, $page_id, $fromEmailName, $transaction_details);
1533
+		$client_message = str_replace($search_array, $replace_array, $client_message);
1534
+		$subject = str_replace($search_array, $replace_array, $subject);
1535
+		$headers = 'MIME-Version: 1.0' . "\r\n";
1536
+		$headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n";
1537
+		$headers .= 'From: ' . $fromEmailName . ' <' . $fromEmail . '>' . "\r\n";
1538
+
1539
+		$to = $fromEmail;
1540
+		$message = $client_message;
1541
+
1542
+
1543
+		/**
1544
+		 * Filter the admin email to address.
1545
+		 *
1546
+		 * @since 1.6.1
1547
+		 * @package GeoDirectory
1548
+		 * @param string $to The email address the email is being sent to.
1549
+		 * @param int|string $page_id Page ID.
1550
+		 * @param int|string $user_id User ID.
1551
+		 * @param string $message_type Can be 'expiration','post_submited','renew','upgrade','claim_approved','claim_rejected','claim_requested','auto_claim','payment_success','payment_fail'.
1552
+		 * @param string $custom_1 Custom data to be sent.
1553
+		 */
1554
+		$to = apply_filters('geodir_adminEmail_to',$to,$page_id, $user_id, $message_type, $custom_1 );
1555
+		/**
1556
+		 * Filter the admin email subject.
1557
+		 *
1558
+		 * @since 1.6.1
1559
+		 * @package GeoDirectory_Payment_Manager
1560
+		 * @param string $subject The email subject.
1561
+		 * @param int|string $page_id Page ID.
1562
+		 * @param int|string $user_id User ID.
1563
+		 * @param string $message_type Can be 'expiration','post_submited','renew','upgrade','claim_approved','claim_rejected','claim_requested','auto_claim','payment_success','payment_fail'.
1564
+		 * @param string $custom_1 Custom data to be sent.
1565
+		 */
1566
+		$subject = apply_filters('geodir_adminEmail_subject',$subject,$page_id, $user_id, $message_type, $custom_1);
1567
+		/**
1568
+		 * Filter the admin email message.
1569
+		 *
1570
+		 * @since 1.6.1
1571
+		 * @package GeoDirectory_Payment_Manager
1572
+		 * @param string $message The email message text.
1573
+		 * @param int|string $page_id Page ID.
1574
+		 * @param int|string $user_id User ID.
1575
+		 * @param string $message_type Can be 'expiration','post_submited','renew','upgrade','claim_approved','claim_rejected','claim_requested','auto_claim','payment_success','payment_fail'.
1576
+		 * @param string $custom_1 Custom data to be sent.
1577
+		 */
1578
+		$message = apply_filters('geodir_adminEmail_message',$message,$page_id, $user_id, $message_type, $custom_1);
1579
+		/**
1580
+		 * Filter the admin email headers.
1581
+		 *
1582
+		 * @since 1.6.1
1583
+		 * @package GeoDirectory_Payment_Manager
1584
+		 * @param string $headers The email headers.
1585
+		 * @param int|string $page_id Page ID.
1586
+		 * @param int|string $user_id User ID.
1587
+		 * @param string $message_type Can be 'expiration','post_submited','renew','upgrade','claim_approved','claim_rejected','claim_requested','auto_claim','payment_success','payment_fail'.
1588
+		 * @param string $custom_1 Custom data to be sent.
1589
+		 */
1590
+		$headers = apply_filters('geodir_adminEmail_headers',$headers,$page_id, $user_id, $message_type, $custom_1);
1591
+
1592
+
1593
+
1594
+		$sent = wp_mail($to, $subject, $message, $headers);
1595
+		if( ! $sent ) {
1596
+			if ( is_array( $to ) ) {
1597
+				$to = implode( ',', $to );
1598
+			}
1599
+			$log_message = sprintf(
1600
+				__( "Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory' ),
1601
+				$message_type,
1602
+				date_i18n( 'F j Y H:i:s', current_time( 'timestamp' ) ),
1603
+				$to,
1604
+				$subject
1605
+			);
1606
+			geodir_error_log( $log_message );
1607
+		}
1608
+	}
1609 1609
 }
1610 1610
 
1611 1611
 if (!function_exists('sendEmail')) {
1612
-    /**
1613
-     * @todo could be a duplicate of geodir_sendEmail.
1614
-     *
1615
-     * @since 1.0.0
1616
-     * @package GeoDirectory
1617
-     * @param string $fromEmail Sender email address.
1618
-     * @param string $fromEmailName Sender name.
1619
-     * @param string $toEmail Receiver email address.
1620
-     * @param string $toEmailName Receiver name.
1621
-     * @param string $to_subject Email subject.
1622
-     * @param string $to_message Email content.
1623
-     * @param string $extra Not being used.
1624
-     * @param string $message_type The message type. Can be send_friend, send_enquiry, forgot_password, registration.
1625
-     * @param string $post_id The post ID.
1626
-     * @param string $user_id The user ID.
1627
-     */
1628
-    function sendEmail($fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra = '', $message_type, $post_id = '', $user_id = '')
1629
-    {
1630
-        $login_details = '';
1631
-        if ($message_type == 'send_friend') {
1632
-            $subject = stripslashes(__(get_option('email_friend_subject'),'geodirectory'));
1633
-            $message = stripslashes(__(get_option('email_friend_content'),'geodirectory'));
1634
-        } elseif ($message_type == 'send_enquiry') {
1635
-            $subject = __(get_option('email_enquiry_subject'),'geodirectory');
1636
-            $message = __(get_option('email_enquiry_content'),'geodirectory');
1637
-        } elseif ($message_type == 'forgot_password') {
1638
-            $subject = __(get_option('forgot_password_subject'),'geodirectory');
1639
-            $message = __(get_option('forgot_password_content'),'geodirectory');
1640
-            $login_details = $to_message;
1641
-        } elseif ($message_type == 'registration') {
1642
-            $subject = __(get_option('registration_success_email_subject'),'geodirectory');
1643
-            $message = __(get_option('registration_success_email_content'),'geodirectory');
1644
-            $login_details = $to_message;
1645
-        }
1646
-        $to_message = nl2br($to_message);
1647
-        $sitefromEmail = get_option('site_email');
1648
-        $sitefromEmailName = get_site_emailName();
1649
-        $productlink = get_permalink($post_id);
1650
-        $post_info = get_post($post_id);
1651
-        $listingLink = '<a href="' . $productlink . '"><b>' . $post_info->post_title . '</b></a>';
1652
-        $siteurl = home_url();
1653
-        $siteurl_link = '<a href="' . $siteurl . '">' . $siteurl . '</a>';
1654
-        $loginurl = geodir_login_url();
1655
-        $loginurl_link = '<a href="' . $loginurl . '">login</a>';
1656
-        if ($fromEmail == '') {
1657
-            $fromEmail = get_option('site_email');
1658
-        }
1659
-        if ($fromEmailName == '') {
1660
-            $fromEmailName = get_option('site_email_name');
1661
-        }
1662
-        $search_array = array('[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#to_name#]', '[#from_name#]', '[#subject#]', '[#comments#]', '[#login_url#]', '[#login_details#]', '[#client_name#]');
1663
-        $replace_array = array($listingLink, $siteurl_link, $post_id, $sitefromEmailName, $toEmailName, $fromEmailName, $to_subject, $to_message, $loginurl_link, $login_details, $toEmailName);
1664
-        $message = str_replace($search_array, $replace_array, $message);
1665
-
1666
-        $search_array = array('[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#to_name#]', '[#from_name#]', '[#subject#]', '[#client_name#]');
1667
-        $replace_array = array($listingLink, $siteurl_link, $post_id, $sitefromEmailName, $toEmailName, $fromEmailName, $to_subject, $toEmailName);
1668
-        $subject = str_replace($search_array, $replace_array, $subject);
1669
-        $headers = 'MIME-Version: 1.0' . "\r\n";
1670
-        $headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n";
1671
-        $headers .= "Reply-To: " . $fromEmail . "\r\n";
1672
-        $headers .= 'From: ' . $sitefromEmailName . ' <' . $sitefromEmail . '>' . "\r\n";
1673
-
1674
-        $to = $toEmail;
1675
-
1676
-        $sent = wp_mail($to, $subject, $message, $headers);
1677
-        if( ! $sent ) {
1678
-            if ( is_array( $to ) ) {
1679
-                $to = implode( ',', $to );
1680
-            }
1681
-            $log_message = sprintf(
1682
-                __( "Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory' ),
1683
-                $message_type,
1684
-                date_i18n( 'F j Y H:i:s', current_time( 'timestamp' ) ),
1685
-                $to,
1686
-                $subject
1687
-            );
1688
-            geodir_error_log( $log_message );
1689
-        }
1690
-
1691
-        ///////// ADMIN BCC EMIALS
1692
-        $admin_bcc = false;
1693
-        if ($message_type == 'registration') {
1694
-            $message_raw = explode(__("Password:", 'geodirectory'), $message);
1695
-            $message_raw2 = explode("</p>", $message_raw[1], 2);
1696
-            $message = $message_raw[0] . __('Password:', 'geodirectory') . ' **********</p>' . $message_raw2[1];
1697
-        }
1698
-        $adminEmail = get_bloginfo('admin_email');
1699
-        $to = $adminEmail;
1700
-
1701
-        if ($message_type == 'registration' && get_option('bcc_new_user')) {
1702
-            $subject .= ' - ADMIN BCC COPY';
1703
-            $admin_bcc = true;
1704
-        }
1705
-        elseif ($message_type == 'send_friend' && get_option('bcc_friend')) {
1706
-            $subject .= ' - ADMIN BCC COPY';
1707
-            $admin_bcc = true;
1708
-        }
1709
-        elseif ($message_type == 'send_enquiry' && get_option('bcc_enquiry')) {
1710
-            $subject .= ' - ADMIN BCC COPY';
1711
-            $admin_bcc = true;
1712
-        }
1713
-
1714
-        if($admin_bcc === true){
1715
-            $sent = wp_mail($to, $subject, $message, $headers);
1716
-            if( ! $sent ) {
1717
-                if ( is_array( $to ) ) {
1718
-                    $to = implode( ',', $to );
1719
-                }
1720
-                $log_message = sprintf(
1721
-                    __( "Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory' ),
1722
-                    $message_type,
1723
-                    date_i18n( 'F j Y H:i:s', current_time( 'timestamp' ) ),
1724
-                    $to,
1725
-                    $subject
1726
-                );
1727
-                geodir_error_log( $log_message );
1728
-            }
1729
-        }
1730
-
1731
-    }
1612
+	/**
1613
+	 * @todo could be a duplicate of geodir_sendEmail.
1614
+	 *
1615
+	 * @since 1.0.0
1616
+	 * @package GeoDirectory
1617
+	 * @param string $fromEmail Sender email address.
1618
+	 * @param string $fromEmailName Sender name.
1619
+	 * @param string $toEmail Receiver email address.
1620
+	 * @param string $toEmailName Receiver name.
1621
+	 * @param string $to_subject Email subject.
1622
+	 * @param string $to_message Email content.
1623
+	 * @param string $extra Not being used.
1624
+	 * @param string $message_type The message type. Can be send_friend, send_enquiry, forgot_password, registration.
1625
+	 * @param string $post_id The post ID.
1626
+	 * @param string $user_id The user ID.
1627
+	 */
1628
+	function sendEmail($fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra = '', $message_type, $post_id = '', $user_id = '')
1629
+	{
1630
+		$login_details = '';
1631
+		if ($message_type == 'send_friend') {
1632
+			$subject = stripslashes(__(get_option('email_friend_subject'),'geodirectory'));
1633
+			$message = stripslashes(__(get_option('email_friend_content'),'geodirectory'));
1634
+		} elseif ($message_type == 'send_enquiry') {
1635
+			$subject = __(get_option('email_enquiry_subject'),'geodirectory');
1636
+			$message = __(get_option('email_enquiry_content'),'geodirectory');
1637
+		} elseif ($message_type == 'forgot_password') {
1638
+			$subject = __(get_option('forgot_password_subject'),'geodirectory');
1639
+			$message = __(get_option('forgot_password_content'),'geodirectory');
1640
+			$login_details = $to_message;
1641
+		} elseif ($message_type == 'registration') {
1642
+			$subject = __(get_option('registration_success_email_subject'),'geodirectory');
1643
+			$message = __(get_option('registration_success_email_content'),'geodirectory');
1644
+			$login_details = $to_message;
1645
+		}
1646
+		$to_message = nl2br($to_message);
1647
+		$sitefromEmail = get_option('site_email');
1648
+		$sitefromEmailName = get_site_emailName();
1649
+		$productlink = get_permalink($post_id);
1650
+		$post_info = get_post($post_id);
1651
+		$listingLink = '<a href="' . $productlink . '"><b>' . $post_info->post_title . '</b></a>';
1652
+		$siteurl = home_url();
1653
+		$siteurl_link = '<a href="' . $siteurl . '">' . $siteurl . '</a>';
1654
+		$loginurl = geodir_login_url();
1655
+		$loginurl_link = '<a href="' . $loginurl . '">login</a>';
1656
+		if ($fromEmail == '') {
1657
+			$fromEmail = get_option('site_email');
1658
+		}
1659
+		if ($fromEmailName == '') {
1660
+			$fromEmailName = get_option('site_email_name');
1661
+		}
1662
+		$search_array = array('[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#to_name#]', '[#from_name#]', '[#subject#]', '[#comments#]', '[#login_url#]', '[#login_details#]', '[#client_name#]');
1663
+		$replace_array = array($listingLink, $siteurl_link, $post_id, $sitefromEmailName, $toEmailName, $fromEmailName, $to_subject, $to_message, $loginurl_link, $login_details, $toEmailName);
1664
+		$message = str_replace($search_array, $replace_array, $message);
1665
+
1666
+		$search_array = array('[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#to_name#]', '[#from_name#]', '[#subject#]', '[#client_name#]');
1667
+		$replace_array = array($listingLink, $siteurl_link, $post_id, $sitefromEmailName, $toEmailName, $fromEmailName, $to_subject, $toEmailName);
1668
+		$subject = str_replace($search_array, $replace_array, $subject);
1669
+		$headers = 'MIME-Version: 1.0' . "\r\n";
1670
+		$headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n";
1671
+		$headers .= "Reply-To: " . $fromEmail . "\r\n";
1672
+		$headers .= 'From: ' . $sitefromEmailName . ' <' . $sitefromEmail . '>' . "\r\n";
1673
+
1674
+		$to = $toEmail;
1675
+
1676
+		$sent = wp_mail($to, $subject, $message, $headers);
1677
+		if( ! $sent ) {
1678
+			if ( is_array( $to ) ) {
1679
+				$to = implode( ',', $to );
1680
+			}
1681
+			$log_message = sprintf(
1682
+				__( "Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory' ),
1683
+				$message_type,
1684
+				date_i18n( 'F j Y H:i:s', current_time( 'timestamp' ) ),
1685
+				$to,
1686
+				$subject
1687
+			);
1688
+			geodir_error_log( $log_message );
1689
+		}
1690
+
1691
+		///////// ADMIN BCC EMIALS
1692
+		$admin_bcc = false;
1693
+		if ($message_type == 'registration') {
1694
+			$message_raw = explode(__("Password:", 'geodirectory'), $message);
1695
+			$message_raw2 = explode("</p>", $message_raw[1], 2);
1696
+			$message = $message_raw[0] . __('Password:', 'geodirectory') . ' **********</p>' . $message_raw2[1];
1697
+		}
1698
+		$adminEmail = get_bloginfo('admin_email');
1699
+		$to = $adminEmail;
1700
+
1701
+		if ($message_type == 'registration' && get_option('bcc_new_user')) {
1702
+			$subject .= ' - ADMIN BCC COPY';
1703
+			$admin_bcc = true;
1704
+		}
1705
+		elseif ($message_type == 'send_friend' && get_option('bcc_friend')) {
1706
+			$subject .= ' - ADMIN BCC COPY';
1707
+			$admin_bcc = true;
1708
+		}
1709
+		elseif ($message_type == 'send_enquiry' && get_option('bcc_enquiry')) {
1710
+			$subject .= ' - ADMIN BCC COPY';
1711
+			$admin_bcc = true;
1712
+		}
1713
+
1714
+		if($admin_bcc === true){
1715
+			$sent = wp_mail($to, $subject, $message, $headers);
1716
+			if( ! $sent ) {
1717
+				if ( is_array( $to ) ) {
1718
+					$to = implode( ',', $to );
1719
+				}
1720
+				$log_message = sprintf(
1721
+					__( "Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory' ),
1722
+					$message_type,
1723
+					date_i18n( 'F j Y H:i:s', current_time( 'timestamp' ) ),
1724
+					$to,
1725
+					$subject
1726
+				);
1727
+				geodir_error_log( $log_message );
1728
+			}
1729
+		}
1730
+
1731
+	}
1732 1732
 }
1733 1733
 
1734 1734
 /*
@@ -1746,16 +1746,16 @@  discard block
 block discarded – undo
1746 1746
  */
1747 1747
 function gd_lang_object_ids($ids_array, $type)
1748 1748
 {
1749
-    if (function_exists('icl_object_id')) {
1750
-        $res = array();
1751
-        foreach ($ids_array as $id) {
1752
-            $xlat = icl_object_id($id, $type, false);
1753
-            if (!is_null($xlat)) $res[] = $xlat;
1754
-        }
1755
-        return $res;
1756
-    } else {
1757
-        return $ids_array;
1758
-    }
1749
+	if (function_exists('icl_object_id')) {
1750
+		$res = array();
1751
+		foreach ($ids_array as $id) {
1752
+			$xlat = icl_object_id($id, $type, false);
1753
+			if (!is_null($xlat)) $res[] = $xlat;
1754
+		}
1755
+		return $res;
1756
+	} else {
1757
+		return $ids_array;
1758
+	}
1759 1759
 }
1760 1760
 
1761 1761
 
@@ -1770,31 +1770,31 @@  discard block
 block discarded – undo
1770 1770
  * @return array Modified Body CSS classes.
1771 1771
  */
1772 1772
 function geodir_custom_posts_body_class($classes) {
1773
-    global $wpdb, $wp;
1774
-    $post_types = geodir_get_posttypes('object');
1775
-    if (!empty($post_types) && count((array)$post_types) > 1) {
1776
-        $classes[] = 'geodir_custom_posts';
1777
-    }
1778
-
1779
-    // fix body class for signup page
1780
-    if (geodir_is_page('login')) {
1781
-        $new_classes = array();
1782
-        $new_classes[] = 'signup page-geodir-signup';
1783
-        if (!empty($classes)) {
1784
-            foreach ($classes as $class) {
1785
-                if ($class && $class != 'home' && $class != 'blog') {
1786
-                    $new_classes[] = $class;
1787
-                }
1788
-            }
1789
-        }
1790
-        $classes = $new_classes;
1791
-    }
1792
-
1793
-    if (geodir_is_geodir_page()) {
1794
-        $classes[] = 'geodir-page';
1795
-    }
1796
-
1797
-    return $classes;
1773
+	global $wpdb, $wp;
1774
+	$post_types = geodir_get_posttypes('object');
1775
+	if (!empty($post_types) && count((array)$post_types) > 1) {
1776
+		$classes[] = 'geodir_custom_posts';
1777
+	}
1778
+
1779
+	// fix body class for signup page
1780
+	if (geodir_is_page('login')) {
1781
+		$new_classes = array();
1782
+		$new_classes[] = 'signup page-geodir-signup';
1783
+		if (!empty($classes)) {
1784
+			foreach ($classes as $class) {
1785
+				if ($class && $class != 'home' && $class != 'blog') {
1786
+					$new_classes[] = $class;
1787
+				}
1788
+			}
1789
+		}
1790
+		$classes = $new_classes;
1791
+	}
1792
+
1793
+	if (geodir_is_geodir_page()) {
1794
+		$classes[] = 'geodir-page';
1795
+	}
1796
+
1797
+	return $classes;
1798 1798
 }
1799 1799
 
1800 1800
 add_filter('body_class', 'geodir_custom_posts_body_class'); // let's add a class to the body so we can style the new addition to the search
@@ -1809,12 +1809,12 @@  discard block
 block discarded – undo
1809 1809
  */
1810 1810
 function geodir_map_zoom_level()
1811 1811
 {
1812
-    /**
1813
-     * Filter GD map zoom level.
1814
-     *
1815
-     * @since 1.0.0
1816
-     */
1817
-    return apply_filters('geodir_map_zoom_level', array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19));
1812
+	/**
1813
+	 * Filter GD map zoom level.
1814
+	 *
1815
+	 * @since 1.0.0
1816
+	 */
1817
+	return apply_filters('geodir_map_zoom_level', array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19));
1818 1818
 
1819 1819
 }
1820 1820
 
@@ -1828,12 +1828,12 @@  discard block
 block discarded – undo
1828 1828
  */
1829 1829
 function geodir_option_version_backup($geodir_option_name)
1830 1830
 {
1831
-    $version_date = time();
1832
-    $geodir_option = get_option($geodir_option_name);
1831
+	$version_date = time();
1832
+	$geodir_option = get_option($geodir_option_name);
1833 1833
 
1834
-    if (!empty($geodir_option)) {
1835
-        add_option($geodir_option_name . '_' . $version_date, $geodir_option);
1836
-    }
1834
+	if (!empty($geodir_option)) {
1835
+		add_option($geodir_option_name . '_' . $version_date, $geodir_option);
1836
+	}
1837 1837
 }
1838 1838
 
1839 1839
 /**
@@ -1846,11 +1846,11 @@  discard block
 block discarded – undo
1846 1846
  */
1847 1847
 function get_page_id_geodir_add_listing_page($page_id)
1848 1848
 {
1849
-    if (geodir_wpml_multilingual_status()) {
1850
-        $post_type = 'post_page';
1851
-        $page_id = geodir_get_wpml_element_id($page_id, $post_type);
1852
-    }
1853
-    return $page_id;
1849
+	if (geodir_wpml_multilingual_status()) {
1850
+		$post_type = 'post_page';
1851
+		$page_id = geodir_get_wpml_element_id($page_id, $post_type);
1852
+	}
1853
+	return $page_id;
1854 1854
 }
1855 1855
 
1856 1856
 /**
@@ -1862,10 +1862,10 @@  discard block
 block discarded – undo
1862 1862
  */
1863 1863
 function geodir_wpml_multilingual_status()
1864 1864
 {
1865
-    if (function_exists('icl_object_id')) {
1866
-        return true;
1867
-    }
1868
-    return false;
1865
+	if (function_exists('icl_object_id')) {
1866
+		return true;
1867
+	}
1868
+	return false;
1869 1869
 }
1870 1870
 
1871 1871
 /**
@@ -1879,22 +1879,22 @@  discard block
 block discarded – undo
1879 1879
  */
1880 1880
 function geodir_get_wpml_element_id($page_id, $post_type)
1881 1881
 {
1882
-    global $sitepress;
1883
-    if (geodir_wpml_multilingual_status() && !empty($sitepress) && isset($sitepress->queries)) {
1884
-        $trid = $sitepress->get_element_trid($page_id, $post_type);
1885
-
1886
-        if ($trid > 0) {
1887
-            $translations = $sitepress->get_element_translations($trid, $post_type);
1888
-
1889
-            $lang = $sitepress->get_current_language();
1890
-            $lang = $lang ? $lang : $sitepress->get_default_language();
1891
-
1892
-            if (!empty($translations) && !empty($lang) && isset($translations[$lang]) && isset($translations[$lang]->element_id) && !empty($translations[$lang]->element_id)) {
1893
-                $page_id = $translations[$lang]->element_id;
1894
-            }
1895
-        }
1896
-    }
1897
-    return $page_id;
1882
+	global $sitepress;
1883
+	if (geodir_wpml_multilingual_status() && !empty($sitepress) && isset($sitepress->queries)) {
1884
+		$trid = $sitepress->get_element_trid($page_id, $post_type);
1885
+
1886
+		if ($trid > 0) {
1887
+			$translations = $sitepress->get_element_translations($trid, $post_type);
1888
+
1889
+			$lang = $sitepress->get_current_language();
1890
+			$lang = $lang ? $lang : $sitepress->get_default_language();
1891
+
1892
+			if (!empty($translations) && !empty($lang) && isset($translations[$lang]) && isset($translations[$lang]->element_id) && !empty($translations[$lang]->element_id)) {
1893
+				$page_id = $translations[$lang]->element_id;
1894
+			}
1895
+		}
1896
+	}
1897
+	return $page_id;
1898 1898
 }
1899 1899
 
1900 1900
 /**
@@ -1906,20 +1906,20 @@  discard block
 block discarded – undo
1906 1906
  */
1907 1907
 function geodir_wpml_check_element_id()
1908 1908
 {
1909
-    global $sitepress;
1910
-    if (geodir_wpml_multilingual_status() && !empty($sitepress) && isset($sitepress->queries)) {
1911
-        $el_type = 'post_page';
1912
-        $el_id = get_option('geodir_add_listing_page');
1913
-        $default_lang = $sitepress->get_default_language();
1914
-        $el_details = $sitepress->get_element_language_details($el_id, $el_type);
1915
-
1916
-        if (!($el_id > 0 && $default_lang && !empty($el_details) && isset($el_details->language_code) && $el_details->language_code == $default_lang)) {
1917
-            if (!$el_details->source_language_code) {
1918
-                $sitepress->set_element_language_details($el_id, $el_type, '', $default_lang);
1919
-                $sitepress->icl_translations_cache->clear();
1920
-            }
1921
-        }
1922
-    }
1909
+	global $sitepress;
1910
+	if (geodir_wpml_multilingual_status() && !empty($sitepress) && isset($sitepress->queries)) {
1911
+		$el_type = 'post_page';
1912
+		$el_id = get_option('geodir_add_listing_page');
1913
+		$default_lang = $sitepress->get_default_language();
1914
+		$el_details = $sitepress->get_element_language_details($el_id, $el_type);
1915
+
1916
+		if (!($el_id > 0 && $default_lang && !empty($el_details) && isset($el_details->language_code) && $el_details->language_code == $default_lang)) {
1917
+			if (!$el_details->source_language_code) {
1918
+				$sitepress->set_element_language_details($el_id, $el_type, '', $default_lang);
1919
+				$sitepress->icl_translations_cache->clear();
1920
+			}
1921
+		}
1922
+	}
1923 1923
 }
1924 1924
 
1925 1925
 /**
@@ -1934,44 +1934,44 @@  discard block
 block discarded – undo
1934 1934
  */
1935 1935
 function geodir_widget_listings_get_order($query_args)
1936 1936
 {
1937
-    global $wpdb, $plugin_prefix, $gd_query_args_widgets;
1938
-
1939
-    $query_args = $gd_query_args_widgets;
1940
-    if (empty($query_args) || empty($query_args['is_geodir_loop'])) {
1941
-        return $wpdb->posts . ".post_date DESC, ";
1942
-    }
1943
-
1944
-    $post_type = empty($query_args['post_type']) ? 'gd_place' : $query_args['post_type'];
1945
-    $table = $plugin_prefix . $post_type . '_detail';
1946
-
1947
-    $sort_by = !empty($query_args['order_by']) ? $query_args['order_by'] : '';
1948
-
1949
-    switch ($sort_by) {
1950
-        case 'latest':
1951
-        case 'newest':
1952
-            $orderby = $wpdb->posts . ".post_date DESC, ";
1953
-            break;
1954
-        case 'featured':
1955
-            $orderby = $table . ".is_featured ASC, ";
1956
-            break;
1957
-        case 'az':
1958
-            $orderby = $wpdb->posts . ".post_title ASC, ";
1959
-            break;
1960
-        case 'high_review':
1961
-            $orderby = $table . ".rating_count DESC, " . $table . ".overall_rating DESC, ";
1962
-            break;
1963
-        case 'high_rating':
1964
-            $orderby = "( " . $table . ".overall_rating  ) DESC, ";
1965
-            break;
1966
-        case 'random':
1967
-            $orderby = "RAND(), ";
1968
-            break;
1969
-        default:
1970
-            $orderby = $wpdb->posts . ".post_title ASC, ";
1971
-            break;
1972
-    }
1973
-
1974
-    return $orderby;
1937
+	global $wpdb, $plugin_prefix, $gd_query_args_widgets;
1938
+
1939
+	$query_args = $gd_query_args_widgets;
1940
+	if (empty($query_args) || empty($query_args['is_geodir_loop'])) {
1941
+		return $wpdb->posts . ".post_date DESC, ";
1942
+	}
1943
+
1944
+	$post_type = empty($query_args['post_type']) ? 'gd_place' : $query_args['post_type'];
1945
+	$table = $plugin_prefix . $post_type . '_detail';
1946
+
1947
+	$sort_by = !empty($query_args['order_by']) ? $query_args['order_by'] : '';
1948
+
1949
+	switch ($sort_by) {
1950
+		case 'latest':
1951
+		case 'newest':
1952
+			$orderby = $wpdb->posts . ".post_date DESC, ";
1953
+			break;
1954
+		case 'featured':
1955
+			$orderby = $table . ".is_featured ASC, ";
1956
+			break;
1957
+		case 'az':
1958
+			$orderby = $wpdb->posts . ".post_title ASC, ";
1959
+			break;
1960
+		case 'high_review':
1961
+			$orderby = $table . ".rating_count DESC, " . $table . ".overall_rating DESC, ";
1962
+			break;
1963
+		case 'high_rating':
1964
+			$orderby = "( " . $table . ".overall_rating  ) DESC, ";
1965
+			break;
1966
+		case 'random':
1967
+			$orderby = "RAND(), ";
1968
+			break;
1969
+		default:
1970
+			$orderby = $wpdb->posts . ".post_title ASC, ";
1971
+			break;
1972
+	}
1973
+
1974
+	return $orderby;
1975 1975
 }
1976 1976
 
1977 1977
 /**
@@ -1989,126 +1989,126 @@  discard block
 block discarded – undo
1989 1989
  */
1990 1990
 function geodir_get_widget_listings($query_args = array(), $count_only = false)
1991 1991
 {
1992
-    global $wpdb, $plugin_prefix, $table_prefix;
1993
-    $GLOBALS['gd_query_args_widgets'] = $query_args;
1994
-    $gd_query_args_widgets = $query_args;
1995
-
1996
-    $post_type = empty($query_args['post_type']) ? 'gd_place' : $query_args['post_type'];
1997
-    $table = $plugin_prefix . $post_type . '_detail';
1998
-
1999
-    $fields = $wpdb->posts . ".*, " . $table . ".*";
2000
-    /**
2001
-     * Filter widget listing fields string part that is being used for query.
2002
-     *
2003
-     * @since 1.0.0
2004
-     * @param string $fields Fields string.
2005
-     * @param string $table Table name.
2006
-     * @param string $post_type Post type.
2007
-     */
2008
-    $fields = apply_filters('geodir_filter_widget_listings_fields', $fields, $table, $post_type);
2009
-
2010
-    $join = "INNER JOIN " . $table . " ON (" . $table . ".post_id = " . $wpdb->posts . ".ID)";
2011
-
2012
-    ########### WPML ###########
2013
-
2014
-    if (function_exists('icl_object_id')) {
2015
-        global $sitepress;
2016
-        $lang_code = ICL_LANGUAGE_CODE;
2017
-        if ($lang_code) {
2018
-            $join .= " JOIN " . $table_prefix . "icl_translations icl_t ON icl_t.element_id = " . $table_prefix . "posts.ID";
2019
-        }
2020
-    }
2021
-
2022
-    ########### WPML ###########
2023
-
2024
-    /**
2025
-     * Filter widget listing join clause string part that is being used for query.
2026
-     *
2027
-     * @since 1.0.0
2028
-     * @param string $join Join clause string.
2029
-     * @param string $post_type Post type.
2030
-     */
2031
-    $join = apply_filters('geodir_filter_widget_listings_join', $join, $post_type);
2032
-
2033
-    $post_status = is_super_admin() ? " OR " . $wpdb->posts . ".post_status = 'private'" : '';
2034
-
2035
-    $where = " AND ( " . $wpdb->posts . ".post_status = 'publish' " . $post_status . " ) AND " . $wpdb->posts . ".post_type = '" . $post_type . "'";
2036
-
2037
-    ########### WPML ###########
2038
-    if (function_exists('icl_object_id')) {
2039
-        if ($lang_code) {
2040
-            $where .= " AND icl_t.language_code = '$lang_code' AND icl_t.element_type = 'post_$post_type' ";
2041
-        }
2042
-    }
2043
-    ########### WPML ###########
2044
-    /**
2045
-     * Filter widget listing where clause string part that is being used for query.
2046
-     *
2047
-     * @since 1.0.0
2048
-     * @param string $where Where clause string.
2049
-     * @param string $post_type Post type.
2050
-     */
2051
-    $where = apply_filters('geodir_filter_widget_listings_where', $where, $post_type);
2052
-    $where = $where != '' ? " WHERE 1=1 " . $where : '';
2053
-
2054
-    $groupby = " GROUP BY $wpdb->posts.ID ";
2055
-    /**
2056
-     * Filter widget listing groupby clause string part that is being used for query.
2057
-     *
2058
-     * @since 1.0.0
2059
-     * @param string $groupby Group by clause string.
2060
-     * @param string $post_type Post type.
2061
-     */
2062
-    $groupby = apply_filters('geodir_filter_widget_listings_groupby', $groupby, $post_type);
2063
-
2064
-    if ($count_only) {
2065
-        $sql = "SELECT COUNT(" . $wpdb->posts . ".ID) AS total FROM " . $wpdb->posts . "
1992
+	global $wpdb, $plugin_prefix, $table_prefix;
1993
+	$GLOBALS['gd_query_args_widgets'] = $query_args;
1994
+	$gd_query_args_widgets = $query_args;
1995
+
1996
+	$post_type = empty($query_args['post_type']) ? 'gd_place' : $query_args['post_type'];
1997
+	$table = $plugin_prefix . $post_type . '_detail';
1998
+
1999
+	$fields = $wpdb->posts . ".*, " . $table . ".*";
2000
+	/**
2001
+	 * Filter widget listing fields string part that is being used for query.
2002
+	 *
2003
+	 * @since 1.0.0
2004
+	 * @param string $fields Fields string.
2005
+	 * @param string $table Table name.
2006
+	 * @param string $post_type Post type.
2007
+	 */
2008
+	$fields = apply_filters('geodir_filter_widget_listings_fields', $fields, $table, $post_type);
2009
+
2010
+	$join = "INNER JOIN " . $table . " ON (" . $table . ".post_id = " . $wpdb->posts . ".ID)";
2011
+
2012
+	########### WPML ###########
2013
+
2014
+	if (function_exists('icl_object_id')) {
2015
+		global $sitepress;
2016
+		$lang_code = ICL_LANGUAGE_CODE;
2017
+		if ($lang_code) {
2018
+			$join .= " JOIN " . $table_prefix . "icl_translations icl_t ON icl_t.element_id = " . $table_prefix . "posts.ID";
2019
+		}
2020
+	}
2021
+
2022
+	########### WPML ###########
2023
+
2024
+	/**
2025
+	 * Filter widget listing join clause string part that is being used for query.
2026
+	 *
2027
+	 * @since 1.0.0
2028
+	 * @param string $join Join clause string.
2029
+	 * @param string $post_type Post type.
2030
+	 */
2031
+	$join = apply_filters('geodir_filter_widget_listings_join', $join, $post_type);
2032
+
2033
+	$post_status = is_super_admin() ? " OR " . $wpdb->posts . ".post_status = 'private'" : '';
2034
+
2035
+	$where = " AND ( " . $wpdb->posts . ".post_status = 'publish' " . $post_status . " ) AND " . $wpdb->posts . ".post_type = '" . $post_type . "'";
2036
+
2037
+	########### WPML ###########
2038
+	if (function_exists('icl_object_id')) {
2039
+		if ($lang_code) {
2040
+			$where .= " AND icl_t.language_code = '$lang_code' AND icl_t.element_type = 'post_$post_type' ";
2041
+		}
2042
+	}
2043
+	########### WPML ###########
2044
+	/**
2045
+	 * Filter widget listing where clause string part that is being used for query.
2046
+	 *
2047
+	 * @since 1.0.0
2048
+	 * @param string $where Where clause string.
2049
+	 * @param string $post_type Post type.
2050
+	 */
2051
+	$where = apply_filters('geodir_filter_widget_listings_where', $where, $post_type);
2052
+	$where = $where != '' ? " WHERE 1=1 " . $where : '';
2053
+
2054
+	$groupby = " GROUP BY $wpdb->posts.ID ";
2055
+	/**
2056
+	 * Filter widget listing groupby clause string part that is being used for query.
2057
+	 *
2058
+	 * @since 1.0.0
2059
+	 * @param string $groupby Group by clause string.
2060
+	 * @param string $post_type Post type.
2061
+	 */
2062
+	$groupby = apply_filters('geodir_filter_widget_listings_groupby', $groupby, $post_type);
2063
+
2064
+	if ($count_only) {
2065
+		$sql = "SELECT COUNT(" . $wpdb->posts . ".ID) AS total FROM " . $wpdb->posts . "
2066 2066
 			" . $join . "
2067 2067
 			" . $where;
2068
-        $rows = (int)$wpdb->get_var($sql);
2069
-    } else {
2070
-        $orderby = geodir_widget_listings_get_order($query_args);
2071
-        /**
2072
-         * Filter widget listing orderby clause string part that is being used for query.
2073
-         *
2074
-         * @since 1.0.0
2075
-         * @param string $orderby Order by clause string.
2076
-         * @param string $table Table name.
2077
-         * @param string $post_type Post type.
2078
-         */
2079
-        $orderby = apply_filters('geodir_filter_widget_listings_orderby', $orderby, $table, $post_type);
2080
-        $orderby .= $wpdb->posts . ".post_title ASC";
2081
-        $orderby = $orderby != '' ? " ORDER BY " . $orderby : '';
2082
-
2083
-        $limit = !empty($query_args['posts_per_page']) ? $query_args['posts_per_page'] : 5;
2084
-        /**
2085
-         * Filter widget listing limit that is being used for query.
2086
-         *
2087
-         * @since 1.0.0
2088
-         * @param int $limit Query results limit.
2089
-         * @param string $post_type Post type.
2090
-         */
2091
-        $limit = apply_filters('geodir_filter_widget_listings_limit', $limit, $post_type);
2092
-
2093
-        $page = !empty($query_args['pageno']) ? absint($query_args['pageno']) : 1;
2094
-        if ( !$page )
2095
-            $page = 1;
2096
-
2097
-        $limit = (int)$limit > 0 ? " LIMIT " . absint( ( $page - 1 ) * (int)$limit ) . ", " . (int)$limit : "";
2098
-
2099
-        $sql = "SELECT SQL_CALC_FOUND_ROWS " . $fields . " FROM " . $wpdb->posts . "
2068
+		$rows = (int)$wpdb->get_var($sql);
2069
+	} else {
2070
+		$orderby = geodir_widget_listings_get_order($query_args);
2071
+		/**
2072
+		 * Filter widget listing orderby clause string part that is being used for query.
2073
+		 *
2074
+		 * @since 1.0.0
2075
+		 * @param string $orderby Order by clause string.
2076
+		 * @param string $table Table name.
2077
+		 * @param string $post_type Post type.
2078
+		 */
2079
+		$orderby = apply_filters('geodir_filter_widget_listings_orderby', $orderby, $table, $post_type);
2080
+		$orderby .= $wpdb->posts . ".post_title ASC";
2081
+		$orderby = $orderby != '' ? " ORDER BY " . $orderby : '';
2082
+
2083
+		$limit = !empty($query_args['posts_per_page']) ? $query_args['posts_per_page'] : 5;
2084
+		/**
2085
+		 * Filter widget listing limit that is being used for query.
2086
+		 *
2087
+		 * @since 1.0.0
2088
+		 * @param int $limit Query results limit.
2089
+		 * @param string $post_type Post type.
2090
+		 */
2091
+		$limit = apply_filters('geodir_filter_widget_listings_limit', $limit, $post_type);
2092
+
2093
+		$page = !empty($query_args['pageno']) ? absint($query_args['pageno']) : 1;
2094
+		if ( !$page )
2095
+			$page = 1;
2096
+
2097
+		$limit = (int)$limit > 0 ? " LIMIT " . absint( ( $page - 1 ) * (int)$limit ) . ", " . (int)$limit : "";
2098
+
2099
+		$sql = "SELECT SQL_CALC_FOUND_ROWS " . $fields . " FROM " . $wpdb->posts . "
2100 2100
 			" . $join . "
2101 2101
 			" . $where . "
2102 2102
 			" . $groupby . "
2103 2103
 			" . $orderby . "
2104 2104
 			" . $limit;
2105
-        $rows = $wpdb->get_results($sql);
2106
-    }
2105
+		$rows = $wpdb->get_results($sql);
2106
+	}
2107 2107
 
2108
-    unset($GLOBALS['gd_query_args_widgets']);
2109
-    unset($gd_query_args_widgets);
2108
+	unset($GLOBALS['gd_query_args_widgets']);
2109
+	unset($gd_query_args_widgets);
2110 2110
 
2111
-    return $rows;
2111
+	return $rows;
2112 2112
 }
2113 2113
 
2114 2114
 /**
@@ -2123,14 +2123,14 @@  discard block
 block discarded – undo
2123 2123
  */
2124 2124
 function geodir_function_widget_listings_fields($fields)
2125 2125
 {
2126
-    global $wpdb, $plugin_prefix, $gd_query_args_widgets;
2126
+	global $wpdb, $plugin_prefix, $gd_query_args_widgets;
2127 2127
 
2128
-    $query_args = $gd_query_args_widgets;
2129
-    if (empty($query_args) || empty($query_args['is_geodir_loop'])) {
2130
-        return $fields;
2131
-    }
2128
+	$query_args = $gd_query_args_widgets;
2129
+	if (empty($query_args) || empty($query_args['is_geodir_loop'])) {
2130
+		return $fields;
2131
+	}
2132 2132
     
2133
-    return $fields;
2133
+	return $fields;
2134 2134
 }
2135 2135
 
2136 2136
 /**
@@ -2145,28 +2145,28 @@  discard block
 block discarded – undo
2145 2145
  */
2146 2146
 function geodir_function_widget_listings_join($join)
2147 2147
 {
2148
-    global $wpdb, $plugin_prefix, $gd_query_args_widgets;
2148
+	global $wpdb, $plugin_prefix, $gd_query_args_widgets;
2149 2149
 
2150
-    $query_args = $gd_query_args_widgets;
2151
-    if (empty($query_args) || empty($query_args['is_geodir_loop'])) {
2152
-        return $join;
2153
-    }
2150
+	$query_args = $gd_query_args_widgets;
2151
+	if (empty($query_args) || empty($query_args['is_geodir_loop'])) {
2152
+		return $join;
2153
+	}
2154 2154
 
2155
-    $post_type = empty($query_args['post_type']) ? 'gd_place' : $query_args['post_type'];
2156
-    $table = $plugin_prefix . $post_type . '_detail';
2155
+	$post_type = empty($query_args['post_type']) ? 'gd_place' : $query_args['post_type'];
2156
+	$table = $plugin_prefix . $post_type . '_detail';
2157 2157
 
2158
-    if (!empty($query_args['with_pics_only'])) {
2159
-        $join .= " LEFT JOIN " . GEODIR_ATTACHMENT_TABLE . " ON ( " . GEODIR_ATTACHMENT_TABLE . ".post_id=" . $table . ".post_id AND " . GEODIR_ATTACHMENT_TABLE . ".mime_type LIKE '%image%' )";
2160
-    }
2158
+	if (!empty($query_args['with_pics_only'])) {
2159
+		$join .= " LEFT JOIN " . GEODIR_ATTACHMENT_TABLE . " ON ( " . GEODIR_ATTACHMENT_TABLE . ".post_id=" . $table . ".post_id AND " . GEODIR_ATTACHMENT_TABLE . ".mime_type LIKE '%image%' )";
2160
+	}
2161 2161
 
2162
-    if (!empty($query_args['tax_query'])) {
2163
-        $tax_queries = get_tax_sql($query_args['tax_query'], $wpdb->posts, 'ID');
2164
-        if (!empty($tax_queries['join']) && !empty($tax_queries['where'])) {
2165
-            $join .= $tax_queries['join'];
2166
-        }
2167
-    }
2162
+	if (!empty($query_args['tax_query'])) {
2163
+		$tax_queries = get_tax_sql($query_args['tax_query'], $wpdb->posts, 'ID');
2164
+		if (!empty($tax_queries['join']) && !empty($tax_queries['where'])) {
2165
+			$join .= $tax_queries['join'];
2166
+		}
2167
+	}
2168 2168
 
2169
-    return $join;
2169
+	return $join;
2170 2170
 }
2171 2171
 
2172 2172
 /**
@@ -2181,54 +2181,54 @@  discard block
 block discarded – undo
2181 2181
  */
2182 2182
 function geodir_function_widget_listings_where($where)
2183 2183
 {
2184
-    global $wpdb, $plugin_prefix, $gd_query_args_widgets;
2185
-
2186
-    $query_args = $gd_query_args_widgets;
2187
-    if (empty($query_args) || empty($query_args['is_geodir_loop'])) {
2188
-        return $where;
2189
-    }
2190
-    $post_type = empty($query_args['post_type']) ? 'gd_place' : $query_args['post_type'];
2191
-    $table = $plugin_prefix . $post_type . '_detail';
2192
-
2193
-    if (!empty($query_args)) {
2194
-        if (!empty($query_args['gd_location']) && function_exists('geodir_default_location_where')) {
2195
-            $where = geodir_default_location_where($where, $table);
2196
-        }
2197
-
2198
-        if (!empty($query_args['post_author'])) {
2199
-            $where .= " AND " . $wpdb->posts . ".post_author = " . (int)$query_args['post_author'];
2200
-        }
2184
+	global $wpdb, $plugin_prefix, $gd_query_args_widgets;
2185
+
2186
+	$query_args = $gd_query_args_widgets;
2187
+	if (empty($query_args) || empty($query_args['is_geodir_loop'])) {
2188
+		return $where;
2189
+	}
2190
+	$post_type = empty($query_args['post_type']) ? 'gd_place' : $query_args['post_type'];
2191
+	$table = $plugin_prefix . $post_type . '_detail';
2192
+
2193
+	if (!empty($query_args)) {
2194
+		if (!empty($query_args['gd_location']) && function_exists('geodir_default_location_where')) {
2195
+			$where = geodir_default_location_where($where, $table);
2196
+		}
2197
+
2198
+		if (!empty($query_args['post_author'])) {
2199
+			$where .= " AND " . $wpdb->posts . ".post_author = " . (int)$query_args['post_author'];
2200
+		}
2201 2201
         
2202
-        if (!empty($query_args['show_featured_only'])) {
2203
-            $where .= " AND " . $table . ".is_featured = '1'";
2204
-        }
2202
+		if (!empty($query_args['show_featured_only'])) {
2203
+			$where .= " AND " . $table . ".is_featured = '1'";
2204
+		}
2205 2205
 
2206
-        if (!empty($query_args['show_special_only'])) {
2207
-            $where .= " AND ( " . $table . ".geodir_special_offers != '' AND " . $table . ".geodir_special_offers IS NOT NULL )";
2208
-        }
2206
+		if (!empty($query_args['show_special_only'])) {
2207
+			$where .= " AND ( " . $table . ".geodir_special_offers != '' AND " . $table . ".geodir_special_offers IS NOT NULL )";
2208
+		}
2209 2209
 
2210
-        if (!empty($query_args['with_pics_only'])) {
2211
-            $where .= " AND " . GEODIR_ATTACHMENT_TABLE . ".ID IS NOT NULL ";
2212
-        }
2210
+		if (!empty($query_args['with_pics_only'])) {
2211
+			$where .= " AND " . GEODIR_ATTACHMENT_TABLE . ".ID IS NOT NULL ";
2212
+		}
2213 2213
 
2214
-        if (!empty($query_args['featured_image_only'])) {
2215
-            $where .= " AND " . $table . ".featured_image IS NOT NULL AND " . $table . ".featured_image!='' ";
2216
-        }
2214
+		if (!empty($query_args['featured_image_only'])) {
2215
+			$where .= " AND " . $table . ".featured_image IS NOT NULL AND " . $table . ".featured_image!='' ";
2216
+		}
2217 2217
 
2218
-        if (!empty($query_args['with_videos_only'])) {
2219
-            $where .= " AND ( " . $table . ".geodir_video != '' AND " . $table . ".geodir_video IS NOT NULL )";
2220
-        }
2218
+		if (!empty($query_args['with_videos_only'])) {
2219
+			$where .= " AND ( " . $table . ".geodir_video != '' AND " . $table . ".geodir_video IS NOT NULL )";
2220
+		}
2221 2221
 
2222
-        if (!empty($query_args['tax_query'])) {
2223
-            $tax_queries = get_tax_sql($query_args['tax_query'], $wpdb->posts, 'ID');
2222
+		if (!empty($query_args['tax_query'])) {
2223
+			$tax_queries = get_tax_sql($query_args['tax_query'], $wpdb->posts, 'ID');
2224 2224
 
2225
-            if (!empty($tax_queries['join']) && !empty($tax_queries['where'])) {
2226
-                $where .= $tax_queries['where'];
2227
-            }
2228
-        }
2229
-    }
2225
+			if (!empty($tax_queries['join']) && !empty($tax_queries['where'])) {
2226
+				$where .= $tax_queries['where'];
2227
+			}
2228
+		}
2229
+	}
2230 2230
 
2231
-    return $where;
2231
+	return $where;
2232 2232
 }
2233 2233
 
2234 2234
 /**
@@ -2243,14 +2243,14 @@  discard block
 block discarded – undo
2243 2243
  */
2244 2244
 function geodir_function_widget_listings_orderby($orderby)
2245 2245
 {
2246
-    global $wpdb, $plugin_prefix, $gd_query_args_widgets;
2246
+	global $wpdb, $plugin_prefix, $gd_query_args_widgets;
2247 2247
 
2248
-    $query_args = $gd_query_args_widgets;
2249
-    if (empty($query_args) || empty($query_args['is_geodir_loop'])) {
2250
-        return $orderby;
2251
-    }
2248
+	$query_args = $gd_query_args_widgets;
2249
+	if (empty($query_args) || empty($query_args['is_geodir_loop'])) {
2250
+		return $orderby;
2251
+	}
2252 2252
 
2253
-    return $orderby;
2253
+	return $orderby;
2254 2254
 }
2255 2255
 
2256 2256
 /**
@@ -2265,18 +2265,18 @@  discard block
 block discarded – undo
2265 2265
  */
2266 2266
 function geodir_function_widget_listings_limit($limit)
2267 2267
 {
2268
-    global $wpdb, $plugin_prefix, $gd_query_args_widgets;
2268
+	global $wpdb, $plugin_prefix, $gd_query_args_widgets;
2269 2269
 
2270
-    $query_args = $gd_query_args_widgets;
2271
-    if (empty($query_args) || empty($query_args['is_geodir_loop'])) {
2272
-        return $limit;
2273
-    }
2270
+	$query_args = $gd_query_args_widgets;
2271
+	if (empty($query_args) || empty($query_args['is_geodir_loop'])) {
2272
+		return $limit;
2273
+	}
2274 2274
 
2275
-    if (!empty($query_args) && !empty($query_args['posts_per_page'])) {
2276
-        $limit = (int)$query_args['posts_per_page'];
2277
-    }
2275
+	if (!empty($query_args) && !empty($query_args['posts_per_page'])) {
2276
+		$limit = (int)$query_args['posts_per_page'];
2277
+	}
2278 2278
 
2279
-    return $limit;
2279
+	return $limit;
2280 2280
 }
2281 2281
 
2282 2282
 /**
@@ -2290,24 +2290,24 @@  discard block
 block discarded – undo
2290 2290
  */
2291 2291
 function geodir_media_image_large_width($default = 800, $params = '')
2292 2292
 {
2293
-    $large_size_w = get_option('large_size_w');
2294
-    $large_size_w = $large_size_w > 0 ? $large_size_w : $default;
2295
-    $large_size_w = absint($large_size_w);
2296
-
2297
-    if (!get_option('geodir_use_wp_media_large_size')) {
2298
-        $large_size_w = 800;
2299
-    }
2300
-
2301
-    /**
2302
-     * Filter large image width.
2303
-     *
2304
-     * @since 1.0.0
2305
-     * @param int $large_size_w Large image width.
2306
-     * @param int $default Default width.
2307
-     * @param string|array $params Image parameters.
2308
-     */
2309
-    $large_size_w = apply_filters('geodir_filter_media_image_large_width', $large_size_w, $default, $params);
2310
-    return $large_size_w;
2293
+	$large_size_w = get_option('large_size_w');
2294
+	$large_size_w = $large_size_w > 0 ? $large_size_w : $default;
2295
+	$large_size_w = absint($large_size_w);
2296
+
2297
+	if (!get_option('geodir_use_wp_media_large_size')) {
2298
+		$large_size_w = 800;
2299
+	}
2300
+
2301
+	/**
2302
+	 * Filter large image width.
2303
+	 *
2304
+	 * @since 1.0.0
2305
+	 * @param int $large_size_w Large image width.
2306
+	 * @param int $default Default width.
2307
+	 * @param string|array $params Image parameters.
2308
+	 */
2309
+	$large_size_w = apply_filters('geodir_filter_media_image_large_width', $large_size_w, $default, $params);
2310
+	return $large_size_w;
2311 2311
 }
2312 2312
 
2313 2313
 /**
@@ -2321,25 +2321,25 @@  discard block
 block discarded – undo
2321 2321
  */
2322 2322
 function geodir_media_image_large_height($default = 800, $params = '')
2323 2323
 {
2324
-    $large_size_h = get_option('large_size_h');
2325
-    $large_size_h = $large_size_h > 0 ? $large_size_h : $default;
2326
-    $large_size_h = absint($large_size_h);
2327
-
2328
-    if (!get_option('geodir_use_wp_media_large_size')) {
2329
-        $large_size_h = 800;
2330
-    }
2331
-
2332
-    /**
2333
-     * Filter large image height.
2334
-     *
2335
-     * @since 1.0.0
2336
-     * @param int $large_size_h Large image height.
2337
-     * @param int $default Default height.
2338
-     * @param string|array $params Image parameters.
2339
-     */
2340
-    $large_size_h = apply_filters('geodir_filter_media_image_large_height', $large_size_h, $default, $params);
2341
-
2342
-    return $large_size_h;
2324
+	$large_size_h = get_option('large_size_h');
2325
+	$large_size_h = $large_size_h > 0 ? $large_size_h : $default;
2326
+	$large_size_h = absint($large_size_h);
2327
+
2328
+	if (!get_option('geodir_use_wp_media_large_size')) {
2329
+		$large_size_h = 800;
2330
+	}
2331
+
2332
+	/**
2333
+	 * Filter large image height.
2334
+	 *
2335
+	 * @since 1.0.0
2336
+	 * @param int $large_size_h Large image height.
2337
+	 * @param int $default Default height.
2338
+	 * @param string|array $params Image parameters.
2339
+	 */
2340
+	$large_size_h = apply_filters('geodir_filter_media_image_large_height', $large_size_h, $default, $params);
2341
+
2342
+	return $large_size_h;
2343 2343
 }
2344 2344
 
2345 2345
 /**
@@ -2354,25 +2354,25 @@  discard block
 block discarded – undo
2354 2354
  */
2355 2355
 function geodir_sanitize_location_name($type, $name, $translate = true)
2356 2356
 {
2357
-    if ($name == '') {
2358
-        return NULL;
2359
-    }
2360
-
2361
-    $type = $type == 'gd_country' ? 'country' : $type;
2362
-    $type = $type == 'gd_region' ? 'region' : $type;
2363
-    $type = $type == 'gd_city' ? 'city' : $type;
2364
-
2365
-    $return = $name;
2366
-    if (function_exists('get_actual_location_name')) {
2367
-        $return = get_actual_location_name($type, $name, $translate);
2368
-    } else {
2369
-        $return = preg_replace('/-(\d+)$/', '', $return);
2370
-        $return = preg_replace('/[_-]/', ' ', $return);
2371
-        $return = geodir_ucwords($return);
2372
-        $return = $translate ? __($return, 'geodirectory') : $return;
2373
-    }
2374
-
2375
-    return $return;
2357
+	if ($name == '') {
2358
+		return NULL;
2359
+	}
2360
+
2361
+	$type = $type == 'gd_country' ? 'country' : $type;
2362
+	$type = $type == 'gd_region' ? 'region' : $type;
2363
+	$type = $type == 'gd_city' ? 'city' : $type;
2364
+
2365
+	$return = $name;
2366
+	if (function_exists('get_actual_location_name')) {
2367
+		$return = get_actual_location_name($type, $name, $translate);
2368
+	} else {
2369
+		$return = preg_replace('/-(\d+)$/', '', $return);
2370
+		$return = preg_replace('/[_-]/', ' ', $return);
2371
+		$return = geodir_ucwords($return);
2372
+		$return = $translate ? __($return, 'geodirectory') : $return;
2373
+	}
2374
+
2375
+	return $return;
2376 2376
 }
2377 2377
 
2378 2378
 
@@ -2386,14 +2386,14 @@  discard block
 block discarded – undo
2386 2386
 function geodir_comments_number($number)
2387 2387
 {
2388 2388
 
2389
-    if ($number > 1) {
2390
-        $output = str_replace('%', number_format_i18n($number), __('% Reviews', 'geodirectory'));
2391
-    } elseif ($number == 0 || $number == '') {
2392
-        $output = __('No Reviews', 'geodirectory');
2393
-    } else { // must be one
2394
-        $output = __('1 Review', 'geodirectory');
2395
-    }
2396
-    echo $output;
2389
+	if ($number > 1) {
2390
+		$output = str_replace('%', number_format_i18n($number), __('% Reviews', 'geodirectory'));
2391
+	} elseif ($number == 0 || $number == '') {
2392
+		$output = __('No Reviews', 'geodirectory');
2393
+	} else { // must be one
2394
+		$output = __('1 Review', 'geodirectory');
2395
+	}
2396
+	echo $output;
2397 2397
 }
2398 2398
 
2399 2399
 /**
@@ -2406,23 +2406,23 @@  discard block
 block discarded – undo
2406 2406
  */
2407 2407
 function is_page_geodir_home()
2408 2408
 {
2409
-    global $wpdb;
2410
-    $cur_url = str_replace(array("https://", "http://", "www."), array('', '', ''), geodir_curPageURL());
2411
-    if (function_exists('geodir_location_geo_home_link')) {
2412
-        remove_filter('home_url', 'geodir_location_geo_home_link', 100000);
2413
-    }
2414
-    $home_url = home_url('', 'http');
2415
-    if (function_exists('geodir_location_geo_home_link')) {
2416
-        add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2);
2417
-    }
2418
-    $home_url = str_replace("www.", "", $home_url);
2419
-    if ( (strpos($home_url, $cur_url) !== false || strpos($home_url . '/', $cur_url) !== false) && ('page' == get_option('show_on_front') && get_option('page_on_front') && get_option('page_on_front')==get_option('geodir_home_page')) ) {
2420
-        return true;
2421
-    }elseif(get_query_var('page_id') == get_option('page_on_front') && 'page' == get_option('show_on_front') && get_option('page_on_front') && get_option('page_on_front')==get_option('geodir_home_page')){
2422
-        return true;
2423
-    } else {
2424
-        return false;
2425
-    }
2409
+	global $wpdb;
2410
+	$cur_url = str_replace(array("https://", "http://", "www."), array('', '', ''), geodir_curPageURL());
2411
+	if (function_exists('geodir_location_geo_home_link')) {
2412
+		remove_filter('home_url', 'geodir_location_geo_home_link', 100000);
2413
+	}
2414
+	$home_url = home_url('', 'http');
2415
+	if (function_exists('geodir_location_geo_home_link')) {
2416
+		add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2);
2417
+	}
2418
+	$home_url = str_replace("www.", "", $home_url);
2419
+	if ( (strpos($home_url, $cur_url) !== false || strpos($home_url . '/', $cur_url) !== false) && ('page' == get_option('show_on_front') && get_option('page_on_front') && get_option('page_on_front')==get_option('geodir_home_page')) ) {
2420
+		return true;
2421
+	}elseif(get_query_var('page_id') == get_option('page_on_front') && 'page' == get_option('show_on_front') && get_option('page_on_front') && get_option('page_on_front')==get_option('geodir_home_page')){
2422
+		return true;
2423
+	} else {
2424
+		return false;
2425
+	}
2426 2426
 
2427 2427
 }
2428 2428
 
@@ -2438,13 +2438,13 @@  discard block
 block discarded – undo
2438 2438
  */
2439 2439
 function geodir_wpseo_homepage_canonical($url)
2440 2440
 {
2441
-    global $post;
2441
+	global $post;
2442 2442
 
2443
-    if (is_page_geodir_home()) {
2444
-        return home_url();
2445
-    }
2443
+	if (is_page_geodir_home()) {
2444
+		return home_url();
2445
+	}
2446 2446
 
2447
-    return $url;
2447
+	return $url;
2448 2448
 }
2449 2449
 
2450 2450
 add_filter('wpseo_canonical', 'geodir_wpseo_homepage_canonical', 10);
@@ -2461,16 +2461,16 @@  discard block
 block discarded – undo
2461 2461
  */
2462 2462
 function geodir_googlemap_script_extra_details_page($extra)
2463 2463
 {
2464
-    global $post;
2465
-    $add_google_places_api = false;
2466
-    if (isset($post->post_content) && has_shortcode($post->post_content, 'gd_add_listing')) {
2467
-        $add_google_places_api = true;
2468
-    }
2469
-    if (!str_replace('libraries=places', '', $extra) && (geodir_is_page('detail') || $add_google_places_api)) {
2470
-        $extra .= "&amp;libraries=places";
2471
-    }
2472
-
2473
-    return $extra;
2464
+	global $post;
2465
+	$add_google_places_api = false;
2466
+	if (isset($post->post_content) && has_shortcode($post->post_content, 'gd_add_listing')) {
2467
+		$add_google_places_api = true;
2468
+	}
2469
+	if (!str_replace('libraries=places', '', $extra) && (geodir_is_page('detail') || $add_google_places_api)) {
2470
+		$extra .= "&amp;libraries=places";
2471
+	}
2472
+
2473
+	return $extra;
2474 2474
 }
2475 2475
 
2476 2476
 add_filter('geodir_googlemap_script_extra', 'geodir_googlemap_script_extra_details_page', 101, 1);
@@ -2490,98 +2490,98 @@  discard block
 block discarded – undo
2490 2490
  */
2491 2491
 function geodir_popular_post_category_output($args = '', $instance = '')
2492 2492
 {
2493
-    // prints the widget
2494
-    global $wpdb, $plugin_prefix, $geodir_post_category_str;
2495
-    extract($args, EXTR_SKIP);
2496
-
2497
-    echo $before_widget;
2498
-
2499
-    /** This filter is documented in geodirectory_widgets.php */
2500
-    $title = empty($instance['title']) ? __('Popular Categories', 'geodirectory') : apply_filters('widget_title', __($instance['title'], 'geodirectory'));
2501
-
2502
-    $gd_post_type = geodir_get_current_posttype();
2503
-
2504
-    $category_limit = isset($instance['category_limit']) && $instance['category_limit'] > 0 ? (int)$instance['category_limit'] : 15;
2505
-    if(!empty($gd_post_type)){
2506
-        $default_post_type = $gd_post_type;
2507
-    }elseif(isset($instance['default_post_type']) && gdsc_is_post_type_valid($instance['default_post_type']) ){
2508
-        $default_post_type = $instance['default_post_type'];
2509
-    }else{
2510
-        $all_gd_post_type = geodir_get_posttypes();
2511
-        $default_post_type = (isset($all_gd_post_type[0])) ? $all_gd_post_type[0] : '';
2512
-    }
2513
-
2514
-    $taxonomy = array();
2515
-    if (!empty($gd_post_type)) {
2516
-        $taxonomy[] = $gd_post_type . "category";
2517
-    } else {
2518
-        $taxonomy = geodir_get_taxonomies($gd_post_type);
2519
-    }
2520
-
2521
-    $terms = get_terms($taxonomy);
2522
-    $a_terms = array();
2523
-    $b_terms = array();
2524
-
2525
-    foreach ($terms as $term) {
2526
-        if ($term->count > 0) {
2527
-            $a_terms[$term->taxonomy][] = $term;
2528
-        }
2529
-    }
2530
-
2531
-    if (!empty($a_terms)) {
2532
-        foreach ($a_terms as $b_key => $b_val) {
2533
-            $b_terms[$b_key] = geodir_sort_terms($b_val, 'count');
2534
-        }
2535
-
2536
-        $default_taxonomy = $default_post_type != '' && isset($b_terms[$default_post_type . 'category']) ? $default_post_type . 'category' : '';
2537
-
2538
-        $tax_change_output = '';
2539
-        if (count($b_terms) > 1) {
2540
-            $tax_change_output .= "<select data-limit='$category_limit' class='geodir-cat-list-tax'  onchange='geodir_get_post_term(this);'>";
2541
-            foreach ($b_terms as $key => $val) {
2542
-                $ptype = get_post_type_object(str_replace("category", "", $key));
2543
-                $cpt_name = __($ptype->labels->singular_name, 'geodirectory');
2544
-                $tax_change_output .= "<option value='$key' ". selected($key, $default_taxonomy, false) .">" . sprintf(__('%s Categories', 'geodirectory'),$cpt_name) . "</option>";
2545
-            }
2546
-            $tax_change_output .= "</select>";
2547
-        }
2548
-
2549
-        if (!empty($b_terms)) {
2550
-            $terms = $default_taxonomy != '' && isset($b_terms[$default_taxonomy]) ? $b_terms[$default_taxonomy] : reset($b_terms);// get the first array
2551
-            global $cat_count;//make global so we can change via function
2552
-            $cat_count = 0;
2553
-            ?>
2493
+	// prints the widget
2494
+	global $wpdb, $plugin_prefix, $geodir_post_category_str;
2495
+	extract($args, EXTR_SKIP);
2496
+
2497
+	echo $before_widget;
2498
+
2499
+	/** This filter is documented in geodirectory_widgets.php */
2500
+	$title = empty($instance['title']) ? __('Popular Categories', 'geodirectory') : apply_filters('widget_title', __($instance['title'], 'geodirectory'));
2501
+
2502
+	$gd_post_type = geodir_get_current_posttype();
2503
+
2504
+	$category_limit = isset($instance['category_limit']) && $instance['category_limit'] > 0 ? (int)$instance['category_limit'] : 15;
2505
+	if(!empty($gd_post_type)){
2506
+		$default_post_type = $gd_post_type;
2507
+	}elseif(isset($instance['default_post_type']) && gdsc_is_post_type_valid($instance['default_post_type']) ){
2508
+		$default_post_type = $instance['default_post_type'];
2509
+	}else{
2510
+		$all_gd_post_type = geodir_get_posttypes();
2511
+		$default_post_type = (isset($all_gd_post_type[0])) ? $all_gd_post_type[0] : '';
2512
+	}
2513
+
2514
+	$taxonomy = array();
2515
+	if (!empty($gd_post_type)) {
2516
+		$taxonomy[] = $gd_post_type . "category";
2517
+	} else {
2518
+		$taxonomy = geodir_get_taxonomies($gd_post_type);
2519
+	}
2520
+
2521
+	$terms = get_terms($taxonomy);
2522
+	$a_terms = array();
2523
+	$b_terms = array();
2524
+
2525
+	foreach ($terms as $term) {
2526
+		if ($term->count > 0) {
2527
+			$a_terms[$term->taxonomy][] = $term;
2528
+		}
2529
+	}
2530
+
2531
+	if (!empty($a_terms)) {
2532
+		foreach ($a_terms as $b_key => $b_val) {
2533
+			$b_terms[$b_key] = geodir_sort_terms($b_val, 'count');
2534
+		}
2535
+
2536
+		$default_taxonomy = $default_post_type != '' && isset($b_terms[$default_post_type . 'category']) ? $default_post_type . 'category' : '';
2537
+
2538
+		$tax_change_output = '';
2539
+		if (count($b_terms) > 1) {
2540
+			$tax_change_output .= "<select data-limit='$category_limit' class='geodir-cat-list-tax'  onchange='geodir_get_post_term(this);'>";
2541
+			foreach ($b_terms as $key => $val) {
2542
+				$ptype = get_post_type_object(str_replace("category", "", $key));
2543
+				$cpt_name = __($ptype->labels->singular_name, 'geodirectory');
2544
+				$tax_change_output .= "<option value='$key' ". selected($key, $default_taxonomy, false) .">" . sprintf(__('%s Categories', 'geodirectory'),$cpt_name) . "</option>";
2545
+			}
2546
+			$tax_change_output .= "</select>";
2547
+		}
2548
+
2549
+		if (!empty($b_terms)) {
2550
+			$terms = $default_taxonomy != '' && isset($b_terms[$default_taxonomy]) ? $b_terms[$default_taxonomy] : reset($b_terms);// get the first array
2551
+			global $cat_count;//make global so we can change via function
2552
+			$cat_count = 0;
2553
+			?>
2554 2554
             <div class="geodir-category-list-in clearfix">
2555 2555
                 <div class="geodir-cat-list clearfix">
2556 2556
                     <?php
2557
-                    echo $before_title . __($title) . $after_title;
2557
+					echo $before_title . __($title) . $after_title;
2558 2558
 
2559
-                    echo $tax_change_output;
2559
+					echo $tax_change_output;
2560 2560
 
2561
-                    echo '<ul class="geodir-popular-cat-list">';
2561
+					echo '<ul class="geodir-popular-cat-list">';
2562 2562
 
2563
-                    geodir_helper_cat_list_output($terms, $category_limit);
2563
+					geodir_helper_cat_list_output($terms, $category_limit);
2564 2564
 
2565
-                    echo '</ul>';
2566
-                    ?>
2565
+					echo '</ul>';
2566
+					?>
2567 2567
                 </div>
2568 2568
                 <?php
2569
-                $hide = '';
2570
-                if ($cat_count < $category_limit) {
2571
-                    $hide = 'style="display:none;"';
2572
-                }
2573
-                echo "<div class='geodir-cat-list-more' $hide >";
2574
-                echo '<a href="javascript:void(0)" class="geodir-morecat geodir-showcat">' . __('More Categories', 'geodirectory') . '</a>';
2575
-                echo '<a href="javascript:void(0)" class="geodir-morecat geodir-hidecat geodir-hide">' . __('Less Categories', 'geodirectory') . '</a>';
2576
-                echo "</div>";
2577
-                /* add scripts */
2578
-                add_action('wp_footer', 'geodir_popular_category_add_scripts', 100);
2579
-                ?>
2569
+				$hide = '';
2570
+				if ($cat_count < $category_limit) {
2571
+					$hide = 'style="display:none;"';
2572
+				}
2573
+				echo "<div class='geodir-cat-list-more' $hide >";
2574
+				echo '<a href="javascript:void(0)" class="geodir-morecat geodir-showcat">' . __('More Categories', 'geodirectory') . '</a>';
2575
+				echo '<a href="javascript:void(0)" class="geodir-morecat geodir-hidecat geodir-hide">' . __('Less Categories', 'geodirectory') . '</a>';
2576
+				echo "</div>";
2577
+				/* add scripts */
2578
+				add_action('wp_footer', 'geodir_popular_category_add_scripts', 100);
2579
+				?>
2580 2580
             </div>
2581 2581
         <?php
2582
-        }
2583
-    }
2584
-    echo $after_widget;
2582
+		}
2583
+	}
2584
+	echo $after_widget;
2585 2585
 }
2586 2586
 
2587 2587
 /**
@@ -2595,38 +2595,38 @@  discard block
 block discarded – undo
2595 2595
  */
2596 2596
 function geodir_helper_cat_list_output($terms, $category_limit)
2597 2597
 {
2598
-    global $geodir_post_category_str, $cat_count;
2599
-    $term_icons = geodir_get_term_icon();
2598
+	global $geodir_post_category_str, $cat_count;
2599
+	$term_icons = geodir_get_term_icon();
2600 2600
 
2601
-    $geodir_post_category_str = array();
2601
+	$geodir_post_category_str = array();
2602 2602
 
2603 2603
 
2604
-    foreach ($terms as $cat) {
2605
-        $post_type = str_replace("category", "", $cat->taxonomy);
2606
-        $term_icon_url = !empty($term_icons) && isset($term_icons[$cat->term_id]) ? $term_icons[$cat->term_id] : '';
2604
+	foreach ($terms as $cat) {
2605
+		$post_type = str_replace("category", "", $cat->taxonomy);
2606
+		$term_icon_url = !empty($term_icons) && isset($term_icons[$cat->term_id]) ? $term_icons[$cat->term_id] : '';
2607 2607
 
2608
-        $cat_count++;
2608
+		$cat_count++;
2609 2609
 
2610
-        $geodir_post_category_str[] = array('posttype' => $post_type, 'termid' => $cat->term_id);
2610
+		$geodir_post_category_str[] = array('posttype' => $post_type, 'termid' => $cat->term_id);
2611 2611
 
2612
-        $class_row = $cat_count > $category_limit ? 'geodir-pcat-hide geodir-hide' : 'geodir-pcat-show';
2613
-        $total_post = $cat->count;
2612
+		$class_row = $cat_count > $category_limit ? 'geodir-pcat-hide geodir-hide' : 'geodir-pcat-show';
2613
+		$total_post = $cat->count;
2614 2614
 
2615
-        $term_link = get_term_link( $cat, $cat->taxonomy );
2616
-        /**
2617
-         * Filer the category term link.
2618
-         *
2619
-         * @since 1.4.5
2620
-         * @param string $term_link The term permalink.
2621
-         * @param int    $cat->term_id The term id.
2622
-         * @param string $post_type Wordpress post type.
2623
-         */
2624
-        $term_link = apply_filters( 'geodir_category_term_link', $term_link, $cat->term_id, $post_type );
2615
+		$term_link = get_term_link( $cat, $cat->taxonomy );
2616
+		/**
2617
+		 * Filer the category term link.
2618
+		 *
2619
+		 * @since 1.4.5
2620
+		 * @param string $term_link The term permalink.
2621
+		 * @param int    $cat->term_id The term id.
2622
+		 * @param string $post_type Wordpress post type.
2623
+		 */
2624
+		$term_link = apply_filters( 'geodir_category_term_link', $term_link, $cat->term_id, $post_type );
2625 2625
 
2626
-        echo '<li class="' . $class_row . '"><a href="' . $term_link . '">';
2627
-        echo '<img alt="' . esc_attr($cat->name) . ' icon" style="height:20px;vertical-align:middle;" src="' . $term_icon_url . '"/> <span class="cat-link">'; echo $cat->name . '</span> <span class="geodir_term_class geodir_link_span geodir_category_class_' . $post_type . '_' . $cat->term_id . '">(' . $total_post . ')</span> ';
2628
-        echo '</a></li>';
2629
-    }
2626
+		echo '<li class="' . $class_row . '"><a href="' . $term_link . '">';
2627
+		echo '<img alt="' . esc_attr($cat->name) . ' icon" style="height:20px;vertical-align:middle;" src="' . $term_icon_url . '"/> <span class="cat-link">'; echo $cat->name . '</span> <span class="geodir_term_class geodir_link_span geodir_category_class_' . $post_type . '_' . $cat->term_id . '">(' . $total_post . ')</span> ';
2628
+		echo '</a></li>';
2629
+	}
2630 2630
 }
2631 2631
 
2632 2632
 /**
@@ -2640,108 +2640,108 @@  discard block
 block discarded – undo
2640 2640
  */
2641 2641
 function geodir_listing_slider_widget_output($args = '', $instance = '')
2642 2642
 {
2643
-    // prints the widget
2644
-    extract($args, EXTR_SKIP);
2645
-
2646
-    echo $before_widget;
2647
-
2648
-    /** This filter is documented in geodirectory_widgets.php */
2649
-    $title = empty($instance['title']) ? '' : apply_filters('widget_title', __($instance['title'], 'geodirectory'));
2650
-    /**
2651
-     * Filter the widget post type.
2652
-     *
2653
-     * @since 1.0.0
2654
-     * @param string $instance['post_type'] Post type of listing.
2655
-     */
2656
-    $post_type = empty($instance['post_type']) ? 'gd_place' : apply_filters('widget_post_type', $instance['post_type']);
2657
-    /**
2658
-     * Filter the widget's term.
2659
-     *
2660
-     * @since 1.0.0
2661
-     * @param string $instance['category'] Filter by term. Can be any valid term.
2662
-     */
2663
-    $category = empty($instance['category']) ? '0' : apply_filters('widget_category', $instance['category']);
2664
-    /**
2665
-     * Filter the widget listings limit.
2666
-     *
2667
-     * @since 1.0.0
2668
-     * @param string $instance['post_number'] Number of listings to display.
2669
-     */
2670
-    $post_number = empty($instance['post_number']) ? '5' : apply_filters('widget_post_number', $instance['post_number']);
2671
-    /**
2672
-     * Filter the widget listings limit shown at one time.
2673
-     *
2674
-     * @since 1.5.0
2675
-     * @param string $instance['max_show'] Number of listings to display on screen.
2676
-     */
2677
-    $max_show = empty($instance['max_show']) ? '1' : apply_filters('widget_max_show', $instance['max_show']);
2678
-    /**
2679
-     * Filter the widget slide width.
2680
-     *
2681
-     * @since 1.5.0
2682
-     * @param string $instance['slide_width'] Width of the slides shown.
2683
-     */
2684
-    $slide_width = empty($instance['slide_width']) ? '' : apply_filters('widget_slide_width', $instance['slide_width']);
2685
-    /**
2686
-     * Filter widget's "show title" value.
2687
-     *
2688
-     * @since 1.0.0
2689
-     * @param string|bool $instance['show_title'] Do you want to display title? Can be 1 or 0.
2690
-     */
2691
-    $show_title = empty($instance['show_title']) ? '' : apply_filters('widget_show_title', $instance['show_title']);
2692
-    /**
2693
-     * Filter widget's "slideshow" value.
2694
-     *
2695
-     * @since 1.0.0
2696
-     * @param int $instance['slideshow'] Setup a slideshow for the slider to animate automatically.
2697
-     */
2698
-    $slideshow = empty($instance['slideshow']) ? 0 : apply_filters('widget_slideshow', $instance['slideshow']);
2699
-    /**
2700
-     * Filter widget's "animationLoop" value.
2701
-     *
2702
-     * @since 1.0.0
2703
-     * @param int $instance['animationLoop'] Gives the slider a seamless infinite loop.
2704
-     */
2705
-    $animationLoop = empty($instance['animationLoop']) ? 0 : apply_filters('widget_animationLoop', $instance['animationLoop']);
2706
-    /**
2707
-     * Filter widget's "directionNav" value.
2708
-     *
2709
-     * @since 1.0.0
2710
-     * @param int $instance['directionNav'] Enable previous/next arrow navigation?. Can be 1 or 0.
2711
-     */
2712
-    $directionNav = empty($instance['directionNav']) ? 0 : apply_filters('widget_directionNav', $instance['directionNav']);
2713
-    /**
2714
-     * Filter widget's "slideshowSpeed" value.
2715
-     *
2716
-     * @since 1.0.0
2717
-     * @param int $instance['slideshowSpeed'] Set the speed of the slideshow cycling, in milliseconds.
2718
-     */
2719
-    $slideshowSpeed = empty($instance['slideshowSpeed']) ? 5000 : apply_filters('widget_slideshowSpeed', $instance['slideshowSpeed']);
2720
-    /**
2721
-     * Filter widget's "animationSpeed" value.
2722
-     *
2723
-     * @since 1.0.0
2724
-     * @param int $instance['animationSpeed'] Set the speed of animations, in milliseconds.
2725
-     */
2726
-    $animationSpeed = empty($instance['animationSpeed']) ? 600 : apply_filters('widget_animationSpeed', $instance['animationSpeed']);
2727
-    /**
2728
-     * Filter widget's "animation" value.
2729
-     *
2730
-     * @since 1.0.0
2731
-     * @param string $instance['animation'] Controls the animation type, "fade" or "slide".
2732
-     */
2733
-    $animation = empty($instance['animation']) ? 'slide' : apply_filters('widget_animation', $instance['animation']);
2734
-    /**
2735
-     * Filter widget's "list_sort" type.
2736
-     *
2737
-     * @since 1.0.0
2738
-     * @param string $instance['list_sort'] Listing sort by type.
2739
-     */
2740
-    $list_sort = empty($instance['list_sort']) ? 'latest' : apply_filters('widget_list_sort', $instance['list_sort']);
2741
-    $show_featured_only = !empty($instance['show_featured_only']) ? 1 : NULL;
2742
-
2743
-    wp_enqueue_script('geodirectory-jquery-flexslider-js');
2744
-    ?>
2643
+	// prints the widget
2644
+	extract($args, EXTR_SKIP);
2645
+
2646
+	echo $before_widget;
2647
+
2648
+	/** This filter is documented in geodirectory_widgets.php */
2649
+	$title = empty($instance['title']) ? '' : apply_filters('widget_title', __($instance['title'], 'geodirectory'));
2650
+	/**
2651
+	 * Filter the widget post type.
2652
+	 *
2653
+	 * @since 1.0.0
2654
+	 * @param string $instance['post_type'] Post type of listing.
2655
+	 */
2656
+	$post_type = empty($instance['post_type']) ? 'gd_place' : apply_filters('widget_post_type', $instance['post_type']);
2657
+	/**
2658
+	 * Filter the widget's term.
2659
+	 *
2660
+	 * @since 1.0.0
2661
+	 * @param string $instance['category'] Filter by term. Can be any valid term.
2662
+	 */
2663
+	$category = empty($instance['category']) ? '0' : apply_filters('widget_category', $instance['category']);
2664
+	/**
2665
+	 * Filter the widget listings limit.
2666
+	 *
2667
+	 * @since 1.0.0
2668
+	 * @param string $instance['post_number'] Number of listings to display.
2669
+	 */
2670
+	$post_number = empty($instance['post_number']) ? '5' : apply_filters('widget_post_number', $instance['post_number']);
2671
+	/**
2672
+	 * Filter the widget listings limit shown at one time.
2673
+	 *
2674
+	 * @since 1.5.0
2675
+	 * @param string $instance['max_show'] Number of listings to display on screen.
2676
+	 */
2677
+	$max_show = empty($instance['max_show']) ? '1' : apply_filters('widget_max_show', $instance['max_show']);
2678
+	/**
2679
+	 * Filter the widget slide width.
2680
+	 *
2681
+	 * @since 1.5.0
2682
+	 * @param string $instance['slide_width'] Width of the slides shown.
2683
+	 */
2684
+	$slide_width = empty($instance['slide_width']) ? '' : apply_filters('widget_slide_width', $instance['slide_width']);
2685
+	/**
2686
+	 * Filter widget's "show title" value.
2687
+	 *
2688
+	 * @since 1.0.0
2689
+	 * @param string|bool $instance['show_title'] Do you want to display title? Can be 1 or 0.
2690
+	 */
2691
+	$show_title = empty($instance['show_title']) ? '' : apply_filters('widget_show_title', $instance['show_title']);
2692
+	/**
2693
+	 * Filter widget's "slideshow" value.
2694
+	 *
2695
+	 * @since 1.0.0
2696
+	 * @param int $instance['slideshow'] Setup a slideshow for the slider to animate automatically.
2697
+	 */
2698
+	$slideshow = empty($instance['slideshow']) ? 0 : apply_filters('widget_slideshow', $instance['slideshow']);
2699
+	/**
2700
+	 * Filter widget's "animationLoop" value.
2701
+	 *
2702
+	 * @since 1.0.0
2703
+	 * @param int $instance['animationLoop'] Gives the slider a seamless infinite loop.
2704
+	 */
2705
+	$animationLoop = empty($instance['animationLoop']) ? 0 : apply_filters('widget_animationLoop', $instance['animationLoop']);
2706
+	/**
2707
+	 * Filter widget's "directionNav" value.
2708
+	 *
2709
+	 * @since 1.0.0
2710
+	 * @param int $instance['directionNav'] Enable previous/next arrow navigation?. Can be 1 or 0.
2711
+	 */
2712
+	$directionNav = empty($instance['directionNav']) ? 0 : apply_filters('widget_directionNav', $instance['directionNav']);
2713
+	/**
2714
+	 * Filter widget's "slideshowSpeed" value.
2715
+	 *
2716
+	 * @since 1.0.0
2717
+	 * @param int $instance['slideshowSpeed'] Set the speed of the slideshow cycling, in milliseconds.
2718
+	 */
2719
+	$slideshowSpeed = empty($instance['slideshowSpeed']) ? 5000 : apply_filters('widget_slideshowSpeed', $instance['slideshowSpeed']);
2720
+	/**
2721
+	 * Filter widget's "animationSpeed" value.
2722
+	 *
2723
+	 * @since 1.0.0
2724
+	 * @param int $instance['animationSpeed'] Set the speed of animations, in milliseconds.
2725
+	 */
2726
+	$animationSpeed = empty($instance['animationSpeed']) ? 600 : apply_filters('widget_animationSpeed', $instance['animationSpeed']);
2727
+	/**
2728
+	 * Filter widget's "animation" value.
2729
+	 *
2730
+	 * @since 1.0.0
2731
+	 * @param string $instance['animation'] Controls the animation type, "fade" or "slide".
2732
+	 */
2733
+	$animation = empty($instance['animation']) ? 'slide' : apply_filters('widget_animation', $instance['animation']);
2734
+	/**
2735
+	 * Filter widget's "list_sort" type.
2736
+	 *
2737
+	 * @since 1.0.0
2738
+	 * @param string $instance['list_sort'] Listing sort by type.
2739
+	 */
2740
+	$list_sort = empty($instance['list_sort']) ? 'latest' : apply_filters('widget_list_sort', $instance['list_sort']);
2741
+	$show_featured_only = !empty($instance['show_featured_only']) ? 1 : NULL;
2742
+
2743
+	wp_enqueue_script('geodirectory-jquery-flexslider-js');
2744
+	?>
2745 2745
     <script type="text/javascript">
2746 2746
         jQuery(window).load(function () {
2747 2747
             jQuery('#geodir_widget_carousel').flexslider({
@@ -2782,86 +2782,86 @@  discard block
 block discarded – undo
2782 2782
         });
2783 2783
     </script>
2784 2784
     <?php
2785
-    $query_args = array(
2786
-        'posts_per_page' => $post_number,
2787
-        'is_geodir_loop' => true,
2788
-        'post_type' => $post_type,
2789
-        'order_by' => $list_sort
2790
-    );
2791
-    if ($show_featured_only) {
2792
-        $query_args['show_featured_only'] = 1;
2793
-    }
2794
-
2795
-    if ($category != 0 || $category != '') {
2796
-        $category_taxonomy = geodir_get_taxonomies($post_type);
2797
-        $tax_query = array(
2798
-            'taxonomy' => $category_taxonomy[0],
2799
-            'field' => 'id',
2800
-            'terms' => $category
2801
-        );
2802
-
2803
-        $query_args['tax_query'] = array($tax_query);
2804
-    }
2805
-
2806
-    // we want listings with featured image only
2807
-    $query_args['featured_image_only'] = 1;
2808
-
2809
-    if ($post_type == 'gd_event') {
2810
-        $query_args['gedir_event_listing_filter'] = 'upcoming';
2811
-    }// show only upcoming events
2812
-
2813
-    $widget_listings = geodir_get_widget_listings($query_args);
2814
-    if (!empty($widget_listings) || (isset($with_no_results) && $with_no_results)) {
2815
-        if ($title) {
2816
-            echo $before_title . $title . $after_title;
2817
-        }
2818
-
2819
-        global $post;
2820
-
2821
-        $current_post = $post;// keep current post info
2822
-
2823
-        $widget_main_slides = '';
2824
-        $nav_slides = '';
2825
-        $widget_slides = 0;
2826
-
2827
-        foreach ($widget_listings as $widget_listing) {
2828
-            global $gd_widget_listing_type;
2829
-            $post = $widget_listing;
2830
-            $widget_image = geodir_get_featured_image($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
2831
-
2832
-            if (!empty($widget_image)) {
2833
-                if ($widget_image->height >= 200) {
2834
-                    $widget_spacer_height = 0;
2835
-                } else {
2836
-                    $widget_spacer_height = ((200 - $widget_image->height) / 2);
2837
-                }
2838
-
2839
-                $widget_main_slides .= '<li class="geodir-listing-slider-widget"><img class="geodir-listing-slider-spacer" src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $widget_image->title . '" title="' . $widget_image->title . '" style="max-height:' . $widget_spacer_height . 'px !important;margin:0 auto;" width="100" />';
2840
-
2841
-                $title = '';
2842
-                if ($show_title) {
2843
-                    $title_html = '<div class="geodir-slider-title"><a href="' . get_permalink($post->ID) . '">' . get_the_title($post->ID) . '</a></div>';
2844
-                    $post_id = $post->ID;
2845
-                    $post_permalink = get_permalink($post->ID);
2846
-                    $post_title = get_the_title($post->ID);
2847
-                    /**
2848
-                     * Filter the listing slider widget title.
2849
-                     *
2850
-                     * @since 1.6.1
2851
-                     * @param string $title_html The html output of the title.
2852
-                     * @param int $post_id The post id.
2853
-                     * @param string $post_permalink The post permalink url.
2854
-                     * @param string $post_title The post title text.
2855
-                     */
2856
-                    $title = apply_filters('geodir_listing_slider_title',$title_html,$post_id,$post_permalink,$post_title);
2857
-                }
2858
-
2859
-                $widget_main_slides .= $title . '<img src="' . $widget_image->src . '" alt="' . $widget_image->title . '" title="' . $widget_image->title . '" style="max-height:200px;margin:0 auto;" /></li>';
2860
-                $nav_slides .= '<li><img src="' . $widget_image->src . '" alt="' . $widget_image->title . '" title="' . $widget_image->title . '" style="max-height:48px;margin:0 auto;" /></li>';
2861
-                $widget_slides++;
2862
-            }
2863
-        }
2864
-        ?>
2785
+	$query_args = array(
2786
+		'posts_per_page' => $post_number,
2787
+		'is_geodir_loop' => true,
2788
+		'post_type' => $post_type,
2789
+		'order_by' => $list_sort
2790
+	);
2791
+	if ($show_featured_only) {
2792
+		$query_args['show_featured_only'] = 1;
2793
+	}
2794
+
2795
+	if ($category != 0 || $category != '') {
2796
+		$category_taxonomy = geodir_get_taxonomies($post_type);
2797
+		$tax_query = array(
2798
+			'taxonomy' => $category_taxonomy[0],
2799
+			'field' => 'id',
2800
+			'terms' => $category
2801
+		);
2802
+
2803
+		$query_args['tax_query'] = array($tax_query);
2804
+	}
2805
+
2806
+	// we want listings with featured image only
2807
+	$query_args['featured_image_only'] = 1;
2808
+
2809
+	if ($post_type == 'gd_event') {
2810
+		$query_args['gedir_event_listing_filter'] = 'upcoming';
2811
+	}// show only upcoming events
2812
+
2813
+	$widget_listings = geodir_get_widget_listings($query_args);
2814
+	if (!empty($widget_listings) || (isset($with_no_results) && $with_no_results)) {
2815
+		if ($title) {
2816
+			echo $before_title . $title . $after_title;
2817
+		}
2818
+
2819
+		global $post;
2820
+
2821
+		$current_post = $post;// keep current post info
2822
+
2823
+		$widget_main_slides = '';
2824
+		$nav_slides = '';
2825
+		$widget_slides = 0;
2826
+
2827
+		foreach ($widget_listings as $widget_listing) {
2828
+			global $gd_widget_listing_type;
2829
+			$post = $widget_listing;
2830
+			$widget_image = geodir_get_featured_image($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
2831
+
2832
+			if (!empty($widget_image)) {
2833
+				if ($widget_image->height >= 200) {
2834
+					$widget_spacer_height = 0;
2835
+				} else {
2836
+					$widget_spacer_height = ((200 - $widget_image->height) / 2);
2837
+				}
2838
+
2839
+				$widget_main_slides .= '<li class="geodir-listing-slider-widget"><img class="geodir-listing-slider-spacer" src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $widget_image->title . '" title="' . $widget_image->title . '" style="max-height:' . $widget_spacer_height . 'px !important;margin:0 auto;" width="100" />';
2840
+
2841
+				$title = '';
2842
+				if ($show_title) {
2843
+					$title_html = '<div class="geodir-slider-title"><a href="' . get_permalink($post->ID) . '">' . get_the_title($post->ID) . '</a></div>';
2844
+					$post_id = $post->ID;
2845
+					$post_permalink = get_permalink($post->ID);
2846
+					$post_title = get_the_title($post->ID);
2847
+					/**
2848
+					 * Filter the listing slider widget title.
2849
+					 *
2850
+					 * @since 1.6.1
2851
+					 * @param string $title_html The html output of the title.
2852
+					 * @param int $post_id The post id.
2853
+					 * @param string $post_permalink The post permalink url.
2854
+					 * @param string $post_title The post title text.
2855
+					 */
2856
+					$title = apply_filters('geodir_listing_slider_title',$title_html,$post_id,$post_permalink,$post_title);
2857
+				}
2858
+
2859
+				$widget_main_slides .= $title . '<img src="' . $widget_image->src . '" alt="' . $widget_image->title . '" title="' . $widget_image->title . '" style="max-height:200px;margin:0 auto;" /></li>';
2860
+				$nav_slides .= '<li><img src="' . $widget_image->src . '" alt="' . $widget_image->title . '" title="' . $widget_image->title . '" style="max-height:48px;margin:0 auto;" /></li>';
2861
+				$widget_slides++;
2862
+			}
2863
+		}
2864
+		?>
2865 2865
         <div class="flex-container" style="min-height:200px;">
2866 2866
             <div class="geodir-listing-flex-loader"><i class="fa fa-refresh fa-spin"></i></div>
2867 2867
             <div id="geodir_widget_slider" class="geodir_flexslider">
@@ -2874,10 +2874,10 @@  discard block
 block discarded – undo
2874 2874
             <?php } ?>
2875 2875
         </div>
2876 2876
         <?php
2877
-        $GLOBALS['post'] = $current_post;
2878
-        setup_postdata($current_post);
2879
-    }
2880
-    echo $after_widget;
2877
+		$GLOBALS['post'] = $current_post;
2878
+		setup_postdata($current_post);
2879
+	}
2880
+	echo $after_widget;
2881 2881
 }
2882 2882
 
2883 2883
 
@@ -2892,65 +2892,65 @@  discard block
 block discarded – undo
2892 2892
  */
2893 2893
 function geodir_loginwidget_output($args = '', $instance = '')
2894 2894
 {
2895
-    //print_r($args);
2896
-    //print_r($instance);
2897
-    // prints the widget
2898
-    extract($args, EXTR_SKIP);
2895
+	//print_r($args);
2896
+	//print_r($instance);
2897
+	// prints the widget
2898
+	extract($args, EXTR_SKIP);
2899 2899
 
2900
-    /** This filter is documented in geodirectory_widgets.php */
2901
-    $title = empty($instance['title']) ? __('My Dashboard', 'geodirectory') : apply_filters('widget_title', __($instance['title'], 'geodirectory'));
2900
+	/** This filter is documented in geodirectory_widgets.php */
2901
+	$title = empty($instance['title']) ? __('My Dashboard', 'geodirectory') : apply_filters('widget_title', __($instance['title'], 'geodirectory'));
2902 2902
 
2903
-    echo $before_widget;
2904
-    echo $before_title . $title . $after_title;
2903
+	echo $before_widget;
2904
+	echo $before_title . $title . $after_title;
2905 2905
 
2906
-    if (is_user_logged_in()) {
2907
-        global $current_user;
2906
+	if (is_user_logged_in()) {
2907
+		global $current_user;
2908 2908
 
2909
-        $author_link = get_author_posts_url($current_user->data->ID);
2910
-        $author_link = geodir_getlink($author_link, array('geodir_dashbord' => 'true'), false);
2909
+		$author_link = get_author_posts_url($current_user->data->ID);
2910
+		$author_link = geodir_getlink($author_link, array('geodir_dashbord' => 'true'), false);
2911 2911
 
2912
-        echo '<ul class="geodir-loginbox-list">';
2913
-        ob_start();
2914
-        ?>
2912
+		echo '<ul class="geodir-loginbox-list">';
2913
+		ob_start();
2914
+		?>
2915 2915
         <li><a class="signin"
2916 2916
                href="<?php echo wp_logout_url(home_url()); ?>"><?php _e('Logout', 'geodirectory'); ?></a></li>
2917 2917
         <?php
2918
-        $post_types = geodir_get_posttypes('object');
2919
-        $show_add_listing_post_types_main_nav = get_option('geodir_add_listing_link_user_dashboard');
2920
-        $geodir_allow_posttype_frontend = get_option('geodir_allow_posttype_frontend');
2918
+		$post_types = geodir_get_posttypes('object');
2919
+		$show_add_listing_post_types_main_nav = get_option('geodir_add_listing_link_user_dashboard');
2920
+		$geodir_allow_posttype_frontend = get_option('geodir_allow_posttype_frontend');
2921 2921
 
2922
-        if (!empty($show_add_listing_post_types_main_nav)) {
2923
-            $addlisting_links = '';
2924
-            foreach ($post_types as $key => $postobj) {
2922
+		if (!empty($show_add_listing_post_types_main_nav)) {
2923
+			$addlisting_links = '';
2924
+			foreach ($post_types as $key => $postobj) {
2925 2925
 
2926
-                if (in_array($key, $show_add_listing_post_types_main_nav)) {
2926
+				if (in_array($key, $show_add_listing_post_types_main_nav)) {
2927 2927
 
2928
-                    if ($add_link = geodir_get_addlisting_link($key)) {
2928
+					if ($add_link = geodir_get_addlisting_link($key)) {
2929 2929
 
2930
-                        $name = $postobj->labels->name;
2930
+						$name = $postobj->labels->name;
2931 2931
 
2932
-                        $selected = '';
2933
-                        if (geodir_get_current_posttype() == $key && geodir_is_page('add-listing'))
2934
-                            $selected = 'selected="selected"';
2932
+						$selected = '';
2933
+						if (geodir_get_current_posttype() == $key && geodir_is_page('add-listing'))
2934
+							$selected = 'selected="selected"';
2935 2935
 
2936
-                        /**
2937
-                         * Filter add listing link.
2938
-                         *
2939
-                         * @since 1.0.0
2940
-                         * @param string $add_link Add listing link.
2941
-                         * @param string $key Add listing array key.
2942
-                         * @param int $current_user->ID Current user ID.
2943
-                         */
2944
-                        $add_link = apply_filters('geodir_dashboard_link_add_listing', $add_link, $key, $current_user->ID);
2936
+						/**
2937
+						 * Filter add listing link.
2938
+						 *
2939
+						 * @since 1.0.0
2940
+						 * @param string $add_link Add listing link.
2941
+						 * @param string $key Add listing array key.
2942
+						 * @param int $current_user->ID Current user ID.
2943
+						 */
2944
+						$add_link = apply_filters('geodir_dashboard_link_add_listing', $add_link, $key, $current_user->ID);
2945 2945
 
2946
-                        $addlisting_links .= '<option ' . $selected . ' value="' . $add_link . '">' . __(ucfirst($name), 'geodirectory') . '</option>';
2946
+						$addlisting_links .= '<option ' . $selected . ' value="' . $add_link . '">' . __(ucfirst($name), 'geodirectory') . '</option>';
2947 2947
 
2948
-                    }
2949
-                }
2948
+					}
2949
+				}
2950 2950
 
2951
-            }
2951
+			}
2952 2952
 
2953
-            if ($addlisting_links != '') { ?>
2953
+			if ($addlisting_links != '') { ?>
2954 2954
 
2955 2955
                 <li><select id="geodir_add_listing" class="chosen_select" onchange="window.location.href=this.value"
2956 2956
                             option-autoredirect="1" name="geodir_add_listing" option-ajaxchosen="false"
@@ -2959,42 +2959,42 @@  discard block
 block discarded – undo
2959 2959
                         <?php echo $addlisting_links; ?>
2960 2960
                     </select></li> <?php
2961 2961
 
2962
-            }
2963
-
2964
-        }
2965
-        // My Favourites in Dashboard
2966
-        $show_favorite_link_user_dashboard = get_option('geodir_favorite_link_user_dashboard');
2967
-        $user_favourite = geodir_user_favourite_listing_count();
2968
-
2969
-        if (!empty($show_favorite_link_user_dashboard) && !empty($user_favourite)) {
2970
-            $favourite_links = '';
2971
-
2972
-            foreach ($post_types as $key => $postobj) {
2973
-                if (in_array($key, $show_favorite_link_user_dashboard) && array_key_exists($key, $user_favourite)) {
2974
-                    $name = $postobj->labels->name;
2975
-                    $post_type_link = geodir_getlink($author_link, array('stype' => $key, 'list' => 'favourite'), false);
2976
-
2977
-                    $selected = '';
2978
-
2979
-                    if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite' && isset($_REQUEST['stype']) && $_REQUEST['stype'] == $key && isset($_REQUEST['geodir_dashbord'])) {
2980
-                        $selected = 'selected="selected"';
2981
-                    }
2982
-                    /**
2983
-                     * Filter favorite listing link.
2984
-                     *
2985
-                     * @since 1.0.0
2986
-                     * @param string $post_type_link Favorite listing link.
2987
-                     * @param string $key Favorite listing array key.
2988
-                     * @param int $current_user->ID Current user ID.
2989
-                     */
2990
-                    $post_type_link = apply_filters('geodir_dashboard_link_favorite_listing', $post_type_link, $key, $current_user->ID);
2991
-
2992
-                    $favourite_links .= '<option ' . $selected . ' value="' . $post_type_link . '">' . __(ucfirst($name), 'geodirectory') . '</option>';
2993
-                }
2994
-            }
2995
-
2996
-            if ($favourite_links != '') {
2997
-                ?>
2962
+			}
2963
+
2964
+		}
2965
+		// My Favourites in Dashboard
2966
+		$show_favorite_link_user_dashboard = get_option('geodir_favorite_link_user_dashboard');
2967
+		$user_favourite = geodir_user_favourite_listing_count();
2968
+
2969
+		if (!empty($show_favorite_link_user_dashboard) && !empty($user_favourite)) {
2970
+			$favourite_links = '';
2971
+
2972
+			foreach ($post_types as $key => $postobj) {
2973
+				if (in_array($key, $show_favorite_link_user_dashboard) && array_key_exists($key, $user_favourite)) {
2974
+					$name = $postobj->labels->name;
2975
+					$post_type_link = geodir_getlink($author_link, array('stype' => $key, 'list' => 'favourite'), false);
2976
+
2977
+					$selected = '';
2978
+
2979
+					if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite' && isset($_REQUEST['stype']) && $_REQUEST['stype'] == $key && isset($_REQUEST['geodir_dashbord'])) {
2980
+						$selected = 'selected="selected"';
2981
+					}
2982
+					/**
2983
+					 * Filter favorite listing link.
2984
+					 *
2985
+					 * @since 1.0.0
2986
+					 * @param string $post_type_link Favorite listing link.
2987
+					 * @param string $key Favorite listing array key.
2988
+					 * @param int $current_user->ID Current user ID.
2989
+					 */
2990
+					$post_type_link = apply_filters('geodir_dashboard_link_favorite_listing', $post_type_link, $key, $current_user->ID);
2991
+
2992
+					$favourite_links .= '<option ' . $selected . ' value="' . $post_type_link . '">' . __(ucfirst($name), 'geodirectory') . '</option>';
2993
+				}
2994
+			}
2995
+
2996
+			if ($favourite_links != '') {
2997
+				?>
2998 2998
                 <li>
2999 2999
                     <select id="geodir_my_favourites" class="chosen_select" onchange="window.location.href=this.value"
3000 3000
                             option-autoredirect="1" name="geodir_my_favourites" option-ajaxchosen="false"
@@ -3004,42 +3004,42 @@  discard block
 block discarded – undo
3004 3004
                     </select>
3005 3005
                 </li>
3006 3006
             <?php
3007
-            }
3008
-        }
3009
-
3010
-
3011
-        $show_listing_link_user_dashboard = get_option('geodir_listing_link_user_dashboard');
3012
-        $user_listing = geodir_user_post_listing_count();
3013
-
3014
-        if (!empty($show_listing_link_user_dashboard) && !empty($user_listing)) {
3015
-            $listing_links = '';
3016
-
3017
-            foreach ($post_types as $key => $postobj) {
3018
-                if (in_array($key, $show_listing_link_user_dashboard) && array_key_exists($key, $user_listing)) {
3019
-                    $name = $postobj->labels->name;
3020
-                    $listing_link = geodir_getlink($author_link, array('stype' => $key), false);
3021
-
3022
-                    $selected = '';
3023
-                    if (!isset($_REQUEST['list']) && isset($_REQUEST['geodir_dashbord']) && isset($_REQUEST['stype']) && $_REQUEST['stype'] == $key) {
3024
-                        $selected = 'selected="selected"';
3025
-                    }
3026
-
3027
-                    /**
3028
-                     * Filter my listing link.
3029
-                     *
3030
-                     * @since 1.0.0
3031
-                     * @param string $listing_link My listing link.
3032
-                     * @param string $key My listing array key.
3033
-                     * @param int $current_user->ID Current user ID.
3034
-                     */
3035
-                    $listing_link = apply_filters('geodir_dashboard_link_my_listing', $listing_link, $key, $current_user->ID);
3036
-
3037
-                    $listing_links .= '<option ' . $selected . ' value="' . $listing_link . '">' . __(ucfirst($name), 'geodirectory') . '</option>';
3038
-                }
3039
-            }
3040
-
3041
-            if ($listing_links != '') {
3042
-                ?>
3007
+			}
3008
+		}
3009
+
3010
+
3011
+		$show_listing_link_user_dashboard = get_option('geodir_listing_link_user_dashboard');
3012
+		$user_listing = geodir_user_post_listing_count();
3013
+
3014
+		if (!empty($show_listing_link_user_dashboard) && !empty($user_listing)) {
3015
+			$listing_links = '';
3016
+
3017
+			foreach ($post_types as $key => $postobj) {
3018
+				if (in_array($key, $show_listing_link_user_dashboard) && array_key_exists($key, $user_listing)) {
3019
+					$name = $postobj->labels->name;
3020
+					$listing_link = geodir_getlink($author_link, array('stype' => $key), false);
3021
+
3022
+					$selected = '';
3023
+					if (!isset($_REQUEST['list']) && isset($_REQUEST['geodir_dashbord']) && isset($_REQUEST['stype']) && $_REQUEST['stype'] == $key) {
3024
+						$selected = 'selected="selected"';
3025
+					}
3026
+
3027
+					/**
3028
+					 * Filter my listing link.
3029
+					 *
3030
+					 * @since 1.0.0
3031
+					 * @param string $listing_link My listing link.
3032
+					 * @param string $key My listing array key.
3033
+					 * @param int $current_user->ID Current user ID.
3034
+					 */
3035
+					$listing_link = apply_filters('geodir_dashboard_link_my_listing', $listing_link, $key, $current_user->ID);
3036
+
3037
+					$listing_links .= '<option ' . $selected . ' value="' . $listing_link . '">' . __(ucfirst($name), 'geodirectory') . '</option>';
3038
+				}
3039
+			}
3040
+
3041
+			if ($listing_links != '') {
3042
+				?>
3043 3043
                 <li>
3044 3044
                     <select id="geodir_my_listings" class="chosen_select" onchange="window.location.href=this.value"
3045 3045
                             option-autoredirect="1" name="geodir_my_listings" option-ajaxchosen="false"
@@ -3049,27 +3049,27 @@  discard block
 block discarded – undo
3049 3049
                     </select>
3050 3050
                 </li>
3051 3051
             <?php
3052
-            }
3053
-        }
3054
-
3055
-        $dashboard_link = ob_get_clean();
3056
-        /**
3057
-         * Filter dashboard links HTML.
3058
-         *
3059
-         * @since 1.0.0
3060
-         * @param string $dashboard_link Dashboard links HTML.
3061
-         */
3062
-        echo apply_filters('geodir_dashboard_links', $dashboard_link);
3063
-        echo '</ul>';
3064
-    } else {
3065
-        ?>
3052
+			}
3053
+		}
3054
+
3055
+		$dashboard_link = ob_get_clean();
3056
+		/**
3057
+		 * Filter dashboard links HTML.
3058
+		 *
3059
+		 * @since 1.0.0
3060
+		 * @param string $dashboard_link Dashboard links HTML.
3061
+		 */
3062
+		echo apply_filters('geodir_dashboard_links', $dashboard_link);
3063
+		echo '</ul>';
3064
+	} else {
3065
+		?>
3066 3066
         <?php
3067
-        /**
3068
-         * Filter signup form action link.
3069
-         *
3070
-         * @since 1.0.0
3071
-         */
3072
-        ?>
3067
+		/**
3068
+		 * Filter signup form action link.
3069
+		 *
3070
+		 * @since 1.0.0
3071
+		 */
3072
+		?>
3073 3073
         <form name="loginform" class="loginform1"
3074 3074
               action="<?php echo geodir_login_url(); ?>"
3075 3075
               method="post">
@@ -3089,28 +3089,28 @@  discard block
 block discarded – undo
3089 3089
 
3090 3090
                 <p class="geodir-new-forgot-link">
3091 3091
                     <?php
3092
-                    /**
3093
-                     * Filter signup page register form link.
3094
-                     *
3095
-                     * @since 1.0.0
3096
-                     */
3097
-                    ?>
3092
+					/**
3093
+					 * Filter signup page register form link.
3094
+					 *
3095
+					 * @since 1.0.0
3096
+					 */
3097
+					?>
3098 3098
                     <a href="<?php echo geodir_login_url(array('signup' => true)); ?>"
3099 3099
                        class="goedir-newuser-link"><?php echo NEW_USER_TEXT; ?></a>
3100 3100
 
3101 3101
                     <?php
3102
-                    /**
3103
-                     * Filter signup page forgot password form link.
3104
-                     *
3105
-                     * @since 1.0.0
3106
-                     */
3107
-                    ?>
3102
+					/**
3103
+					 * Filter signup page forgot password form link.
3104
+					 *
3105
+					 * @since 1.0.0
3106
+					 */
3107
+					?>
3108 3108
                     <a href="<?php echo geodir_login_url(array('forgot' => true)); ?>"
3109 3109
                        class="goedir-forgot-link"><?php echo FORGOT_PW_TEXT; ?></a></p></div>
3110 3110
         </form>
3111 3111
     <?php }
3112 3112
 
3113
-    echo $after_widget;
3113
+	echo $after_widget;
3114 3114
 }
3115 3115
 
3116 3116
 
@@ -3129,284 +3129,284 @@  discard block
 block discarded – undo
3129 3129
  * @param array|string $instance The settings for the particular instance of the widget.
3130 3130
  */
3131 3131
 function geodir_popular_postview_output($args = '', $instance = '') {
3132
-    global $gd_session;
3132
+	global $gd_session;
3133 3133
 	
3134
-    // prints the widget
3135
-    extract($args, EXTR_SKIP);
3136
-
3137
-    echo $before_widget;
3138
-
3139
-    /** This filter is documented in geodirectory_widgets.php */
3140
-    $title = empty($instance['title']) ? geodir_ucwords($instance['category_title']) : apply_filters('widget_title', __($instance['title'], 'geodirectory'));
3141
-    /**
3142
-     * Filter the widget post type.
3143
-     *
3144
-     * @since 1.0.0
3145
-     * @param string $instance['post_type'] Post type of listing.
3146
-     */
3147
-    $post_type = empty($instance['post_type']) ? 'gd_place' : apply_filters('widget_post_type', $instance['post_type']);
3148
-    /**
3149
-     * Filter the widget's term.
3150
-     *
3151
-     * @since 1.0.0
3152
-     * @param string $instance['category'] Filter by term. Can be any valid term.
3153
-     */
3154
-    $category = empty($instance['category']) ? '0' : apply_filters('widget_category', $instance['category']);
3155
-    /**
3156
-     * Filter the widget listings limit.
3157
-     *
3158
-     * @since 1.0.0
3159
-     * @param string $instance['post_number'] Number of listings to display.
3160
-     */
3161
-    $post_number = empty($instance['post_number']) ? '5' : apply_filters('widget_post_number', $instance['post_number']);
3162
-    /**
3163
-     * Filter widget's "layout" type.
3164
-     *
3165
-     * @since 1.0.0
3166
-     * @param string $instance['layout'] Widget layout type.
3167
-     */
3168
-    $layout = empty($instance['layout']) ? 'gridview_onehalf' : apply_filters('widget_layout', $instance['layout']);
3169
-    /**
3170
-     * Filter widget's "add_location_filter" value.
3171
-     *
3172
-     * @since 1.0.0
3173
-     * @param string|bool $instance['add_location_filter'] Do you want to add location filter? Can be 1 or 0.
3174
-     */
3175
-    $add_location_filter = empty($instance['add_location_filter']) ? '0' : apply_filters('widget_add_location_filter', $instance['add_location_filter']);
3176
-    /**
3177
-     * Filter widget's listing width.
3178
-     *
3179
-     * @since 1.0.0
3180
-     * @param string $instance['listing_width'] Listing width.
3181
-     */
3182
-    $listing_width = empty($instance['listing_width']) ? '' : apply_filters('widget_listing_width', $instance['listing_width']);
3183
-    /**
3184
-     * Filter widget's "list_sort" type.
3185
-     *
3186
-     * @since 1.0.0
3187
-     * @param string $instance['list_sort'] Listing sort by type.
3188
-     */
3189
-    $list_sort = empty($instance['list_sort']) ? 'latest' : apply_filters('widget_list_sort', $instance['list_sort']);
3190
-    $use_viewing_post_type = !empty($instance['use_viewing_post_type']) ? true : false;
3191
-
3192
-    // set post type to current viewing post type
3193
-    if ($use_viewing_post_type) {
3194
-        $current_post_type = geodir_get_current_posttype();
3195
-        if ($current_post_type != '' && $current_post_type != $post_type) {
3196
-            $post_type = $current_post_type;
3197
-            $category = array(); // old post type category will not work for current changed post type
3198
-        }
3199
-    }
3200
-    // replace widget title dynamically
3201
-    $posttype_plural_label = __(get_post_type_plural_label($post_type), 'geodirectory');
3202
-    $posttype_singular_label = __(get_post_type_singular_label($post_type), 'geodirectory');
3203
-
3204
-    $title = str_replace("%posttype_plural_label%", $posttype_plural_label, $title);
3205
-    $title = str_replace("%posttype_singular_label%", $posttype_singular_label, $title);
3206
-
3207
-    if (isset($instance['character_count'])) {
3208
-        /**
3209
-         * Filter the widget's excerpt character count.
3210
-         *
3211
-         * @since 1.0.0
3212
-         * @param int $instance['character_count'] Excerpt character count.
3213
-         */
3214
-        $character_count = apply_filters('widget_list_character_count', $instance['character_count']);
3215
-    } else {
3216
-        $character_count = '';
3217
-    }
3218
-
3219
-    if (empty($title) || $title == 'All') {
3220
-        $title .= ' ' . __(get_post_type_plural_label($post_type), 'geodirectory');
3221
-    }
3222
-
3223
-    $location_url = array();
3224
-    $city = get_query_var('gd_city');
3225
-    if (!empty($city)) {
3226
-        $country = get_query_var('gd_country');
3227
-        $region = get_query_var('gd_region');
3228
-
3229
-        $geodir_show_location_url = get_option('geodir_show_location_url');
3230
-
3231
-        if ($geodir_show_location_url == 'all') {
3232
-            if ($country != '') {
3233
-                $location_url[] = $country;
3234
-            }
3235
-
3236
-            if ($region != '') {
3237
-                $location_url[] = $region;
3238
-            }
3239
-        } else if ($geodir_show_location_url == 'country_city') {
3240
-            if ($country != '') {
3241
-                $location_url[] = $country;
3242
-            }
3243
-        } else if ($geodir_show_location_url == 'region_city') {
3244
-            if ($region != '') {
3245
-                $location_url[] = $region;
3246
-            }
3247
-        }
3248
-
3249
-        $location_url[] = $city;
3250
-    }
3251
-
3252
-    $location_url = implode('/', $location_url);
3253
-    $skip_location = false;
3254
-    if (!$add_location_filter && $gd_session->get('gd_multi_location')) {
3255
-        $skip_location = true;
3256
-        $gd_session->un_set('gd_multi_location');
3257
-    }
3258
-
3259
-    if (get_option('permalink_structure')) {
3260
-        $viewall_url = get_post_type_archive_link($post_type);
3261
-    } else {
3262
-        $viewall_url = get_post_type_archive_link($post_type);
3263
-    }
3264
-
3265
-    if (!empty($category) && $category[0] != '0') {
3266
-        global $geodir_add_location_url;
3267
-
3268
-        $geodir_add_location_url = '0';
3269
-
3270
-        if ($add_location_filter != '0') {
3271
-            $geodir_add_location_url = '1';
3272
-        }
3273
-
3274
-        $viewall_url = get_term_link((int)$category[0], $post_type . 'category');
3275
-
3276
-        $geodir_add_location_url = NULL;
3277
-    }
3278
-    if ($skip_location) {
3279
-        $gd_session->set('gd_multi_location', 1);
3280
-    }
3281
-
3282
-    if(is_wp_error( $viewall_url  )){$viewall_url = '';}
3283
-
3284
-    $query_args = array(
3285
-        'posts_per_page' => $post_number,
3286
-        'is_geodir_loop' => true,
3287
-        'gd_location' => $add_location_filter ? true : false,
3288
-        'post_type' => $post_type,
3289
-        'order_by' => $list_sort
3290
-    );
3291
-
3292
-    if ($character_count) {
3293
-        $query_args['excerpt_length'] = $character_count;
3294
-    }
3295
-
3296
-    if (!empty($instance['show_featured_only'])) {
3297
-        $query_args['show_featured_only'] = 1;
3298
-    }
3299
-
3300
-    if (!empty($instance['show_special_only'])) {
3301
-        $query_args['show_special_only'] = 1;
3302
-    }
3303
-
3304
-    if (!empty($instance['with_pics_only'])) {
3305
-        $query_args['with_pics_only'] = 0;
3306
-        $query_args['featured_image_only'] = 1;
3307
-    }
3308
-
3309
-    if (!empty($instance['with_videos_only'])) {
3310
-        $query_args['with_videos_only'] = 1;
3311
-    }
3312
-    $with_no_results = !empty($instance['without_no_results']) ? false : true;
3313
-
3314
-    if (!empty($category) && $category[0] != '0') {
3315
-        $category_taxonomy = geodir_get_taxonomies($post_type);
3316
-
3317
-        ######### WPML #########
3318
-        if (function_exists('icl_object_id')) {
3319
-            $category = gd_lang_object_ids($category, $category_taxonomy[0]);
3320
-        }
3321
-        ######### WPML #########
3322
-
3323
-        $tax_query = array(
3324
-            'taxonomy' => $category_taxonomy[0],
3325
-            'field' => 'id',
3326
-            'terms' => $category
3327
-        );
3328
-
3329
-        $query_args['tax_query'] = array($tax_query);
3330
-    }
3331
-
3332
-    global $gridview_columns_widget, $geodir_is_widget_listing;
3333
-
3334
-    $widget_listings = geodir_get_widget_listings($query_args);
3335
-
3336
-    if (!empty($widget_listings) || $with_no_results) {
3337
-        ?>
3134
+	// prints the widget
3135
+	extract($args, EXTR_SKIP);
3136
+
3137
+	echo $before_widget;
3138
+
3139
+	/** This filter is documented in geodirectory_widgets.php */
3140
+	$title = empty($instance['title']) ? geodir_ucwords($instance['category_title']) : apply_filters('widget_title', __($instance['title'], 'geodirectory'));
3141
+	/**
3142
+	 * Filter the widget post type.
3143
+	 *
3144
+	 * @since 1.0.0
3145
+	 * @param string $instance['post_type'] Post type of listing.
3146
+	 */
3147
+	$post_type = empty($instance['post_type']) ? 'gd_place' : apply_filters('widget_post_type', $instance['post_type']);
3148
+	/**
3149
+	 * Filter the widget's term.
3150
+	 *
3151
+	 * @since 1.0.0
3152
+	 * @param string $instance['category'] Filter by term. Can be any valid term.
3153
+	 */
3154
+	$category = empty($instance['category']) ? '0' : apply_filters('widget_category', $instance['category']);
3155
+	/**
3156
+	 * Filter the widget listings limit.
3157
+	 *
3158
+	 * @since 1.0.0
3159
+	 * @param string $instance['post_number'] Number of listings to display.
3160
+	 */
3161
+	$post_number = empty($instance['post_number']) ? '5' : apply_filters('widget_post_number', $instance['post_number']);
3162
+	/**
3163
+	 * Filter widget's "layout" type.
3164
+	 *
3165
+	 * @since 1.0.0
3166
+	 * @param string $instance['layout'] Widget layout type.
3167
+	 */
3168
+	$layout = empty($instance['layout']) ? 'gridview_onehalf' : apply_filters('widget_layout', $instance['layout']);
3169
+	/**
3170
+	 * Filter widget's "add_location_filter" value.
3171
+	 *
3172
+	 * @since 1.0.0
3173
+	 * @param string|bool $instance['add_location_filter'] Do you want to add location filter? Can be 1 or 0.
3174
+	 */
3175
+	$add_location_filter = empty($instance['add_location_filter']) ? '0' : apply_filters('widget_add_location_filter', $instance['add_location_filter']);
3176
+	/**
3177
+	 * Filter widget's listing width.
3178
+	 *
3179
+	 * @since 1.0.0
3180
+	 * @param string $instance['listing_width'] Listing width.
3181
+	 */
3182
+	$listing_width = empty($instance['listing_width']) ? '' : apply_filters('widget_listing_width', $instance['listing_width']);
3183
+	/**
3184
+	 * Filter widget's "list_sort" type.
3185
+	 *
3186
+	 * @since 1.0.0
3187
+	 * @param string $instance['list_sort'] Listing sort by type.
3188
+	 */
3189
+	$list_sort = empty($instance['list_sort']) ? 'latest' : apply_filters('widget_list_sort', $instance['list_sort']);
3190
+	$use_viewing_post_type = !empty($instance['use_viewing_post_type']) ? true : false;
3191
+
3192
+	// set post type to current viewing post type
3193
+	if ($use_viewing_post_type) {
3194
+		$current_post_type = geodir_get_current_posttype();
3195
+		if ($current_post_type != '' && $current_post_type != $post_type) {
3196
+			$post_type = $current_post_type;
3197
+			$category = array(); // old post type category will not work for current changed post type
3198
+		}
3199
+	}
3200
+	// replace widget title dynamically
3201
+	$posttype_plural_label = __(get_post_type_plural_label($post_type), 'geodirectory');
3202
+	$posttype_singular_label = __(get_post_type_singular_label($post_type), 'geodirectory');
3203
+
3204
+	$title = str_replace("%posttype_plural_label%", $posttype_plural_label, $title);
3205
+	$title = str_replace("%posttype_singular_label%", $posttype_singular_label, $title);
3206
+
3207
+	if (isset($instance['character_count'])) {
3208
+		/**
3209
+		 * Filter the widget's excerpt character count.
3210
+		 *
3211
+		 * @since 1.0.0
3212
+		 * @param int $instance['character_count'] Excerpt character count.
3213
+		 */
3214
+		$character_count = apply_filters('widget_list_character_count', $instance['character_count']);
3215
+	} else {
3216
+		$character_count = '';
3217
+	}
3218
+
3219
+	if (empty($title) || $title == 'All') {
3220
+		$title .= ' ' . __(get_post_type_plural_label($post_type), 'geodirectory');
3221
+	}
3222
+
3223
+	$location_url = array();
3224
+	$city = get_query_var('gd_city');
3225
+	if (!empty($city)) {
3226
+		$country = get_query_var('gd_country');
3227
+		$region = get_query_var('gd_region');
3228
+
3229
+		$geodir_show_location_url = get_option('geodir_show_location_url');
3230
+
3231
+		if ($geodir_show_location_url == 'all') {
3232
+			if ($country != '') {
3233
+				$location_url[] = $country;
3234
+			}
3235
+
3236
+			if ($region != '') {
3237
+				$location_url[] = $region;
3238
+			}
3239
+		} else if ($geodir_show_location_url == 'country_city') {
3240
+			if ($country != '') {
3241
+				$location_url[] = $country;
3242
+			}
3243
+		} else if ($geodir_show_location_url == 'region_city') {
3244
+			if ($region != '') {
3245
+				$location_url[] = $region;
3246
+			}
3247
+		}
3248
+
3249
+		$location_url[] = $city;
3250
+	}
3251
+
3252
+	$location_url = implode('/', $location_url);
3253
+	$skip_location = false;
3254
+	if (!$add_location_filter && $gd_session->get('gd_multi_location')) {
3255
+		$skip_location = true;
3256
+		$gd_session->un_set('gd_multi_location');
3257
+	}
3258
+
3259
+	if (get_option('permalink_structure')) {
3260
+		$viewall_url = get_post_type_archive_link($post_type);
3261
+	} else {
3262
+		$viewall_url = get_post_type_archive_link($post_type);
3263
+	}
3264
+
3265
+	if (!empty($category) && $category[0] != '0') {
3266
+		global $geodir_add_location_url;
3267
+
3268
+		$geodir_add_location_url = '0';
3269
+
3270
+		if ($add_location_filter != '0') {
3271
+			$geodir_add_location_url = '1';
3272
+		}
3273
+
3274
+		$viewall_url = get_term_link((int)$category[0], $post_type . 'category');
3275
+
3276
+		$geodir_add_location_url = NULL;
3277
+	}
3278
+	if ($skip_location) {
3279
+		$gd_session->set('gd_multi_location', 1);
3280
+	}
3281
+
3282
+	if(is_wp_error( $viewall_url  )){$viewall_url = '';}
3283
+
3284
+	$query_args = array(
3285
+		'posts_per_page' => $post_number,
3286
+		'is_geodir_loop' => true,
3287
+		'gd_location' => $add_location_filter ? true : false,
3288
+		'post_type' => $post_type,
3289
+		'order_by' => $list_sort
3290
+	);
3291
+
3292
+	if ($character_count) {
3293
+		$query_args['excerpt_length'] = $character_count;
3294
+	}
3295
+
3296
+	if (!empty($instance['show_featured_only'])) {
3297
+		$query_args['show_featured_only'] = 1;
3298
+	}
3299
+
3300
+	if (!empty($instance['show_special_only'])) {
3301
+		$query_args['show_special_only'] = 1;
3302
+	}
3303
+
3304
+	if (!empty($instance['with_pics_only'])) {
3305
+		$query_args['with_pics_only'] = 0;
3306
+		$query_args['featured_image_only'] = 1;
3307
+	}
3308
+
3309
+	if (!empty($instance['with_videos_only'])) {
3310
+		$query_args['with_videos_only'] = 1;
3311
+	}
3312
+	$with_no_results = !empty($instance['without_no_results']) ? false : true;
3313
+
3314
+	if (!empty($category) && $category[0] != '0') {
3315
+		$category_taxonomy = geodir_get_taxonomies($post_type);
3316
+
3317
+		######### WPML #########
3318
+		if (function_exists('icl_object_id')) {
3319
+			$category = gd_lang_object_ids($category, $category_taxonomy[0]);
3320
+		}
3321
+		######### WPML #########
3322
+
3323
+		$tax_query = array(
3324
+			'taxonomy' => $category_taxonomy[0],
3325
+			'field' => 'id',
3326
+			'terms' => $category
3327
+		);
3328
+
3329
+		$query_args['tax_query'] = array($tax_query);
3330
+	}
3331
+
3332
+	global $gridview_columns_widget, $geodir_is_widget_listing;
3333
+
3334
+	$widget_listings = geodir_get_widget_listings($query_args);
3335
+
3336
+	if (!empty($widget_listings) || $with_no_results) {
3337
+		?>
3338 3338
         <div class="geodir_locations geodir_location_listing">
3339 3339
 
3340 3340
             <?php
3341
-            /**
3342
-             * Called before the div containing the title and view all link in popular post view widget.
3343
-             *
3344
-             * @since 1.0.0
3345
-             */
3346
-            do_action('geodir_before_view_all_link_in_widget'); ?>
3341
+			/**
3342
+			 * Called before the div containing the title and view all link in popular post view widget.
3343
+			 *
3344
+			 * @since 1.0.0
3345
+			 */
3346
+			do_action('geodir_before_view_all_link_in_widget'); ?>
3347 3347
             <div class="geodir_list_heading clearfix">
3348 3348
                 <?php echo $before_title . $title . $after_title; ?>
3349 3349
                 <a href="<?php echo $viewall_url; ?>"
3350 3350
                    class="geodir-viewall"><?php _e('View all', 'geodirectory'); ?></a>
3351 3351
             </div>
3352 3352
             <?php
3353
-            /**
3354
-             * Called after the div containing the title and view all link in popular post view widget.
3355
-             *
3356
-             * @since 1.0.0
3357
-             */
3358
-            do_action('geodir_after_view_all_link_in_widget'); ?>
3353
+			/**
3354
+			 * Called after the div containing the title and view all link in popular post view widget.
3355
+			 *
3356
+			 * @since 1.0.0
3357
+			 */
3358
+			do_action('geodir_after_view_all_link_in_widget'); ?>
3359 3359
             <?php
3360
-            if (strstr($layout, 'gridview')) {
3361
-                $listing_view_exp = explode('_', $layout);
3362
-                $gridview_columns_widget = $layout;
3363
-                $layout = $listing_view_exp[0];
3364
-            } else {
3365
-                $gridview_columns_widget = '';
3366
-            }
3367
-
3368
-            /**
3369
-             * Filter the widget listing listview template path.
3370
-             *
3371
-             * @since 1.0.0
3372
-             */
3373
-            $template = apply_filters("geodir_template_part-widget-listing-listview", geodir_locate_template('widget-listing-listview'));
3374
-            if (!isset($character_count)) {
3375
-                /**
3376
-                 * Filter the widget's excerpt character count.
3377
-                 *
3378
-                 * @since 1.0.0
3379
-                 * @param int $instance['character_count'] Excerpt character count.
3380
-                 */
3381
-                $character_count = $character_count == '' ? 50 : apply_filters('widget_character_count', $character_count);
3382
-            }
3383
-
3384
-            global $post, $map_jason, $map_canvas_arr;
3385
-
3386
-            $current_post = $post;
3387
-            $current_map_jason = $map_jason;
3388
-            $current_map_canvas_arr = $map_canvas_arr;
3389
-            $geodir_is_widget_listing = true;
3390
-
3391
-            /**
3392
-             * Includes related listing listview template.
3393
-             *
3394
-             * @since 1.0.0
3395
-             */
3396
-            include($template);
3397
-
3398
-            $geodir_is_widget_listing = false;
3399
-
3400
-            $GLOBALS['post'] = $current_post;
3401
-            if (!empty($current_post))
3402
-                setup_postdata($current_post);
3403
-            $map_jason = $current_map_jason;
3404
-            $map_canvas_arr = $current_map_canvas_arr;
3405
-            ?>
3360
+			if (strstr($layout, 'gridview')) {
3361
+				$listing_view_exp = explode('_', $layout);
3362
+				$gridview_columns_widget = $layout;
3363
+				$layout = $listing_view_exp[0];
3364
+			} else {
3365
+				$gridview_columns_widget = '';
3366
+			}
3367
+
3368
+			/**
3369
+			 * Filter the widget listing listview template path.
3370
+			 *
3371
+			 * @since 1.0.0
3372
+			 */
3373
+			$template = apply_filters("geodir_template_part-widget-listing-listview", geodir_locate_template('widget-listing-listview'));
3374
+			if (!isset($character_count)) {
3375
+				/**
3376
+				 * Filter the widget's excerpt character count.
3377
+				 *
3378
+				 * @since 1.0.0
3379
+				 * @param int $instance['character_count'] Excerpt character count.
3380
+				 */
3381
+				$character_count = $character_count == '' ? 50 : apply_filters('widget_character_count', $character_count);
3382
+			}
3383
+
3384
+			global $post, $map_jason, $map_canvas_arr;
3385
+
3386
+			$current_post = $post;
3387
+			$current_map_jason = $map_jason;
3388
+			$current_map_canvas_arr = $map_canvas_arr;
3389
+			$geodir_is_widget_listing = true;
3390
+
3391
+			/**
3392
+			 * Includes related listing listview template.
3393
+			 *
3394
+			 * @since 1.0.0
3395
+			 */
3396
+			include($template);
3397
+
3398
+			$geodir_is_widget_listing = false;
3399
+
3400
+			$GLOBALS['post'] = $current_post;
3401
+			if (!empty($current_post))
3402
+				setup_postdata($current_post);
3403
+			$map_jason = $current_map_jason;
3404
+			$map_canvas_arr = $current_map_canvas_arr;
3405
+			?>
3406 3406
         </div>
3407 3407
     <?php
3408
-    }
3409
-    echo $after_widget;
3408
+	}
3409
+	echo $after_widget;
3410 3410
 
3411 3411
 }
3412 3412
 
@@ -3429,26 +3429,26 @@  discard block
 block discarded – undo
3429 3429
  */
3430 3430
 function geodir_count_reviews_by_term_id($term_id, $taxonomy, $post_type)
3431 3431
 {
3432
-    global $wpdb, $plugin_prefix;
3432
+	global $wpdb, $plugin_prefix;
3433 3433
 
3434
-    $detail_table = $plugin_prefix . $post_type . '_detail';
3434
+	$detail_table = $plugin_prefix . $post_type . '_detail';
3435 3435
 
3436
-    $sql = "SELECT COALESCE(SUM(rating_count),0) FROM " . $detail_table . " WHERE post_status = 'publish' AND rating_count > 0 AND FIND_IN_SET(" . $term_id . ", " . $taxonomy . ")";
3436
+	$sql = "SELECT COALESCE(SUM(rating_count),0) FROM " . $detail_table . " WHERE post_status = 'publish' AND rating_count > 0 AND FIND_IN_SET(" . $term_id . ", " . $taxonomy . ")";
3437 3437
 
3438
-    /**
3439
-     * Filter count review sql query.
3440
-     *
3441
-     * @since 1.5.1
3442
-     * @param string $sql Database sql query..
3443
-     * @param int $term_id The term ID.
3444
-     * @param int $taxonomy The taxonomy Id.
3445
-     * @param string $post_type The post type.
3446
-     */
3447
-    $sql = apply_filters('geodir_count_reviews_by_term_sql', $sql, $term_id, $taxonomy, $post_type);
3438
+	/**
3439
+	 * Filter count review sql query.
3440
+	 *
3441
+	 * @since 1.5.1
3442
+	 * @param string $sql Database sql query..
3443
+	 * @param int $term_id The term ID.
3444
+	 * @param int $taxonomy The taxonomy Id.
3445
+	 * @param string $post_type The post type.
3446
+	 */
3447
+	$sql = apply_filters('geodir_count_reviews_by_term_sql', $sql, $term_id, $taxonomy, $post_type);
3448 3448
 
3449
-    $count = $wpdb->get_var($sql);
3449
+	$count = $wpdb->get_var($sql);
3450 3450
 
3451
-    return $count;
3451
+	return $count;
3452 3452
 }
3453 3453
 
3454 3454
 /**
@@ -3464,90 +3464,90 @@  discard block
 block discarded – undo
3464 3464
  * @return array Term array data.
3465 3465
  */
3466 3466
 function geodir_count_reviews_by_terms($force_update = false, $post_ID = 0) {
3467
-    /**
3468
-     * Filter review count option data.
3469
-     *
3470
-     * @since 1.0.0
3471
-     * @since 1.6.1 Added $post_ID param.
3472
-     * @param bool $force_update Force update option value?. Default.false.
3473
-     * @param int $post_ID The post id to update if any.
3474
-     */
3475
-    $option_data = apply_filters('geodir_count_reviews_by_terms_before', '', $force_update,$post_ID);
3476
-    if (!empty($option_data)) {
3477
-        return $option_data;
3478
-    }
3479
-
3480
-    $option_data = get_option('geodir_global_review_count');
3481
-
3482
-    if (!$option_data || $force_update) {
3483
-        if ((int)$post_ID > 0) { // Update reviews count for specific post categories only.
3484
-            global $gd_session;
3485
-            $term_array = (array)$option_data;
3486
-            $post_type = get_post_type($post_ID);
3487
-            $taxonomy = $post_type . 'category';
3488
-            $terms = wp_get_object_terms($post_ID, $taxonomy, array('fields' => 'ids'));
3489
-
3490
-            if (!empty($terms) && !is_wp_error($terms)) {
3491
-                foreach ($terms as $term_id) {
3492
-                    $count = geodir_count_reviews_by_term_id($term_id, $taxonomy, $post_type);
3493
-                    $children = get_term_children($term_id, $taxonomy);
3494
-                    $term_array[$term_id] = $count;
3495
-                }
3496
-            }
3467
+	/**
3468
+	 * Filter review count option data.
3469
+	 *
3470
+	 * @since 1.0.0
3471
+	 * @since 1.6.1 Added $post_ID param.
3472
+	 * @param bool $force_update Force update option value?. Default.false.
3473
+	 * @param int $post_ID The post id to update if any.
3474
+	 */
3475
+	$option_data = apply_filters('geodir_count_reviews_by_terms_before', '', $force_update,$post_ID);
3476
+	if (!empty($option_data)) {
3477
+		return $option_data;
3478
+	}
3479
+
3480
+	$option_data = get_option('geodir_global_review_count');
3481
+
3482
+	if (!$option_data || $force_update) {
3483
+		if ((int)$post_ID > 0) { // Update reviews count for specific post categories only.
3484
+			global $gd_session;
3485
+			$term_array = (array)$option_data;
3486
+			$post_type = get_post_type($post_ID);
3487
+			$taxonomy = $post_type . 'category';
3488
+			$terms = wp_get_object_terms($post_ID, $taxonomy, array('fields' => 'ids'));
3489
+
3490
+			if (!empty($terms) && !is_wp_error($terms)) {
3491
+				foreach ($terms as $term_id) {
3492
+					$count = geodir_count_reviews_by_term_id($term_id, $taxonomy, $post_type);
3493
+					$children = get_term_children($term_id, $taxonomy);
3494
+					$term_array[$term_id] = $count;
3495
+				}
3496
+			}
3497 3497
             
3498
-            $session_listing = $gd_session->get('listing');
3498
+			$session_listing = $gd_session->get('listing');
3499 3499
             
3500
-            $terms = array();
3501
-            if (isset($_POST['post_category'][$taxonomy])) {
3502
-                $terms = (array)$_POST['post_category'][$taxonomy];
3503
-            } else if (!empty($session_listing) && isset($session_listing['post_category'][$taxonomy])) {
3504
-                $terms = (array)$session_listing['post_category'][$taxonomy];
3505
-            }
3500
+			$terms = array();
3501
+			if (isset($_POST['post_category'][$taxonomy])) {
3502
+				$terms = (array)$_POST['post_category'][$taxonomy];
3503
+			} else if (!empty($session_listing) && isset($session_listing['post_category'][$taxonomy])) {
3504
+				$terms = (array)$session_listing['post_category'][$taxonomy];
3505
+			}
3506 3506
             
3507
-            if (!empty($terms)) {
3508
-                foreach ($terms as $term_id) {
3509
-                    if ($term_id > 0) {
3510
-                        $count = geodir_count_reviews_by_term_id($term_id, $taxonomy, $post_type);
3511
-                        $children = get_term_children($term_id, $taxonomy);
3512
-                        $term_array[$term_id] = $count;
3513
-                    }
3514
-                }
3515
-            }
3516
-        } else { // Update reviews count for all post categories.
3517
-            $term_array = array();
3518
-            $post_types = geodir_get_posttypes();
3519
-            foreach ($post_types as $post_type) {
3520
-
3521
-                $taxonomy = geodir_get_taxonomies($post_type);
3522
-                $taxonomy = $taxonomy[0];
3523
-
3524
-                $args = array(
3525
-                    'hide_empty' => false
3526
-                );
3527
-
3528
-                $terms = get_terms($taxonomy, $args);
3529
-
3530
-                foreach ($terms as $term) {
3531
-                    $count = geodir_count_reviews_by_term_id($term->term_id, $taxonomy, $post_type);
3532
-                    $children = get_term_children($term->term_id, $taxonomy);
3533
-                    /*if ( is_array( $children ) ) {
3507
+			if (!empty($terms)) {
3508
+				foreach ($terms as $term_id) {
3509
+					if ($term_id > 0) {
3510
+						$count = geodir_count_reviews_by_term_id($term_id, $taxonomy, $post_type);
3511
+						$children = get_term_children($term_id, $taxonomy);
3512
+						$term_array[$term_id] = $count;
3513
+					}
3514
+				}
3515
+			}
3516
+		} else { // Update reviews count for all post categories.
3517
+			$term_array = array();
3518
+			$post_types = geodir_get_posttypes();
3519
+			foreach ($post_types as $post_type) {
3520
+
3521
+				$taxonomy = geodir_get_taxonomies($post_type);
3522
+				$taxonomy = $taxonomy[0];
3523
+
3524
+				$args = array(
3525
+					'hide_empty' => false
3526
+				);
3527
+
3528
+				$terms = get_terms($taxonomy, $args);
3529
+
3530
+				foreach ($terms as $term) {
3531
+					$count = geodir_count_reviews_by_term_id($term->term_id, $taxonomy, $post_type);
3532
+					$children = get_term_children($term->term_id, $taxonomy);
3533
+					/*if ( is_array( $children ) ) {
3534 3534
                         foreach ( $children as $child_id ) {
3535 3535
                             $child_count = geodir_count_reviews_by_term_id($child_id, $taxonomy, $post_type);
3536 3536
                             $count = $count + $child_count;
3537 3537
                         }
3538 3538
                     }*/
3539
-                    $term_array[$term->term_id] = $count;
3540
-                }
3541
-            }
3542
-        }
3543
-
3544
-        update_option('geodir_global_review_count', $term_array);
3545
-        //clear cache
3546
-        wp_cache_delete('geodir_global_review_count');
3547
-        return $term_array;
3548
-    } else {
3549
-        return $option_data;
3550
-    }
3539
+					$term_array[$term->term_id] = $count;
3540
+				}
3541
+			}
3542
+		}
3543
+
3544
+		update_option('geodir_global_review_count', $term_array);
3545
+		//clear cache
3546
+		wp_cache_delete('geodir_global_review_count');
3547
+		return $term_array;
3548
+	} else {
3549
+		return $option_data;
3550
+	}
3551 3551
 }
3552 3552
 
3553 3553
 /**
@@ -3559,38 +3559,38 @@  discard block
 block discarded – undo
3559 3559
  * @return bool
3560 3560
  */
3561 3561
 function geodir_term_review_count_force_update($new_status, $old_status = '', $post = '') {
3562
-    if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'geodir_import_export') {
3563
-        return; // do not run if importing listings
3564
-    }
3562
+	if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'geodir_import_export') {
3563
+		return; // do not run if importing listings
3564
+	}
3565 3565
     
3566
-    if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
3567
-        return;
3568
-    }
3569
-
3570
-    $post_ID = 0;
3571
-    if (!empty($post)) {
3572
-        if (isset($post->post_type) && strpos($post->post_type, 'gd_') !== 0) {
3573
-            return;
3574
-        }
3566
+	if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
3567
+		return;
3568
+	}
3569
+
3570
+	$post_ID = 0;
3571
+	if (!empty($post)) {
3572
+		if (isset($post->post_type) && strpos($post->post_type, 'gd_') !== 0) {
3573
+			return;
3574
+		}
3575 3575
         
3576
-        if ($new_status == 'auto-draft' && $old_status == 'new') {
3577
-            return;
3578
-        }
3576
+		if ($new_status == 'auto-draft' && $old_status == 'new') {
3577
+			return;
3578
+		}
3579 3579
         
3580
-        if (!empty($post->ID)) {
3581
-            $post_ID = $post->ID;
3582
-        }
3583
-    }
3580
+		if (!empty($post->ID)) {
3581
+			$post_ID = $post->ID;
3582
+		}
3583
+	}
3584 3584
 
3585
-    if ($new_status != $old_status) {
3586
-        geodir_count_reviews_by_terms(true, $post_ID);
3587
-    }
3585
+	if ($new_status != $old_status) {
3586
+		geodir_count_reviews_by_terms(true, $post_ID);
3587
+	}
3588 3588
 
3589
-    return true;
3589
+	return true;
3590 3590
 }
3591 3591
 
3592 3592
 function geodir_term_review_count_force_update_single_post($post_id){
3593
-    geodir_count_reviews_by_terms(true, $post_id); 
3593
+	geodir_count_reviews_by_terms(true, $post_id); 
3594 3594
 }
3595 3595
 
3596 3596
 /*-----------------------------------------------------------------------------------*/
@@ -3608,15 +3608,15 @@  discard block
 block discarded – undo
3608 3608
 function geodir_count_posts_by_term($data, $term)
3609 3609
 {
3610 3610
 
3611
-    if ($data) {
3612
-        if (isset($data[$term->term_id])) {
3613
-            return $data[$term->term_id];
3614
-        } else {
3615
-            return 0;
3616
-        }
3617
-    } else {
3618
-        return $term->count;
3619
-    }
3611
+	if ($data) {
3612
+		if (isset($data[$term->term_id])) {
3613
+			return $data[$term->term_id];
3614
+		} else {
3615
+			return 0;
3616
+		}
3617
+	} else {
3618
+		return $term->count;
3619
+	}
3620 3620
 }
3621 3621
 
3622 3622
 /**
@@ -3629,8 +3629,8 @@  discard block
 block discarded – undo
3629 3629
  */
3630 3630
 function geodir_sort_terms_by_count($terms)
3631 3631
 {
3632
-    usort($terms, "geodir_sort_by_count_obj");
3633
-    return $terms;
3632
+	usort($terms, "geodir_sort_by_count_obj");
3633
+	return $terms;
3634 3634
 }
3635 3635
 
3636 3636
 /**
@@ -3643,8 +3643,8 @@  discard block
 block discarded – undo
3643 3643
  */
3644 3644
 function geodir_sort_terms_by_review_count($terms)
3645 3645
 {
3646
-    usort($terms, "geodir_sort_by_review_count_obj");
3647
-    return $terms;
3646
+	usort($terms, "geodir_sort_by_review_count_obj");
3647
+	return $terms;
3648 3648
 }
3649 3649
 
3650 3650
 /**
@@ -3658,12 +3658,12 @@  discard block
 block discarded – undo
3658 3658
  */
3659 3659
 function geodir_sort_terms($terms, $sort = 'count')
3660 3660
 {
3661
-    if ($sort == 'count') {
3662
-        return geodir_sort_terms_by_count($terms);
3663
-    }
3664
-    if ($sort == 'review_count') {
3665
-        return geodir_sort_terms_by_review_count($terms);
3666
-    }
3661
+	if ($sort == 'count') {
3662
+		return geodir_sort_terms_by_count($terms);
3663
+	}
3664
+	if ($sort == 'review_count') {
3665
+		return geodir_sort_terms_by_review_count($terms);
3666
+	}
3667 3667
 }
3668 3668
 
3669 3669
 /*-----------------------------------------------------------------------------------*/
@@ -3680,7 +3680,7 @@  discard block
 block discarded – undo
3680 3680
  */
3681 3681
 function geodir_sort_by_count($a, $b)
3682 3682
 {
3683
-    return $a['count'] < $b['count'];
3683
+	return $a['count'] < $b['count'];
3684 3684
 }
3685 3685
 
3686 3686
 /**
@@ -3694,7 +3694,7 @@  discard block
 block discarded – undo
3694 3694
  */
3695 3695
 function geodir_sort_by_count_obj($a, $b)
3696 3696
 {
3697
-    return $a->count < $b->count;
3697
+	return $a->count < $b->count;
3698 3698
 }
3699 3699
 
3700 3700
 /**
@@ -3708,7 +3708,7 @@  discard block
 block discarded – undo
3708 3708
  */
3709 3709
 function geodir_sort_by_review_count_obj($a, $b)
3710 3710
 {
3711
-    return $a->review_count < $b->review_count;
3711
+	return $a->review_count < $b->review_count;
3712 3712
 }
3713 3713
 
3714 3714
 /**
@@ -3718,43 +3718,43 @@  discard block
 block discarded – undo
3718 3718
  * @package GeoDirectory
3719 3719
  */
3720 3720
 function geodir_load_textdomain() {
3721
-    /**
3722
-     * Filter the plugin locale.
3723
-     *
3724
-     * @since 1.4.2
3725
-     * @package GeoDirectory
3726
-     */
3727
-    $locale = apply_filters('plugin_locale', get_locale(), 'geodirectory');
3728
-
3729
-    load_textdomain('geodirectory', WP_LANG_DIR . '/' . 'geodirectory' . '/' . 'geodirectory' . '-' . $locale . '.mo');
3730
-    load_plugin_textdomain('geodirectory', false, plugin_basename(dirname(dirname(__FILE__))) . '/geodirectory-languages');
3731
-
3732
-    /**
3733
-     * Define language constants.
3734
-     *
3735
-     * @since 1.0.0
3736
-     */
3737
-    require_once(geodir_plugin_path() . '/language.php');
3738
-
3739
-    $language_file = geodir_plugin_path() . '/db-language.php';
3740
-
3741
-    // Load language string file if not created yet
3742
-    if (!file_exists($language_file)) {
3743
-        geodirectory_load_db_language();
3744
-    }
3745
-
3746
-    if (file_exists($language_file)) {
3747
-        /**
3748
-         * Language strings from database.
3749
-         *
3750
-         * @since 1.4.2
3751
-         */
3752
-        try {
3753
-            require_once($language_file);
3754
-        } catch(Exception $e) {
3755
-            error_log('Language Error: ' . $e->getMessage());
3756
-        }
3757
-    }
3721
+	/**
3722
+	 * Filter the plugin locale.
3723
+	 *
3724
+	 * @since 1.4.2
3725
+	 * @package GeoDirectory
3726
+	 */
3727
+	$locale = apply_filters('plugin_locale', get_locale(), 'geodirectory');
3728
+
3729
+	load_textdomain('geodirectory', WP_LANG_DIR . '/' . 'geodirectory' . '/' . 'geodirectory' . '-' . $locale . '.mo');
3730
+	load_plugin_textdomain('geodirectory', false, plugin_basename(dirname(dirname(__FILE__))) . '/geodirectory-languages');
3731
+
3732
+	/**
3733
+	 * Define language constants.
3734
+	 *
3735
+	 * @since 1.0.0
3736
+	 */
3737
+	require_once(geodir_plugin_path() . '/language.php');
3738
+
3739
+	$language_file = geodir_plugin_path() . '/db-language.php';
3740
+
3741
+	// Load language string file if not created yet
3742
+	if (!file_exists($language_file)) {
3743
+		geodirectory_load_db_language();
3744
+	}
3745
+
3746
+	if (file_exists($language_file)) {
3747
+		/**
3748
+		 * Language strings from database.
3749
+		 *
3750
+		 * @since 1.4.2
3751
+		 */
3752
+		try {
3753
+			require_once($language_file);
3754
+		} catch(Exception $e) {
3755
+			error_log('Language Error: ' . $e->getMessage());
3756
+		}
3757
+	}
3758 3758
 }
3759 3759
 
3760 3760
 /**
@@ -3768,66 +3768,66 @@  discard block
 block discarded – undo
3768 3768
  * @return bool True if file created otherwise false
3769 3769
  */
3770 3770
 function geodirectory_load_db_language() {
3771
-    global $wp_filesystem;
3772
-    if( empty( $wp_filesystem ) ) {
3773
-        require_once( ABSPATH .'/wp-admin/includes/file.php' );
3774
-        WP_Filesystem();
3775
-        global $wp_filesystem;
3776
-    }
3777
-
3778
-    $language_file = geodir_plugin_path() . '/db-language.php';
3779
-
3780
-    if(is_file($language_file) && !is_writable($language_file))
3781
-        return false; // Not possible to create.
3782
-
3783
-    if(!is_file($language_file) && !is_writable(dirname($language_file)))
3784
-        return false; // Not possible to create.
3785
-
3786
-    $contents_strings = array();
3787
-
3788
-    /**
3789
-     * Filter the language string from database to translate via po editor
3790
-     *
3791
-     * @since 1.4.2
3792
-     *
3793
-     * @param array $contents_strings Array of strings.
3794
-     */
3795
-    $contents_strings = apply_filters('geodir_load_db_language', $contents_strings);
3796
-
3797
-    $contents_strings = array_unique($contents_strings);
3798
-
3799
-    $contents_head = array();
3800
-    $contents_head[] = "<?php";
3801
-    $contents_head[] = "/**";
3802
-    $contents_head[] = " * Translate language string stored in database. Ex: Custom Fields";
3803
-    $contents_head[] = " *";
3804
-    $contents_head[] = " * @package GeoDirectory";
3805
-    $contents_head[] = " * @since 1.4.2";
3806
-    $contents_head[] = " */";
3807
-    $contents_head[] = "";
3808
-    $contents_head[] = "// Language keys";
3809
-
3810
-    $contents_foot = array();
3811
-    $contents_foot[] = "";
3812
-    $contents_foot[] = "";
3813
-
3814
-    $contents = implode(PHP_EOL, $contents_head);
3815
-
3816
-    if (!empty($contents_strings)) {
3817
-        foreach ( $contents_strings as $string ) {
3818
-            if (is_scalar($string) && $string != '') {
3819
-                $string = str_replace("'", "\'", $string);
3820
-                $contents .= PHP_EOL . "__('" . $string . "', 'geodirectory');";
3821
-            }
3822
-        }
3823
-    }
3824
-
3825
-    $contents .= implode(PHP_EOL, $contents_foot);
3826
-
3827
-    if($wp_filesystem->put_contents( $language_file, $contents, FS_CHMOD_FILE))
3828
-        return false; // Failure; could not write file.
3829
-
3830
-    return true;
3771
+	global $wp_filesystem;
3772
+	if( empty( $wp_filesystem ) ) {
3773
+		require_once( ABSPATH .'/wp-admin/includes/file.php' );
3774
+		WP_Filesystem();
3775
+		global $wp_filesystem;
3776
+	}
3777
+
3778
+	$language_file = geodir_plugin_path() . '/db-language.php';
3779
+
3780
+	if(is_file($language_file) && !is_writable($language_file))
3781
+		return false; // Not possible to create.
3782
+
3783
+	if(!is_file($language_file) && !is_writable(dirname($language_file)))
3784
+		return false; // Not possible to create.
3785
+
3786
+	$contents_strings = array();
3787
+
3788
+	/**
3789
+	 * Filter the language string from database to translate via po editor
3790
+	 *
3791
+	 * @since 1.4.2
3792
+	 *
3793
+	 * @param array $contents_strings Array of strings.
3794
+	 */
3795
+	$contents_strings = apply_filters('geodir_load_db_language', $contents_strings);
3796
+
3797
+	$contents_strings = array_unique($contents_strings);
3798
+
3799
+	$contents_head = array();
3800
+	$contents_head[] = "<?php";
3801
+	$contents_head[] = "/**";
3802
+	$contents_head[] = " * Translate language string stored in database. Ex: Custom Fields";
3803
+	$contents_head[] = " *";
3804
+	$contents_head[] = " * @package GeoDirectory";
3805
+	$contents_head[] = " * @since 1.4.2";
3806
+	$contents_head[] = " */";
3807
+	$contents_head[] = "";
3808
+	$contents_head[] = "// Language keys";
3809
+
3810
+	$contents_foot = array();
3811
+	$contents_foot[] = "";
3812
+	$contents_foot[] = "";
3813
+
3814
+	$contents = implode(PHP_EOL, $contents_head);
3815
+
3816
+	if (!empty($contents_strings)) {
3817
+		foreach ( $contents_strings as $string ) {
3818
+			if (is_scalar($string) && $string != '') {
3819
+				$string = str_replace("'", "\'", $string);
3820
+				$contents .= PHP_EOL . "__('" . $string . "', 'geodirectory');";
3821
+			}
3822
+		}
3823
+	}
3824
+
3825
+	$contents .= implode(PHP_EOL, $contents_foot);
3826
+
3827
+	if($wp_filesystem->put_contents( $language_file, $contents, FS_CHMOD_FILE))
3828
+		return false; // Failure; could not write file.
3829
+
3830
+	return true;
3831 3831
 }
3832 3832
 
3833 3833
 /**
@@ -3843,31 +3843,31 @@  discard block
 block discarded – undo
3843 3843
  * @return array Translation texts.
3844 3844
  */
3845 3845
 function geodir_load_custom_field_translation($translation_texts = array()) {
3846
-    global $wpdb;
3846
+	global $wpdb;
3847 3847
 
3848
-    // Custom fields table
3849
-    $sql = "SELECT admin_title, admin_desc, site_title, clabels, required_msg, default_value, option_values FROM " . GEODIR_CUSTOM_FIELDS_TABLE;
3850
-    $rows = $wpdb->get_results($sql);
3848
+	// Custom fields table
3849
+	$sql = "SELECT admin_title, admin_desc, site_title, clabels, required_msg, default_value, option_values FROM " . GEODIR_CUSTOM_FIELDS_TABLE;
3850
+	$rows = $wpdb->get_results($sql);
3851 3851
 
3852
-    if (!empty($rows)) {
3853
-        foreach($rows as $row) {
3854
-            if (!empty($row->admin_title))
3855
-                $translation_texts[] = stripslashes_deep($row->admin_title);
3852
+	if (!empty($rows)) {
3853
+		foreach($rows as $row) {
3854
+			if (!empty($row->admin_title))
3855
+				$translation_texts[] = stripslashes_deep($row->admin_title);
3856 3856
 			
3857
-            if (!empty($row->admin_desc))
3858
-                $translation_texts[] = stripslashes_deep($row->admin_desc);
3857
+			if (!empty($row->admin_desc))
3858
+				$translation_texts[] = stripslashes_deep($row->admin_desc);
3859 3859
 
3860
-            if (!empty($row->site_title))
3861
-                $translation_texts[] = stripslashes_deep($row->site_title);
3860
+			if (!empty($row->site_title))
3861
+				$translation_texts[] = stripslashes_deep($row->site_title);
3862 3862
 
3863
-            if (!empty($row->clabels))
3864
-                $translation_texts[] = stripslashes_deep($row->clabels);
3863
+			if (!empty($row->clabels))
3864
+				$translation_texts[] = stripslashes_deep($row->clabels);
3865 3865
 
3866
-            if (!empty($row->required_msg))
3867
-                $translation_texts[] = stripslashes_deep($row->required_msg);
3866
+			if (!empty($row->required_msg))
3867
+				$translation_texts[] = stripslashes_deep($row->required_msg);
3868 3868
 			
3869 3869
 			if (!empty($row->default_value))
3870
-                $translation_texts[] = stripslashes_deep($row->default_value);
3870
+				$translation_texts[] = stripslashes_deep($row->default_value);
3871 3871
 			
3872 3872
 			if (!empty($row->option_values)) {
3873 3873
 				$option_values = geodir_string_values_to_options(stripslashes_deep($row->option_values));
@@ -3880,25 +3880,25 @@  discard block
 block discarded – undo
3880 3880
 					}
3881 3881
 				}
3882 3882
 			}
3883
-        }
3884
-    }
3883
+		}
3884
+	}
3885 3885
 	
3886
-    // Custom sorting fields table
3887
-    $sql = "SELECT site_title, asc_title, desc_title FROM " . GEODIR_CUSTOM_SORT_FIELDS_TABLE;
3888
-    $rows = $wpdb->get_results($sql);
3889
-
3890
-    if (!empty($rows)) {
3891
-        foreach($rows as $row) {
3892
-            if (!empty($row->site_title))
3893
-                $translation_texts[] = stripslashes_deep($row->site_title);
3894
-
3895
-            if (!empty($row->asc_title))
3896
-                $translation_texts[] = stripslashes_deep($row->asc_title);
3897
-
3898
-            if (!empty($row->desc_title))
3899
-                $translation_texts[] = stripslashes_deep($row->desc_title);
3900
-        }
3901
-    }
3886
+	// Custom sorting fields table
3887
+	$sql = "SELECT site_title, asc_title, desc_title FROM " . GEODIR_CUSTOM_SORT_FIELDS_TABLE;
3888
+	$rows = $wpdb->get_results($sql);
3889
+
3890
+	if (!empty($rows)) {
3891
+		foreach($rows as $row) {
3892
+			if (!empty($row->site_title))
3893
+				$translation_texts[] = stripslashes_deep($row->site_title);
3894
+
3895
+			if (!empty($row->asc_title))
3896
+				$translation_texts[] = stripslashes_deep($row->asc_title);
3897
+
3898
+			if (!empty($row->desc_title))
3899
+				$translation_texts[] = stripslashes_deep($row->desc_title);
3900
+		}
3901
+	}
3902 3902
 	
3903 3903
 	// Advance search filter fields table
3904 3904
 	if (defined('GEODIR_ADVANCE_SEARCH_TABLE')) {
@@ -3919,9 +3919,9 @@  discard block
 block discarded – undo
3919 3919
 		}
3920 3920
 	}
3921 3921
 
3922
-    $translation_texts = !empty($translation_texts) ? array_unique($translation_texts) : $translation_texts;
3922
+	$translation_texts = !empty($translation_texts) ? array_unique($translation_texts) : $translation_texts;
3923 3923
 
3924
-    return $translation_texts;
3924
+	return $translation_texts;
3925 3925
 }
3926 3926
 
3927 3927
 /**
@@ -3933,71 +3933,71 @@  discard block
 block discarded – undo
3933 3933
  * @return array Array of mime types.
3934 3934
  */
3935 3935
 function geodir_allowed_mime_types() {
3936
-    /**
3937
-     * Filter the list of mime types and file extensions allowed for file upload.
3938
-     *
3939
-     * @since 1.4.7
3940
-     * @package GeoDirectory
3941
-     *
3942
-     * @param array $geodir_allowed_mime_types and file extensions.
3943
-     */
3944
-    return apply_filters( 'geodir_allowed_mime_types', array(
3945
-            'Image' => array( // Image formats.
3946
-                'jpg' => 'image/jpeg',
3947
-                'jpe' => 'image/jpeg',
3948
-                'jpeg' => 'image/jpeg',
3949
-                'gif' => 'image/gif',
3950
-                'png' => 'image/png',
3951
-                'bmp' => 'image/bmp',
3952
-                'ico' => 'image/x-icon',
3953
-            ),
3954
-            'Video' => array( // Video formats.
3955
-                'asf' => 'video/x-ms-asf',
3956
-                'avi' => 'video/avi',
3957
-                'flv' => 'video/x-flv',
3958
-                'mkv' => 'video/x-matroska',
3959
-                'mp4' => 'video/mp4',
3960
-                'mpeg' => 'video/mpeg',
3961
-                'mpg' => 'video/mpeg',
3962
-                'wmv' => 'video/x-ms-wmv',
3963
-                '3gp' => 'video/3gpp',
3964
-            ),
3965
-            'Audio' => array( // Audio formats.
3966
-                'ogg' => 'audio/ogg',
3967
-                'mp3' => 'audio/mpeg',
3968
-                'wav' => 'audio/wav',
3969
-                'wma' => 'audio/x-ms-wma',
3970
-            ),
3971
-            'Text' => array( // Text formats.
3972
-                'css' => 'text/css',
3973
-                'csv' => 'text/csv',
3974
-                'htm' => 'text/html',
3975
-                'html' => 'text/html',
3976
-                'txt' => 'text/plain',
3977
-                'rtx' => 'text/richtext',
3978
-                'vtt' => 'text/vtt',
3979
-            ),
3980
-            'Application' => array( // Application formats.
3981
-                'doc' => 'application/msword',
3982
-                'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
3983
-                'exe' => 'application/x-msdownload',
3984
-                'js' => 'application/javascript',
3985
-                'odt' => 'application/vnd.oasis.opendocument.text',
3986
-                'pdf' => 'application/pdf',
3987
-                'pot' => 'application/vnd.ms-powerpoint',
3988
-                'ppt' => 'application/vnd.ms-powerpoint',
3989
-                'pptx' => 'application/vnd.ms-powerpoint',
3990
-                'psd' => 'application/octet-stream',
3991
-                'rar' => 'application/rar',
3992
-                'rtf' => 'application/rtf',
3993
-                'swf' => 'application/x-shockwave-flash',
3994
-                'tar' => 'application/x-tar',
3995
-                'xls' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
3996
-                'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
3997
-                'zip' => 'application/zip',
3998
-            )
3999
-        )
4000
-    );
3936
+	/**
3937
+	 * Filter the list of mime types and file extensions allowed for file upload.
3938
+	 *
3939
+	 * @since 1.4.7
3940
+	 * @package GeoDirectory
3941
+	 *
3942
+	 * @param array $geodir_allowed_mime_types and file extensions.
3943
+	 */
3944
+	return apply_filters( 'geodir_allowed_mime_types', array(
3945
+			'Image' => array( // Image formats.
3946
+				'jpg' => 'image/jpeg',
3947
+				'jpe' => 'image/jpeg',
3948
+				'jpeg' => 'image/jpeg',
3949
+				'gif' => 'image/gif',
3950
+				'png' => 'image/png',
3951
+				'bmp' => 'image/bmp',
3952
+				'ico' => 'image/x-icon',
3953
+			),
3954
+			'Video' => array( // Video formats.
3955
+				'asf' => 'video/x-ms-asf',
3956
+				'avi' => 'video/avi',
3957
+				'flv' => 'video/x-flv',
3958
+				'mkv' => 'video/x-matroska',
3959
+				'mp4' => 'video/mp4',
3960
+				'mpeg' => 'video/mpeg',
3961
+				'mpg' => 'video/mpeg',
3962
+				'wmv' => 'video/x-ms-wmv',
3963
+				'3gp' => 'video/3gpp',
3964
+			),
3965
+			'Audio' => array( // Audio formats.
3966
+				'ogg' => 'audio/ogg',
3967
+				'mp3' => 'audio/mpeg',
3968
+				'wav' => 'audio/wav',
3969
+				'wma' => 'audio/x-ms-wma',
3970
+			),
3971
+			'Text' => array( // Text formats.
3972
+				'css' => 'text/css',
3973
+				'csv' => 'text/csv',
3974
+				'htm' => 'text/html',
3975
+				'html' => 'text/html',
3976
+				'txt' => 'text/plain',
3977
+				'rtx' => 'text/richtext',
3978
+				'vtt' => 'text/vtt',
3979
+			),
3980
+			'Application' => array( // Application formats.
3981
+				'doc' => 'application/msword',
3982
+				'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
3983
+				'exe' => 'application/x-msdownload',
3984
+				'js' => 'application/javascript',
3985
+				'odt' => 'application/vnd.oasis.opendocument.text',
3986
+				'pdf' => 'application/pdf',
3987
+				'pot' => 'application/vnd.ms-powerpoint',
3988
+				'ppt' => 'application/vnd.ms-powerpoint',
3989
+				'pptx' => 'application/vnd.ms-powerpoint',
3990
+				'psd' => 'application/octet-stream',
3991
+				'rar' => 'application/rar',
3992
+				'rtf' => 'application/rtf',
3993
+				'swf' => 'application/x-shockwave-flash',
3994
+				'tar' => 'application/x-tar',
3995
+				'xls' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
3996
+				'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
3997
+				'zip' => 'application/zip',
3998
+			)
3999
+		)
4000
+	);
4001 4001
 }
4002 4002
 
4003 4003
 /**
@@ -4009,21 +4009,21 @@  discard block
 block discarded – undo
4009 4009
  * @return string User display name.
4010 4010
  */
4011 4011
 function geodir_get_client_name($user_id) {
4012
-    $client_name = '';
4012
+	$client_name = '';
4013 4013
 
4014
-    $user_data = get_userdata($user_id);
4014
+	$user_data = get_userdata($user_id);
4015 4015
 
4016
-    if (!empty($user_data)) {
4017
-        if (isset($user_data->display_name) && trim($user_data->display_name) != '') {
4018
-            $client_name = trim($user_data->display_name);
4019
-        } else if (isset($user_data->user_nicename) && trim($user_data->user_nicename) != '') {
4020
-            $client_name = trim($user_data->user_nicename);
4021
-        } else {
4022
-            $client_name = trim($user_data->user_login);
4023
-        }
4024
-    }
4016
+	if (!empty($user_data)) {
4017
+		if (isset($user_data->display_name) && trim($user_data->display_name) != '') {
4018
+			$client_name = trim($user_data->display_name);
4019
+		} else if (isset($user_data->user_nicename) && trim($user_data->user_nicename) != '') {
4020
+			$client_name = trim($user_data->user_nicename);
4021
+		} else {
4022
+			$client_name = trim($user_data->user_login);
4023
+		}
4024
+	}
4025 4025
 
4026
-    return $client_name;
4026
+	return $client_name;
4027 4027
 }
4028 4028
 
4029 4029
 
@@ -4038,125 +4038,125 @@  discard block
 block discarded – undo
4038 4038
  */
4039 4039
 function geodir_wpseo_replacements($vars){
4040 4040
 
4041
-    global $wp;
4042
-    $title = '';
4043
-    // location variables
4044
-    $gd_post_type = geodir_get_current_posttype();
4045
-    $location_array = geodir_get_current_location_terms('query_vars', $gd_post_type);
4046
-    /**
4047
-     * Filter the title variables location variables array
4048
-     *
4049
-     * @since 1.5.5
4050
-     * @package GeoDirectory
4051
-     * @param array $location_array The array of location variables.
4052
-     * @param array $vars The page title variables.
4053
-     */
4054
-    $location_array = apply_filters('geodir_filter_title_variables_location_arr_seo',$location_array, $vars);
4055
-    $location_titles = array();
4056
-    if(get_query_var( 'gd_country_full' )){
4057
-        if(get_query_var( 'gd_country_full' )){$location_array['gd_country'] = get_query_var( 'gd_country_full' );}
4058
-        if(get_query_var( 'gd_region_full' )){$location_array['gd_region'] = get_query_var( 'gd_region_full' );}
4059
-        if(get_query_var( 'gd_city_full' )){$location_array['gd_city'] = get_query_var( 'gd_city_full' );}
4060
-    }
4061
-    $location_single = '';
4062
-    $gd_country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : '';
4063
-    $gd_region = (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') ? $wp->query_vars['gd_region'] : '';
4064
-    $gd_city = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : '';
4065
-
4066
-    $gd_country_actual = $gd_region_actual = $gd_city_actual = '';
4067
-
4068
-    if (function_exists('get_actual_location_name')) {
4069
-        $gd_country_actual = $gd_country != '' ? get_actual_location_name('country', $gd_country, true) : $gd_country;
4070
-        $gd_region_actual = $gd_region != '' ? get_actual_location_name('region', $gd_region) : $gd_region;
4071
-        $gd_city_actual = $gd_city != '' ? get_actual_location_name('city', $gd_city) : $gd_city;
4072
-    }
4073
-
4074
-    if ($gd_city != '') {
4075
-        if ($gd_city_actual != '') {
4076
-            $gd_city = $gd_city_actual;
4077
-        } else {
4078
-            $gd_city = preg_replace('/-(\d+)$/', '', $gd_city);
4079
-            $gd_city = preg_replace('/[_-]/', ' ', $gd_city);
4080
-            $gd_city = __(geodir_ucwords($gd_city), 'geodirectory');
4081
-        }
4082
-        $location_single = $gd_city;
4083
-
4084
-    } else if ($gd_region != '') {
4085
-        if ($gd_region_actual != '') {
4086
-            $gd_region = $gd_region_actual;
4087
-        } else {
4088
-            $gd_region = preg_replace('/-(\d+)$/', '', $gd_region);
4089
-            $gd_region = preg_replace('/[_-]/', ' ', $gd_region);
4090
-            $gd_region = __(geodir_ucwords($gd_region), 'geodirectory');
4091
-        }
4092
-
4093
-        $location_single = $gd_region;
4094
-    } else if ($gd_country != '') {
4095
-        if ($gd_country_actual != '') {
4096
-            $gd_country = $gd_country_actual;
4097
-        } else {
4098
-            $gd_country = preg_replace('/-(\d+)$/', '', $gd_country);
4099
-            $gd_country = preg_replace('/[_-]/', ' ', $gd_country);
4100
-            $gd_country = __(geodir_ucwords($gd_country), 'geodirectory');
4101
-        }
4102
-
4103
-        $location_single = $gd_country;
4104
-    }
4105
-
4106
-    if (!empty($location_array)) {
4107
-
4108
-        $actual_location_name = function_exists('get_actual_location_name') ? true : false;
4109
-        $location_array = array_reverse($location_array);
4110
-
4111
-        foreach ($location_array as $location_type => $location) {
4112
-            $gd_location_link_text = preg_replace('/-(\d+)$/', '', $location);
4113
-            $gd_location_link_text = preg_replace('/[_-]/', ' ', $gd_location_link_text);
4114
-
4115
-            $location_name = geodir_ucwords($gd_location_link_text);
4116
-            $location_name = __($location_name, 'geodirectory');
4117
-
4118
-            if ($actual_location_name) {
4119
-                $location_type = strpos($location_type, 'gd_') === 0 ? substr($location_type, 3) : $location_type;
4120
-                $location_name = get_actual_location_name($location_type, $location, true);
4121
-            }
4122
-
4123
-            $location_titles[] = $location_name;
4124
-        }
4125
-        if (!empty($location_titles)) {
4126
-            $location_titles = array_unique($location_titles);
4127
-        }
4128
-    }
4129
-
4130
-
4131
-    if(!empty($location_titles)) {
4132
-        $vars['%%location%%'] = implode(", ", $location_titles);
4133
-    }
4134
-
4135
-
4136
-    if(!empty($location_titles)) {
4137
-        $vars['%%in_location%%'] = __('in ', 'geodirectory') . implode(", ", $location_titles);
4138
-    }
4139
-
4140
-
4141
-
4142
-    if($location_single) {
4143
-        $vars['%%in_location_single%%'] = __('in', 'geodirectory') . ' ' .$location_single;
4144
-    }
4145
-
4146
-
4147
-    if($location_single) {
4148
-        $vars['%%location_single%%'] = $location_single;
4149
-    }
4150
-
4151
-    /**
4152
-     * Filter the title variables after standard ones have been filtered for wpseo.
4153
-     *
4154
-     * @since 1.5.7
4155
-     * @package GeoDirectory
4156
-     * @param string $vars The title with variables.
4157
-     * @param array $location_array The array of location variables.
4158
-     */
4159
-    return apply_filters('geodir_wpseo_replacements_vars',$vars,$location_array);
4041
+	global $wp;
4042
+	$title = '';
4043
+	// location variables
4044
+	$gd_post_type = geodir_get_current_posttype();
4045
+	$location_array = geodir_get_current_location_terms('query_vars', $gd_post_type);
4046
+	/**
4047
+	 * Filter the title variables location variables array
4048
+	 *
4049
+	 * @since 1.5.5
4050
+	 * @package GeoDirectory
4051
+	 * @param array $location_array The array of location variables.
4052
+	 * @param array $vars The page title variables.
4053
+	 */
4054
+	$location_array = apply_filters('geodir_filter_title_variables_location_arr_seo',$location_array, $vars);
4055
+	$location_titles = array();
4056
+	if(get_query_var( 'gd_country_full' )){
4057
+		if(get_query_var( 'gd_country_full' )){$location_array['gd_country'] = get_query_var( 'gd_country_full' );}
4058
+		if(get_query_var( 'gd_region_full' )){$location_array['gd_region'] = get_query_var( 'gd_region_full' );}
4059
+		if(get_query_var( 'gd_city_full' )){$location_array['gd_city'] = get_query_var( 'gd_city_full' );}
4060
+	}
4061
+	$location_single = '';
4062
+	$gd_country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : '';
4063
+	$gd_region = (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') ? $wp->query_vars['gd_region'] : '';
4064
+	$gd_city = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : '';
4065
+
4066
+	$gd_country_actual = $gd_region_actual = $gd_city_actual = '';
4067
+
4068
+	if (function_exists('get_actual_location_name')) {
4069
+		$gd_country_actual = $gd_country != '' ? get_actual_location_name('country', $gd_country, true) : $gd_country;
4070
+		$gd_region_actual = $gd_region != '' ? get_actual_location_name('region', $gd_region) : $gd_region;
4071
+		$gd_city_actual = $gd_city != '' ? get_actual_location_name('city', $gd_city) : $gd_city;
4072
+	}
4073
+
4074
+	if ($gd_city != '') {
4075
+		if ($gd_city_actual != '') {
4076
+			$gd_city = $gd_city_actual;
4077
+		} else {
4078
+			$gd_city = preg_replace('/-(\d+)$/', '', $gd_city);
4079
+			$gd_city = preg_replace('/[_-]/', ' ', $gd_city);
4080
+			$gd_city = __(geodir_ucwords($gd_city), 'geodirectory');
4081
+		}
4082
+		$location_single = $gd_city;
4083
+
4084
+	} else if ($gd_region != '') {
4085
+		if ($gd_region_actual != '') {
4086
+			$gd_region = $gd_region_actual;
4087
+		} else {
4088
+			$gd_region = preg_replace('/-(\d+)$/', '', $gd_region);
4089
+			$gd_region = preg_replace('/[_-]/', ' ', $gd_region);
4090
+			$gd_region = __(geodir_ucwords($gd_region), 'geodirectory');
4091
+		}
4092
+
4093
+		$location_single = $gd_region;
4094
+	} else if ($gd_country != '') {
4095
+		if ($gd_country_actual != '') {
4096
+			$gd_country = $gd_country_actual;
4097
+		} else {
4098
+			$gd_country = preg_replace('/-(\d+)$/', '', $gd_country);
4099
+			$gd_country = preg_replace('/[_-]/', ' ', $gd_country);
4100
+			$gd_country = __(geodir_ucwords($gd_country), 'geodirectory');
4101
+		}
4102
+
4103
+		$location_single = $gd_country;
4104
+	}
4105
+
4106
+	if (!empty($location_array)) {
4107
+
4108
+		$actual_location_name = function_exists('get_actual_location_name') ? true : false;
4109
+		$location_array = array_reverse($location_array);
4110
+
4111
+		foreach ($location_array as $location_type => $location) {
4112
+			$gd_location_link_text = preg_replace('/-(\d+)$/', '', $location);
4113
+			$gd_location_link_text = preg_replace('/[_-]/', ' ', $gd_location_link_text);
4114
+
4115
+			$location_name = geodir_ucwords($gd_location_link_text);
4116
+			$location_name = __($location_name, 'geodirectory');
4117
+
4118
+			if ($actual_location_name) {
4119
+				$location_type = strpos($location_type, 'gd_') === 0 ? substr($location_type, 3) : $location_type;
4120
+				$location_name = get_actual_location_name($location_type, $location, true);
4121
+			}
4122
+
4123
+			$location_titles[] = $location_name;
4124
+		}
4125
+		if (!empty($location_titles)) {
4126
+			$location_titles = array_unique($location_titles);
4127
+		}
4128
+	}
4129
+
4130
+
4131
+	if(!empty($location_titles)) {
4132
+		$vars['%%location%%'] = implode(", ", $location_titles);
4133
+	}
4134
+
4135
+
4136
+	if(!empty($location_titles)) {
4137
+		$vars['%%in_location%%'] = __('in ', 'geodirectory') . implode(", ", $location_titles);
4138
+	}
4139
+
4140
+
4141
+
4142
+	if($location_single) {
4143
+		$vars['%%in_location_single%%'] = __('in', 'geodirectory') . ' ' .$location_single;
4144
+	}
4145
+
4146
+
4147
+	if($location_single) {
4148
+		$vars['%%location_single%%'] = $location_single;
4149
+	}
4150
+
4151
+	/**
4152
+	 * Filter the title variables after standard ones have been filtered for wpseo.
4153
+	 *
4154
+	 * @since 1.5.7
4155
+	 * @package GeoDirectory
4156
+	 * @param string $vars The title with variables.
4157
+	 * @param array $location_array The array of location variables.
4158
+	 */
4159
+	return apply_filters('geodir_wpseo_replacements_vars',$vars,$location_array);
4160 4160
 }
4161 4161
 
4162 4162
 
@@ -4204,286 +4204,286 @@  discard block
 block discarded – undo
4204 4204
  * @return string Title after filtered variables.
4205 4205
  */
4206 4206
 function geodir_filter_title_variables($title, $gd_page, $sep = '') {
4207
-    global $wp, $post;
4207
+	global $wp, $post;
4208 4208
 
4209
-    if (!$gd_page || !$title) {
4210
-        return $title; // if no a GD page then bail.
4211
-    }
4209
+	if (!$gd_page || !$title) {
4210
+		return $title; // if no a GD page then bail.
4211
+	}
4212 4212
     
4213
-    if ($sep == '') {
4214
-        /**
4215
-         * Filter the page title separator.
4216
-         *
4217
-         * @since 1.0.0
4218
-         * @package GeoDirectory
4219
-         * @param string $sep The separator, default: `|`.
4220
-         */
4221
-        $sep = apply_filters('geodir_page_title_separator', '|');
4222
-    }
4223
-
4224
-    if (strpos($title,'%%title%%') !== false) {
4225
-        $title = str_replace("%%title%%", $post->post_title, $title);
4226
-    }
4227
-
4228
-    if (strpos($title,'%%sitename%%') !== false) {
4229
-        $title = str_replace("%%sitename%%", get_bloginfo('name'), $title);
4230
-    }
4231
-
4232
-    if (strpos($title,'%%sitedesc%%') !== false) {
4233
-        $title = str_replace("%%sitedesc%%", get_bloginfo('description'), $title);
4234
-    }
4235
-
4236
-    if (strpos($title,'%%excerpt%%') !== false) {
4237
-        $title = str_replace("%%excerpt%%", strip_tags(get_the_excerpt()), $title);
4238
-    }
4213
+	if ($sep == '') {
4214
+		/**
4215
+		 * Filter the page title separator.
4216
+		 *
4217
+		 * @since 1.0.0
4218
+		 * @package GeoDirectory
4219
+		 * @param string $sep The separator, default: `|`.
4220
+		 */
4221
+		$sep = apply_filters('geodir_page_title_separator', '|');
4222
+	}
4223
+
4224
+	if (strpos($title,'%%title%%') !== false) {
4225
+		$title = str_replace("%%title%%", $post->post_title, $title);
4226
+	}
4227
+
4228
+	if (strpos($title,'%%sitename%%') !== false) {
4229
+		$title = str_replace("%%sitename%%", get_bloginfo('name'), $title);
4230
+	}
4231
+
4232
+	if (strpos($title,'%%sitedesc%%') !== false) {
4233
+		$title = str_replace("%%sitedesc%%", get_bloginfo('description'), $title);
4234
+	}
4235
+
4236
+	if (strpos($title,'%%excerpt%%') !== false) {
4237
+		$title = str_replace("%%excerpt%%", strip_tags(get_the_excerpt()), $title);
4238
+	}
4239 4239
     
4240
-    if ($gd_page == 'search' || $gd_page == 'author') {
4241
-        $post_type = sanitize_text_field($_REQUEST['stype']);
4242
-    } else if ($gd_page == 'add-listing') {
4243
-        $post_type = sanitize_text_field($_REQUEST['listing_type']);
4244
-        $post_type = !$post_type && !empty($_REQUEST['pid']) ? get_post_type((int)$_REQUEST['pid']) : $post_type;
4245
-    } else if (isset($post->post_type) && $post->post_type && in_array($post->post_type , geodir_get_posttypes())) {
4246
-        $post_type = $post->post_type;
4247
-    } else {
4248
-        $post_type = get_query_var('post_type');
4249
-    }
4240
+	if ($gd_page == 'search' || $gd_page == 'author') {
4241
+		$post_type = sanitize_text_field($_REQUEST['stype']);
4242
+	} else if ($gd_page == 'add-listing') {
4243
+		$post_type = sanitize_text_field($_REQUEST['listing_type']);
4244
+		$post_type = !$post_type && !empty($_REQUEST['pid']) ? get_post_type((int)$_REQUEST['pid']) : $post_type;
4245
+	} else if (isset($post->post_type) && $post->post_type && in_array($post->post_type , geodir_get_posttypes())) {
4246
+		$post_type = $post->post_type;
4247
+	} else {
4248
+		$post_type = get_query_var('post_type');
4249
+	}
4250 4250
     
4251
-    if (strpos($title, '%%pt_single%%') !== false) {        
4252
-        $singular_name = '';
4253
-        if ($post_type && $singular_name = get_post_type_singular_label($post_type)) {
4254
-            $singular_name = __($singular_name, 'geodirectory');
4255
-        }
4251
+	if (strpos($title, '%%pt_single%%') !== false) {        
4252
+		$singular_name = '';
4253
+		if ($post_type && $singular_name = get_post_type_singular_label($post_type)) {
4254
+			$singular_name = __($singular_name, 'geodirectory');
4255
+		}
4256 4256
         
4257
-        $title = str_replace("%%pt_single%%", $singular_name, $title);
4258
-    }
4259
-
4260
-    if (strpos($title, '%%pt_plural%%') !== false) {        
4261
-        $plural_name = '';
4262
-        if ($post_type && $plural_name = get_post_type_plural_label($post_type)) {
4263
-            $plural_name = __($plural_name, 'geodirectory');
4264
-        }
4257
+		$title = str_replace("%%pt_single%%", $singular_name, $title);
4258
+	}
4259
+
4260
+	if (strpos($title, '%%pt_plural%%') !== false) {        
4261
+		$plural_name = '';
4262
+		if ($post_type && $plural_name = get_post_type_plural_label($post_type)) {
4263
+			$plural_name = __($plural_name, 'geodirectory');
4264
+		}
4265 4265
         
4266
-        $title = str_replace("%%pt_plural%%", $plural_name, $title);
4267
-    }
4268
-
4269
-    if (strpos($title, '%%category%%') !== false) {
4270
-        $cat_name = '';
4271
-
4272
-        if ($gd_page=='detail') {
4273
-            if ($post->default_category) {
4274
-                $cat = get_term($post->default_category, $post->post_type . 'category');
4275
-                $cat_name = (isset($cat->name)) ? $cat->name : '';
4276
-            }
4277
-        } else if ($gd_page == 'listing') {
4278
-            $queried_object = get_queried_object();
4279
-            if (isset($queried_object->name)) {
4280
-                $cat_name = $queried_object->name;
4281
-            }
4282
-        }
4283
-        $title = str_replace("%%category%%", $cat_name, $title);
4284
-    }
4285
-
4286
-    if (strpos($title, '%%tag%%') !== false) {
4287
-        $cat_name = '';
4288
-
4289
-        if ($gd_page=='detail') {
4290
-            if ($post->default_category) {
4291
-                $cat = get_term($post->default_category, $post->post_type . 'category');
4292
-                $cat_name = (isset($cat->name)) ? $cat->name : '';
4293
-            }
4294
-        } else if($gd_page == 'listing') {
4295
-            $queried_object = get_queried_object();
4296
-            if (isset($queried_object->name)) {
4297
-                $cat_name = $queried_object->name;
4298
-            }
4299
-        }
4300
-        $title = str_replace("%%tag%%", $cat_name, $title);
4301
-    }
4302
-
4303
-    if (strpos($title, '%%id%%') !== false) {
4304
-        $ID = (isset($post->ID)) ? $post->ID : '';
4305
-        $title = str_replace("%%id%%", $ID, $title);
4306
-    }
4307
-
4308
-    if (strpos($title,'%%sep%%') !== false) {
4309
-        $title = str_replace("%%sep%%", $sep, $title);
4310
-    }
4311
-
4312
-    // location variables
4313
-    $gd_post_type = geodir_get_current_posttype();
4314
-    $location_array = geodir_get_current_location_terms('query_vars', $gd_post_type);
4315
-    /**
4316
-     * Filter the title variables location variables array
4317
-     *
4318
-     * @since 1.5.5
4319
-     * @package GeoDirectory
4320
-     * @param array $location_array The array of location variables.
4321
-     * @param string $title The title with variables..
4322
-     * @param string $gd_page The page being filtered.
4323
-     * @param string $sep The separator, default: `|`.
4324
-     */
4325
-    $location_array = apply_filters('geodir_filter_title_variables_location_arr',$location_array,$title, $gd_page, $sep);
4326
-    $location_titles = array();
4327
-    if($gd_page=='location' && get_query_var( 'gd_country_full' )){
4328
-        if(get_query_var( 'gd_country_full' )){$location_array['gd_country'] = get_query_var( 'gd_country_full' );}
4329
-        if(get_query_var( 'gd_region_full' )){$location_array['gd_region'] = get_query_var( 'gd_region_full' );}
4330
-        if(get_query_var( 'gd_city_full' )){$location_array['gd_city'] = get_query_var( 'gd_city_full' );}
4331
-    }
4332
-    $location_single = '';
4333
-    $gd_country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : '';
4334
-    $gd_region = (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') ? $wp->query_vars['gd_region'] : '';
4335
-    $gd_city = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : '';
4336
-
4337
-    $gd_country_actual = $gd_region_actual = $gd_city_actual = '';
4338
-
4339
-    if (function_exists('get_actual_location_name')) {
4340
-        $gd_country_actual = $gd_country != '' ? get_actual_location_name('country', $gd_country, true) : $gd_country;
4341
-        $gd_region_actual = $gd_region != '' ? get_actual_location_name('region', $gd_region) : $gd_region;
4342
-        $gd_city_actual = $gd_city != '' ? get_actual_location_name('city', $gd_city) : $gd_city;
4343
-    }
4344
-
4345
-    if ($gd_city != '') {
4346
-        if ($gd_city_actual != '') {
4347
-            $gd_city = $gd_city_actual;
4348
-        } else {
4349
-            $gd_city = preg_replace('/-(\d+)$/', '', $gd_city);
4350
-            $gd_city = preg_replace('/[_-]/', ' ', $gd_city);
4351
-            $gd_city = __(geodir_ucwords($gd_city), 'geodirectory');
4352
-        }
4353
-        $location_single = $gd_city;
4354
-
4355
-    } else if ($gd_region != '') {
4356
-        if ($gd_region_actual != '') {
4357
-            $gd_region = $gd_region_actual;
4358
-        } else {
4359
-            $gd_region = preg_replace('/-(\d+)$/', '', $gd_region);
4360
-            $gd_region = preg_replace('/[_-]/', ' ', $gd_region);
4361
-            $gd_region = __(geodir_ucwords($gd_region), 'geodirectory');
4362
-        }
4363
-
4364
-        $location_single = $gd_region;
4365
-    } else if ($gd_country != '') {
4366
-        if ($gd_country_actual != '') {
4367
-            $gd_country = $gd_country_actual;
4368
-        } else {
4369
-            $gd_country = preg_replace('/-(\d+)$/', '', $gd_country);
4370
-            $gd_country = preg_replace('/[_-]/', ' ', $gd_country);
4371
-            $gd_country = __(geodir_ucwords($gd_country), 'geodirectory');
4372
-        }
4373
-
4374
-        $location_single = $gd_country;
4375
-    }
4376
-
4377
-    if (!empty($location_array)) {
4378
-
4379
-        $actual_location_name = function_exists('get_actual_location_name') ? true : false;
4380
-        $location_array = array_reverse($location_array);
4381
-
4382
-        foreach ($location_array as $location_type => $location) {
4383
-            $gd_location_link_text = preg_replace('/-(\d+)$/', '', $location);
4384
-            $gd_location_link_text = preg_replace('/[_-]/', ' ', $gd_location_link_text);
4385
-
4386
-            $location_name = geodir_ucwords($gd_location_link_text);
4387
-            $location_name = __($location_name, 'geodirectory');
4388
-
4389
-            if ($actual_location_name) {
4390
-                $location_type = strpos($location_type, 'gd_') === 0 ? substr($location_type, 3) : $location_type;
4391
-                $location_name = get_actual_location_name($location_type, $location, true);
4392
-            }
4393
-
4394
-            $location_titles[] = $location_name;
4395
-        }
4396
-        if (!empty($location_titles)) {
4397
-            $location_titles = array_unique($location_titles);
4398
-        }
4399
-    }
4400
-
4401
-
4402
-    if(strpos($title,'%%location%%') !== false){
4403
-        $location = '';
4404
-        if($location_titles) {
4405
-            $location = implode(", ", $location_titles);
4406
-        }
4407
-        $title = str_replace("%%location%%",$location,$title);
4408
-    }
4409
-
4410
-    if(strpos($title,'%%in_location%%') !== false){
4411
-        $location = '';
4412
-        if($location_titles) {
4413
-            $location = __('in ', 'geodirectory') . implode(", ", $location_titles);
4414
-        }
4415
-        $title = str_replace("%%in_location%%",$location,$title);
4416
-    }
4417
-
4418
-    if(strpos($title,'%%in_location_single%%') !== false){
4419
-        if($location_single) {
4420
-            $location_single = __('in', 'geodirectory') . ' ' .$location_single;
4421
-        }
4422
-        $title = str_replace("%%in_location_single%%",$location_single,$title);
4423
-    }
4424
-
4425
-    if(strpos($title,'%%location_single%%') !== false){
4426
-        $title = str_replace("%%location_single%%",$location_single,$title);
4427
-    }
4428
-
4429
-
4430
-    if(strpos($title,'%%search_term%%') !== false){
4431
-        $search_term = '';
4432
-        if(isset($_REQUEST['s'])){
4433
-            $search_term = esc_attr($_REQUEST['s']);
4434
-        }
4435
-        $title = str_replace("%%search_term%%",$search_term,$title);
4436
-    }
4437
-
4438
-    if(strpos($title,'%%search_near%%') !== false){
4439
-        $search_term = '';
4440
-        if(isset($_REQUEST['snear'])){
4441
-            $search_term = esc_attr($_REQUEST['snear']);
4442
-        }
4443
-        $title = str_replace("%%search_near%%",$search_term,$title);
4444
-    }
4445
-
4446
-    if(strpos($title,'%%name%%') !== false){
4447
-        $author_name = get_the_author();
4448
-        if (!$author_name || $author_name === '') {
4449
-            $queried_object = get_queried_object();
4266
+		$title = str_replace("%%pt_plural%%", $plural_name, $title);
4267
+	}
4268
+
4269
+	if (strpos($title, '%%category%%') !== false) {
4270
+		$cat_name = '';
4271
+
4272
+		if ($gd_page=='detail') {
4273
+			if ($post->default_category) {
4274
+				$cat = get_term($post->default_category, $post->post_type . 'category');
4275
+				$cat_name = (isset($cat->name)) ? $cat->name : '';
4276
+			}
4277
+		} else if ($gd_page == 'listing') {
4278
+			$queried_object = get_queried_object();
4279
+			if (isset($queried_object->name)) {
4280
+				$cat_name = $queried_object->name;
4281
+			}
4282
+		}
4283
+		$title = str_replace("%%category%%", $cat_name, $title);
4284
+	}
4285
+
4286
+	if (strpos($title, '%%tag%%') !== false) {
4287
+		$cat_name = '';
4288
+
4289
+		if ($gd_page=='detail') {
4290
+			if ($post->default_category) {
4291
+				$cat = get_term($post->default_category, $post->post_type . 'category');
4292
+				$cat_name = (isset($cat->name)) ? $cat->name : '';
4293
+			}
4294
+		} else if($gd_page == 'listing') {
4295
+			$queried_object = get_queried_object();
4296
+			if (isset($queried_object->name)) {
4297
+				$cat_name = $queried_object->name;
4298
+			}
4299
+		}
4300
+		$title = str_replace("%%tag%%", $cat_name, $title);
4301
+	}
4302
+
4303
+	if (strpos($title, '%%id%%') !== false) {
4304
+		$ID = (isset($post->ID)) ? $post->ID : '';
4305
+		$title = str_replace("%%id%%", $ID, $title);
4306
+	}
4307
+
4308
+	if (strpos($title,'%%sep%%') !== false) {
4309
+		$title = str_replace("%%sep%%", $sep, $title);
4310
+	}
4311
+
4312
+	// location variables
4313
+	$gd_post_type = geodir_get_current_posttype();
4314
+	$location_array = geodir_get_current_location_terms('query_vars', $gd_post_type);
4315
+	/**
4316
+	 * Filter the title variables location variables array
4317
+	 *
4318
+	 * @since 1.5.5
4319
+	 * @package GeoDirectory
4320
+	 * @param array $location_array The array of location variables.
4321
+	 * @param string $title The title with variables..
4322
+	 * @param string $gd_page The page being filtered.
4323
+	 * @param string $sep The separator, default: `|`.
4324
+	 */
4325
+	$location_array = apply_filters('geodir_filter_title_variables_location_arr',$location_array,$title, $gd_page, $sep);
4326
+	$location_titles = array();
4327
+	if($gd_page=='location' && get_query_var( 'gd_country_full' )){
4328
+		if(get_query_var( 'gd_country_full' )){$location_array['gd_country'] = get_query_var( 'gd_country_full' );}
4329
+		if(get_query_var( 'gd_region_full' )){$location_array['gd_region'] = get_query_var( 'gd_region_full' );}
4330
+		if(get_query_var( 'gd_city_full' )){$location_array['gd_city'] = get_query_var( 'gd_city_full' );}
4331
+	}
4332
+	$location_single = '';
4333
+	$gd_country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : '';
4334
+	$gd_region = (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') ? $wp->query_vars['gd_region'] : '';
4335
+	$gd_city = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : '';
4336
+
4337
+	$gd_country_actual = $gd_region_actual = $gd_city_actual = '';
4338
+
4339
+	if (function_exists('get_actual_location_name')) {
4340
+		$gd_country_actual = $gd_country != '' ? get_actual_location_name('country', $gd_country, true) : $gd_country;
4341
+		$gd_region_actual = $gd_region != '' ? get_actual_location_name('region', $gd_region) : $gd_region;
4342
+		$gd_city_actual = $gd_city != '' ? get_actual_location_name('city', $gd_city) : $gd_city;
4343
+	}
4344
+
4345
+	if ($gd_city != '') {
4346
+		if ($gd_city_actual != '') {
4347
+			$gd_city = $gd_city_actual;
4348
+		} else {
4349
+			$gd_city = preg_replace('/-(\d+)$/', '', $gd_city);
4350
+			$gd_city = preg_replace('/[_-]/', ' ', $gd_city);
4351
+			$gd_city = __(geodir_ucwords($gd_city), 'geodirectory');
4352
+		}
4353
+		$location_single = $gd_city;
4354
+
4355
+	} else if ($gd_region != '') {
4356
+		if ($gd_region_actual != '') {
4357
+			$gd_region = $gd_region_actual;
4358
+		} else {
4359
+			$gd_region = preg_replace('/-(\d+)$/', '', $gd_region);
4360
+			$gd_region = preg_replace('/[_-]/', ' ', $gd_region);
4361
+			$gd_region = __(geodir_ucwords($gd_region), 'geodirectory');
4362
+		}
4363
+
4364
+		$location_single = $gd_region;
4365
+	} else if ($gd_country != '') {
4366
+		if ($gd_country_actual != '') {
4367
+			$gd_country = $gd_country_actual;
4368
+		} else {
4369
+			$gd_country = preg_replace('/-(\d+)$/', '', $gd_country);
4370
+			$gd_country = preg_replace('/[_-]/', ' ', $gd_country);
4371
+			$gd_country = __(geodir_ucwords($gd_country), 'geodirectory');
4372
+		}
4373
+
4374
+		$location_single = $gd_country;
4375
+	}
4376
+
4377
+	if (!empty($location_array)) {
4378
+
4379
+		$actual_location_name = function_exists('get_actual_location_name') ? true : false;
4380
+		$location_array = array_reverse($location_array);
4381
+
4382
+		foreach ($location_array as $location_type => $location) {
4383
+			$gd_location_link_text = preg_replace('/-(\d+)$/', '', $location);
4384
+			$gd_location_link_text = preg_replace('/[_-]/', ' ', $gd_location_link_text);
4385
+
4386
+			$location_name = geodir_ucwords($gd_location_link_text);
4387
+			$location_name = __($location_name, 'geodirectory');
4388
+
4389
+			if ($actual_location_name) {
4390
+				$location_type = strpos($location_type, 'gd_') === 0 ? substr($location_type, 3) : $location_type;
4391
+				$location_name = get_actual_location_name($location_type, $location, true);
4392
+			}
4393
+
4394
+			$location_titles[] = $location_name;
4395
+		}
4396
+		if (!empty($location_titles)) {
4397
+			$location_titles = array_unique($location_titles);
4398
+		}
4399
+	}
4400
+
4401
+
4402
+	if(strpos($title,'%%location%%') !== false){
4403
+		$location = '';
4404
+		if($location_titles) {
4405
+			$location = implode(", ", $location_titles);
4406
+		}
4407
+		$title = str_replace("%%location%%",$location,$title);
4408
+	}
4409
+
4410
+	if(strpos($title,'%%in_location%%') !== false){
4411
+		$location = '';
4412
+		if($location_titles) {
4413
+			$location = __('in ', 'geodirectory') . implode(", ", $location_titles);
4414
+		}
4415
+		$title = str_replace("%%in_location%%",$location,$title);
4416
+	}
4417
+
4418
+	if(strpos($title,'%%in_location_single%%') !== false){
4419
+		if($location_single) {
4420
+			$location_single = __('in', 'geodirectory') . ' ' .$location_single;
4421
+		}
4422
+		$title = str_replace("%%in_location_single%%",$location_single,$title);
4423
+	}
4424
+
4425
+	if(strpos($title,'%%location_single%%') !== false){
4426
+		$title = str_replace("%%location_single%%",$location_single,$title);
4427
+	}
4428
+
4429
+
4430
+	if(strpos($title,'%%search_term%%') !== false){
4431
+		$search_term = '';
4432
+		if(isset($_REQUEST['s'])){
4433
+			$search_term = esc_attr($_REQUEST['s']);
4434
+		}
4435
+		$title = str_replace("%%search_term%%",$search_term,$title);
4436
+	}
4437
+
4438
+	if(strpos($title,'%%search_near%%') !== false){
4439
+		$search_term = '';
4440
+		if(isset($_REQUEST['snear'])){
4441
+			$search_term = esc_attr($_REQUEST['snear']);
4442
+		}
4443
+		$title = str_replace("%%search_near%%",$search_term,$title);
4444
+	}
4445
+
4446
+	if(strpos($title,'%%name%%') !== false){
4447
+		$author_name = get_the_author();
4448
+		if (!$author_name || $author_name === '') {
4449
+			$queried_object = get_queried_object();
4450 4450
             
4451
-            if (isset($queried_object->data->user_nicename)) {
4452
-                $author_name = $queried_object->data->display_name;
4453
-            }
4454
-        }
4455
-        $title = str_replace("%%name%%", $author_name, $title);
4456
-    }
4451
+			if (isset($queried_object->data->user_nicename)) {
4452
+				$author_name = $queried_object->data->display_name;
4453
+			}
4454
+		}
4455
+		$title = str_replace("%%name%%", $author_name, $title);
4456
+	}
4457 4457
     
4458
-    if (strpos($title, '%%page%%') !== false) {
4459
-        $page = geodir_title_meta_page($sep);
4460
-        $title = str_replace("%%page%%", $page, $title);
4461
-    }
4462
-    if (strpos($title, '%%pagenumber%%') !== false) {
4463
-        $pagenumber = geodir_title_meta_pagenumber();
4464
-        $title = str_replace("%%pagenumber%%", $pagenumber, $title);
4465
-    }
4466
-    if (strpos($title, '%%pagetotal%%') !== false) {
4467
-        $pagetotal = geodir_title_meta_pagetotal();
4468
-        $title = str_replace("%%pagetotal%%", $pagetotal, $title);
4469
-    }
4470
-
4471
-    $title = wptexturize( $title );
4472
-    $title = convert_chars( $title );
4473
-    $title = esc_html( $title );
4474
-
4475
-    /**
4476
-     * Filter the title variables after standard ones have been filtered.
4477
-     *
4478
-     * @since 1.5.7
4479
-     * @package GeoDirectory
4480
-     * @param string $title The title with variables.
4481
-     * @param array $location_array The array of location variables.
4482
-     * @param string $gd_page The page being filtered.
4483
-     * @param string $sep The separator, default: `|`.
4484
-     */
4485
-
4486
-    return apply_filters('geodir_filter_title_variables_vars',$title,$location_array, $gd_page, $sep);
4458
+	if (strpos($title, '%%page%%') !== false) {
4459
+		$page = geodir_title_meta_page($sep);
4460
+		$title = str_replace("%%page%%", $page, $title);
4461
+	}
4462
+	if (strpos($title, '%%pagenumber%%') !== false) {
4463
+		$pagenumber = geodir_title_meta_pagenumber();
4464
+		$title = str_replace("%%pagenumber%%", $pagenumber, $title);
4465
+	}
4466
+	if (strpos($title, '%%pagetotal%%') !== false) {
4467
+		$pagetotal = geodir_title_meta_pagetotal();
4468
+		$title = str_replace("%%pagetotal%%", $pagetotal, $title);
4469
+	}
4470
+
4471
+	$title = wptexturize( $title );
4472
+	$title = convert_chars( $title );
4473
+	$title = esc_html( $title );
4474
+
4475
+	/**
4476
+	 * Filter the title variables after standard ones have been filtered.
4477
+	 *
4478
+	 * @since 1.5.7
4479
+	 * @package GeoDirectory
4480
+	 * @param string $title The title with variables.
4481
+	 * @param array $location_array The array of location variables.
4482
+	 * @param string $gd_page The page being filtered.
4483
+	 * @param string $sep The separator, default: `|`.
4484
+	 */
4485
+
4486
+	return apply_filters('geodir_filter_title_variables_vars',$title,$location_array, $gd_page, $sep);
4487 4487
 }
4488 4488
 
4489 4489
 /**
@@ -4496,65 +4496,65 @@  discard block
 block discarded – undo
4496 4496
  * @return array Translation texts.
4497 4497
  */
4498 4498
 function geodir_load_cpt_text_translation($translation_texts = array()) {
4499
-    $gd_post_types = geodir_get_posttypes('array');
4500
-
4501
-    if (!empty($gd_post_types)) {
4502
-        foreach ($gd_post_types as $post_type => $cpt_info) {
4503
-            $labels = isset($cpt_info['labels']) ? $cpt_info['labels'] : '';
4504
-            $description = isset($cpt_info['description']) ? $cpt_info['description'] : '';
4505
-            $seo = isset($cpt_info['seo']) ? $cpt_info['seo'] : '';
4506
-
4507
-            if (!empty($labels)) {
4508
-                if ($labels['name'] != '' && !in_array($labels['name'], $translation_texts))
4509
-                    $translation_texts[] = $labels['name'];
4510
-                if ($labels['singular_name'] != '' && !in_array($labels['singular_name'], $translation_texts))
4511
-                    $translation_texts[] = $labels['singular_name'];
4512
-                if ($labels['add_new'] != '' && !in_array($labels['add_new'], $translation_texts))
4513
-                    $translation_texts[] = $labels['add_new'];
4514
-                if ($labels['add_new_item'] != '' && !in_array($labels['add_new_item'], $translation_texts))
4515
-                    $translation_texts[] = $labels['add_new_item'];
4516
-                if ($labels['edit_item'] != '' && !in_array($labels['edit_item'], $translation_texts))
4517
-                    $translation_texts[] = $labels['edit_item'];
4518
-                if ($labels['new_item'] != '' && !in_array($labels['new_item'], $translation_texts))
4519
-                    $translation_texts[] = $labels['new_item'];
4520
-                if ($labels['view_item'] != '' && !in_array($labels['view_item'], $translation_texts))
4521
-                    $translation_texts[] = $labels['view_item'];
4522
-                if ($labels['search_items'] != '' && !in_array($labels['search_items'], $translation_texts))
4523
-                    $translation_texts[] = $labels['search_items'];
4524
-                if ($labels['not_found'] != '' && !in_array($labels['not_found'], $translation_texts))
4525
-                    $translation_texts[] = $labels['not_found'];
4526
-                if ($labels['not_found_in_trash'] != '' && !in_array($labels['not_found_in_trash'], $translation_texts))
4527
-                    $translation_texts[] = $labels['not_found_in_trash'];
4528
-                if (isset($labels['label_post_profile']) && $labels['label_post_profile'] != '' && !in_array($labels['label_post_profile'], $translation_texts))
4529
-                    $translation_texts[] = $labels['label_post_profile'];
4530
-                if (isset($labels['label_post_info']) && $labels['label_post_info'] != '' && !in_array($labels['label_post_info'], $translation_texts))
4531
-                    $translation_texts[] = $labels['label_post_info'];
4532
-                if (isset($labels['label_post_images']) && $labels['label_post_images'] != '' && !in_array($labels['label_post_images'], $translation_texts))
4533
-                    $translation_texts[] = $labels['label_post_images'];
4534
-                if (isset($labels['label_post_map']) && $labels['label_post_map'] != '' && !in_array($labels['label_post_map'], $translation_texts))
4535
-                    $translation_texts[] = $labels['label_post_map'];
4536
-                if (isset($labels['label_reviews']) && $labels['label_reviews'] != '' && !in_array($labels['label_reviews'], $translation_texts))
4537
-                    $translation_texts[] = $labels['label_reviews'];
4538
-                if (isset($labels['label_related_listing']) && $labels['label_related_listing'] != '' && !in_array($labels['label_related_listing'], $translation_texts))
4539
-                    $translation_texts[] = $labels['label_related_listing'];
4540
-            }
4541
-
4542
-            if ($description != '' && !in_array($description, $translation_texts)) {
4543
-                $translation_texts[] = normalize_whitespace($description);
4544
-            }
4545
-
4546
-            if (!empty($seo)) {
4547
-                if (isset($seo['meta_keyword']) && $seo['meta_keyword'] != '' && !in_array($seo['meta_keyword'], $translation_texts))
4548
-                    $translation_texts[] = normalize_whitespace($seo['meta_keyword']);
4549
-
4550
-                if (isset($seo['meta_description']) && $seo['meta_description'] != '' && !in_array($seo['meta_description'], $translation_texts))
4551
-                    $translation_texts[] = normalize_whitespace($seo['meta_description']);
4552
-            }
4553
-        }
4554
-    }
4555
-    $translation_texts = !empty($translation_texts) ? array_unique($translation_texts) : $translation_texts;
4556
-
4557
-    return $translation_texts;
4499
+	$gd_post_types = geodir_get_posttypes('array');
4500
+
4501
+	if (!empty($gd_post_types)) {
4502
+		foreach ($gd_post_types as $post_type => $cpt_info) {
4503
+			$labels = isset($cpt_info['labels']) ? $cpt_info['labels'] : '';
4504
+			$description = isset($cpt_info['description']) ? $cpt_info['description'] : '';
4505
+			$seo = isset($cpt_info['seo']) ? $cpt_info['seo'] : '';
4506
+
4507
+			if (!empty($labels)) {
4508
+				if ($labels['name'] != '' && !in_array($labels['name'], $translation_texts))
4509
+					$translation_texts[] = $labels['name'];
4510
+				if ($labels['singular_name'] != '' && !in_array($labels['singular_name'], $translation_texts))
4511
+					$translation_texts[] = $labels['singular_name'];
4512
+				if ($labels['add_new'] != '' && !in_array($labels['add_new'], $translation_texts))
4513
+					$translation_texts[] = $labels['add_new'];
4514
+				if ($labels['add_new_item'] != '' && !in_array($labels['add_new_item'], $translation_texts))
4515
+					$translation_texts[] = $labels['add_new_item'];
4516
+				if ($labels['edit_item'] != '' && !in_array($labels['edit_item'], $translation_texts))
4517
+					$translation_texts[] = $labels['edit_item'];
4518
+				if ($labels['new_item'] != '' && !in_array($labels['new_item'], $translation_texts))
4519
+					$translation_texts[] = $labels['new_item'];
4520
+				if ($labels['view_item'] != '' && !in_array($labels['view_item'], $translation_texts))
4521
+					$translation_texts[] = $labels['view_item'];
4522
+				if ($labels['search_items'] != '' && !in_array($labels['search_items'], $translation_texts))
4523
+					$translation_texts[] = $labels['search_items'];
4524
+				if ($labels['not_found'] != '' && !in_array($labels['not_found'], $translation_texts))
4525
+					$translation_texts[] = $labels['not_found'];
4526
+				if ($labels['not_found_in_trash'] != '' && !in_array($labels['not_found_in_trash'], $translation_texts))
4527
+					$translation_texts[] = $labels['not_found_in_trash'];
4528
+				if (isset($labels['label_post_profile']) && $labels['label_post_profile'] != '' && !in_array($labels['label_post_profile'], $translation_texts))
4529
+					$translation_texts[] = $labels['label_post_profile'];
4530
+				if (isset($labels['label_post_info']) && $labels['label_post_info'] != '' && !in_array($labels['label_post_info'], $translation_texts))
4531
+					$translation_texts[] = $labels['label_post_info'];
4532
+				if (isset($labels['label_post_images']) && $labels['label_post_images'] != '' && !in_array($labels['label_post_images'], $translation_texts))
4533
+					$translation_texts[] = $labels['label_post_images'];
4534
+				if (isset($labels['label_post_map']) && $labels['label_post_map'] != '' && !in_array($labels['label_post_map'], $translation_texts))
4535
+					$translation_texts[] = $labels['label_post_map'];
4536
+				if (isset($labels['label_reviews']) && $labels['label_reviews'] != '' && !in_array($labels['label_reviews'], $translation_texts))
4537
+					$translation_texts[] = $labels['label_reviews'];
4538
+				if (isset($labels['label_related_listing']) && $labels['label_related_listing'] != '' && !in_array($labels['label_related_listing'], $translation_texts))
4539
+					$translation_texts[] = $labels['label_related_listing'];
4540
+			}
4541
+
4542
+			if ($description != '' && !in_array($description, $translation_texts)) {
4543
+				$translation_texts[] = normalize_whitespace($description);
4544
+			}
4545
+
4546
+			if (!empty($seo)) {
4547
+				if (isset($seo['meta_keyword']) && $seo['meta_keyword'] != '' && !in_array($seo['meta_keyword'], $translation_texts))
4548
+					$translation_texts[] = normalize_whitespace($seo['meta_keyword']);
4549
+
4550
+				if (isset($seo['meta_description']) && $seo['meta_description'] != '' && !in_array($seo['meta_description'], $translation_texts))
4551
+					$translation_texts[] = normalize_whitespace($seo['meta_description']);
4552
+			}
4553
+		}
4554
+	}
4555
+	$translation_texts = !empty($translation_texts) ? array_unique($translation_texts) : $translation_texts;
4556
+
4557
+	return $translation_texts;
4558 4558
 }
4559 4559
 
4560 4560
 /**
@@ -4567,27 +4567,27 @@  discard block
 block discarded – undo
4567 4567
  * @return array Location terms.
4568 4568
  */
4569 4569
 function geodir_remove_location_terms($location_terms = array()) {
4570
-    $location_manager = defined('POST_LOCATION_TABLE') ? true : false;
4571
-
4572
-    if (!empty($location_terms) && $location_manager) {
4573
-        $hide_country_part = get_option('geodir_location_hide_country_part');
4574
-        $hide_region_part = get_option('geodir_location_hide_region_part');
4575
-
4576
-        if ($hide_region_part && $hide_country_part) {
4577
-            if (isset($location_terms['gd_country']))
4578
-                unset($location_terms['gd_country']);
4579
-            if (isset($location_terms['gd_region']))
4580
-                unset($location_terms['gd_region']);
4581
-        } else if ($hide_region_part && !$hide_country_part) {
4582
-            if (isset($location_terms['gd_region']))
4583
-                unset($location_terms['gd_region']);
4584
-        } else if (!$hide_region_part && $hide_country_part) {
4585
-            if (isset($location_terms['gd_country']))
4586
-                unset($location_terms['gd_country']);
4587
-        }
4588
-    }
4589
-
4590
-    return $location_terms;
4570
+	$location_manager = defined('POST_LOCATION_TABLE') ? true : false;
4571
+
4572
+	if (!empty($location_terms) && $location_manager) {
4573
+		$hide_country_part = get_option('geodir_location_hide_country_part');
4574
+		$hide_region_part = get_option('geodir_location_hide_region_part');
4575
+
4576
+		if ($hide_region_part && $hide_country_part) {
4577
+			if (isset($location_terms['gd_country']))
4578
+				unset($location_terms['gd_country']);
4579
+			if (isset($location_terms['gd_region']))
4580
+				unset($location_terms['gd_region']);
4581
+		} else if ($hide_region_part && !$hide_country_part) {
4582
+			if (isset($location_terms['gd_region']))
4583
+				unset($location_terms['gd_region']);
4584
+		} else if (!$hide_region_part && $hide_country_part) {
4585
+			if (isset($location_terms['gd_country']))
4586
+				unset($location_terms['gd_country']);
4587
+		}
4588
+	}
4589
+
4590
+	return $location_terms;
4591 4591
 }
4592 4592
 
4593 4593
 /**
@@ -4601,47 +4601,47 @@  discard block
 block discarded – undo
4601 4601
  * @param bool $update Whether this is an existing listing being updated or not.
4602 4602
  */
4603 4603
 function geodir_on_wp_insert_post($post_ID, $post, $update) {
4604
-    if (!$update) {
4605
-        return;
4606
-    }
4604
+	if (!$update) {
4605
+		return;
4606
+	}
4607 4607
     
4608
-    $action = isset($_REQUEST['action']) ? sanitize_text_field($_REQUEST['action']) : '';
4609
-    $is_admin = is_admin() && ( !defined('DOING_AJAX' ) || ( defined('DOING_AJAX') && !DOING_AJAX ) )  ? true : false;
4610
-    $inline_save = $action == 'inline-save' ? true : false;
4608
+	$action = isset($_REQUEST['action']) ? sanitize_text_field($_REQUEST['action']) : '';
4609
+	$is_admin = is_admin() && ( !defined('DOING_AJAX' ) || ( defined('DOING_AJAX') && !DOING_AJAX ) )  ? true : false;
4610
+	$inline_save = $action == 'inline-save' ? true : false;
4611 4611
 
4612
-    if (empty($post->post_type) || $is_admin || $inline_save || (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)) {
4613
-        return;
4614
-    }
4612
+	if (empty($post->post_type) || $is_admin || $inline_save || (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)) {
4613
+		return;
4614
+	}
4615 4615
     
4616
-    if ($action != '' && in_array($action, array('geodir_import_export'))) {
4617
-        return;
4618
-    }
4616
+	if ($action != '' && in_array($action, array('geodir_import_export'))) {
4617
+		return;
4618
+	}
4619 4619
 
4620
-    $user_id = (int)get_current_user_id();
4620
+	$user_id = (int)get_current_user_id();
4621 4621
         
4622
-    if ($user_id > 0 && get_option('geodir_notify_post_edited') && !wp_is_post_revision($post_ID) && in_array($post->post_type, geodir_get_posttypes())) {
4623
-        $author_id = !empty($post->post_author) ? $post->post_author : 0;
4622
+	if ($user_id > 0 && get_option('geodir_notify_post_edited') && !wp_is_post_revision($post_ID) && in_array($post->post_type, geodir_get_posttypes())) {
4623
+		$author_id = !empty($post->post_author) ? $post->post_author : 0;
4624 4624
         
4625
-        if ($user_id == $author_id && !is_super_admin()) {
4626
-            $from_email = get_option('site_email');
4627
-            $from_name = get_site_emailName();
4628
-            $to_email = get_option('admin_email');
4629
-            $to_name = get_option('name');
4630
-            $message_type = 'listing_edited';
4625
+		if ($user_id == $author_id && !is_super_admin()) {
4626
+			$from_email = get_option('site_email');
4627
+			$from_name = get_site_emailName();
4628
+			$to_email = get_option('admin_email');
4629
+			$to_name = get_option('name');
4630
+			$message_type = 'listing_edited';
4631 4631
             
4632
-            $notify_edited = true;
4633
-            /**
4634
-             * Send notification when listing edited by author?
4635
-             *
4636
-             * @since 1.6.0
4637
-             * @param bool $notify_edited Notify on listing edited by author?
4638
-             * @param object $post The current post object.
4639
-             */
4640
-            $notify_edited = apply_filters('geodir_notify_on_listing_edited', $notify_edited, $post);
4632
+			$notify_edited = true;
4633
+			/**
4634
+			 * Send notification when listing edited by author?
4635
+			 *
4636
+			 * @since 1.6.0
4637
+			 * @param bool $notify_edited Notify on listing edited by author?
4638
+			 * @param object $post The current post object.
4639
+			 */
4640
+			$notify_edited = apply_filters('geodir_notify_on_listing_edited', $notify_edited, $post);
4641 4641
             
4642
-            geodir_sendEmail($from_email, $from_name, $to_email, $to_name, '', '', '', $message_type, $post_ID);
4643
-        }
4644
-    }
4642
+			geodir_sendEmail($from_email, $from_name, $to_email, $to_name, '', '', '', $message_type, $post_ID);
4643
+		}
4644
+	}
4645 4645
 }
4646 4646
 
4647 4647
 /**
@@ -4655,16 +4655,16 @@  discard block
 block discarded – undo
4655 4655
  * @return string|null The current page start & end numbering.
4656 4656
  */
4657 4657
 function geodir_title_meta_page($sep) {
4658
-    $replacement = null;
4658
+	$replacement = null;
4659 4659
 
4660
-    $max = geodir_title_meta_pagenumbering('max');
4661
-    $nr  = geodir_title_meta_pagenumbering('nr');
4660
+	$max = geodir_title_meta_pagenumbering('max');
4661
+	$nr  = geodir_title_meta_pagenumbering('nr');
4662 4662
 
4663
-    if ($max > 1 && $nr > 1) {
4664
-        $replacement = sprintf($sep . ' ' . __('Page %1$d of %2$d', 'geodirectory'), $nr, $max);
4665
-    }
4663
+	if ($max > 1 && $nr > 1) {
4664
+		$replacement = sprintf($sep . ' ' . __('Page %1$d of %2$d', 'geodirectory'), $nr, $max);
4665
+	}
4666 4666
 
4667
-    return $replacement;
4667
+	return $replacement;
4668 4668
 }
4669 4669
 
4670 4670
 /**
@@ -4676,14 +4676,14 @@  discard block
 block discarded – undo
4676 4676
  * @return string|null The current page number.
4677 4677
  */
4678 4678
 function geodir_title_meta_pagenumber() {
4679
-    $replacement = null;
4679
+	$replacement = null;
4680 4680
 
4681
-    $nr = geodir_title_meta_pagenumbering('nr');
4682
-    if (isset($nr) && $nr > 0) {
4683
-        $replacement = (string)$nr;
4684
-    }
4681
+	$nr = geodir_title_meta_pagenumbering('nr');
4682
+	if (isset($nr) && $nr > 0) {
4683
+		$replacement = (string)$nr;
4684
+	}
4685 4685
 
4686
-    return $replacement;
4686
+	return $replacement;
4687 4687
 }
4688 4688
 
4689 4689
 /**
@@ -4695,14 +4695,14 @@  discard block
 block discarded – undo
4695 4695
  * @return string|null The current page total.
4696 4696
  */
4697 4697
 function geodir_title_meta_pagetotal() {
4698
-    $replacement = null;
4698
+	$replacement = null;
4699 4699
 
4700
-    $max = geodir_title_meta_pagenumbering('max');
4701
-    if (isset($max) && $max > 0) {
4702
-        $replacement = (string)$max;
4703
-    }
4700
+	$max = geodir_title_meta_pagenumbering('max');
4701
+	if (isset($max) && $max > 0) {
4702
+		$replacement = (string)$max;
4703
+	}
4704 4704
 
4705
-    return $replacement;
4705
+	return $replacement;
4706 4706
 }
4707 4707
 
4708 4708
 /**
@@ -4719,44 +4719,44 @@  discard block
 block discarded – undo
4719 4719
  * @return int|null The current page numbering.
4720 4720
  */
4721 4721
 function geodir_title_meta_pagenumbering($request = 'nr') {
4722
-    global $wp_query, $post;
4723
-    $max_num_pages = null;
4724
-    $page_number   = null;
4725
-
4726
-    $max_num_pages = 1;
4727
-
4728
-    if (!is_singular()) {
4729
-        $page_number = get_query_var('paged');
4730
-        if ($page_number === 0 || $page_number === '') {
4731
-            $page_number = 1;
4732
-        }
4733
-
4734
-        if (isset($wp_query->max_num_pages) && ($wp_query->max_num_pages != '' && $wp_query->max_num_pages != 0)) {
4735
-            $max_num_pages = $wp_query->max_num_pages;
4736
-        }
4737
-    } else {
4738
-        $page_number = get_query_var('page');
4739
-        if ($page_number === 0 || $page_number === '') {
4740
-            $page_number = 1;
4741
-        }
4742
-
4743
-        if (isset($post->post_content)) {
4744
-            $max_num_pages = (substr_count($post->post_content, '<!--nextpage-->' ) + 1);
4745
-        }
4746
-    }
4747
-
4748
-    $return = null;
4749
-
4750
-    switch ($request) {
4751
-        case 'nr':
4752
-            $return = $page_number;
4753
-            break;
4754
-        case 'max':
4755
-            $return = $max_num_pages;
4756
-            break;
4757
-    }
4758
-
4759
-    return $return;
4722
+	global $wp_query, $post;
4723
+	$max_num_pages = null;
4724
+	$page_number   = null;
4725
+
4726
+	$max_num_pages = 1;
4727
+
4728
+	if (!is_singular()) {
4729
+		$page_number = get_query_var('paged');
4730
+		if ($page_number === 0 || $page_number === '') {
4731
+			$page_number = 1;
4732
+		}
4733
+
4734
+		if (isset($wp_query->max_num_pages) && ($wp_query->max_num_pages != '' && $wp_query->max_num_pages != 0)) {
4735
+			$max_num_pages = $wp_query->max_num_pages;
4736
+		}
4737
+	} else {
4738
+		$page_number = get_query_var('page');
4739
+		if ($page_number === 0 || $page_number === '') {
4740
+			$page_number = 1;
4741
+		}
4742
+
4743
+		if (isset($post->post_content)) {
4744
+			$max_num_pages = (substr_count($post->post_content, '<!--nextpage-->' ) + 1);
4745
+		}
4746
+	}
4747
+
4748
+	$return = null;
4749
+
4750
+	switch ($request) {
4751
+		case 'nr':
4752
+			$return = $page_number;
4753
+			break;
4754
+		case 'max':
4755
+			$return = $max_num_pages;
4756
+			break;
4757
+	}
4758
+
4759
+	return $return;
4760 4760
 }
4761 4761
 
4762 4762
 /**
@@ -4768,17 +4768,17 @@  discard block
 block discarded – undo
4768 4768
  * @return array Terms.
4769 4769
  */
4770 4770
 function geodir_filter_empty_terms($terms) {
4771
-    if (empty($terms)) {
4772
-        return $terms;
4773
-    }
4774
-
4775
-    $return = array();
4776
-    foreach ($terms as $term) {
4777
-        if (isset($term->count) && $term->count > 0) {
4778
-            $return[] = $term;
4779
-        }
4780
-    }
4781
-    return $return;
4771
+	if (empty($terms)) {
4772
+		return $terms;
4773
+	}
4774
+
4775
+	$return = array();
4776
+	foreach ($terms as $term) {
4777
+		if (isset($term->count) && $term->count > 0) {
4778
+			$return[] = $term;
4779
+		}
4780
+	}
4781
+	return $return;
4782 4782
 }
4783 4783
 
4784 4784
 
@@ -4791,9 +4791,9 @@  discard block
 block discarded – undo
4791 4791
  * @return array
4792 4792
  */
4793 4793
 function geodir_remove_hentry( $class ) {
4794
-    if(geodir_is_page('detail')){
4795
-        $class = array_diff( $class, array( 'hentry' ) );
4796
-    }
4797
-    return $class;
4794
+	if(geodir_is_page('detail')){
4795
+		$class = array_diff( $class, array( 'hentry' ) );
4796
+	}
4797
+	return $class;
4798 4798
 }
4799 4799
 add_filter( 'post_class', 'geodir_remove_hentry' );
4800 4800
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +356 added lines, -356 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 /**
11 11
  * Get All Plugin functions from WordPress
12 12
  */
13
-include_once(ABSPATH . 'wp-admin/includes/plugin.php');
13
+include_once(ABSPATH.'wp-admin/includes/plugin.php');
14 14
 
15 15
 /*-----------------------------------------------------------------------------------*/
16 16
 /* Helper functions */
@@ -29,9 +29,9 @@  discard block
 block discarded – undo
29 29
 {
30 30
 
31 31
     if (is_ssl()) :
32
-        return str_replace('http://', 'https://', WP_PLUGIN_URL) . "/" . plugin_basename(dirname(dirname(__FILE__)));
32
+        return str_replace('http://', 'https://', WP_PLUGIN_URL)."/".plugin_basename(dirname(dirname(__FILE__)));
33 33
     else :
34
-        return WP_PLUGIN_URL . "/" . plugin_basename(dirname(dirname(__FILE__)));
34
+        return WP_PLUGIN_URL."/".plugin_basename(dirname(dirname(__FILE__)));
35 35
     endif;
36 36
 }
37 37
 
@@ -47,10 +47,10 @@  discard block
 block discarded – undo
47 47
  */
48 48
 function geodir_plugin_path()
49 49
 {
50
-    if ( defined( 'GD_TESTING_MODE' ) && GD_TESTING_MODE ) {
50
+    if (defined('GD_TESTING_MODE') && GD_TESTING_MODE) {
51 51
         return dirname(dirname(__FILE__));
52 52
     } else {
53
-        return WP_PLUGIN_DIR . "/" . plugin_basename(dirname(dirname(__FILE__)));
53
+        return WP_PLUGIN_DIR."/".plugin_basename(dirname(dirname(__FILE__)));
54 54
     }
55 55
 }
56 56
 
@@ -129,10 +129,10 @@  discard block
 block discarded – undo
129 129
     foreach ($params as $key => $value) {
130 130
         if (gettype($value) == 'array') { //Handle array data properly
131 131
             foreach ($value as $val) {
132
-                $params_arr[] = $key . '[]=' . urlencode($val);
132
+                $params_arr[] = $key.'[]='.urlencode($val);
133 133
             }
134 134
         } else {
135
-            $params_arr[] = $key . '=' . urlencode($value);
135
+            $params_arr[] = $key.'='.urlencode($value);
136 136
         }
137 137
     }
138 138
     $link .= implode('&', $params_arr);
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 
161 161
         $add_listing_link = get_page_link(geodir_add_listing_page_id());
162 162
 
163
-        return esc_url( add_query_arg(array('listing_type' => $post_type), $add_listing_link) );
163
+        return esc_url(add_query_arg(array('listing_type' => $post_type), $add_listing_link));
164 164
     } else
165 165
         return get_bloginfo('url');
166 166
 }
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
         $pageURL .= "s";
181 181
     }
182 182
     $pageURL .= "://";
183
-    $pageURL .= $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"];
183
+    $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
184 184
     /**
185 185
      * Filter the current page URL returned by function geodir_curPageURL().
186 186
      *
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
 function geodir_is_page($gdpage = '')
253 253
 {
254 254
 
255
-    global $wp_query, $post,$wp;
255
+    global $wp_query, $post, $wp;
256 256
     //if(!is_admin()):
257 257
 
258 258
     switch ($gdpage):
@@ -277,14 +277,14 @@  discard block
 block discarded – undo
277 277
             break;
278 278
         case 'detail':
279 279
             $post_type = get_query_var('post_type');
280
-            if(is_array($post_type)){$post_type = reset($post_type);}
280
+            if (is_array($post_type)) {$post_type = reset($post_type); }
281 281
             if (is_single() && in_array($post_type, geodir_get_posttypes()))
282 282
                 return true;
283 283
             break;
284 284
         case 'pt':
285 285
             $post_type = get_query_var('post_type');
286
-            if(is_array($post_type)){$post_type = reset($post_type);}
287
-            if (is_post_type_archive() && in_array($post_type , geodir_get_posttypes()) && !is_tax())
286
+            if (is_array($post_type)) {$post_type = reset($post_type); }
287
+            if (is_post_type_archive() && in_array($post_type, geodir_get_posttypes()) && !is_tax())
288 288
                 return true;
289 289
 
290 290
             break;
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
                 return true;
296 296
             }
297 297
             $post_type = get_query_var('post_type');
298
-            if(is_array($post_type)){$post_type = reset($post_type);}
298
+            if (is_array($post_type)) {$post_type = reset($post_type); }
299 299
             if (is_post_type_archive() && in_array($post_type, geodir_get_posttypes()))
300 300
                 return true;
301 301
 
@@ -314,8 +314,8 @@  discard block
 block discarded – undo
314 314
             if (is_author() && isset($_REQUEST['geodir_dashbord']))
315 315
                 return true;
316 316
 			
317
-			if (function_exists('bp_loggedin_user_id') && function_exists('bp_displayed_user_id') && $my_id = (int)bp_loggedin_user_id()) {
318
-				if (((bool)bp_is_current_component('listings') || (bool)bp_is_current_component('favorites')) && $my_id > 0 && $my_id == (int)bp_displayed_user_id()) {
317
+			if (function_exists('bp_loggedin_user_id') && function_exists('bp_displayed_user_id') && $my_id = (int) bp_loggedin_user_id()) {
318
+				if (((bool) bp_is_current_component('listings') || (bool) bp_is_current_component('favorites')) && $my_id > 0 && $my_id == (int) bp_displayed_user_id()) {
319 319
 					return true;
320 320
 				}
321 321
 			}
@@ -368,7 +368,7 @@  discard block
 block discarded – undo
368 368
         if (empty($wp->query_vars) || !array_diff(array_keys($wp->query_vars), array('preview', 'page', 'paged', 'cpage'))) {
369 369
             if (get_option('geodir_set_as_home'))
370 370
                 $wp->query_vars['gd_is_geodir_page'] = true;
371
-            if(geodir_is_page('home')){
371
+            if (geodir_is_page('home')) {
372 372
                 $wp->query_vars['gd_is_geodir_page'] = true;
373 373
             }
374 374
 
@@ -420,7 +420,7 @@  discard block
 block discarded – undo
420 420
 
421 421
         if (!isset($wp->query_vars['gd_is_geodir_page'])) {
422 422
             $geodir_taxonomis = geodir_get_taxonomies('', true);
423
-            if(!empty($geodir_taxonomis)){
423
+            if (!empty($geodir_taxonomis)) {
424 424
                 foreach ($geodir_taxonomis as $taxonomy) {
425 425
                     if (array_key_exists($taxonomy, $wp->query_vars)) {
426 426
                         $wp->query_vars['gd_is_geodir_page'] = true;
@@ -440,10 +440,10 @@  discard block
 block discarded – undo
440 440
 
441 441
 
442 442
 //check if homepage
443
-        if(!isset($wp->query_vars['gd_is_geodir_page'])
443
+        if (!isset($wp->query_vars['gd_is_geodir_page'])
444 444
             && !isset($wp->query_vars['page_id'])
445 445
             && !isset($wp->query_vars['pagename'])
446
-            && is_page_geodir_home()){
446
+            && is_page_geodir_home()) {
447 447
             $wp->query_vars['gd_is_geodir_page'] = true;
448 448
         }
449 449
         //echo $wp->query_vars['gd_is_geodir_page'] ;
@@ -505,7 +505,7 @@  discard block
 block discarded – undo
505 505
              * @since 1.0.0
506 506
              * @param array $imagesizes[$size] Image size array of the passed key.
507 507
              */
508
-            return apply_filters('geodir_get_imagesize_' . $size, $imagesizes[$size]);
508
+            return apply_filters('geodir_get_imagesize_'.$size, $imagesizes[$size]);
509 509
 
510 510
         } elseif (!empty($size)) {
511 511
 
@@ -544,13 +544,13 @@  discard block
 block discarded – undo
544 544
     function createRandomString()
545 545
     {
546 546
         $chars = "abcdefghijkmlnopqrstuvwxyz1023456789";
547
-        srand((double)microtime() * 1000000);
547
+        srand((double) microtime() * 1000000);
548 548
         $i = 0;
549 549
         $rstring = '';
550 550
         while ($i <= 25) {
551 551
             $num = rand() % 33;
552 552
             $tmp = substr($chars, $num, 1);
553
-            $rstring = $rstring . $tmp;
553
+            $rstring = $rstring.$tmp;
554 554
             $i++;
555 555
         }
556 556
         return $rstring;
@@ -681,11 +681,11 @@  discard block
 block discarded – undo
681 681
         }
682 682
 		
683 683
 		if (!empty($subject)) {
684
-			$subject = __(stripslashes_deep($subject),'geodirectory');
684
+			$subject = __(stripslashes_deep($subject), 'geodirectory');
685 685
 		}
686 686
 		
687 687
 		if (!empty($message)) {
688
-			$message = __(stripslashes_deep($message),'geodirectory');
688
+			$message = __(stripslashes_deep($message), 'geodirectory');
689 689
 		}
690 690
 
691 691
         $to_message = nl2br($to_message);
@@ -705,12 +705,12 @@  discard block
 block discarded – undo
705 705
 
706 706
         if ($post_info) {
707 707
             $posted_date = $post_info->post_date;
708
-            $listingLink = '<a href="' . $productlink . '"><b>' . $post_info->post_title . '</b></a>';
708
+            $listingLink = '<a href="'.$productlink.'"><b>'.$post_info->post_title.'</b></a>';
709 709
         }
710 710
         $siteurl = home_url();
711
-        $siteurl_link = '<a href="' . $siteurl . '">' . $siteurl . '</a>';
711
+        $siteurl_link = '<a href="'.$siteurl.'">'.$siteurl.'</a>';
712 712
         $loginurl = geodir_login_url();
713
-        $loginurl_link = '<a href="' . $loginurl . '">login</a>';
713
+        $loginurl_link = '<a href="'.$loginurl.'">login</a>';
714 714
         
715 715
         $post_author_id = !empty($post_info) ? $post_info->post_author : 0;
716 716
         $post_author_name = geodir_get_client_name($post_author_id);
@@ -724,18 +724,18 @@  discard block
 block discarded – undo
724 724
             $fromEmailName = get_option('site_email_name');
725 725
         }
726 726
 
727
-        $search_array = array('[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#to_name#]', '[#from_name#]', '[#subject#]', '[#comments#]', '[#login_url#]', '[#login_details#]', '[#client_name#]', '[#posted_date#]','[#from_email#]','[#user_login#]','[#username#]','[#post_author_id#]','[#post_author_name#]','[#current_date#]');
728
-        $replace_array = array($listingLink, $siteurl_link, $post_id, $sitefromEmailName, $toEmailName, $fromEmailName, $to_subject, $to_message, $loginurl_link, $login_details, $toEmailName, $posted_date,$fromEmail, $user_login, $user_login, $post_author_id, $post_author_name, $current_date);
727
+        $search_array = array('[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#to_name#]', '[#from_name#]', '[#subject#]', '[#comments#]', '[#login_url#]', '[#login_details#]', '[#client_name#]', '[#posted_date#]', '[#from_email#]', '[#user_login#]', '[#username#]', '[#post_author_id#]', '[#post_author_name#]', '[#current_date#]');
728
+        $replace_array = array($listingLink, $siteurl_link, $post_id, $sitefromEmailName, $toEmailName, $fromEmailName, $to_subject, $to_message, $loginurl_link, $login_details, $toEmailName, $posted_date, $fromEmail, $user_login, $user_login, $post_author_id, $post_author_name, $current_date);
729 729
         $message = str_replace($search_array, $replace_array, $message);
730 730
 
731
-        $search_array = array('[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#to_name#]', '[#from_name#]', '[#subject#]', '[#client_name#]', '[#posted_date#]','[#from_email#]','[#user_login#]','[#username#]','[#post_author_id#]','[#post_author_name#]','[#current_date#]');
732
-        $replace_array = array($listingLink, $siteurl_link, $post_id, $sitefromEmailName, $toEmailName, $fromEmailName, $to_subject, $toEmailName, $posted_date,$fromEmail, $user_login, $user_login, $post_author_id, $post_author_name, $current_date);
731
+        $search_array = array('[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#to_name#]', '[#from_name#]', '[#subject#]', '[#client_name#]', '[#posted_date#]', '[#from_email#]', '[#user_login#]', '[#username#]', '[#post_author_id#]', '[#post_author_name#]', '[#current_date#]');
732
+        $replace_array = array($listingLink, $siteurl_link, $post_id, $sitefromEmailName, $toEmailName, $fromEmailName, $to_subject, $toEmailName, $posted_date, $fromEmail, $user_login, $user_login, $post_author_id, $post_author_name, $current_date);
733 733
         $subject = str_replace($search_array, $replace_array, $subject);
734 734
 
735
-        $headers = 'MIME-Version: 1.0' . "\r\n";
736
-        $headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n";
737
-        $headers .= "Reply-To: " . $fromEmail . "\r\n";
738
-        $headers .= 'From: ' . $sitefromEmailName . ' <' . $sitefromEmail . '>' . "\r\n";
735
+        $headers = 'MIME-Version: 1.0'."\r\n";
736
+        $headers .= 'Content-type: text/html; charset=UTF-8'."\r\n";
737
+        $headers .= "Reply-To: ".$fromEmail."\r\n";
738
+        $headers .= 'From: '.$sitefromEmailName.' <'.$sitefromEmail.'>'."\r\n";
739 739
 
740 740
         $to = $toEmail;
741 741
 
@@ -756,7 +756,7 @@  discard block
 block discarded – undo
756 756
          * @param string $post_id The post ID.
757 757
          * @param string $user_id The user ID.
758 758
          */
759
-        $to = apply_filters('geodir_sendEmail_to',$to,$fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id );
759
+        $to = apply_filters('geodir_sendEmail_to', $to, $fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id);
760 760
         /**
761 761
          * Filter the client email subject.
762 762
          *
@@ -774,7 +774,7 @@  discard block
 block discarded – undo
774 774
          * @param string $post_id The post ID.
775 775
          * @param string $user_id The user ID.
776 776
          */
777
-        $subject = apply_filters('geodir_sendEmail_subject',$subject,$fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id );
777
+        $subject = apply_filters('geodir_sendEmail_subject', $subject, $fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id);
778 778
         /**
779 779
          * Filter the client email message.
780 780
          *
@@ -792,7 +792,7 @@  discard block
 block discarded – undo
792 792
          * @param string $post_id The post ID.
793 793
          * @param string $user_id The user ID.
794 794
          */
795
-        $message = apply_filters('geodir_sendEmail_message',$message,$fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id );
795
+        $message = apply_filters('geodir_sendEmail_message', $message, $fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id);
796 796
         /**
797 797
          * Filter the client email headers.
798 798
          *
@@ -810,22 +810,22 @@  discard block
 block discarded – undo
810 810
          * @param string $post_id The post ID.
811 811
          * @param string $user_id The user ID.
812 812
          */
813
-        $headers = apply_filters('geodir_sendEmail_headers',$headers,$fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id );
813
+        $headers = apply_filters('geodir_sendEmail_headers', $headers, $fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id);
814 814
 
815 815
         $sent = wp_mail($to, $subject, $message, $headers);
816 816
 
817
-        if( ! $sent ) {
818
-            if ( is_array( $to ) ) {
819
-                $to = implode( ',', $to );
817
+        if (!$sent) {
818
+            if (is_array($to)) {
819
+                $to = implode(',', $to);
820 820
             }
821 821
             $log_message = sprintf(
822
-                __( "Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory' ),
822
+                __("Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory'),
823 823
                 $message_type,
824
-                date_i18n( 'F j Y H:i:s', current_time( 'timestamp' ) ),
824
+                date_i18n('F j Y H:i:s', current_time('timestamp')),
825 825
                 $to,
826 826
                 $subject
827 827
             );
828
-            geodir_error_log( $log_message );
828
+            geodir_error_log($log_message);
829 829
         }
830 830
 
831 831
         ///////// ADMIN BCC EMIALS
@@ -837,11 +837,11 @@  discard block
 block discarded – undo
837 837
             $subject = __(stripslashes_deep(get_option('geodir_post_submited_success_email_subject_admin')), 'geodirectory');
838 838
             $message = __(stripslashes_deep(get_option('geodir_post_submited_success_email_content_admin')), 'geodirectory');
839 839
 
840
-            $search_array = array('[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#to_name#]', '[#from_name#]', '[#subject#]', '[#comments#]', '[#login_url#]', '[#login_details#]', '[#client_name#]', '[#posted_date#]','[#user_login#]','[#username#]');
840
+            $search_array = array('[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#to_name#]', '[#from_name#]', '[#subject#]', '[#comments#]', '[#login_url#]', '[#login_details#]', '[#client_name#]', '[#posted_date#]', '[#user_login#]', '[#username#]');
841 841
             $replace_array = array($listingLink, $siteurl_link, $post_id, $sitefromEmailName, $toEmailName, $fromEmailName, $to_subject, $to_message, $loginurl_link, $login_details, $toEmailName, $posted_date, $user_login, $user_login);
842 842
             $message = str_replace($search_array, $replace_array, $message);
843 843
 
844
-            $search_array = array('[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#to_name#]', '[#from_name#]', '[#subject#]', '[#client_name#]', '[#posted_date#]','[#user_login#]','[#username#]');
844
+            $search_array = array('[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#to_name#]', '[#from_name#]', '[#subject#]', '[#client_name#]', '[#posted_date#]', '[#user_login#]', '[#username#]');
845 845
             $replace_array = array($listingLink, $siteurl_link, $post_id, $sitefromEmailName, $toEmailName, $fromEmailName, $to_subject, $toEmailName, $posted_date, $user_login, $user_login);
846 846
             $subject = str_replace($search_array, $replace_array, $subject);
847 847
 
@@ -866,21 +866,21 @@  discard block
 block discarded – undo
866 866
             $admin_bcc = true;
867 867
         }
868 868
 
869
-        if($admin_bcc===true){
869
+        if ($admin_bcc === true) {
870 870
             $sent = wp_mail($to, $subject, $message, $headers);
871 871
 
872
-            if( ! $sent ) {
873
-                if ( is_array( $to ) ) {
874
-                    $to = implode( ',', $to );
872
+            if (!$sent) {
873
+                if (is_array($to)) {
874
+                    $to = implode(',', $to);
875 875
                 }
876 876
                 $log_message = sprintf(
877
-                    __( "Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory' ),
877
+                    __("Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory'),
878 878
                     $message_type,
879
-                    date_i18n( 'F j Y H:i:s', current_time( 'timestamp' ) ),
879
+                    date_i18n('F j Y H:i:s', current_time('timestamp')),
880 880
                     $to,
881 881
                     $subject
882 882
                 );
883
-                geodir_error_log( $log_message );
883
+                geodir_error_log($log_message);
884 884
             }
885 885
         }
886 886
 
@@ -912,12 +912,12 @@  discard block
 block discarded – undo
912 912
         foreach ($parents as $parent):
913 913
             $item = get_term_by('id', $parent, get_query_var('taxonomy'));
914 914
             $url = get_term_link($item, get_query_var('taxonomy'));
915
-            echo '<li> > <a href="' . $url . '">' . $item->name . '</a></li>';
915
+            echo '<li> > <a href="'.$url.'">'.$item->name.'</a></li>';
916 916
         endforeach;
917 917
 
918 918
     endif;
919 919
 
920
-    echo '<li> > ' . $term->name . '</li>';
920
+    echo '<li> > '.$term->name.'</li>';
921 921
 }
922 922
 
923 923
 
@@ -951,7 +951,7 @@  discard block
 block discarded – undo
951 951
          *
952 952
          * @since 1.0.0
953 953
          */
954
-        $breadcrumb .= '<li>' . apply_filters('geodir_breadcrumb_first_link', '<a href="' . home_url() . '">' . __('Home', 'geodirectory') . '</a>') . '</li>';
954
+        $breadcrumb .= '<li>'.apply_filters('geodir_breadcrumb_first_link', '<a href="'.home_url().'">'.__('Home', 'geodirectory').'</a>').'</li>';
955 955
 
956 956
         $gd_post_type = geodir_get_current_posttype();
957 957
         $post_type_info = get_post_type_object($gd_post_type);
@@ -975,7 +975,7 @@  discard block
 block discarded – undo
975 975
             $location_manager = defined('POST_LOCATION_TABLE') ? true : false;
976 976
 			$neighbourhood_active = $location_manager && get_option('location_neighbourhoods') ? true : false;
977 977
 				
978
-			if(geodir_is_page('detail') && isset($post->country_slug)){
978
+			if (geodir_is_page('detail') && isset($post->country_slug)) {
979 979
                 $location_terms = array(
980 980
                     'gd_country' => $post->country_slug,
981 981
                     'gd_region' => $post->region_slug,
@@ -1030,12 +1030,12 @@  discard block
 block discarded – undo
1030 1030
             $is_location_last = '';
1031 1031
             $is_taxonomy_last = '';
1032 1032
             $breadcrumb .= '<li>';
1033
-            if (get_query_var($gd_post_type . 'category'))
1034
-                $gd_taxonomy = $gd_post_type . 'category';
1035
-            elseif (get_query_var($gd_post_type . '_tags'))
1036
-                $gd_taxonomy = $gd_post_type . '_tags';
1033
+            if (get_query_var($gd_post_type.'category'))
1034
+                $gd_taxonomy = $gd_post_type.'category';
1035
+            elseif (get_query_var($gd_post_type.'_tags'))
1036
+                $gd_taxonomy = $gd_post_type.'_tags';
1037 1037
 
1038
-            $breadcrumb .= $separator . '<a href="' . $listing_link . '">' . __(ucfirst($post_type_info->label), 'geodirectory') . '</a>';
1038
+            $breadcrumb .= $separator.'<a href="'.$listing_link.'">'.__(ucfirst($post_type_info->label), 'geodirectory').'</a>';
1039 1039
             if (!empty($gd_taxonomy) || geodir_is_page('detail'))
1040 1040
                 $is_location_last = false;
1041 1041
             else
@@ -1085,18 +1085,18 @@  discard block
 block discarded – undo
1085 1085
                         }
1086 1086
 
1087 1087
                         if ($is_location_last && $key == 'gd_country' && !(isset($location_terms['gd_region']) && $location_terms['gd_region'] != '') && !(isset($location_terms['gd_city']) && $location_terms['gd_city'] != '')) {
1088
-                            $breadcrumb .= $location_term_actual_country != '' ? $separator . $location_term_actual_country : $separator . $gd_location_link_text;
1088
+                            $breadcrumb .= $location_term_actual_country != '' ? $separator.$location_term_actual_country : $separator.$gd_location_link_text;
1089 1089
                         } else if ($is_location_last && $key == 'gd_region' && !(isset($location_terms['gd_city']) && $location_terms['gd_city'] != '')) {
1090
-                            $breadcrumb .= $location_term_actual_region != '' ? $separator . $location_term_actual_region : $separator . $gd_location_link_text;
1090
+                            $breadcrumb .= $location_term_actual_region != '' ? $separator.$location_term_actual_region : $separator.$gd_location_link_text;
1091 1091
                         } else if ($is_location_last && $key == 'gd_city' && empty($location_terms['gd_neighbourhood'])) {
1092
-                            $breadcrumb .= $location_term_actual_city != '' ? $separator . $location_term_actual_city : $separator . $gd_location_link_text;
1092
+                            $breadcrumb .= $location_term_actual_city != '' ? $separator.$location_term_actual_city : $separator.$gd_location_link_text;
1093 1093
                         } else if ($is_location_last && $key == 'gd_neighbourhood') {
1094
-                            $breadcrumb .= $separator . $gd_location_link_text;
1094
+                            $breadcrumb .= $separator.$gd_location_link_text;
1095 1095
                         } else {
1096 1096
                             if (get_option('permalink_structure') != '') {
1097
-                                $location_link .= $location_term . '/';
1097
+                                $location_link .= $location_term.'/';
1098 1098
                             } else {
1099
-                                $location_link .= "&$key=" . $location_term;
1099
+                                $location_link .= "&$key=".$location_term;
1100 1100
                             }
1101 1101
 
1102 1102
                             if ($key == 'gd_country' && $location_term_actual_country != '') {
@@ -1113,7 +1113,7 @@  discard block
 block discarded – undo
1113 1113
                             }
1114 1114
                             */
1115 1115
 
1116
-                            $breadcrumb .= $separator . '<a href="' . $location_link . '">' . $gd_location_link_text . '</a>';
1116
+                            $breadcrumb .= $separator.'<a href="'.$location_link.'">'.$gd_location_link_text.'</a>';
1117 1117
                         }
1118 1118
                     }
1119 1119
                 }
@@ -1124,8 +1124,8 @@  discard block
 block discarded – undo
1124 1124
 
1125 1125
                 //if(get_option('geodir_add_categories_url'))
1126 1126
                 {
1127
-                    if (get_query_var($gd_post_type . '_tags')) {
1128
-                        $cat_link = $listing_link . 'tags/';
1127
+                    if (get_query_var($gd_post_type.'_tags')) {
1128
+                        $cat_link = $listing_link.'tags/';
1129 1129
                     } else
1130 1130
                         $cat_link = $listing_link;
1131 1131
 
@@ -1136,7 +1136,7 @@  discard block
 block discarded – undo
1136 1136
 
1137 1137
                         if ($location_term != '') {
1138 1138
                             if (get_option('permalink_structure') != '') {
1139
-                                $cat_link .= $location_term . '/';
1139
+                                $cat_link .= $location_term.'/';
1140 1140
                             }
1141 1141
                         }
1142 1142
                     }
@@ -1155,10 +1155,10 @@  discard block
 block discarded – undo
1155 1155
                         }
1156 1156
 
1157 1157
                         if ($term_index == count($term_array) && $is_taxonomy_last)
1158
-                            $breadcrumb .= $separator . $term_link_text;
1158
+                            $breadcrumb .= $separator.$term_link_text;
1159 1159
                         else {
1160
-                            $cat_link .= $term . '/';
1161
-                            $breadcrumb .= $separator . '<a href="' . $cat_link . '">' . $term_link_text . '</a>';
1160
+                            $cat_link .= $term.'/';
1161
+                            $breadcrumb .= $separator.'<a href="'.$cat_link.'">'.$term_link_text.'</a>';
1162 1162
                         }
1163 1163
                         $term_index++;
1164 1164
                     }
@@ -1168,7 +1168,7 @@  discard block
 block discarded – undo
1168 1168
             }
1169 1169
 
1170 1170
             if (geodir_is_page('detail'))
1171
-                $breadcrumb .= $separator . get_the_title();
1171
+                $breadcrumb .= $separator.get_the_title();
1172 1172
 
1173 1173
             $breadcrumb .= '</li>';
1174 1174
 
@@ -1188,7 +1188,7 @@  discard block
 block discarded – undo
1188 1188
             $default_author_link = apply_filters('geodir_dashboard_author_link', $default_author_link, $user_id);
1189 1189
 
1190 1190
             $breadcrumb .= '<li>';
1191
-            $breadcrumb .= $separator . '<a href="' . $default_author_link . '">' . __('My Dashboard', 'geodirectory') . '</a>';
1191
+            $breadcrumb .= $separator.'<a href="'.$default_author_link.'">'.__('My Dashboard', 'geodirectory').'</a>';
1192 1192
 
1193 1193
             if (isset($_REQUEST['list'])) {
1194 1194
                 $author_link = geodir_getlink($author_link, array('geodir_dashbord' => 'true', 'stype' => $_REQUEST['stype']), false);
@@ -1203,20 +1203,20 @@  discard block
 block discarded – undo
1203 1203
                  */
1204 1204
                 $author_link = apply_filters('geodir_dashboard_author_link', $author_link, $user_id, $_REQUEST['stype']);
1205 1205
 
1206
-                $breadcrumb .= $separator . '<a href="' . $author_link . '">' . __(ucfirst($post_type_info->label), 'geodirectory') . '</a>';
1207
-                $breadcrumb .= $separator . ucfirst(__('My', 'geodirectory') . ' ' . $_REQUEST['list']);
1206
+                $breadcrumb .= $separator.'<a href="'.$author_link.'">'.__(ucfirst($post_type_info->label), 'geodirectory').'</a>';
1207
+                $breadcrumb .= $separator.ucfirst(__('My', 'geodirectory').' '.$_REQUEST['list']);
1208 1208
             } else
1209
-                $breadcrumb .= $separator . __(ucfirst($post_type_info->label), 'geodirectory');
1209
+                $breadcrumb .= $separator.__(ucfirst($post_type_info->label), 'geodirectory');
1210 1210
 
1211 1211
             $breadcrumb .= '</li>';
1212 1212
         } elseif (is_category() || is_single()) {
1213 1213
             $category = get_the_category();
1214 1214
             if (is_category()) {
1215
-                $breadcrumb .= '<li>' . $separator . $category[0]->cat_name . '</li>';
1215
+                $breadcrumb .= '<li>'.$separator.$category[0]->cat_name.'</li>';
1216 1216
             }
1217 1217
             if (is_single()) {
1218
-                $breadcrumb .= '<li>' . $separator . '<a href="' . get_category_link($category[0]->term_id) . '">' . $category[0]->cat_name . '</a></li>';
1219
-                $breadcrumb .= '<li>' . $separator . get_the_title() . '</li>';
1218
+                $breadcrumb .= '<li>'.$separator.'<a href="'.get_category_link($category[0]->term_id).'">'.$category[0]->cat_name.'</a></li>';
1219
+                $breadcrumb .= '<li>'.$separator.get_the_title().'</li>';
1220 1220
             }
1221 1221
             /* End of my version ##################################################### */
1222 1222
         } else if (is_page()) {
@@ -1224,37 +1224,37 @@  discard block
 block discarded – undo
1224 1224
 
1225 1225
             if (geodir_is_page('location')) {
1226 1226
                 $location_page_id = geodir_location_page_id();
1227
-                $loc_post = get_post( $location_page_id );
1227
+                $loc_post = get_post($location_page_id);
1228 1228
                 $post_name = $loc_post->post_name;
1229
-                $slug= ucwords(str_replace('-',' ',$post_name));
1230
-                $page_title = !empty($slug )? $slug : __('Location', 'geodirectory');
1229
+                $slug = ucwords(str_replace('-', ' ', $post_name));
1230
+                $page_title = !empty($slug) ? $slug : __('Location', 'geodirectory');
1231 1231
             }
1232 1232
 
1233
-            $breadcrumb .= '<li>' . $separator;
1233
+            $breadcrumb .= '<li>'.$separator;
1234 1234
             $breadcrumb .= stripslashes_deep($page_title);
1235 1235
             $breadcrumb .= '</li>';
1236 1236
         } else if (is_tag()) {
1237
-            $breadcrumb .=  "<li> " . $separator . single_tag_title('',false) . '</li>';
1237
+            $breadcrumb .= "<li> ".$separator.single_tag_title('', false).'</li>';
1238 1238
         } else if (is_day()) {
1239
-            $breadcrumb .= "<li> " . $separator . __(" Archive for", 'geodirectory') . " ";
1239
+            $breadcrumb .= "<li> ".$separator.__(" Archive for", 'geodirectory')." ";
1240 1240
             the_time('F jS, Y');
1241 1241
             $breadcrumb .= '</li>';
1242 1242
         } else if (is_month()) {
1243
-            $breadcrumb .= "<li> " . $separator . __(" Archive for", 'geodirectory') . " ";
1243
+            $breadcrumb .= "<li> ".$separator.__(" Archive for", 'geodirectory')." ";
1244 1244
             the_time('F, Y');
1245 1245
             $breadcrumb .= '</li>';
1246 1246
         } else if (is_year()) {
1247
-            $breadcrumb .= "<li> " . $separator . __(" Archive for", 'geodirectory') . " ";
1247
+            $breadcrumb .= "<li> ".$separator.__(" Archive for", 'geodirectory')." ";
1248 1248
             the_time('Y');
1249 1249
             $breadcrumb .= '</li>';
1250 1250
         } else if (is_author()) {
1251
-            $breadcrumb .= "<li> " . $separator . __(" Author Archive", 'geodirectory');
1251
+            $breadcrumb .= "<li> ".$separator.__(" Author Archive", 'geodirectory');
1252 1252
             $breadcrumb .= '</li>';
1253 1253
         } else if (isset($_GET['paged']) && !empty($_GET['paged'])) {
1254
-            $breadcrumb .= "<li>" . $separator . __("Blog Archives", 'geodirectory');
1254
+            $breadcrumb .= "<li>".$separator.__("Blog Archives", 'geodirectory');
1255 1255
             $breadcrumb .= '</li>';
1256 1256
         } else if (is_search()) {
1257
-            $breadcrumb .= "<li> " . $separator . __(" Search Results", 'geodirectory');
1257
+            $breadcrumb .= "<li> ".$separator.__(" Search Results", 'geodirectory');
1258 1258
             $breadcrumb .= '</li>';
1259 1259
         }
1260 1260
         $breadcrumb .= '</ul></div>';
@@ -1310,7 +1310,7 @@  discard block
 block discarded – undo
1310 1310
 function fetch_remote_file($url)
1311 1311
 {
1312 1312
     // extract the file name and extension from the url
1313
-    require_once(ABSPATH . 'wp-includes/pluggable.php');
1313
+    require_once(ABSPATH.'wp-includes/pluggable.php');
1314 1314
     $file_name = basename($url);
1315 1315
     if (strpos($file_name, '?') !== false) {
1316 1316
         list($file_name) = explode('?', $file_name);
@@ -1342,15 +1342,15 @@  discard block
 block discarded – undo
1342 1342
         return new WP_Error('upload_dir_error', $upload['error']);
1343 1343
 
1344 1344
 
1345
-    sleep(0.3);// if multiple remote file this can cause the remote server to timeout so we add a slight delay
1345
+    sleep(0.3); // if multiple remote file this can cause the remote server to timeout so we add a slight delay
1346 1346
 
1347 1347
     // fetch the remote url and write it to the placeholder file
1348
-    $headers = wp_remote_get($url, array('stream' => true,'filename' => $upload['file']));
1348
+    $headers = wp_remote_get($url, array('stream' => true, 'filename' => $upload['file']));
1349 1349
 
1350 1350
     $log_message = '';
1351
-    if( is_wp_error( $headers  ) ) {
1351
+    if (is_wp_error($headers)) {
1352 1352
         echo 'file: '.$url;
1353
-        return new WP_Error('import_file_error',$headers->get_error_message());
1353
+        return new WP_Error('import_file_error', $headers->get_error_message());
1354 1354
     }
1355 1355
 
1356 1356
     $filesize = filesize($upload['file']);
@@ -1363,21 +1363,21 @@  discard block
 block discarded – undo
1363 1363
         $log_message = sprintf(__('Remote server returned error response %1$d %2$s', 'geodirectory'), esc_html($headers['response']), get_status_header_desc($headers['response']));
1364 1364
     }
1365 1365
     elseif (isset($headers['headers']['content-length']) && $filesize != $headers['headers']['content-length']) {
1366
-        $log_message =  __('Remote file is incorrect size', 'geodirectory');
1366
+        $log_message = __('Remote file is incorrect size', 'geodirectory');
1367 1367
     }
1368 1368
     elseif (0 == $filesize) {
1369 1369
         $log_message = __('Zero size file downloaded', 'geodirectory');
1370 1370
     }
1371 1371
 
1372
-    if($log_message){
1372
+    if ($log_message) {
1373 1373
         $del = unlink($upload['file']);
1374
-        if(!$del){geodir_error_log(__('GeoDirectory: fetch_remote_file() failed to delete temp file.', 'geodirectory'));}
1375
-        return new WP_Error('import_file_error',$log_message );
1374
+        if (!$del) {geodir_error_log(__('GeoDirectory: fetch_remote_file() failed to delete temp file.', 'geodirectory')); }
1375
+        return new WP_Error('import_file_error', $log_message);
1376 1376
     }
1377 1377
 
1378 1378
     if ($dummy && $add_to_cache && is_array($upload)) {
1379 1379
         $images = get_transient('cached_dummy_images');
1380
-        if(is_array($images))
1380
+        if (is_array($images))
1381 1381
             $images[$key] = $upload;
1382 1382
         else
1383 1383
             $images = array($key => $upload);
@@ -1398,12 +1398,12 @@  discard block
 block discarded – undo
1398 1398
  */
1399 1399
 function geodir_max_upload_size()
1400 1400
 {
1401
-    $max_filesize = (float)get_option('geodir_upload_max_filesize', 2);
1401
+    $max_filesize = (float) get_option('geodir_upload_max_filesize', 2);
1402 1402
 
1403 1403
     if ($max_filesize > 0 && $max_filesize < 1) {
1404
-        $max_filesize = (int)($max_filesize * 1024) . 'kb';
1404
+        $max_filesize = (int) ($max_filesize * 1024).'kb';
1405 1405
     } else {
1406
-        $max_filesize = $max_filesize > 0 ? $max_filesize . 'mb' : '2mb';
1406
+        $max_filesize = $max_filesize > 0 ? $max_filesize.'mb' : '2mb';
1407 1407
     }
1408 1408
 
1409 1409
     /**
@@ -1426,7 +1426,7 @@  discard block
 block discarded – undo
1426 1426
  */
1427 1427
 function geodir_dummy_folder_exists()
1428 1428
 {
1429
-    $path = geodir_plugin_path() . '/geodirectory-admin/dummy/';
1429
+    $path = geodir_plugin_path().'/geodirectory-admin/dummy/';
1430 1430
     if (!is_dir($path))
1431 1431
         return false;
1432 1432
     else
@@ -1470,35 +1470,35 @@  discard block
 block discarded – undo
1470 1470
     {
1471 1471
         global $wpdb;
1472 1472
         if ($message_type == 'expiration') {
1473
-            $subject = stripslashes(__(get_option('renew_email_subject'),'geodirectory'));
1474
-            $client_message = stripslashes(__(get_option('renew_email_content'),'geodirectory'));
1473
+            $subject = stripslashes(__(get_option('renew_email_subject'), 'geodirectory'));
1474
+            $client_message = stripslashes(__(get_option('renew_email_content'), 'geodirectory'));
1475 1475
         } elseif ($message_type == 'post_submited') {
1476
-            $subject = __(get_option('post_submited_success_email_subject_admin'),'geodirectory');
1477
-            $client_message = __(get_option('post_submited_success_email_content_admin'),'geodirectory');
1476
+            $subject = __(get_option('post_submited_success_email_subject_admin'), 'geodirectory');
1477
+            $client_message = __(get_option('post_submited_success_email_content_admin'), 'geodirectory');
1478 1478
         } elseif ($message_type == 'renew') {
1479
-            $subject = __(get_option('post_renew_success_email_subject_admin'),'geodirectory');
1480
-            $client_message = __(get_option('post_renew_success_email_content_admin'),'geodirectory');
1479
+            $subject = __(get_option('post_renew_success_email_subject_admin'), 'geodirectory');
1480
+            $client_message = __(get_option('post_renew_success_email_content_admin'), 'geodirectory');
1481 1481
         } elseif ($message_type == 'upgrade') {
1482
-            $subject = __(get_option('post_upgrade_success_email_subject_admin'),'geodirectory');
1483
-            $client_message = __(get_option('post_upgrade_success_email_content_admin'),'geodirectory');
1482
+            $subject = __(get_option('post_upgrade_success_email_subject_admin'), 'geodirectory');
1483
+            $client_message = __(get_option('post_upgrade_success_email_content_admin'), 'geodirectory');
1484 1484
         } elseif ($message_type == 'claim_approved') {
1485
-            $subject = __(get_option('claim_approved_email_subject'),'geodirectory');
1486
-            $client_message = __(get_option('claim_approved_email_content'),'geodirectory');
1485
+            $subject = __(get_option('claim_approved_email_subject'), 'geodirectory');
1486
+            $client_message = __(get_option('claim_approved_email_content'), 'geodirectory');
1487 1487
         } elseif ($message_type == 'claim_rejected') {
1488
-            $subject = __(get_option('claim_rejected_email_subject'),'geodirectory');
1489
-            $client_message = __(get_option('claim_rejected_email_content'),'geodirectory');
1488
+            $subject = __(get_option('claim_rejected_email_subject'), 'geodirectory');
1489
+            $client_message = __(get_option('claim_rejected_email_content'), 'geodirectory');
1490 1490
         } elseif ($message_type == 'claim_requested') {
1491
-            $subject = __(get_option('claim_email_subject_admin'),'geodirectory');
1492
-            $client_message = __(get_option('claim_email_content_admin'),'geodirectory');
1491
+            $subject = __(get_option('claim_email_subject_admin'), 'geodirectory');
1492
+            $client_message = __(get_option('claim_email_content_admin'), 'geodirectory');
1493 1493
         } elseif ($message_type == 'auto_claim') {
1494
-            $subject = __(get_option('auto_claim_email_subject'),'geodirectory');
1495
-            $client_message = __(get_option('auto_claim_email_content'),'geodirectory');
1494
+            $subject = __(get_option('auto_claim_email_subject'), 'geodirectory');
1495
+            $client_message = __(get_option('auto_claim_email_content'), 'geodirectory');
1496 1496
         } elseif ($message_type == 'payment_success') {
1497
-            $subject = __(get_option('post_payment_success_admin_email_subject'),'geodirectory');
1498
-            $client_message = __(get_option('post_payment_success_admin_email_content'),'geodirectory');
1497
+            $subject = __(get_option('post_payment_success_admin_email_subject'), 'geodirectory');
1498
+            $client_message = __(get_option('post_payment_success_admin_email_content'), 'geodirectory');
1499 1499
         } elseif ($message_type == 'payment_fail') {
1500
-            $subject = __(get_option('post_payment_fail_admin_email_subject'),'geodirectory');
1501
-            $client_message = __(get_option('post_payment_fail_admin_email_content'),'geodirectory');
1500
+            $subject = __(get_option('post_payment_fail_admin_email_subject'), 'geodirectory');
1501
+            $client_message = __(get_option('post_payment_fail_admin_email_content'), 'geodirectory');
1502 1502
         }
1503 1503
         $transaction_details = $custom_1;
1504 1504
         $fromEmail = get_option('site_email');
@@ -1509,11 +1509,11 @@  discard block
 block discarded – undo
1509 1509
         $productlink = get_permalink($page_id);
1510 1510
         $post_info = get_post($page_id);
1511 1511
         $post_date = date('dS F,Y', strtotime($post_info->post_date));
1512
-        $listingLink = '<a href="' . $productlink . '"><b>' . $post_info->post_title . '</b></a>';
1512
+        $listingLink = '<a href="'.$productlink.'"><b>'.$post_info->post_title.'</b></a>';
1513 1513
         $loginurl = geodir_login_url();
1514
-        $loginurl_link = '<a href="' . $loginurl . '">login</a>';
1514
+        $loginurl_link = '<a href="'.$loginurl.'">login</a>';
1515 1515
         $siteurl = home_url();
1516
-        $siteurl_link = '<a href="' . $siteurl . '">' . $fromEmailName . '</a>';
1516
+        $siteurl_link = '<a href="'.$siteurl.'">'.$fromEmailName.'</a>';
1517 1517
         $user_info = get_userdata($user_id);
1518 1518
         $user_email = $user_info->user_email;
1519 1519
         $display_name = geodir_get_client_name($user_id);
@@ -1527,14 +1527,14 @@  discard block
 block discarded – undo
1527 1527
         } else {
1528 1528
             $post_type = 'listing';
1529 1529
         }
1530
-        $renew_link = '<a href="' . $siteurl . '?ptype=post_' . $post_type . '&renew=1&pid=' . $page_id . '">' . RENEW_LINK . '</a>';
1530
+        $renew_link = '<a href="'.$siteurl.'?ptype=post_'.$post_type.'&renew=1&pid='.$page_id.'">'.RENEW_LINK.'</a>';
1531 1531
         $search_array = array('[#client_name#]', '[#listing_link#]', '[#posted_date#]', '[#number_of_days#]', '[#number_of_grace_days#]', '[#login_url#]', '[#username#]', '[#user_email#]', '[#site_name_url#]', '[#renew_link#]', '[#post_id#]', '[#site_name#]', '[#transaction_details#]');
1532 1532
         $replace_array = array($display_name, $listingLink, $post_date, $alivedays, $number_of_grace_days, $loginurl_link, $user_login, $user_email, $siteurl_link, $renew_link, $page_id, $fromEmailName, $transaction_details);
1533 1533
         $client_message = str_replace($search_array, $replace_array, $client_message);
1534 1534
         $subject = str_replace($search_array, $replace_array, $subject);
1535
-        $headers = 'MIME-Version: 1.0' . "\r\n";
1536
-        $headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n";
1537
-        $headers .= 'From: ' . $fromEmailName . ' <' . $fromEmail . '>' . "\r\n";
1535
+        $headers = 'MIME-Version: 1.0'."\r\n";
1536
+        $headers .= 'Content-type: text/html; charset=UTF-8'."\r\n";
1537
+        $headers .= 'From: '.$fromEmailName.' <'.$fromEmail.'>'."\r\n";
1538 1538
 
1539 1539
         $to = $fromEmail;
1540 1540
         $message = $client_message;
@@ -1551,7 +1551,7 @@  discard block
 block discarded – undo
1551 1551
          * @param string $message_type Can be 'expiration','post_submited','renew','upgrade','claim_approved','claim_rejected','claim_requested','auto_claim','payment_success','payment_fail'.
1552 1552
          * @param string $custom_1 Custom data to be sent.
1553 1553
          */
1554
-        $to = apply_filters('geodir_adminEmail_to',$to,$page_id, $user_id, $message_type, $custom_1 );
1554
+        $to = apply_filters('geodir_adminEmail_to', $to, $page_id, $user_id, $message_type, $custom_1);
1555 1555
         /**
1556 1556
          * Filter the admin email subject.
1557 1557
          *
@@ -1563,7 +1563,7 @@  discard block
 block discarded – undo
1563 1563
          * @param string $message_type Can be 'expiration','post_submited','renew','upgrade','claim_approved','claim_rejected','claim_requested','auto_claim','payment_success','payment_fail'.
1564 1564
          * @param string $custom_1 Custom data to be sent.
1565 1565
          */
1566
-        $subject = apply_filters('geodir_adminEmail_subject',$subject,$page_id, $user_id, $message_type, $custom_1);
1566
+        $subject = apply_filters('geodir_adminEmail_subject', $subject, $page_id, $user_id, $message_type, $custom_1);
1567 1567
         /**
1568 1568
          * Filter the admin email message.
1569 1569
          *
@@ -1575,7 +1575,7 @@  discard block
 block discarded – undo
1575 1575
          * @param string $message_type Can be 'expiration','post_submited','renew','upgrade','claim_approved','claim_rejected','claim_requested','auto_claim','payment_success','payment_fail'.
1576 1576
          * @param string $custom_1 Custom data to be sent.
1577 1577
          */
1578
-        $message = apply_filters('geodir_adminEmail_message',$message,$page_id, $user_id, $message_type, $custom_1);
1578
+        $message = apply_filters('geodir_adminEmail_message', $message, $page_id, $user_id, $message_type, $custom_1);
1579 1579
         /**
1580 1580
          * Filter the admin email headers.
1581 1581
          *
@@ -1587,23 +1587,23 @@  discard block
 block discarded – undo
1587 1587
          * @param string $message_type Can be 'expiration','post_submited','renew','upgrade','claim_approved','claim_rejected','claim_requested','auto_claim','payment_success','payment_fail'.
1588 1588
          * @param string $custom_1 Custom data to be sent.
1589 1589
          */
1590
-        $headers = apply_filters('geodir_adminEmail_headers',$headers,$page_id, $user_id, $message_type, $custom_1);
1590
+        $headers = apply_filters('geodir_adminEmail_headers', $headers, $page_id, $user_id, $message_type, $custom_1);
1591 1591
 
1592 1592
 
1593 1593
 
1594 1594
         $sent = wp_mail($to, $subject, $message, $headers);
1595
-        if( ! $sent ) {
1596
-            if ( is_array( $to ) ) {
1597
-                $to = implode( ',', $to );
1595
+        if (!$sent) {
1596
+            if (is_array($to)) {
1597
+                $to = implode(',', $to);
1598 1598
             }
1599 1599
             $log_message = sprintf(
1600
-                __( "Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory' ),
1600
+                __("Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory'),
1601 1601
                 $message_type,
1602
-                date_i18n( 'F j Y H:i:s', current_time( 'timestamp' ) ),
1602
+                date_i18n('F j Y H:i:s', current_time('timestamp')),
1603 1603
                 $to,
1604 1604
                 $subject
1605 1605
             );
1606
-            geodir_error_log( $log_message );
1606
+            geodir_error_log($log_message);
1607 1607
         }
1608 1608
     }
1609 1609
 }
@@ -1629,18 +1629,18 @@  discard block
 block discarded – undo
1629 1629
     {
1630 1630
         $login_details = '';
1631 1631
         if ($message_type == 'send_friend') {
1632
-            $subject = stripslashes(__(get_option('email_friend_subject'),'geodirectory'));
1633
-            $message = stripslashes(__(get_option('email_friend_content'),'geodirectory'));
1632
+            $subject = stripslashes(__(get_option('email_friend_subject'), 'geodirectory'));
1633
+            $message = stripslashes(__(get_option('email_friend_content'), 'geodirectory'));
1634 1634
         } elseif ($message_type == 'send_enquiry') {
1635
-            $subject = __(get_option('email_enquiry_subject'),'geodirectory');
1636
-            $message = __(get_option('email_enquiry_content'),'geodirectory');
1635
+            $subject = __(get_option('email_enquiry_subject'), 'geodirectory');
1636
+            $message = __(get_option('email_enquiry_content'), 'geodirectory');
1637 1637
         } elseif ($message_type == 'forgot_password') {
1638
-            $subject = __(get_option('forgot_password_subject'),'geodirectory');
1639
-            $message = __(get_option('forgot_password_content'),'geodirectory');
1638
+            $subject = __(get_option('forgot_password_subject'), 'geodirectory');
1639
+            $message = __(get_option('forgot_password_content'), 'geodirectory');
1640 1640
             $login_details = $to_message;
1641 1641
         } elseif ($message_type == 'registration') {
1642
-            $subject = __(get_option('registration_success_email_subject'),'geodirectory');
1643
-            $message = __(get_option('registration_success_email_content'),'geodirectory');
1642
+            $subject = __(get_option('registration_success_email_subject'), 'geodirectory');
1643
+            $message = __(get_option('registration_success_email_content'), 'geodirectory');
1644 1644
             $login_details = $to_message;
1645 1645
         }
1646 1646
         $to_message = nl2br($to_message);
@@ -1648,11 +1648,11 @@  discard block
 block discarded – undo
1648 1648
         $sitefromEmailName = get_site_emailName();
1649 1649
         $productlink = get_permalink($post_id);
1650 1650
         $post_info = get_post($post_id);
1651
-        $listingLink = '<a href="' . $productlink . '"><b>' . $post_info->post_title . '</b></a>';
1651
+        $listingLink = '<a href="'.$productlink.'"><b>'.$post_info->post_title.'</b></a>';
1652 1652
         $siteurl = home_url();
1653
-        $siteurl_link = '<a href="' . $siteurl . '">' . $siteurl . '</a>';
1653
+        $siteurl_link = '<a href="'.$siteurl.'">'.$siteurl.'</a>';
1654 1654
         $loginurl = geodir_login_url();
1655
-        $loginurl_link = '<a href="' . $loginurl . '">login</a>';
1655
+        $loginurl_link = '<a href="'.$loginurl.'">login</a>';
1656 1656
         if ($fromEmail == '') {
1657 1657
             $fromEmail = get_option('site_email');
1658 1658
         }
@@ -1666,26 +1666,26 @@  discard block
 block discarded – undo
1666 1666
         $search_array = array('[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#to_name#]', '[#from_name#]', '[#subject#]', '[#client_name#]');
1667 1667
         $replace_array = array($listingLink, $siteurl_link, $post_id, $sitefromEmailName, $toEmailName, $fromEmailName, $to_subject, $toEmailName);
1668 1668
         $subject = str_replace($search_array, $replace_array, $subject);
1669
-        $headers = 'MIME-Version: 1.0' . "\r\n";
1670
-        $headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n";
1671
-        $headers .= "Reply-To: " . $fromEmail . "\r\n";
1672
-        $headers .= 'From: ' . $sitefromEmailName . ' <' . $sitefromEmail . '>' . "\r\n";
1669
+        $headers = 'MIME-Version: 1.0'."\r\n";
1670
+        $headers .= 'Content-type: text/html; charset=UTF-8'."\r\n";
1671
+        $headers .= "Reply-To: ".$fromEmail."\r\n";
1672
+        $headers .= 'From: '.$sitefromEmailName.' <'.$sitefromEmail.'>'."\r\n";
1673 1673
 
1674 1674
         $to = $toEmail;
1675 1675
 
1676 1676
         $sent = wp_mail($to, $subject, $message, $headers);
1677
-        if( ! $sent ) {
1678
-            if ( is_array( $to ) ) {
1679
-                $to = implode( ',', $to );
1677
+        if (!$sent) {
1678
+            if (is_array($to)) {
1679
+                $to = implode(',', $to);
1680 1680
             }
1681 1681
             $log_message = sprintf(
1682
-                __( "Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory' ),
1682
+                __("Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory'),
1683 1683
                 $message_type,
1684
-                date_i18n( 'F j Y H:i:s', current_time( 'timestamp' ) ),
1684
+                date_i18n('F j Y H:i:s', current_time('timestamp')),
1685 1685
                 $to,
1686 1686
                 $subject
1687 1687
             );
1688
-            geodir_error_log( $log_message );
1688
+            geodir_error_log($log_message);
1689 1689
         }
1690 1690
 
1691 1691
         ///////// ADMIN BCC EMIALS
@@ -1693,7 +1693,7 @@  discard block
 block discarded – undo
1693 1693
         if ($message_type == 'registration') {
1694 1694
             $message_raw = explode(__("Password:", 'geodirectory'), $message);
1695 1695
             $message_raw2 = explode("</p>", $message_raw[1], 2);
1696
-            $message = $message_raw[0] . __('Password:', 'geodirectory') . ' **********</p>' . $message_raw2[1];
1696
+            $message = $message_raw[0].__('Password:', 'geodirectory').' **********</p>'.$message_raw2[1];
1697 1697
         }
1698 1698
         $adminEmail = get_bloginfo('admin_email');
1699 1699
         $to = $adminEmail;
@@ -1711,20 +1711,20 @@  discard block
 block discarded – undo
1711 1711
             $admin_bcc = true;
1712 1712
         }
1713 1713
 
1714
-        if($admin_bcc === true){
1714
+        if ($admin_bcc === true) {
1715 1715
             $sent = wp_mail($to, $subject, $message, $headers);
1716
-            if( ! $sent ) {
1717
-                if ( is_array( $to ) ) {
1718
-                    $to = implode( ',', $to );
1716
+            if (!$sent) {
1717
+                if (is_array($to)) {
1718
+                    $to = implode(',', $to);
1719 1719
                 }
1720 1720
                 $log_message = sprintf(
1721
-                    __( "Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory' ),
1721
+                    __("Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory'),
1722 1722
                     $message_type,
1723
-                    date_i18n( 'F j Y H:i:s', current_time( 'timestamp' ) ),
1723
+                    date_i18n('F j Y H:i:s', current_time('timestamp')),
1724 1724
                     $to,
1725 1725
                     $subject
1726 1726
                 );
1727
-                geodir_error_log( $log_message );
1727
+                geodir_error_log($log_message);
1728 1728
             }
1729 1729
         }
1730 1730
 
@@ -1772,7 +1772,7 @@  discard block
 block discarded – undo
1772 1772
 function geodir_custom_posts_body_class($classes) {
1773 1773
     global $wpdb, $wp;
1774 1774
     $post_types = geodir_get_posttypes('object');
1775
-    if (!empty($post_types) && count((array)$post_types) > 1) {
1775
+    if (!empty($post_types) && count((array) $post_types) > 1) {
1776 1776
         $classes[] = 'geodir_custom_posts';
1777 1777
     }
1778 1778
 
@@ -1832,7 +1832,7 @@  discard block
 block discarded – undo
1832 1832
     $geodir_option = get_option($geodir_option_name);
1833 1833
 
1834 1834
     if (!empty($geodir_option)) {
1835
-        add_option($geodir_option_name . '_' . $version_date, $geodir_option);
1835
+        add_option($geodir_option_name.'_'.$version_date, $geodir_option);
1836 1836
     }
1837 1837
 }
1838 1838
 
@@ -1938,36 +1938,36 @@  discard block
 block discarded – undo
1938 1938
 
1939 1939
     $query_args = $gd_query_args_widgets;
1940 1940
     if (empty($query_args) || empty($query_args['is_geodir_loop'])) {
1941
-        return $wpdb->posts . ".post_date DESC, ";
1941
+        return $wpdb->posts.".post_date DESC, ";
1942 1942
     }
1943 1943
 
1944 1944
     $post_type = empty($query_args['post_type']) ? 'gd_place' : $query_args['post_type'];
1945
-    $table = $plugin_prefix . $post_type . '_detail';
1945
+    $table = $plugin_prefix.$post_type.'_detail';
1946 1946
 
1947 1947
     $sort_by = !empty($query_args['order_by']) ? $query_args['order_by'] : '';
1948 1948
 
1949 1949
     switch ($sort_by) {
1950 1950
         case 'latest':
1951 1951
         case 'newest':
1952
-            $orderby = $wpdb->posts . ".post_date DESC, ";
1952
+            $orderby = $wpdb->posts.".post_date DESC, ";
1953 1953
             break;
1954 1954
         case 'featured':
1955
-            $orderby = $table . ".is_featured ASC, ";
1955
+            $orderby = $table.".is_featured ASC, ";
1956 1956
             break;
1957 1957
         case 'az':
1958
-            $orderby = $wpdb->posts . ".post_title ASC, ";
1958
+            $orderby = $wpdb->posts.".post_title ASC, ";
1959 1959
             break;
1960 1960
         case 'high_review':
1961
-            $orderby = $table . ".rating_count DESC, " . $table . ".overall_rating DESC, ";
1961
+            $orderby = $table.".rating_count DESC, ".$table.".overall_rating DESC, ";
1962 1962
             break;
1963 1963
         case 'high_rating':
1964
-            $orderby = "( " . $table . ".overall_rating  ) DESC, ";
1964
+            $orderby = "( ".$table.".overall_rating  ) DESC, ";
1965 1965
             break;
1966 1966
         case 'random':
1967 1967
             $orderby = "RAND(), ";
1968 1968
             break;
1969 1969
         default:
1970
-            $orderby = $wpdb->posts . ".post_title ASC, ";
1970
+            $orderby = $wpdb->posts.".post_title ASC, ";
1971 1971
             break;
1972 1972
     }
1973 1973
 
@@ -1994,9 +1994,9 @@  discard block
 block discarded – undo
1994 1994
     $gd_query_args_widgets = $query_args;
1995 1995
 
1996 1996
     $post_type = empty($query_args['post_type']) ? 'gd_place' : $query_args['post_type'];
1997
-    $table = $plugin_prefix . $post_type . '_detail';
1997
+    $table = $plugin_prefix.$post_type.'_detail';
1998 1998
 
1999
-    $fields = $wpdb->posts . ".*, " . $table . ".*";
1999
+    $fields = $wpdb->posts.".*, ".$table.".*";
2000 2000
     /**
2001 2001
      * Filter widget listing fields string part that is being used for query.
2002 2002
      *
@@ -2007,7 +2007,7 @@  discard block
 block discarded – undo
2007 2007
      */
2008 2008
     $fields = apply_filters('geodir_filter_widget_listings_fields', $fields, $table, $post_type);
2009 2009
 
2010
-    $join = "INNER JOIN " . $table . " ON (" . $table . ".post_id = " . $wpdb->posts . ".ID)";
2010
+    $join = "INNER JOIN ".$table." ON (".$table.".post_id = ".$wpdb->posts.".ID)";
2011 2011
 
2012 2012
     ########### WPML ###########
2013 2013
 
@@ -2015,7 +2015,7 @@  discard block
 block discarded – undo
2015 2015
         global $sitepress;
2016 2016
         $lang_code = ICL_LANGUAGE_CODE;
2017 2017
         if ($lang_code) {
2018
-            $join .= " JOIN " . $table_prefix . "icl_translations icl_t ON icl_t.element_id = " . $table_prefix . "posts.ID";
2018
+            $join .= " JOIN ".$table_prefix."icl_translations icl_t ON icl_t.element_id = ".$table_prefix."posts.ID";
2019 2019
         }
2020 2020
     }
2021 2021
 
@@ -2030,9 +2030,9 @@  discard block
 block discarded – undo
2030 2030
      */
2031 2031
     $join = apply_filters('geodir_filter_widget_listings_join', $join, $post_type);
2032 2032
 
2033
-    $post_status = is_super_admin() ? " OR " . $wpdb->posts . ".post_status = 'private'" : '';
2033
+    $post_status = is_super_admin() ? " OR ".$wpdb->posts.".post_status = 'private'" : '';
2034 2034
 
2035
-    $where = " AND ( " . $wpdb->posts . ".post_status = 'publish' " . $post_status . " ) AND " . $wpdb->posts . ".post_type = '" . $post_type . "'";
2035
+    $where = " AND ( ".$wpdb->posts.".post_status = 'publish' ".$post_status." ) AND ".$wpdb->posts.".post_type = '".$post_type."'";
2036 2036
 
2037 2037
     ########### WPML ###########
2038 2038
     if (function_exists('icl_object_id')) {
@@ -2049,7 +2049,7 @@  discard block
 block discarded – undo
2049 2049
      * @param string $post_type Post type.
2050 2050
      */
2051 2051
     $where = apply_filters('geodir_filter_widget_listings_where', $where, $post_type);
2052
-    $where = $where != '' ? " WHERE 1=1 " . $where : '';
2052
+    $where = $where != '' ? " WHERE 1=1 ".$where : '';
2053 2053
 
2054 2054
     $groupby = " GROUP BY $wpdb->posts.ID ";
2055 2055
     /**
@@ -2062,10 +2062,10 @@  discard block
 block discarded – undo
2062 2062
     $groupby = apply_filters('geodir_filter_widget_listings_groupby', $groupby, $post_type);
2063 2063
 
2064 2064
     if ($count_only) {
2065
-        $sql = "SELECT COUNT(" . $wpdb->posts . ".ID) AS total FROM " . $wpdb->posts . "
2066
-			" . $join . "
2065
+        $sql = "SELECT COUNT(".$wpdb->posts.".ID) AS total FROM ".$wpdb->posts."
2066
+			" . $join."
2067 2067
 			" . $where;
2068
-        $rows = (int)$wpdb->get_var($sql);
2068
+        $rows = (int) $wpdb->get_var($sql);
2069 2069
     } else {
2070 2070
         $orderby = geodir_widget_listings_get_order($query_args);
2071 2071
         /**
@@ -2077,8 +2077,8 @@  discard block
 block discarded – undo
2077 2077
          * @param string $post_type Post type.
2078 2078
          */
2079 2079
         $orderby = apply_filters('geodir_filter_widget_listings_orderby', $orderby, $table, $post_type);
2080
-        $orderby .= $wpdb->posts . ".post_title ASC";
2081
-        $orderby = $orderby != '' ? " ORDER BY " . $orderby : '';
2080
+        $orderby .= $wpdb->posts.".post_title ASC";
2081
+        $orderby = $orderby != '' ? " ORDER BY ".$orderby : '';
2082 2082
 
2083 2083
         $limit = !empty($query_args['posts_per_page']) ? $query_args['posts_per_page'] : 5;
2084 2084
         /**
@@ -2091,16 +2091,16 @@  discard block
 block discarded – undo
2091 2091
         $limit = apply_filters('geodir_filter_widget_listings_limit', $limit, $post_type);
2092 2092
 
2093 2093
         $page = !empty($query_args['pageno']) ? absint($query_args['pageno']) : 1;
2094
-        if ( !$page )
2094
+        if (!$page)
2095 2095
             $page = 1;
2096 2096
 
2097
-        $limit = (int)$limit > 0 ? " LIMIT " . absint( ( $page - 1 ) * (int)$limit ) . ", " . (int)$limit : "";
2097
+        $limit = (int) $limit > 0 ? " LIMIT ".absint(($page - 1) * (int) $limit).", ".(int) $limit : "";
2098 2098
 
2099
-        $sql = "SELECT SQL_CALC_FOUND_ROWS " . $fields . " FROM " . $wpdb->posts . "
2100
-			" . $join . "
2101
-			" . $where . "
2102
-			" . $groupby . "
2103
-			" . $orderby . "
2099
+        $sql = "SELECT SQL_CALC_FOUND_ROWS ".$fields." FROM ".$wpdb->posts."
2100
+			" . $join."
2101
+			" . $where."
2102
+			" . $groupby."
2103
+			" . $orderby."
2104 2104
 			" . $limit;
2105 2105
         $rows = $wpdb->get_results($sql);
2106 2106
     }
@@ -2153,10 +2153,10 @@  discard block
 block discarded – undo
2153 2153
     }
2154 2154
 
2155 2155
     $post_type = empty($query_args['post_type']) ? 'gd_place' : $query_args['post_type'];
2156
-    $table = $plugin_prefix . $post_type . '_detail';
2156
+    $table = $plugin_prefix.$post_type.'_detail';
2157 2157
 
2158 2158
     if (!empty($query_args['with_pics_only'])) {
2159
-        $join .= " LEFT JOIN " . GEODIR_ATTACHMENT_TABLE . " ON ( " . GEODIR_ATTACHMENT_TABLE . ".post_id=" . $table . ".post_id AND " . GEODIR_ATTACHMENT_TABLE . ".mime_type LIKE '%image%' )";
2159
+        $join .= " LEFT JOIN ".GEODIR_ATTACHMENT_TABLE." ON ( ".GEODIR_ATTACHMENT_TABLE.".post_id=".$table.".post_id AND ".GEODIR_ATTACHMENT_TABLE.".mime_type LIKE '%image%' )";
2160 2160
     }
2161 2161
 
2162 2162
     if (!empty($query_args['tax_query'])) {
@@ -2188,7 +2188,7 @@  discard block
 block discarded – undo
2188 2188
         return $where;
2189 2189
     }
2190 2190
     $post_type = empty($query_args['post_type']) ? 'gd_place' : $query_args['post_type'];
2191
-    $table = $plugin_prefix . $post_type . '_detail';
2191
+    $table = $plugin_prefix.$post_type.'_detail';
2192 2192
 
2193 2193
     if (!empty($query_args)) {
2194 2194
         if (!empty($query_args['gd_location']) && function_exists('geodir_default_location_where')) {
@@ -2196,27 +2196,27 @@  discard block
 block discarded – undo
2196 2196
         }
2197 2197
 
2198 2198
         if (!empty($query_args['post_author'])) {
2199
-            $where .= " AND " . $wpdb->posts . ".post_author = " . (int)$query_args['post_author'];
2199
+            $where .= " AND ".$wpdb->posts.".post_author = ".(int) $query_args['post_author'];
2200 2200
         }
2201 2201
         
2202 2202
         if (!empty($query_args['show_featured_only'])) {
2203
-            $where .= " AND " . $table . ".is_featured = '1'";
2203
+            $where .= " AND ".$table.".is_featured = '1'";
2204 2204
         }
2205 2205
 
2206 2206
         if (!empty($query_args['show_special_only'])) {
2207
-            $where .= " AND ( " . $table . ".geodir_special_offers != '' AND " . $table . ".geodir_special_offers IS NOT NULL )";
2207
+            $where .= " AND ( ".$table.".geodir_special_offers != '' AND ".$table.".geodir_special_offers IS NOT NULL )";
2208 2208
         }
2209 2209
 
2210 2210
         if (!empty($query_args['with_pics_only'])) {
2211
-            $where .= " AND " . GEODIR_ATTACHMENT_TABLE . ".ID IS NOT NULL ";
2211
+            $where .= " AND ".GEODIR_ATTACHMENT_TABLE.".ID IS NOT NULL ";
2212 2212
         }
2213 2213
 
2214 2214
         if (!empty($query_args['featured_image_only'])) {
2215
-            $where .= " AND " . $table . ".featured_image IS NOT NULL AND " . $table . ".featured_image!='' ";
2215
+            $where .= " AND ".$table.".featured_image IS NOT NULL AND ".$table.".featured_image!='' ";
2216 2216
         }
2217 2217
 
2218 2218
         if (!empty($query_args['with_videos_only'])) {
2219
-            $where .= " AND ( " . $table . ".geodir_video != '' AND " . $table . ".geodir_video IS NOT NULL )";
2219
+            $where .= " AND ( ".$table.".geodir_video != '' AND ".$table.".geodir_video IS NOT NULL )";
2220 2220
         }
2221 2221
 
2222 2222
         if (!empty($query_args['tax_query'])) {
@@ -2273,7 +2273,7 @@  discard block
 block discarded – undo
2273 2273
     }
2274 2274
 
2275 2275
     if (!empty($query_args) && !empty($query_args['posts_per_page'])) {
2276
-        $limit = (int)$query_args['posts_per_page'];
2276
+        $limit = (int) $query_args['posts_per_page'];
2277 2277
     }
2278 2278
 
2279 2279
     return $limit;
@@ -2416,9 +2416,9 @@  discard block
 block discarded – undo
2416 2416
         add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2);
2417 2417
     }
2418 2418
     $home_url = str_replace("www.", "", $home_url);
2419
-    if ( (strpos($home_url, $cur_url) !== false || strpos($home_url . '/', $cur_url) !== false) && ('page' == get_option('show_on_front') && get_option('page_on_front') && get_option('page_on_front')==get_option('geodir_home_page')) ) {
2419
+    if ((strpos($home_url, $cur_url) !== false || strpos($home_url.'/', $cur_url) !== false) && ('page' == get_option('show_on_front') && get_option('page_on_front') && get_option('page_on_front') == get_option('geodir_home_page'))) {
2420 2420
         return true;
2421
-    }elseif(get_query_var('page_id') == get_option('page_on_front') && 'page' == get_option('show_on_front') && get_option('page_on_front') && get_option('page_on_front')==get_option('geodir_home_page')){
2421
+    }elseif (get_query_var('page_id') == get_option('page_on_front') && 'page' == get_option('show_on_front') && get_option('page_on_front') && get_option('page_on_front') == get_option('geodir_home_page')) {
2422 2422
         return true;
2423 2423
     } else {
2424 2424
         return false;
@@ -2501,19 +2501,19 @@  discard block
 block discarded – undo
2501 2501
 
2502 2502
     $gd_post_type = geodir_get_current_posttype();
2503 2503
 
2504
-    $category_limit = isset($instance['category_limit']) && $instance['category_limit'] > 0 ? (int)$instance['category_limit'] : 15;
2505
-    if(!empty($gd_post_type)){
2504
+    $category_limit = isset($instance['category_limit']) && $instance['category_limit'] > 0 ? (int) $instance['category_limit'] : 15;
2505
+    if (!empty($gd_post_type)) {
2506 2506
         $default_post_type = $gd_post_type;
2507
-    }elseif(isset($instance['default_post_type']) && gdsc_is_post_type_valid($instance['default_post_type']) ){
2507
+    }elseif (isset($instance['default_post_type']) && gdsc_is_post_type_valid($instance['default_post_type'])) {
2508 2508
         $default_post_type = $instance['default_post_type'];
2509
-    }else{
2509
+    } else {
2510 2510
         $all_gd_post_type = geodir_get_posttypes();
2511 2511
         $default_post_type = (isset($all_gd_post_type[0])) ? $all_gd_post_type[0] : '';
2512 2512
     }
2513 2513
 
2514 2514
     $taxonomy = array();
2515 2515
     if (!empty($gd_post_type)) {
2516
-        $taxonomy[] = $gd_post_type . "category";
2516
+        $taxonomy[] = $gd_post_type."category";
2517 2517
     } else {
2518 2518
         $taxonomy = geodir_get_taxonomies($gd_post_type);
2519 2519
     }
@@ -2533,7 +2533,7 @@  discard block
 block discarded – undo
2533 2533
             $b_terms[$b_key] = geodir_sort_terms($b_val, 'count');
2534 2534
         }
2535 2535
 
2536
-        $default_taxonomy = $default_post_type != '' && isset($b_terms[$default_post_type . 'category']) ? $default_post_type . 'category' : '';
2536
+        $default_taxonomy = $default_post_type != '' && isset($b_terms[$default_post_type.'category']) ? $default_post_type.'category' : '';
2537 2537
 
2538 2538
         $tax_change_output = '';
2539 2539
         if (count($b_terms) > 1) {
@@ -2541,20 +2541,20 @@  discard block
 block discarded – undo
2541 2541
             foreach ($b_terms as $key => $val) {
2542 2542
                 $ptype = get_post_type_object(str_replace("category", "", $key));
2543 2543
                 $cpt_name = __($ptype->labels->singular_name, 'geodirectory');
2544
-                $tax_change_output .= "<option value='$key' ". selected($key, $default_taxonomy, false) .">" . sprintf(__('%s Categories', 'geodirectory'),$cpt_name) . "</option>";
2544
+                $tax_change_output .= "<option value='$key' ".selected($key, $default_taxonomy, false).">".sprintf(__('%s Categories', 'geodirectory'), $cpt_name)."</option>";
2545 2545
             }
2546 2546
             $tax_change_output .= "</select>";
2547 2547
         }
2548 2548
 
2549 2549
         if (!empty($b_terms)) {
2550
-            $terms = $default_taxonomy != '' && isset($b_terms[$default_taxonomy]) ? $b_terms[$default_taxonomy] : reset($b_terms);// get the first array
2551
-            global $cat_count;//make global so we can change via function
2550
+            $terms = $default_taxonomy != '' && isset($b_terms[$default_taxonomy]) ? $b_terms[$default_taxonomy] : reset($b_terms); // get the first array
2551
+            global $cat_count; //make global so we can change via function
2552 2552
             $cat_count = 0;
2553 2553
             ?>
2554 2554
             <div class="geodir-category-list-in clearfix">
2555 2555
                 <div class="geodir-cat-list clearfix">
2556 2556
                     <?php
2557
-                    echo $before_title . __($title) . $after_title;
2557
+                    echo $before_title.__($title).$after_title;
2558 2558
 
2559 2559
                     echo $tax_change_output;
2560 2560
 
@@ -2571,8 +2571,8 @@  discard block
 block discarded – undo
2571 2571
                     $hide = 'style="display:none;"';
2572 2572
                 }
2573 2573
                 echo "<div class='geodir-cat-list-more' $hide >";
2574
-                echo '<a href="javascript:void(0)" class="geodir-morecat geodir-showcat">' . __('More Categories', 'geodirectory') . '</a>';
2575
-                echo '<a href="javascript:void(0)" class="geodir-morecat geodir-hidecat geodir-hide">' . __('Less Categories', 'geodirectory') . '</a>';
2574
+                echo '<a href="javascript:void(0)" class="geodir-morecat geodir-showcat">'.__('More Categories', 'geodirectory').'</a>';
2575
+                echo '<a href="javascript:void(0)" class="geodir-morecat geodir-hidecat geodir-hide">'.__('Less Categories', 'geodirectory').'</a>';
2576 2576
                 echo "</div>";
2577 2577
                 /* add scripts */
2578 2578
                 add_action('wp_footer', 'geodir_popular_category_add_scripts', 100);
@@ -2612,7 +2612,7 @@  discard block
 block discarded – undo
2612 2612
         $class_row = $cat_count > $category_limit ? 'geodir-pcat-hide geodir-hide' : 'geodir-pcat-show';
2613 2613
         $total_post = $cat->count;
2614 2614
 
2615
-        $term_link = get_term_link( $cat, $cat->taxonomy );
2615
+        $term_link = get_term_link($cat, $cat->taxonomy);
2616 2616
         /**
2617 2617
          * Filer the category term link.
2618 2618
          *
@@ -2621,10 +2621,10 @@  discard block
 block discarded – undo
2621 2621
          * @param int    $cat->term_id The term id.
2622 2622
          * @param string $post_type Wordpress post type.
2623 2623
          */
2624
-        $term_link = apply_filters( 'geodir_category_term_link', $term_link, $cat->term_id, $post_type );
2624
+        $term_link = apply_filters('geodir_category_term_link', $term_link, $cat->term_id, $post_type);
2625 2625
 
2626
-        echo '<li class="' . $class_row . '"><a href="' . $term_link . '">';
2627
-        echo '<img alt="' . esc_attr($cat->name) . ' icon" style="height:20px;vertical-align:middle;" src="' . $term_icon_url . '"/> <span class="cat-link">'; echo $cat->name . '</span> <span class="geodir_term_class geodir_link_span geodir_category_class_' . $post_type . '_' . $cat->term_id . '">(' . $total_post . ')</span> ';
2626
+        echo '<li class="'.$class_row.'"><a href="'.$term_link.'">';
2627
+        echo '<img alt="'.esc_attr($cat->name).' icon" style="height:20px;vertical-align:middle;" src="'.$term_icon_url.'"/> <span class="cat-link">'; echo $cat->name.'</span> <span class="geodir_term_class geodir_link_span geodir_category_class_'.$post_type.'_'.$cat->term_id.'">('.$total_post.')</span> ';
2628 2628
         echo '</a></li>';
2629 2629
     }
2630 2630
 }
@@ -2755,29 +2755,29 @@  discard block
 block discarded – undo
2755 2755
                 itemWidth: 75,
2756 2756
                 itemMargin: 5,
2757 2757
                 asNavFor: '#geodir_widget_slider',
2758
-                rtl: <?php echo ( is_rtl() ? 'true' : 'false' ); /* fix rtl issue */ ?>
2758
+                rtl: <?php echo (is_rtl() ? 'true' : 'false'); /* fix rtl issue */ ?>
2759 2759
             });
2760 2760
 
2761 2761
             jQuery('#geodir_widget_slider').flexslider({
2762
-                animation: "<?php echo $animation;?>",
2762
+                animation: "<?php echo $animation; ?>",
2763 2763
                 selector: ".geodir-slides > li",
2764 2764
                 namespace: "geodir-",
2765 2765
                 controlNav: true,
2766
-                animationLoop: <?php echo $animationLoop;?>,
2767
-                slideshow: <?php echo $slideshow;?>,
2768
-                slideshowSpeed: <?php echo $slideshowSpeed;?>,
2769
-                animationSpeed: <?php echo $animationSpeed;?>,
2770
-                directionNav: <?php echo $directionNav;?>,
2771
-                maxItems: <?php echo $max_show;?>,
2766
+                animationLoop: <?php echo $animationLoop; ?>,
2767
+                slideshow: <?php echo $slideshow; ?>,
2768
+                slideshowSpeed: <?php echo $slideshowSpeed; ?>,
2769
+                animationSpeed: <?php echo $animationSpeed; ?>,
2770
+                directionNav: <?php echo $directionNav; ?>,
2771
+                maxItems: <?php echo $max_show; ?>,
2772 2772
                 move: 1,
2773
-                <?php if($slide_width){ echo "itemWidth: ".$slide_width.",";}?>
2773
+                <?php if ($slide_width) { echo "itemWidth: ".$slide_width.","; }?>
2774 2774
                 sync: "#geodir_widget_carousel",
2775 2775
                 start: function (slider) {
2776 2776
                     jQuery('.geodir-listing-flex-loader').hide();
2777 2777
                     jQuery('#geodir_widget_slider').css({'visibility': 'visible'});
2778 2778
                     jQuery('#geodir_widget_carousel').css({'visibility': 'visible'});
2779 2779
                 },
2780
-                rtl: <?php echo ( is_rtl() ? 'true' : 'false' ); /* fix rtl issue */ ?>
2780
+                rtl: <?php echo (is_rtl() ? 'true' : 'false'); /* fix rtl issue */ ?>
2781 2781
             });
2782 2782
         });
2783 2783
     </script>
@@ -2813,12 +2813,12 @@  discard block
 block discarded – undo
2813 2813
     $widget_listings = geodir_get_widget_listings($query_args);
2814 2814
     if (!empty($widget_listings) || (isset($with_no_results) && $with_no_results)) {
2815 2815
         if ($title) {
2816
-            echo $before_title . $title . $after_title;
2816
+            echo $before_title.$title.$after_title;
2817 2817
         }
2818 2818
 
2819 2819
         global $post;
2820 2820
 
2821
-        $current_post = $post;// keep current post info
2821
+        $current_post = $post; // keep current post info
2822 2822
 
2823 2823
         $widget_main_slides = '';
2824 2824
         $nav_slides = '';
@@ -2836,11 +2836,11 @@  discard block
 block discarded – undo
2836 2836
                     $widget_spacer_height = ((200 - $widget_image->height) / 2);
2837 2837
                 }
2838 2838
 
2839
-                $widget_main_slides .= '<li class="geodir-listing-slider-widget"><img class="geodir-listing-slider-spacer" src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $widget_image->title . '" title="' . $widget_image->title . '" style="max-height:' . $widget_spacer_height . 'px !important;margin:0 auto;" width="100" />';
2839
+                $widget_main_slides .= '<li class="geodir-listing-slider-widget"><img class="geodir-listing-slider-spacer" src="'.geodir_plugin_url()."/geodirectory-assets/images/spacer.gif".'" alt="'.$widget_image->title.'" title="'.$widget_image->title.'" style="max-height:'.$widget_spacer_height.'px !important;margin:0 auto;" width="100" />';
2840 2840
 
2841 2841
                 $title = '';
2842 2842
                 if ($show_title) {
2843
-                    $title_html = '<div class="geodir-slider-title"><a href="' . get_permalink($post->ID) . '">' . get_the_title($post->ID) . '</a></div>';
2843
+                    $title_html = '<div class="geodir-slider-title"><a href="'.get_permalink($post->ID).'">'.get_the_title($post->ID).'</a></div>';
2844 2844
                     $post_id = $post->ID;
2845 2845
                     $post_permalink = get_permalink($post->ID);
2846 2846
                     $post_title = get_the_title($post->ID);
@@ -2853,11 +2853,11 @@  discard block
 block discarded – undo
2853 2853
                      * @param string $post_permalink The post permalink url.
2854 2854
                      * @param string $post_title The post title text.
2855 2855
                      */
2856
-                    $title = apply_filters('geodir_listing_slider_title',$title_html,$post_id,$post_permalink,$post_title);
2856
+                    $title = apply_filters('geodir_listing_slider_title', $title_html, $post_id, $post_permalink, $post_title);
2857 2857
                 }
2858 2858
 
2859
-                $widget_main_slides .= $title . '<img src="' . $widget_image->src . '" alt="' . $widget_image->title . '" title="' . $widget_image->title . '" style="max-height:200px;margin:0 auto;" /></li>';
2860
-                $nav_slides .= '<li><img src="' . $widget_image->src . '" alt="' . $widget_image->title . '" title="' . $widget_image->title . '" style="max-height:48px;margin:0 auto;" /></li>';
2859
+                $widget_main_slides .= $title.'<img src="'.$widget_image->src.'" alt="'.$widget_image->title.'" title="'.$widget_image->title.'" style="max-height:200px;margin:0 auto;" /></li>';
2860
+                $nav_slides .= '<li><img src="'.$widget_image->src.'" alt="'.$widget_image->title.'" title="'.$widget_image->title.'" style="max-height:48px;margin:0 auto;" /></li>';
2861 2861
                 $widget_slides++;
2862 2862
             }
2863 2863
         }
@@ -2901,7 +2901,7 @@  discard block
 block discarded – undo
2901 2901
     $title = empty($instance['title']) ? __('My Dashboard', 'geodirectory') : apply_filters('widget_title', __($instance['title'], 'geodirectory'));
2902 2902
 
2903 2903
     echo $before_widget;
2904
-    echo $before_title . $title . $after_title;
2904
+    echo $before_title.$title.$after_title;
2905 2905
 
2906 2906
     if (is_user_logged_in()) {
2907 2907
         global $current_user;
@@ -2943,7 +2943,7 @@  discard block
 block discarded – undo
2943 2943
                          */
2944 2944
                         $add_link = apply_filters('geodir_dashboard_link_add_listing', $add_link, $key, $current_user->ID);
2945 2945
 
2946
-                        $addlisting_links .= '<option ' . $selected . ' value="' . $add_link . '">' . __(ucfirst($name), 'geodirectory') . '</option>';
2946
+                        $addlisting_links .= '<option '.$selected.' value="'.$add_link.'">'.__(ucfirst($name), 'geodirectory').'</option>';
2947 2947
 
2948 2948
                     }
2949 2949
                 }
@@ -2989,7 +2989,7 @@  discard block
 block discarded – undo
2989 2989
                      */
2990 2990
                     $post_type_link = apply_filters('geodir_dashboard_link_favorite_listing', $post_type_link, $key, $current_user->ID);
2991 2991
 
2992
-                    $favourite_links .= '<option ' . $selected . ' value="' . $post_type_link . '">' . __(ucfirst($name), 'geodirectory') . '</option>';
2992
+                    $favourite_links .= '<option '.$selected.' value="'.$post_type_link.'">'.__(ucfirst($name), 'geodirectory').'</option>';
2993 2993
                 }
2994 2994
             }
2995 2995
 
@@ -3034,7 +3034,7 @@  discard block
 block discarded – undo
3034 3034
                      */
3035 3035
                     $listing_link = apply_filters('geodir_dashboard_link_my_listing', $listing_link, $key, $current_user->ID);
3036 3036
 
3037
-                    $listing_links .= '<option ' . $selected . ' value="' . $listing_link . '">' . __(ucfirst($name), 'geodirectory') . '</option>';
3037
+                    $listing_links .= '<option '.$selected.' value="'.$listing_link.'">'.__(ucfirst($name), 'geodirectory').'</option>';
3038 3038
                 }
3039 3039
             }
3040 3040
 
@@ -3217,7 +3217,7 @@  discard block
 block discarded – undo
3217 3217
     }
3218 3218
 
3219 3219
     if (empty($title) || $title == 'All') {
3220
-        $title .= ' ' . __(get_post_type_plural_label($post_type), 'geodirectory');
3220
+        $title .= ' '.__(get_post_type_plural_label($post_type), 'geodirectory');
3221 3221
     }
3222 3222
 
3223 3223
     $location_url = array();
@@ -3271,7 +3271,7 @@  discard block
 block discarded – undo
3271 3271
             $geodir_add_location_url = '1';
3272 3272
         }
3273 3273
 
3274
-        $viewall_url = get_term_link((int)$category[0], $post_type . 'category');
3274
+        $viewall_url = get_term_link((int) $category[0], $post_type.'category');
3275 3275
 
3276 3276
         $geodir_add_location_url = NULL;
3277 3277
     }
@@ -3279,7 +3279,7 @@  discard block
 block discarded – undo
3279 3279
         $gd_session->set('gd_multi_location', 1);
3280 3280
     }
3281 3281
 
3282
-    if(is_wp_error( $viewall_url  )){$viewall_url = '';}
3282
+    if (is_wp_error($viewall_url)) {$viewall_url = ''; }
3283 3283
 
3284 3284
     $query_args = array(
3285 3285
         'posts_per_page' => $post_number,
@@ -3345,7 +3345,7 @@  discard block
 block discarded – undo
3345 3345
              */
3346 3346
             do_action('geodir_before_view_all_link_in_widget'); ?>
3347 3347
             <div class="geodir_list_heading clearfix">
3348
-                <?php echo $before_title . $title . $after_title; ?>
3348
+                <?php echo $before_title.$title.$after_title; ?>
3349 3349
                 <a href="<?php echo $viewall_url; ?>"
3350 3350
                    class="geodir-viewall"><?php _e('View all', 'geodirectory'); ?></a>
3351 3351
             </div>
@@ -3431,9 +3431,9 @@  discard block
 block discarded – undo
3431 3431
 {
3432 3432
     global $wpdb, $plugin_prefix;
3433 3433
 
3434
-    $detail_table = $plugin_prefix . $post_type . '_detail';
3434
+    $detail_table = $plugin_prefix.$post_type.'_detail';
3435 3435
 
3436
-    $sql = "SELECT COALESCE(SUM(rating_count),0) FROM " . $detail_table . " WHERE post_status = 'publish' AND rating_count > 0 AND FIND_IN_SET(" . $term_id . ", " . $taxonomy . ")";
3436
+    $sql = "SELECT COALESCE(SUM(rating_count),0) FROM ".$detail_table." WHERE post_status = 'publish' AND rating_count > 0 AND FIND_IN_SET(".$term_id.", ".$taxonomy.")";
3437 3437
 
3438 3438
     /**
3439 3439
      * Filter count review sql query.
@@ -3472,7 +3472,7 @@  discard block
 block discarded – undo
3472 3472
      * @param bool $force_update Force update option value?. Default.false.
3473 3473
      * @param int $post_ID The post id to update if any.
3474 3474
      */
3475
-    $option_data = apply_filters('geodir_count_reviews_by_terms_before', '', $force_update,$post_ID);
3475
+    $option_data = apply_filters('geodir_count_reviews_by_terms_before', '', $force_update, $post_ID);
3476 3476
     if (!empty($option_data)) {
3477 3477
         return $option_data;
3478 3478
     }
@@ -3480,11 +3480,11 @@  discard block
 block discarded – undo
3480 3480
     $option_data = get_option('geodir_global_review_count');
3481 3481
 
3482 3482
     if (!$option_data || $force_update) {
3483
-        if ((int)$post_ID > 0) { // Update reviews count for specific post categories only.
3483
+        if ((int) $post_ID > 0) { // Update reviews count for specific post categories only.
3484 3484
             global $gd_session;
3485
-            $term_array = (array)$option_data;
3485
+            $term_array = (array) $option_data;
3486 3486
             $post_type = get_post_type($post_ID);
3487
-            $taxonomy = $post_type . 'category';
3487
+            $taxonomy = $post_type.'category';
3488 3488
             $terms = wp_get_object_terms($post_ID, $taxonomy, array('fields' => 'ids'));
3489 3489
 
3490 3490
             if (!empty($terms) && !is_wp_error($terms)) {
@@ -3499,9 +3499,9 @@  discard block
 block discarded – undo
3499 3499
             
3500 3500
             $terms = array();
3501 3501
             if (isset($_POST['post_category'][$taxonomy])) {
3502
-                $terms = (array)$_POST['post_category'][$taxonomy];
3502
+                $terms = (array) $_POST['post_category'][$taxonomy];
3503 3503
             } else if (!empty($session_listing) && isset($session_listing['post_category'][$taxonomy])) {
3504
-                $terms = (array)$session_listing['post_category'][$taxonomy];
3504
+                $terms = (array) $session_listing['post_category'][$taxonomy];
3505 3505
             }
3506 3506
             
3507 3507
             if (!empty($terms)) {
@@ -3589,7 +3589,7 @@  discard block
 block discarded – undo
3589 3589
     return true;
3590 3590
 }
3591 3591
 
3592
-function geodir_term_review_count_force_update_single_post($post_id){
3592
+function geodir_term_review_count_force_update_single_post($post_id) {
3593 3593
     geodir_count_reviews_by_terms(true, $post_id); 
3594 3594
 }
3595 3595
 
@@ -3726,17 +3726,17 @@  discard block
 block discarded – undo
3726 3726
      */
3727 3727
     $locale = apply_filters('plugin_locale', get_locale(), 'geodirectory');
3728 3728
 
3729
-    load_textdomain('geodirectory', WP_LANG_DIR . '/' . 'geodirectory' . '/' . 'geodirectory' . '-' . $locale . '.mo');
3730
-    load_plugin_textdomain('geodirectory', false, plugin_basename(dirname(dirname(__FILE__))) . '/geodirectory-languages');
3729
+    load_textdomain('geodirectory', WP_LANG_DIR.'/'.'geodirectory'.'/'.'geodirectory'.'-'.$locale.'.mo');
3730
+    load_plugin_textdomain('geodirectory', false, plugin_basename(dirname(dirname(__FILE__))).'/geodirectory-languages');
3731 3731
 
3732 3732
     /**
3733 3733
      * Define language constants.
3734 3734
      *
3735 3735
      * @since 1.0.0
3736 3736
      */
3737
-    require_once(geodir_plugin_path() . '/language.php');
3737
+    require_once(geodir_plugin_path().'/language.php');
3738 3738
 
3739
-    $language_file = geodir_plugin_path() . '/db-language.php';
3739
+    $language_file = geodir_plugin_path().'/db-language.php';
3740 3740
 
3741 3741
     // Load language string file if not created yet
3742 3742
     if (!file_exists($language_file)) {
@@ -3751,8 +3751,8 @@  discard block
 block discarded – undo
3751 3751
          */
3752 3752
         try {
3753 3753
             require_once($language_file);
3754
-        } catch(Exception $e) {
3755
-            error_log('Language Error: ' . $e->getMessage());
3754
+        } catch (Exception $e) {
3755
+            error_log('Language Error: '.$e->getMessage());
3756 3756
         }
3757 3757
     }
3758 3758
 }
@@ -3769,18 +3769,18 @@  discard block
 block discarded – undo
3769 3769
  */
3770 3770
 function geodirectory_load_db_language() {
3771 3771
     global $wp_filesystem;
3772
-    if( empty( $wp_filesystem ) ) {
3773
-        require_once( ABSPATH .'/wp-admin/includes/file.php' );
3772
+    if (empty($wp_filesystem)) {
3773
+        require_once(ABSPATH.'/wp-admin/includes/file.php');
3774 3774
         WP_Filesystem();
3775 3775
         global $wp_filesystem;
3776 3776
     }
3777 3777
 
3778
-    $language_file = geodir_plugin_path() . '/db-language.php';
3778
+    $language_file = geodir_plugin_path().'/db-language.php';
3779 3779
 
3780
-    if(is_file($language_file) && !is_writable($language_file))
3780
+    if (is_file($language_file) && !is_writable($language_file))
3781 3781
         return false; // Not possible to create.
3782 3782
 
3783
-    if(!is_file($language_file) && !is_writable(dirname($language_file)))
3783
+    if (!is_file($language_file) && !is_writable(dirname($language_file)))
3784 3784
         return false; // Not possible to create.
3785 3785
 
3786 3786
     $contents_strings = array();
@@ -3814,17 +3814,17 @@  discard block
 block discarded – undo
3814 3814
     $contents = implode(PHP_EOL, $contents_head);
3815 3815
 
3816 3816
     if (!empty($contents_strings)) {
3817
-        foreach ( $contents_strings as $string ) {
3817
+        foreach ($contents_strings as $string) {
3818 3818
             if (is_scalar($string) && $string != '') {
3819 3819
                 $string = str_replace("'", "\'", $string);
3820
-                $contents .= PHP_EOL . "__('" . $string . "', 'geodirectory');";
3820
+                $contents .= PHP_EOL."__('".$string."', 'geodirectory');";
3821 3821
             }
3822 3822
         }
3823 3823
     }
3824 3824
 
3825 3825
     $contents .= implode(PHP_EOL, $contents_foot);
3826 3826
 
3827
-    if($wp_filesystem->put_contents( $language_file, $contents, FS_CHMOD_FILE))
3827
+    if ($wp_filesystem->put_contents($language_file, $contents, FS_CHMOD_FILE))
3828 3828
         return false; // Failure; could not write file.
3829 3829
 
3830 3830
     return true;
@@ -3846,11 +3846,11 @@  discard block
 block discarded – undo
3846 3846
     global $wpdb;
3847 3847
 
3848 3848
     // Custom fields table
3849
-    $sql = "SELECT admin_title, admin_desc, site_title, clabels, required_msg, default_value, option_values FROM " . GEODIR_CUSTOM_FIELDS_TABLE;
3849
+    $sql = "SELECT admin_title, admin_desc, site_title, clabels, required_msg, default_value, option_values FROM ".GEODIR_CUSTOM_FIELDS_TABLE;
3850 3850
     $rows = $wpdb->get_results($sql);
3851 3851
 
3852 3852
     if (!empty($rows)) {
3853
-        foreach($rows as $row) {
3853
+        foreach ($rows as $row) {
3854 3854
             if (!empty($row->admin_title))
3855 3855
                 $translation_texts[] = stripslashes_deep($row->admin_title);
3856 3856
 			
@@ -3884,11 +3884,11 @@  discard block
 block discarded – undo
3884 3884
     }
3885 3885
 	
3886 3886
     // Custom sorting fields table
3887
-    $sql = "SELECT site_title, asc_title, desc_title FROM " . GEODIR_CUSTOM_SORT_FIELDS_TABLE;
3887
+    $sql = "SELECT site_title, asc_title, desc_title FROM ".GEODIR_CUSTOM_SORT_FIELDS_TABLE;
3888 3888
     $rows = $wpdb->get_results($sql);
3889 3889
 
3890 3890
     if (!empty($rows)) {
3891
-        foreach($rows as $row) {
3891
+        foreach ($rows as $row) {
3892 3892
             if (!empty($row->site_title))
3893 3893
                 $translation_texts[] = stripslashes_deep($row->site_title);
3894 3894
 
@@ -3902,11 +3902,11 @@  discard block
 block discarded – undo
3902 3902
 	
3903 3903
 	// Advance search filter fields table
3904 3904
 	if (defined('GEODIR_ADVANCE_SEARCH_TABLE')) {
3905
-		$sql = "SELECT field_site_name, front_search_title, field_desc FROM " . GEODIR_ADVANCE_SEARCH_TABLE;
3905
+		$sql = "SELECT field_site_name, front_search_title, field_desc FROM ".GEODIR_ADVANCE_SEARCH_TABLE;
3906 3906
 		$rows = $wpdb->get_results($sql);
3907 3907
 
3908 3908
 		if (!empty($rows)) {
3909
-			foreach($rows as $row) {
3909
+			foreach ($rows as $row) {
3910 3910
 				if (!empty($row->field_site_name))
3911 3911
 					$translation_texts[] = stripslashes_deep($row->field_site_name);
3912 3912
 
@@ -3941,7 +3941,7 @@  discard block
 block discarded – undo
3941 3941
      *
3942 3942
      * @param array $geodir_allowed_mime_types and file extensions.
3943 3943
      */
3944
-    return apply_filters( 'geodir_allowed_mime_types', array(
3944
+    return apply_filters('geodir_allowed_mime_types', array(
3945 3945
             'Image' => array( // Image formats.
3946 3946
                 'jpg' => 'image/jpeg',
3947 3947
                 'jpe' => 'image/jpeg',
@@ -4030,13 +4030,13 @@  discard block
 block discarded – undo
4030 4030
 
4031 4031
 
4032 4032
 
4033
-add_filter('wpseo_replacements','geodir_wpseo_replacements',10,1);
4033
+add_filter('wpseo_replacements', 'geodir_wpseo_replacements', 10, 1);
4034 4034
 /*
4035 4035
  * Add location variables to wpseo replacements.
4036 4036
  *
4037 4037
  * @since 1.5.4
4038 4038
  */
4039
-function geodir_wpseo_replacements($vars){
4039
+function geodir_wpseo_replacements($vars) {
4040 4040
 
4041 4041
     global $wp;
4042 4042
     $title = '';
@@ -4051,12 +4051,12 @@  discard block
 block discarded – undo
4051 4051
      * @param array $location_array The array of location variables.
4052 4052
      * @param array $vars The page title variables.
4053 4053
      */
4054
-    $location_array = apply_filters('geodir_filter_title_variables_location_arr_seo',$location_array, $vars);
4054
+    $location_array = apply_filters('geodir_filter_title_variables_location_arr_seo', $location_array, $vars);
4055 4055
     $location_titles = array();
4056
-    if(get_query_var( 'gd_country_full' )){
4057
-        if(get_query_var( 'gd_country_full' )){$location_array['gd_country'] = get_query_var( 'gd_country_full' );}
4058
-        if(get_query_var( 'gd_region_full' )){$location_array['gd_region'] = get_query_var( 'gd_region_full' );}
4059
-        if(get_query_var( 'gd_city_full' )){$location_array['gd_city'] = get_query_var( 'gd_city_full' );}
4056
+    if (get_query_var('gd_country_full')) {
4057
+        if (get_query_var('gd_country_full')) {$location_array['gd_country'] = get_query_var('gd_country_full'); }
4058
+        if (get_query_var('gd_region_full')) {$location_array['gd_region'] = get_query_var('gd_region_full'); }
4059
+        if (get_query_var('gd_city_full')) {$location_array['gd_city'] = get_query_var('gd_city_full'); }
4060 4060
     }
4061 4061
     $location_single = '';
4062 4062
     $gd_country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : '';
@@ -4128,23 +4128,23 @@  discard block
 block discarded – undo
4128 4128
     }
4129 4129
 
4130 4130
 
4131
-    if(!empty($location_titles)) {
4131
+    if (!empty($location_titles)) {
4132 4132
         $vars['%%location%%'] = implode(", ", $location_titles);
4133 4133
     }
4134 4134
 
4135 4135
 
4136
-    if(!empty($location_titles)) {
4137
-        $vars['%%in_location%%'] = __('in ', 'geodirectory') . implode(", ", $location_titles);
4136
+    if (!empty($location_titles)) {
4137
+        $vars['%%in_location%%'] = __('in ', 'geodirectory').implode(", ", $location_titles);
4138 4138
     }
4139 4139
 
4140 4140
 
4141 4141
 
4142
-    if($location_single) {
4143
-        $vars['%%in_location_single%%'] = __('in', 'geodirectory') . ' ' .$location_single;
4142
+    if ($location_single) {
4143
+        $vars['%%in_location_single%%'] = __('in', 'geodirectory').' '.$location_single;
4144 4144
     }
4145 4145
 
4146 4146
 
4147
-    if($location_single) {
4147
+    if ($location_single) {
4148 4148
         $vars['%%location_single%%'] = $location_single;
4149 4149
     }
4150 4150
 
@@ -4156,13 +4156,13 @@  discard block
 block discarded – undo
4156 4156
      * @param string $vars The title with variables.
4157 4157
      * @param array $location_array The array of location variables.
4158 4158
      */
4159
-    return apply_filters('geodir_wpseo_replacements_vars',$vars,$location_array);
4159
+    return apply_filters('geodir_wpseo_replacements_vars', $vars, $location_array);
4160 4160
 }
4161 4161
 
4162 4162
 
4163
-add_filter('geodir_seo_meta_title','geodir_filter_title_variables',10,3);
4164
-add_filter('geodir_seo_page_title','geodir_filter_title_variables',10,2);
4165
-add_filter('geodir_seo_meta_description_pre','geodir_filter_title_variables',10,3);
4163
+add_filter('geodir_seo_meta_title', 'geodir_filter_title_variables', 10, 3);
4164
+add_filter('geodir_seo_page_title', 'geodir_filter_title_variables', 10, 2);
4165
+add_filter('geodir_seo_meta_description_pre', 'geodir_filter_title_variables', 10, 3);
4166 4166
 
4167 4167
 /**
4168 4168
  * Filter the title variables.
@@ -4221,19 +4221,19 @@  discard block
 block discarded – undo
4221 4221
         $sep = apply_filters('geodir_page_title_separator', '|');
4222 4222
     }
4223 4223
 
4224
-    if (strpos($title,'%%title%%') !== false) {
4224
+    if (strpos($title, '%%title%%') !== false) {
4225 4225
         $title = str_replace("%%title%%", $post->post_title, $title);
4226 4226
     }
4227 4227
 
4228
-    if (strpos($title,'%%sitename%%') !== false) {
4228
+    if (strpos($title, '%%sitename%%') !== false) {
4229 4229
         $title = str_replace("%%sitename%%", get_bloginfo('name'), $title);
4230 4230
     }
4231 4231
 
4232
-    if (strpos($title,'%%sitedesc%%') !== false) {
4232
+    if (strpos($title, '%%sitedesc%%') !== false) {
4233 4233
         $title = str_replace("%%sitedesc%%", get_bloginfo('description'), $title);
4234 4234
     }
4235 4235
 
4236
-    if (strpos($title,'%%excerpt%%') !== false) {
4236
+    if (strpos($title, '%%excerpt%%') !== false) {
4237 4237
         $title = str_replace("%%excerpt%%", strip_tags(get_the_excerpt()), $title);
4238 4238
     }
4239 4239
     
@@ -4241,8 +4241,8 @@  discard block
 block discarded – undo
4241 4241
         $post_type = sanitize_text_field($_REQUEST['stype']);
4242 4242
     } else if ($gd_page == 'add-listing') {
4243 4243
         $post_type = sanitize_text_field($_REQUEST['listing_type']);
4244
-        $post_type = !$post_type && !empty($_REQUEST['pid']) ? get_post_type((int)$_REQUEST['pid']) : $post_type;
4245
-    } else if (isset($post->post_type) && $post->post_type && in_array($post->post_type , geodir_get_posttypes())) {
4244
+        $post_type = !$post_type && !empty($_REQUEST['pid']) ? get_post_type((int) $_REQUEST['pid']) : $post_type;
4245
+    } else if (isset($post->post_type) && $post->post_type && in_array($post->post_type, geodir_get_posttypes())) {
4246 4246
         $post_type = $post->post_type;
4247 4247
     } else {
4248 4248
         $post_type = get_query_var('post_type');
@@ -4269,9 +4269,9 @@  discard block
 block discarded – undo
4269 4269
     if (strpos($title, '%%category%%') !== false) {
4270 4270
         $cat_name = '';
4271 4271
 
4272
-        if ($gd_page=='detail') {
4272
+        if ($gd_page == 'detail') {
4273 4273
             if ($post->default_category) {
4274
-                $cat = get_term($post->default_category, $post->post_type . 'category');
4274
+                $cat = get_term($post->default_category, $post->post_type.'category');
4275 4275
                 $cat_name = (isset($cat->name)) ? $cat->name : '';
4276 4276
             }
4277 4277
         } else if ($gd_page == 'listing') {
@@ -4286,12 +4286,12 @@  discard block
 block discarded – undo
4286 4286
     if (strpos($title, '%%tag%%') !== false) {
4287 4287
         $cat_name = '';
4288 4288
 
4289
-        if ($gd_page=='detail') {
4289
+        if ($gd_page == 'detail') {
4290 4290
             if ($post->default_category) {
4291
-                $cat = get_term($post->default_category, $post->post_type . 'category');
4291
+                $cat = get_term($post->default_category, $post->post_type.'category');
4292 4292
                 $cat_name = (isset($cat->name)) ? $cat->name : '';
4293 4293
             }
4294
-        } else if($gd_page == 'listing') {
4294
+        } else if ($gd_page == 'listing') {
4295 4295
             $queried_object = get_queried_object();
4296 4296
             if (isset($queried_object->name)) {
4297 4297
                 $cat_name = $queried_object->name;
@@ -4305,7 +4305,7 @@  discard block
 block discarded – undo
4305 4305
         $title = str_replace("%%id%%", $ID, $title);
4306 4306
     }
4307 4307
 
4308
-    if (strpos($title,'%%sep%%') !== false) {
4308
+    if (strpos($title, '%%sep%%') !== false) {
4309 4309
         $title = str_replace("%%sep%%", $sep, $title);
4310 4310
     }
4311 4311
 
@@ -4322,12 +4322,12 @@  discard block
 block discarded – undo
4322 4322
      * @param string $gd_page The page being filtered.
4323 4323
      * @param string $sep The separator, default: `|`.
4324 4324
      */
4325
-    $location_array = apply_filters('geodir_filter_title_variables_location_arr',$location_array,$title, $gd_page, $sep);
4325
+    $location_array = apply_filters('geodir_filter_title_variables_location_arr', $location_array, $title, $gd_page, $sep);
4326 4326
     $location_titles = array();
4327
-    if($gd_page=='location' && get_query_var( 'gd_country_full' )){
4328
-        if(get_query_var( 'gd_country_full' )){$location_array['gd_country'] = get_query_var( 'gd_country_full' );}
4329
-        if(get_query_var( 'gd_region_full' )){$location_array['gd_region'] = get_query_var( 'gd_region_full' );}
4330
-        if(get_query_var( 'gd_city_full' )){$location_array['gd_city'] = get_query_var( 'gd_city_full' );}
4327
+    if ($gd_page == 'location' && get_query_var('gd_country_full')) {
4328
+        if (get_query_var('gd_country_full')) {$location_array['gd_country'] = get_query_var('gd_country_full'); }
4329
+        if (get_query_var('gd_region_full')) {$location_array['gd_region'] = get_query_var('gd_region_full'); }
4330
+        if (get_query_var('gd_city_full')) {$location_array['gd_city'] = get_query_var('gd_city_full'); }
4331 4331
     }
4332 4332
     $location_single = '';
4333 4333
     $gd_country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : '';
@@ -4399,51 +4399,51 @@  discard block
 block discarded – undo
4399 4399
     }
4400 4400
 
4401 4401
 
4402
-    if(strpos($title,'%%location%%') !== false){
4402
+    if (strpos($title, '%%location%%') !== false) {
4403 4403
         $location = '';
4404
-        if($location_titles) {
4404
+        if ($location_titles) {
4405 4405
             $location = implode(", ", $location_titles);
4406 4406
         }
4407
-        $title = str_replace("%%location%%",$location,$title);
4407
+        $title = str_replace("%%location%%", $location, $title);
4408 4408
     }
4409 4409
 
4410
-    if(strpos($title,'%%in_location%%') !== false){
4410
+    if (strpos($title, '%%in_location%%') !== false) {
4411 4411
         $location = '';
4412
-        if($location_titles) {
4413
-            $location = __('in ', 'geodirectory') . implode(", ", $location_titles);
4412
+        if ($location_titles) {
4413
+            $location = __('in ', 'geodirectory').implode(", ", $location_titles);
4414 4414
         }
4415
-        $title = str_replace("%%in_location%%",$location,$title);
4415
+        $title = str_replace("%%in_location%%", $location, $title);
4416 4416
     }
4417 4417
 
4418
-    if(strpos($title,'%%in_location_single%%') !== false){
4419
-        if($location_single) {
4420
-            $location_single = __('in', 'geodirectory') . ' ' .$location_single;
4418
+    if (strpos($title, '%%in_location_single%%') !== false) {
4419
+        if ($location_single) {
4420
+            $location_single = __('in', 'geodirectory').' '.$location_single;
4421 4421
         }
4422
-        $title = str_replace("%%in_location_single%%",$location_single,$title);
4422
+        $title = str_replace("%%in_location_single%%", $location_single, $title);
4423 4423
     }
4424 4424
 
4425
-    if(strpos($title,'%%location_single%%') !== false){
4426
-        $title = str_replace("%%location_single%%",$location_single,$title);
4425
+    if (strpos($title, '%%location_single%%') !== false) {
4426
+        $title = str_replace("%%location_single%%", $location_single, $title);
4427 4427
     }
4428 4428
 
4429 4429
 
4430
-    if(strpos($title,'%%search_term%%') !== false){
4430
+    if (strpos($title, '%%search_term%%') !== false) {
4431 4431
         $search_term = '';
4432
-        if(isset($_REQUEST['s'])){
4432
+        if (isset($_REQUEST['s'])) {
4433 4433
             $search_term = esc_attr($_REQUEST['s']);
4434 4434
         }
4435
-        $title = str_replace("%%search_term%%",$search_term,$title);
4435
+        $title = str_replace("%%search_term%%", $search_term, $title);
4436 4436
     }
4437 4437
 
4438
-    if(strpos($title,'%%search_near%%') !== false){
4438
+    if (strpos($title, '%%search_near%%') !== false) {
4439 4439
         $search_term = '';
4440
-        if(isset($_REQUEST['snear'])){
4440
+        if (isset($_REQUEST['snear'])) {
4441 4441
             $search_term = esc_attr($_REQUEST['snear']);
4442 4442
         }
4443
-        $title = str_replace("%%search_near%%",$search_term,$title);
4443
+        $title = str_replace("%%search_near%%", $search_term, $title);
4444 4444
     }
4445 4445
 
4446
-    if(strpos($title,'%%name%%') !== false){
4446
+    if (strpos($title, '%%name%%') !== false) {
4447 4447
         $author_name = get_the_author();
4448 4448
         if (!$author_name || $author_name === '') {
4449 4449
             $queried_object = get_queried_object();
@@ -4468,9 +4468,9 @@  discard block
 block discarded – undo
4468 4468
         $title = str_replace("%%pagetotal%%", $pagetotal, $title);
4469 4469
     }
4470 4470
 
4471
-    $title = wptexturize( $title );
4472
-    $title = convert_chars( $title );
4473
-    $title = esc_html( $title );
4471
+    $title = wptexturize($title);
4472
+    $title = convert_chars($title);
4473
+    $title = esc_html($title);
4474 4474
 
4475 4475
     /**
4476 4476
      * Filter the title variables after standard ones have been filtered.
@@ -4483,7 +4483,7 @@  discard block
 block discarded – undo
4483 4483
      * @param string $sep The separator, default: `|`.
4484 4484
      */
4485 4485
 
4486
-    return apply_filters('geodir_filter_title_variables_vars',$title,$location_array, $gd_page, $sep);
4486
+    return apply_filters('geodir_filter_title_variables_vars', $title, $location_array, $gd_page, $sep);
4487 4487
 }
4488 4488
 
4489 4489
 /**
@@ -4606,7 +4606,7 @@  discard block
 block discarded – undo
4606 4606
     }
4607 4607
     
4608 4608
     $action = isset($_REQUEST['action']) ? sanitize_text_field($_REQUEST['action']) : '';
4609
-    $is_admin = is_admin() && ( !defined('DOING_AJAX' ) || ( defined('DOING_AJAX') && !DOING_AJAX ) )  ? true : false;
4609
+    $is_admin = is_admin() && (!defined('DOING_AJAX') || (defined('DOING_AJAX') && !DOING_AJAX)) ? true : false;
4610 4610
     $inline_save = $action == 'inline-save' ? true : false;
4611 4611
 
4612 4612
     if (empty($post->post_type) || $is_admin || $inline_save || (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)) {
@@ -4617,7 +4617,7 @@  discard block
 block discarded – undo
4617 4617
         return;
4618 4618
     }
4619 4619
 
4620
-    $user_id = (int)get_current_user_id();
4620
+    $user_id = (int) get_current_user_id();
4621 4621
         
4622 4622
     if ($user_id > 0 && get_option('geodir_notify_post_edited') && !wp_is_post_revision($post_ID) && in_array($post->post_type, geodir_get_posttypes())) {
4623 4623
         $author_id = !empty($post->post_author) ? $post->post_author : 0;
@@ -4661,7 +4661,7 @@  discard block
 block discarded – undo
4661 4661
     $nr  = geodir_title_meta_pagenumbering('nr');
4662 4662
 
4663 4663
     if ($max > 1 && $nr > 1) {
4664
-        $replacement = sprintf($sep . ' ' . __('Page %1$d of %2$d', 'geodirectory'), $nr, $max);
4664
+        $replacement = sprintf($sep.' '.__('Page %1$d of %2$d', 'geodirectory'), $nr, $max);
4665 4665
     }
4666 4666
 
4667 4667
     return $replacement;
@@ -4680,7 +4680,7 @@  discard block
 block discarded – undo
4680 4680
 
4681 4681
     $nr = geodir_title_meta_pagenumbering('nr');
4682 4682
     if (isset($nr) && $nr > 0) {
4683
-        $replacement = (string)$nr;
4683
+        $replacement = (string) $nr;
4684 4684
     }
4685 4685
 
4686 4686
     return $replacement;
@@ -4699,7 +4699,7 @@  discard block
 block discarded – undo
4699 4699
 
4700 4700
     $max = geodir_title_meta_pagenumbering('max');
4701 4701
     if (isset($max) && $max > 0) {
4702
-        $replacement = (string)$max;
4702
+        $replacement = (string) $max;
4703 4703
     }
4704 4704
 
4705 4705
     return $replacement;
@@ -4741,7 +4741,7 @@  discard block
 block discarded – undo
4741 4741
         }
4742 4742
 
4743 4743
         if (isset($post->post_content)) {
4744
-            $max_num_pages = (substr_count($post->post_content, '<!--nextpage-->' ) + 1);
4744
+            $max_num_pages = (substr_count($post->post_content, '<!--nextpage-->') + 1);
4745 4745
         }
4746 4746
     }
4747 4747
 
@@ -4790,10 +4790,10 @@  discard block
 block discarded – undo
4790 4790
  *
4791 4791
  * @return array
4792 4792
  */
4793
-function geodir_remove_hentry( $class ) {
4794
-    if(geodir_is_page('detail')){
4795
-        $class = array_diff( $class, array( 'hentry' ) );
4793
+function geodir_remove_hentry($class) {
4794
+    if (geodir_is_page('detail')) {
4795
+        $class = array_diff($class, array('hentry'));
4796 4796
     }
4797 4797
     return $class;
4798 4798
 }
4799
-add_filter( 'post_class', 'geodir_remove_hentry' );
4800 4799
\ No newline at end of file
4800
+add_filter('post_class', 'geodir_remove_hentry');
4801 4801
\ No newline at end of file
Please login to merge, or discard this patch.
geodirectory_template_actions.php 2 patches
Indentation   +1735 added lines, -1735 removed lines patch added patch discarded remove patch
@@ -17,10 +17,10 @@  discard block
 block discarded – undo
17 17
  */
18 18
 function gd_compat_styles()
19 19
 {
20
-    $tc = get_option('theme_compatibility_setting');
21
-    echo "<style id='gd-compat-styles' type='text/css'>";
22
-    echo $tc['geodir_theme_compat_css'];
23
-    echo "</style>";
20
+	$tc = get_option('theme_compatibility_setting');
21
+	echo "<style id='gd-compat-styles' type='text/css'>";
22
+	echo $tc['geodir_theme_compat_css'];
23
+	echo "</style>";
24 24
 }
25 25
 
26 26
 /**
@@ -31,10 +31,10 @@  discard block
 block discarded – undo
31 31
  */
32 32
 function gd_compat_script()
33 33
 {
34
-    $tc = get_option('theme_compatibility_setting');
35
-    echo "<script>";
36
-    echo $tc['geodir_theme_compat_js'];
37
-    echo " </script>";
34
+	$tc = get_option('theme_compatibility_setting');
35
+	echo "<script>";
36
+	echo $tc['geodir_theme_compat_js'];
37
+	echo " </script>";
38 38
 }
39 39
 
40 40
 /**
@@ -47,8 +47,8 @@  discard block
 block discarded – undo
47 47
  */
48 48
 function geodir_top_content_add_dynamic()
49 49
 {
50
-    $tc = get_option('theme_compatibility_setting');
51
-    echo $tc['geodir_top_content_add'];
50
+	$tc = get_option('theme_compatibility_setting');
51
+	echo $tc['geodir_top_content_add'];
52 52
 }
53 53
 
54 54
 /**
@@ -61,8 +61,8 @@  discard block
 block discarded – undo
61 61
  */
62 62
 function geodir_before_main_content_add_dynamic()
63 63
 {
64
-    $tc = get_option('theme_compatibility_setting');
65
-    echo $tc['geodir_before_main_content_add'];
64
+	$tc = get_option('theme_compatibility_setting');
65
+	echo $tc['geodir_before_main_content_add'];
66 66
 }
67 67
 
68 68
 /**
@@ -75,8 +75,8 @@  discard block
 block discarded – undo
75 75
  */
76 76
 function geodir_full_page_class_dynamic()
77 77
 {
78
-    $tc = get_option('theme_compatibility_setting');
79
-    return $tc['geodir_full_page_class_filter'];
78
+	$tc = get_option('theme_compatibility_setting');
79
+	return $tc['geodir_full_page_class_filter'];
80 80
 }
81 81
 
82 82
 /**
@@ -89,8 +89,8 @@  discard block
 block discarded – undo
89 89
  */
90 90
 function geodir_before_widget_dynamic()
91 91
 {
92
-    $tc = get_option('theme_compatibility_setting');
93
-    return $tc['geodir_before_widget_filter'];
92
+	$tc = get_option('theme_compatibility_setting');
93
+	return $tc['geodir_before_widget_filter'];
94 94
 }
95 95
 
96 96
 /**
@@ -103,8 +103,8 @@  discard block
 block discarded – undo
103 103
  */
104 104
 function geodir_after_widget_dynamic()
105 105
 {
106
-    $tc = get_option('theme_compatibility_setting');
107
-    return $tc['geodir_after_widget_filter'];
106
+	$tc = get_option('theme_compatibility_setting');
107
+	return $tc['geodir_after_widget_filter'];
108 108
 }
109 109
 
110 110
 /**
@@ -117,8 +117,8 @@  discard block
 block discarded – undo
117 117
  */
118 118
 function geodir_before_title_dynamic()
119 119
 {
120
-    $tc = get_option('theme_compatibility_setting');
121
-    return $tc['geodir_before_title_filter'];
120
+	$tc = get_option('theme_compatibility_setting');
121
+	return $tc['geodir_before_title_filter'];
122 122
 }
123 123
 
124 124
 /**
@@ -131,8 +131,8 @@  discard block
 block discarded – undo
131 131
  */
132 132
 function geodir_after_title_dynamic()
133 133
 {
134
-    $tc = get_option('theme_compatibility_setting');
135
-    return $tc['geodir_after_title_filter'];
134
+	$tc = get_option('theme_compatibility_setting');
135
+	return $tc['geodir_after_title_filter'];
136 136
 }
137 137
 
138 138
 /**
@@ -145,8 +145,8 @@  discard block
 block discarded – undo
145 145
  */
146 146
 function geodir_menu_li_class_dynamic()
147 147
 {
148
-    $tc = get_option('theme_compatibility_setting');
149
-    return $tc['geodir_menu_li_class_filter'];
148
+	$tc = get_option('theme_compatibility_setting');
149
+	return $tc['geodir_menu_li_class_filter'];
150 150
 }
151 151
 
152 152
 /**
@@ -159,8 +159,8 @@  discard block
 block discarded – undo
159 159
  */
160 160
 function geodir_sub_menu_ul_class_dynamic()
161 161
 {
162
-    $tc = get_option('theme_compatibility_setting');
163
-    return $tc['geodir_sub_menu_ul_class_filter'];
162
+	$tc = get_option('theme_compatibility_setting');
163
+	return $tc['geodir_sub_menu_ul_class_filter'];
164 164
 }
165 165
 
166 166
 /**
@@ -173,8 +173,8 @@  discard block
 block discarded – undo
173 173
  */
174 174
 function geodir_sub_menu_li_class_dynamic()
175 175
 {
176
-    $tc = get_option('theme_compatibility_setting');
177
-    return $tc['geodir_sub_menu_li_class_filter'];
176
+	$tc = get_option('theme_compatibility_setting');
177
+	return $tc['geodir_sub_menu_li_class_filter'];
178 178
 }
179 179
 
180 180
 /**
@@ -187,8 +187,8 @@  discard block
 block discarded – undo
187 187
  */
188 188
 function geodir_menu_a_class_dynamic()
189 189
 {
190
-    $tc = get_option('theme_compatibility_setting');
191
-    return $tc['geodir_menu_a_class_filter'];
190
+	$tc = get_option('theme_compatibility_setting');
191
+	return $tc['geodir_menu_a_class_filter'];
192 192
 }
193 193
 
194 194
 /**
@@ -201,8 +201,8 @@  discard block
 block discarded – undo
201 201
  */
202 202
 function geodir_sub_menu_a_class_dynamic()
203 203
 {
204
-    $tc = get_option('theme_compatibility_setting');
205
-    return $tc['geodir_sub_menu_a_class_filter'];
204
+	$tc = get_option('theme_compatibility_setting');
205
+	return $tc['geodir_sub_menu_a_class_filter'];
206 206
 }
207 207
 
208 208
 /**
@@ -215,8 +215,8 @@  discard block
 block discarded – undo
215 215
  */
216 216
 function geodir_location_switcher_menu_li_class_dynamic()
217 217
 {
218
-    $tc = get_option('theme_compatibility_setting');
219
-    return $tc['geodir_location_switcher_menu_li_class_filter'];
218
+	$tc = get_option('theme_compatibility_setting');
219
+	return $tc['geodir_location_switcher_menu_li_class_filter'];
220 220
 }
221 221
 
222 222
 /**
@@ -229,8 +229,8 @@  discard block
 block discarded – undo
229 229
  */
230 230
 function geodir_location_switcher_menu_a_class_dynamic()
231 231
 {
232
-    $tc = get_option('theme_compatibility_setting');
233
-    return $tc['geodir_location_switcher_menu_a_class_filter'];
232
+	$tc = get_option('theme_compatibility_setting');
233
+	return $tc['geodir_location_switcher_menu_a_class_filter'];
234 234
 }
235 235
 
236 236
 /**
@@ -243,8 +243,8 @@  discard block
 block discarded – undo
243 243
  */
244 244
 function geodir_location_switcher_menu_sub_ul_class_dynamic()
245 245
 {
246
-    $tc = get_option('theme_compatibility_setting');
247
-    return $tc['geodir_location_switcher_menu_sub_ul_class_filter'];
246
+	$tc = get_option('theme_compatibility_setting');
247
+	return $tc['geodir_location_switcher_menu_sub_ul_class_filter'];
248 248
 }
249 249
 
250 250
 /**
@@ -257,8 +257,8 @@  discard block
 block discarded – undo
257 257
  */
258 258
 function geodir_location_switcher_menu_sub_li_class_dynamic()
259 259
 {
260
-    $tc = get_option('theme_compatibility_setting');
261
-    return $tc['geodir_location_switcher_menu_sub_li_class_filter'];
260
+	$tc = get_option('theme_compatibility_setting');
261
+	return $tc['geodir_location_switcher_menu_sub_li_class_filter'];
262 262
 }
263 263
 
264 264
 
@@ -275,106 +275,106 @@  discard block
 block discarded – undo
275 275
 function geodir_content_actions_dynamic()
276 276
 {
277 277
 
278
-    $tc = get_option('theme_compatibility_setting');
279
-    if (empty($tc)) {
280
-        return;
281
-    }
278
+	$tc = get_option('theme_compatibility_setting');
279
+	if (empty($tc)) {
280
+		return;
281
+	}
282 282
 
283
-    //php
284
-    if (!empty($tc['geodir_theme_compat_code'])) {
285
-        include_once('geodirectory-functions/compatibility/' . $tc['geodir_theme_compat_code'] . '.php');
286
-    }
283
+	//php
284
+	if (!empty($tc['geodir_theme_compat_code'])) {
285
+		include_once('geodirectory-functions/compatibility/' . $tc['geodir_theme_compat_code'] . '.php');
286
+	}
287 287
 
288
-    //geodir_full_page_class
289
-    if (!empty($tc['geodir_full_page_class_filter'])) {
290
-        add_filter('geodir_full_page_class', 'geodir_full_page_class_dynamic', 10);
291
-    }
288
+	//geodir_full_page_class
289
+	if (!empty($tc['geodir_full_page_class_filter'])) {
290
+		add_filter('geodir_full_page_class', 'geodir_full_page_class_dynamic', 10);
291
+	}
292 292
 
293
-    //widget before filter
294
-    if (!empty($tc['geodir_before_widget_filter'])) {
295
-        add_filter('geodir_before_widget', 'geodir_before_widget_dynamic', 10);
296
-    }
293
+	//widget before filter
294
+	if (!empty($tc['geodir_before_widget_filter'])) {
295
+		add_filter('geodir_before_widget', 'geodir_before_widget_dynamic', 10);
296
+	}
297 297
 
298
-    //widget after filter
299
-    if (!empty($tc['geodir_after_widget_filter'])) {
300
-        add_filter('geodir_after_widget', 'geodir_after_widget_dynamic', 10);
301
-    }
298
+	//widget after filter
299
+	if (!empty($tc['geodir_after_widget_filter'])) {
300
+		add_filter('geodir_after_widget', 'geodir_after_widget_dynamic', 10);
301
+	}
302 302
 
303
-    //widget before title filter
304
-    if (!empty($tc['geodir_before_title_filter'])) {
305
-        add_filter('geodir_before_title', 'geodir_before_title_dynamic', 10);
306
-    }
303
+	//widget before title filter
304
+	if (!empty($tc['geodir_before_title_filter'])) {
305
+		add_filter('geodir_before_title', 'geodir_before_title_dynamic', 10);
306
+	}
307 307
 
308
-    //widget before title filter
309
-    if (!empty($tc['geodir_after_title_filter'])) {
310
-        add_filter('geodir_after_title', 'geodir_after_title_dynamic', 10);
311
-    }
308
+	//widget before title filter
309
+	if (!empty($tc['geodir_after_title_filter'])) {
310
+		add_filter('geodir_after_title', 'geodir_after_title_dynamic', 10);
311
+	}
312 312
 
313
-    //menu li class
314
-    if (!empty($tc['geodir_menu_li_class_filter'])) {
315
-        add_filter('geodir_menu_li_class', 'geodir_menu_li_class_dynamic', 10);
316
-    }
313
+	//menu li class
314
+	if (!empty($tc['geodir_menu_li_class_filter'])) {
315
+		add_filter('geodir_menu_li_class', 'geodir_menu_li_class_dynamic', 10);
316
+	}
317 317
 
318
-    //menu ul class
319
-    if (!empty($tc['geodir_sub_menu_ul_class_filter'])) {
320
-        add_filter('geodir_sub_menu_ul_class', 'geodir_sub_menu_ul_class_dynamic', 10);
321
-    }
318
+	//menu ul class
319
+	if (!empty($tc['geodir_sub_menu_ul_class_filter'])) {
320
+		add_filter('geodir_sub_menu_ul_class', 'geodir_sub_menu_ul_class_dynamic', 10);
321
+	}
322 322
 
323
-    //menu sub li class
324
-    if (!empty($tc['geodir_sub_menu_li_class_filter'])) {
325
-        add_filter('geodir_sub_menu_li_class', 'geodir_sub_menu_li_class_dynamic', 10);
326
-    }
323
+	//menu sub li class
324
+	if (!empty($tc['geodir_sub_menu_li_class_filter'])) {
325
+		add_filter('geodir_sub_menu_li_class', 'geodir_sub_menu_li_class_dynamic', 10);
326
+	}
327 327
 
328
-    //menu a class
329
-    if (!empty($tc['geodir_menu_a_class_filter'])) {
330
-        add_filter('geodir_menu_a_class', 'geodir_menu_a_class_dynamic', 10);
331
-    }
328
+	//menu a class
329
+	if (!empty($tc['geodir_menu_a_class_filter'])) {
330
+		add_filter('geodir_menu_a_class', 'geodir_menu_a_class_dynamic', 10);
331
+	}
332 332
 
333
-    //menu sub a class
334
-    if (!empty($tc['geodir_sub_menu_a_class_filter'])) {
335
-        add_filter('geodir_sub_menu_a_class', 'geodir_sub_menu_a_class_dynamic', 10);
336
-    }
333
+	//menu sub a class
334
+	if (!empty($tc['geodir_sub_menu_a_class_filter'])) {
335
+		add_filter('geodir_sub_menu_a_class', 'geodir_sub_menu_a_class_dynamic', 10);
336
+	}
337 337
 
338
-    //location menu li class
339
-    if (!empty($tc['geodir_location_switcher_menu_li_class_filter'])) {
340
-        add_filter('geodir_location_switcher_menu_li_class', 'geodir_location_switcher_menu_li_class_dynamic', 10);
341
-    }
338
+	//location menu li class
339
+	if (!empty($tc['geodir_location_switcher_menu_li_class_filter'])) {
340
+		add_filter('geodir_location_switcher_menu_li_class', 'geodir_location_switcher_menu_li_class_dynamic', 10);
341
+	}
342 342
 
343
-    //location menu sub ul class
344
-    if (!empty($tc['geodir_location_switcher_menu_sub_ul_class_filter'])) {
345
-        add_filter('geodir_location_switcher_menu_sub_ul_class', 'geodir_location_switcher_menu_sub_ul_class_dynamic', 10);
346
-    }
343
+	//location menu sub ul class
344
+	if (!empty($tc['geodir_location_switcher_menu_sub_ul_class_filter'])) {
345
+		add_filter('geodir_location_switcher_menu_sub_ul_class', 'geodir_location_switcher_menu_sub_ul_class_dynamic', 10);
346
+	}
347 347
 
348
-    //location menu sub li class
349
-    if (!empty($tc['geodir_location_switcher_menu_sub_li_class_filter'])) {
350
-        add_filter('geodir_location_switcher_menu_sub_li_class', 'geodir_location_switcher_menu_sub_li_class_dynamic', 10);
351
-    }
348
+	//location menu sub li class
349
+	if (!empty($tc['geodir_location_switcher_menu_sub_li_class_filter'])) {
350
+		add_filter('geodir_location_switcher_menu_sub_li_class', 'geodir_location_switcher_menu_sub_li_class_dynamic', 10);
351
+	}
352 352
 
353
-    //location menu a class
354
-    if (!empty($tc['geodir_location_switcher_menu_a_class_filter'])) {
355
-        add_filter('geodir_location_switcher_menu_a_class', 'geodir_location_switcher_menu_a_class_dynamic', 10);
356
-    }
353
+	//location menu a class
354
+	if (!empty($tc['geodir_location_switcher_menu_a_class_filter'])) {
355
+		add_filter('geodir_location_switcher_menu_a_class', 'geodir_location_switcher_menu_a_class_dynamic', 10);
356
+	}
357 357
 
358
-    // compat styles
359
-    if (!empty($tc['geodir_theme_compat_css'])) {
360
-        add_action('wp_head', 'gd_compat_styles');
361
-    }
358
+	// compat styles
359
+	if (!empty($tc['geodir_theme_compat_css'])) {
360
+		add_action('wp_head', 'gd_compat_styles');
361
+	}
362 362
 
363
-    // compat js
364
-    if (!empty($tc['geodir_theme_compat_js'])) {
365
-        add_action('wp_footer', 'gd_compat_script');
366
-    }
363
+	// compat js
364
+	if (!empty($tc['geodir_theme_compat_js'])) {
365
+		add_action('wp_footer', 'gd_compat_script');
366
+	}
367 367
 
368 368
 
369
-    // geodir_top_content_add
370
-    if (!empty($tc['geodir_top_content_add'])) {
371
-        add_action('geodir_top_content', 'geodir_top_content_add_dynamic', 10, 1);
372
-    }
369
+	// geodir_top_content_add
370
+	if (!empty($tc['geodir_top_content_add'])) {
371
+		add_action('geodir_top_content', 'geodir_top_content_add_dynamic', 10, 1);
372
+	}
373 373
 
374
-    // geodir_before_main_content_add
375
-    if (!empty($tc['geodir_before_main_content_add'])) {
376
-        add_action('geodir_before_main_content', 'geodir_before_main_content_add_dynamic', 10, 1);
377
-    }
374
+	// geodir_before_main_content_add
375
+	if (!empty($tc['geodir_before_main_content_add'])) {
376
+		add_action('geodir_before_main_content', 'geodir_before_main_content_add_dynamic', 10, 1);
377
+	}
378 378
 
379 379
 
380 380
 }
@@ -397,23 +397,23 @@  discard block
 block discarded – undo
397 397
  */
398 398
 function geodir_action_wrapper_open($type = '', $id = '', $class = '')
399 399
 {
400
-    $tc = get_option('theme_compatibility_setting');
401
-    if (!empty($tc['geodir_wrapper_open_replace'])) {
402
-        $text = $tc['geodir_wrapper_open_replace'];
403
-    } else {
404
-        $text = '<div id="[id]" class="[class]">';
405
-    }
400
+	$tc = get_option('theme_compatibility_setting');
401
+	if (!empty($tc['geodir_wrapper_open_replace'])) {
402
+		$text = $tc['geodir_wrapper_open_replace'];
403
+	} else {
404
+		$text = '<div id="[id]" class="[class]">';
405
+	}
406 406
 
407
-    if (!empty($tc['geodir_wrapper_open_id'])) {
408
-        $id = $tc['geodir_wrapper_open_id'];
409
-    }
410
-    if (!empty($tc['geodir_wrapper_open_class'])) {
411
-        $class = $tc['geodir_wrapper_open_class'];
412
-    }
407
+	if (!empty($tc['geodir_wrapper_open_id'])) {
408
+		$id = $tc['geodir_wrapper_open_id'];
409
+	}
410
+	if (!empty($tc['geodir_wrapper_open_class'])) {
411
+		$class = $tc['geodir_wrapper_open_class'];
412
+	}
413 413
 
414
-    $text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
414
+	$text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
415 415
 
416
-    echo $text;
416
+	echo $text;
417 417
 }
418 418
 
419 419
 // action for adding the wrapperdiv closing tag
@@ -428,14 +428,14 @@  discard block
 block discarded – undo
428 428
  */
429 429
 function geodir_action_wrapper_close($type = '')
430 430
 {
431
-    $tc = get_option('theme_compatibility_setting');
432
-    if (!empty($tc['geodir_wrapper_close_replace'])) {
433
-        $text = $tc['geodir_wrapper_close_replace'];
434
-    } else {
435
-        $text = '</div><!-- wrapper ends here-->';
436
-    }
431
+	$tc = get_option('theme_compatibility_setting');
432
+	if (!empty($tc['geodir_wrapper_close_replace'])) {
433
+		$text = $tc['geodir_wrapper_close_replace'];
434
+	} else {
435
+		$text = '</div><!-- wrapper ends here-->';
436
+	}
437 437
 
438
-    echo $text;
438
+	echo $text;
439 439
 }
440 440
 
441 441
 // action for adding the content div opening tag
@@ -451,35 +451,35 @@  discard block
 block discarded – undo
451 451
  */
452 452
 function geodir_action_wrapper_content_open($type = '', $id = '', $class = '')
453 453
 {
454
-    if ($type == 'home-page' && $width = get_option('geodir_width_home_contant_section')) {
455
-        $width_css = 'style="width:' . $width . '%;"';
456
-    } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_contant_section')) {
457
-        $width_css = 'style="width:' . $width . '%;"';
458
-    } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_contant_section')) {
459
-        $width_css = 'style="width:' . $width . '%;"';
460
-    } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_contant_section')) {
461
-        $width_css = 'style="width:' . $width . '%;"';
462
-    } else {
463
-        $width_css = '';
464
-    }
465
-
466
-    $tc = get_option('theme_compatibility_setting');
467
-    if (!empty($tc['geodir_wrapper_content_open_replace'])) {
468
-        $text = $tc['geodir_wrapper_content_open_replace'];
469
-    } else {
470
-        $text = '<div id="[id]" class="[class]" role="main" [width_css]>';
471
-    }
472
-
473
-    if (!empty($tc['geodir_wrapper_content_open_id'])) {
474
-        $id = $tc['geodir_wrapper_content_open_id'];
475
-    }
476
-    if (!empty($tc['geodir_wrapper_content_open_class'])) {
477
-        $class = $tc['geodir_wrapper_content_open_class'];
478
-    }
479
-
480
-    $text = str_replace(array("[id]", "[class]", "[width_css]"), array($id, $class, $width_css), $text);
481
-
482
-    echo $text;
454
+	if ($type == 'home-page' && $width = get_option('geodir_width_home_contant_section')) {
455
+		$width_css = 'style="width:' . $width . '%;"';
456
+	} elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_contant_section')) {
457
+		$width_css = 'style="width:' . $width . '%;"';
458
+	} elseif ($type == 'search-page' && $width = get_option('geodir_width_search_contant_section')) {
459
+		$width_css = 'style="width:' . $width . '%;"';
460
+	} elseif ($type == 'author-page' && $width = get_option('geodir_width_author_contant_section')) {
461
+		$width_css = 'style="width:' . $width . '%;"';
462
+	} else {
463
+		$width_css = '';
464
+	}
465
+
466
+	$tc = get_option('theme_compatibility_setting');
467
+	if (!empty($tc['geodir_wrapper_content_open_replace'])) {
468
+		$text = $tc['geodir_wrapper_content_open_replace'];
469
+	} else {
470
+		$text = '<div id="[id]" class="[class]" role="main" [width_css]>';
471
+	}
472
+
473
+	if (!empty($tc['geodir_wrapper_content_open_id'])) {
474
+		$id = $tc['geodir_wrapper_content_open_id'];
475
+	}
476
+	if (!empty($tc['geodir_wrapper_content_open_class'])) {
477
+		$class = $tc['geodir_wrapper_content_open_class'];
478
+	}
479
+
480
+	$text = str_replace(array("[id]", "[class]", "[width_css]"), array($id, $class, $width_css), $text);
481
+
482
+	echo $text;
483 483
 }
484 484
 
485 485
 // action for adding the primary div closing tag
@@ -493,13 +493,13 @@  discard block
 block discarded – undo
493 493
  */
494 494
 function geodir_action_wrapper_content_close($type = '')
495 495
 {
496
-    $tc = get_option('theme_compatibility_setting');
497
-    if (!empty($tc['geodir_wrapper_content_close_replace'])) {
498
-        $text = $tc['geodir_wrapper_content_close_replace'];
499
-    } else {
500
-        $text = '</div><!-- content ends here-->';
501
-    }
502
-    echo $text;
496
+	$tc = get_option('theme_compatibility_setting');
497
+	if (!empty($tc['geodir_wrapper_content_close_replace'])) {
498
+		$text = $tc['geodir_wrapper_content_close_replace'];
499
+	} else {
500
+		$text = '</div><!-- content ends here-->';
501
+	}
502
+	echo $text;
503 503
 }
504 504
 
505 505
 // action for adding the <article> opening tag
@@ -517,24 +517,24 @@  discard block
 block discarded – undo
517 517
  */
518 518
 function geodir_action_article_open($type = '', $id = '', $class = '', $itemtype = '')
519 519
 {
520
-    $class = implode(" ", $class);
521
-    $tc = get_option('theme_compatibility_setting');
522
-    if (!empty($tc['geodir_article_open_replace'])) {
523
-        $text = $tc['geodir_article_open_replace'];
524
-    } else {
525
-        $text = '<article  id="[id]" class="[class]" >';
526
-    }
520
+	$class = implode(" ", $class);
521
+	$tc = get_option('theme_compatibility_setting');
522
+	if (!empty($tc['geodir_article_open_replace'])) {
523
+		$text = $tc['geodir_article_open_replace'];
524
+	} else {
525
+		$text = '<article  id="[id]" class="[class]" >';
526
+	}
527 527
 
528
-    if (!empty($tc['geodir_article_open_id'])) {
529
-        $id = $tc['geodir_article_open_id'];
530
-    }
531
-    if (!empty($tc['geodir_article_open_class'])) {
532
-        $class = $tc['geodir_article_open_class'];
533
-    }
528
+	if (!empty($tc['geodir_article_open_id'])) {
529
+		$id = $tc['geodir_article_open_id'];
530
+	}
531
+	if (!empty($tc['geodir_article_open_class'])) {
532
+		$class = $tc['geodir_article_open_class'];
533
+	}
534 534
 
535
-    $text = str_replace(array("[id]", "[class]", "[itemtype]"), array($id, $class, $itemtype), $text);
535
+	$text = str_replace(array("[id]", "[class]", "[itemtype]"), array($id, $class, $itemtype), $text);
536 536
 
537
-    echo $text;
537
+	echo $text;
538 538
 }
539 539
 
540 540
 // action for adding the primary div closing tag
@@ -548,13 +548,13 @@  discard block
 block discarded – undo
548 548
  */
549 549
 function geodir_action_article_close($type = '')
550 550
 {
551
-    $tc = get_option('theme_compatibility_setting');
552
-    if (!empty($tc['geodir_article_close_replace'])) {
553
-        $text = $tc['geodir_article_close_replace'];
554
-    } else {
555
-        $text = '</article><!-- article ends here-->';
556
-    }
557
-    echo $text;
551
+	$tc = get_option('theme_compatibility_setting');
552
+	if (!empty($tc['geodir_article_close_replace'])) {
553
+		$text = $tc['geodir_article_close_replace'];
554
+	} else {
555
+		$text = '</article><!-- article ends here-->';
556
+	}
557
+	echo $text;
558 558
 }
559 559
 
560 560
 // action for adding the sidebar opening tag
@@ -571,35 +571,35 @@  discard block
 block discarded – undo
571 571
  */
572 572
 function geodir_action_sidebar_right_open($type = '', $id = '', $class = '', $itemtype = '')
573 573
 {
574
-    if ($type == 'home-page' && $width = get_option('geodir_width_home_right_section')) {
575
-        $width_css = 'style="width:' . $width . '%;"';
576
-    } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_right_section')) {
577
-        $width_css = 'style="width:' . $width . '%;"';
578
-    } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_right_section')) {
579
-        $width_css = 'style="width:' . $width . '%;"';
580
-    } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_right_section')) {
581
-        $width_css = 'style="width:' . $width . '%;"';
582
-    } else {
583
-        $width_css = '';
584
-    }
585
-
586
-    $tc = get_option('theme_compatibility_setting');
587
-    if (!empty($tc['geodir_sidebar_right_open_replace'])) {
588
-        $text = $tc['geodir_sidebar_right_open_replace'];
589
-    } else {
590
-        $text = '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>';
591
-    }
592
-
593
-    if (!empty($tc['geodir_sidebar_right_open_id'])) {
594
-        $id = $tc['geodir_sidebar_right_open_id'];
595
-    }
596
-    if (!empty($tc['geodir_sidebar_right_open_class'])) {
597
-        $class = $tc['geodir_sidebar_right_open_class'];
598
-    }
599
-
600
-    $text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
601
-
602
-    echo $text;
574
+	if ($type == 'home-page' && $width = get_option('geodir_width_home_right_section')) {
575
+		$width_css = 'style="width:' . $width . '%;"';
576
+	} elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_right_section')) {
577
+		$width_css = 'style="width:' . $width . '%;"';
578
+	} elseif ($type == 'search-page' && $width = get_option('geodir_width_search_right_section')) {
579
+		$width_css = 'style="width:' . $width . '%;"';
580
+	} elseif ($type == 'author-page' && $width = get_option('geodir_width_author_right_section')) {
581
+		$width_css = 'style="width:' . $width . '%;"';
582
+	} else {
583
+		$width_css = '';
584
+	}
585
+
586
+	$tc = get_option('theme_compatibility_setting');
587
+	if (!empty($tc['geodir_sidebar_right_open_replace'])) {
588
+		$text = $tc['geodir_sidebar_right_open_replace'];
589
+	} else {
590
+		$text = '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>';
591
+	}
592
+
593
+	if (!empty($tc['geodir_sidebar_right_open_id'])) {
594
+		$id = $tc['geodir_sidebar_right_open_id'];
595
+	}
596
+	if (!empty($tc['geodir_sidebar_right_open_class'])) {
597
+		$class = $tc['geodir_sidebar_right_open_class'];
598
+	}
599
+
600
+	$text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
601
+
602
+	echo $text;
603 603
 }
604 604
 
605 605
 // action for adding the primary div closing tag
@@ -613,13 +613,13 @@  discard block
 block discarded – undo
613 613
  */
614 614
 function geodir_action_sidebar_right_close($type = '')
615 615
 {
616
-    $tc = get_option('theme_compatibility_setting');
617
-    if (!empty($tc['geodir_sidebar_right_close_replace'])) {
618
-        $text = $tc['geodir_sidebar_right_close_replace'];
619
-    } else {
620
-        $text = '</aside><!-- sidebar ends here-->';
621
-    }
622
-    echo $text;
616
+	$tc = get_option('theme_compatibility_setting');
617
+	if (!empty($tc['geodir_sidebar_right_close_replace'])) {
618
+		$text = $tc['geodir_sidebar_right_close_replace'];
619
+	} else {
620
+		$text = '</aside><!-- sidebar ends here-->';
621
+	}
622
+	echo $text;
623 623
 }
624 624
 
625 625
 
@@ -640,121 +640,121 @@  discard block
 block discarded – undo
640 640
  */
641 641
 function geodir_action_geodir_set_preview_post()
642 642
 {
643
-    global $post, $preview, $gd_session;
644
-    $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
645
-    if (!$preview || $is_backend_preview) {
646
-        return;
647
-    }// bail if not previewing
648
-
649
-    $listing_type = isset($_REQUEST['listing_type']) ? sanitize_text_field($_REQUEST['listing_type']) : '';
650
-
651
-    $fields_info = geodir_get_custom_fields_type($listing_type);
652
-
653
-    foreach ($_REQUEST as $pkey => $pval) {
654
-        if ($pkey == 'geodir_video') {
655
-            $tags = '<iframe>';
656
-        } else if ($pkey == 'post_desc') {
657
-            $tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>';
658
-        } else if (is_array($fields_info) && isset($fields_info[$pkey]) && ($fields_info[$pkey] == 'textarea' || $fields_info[$pkey] == 'html')) {
659
-            $tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>';
660
-        } else if (is_array($_REQUEST[$pkey])) {
661
-            $tags = 'skip_field';
662
-        } else {
663
-            $tags = '';
664
-        }
665
-        /**
666
-         * Allows the filtering of the allowed HTML tags per field when submitting from frontend add listing page.
667
-         *
668
-         * @since 1.0.0
669
-         * @param string $tags The allowed HTML tags for the field. Can be many things, for example the description allows these tags '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>'.
670
-         * @param string|array $pkey The field id/name. If array then value is set as "skip_field".
671
-         */
672
-        $tags = apply_filters('geodir_save_post_key', $tags, $pkey);
673
-
674
-        if ($tags != 'skip_field') {
675
-            $_REQUEST[$pkey] = strip_tags($_REQUEST[$pkey], $tags);
676
-        }
677
-    }
678
-
679
-    $post = (object)$_REQUEST;
680
-
681
-
682
-    if (isset($post->video)) {
683
-        $post->video = stripslashes($post->video);
684
-    }
685
-
686
-    if (isset($post->Video2)) {
687
-        $post->Video2 = stripslashes($post->Video2);
688
-    }
689
-
690
-    $post_type = $post->listing_type;
691
-    $post_type_info = get_post_type_object($post_type);
692
-
693
-    $listing_label = $post_type_info->labels->singular_name;
694
-
695
-    $term_icon = '';
696
-
697
-    if (!empty($post->post_category)) {
698
-        foreach ($post->post_category as $post_taxonomy => $post_term) {
699
-
700
-            if ($post_term != '' && !is_array($post_term)) {
701
-                $post_term = explode(',', trim($post_term, ','));
702
-            }
643
+	global $post, $preview, $gd_session;
644
+	$is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
645
+	if (!$preview || $is_backend_preview) {
646
+		return;
647
+	}// bail if not previewing
648
+
649
+	$listing_type = isset($_REQUEST['listing_type']) ? sanitize_text_field($_REQUEST['listing_type']) : '';
650
+
651
+	$fields_info = geodir_get_custom_fields_type($listing_type);
652
+
653
+	foreach ($_REQUEST as $pkey => $pval) {
654
+		if ($pkey == 'geodir_video') {
655
+			$tags = '<iframe>';
656
+		} else if ($pkey == 'post_desc') {
657
+			$tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>';
658
+		} else if (is_array($fields_info) && isset($fields_info[$pkey]) && ($fields_info[$pkey] == 'textarea' || $fields_info[$pkey] == 'html')) {
659
+			$tags = '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>';
660
+		} else if (is_array($_REQUEST[$pkey])) {
661
+			$tags = 'skip_field';
662
+		} else {
663
+			$tags = '';
664
+		}
665
+		/**
666
+		 * Allows the filtering of the allowed HTML tags per field when submitting from frontend add listing page.
667
+		 *
668
+		 * @since 1.0.0
669
+		 * @param string $tags The allowed HTML tags for the field. Can be many things, for example the description allows these tags '<p><a><b><i><em><h1><h2><h3><h4><h5><ul><ol><li><img><div><del><ins><span><cite><code><strike><strong><blockquote>'.
670
+		 * @param string|array $pkey The field id/name. If array then value is set as "skip_field".
671
+		 */
672
+		$tags = apply_filters('geodir_save_post_key', $tags, $pkey);
673
+
674
+		if ($tags != 'skip_field') {
675
+			$_REQUEST[$pkey] = strip_tags($_REQUEST[$pkey], $tags);
676
+		}
677
+	}
678
+
679
+	$post = (object)$_REQUEST;
680
+
681
+
682
+	if (isset($post->video)) {
683
+		$post->video = stripslashes($post->video);
684
+	}
685
+
686
+	if (isset($post->Video2)) {
687
+		$post->Video2 = stripslashes($post->Video2);
688
+	}
689
+
690
+	$post_type = $post->listing_type;
691
+	$post_type_info = get_post_type_object($post_type);
692
+
693
+	$listing_label = $post_type_info->labels->singular_name;
694
+
695
+	$term_icon = '';
696
+
697
+	if (!empty($post->post_category)) {
698
+		foreach ($post->post_category as $post_taxonomy => $post_term) {
699
+
700
+			if ($post_term != '' && !is_array($post_term)) {
701
+				$post_term = explode(',', trim($post_term, ','));
702
+			}
703 703
 
704
-            if (is_array($post_term)) {
705
-                $post_term = array_unique($post_term);
706
-            }
704
+			if (is_array($post_term)) {
705
+				$post_term = array_unique($post_term);
706
+			}
707 707
 
708
-            if (!empty($post_term)) {
709
-                foreach ($post_term as $cat_id) {
710
-                    $cat_id = trim($cat_id);
711
-
712
-                    if ($cat_id != '') {
713
-                        $term_icon = get_option('geodir_default_marker_icon');
714
-
715
-                        if (isset($post->post_default_category) && $post->post_default_category == $cat_id) {
716
-                            if ($term_icon_url = get_tax_meta($cat_id, 'ct_cat_icon', false, $post_type)) {
717
-                                if (isset($term_icon_url['src']) && $term_icon_url['src'] != '')
718
-                                    $term_icon = $term_icon_url['src'];
719
-                                break;
720
-                            }
721
-                        }
722
-                    }
723
-                }
724
-            }
725
-        }
726
-    }
708
+			if (!empty($post_term)) {
709
+				foreach ($post_term as $cat_id) {
710
+					$cat_id = trim($cat_id);
711
+
712
+					if ($cat_id != '') {
713
+						$term_icon = get_option('geodir_default_marker_icon');
714
+
715
+						if (isset($post->post_default_category) && $post->post_default_category == $cat_id) {
716
+							if ($term_icon_url = get_tax_meta($cat_id, 'ct_cat_icon', false, $post_type)) {
717
+								if (isset($term_icon_url['src']) && $term_icon_url['src'] != '')
718
+									$term_icon = $term_icon_url['src'];
719
+								break;
720
+							}
721
+						}
722
+					}
723
+				}
724
+			}
725
+		}
726
+	}
727 727
 
728
-    $post_latitude = isset($post->post_latitude) ? $post->post_latitude : '';
729
-    $post_longitude = isset($post->post_longitude) ? $post->post_longitude : '';
728
+	$post_latitude = isset($post->post_latitude) ? $post->post_latitude : '';
729
+	$post_longitude = isset($post->post_longitude) ? $post->post_longitude : '';
730 730
 
731
-    $srcharr = array("'", "/", "-", '"', '\\');
732
-    $replarr = array("&prime;", "&frasl;", "&ndash;", "&ldquo;", '');
731
+	$srcharr = array("'", "/", "-", '"', '\\');
732
+	$replarr = array("&prime;", "&frasl;", "&ndash;", "&ldquo;", '');
733 733
 
734
-    $json_title = str_replace($srcharr, $replarr, $post->post_title);
734
+	$json_title = str_replace($srcharr, $replarr, $post->post_title);
735 735
 
736
-    $json = '{';
737
-    $json .= '"post_preview": "1",';
738
-    $json .= '"t": "' . $json_title . '",';
739
-    $json .= '"lt": "' . $post_latitude . '",';
740
-    $json .= '"ln": "' . $post_longitude . '",';
741
-    $json .= '"i":"' . $term_icon . '"';
742
-    $json .= '}';
736
+	$json = '{';
737
+	$json .= '"post_preview": "1",';
738
+	$json .= '"t": "' . $json_title . '",';
739
+	$json .= '"lt": "' . $post_latitude . '",';
740
+	$json .= '"ln": "' . $post_longitude . '",';
741
+	$json .= '"i":"' . $term_icon . '"';
742
+	$json .= '}';
743 743
 
744
-    $post->marker_json = $json;
744
+	$post->marker_json = $json;
745 745
 
746
-    $gd_session->set('listing', $_REQUEST);
746
+	$gd_session->set('listing', $_REQUEST);
747 747
 
748
-    // we need to define a few things to trick the setup_postdata
749
-    if (!isset($post->ID)) {
750
-        $post->ID = '';
751
-        $post->post_author = '';
752
-        $post->post_date = '';
753
-        $post->post_content = '';
754
-        $post->default_category = '';
755
-        $post->post_type = '';
756
-    }
757
-    setup_postdata($post);
748
+	// we need to define a few things to trick the setup_postdata
749
+	if (!isset($post->ID)) {
750
+		$post->ID = '';
751
+		$post->post_author = '';
752
+		$post->post_date = '';
753
+		$post->post_content = '';
754
+		$post->default_category = '';
755
+		$post->post_type = '';
756
+	}
757
+	setup_postdata($post);
758 758
 }
759 759
 
760 760
 /**
@@ -766,15 +766,15 @@  discard block
 block discarded – undo
766 766
  */
767 767
 function geodir_action_geodir_preview_code()
768 768
 {
769
-    global $preview;
769
+	global $preview;
770 770
 
771
-    $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
771
+	$is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
772 772
 
773
-    if (!$preview || $is_backend_preview) {
774
-        return;
775
-    }// bail if not previewing
773
+	if (!$preview || $is_backend_preview) {
774
+		return;
775
+	}// bail if not previewing
776 776
 
777
-    geodir_get_template_part('preview', 'buttons');
777
+	geodir_get_template_part('preview', 'buttons');
778 778
 }
779 779
 
780 780
 // action for adding the details page top widget area
@@ -790,20 +790,20 @@  discard block
 block discarded – undo
790 790
  */
791 791
 function geodir_action_geodir_sidebar_detail_top($class = '')
792 792
 {
793
-    if (get_option('geodir_show_detail_top_section')) { ?>
793
+	if (get_option('geodir_show_detail_top_section')) { ?>
794 794
         <div
795 795
             class="<?php
796
-            /**
797
-             * Filter the div class for the wrapper of the full width widget areas.
798
-             *
799
-             * Allows you to filter the class of the div for the HTML Container wrapper for the full width widget areas referred to as "Top Section" or "Bottom Section" in the widget areas.
800
-             *
801
-             * @since 1.0.0
802
-             * @param string $class The class of the div.
803
-             * @param string $type The page type the widget area is being used on. Values can be 'geodir_detail_top', 'geodir_detail_bottom', 'geodir_listing_top', 'geodir_listing_bottom', 'Reg/Login Top Section',
804
-             *               'geodir_author_top','geodir_author_bottom', 'geodir_search_top', 'geodir_search_bottom', 'geodir_home_top' or 'geodir_home_bottom'.
805
-             */
806
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_top'); ?> <?php echo $class; ?>">
796
+			/**
797
+			 * Filter the div class for the wrapper of the full width widget areas.
798
+			 *
799
+			 * Allows you to filter the class of the div for the HTML Container wrapper for the full width widget areas referred to as "Top Section" or "Bottom Section" in the widget areas.
800
+			 *
801
+			 * @since 1.0.0
802
+			 * @param string $class The class of the div.
803
+			 * @param string $type The page type the widget area is being used on. Values can be 'geodir_detail_top', 'geodir_detail_bottom', 'geodir_listing_top', 'geodir_listing_bottom', 'Reg/Login Top Section',
804
+			 *               'geodir_author_top','geodir_author_bottom', 'geodir_search_top', 'geodir_search_bottom', 'geodir_home_top' or 'geodir_home_bottom'.
805
+			 */
806
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_top'); ?> <?php echo $class; ?>">
807 807
             <?php dynamic_sidebar('geodir_detail_top'); ?>
808 808
         </div>
809 809
     <?php }
@@ -827,11 +827,11 @@  discard block
 block discarded – undo
827 827
  */
828 828
 function geodir_action_geodir_sidebar_detail_bottom_section($class = '')
829 829
 {
830
-    if (get_option('geodir_show_detail_bottom_section')) { ?>
830
+	if (get_option('geodir_show_detail_bottom_section')) { ?>
831 831
         <div
832 832
             class="<?php
833
-            /** This action is documented in geodirectory_template_actions.php */
834
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_bottom'); ?> <?php echo $class; ?>">
833
+			/** This action is documented in geodirectory_template_actions.php */
834
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_detail_bottom'); ?> <?php echo $class; ?>">
835 835
             <?php dynamic_sidebar('geodir_detail_bottom'); ?>
836 836
         </div><!-- clearfix ends here-->
837 837
     <?php }
@@ -845,7 +845,7 @@  discard block
 block discarded – undo
845 845
  */
846 846
 function geodir_details_sidebar_widget_area()
847 847
 {
848
-    dynamic_sidebar('geodir_detail_sidebar');
848
+	dynamic_sidebar('geodir_detail_sidebar');
849 849
 }
850 850
 
851 851
 /**
@@ -856,12 +856,12 @@  discard block
 block discarded – undo
856 856
  */
857 857
 function geodir_details_sidebar_place_details()
858 858
 {
859
-    /**
860
-     * Used to add items to the details page sidebar.
861
-     *
862
-     * @since 1.0.0
863
-     */
864
-    do_action('geodir_detail_page_sidebar');
859
+	/**
860
+	 * Used to add items to the details page sidebar.
861
+	 *
862
+	 * @since 1.0.0
863
+	 */
864
+	do_action('geodir_detail_page_sidebar');
865 865
 }
866 866
 
867 867
 add_action('geodir_detail_sidebar_inside', 'geodir_details_sidebar_place_details', 10);
@@ -876,68 +876,68 @@  discard block
 block discarded – undo
876 876
  */
877 877
 function geodir_action_details_sidebar()
878 878
 {
879
-    // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
880
-    if (get_option('geodir_detail_sidebar_left_section')) {
881
-        /**
882
-         * Called before the details page left sidebar is opened.
883
-         *
884
-         * This is used to add opening wrapper HTML to the details page left sidebar.
885
-         *
886
-         * @since 1.0.0
887
-         * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
888
-         * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-left'.
889
-         * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-left geodir-details-sidebar-left'.
890
-         * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'.
891
-         */
892
-        do_action('geodir_sidebar_left_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-left geodir-details-sidebar-left', 'http://schema.org/WPSideBar');
893
-        ?>
879
+	// this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
880
+	if (get_option('geodir_detail_sidebar_left_section')) {
881
+		/**
882
+		 * Called before the details page left sidebar is opened.
883
+		 *
884
+		 * This is used to add opening wrapper HTML to the details page left sidebar.
885
+		 *
886
+		 * @since 1.0.0
887
+		 * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
888
+		 * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-left'.
889
+		 * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-left geodir-details-sidebar-left'.
890
+		 * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'.
891
+		 */
892
+		do_action('geodir_sidebar_left_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-left geodir-details-sidebar-left', 'http://schema.org/WPSideBar');
893
+		?>
894 894
         <div class="geodir-content-left geodir-sidebar-wrap"><?php
895
-        /**
896
-         * Called inside the HTML wrapper of the details sidebar for either the left and right sidebar.
897
-         *
898
-         * This is used to add all info to the details page sidebars.
899
-         *
900
-         * @since 1.0.0
901
-         */
902
-        do_action('geodir_detail_sidebar_inside');
903
-        ?></div><!-- end geodir-content-left --><?php
904
-        /**
905
-         * Called after the details page left sidebar.
906
-         *
907
-         * This is used to add closing wrapper HTML to the details page left sidebar.
908
-         *
909
-         * @since 1.0.0
910
-         * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
911
-         */
912
-        do_action('geodir_sidebar_left_close', 'details-page');
913
-    } else {
914
-        /**
915
-         * Called before the details page right sidebar is opened.
916
-         *
917
-         * This is used to add opening wrapper HTML to the details page right sidebar.
918
-         *
919
-         * @since 1.0.0
920
-         * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'add-listing-page', 'author-page', 'search-page' or 'home-page'.
921
-         * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-right'.
922
-         * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-right geodir-details-sidebar-right'.
923
-         * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'.
924
-         */
925
-        do_action('geodir_sidebar_right_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-right geodir-details-sidebar-right', 'http://schema.org/WPSideBar');
926
-        ?>
895
+		/**
896
+		 * Called inside the HTML wrapper of the details sidebar for either the left and right sidebar.
897
+		 *
898
+		 * This is used to add all info to the details page sidebars.
899
+		 *
900
+		 * @since 1.0.0
901
+		 */
902
+		do_action('geodir_detail_sidebar_inside');
903
+		?></div><!-- end geodir-content-left --><?php
904
+		/**
905
+		 * Called after the details page left sidebar.
906
+		 *
907
+		 * This is used to add closing wrapper HTML to the details page left sidebar.
908
+		 *
909
+		 * @since 1.0.0
910
+		 * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
911
+		 */
912
+		do_action('geodir_sidebar_left_close', 'details-page');
913
+	} else {
914
+		/**
915
+		 * Called before the details page right sidebar is opened.
916
+		 *
917
+		 * This is used to add opening wrapper HTML to the details page right sidebar.
918
+		 *
919
+		 * @since 1.0.0
920
+		 * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'add-listing-page', 'author-page', 'search-page' or 'home-page'.
921
+		 * @param string $id Usually the ID of the sidebar wrapper. Values can be 'geodir-sidebar' or 'geodir-sidebar-right'.
922
+		 * @param string $class The class of the sidebar wrapper. 'geodir-sidebar-right geodir-details-sidebar-right'.
923
+		 * @param string $itemtype HTML itemtype 'http://schema.org/WPSideBar'.
924
+		 */
925
+		do_action('geodir_sidebar_right_open', 'details-page', 'geodir-sidebar', 'geodir-sidebar-right geodir-details-sidebar-right', 'http://schema.org/WPSideBar');
926
+		?>
927 927
         <div class="geodir-content-right geodir-sidebar-wrap"><?php
928
-        /** This action is documented in geodirectory_template_actions.php */
929
-        do_action('geodir_detail_sidebar_inside');
930
-        ?></div><!-- end geodir-content-right --><?php
931
-        /**
932
-         * Called after the details page right sidebar.
933
-         *
934
-         * This is used to add closing wrapper HTML to the details page right sidebar.
935
-         *
936
-         * @since 1.0.0
937
-         * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
938
-         */
939
-        do_action('geodir_sidebar_right_close', 'details-page');
940
-    }
928
+		/** This action is documented in geodirectory_template_actions.php */
929
+		do_action('geodir_detail_sidebar_inside');
930
+		?></div><!-- end geodir-content-right --><?php
931
+		/**
932
+		 * Called after the details page right sidebar.
933
+		 *
934
+		 * This is used to add closing wrapper HTML to the details page right sidebar.
935
+		 *
936
+		 * @since 1.0.0
937
+		 * @param string $type The current page type. Values can be 'details-page', 'listings-page', 'author-page', 'search-page' or 'home-page'.
938
+		 */
939
+		do_action('geodir_sidebar_right_close', 'details-page');
940
+	}
941 941
 }
942 942
 
943 943
 add_action('geodir_page_title', 'geodir_action_page_title', 10);
@@ -951,21 +951,21 @@  discard block
 block discarded – undo
951 951
  */
952 952
 function geodir_action_page_title()
953 953
 {
954
-    /**
955
-     * Filter the page title HTML h1 class.
956
-     *
957
-     * @since 1.0.0
958
-     * @param string $class The class to use. Default is 'entry-title fn'.
959
-     */
960
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
961
-    /**
962
-     * Filter the page title HTML header wrapper class.
963
-     *
964
-     * @since 1.0.0
965
-     * @param string $class The class to use. Default is 'entry-header'.
966
-     */
967
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
968
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . stripslashes(get_the_title()) . '</h1></header>';
954
+	/**
955
+	 * Filter the page title HTML h1 class.
956
+	 *
957
+	 * @since 1.0.0
958
+	 * @param string $class The class to use. Default is 'entry-title fn'.
959
+	 */
960
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
961
+	/**
962
+	 * Filter the page title HTML header wrapper class.
963
+	 *
964
+	 * @since 1.0.0
965
+	 * @param string $class The class to use. Default is 'entry-header'.
966
+	 */
967
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
968
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . stripslashes(get_the_title()) . '</h1></header>';
969 969
 }
970 970
 
971 971
 
@@ -982,87 +982,87 @@  discard block
 block discarded – undo
982 982
  */
983 983
 function geodir_action_details_slider()
984 984
 {
985
-    global $preview, $post;
985
+	global $preview, $post;
986 986
 
987
-    $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // preview from backend
987
+	$is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // preview from backend
988 988
 
989
-    if ($is_backend_preview && !empty($post) && !empty($post->ID) && !isset($post->post_images)) {
990
-        $preview_get_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
989
+	if ($is_backend_preview && !empty($post) && !empty($post->ID) && !isset($post->post_images)) {
990
+		$preview_get_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
991 991
 
992
-        $preview_post_images = array();
993
-        if ($preview_get_images) {
994
-            foreach ($preview_get_images as $row) {
995
-                $preview_post_images[] = $row->src;
996
-            }
997
-        }
998
-        if (!empty($preview_post_images)) {
999
-            $post->post_images = implode(',', $preview_post_images);
1000
-        }
1001
-    }
1002
-
1003
-    if ($preview) {
1004
-        $post_images = array();
1005
-        if (isset($post->post_images) && !empty($post->post_images)) {
1006
-            $post->post_images = trim($post->post_images, ",");
1007
-            $post_images = explode(",", $post->post_images);
1008
-        }
1009
-
1010
-        $main_slides = '';
1011
-        $nav_slides = '';
1012
-        $slides = 0;
1013
-
1014
-        if (!empty($post_images)) {
1015
-            foreach ($post_images as $image) {
1016
-                if (!empty($image)) {
1017
-                    $sizes = getimagesize(trim($image));
1018
-                    $width = !empty($sizes) && isset($sizes[0]) ? $sizes[0] : 0;
1019
-                    $height = !empty($sizes) && isset($sizes[1]) ? $sizes[1] : 0;
1020
-
1021
-                    if ($image && $width && $height) {
1022
-                        $image = (object)array('src' => $image, 'width' => $width, 'height' => $height);
1023
-                    }
1024
-
1025
-                    if (isset($image->src)) {
1026
-                        if ($image->height >= 400) {
1027
-                            $spacer_height = 0;
1028
-                        } else {
1029
-                            $spacer_height = ((400 - $image->height) / 2);
1030
-                        }
1031
-
1032
-                        $image_title = isset($image->title) ? $image->title : '';
1033
-
1034
-                        $main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />';
1035
-                        $main_slides .= '<img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:400px;margin:0 auto;" /></li>';
1036
-                        $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:48px;margin:0 auto;" /></li>';
1037
-                        $slides++;
1038
-                    }
1039
-                }
1040
-            }// endfore
1041
-        } //end if
1042
-    } else {
1043
-        $main_slides = '';
1044
-        $nav_slides = '';
1045
-        $post_images = geodir_get_images($post->ID, 'thumbnail', false); // Hide default image on listing preview/detail page.
1046
-        $slides = 0;
1047
-
1048
-        if (!empty($post_images)) {
1049
-            foreach ($post_images as $image) {
1050
-                if ($image->height >= 400) {
1051
-                    $spacer_height = 0;
1052
-                } else {
1053
-                    $spacer_height = ((400 - $image->height) / 2);
1054
-                }
1055
-                $caption = '';//(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : '';
1056
-                $main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />';
1057
-                $main_slides .= '<img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>';
1058
-                $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:48px;margin:0 auto;" /></li>';
1059
-                $slides++;
1060
-            }
1061
-        }// endfore
1062
-    }
992
+		$preview_post_images = array();
993
+		if ($preview_get_images) {
994
+			foreach ($preview_get_images as $row) {
995
+				$preview_post_images[] = $row->src;
996
+			}
997
+		}
998
+		if (!empty($preview_post_images)) {
999
+			$post->post_images = implode(',', $preview_post_images);
1000
+		}
1001
+	}
1002
+
1003
+	if ($preview) {
1004
+		$post_images = array();
1005
+		if (isset($post->post_images) && !empty($post->post_images)) {
1006
+			$post->post_images = trim($post->post_images, ",");
1007
+			$post_images = explode(",", $post->post_images);
1008
+		}
1009
+
1010
+		$main_slides = '';
1011
+		$nav_slides = '';
1012
+		$slides = 0;
1013
+
1014
+		if (!empty($post_images)) {
1015
+			foreach ($post_images as $image) {
1016
+				if (!empty($image)) {
1017
+					$sizes = getimagesize(trim($image));
1018
+					$width = !empty($sizes) && isset($sizes[0]) ? $sizes[0] : 0;
1019
+					$height = !empty($sizes) && isset($sizes[1]) ? $sizes[1] : 0;
1020
+
1021
+					if ($image && $width && $height) {
1022
+						$image = (object)array('src' => $image, 'width' => $width, 'height' => $height);
1023
+					}
1024
+
1025
+					if (isset($image->src)) {
1026
+						if ($image->height >= 400) {
1027
+							$spacer_height = 0;
1028
+						} else {
1029
+							$spacer_height = ((400 - $image->height) / 2);
1030
+						}
1031
+
1032
+						$image_title = isset($image->title) ? $image->title : '';
1033
+
1034
+						$main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />';
1035
+						$main_slides .= '<img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:400px;margin:0 auto;" /></li>';
1036
+						$nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:48px;margin:0 auto;" /></li>';
1037
+						$slides++;
1038
+					}
1039
+				}
1040
+			}// endfore
1041
+		} //end if
1042
+	} else {
1043
+		$main_slides = '';
1044
+		$nav_slides = '';
1045
+		$post_images = geodir_get_images($post->ID, 'thumbnail', false); // Hide default image on listing preview/detail page.
1046
+		$slides = 0;
1047
+
1048
+		if (!empty($post_images)) {
1049
+			foreach ($post_images as $image) {
1050
+				if ($image->height >= 400) {
1051
+					$spacer_height = 0;
1052
+				} else {
1053
+					$spacer_height = ((400 - $image->height) / 2);
1054
+				}
1055
+				$caption = '';//(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : '';
1056
+				$main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />';
1057
+				$main_slides .= '<img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>';
1058
+				$nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:48px;margin:0 auto;" /></li>';
1059
+				$slides++;
1060
+			}
1061
+		}// endfore
1062
+	}
1063 1063
 
1064
-    if (!empty($post_images)) {
1065
-        ?>
1064
+	if (!empty($post_images)) {
1065
+		?>
1066 1066
         <div class="geodir_flex-container">
1067 1067
             <div class="geodir_flex-loader"><i class="fa fa-refresh fa-spin"></i></div>
1068 1068
             <div id="geodir_slider" class="geodir_flexslider ">
@@ -1075,7 +1075,7 @@  discard block
 block discarded – undo
1075 1075
             <?php } ?>
1076 1076
         </div>
1077 1077
     <?php
1078
-    }
1078
+	}
1079 1079
 }
1080 1080
 
1081 1081
 add_action('geodir_details_taxonomies', 'geodir_action_details_taxonomies', 10);
@@ -1090,177 +1090,177 @@  discard block
 block discarded – undo
1090 1090
  */
1091 1091
 function geodir_action_details_taxonomies()
1092 1092
 {
1093
-    global $preview, $post;?>
1093
+	global $preview, $post;?>
1094 1094
     <p class="geodir_post_taxomomies clearfix">
1095 1095
     <?php
1096
-    $taxonomies = array();
1097
-
1098
-    $is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
1099
-
1100
-    if ($preview && !$is_backend_preview) {
1101
-        $post_type = $post->listing_type;
1102
-        $post_taxonomy = $post_type . 'category';
1103
-        $post->{$post_taxonomy} = $post->post_category[$post_taxonomy];
1104
-    } else {
1105
-        $post_type = $post->post_type;
1106
-        $post_taxonomy = $post_type . 'category';
1107
-    }
1096
+	$taxonomies = array();
1097
+
1098
+	$is_backend_preview = (is_single() && !empty($_REQUEST['post_type']) && !empty($_REQUEST['preview']) && !empty($_REQUEST['p'])) && is_super_admin() ? true : false; // skip if preview from backend
1099
+
1100
+	if ($preview && !$is_backend_preview) {
1101
+		$post_type = $post->listing_type;
1102
+		$post_taxonomy = $post_type . 'category';
1103
+		$post->{$post_taxonomy} = $post->post_category[$post_taxonomy];
1104
+	} else {
1105
+		$post_type = $post->post_type;
1106
+		$post_taxonomy = $post_type . 'category';
1107
+	}
1108 1108
 //{	
1109
-    $post_type_info = get_post_type_object($post_type);
1110
-    $listing_label = __($post_type_info->labels->singular_name, 'geodirectory');
1111
-
1112
-    if (!empty($post->post_tags)) {
1113
-
1114
-        if (taxonomy_exists($post_type . '_tags')):
1115
-            $links = array();
1116
-            $terms = array();
1117
-            // to limit post tags
1118
-            $post_tags = trim($post->post_tags, ",");
1119
-            $post_id = isset($post->ID) ? $post->ID : '';
1120
-            /**
1121
-             * Filter the post tags.
1122
-             *
1123
-             * Allows you to filter the post tags output on the details page of a post.
1124
-             *
1125
-             * @since 1.0.0
1126
-             * @param string $post_tags A comma seperated list of tags.
1127
-             * @param int $post_id The current post id.
1128
-             */
1129
-            $post_tags = apply_filters('geodir_action_details_post_tags', $post_tags, $post_id);
1130
-
1131
-            $post->post_tags = $post_tags;
1132
-            $post_tags = explode(",", trim($post->post_tags, ","));
1133
-
1134
-
1135
-            foreach ($post_tags as $post_term) {
1136
-
1137
-                // fix slug creation order for tags & location
1138
-                $post_term = trim($post_term);
1139
-
1140
-                $priority_location = false;
1141
-                if ($insert_term = term_exists($post_term, $post_type . '_tags')) {
1142
-                    $term = get_term_by('id', $insert_term['term_id'], $post_type . '_tags');
1143
-                } else {
1144
-                    $post_country = isset($_REQUEST['post_country']) && $_REQUEST['post_country'] != '' ? sanitize_text_field($_REQUEST['post_country']) : NULL;
1145
-                    $post_region = isset($_REQUEST['post_region']) && $_REQUEST['post_region'] != '' ? sanitize_text_field($_REQUEST['post_region']) : NULL;
1146
-                    $post_city = isset($_REQUEST['post_city']) && $_REQUEST['post_city'] != '' ? sanitize_text_field($_REQUEST['post_city']) : NULL;
1147
-                    $match_country = $post_country && sanitize_title($post_term) == sanitize_title($post_country) ? true : false;
1148
-                    $match_region = $post_region && sanitize_title($post_term) == sanitize_title($post_region) ? true : false;
1149
-                    $match_city = $post_city && sanitize_title($post_term) == sanitize_title($post_city) ? true : false;
1150
-                    if ($match_country || $match_region || $match_city) {
1151
-                        $priority_location = true;
1152
-                        $term = get_term_by('name', $post_term, $post_type . '_tags');
1153
-                    } else {
1154
-                        $insert_term = wp_insert_term($post_term, $post_type . '_tags');
1155
-                        $term = get_term_by('name', $post_term, $post_type . '_tags');
1156
-                    }
1157
-                }
1158
-
1159
-                if (!is_wp_error($term) && is_object($term)) {
1160
-
1161
-                    // fix tag link on detail page
1162
-                    if ($priority_location) {
1163
-
1164
-                        $tag_link = "<a href=''>$post_term</a>";
1165
-                        /**
1166
-                         * Filter the tag name on the details page.
1167
-                         *
1168
-                         * @since 1.5.6
1169
-                         * @param string $tag_link The tag link html.
1170
-                         * @param object $term The tag term object.
1171
-                         */
1172
-                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1173
-                        $links[] = $tag_link;
1174
-                    } else {
1175
-                        $tag_link = "<a href='" . esc_attr(get_term_link($term->term_id, $term->taxonomy)) . "'>$term->name</a>";
1176
-                        /** This action is documented in geodirectory-template_actions.php */
1177
-                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1178
-                        $links[] = $tag_link;
1179
-                    }
1180
-                    $terms[] = $term;
1181
-                }
1182
-                //
1183
-            }
1184
-            if (!isset($listing_label)) {
1185
-                $listing_label = '';
1186
-            }
1187
-            $taxonomies[$post_type . '_tags'] = wp_sprintf(__('%s Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1188
-        endif;
1189
-
1190
-    }
1191
-
1192
-    if (!empty($post->{$post_taxonomy})) {
1193
-        $links = array();
1194
-        $terms = array();
1195
-        $termsOrdered = array();
1196
-        if (!is_array($post->{$post_taxonomy})) {
1197
-            $post_term = explode(",", trim($post->{$post_taxonomy}, ","));
1198
-        } else {
1199
-            $post_term = $post->{$post_taxonomy};
1109
+	$post_type_info = get_post_type_object($post_type);
1110
+	$listing_label = __($post_type_info->labels->singular_name, 'geodirectory');
1111
+
1112
+	if (!empty($post->post_tags)) {
1113
+
1114
+		if (taxonomy_exists($post_type . '_tags')):
1115
+			$links = array();
1116
+			$terms = array();
1117
+			// to limit post tags
1118
+			$post_tags = trim($post->post_tags, ",");
1119
+			$post_id = isset($post->ID) ? $post->ID : '';
1120
+			/**
1121
+			 * Filter the post tags.
1122
+			 *
1123
+			 * Allows you to filter the post tags output on the details page of a post.
1124
+			 *
1125
+			 * @since 1.0.0
1126
+			 * @param string $post_tags A comma seperated list of tags.
1127
+			 * @param int $post_id The current post id.
1128
+			 */
1129
+			$post_tags = apply_filters('geodir_action_details_post_tags', $post_tags, $post_id);
1130
+
1131
+			$post->post_tags = $post_tags;
1132
+			$post_tags = explode(",", trim($post->post_tags, ","));
1133
+
1134
+
1135
+			foreach ($post_tags as $post_term) {
1136
+
1137
+				// fix slug creation order for tags & location
1138
+				$post_term = trim($post_term);
1139
+
1140
+				$priority_location = false;
1141
+				if ($insert_term = term_exists($post_term, $post_type . '_tags')) {
1142
+					$term = get_term_by('id', $insert_term['term_id'], $post_type . '_tags');
1143
+				} else {
1144
+					$post_country = isset($_REQUEST['post_country']) && $_REQUEST['post_country'] != '' ? sanitize_text_field($_REQUEST['post_country']) : NULL;
1145
+					$post_region = isset($_REQUEST['post_region']) && $_REQUEST['post_region'] != '' ? sanitize_text_field($_REQUEST['post_region']) : NULL;
1146
+					$post_city = isset($_REQUEST['post_city']) && $_REQUEST['post_city'] != '' ? sanitize_text_field($_REQUEST['post_city']) : NULL;
1147
+					$match_country = $post_country && sanitize_title($post_term) == sanitize_title($post_country) ? true : false;
1148
+					$match_region = $post_region && sanitize_title($post_term) == sanitize_title($post_region) ? true : false;
1149
+					$match_city = $post_city && sanitize_title($post_term) == sanitize_title($post_city) ? true : false;
1150
+					if ($match_country || $match_region || $match_city) {
1151
+						$priority_location = true;
1152
+						$term = get_term_by('name', $post_term, $post_type . '_tags');
1153
+					} else {
1154
+						$insert_term = wp_insert_term($post_term, $post_type . '_tags');
1155
+						$term = get_term_by('name', $post_term, $post_type . '_tags');
1156
+					}
1157
+				}
1158
+
1159
+				if (!is_wp_error($term) && is_object($term)) {
1160
+
1161
+					// fix tag link on detail page
1162
+					if ($priority_location) {
1163
+
1164
+						$tag_link = "<a href=''>$post_term</a>";
1165
+						/**
1166
+						 * Filter the tag name on the details page.
1167
+						 *
1168
+						 * @since 1.5.6
1169
+						 * @param string $tag_link The tag link html.
1170
+						 * @param object $term The tag term object.
1171
+						 */
1172
+						$tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1173
+						$links[] = $tag_link;
1174
+					} else {
1175
+						$tag_link = "<a href='" . esc_attr(get_term_link($term->term_id, $term->taxonomy)) . "'>$term->name</a>";
1176
+						/** This action is documented in geodirectory-template_actions.php */
1177
+						$tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1178
+						$links[] = $tag_link;
1179
+					}
1180
+					$terms[] = $term;
1181
+				}
1182
+				//
1183
+			}
1184
+			if (!isset($listing_label)) {
1185
+				$listing_label = '';
1186
+			}
1187
+			$taxonomies[$post_type . '_tags'] = wp_sprintf(__('%s Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1188
+		endif;
1189
+
1190
+	}
1191
+
1192
+	if (!empty($post->{$post_taxonomy})) {
1193
+		$links = array();
1194
+		$terms = array();
1195
+		$termsOrdered = array();
1196
+		if (!is_array($post->{$post_taxonomy})) {
1197
+			$post_term = explode(",", trim($post->{$post_taxonomy}, ","));
1198
+		} else {
1199
+			$post_term = $post->{$post_taxonomy};
1200 1200
 			
1201 1201
 			if ($preview && !$is_backend_preview) {
1202 1202
 				$post_term = geodir_add_parent_terms($post_term, $post_taxonomy);
1203 1203
 			}
1204
-        }
1205
-
1206
-        $post_term = array_unique($post_term);
1207
-        if (!empty($post_term)) {
1208
-            foreach ($post_term as $post_term) {
1209
-                $post_term = trim($post_term);
1210
-
1211
-                if ($post_term != ''):
1212
-                    $term = get_term_by('id', $post_term, $post_taxonomy);
1213
-
1214
-                    if (is_object($term)) {
1215
-                        $term_link = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>$term->name</a>";
1216
-                        /**
1217
-                         * Filter the category name on the details page.
1218
-                         *
1219
-                         * @since 1.5.6
1220
-                         * @param string $term_link The link html to the category.
1221
-                         * @param object $term The category term object.
1222
-                         */
1223
-                        $term_link = apply_filters('geodir_details_taxonomies_cat_link',$term_link,$term);
1224
-                        $links[] = $term_link;
1225
-                        $terms[] = $term;
1226
-                    }
1227
-                endif;
1228
-            }
1229
-            // order alphabetically
1230
-            asort($links);
1231
-            foreach (array_keys($links) as $key) {
1232
-                $termsOrdered[$key] = $terms[$key];
1233
-            }
1234
-            $terms = $termsOrdered;
1204
+		}
1205
+
1206
+		$post_term = array_unique($post_term);
1207
+		if (!empty($post_term)) {
1208
+			foreach ($post_term as $post_term) {
1209
+				$post_term = trim($post_term);
1210
+
1211
+				if ($post_term != ''):
1212
+					$term = get_term_by('id', $post_term, $post_taxonomy);
1213
+
1214
+					if (is_object($term)) {
1215
+						$term_link = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>$term->name</a>";
1216
+						/**
1217
+						 * Filter the category name on the details page.
1218
+						 *
1219
+						 * @since 1.5.6
1220
+						 * @param string $term_link The link html to the category.
1221
+						 * @param object $term The category term object.
1222
+						 */
1223
+						$term_link = apply_filters('geodir_details_taxonomies_cat_link',$term_link,$term);
1224
+						$links[] = $term_link;
1225
+						$terms[] = $term;
1226
+					}
1227
+				endif;
1228
+			}
1229
+			// order alphabetically
1230
+			asort($links);
1231
+			foreach (array_keys($links) as $key) {
1232
+				$termsOrdered[$key] = $terms[$key];
1233
+			}
1234
+			$terms = $termsOrdered;
1235 1235
 
1236
-        }
1236
+		}
1237 1237
 
1238
-        if (!isset($listing_label)) {
1239
-            $listing_label = '';
1240
-        }
1241
-        $taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1238
+		if (!isset($listing_label)) {
1239
+			$listing_label = '';
1240
+		}
1241
+		$taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1242 1242
 
1243
-    }
1243
+	}
1244 1244
 
1245
-    /**
1246
-     * Filter the taxonomies array before output.
1247
-     *
1248
-     * @since 1.5.9
1249
-     * @param array $taxonomies The array of cats and tags.
1250
-     * @param string $post_type The post type being output.
1251
-     * @param string $listing_label The post type label.
1252
-     * @param string $listing_label The post type label with ucwords function.
1253
-     */
1254
-    $taxonomies = apply_filters('geodir_details_taxonomies_output',$taxonomies,$post_type,$listing_label,geodir_ucwords($listing_label));
1245
+	/**
1246
+	 * Filter the taxonomies array before output.
1247
+	 *
1248
+	 * @since 1.5.9
1249
+	 * @param array $taxonomies The array of cats and tags.
1250
+	 * @param string $post_type The post type being output.
1251
+	 * @param string $listing_label The post type label.
1252
+	 * @param string $listing_label The post type label with ucwords function.
1253
+	 */
1254
+	$taxonomies = apply_filters('geodir_details_taxonomies_output',$taxonomies,$post_type,$listing_label,geodir_ucwords($listing_label));
1255 1255
 
1256
-    if (isset($taxonomies[$post_taxonomy])) {
1257
-        echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>';
1258
-    }
1256
+	if (isset($taxonomies[$post_taxonomy])) {
1257
+		echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>';
1258
+	}
1259 1259
 
1260
-    if (isset($taxonomies[$post_type . '_tags']))
1261
-        echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>';
1260
+	if (isset($taxonomies[$post_type . '_tags']))
1261
+		echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>';
1262 1262
 
1263
-    ?>
1263
+	?>
1264 1264
     </p><?php
1265 1265
 }
1266 1266
 
@@ -1282,127 +1282,127 @@  discard block
 block discarded – undo
1282 1282
 function geodir_action_details_micordata($post='')
1283 1283
 {
1284 1284
 
1285
-    global $preview;
1286
-    if(empty($post)){global $post;}
1287
-    if ($preview || !geodir_is_page('detail')) {
1288
-        return;
1289
-    }
1290
-
1291
-    // url
1292
-    $c_url = geodir_curPageURL();
1293
-
1294
-    // post reviews
1295
-    $post_reviews = get_comments(array('post_id' => $post->ID, 'status' => 'approve'));
1296
-    if (empty($post_reviews)) {
1297
-        $reviews = '';
1298
-    } else {
1299
-        foreach ($post_reviews as $review) {
1300
-            $reviews[] = array(
1301
-                "@type" => "Review",
1302
-                "author" => $review->comment_author,
1303
-                "datePublished" => $review->comment_date,
1304
-                "description" => $review->comment_content,
1305
-                "reviewRating" => array(
1306
-                    "@type" => "Rating",
1307
-                    "bestRating" => "5",// @todo this will need to be filtered for review manager if user changes the score.
1308
-                    "ratingValue" => geodir_get_commentoverall($review->comment_ID),
1309
-                    "worstRating" => "1"
1310
-                )
1311
-            );
1312
-        }
1313
-
1314
-    }
1315
-
1316
-    // post images
1317
-    $post_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
1318
-    if (empty($post_images)) {
1319
-        $images = '';
1320
-    } else {
1321
-        $i_arr = array();
1322
-        foreach ($post_images as $img) {
1323
-            $i_arr[] = $img->src;
1324
-        }
1325
-
1326
-        if (count($i_arr) == 1) {
1327
-            $images = $i_arr[0];
1328
-        } else {
1329
-            $images = $i_arr;
1330
-        }
1331
-
1332
-    }
1333
-    //print_r($post);
1334
-    // external links
1335
-    $external_links =  array();
1336
-    $external_links[] = $post->geodir_website;
1337
-    $external_links[] = $post->geodir_twitter;
1338
-    $external_links[] = $post->geodir_facebook;
1339
-    $external_links = array_filter($external_links);
1340
-
1341
-    if(!empty($external_links)){
1342
-        $external_links = array_values($external_links);
1343
-    }
1344
-
1345
-    // reviews
1346
-    $comment_count = geodir_get_review_count_total($post->ID);
1347
-    $post_avgratings = geodir_get_post_rating($post->ID);
1348
-
1349
-    // schema type
1350
-    $schema_type = 'LocalBusiness';
1351
-    if(isset($post->default_category) && $post->default_category){
1352
-        $cat_schema = get_tax_meta($post->default_category, 'ct_cat_schema', false, $post->post_type);
1353
-        if($cat_schema){$schema_type = $cat_schema;}
1354
-        if(!$schema_type && $post->post_type=='gd_event'){$schema_type = 'Event';}
1355
-    }
1356
-
1357
-    $schema = array();
1358
-    $schema['@context'] = "http://schema.org";
1359
-    $schema['@type'] = $schema_type;
1360
-    $schema['name'] = $post->post_name;
1361
-    $schema['description'] = wp_strip_all_tags( $post->post_content, true );
1362
-    $schema['telephone'] = $post->geodir_contact;
1363
-    $schema['url'] = $c_url;
1364
-    $schema['sameAs'] = $external_links;
1365
-    $schema['image'] = $images;
1366
-    $schema['address'] = array(
1367
-        "@type" => "PostalAddress",
1368
-        "streetAddress" => $post->post_address,
1369
-        "addressLocality" => $post->post_city,
1370
-        "addressRegion" => $post->post_region,
1371
-        "addressCountry" => $post->post_country,
1372
-        "postalCode" => $post->post_zip
1373
-    );
1374
-
1375
-    if($post->post_latitude && $post->post_longitude) {
1376
-        $schema['geo'] = array(
1377
-            "@type" => "GeoCoordinates",
1378
-            "latitude" => $post->post_latitude,
1379
-            "longitude" => $post->post_longitude
1380
-        );
1381
-    }
1382
-
1383
-    if($post_avgratings) {
1384
-        $schema['aggregateRating'] = array(
1385
-            "@type" => "AggregateRating",
1386
-            "ratingValue" => $post_avgratings,
1387
-            "bestRating" => "5", // @todo this will need to be filtered for review manager if user changes the score.
1388
-            "worstRating" => "1",
1389
-            "ratingCount" => $comment_count
1390
-        );
1391
-    }
1392
-    $schema['review'] = $reviews;
1393
-
1394
-    /**
1395
-     * Allow the schema JSON-LD info to be filtered.
1396
-     *
1397
-     * @since 1.5.4
1398
-     * @since 1.5.7 Added $post variable.
1399
-     * @param array $schema The array of schema data to be filtered.
1400
-     * @param object $post The post object.
1401
-     */
1402
-    $schema = apply_filters('geodir_details_schema', $schema,$post);
1403
-
1404
-
1405
-    echo '<script type="application/ld+json">' . json_encode($schema) . '</script>';
1285
+	global $preview;
1286
+	if(empty($post)){global $post;}
1287
+	if ($preview || !geodir_is_page('detail')) {
1288
+		return;
1289
+	}
1290
+
1291
+	// url
1292
+	$c_url = geodir_curPageURL();
1293
+
1294
+	// post reviews
1295
+	$post_reviews = get_comments(array('post_id' => $post->ID, 'status' => 'approve'));
1296
+	if (empty($post_reviews)) {
1297
+		$reviews = '';
1298
+	} else {
1299
+		foreach ($post_reviews as $review) {
1300
+			$reviews[] = array(
1301
+				"@type" => "Review",
1302
+				"author" => $review->comment_author,
1303
+				"datePublished" => $review->comment_date,
1304
+				"description" => $review->comment_content,
1305
+				"reviewRating" => array(
1306
+					"@type" => "Rating",
1307
+					"bestRating" => "5",// @todo this will need to be filtered for review manager if user changes the score.
1308
+					"ratingValue" => geodir_get_commentoverall($review->comment_ID),
1309
+					"worstRating" => "1"
1310
+				)
1311
+			);
1312
+		}
1313
+
1314
+	}
1315
+
1316
+	// post images
1317
+	$post_images = geodir_get_images($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
1318
+	if (empty($post_images)) {
1319
+		$images = '';
1320
+	} else {
1321
+		$i_arr = array();
1322
+		foreach ($post_images as $img) {
1323
+			$i_arr[] = $img->src;
1324
+		}
1325
+
1326
+		if (count($i_arr) == 1) {
1327
+			$images = $i_arr[0];
1328
+		} else {
1329
+			$images = $i_arr;
1330
+		}
1331
+
1332
+	}
1333
+	//print_r($post);
1334
+	// external links
1335
+	$external_links =  array();
1336
+	$external_links[] = $post->geodir_website;
1337
+	$external_links[] = $post->geodir_twitter;
1338
+	$external_links[] = $post->geodir_facebook;
1339
+	$external_links = array_filter($external_links);
1340
+
1341
+	if(!empty($external_links)){
1342
+		$external_links = array_values($external_links);
1343
+	}
1344
+
1345
+	// reviews
1346
+	$comment_count = geodir_get_review_count_total($post->ID);
1347
+	$post_avgratings = geodir_get_post_rating($post->ID);
1348
+
1349
+	// schema type
1350
+	$schema_type = 'LocalBusiness';
1351
+	if(isset($post->default_category) && $post->default_category){
1352
+		$cat_schema = get_tax_meta($post->default_category, 'ct_cat_schema', false, $post->post_type);
1353
+		if($cat_schema){$schema_type = $cat_schema;}
1354
+		if(!$schema_type && $post->post_type=='gd_event'){$schema_type = 'Event';}
1355
+	}
1356
+
1357
+	$schema = array();
1358
+	$schema['@context'] = "http://schema.org";
1359
+	$schema['@type'] = $schema_type;
1360
+	$schema['name'] = $post->post_name;
1361
+	$schema['description'] = wp_strip_all_tags( $post->post_content, true );
1362
+	$schema['telephone'] = $post->geodir_contact;
1363
+	$schema['url'] = $c_url;
1364
+	$schema['sameAs'] = $external_links;
1365
+	$schema['image'] = $images;
1366
+	$schema['address'] = array(
1367
+		"@type" => "PostalAddress",
1368
+		"streetAddress" => $post->post_address,
1369
+		"addressLocality" => $post->post_city,
1370
+		"addressRegion" => $post->post_region,
1371
+		"addressCountry" => $post->post_country,
1372
+		"postalCode" => $post->post_zip
1373
+	);
1374
+
1375
+	if($post->post_latitude && $post->post_longitude) {
1376
+		$schema['geo'] = array(
1377
+			"@type" => "GeoCoordinates",
1378
+			"latitude" => $post->post_latitude,
1379
+			"longitude" => $post->post_longitude
1380
+		);
1381
+	}
1382
+
1383
+	if($post_avgratings) {
1384
+		$schema['aggregateRating'] = array(
1385
+			"@type" => "AggregateRating",
1386
+			"ratingValue" => $post_avgratings,
1387
+			"bestRating" => "5", // @todo this will need to be filtered for review manager if user changes the score.
1388
+			"worstRating" => "1",
1389
+			"ratingCount" => $comment_count
1390
+		);
1391
+	}
1392
+	$schema['review'] = $reviews;
1393
+
1394
+	/**
1395
+	 * Allow the schema JSON-LD info to be filtered.
1396
+	 *
1397
+	 * @since 1.5.4
1398
+	 * @since 1.5.7 Added $post variable.
1399
+	 * @param array $schema The array of schema data to be filtered.
1400
+	 * @param object $post The post object.
1401
+	 */
1402
+	$schema = apply_filters('geodir_details_schema', $schema,$post);
1403
+
1404
+
1405
+	echo '<script type="application/ld+json">' . json_encode($schema) . '</script>';
1406 1406
 
1407 1407
 }
1408 1408
 
@@ -1420,7 +1420,7 @@  discard block
 block discarded – undo
1420 1420
  */
1421 1421
 function geodir_action_details_next_prev()
1422 1422
 {
1423
-    ?>
1423
+	?>
1424 1424
     <div class="geodir-pos_navigation clearfix">
1425 1425
     <div
1426 1426
         class="geodir-post_left"><?php previous_post_link('%link', '' . __('Previous', 'geodirectory'), false) ?></div>
@@ -1438,15 +1438,15 @@  discard block
 block discarded – undo
1438 1438
  */
1439 1439
 function geodir_action_before_single_post()
1440 1440
 {
1441
-    global $post;
1442
-    /**
1443
-     * Called at the very start of the details page output, before the title section.
1444
-     *
1445
-     * @since 1.0.0
1446
-     * @param object $post The current post object.
1447
-     * @global WP_Post|null $post The current post, if available.
1448
-     */
1449
-    do_action('geodir_before_single_post', $post); // extra action	
1441
+	global $post;
1442
+	/**
1443
+	 * Called at the very start of the details page output, before the title section.
1444
+	 *
1445
+	 * @since 1.0.0
1446
+	 * @param object $post The current post object.
1447
+	 * @global WP_Post|null $post The current post, if available.
1448
+	 */
1449
+	do_action('geodir_before_single_post', $post); // extra action	
1450 1450
 }
1451 1451
 
1452 1452
 /**
@@ -1457,13 +1457,13 @@  discard block
 block discarded – undo
1457 1457
  */
1458 1458
 function geodir_action_after_single_post($post)
1459 1459
 {
1460
-    /**
1461
-     * Called on the details page after the details page tabs section and before the next/prev buttons.
1462
-     *
1463
-     * @since 1.0.0
1464
-     * @param object $post The current post object.
1465
-     */
1466
-    do_action('geodir_after_single_post', $post); // extra action	
1460
+	/**
1461
+	 * Called on the details page after the details page tabs section and before the next/prev buttons.
1462
+	 *
1463
+	 * @since 1.0.0
1464
+	 * @param object $post The current post object.
1465
+	 */
1466
+	do_action('geodir_after_single_post', $post); // extra action	
1467 1467
 }
1468 1468
 
1469 1469
 add_action('geodir_details_main_content', 'geodir_action_before_single_post', 10);
@@ -1489,167 +1489,167 @@  discard block
 block discarded – undo
1489 1489
  */
1490 1490
 function geodir_action_listings_title()
1491 1491
 {
1492
-    global $wp, $term;
1492
+	global $wp, $term;
1493 1493
 
1494
-    $gd_post_type = geodir_get_current_posttype();
1495
-    $post_type_info = get_post_type_object($gd_post_type);
1494
+	$gd_post_type = geodir_get_current_posttype();
1495
+	$post_type_info = get_post_type_object($gd_post_type);
1496 1496
 
1497
-    $add_string_in_title = __('All', 'geodirectory') . ' ';
1498
-    if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
1499
-        $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
1500
-    }
1497
+	$add_string_in_title = __('All', 'geodirectory') . ' ';
1498
+	if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
1499
+		$add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
1500
+	}
1501 1501
 
1502
-    $list_title = $add_string_in_title . __(ucfirst($post_type_info->labels->name), 'geodirectory');
1503
-    $single_name = $post_type_info->labels->singular_name;
1502
+	$list_title = $add_string_in_title . __(ucfirst($post_type_info->labels->name), 'geodirectory');
1503
+	$single_name = $post_type_info->labels->singular_name;
1504 1504
 
1505
-    $taxonomy = geodir_get_taxonomies($gd_post_type, true);
1505
+	$taxonomy = geodir_get_taxonomies($gd_post_type, true);
1506 1506
 
1507
-    $gd_country = get_query_var('gd_country');
1508
-    $gd_region = get_query_var('gd_region');
1509
-    $gd_city = get_query_var('gd_city');
1507
+	$gd_country = get_query_var('gd_country');
1508
+	$gd_region = get_query_var('gd_region');
1509
+	$gd_city = get_query_var('gd_city');
1510 1510
 
1511
-    if (!empty($term)) {
1512
-        $location_name = '';
1513
-        if ($gd_country != '' || $gd_region != '' || $gd_city != '') {
1514
-            if ($gd_country != '') {
1515
-                $location_name = geodir_sanitize_location_name('gd_country', $gd_country);
1516
-            }
1517
-
1518
-            if ($gd_region != '') {
1519
-                $location_name = geodir_sanitize_location_name('gd_region', $gd_region);
1520
-            }
1521
-
1522
-            if ($gd_city != '') {
1523
-                $location_name = geodir_sanitize_location_name('gd_city', $gd_city);
1524
-            }
1525
-        }
1526
-
1527
-        $current_term = get_term_by('slug', $term, $taxonomy[0]);
1528
-        if (!empty($current_term)) {
1529
-            $current_term_name = __(ucfirst($current_term->name), 'geodirectory');
1530
-            if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1531
-                $location_last_char = substr($location_name, -1);
1532
-                $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1533
-                $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1534
-            } else {
1535
-                $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1536
-            }
1537
-        } else {
1538
-            if (count($taxonomy) > 1) {
1539
-                $current_term = get_term_by('slug', $term, $taxonomy[1]);
1540
-
1541
-                if (!empty($current_term)) {
1542
-                    $current_term_name = __(ucfirst($current_term->name), 'geodirectory');
1543
-                    if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1544
-                        $location_last_char = substr($location_name, -1);
1545
-                        $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1546
-                        $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1547
-                    } else {
1548
-                        $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1549
-                    }
1550
-                }
1551
-            }
1552
-        }
1553
-
1554
-    } else {
1555
-        $gd_country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : '';
1556
-        $gd_region = (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') ? $wp->query_vars['gd_region'] : '';
1557
-        $gd_city = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : '';
1558
-
1559
-        $gd_country_actual = $gd_region_actual = $gd_city_actual = '';
1560
-
1561
-        if (function_exists('get_actual_location_name')) {
1562
-            $gd_country_actual = $gd_country != '' ? get_actual_location_name('country', $gd_country, true) : $gd_country;
1563
-            $gd_region_actual = $gd_region != '' ? get_actual_location_name('region', $gd_region) : $gd_region;
1564
-            $gd_city_actual = $gd_city != '' ? get_actual_location_name('city', $gd_city) : $gd_city;
1565
-        }
1566
-
1567
-        if ($gd_city != '') {
1568
-            if ($gd_city_actual != '') {
1569
-                $gd_city = $gd_city_actual;
1570
-            } else {
1571
-                $gd_city = preg_replace('/-(\d+)$/', '', $gd_city);
1572
-                $gd_city = preg_replace('/[_-]/', ' ', $gd_city);
1573
-                $gd_city = __(geodir_ucwords($gd_city), 'geodirectory');
1574
-            }
1575
-
1576
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_city . "'";
1577
-        } else if ($gd_region != '') {
1578
-            if ($gd_region_actual != '') {
1579
-                $gd_region = $gd_region_actual;
1580
-            } else {
1581
-                $gd_region = preg_replace('/-(\d+)$/', '', $gd_region);
1582
-                $gd_region = preg_replace('/[_-]/', ' ', $gd_region);
1583
-                $gd_region = __(geodir_ucwords($gd_region), 'geodirectory');
1584
-            }
1585
-
1586
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_region . "'";
1587
-        } else if ($gd_country != '') {
1588
-            if ($gd_country_actual != '') {
1589
-                $gd_country = $gd_country_actual;
1590
-            } else {
1591
-                $gd_country = preg_replace('/-(\d+)$/', '', $gd_country);
1592
-                $gd_country = preg_replace('/[_-]/', ' ', $gd_country);
1593
-                $gd_country = __(geodir_ucwords($gd_country), 'geodirectory');
1594
-            }
1595
-
1596
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_country . "'";
1597
-        }
1598
-    }
1599
-
1600
-    if (is_search()) {
1601
-        $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
1602
-    }
1603
-    /** This action is documented in geodirectory_template_actions.php */
1604
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
1605
-    /** This action is documented in geodirectory_template_actions.php */
1606
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
1607
-
1608
-
1609
-    $title = $list_title;
1610
-    if(geodir_is_page('pt')){
1611
-        $gd_page = 'pt';
1612
-        $title  = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
1613
-    }
1614
-    elseif(geodir_is_page('listing')){
1615
-        $gd_page = 'listing';
1616
-        global $wp_query;
1617
-        $current_term = $wp_query->get_queried_object();
1618
-        if (strpos($current_term->taxonomy,'_tags') !== false) {
1619
-            $title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
1620
-        }else{
1621
-            $title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
1622
-        }
1511
+	if (!empty($term)) {
1512
+		$location_name = '';
1513
+		if ($gd_country != '' || $gd_region != '' || $gd_city != '') {
1514
+			if ($gd_country != '') {
1515
+				$location_name = geodir_sanitize_location_name('gd_country', $gd_country);
1516
+			}
1623 1517
 
1624
-    }
1625
-    elseif(geodir_is_page('author')){
1626
-        $gd_page = 'author';
1627
-        if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
1628
-            $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
1629
-        }else{
1630
-            $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
1631
-        }
1518
+			if ($gd_region != '') {
1519
+				$location_name = geodir_sanitize_location_name('gd_region', $gd_region);
1520
+			}
1632 1521
 
1633
-    }
1522
+			if ($gd_city != '') {
1523
+				$location_name = geodir_sanitize_location_name('gd_city', $gd_city);
1524
+			}
1525
+		}
1526
+
1527
+		$current_term = get_term_by('slug', $term, $taxonomy[0]);
1528
+		if (!empty($current_term)) {
1529
+			$current_term_name = __(ucfirst($current_term->name), 'geodirectory');
1530
+			if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1531
+				$location_last_char = substr($location_name, -1);
1532
+				$location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1533
+				$list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1534
+			} else {
1535
+				$list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1536
+			}
1537
+		} else {
1538
+			if (count($taxonomy) > 1) {
1539
+				$current_term = get_term_by('slug', $term, $taxonomy[1]);
1540
+
1541
+				if (!empty($current_term)) {
1542
+					$current_term_name = __(ucfirst($current_term->name), 'geodirectory');
1543
+					if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1544
+						$location_last_char = substr($location_name, -1);
1545
+						$location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1546
+						$list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1547
+					} else {
1548
+						$list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1549
+					}
1550
+				}
1551
+			}
1552
+		}
1553
+
1554
+	} else {
1555
+		$gd_country = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : '';
1556
+		$gd_region = (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') ? $wp->query_vars['gd_region'] : '';
1557
+		$gd_city = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : '';
1558
+
1559
+		$gd_country_actual = $gd_region_actual = $gd_city_actual = '';
1560
+
1561
+		if (function_exists('get_actual_location_name')) {
1562
+			$gd_country_actual = $gd_country != '' ? get_actual_location_name('country', $gd_country, true) : $gd_country;
1563
+			$gd_region_actual = $gd_region != '' ? get_actual_location_name('region', $gd_region) : $gd_region;
1564
+			$gd_city_actual = $gd_city != '' ? get_actual_location_name('city', $gd_city) : $gd_city;
1565
+		}
1566
+
1567
+		if ($gd_city != '') {
1568
+			if ($gd_city_actual != '') {
1569
+				$gd_city = $gd_city_actual;
1570
+			} else {
1571
+				$gd_city = preg_replace('/-(\d+)$/', '', $gd_city);
1572
+				$gd_city = preg_replace('/[_-]/', ' ', $gd_city);
1573
+				$gd_city = __(geodir_ucwords($gd_city), 'geodirectory');
1574
+			}
1634 1575
 
1576
+			$list_title .= __(' in', 'geodirectory') . " '" . $gd_city . "'";
1577
+		} else if ($gd_region != '') {
1578
+			if ($gd_region_actual != '') {
1579
+				$gd_region = $gd_region_actual;
1580
+			} else {
1581
+				$gd_region = preg_replace('/-(\d+)$/', '', $gd_region);
1582
+				$gd_region = preg_replace('/[_-]/', ' ', $gd_region);
1583
+				$gd_region = __(geodir_ucwords($gd_region), 'geodirectory');
1584
+			}
1635 1585
 
1636
-    /**
1637
-     * Filter page title to replace variables.
1638
-     *
1639
-     * @since 1.5.4
1640
-     * @param string $title The page title including variables.
1641
-     * @param string $gd_page The GeoDirectory page type if any.
1642
-     */
1643
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
1586
+			$list_title .= __(' in', 'geodirectory') . " '" . $gd_region . "'";
1587
+		} else if ($gd_country != '') {
1588
+			if ($gd_country_actual != '') {
1589
+				$gd_country = $gd_country_actual;
1590
+			} else {
1591
+				$gd_country = preg_replace('/-(\d+)$/', '', $gd_country);
1592
+				$gd_country = preg_replace('/[_-]/', ' ', $gd_country);
1593
+				$gd_country = __(geodir_ucwords($gd_country), 'geodirectory');
1594
+			}
1644 1595
 
1645
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
1646
-        /**
1647
-         * Filter the listing page title.
1648
-         *
1649
-         * @since 1.0.0
1650
-         * @param string $list_title The title for the category page.
1651
-         */
1652
-        apply_filters('geodir_listing_page_title', $title) . '</h1></header>';
1596
+			$list_title .= __(' in', 'geodirectory') . " '" . $gd_country . "'";
1597
+		}
1598
+	}
1599
+
1600
+	if (is_search()) {
1601
+		$list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
1602
+	}
1603
+	/** This action is documented in geodirectory_template_actions.php */
1604
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
1605
+	/** This action is documented in geodirectory_template_actions.php */
1606
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
1607
+
1608
+
1609
+	$title = $list_title;
1610
+	if(geodir_is_page('pt')){
1611
+		$gd_page = 'pt';
1612
+		$title  = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
1613
+	}
1614
+	elseif(geodir_is_page('listing')){
1615
+		$gd_page = 'listing';
1616
+		global $wp_query;
1617
+		$current_term = $wp_query->get_queried_object();
1618
+		if (strpos($current_term->taxonomy,'_tags') !== false) {
1619
+			$title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
1620
+		}else{
1621
+			$title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
1622
+		}
1623
+
1624
+	}
1625
+	elseif(geodir_is_page('author')){
1626
+		$gd_page = 'author';
1627
+		if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
1628
+			$title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
1629
+		}else{
1630
+			$title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
1631
+		}
1632
+
1633
+	}
1634
+
1635
+
1636
+	/**
1637
+	 * Filter page title to replace variables.
1638
+	 *
1639
+	 * @since 1.5.4
1640
+	 * @param string $title The page title including variables.
1641
+	 * @param string $gd_page The GeoDirectory page type if any.
1642
+	 */
1643
+	$title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
1644
+
1645
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
1646
+		/**
1647
+		 * Filter the listing page title.
1648
+		 *
1649
+		 * @since 1.0.0
1650
+		 * @param string $list_title The title for the category page.
1651
+		 */
1652
+		apply_filters('geodir_listing_page_title', $title) . '</h1></header>';
1653 1653
 }
1654 1654
 
1655 1655
 add_action('geodir_listings_page_description', 'geodir_action_listings_description', 10);
@@ -1662,46 +1662,46 @@  discard block
 block discarded – undo
1662 1662
  */
1663 1663
 function geodir_action_listings_description()
1664 1664
 {
1665
-    global $wp_query;
1666
-    $current_term = $wp_query->get_queried_object();
1665
+	global $wp_query;
1666
+	$current_term = $wp_query->get_queried_object();
1667 1667
 
1668
-    $gd_post_type = geodir_get_current_posttype();
1669
-    if (isset($current_term->term_id) && $current_term->term_id != '') {
1668
+	$gd_post_type = geodir_get_current_posttype();
1669
+	if (isset($current_term->term_id) && $current_term->term_id != '') {
1670 1670
 
1671
-        $term_desc = term_description($current_term->term_id, $gd_post_type . '_tags');
1672
-        $saved_data = stripslashes(get_tax_meta($current_term->term_id, 'ct_cat_top_desc', false, $gd_post_type));
1673
-        if ($term_desc && !$saved_data) {
1674
-            $saved_data = $term_desc;
1675
-        }
1671
+		$term_desc = term_description($current_term->term_id, $gd_post_type . '_tags');
1672
+		$saved_data = stripslashes(get_tax_meta($current_term->term_id, 'ct_cat_top_desc', false, $gd_post_type));
1673
+		if ($term_desc && !$saved_data) {
1674
+			$saved_data = $term_desc;
1675
+		}
1676 1676
 
1677
-        // stop payment manager filtering content length
1678
-        $filter_priority = has_filter( 'the_content', 'geodir_payments_the_content' );
1679
-        if ( false !== $filter_priority ) {
1680
-            remove_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1681
-        }
1677
+		// stop payment manager filtering content length
1678
+		$filter_priority = has_filter( 'the_content', 'geodir_payments_the_content' );
1679
+		if ( false !== $filter_priority ) {
1680
+			remove_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1681
+		}
1682 1682
 
1683
-        /**
1684
-         * Apply the core filter `the_content` filter to the variable string.
1685
-         *
1686
-         * This is a WordPress core filter that does many things.
1687
-         *
1688
-         * @since 1.0.0
1689
-         * @param string $var The string to apply the filter to.
1690
-         */
1691
-        $cat_description = apply_filters('the_content', $saved_data);
1683
+		/**
1684
+		 * Apply the core filter `the_content` filter to the variable string.
1685
+		 *
1686
+		 * This is a WordPress core filter that does many things.
1687
+		 *
1688
+		 * @since 1.0.0
1689
+		 * @param string $var The string to apply the filter to.
1690
+		 */
1691
+		$cat_description = apply_filters('the_content', $saved_data);
1692 1692
 
1693 1693
 
1694
-        if ( false !== $filter_priority ) {
1695
-            add_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1696
-        }
1694
+		if ( false !== $filter_priority ) {
1695
+			add_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1696
+		}
1697 1697
 
1698
-        if ($cat_description) {
1699
-            ?>
1698
+		if ($cat_description) {
1699
+			?>
1700 1700
 
1701 1701
             <div class="term_description"><?php echo $cat_description;?></div> <?php
1702
-        }
1702
+		}
1703 1703
 
1704
-    }
1704
+	}
1705 1705
 }
1706 1706
 
1707 1707
 // action for adding the listings page top widget area
@@ -1720,11 +1720,11 @@  discard block
 block discarded – undo
1720 1720
  */
1721 1721
 function geodir_action_geodir_sidebar_listings_top()
1722 1722
 {
1723
-    if (get_option('geodir_show_listing_top_section')) { ?>
1723
+	if (get_option('geodir_show_listing_top_section')) { ?>
1724 1724
         <div
1725 1725
             class="<?php
1726
-            /** This action is documented in geodirectory_template_actions.php */
1727
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_top'); ?>">
1726
+			/** This action is documented in geodirectory_template_actions.php */
1727
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_top'); ?>">
1728 1728
             <?php dynamic_sidebar('geodir_listing_top'); ?>
1729 1729
         </div><!-- clearfix ends here-->
1730 1730
     <?php }
@@ -1747,35 +1747,35 @@  discard block
 block discarded – undo
1747 1747
  */
1748 1748
 function geodir_action_sidebar_left_open($type = '', $id = '', $class = '', $itemtype = '')
1749 1749
 {
1750
-    if ($type == 'home-page' && $width = get_option('geodir_width_home_left_section')) {
1751
-        $width_css = 'style="width:' . $width . '%;"';
1752
-    } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_left_section')) {
1753
-        $width_css = 'style="width:' . $width . '%;"';
1754
-    } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_left_section')) {
1755
-        $width_css = 'style="width:' . $width . '%;"';
1756
-    } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_left_section')) {
1757
-        $width_css = 'style="width:' . $width . '%;"';
1758
-    } else {
1759
-        $width_css = '';
1760
-    }
1761
-
1762
-    $tc = get_option('theme_compatibility_setting');
1763
-    if (!empty($tc['geodir_sidebar_left_open_replace'])) {
1764
-        $text = $tc['geodir_sidebar_left_open_replace'];
1765
-    } else {
1766
-        $text = '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>';
1767
-    }
1768
-
1769
-    if (!empty($tc['geodir_sidebar_left_open_id'])) {
1770
-        $id = $tc['geodir_sidebar_left_open_id'];
1771
-    }
1772
-    if (!empty($tc['geodir_sidebar_left_open_class'])) {
1773
-        $class = $tc['geodir_sidebar_left_open_class'];
1774
-    }
1775
-
1776
-    $text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
1777
-
1778
-    echo $text;
1750
+	if ($type == 'home-page' && $width = get_option('geodir_width_home_left_section')) {
1751
+		$width_css = 'style="width:' . $width . '%;"';
1752
+	} elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_left_section')) {
1753
+		$width_css = 'style="width:' . $width . '%;"';
1754
+	} elseif ($type == 'search-page' && $width = get_option('geodir_width_search_left_section')) {
1755
+		$width_css = 'style="width:' . $width . '%;"';
1756
+	} elseif ($type == 'author-page' && $width = get_option('geodir_width_author_left_section')) {
1757
+		$width_css = 'style="width:' . $width . '%;"';
1758
+	} else {
1759
+		$width_css = '';
1760
+	}
1761
+
1762
+	$tc = get_option('theme_compatibility_setting');
1763
+	if (!empty($tc['geodir_sidebar_left_open_replace'])) {
1764
+		$text = $tc['geodir_sidebar_left_open_replace'];
1765
+	} else {
1766
+		$text = '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>';
1767
+	}
1768
+
1769
+	if (!empty($tc['geodir_sidebar_left_open_id'])) {
1770
+		$id = $tc['geodir_sidebar_left_open_id'];
1771
+	}
1772
+	if (!empty($tc['geodir_sidebar_left_open_class'])) {
1773
+		$class = $tc['geodir_sidebar_left_open_class'];
1774
+	}
1775
+
1776
+	$text = str_replace(array("[id]", "[class]", "[itemtype]", "[width_css]"), array($id, $class, $itemtype, $width_css), $text);
1777
+
1778
+	echo $text;
1779 1779
 }
1780 1780
 
1781 1781
 // action for adding the primary div closing tag
@@ -1791,13 +1791,13 @@  discard block
 block discarded – undo
1791 1791
  */
1792 1792
 function geodir_action_sidebar_left_close($type = '')
1793 1793
 {
1794
-    $tc = get_option('theme_compatibility_setting');
1795
-    if (!empty($tc['geodir_sidebar_left_close_replace'])) {
1796
-        $text = $tc['geodir_sidebar_left_close_replace'];
1797
-    } else {
1798
-        $text = '</aside><!-- sidebar ends here-->';
1799
-    }
1800
-    echo $text;
1794
+	$tc = get_option('theme_compatibility_setting');
1795
+	if (!empty($tc['geodir_sidebar_left_close_replace'])) {
1796
+		$text = $tc['geodir_sidebar_left_close_replace'];
1797
+	} else {
1798
+		$text = '</aside><!-- sidebar ends here-->';
1799
+	}
1800
+	echo $text;
1801 1801
 }
1802 1802
 
1803 1803
 /**
@@ -1810,7 +1810,7 @@  discard block
 block discarded – undo
1810 1810
  */
1811 1811
 function geodir_listing_left_section()
1812 1812
 {
1813
-    if (get_option('geodir_show_listing_left_section')) { ?>
1813
+	if (get_option('geodir_show_listing_left_section')) { ?>
1814 1814
         <div class="geodir-content-left geodir-sidebar-wrap">
1815 1815
             <?php dynamic_sidebar('geodir_listing_left_sidebar'); ?>
1816 1816
         </div><!-- end geodir-content-left -->
@@ -1828,20 +1828,20 @@  discard block
 block discarded – undo
1828 1828
  */
1829 1829
 function geodir_action_listings_sidebar_left()
1830 1830
 {
1831
-    if (get_option('geodir_show_listing_left_section')) {
1832
-        /** This action is documented in geodirectory_template_actions.php */
1833
-        do_action('geodir_sidebar_left_open', 'listings-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
1834
-        /**
1835
-         * Calls the listings page (category) left sidebar content.
1836
-         *
1837
-         * All the content for the listings page left sidebar is added via this hook.
1838
-         *
1839
-         * @since 1.0.0
1840
-         */
1841
-        do_action('geodir_listings_sidebar_left_inside');
1842
-        /** This action is documented in geodirectory_template_actions.php */
1843
-        do_action('geodir_sidebar_left_close', 'listings-page');
1844
-    }
1831
+	if (get_option('geodir_show_listing_left_section')) {
1832
+		/** This action is documented in geodirectory_template_actions.php */
1833
+		do_action('geodir_sidebar_left_open', 'listings-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
1834
+		/**
1835
+		 * Calls the listings page (category) left sidebar content.
1836
+		 *
1837
+		 * All the content for the listings page left sidebar is added via this hook.
1838
+		 *
1839
+		 * @since 1.0.0
1840
+		 */
1841
+		do_action('geodir_listings_sidebar_left_inside');
1842
+		/** This action is documented in geodirectory_template_actions.php */
1843
+		do_action('geodir_sidebar_left_close', 'listings-page');
1844
+	}
1845 1845
 }
1846 1846
 
1847 1847
 /**
@@ -1854,7 +1854,7 @@  discard block
 block discarded – undo
1854 1854
  */
1855 1855
 function geodir_listing_right_section()
1856 1856
 {
1857
-    if (get_option('geodir_show_listing_right_section')) { ?>
1857
+	if (get_option('geodir_show_listing_right_section')) { ?>
1858 1858
         <div class="geodir-content-right geodir-sidebar-wrap">
1859 1859
             <?php dynamic_sidebar('geodir_listing_right_sidebar'); ?>
1860 1860
         </div><!-- end geodir-content-right -->
@@ -1872,20 +1872,20 @@  discard block
 block discarded – undo
1872 1872
  */
1873 1873
 function geodir_action_listings_sidebar_right()
1874 1874
 {
1875
-    if (get_option('geodir_show_listing_right_section')) {
1876
-        /** This action is documented in geodirectory_template_actions.php */
1877
-        do_action('geodir_sidebar_right_open', 'listings-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
1878
-        /**
1879
-         * Calls the listings page (category) right sidebar content.
1880
-         *
1881
-         * All the content for the listings page right sidebar is added via this hook.
1882
-         *
1883
-         * @since 1.0.0
1884
-         */
1885
-        do_action('geodir_listings_sidebar_right_inside');
1886
-        /** This action is documented in geodirectory_template_actions.php */
1887
-        do_action('geodir_sidebar_right_close', 'listings-page');
1888
-    }
1875
+	if (get_option('geodir_show_listing_right_section')) {
1876
+		/** This action is documented in geodirectory_template_actions.php */
1877
+		do_action('geodir_sidebar_right_open', 'listings-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
1878
+		/**
1879
+		 * Calls the listings page (category) right sidebar content.
1880
+		 *
1881
+		 * All the content for the listings page right sidebar is added via this hook.
1882
+		 *
1883
+		 * @since 1.0.0
1884
+		 */
1885
+		do_action('geodir_listings_sidebar_right_inside');
1886
+		/** This action is documented in geodirectory_template_actions.php */
1887
+		do_action('geodir_sidebar_right_close', 'listings-page');
1888
+	}
1889 1889
 }
1890 1890
 
1891 1891
 
@@ -1902,23 +1902,23 @@  discard block
 block discarded – undo
1902 1902
  */
1903 1903
 function geodir_action_main_content_open($type = '', $id = '', $class = '')
1904 1904
 {
1905
-    $tc = get_option('theme_compatibility_setting');
1906
-    if (!empty($tc['geodir_main_content_open_replace'])) {
1907
-        $text = $tc['geodir_main_content_open_replace'];
1908
-    } else {
1909
-        $text = '<main id="[id]" class="[class]" role="main">';
1910
-    }
1905
+	$tc = get_option('theme_compatibility_setting');
1906
+	if (!empty($tc['geodir_main_content_open_replace'])) {
1907
+		$text = $tc['geodir_main_content_open_replace'];
1908
+	} else {
1909
+		$text = '<main id="[id]" class="[class]" role="main">';
1910
+	}
1911 1911
 
1912
-    if (!empty($tc['geodir_main_content_open_id'])) {
1913
-        $id = $tc['geodir_main_content_open_id'];
1914
-    }
1915
-    if (!empty($tc['geodir_main_content_open_class'])) {
1916
-        $class = $tc['geodir_main_content_open_class'];
1917
-    }
1912
+	if (!empty($tc['geodir_main_content_open_id'])) {
1913
+		$id = $tc['geodir_main_content_open_id'];
1914
+	}
1915
+	if (!empty($tc['geodir_main_content_open_class'])) {
1916
+		$class = $tc['geodir_main_content_open_class'];
1917
+	}
1918 1918
 
1919
-    $text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
1919
+	$text = str_replace(array("[id]", "[class]"), array($id, $class), $text);
1920 1920
 
1921
-    echo $text;
1921
+	echo $text;
1922 1922
 }
1923 1923
 
1924 1924
 // action for adding the primary div closing tag
@@ -1931,13 +1931,13 @@  discard block
 block discarded – undo
1931 1931
  */
1932 1932
 function geodir_action_main_content_close()
1933 1933
 {
1934
-    $tc = get_option('theme_compatibility_setting');
1935
-    if (!empty($tc['geodir_main_content_close_replace'])) {
1936
-        $text = $tc['geodir_main_content_close_replace'];
1937
-    } else {
1938
-        $text = '</main><!-- main ends here-->';
1939
-    }
1940
-    echo $text;
1934
+	$tc = get_option('theme_compatibility_setting');
1935
+	if (!empty($tc['geodir_main_content_close_replace'])) {
1936
+		$text = $tc['geodir_main_content_close_replace'];
1937
+	} else {
1938
+		$text = '</main><!-- main ends here-->';
1939
+	}
1940
+	echo $text;
1941 1941
 }
1942 1942
 
1943 1943
 /**
@@ -1949,14 +1949,14 @@  discard block
 block discarded – undo
1949 1949
  */
1950 1950
 function geodir_action_listings_content_inside()
1951 1951
 {
1952
-    global $gridview_columns;
1953
-    $listing_view = get_option('geodir_listing_view');
1954
-    if (strstr($listing_view, 'gridview')) {
1955
-        $gridview_columns = $listing_view;
1956
-        $listing_view_exp = explode('_', $listing_view);
1957
-        $listing_view = $listing_view_exp[0];
1958
-    }
1959
-    geodir_get_template_part('listing', 'listview');
1952
+	global $gridview_columns;
1953
+	$listing_view = get_option('geodir_listing_view');
1954
+	if (strstr($listing_view, 'gridview')) {
1955
+		$gridview_columns = $listing_view;
1956
+		$listing_view_exp = explode('_', $listing_view);
1957
+		$listing_view = $listing_view_exp[0];
1958
+	}
1959
+	geodir_get_template_part('listing', 'listview');
1960 1960
 }
1961 1961
 
1962 1962
 add_action('geodir_listings_content_inside', 'geodir_action_listings_content_inside', 10);
@@ -1972,47 +1972,47 @@  discard block
 block discarded – undo
1972 1972
  */
1973 1973
 function geodir_action_listings_content()
1974 1974
 {
1975
-    /**
1976
-     * This is used to add HTML opening wrappers to the main content of most pages including listings, author, search, home etc.
1977
-     *
1978
-     * @since 1.0.0
1979
-     * @param string $type The page type. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
1980
-     * @param string $id The id for the div. Usually 'geodir-main-content'.
1981
-     * @param string $class The class for the div. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
1982
-     * @see 'geodir_main_content_close' Where the oposing closing tag is added.
1983
-     */
1984
-    do_action('geodir_main_content_open', 'listings-page', 'geodir-main-content', 'listings-page');
1985
-    $extra_class = apply_filters('geodir_before_listing_wrapper_extra_class', '', 'listings-page');
1986
-    echo '<div class="clearfix '.$extra_class.'">';
1987
-    /**
1988
-     * Called before the listings page content, inside the outer wrapper. Used on listings pages and search and author pages.
1989
-     *
1990
-     * @since 1.0.0
1991
-     */
1992
-    do_action('geodir_before_listing');
1993
-    echo '</div>';
1994
-
1995
-    /**
1996
-     * This actions calls the listings list content. Used on listings pages and search and author pages.
1997
-     *
1998
-     * @since 1.0.0
1999
-     */
2000
-    do_action('geodir_listings_content_inside');
2001
-
2002
-    /**
2003
-     * Called after the listings content, inside the outer wrapper HTML. Used on listings pages and search and author pages.
2004
-     *
2005
-     * @since 1.0.0
2006
-     */
2007
-    do_action('geodir_after_listing');
2008
-
2009
-    /**
2010
-     * This is used to add HTML closing wrappers to the main content of most pages including listings, author, search, home etc.
2011
-     *
2012
-     * @since 1.0.0
2013
-     * @see 'geodir_main_content_open' Where the oposing opening tag is added.
2014
-     */
2015
-    do_action('geodir_main_content_close', 'listings-page');
1975
+	/**
1976
+	 * This is used to add HTML opening wrappers to the main content of most pages including listings, author, search, home etc.
1977
+	 *
1978
+	 * @since 1.0.0
1979
+	 * @param string $type The page type. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
1980
+	 * @param string $id The id for the div. Usually 'geodir-main-content'.
1981
+	 * @param string $class The class for the div. Values can be 'listings-page', 'author-page', 'search-page' or 'home-page'.
1982
+	 * @see 'geodir_main_content_close' Where the oposing closing tag is added.
1983
+	 */
1984
+	do_action('geodir_main_content_open', 'listings-page', 'geodir-main-content', 'listings-page');
1985
+	$extra_class = apply_filters('geodir_before_listing_wrapper_extra_class', '', 'listings-page');
1986
+	echo '<div class="clearfix '.$extra_class.'">';
1987
+	/**
1988
+	 * Called before the listings page content, inside the outer wrapper. Used on listings pages and search and author pages.
1989
+	 *
1990
+	 * @since 1.0.0
1991
+	 */
1992
+	do_action('geodir_before_listing');
1993
+	echo '</div>';
1994
+
1995
+	/**
1996
+	 * This actions calls the listings list content. Used on listings pages and search and author pages.
1997
+	 *
1998
+	 * @since 1.0.0
1999
+	 */
2000
+	do_action('geodir_listings_content_inside');
2001
+
2002
+	/**
2003
+	 * Called after the listings content, inside the outer wrapper HTML. Used on listings pages and search and author pages.
2004
+	 *
2005
+	 * @since 1.0.0
2006
+	 */
2007
+	do_action('geodir_after_listing');
2008
+
2009
+	/**
2010
+	 * This is used to add HTML closing wrappers to the main content of most pages including listings, author, search, home etc.
2011
+	 *
2012
+	 * @since 1.0.0
2013
+	 * @see 'geodir_main_content_open' Where the oposing opening tag is added.
2014
+	 */
2015
+	do_action('geodir_main_content_close', 'listings-page');
2016 2016
 }
2017 2017
 
2018 2018
 
@@ -2027,10 +2027,10 @@  discard block
 block discarded – undo
2027 2027
  */
2028 2028
 function geodir_action_sidebar_listings_bottom_section()
2029 2029
 {
2030
-    if (get_option('geodir_show_listing_bottom_section')) { ?>
2030
+	if (get_option('geodir_show_listing_bottom_section')) { ?>
2031 2031
         <div class="<?php
2032
-            /** This action is documented in geodirectory_template_actions.php */
2033
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_bottom'); ?>">
2032
+			/** This action is documented in geodirectory_template_actions.php */
2033
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_listing_bottom'); ?>">
2034 2034
             <?php dynamic_sidebar('geodir_listing_bottom'); ?>
2035 2035
         </div><!-- clearfix ends here-->
2036 2036
     <?php }
@@ -2050,38 +2050,38 @@  discard block
 block discarded – undo
2050 2050
  */
2051 2051
 function geodir_action_add_listing_page_title()
2052 2052
 {
2053
-    if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '')
2054
-        $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2055
-    /** This action is documented in geodirectory_template_actions.php */
2056
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
2057
-    /** This action is documented in geodirectory_template_actions.php */
2058
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2059
-
2060
-    $title = apply_filters('geodir_add_listing_page_title_text', get_the_title());
2061
-
2062
-    if(geodir_is_page('add-listing')){
2063
-        $gd_page = 'add-listing';
2064
-        if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
2065
-            $title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
2066
-        }elseif(isset($listing_type)){
2067
-            $title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
2068
-        }
2053
+	if (isset($_REQUEST['listing_type']) && $_REQUEST['listing_type'] != '')
2054
+		$listing_type = sanitize_text_field($_REQUEST['listing_type']);
2055
+	/** This action is documented in geodirectory_template_actions.php */
2056
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
2057
+	/** This action is documented in geodirectory_template_actions.php */
2058
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2059
+
2060
+	$title = apply_filters('geodir_add_listing_page_title_text', get_the_title());
2061
+
2062
+	if(geodir_is_page('add-listing')){
2063
+		$gd_page = 'add-listing';
2064
+		if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
2065
+			$title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
2066
+		}elseif(isset($listing_type)){
2067
+			$title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
2068
+		}
2069 2069
 
2070
-    }
2070
+	}
2071 2071
 
2072 2072
 
2073
-    /**
2074
-     * Filter page title to replace variables.
2075
-     *
2076
-     * @since 1.5.4
2077
-     * @param string $title The page title including variables.
2078
-     * @param string $gd_page The GeoDirectory page type if any.
2079
-     */
2080
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2073
+	/**
2074
+	 * Filter page title to replace variables.
2075
+	 *
2076
+	 * @since 1.5.4
2077
+	 * @param string $title The page title including variables.
2078
+	 * @param string $gd_page The GeoDirectory page type if any.
2079
+	 */
2080
+	$title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2081 2081
 
2082
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">';
2083
-    echo $title;
2084
-    echo '</h1></header>';
2082
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">';
2083
+	echo $title;
2084
+	echo '</h1></header>';
2085 2085
 }
2086 2086
 
2087 2087
 add_action('geodir_add_listing_page_mandatory', 'geodir_action_add_listing_page_mandatory', 10);
@@ -2112,59 +2112,59 @@  discard block
 block discarded – undo
2112 2112
  */
2113 2113
 function geodir_action_add_listing_form()
2114 2114
 {
2115
-    global $cat_display, $post_cat, $current_user, $gd_session;
2116
-    $page_id = get_the_ID();
2117
-    $post = '';
2118
-    $title = '';
2119
-    $desc = '';
2120
-    $kw_tags = '';
2121
-    $required_msg = '';
2122
-    $submit_button = '';
2123
-
2124
-    $ajax_action = isset($_REQUEST['ajax_action']) ? $_REQUEST['ajax_action'] : 'add';
2125
-
2126
-    $thumb_img_arr = array();
2127
-    $curImages = '';
2128
-
2129
-    if (isset($_REQUEST['backandedit'])) {
2130
-        global $post;
2131
-        $post = (object)$gd_session->get('listing');
2132
-        $listing_type = $post->listing_type;
2133
-        $title = $post->post_title;
2134
-        $desc = $post->post_desc;
2135
-        $post_cat = $post->post_category;
2136
-
2137
-        $kw_tags = $post->post_tags;
2138
-        $curImages = isset($post->post_images) ? $post->post_images : '';
2139
-    } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2140
-        global $post, $post_images;
2141
-
2142
-        $post = geodir_get_post_info($_REQUEST['pid']);
2143
-        $thumb_img_arr = geodir_get_images($post->ID);
2144
-        if ($thumb_img_arr) {
2145
-            foreach ($thumb_img_arr as $post_img) {
2146
-                $curImages .= $post_img->src . ',';
2147
-            }
2148
-        }
2115
+	global $cat_display, $post_cat, $current_user, $gd_session;
2116
+	$page_id = get_the_ID();
2117
+	$post = '';
2118
+	$title = '';
2119
+	$desc = '';
2120
+	$kw_tags = '';
2121
+	$required_msg = '';
2122
+	$submit_button = '';
2123
+
2124
+	$ajax_action = isset($_REQUEST['ajax_action']) ? $_REQUEST['ajax_action'] : 'add';
2125
+
2126
+	$thumb_img_arr = array();
2127
+	$curImages = '';
2128
+
2129
+	if (isset($_REQUEST['backandedit'])) {
2130
+		global $post;
2131
+		$post = (object)$gd_session->get('listing');
2132
+		$listing_type = $post->listing_type;
2133
+		$title = $post->post_title;
2134
+		$desc = $post->post_desc;
2135
+		$post_cat = $post->post_category;
2136
+
2137
+		$kw_tags = $post->post_tags;
2138
+		$curImages = isset($post->post_images) ? $post->post_images : '';
2139
+	} elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2140
+		global $post, $post_images;
2141
+
2142
+		$post = geodir_get_post_info($_REQUEST['pid']);
2143
+		$thumb_img_arr = geodir_get_images($post->ID);
2144
+		if ($thumb_img_arr) {
2145
+			foreach ($thumb_img_arr as $post_img) {
2146
+				$curImages .= $post_img->src . ',';
2147
+			}
2148
+		}
2149 2149
 
2150
-        $listing_type = $post->post_type;
2151
-        $title = $post->post_title;
2152
-        $desc = $post->post_content;
2153
-        $kw_tags = $post->post_tags;
2154
-        $kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type . '_tags', array('fields' => 'names')));
2155
-    } else {
2156
-        $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2157
-    }
2150
+		$listing_type = $post->post_type;
2151
+		$title = $post->post_title;
2152
+		$desc = $post->post_content;
2153
+		$kw_tags = $post->post_tags;
2154
+		$kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type . '_tags', array('fields' => 'names')));
2155
+	} else {
2156
+		$listing_type = sanitize_text_field($_REQUEST['listing_type']);
2157
+	}
2158 2158
 
2159
-    if ($current_user->ID != '0') {
2160
-        $user_login = true;
2161
-    }
2159
+	if ($current_user->ID != '0') {
2160
+		$user_login = true;
2161
+	}
2162 2162
 
2163
-    $post_type_info = geodir_get_posttype_info($listing_type);
2163
+	$post_type_info = geodir_get_posttype_info($listing_type);
2164 2164
 
2165
-    $cpt_singular_name = (isset($post_type_info['labels']['singular_name']) && $post_type_info['labels']['singular_name']) ? $post_type_info['labels']['singular_name'] : __('Listing','geodirectory');
2165
+	$cpt_singular_name = (isset($post_type_info['labels']['singular_name']) && $post_type_info['labels']['singular_name']) ? $post_type_info['labels']['singular_name'] : __('Listing','geodirectory');
2166 2166
 
2167
-    ?>
2167
+	?>
2168 2168
     <form name="propertyform" id="propertyform" action="<?php echo get_page_link(geodir_preview_page_id());?>" method="post" enctype="multipart/form-data">
2169 2169
         <input type="hidden" name="preview" value="<?php echo sanitize_text_field($listing_type);?>"/>
2170 2170
         <input type="hidden" name="listing_type" value="<?php echo sanitize_text_field($listing_type);?>"/>
@@ -2175,27 +2175,27 @@  discard block
 block discarded – undo
2175 2175
         <?php } if (isset($_REQUEST['backandedit'])) { ?>
2176 2176
             <input type="hidden" name="backandedit" value="<?php echo sanitize_text_field($_REQUEST['backandedit']);?>"/>
2177 2177
         <?php
2178
-        } 
2179
-        /**
2180
-         * Called at the very top of the add listing page form for frontend.
2181
-         *
2182
-         * This is called just before the "Enter Listing Details" text.
2183
-         *
2184
-         * @since 1.0.0
2185
-         */
2186
-        do_action('geodir_before_detail_fields');
2187
-        ?>
2178
+		} 
2179
+		/**
2180
+		 * Called at the very top of the add listing page form for frontend.
2181
+		 *
2182
+		 * This is called just before the "Enter Listing Details" text.
2183
+		 *
2184
+		 * @since 1.0.0
2185
+		 */
2186
+		do_action('geodir_before_detail_fields');
2187
+		?>
2188 2188
         <h5 id="geodir_fieldset_details" class="geodir-fieldset-row" gd-fieldset="details"><?php echo LISTING_DETAILS_TEXT;?></h5>
2189 2189
         <?php
2190
-        /**
2191
-         * Called at the top of the add listing page form for frontend.
2192
-         *
2193
-         * This is called after the "Enter Listing Details" text.
2194
-         *
2195
-         * @since 1.0.0
2196
-         */
2197
-        do_action('geodir_before_main_form_fields');
2198
-        ?>
2190
+		/**
2191
+		 * Called at the top of the add listing page form for frontend.
2192
+		 *
2193
+		 * This is called after the "Enter Listing Details" text.
2194
+		 *
2195
+		 * @since 1.0.0
2196
+		 */
2197
+		do_action('geodir_before_main_form_fields');
2198
+		?>
2199 2199
         <div id="geodir_post_title_row" class="required_field geodir_form_row clearfix gd-fieldset-details">
2200 2200
             <label><?php echo sprintf( __('%s Title', 'geodirectory'), $cpt_singular_name ); ?><span>*</span> </label>
2201 2201
             <input type="text" field_type="text" name="post_title" id="post_title" class="geodir_textfield"
@@ -2203,57 +2203,57 @@  discard block
 block discarded – undo
2203 2203
             <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory');?></span>
2204 2204
         </div>
2205 2205
         <?php
2206
-        $show_editor = get_option('geodir_tiny_editor_on_add_listing');
2207
-
2208
-        $desc = $show_editor ? stripslashes($desc) : esc_attr(stripslashes($desc));
2209
-        $desc_limit = '';
2210
-        /**
2211
-         * Filter the add listing description field character limit number.
2212
-         *
2213
-         * @since 1.0.0
2214
-         * @param int $desc_limit The amount of characters to limit the description to.
2215
-         */
2216
-        $desc_limit = apply_filters('geodir_description_field_desc_limit', $desc_limit);
2217
-        /**
2218
-         * Filter the add listing description field text.
2219
-         *
2220
-         * @since 1.0.0
2221
-         * @param string $desc The text for the description field.
2222
-         * @param int $desc_limit The character limit number if any.
2223
-         */
2224
-        $desc = apply_filters('geodir_description_field_desc', $desc, $desc_limit);
2225
-        $desc_limit_msg = '';
2226
-        /**
2227
-         * Filter the add listing description limit message.
2228
-         *
2229
-         * This is the message shown if there is a limit applied to the amount of characters the description can use.
2230
-         *
2231
-         * @since 1.0.0
2232
-         * @param string $desc_limit_msg The limit message string if any.
2233
-         * @param int $desc_limit The character limit numer if any.
2234
-         */
2235
-        $desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit);
2206
+		$show_editor = get_option('geodir_tiny_editor_on_add_listing');
2207
+
2208
+		$desc = $show_editor ? stripslashes($desc) : esc_attr(stripslashes($desc));
2209
+		$desc_limit = '';
2210
+		/**
2211
+		 * Filter the add listing description field character limit number.
2212
+		 *
2213
+		 * @since 1.0.0
2214
+		 * @param int $desc_limit The amount of characters to limit the description to.
2215
+		 */
2216
+		$desc_limit = apply_filters('geodir_description_field_desc_limit', $desc_limit);
2217
+		/**
2218
+		 * Filter the add listing description field text.
2219
+		 *
2220
+		 * @since 1.0.0
2221
+		 * @param string $desc The text for the description field.
2222
+		 * @param int $desc_limit The character limit number if any.
2223
+		 */
2224
+		$desc = apply_filters('geodir_description_field_desc', $desc, $desc_limit);
2225
+		$desc_limit_msg = '';
2226
+		/**
2227
+		 * Filter the add listing description limit message.
2228
+		 *
2229
+		 * This is the message shown if there is a limit applied to the amount of characters the description can use.
2230
+		 *
2231
+		 * @since 1.0.0
2232
+		 * @param string $desc_limit_msg The limit message string if any.
2233
+		 * @param int $desc_limit The character limit numer if any.
2234
+		 */
2235
+		$desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit);
2236 2236
         
2237
-        $desc_class = '';
2238
-        if ($desc_limit === '' || (int)$desc_limit > 0) {
2239
-            /**
2240
-             * Called on the add listing page form for frontend just before the description field.
2241
-             *
2242
-             * @since 1.0.0
2243
-             */
2244
-            do_action('geodir_before_description_field');
2237
+		$desc_class = '';
2238
+		if ($desc_limit === '' || (int)$desc_limit > 0) {
2239
+			/**
2240
+			 * Called on the add listing page form for frontend just before the description field.
2241
+			 *
2242
+			 * @since 1.0.0
2243
+			 */
2244
+			do_action('geodir_before_description_field');
2245 2245
             
2246
-            $desc_class = ' required_field';
2247
-        } else {
2248
-            $desc_class = ' hidden';
2249
-        }
2250
-        ?>
2246
+			$desc_class = ' required_field';
2247
+		} else {
2248
+			$desc_class = ' hidden';
2249
+		}
2250
+		?>
2251 2251
         <div id="geodir_post_desc_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $desc_class;?>">
2252 2252
             <label><?php echo sprintf( __('%s Description', 'geodirectory'), $cpt_singular_name ); ?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label>
2253 2253
             <?php
2254
-            if (!empty($show_editor) && in_array($listing_type, $show_editor)) {
2255
-                $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
2256
-            ?>
2254
+			if (!empty($show_editor) && in_array($listing_type, $show_editor)) {
2255
+				$editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
2256
+			?>
2257 2257
                 <div class="editor" field_id="post_desc" field_type="editor">
2258 2258
                     <?php wp_editor($desc, "post_desc", $editor_settings); ?>
2259 2259
                 </div>
@@ -2267,56 +2267,56 @@  discard block
 block discarded – undo
2267 2267
             <span class="geodir_message_error"><?php echo _e($required_msg, 'geodirectory');?></span>
2268 2268
         </div>
2269 2269
         <?php
2270
-        if ($desc_limit === '' || (int)$desc_limit > 0) {
2271
-            /**
2272
-             * Called on the add listing page form for frontend just after the description field.
2273
-             *
2274
-             * @since 1.0.0
2275
-             */
2276
-            do_action('geodir_after_description_field');
2277
-        }
2270
+		if ($desc_limit === '' || (int)$desc_limit > 0) {
2271
+			/**
2272
+			 * Called on the add listing page form for frontend just after the description field.
2273
+			 *
2274
+			 * @since 1.0.0
2275
+			 */
2276
+			do_action('geodir_after_description_field');
2277
+		}
2278 2278
         
2279
-        $kw_tags = esc_attr(stripslashes($kw_tags));
2280
-        $kw_tags_count = TAGKW_TEXT_COUNT;
2281
-        $kw_tags_msg = TAGKW_MSG;
2282
-        /**
2283
-         * Filter the add listing tags character limit.
2284
-         *
2285
-         * @since 1.0.0
2286
-         * @param int $kw_tags_count The character count limit if any.
2287
-         */
2288
-        $kw_tags_count = apply_filters('geodir_listing_tags_field_tags_count', $kw_tags_count);
2289
-        /**
2290
-         * Filter the add listing tags field value.
2291
-         *
2292
-         * You can use the $_REQUEST values to check if this is a go back and edit value etc.
2293
-         *
2294
-         * @since 1.0.0
2295
-         * @param string $kw_tags The tag field value, usually a comma separated list of tags.
2296
-         * @param int $kw_tags_count The character count limit if any.
2297
-         */
2298
-        $kw_tags = apply_filters('geodir_listing_tags_field_tags', $kw_tags, $kw_tags_count);
2299
-        /**
2300
-         * Filter the add listing tags field message text.
2301
-         *
2302
-         * @since 1.0.0
2303
-         * @param string $kw_tags_msg The message shown under the field.
2304
-         * @param int $kw_tags_count The character count limit if any.
2305
-         */
2306
-        $kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count);
2279
+		$kw_tags = esc_attr(stripslashes($kw_tags));
2280
+		$kw_tags_count = TAGKW_TEXT_COUNT;
2281
+		$kw_tags_msg = TAGKW_MSG;
2282
+		/**
2283
+		 * Filter the add listing tags character limit.
2284
+		 *
2285
+		 * @since 1.0.0
2286
+		 * @param int $kw_tags_count The character count limit if any.
2287
+		 */
2288
+		$kw_tags_count = apply_filters('geodir_listing_tags_field_tags_count', $kw_tags_count);
2289
+		/**
2290
+		 * Filter the add listing tags field value.
2291
+		 *
2292
+		 * You can use the $_REQUEST values to check if this is a go back and edit value etc.
2293
+		 *
2294
+		 * @since 1.0.0
2295
+		 * @param string $kw_tags The tag field value, usually a comma separated list of tags.
2296
+		 * @param int $kw_tags_count The character count limit if any.
2297
+		 */
2298
+		$kw_tags = apply_filters('geodir_listing_tags_field_tags', $kw_tags, $kw_tags_count);
2299
+		/**
2300
+		 * Filter the add listing tags field message text.
2301
+		 *
2302
+		 * @since 1.0.0
2303
+		 * @param string $kw_tags_msg The message shown under the field.
2304
+		 * @param int $kw_tags_count The character count limit if any.
2305
+		 */
2306
+		$kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count);
2307 2307
         
2308
-        $tags_class = '';
2309
-        if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2310
-            /**
2311
-             * Called on the add listing page form for frontend just before the tags field.
2312
-             *
2313
-             * @since 1.0.0
2314
-             */
2315
-            do_action('geodir_before_listing_tags_field');
2316
-        } else {
2317
-            $tags_class = ' hidden';
2318
-        }
2319
-        ?>
2308
+		$tags_class = '';
2309
+		if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2310
+			/**
2311
+			 * Called on the add listing page form for frontend just before the tags field.
2312
+			 *
2313
+			 * @since 1.0.0
2314
+			 */
2315
+			do_action('geodir_before_listing_tags_field');
2316
+		} else {
2317
+			$tags_class = ' hidden';
2318
+		}
2319
+		?>
2320 2320
         <div id="geodir_post_tags_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $tags_class;?>">
2321 2321
             <label><?php echo TAGKW_TEXT; ?></label>
2322 2322
             <input name="post_tags" id="post_tags" value="<?php echo $kw_tags; ?>" type="text" class="geodir_textfield"
@@ -2324,90 +2324,90 @@  discard block
 block discarded – undo
2324 2324
             <span class="geodir_message_note"><?php echo $kw_tags_msg;?></span>
2325 2325
         </div>
2326 2326
         <?php
2327
-        if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2328
-            /**
2329
-             * Called on the add listing page form for frontend just after the tags field.
2330
-             *
2331
-             * @since 1.0.0
2332
-             */
2333
-            do_action('geodir_after_listing_tags_field');
2334
-        }
2327
+		if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2328
+			/**
2329
+			 * Called on the add listing page form for frontend just after the tags field.
2330
+			 *
2331
+			 * @since 1.0.0
2332
+			 */
2333
+			do_action('geodir_after_listing_tags_field');
2334
+		}
2335 2335
         
2336
-        $package_info = array();
2337
-        $package_info = geodir_post_package_info($package_info, $post);
2336
+		$package_info = array();
2337
+		$package_info = geodir_post_package_info($package_info, $post);
2338 2338
         
2339
-        geodir_get_custom_fields_html($package_info->pid, 'all', $listing_type);
2339
+		geodir_get_custom_fields_html($package_info->pid, 'all', $listing_type);
2340 2340
         
2341
-        // adjust values here
2342
-        $id = "post_images"; // this will be the name of form field. Image url(s) will be submitted in $_POST using this key. So if $id == �img1� then $_POST[�img1�] will have all the image urls
2343
-
2344
-        $multiple = true; // allow multiple files upload
2341
+		// adjust values here
2342
+		$id = "post_images"; // this will be the name of form field. Image url(s) will be submitted in $_POST using this key. So if $id == �img1� then $_POST[�img1�] will have all the image urls
2345 2343
 
2346
-        $width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels)
2344
+		$multiple = true; // allow multiple files upload
2347 2345
 
2348
-        $height = geodir_media_image_large_height(); // If you want to automatically resize all uploaded images then provide height here (in pixels)
2346
+		$width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels)
2349 2347
 
2350
-        $thumb_img_arr = array();
2351
-        $totImg = 0;
2352
-        if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
2353
-            $post = (object)$gd_session->get('listing');
2354
-            if (isset($post->post_images))
2355
-                $curImages = trim($post->post_images, ",");
2348
+		$height = geodir_media_image_large_height(); // If you want to automatically resize all uploaded images then provide height here (in pixels)
2356 2349
 
2350
+		$thumb_img_arr = array();
2351
+		$totImg = 0;
2352
+		if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
2353
+			$post = (object)$gd_session->get('listing');
2354
+			if (isset($post->post_images))
2355
+				$curImages = trim($post->post_images, ",");
2357 2356
 
2358
-            if ($curImages != '') {
2359
-                $curImages_array = explode(',', $curImages);
2360
-                $totImg = count($curImages_array);
2361
-            }
2362 2357
 
2363
-            $listing_type = $post->listing_type;
2358
+			if ($curImages != '') {
2359
+				$curImages_array = explode(',', $curImages);
2360
+				$totImg = count($curImages_array);
2361
+			}
2364 2362
 
2365
-        } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2366
-            $post = geodir_get_post_info((int)$_REQUEST['pid']);
2367
-            $listing_type = $post->post_type;
2368
-            $thumb_img_arr = geodir_get_images($_REQUEST['pid']);
2363
+			$listing_type = $post->listing_type;
2369 2364
 
2370
-        } else {
2371
-            $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2372
-        }
2365
+		} elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2366
+			$post = geodir_get_post_info((int)$_REQUEST['pid']);
2367
+			$listing_type = $post->post_type;
2368
+			$thumb_img_arr = geodir_get_images($_REQUEST['pid']);
2373 2369
 
2370
+		} else {
2371
+			$listing_type = sanitize_text_field($_REQUEST['listing_type']);
2372
+		}
2374 2373
 
2375
-        if (!empty($thumb_img_arr)) {
2376
-            foreach ($thumb_img_arr as $img) {
2377
-                //$curImages = $img->src.",";
2378
-            }
2379 2374
 
2380
-            $totImg = count((array)$thumb_img_arr);
2381
-        }
2375
+		if (!empty($thumb_img_arr)) {
2376
+			foreach ($thumb_img_arr as $img) {
2377
+				//$curImages = $img->src.",";
2378
+			}
2382 2379
 
2383
-        if ($curImages != '')
2384
-            $svalue = $curImages; // this will be initial value of the above form field. Image urls.
2385
-        else
2386
-            $svalue = '';
2387
-
2388
-        $image_limit = $package_info->image_limit;
2389
-        $show_image_input_box = ($image_limit != '0');
2390
-        /**
2391
-         * Filter to be able to show/hide the image upload section of the add listing form.
2392
-         *
2393
-         * @since 1.0.0
2394
-         * @param bool $show_image_input_box Set true to show. Set false to not show.
2395
-         * @param string $listing_type The custom post type slug.
2396
-         */
2397
-        $show_image_input_box = apply_filters('geodir_image_uploader_on_add_listing', $show_image_input_box, $listing_type);
2398
-        if ($show_image_input_box) {
2399
-            ?>
2380
+			$totImg = count((array)$thumb_img_arr);
2381
+		}
2382
+
2383
+		if ($curImages != '')
2384
+			$svalue = $curImages; // this will be initial value of the above form field. Image urls.
2385
+		else
2386
+			$svalue = '';
2387
+
2388
+		$image_limit = $package_info->image_limit;
2389
+		$show_image_input_box = ($image_limit != '0');
2390
+		/**
2391
+		 * Filter to be able to show/hide the image upload section of the add listing form.
2392
+		 *
2393
+		 * @since 1.0.0
2394
+		 * @param bool $show_image_input_box Set true to show. Set false to not show.
2395
+		 * @param string $listing_type The custom post type slug.
2396
+		 */
2397
+		$show_image_input_box = apply_filters('geodir_image_uploader_on_add_listing', $show_image_input_box, $listing_type);
2398
+		if ($show_image_input_box) {
2399
+			?>
2400 2400
 
2401 2401
             <h5 id="geodir_form_title_row" class="geodir-form_title"> <?php echo PRO_PHOTO_TEXT;?>
2402 2402
                 <?php if ($image_limit == 1) {
2403
-                    echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
2404
-                } ?>
2403
+					echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
2404
+				} ?>
2405 2405
                 <?php if ($image_limit > 1) {
2406
-                    echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>';
2407
-                } ?>
2406
+					echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>';
2407
+				} ?>
2408 2408
                 <?php if ($image_limit == '') {
2409
-                    echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>';
2410
-                } ?>
2409
+					echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>';
2410
+				} ?>
2411 2411
             </h5>
2412 2412
 
2413 2413
             <div class="geodir_form_row clearfix" id="<?php echo $id; ?>dropbox"
@@ -2445,12 +2445,12 @@  discard block
 block discarded – undo
2445 2445
         <?php } ?>
2446 2446
 
2447 2447
         <?php
2448
-        /**
2449
-         * Called on the add listing page form for frontend just after the image upload field.
2450
-         *
2451
-         * @since 1.0.0
2452
-         */
2453
-        do_action('geodir_after_main_form_fields');?>
2448
+		/**
2449
+		 * Called on the add listing page form for frontend just after the image upload field.
2450
+		 *
2451
+		 * @since 1.0.0
2452
+		 */
2453
+		do_action('geodir_after_main_form_fields');?>
2454 2454
 
2455 2455
 
2456 2456
         <!-- add captcha code -->
@@ -2479,7 +2479,7 @@  discard block
 block discarded – undo
2479 2479
 
2480 2480
     </form>
2481 2481
     <?php
2482
-    wp_reset_query();
2482
+	wp_reset_query();
2483 2483
 }
2484 2484
 
2485 2485
 /**
@@ -2490,7 +2490,7 @@  discard block
 block discarded – undo
2490 2490
  */
2491 2491
 function geodir_add_listing_sidebar_widget_area()
2492 2492
 {
2493
-    dynamic_sidebar('geodir_add_listing_sidebar');
2493
+	dynamic_sidebar('geodir_add_listing_sidebar');
2494 2494
 }
2495 2495
 
2496 2496
 add_action('geodir_add_listing_sidebar_inside', 'geodir_add_listing_sidebar_widget_area', 10);
@@ -2505,16 +2505,16 @@  discard block
 block discarded – undo
2505 2505
  */
2506 2506
 function geodir_action_add_listing_sidebar()
2507 2507
 {
2508
-    /** This action is documented in geodirectory_template_actions.php */
2509
-    do_action('geodir_sidebar_right_open', 'add-listing-page', 'geodir-sidebar', 'geodir-sidebar-right', 'http://schema.org/WPSideBar');
2510
-    /**
2511
-     * This is used to add the content to the add listing page sidebar.
2512
-     *
2513
-     * @since 1.0.0
2514
-     */
2515
-    do_action('geodir_add_listing_sidebar_inside');
2516
-    /** This action is documented in geodirectory_template_actions.php */
2517
-    do_action('geodir_sidebar_right_close', 'details-page');
2508
+	/** This action is documented in geodirectory_template_actions.php */
2509
+	do_action('geodir_sidebar_right_open', 'add-listing-page', 'geodir-sidebar', 'geodir-sidebar-right', 'http://schema.org/WPSideBar');
2510
+	/**
2511
+	 * This is used to add the content to the add listing page sidebar.
2512
+	 *
2513
+	 * @since 1.0.0
2514
+	 */
2515
+	do_action('geodir_add_listing_sidebar_inside');
2516
+	/** This action is documented in geodirectory_template_actions.php */
2517
+	do_action('geodir_sidebar_right_close', 'details-page');
2518 2518
 }
2519 2519
 
2520 2520
 ###############################################
@@ -2531,11 +2531,11 @@  discard block
 block discarded – undo
2531 2531
  */
2532 2532
 function geodir_action_geodir_sidebar_signup_top()
2533 2533
 {
2534
-    ?>
2534
+	?>
2535 2535
     <div
2536 2536
         class="<?php
2537
-        /** This action is documented in geodirectory_template_actions.php */
2538
-        echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>">
2537
+		/** This action is documented in geodirectory_template_actions.php */
2538
+		echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>">
2539 2539
         <?php dynamic_sidebar('Reg/Login Top Section');?>
2540 2540
     </div><!-- clearfix ends here-->
2541 2541
 <?php
@@ -2554,9 +2554,9 @@  discard block
 block discarded – undo
2554 2554
 function geodir_action_signup_forms()
2555 2555
 {
2556 2556
 
2557
-    global $user_login;
2557
+	global $user_login;
2558 2558
 
2559
-    ?>
2559
+	?>
2560 2560
     <script type="text/javascript">
2561 2561
         <?php if ( $user_login ) { ?>
2562 2562
         setTimeout(function () {
@@ -2592,65 +2592,65 @@  discard block
 block discarded – undo
2592 2592
         <?php } ?>
2593 2593
     </script><?php
2594 2594
 
2595
-    global $errors;
2596
-    if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim')
2597
-        $errors->add('claim_login', LOGIN_CLAIM);
2598
-
2599
-    if (!empty($errors)) {
2600
-        foreach ($errors as $errorsObj) {
2601
-            foreach ($errorsObj as $key => $val) {
2602
-                for ($i = 0; $i < count($val); $i++) {
2603
-                    echo "<div class=sucess_msg>" . $val[$i] . '</div>';
2604
-                    $registration_error_msg = 1;
2605
-                }
2606
-            }
2607
-        }
2608
-    }
2595
+	global $errors;
2596
+	if (isset($_REQUEST['msg']) && $_REQUEST['msg'] == 'claim')
2597
+		$errors->add('claim_login', LOGIN_CLAIM);
2598
+
2599
+	if (!empty($errors)) {
2600
+		foreach ($errors as $errorsObj) {
2601
+			foreach ($errorsObj as $key => $val) {
2602
+				for ($i = 0; $i < count($val); $i++) {
2603
+					echo "<div class=sucess_msg>" . $val[$i] . '</div>';
2604
+					$registration_error_msg = 1;
2605
+				}
2606
+			}
2607
+		}
2608
+	}
2609 2609
 
2610
-    if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_in') {
2611
-        ?>
2610
+	if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_in') {
2611
+		?>
2612 2612
 
2613 2613
         <div class="login_form">
2614 2614
             <?php
2615
-            /**
2616
-             * Contains login form template.
2617
-             *
2618
-             * @since 1.0.0
2619
-             */
2620
-            include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2615
+			/**
2616
+			 * Contains login form template.
2617
+			 *
2618
+			 * @since 1.0.0
2619
+			 */
2620
+			include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2621 2621
         </div>
2622 2622
 
2623 2623
     <?php } elseif (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_up') { ?>
2624 2624
 
2625 2625
         <div class="registration_form">
2626 2626
             <?php
2627
-            /**
2628
-             * Contains registration form template.
2629
-             *
2630
-             * @since 1.0.0
2631
-             */
2632
-            include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2627
+			/**
2628
+			 * Contains registration form template.
2629
+			 *
2630
+			 * @since 1.0.0
2631
+			 */
2632
+			include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2633 2633
         </div>
2634 2634
 
2635 2635
     <?php } else { ?>
2636 2636
 
2637 2637
         <div class="login_form_l">
2638 2638
             <?php
2639
-            /**
2640
-             * Contains login form template.
2641
-             *
2642
-             * @since 1.0.0
2643
-             */
2644
-            include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2639
+			/**
2640
+			 * Contains login form template.
2641
+			 *
2642
+			 * @since 1.0.0
2643
+			 */
2644
+			include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2645 2645
         </div>
2646 2646
         <div class="registration_form_r">
2647 2647
             <?php
2648
-            /**
2649
-             * Contains registration form template.
2650
-             *
2651
-             * @since 1.0.0
2652
-             */
2653
-            include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2648
+			/**
2649
+			 * Contains registration form template.
2650
+			 *
2651
+			 * @since 1.0.0
2652
+			 */
2653
+			include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2654 2654
         </div>
2655 2655
 
2656 2656
     <?php }?>
@@ -2681,66 +2681,66 @@  discard block
 block discarded – undo
2681 2681
  */
2682 2682
 function geodir_action_author_page_title()
2683 2683
 {
2684
-    global $term;
2684
+	global $term;
2685 2685
 
2686
-    $gd_post_type = geodir_get_current_posttype();
2687
-    $post_type_info = get_post_type_object($gd_post_type);
2686
+	$gd_post_type = geodir_get_current_posttype();
2687
+	$post_type_info = get_post_type_object($gd_post_type);
2688 2688
 
2689
-    $add_string_in_title = __('All', 'geodirectory') . ' ';
2690
-    if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
2691
-        $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
2692
-    }
2689
+	$add_string_in_title = __('All', 'geodirectory') . ' ';
2690
+	if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
2691
+		$add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
2692
+	}
2693 2693
 
2694
-    $list_title = $add_string_in_title . $post_type_info->labels->name;
2695
-    $single_name = $post_type_info->labels->singular_name;
2694
+	$list_title = $add_string_in_title . $post_type_info->labels->name;
2695
+	$single_name = $post_type_info->labels->singular_name;
2696 2696
 
2697
-    $taxonomy = geodir_get_taxonomies($gd_post_type);
2697
+	$taxonomy = geodir_get_taxonomies($gd_post_type);
2698 2698
 
2699
-    if (!empty($term)) {
2700
-        $current_term = get_term_by('slug', $term, $taxonomy[0]);
2701
-        if (!empty($current_term))
2702
-            $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
2703
-    }
2699
+	if (!empty($term)) {
2700
+		$current_term = get_term_by('slug', $term, $taxonomy[0]);
2701
+		if (!empty($current_term))
2702
+			$list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
2703
+	}
2704 2704
 
2705 2705
 
2706
-    if (is_search()) {
2707
-        $list_title = __('Search', 'geodirectory') . ' ' . __($post_type_info->labels->name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2706
+	if (is_search()) {
2707
+		$list_title = __('Search', 'geodirectory') . ' ' . __($post_type_info->labels->name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2708 2708
 
2709
-    }
2710
-    /** This action is documented in geodirectory_template_actions.php */
2711
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
2712
-    /** This action is documented in geodirectory_template_actions.php */
2713
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2709
+	}
2710
+	/** This action is documented in geodirectory_template_actions.php */
2711
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
2712
+	/** This action is documented in geodirectory_template_actions.php */
2713
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2714 2714
 
2715
-    $title = $list_title;
2716
-    if(geodir_is_page('author')){
2717
-        $gd_page = 'author';
2718
-        if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
2719
-            $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
2720
-        }else{
2721
-            $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
2722
-        }
2715
+	$title = $list_title;
2716
+	if(geodir_is_page('author')){
2717
+		$gd_page = 'author';
2718
+		if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
2719
+			$title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
2720
+		}else{
2721
+			$title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
2722
+		}
2723 2723
 
2724
-    }
2724
+	}
2725 2725
 
2726 2726
 
2727
-    /**
2728
-     * Filter page title to replace variables.
2729
-     *
2730
-     * @since 1.5.4
2731
-     * @param string $title The page title including variables.
2732
-     * @param string $gd_page The GeoDirectory page type if any.
2733
-     */
2734
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2727
+	/**
2728
+	 * Filter page title to replace variables.
2729
+	 *
2730
+	 * @since 1.5.4
2731
+	 * @param string $title The page title including variables.
2732
+	 * @param string $gd_page The GeoDirectory page type if any.
2733
+	 */
2734
+	$title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2735 2735
 
2736
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2737
-        /**
2738
-         * Filter the author page title text.
2739
-         *
2740
-         * @since 1.0.0
2741
-         * @param string $list_title The title for the page.
2742
-         */
2743
-        apply_filters('geodir_author_page_title_text', $title) . '</h1></header>';
2736
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2737
+		/**
2738
+		 * Filter the author page title text.
2739
+		 *
2740
+		 * @since 1.0.0
2741
+		 * @param string $list_title The title for the page.
2742
+		 */
2743
+		apply_filters('geodir_author_page_title_text', $title) . '</h1></header>';
2744 2744
 }
2745 2745
 
2746 2746
 
@@ -2758,11 +2758,11 @@  discard block
 block discarded – undo
2758 2758
  */
2759 2759
 function geodir_action_geodir_sidebar_author_top()
2760 2760
 {
2761
-    if (get_option('geodir_show_author_top_section')) { ?>
2761
+	if (get_option('geodir_show_author_top_section')) { ?>
2762 2762
         <div
2763 2763
             class="<?php
2764
-            /** This action is documented in geodirectory_template_actions.php */
2765
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_top'); ?>">
2764
+			/** This action is documented in geodirectory_template_actions.php */
2765
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_top'); ?>">
2766 2766
             <?php dynamic_sidebar('geodir_author_top'); ?>
2767 2767
         </div><!-- clearfix ends here-->
2768 2768
     <?php }
@@ -2778,7 +2778,7 @@  discard block
 block discarded – undo
2778 2778
  */
2779 2779
 function geodir_author_left_section()
2780 2780
 {
2781
-    if (get_option('geodir_show_author_left_section')) { ?>
2781
+	if (get_option('geodir_show_author_left_section')) { ?>
2782 2782
         <div class="geodir-content-left geodir-sidebar-wrap">
2783 2783
             <?php dynamic_sidebar('geodir_author_left_sidebar'); ?>
2784 2784
         </div><!-- end geodir-content-left -->
@@ -2799,19 +2799,19 @@  discard block
 block discarded – undo
2799 2799
  */
2800 2800
 function geodir_action_author_sidebar_left()
2801 2801
 {
2802
-    if (get_option('geodir_show_author_left_section')) {
2802
+	if (get_option('geodir_show_author_left_section')) {
2803 2803
 // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
2804
-        /** This action is documented in geodirectory_template_actions.php */
2805
-        do_action('geodir_sidebar_left_open', 'author-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
2806
-        /**
2807
-         * This is used to add the content to the author page left sidebar (if active).
2808
-         *
2809
-         * @since 1.0.0
2810
-         */
2811
-        do_action('geodir_author_sidebar_left_inside');
2812
-        /** This action is documented in geodirectory_template_actions.php */
2813
-        do_action('geodir_sidebar_left_close', 'author-page');
2814
-    }
2804
+		/** This action is documented in geodirectory_template_actions.php */
2805
+		do_action('geodir_sidebar_left_open', 'author-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
2806
+		/**
2807
+		 * This is used to add the content to the author page left sidebar (if active).
2808
+		 *
2809
+		 * @since 1.0.0
2810
+		 */
2811
+		do_action('geodir_author_sidebar_left_inside');
2812
+		/** This action is documented in geodirectory_template_actions.php */
2813
+		do_action('geodir_sidebar_left_close', 'author-page');
2814
+	}
2815 2815
 }
2816 2816
 
2817 2817
 /**
@@ -2824,7 +2824,7 @@  discard block
 block discarded – undo
2824 2824
  */
2825 2825
 function geodir_author_right_section()
2826 2826
 {
2827
-    if (get_option('geodir_show_author_right_section')) { ?>
2827
+	if (get_option('geodir_show_author_right_section')) { ?>
2828 2828
         <div class="geodir-content-right geodir-sidebar-wrap">
2829 2829
             <?php dynamic_sidebar('geodir_author_right_sidebar'); ?>
2830 2830
         </div><!-- end geodir-content-right -->
@@ -2844,18 +2844,18 @@  discard block
 block discarded – undo
2844 2844
  */
2845 2845
 function geodir_action_author_sidebar_right()
2846 2846
 {
2847
-    if (get_option('geodir_show_author_right_section')) {
2848
-        /** This action is documented in geodirectory_template_actions.php */
2849
-        do_action('geodir_sidebar_right_open', 'author-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
2850
-        /**
2851
-         * This is used to add the content to the author page right sidebar (if active).
2852
-         *
2853
-         * @since 1.0.0
2854
-         */
2855
-        do_action('geodir_author_sidebar_right_inside');
2856
-        /** This action is documented in geodirectory_template_actions.php */
2857
-        do_action('geodir_sidebar_right_close', 'author-page');
2858
-    }
2847
+	if (get_option('geodir_show_author_right_section')) {
2848
+		/** This action is documented in geodirectory_template_actions.php */
2849
+		do_action('geodir_sidebar_right_open', 'author-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
2850
+		/**
2851
+		 * This is used to add the content to the author page right sidebar (if active).
2852
+		 *
2853
+		 * @since 1.0.0
2854
+		 */
2855
+		do_action('geodir_author_sidebar_right_inside');
2856
+		/** This action is documented in geodirectory_template_actions.php */
2857
+		do_action('geodir_sidebar_right_close', 'author-page');
2858
+	}
2859 2859
 }
2860 2860
 
2861 2861
 /**
@@ -2867,14 +2867,14 @@  discard block
 block discarded – undo
2867 2867
  */
2868 2868
 function geodir_action_author_content_inside()
2869 2869
 {
2870
-    global $gridview_columns;
2871
-    $listing_view = get_option('geodir_author_view');
2872
-    if (strstr($listing_view, 'gridview')) {
2873
-        $gridview_columns = $listing_view;
2874
-        $listing_view_exp = explode('_', $listing_view);
2875
-        $listing_view = $listing_view_exp[0];
2876
-    }
2877
-    geodir_get_template_part('listing', 'listview');
2870
+	global $gridview_columns;
2871
+	$listing_view = get_option('geodir_author_view');
2872
+	if (strstr($listing_view, 'gridview')) {
2873
+		$gridview_columns = $listing_view;
2874
+		$listing_view_exp = explode('_', $listing_view);
2875
+		$listing_view = $listing_view_exp[0];
2876
+	}
2877
+	geodir_get_template_part('listing', 'listview');
2878 2878
 }
2879 2879
 
2880 2880
 add_action('geodir_author_content_inside', 'geodir_action_author_content_inside', 10);
@@ -2889,22 +2889,22 @@  discard block
 block discarded – undo
2889 2889
  */
2890 2890
 function geodir_action_author_content()
2891 2891
 {
2892
-    /** This action is documented in geodirectory_template_actions.php */
2893
-    do_action('geodir_main_content_open', 'author-page', 'geodir-main-content', 'author-page');
2894
-    echo '<div class="clearfix">';
2895
-    /** This action is documented in geodirectory_template_actions.php */
2896
-    do_action('geodir_before_listing');
2897
-    echo '</div>';
2898
-    /**
2899
-     * This is used to add the content to the author page main content.
2900
-     *
2901
-     * @since 1.0.0
2902
-     */
2903
-    do_action('geodir_author_content_inside');
2904
-    /** This action is documented in geodirectory_template_actions.php */
2905
-    do_action('geodir_after_listing');
2906
-    /** This action is documented in geodirectory_template_actions.php */
2907
-    do_action('geodir_main_content_close', 'author-page');
2892
+	/** This action is documented in geodirectory_template_actions.php */
2893
+	do_action('geodir_main_content_open', 'author-page', 'geodir-main-content', 'author-page');
2894
+	echo '<div class="clearfix">';
2895
+	/** This action is documented in geodirectory_template_actions.php */
2896
+	do_action('geodir_before_listing');
2897
+	echo '</div>';
2898
+	/**
2899
+	 * This is used to add the content to the author page main content.
2900
+	 *
2901
+	 * @since 1.0.0
2902
+	 */
2903
+	do_action('geodir_author_content_inside');
2904
+	/** This action is documented in geodirectory_template_actions.php */
2905
+	do_action('geodir_after_listing');
2906
+	/** This action is documented in geodirectory_template_actions.php */
2907
+	do_action('geodir_main_content_close', 'author-page');
2908 2908
 }
2909 2909
 
2910 2910
 add_action('geodir_sidebar_author_bottom_section', 'geodir_action_sidebar_author_bottom_section', 10);
@@ -2918,11 +2918,11 @@  discard block
 block discarded – undo
2918 2918
  */
2919 2919
 function geodir_action_sidebar_author_bottom_section()
2920 2920
 {
2921
-    if (get_option('geodir_show_author_bottom_section')) { ?>
2921
+	if (get_option('geodir_show_author_bottom_section')) { ?>
2922 2922
         <div
2923 2923
             class="<?php
2924
-            /** This action is documented in geodirectory_template_actions.php */
2925
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_bottom'); ?>">
2924
+			/** This action is documented in geodirectory_template_actions.php */
2925
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_author_bottom'); ?>">
2926 2926
             <?php dynamic_sidebar('geodir_author_bottom'); ?>
2927 2927
         </div><!-- clearfix ends here-->
2928 2928
     <?php }
@@ -2941,23 +2941,23 @@  discard block
 block discarded – undo
2941 2941
  */
2942 2942
 function geodir_action_search_page_title()
2943 2943
 {
2944
-    $gd_post_type = geodir_get_current_posttype();
2945
-    $post_type_info = get_post_type_object($gd_post_type);
2944
+	$gd_post_type = geodir_get_current_posttype();
2945
+	$post_type_info = get_post_type_object($gd_post_type);
2946 2946
 
2947
-    $pt_name = '';
2948
-    if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;}
2947
+	$pt_name = '';
2948
+	if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;}
2949 2949
 
2950
-    if (is_search()) {
2951
-        $list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2950
+	if (is_search()) {
2951
+		$list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2952 2952
 
2953
-    }
2954
-    /** This action is documented in geodirectory_template_actions.php */
2955
-    $class = apply_filters('geodir_page_title_class', 'entry-title fn');
2956
-    /** This action is documented in geodirectory_template_actions.php */
2957
-    $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2958
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2959
-        /** This action is documented in geodirectory_template_actions.php */
2960
-        apply_filters('geodir_listing_page_title', wptexturize($list_title)) . '</h1></header>';
2953
+	}
2954
+	/** This action is documented in geodirectory_template_actions.php */
2955
+	$class = apply_filters('geodir_page_title_class', 'entry-title fn');
2956
+	/** This action is documented in geodirectory_template_actions.php */
2957
+	$class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2958
+	echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2959
+		/** This action is documented in geodirectory_template_actions.php */
2960
+		apply_filters('geodir_listing_page_title', wptexturize($list_title)) . '</h1></header>';
2961 2961
 }
2962 2962
 
2963 2963
 // action for adding the listings page top widget area
@@ -2973,11 +2973,11 @@  discard block
 block discarded – undo
2973 2973
  */
2974 2974
 function geodir_action_geodir_sidebar_search_top()
2975 2975
 {
2976
-    if (get_option('geodir_show_search_top_section')) { ?>
2976
+	if (get_option('geodir_show_search_top_section')) { ?>
2977 2977
         <div
2978 2978
             class="<?php
2979
-            /** This action is documented in geodirectory_template_actions.php */
2980
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_top'); ?>">
2979
+			/** This action is documented in geodirectory_template_actions.php */
2980
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_top'); ?>">
2981 2981
             <?php dynamic_sidebar('geodir_search_top'); ?>
2982 2982
         </div><!-- clearfix ends here-->
2983 2983
     <?php }
@@ -2993,7 +2993,7 @@  discard block
 block discarded – undo
2993 2993
  */
2994 2994
 function geodir_search_left_section()
2995 2995
 {
2996
-    if (get_option('geodir_show_search_left_section')) { ?>
2996
+	if (get_option('geodir_show_search_left_section')) { ?>
2997 2997
         <div class="geodir-content-left geodir-sidebar-wrap">
2998 2998
             <?php dynamic_sidebar('geodir_search_left_sidebar'); ?>
2999 2999
         </div><!-- end geodir-content-left -->
@@ -3013,19 +3013,19 @@  discard block
 block discarded – undo
3013 3013
  */
3014 3014
 function geodir_action_search_sidebar_left()
3015 3015
 {
3016
-    if (get_option('geodir_show_search_left_section')) {
3016
+	if (get_option('geodir_show_search_left_section')) {
3017 3017
 // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
3018
-        /** This action is documented in geodirectory_template_actions.php */
3019
-        do_action('geodir_sidebar_left_open', 'search-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3020
-        /**
3021
-         * This is used to add the content to the search page left sidebar (if active).
3022
-         *
3023
-         * @since 1.0.0
3024
-         */
3025
-        do_action('geodir_search_sidebar_left_inside');
3026
-        /** This action is documented in geodirectory_template_actions.php */
3027
-        do_action('geodir_sidebar_left_close', 'search-page');
3028
-    }
3018
+		/** This action is documented in geodirectory_template_actions.php */
3019
+		do_action('geodir_sidebar_left_open', 'search-page', 'geodir-sidebar-left', 'geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3020
+		/**
3021
+		 * This is used to add the content to the search page left sidebar (if active).
3022
+		 *
3023
+		 * @since 1.0.0
3024
+		 */
3025
+		do_action('geodir_search_sidebar_left_inside');
3026
+		/** This action is documented in geodirectory_template_actions.php */
3027
+		do_action('geodir_sidebar_left_close', 'search-page');
3028
+	}
3029 3029
 }
3030 3030
 
3031 3031
 /**
@@ -3038,7 +3038,7 @@  discard block
 block discarded – undo
3038 3038
  */
3039 3039
 function geodir_search_right_section()
3040 3040
 {
3041
-    if (get_option('geodir_show_search_right_section')) { ?>
3041
+	if (get_option('geodir_show_search_right_section')) { ?>
3042 3042
         <div class="geodir-content-right geodir-sidebar-wrap">
3043 3043
             <?php dynamic_sidebar('geodir_search_right_sidebar'); ?>
3044 3044
         </div><!-- end geodir-content-right -->
@@ -3058,18 +3058,18 @@  discard block
 block discarded – undo
3058 3058
  */
3059 3059
 function geodir_action_search_sidebar_right()
3060 3060
 {
3061
-    if (get_option('geodir_show_search_right_section')) {
3062
-        /** This action is documented in geodirectory_template_actions.php */
3063
-        do_action('geodir_sidebar_right_open', 'search-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3064
-        /**
3065
-         * This is used to add the content to the search page right sidebar (if active).
3066
-         *
3067
-         * @since 1.0.0
3068
-         */
3069
-        do_action('geodir_search_sidebar_right_inside');
3070
-        /** This action is documented in geodirectory_template_actions.php */
3071
-        do_action('geodir_sidebar_right_close', 'search-page');
3072
-    }
3061
+	if (get_option('geodir_show_search_right_section')) {
3062
+		/** This action is documented in geodirectory_template_actions.php */
3063
+		do_action('geodir_sidebar_right_open', 'search-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3064
+		/**
3065
+		 * This is used to add the content to the search page right sidebar (if active).
3066
+		 *
3067
+		 * @since 1.0.0
3068
+		 */
3069
+		do_action('geodir_search_sidebar_right_inside');
3070
+		/** This action is documented in geodirectory_template_actions.php */
3071
+		do_action('geodir_sidebar_right_close', 'search-page');
3072
+	}
3073 3073
 }
3074 3074
 
3075 3075
 
@@ -3084,11 +3084,11 @@  discard block
 block discarded – undo
3084 3084
  */
3085 3085
 function geodir_action_sidebar_search_bottom_section()
3086 3086
 {
3087
-    if (get_option('geodir_show_search_bottom_section')) { ?>
3087
+	if (get_option('geodir_show_search_bottom_section')) { ?>
3088 3088
         <div
3089 3089
             class="<?php
3090
-            /** This action is documented in geodirectory_template_actions.php */
3091
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_bottom'); ?>">
3090
+			/** This action is documented in geodirectory_template_actions.php */
3091
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_search_bottom'); ?>">
3092 3092
             <?php dynamic_sidebar('geodir_search_bottom'); ?>
3093 3093
         </div><!-- clearfix ends here-->
3094 3094
     <?php }
@@ -3103,14 +3103,14 @@  discard block
 block discarded – undo
3103 3103
  */
3104 3104
 function geodir_action_search_content_inside()
3105 3105
 {
3106
-    global $gridview_columns;
3107
-    $listing_view = get_option('geodir_search_view');
3108
-    if (strstr($listing_view, 'gridview')) {
3109
-        $gridview_columns = $listing_view;
3110
-        $listing_view_exp = explode('_', $listing_view);
3111
-        $listing_view = $listing_view_exp[0];
3112
-    }
3113
-    geodir_get_template_part('listing', 'listview');
3106
+	global $gridview_columns;
3107
+	$listing_view = get_option('geodir_search_view');
3108
+	if (strstr($listing_view, 'gridview')) {
3109
+		$gridview_columns = $listing_view;
3110
+		$listing_view_exp = explode('_', $listing_view);
3111
+		$listing_view = $listing_view_exp[0];
3112
+	}
3113
+	geodir_get_template_part('listing', 'listview');
3114 3114
 }
3115 3115
 
3116 3116
 add_action('geodir_search_content_inside', 'geodir_action_search_content_inside', 10);
@@ -3126,22 +3126,22 @@  discard block
 block discarded – undo
3126 3126
  */
3127 3127
 function geodir_action_search_content()
3128 3128
 {
3129
-    /** This action is documented in geodirectory_template_actions.php */
3130
-    do_action('geodir_main_content_open', 'search-page', 'geodir-main-content', 'search-page');
3131
-    echo '<div class="clearfix">';
3132
-    /** This action is documented in geodirectory_template_actions.php */
3133
-    do_action('geodir_before_listing');
3134
-    echo '</div>';
3135
-    /**
3136
-     * This is used to add the content to the search page main content.
3137
-     *
3138
-     * @since 1.0.0
3139
-     */
3140
-    do_action('geodir_search_content_inside');
3141
-    /** This action is documented in geodirectory_template_actions.php */
3142
-    do_action('geodir_after_listing');
3143
-    /** This action is documented in geodirectory_template_actions.php */
3144
-    do_action('geodir_main_content_close', 'search-page');
3129
+	/** This action is documented in geodirectory_template_actions.php */
3130
+	do_action('geodir_main_content_open', 'search-page', 'geodir-main-content', 'search-page');
3131
+	echo '<div class="clearfix">';
3132
+	/** This action is documented in geodirectory_template_actions.php */
3133
+	do_action('geodir_before_listing');
3134
+	echo '</div>';
3135
+	/**
3136
+	 * This is used to add the content to the search page main content.
3137
+	 *
3138
+	 * @since 1.0.0
3139
+	 */
3140
+	do_action('geodir_search_content_inside');
3141
+	/** This action is documented in geodirectory_template_actions.php */
3142
+	do_action('geodir_after_listing');
3143
+	/** This action is documented in geodirectory_template_actions.php */
3144
+	do_action('geodir_main_content_close', 'search-page');
3145 3145
 }
3146 3146
 
3147 3147
 ###############################################
@@ -3164,11 +3164,11 @@  discard block
 block discarded – undo
3164 3164
  */
3165 3165
 function geodir_action_geodir_sidebar_home_top()
3166 3166
 {
3167
-    if (get_option('geodir_show_home_top_section')) { ?>
3167
+	if (get_option('geodir_show_home_top_section')) { ?>
3168 3168
         <div
3169 3169
             class="<?php
3170
-            /** This action is documented in geodirectory_template_actions.php */
3171
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_top'); ?>">
3170
+			/** This action is documented in geodirectory_template_actions.php */
3171
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_top'); ?>">
3172 3172
             <?php dynamic_sidebar('geodir_home_top'); ?>
3173 3173
         </div><!-- clearfix ends here-->
3174 3174
     <?php }
@@ -3184,7 +3184,7 @@  discard block
 block discarded – undo
3184 3184
  */
3185 3185
 function geodir_home_left_section()
3186 3186
 {
3187
-    if (get_option('geodir_show_home_left_section')) { ?>
3187
+	if (get_option('geodir_show_home_left_section')) { ?>
3188 3188
         <div class="geodir-content-left geodir-sidebar-wrap">
3189 3189
             <?php dynamic_sidebar('geodir_home_left'); ?>
3190 3190
         </div><!-- end geodir-content-left -->
@@ -3206,19 +3206,19 @@  discard block
 block discarded – undo
3206 3206
  */
3207 3207
 function geodir_action_home_sidebar_left()
3208 3208
 {
3209
-    if (get_option('geodir_show_home_left_section')) {
3209
+	if (get_option('geodir_show_home_left_section')) {
3210 3210
 // this adds the opening html tags to the primary div, this required the closing tag below :: ($type='',$id='',$class='',$itemtype='')
3211
-        /** This action is documented in geodirectory_template_actions.php */
3212
-        do_action('geodir_sidebar_left_open', 'home-page', 'geodir-sidebar-left', 'geodir-sidebar geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3213
-        /**
3214
-         * This is used to add the content to the home page left sidebar (if active).
3215
-         *
3216
-         * @since 1.0.0
3217
-         */
3218
-        do_action('geodir_home_sidebar_left_inside');
3219
-        /** This action is documented in geodirectory_template_actions.php */
3220
-        do_action('geodir_sidebar_left_close', 'home-page');
3221
-    }
3211
+		/** This action is documented in geodirectory_template_actions.php */
3212
+		do_action('geodir_sidebar_left_open', 'home-page', 'geodir-sidebar-left', 'geodir-sidebar geodir-sidebar-left geodir-listings-sidebar-left', 'http://schema.org/WPSideBar');
3213
+		/**
3214
+		 * This is used to add the content to the home page left sidebar (if active).
3215
+		 *
3216
+		 * @since 1.0.0
3217
+		 */
3218
+		do_action('geodir_home_sidebar_left_inside');
3219
+		/** This action is documented in geodirectory_template_actions.php */
3220
+		do_action('geodir_sidebar_left_close', 'home-page');
3221
+	}
3222 3222
 }
3223 3223
 
3224 3224
 /**
@@ -3231,7 +3231,7 @@  discard block
 block discarded – undo
3231 3231
  */
3232 3232
 function geodir_home_right_section()
3233 3233
 {
3234
-    if (get_option('geodir_show_home_right_section')) { ?>
3234
+	if (get_option('geodir_show_home_right_section')) { ?>
3235 3235
         <div class="geodir-content-right geodir-sidebar-wrap">
3236 3236
             <?php dynamic_sidebar('geodir_home_right'); ?>
3237 3237
         </div><!-- end geodir-content-right -->
@@ -3252,18 +3252,18 @@  discard block
 block discarded – undo
3252 3252
  */
3253 3253
 function geodir_action_home_sidebar_right()
3254 3254
 {
3255
-    if (get_option('geodir_show_home_right_section')) {
3256
-        /** This action is documented in geodirectory_template_actions.php */
3257
-        do_action('geodir_sidebar_right_open', 'home-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3258
-        /**
3259
-         * This is used to add the content to the home page right sidebar (if active).
3260
-         *
3261
-         * @since 1.0.0
3262
-         */
3263
-        do_action('geodir_home_sidebar_right_inside');
3264
-        /** This action is documented in geodirectory_template_actions.php */
3265
-        do_action('geodir_sidebar_right_close', 'home-page');
3266
-    }
3255
+	if (get_option('geodir_show_home_right_section')) {
3256
+		/** This action is documented in geodirectory_template_actions.php */
3257
+		do_action('geodir_sidebar_right_open', 'home-page', 'geodir-sidebar-right', 'geodir-sidebar-right geodir-listings-sidebar-right', 'http://schema.org/WPSideBar');
3258
+		/**
3259
+		 * This is used to add the content to the home page right sidebar (if active).
3260
+		 *
3261
+		 * @since 1.0.0
3262
+		 */
3263
+		do_action('geodir_home_sidebar_right_inside');
3264
+		/** This action is documented in geodirectory_template_actions.php */
3265
+		do_action('geodir_sidebar_right_close', 'home-page');
3266
+	}
3267 3267
 }
3268 3268
 
3269 3269
 /**
@@ -3274,7 +3274,7 @@  discard block
 block discarded – undo
3274 3274
  */
3275 3275
 function geodir_action_home_content_inside()
3276 3276
 {
3277
-    dynamic_sidebar('geodir_home_content');
3277
+	dynamic_sidebar('geodir_home_content');
3278 3278
 }
3279 3279
 
3280 3280
 add_action('geodir_home_content_inside', 'geodir_action_home_content_inside', 10);
@@ -3289,28 +3289,28 @@  discard block
 block discarded – undo
3289 3289
  */
3290 3290
 function geodir_action_home_content()
3291 3291
 {
3292
-    /** This action is documented in geodirectory_template_actions.php */
3293
-    do_action('geodir_main_content_open', 'home-page', 'geodir-main-content', 'home-page');
3294
-    /**
3295
-     * This called before the home page main content.
3296
-     *
3297
-     * @since 1.0.0
3298
-     */
3299
-    do_action('geodir_before_home_content');
3300
-    /**
3301
-     * This is used to add the content to the home page main content.
3302
-     *
3303
-     * @since 1.0.0
3304
-     */
3305
-    do_action('geodir_home_content_inside');
3306
-    /**
3307
-     * This is called after the homepage main content.
3308
-     *
3309
-     * @since 1.0.0
3310
-     */
3311
-    do_action('geodir_after_home_content');
3312
-    /** This action is documented in geodirectory_template_actions.php */
3313
-    do_action('geodir_main_content_close', 'home-page');
3292
+	/** This action is documented in geodirectory_template_actions.php */
3293
+	do_action('geodir_main_content_open', 'home-page', 'geodir-main-content', 'home-page');
3294
+	/**
3295
+	 * This called before the home page main content.
3296
+	 *
3297
+	 * @since 1.0.0
3298
+	 */
3299
+	do_action('geodir_before_home_content');
3300
+	/**
3301
+	 * This is used to add the content to the home page main content.
3302
+	 *
3303
+	 * @since 1.0.0
3304
+	 */
3305
+	do_action('geodir_home_content_inside');
3306
+	/**
3307
+	 * This is called after the homepage main content.
3308
+	 *
3309
+	 * @since 1.0.0
3310
+	 */
3311
+	do_action('geodir_after_home_content');
3312
+	/** This action is documented in geodirectory_template_actions.php */
3313
+	do_action('geodir_main_content_close', 'home-page');
3314 3314
 }
3315 3315
 
3316 3316
 add_action('geodir_sidebar_location_bottom_section', 'geodir_action_sidebar_home_bottom_section', 10);
@@ -3325,11 +3325,11 @@  discard block
 block discarded – undo
3325 3325
  */
3326 3326
 function geodir_action_sidebar_home_bottom_section()
3327 3327
 {
3328
-    if (get_option('geodir_show_home_bottom_section')) { ?>
3328
+	if (get_option('geodir_show_home_bottom_section')) { ?>
3329 3329
         <div
3330 3330
             class="<?php
3331
-            /** This action is documented in geodirectory_template_actions.php */
3332
-            echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_bottom'); ?>">
3331
+			/** This action is documented in geodirectory_template_actions.php */
3332
+			echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'geodir_home_bottom'); ?>">
3333 3333
             <?php dynamic_sidebar('geodir_home_bottom'); ?>
3334 3334
         </div><!-- clearfix ends here-->
3335 3335
     <?php }
@@ -3357,13 +3357,13 @@  discard block
 block discarded – undo
3357 3357
  */
3358 3358
 function geodir_filter_listing_page_title($list_title)
3359 3359
 {
3360
-    if (is_search() && trim(get_search_query()) == '') {
3361
-        $gd_post_type = geodir_get_current_posttype();
3362
-        $post_type_info = get_post_type_object($gd_post_type);
3360
+	if (is_search() && trim(get_search_query()) == '') {
3361
+		$gd_post_type = geodir_get_current_posttype();
3362
+		$post_type_info = get_post_type_object($gd_post_type);
3363 3363
 
3364
-        $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' :', 'geodirectory');
3365
-    }
3366
-    return $list_title;
3364
+		$list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' :', 'geodirectory');
3365
+	}
3366
+	return $list_title;
3367 3367
 }
3368 3368
 
3369 3369
 add_action('geodir_message_not_found_on_listing', 'geodir_display_message_not_found_on_listing');
@@ -3378,61 +3378,61 @@  discard block
 block discarded – undo
3378 3378
  * @param string $gd_page The geodirectory page type. Default null.
3379 3379
  */
3380 3380
 function geodir_add_page_content( $position = 'before', $gd_page = '' ) {
3381
-    global $post;
3381
+	global $post;
3382 3382
         
3383
-    $gd_page_id = NULL;
3384
-    if ($gd_page == 'home-page' && geodir_is_page('home')) {
3385
-        $gd_page_id = geodir_home_page_id();
3386
-    } else if ($gd_page == 'details-page' && geodir_is_page('preview')) {
3387
-        $gd_page_id = geodir_preview_page_id();
3388
-    } else if ($gd_page == 'add-listing-page' && geodir_is_page('add-listing')) {
3389
-        $gd_page_id = geodir_add_listing_page_id();
3390
-    } else if ($gd_page == 'success-page' && geodir_is_page('listing-success')) {
3391
-        $gd_page_id = geodir_success_page_id();
3392
-    } else if ($gd_page == 'location-page' && geodir_is_page('location')) {
3393
-        $gd_page_id = geodir_location_page_id();
3394
-    } else if ($gd_page == 'info-page' && geodir_is_page('info')) {
3395
-        $gd_page_id = geodir_info_page_id();
3396
-    } else if ($gd_page == 'signup-page' && geodir_is_page('login')) {
3397
-        $gd_page_id = geodir_login_page_id();
3398
-    } else if ($gd_page == 'checkout-page' && geodir_is_page('checkout')) {
3399
-        $gd_page_id = geodir_payment_checkout_page_id();
3400
-    } else if ($gd_page == 'invoices-page' && geodir_is_page('invoices')) {
3401
-        $gd_page_id = geodir_payment_invoices_page_id();
3402
-    }
3383
+	$gd_page_id = NULL;
3384
+	if ($gd_page == 'home-page' && geodir_is_page('home')) {
3385
+		$gd_page_id = geodir_home_page_id();
3386
+	} else if ($gd_page == 'details-page' && geodir_is_page('preview')) {
3387
+		$gd_page_id = geodir_preview_page_id();
3388
+	} else if ($gd_page == 'add-listing-page' && geodir_is_page('add-listing')) {
3389
+		$gd_page_id = geodir_add_listing_page_id();
3390
+	} else if ($gd_page == 'success-page' && geodir_is_page('listing-success')) {
3391
+		$gd_page_id = geodir_success_page_id();
3392
+	} else if ($gd_page == 'location-page' && geodir_is_page('location')) {
3393
+		$gd_page_id = geodir_location_page_id();
3394
+	} else if ($gd_page == 'info-page' && geodir_is_page('info')) {
3395
+		$gd_page_id = geodir_info_page_id();
3396
+	} else if ($gd_page == 'signup-page' && geodir_is_page('login')) {
3397
+		$gd_page_id = geodir_login_page_id();
3398
+	} else if ($gd_page == 'checkout-page' && geodir_is_page('checkout')) {
3399
+		$gd_page_id = geodir_payment_checkout_page_id();
3400
+	} else if ($gd_page == 'invoices-page' && geodir_is_page('invoices')) {
3401
+		$gd_page_id = geodir_payment_invoices_page_id();
3402
+	}
3403 3403
     
3404
-    if (!$gd_page_id > 0) {
3405
-        return;
3406
-    }
3404
+	if (!$gd_page_id > 0) {
3405
+		return;
3406
+	}
3407 3407
     
3408
-    $display = 'before';
3409
-    /**
3410
-     * Filter the position to display the page content.
3411
-     *
3412
-     * @since 1.6.3
3413
-     *
3414
-     * @param string $display Position to add the post content.
3415
-     * @param string $gd_page The geodirectory page type.
3416
-     */
3417
-    $display = apply_filters('geodir_add_page_content_position', $display, $gd_page);
3408
+	$display = 'before';
3409
+	/**
3410
+	 * Filter the position to display the page content.
3411
+	 *
3412
+	 * @since 1.6.3
3413
+	 *
3414
+	 * @param string $display Position to add the post content.
3415
+	 * @param string $gd_page The geodirectory page type.
3416
+	 */
3417
+	$display = apply_filters('geodir_add_page_content_position', $display, $gd_page);
3418 3418
     
3419
-    if ($position !== $display) {
3420
-        return;
3421
-    }
3419
+	if ($position !== $display) {
3420
+		return;
3421
+	}
3422 3422
         
3423
-    $gd_post = $post;
3423
+	$gd_post = $post;
3424 3424
     
3425
-    setup_postdata(get_post($gd_page_id));
3425
+	setup_postdata(get_post($gd_page_id));
3426 3426
     
3427
-    if (get_the_content()) {
3428
-        ?>
3427
+	if (get_the_content()) {
3428
+		?>
3429 3429
         <section class="entry-content clearfix" itemprop="articleBody"><?php the_content(); ?></section>
3430 3430
         <?php
3431
-    }
3431
+	}
3432 3432
     
3433
-    $post = $gd_post;
3434
-    if (!empty($gd_post) && is_object($gd_post)) {
3435
-        setup_postdata($gd_post);
3436
-    }
3433
+	$post = $gd_post;
3434
+	if (!empty($gd_post) && is_object($gd_post)) {
3435
+		setup_postdata($gd_post);
3436
+	}
3437 3437
 }
3438 3438
 add_action('geodir_add_page_content', 'geodir_add_page_content', 10, 2);
3439 3439
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +163 added lines, -163 removed lines patch added patch discarded remove patch
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
 
283 283
     //php
284 284
     if (!empty($tc['geodir_theme_compat_code'])) {
285
-        include_once('geodirectory-functions/compatibility/' . $tc['geodir_theme_compat_code'] . '.php');
285
+        include_once('geodirectory-functions/compatibility/'.$tc['geodir_theme_compat_code'].'.php');
286 286
     }
287 287
 
288 288
     //geodir_full_page_class
@@ -452,13 +452,13 @@  discard block
 block discarded – undo
452 452
 function geodir_action_wrapper_content_open($type = '', $id = '', $class = '')
453 453
 {
454 454
     if ($type == 'home-page' && $width = get_option('geodir_width_home_contant_section')) {
455
-        $width_css = 'style="width:' . $width . '%;"';
455
+        $width_css = 'style="width:'.$width.'%;"';
456 456
     } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_contant_section')) {
457
-        $width_css = 'style="width:' . $width . '%;"';
457
+        $width_css = 'style="width:'.$width.'%;"';
458 458
     } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_contant_section')) {
459
-        $width_css = 'style="width:' . $width . '%;"';
459
+        $width_css = 'style="width:'.$width.'%;"';
460 460
     } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_contant_section')) {
461
-        $width_css = 'style="width:' . $width . '%;"';
461
+        $width_css = 'style="width:'.$width.'%;"';
462 462
     } else {
463 463
         $width_css = '';
464 464
     }
@@ -572,13 +572,13 @@  discard block
 block discarded – undo
572 572
 function geodir_action_sidebar_right_open($type = '', $id = '', $class = '', $itemtype = '')
573 573
 {
574 574
     if ($type == 'home-page' && $width = get_option('geodir_width_home_right_section')) {
575
-        $width_css = 'style="width:' . $width . '%;"';
575
+        $width_css = 'style="width:'.$width.'%;"';
576 576
     } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_right_section')) {
577
-        $width_css = 'style="width:' . $width . '%;"';
577
+        $width_css = 'style="width:'.$width.'%;"';
578 578
     } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_right_section')) {
579
-        $width_css = 'style="width:' . $width . '%;"';
579
+        $width_css = 'style="width:'.$width.'%;"';
580 580
     } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_right_section')) {
581
-        $width_css = 'style="width:' . $width . '%;"';
581
+        $width_css = 'style="width:'.$width.'%;"';
582 582
     } else {
583 583
         $width_css = '';
584 584
     }
@@ -676,7 +676,7 @@  discard block
 block discarded – undo
676 676
         }
677 677
     }
678 678
 
679
-    $post = (object)$_REQUEST;
679
+    $post = (object) $_REQUEST;
680 680
 
681 681
 
682 682
     if (isset($post->video)) {
@@ -735,10 +735,10 @@  discard block
 block discarded – undo
735 735
 
736 736
     $json = '{';
737 737
     $json .= '"post_preview": "1",';
738
-    $json .= '"t": "' . $json_title . '",';
739
-    $json .= '"lt": "' . $post_latitude . '",';
740
-    $json .= '"ln": "' . $post_longitude . '",';
741
-    $json .= '"i":"' . $term_icon . '"';
738
+    $json .= '"t": "'.$json_title.'",';
739
+    $json .= '"lt": "'.$post_latitude.'",';
740
+    $json .= '"ln": "'.$post_longitude.'",';
741
+    $json .= '"i":"'.$term_icon.'"';
742 742
     $json .= '}';
743 743
 
744 744
     $post->marker_json = $json;
@@ -965,7 +965,7 @@  discard block
 block discarded – undo
965 965
      * @param string $class The class to use. Default is 'entry-header'.
966 966
      */
967 967
     $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
968
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' . stripslashes(get_the_title()) . '</h1></header>';
968
+    echo '<header class="'.$class_header.'"><h1 class="'.$class.'">'.stripslashes(get_the_title()).'</h1></header>';
969 969
 }
970 970
 
971 971
 
@@ -1019,7 +1019,7 @@  discard block
 block discarded – undo
1019 1019
                     $height = !empty($sizes) && isset($sizes[1]) ? $sizes[1] : 0;
1020 1020
 
1021 1021
                     if ($image && $width && $height) {
1022
-                        $image = (object)array('src' => $image, 'width' => $width, 'height' => $height);
1022
+                        $image = (object) array('src' => $image, 'width' => $width, 'height' => $height);
1023 1023
                     }
1024 1024
 
1025 1025
                     if (isset($image->src)) {
@@ -1031,9 +1031,9 @@  discard block
 block discarded – undo
1031 1031
 
1032 1032
                         $image_title = isset($image->title) ? $image->title : '';
1033 1033
 
1034
-                        $main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />';
1035
-                        $main_slides .= '<img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:400px;margin:0 auto;" /></li>';
1036
-                        $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image_title . '" title="' . $image_title . '" style="max-height:48px;margin:0 auto;" /></li>';
1034
+                        $main_slides .= '<li><img src="'.geodir_plugin_url()."/geodirectory-assets/images/spacer.gif".'" alt="'.$image_title.'" title="'.$image_title.'" style="max-height:'.$spacer_height.'px;margin:0 auto;" />';
1035
+                        $main_slides .= '<img src="'.$image->src.'" alt="'.$image_title.'" title="'.$image_title.'" style="max-height:400px;margin:0 auto;" /></li>';
1036
+                        $nav_slides .= '<li><img src="'.$image->src.'" alt="'.$image_title.'" title="'.$image_title.'" style="max-height:48px;margin:0 auto;" /></li>';
1037 1037
                         $slides++;
1038 1038
                     }
1039 1039
                 }
@@ -1052,10 +1052,10 @@  discard block
 block discarded – undo
1052 1052
                 } else {
1053 1053
                     $spacer_height = ((400 - $image->height) / 2);
1054 1054
                 }
1055
-                $caption = '';//(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : '';
1056
-                $main_slides .= '<li><img src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:' . $spacer_height . 'px;margin:0 auto;" />';
1057
-                $main_slides .= '<img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>';
1058
-                $nav_slides .= '<li><img src="' . $image->src . '" alt="' . $image->title . '" title="' . $image->title . '" style="max-height:48px;margin:0 auto;" /></li>';
1055
+                $caption = ''; //(!empty($image->caption)) ? '<p class="flex-caption">'.$image->caption.'</p>' : '';
1056
+                $main_slides .= '<li><img src="'.geodir_plugin_url()."/geodirectory-assets/images/spacer.gif".'" alt="'.$image->title.'" title="'.$image->title.'" style="max-height:'.$spacer_height.'px;margin:0 auto;" />';
1057
+                $main_slides .= '<img src="'.$image->src.'" alt="'.$image->title.'" title="'.$image->title.'" style="max-height:400px;margin:0 auto;" />'.$caption.'</li>';
1058
+                $nav_slides .= '<li><img src="'.$image->src.'" alt="'.$image->title.'" title="'.$image->title.'" style="max-height:48px;margin:0 auto;" /></li>';
1059 1059
                 $slides++;
1060 1060
             }
1061 1061
         }// endfore
@@ -1090,7 +1090,7 @@  discard block
 block discarded – undo
1090 1090
  */
1091 1091
 function geodir_action_details_taxonomies()
1092 1092
 {
1093
-    global $preview, $post;?>
1093
+    global $preview, $post; ?>
1094 1094
     <p class="geodir_post_taxomomies clearfix">
1095 1095
     <?php
1096 1096
     $taxonomies = array();
@@ -1099,11 +1099,11 @@  discard block
 block discarded – undo
1099 1099
 
1100 1100
     if ($preview && !$is_backend_preview) {
1101 1101
         $post_type = $post->listing_type;
1102
-        $post_taxonomy = $post_type . 'category';
1102
+        $post_taxonomy = $post_type.'category';
1103 1103
         $post->{$post_taxonomy} = $post->post_category[$post_taxonomy];
1104 1104
     } else {
1105 1105
         $post_type = $post->post_type;
1106
-        $post_taxonomy = $post_type . 'category';
1106
+        $post_taxonomy = $post_type.'category';
1107 1107
     }
1108 1108
 //{	
1109 1109
     $post_type_info = get_post_type_object($post_type);
@@ -1111,7 +1111,7 @@  discard block
 block discarded – undo
1111 1111
 
1112 1112
     if (!empty($post->post_tags)) {
1113 1113
 
1114
-        if (taxonomy_exists($post_type . '_tags')):
1114
+        if (taxonomy_exists($post_type.'_tags')):
1115 1115
             $links = array();
1116 1116
             $terms = array();
1117 1117
             // to limit post tags
@@ -1138,8 +1138,8 @@  discard block
 block discarded – undo
1138 1138
                 $post_term = trim($post_term);
1139 1139
 
1140 1140
                 $priority_location = false;
1141
-                if ($insert_term = term_exists($post_term, $post_type . '_tags')) {
1142
-                    $term = get_term_by('id', $insert_term['term_id'], $post_type . '_tags');
1141
+                if ($insert_term = term_exists($post_term, $post_type.'_tags')) {
1142
+                    $term = get_term_by('id', $insert_term['term_id'], $post_type.'_tags');
1143 1143
                 } else {
1144 1144
                     $post_country = isset($_REQUEST['post_country']) && $_REQUEST['post_country'] != '' ? sanitize_text_field($_REQUEST['post_country']) : NULL;
1145 1145
                     $post_region = isset($_REQUEST['post_region']) && $_REQUEST['post_region'] != '' ? sanitize_text_field($_REQUEST['post_region']) : NULL;
@@ -1149,10 +1149,10 @@  discard block
 block discarded – undo
1149 1149
                     $match_city = $post_city && sanitize_title($post_term) == sanitize_title($post_city) ? true : false;
1150 1150
                     if ($match_country || $match_region || $match_city) {
1151 1151
                         $priority_location = true;
1152
-                        $term = get_term_by('name', $post_term, $post_type . '_tags');
1152
+                        $term = get_term_by('name', $post_term, $post_type.'_tags');
1153 1153
                     } else {
1154
-                        $insert_term = wp_insert_term($post_term, $post_type . '_tags');
1155
-                        $term = get_term_by('name', $post_term, $post_type . '_tags');
1154
+                        $insert_term = wp_insert_term($post_term, $post_type.'_tags');
1155
+                        $term = get_term_by('name', $post_term, $post_type.'_tags');
1156 1156
                     }
1157 1157
                 }
1158 1158
 
@@ -1169,12 +1169,12 @@  discard block
 block discarded – undo
1169 1169
                          * @param string $tag_link The tag link html.
1170 1170
                          * @param object $term The tag term object.
1171 1171
                          */
1172
-                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1172
+                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link', $tag_link, $term);
1173 1173
                         $links[] = $tag_link;
1174 1174
                     } else {
1175
-                        $tag_link = "<a href='" . esc_attr(get_term_link($term->term_id, $term->taxonomy)) . "'>$term->name</a>";
1175
+                        $tag_link = "<a href='".esc_attr(get_term_link($term->term_id, $term->taxonomy))."'>$term->name</a>";
1176 1176
                         /** This action is documented in geodirectory-template_actions.php */
1177
-                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link',$tag_link,$term);
1177
+                        $tag_link = apply_filters('geodir_details_taxonomies_tag_link', $tag_link, $term);
1178 1178
                         $links[] = $tag_link;
1179 1179
                     }
1180 1180
                     $terms[] = $term;
@@ -1184,7 +1184,7 @@  discard block
 block discarded – undo
1184 1184
             if (!isset($listing_label)) {
1185 1185
                 $listing_label = '';
1186 1186
             }
1187
-            $taxonomies[$post_type . '_tags'] = wp_sprintf(__('%s Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1187
+            $taxonomies[$post_type.'_tags'] = wp_sprintf(__('%s Tags: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object) $terms);
1188 1188
         endif;
1189 1189
 
1190 1190
     }
@@ -1212,7 +1212,7 @@  discard block
 block discarded – undo
1212 1212
                     $term = get_term_by('id', $post_term, $post_taxonomy);
1213 1213
 
1214 1214
                     if (is_object($term)) {
1215
-                        $term_link = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>$term->name</a>";
1215
+                        $term_link = "<a href='".esc_attr(get_term_link($term, $post_taxonomy))."'>$term->name</a>";
1216 1216
                         /**
1217 1217
                          * Filter the category name on the details page.
1218 1218
                          *
@@ -1220,7 +1220,7 @@  discard block
 block discarded – undo
1220 1220
                          * @param string $term_link The link html to the category.
1221 1221
                          * @param object $term The category term object.
1222 1222
                          */
1223
-                        $term_link = apply_filters('geodir_details_taxonomies_cat_link',$term_link,$term);
1223
+                        $term_link = apply_filters('geodir_details_taxonomies_cat_link', $term_link, $term);
1224 1224
                         $links[] = $term_link;
1225 1225
                         $terms[] = $term;
1226 1226
                     }
@@ -1238,7 +1238,7 @@  discard block
 block discarded – undo
1238 1238
         if (!isset($listing_label)) {
1239 1239
             $listing_label = '';
1240 1240
         }
1241
-        $taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object)$terms);
1241
+        $taxonomies[$post_taxonomy] = wp_sprintf(__('%s Category: %l', 'geodirectory'), geodir_ucwords($listing_label), $links, (object) $terms);
1242 1242
 
1243 1243
     }
1244 1244
 
@@ -1251,14 +1251,14 @@  discard block
 block discarded – undo
1251 1251
      * @param string $listing_label The post type label.
1252 1252
      * @param string $listing_label The post type label with ucwords function.
1253 1253
      */
1254
-    $taxonomies = apply_filters('geodir_details_taxonomies_output',$taxonomies,$post_type,$listing_label,geodir_ucwords($listing_label));
1254
+    $taxonomies = apply_filters('geodir_details_taxonomies_output', $taxonomies, $post_type, $listing_label, geodir_ucwords($listing_label));
1255 1255
 
1256 1256
     if (isset($taxonomies[$post_taxonomy])) {
1257
-        echo '<span class="geodir-category">' . $taxonomies[$post_taxonomy] . '</span>';
1257
+        echo '<span class="geodir-category">'.$taxonomies[$post_taxonomy].'</span>';
1258 1258
     }
1259 1259
 
1260
-    if (isset($taxonomies[$post_type . '_tags']))
1261
-        echo '<span class="geodir-tags">' . $taxonomies[$post_type . '_tags'] . '</span>';
1260
+    if (isset($taxonomies[$post_type.'_tags']))
1261
+        echo '<span class="geodir-tags">'.$taxonomies[$post_type.'_tags'].'</span>';
1262 1262
 
1263 1263
     ?>
1264 1264
     </p><?php
@@ -1279,11 +1279,11 @@  discard block
 block discarded – undo
1279 1279
  * @param object $post Optional. The post object or blank.
1280 1280
  * @package GeoDirectory
1281 1281
  */
1282
-function geodir_action_details_micordata($post='')
1282
+function geodir_action_details_micordata($post = '')
1283 1283
 {
1284 1284
 
1285 1285
     global $preview;
1286
-    if(empty($post)){global $post;}
1286
+    if (empty($post)) {global $post; }
1287 1287
     if ($preview || !geodir_is_page('detail')) {
1288 1288
         return;
1289 1289
     }
@@ -1304,7 +1304,7 @@  discard block
 block discarded – undo
1304 1304
                 "description" => $review->comment_content,
1305 1305
                 "reviewRating" => array(
1306 1306
                     "@type" => "Rating",
1307
-                    "bestRating" => "5",// @todo this will need to be filtered for review manager if user changes the score.
1307
+                    "bestRating" => "5", // @todo this will need to be filtered for review manager if user changes the score.
1308 1308
                     "ratingValue" => geodir_get_commentoverall($review->comment_ID),
1309 1309
                     "worstRating" => "1"
1310 1310
                 )
@@ -1332,13 +1332,13 @@  discard block
 block discarded – undo
1332 1332
     }
1333 1333
     //print_r($post);
1334 1334
     // external links
1335
-    $external_links =  array();
1335
+    $external_links = array();
1336 1336
     $external_links[] = $post->geodir_website;
1337 1337
     $external_links[] = $post->geodir_twitter;
1338 1338
     $external_links[] = $post->geodir_facebook;
1339 1339
     $external_links = array_filter($external_links);
1340 1340
 
1341
-    if(!empty($external_links)){
1341
+    if (!empty($external_links)) {
1342 1342
         $external_links = array_values($external_links);
1343 1343
     }
1344 1344
 
@@ -1348,17 +1348,17 @@  discard block
 block discarded – undo
1348 1348
 
1349 1349
     // schema type
1350 1350
     $schema_type = 'LocalBusiness';
1351
-    if(isset($post->default_category) && $post->default_category){
1351
+    if (isset($post->default_category) && $post->default_category) {
1352 1352
         $cat_schema = get_tax_meta($post->default_category, 'ct_cat_schema', false, $post->post_type);
1353
-        if($cat_schema){$schema_type = $cat_schema;}
1354
-        if(!$schema_type && $post->post_type=='gd_event'){$schema_type = 'Event';}
1353
+        if ($cat_schema) {$schema_type = $cat_schema; }
1354
+        if (!$schema_type && $post->post_type == 'gd_event') {$schema_type = 'Event'; }
1355 1355
     }
1356 1356
 
1357 1357
     $schema = array();
1358 1358
     $schema['@context'] = "http://schema.org";
1359 1359
     $schema['@type'] = $schema_type;
1360 1360
     $schema['name'] = $post->post_name;
1361
-    $schema['description'] = wp_strip_all_tags( $post->post_content, true );
1361
+    $schema['description'] = wp_strip_all_tags($post->post_content, true);
1362 1362
     $schema['telephone'] = $post->geodir_contact;
1363 1363
     $schema['url'] = $c_url;
1364 1364
     $schema['sameAs'] = $external_links;
@@ -1372,7 +1372,7 @@  discard block
 block discarded – undo
1372 1372
         "postalCode" => $post->post_zip
1373 1373
     );
1374 1374
 
1375
-    if($post->post_latitude && $post->post_longitude) {
1375
+    if ($post->post_latitude && $post->post_longitude) {
1376 1376
         $schema['geo'] = array(
1377 1377
             "@type" => "GeoCoordinates",
1378 1378
             "latitude" => $post->post_latitude,
@@ -1380,7 +1380,7 @@  discard block
 block discarded – undo
1380 1380
         );
1381 1381
     }
1382 1382
 
1383
-    if($post_avgratings) {
1383
+    if ($post_avgratings) {
1384 1384
         $schema['aggregateRating'] = array(
1385 1385
             "@type" => "AggregateRating",
1386 1386
             "ratingValue" => $post_avgratings,
@@ -1399,10 +1399,10 @@  discard block
 block discarded – undo
1399 1399
      * @param array $schema The array of schema data to be filtered.
1400 1400
      * @param object $post The post object.
1401 1401
      */
1402
-    $schema = apply_filters('geodir_details_schema', $schema,$post);
1402
+    $schema = apply_filters('geodir_details_schema', $schema, $post);
1403 1403
 
1404 1404
 
1405
-    echo '<script type="application/ld+json">' . json_encode($schema) . '</script>';
1405
+    echo '<script type="application/ld+json">'.json_encode($schema).'</script>';
1406 1406
 
1407 1407
 }
1408 1408
 
@@ -1423,9 +1423,9 @@  discard block
 block discarded – undo
1423 1423
     ?>
1424 1424
     <div class="geodir-pos_navigation clearfix">
1425 1425
     <div
1426
-        class="geodir-post_left"><?php previous_post_link('%link', '' . __('Previous', 'geodirectory'), false) ?></div>
1426
+        class="geodir-post_left"><?php previous_post_link('%link', ''.__('Previous', 'geodirectory'), false) ?></div>
1427 1427
     <div
1428
-        class="geodir-post_right"><?php next_post_link('%link', __('Next', 'geodirectory') . '', false) ?></div>
1428
+        class="geodir-post_right"><?php next_post_link('%link', __('Next', 'geodirectory').'', false) ?></div>
1429 1429
     </div><?php
1430 1430
 }
1431 1431
 
@@ -1494,12 +1494,12 @@  discard block
 block discarded – undo
1494 1494
     $gd_post_type = geodir_get_current_posttype();
1495 1495
     $post_type_info = get_post_type_object($gd_post_type);
1496 1496
 
1497
-    $add_string_in_title = __('All', 'geodirectory') . ' ';
1497
+    $add_string_in_title = __('All', 'geodirectory').' ';
1498 1498
     if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
1499
-        $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
1499
+        $add_string_in_title = __('My Favorite', 'geodirectory').' ';
1500 1500
     }
1501 1501
 
1502
-    $list_title = $add_string_in_title . __(ucfirst($post_type_info->labels->name), 'geodirectory');
1502
+    $list_title = $add_string_in_title.__(ucfirst($post_type_info->labels->name), 'geodirectory');
1503 1503
     $single_name = $post_type_info->labels->singular_name;
1504 1504
 
1505 1505
     $taxonomy = geodir_get_taxonomies($gd_post_type, true);
@@ -1527,12 +1527,12 @@  discard block
 block discarded – undo
1527 1527
         $current_term = get_term_by('slug', $term, $taxonomy[0]);
1528 1528
         if (!empty($current_term)) {
1529 1529
             $current_term_name = __(ucfirst($current_term->name), 'geodirectory');
1530
-            if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1530
+            if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type.'category') {
1531 1531
                 $location_last_char = substr($location_name, -1);
1532 1532
                 $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1533
-                $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1533
+                $list_title .= __(' in', 'geodirectory').' '.$location_name.$location_name_attach.' '.$current_term_name;
1534 1534
             } else {
1535
-                $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1535
+                $list_title .= __(' in', 'geodirectory')." '".$current_term_name."'";
1536 1536
             }
1537 1537
         } else {
1538 1538
             if (count($taxonomy) > 1) {
@@ -1540,12 +1540,12 @@  discard block
 block discarded – undo
1540 1540
 
1541 1541
                 if (!empty($current_term)) {
1542 1542
                     $current_term_name = __(ucfirst($current_term->name), 'geodirectory');
1543
-                    if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type . 'category') {
1543
+                    if ($current_term_name != '' && $location_name != '' && isset($current_term->taxonomy) && $current_term->taxonomy == $gd_post_type.'category') {
1544 1544
                         $location_last_char = substr($location_name, -1);
1545 1545
                         $location_name_attach = geodir_strtolower($location_last_char) == 's' ? __("'", 'geodirectory') : __("'s", 'geodirectory');
1546
-                        $list_title .= __(' in', 'geodirectory') . ' ' . $location_name . $location_name_attach . ' ' . $current_term_name;
1546
+                        $list_title .= __(' in', 'geodirectory').' '.$location_name.$location_name_attach.' '.$current_term_name;
1547 1547
                     } else {
1548
-                        $list_title .= __(' in', 'geodirectory') . " '" . $current_term_name . "'";
1548
+                        $list_title .= __(' in', 'geodirectory')." '".$current_term_name."'";
1549 1549
                     }
1550 1550
                 }
1551 1551
             }
@@ -1573,7 +1573,7 @@  discard block
 block discarded – undo
1573 1573
                 $gd_city = __(geodir_ucwords($gd_city), 'geodirectory');
1574 1574
             }
1575 1575
 
1576
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_city . "'";
1576
+            $list_title .= __(' in', 'geodirectory')." '".$gd_city."'";
1577 1577
         } else if ($gd_region != '') {
1578 1578
             if ($gd_region_actual != '') {
1579 1579
                 $gd_region = $gd_region_actual;
@@ -1583,7 +1583,7 @@  discard block
 block discarded – undo
1583 1583
                 $gd_region = __(geodir_ucwords($gd_region), 'geodirectory');
1584 1584
             }
1585 1585
 
1586
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_region . "'";
1586
+            $list_title .= __(' in', 'geodirectory')." '".$gd_region."'";
1587 1587
         } else if ($gd_country != '') {
1588 1588
             if ($gd_country_actual != '') {
1589 1589
                 $gd_country = $gd_country_actual;
@@ -1593,12 +1593,12 @@  discard block
 block discarded – undo
1593 1593
                 $gd_country = __(geodir_ucwords($gd_country), 'geodirectory');
1594 1594
             }
1595 1595
 
1596
-            $list_title .= __(' in', 'geodirectory') . " '" . $gd_country . "'";
1596
+            $list_title .= __(' in', 'geodirectory')." '".$gd_country."'";
1597 1597
         }
1598 1598
     }
1599 1599
 
1600 1600
     if (is_search()) {
1601
-        $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
1601
+        $list_title = __('Search', 'geodirectory').' '.__(ucfirst($post_type_info->labels->name), 'geodirectory').__(' For :', 'geodirectory')." '".get_search_query()."'";
1602 1602
     }
1603 1603
     /** This action is documented in geodirectory_template_actions.php */
1604 1604
     $class = apply_filters('geodir_page_title_class', 'entry-title fn');
@@ -1607,26 +1607,26 @@  discard block
 block discarded – undo
1607 1607
 
1608 1608
 
1609 1609
     $title = $list_title;
1610
-    if(geodir_is_page('pt')){
1610
+    if (geodir_is_page('pt')) {
1611 1611
         $gd_page = 'pt';
1612
-        $title  = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
1612
+        $title = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : $title;
1613 1613
     }
1614
-    elseif(geodir_is_page('listing')){
1614
+    elseif (geodir_is_page('listing')) {
1615 1615
         $gd_page = 'listing';
1616 1616
         global $wp_query;
1617 1617
         $current_term = $wp_query->get_queried_object();
1618
-        if (strpos($current_term->taxonomy,'_tags') !== false) {
1618
+        if (strpos($current_term->taxonomy, '_tags') !== false) {
1619 1619
             $title = (get_option('geodir_page_title_tag-listing')) ? get_option('geodir_page_title_tag-listing') : $title;
1620
-        }else{
1620
+        } else {
1621 1621
             $title = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : $title;
1622 1622
         }
1623 1623
 
1624 1624
     }
1625
-    elseif(geodir_is_page('author')){
1625
+    elseif (geodir_is_page('author')) {
1626 1626
         $gd_page = 'author';
1627
-        if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
1627
+        if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
1628 1628
             $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
1629
-        }else{
1629
+        } else {
1630 1630
             $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
1631 1631
         }
1632 1632
 
@@ -1640,16 +1640,16 @@  discard block
 block discarded – undo
1640 1640
      * @param string $title The page title including variables.
1641 1641
      * @param string $gd_page The GeoDirectory page type if any.
1642 1642
      */
1643
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
1643
+    $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
1644 1644
 
1645
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
1645
+    echo '<header class="'.$class_header.'"><h1 class="'.$class.'">'.
1646 1646
         /**
1647 1647
          * Filter the listing page title.
1648 1648
          *
1649 1649
          * @since 1.0.0
1650 1650
          * @param string $list_title The title for the category page.
1651 1651
          */
1652
-        apply_filters('geodir_listing_page_title', $title) . '</h1></header>';
1652
+        apply_filters('geodir_listing_page_title', $title).'</h1></header>';
1653 1653
 }
1654 1654
 
1655 1655
 add_action('geodir_listings_page_description', 'geodir_action_listings_description', 10);
@@ -1668,16 +1668,16 @@  discard block
 block discarded – undo
1668 1668
     $gd_post_type = geodir_get_current_posttype();
1669 1669
     if (isset($current_term->term_id) && $current_term->term_id != '') {
1670 1670
 
1671
-        $term_desc = term_description($current_term->term_id, $gd_post_type . '_tags');
1671
+        $term_desc = term_description($current_term->term_id, $gd_post_type.'_tags');
1672 1672
         $saved_data = stripslashes(get_tax_meta($current_term->term_id, 'ct_cat_top_desc', false, $gd_post_type));
1673 1673
         if ($term_desc && !$saved_data) {
1674 1674
             $saved_data = $term_desc;
1675 1675
         }
1676 1676
 
1677 1677
         // stop payment manager filtering content length
1678
-        $filter_priority = has_filter( 'the_content', 'geodir_payments_the_content' );
1679
-        if ( false !== $filter_priority ) {
1680
-            remove_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1678
+        $filter_priority = has_filter('the_content', 'geodir_payments_the_content');
1679
+        if (false !== $filter_priority) {
1680
+            remove_filter('the_content', 'geodir_payments_the_content', $filter_priority);
1681 1681
         }
1682 1682
 
1683 1683
         /**
@@ -1691,14 +1691,14 @@  discard block
 block discarded – undo
1691 1691
         $cat_description = apply_filters('the_content', $saved_data);
1692 1692
 
1693 1693
 
1694
-        if ( false !== $filter_priority ) {
1695
-            add_filter( 'the_content', 'geodir_payments_the_content', $filter_priority );
1694
+        if (false !== $filter_priority) {
1695
+            add_filter('the_content', 'geodir_payments_the_content', $filter_priority);
1696 1696
         }
1697 1697
 
1698 1698
         if ($cat_description) {
1699 1699
             ?>
1700 1700
 
1701
-            <div class="term_description"><?php echo $cat_description;?></div> <?php
1701
+            <div class="term_description"><?php echo $cat_description; ?></div> <?php
1702 1702
         }
1703 1703
 
1704 1704
     }
@@ -1748,13 +1748,13 @@  discard block
 block discarded – undo
1748 1748
 function geodir_action_sidebar_left_open($type = '', $id = '', $class = '', $itemtype = '')
1749 1749
 {
1750 1750
     if ($type == 'home-page' && $width = get_option('geodir_width_home_left_section')) {
1751
-        $width_css = 'style="width:' . $width . '%;"';
1751
+        $width_css = 'style="width:'.$width.'%;"';
1752 1752
     } elseif ($type == 'listings-page' && $width = get_option('geodir_width_listing_left_section')) {
1753
-        $width_css = 'style="width:' . $width . '%;"';
1753
+        $width_css = 'style="width:'.$width.'%;"';
1754 1754
     } elseif ($type == 'search-page' && $width = get_option('geodir_width_search_left_section')) {
1755
-        $width_css = 'style="width:' . $width . '%;"';
1755
+        $width_css = 'style="width:'.$width.'%;"';
1756 1756
     } elseif ($type == 'author-page' && $width = get_option('geodir_width_author_left_section')) {
1757
-        $width_css = 'style="width:' . $width . '%;"';
1757
+        $width_css = 'style="width:'.$width.'%;"';
1758 1758
     } else {
1759 1759
         $width_css = '';
1760 1760
     }
@@ -2059,11 +2059,11 @@  discard block
 block discarded – undo
2059 2059
 
2060 2060
     $title = apply_filters('geodir_add_listing_page_title_text', get_the_title());
2061 2061
 
2062
-    if(geodir_is_page('add-listing')){
2062
+    if (geodir_is_page('add-listing')) {
2063 2063
         $gd_page = 'add-listing';
2064
-        if(isset($_REQUEST['pid']) && $_REQUEST['pid'] != ''){
2064
+        if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2065 2065
             $title = (get_option('geodir_page_title_edit-listing')) ? get_option('geodir_page_title_edit-listing') : $title;
2066
-        }elseif(isset($listing_type)){
2066
+        }elseif (isset($listing_type)) {
2067 2067
             $title = (get_option('geodir_page_title_add-listing')) ? get_option('geodir_page_title_add-listing') : $title;
2068 2068
         }
2069 2069
 
@@ -2077,9 +2077,9 @@  discard block
 block discarded – undo
2077 2077
      * @param string $title The page title including variables.
2078 2078
      * @param string $gd_page The GeoDirectory page type if any.
2079 2079
      */
2080
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2080
+    $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2081 2081
 
2082
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">';
2082
+    echo '<header class="'.$class_header.'"><h1 class="'.$class.'">';
2083 2083
     echo $title;
2084 2084
     echo '</h1></header>';
2085 2085
 }
@@ -2093,7 +2093,7 @@  discard block
 block discarded – undo
2093 2093
  */
2094 2094
 function geodir_action_add_listing_page_mandatory()
2095 2095
 {?>
2096
-    <p class="geodir-note "><span class="geodir-required">*</span>&nbsp;<?php echo INDICATES_MANDATORY_FIELDS_TEXT;?></p>
2096
+    <p class="geodir-note "><span class="geodir-required">*</span>&nbsp;<?php echo INDICATES_MANDATORY_FIELDS_TEXT; ?></p>
2097 2097
 <?php
2098 2098
 }
2099 2099
 
@@ -2128,7 +2128,7 @@  discard block
 block discarded – undo
2128 2128
 
2129 2129
     if (isset($_REQUEST['backandedit'])) {
2130 2130
         global $post;
2131
-        $post = (object)$gd_session->get('listing');
2131
+        $post = (object) $gd_session->get('listing');
2132 2132
         $listing_type = $post->listing_type;
2133 2133
         $title = $post->post_title;
2134 2134
         $desc = $post->post_desc;
@@ -2143,7 +2143,7 @@  discard block
 block discarded – undo
2143 2143
         $thumb_img_arr = geodir_get_images($post->ID);
2144 2144
         if ($thumb_img_arr) {
2145 2145
             foreach ($thumb_img_arr as $post_img) {
2146
-                $curImages .= $post_img->src . ',';
2146
+                $curImages .= $post_img->src.',';
2147 2147
             }
2148 2148
         }
2149 2149
 
@@ -2151,7 +2151,7 @@  discard block
 block discarded – undo
2151 2151
         $title = $post->post_title;
2152 2152
         $desc = $post->post_content;
2153 2153
         $kw_tags = $post->post_tags;
2154
-        $kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type . '_tags', array('fields' => 'names')));
2154
+        $kw_tags = implode(",", wp_get_object_terms($post->ID, $listing_type.'_tags', array('fields' => 'names')));
2155 2155
     } else {
2156 2156
         $listing_type = sanitize_text_field($_REQUEST['listing_type']);
2157 2157
     }
@@ -2162,18 +2162,18 @@  discard block
 block discarded – undo
2162 2162
 
2163 2163
     $post_type_info = geodir_get_posttype_info($listing_type);
2164 2164
 
2165
-    $cpt_singular_name = (isset($post_type_info['labels']['singular_name']) && $post_type_info['labels']['singular_name']) ? $post_type_info['labels']['singular_name'] : __('Listing','geodirectory');
2165
+    $cpt_singular_name = (isset($post_type_info['labels']['singular_name']) && $post_type_info['labels']['singular_name']) ? $post_type_info['labels']['singular_name'] : __('Listing', 'geodirectory');
2166 2166
 
2167 2167
     ?>
2168
-    <form name="propertyform" id="propertyform" action="<?php echo get_page_link(geodir_preview_page_id());?>" method="post" enctype="multipart/form-data">
2169
-        <input type="hidden" name="preview" value="<?php echo sanitize_text_field($listing_type);?>"/>
2170
-        <input type="hidden" name="listing_type" value="<?php echo sanitize_text_field($listing_type);?>"/>
2168
+    <form name="propertyform" id="propertyform" action="<?php echo get_page_link(geodir_preview_page_id()); ?>" method="post" enctype="multipart/form-data">
2169
+        <input type="hidden" name="preview" value="<?php echo sanitize_text_field($listing_type); ?>"/>
2170
+        <input type="hidden" name="listing_type" value="<?php echo sanitize_text_field($listing_type); ?>"/>
2171 2171
         <?php if ($page_id) { ?>
2172
-        <input type="hidden" name="add_listing_page_id" value="<?php echo $page_id;?>"/>
2172
+        <input type="hidden" name="add_listing_page_id" value="<?php echo $page_id; ?>"/>
2173 2173
         <?php } if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') { ?>
2174
-            <input type="hidden" name="pid" value="<?php echo sanitize_text_field($_REQUEST['pid']);?>"/>
2174
+            <input type="hidden" name="pid" value="<?php echo sanitize_text_field($_REQUEST['pid']); ?>"/>
2175 2175
         <?php } if (isset($_REQUEST['backandedit'])) { ?>
2176
-            <input type="hidden" name="backandedit" value="<?php echo sanitize_text_field($_REQUEST['backandedit']);?>"/>
2176
+            <input type="hidden" name="backandedit" value="<?php echo sanitize_text_field($_REQUEST['backandedit']); ?>"/>
2177 2177
         <?php
2178 2178
         } 
2179 2179
         /**
@@ -2185,7 +2185,7 @@  discard block
 block discarded – undo
2185 2185
          */
2186 2186
         do_action('geodir_before_detail_fields');
2187 2187
         ?>
2188
-        <h5 id="geodir_fieldset_details" class="geodir-fieldset-row" gd-fieldset="details"><?php echo LISTING_DETAILS_TEXT;?></h5>
2188
+        <h5 id="geodir_fieldset_details" class="geodir-fieldset-row" gd-fieldset="details"><?php echo LISTING_DETAILS_TEXT; ?></h5>
2189 2189
         <?php
2190 2190
         /**
2191 2191
          * Called at the top of the add listing page form for frontend.
@@ -2197,10 +2197,10 @@  discard block
 block discarded – undo
2197 2197
         do_action('geodir_before_main_form_fields');
2198 2198
         ?>
2199 2199
         <div id="geodir_post_title_row" class="required_field geodir_form_row clearfix gd-fieldset-details">
2200
-            <label><?php echo sprintf( __('%s Title', 'geodirectory'), $cpt_singular_name ); ?><span>*</span> </label>
2200
+            <label><?php echo sprintf(__('%s Title', 'geodirectory'), $cpt_singular_name); ?><span>*</span> </label>
2201 2201
             <input type="text" field_type="text" name="post_title" id="post_title" class="geodir_textfield"
2202 2202
                    value="<?php echo esc_attr(stripslashes($title)); ?>"/>
2203
-            <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory');?></span>
2203
+            <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span>
2204 2204
         </div>
2205 2205
         <?php
2206 2206
         $show_editor = get_option('geodir_tiny_editor_on_add_listing');
@@ -2235,7 +2235,7 @@  discard block
 block discarded – undo
2235 2235
         $desc_limit_msg = apply_filters('geodir_description_field_desc_limit_msg', $desc_limit_msg, $desc_limit);
2236 2236
         
2237 2237
         $desc_class = '';
2238
-        if ($desc_limit === '' || (int)$desc_limit > 0) {
2238
+        if ($desc_limit === '' || (int) $desc_limit > 0) {
2239 2239
             /**
2240 2240
              * Called on the add listing page form for frontend just before the description field.
2241 2241
              *
@@ -2248,8 +2248,8 @@  discard block
 block discarded – undo
2248 2248
             $desc_class = ' hidden';
2249 2249
         }
2250 2250
         ?>
2251
-        <div id="geodir_post_desc_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $desc_class;?>">
2252
-            <label><?php echo sprintf( __('%s Description', 'geodirectory'), $cpt_singular_name ); ?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label>
2251
+        <div id="geodir_post_desc_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $desc_class; ?>">
2252
+            <label><?php echo sprintf(__('%s Description', 'geodirectory'), $cpt_singular_name); ?><span><?php if ($desc_limit != '0') { echo '*'; } ?></span> </label>
2253 2253
             <?php
2254 2254
             if (!empty($show_editor) && in_array($listing_type, $show_editor)) {
2255 2255
                 $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);
@@ -2258,16 +2258,16 @@  discard block
 block discarded – undo
2258 2258
                     <?php wp_editor($desc, "post_desc", $editor_settings); ?>
2259 2259
                 </div>
2260 2260
             <?php if ($desc_limit != '') { ?>
2261
-                <script type="text/javascript">jQuery('textarea#post_desc').attr('maxlength', "<?php echo $desc_limit;?>");</script>
2261
+                <script type="text/javascript">jQuery('textarea#post_desc').attr('maxlength', "<?php echo $desc_limit; ?>");</script>
2262 2262
             <?php } } else { ?>
2263 2263
                 <textarea field_type="textarea" name="post_desc" id="post_desc" class="geodir_textarea" maxlength="<?php echo $desc_limit; ?>"><?php echo $desc; ?></textarea>
2264 2264
             <?php } if ($desc_limit_msg != '') { ?>
2265 2265
                 <span class="geodir_message_note"><?php echo $desc_limit_msg; ?></span>
2266 2266
             <?php } ?>
2267
-            <span class="geodir_message_error"><?php echo _e($required_msg, 'geodirectory');?></span>
2267
+            <span class="geodir_message_error"><?php echo _e($required_msg, 'geodirectory'); ?></span>
2268 2268
         </div>
2269 2269
         <?php
2270
-        if ($desc_limit === '' || (int)$desc_limit > 0) {
2270
+        if ($desc_limit === '' || (int) $desc_limit > 0) {
2271 2271
             /**
2272 2272
              * Called on the add listing page form for frontend just after the description field.
2273 2273
              *
@@ -2306,7 +2306,7 @@  discard block
 block discarded – undo
2306 2306
         $kw_tags_msg = apply_filters('geodir_listing_tags_field_tags_msg', $kw_tags_msg, $kw_tags_count);
2307 2307
         
2308 2308
         $tags_class = '';
2309
-        if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2309
+        if ($kw_tags_count === '' || (int) $kw_tags_count > 0) {
2310 2310
             /**
2311 2311
              * Called on the add listing page form for frontend just before the tags field.
2312 2312
              *
@@ -2317,14 +2317,14 @@  discard block
 block discarded – undo
2317 2317
             $tags_class = ' hidden';
2318 2318
         }
2319 2319
         ?>
2320
-        <div id="geodir_post_tags_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $tags_class;?>">
2320
+        <div id="geodir_post_tags_row" class="geodir_form_row clearfix gd-fieldset-details<?php echo $tags_class; ?>">
2321 2321
             <label><?php echo TAGKW_TEXT; ?></label>
2322 2322
             <input name="post_tags" id="post_tags" value="<?php echo $kw_tags; ?>" type="text" class="geodir_textfield"
2323
-                   maxlength="<?php echo $kw_tags_count;?>"/>
2324
-            <span class="geodir_message_note"><?php echo $kw_tags_msg;?></span>
2323
+                   maxlength="<?php echo $kw_tags_count; ?>"/>
2324
+            <span class="geodir_message_note"><?php echo $kw_tags_msg; ?></span>
2325 2325
         </div>
2326 2326
         <?php
2327
-        if ($kw_tags_count === '' || (int)$kw_tags_count > 0) {
2327
+        if ($kw_tags_count === '' || (int) $kw_tags_count > 0) {
2328 2328
             /**
2329 2329
              * Called on the add listing page form for frontend just after the tags field.
2330 2330
              *
@@ -2350,7 +2350,7 @@  discard block
 block discarded – undo
2350 2350
         $thumb_img_arr = array();
2351 2351
         $totImg = 0;
2352 2352
         if (isset($_REQUEST['backandedit']) && empty($_REQUEST['pid'])) {
2353
-            $post = (object)$gd_session->get('listing');
2353
+            $post = (object) $gd_session->get('listing');
2354 2354
             if (isset($post->post_images))
2355 2355
                 $curImages = trim($post->post_images, ",");
2356 2356
 
@@ -2363,7 +2363,7 @@  discard block
 block discarded – undo
2363 2363
             $listing_type = $post->listing_type;
2364 2364
 
2365 2365
         } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
2366
-            $post = geodir_get_post_info((int)$_REQUEST['pid']);
2366
+            $post = geodir_get_post_info((int) $_REQUEST['pid']);
2367 2367
             $listing_type = $post->post_type;
2368 2368
             $thumb_img_arr = geodir_get_images($_REQUEST['pid']);
2369 2369
 
@@ -2377,7 +2377,7 @@  discard block
 block discarded – undo
2377 2377
                 //$curImages = $img->src.",";
2378 2378
             }
2379 2379
 
2380
-            $totImg = count((array)$thumb_img_arr);
2380
+            $totImg = count((array) $thumb_img_arr);
2381 2381
         }
2382 2382
 
2383 2383
         if ($curImages != '')
@@ -2398,15 +2398,15 @@  discard block
 block discarded – undo
2398 2398
         if ($show_image_input_box) {
2399 2399
             ?>
2400 2400
 
2401
-            <h5 id="geodir_form_title_row" class="geodir-form_title"> <?php echo PRO_PHOTO_TEXT;?>
2401
+            <h5 id="geodir_form_title_row" class="geodir-form_title"> <?php echo PRO_PHOTO_TEXT; ?>
2402 2402
                 <?php if ($image_limit == 1) {
2403
-                    echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('image with this package', 'geodirectory') . ')</small>';
2403
+                    echo '<br /><small>('.__('You can upload', 'geodirectory').' '.$image_limit.' '.__('image with this package', 'geodirectory').')</small>';
2404 2404
                 } ?>
2405 2405
                 <?php if ($image_limit > 1) {
2406
-                    echo '<br /><small>(' . __('You can upload', 'geodirectory') . ' ' . $image_limit . ' ' . __('images with this package', 'geodirectory') . ')</small>';
2406
+                    echo '<br /><small>('.__('You can upload', 'geodirectory').' '.$image_limit.' '.__('images with this package', 'geodirectory').')</small>';
2407 2407
                 } ?>
2408 2408
                 <?php if ($image_limit == '') {
2409
-                    echo '<br /><small>(' . __('You can upload unlimited images with this package', 'geodirectory') . ')</small>';
2409
+                    echo '<br /><small>('.__('You can upload unlimited images with this package', 'geodirectory').')</small>';
2410 2410
                 } ?>
2411 2411
             </h5>
2412 2412
 
@@ -2421,11 +2421,11 @@  discard block
 block discarded – undo
2421 2421
                 <div
2422 2422
                     class="plupload-upload-uic hide-if-no-js <?php if ($multiple): ?>plupload-upload-uic-multiple<?php endif; ?>"
2423 2423
                     id="<?php echo $id; ?>plupload-upload-ui">
2424
-                    <h4><?php _e('Drop files to upload', 'geodirectory');?></h4><br/>
2424
+                    <h4><?php _e('Drop files to upload', 'geodirectory'); ?></h4><br/>
2425 2425
                     <input id="<?php echo $id; ?>plupload-browse-button" type="button"
2426 2426
                            value="<?php esc_attr_e('Select Files', 'geodirectory'); ?>" class="geodir_button"/>
2427 2427
                     <span class="ajaxnonceplu"
2428
-                          id="ajaxnonceplu<?php echo wp_create_nonce($id . 'pluploadan'); ?>"></span>
2428
+                          id="ajaxnonceplu<?php echo wp_create_nonce($id.'pluploadan'); ?>"></span>
2429 2429
                     <?php if ($width && $height): ?>
2430 2430
                         <span class="plupload-resize"></span>
2431 2431
                         <span class="plupload-width" id="plupload-width<?php echo $width; ?>"></span>
@@ -2438,7 +2438,7 @@  discard block
 block discarded – undo
2438 2438
                      id="<?php echo $id; ?>plupload-thumbs" style="border-top:1px solid #ccc; padding-top:10px;">
2439 2439
                 </div>
2440 2440
                 <span
2441
-                    id="upload-msg"><?php _e('Please drag &amp; drop the images to rearrange the order', 'geodirectory');?></span>
2441
+                    id="upload-msg"><?php _e('Please drag &amp; drop the images to rearrange the order', 'geodirectory'); ?></span>
2442 2442
                 <span id="<?php echo $id; ?>upload-error" style="display:none"></span>
2443 2443
             </div>
2444 2444
 
@@ -2450,7 +2450,7 @@  discard block
 block discarded – undo
2450 2450
          *
2451 2451
          * @since 1.0.0
2452 2452
          */
2453
-        do_action('geodir_after_main_form_fields');?>
2453
+        do_action('geodir_after_main_form_fields'); ?>
2454 2454
 
2455 2455
 
2456 2456
         <!-- add captcha code -->
@@ -2461,7 +2461,7 @@  discard block
 block discarded – undo
2461 2461
         </script>
2462 2462
         <noscript>
2463 2463
             <div>
2464
-                <label><?php _e('Type 64 into this box', 'geodirectory');?></label>
2464
+                <label><?php _e('Type 64 into this box', 'geodirectory'); ?></label>
2465 2465
                 <input type="text" id="geodir_spamblocker_top_form" name="geodir_spamblocker" value="" maxlength="10"/>
2466 2466
             </div>
2467 2467
         </noscript>
@@ -2471,10 +2471,10 @@  discard block
 block discarded – undo
2471 2471
         <!-- end captcha code -->
2472 2472
 
2473 2473
         <div id="geodir-add-listing-submit" class="geodir_form_row clear_both" style="padding:2px;text-align:center;">
2474
-            <input type="submit" value="<?php echo PRO_PREVIEW_BUTTON;?>"
2475
-                   class="geodir_button" <?php echo $submit_button;?>/>
2474
+            <input type="submit" value="<?php echo PRO_PREVIEW_BUTTON; ?>"
2475
+                   class="geodir_button" <?php echo $submit_button; ?>/>
2476 2476
             <span class="geodir_message_note"
2477
-                  style="padding-left:0px;"> <?php _e('Note: You will be able to see a preview in the next page', 'geodirectory');?></span>
2477
+                  style="padding-left:0px;"> <?php _e('Note: You will be able to see a preview in the next page', 'geodirectory'); ?></span>
2478 2478
         </div>
2479 2479
 
2480 2480
     </form>
@@ -2536,7 +2536,7 @@  discard block
 block discarded – undo
2536 2536
         class="<?php
2537 2537
         /** This action is documented in geodirectory_template_actions.php */
2538 2538
         echo apply_filters('geodir_full_page_class', 'geodir_full_page clearfix', 'Reg/Login Top Section'); ?>">
2539
-        <?php dynamic_sidebar('Reg/Login Top Section');?>
2539
+        <?php dynamic_sidebar('Reg/Login Top Section'); ?>
2540 2540
     </div><!-- clearfix ends here-->
2541 2541
 <?php
2542 2542
 }
@@ -2558,7 +2558,7 @@  discard block
 block discarded – undo
2558 2558
 
2559 2559
     ?>
2560 2560
     <script type="text/javascript">
2561
-        <?php if ( $user_login ) { ?>
2561
+        <?php if ($user_login) { ?>
2562 2562
         setTimeout(function () {
2563 2563
             try {
2564 2564
                 d = document.getElementById('user_pass');
@@ -2575,7 +2575,7 @@  discard block
 block discarded – undo
2575 2575
         <?php } ?>
2576 2576
     </script>
2577 2577
     <script type="text/javascript">
2578
-        <?php if ( $user_login ) { ?>
2578
+        <?php if ($user_login) { ?>
2579 2579
         setTimeout(function () {
2580 2580
             try {
2581 2581
                 d = document.getElementById('user_pass');
@@ -2600,7 +2600,7 @@  discard block
 block discarded – undo
2600 2600
         foreach ($errors as $errorsObj) {
2601 2601
             foreach ($errorsObj as $key => $val) {
2602 2602
                 for ($i = 0; $i < count($val); $i++) {
2603
-                    echo "<div class=sucess_msg>" . $val[$i] . '</div>';
2603
+                    echo "<div class=sucess_msg>".$val[$i].'</div>';
2604 2604
                     $registration_error_msg = 1;
2605 2605
                 }
2606 2606
             }
@@ -2617,7 +2617,7 @@  discard block
 block discarded – undo
2617 2617
              *
2618 2618
              * @since 1.0.0
2619 2619
              */
2620
-            include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2620
+            include(geodir_plugin_path()."/geodirectory-templates/login_frm.php"); ?>
2621 2621
         </div>
2622 2622
 
2623 2623
     <?php } elseif (isset($_REQUEST['page']) && $_REQUEST['page'] == 'login' && isset($_REQUEST['page1']) && $_REQUEST['page1'] == 'sign_up') { ?>
@@ -2629,7 +2629,7 @@  discard block
 block discarded – undo
2629 2629
              *
2630 2630
              * @since 1.0.0
2631 2631
              */
2632
-            include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2632
+            include(geodir_plugin_path()."/geodirectory-templates/reg_frm.php"); ?>
2633 2633
         </div>
2634 2634
 
2635 2635
     <?php } else { ?>
@@ -2641,7 +2641,7 @@  discard block
 block discarded – undo
2641 2641
              *
2642 2642
              * @since 1.0.0
2643 2643
              */
2644
-            include(geodir_plugin_path() . "/geodirectory-templates/login_frm.php"); ?>
2644
+            include(geodir_plugin_path()."/geodirectory-templates/login_frm.php"); ?>
2645 2645
         </div>
2646 2646
         <div class="registration_form_r">
2647 2647
             <?php
@@ -2650,7 +2650,7 @@  discard block
 block discarded – undo
2650 2650
              *
2651 2651
              * @since 1.0.0
2652 2652
              */
2653
-            include(geodir_plugin_path() . "/geodirectory-templates/reg_frm.php"); ?>
2653
+            include(geodir_plugin_path()."/geodirectory-templates/reg_frm.php"); ?>
2654 2654
         </div>
2655 2655
 
2656 2656
     <?php }?>
@@ -2686,12 +2686,12 @@  discard block
 block discarded – undo
2686 2686
     $gd_post_type = geodir_get_current_posttype();
2687 2687
     $post_type_info = get_post_type_object($gd_post_type);
2688 2688
 
2689
-    $add_string_in_title = __('All', 'geodirectory') . ' ';
2689
+    $add_string_in_title = __('All', 'geodirectory').' ';
2690 2690
     if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
2691
-        $add_string_in_title = __('My Favorite', 'geodirectory') . ' ';
2691
+        $add_string_in_title = __('My Favorite', 'geodirectory').' ';
2692 2692
     }
2693 2693
 
2694
-    $list_title = $add_string_in_title . $post_type_info->labels->name;
2694
+    $list_title = $add_string_in_title.$post_type_info->labels->name;
2695 2695
     $single_name = $post_type_info->labels->singular_name;
2696 2696
 
2697 2697
     $taxonomy = geodir_get_taxonomies($gd_post_type);
@@ -2699,12 +2699,12 @@  discard block
 block discarded – undo
2699 2699
     if (!empty($term)) {
2700 2700
         $current_term = get_term_by('slug', $term, $taxonomy[0]);
2701 2701
         if (!empty($current_term))
2702
-            $list_title .= __(' in', 'geodirectory') . " '" . geodir_ucwords($current_term->name) . "'";
2702
+            $list_title .= __(' in', 'geodirectory')." '".geodir_ucwords($current_term->name)."'";
2703 2703
     }
2704 2704
 
2705 2705
 
2706 2706
     if (is_search()) {
2707
-        $list_title = __('Search', 'geodirectory') . ' ' . __($post_type_info->labels->name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2707
+        $list_title = __('Search', 'geodirectory').' '.__($post_type_info->labels->name, 'geodirectory').__(' For :', 'geodirectory')." '".get_search_query()."'";
2708 2708
 
2709 2709
     }
2710 2710
     /** This action is documented in geodirectory_template_actions.php */
@@ -2713,11 +2713,11 @@  discard block
 block discarded – undo
2713 2713
     $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2714 2714
 
2715 2715
     $title = $list_title;
2716
-    if(geodir_is_page('author')){
2716
+    if (geodir_is_page('author')) {
2717 2717
         $gd_page = 'author';
2718
-        if(isset($_REQUEST['list']) && $_REQUEST['list']=='favourite'){
2718
+        if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite') {
2719 2719
             $title = (get_option('geodir_page_title_favorite')) ? get_option('geodir_page_title_favorite') : $title;
2720
-        }else{
2720
+        } else {
2721 2721
             $title = (get_option('geodir_page_title_author')) ? get_option('geodir_page_title_author') : $title;
2722 2722
         }
2723 2723
 
@@ -2731,16 +2731,16 @@  discard block
 block discarded – undo
2731 2731
      * @param string $title The page title including variables.
2732 2732
      * @param string $gd_page The GeoDirectory page type if any.
2733 2733
      */
2734
-    $title =  apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2734
+    $title = apply_filters('geodir_seo_page_title', __($title, 'geodirectory'), $gd_page);
2735 2735
 
2736
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2736
+    echo '<header class="'.$class_header.'"><h1 class="'.$class.'">'.
2737 2737
         /**
2738 2738
          * Filter the author page title text.
2739 2739
          *
2740 2740
          * @since 1.0.0
2741 2741
          * @param string $list_title The title for the page.
2742 2742
          */
2743
-        apply_filters('geodir_author_page_title_text', $title) . '</h1></header>';
2743
+        apply_filters('geodir_author_page_title_text', $title).'</h1></header>';
2744 2744
 }
2745 2745
 
2746 2746
 
@@ -2945,19 +2945,19 @@  discard block
 block discarded – undo
2945 2945
     $post_type_info = get_post_type_object($gd_post_type);
2946 2946
 
2947 2947
     $pt_name = '';
2948
-    if(isset($post_type_info->labels->name)){$pt_name=$post_type_info->labels->name;}
2948
+    if (isset($post_type_info->labels->name)) {$pt_name = $post_type_info->labels->name; }
2949 2949
 
2950 2950
     if (is_search()) {
2951
-        $list_title = __('Search', 'geodirectory') . ' ' . __($pt_name, 'geodirectory') . __(' For :', 'geodirectory') . " '" . get_search_query() . "'";
2951
+        $list_title = __('Search', 'geodirectory').' '.__($pt_name, 'geodirectory').__(' For :', 'geodirectory')." '".get_search_query()."'";
2952 2952
 
2953 2953
     }
2954 2954
     /** This action is documented in geodirectory_template_actions.php */
2955 2955
     $class = apply_filters('geodir_page_title_class', 'entry-title fn');
2956 2956
     /** This action is documented in geodirectory_template_actions.php */
2957 2957
     $class_header = apply_filters('geodir_page_title_header_class', 'entry-header');
2958
-    echo '<header class="' . $class_header . '"><h1 class="' . $class . '">' .
2958
+    echo '<header class="'.$class_header.'"><h1 class="'.$class.'">'.
2959 2959
         /** This action is documented in geodirectory_template_actions.php */
2960
-        apply_filters('geodir_listing_page_title', wptexturize($list_title)) . '</h1></header>';
2960
+        apply_filters('geodir_listing_page_title', wptexturize($list_title)).'</h1></header>';
2961 2961
 }
2962 2962
 
2963 2963
 // action for adding the listings page top widget area
@@ -3361,7 +3361,7 @@  discard block
 block discarded – undo
3361 3361
         $gd_post_type = geodir_get_current_posttype();
3362 3362
         $post_type_info = get_post_type_object($gd_post_type);
3363 3363
 
3364
-        $list_title = __('Search', 'geodirectory') . ' ' . __(ucfirst($post_type_info->labels->name), 'geodirectory') . __(' :', 'geodirectory');
3364
+        $list_title = __('Search', 'geodirectory').' '.__(ucfirst($post_type_info->labels->name), 'geodirectory').__(' :', 'geodirectory');
3365 3365
     }
3366 3366
     return $list_title;
3367 3367
 }
@@ -3377,7 +3377,7 @@  discard block
 block discarded – undo
3377 3377
  * @param string $position Position to add the post content. 'before' or 'after'. Default 'before'.
3378 3378
  * @param string $gd_page The geodirectory page type. Default null.
3379 3379
  */
3380
-function geodir_add_page_content( $position = 'before', $gd_page = '' ) {
3380
+function geodir_add_page_content($position = 'before', $gd_page = '') {
3381 3381
     global $post;
3382 3382
         
3383 3383
     $gd_page_id = NULL;
Please login to merge, or discard this patch.