Passed
Push — master ( 905d4c...9c92c6 )
by Stiofan
09:42
created
geodirectory-admin/option-pages/design_settings_array.php 1 patch
Indentation   +923 added lines, -923 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
+	),
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
+	),
848
+
849
+	array('type' => 'sectionend', 'id' => 'geodir_navigation_options'),
850 850
 
851 851
 
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
-    ),
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
+	),
868 868
 
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
-    ),
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 881
 
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
-    ),
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
+	),
894 894
 
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
-    ),
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
+	),
907 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
-    ),
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
+	),
919 919
 
920
-    array('type' => 'sectionend', 'id' => 'geodir_post_type_navigation_layout'),
920
+	array('type' => 'sectionend', 'id' => 'geodir_post_type_navigation_layout'),
921 921
 
922 922
 
923
-    array('name' => __('User Dashboard Post Type Navigation Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_user_dashboard_post_type '),
923
+	array('name' => __('User Dashboard Post Type Navigation Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_user_dashboard_post_type '),
924 924
 
925 925
 
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
-    ),
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 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
-    ),
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 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
-    /*
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,166 +994,166 @@  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
-    /* Untick the category by default on home map */
1051
-    array(
1052
-        'name' => __('Home Map Settings', 'geodirectory'),
1053
-        'type' => 'sectionstart',
1054
-        'desc' => '',
1055
-        'id' => 'geodir_home_map_section'
1056
-    ),
1057
-    array(
1058
-        'name' => __('Select category to untick by default on map', 'geodirectory'),
1059
-        'desc' => __('Select category to untick by default on the home map.', 'geodirectory'),
1060
-        'tip' => '',
1061
-        'id' => 'geodir_home_map_untick',
1062
-        'css' => 'min-width:300px;',
1063
-        'std' => '',
1064
-        'type' => 'multiselect',
1065
-        'placeholder_text' => __('Select category', 'geodirectory'),
1066
-        'class' => 'chosen_select',
1067
-        'options' => geodir_home_map_cats_key_value_array()
1068
-    ),
1069
-    array(
1070
-        'type' => 'sectionend',
1071
-        'id' => 'geodir_home_map_section'
1072
-    ),
1050
+	/* Untick the category by default on home map */
1051
+	array(
1052
+		'name' => __('Home Map Settings', 'geodirectory'),
1053
+		'type' => 'sectionstart',
1054
+		'desc' => '',
1055
+		'id' => 'geodir_home_map_section'
1056
+	),
1057
+	array(
1058
+		'name' => __('Select category to untick by default on map', 'geodirectory'),
1059
+		'desc' => __('Select category to untick by default on the home map.', 'geodirectory'),
1060
+		'tip' => '',
1061
+		'id' => 'geodir_home_map_untick',
1062
+		'css' => 'min-width:300px;',
1063
+		'std' => '',
1064
+		'type' => 'multiselect',
1065
+		'placeholder_text' => __('Select category', 'geodirectory'),
1066
+		'class' => 'chosen_select',
1067
+		'options' => geodir_home_map_cats_key_value_array()
1068
+	),
1069
+	array(
1070
+		'type' => 'sectionend',
1071
+		'id' => 'geodir_home_map_section'
1072
+	),
1073 1073
 
1074
-    array(
1075
-        'name' => __('Add Listing Map Settings', 'geodirectory'),
1076
-        'type' => 'sectionstart',
1077
-        'desc' => '',
1078
-        'id' => 'geodir_add_listing_map_section'
1079
-    ),
1080
-    array(
1081
-        'name' => __('Disable mouse scroll', 'geodirectory'),
1082
-        'desc' => __('Stops the mouse scroll zooming the map', 'geodirectory'),
1083
-        'id' => 'geodir_add_listing_mouse_scroll',
1084
-        'type' => 'checkbox',
1085
-        'std' => '0' // Default value to show home top section
1086
-    ),
1087
-    array(
1088
-        'type' => 'sectionend',
1089
-        'id' => 'geodir_add_listing_map_section'
1090
-    ),
1074
+	array(
1075
+		'name' => __('Add Listing Map Settings', 'geodirectory'),
1076
+		'type' => 'sectionstart',
1077
+		'desc' => '',
1078
+		'id' => 'geodir_add_listing_map_section'
1079
+	),
1080
+	array(
1081
+		'name' => __('Disable mouse scroll', 'geodirectory'),
1082
+		'desc' => __('Stops the mouse scroll zooming the map', 'geodirectory'),
1083
+		'id' => 'geodir_add_listing_mouse_scroll',
1084
+		'type' => 'checkbox',
1085
+		'std' => '0' // Default value to show home top section
1086
+	),
1087
+	array(
1088
+		'type' => 'sectionend',
1089
+		'id' => 'geodir_add_listing_map_section'
1090
+	),
1091 1091
 
1092 1092
 
1093
-    array('name' => __('Default map settings', 'geodirectory'),
1094
-        'type' => 'sectionstart',
1095
-        'desc' => '',
1096
-        'id' => 'geodir_map_default_settings'),
1093
+	array('name' => __('Default map settings', 'geodirectory'),
1094
+		'type' => 'sectionstart',
1095
+		'desc' => '',
1096
+		'id' => 'geodir_map_default_settings'),
1097 1097
 
1098
-    array(
1099
-        'name' => '',
1100
-        'desc' => '',
1101
-        'id' => 'map_default_settings',
1102
-        'type' => 'map_default_settings',
1103
-        'css' => 'min-width:300px;',
1104
-        'std' => '' // Default value for the page title - changed in settings
1105
-    ),
1098
+	array(
1099
+		'name' => '',
1100
+		'desc' => '',
1101
+		'id' => 'map_default_settings',
1102
+		'type' => 'map_default_settings',
1103
+		'css' => 'min-width:300px;',
1104
+		'std' => '' // Default value for the page title - changed in settings
1105
+	),
1106 1106
 
1107
-    array(
1108
-        'name' => __('Upload map default marker icon', 'geodirectory'),
1109
-        'desc' => '',
1110
-        'id' => 'geodir_default_marker_icon',
1111
-        'type' => 'file',
1112
-        'std' => '0',
1113
-        'value' => geodir_plugin_url() . '/geodirectory-functions/map-functions/icons/pin.png'// Default value to show home top section
1114
-    ),
1115
-    // add option that allows enable/disable map dragging to phone devices
1116
-    array(
1117
-        'name' => __('Show button control on map to enable/disable dragging', 'geodirectory'),
1118
-        'desc' => __('If checked, it displays button control to enable/disable dragging on google maps for phone devices', 'geodirectory'),
1119
-        'id' => 'geodir_map_onoff_dragging',
1120
-        'type' => 'checkbox',
1121
-        'std' => '0' // Default value to show home top section
1122
-    ),
1123
-    array(
1124
-        'name' => __('Select Maps API', 'geodirectory'),
1125
-        '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'),
1126
-        'tip' => '',
1127
-        'id' => 'geodir_load_map',
1128
-        'css' => 'min-width:300px;',
1129
-        'std' => 'auto',
1130
-        'type' => 'select',
1131
-        'placeholder_text' => __('Select Map', 'geodirectory'),
1132
-        'options' => array(
1133
-                        'auto' => __('Load Automatic', 'geodirectory'),
1134
-                        'google' => __('Load Google Maps API', 'geodirectory'),
1135
-                        'osm' => __('Load OpenStreetMap API', 'geodirectory'),
1136
-                        'none' => __('Disbale Maps', 'geodirectory')
1137
-                    )
1138
-    ),
1139
-
1140
-    array('type' => 'sectionend', 'id' => 'geodir_map_default_settings'),
1141
-
1142
-    array('name' => __('Show / hide post type and category on map', 'geodirectory'),
1143
-        'type' => 'sectionstart',
1144
-        'desc' => '',
1145
-        'id' => 'geodir_map_settings'),
1107
+	array(
1108
+		'name' => __('Upload map default marker icon', 'geodirectory'),
1109
+		'desc' => '',
1110
+		'id' => 'geodir_default_marker_icon',
1111
+		'type' => 'file',
1112
+		'std' => '0',
1113
+		'value' => geodir_plugin_url() . '/geodirectory-functions/map-functions/icons/pin.png'// Default value to show home top section
1114
+	),
1115
+	// add option that allows enable/disable map dragging to phone devices
1116
+	array(
1117
+		'name' => __('Show button control on map to enable/disable dragging', 'geodirectory'),
1118
+		'desc' => __('If checked, it displays button control to enable/disable dragging on google maps for phone devices', 'geodirectory'),
1119
+		'id' => 'geodir_map_onoff_dragging',
1120
+		'type' => 'checkbox',
1121
+		'std' => '0' // Default value to show home top section
1122
+	),
1123
+	array(
1124
+		'name' => __('Select Maps API', 'geodirectory'),
1125
+		'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'),
1126
+		'tip' => '',
1127
+		'id' => 'geodir_load_map',
1128
+		'css' => 'min-width:300px;',
1129
+		'std' => 'auto',
1130
+		'type' => 'select',
1131
+		'placeholder_text' => __('Select Map', 'geodirectory'),
1132
+		'options' => array(
1133
+						'auto' => __('Load Automatic', 'geodirectory'),
1134
+						'google' => __('Load Google Maps API', 'geodirectory'),
1135
+						'osm' => __('Load OpenStreetMap API', 'geodirectory'),
1136
+						'none' => __('Disbale Maps', 'geodirectory')
1137
+					)
1138
+	),
1146 1139
 
1147
-    array(
1148
-        'name' => __('Select Map Category', 'geodirectory'),
1149
-        'desc' => '',
1150
-        'id' => 'geodir_map_settings',
1151
-        'type' => 'map',
1152
-        'css' => 'min-width:300px;',
1153
-        'std' => '' // Default value for the page title - changed in settings
1154
-    ),
1155
-
1156
-    array('type' => 'sectionend', 'id' => 'geodir_map_settings'),
1157
-    /* Map Settings End */
1140
+	array('type' => 'sectionend', 'id' => 'geodir_map_default_settings'),
1141
+
1142
+	array('name' => __('Show / hide post type and category on map', 'geodirectory'),
1143
+		'type' => 'sectionstart',
1144
+		'desc' => '',
1145
+		'id' => 'geodir_map_settings'),
1146
+
1147
+	array(
1148
+		'name' => __('Select Map Category', 'geodirectory'),
1149
+		'desc' => '',
1150
+		'id' => 'geodir_map_settings',
1151
+		'type' => 'map',
1152
+		'css' => 'min-width:300px;',
1153
+		'std' => '' // Default value for the page title - changed in settings
1154
+	),
1155
+
1156
+	array('type' => 'sectionend', 'id' => 'geodir_map_settings'),
1157
+	/* Map Settings End */
1158 1158
 
1159 1159
 )); // End Design settings
Please login to merge, or discard this patch.
geodirectory_hooks_actions.php 3 patches
Indentation   +1481 added lines, -1481 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
  */
20 20
 function geodir_get_ajax_url()
21 21
 {
22
-    return admin_url('admin-ajax.php?action=geodir_ajax_action');
22
+	return admin_url('admin-ajax.php?action=geodir_ajax_action');
23 23
 }
24 24
 
25 25
 /////////////////////
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 add_filter('query_vars', 'geodir_add_geodir_page_var');
88 88
 add_action('wp', 'geodir_add_page_id_in_query_var'); // problem fix in wordpress 3.8
89 89
 if (get_option('permalink_structure') != '')
90
-    add_filter('parse_request', 'geodir_set_location_var_in_session_in_core');
90
+	add_filter('parse_request', 'geodir_set_location_var_in_session_in_core');
91 91
 
92 92
 add_filter('parse_query', 'geodir_modified_query');
93 93
 
@@ -154,14 +154,14 @@  discard block
 block discarded – undo
154 154
 /* POST AND LOOP ACTIONS */
155 155
 ////////////////////////
156 156
 if (!is_admin()) {
157
-    add_action('pre_get_posts', 'geodir_exclude_page', 100); /// Will help to exclude virtural page from everywhere
158
-    add_filter('wp_list_pages_excludes', 'exclude_from_wp_list_pages', 100);
159
-    /** Exclude Virtual Pages From Pages List **/
160
-    add_action('pre_get_posts', 'set_listing_request', 0);
161
-    add_action('pre_get_posts', 'geodir_listing_loop_filter', 1);
162
-    add_filter('excerpt_more', 'geodir_excerpt_more', 1000);
163
-    add_filter('excerpt_length', 'geodir_excerpt_length', 1000);
164
-    add_action('the_post', 'create_marker_jason_of_posts'); // Add marker in json array, Map related filter
157
+	add_action('pre_get_posts', 'geodir_exclude_page', 100); /// Will help to exclude virtural page from everywhere
158
+	add_filter('wp_list_pages_excludes', 'exclude_from_wp_list_pages', 100);
159
+	/** Exclude Virtual Pages From Pages List **/
160
+	add_action('pre_get_posts', 'set_listing_request', 0);
161
+	add_action('pre_get_posts', 'geodir_listing_loop_filter', 1);
162
+	add_filter('excerpt_more', 'geodir_excerpt_more', 1000);
163
+	add_filter('excerpt_length', 'geodir_excerpt_length', 1000);
164
+	add_action('the_post', 'create_marker_jason_of_posts'); // Add marker in json array, Map related filter
165 165
 }
166 166
 
167 167
 
@@ -222,12 +222,12 @@  discard block
 block discarded – undo
222 222
  */
223 223
 function geodir_unset_prev_theme_nav_location($newname)
224 224
 {
225
-    $geodir_theme_location = get_option('geodir_theme_location_nav_' . $newname);
226
-    if ($geodir_theme_location) {
227
-        update_option('geodir_theme_location_nav', $geodir_theme_location);
228
-    } else {
229
-        update_option('geodir_theme_location_nav', '');
230
-    }
225
+	$geodir_theme_location = get_option('geodir_theme_location_nav_' . $newname);
226
+	if ($geodir_theme_location) {
227
+		update_option('geodir_theme_location_nav', $geodir_theme_location);
228
+	} else {
229
+		update_option('geodir_theme_location_nav', '');
230
+	}
231 231
 }
232 232
 
233 233
 /// add action for theme switch to blank previous theme navigation location setting
@@ -248,32 +248,32 @@  discard block
 block discarded – undo
248 248
  */
249 249
 function geodir_add_post_filters()
250 250
 {
251
-    /**
252
-     * Contains all function for filtering listing.
253
-     *
254
-     * @since 1.0.0
255
-     * @package GeoDirectory
256
-     */
257
-    include_once('geodirectory-functions/listing_filters.php');
251
+	/**
252
+	 * Contains all function for filtering listing.
253
+	 *
254
+	 * @since 1.0.0
255
+	 * @package GeoDirectory
256
+	 */
257
+	include_once('geodirectory-functions/listing_filters.php');
258 258
 }
259 259
 
260 260
 
261 261
 if (!function_exists('geodir_init_defaults')) {
262
-    /**
263
-     * Calls the function to register the GeoDirectory default CPT and taxonomies.
264
-     *
265
-     * @since 1.0.0
266
-     * @package GeoDirectory
267
-     */
268
-    function geodir_init_defaults()
269
-    {
270
-        if (function_exists('geodir_register_defaults')) {
262
+	/**
263
+	 * Calls the function to register the GeoDirectory default CPT and taxonomies.
264
+	 *
265
+	 * @since 1.0.0
266
+	 * @package GeoDirectory
267
+	 */
268
+	function geodir_init_defaults()
269
+	{
270
+		if (function_exists('geodir_register_defaults')) {
271 271
 
272
-            geodir_register_defaults();
272
+			geodir_register_defaults();
273 273
 
274
-        }
274
+		}
275 275
 
276
-    }
276
+	}
277 277
 }
278 278
 
279 279
 
@@ -295,26 +295,26 @@  discard block
 block discarded – undo
295 295
 // CALLED ON 'sidebars_widgets' FILTER
296 296
 
297 297
 if (!function_exists('geodir_restrict_widget')) {
298
-    /**
299
-     * Sets global values to be able to tell if the current page is a GeoDirectory listing page or a GeoDirectory details page.
300
-     *
301
-     * @global bool $is_listing Sets the global value to true if on a GD category page. False if not.
302
-     * @global bool $is_single_place Sets the global value to true if on a GD details (post) page. False if not.
303
-     * @since 1.0.0
304
-     * @package GeoDirectory
305
-     */
306
-    function geodir_restrict_widget()
307
-    {
308
-        global $is_listing, $is_single_place;
298
+	/**
299
+	 * Sets global values to be able to tell if the current page is a GeoDirectory listing page or a GeoDirectory details page.
300
+	 *
301
+	 * @global bool $is_listing Sets the global value to true if on a GD category page. False if not.
302
+	 * @global bool $is_single_place Sets the global value to true if on a GD details (post) page. False if not.
303
+	 * @since 1.0.0
304
+	 * @package GeoDirectory
305
+	 */
306
+	function geodir_restrict_widget()
307
+	{
308
+		global $is_listing, $is_single_place;
309 309
 
310
-        // set is listing	
311
-        (geodir_is_page('listing')) ? $is_listing = true : $is_listing = false;
310
+		// set is listing	
311
+		(geodir_is_page('listing')) ? $is_listing = true : $is_listing = false;
312 312
 
313
-        // set is single place
314
-        (geodir_is_page('place')) ? $is_single_place = true : $is_single_place = false;
313
+		// set is single place
314
+		(geodir_is_page('place')) ? $is_single_place = true : $is_single_place = false;
315 315
 
316 316
 
317
-    }
317
+	}
318 318
 }
319 319
 
320 320
 
@@ -335,32 +335,32 @@  discard block
 block discarded – undo
335 335
  */
336 336
 function geodir_detail_page_sidebar_content_sorting()
337 337
 {
338
-    $arr_detail_page_sidebar_content =
339
-        /**
340
-         * An array of functions to be called to be displayed on the details (post) page sidebar.
341
-         *
342
-         * This filter can be used to remove sections of the details page sidebar,
343
-         * add new sections or rearrange the order of the sections.
344
-         *
345
-         * @param array array('geodir_social_sharing_buttons','geodir_share_this_button','geodir_detail_page_google_analytics','geodir_edit_post_link','geodir_detail_page_review_rating','geodir_detail_page_more_info') The array of functions that will be called.
346
-         * @since 1.0.0
347
-         */
348
-        apply_filters('geodir_detail_page_sidebar_content',
349
-            array('geodir_social_sharing_buttons',
350
-                'geodir_share_this_button',
351
-                'geodir_detail_page_google_analytics',
352
-                'geodir_edit_post_link',
353
-                //'geodir_detail_page_review_rating',
354
-                'geodir_detail_page_more_info'
355
-            ) // end of array 
356
-        ); // end of apply filter
357
-    if (!empty($arr_detail_page_sidebar_content)) {
358
-        foreach ($arr_detail_page_sidebar_content as $content_function) {
359
-            if (function_exists($content_function)) {
360
-                add_action('geodir_detail_page_sidebar', $content_function);
361
-            }
362
-        }
363
-    }
338
+	$arr_detail_page_sidebar_content =
339
+		/**
340
+		 * An array of functions to be called to be displayed on the details (post) page sidebar.
341
+		 *
342
+		 * This filter can be used to remove sections of the details page sidebar,
343
+		 * add new sections or rearrange the order of the sections.
344
+		 *
345
+		 * @param array array('geodir_social_sharing_buttons','geodir_share_this_button','geodir_detail_page_google_analytics','geodir_edit_post_link','geodir_detail_page_review_rating','geodir_detail_page_more_info') The array of functions that will be called.
346
+		 * @since 1.0.0
347
+		 */
348
+		apply_filters('geodir_detail_page_sidebar_content',
349
+			array('geodir_social_sharing_buttons',
350
+				'geodir_share_this_button',
351
+				'geodir_detail_page_google_analytics',
352
+				'geodir_edit_post_link',
353
+				//'geodir_detail_page_review_rating',
354
+				'geodir_detail_page_more_info'
355
+			) // end of array 
356
+		); // end of apply filter
357
+	if (!empty($arr_detail_page_sidebar_content)) {
358
+		foreach ($arr_detail_page_sidebar_content as $content_function) {
359
+			if (function_exists($content_function)) {
360
+				add_action('geodir_detail_page_sidebar', $content_function);
361
+			}
362
+		}
363
+	}
364 364
 }
365 365
 
366 366
 add_action('geodir_after_edit_post_link', 'geodir_add_to_favourite_link', 1);
@@ -375,14 +375,14 @@  discard block
 block discarded – undo
375 375
  */
376 376
 function geodir_add_to_favourite_link()
377 377
 {
378
-    global $post, $preview;
379
-    if (!$preview && geodir_is_page('detail')) {
380
-        ?>
378
+	global $post, $preview;
379
+	if (!$preview && geodir_is_page('detail')) {
380
+		?>
381 381
         <p class="edit_link">
382 382
             <?php geodir_favourite_html($post->post_author, $post->ID); ?>
383 383
         </p>
384 384
     <?php
385
-    }
385
+	}
386 386
 }
387 387
 
388 388
 /**
@@ -396,41 +396,41 @@  discard block
 block discarded – undo
396 396
  */
397 397
 function geodir_social_sharing_buttons()
398 398
 {
399
-    global $preview;
400
-    ob_start(); // Start  buffering;
401
-    /**
402
-     * This action is called before the social buttons twitter,facebook and google plus are output in a containing div.
403
-     *
404
-     * @since 1.0.0
405
-     */
406
-    do_action('geodir_before_social_sharing_buttons');
407
-    if (!$preview) {
408
-        ?>
399
+	global $preview;
400
+	ob_start(); // Start  buffering;
401
+	/**
402
+	 * This action is called before the social buttons twitter,facebook and google plus are output in a containing div.
403
+	 *
404
+	 * @since 1.0.0
405
+	 */
406
+	do_action('geodir_before_social_sharing_buttons');
407
+	if (!$preview) {
408
+		?>
409 409
         <div class="likethis">
410 410
             <?php geodir_twitter_tweet_button(); ?>
411 411
             <?php geodir_fb_like_button(); ?>
412 412
             <?php geodir_google_plus_button(); ?>
413 413
         </div>
414 414
     <?php
415
-    }// end of if, if its a preview or not
416
-
417
-    /**
418
-     * This action is called after the social buttons twitter,facebook and google plus are output in a containing div.
419
-     *
420
-     * @since 1.0.0
421
-     */
422
-    do_action('geodir_after_social_sharing_buttons');
423
-    $content_html = ob_get_clean();
424
-    if (trim($content_html) != '')
425
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-social-sharing">' . $content_html . '</div>';
426
-    if ((int)get_option('geodir_disable_tfg_buttons_section') != 1) {
427
-        /**
428
-         * Filter the geodir_social_sharing_buttons() function content.
429
-         *
430
-         * @param string $content_html The output html of the geodir_social_sharing_buttons() function.
431
-         */
432
-        echo $content_html = apply_filters('geodir_social_sharing_buttons_html', $content_html);
433
-    }
415
+	}// end of if, if its a preview or not
416
+
417
+	/**
418
+	 * This action is called after the social buttons twitter,facebook and google plus are output in a containing div.
419
+	 *
420
+	 * @since 1.0.0
421
+	 */
422
+	do_action('geodir_after_social_sharing_buttons');
423
+	$content_html = ob_get_clean();
424
+	if (trim($content_html) != '')
425
+		$content_html = '<div class="geodir-company_info geodir-details-sidebar-social-sharing">' . $content_html . '</div>';
426
+	if ((int)get_option('geodir_disable_tfg_buttons_section') != 1) {
427
+		/**
428
+		 * Filter the geodir_social_sharing_buttons() function content.
429
+		 *
430
+		 * @param string $content_html The output html of the geodir_social_sharing_buttons() function.
431
+		 */
432
+		echo $content_html = apply_filters('geodir_social_sharing_buttons_html', $content_html);
433
+	}
434 434
 
435 435
 
436 436
 }
@@ -446,39 +446,39 @@  discard block
 block discarded – undo
446 446
  */
447 447
 function geodir_share_this_button()
448 448
 {
449
-    global $preview;
450
-    ob_start(); // Start buffering;
451
-    /**
452
-     * This is called before the share this html in the function geodir_share_this_button()
453
-     *
454
-     * @since 1.0.0
455
-     */
456
-    do_action('geodir_before_share_this_button');
457
-    if (!$preview) {
458
-        ?>
449
+	global $preview;
450
+	ob_start(); // Start buffering;
451
+	/**
452
+	 * This is called before the share this html in the function geodir_share_this_button()
453
+	 *
454
+	 * @since 1.0.0
455
+	 */
456
+	do_action('geodir_before_share_this_button');
457
+	if (!$preview) {
458
+		?>
459 459
         <div class="share clearfix">
460 460
             <?php geodir_share_this_button_code(); ?>
461 461
         </div>
462 462
     <?php
463
-    }// end of if, if its a preview or not
464
-    /**
465
-     * This is called after the share this html in the function geodir_share_this_button()
466
-     *
467
-     * @since 1.0.0
468
-     */
469
-    do_action('geodir_after_share_this_button');
470
-    $content_html = ob_get_clean();
471
-    if (trim($content_html) != '')
472
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-sharethis">' . $content_html . '</div>';
473
-    if ((int)get_option('geodir_disable_sharethis_button_section') != 1) {
474
-        /**
475
-         * Filter the geodir_share_this_button() function content.
476
-         *
477
-         * @param string $content_html The output html of the geodir_share_this_button() function.
478
-         * @since 1.0.0
479
-         */
480
-        echo $content_html = apply_filters('geodir_share_this_button_html', $content_html);
481
-    }
463
+	}// end of if, if its a preview or not
464
+	/**
465
+	 * This is called after the share this html in the function geodir_share_this_button()
466
+	 *
467
+	 * @since 1.0.0
468
+	 */
469
+	do_action('geodir_after_share_this_button');
470
+	$content_html = ob_get_clean();
471
+	if (trim($content_html) != '')
472
+		$content_html = '<div class="geodir-company_info geodir-details-sidebar-sharethis">' . $content_html . '</div>';
473
+	if ((int)get_option('geodir_disable_sharethis_button_section') != 1) {
474
+		/**
475
+		 * Filter the geodir_share_this_button() function content.
476
+		 *
477
+		 * @param string $content_html The output html of the geodir_share_this_button() function.
478
+		 * @since 1.0.0
479
+		 */
480
+		echo $content_html = apply_filters('geodir_share_this_button_html', $content_html);
481
+	}
482 482
 
483 483
 }
484 484
 
@@ -494,46 +494,46 @@  discard block
 block discarded – undo
494 494
  */
495 495
 function geodir_edit_post_link()
496 496
 {
497
-    global $post, $preview;
498
-    ob_start(); // Start buffering;
499
-    /**
500
-     * This is called before the edit post link html in the function geodir_edit_post_link()
501
-     *
502
-     * @since 1.0.0
503
-     */
504
-    do_action('geodir_before_edit_post_link');
505
-    if (!$preview) {
506
-        $is_current_user_owner = geodir_listing_belong_to_current_user();
497
+	global $post, $preview;
498
+	ob_start(); // Start buffering;
499
+	/**
500
+	 * This is called before the edit post link html in the function geodir_edit_post_link()
501
+	 *
502
+	 * @since 1.0.0
503
+	 */
504
+	do_action('geodir_before_edit_post_link');
505
+	if (!$preview) {
506
+		$is_current_user_owner = geodir_listing_belong_to_current_user();
507 507
         
508
-        if ($is_current_user_owner) {
509
-            $post_id = $post->ID;
508
+		if ($is_current_user_owner) {
509
+			$post_id = $post->ID;
510 510
             
511
-            if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
512
-                $post_id = (int)$_REQUEST['pid'];
513
-            }
511
+			if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
512
+				$post_id = (int)$_REQUEST['pid'];
513
+			}
514 514
 
515
-            $postlink = get_permalink(geodir_add_listing_page_id());
516
-            $editlink = geodir_getlink($postlink, array('pid' => $post_id), false);
517
-            echo ' <p class="edit_link"><i class="fa fa-pencil"></i> <a href="' . esc_url($editlink) . '">' . __('Edit this Post', 'geodirectory') . '</a></p>';
518
-        }
519
-    }// end of if, if its a preview or not
520
-    /**
521
-     * This is called after the edit post link html in the function geodir_edit_post_link()
522
-     *
523
-     * @since 1.0.0
524
-     */
525
-    do_action('geodir_after_edit_post_link');
526
-    $content_html = ob_get_clean();
527
-    if (trim($content_html) != '')
528
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-user-links">' . $content_html . '</div>';
529
-    if ((int)get_option('geodir_disable_user_links_section') != 1) {
530
-        /**
531
-         * Filter the geodir_edit_post_link() function content.
532
-         *
533
-         * @param string $content_html The output html of the geodir_edit_post_link() function.
534
-         */
535
-        echo $content_html = apply_filters('geodir_edit_post_link_html', $content_html);
536
-    }
515
+			$postlink = get_permalink(geodir_add_listing_page_id());
516
+			$editlink = geodir_getlink($postlink, array('pid' => $post_id), false);
517
+			echo ' <p class="edit_link"><i class="fa fa-pencil"></i> <a href="' . esc_url($editlink) . '">' . __('Edit this Post', 'geodirectory') . '</a></p>';
518
+		}
519
+	}// end of if, if its a preview or not
520
+	/**
521
+	 * This is called after the edit post link html in the function geodir_edit_post_link()
522
+	 *
523
+	 * @since 1.0.0
524
+	 */
525
+	do_action('geodir_after_edit_post_link');
526
+	$content_html = ob_get_clean();
527
+	if (trim($content_html) != '')
528
+		$content_html = '<div class="geodir-company_info geodir-details-sidebar-user-links">' . $content_html . '</div>';
529
+	if ((int)get_option('geodir_disable_user_links_section') != 1) {
530
+		/**
531
+		 * Filter the geodir_edit_post_link() function content.
532
+		 *
533
+		 * @param string $content_html The output html of the geodir_edit_post_link() function.
534
+		 */
535
+		echo $content_html = apply_filters('geodir_edit_post_link_html', $content_html);
536
+	}
537 537
 }
538 538
 
539 539
 /**
@@ -547,41 +547,41 @@  discard block
 block discarded – undo
547 547
  */
548 548
 function geodir_detail_page_google_analytics()
549 549
 {
550
-    global $post;
551
-    $package_info = array();
552
-    $package_info = geodir_post_package_info($package_info, $post);
550
+	global $post;
551
+	$package_info = array();
552
+	$package_info = geodir_post_package_info($package_info, $post);
553 553
 
554
-    $id = trim(get_option('geodir_ga_id'));
554
+	$id = trim(get_option('geodir_ga_id'));
555 555
 
556
-    if (!$id) {
557
-        return; //if no Google Analytics ID then bail.
558
-    }
556
+	if (!$id) {
557
+		return; //if no Google Analytics ID then bail.
558
+	}
559 559
 
560
-    ob_start(); // Start buffering;
561
-    /**
562
-     * This is called before the edit post link html in the function geodir_detail_page_google_analytics()
563
-     *
564
-     * @since 1.0.0
565
-     */
566
-    do_action('geodir_before_google_analytics');
560
+	ob_start(); // Start buffering;
561
+	/**
562
+	 * This is called before the edit post link html in the function geodir_detail_page_google_analytics()
563
+	 *
564
+	 * @since 1.0.0
565
+	 */
566
+	do_action('geodir_before_google_analytics');
567 567
     
568
-    $refresh_time = get_option('geodir_ga_refresh_time', 5);
569
-    /**
570
-     * Filter the time interval to check & refresh new users results.
571
-     *
572
-     * @since 1.5.9
573
-     *
574
-     * @param int $refresh_time Time interval to check & refresh new users results.
575
-     */
576
-    $refresh_time = apply_filters('geodir_google_analytics_refresh_time', $refresh_time);
577
-    $refresh_time = absint($refresh_time * 1000);
568
+	$refresh_time = get_option('geodir_ga_refresh_time', 5);
569
+	/**
570
+	 * Filter the time interval to check & refresh new users results.
571
+	 *
572
+	 * @since 1.5.9
573
+	 *
574
+	 * @param int $refresh_time Time interval to check & refresh new users results.
575
+	 */
576
+	$refresh_time = apply_filters('geodir_google_analytics_refresh_time', $refresh_time);
577
+	$refresh_time = absint($refresh_time * 1000);
578 578
     
579
-    $hide_refresh = get_option('geodir_ga_auto_refresh');
579
+	$hide_refresh = get_option('geodir_ga_auto_refresh');
580 580
     
581
-    $auto_refresh = $hide_refresh && $refresh_time && $refresh_time > 0 ? 1 : 0;
582
-    if (get_option('geodir_ga_stats') && is_user_logged_in() &&  (isset($package_info->google_analytics) && $package_info->google_analytics == '1') && (get_current_user_id()==$post->post_author || current_user_can( 'manage_options' )) ) {
583
-        $page_url = urlencode($_SERVER['REQUEST_URI']);
584
-        ?>
581
+	$auto_refresh = $hide_refresh && $refresh_time && $refresh_time > 0 ? 1 : 0;
582
+	if (get_option('geodir_ga_stats') && is_user_logged_in() &&  (isset($package_info->google_analytics) && $package_info->google_analytics == '1') && (get_current_user_id()==$post->post_author || current_user_can( 'manage_options' )) ) {
583
+		$page_url = urlencode($_SERVER['REQUEST_URI']);
584
+		?>
585 585
         <script type="text/javascript">
586 586
             var gd_gaTimeOut;
587 587
             var gd_gaTime = parseInt('<?php echo $refresh_time;?>');
@@ -833,15 +833,15 @@  discard block
 block discarded – undo
833 833
                     var labels = results[1].rows.map(function(row) { return +row[0]; });
834 834
 
835 835
                     <?php
836
-                    // Here we list the shorthand days of the week so it can be used in translation.
837
-                    __("Mon",'geodirectory');
838
-                    __("Tue",'geodirectory');
839
-                    __("Wed",'geodirectory');
840
-                    __("Thu",'geodirectory');
841
-                    __("Fri",'geodirectory');
842
-                    __("Sat",'geodirectory');
843
-                    __("Sun",'geodirectory');
844
-                    ?>
836
+					// Here we list the shorthand days of the week so it can be used in translation.
837
+					__("Mon",'geodirectory');
838
+					__("Tue",'geodirectory');
839
+					__("Wed",'geodirectory');
840
+					__("Thu",'geodirectory');
841
+					__("Fri",'geodirectory');
842
+					__("Sat",'geodirectory');
843
+					__("Sun",'geodirectory');
844
+					?>
845 845
 
846 846
                     labels = [
847 847
                         "<?php _e(date('D', strtotime("+1 day")),'geodirectory'); ?>",
@@ -1090,24 +1090,24 @@  discard block
 block discarded – undo
1090 1090
         </span>
1091 1091
 
1092 1092
     <?php
1093
-    }
1094
-    /**
1095
-     * This is called after the edit post link html in the function geodir_detail_page_google_analytics()
1096
-     *
1097
-     * @since 1.0.0
1098
-     */
1099
-    do_action('geodir_after_google_analytics');
1100
-    $content_html = ob_get_clean();
1101
-    if (trim($content_html) != '')
1102
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-google-analytics">' . $content_html . '</div>';
1103
-    if ((int)get_option('geodir_disable_google_analytics_section') != 1) {
1104
-        /**
1105
-         * Filter the geodir_edit_post_link() function content.
1106
-         *
1107
-         * @param string $content_html The output html of the geodir_edit_post_link() function.
1108
-         */
1109
-        echo $content_html = apply_filters('geodir_google_analytic_html', $content_html);
1110
-    }
1093
+	}
1094
+	/**
1095
+	 * This is called after the edit post link html in the function geodir_detail_page_google_analytics()
1096
+	 *
1097
+	 * @since 1.0.0
1098
+	 */
1099
+	do_action('geodir_after_google_analytics');
1100
+	$content_html = ob_get_clean();
1101
+	if (trim($content_html) != '')
1102
+		$content_html = '<div class="geodir-company_info geodir-details-sidebar-google-analytics">' . $content_html . '</div>';
1103
+	if ((int)get_option('geodir_disable_google_analytics_section') != 1) {
1104
+		/**
1105
+		 * Filter the geodir_edit_post_link() function content.
1106
+		 *
1107
+		 * @param string $content_html The output html of the geodir_edit_post_link() function.
1108
+		 */
1109
+		echo $content_html = apply_filters('geodir_google_analytic_html', $content_html);
1110
+	}
1111 1111
 }
1112 1112
 
1113 1113
 /**
@@ -1123,90 +1123,90 @@  discard block
 block discarded – undo
1123 1123
  */
1124 1124
 function geodir_detail_page_review_rating()
1125 1125
 {
1126
-    global $post, $preview, $post_images;
1127
-    ob_start(); // Start  buffering;
1128
-    /**
1129
-     * This is called before the rating html in the function geodir_detail_page_review_rating().
1130
-     *
1131
-     * This is called outside the check for an actual rating and the check for preview page.
1132
-     *
1133
-     * @since 1.0.0
1134
-     */
1135
-    do_action('geodir_before_detail_page_review_rating');
1136
-
1137
-    $comment_count = geodir_get_review_count_total($post->ID);
1138
-    $post_avgratings = geodir_get_post_rating($post->ID);
1139
-
1140
-    if ($post_avgratings != 0 && !$preview) {
1141
-        /**
1142
-         * This is called before the rating html in the function geodir_detail_page_review_rating().
1143
-         *
1144
-         * This is called inside the check for an actual rating and the check for preview page.
1145
-         *
1146
-         * @since 1.0.0
1147
-         * @param float $post_avgratings Average rating for the surrent post.
1148
-         * @param int $post->ID Current post ID.
1149
-         */
1150
-        do_action('geodir_before_review_rating_stars_on_detail', $post_avgratings, $post->ID);
1151
-
1152
-        $html = '<p style=" float:left;">';
1153
-        $html .= geodir_get_rating_stars($post_avgratings, $post->ID);
1154
-        $html .= '<div class="average-review" itemscope itemtype="http://data-vocabulary.org/Review-aggregate">';
1155
-        $post_avgratings = (is_float($post_avgratings) || (strpos($post_avgratings, ".", 1) == 1 && strlen($post_avgratings) > 3)) ? number_format($post_avgratings, 1, '.', '') : $post_avgratings;
1126
+	global $post, $preview, $post_images;
1127
+	ob_start(); // Start  buffering;
1128
+	/**
1129
+	 * This is called before the rating html in the function geodir_detail_page_review_rating().
1130
+	 *
1131
+	 * This is called outside the check for an actual rating and the check for preview page.
1132
+	 *
1133
+	 * @since 1.0.0
1134
+	 */
1135
+	do_action('geodir_before_detail_page_review_rating');
1136
+
1137
+	$comment_count = geodir_get_review_count_total($post->ID);
1138
+	$post_avgratings = geodir_get_post_rating($post->ID);
1139
+
1140
+	if ($post_avgratings != 0 && !$preview) {
1141
+		/**
1142
+		 * This is called before the rating html in the function geodir_detail_page_review_rating().
1143
+		 *
1144
+		 * This is called inside the check for an actual rating and the check for preview page.
1145
+		 *
1146
+		 * @since 1.0.0
1147
+		 * @param float $post_avgratings Average rating for the surrent post.
1148
+		 * @param int $post->ID Current post ID.
1149
+		 */
1150
+		do_action('geodir_before_review_rating_stars_on_detail', $post_avgratings, $post->ID);
1151
+
1152
+		$html = '<p style=" float:left;">';
1153
+		$html .= geodir_get_rating_stars($post_avgratings, $post->ID);
1154
+		$html .= '<div class="average-review" itemscope itemtype="http://data-vocabulary.org/Review-aggregate">';
1155
+		$post_avgratings = (is_float($post_avgratings) || (strpos($post_avgratings, ".", 1) == 1 && strlen($post_avgratings) > 3)) ? number_format($post_avgratings, 1, '.', '') : $post_avgratings;
1156 1156
        
1157 1157
 	   $reviews_text = $comment_count > 1 ? __("reviews", 'geodirectory') : __("review", 'geodirectory');
1158 1158
 	   
1159 1159
 	   $html .= '<span itemprop="rating" itemscope itemtype="http://data-vocabulary.org/Rating"><span class="rating" itemprop="average" content="' . $post_avgratings . '">' . $post_avgratings . '</span> / <span itemprop="best" content="5">5</span> ' . __("based on", 'geodirectory') . ' </span><span class="count" itemprop="count" content="' . $comment_count . '">' . $comment_count . ' ' . $reviews_text . '</span><br />';
1160 1160
 
1161
-        $html .= '<span class="item">';
1162
-        $html .= '<span class="fn" itemprop="itemreviewed">' . $post->post_title . '</span>';
1161
+		$html .= '<span class="item">';
1162
+		$html .= '<span class="fn" itemprop="itemreviewed">' . $post->post_title . '</span>';
1163 1163
 
1164
-        if ($post_images) {
1165
-            foreach ($post_images as $img) {
1166
-                $post_img = $img->src;
1167
-                break;
1168
-            }
1169
-        }
1170
-
1171
-        if (isset($post_img) && $post_img) {
1172
-            $html .= '<br /><img src="' . $post_img . '" class="photo" alt="' . esc_attr($post->post_title) . '" itemprop="photo" content="' . $post_img . '" class="photo" />';
1173
-        }
1174
-
1175
-        $html .= '</span>';
1176
-
1177
-        echo $html .= '</div>';
1178
-        /**
1179
-         * This is called after the rating html in the function geodir_detail_page_review_rating().
1180
-         *
1181
-         * This is called inside the check for an actual rating and the check for preview page.
1182
-         *
1183
-         * @since 1.0.0
1184
-         * @param float $post_avgratings Average rating for the surrent post.
1185
-         * @param int $post->ID Current post ID.
1186
-         */
1187
-        do_action('geodir_after_review_rating_stars_on_detail', $post_avgratings, $post->ID);
1188
-    }
1189
-    /**
1190
-     * This is called before the rating html in the function geodir_detail_page_review_rating().
1191
-     *
1192
-     * This is called outside the check for an actual rating and the check for preview page.
1193
-     *
1194
-     * @since 1.0.0
1195
-     */
1196
-    do_action('geodir_after_detail_page_review_rating');
1197
-    $content_html = ob_get_clean();
1198
-    if (trim($content_html) != '') {
1199
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-rating">' . $content_html . '</div>';
1200
-    }
1201
-    if ((int)get_option('geodir_disable_rating_info_section') != 1) {
1202
-        /**
1203
-         * Filter the geodir_detail_page_review_rating() function content.
1204
-         *
1205
-         * @since 1.0.0
1206
-         * @param string $content_html The output html of the geodir_detail_page_review_rating() function.
1207
-         */
1208
-        echo $content_html = apply_filters('geodir_detail_page_review_rating_html', $content_html);
1209
-    }
1164
+		if ($post_images) {
1165
+			foreach ($post_images as $img) {
1166
+				$post_img = $img->src;
1167
+				break;
1168
+			}
1169
+		}
1170
+
1171
+		if (isset($post_img) && $post_img) {
1172
+			$html .= '<br /><img src="' . $post_img . '" class="photo" alt="' . esc_attr($post->post_title) . '" itemprop="photo" content="' . $post_img . '" class="photo" />';
1173
+		}
1174
+
1175
+		$html .= '</span>';
1176
+
1177
+		echo $html .= '</div>';
1178
+		/**
1179
+		 * This is called after the rating html in the function geodir_detail_page_review_rating().
1180
+		 *
1181
+		 * This is called inside the check for an actual rating and the check for preview page.
1182
+		 *
1183
+		 * @since 1.0.0
1184
+		 * @param float $post_avgratings Average rating for the surrent post.
1185
+		 * @param int $post->ID Current post ID.
1186
+		 */
1187
+		do_action('geodir_after_review_rating_stars_on_detail', $post_avgratings, $post->ID);
1188
+	}
1189
+	/**
1190
+	 * This is called before the rating html in the function geodir_detail_page_review_rating().
1191
+	 *
1192
+	 * This is called outside the check for an actual rating and the check for preview page.
1193
+	 *
1194
+	 * @since 1.0.0
1195
+	 */
1196
+	do_action('geodir_after_detail_page_review_rating');
1197
+	$content_html = ob_get_clean();
1198
+	if (trim($content_html) != '') {
1199
+		$content_html = '<div class="geodir-company_info geodir-details-sidebar-rating">' . $content_html . '</div>';
1200
+	}
1201
+	if ((int)get_option('geodir_disable_rating_info_section') != 1) {
1202
+		/**
1203
+		 * Filter the geodir_detail_page_review_rating() function content.
1204
+		 *
1205
+		 * @since 1.0.0
1206
+		 * @param string $content_html The output html of the geodir_detail_page_review_rating() function.
1207
+		 */
1208
+		echo $content_html = apply_filters('geodir_detail_page_review_rating_html', $content_html);
1209
+	}
1210 1210
 }
1211 1211
 
1212 1212
 /**
@@ -1218,35 +1218,35 @@  discard block
 block discarded – undo
1218 1218
  */
1219 1219
 function geodir_detail_page_more_info()
1220 1220
 {
1221
-    ob_start(); // Start  buffering;
1222
-    /**
1223
-     * This is called before the info section html.
1224
-     *
1225
-     * @since 1.0.0
1226
-     */
1227
-    do_action('geodir_before_detail_page_more_info');
1228
-    if ($geodir_post_detail_fields = geodir_show_listing_info()) {
1229
-        echo $geodir_post_detail_fields;
1230
-    }
1231
-    /**
1232
-     * This is called after the info section html.
1233
-     *
1234
-     * @since 1.0.0
1235
-     */
1236
-    do_action('geodir_after_detail_page_more_info');
1237
-
1238
-    $content_html = ob_get_clean();
1239
-    if (trim($content_html) != '')
1240
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-listing-info">' . $content_html . '</div>';
1241
-    if ((int)get_option('geodir_disable_listing_info_section') != 1) {
1242
-        /**
1243
-         * Filter the output html for function geodir_detail_page_more_info().
1244
-         *
1245
-         * @since 1.0.0
1246
-         * @param string $content_html The output html of the geodir_detail_page_more_info() function.
1247
-         */
1248
-        echo $content_html = apply_filters('geodir_detail_page_more_info_html', $content_html);
1249
-    }
1221
+	ob_start(); // Start  buffering;
1222
+	/**
1223
+	 * This is called before the info section html.
1224
+	 *
1225
+	 * @since 1.0.0
1226
+	 */
1227
+	do_action('geodir_before_detail_page_more_info');
1228
+	if ($geodir_post_detail_fields = geodir_show_listing_info()) {
1229
+		echo $geodir_post_detail_fields;
1230
+	}
1231
+	/**
1232
+	 * This is called after the info section html.
1233
+	 *
1234
+	 * @since 1.0.0
1235
+	 */
1236
+	do_action('geodir_after_detail_page_more_info');
1237
+
1238
+	$content_html = ob_get_clean();
1239
+	if (trim($content_html) != '')
1240
+		$content_html = '<div class="geodir-company_info geodir-details-sidebar-listing-info">' . $content_html . '</div>';
1241
+	if ((int)get_option('geodir_disable_listing_info_section') != 1) {
1242
+		/**
1243
+		 * Filter the output html for function geodir_detail_page_more_info().
1244
+		 *
1245
+		 * @since 1.0.0
1246
+		 * @param string $content_html The output html of the geodir_detail_page_more_info() function.
1247
+		 */
1248
+		echo $content_html = apply_filters('geodir_detail_page_more_info_html', $content_html);
1249
+	}
1250 1250
 }
1251 1251
 
1252 1252
 
@@ -1260,15 +1260,15 @@  discard block
 block discarded – undo
1260 1260
  */
1261 1261
 function geodir_localize_all_js_msg()
1262 1262
 {// check_ajax_referer function is used to make sure no files are uplaoded remotly but it will fail if used between https and non https so we do the check below of the urls
1263
-    if (str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
1264
-        $ajax_url = admin_url('admin-ajax.php');
1265
-    } elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
1266
-        $ajax_url = admin_url('admin-ajax.php');
1267
-    } elseif (str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
1268
-        $ajax_url = str_replace("https", "http", admin_url('admin-ajax.php'));
1269
-    } elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
1270
-        $ajax_url = str_replace("http", "https", admin_url('admin-ajax.php'));
1271
-    }
1263
+	if (str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
1264
+		$ajax_url = admin_url('admin-ajax.php');
1265
+	} elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
1266
+		$ajax_url = admin_url('admin-ajax.php');
1267
+	} elseif (str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
1268
+		$ajax_url = str_replace("https", "http", admin_url('admin-ajax.php'));
1269
+	} elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
1270
+		$ajax_url = str_replace("http", "https", admin_url('admin-ajax.php'));
1271
+	}
1272 1272
 	
1273 1273
 	/**
1274 1274
 	 * Filter the allowed image type extensions for post images.
@@ -1278,59 +1278,59 @@  discard block
 block discarded – undo
1278 1278
 	 */
1279 1279
 	$allowed_img_types = apply_filters('geodir_allowed_post_image_exts', array('jpg', 'jpeg', 'jpe', 'gif', 'png'));
1280 1280
 	
1281
-    $default_marker_icon = get_option('geodir_default_marker_icon');
1282
-    $default_marker_size = geodir_get_marker_size($default_marker_icon, array('w' => 20, 'h' => 34));
1283
-    $default_marker_width = $default_marker_size['w'];
1284
-    $default_marker_height = $default_marker_size['h'];
1281
+	$default_marker_icon = get_option('geodir_default_marker_icon');
1282
+	$default_marker_size = geodir_get_marker_size($default_marker_icon, array('w' => 20, 'h' => 34));
1283
+	$default_marker_width = $default_marker_size['w'];
1284
+	$default_marker_height = $default_marker_size['h'];
1285 1285
     
1286
-    $arr_alert_msg = array(
1287
-        'geodir_plugin_url' => geodir_plugin_url(),
1288
-        'geodir_admin_ajax_url' => $ajax_url,
1289
-        'custom_field_not_blank_var' => __('HTML Variable Name must not be blank', 'geodirectory'),
1290
-        'custom_field_not_special_char' => __('Please do not use special character and spaces in HTML Variable Name.', 'geodirectory'),
1291
-        'custom_field_unique_name' => __('HTML Variable Name should be a unique name.', 'geodirectory'),
1292
-        'custom_field_delete' => __('Are you wish to delete this field?', 'geodirectory'),
1293
-        //start not show alert msg
1294
-        'tax_meta_class_succ_del_msg' => __('File has been successfully deleted.', 'geodirectory'),
1295
-        'tax_meta_class_not_permission_to_del_msg' => __('You do NOT have permission to delete this file.', 'geodirectory'),
1296
-        'tax_meta_class_order_save_msg' => __('Order saved!', 'geodirectory'),
1297
-        'tax_meta_class_not_permission_record_img_msg' => __('You do not have permission to reorder images.', 'geodirectory'),
1298
-        'address_not_found_on_map_msg' => __('Address not found for:', 'geodirectory'),
1299
-        // end not show alert msg
1300
-        'my_place_listing_del' => __('Are you wish to delete this listing?', 'geodirectory'),
1301
-        //start not show alert msg
1302
-        'rating_error_msg' => __('Error : please retry', 'geodirectory'),
1303
-        'listing_url_prefix_msg' => __('Please enter listing url prefix', 'geodirectory'),
1304
-        'invalid_listing_prefix_msg' => __('Invalid character in listing url prefix', 'geodirectory'),
1305
-        'location_url_prefix_msg' => __('Please enter location url prefix', 'geodirectory'),
1306
-        'invalid_location_prefix_msg' => __('Invalid character in location url prefix', 'geodirectory'),
1307
-        'location_and_cat_url_separator_msg' => __('Please enter location and category url separator', 'geodirectory'),
1308
-        'invalid_char_and_cat_url_separator_msg' => __('Invalid character in location and category url separator', 'geodirectory'),
1309
-        'listing_det_url_separator_msg' => __('Please enter listing detail url separator', 'geodirectory'),
1310
-        'invalid_char_listing_det_url_separator_msg' => __('Invalid character in listing detail url separator', 'geodirectory'),
1311
-        'loading_listing_error_favorite' => __('Error loading listing.', 'geodirectory'),
1312
-        'geodir_field_id_required' => __('This field is required.', 'geodirectory'),
1313
-        'geodir_valid_email_address_msg' => __('Please enter valid email address.', 'geodirectory'),
1314
-        'geodir_default_marker_icon' => $default_marker_icon,
1315
-        'geodir_default_marker_w' => $default_marker_width,
1316
-        'geodir_default_marker_h' => $default_marker_height,
1317
-        'geodir_latitude_error_msg' => GEODIR_LATITUDE_ERROR_MSG,
1318
-        'geodir_longgitude_error_msg' => GEODIR_LOGNGITUDE_ERROR_MSG,
1319
-        'geodir_default_rating_star_icon' => get_option('geodir_default_rating_star_icon'),
1320
-        'gd_cmt_btn_post_reply' => __('Post Reply', 'geodirectory'),
1321
-        'gd_cmt_btn_reply_text' => __('Reply text', 'geodirectory'),
1322
-        'gd_cmt_btn_post_review' => __('Post Review', 'geodirectory'),
1323
-        'gd_cmt_btn_review_text' => __('Review text', 'geodirectory'),
1324
-        'gd_cmt_err_no_rating' => __("Please select star rating, you can't leave a review without stars.", 'geodirectory'),
1325
-        /* on/off dragging for phone devices */
1326
-        'geodir_onoff_dragging' => get_option('geodir_map_onoff_dragging') ? true : false,
1327
-        'geodir_is_mobile' => wp_is_mobile() ? true : false,
1328
-        'geodir_on_dragging_text' => __('Enable Dragging', 'geodirectory'),
1329
-        'geodir_off_dragging_text' => __('Disable Dragging', 'geodirectory'),
1330
-        'geodir_err_max_file_size' => __('File size error : You tried to upload a file over %s', 'geodirectory'),
1331
-        'geodir_err_file_upload_limit' => __('You have reached your upload limit of %s files.', 'geodirectory'),
1332
-        'geodir_err_pkg_upload_limit' => __('You may only upload %s files with this package, please try again.', 'geodirectory'),
1333
-        'geodir_action_remove' => __('Remove', 'geodirectory'),
1286
+	$arr_alert_msg = array(
1287
+		'geodir_plugin_url' => geodir_plugin_url(),
1288
+		'geodir_admin_ajax_url' => $ajax_url,
1289
+		'custom_field_not_blank_var' => __('HTML Variable Name must not be blank', 'geodirectory'),
1290
+		'custom_field_not_special_char' => __('Please do not use special character and spaces in HTML Variable Name.', 'geodirectory'),
1291
+		'custom_field_unique_name' => __('HTML Variable Name should be a unique name.', 'geodirectory'),
1292
+		'custom_field_delete' => __('Are you wish to delete this field?', 'geodirectory'),
1293
+		//start not show alert msg
1294
+		'tax_meta_class_succ_del_msg' => __('File has been successfully deleted.', 'geodirectory'),
1295
+		'tax_meta_class_not_permission_to_del_msg' => __('You do NOT have permission to delete this file.', 'geodirectory'),
1296
+		'tax_meta_class_order_save_msg' => __('Order saved!', 'geodirectory'),
1297
+		'tax_meta_class_not_permission_record_img_msg' => __('You do not have permission to reorder images.', 'geodirectory'),
1298
+		'address_not_found_on_map_msg' => __('Address not found for:', 'geodirectory'),
1299
+		// end not show alert msg
1300
+		'my_place_listing_del' => __('Are you wish to delete this listing?', 'geodirectory'),
1301
+		//start not show alert msg
1302
+		'rating_error_msg' => __('Error : please retry', 'geodirectory'),
1303
+		'listing_url_prefix_msg' => __('Please enter listing url prefix', 'geodirectory'),
1304
+		'invalid_listing_prefix_msg' => __('Invalid character in listing url prefix', 'geodirectory'),
1305
+		'location_url_prefix_msg' => __('Please enter location url prefix', 'geodirectory'),
1306
+		'invalid_location_prefix_msg' => __('Invalid character in location url prefix', 'geodirectory'),
1307
+		'location_and_cat_url_separator_msg' => __('Please enter location and category url separator', 'geodirectory'),
1308
+		'invalid_char_and_cat_url_separator_msg' => __('Invalid character in location and category url separator', 'geodirectory'),
1309
+		'listing_det_url_separator_msg' => __('Please enter listing detail url separator', 'geodirectory'),
1310
+		'invalid_char_listing_det_url_separator_msg' => __('Invalid character in listing detail url separator', 'geodirectory'),
1311
+		'loading_listing_error_favorite' => __('Error loading listing.', 'geodirectory'),
1312
+		'geodir_field_id_required' => __('This field is required.', 'geodirectory'),
1313
+		'geodir_valid_email_address_msg' => __('Please enter valid email address.', 'geodirectory'),
1314
+		'geodir_default_marker_icon' => $default_marker_icon,
1315
+		'geodir_default_marker_w' => $default_marker_width,
1316
+		'geodir_default_marker_h' => $default_marker_height,
1317
+		'geodir_latitude_error_msg' => GEODIR_LATITUDE_ERROR_MSG,
1318
+		'geodir_longgitude_error_msg' => GEODIR_LOGNGITUDE_ERROR_MSG,
1319
+		'geodir_default_rating_star_icon' => get_option('geodir_default_rating_star_icon'),
1320
+		'gd_cmt_btn_post_reply' => __('Post Reply', 'geodirectory'),
1321
+		'gd_cmt_btn_reply_text' => __('Reply text', 'geodirectory'),
1322
+		'gd_cmt_btn_post_review' => __('Post Review', 'geodirectory'),
1323
+		'gd_cmt_btn_review_text' => __('Review text', 'geodirectory'),
1324
+		'gd_cmt_err_no_rating' => __("Please select star rating, you can't leave a review without stars.", 'geodirectory'),
1325
+		/* on/off dragging for phone devices */
1326
+		'geodir_onoff_dragging' => get_option('geodir_map_onoff_dragging') ? true : false,
1327
+		'geodir_is_mobile' => wp_is_mobile() ? true : false,
1328
+		'geodir_on_dragging_text' => __('Enable Dragging', 'geodirectory'),
1329
+		'geodir_off_dragging_text' => __('Disable Dragging', 'geodirectory'),
1330
+		'geodir_err_max_file_size' => __('File size error : You tried to upload a file over %s', 'geodirectory'),
1331
+		'geodir_err_file_upload_limit' => __('You have reached your upload limit of %s files.', 'geodirectory'),
1332
+		'geodir_err_pkg_upload_limit' => __('You may only upload %s files with this package, please try again.', 'geodirectory'),
1333
+		'geodir_action_remove' => __('Remove', 'geodirectory'),
1334 1334
 		'geodir_txt_all_files' => __('Allowed files', 'geodirectory'),
1335 1335
 		'geodir_err_file_type' => __('File type error. Allowed file types: %s', 'geodirectory'),
1336 1336
 		'gd_allowed_img_types' => !empty($allowed_img_types) ? implode(',', $allowed_img_types) : '',
@@ -1338,29 +1338,29 @@  discard block
 block discarded – undo
1338 1338
 		'geodir_txt_form_searching' => __('Searching...', 'geodirectory'),
1339 1339
 		'fa_rating' => (int)get_option('geodir_reviewrating_enable_font_awesome') == 1 ? 1 : '',
1340 1340
 		'reviewrating' => defined('GEODIRREVIEWRATING_VERSION') ? 1 : '',
1341
-        'geodir_map_name' => geodir_map_name(),
1342
-    );
1343
-
1344
-    /**
1345
-     * Filters the translated JS strings from function geodir_localize_all_js_msg().
1346
-     *
1347
-     * With this filter you can add, remove or change translated JS strings.
1348
-     * You should add your own translations to this if you are building an addon rather than adding another script block.
1349
-     *
1350
-     * @since 1.0.0
1351
-     */
1352
-    $arr_alert_msg = apply_filters('geodir_all_js_msg', $arr_alert_msg);
1353
-
1354
-    foreach ($arr_alert_msg as $key => $value) {
1355
-        if (!is_scalar($value))
1356
-            continue;
1357
-        $arr_alert_msg[$key] = html_entity_decode((string)$value, ENT_QUOTES, 'UTF-8');
1358
-    }
1341
+		'geodir_map_name' => geodir_map_name(),
1342
+	);
1359 1343
 
1360
-    $script = "var geodir_all_js_msg = " . json_encode($arr_alert_msg) . ';';
1361
-    echo '<script>';
1362
-    echo $script;
1363
-    echo '</script>';
1344
+	/**
1345
+	 * Filters the translated JS strings from function geodir_localize_all_js_msg().
1346
+	 *
1347
+	 * With this filter you can add, remove or change translated JS strings.
1348
+	 * You should add your own translations to this if you are building an addon rather than adding another script block.
1349
+	 *
1350
+	 * @since 1.0.0
1351
+	 */
1352
+	$arr_alert_msg = apply_filters('geodir_all_js_msg', $arr_alert_msg);
1353
+
1354
+	foreach ($arr_alert_msg as $key => $value) {
1355
+		if (!is_scalar($value))
1356
+			continue;
1357
+		$arr_alert_msg[$key] = html_entity_decode((string)$value, ENT_QUOTES, 'UTF-8');
1358
+	}
1359
+
1360
+	$script = "var geodir_all_js_msg = " . json_encode($arr_alert_msg) . ';';
1361
+	echo '<script>';
1362
+	echo $script;
1363
+	echo '</script>';
1364 1364
 }
1365 1365
 
1366 1366
 add_action('admin_bar_menu', 'geodir_admin_bar_site_menu', 31);
@@ -1376,9 +1376,9 @@  discard block
 block discarded – undo
1376 1376
  */
1377 1377
 function geodir_admin_bar_site_menu($wp_admin_bar)
1378 1378
 {
1379
-    if (get_option("geodir_installed")) {
1380
-        $wp_admin_bar->add_menu(array('parent' => 'appearance', 'id' => 'geodirectory', 'title' => __('GeoDirectory', 'geodirectory'), 'href' => admin_url('?page=geodirectory')));
1381
-    }
1379
+	if (get_option("geodir_installed")) {
1380
+		$wp_admin_bar->add_menu(array('parent' => 'appearance', 'id' => 'geodirectory', 'title' => __('GeoDirectory', 'geodirectory'), 'href' => admin_url('?page=geodirectory')));
1381
+	}
1382 1382
 }
1383 1383
 
1384 1384
 add_action('geodir_before_listing', 'geodir_display_sort_options'); /*function in custom_functions.php*/
@@ -1404,25 +1404,25 @@  discard block
 block discarded – undo
1404 1404
  */
1405 1405
 function geodir_store_sidebars()
1406 1406
 {
1407
-    global $geodir_sidebars;
1408
-    global $sidebars_widgets;
1409
-
1410
-    if (!is_array($sidebars_widgets))
1411
-        $sidebars_widgets = wp_get_sidebars_widgets();
1412
-    $geodir_old_sidebars = array();
1413
-
1414
-    if (is_array($geodir_sidebars)) {
1415
-        foreach ($geodir_sidebars as $val) {
1416
-            if (is_array($sidebars_widgets)) {
1417
-                if (array_key_exists($val, $sidebars_widgets))
1418
-                    $geodir_old_sidebars[$val] = $sidebars_widgets[$val];
1419
-                else
1420
-                    $geodir_old_sidebars[$val] = array();
1421
-            }
1422
-        }
1423
-    }
1424
-    update_option('geodir_sidebars', $geodir_old_sidebars);
1425
-    geodir_option_version_backup('geodir_sidebars');
1407
+	global $geodir_sidebars;
1408
+	global $sidebars_widgets;
1409
+
1410
+	if (!is_array($sidebars_widgets))
1411
+		$sidebars_widgets = wp_get_sidebars_widgets();
1412
+	$geodir_old_sidebars = array();
1413
+
1414
+	if (is_array($geodir_sidebars)) {
1415
+		foreach ($geodir_sidebars as $val) {
1416
+			if (is_array($sidebars_widgets)) {
1417
+				if (array_key_exists($val, $sidebars_widgets))
1418
+					$geodir_old_sidebars[$val] = $sidebars_widgets[$val];
1419
+				else
1420
+					$geodir_old_sidebars[$val] = array();
1421
+			}
1422
+		}
1423
+	}
1424
+	update_option('geodir_sidebars', $geodir_old_sidebars);
1425
+	geodir_option_version_backup('geodir_sidebars');
1426 1426
 
1427 1427
 }
1428 1428
 
@@ -1436,28 +1436,28 @@  discard block
 block discarded – undo
1436 1436
  */
1437 1437
 function geodir_restore_sidebars()
1438 1438
 {
1439
-    global $sidebars_widgets;
1440
-
1441
-    if (!is_array($sidebars_widgets))
1442
-        $sidebars_widgets = wp_get_sidebars_widgets();
1443
-
1444
-    if (is_array($sidebars_widgets)) {
1445
-        $geodir_old_sidebars = get_option('geodir_sidebars');
1446
-        if (is_array($geodir_old_sidebars)) {
1447
-            foreach ($geodir_old_sidebars as $key => $val) {
1448
-                if(0 === strpos($key, 'geodir_'))// if gd widget
1449
-                {
1450
-                    $sidebars_widgets[$key] = $geodir_old_sidebars[$key];
1451
-                }
1439
+	global $sidebars_widgets;
1452 1440
 
1441
+	if (!is_array($sidebars_widgets))
1442
+		$sidebars_widgets = wp_get_sidebars_widgets();
1453 1443
 
1454
-            }
1455
-        }
1444
+	if (is_array($sidebars_widgets)) {
1445
+		$geodir_old_sidebars = get_option('geodir_sidebars');
1446
+		if (is_array($geodir_old_sidebars)) {
1447
+			foreach ($geodir_old_sidebars as $key => $val) {
1448
+				if(0 === strpos($key, 'geodir_'))// if gd widget
1449
+				{
1450
+					$sidebars_widgets[$key] = $geodir_old_sidebars[$key];
1451
+				}
1456 1452
 
1457
-    }
1458 1453
 
1459
-    update_option('sidebars_widgets', $sidebars_widgets);
1460
-    update_option('geodir_sidebars', '');
1454
+			}
1455
+		}
1456
+
1457
+	}
1458
+
1459
+	update_option('sidebars_widgets', $sidebars_widgets);
1460
+	update_option('geodir_sidebars', '');
1461 1461
 }
1462 1462
 
1463 1463
 add_action('geodir_after_listing_post_gridview', 'geodir_after_listing_post_gridview');
@@ -1470,9 +1470,9 @@  discard block
 block discarded – undo
1470 1470
  */
1471 1471
 function geodir_after_listing_post_gridview()
1472 1472
 {
1473
-    global $gridview_columns;
1473
+	global $gridview_columns;
1474 1474
 
1475
-    $gridview_columns = '';
1475
+	$gridview_columns = '';
1476 1476
 
1477 1477
 }
1478 1478
 
@@ -1500,11 +1500,11 @@  discard block
 block discarded – undo
1500 1500
  */
1501 1501
 function so_handle_038($url, $original_url, $_context)
1502 1502
 {
1503
-    if (strstr($url, "maps.google.com/maps/api/js") !== false) {
1504
-        $url = str_replace("&#038;", "&amp;", $url); // or $url = $original_url
1505
-    }
1503
+	if (strstr($url, "maps.google.com/maps/api/js") !== false) {
1504
+		$url = str_replace("&#038;", "&amp;", $url); // or $url = $original_url
1505
+	}
1506 1506
 
1507
-    return $url;
1507
+	return $url;
1508 1508
 }
1509 1509
 
1510 1510
 
@@ -1520,34 +1520,34 @@  discard block
 block discarded – undo
1520 1520
 function geodir_after_main_form_fields() {
1521 1521
 	global $gd_session;
1522 1522
 	
1523
-    if (get_option('geodir_accept_term_condition')) {
1524
-        global $post;
1525
-        $term_condition = '';
1526
-        if (isset($_REQUEST['backandedit'])) {
1527
-            $post = (object)$gd_session->get('listing');
1528
-            $term_condition = isset($post->geodir_accept_term_condition) ? $post->geodir_accept_term_condition : '';
1529
-        }
1530
-
1531
-        ?>
1523
+	if (get_option('geodir_accept_term_condition')) {
1524
+		global $post;
1525
+		$term_condition = '';
1526
+		if (isset($_REQUEST['backandedit'])) {
1527
+			$post = (object)$gd_session->get('listing');
1528
+			$term_condition = isset($post->geodir_accept_term_condition) ? $post->geodir_accept_term_condition : '';
1529
+		}
1530
+
1531
+		?>
1532 1532
         <div id="geodir_accept_term_condition_row" class="required_field geodir_form_row clearfix">
1533 1533
             <label>&nbsp;</label>
1534 1534
 
1535 1535
             <div class="geodir_taxonomy_field" style="float:left; width:70%;">
1536 1536
 				<span style="display:block"> 
1537 1537
 				<input class="main_list_selecter" type="checkbox" <?php if ($term_condition == '1') {
1538
-                    echo 'checked="checked"';
1539
-                } ?> field_type="checkbox" name="geodir_accept_term_condition" id="geodir_accept_term_condition"
1538
+					echo 'checked="checked"';
1539
+				} ?> field_type="checkbox" name="geodir_accept_term_condition" id="geodir_accept_term_condition"
1540 1540
                        class="geodir_textfield" value="1"
1541 1541
                        style="display:inline-block"/><a href="<?php $terms_page = get_option('geodir_term_condition_page'); if($terms_page){ echo get_permalink($terms_page);}?>" target="_blank"><?php _e('Please accept our terms and conditions', 'geodirectory'); ?></a>
1542 1542
 				</span>
1543 1543
             </div>
1544 1544
             <span class="geodir_message_error"><?php if (isset($required_msg)) {
1545
-                    _e($required_msg, 'geodirectory');
1546
-                } ?></span>
1545
+					_e($required_msg, 'geodirectory');
1546
+				} ?></span>
1547 1547
         </div>
1548 1548
     <?php
1549 1549
 
1550
-    }
1550
+	}
1551 1551
 }
1552 1552
 
1553 1553
 
@@ -1572,42 +1572,42 @@  discard block
 block discarded – undo
1572 1572
  */
1573 1573
 function geodir_detail_page_tab_is_display($is_display, $tab)
1574 1574
 {
1575
-    global $post, $post_images, $video, $special_offers, $related_listing, $geodir_post_detail_fields;
1575
+	global $post, $post_images, $video, $special_offers, $related_listing, $geodir_post_detail_fields;
1576 1576
 
1577
-    if ($tab == 'post_profile') {
1578
-        /** This action is documented in geodirectory_template_actions.php */
1579
-        $desc_limit = apply_filters('geodir_description_field_desc_limit', '');
1577
+	if ($tab == 'post_profile') {
1578
+		/** This action is documented in geodirectory_template_actions.php */
1579
+		$desc_limit = apply_filters('geodir_description_field_desc_limit', '');
1580 1580
         
1581
-        if (!($desc_limit === '' || (int)$desc_limit > 0)) {
1582
-            $is_display = false;
1583
-        }
1584
-    }
1581
+		if (!($desc_limit === '' || (int)$desc_limit > 0)) {
1582
+			$is_display = false;
1583
+		}
1584
+	}
1585 1585
     
1586
-    if ($tab == 'post_info')
1587
-        $is_display = (!empty($geodir_post_detail_fields)) ? true : false;
1586
+	if ($tab == 'post_info')
1587
+		$is_display = (!empty($geodir_post_detail_fields)) ? true : false;
1588 1588
 
1589
-    if ($tab == 'post_images')
1590
-        $is_display = (!empty($post_images)) ? true : false;
1589
+	if ($tab == 'post_images')
1590
+		$is_display = (!empty($post_images)) ? true : false;
1591 1591
 
1592
-    if ($tab == 'post_video')
1593
-        $is_display = (!empty($video)) ? true : false;
1592
+	if ($tab == 'post_video')
1593
+		$is_display = (!empty($video)) ? true : false;
1594 1594
 
1595
-    if ($tab == 'special_offers')
1596
-        $is_display = (!empty($special_offers)) ? true : false;
1595
+	if ($tab == 'special_offers')
1596
+		$is_display = (!empty($special_offers)) ? true : false;
1597 1597
 
1598
-    if ($tab == 'reviews')
1599
-        $is_display = (geodir_is_page('detail')) ? true : false;
1598
+	if ($tab == 'reviews')
1599
+		$is_display = (geodir_is_page('detail')) ? true : false;
1600 1600
 
1601
-    if ($tab == 'related_listing') {
1602
-       $message = __('No listings found which match your selection.', 'geodirectory');
1601
+	if ($tab == 'related_listing') {
1602
+	   $message = __('No listings found which match your selection.', 'geodirectory');
1603 1603
        
1604
-       /** This action is documented in geodirectory-functions/template_functions.php */
1605
-       $message = apply_filters('geodir_message_listing_not_found', $message, 'listing-listview', false);
1604
+	   /** This action is documented in geodirectory-functions/template_functions.php */
1605
+	   $message = apply_filters('geodir_message_listing_not_found', $message, 'listing-listview', false);
1606 1606
        
1607
-       $is_display = ((strpos($related_listing, $message) !== false || $related_listing == '' || !geodir_is_page('detail'))) ? false : true;
1608
-    }
1607
+	   $is_display = ((strpos($related_listing, $message) !== false || $related_listing == '' || !geodir_is_page('detail'))) ? false : true;
1608
+	}
1609 1609
 
1610
-    return $is_display;
1610
+	return $is_display;
1611 1611
 }
1612 1612
 
1613 1613
 
@@ -1623,69 +1623,69 @@  discard block
 block discarded – undo
1623 1623
  * @global string $plugin_prefix Geodirectory plugin table prefix.
1624 1624
  */
1625 1625
 function geodir_changes_in_custom_fields_table() {
1626
-    global $wpdb, $plugin_prefix;
1626
+	global $wpdb, $plugin_prefix;
1627 1627
 	
1628 1628
 	// Remove unused virtual page
1629 1629
 	$listings_page_id = (int)get_option('geodir_listing_page');
1630 1630
 	if ($listings_page_id) {
1631 1631
 		$wpdb->query($wpdb->prepare("DELETE FROM " . $wpdb->posts . " WHERE ID=%d AND post_name = %s AND post_type=%s", array($listings_page_id, 'listings', 'page')));
1632
-        delete_option('geodir_listing_page');
1632
+		delete_option('geodir_listing_page');
1633 1633
 	}
1634 1634
 
1635
-    if (!get_option('geodir_changes_in_custom_fields_table')) {
1636
-        $wpdb->query(
1637
-            $wpdb->prepare(
1638
-                "UPDATE " . GEODIR_CUSTOM_FIELDS_TABLE . " SET is_default=%s, is_admin=%s WHERE is_default=%s",
1639
-                array('1', '1', 'admin')
1640
-            )
1641
-        );
1635
+	if (!get_option('geodir_changes_in_custom_fields_table')) {
1636
+		$wpdb->query(
1637
+			$wpdb->prepare(
1638
+				"UPDATE " . GEODIR_CUSTOM_FIELDS_TABLE . " SET is_default=%s, is_admin=%s WHERE is_default=%s",
1639
+				array('1', '1', 'admin')
1640
+			)
1641
+		);
1642 1642
 
1643 1643
 
1644
-        /* --- terms meta value set --- */
1644
+		/* --- terms meta value set --- */
1645 1645
 
1646
-        update_option('geodir_default_marker_icon', geodir_plugin_url() . '/geodirectory-functions/map-functions/icons/pin.png');
1646
+		update_option('geodir_default_marker_icon', geodir_plugin_url() . '/geodirectory-functions/map-functions/icons/pin.png');
1647 1647
 
1648
-        $options_data = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "options WHERE option_name LIKE %s", array('%tax_meta_%')));
1648
+		$options_data = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "options WHERE option_name LIKE %s", array('%tax_meta_%')));
1649 1649
 
1650
-        if (!empty($options_data)) {
1650
+		if (!empty($options_data)) {
1651 1651
 
1652
-            foreach ($options_data as $optobj) {
1652
+			foreach ($options_data as $optobj) {
1653 1653
 
1654
-                $option_val = str_replace('tax_meta_', '', $optobj->option_name);
1654
+				$option_val = str_replace('tax_meta_', '', $optobj->option_name);
1655 1655
 
1656
-                $taxonomies_data = $wpdb->get_results($wpdb->prepare("SELECT taxonomy FROM " . $wpdb->prefix . "term_taxonomy WHERE taxonomy LIKE %s AND term_id=%d", array('%category%', $option_val)));
1656
+				$taxonomies_data = $wpdb->get_results($wpdb->prepare("SELECT taxonomy FROM " . $wpdb->prefix . "term_taxonomy WHERE taxonomy LIKE %s AND term_id=%d", array('%category%', $option_val)));
1657 1657
 
1658
-                if (!empty($taxonomies_data)) {
1658
+				if (!empty($taxonomies_data)) {
1659 1659
 
1660
-                    foreach ($taxonomies_data as $taxobj) {
1660
+					foreach ($taxonomies_data as $taxobj) {
1661 1661
 
1662
-                        $taxObject = get_taxonomy($taxobj->taxonomy);
1663
-                        $post_type = $taxObject->object_type[0];
1662
+						$taxObject = get_taxonomy($taxobj->taxonomy);
1663
+						$post_type = $taxObject->object_type[0];
1664 1664
 
1665
-                        $opt_value = 'tax_meta_' . $post_type . '_' . $option_val;
1665
+						$opt_value = 'tax_meta_' . $post_type . '_' . $option_val;
1666 1666
 
1667
-                        $duplicate_data = $wpdb->get_var($wpdb->prepare("SELECT option_id FROM " . $wpdb->prefix . "options WHERE option_name=%s", array('tax_meta_' . $option_val)));
1667
+						$duplicate_data = $wpdb->get_var($wpdb->prepare("SELECT option_id FROM " . $wpdb->prefix . "options WHERE option_name=%s", array('tax_meta_' . $option_val)));
1668 1668
 
1669
-                        if ($duplicate_data) {
1669
+						if ($duplicate_data) {
1670 1670
 
1671
-                            $wpdb->query($wpdb->prepare("UPDATE " . $wpdb->prefix . "options SET	option_name=%s WHERE option_id=%d", array($opt_value, $optobj->option_id)));
1671
+							$wpdb->query($wpdb->prepare("UPDATE " . $wpdb->prefix . "options SET	option_name=%s WHERE option_id=%d", array($opt_value, $optobj->option_id)));
1672 1672
 
1673
-                        } else {
1673
+						} else {
1674 1674
 
1675
-                            $wpdb->query($wpdb->prepare("INSERT INTO " . $wpdb->prefix . "options (option_name,option_value,autoload) VALUES (%s, %s, %s)", array($opt_value, $optobj->option_value, $optobj->autoload)));
1675
+							$wpdb->query($wpdb->prepare("INSERT INTO " . $wpdb->prefix . "options (option_name,option_value,autoload) VALUES (%s, %s, %s)", array($opt_value, $optobj->option_value, $optobj->autoload)));
1676 1676
 
1677
-                        }
1677
+						}
1678 1678
 
1679
-                    }
1679
+					}
1680 1680
 
1681
-                }
1681
+				}
1682 1682
 
1683
-            }
1684
-        }
1683
+			}
1684
+		}
1685 1685
 
1686
-        update_option('geodir_changes_in_custom_fields_table', '1');
1686
+		update_option('geodir_changes_in_custom_fields_table', '1');
1687 1687
 
1688
-    }
1688
+	}
1689 1689
 
1690 1690
 }
1691 1691
 
@@ -1704,24 +1704,24 @@  discard block
 block discarded – undo
1704 1704
 function geodir_location_slug_check($slug)
1705 1705
 {
1706 1706
 
1707
-    global $wpdb, $table_prefix;
1707
+	global $wpdb, $table_prefix;
1708 1708
 
1709
-    $slug_exists = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($slug)));
1709
+	$slug_exists = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($slug)));
1710 1710
 
1711
-    if ($slug_exists) {
1711
+	if ($slug_exists) {
1712 1712
 
1713
-        $suffix = 1;
1714
-        do {
1715
-            $alt_location_name = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix";
1716
-            $location_slug_check = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($alt_location_name)));
1717
-            $suffix++;
1718
-        } while ($location_slug_check && $suffix < 100);
1713
+		$suffix = 1;
1714
+		do {
1715
+			$alt_location_name = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix";
1716
+			$location_slug_check = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($alt_location_name)));
1717
+			$suffix++;
1718
+		} while ($location_slug_check && $suffix < 100);
1719 1719
 
1720
-        $slug = $alt_location_name;
1720
+		$slug = $alt_location_name;
1721 1721
 
1722
-    }
1722
+	}
1723 1723
 
1724
-    return $slug;
1724
+	return $slug;
1725 1725
 
1726 1726
 }
1727 1727
 
@@ -1746,42 +1746,42 @@  discard block
 block discarded – undo
1746 1746
 function geodir_update_term_slug($term_id, $tt_id, $taxonomy)
1747 1747
 {
1748 1748
 
1749
-    global $wpdb, $plugin_prefix, $table_prefix;
1749
+	global $wpdb, $plugin_prefix, $table_prefix;
1750 1750
 
1751
-    $tern_data = get_term_by('id', $term_id, $taxonomy);
1751
+	$tern_data = get_term_by('id', $term_id, $taxonomy);
1752 1752
 
1753
-    $slug = $tern_data->slug;
1753
+	$slug = $tern_data->slug;
1754 1754
 
1755
-    /**
1756
-     * Filter if a term slug exists.
1757
-     *
1758
-     * @since 1.0.0
1759
-     * @package GeoDirectory
1760
-     * @param bool $bool Default: false.
1761
-     * @param string $slug The term slug.
1762
-     * @param int $term_id The term ID.
1763
-     */
1764
-    $slug_exists = apply_filters('geodir_term_slug_is_exists', false, $slug, $term_id);
1755
+	/**
1756
+	 * Filter if a term slug exists.
1757
+	 *
1758
+	 * @since 1.0.0
1759
+	 * @package GeoDirectory
1760
+	 * @param bool $bool Default: false.
1761
+	 * @param string $slug The term slug.
1762
+	 * @param int $term_id The term ID.
1763
+	 */
1764
+	$slug_exists = apply_filters('geodir_term_slug_is_exists', false, $slug, $term_id);
1765 1765
 
1766
-    if ($slug_exists) {
1766
+	if ($slug_exists) {
1767 1767
 
1768
-        $suffix = 1;
1769
-        do {
1770
-            $new_slug = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix";
1768
+		$suffix = 1;
1769
+		do {
1770
+			$new_slug = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix";
1771 1771
 
1772
-            /** This action is documented in geodirectory_hooks_actions.php */
1773
-            $term_slug_check = apply_filters('geodir_term_slug_is_exists', false, $new_slug, $term_id);
1772
+			/** This action is documented in geodirectory_hooks_actions.php */
1773
+			$term_slug_check = apply_filters('geodir_term_slug_is_exists', false, $new_slug, $term_id);
1774 1774
 
1775
-            $suffix++;
1776
-        } while ($term_slug_check && $suffix < 100);
1775
+			$suffix++;
1776
+		} while ($term_slug_check && $suffix < 100);
1777 1777
 
1778
-        $slug = $new_slug;
1778
+		$slug = $new_slug;
1779 1779
 
1780
-        //wp_update_term( $term_id, $taxonomy, array('slug' => $slug) );
1780
+		//wp_update_term( $term_id, $taxonomy, array('slug' => $slug) );
1781 1781
 
1782
-        $wpdb->query($wpdb->prepare("UPDATE " . $table_prefix . "terms SET slug=%s WHERE term_id=%d", array($slug, $term_id)));
1782
+		$wpdb->query($wpdb->prepare("UPDATE " . $table_prefix . "terms SET slug=%s WHERE term_id=%d", array($slug, $term_id)));
1783 1783
 
1784
-    }
1784
+	}
1785 1785
 	
1786 1786
 	// Update tag in detail table.
1787 1787
 	$taxonomy_obj = get_taxonomy($taxonomy);
@@ -1822,21 +1822,21 @@  discard block
 block discarded – undo
1822 1822
 function geodir_term_slug_is_exists($slug_exists, $slug, $term_id)
1823 1823
 {
1824 1824
 
1825
-    global $wpdb, $table_prefix;
1825
+	global $wpdb, $table_prefix;
1826 1826
 
1827
-    $default_location = geodir_get_default_location();
1827
+	$default_location = geodir_get_default_location();
1828 1828
 
1829
-    $country_slug = $default_location->country_slug;
1830
-    $region_slug = $default_location->region_slug;
1831
-    $city_slug = $default_location->city_slug;
1829
+	$country_slug = $default_location->country_slug;
1830
+	$region_slug = $default_location->region_slug;
1831
+	$city_slug = $default_location->city_slug;
1832 1832
 
1833
-    if ($country_slug == $slug || $region_slug == $slug || $city_slug == $slug)
1834
-        return $slug_exists = true;
1833
+	if ($country_slug == $slug || $region_slug == $slug || $city_slug == $slug)
1834
+		return $slug_exists = true;
1835 1835
 
1836
-    if ($wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s AND term_id != %d", array($slug, $term_id))))
1837
-        return $slug_exists = true;
1836
+	if ($wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s AND term_id != %d", array($slug, $term_id))))
1837
+		return $slug_exists = true;
1838 1838
 
1839
-    return $slug_exists;
1839
+	return $slug_exists;
1840 1840
 }
1841 1841
 
1842 1842
 
@@ -1855,75 +1855,75 @@  discard block
 block discarded – undo
1855 1855
  */
1856 1856
 function geodir_custom_page_title($title = '', $sep = '')
1857 1857
 {
1858
-    global $wp;
1859
-    if (class_exists('WPSEO_Frontend') || class_exists('All_in_One_SEO_Pack')) {
1860
-        return $title;
1861
-    }
1858
+	global $wp;
1859
+	if (class_exists('WPSEO_Frontend') || class_exists('All_in_One_SEO_Pack')) {
1860
+		return $title;
1861
+	}
1862 1862
 
1863
-    if ($sep == '') {
1864
-        /**
1865
-         * Filter the page title separator.
1866
-         *
1867
-         * @since 1.0.0
1868
-         * @package GeoDirectory
1869
-         * @param string $sep The separator, default: `|`.
1870
-         */
1871
-        $sep = apply_filters('geodir_page_title_separator', '|');
1872
-    }
1863
+	if ($sep == '') {
1864
+		/**
1865
+		 * Filter the page title separator.
1866
+		 *
1867
+		 * @since 1.0.0
1868
+		 * @package GeoDirectory
1869
+		 * @param string $sep The separator, default: `|`.
1870
+		 */
1871
+		$sep = apply_filters('geodir_page_title_separator', '|');
1872
+	}
1873 1873
 
1874 1874
 
1875
-    $gd_page = '';
1876
-    if(geodir_is_page('home')){
1877
-        $gd_page = 'home';
1878
-        $title = (get_option('geodir_meta_title_homepage')) ? get_option('geodir_meta_title_homepage') : $title;
1879
-    }
1880
-    elseif(geodir_is_page('detail')){
1881
-        $gd_page = 'detail';
1882
-        $title = (get_option('geodir_meta_title_detail')) ? get_option('geodir_meta_title_detail') : $title;
1883
-    }
1884
-    elseif(geodir_is_page('pt')){
1885
-        $gd_page = 'pt';
1886
-        $title = (get_option('geodir_meta_title_pt')) ? get_option('geodir_meta_title_pt') : $title;
1887
-    }
1888
-    elseif(geodir_is_page('listing')){
1889
-        $gd_page = 'listing';
1890
-        $title = (get_option('geodir_meta_title_listing')) ? get_option('geodir_meta_title_listing') : $title;
1891
-    }
1892
-    elseif(geodir_is_page('location')){
1893
-        $gd_page = 'location';
1894
-        $title = (get_option('geodir_meta_title_location')) ? get_option('geodir_meta_title_location') : $title;
1895
-    }
1896
-    elseif(geodir_is_page('search')){
1897
-        $gd_page = 'search';
1898
-        $title = (get_option('geodir_meta_title_search')) ? get_option('geodir_meta_title_search') : $title;
1899
-    }
1900
-    elseif(geodir_is_page('add-listing')){
1901
-        $gd_page = 'add-listing';
1902
-        $title = (get_option('geodir_meta_title_add-listing')) ? get_option('geodir_meta_title_add-listing') : $title;
1903
-    }
1904
-    elseif(geodir_is_page('author')){
1905
-        $gd_page = 'author';
1906
-        $title = (get_option('geodir_meta_title_author')) ? get_option('geodir_meta_title_author') : $title;
1907
-    }
1908
-    elseif(geodir_is_page('login')){
1909
-        $gd_page = 'login';
1910
-        $title = (get_option('geodir_meta_title_login')) ? get_option('geodir_meta_title_login') : $title;
1911
-    }
1912
-    elseif(geodir_is_page('listing-success')){
1913
-        $gd_page = 'listing-success';
1914
-        $title = (get_option('geodir_meta_title_listing-success')) ? get_option('geodir_meta_title_listing-success') : $title;
1915
-    }
1875
+	$gd_page = '';
1876
+	if(geodir_is_page('home')){
1877
+		$gd_page = 'home';
1878
+		$title = (get_option('geodir_meta_title_homepage')) ? get_option('geodir_meta_title_homepage') : $title;
1879
+	}
1880
+	elseif(geodir_is_page('detail')){
1881
+		$gd_page = 'detail';
1882
+		$title = (get_option('geodir_meta_title_detail')) ? get_option('geodir_meta_title_detail') : $title;
1883
+	}
1884
+	elseif(geodir_is_page('pt')){
1885
+		$gd_page = 'pt';
1886
+		$title = (get_option('geodir_meta_title_pt')) ? get_option('geodir_meta_title_pt') : $title;
1887
+	}
1888
+	elseif(geodir_is_page('listing')){
1889
+		$gd_page = 'listing';
1890
+		$title = (get_option('geodir_meta_title_listing')) ? get_option('geodir_meta_title_listing') : $title;
1891
+	}
1892
+	elseif(geodir_is_page('location')){
1893
+		$gd_page = 'location';
1894
+		$title = (get_option('geodir_meta_title_location')) ? get_option('geodir_meta_title_location') : $title;
1895
+	}
1896
+	elseif(geodir_is_page('search')){
1897
+		$gd_page = 'search';
1898
+		$title = (get_option('geodir_meta_title_search')) ? get_option('geodir_meta_title_search') : $title;
1899
+	}
1900
+	elseif(geodir_is_page('add-listing')){
1901
+		$gd_page = 'add-listing';
1902
+		$title = (get_option('geodir_meta_title_add-listing')) ? get_option('geodir_meta_title_add-listing') : $title;
1903
+	}
1904
+	elseif(geodir_is_page('author')){
1905
+		$gd_page = 'author';
1906
+		$title = (get_option('geodir_meta_title_author')) ? get_option('geodir_meta_title_author') : $title;
1907
+	}
1908
+	elseif(geodir_is_page('login')){
1909
+		$gd_page = 'login';
1910
+		$title = (get_option('geodir_meta_title_login')) ? get_option('geodir_meta_title_login') : $title;
1911
+	}
1912
+	elseif(geodir_is_page('listing-success')){
1913
+		$gd_page = 'listing-success';
1914
+		$title = (get_option('geodir_meta_title_listing-success')) ? get_option('geodir_meta_title_listing-success') : $title;
1915
+	}
1916 1916
 
1917 1917
 
1918
-    /**
1919
-     * Filter page meta title to replace variables.
1920
-     *
1921
-     * @since 1.5.4
1922
-     * @param string $title The page title including variables.
1923
-     * @param string $gd_page The GeoDirectory page type if any.
1924
-     * @param string $sep The title separator symbol.
1925
-     */
1926
-    return apply_filters('geodir_seo_meta_title', __($title, 'geodirectory'), $gd_page, $sep);
1918
+	/**
1919
+	 * Filter page meta title to replace variables.
1920
+	 *
1921
+	 * @since 1.5.4
1922
+	 * @param string $title The page title including variables.
1923
+	 * @param string $gd_page The GeoDirectory page type if any.
1924
+	 * @param string $sep The title separator symbol.
1925
+	 */
1926
+	return apply_filters('geodir_seo_meta_title', __($title, 'geodirectory'), $gd_page, $sep);
1927 1927
 
1928 1928
 }
1929 1929
 
@@ -1939,33 +1939,33 @@  discard block
 block discarded – undo
1939 1939
 function geodir_set_post_attachment()
1940 1940
 {
1941 1941
 
1942
-    if (!get_option('geodir_set_post_attachments')) {
1942
+	if (!get_option('geodir_set_post_attachments')) {
1943 1943
 
1944
-        require_once(ABSPATH . 'wp-admin/includes/image.php');
1945
-        require_once(ABSPATH . 'wp-admin/includes/file.php');
1944
+		require_once(ABSPATH . 'wp-admin/includes/image.php');
1945
+		require_once(ABSPATH . 'wp-admin/includes/file.php');
1946 1946
 
1947
-        $all_postypes = geodir_get_posttypes();
1947
+		$all_postypes = geodir_get_posttypes();
1948 1948
 
1949
-        $args = array(
1950
-            'posts_per_page' => -1,
1951
-            'post_type' => $all_postypes,
1952
-            'post_status' => 'publish');
1949
+		$args = array(
1950
+			'posts_per_page' => -1,
1951
+			'post_type' => $all_postypes,
1952
+			'post_status' => 'publish');
1953 1953
 
1954
-        $posts_array = get_posts($args);
1954
+		$posts_array = get_posts($args);
1955 1955
 
1956
-        if (!empty($posts_array)) {
1956
+		if (!empty($posts_array)) {
1957 1957
 
1958
-            foreach ($posts_array as $post) {
1958
+			foreach ($posts_array as $post) {
1959 1959
 
1960
-                geodir_set_wp_featured_image($post->ID);
1960
+				geodir_set_wp_featured_image($post->ID);
1961 1961
 
1962
-            }
1962
+			}
1963 1963
 
1964
-        }
1964
+		}
1965 1965
 
1966
-        update_option('geodir_set_post_attachments', '1');
1966
+		update_option('geodir_set_post_attachments', '1');
1967 1967
 
1968
-    }
1968
+	}
1969 1969
 
1970 1970
 }
1971 1971
 
@@ -1982,19 +1982,19 @@  discard block
 block discarded – undo
1982 1982
 function geodir_remove_url_seperator()
1983 1983
 {
1984 1984
 
1985
-    if (!get_option('geodir_remove_url_seperator')) {
1985
+	if (!get_option('geodir_remove_url_seperator')) {
1986 1986
 
1987
-        if (get_option('geodir_listingurl_separator'))
1988
-            delete_option('geodir_listingurl_separator');
1987
+		if (get_option('geodir_listingurl_separator'))
1988
+			delete_option('geodir_listingurl_separator');
1989 1989
 
1990
-        if (get_option('geodir_detailurl_separator'))
1991
-            delete_option('geodir_detailurl_separator');
1990
+		if (get_option('geodir_detailurl_separator'))
1991
+			delete_option('geodir_detailurl_separator');
1992 1992
 
1993
-        flush_rewrite_rules(false);
1993
+		flush_rewrite_rules(false);
1994 1994
 
1995
-        update_option('geodir_remove_url_seperator', '1');
1995
+		update_option('geodir_remove_url_seperator', '1');
1996 1996
 
1997
-    }
1997
+	}
1998 1998
 
1999 1999
 }
2000 2000
 
@@ -2010,19 +2010,19 @@  discard block
 block discarded – undo
2010 2010
  */
2011 2011
 function geodir_remove_url_seperator_form_permalink_settings($permalink_arr)
2012 2012
 {
2013
-    foreach ($permalink_arr as $key => $value) {
2013
+	foreach ($permalink_arr as $key => $value) {
2014 2014
 
2015
-        if ($value['id'] == 'geodir_listingurl_separator' || $value['id'] == 'geodir_detailurl_separator')
2016
-            unset($permalink_arr[$key]);
2015
+		if ($value['id'] == 'geodir_listingurl_separator' || $value['id'] == 'geodir_detailurl_separator')
2016
+			unset($permalink_arr[$key]);
2017 2017
 
2018
-    }
2018
+	}
2019 2019
 
2020
-    return $permalink_arr;
2020
+	return $permalink_arr;
2021 2021
 
2022 2022
 }
2023 2023
 
2024 2024
 if (!is_admin()) {
2025
-    add_filter('posts_results', 'geodir_set_status_draft_to_publish_for_own_post');
2025
+	add_filter('posts_results', 'geodir_set_status_draft_to_publish_for_own_post');
2026 2026
 }
2027 2027
 /**
2028 2028
  * Set status from draft to publish.
@@ -2035,13 +2035,13 @@  discard block
 block discarded – undo
2035 2035
  */
2036 2036
 function geodir_set_status_draft_to_publish_for_own_post($post)
2037 2037
 {
2038
-    global $wp;
2039
-    $user_id = get_current_user_id();
2038
+	global $wp;
2039
+	$user_id = get_current_user_id();
2040 2040
 
2041
-    if (!empty($post) && $post[0]->post_author == $user_id) {
2042
-        $post[0]->post_status = 'publish';
2043
-    }
2044
-    return $post;
2041
+	if (!empty($post) && $post[0]->post_author == $user_id) {
2042
+		$post[0]->post_status = 'publish';
2043
+	}
2044
+	return $post;
2045 2045
 }
2046 2046
 
2047 2047
 
@@ -2133,33 +2133,33 @@  discard block
 block discarded – undo
2133 2133
  */
2134 2134
 function geodir_detail_page_tab_headings_change($tabs_arr)
2135 2135
 {
2136
-    global $wpdb;
2136
+	global $wpdb;
2137 2137
 
2138
-    $post_type = geodir_get_current_posttype();
2138
+	$post_type = geodir_get_current_posttype();
2139 2139
 
2140
-    $all_postypes = geodir_get_posttypes();
2140
+	$all_postypes = geodir_get_posttypes();
2141 2141
 
2142
-    if (!empty($tabs_arr) && $post_type != '' && in_array($post_type, $all_postypes)) {
2142
+	if (!empty($tabs_arr) && $post_type != '' && in_array($post_type, $all_postypes)) {
2143 2143
 
2144
-        if (array_key_exists('post_video', $tabs_arr)) {
2144
+		if (array_key_exists('post_video', $tabs_arr)) {
2145 2145
 
2146
-            $field_title = $wpdb->get_var($wpdb->prepare("select site_title from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array('geodir_video', $post_type)));
2146
+			$field_title = $wpdb->get_var($wpdb->prepare("select site_title from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array('geodir_video', $post_type)));
2147 2147
 
2148
-            if (isset($tabs_arr['post_video']['heading_text']) && $field_title != '')
2149
-                $tabs_arr['post_video']['heading_text'] = $field_title;
2150
-        }
2148
+			if (isset($tabs_arr['post_video']['heading_text']) && $field_title != '')
2149
+				$tabs_arr['post_video']['heading_text'] = $field_title;
2150
+		}
2151 2151
 
2152
-        if (array_key_exists('special_offers', $tabs_arr)) {
2152
+		if (array_key_exists('special_offers', $tabs_arr)) {
2153 2153
 
2154
-            $field_title = $wpdb->get_var($wpdb->prepare("select site_title from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array('geodir_special_offers', $post_type)));
2154
+			$field_title = $wpdb->get_var($wpdb->prepare("select site_title from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array('geodir_special_offers', $post_type)));
2155 2155
 
2156
-            if (isset($tabs_arr['special_offers']['heading_text']) && $field_title != '')
2157
-                $tabs_arr['special_offers']['heading_text'] = $field_title;
2158
-        }
2156
+			if (isset($tabs_arr['special_offers']['heading_text']) && $field_title != '')
2157
+				$tabs_arr['special_offers']['heading_text'] = $field_title;
2158
+		}
2159 2159
 
2160
-    }
2160
+	}
2161 2161
 
2162
-    return $tabs_arr;
2162
+	return $tabs_arr;
2163 2163
 
2164 2164
 }
2165 2165
 
@@ -2172,10 +2172,10 @@  discard block
 block discarded – undo
2172 2172
  */
2173 2173
 function geodir_remove_template_redirect_actions()
2174 2174
 {
2175
-    if (geodir_is_page('login')){
2176
-        remove_all_actions('template_redirect');
2177
-        remove_action('init', 'avia_modify_front', 10);
2178
-    }
2175
+	if (geodir_is_page('login')){
2176
+		remove_all_actions('template_redirect');
2177
+		remove_action('init', 'avia_modify_front', 10);
2178
+	}
2179 2179
 }
2180 2180
 
2181 2181
 
@@ -2197,51 +2197,51 @@  discard block
 block discarded – undo
2197 2197
 function geodirectory_before_featured_image_delete($attachment_id)
2198 2198
 {
2199 2199
 
2200
-    global $wpdb, $plugin_prefix;
2200
+	global $wpdb, $plugin_prefix;
2201 2201
 
2202
-    $post_id = get_post_field('post_parent', $attachment_id);
2202
+	$post_id = get_post_field('post_parent', $attachment_id);
2203 2203
 
2204
-    $attachment_url = wp_get_attachment_url($attachment_id);
2204
+	$attachment_url = wp_get_attachment_url($attachment_id);
2205 2205
 
2206
-    if ($post_id > 0 && (isset($_REQUEST['action']) && $_REQUEST['action'] == 'delete')) {
2206
+	if ($post_id > 0 && (isset($_REQUEST['action']) && $_REQUEST['action'] == 'delete')) {
2207 2207
 
2208
-        $post_type = get_post_type($post_id);
2208
+		$post_type = get_post_type($post_id);
2209 2209
 
2210
-        $all_postypes = geodir_get_posttypes();
2210
+		$all_postypes = geodir_get_posttypes();
2211 2211
 
2212
-        if (!in_array($post_type, $all_postypes) || !is_admin())
2213
-            return false;
2212
+		if (!in_array($post_type, $all_postypes) || !is_admin())
2213
+			return false;
2214 2214
 
2215
-        $uploads = wp_upload_dir();
2215
+		$uploads = wp_upload_dir();
2216 2216
 
2217
-        $split_img_path = explode($uploads['baseurl'], $attachment_url);
2217
+		$split_img_path = explode($uploads['baseurl'], $attachment_url);
2218 2218
 
2219
-        $split_img_file_path = isset($split_img_path[1]) ? $split_img_path[1] : '';
2219
+		$split_img_file_path = isset($split_img_path[1]) ? $split_img_path[1] : '';
2220 2220
 
2221
-        $wpdb->query(
2222
-            $wpdb->prepare("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id = %d AND file=%s ",
2223
-                array($post_id, $split_img_file_path)
2224
-            )
2225
-        );
2221
+		$wpdb->query(
2222
+			$wpdb->prepare("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id = %d AND file=%s ",
2223
+				array($post_id, $split_img_file_path)
2224
+			)
2225
+		);
2226 2226
 
2227
-        $attachment_data = $wpdb->get_row(
2228
-            $wpdb->prepare("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=%d",
2229
-                array($post_id)
2230
-            )
2231
-        );
2227
+		$attachment_data = $wpdb->get_row(
2228
+			$wpdb->prepare("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=%d",
2229
+				array($post_id)
2230
+			)
2231
+		);
2232 2232
 
2233
-        if (!empty($attachment_data)) {
2234
-            $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
2235
-        }
2233
+		if (!empty($attachment_data)) {
2234
+			$wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
2235
+		}
2236 2236
 
2237 2237
 
2238
-        $table_name = $plugin_prefix . $post_type . '_detail';
2238
+		$table_name = $plugin_prefix . $post_type . '_detail';
2239 2239
 
2240
-        $wpdb->query("UPDATE " . $table_name . " SET featured_image='' WHERE post_id =" . $post_id);
2240
+		$wpdb->query("UPDATE " . $table_name . " SET featured_image='' WHERE post_id =" . $post_id);
2241 2241
 
2242
-        geodir_set_wp_featured_image($post_id);
2242
+		geodir_set_wp_featured_image($post_id);
2243 2243
 
2244
-    }
2244
+	}
2245 2245
 
2246 2246
 }
2247 2247
 
@@ -2259,79 +2259,79 @@  discard block
 block discarded – undo
2259 2259
 function geodir_temp_set_post_attachment()
2260 2260
 {
2261 2261
 
2262
-    global $wpdb, $plugin_prefix;
2262
+	global $wpdb, $plugin_prefix;
2263 2263
 
2264
-    $all_postypes = geodir_get_posttypes();
2264
+	$all_postypes = geodir_get_posttypes();
2265 2265
 
2266
-    foreach ($all_postypes as $posttype) {
2266
+	foreach ($all_postypes as $posttype) {
2267 2267
 
2268
-        $tablename = $plugin_prefix . $posttype . '_detail';
2268
+		$tablename = $plugin_prefix . $posttype . '_detail';
2269 2269
 
2270
-        $get_post_data = $wpdb->get_results("SELECT post_id FROM " . $tablename);
2270
+		$get_post_data = $wpdb->get_results("SELECT post_id FROM " . $tablename);
2271 2271
 
2272
-        if (!empty($get_post_data)) {
2272
+		if (!empty($get_post_data)) {
2273 2273
 
2274
-            foreach ($get_post_data as $data) {
2274
+			foreach ($get_post_data as $data) {
2275 2275
 
2276
-                $post_id = $data->post_id;
2276
+				$post_id = $data->post_id;
2277 2277
 
2278
-                $attachment_data = $wpdb->get_results("SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id =" . $post_id . " AND file!=''");
2278
+				$attachment_data = $wpdb->get_results("SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id =" . $post_id . " AND file!=''");
2279 2279
 
2280
-                if (!empty($attachment_data)) {
2280
+				if (!empty($attachment_data)) {
2281 2281
 
2282
-                    foreach ($attachment_data as $attach) {
2282
+					foreach ($attachment_data as $attach) {
2283 2283
 
2284
-                        $file_info = pathinfo($attach->file);
2284
+						$file_info = pathinfo($attach->file);
2285 2285
 
2286
-                        $sub_dir = '';
2287
-                        if ($file_info['dirname'] != '.' && $file_info['dirname'] != '..')
2288
-                            $sub_dir = stripslashes_deep($file_info['dirname']);
2286
+						$sub_dir = '';
2287
+						if ($file_info['dirname'] != '.' && $file_info['dirname'] != '..')
2288
+							$sub_dir = stripslashes_deep($file_info['dirname']);
2289 2289
 
2290
-                        $uploads = wp_upload_dir(trim($sub_dir, '/')); // Array of key => value pairs
2291
-                        $uploads_path = $uploads['basedir'];
2290
+						$uploads = wp_upload_dir(trim($sub_dir, '/')); // Array of key => value pairs
2291
+						$uploads_path = $uploads['basedir'];
2292 2292
 
2293
-                        $file_name = $file_info['basename'];
2293
+						$file_name = $file_info['basename'];
2294 2294
 
2295
-                        $img_arr['path'] = $uploads_path . $sub_dir . '/' . $file_name;
2295
+						$img_arr['path'] = $uploads_path . $sub_dir . '/' . $file_name;
2296 2296
 
2297
-                        if (!file_exists($img_arr['path'])) {
2297
+						if (!file_exists($img_arr['path'])) {
2298 2298
 
2299
-                            $wpdb->query("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE ID=" . $attach->ID);
2299
+							$wpdb->query("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE ID=" . $attach->ID);
2300 2300
 
2301
-                        }
2301
+						}
2302 2302
 
2303
-                    }
2303
+					}
2304 2304
 
2305
-                    $attachment_data = $wpdb->get_row("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=" . $post_id . " GROUP BY post_id");
2305
+					$attachment_data = $wpdb->get_row("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=" . $post_id . " GROUP BY post_id");
2306 2306
 
2307
-                    if (!empty($attachment_data)) {
2307
+					if (!empty($attachment_data)) {
2308 2308
 
2309
-                        if ($attachment_data->ID)
2310
-                            $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
2309
+						if ($attachment_data->ID)
2310
+							$wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
2311 2311
 
2312
-                    } else {
2312
+					} else {
2313 2313
 
2314
-                        if (has_post_thumbnail($post_id)) {
2314
+						if (has_post_thumbnail($post_id)) {
2315 2315
 
2316
-                            $post_thumbnail_id = get_post_thumbnail_id($post_id);
2316
+							$post_thumbnail_id = get_post_thumbnail_id($post_id);
2317 2317
 
2318
-                            wp_delete_attachment($post_thumbnail_id);
2318
+							wp_delete_attachment($post_thumbnail_id);
2319 2319
 
2320
-                        }
2320
+						}
2321 2321
 
2322
-                    }
2322
+					}
2323 2323
 
2324
-                    $wpdb->query("UPDATE " . $tablename . " SET featured_image='' WHERE post_id =" . $post_id);
2324
+					$wpdb->query("UPDATE " . $tablename . " SET featured_image='' WHERE post_id =" . $post_id);
2325 2325
 
2326
-                    geodir_set_wp_featured_image($post_id);
2326
+					geodir_set_wp_featured_image($post_id);
2327 2327
 
2328
-                }
2328
+				}
2329 2329
 
2330
-            }
2330
+			}
2331 2331
 
2332
-        }
2332
+		}
2333 2333
 
2334
-    }
2334
+	}
2335 2335
 
2336 2336
 }
2337 2337
 
@@ -2349,9 +2349,9 @@  discard block
 block discarded – undo
2349 2349
 function geodir_default_rating_star_icon()
2350 2350
 {
2351 2351
 
2352
-    if (!get_option('geodir_default_rating_star_icon')) {
2353
-        update_option('geodir_default_rating_star_icon', geodir_plugin_url() . '/geodirectory-assets/images/stars.png');
2354
-    }
2352
+	if (!get_option('geodir_default_rating_star_icon')) {
2353
+		update_option('geodir_default_rating_star_icon', geodir_plugin_url() . '/geodirectory-assets/images/stars.png');
2354
+	}
2355 2355
 
2356 2356
 }
2357 2357
 
@@ -2369,27 +2369,27 @@  discard block
 block discarded – undo
2369 2369
  */
2370 2370
 function geodir_user_post_listing_count($user_id=null)
2371 2371
 {
2372
-    global $wpdb, $plugin_prefix, $current_user;
2373
-    if(!$user_id){
2374
-        $user_id = $current_user->ID;
2375
-    }
2372
+	global $wpdb, $plugin_prefix, $current_user;
2373
+	if(!$user_id){
2374
+		$user_id = $current_user->ID;
2375
+	}
2376 2376
 
2377
-    $user_id = $current_user->ID;
2378
-    $all_postypes = geodir_get_posttypes();
2379
-    $all_posts = get_option('geodir_listing_link_user_dashboard');
2377
+	$user_id = $current_user->ID;
2378
+	$all_postypes = geodir_get_posttypes();
2379
+	$all_posts = get_option('geodir_listing_link_user_dashboard');
2380 2380
 
2381
-    $user_listing = array();
2382
-    if (is_array($all_posts) && !empty($all_posts)) {
2383
-        foreach ($all_posts as $ptype) {
2384
-            $total_posts = $wpdb->get_var("SELECT count( ID ) FROM " . $wpdb->prefix . "posts WHERE post_author=" . $user_id . " AND post_type='" . $ptype . "' AND ( post_status = 'publish' OR post_status = 'draft' OR post_status = 'private' )");
2381
+	$user_listing = array();
2382
+	if (is_array($all_posts) && !empty($all_posts)) {
2383
+		foreach ($all_posts as $ptype) {
2384
+			$total_posts = $wpdb->get_var("SELECT count( ID ) FROM " . $wpdb->prefix . "posts WHERE post_author=" . $user_id . " AND post_type='" . $ptype . "' AND ( post_status = 'publish' OR post_status = 'draft' OR post_status = 'private' )");
2385 2385
 
2386
-            if ($total_posts > 0) {
2387
-                $user_listing[$ptype] = $total_posts;
2388
-            }
2389
-        }
2390
-    }
2386
+			if ($total_posts > 0) {
2387
+				$user_listing[$ptype] = $total_posts;
2388
+			}
2389
+		}
2390
+	}
2391 2391
 
2392
-    return $user_listing;
2392
+	return $user_listing;
2393 2393
 }
2394 2394
 
2395 2395
 
@@ -2409,579 +2409,579 @@  discard block
 block discarded – undo
2409 2409
  */
2410 2410
 function geodir_detail_page_custom_field_tab($tabs_arr)
2411 2411
 {
2412
-    global $post;
2413
-
2414
-    $post_type = geodir_get_current_posttype();
2415
-    $all_postypes = geodir_get_posttypes();
2416
-
2417
-    if (!empty($tabs_arr) && $post_type != '' && in_array($post_type, $all_postypes) && (geodir_is_page('detail') || geodir_is_page('preview'))) {
2418
-        $package_info = array();
2419
-        $package_info = geodir_post_package_info($package_info, $post);
2420
-        $post_package_id = $package_info->pid;
2421
-        $fields_location = 'detail';
2422
-
2423
-        $custom_fields = geodir_post_custom_fields($post_package_id, 'default', $post_type, $fields_location);
2424
-        if (!empty($custom_fields)) {
2425
-            $parse_custom_fields = array();
2426
-            foreach ($custom_fields as $field) {
2427
-                $field = stripslashes_deep($field); // strip slashes
2412
+	global $post;
2413
+
2414
+	$post_type = geodir_get_current_posttype();
2415
+	$all_postypes = geodir_get_posttypes();
2416
+
2417
+	if (!empty($tabs_arr) && $post_type != '' && in_array($post_type, $all_postypes) && (geodir_is_page('detail') || geodir_is_page('preview'))) {
2418
+		$package_info = array();
2419
+		$package_info = geodir_post_package_info($package_info, $post);
2420
+		$post_package_id = $package_info->pid;
2421
+		$fields_location = 'detail';
2422
+
2423
+		$custom_fields = geodir_post_custom_fields($post_package_id, 'default', $post_type, $fields_location);
2424
+		if (!empty($custom_fields)) {
2425
+			$parse_custom_fields = array();
2426
+			foreach ($custom_fields as $field) {
2427
+				$field = stripslashes_deep($field); // strip slashes
2428 2428
                 
2429
-                $type = $field;
2430
-                $field_name = $field['htmlvar_name'];
2431
-                if (empty($geodir_post_info) && geodir_is_page('preview') && $field_name != '' && !isset($post->{$field_name}) && isset($_REQUEST[$field_name])) {
2432
-                    $post->{$field_name} = $_REQUEST[$field_name];
2433
-                }
2434
-
2435
-                if (isset($field['show_as_tab']) && $field['show_as_tab'] == 1 && ((isset($post->{$field_name}) && $post->{$field_name} != '') || $field['type'] == 'fieldset') && in_array($field['type'], array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file'))) {
2436
-                    if ($type['type'] == 'datepicker' && ($post->{$type['htmlvar_name']} == '' || $post->{$type['htmlvar_name']} == '0000-00-00')) {
2437
-                        continue;
2438
-                    }
2439
-
2440
-                    $parse_custom_fields[] = $field;
2441
-                }
2442
-            }
2443
-            $custom_fields = $parse_custom_fields;
2444
-        }
2445
-
2446
-        if (!empty($custom_fields)) {
2447
-            $field_set_start = 0;
2448
-            $fieldset_count = 0;
2449
-            $fieldset = '';
2450
-            $total_fields = count($custom_fields);
2451
-            $count_field = 0;
2452
-            $fieldset_arr = array();
2453
-            $i = 0;
2454
-            $geodir_post_info = isset($post->ID) && !empty($post->ID) ? geodir_get_post_info($post->ID) : NULL;
2455
-
2456
-            foreach ($custom_fields as $field) {
2457
-                $count_field++;
2458
-                $field_name = $field['htmlvar_name'];
2459
-                if (empty($geodir_post_info) && geodir_is_page('preview') && $field_name != '' && !isset($post->{$field_name}) && isset($_REQUEST[$field_name])) {
2460
-                    $post->{$field_name} = $_REQUEST[$field_name];
2461
-                }
2462
-
2463
-                if (isset($field['show_as_tab']) && $field['show_as_tab'] == 1 && ((isset($post->{$field_name}) && $post->{$field_name} != '') || $field['type'] == 'fieldset') && in_array($field['type'], array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file'))) {
2464
-                    $label = $field['site_title'] != '' ? $field['site_title'] : $field['admin_title'];
2465
-                    $site_title = trim($field['site_title']);
2466
-                    $type = $field;
2467
-                    $html = '';
2468
-                    $html_var = $field_name;
2469
-                    $field_icon = '';
2470
-                    $variables_array = array();
2471
-
2472
-                    if ($type['type'] == 'datepicker' && ($post->{$type['htmlvar_name']} == '' || $post->{$type['htmlvar_name']} == '0000-00-00')) {
2473
-                        continue;
2474
-                    }
2475
-
2476
-                    if ($type['type'] != 'fieldset') {
2477
-                        $i++;
2478
-                        $variables_array['post_id'] = $post->ID;
2479
-                        $variables_array['label'] = __($type['site_title'], 'geodirectory');
2480
-                        $variables_array['value'] = '';
2481
-                        $variables_array['value'] = $post->{$type['htmlvar_name']};
2482
-                    }
2483
-
2484
-                    if (strpos($type['field_icon'], 'http') !== false) {
2485
-                        $field_icon = ' background: url(' . $type['field_icon'] . ') no-repeat left center;background-size:18px 18px;padding-left: 21px;';
2486
-                    } elseif (strpos($type['field_icon'], 'fa fa-') !== false) {
2487
-                        $field_icon = '<i class="' . $type['field_icon'] . '"></i>';
2488
-                    }
2429
+				$type = $field;
2430
+				$field_name = $field['htmlvar_name'];
2431
+				if (empty($geodir_post_info) && geodir_is_page('preview') && $field_name != '' && !isset($post->{$field_name}) && isset($_REQUEST[$field_name])) {
2432
+					$post->{$field_name} = $_REQUEST[$field_name];
2433
+				}
2434
+
2435
+				if (isset($field['show_as_tab']) && $field['show_as_tab'] == 1 && ((isset($post->{$field_name}) && $post->{$field_name} != '') || $field['type'] == 'fieldset') && in_array($field['type'], array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file'))) {
2436
+					if ($type['type'] == 'datepicker' && ($post->{$type['htmlvar_name']} == '' || $post->{$type['htmlvar_name']} == '0000-00-00')) {
2437
+						continue;
2438
+					}
2439
+
2440
+					$parse_custom_fields[] = $field;
2441
+				}
2442
+			}
2443
+			$custom_fields = $parse_custom_fields;
2444
+		}
2489 2445
 
2490
-                    switch ($type['type']) {
2491
-                        case 'fieldset': {
2492
-                            $i = 0;
2493
-                            $fieldset_count++;
2494
-                            $field_set_start = 1;
2495
-                            $fieldset_arr[$fieldset_count]['htmlvar_name'] = 'gd_tab_' . $fieldset_count;
2496
-                            $fieldset_arr[$fieldset_count]['label'] = $label;
2497
-                        }
2498
-                            break;
2499
-                        case 'url': {
2500
-                            if (strpos($field_icon, 'http') !== false) {
2501
-                                $field_icon_af = '';
2502
-                            } elseif ($field_icon == '') {
2503
-
2504
-                                if ($type['name'] == 'geodir_facebook') {
2505
-                                    $field_icon_af = '<i class="fa fa-facebook-square"></i>';
2506
-                                } elseif ($type['name'] == 'geodir_twitter') {
2507
-                                    $field_icon_af = '<i class="fa fa-twitter-square"></i>';
2508
-                                } else {
2509
-                                    $field_icon_af = '<i class="fa fa-link"></i>';
2510
-                                }
2511
-
2512
-                            } else {
2513
-                                $field_icon_af = $field_icon;
2514
-                                $field_icon = '';
2515
-                            }
2446
+		if (!empty($custom_fields)) {
2447
+			$field_set_start = 0;
2448
+			$fieldset_count = 0;
2449
+			$fieldset = '';
2450
+			$total_fields = count($custom_fields);
2451
+			$count_field = 0;
2452
+			$fieldset_arr = array();
2453
+			$i = 0;
2454
+			$geodir_post_info = isset($post->ID) && !empty($post->ID) ? geodir_get_post_info($post->ID) : NULL;
2455
+
2456
+			foreach ($custom_fields as $field) {
2457
+				$count_field++;
2458
+				$field_name = $field['htmlvar_name'];
2459
+				if (empty($geodir_post_info) && geodir_is_page('preview') && $field_name != '' && !isset($post->{$field_name}) && isset($_REQUEST[$field_name])) {
2460
+					$post->{$field_name} = $_REQUEST[$field_name];
2461
+				}
2462
+
2463
+				if (isset($field['show_as_tab']) && $field['show_as_tab'] == 1 && ((isset($post->{$field_name}) && $post->{$field_name} != '') || $field['type'] == 'fieldset') && in_array($field['type'], array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file'))) {
2464
+					$label = $field['site_title'] != '' ? $field['site_title'] : $field['admin_title'];
2465
+					$site_title = trim($field['site_title']);
2466
+					$type = $field;
2467
+					$html = '';
2468
+					$html_var = $field_name;
2469
+					$field_icon = '';
2470
+					$variables_array = array();
2471
+
2472
+					if ($type['type'] == 'datepicker' && ($post->{$type['htmlvar_name']} == '' || $post->{$type['htmlvar_name']} == '0000-00-00')) {
2473
+						continue;
2474
+					}
2475
+
2476
+					if ($type['type'] != 'fieldset') {
2477
+						$i++;
2478
+						$variables_array['post_id'] = $post->ID;
2479
+						$variables_array['label'] = __($type['site_title'], 'geodirectory');
2480
+						$variables_array['value'] = '';
2481
+						$variables_array['value'] = $post->{$type['htmlvar_name']};
2482
+					}
2483
+
2484
+					if (strpos($type['field_icon'], 'http') !== false) {
2485
+						$field_icon = ' background: url(' . $type['field_icon'] . ') no-repeat left center;background-size:18px 18px;padding-left: 21px;';
2486
+					} elseif (strpos($type['field_icon'], 'fa fa-') !== false) {
2487
+						$field_icon = '<i class="' . $type['field_icon'] . '"></i>';
2488
+					}
2489
+
2490
+					switch ($type['type']) {
2491
+						case 'fieldset': {
2492
+							$i = 0;
2493
+							$fieldset_count++;
2494
+							$field_set_start = 1;
2495
+							$fieldset_arr[$fieldset_count]['htmlvar_name'] = 'gd_tab_' . $fieldset_count;
2496
+							$fieldset_arr[$fieldset_count]['label'] = $label;
2497
+						}
2498
+							break;
2499
+						case 'url': {
2500
+							if (strpos($field_icon, 'http') !== false) {
2501
+								$field_icon_af = '';
2502
+							} elseif ($field_icon == '') {
2503
+
2504
+								if ($type['name'] == 'geodir_facebook') {
2505
+									$field_icon_af = '<i class="fa fa-facebook-square"></i>';
2506
+								} elseif ($type['name'] == 'geodir_twitter') {
2507
+									$field_icon_af = '<i class="fa fa-twitter-square"></i>';
2508
+								} else {
2509
+									$field_icon_af = '<i class="fa fa-link"></i>';
2510
+								}
2511
+
2512
+							} else {
2513
+								$field_icon_af = $field_icon;
2514
+								$field_icon = '';
2515
+							}
2516 2516
                             
2517
-                            $a_url = geodir_parse_custom_field_url($post->{$type['htmlvar_name']});
2518
-
2519
-                            $website = !empty($a_url['url']) ? $a_url['url'] : '';
2520
-                            $title = !empty($a_url['label']) ? $a_url['label'] : $type['site_title'];
2521
-                            $title = $title != '' ? __(stripslashes($title), 'geodirectory') : '';
2522
-
2523
-                            $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2524
-
2525
-                            // all search engines that use the nofollow value exclude links that use it from their ranking calculation
2526
-                            $rel = strpos($website, get_site_url()) !== false ? '' : 'rel="nofollow"';
2527
-
2528
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '"><span class="geodir-i-website" style="' . $field_icon . '">' . $field_icon_af . ' <a href="' . $website . '" target="_blank" ' . $rel . ' ><strong>' .
2529
-                                /**
2530
-                                 * Filer the custom field website name.
2531
-                                 *
2532
-                                 * @since 1.0.0
2533
-                                 * @param string $title The field name default: "Website".
2534
-                                 * @param string $website The website address.
2535
-                                 * @param int $post->ID The post ID.
2536
-                                 */
2537
-                                apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID) . '</strong></a></span></div>';
2538
-                        }
2539
-                            break;
2540
-                        case 'phone': {
2541
-                            if (strpos($field_icon, 'http') !== false) {
2542
-                                $field_icon_af = '';
2543
-                            } elseif ($field_icon == '') {
2544
-                                $field_icon_af = '<i class="fa fa-phone"></i>';
2545
-                            } else {
2546
-                                $field_icon_af = $field_icon;
2547
-                                $field_icon = '';
2548
-                            }
2549
-
2550
-                            $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2551
-
2552
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-contact" style="' . $field_icon . '">' . $field_icon_af;
2553
-                            if ($field_set_start == 1 && $site_title != '') {
2554
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2555
-                            }
2556
-                            $html .= ' </span>' . stripslashes($post->{$type['htmlvar_name']}) . '</div>';
2557
-                        }
2558
-                            break;
2559
-                        case 'time': {
2560
-                            $value = '';
2561
-                            if ($post->{$type['htmlvar_name']} != '')
2562
-                                $value = date_i18n(get_option('time_format'), strtotime($post->{$type['htmlvar_name']}));
2563
-
2564
-                            if (strpos($field_icon, 'http') !== false) {
2565
-                                $field_icon_af = '';
2566
-                            } elseif ($field_icon == '') {
2567
-                                $field_icon_af = '<i class="fa fa-clock-o"></i>';
2568
-                            } else {
2569
-                                $field_icon_af = $field_icon;
2570
-                                $field_icon = '';
2571
-                            }
2572
-
2573
-                            $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2574
-
2575
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-time" style="' . $field_icon . '">' . $field_icon_af;
2576
-                            if ($field_set_start == 1 && $site_title != '') {
2577
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2578
-                            }
2579
-                            $html .= ' </span>' . stripslashes($value) . '</div>';
2580
-                        }
2581
-                            break;
2582
-                        case 'datepicker': {
2583
-                            $date_format = geodir_default_date_format();
2584
-                            if ($type['extra_fields'] != '') {
2585
-                                $date_format = unserialize($type['extra_fields']);
2586
-                                $date_format = $date_format['date_format'];
2587
-                            }
2588
-
2589
-                            $search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format
2590
-                            $replace = array('d','j','l','m','n','F','Y');//PHP date format
2591
-
2592
-                            $date_format = str_replace($search, $replace, $date_format);
2593
-
2594
-                            $post_htmlvar_value = $date_format == 'd/m/Y' ? str_replace('/', '-', $post->{$type['htmlvar_name']}) : $post->{$type['htmlvar_name']}; // PHP doesn't work well with dd/mm/yyyy format
2595
-
2596
-                            $value = '';
2597
-                            if ($post->{$type['htmlvar_name']} != '')
2598
-                                $value = date($date_format, strtotime($post_htmlvar_value));
2599
-
2600
-                            if (strpos($field_icon, 'http') !== false) {
2601
-                                $field_icon_af = '';
2602
-                            } elseif ($field_icon == '') {
2603
-                                $field_icon_af = '<i class="fa fa-calendar"></i>';
2604
-                            } else {
2605
-                                $field_icon_af = $field_icon;
2606
-                                $field_icon = '';
2607
-                            }
2608
-
2609
-                            $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2610
-
2611
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-datepicker" style="' . $field_icon . '">' . $field_icon_af;
2612
-                            if ($field_set_start == 1 && $site_title != '') {
2613
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2614
-                            }
2615
-                            $html .= ' </span>' . $value . '</div>';
2616
-                        }
2617
-                            break;
2618
-                        case 'text': {
2619
-                            if (strpos($field_icon, 'http') !== false) {
2620
-                                $field_icon_af = '';
2621
-                            } elseif ($field_icon == '') {
2622
-                                $field_icon_af = '';
2623
-                            } else {
2624
-                                $field_icon_af = $field_icon;
2625
-                                $field_icon = '';
2626
-                            }
2627
-
2628
-                            $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2629
-
2630
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
2631
-                            if ($field_set_start == 1 && $site_title != '') {
2632
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2633
-                            }
2634
-                            $html .= ' </span>' . stripslashes($post->{$type['htmlvar_name']}) . '</div>';
2635
-                        }
2636
-                            break;
2637
-                        case 'radio': {
2638
-
2639
-                            if ($post->{$type['htmlvar_name']} != '') {
2640
-                                if ($post->{$type['htmlvar_name']} == 'f' || $post->{$type['htmlvar_name']} == '0') {
2641
-                                    $html_val = __('No', 'geodirectory');
2642
-                                } else if ($post->{$type['htmlvar_name']} == 't' || $post->{$type['htmlvar_name']} == '1') {
2643
-                                    $html_val = __('Yes', 'geodirectory');
2644
-                                } else {
2645
-                                    $html_val = __($post->{$type['htmlvar_name']}, 'geodirectory');
2517
+							$a_url = geodir_parse_custom_field_url($post->{$type['htmlvar_name']});
2518
+
2519
+							$website = !empty($a_url['url']) ? $a_url['url'] : '';
2520
+							$title = !empty($a_url['label']) ? $a_url['label'] : $type['site_title'];
2521
+							$title = $title != '' ? __(stripslashes($title), 'geodirectory') : '';
2522
+
2523
+							$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2524
+
2525
+							// all search engines that use the nofollow value exclude links that use it from their ranking calculation
2526
+							$rel = strpos($website, get_site_url()) !== false ? '' : 'rel="nofollow"';
2527
+
2528
+							$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '"><span class="geodir-i-website" style="' . $field_icon . '">' . $field_icon_af . ' <a href="' . $website . '" target="_blank" ' . $rel . ' ><strong>' .
2529
+								/**
2530
+								 * Filer the custom field website name.
2531
+								 *
2532
+								 * @since 1.0.0
2533
+								 * @param string $title The field name default: "Website".
2534
+								 * @param string $website The website address.
2535
+								 * @param int $post->ID The post ID.
2536
+								 */
2537
+								apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID) . '</strong></a></span></div>';
2538
+						}
2539
+							break;
2540
+						case 'phone': {
2541
+							if (strpos($field_icon, 'http') !== false) {
2542
+								$field_icon_af = '';
2543
+							} elseif ($field_icon == '') {
2544
+								$field_icon_af = '<i class="fa fa-phone"></i>';
2545
+							} else {
2546
+								$field_icon_af = $field_icon;
2547
+								$field_icon = '';
2548
+							}
2549
+
2550
+							$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2551
+
2552
+							$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-contact" style="' . $field_icon . '">' . $field_icon_af;
2553
+							if ($field_set_start == 1 && $site_title != '') {
2554
+								$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2555
+							}
2556
+							$html .= ' </span>' . stripslashes($post->{$type['htmlvar_name']}) . '</div>';
2557
+						}
2558
+							break;
2559
+						case 'time': {
2560
+							$value = '';
2561
+							if ($post->{$type['htmlvar_name']} != '')
2562
+								$value = date_i18n(get_option('time_format'), strtotime($post->{$type['htmlvar_name']}));
2563
+
2564
+							if (strpos($field_icon, 'http') !== false) {
2565
+								$field_icon_af = '';
2566
+							} elseif ($field_icon == '') {
2567
+								$field_icon_af = '<i class="fa fa-clock-o"></i>';
2568
+							} else {
2569
+								$field_icon_af = $field_icon;
2570
+								$field_icon = '';
2571
+							}
2572
+
2573
+							$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2574
+
2575
+							$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-time" style="' . $field_icon . '">' . $field_icon_af;
2576
+							if ($field_set_start == 1 && $site_title != '') {
2577
+								$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2578
+							}
2579
+							$html .= ' </span>' . stripslashes($value) . '</div>';
2580
+						}
2581
+							break;
2582
+						case 'datepicker': {
2583
+							$date_format = geodir_default_date_format();
2584
+							if ($type['extra_fields'] != '') {
2585
+								$date_format = unserialize($type['extra_fields']);
2586
+								$date_format = $date_format['date_format'];
2587
+							}
2588
+
2589
+							$search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format
2590
+							$replace = array('d','j','l','m','n','F','Y');//PHP date format
2591
+
2592
+							$date_format = str_replace($search, $replace, $date_format);
2593
+
2594
+							$post_htmlvar_value = $date_format == 'd/m/Y' ? str_replace('/', '-', $post->{$type['htmlvar_name']}) : $post->{$type['htmlvar_name']}; // PHP doesn't work well with dd/mm/yyyy format
2595
+
2596
+							$value = '';
2597
+							if ($post->{$type['htmlvar_name']} != '')
2598
+								$value = date($date_format, strtotime($post_htmlvar_value));
2599
+
2600
+							if (strpos($field_icon, 'http') !== false) {
2601
+								$field_icon_af = '';
2602
+							} elseif ($field_icon == '') {
2603
+								$field_icon_af = '<i class="fa fa-calendar"></i>';
2604
+							} else {
2605
+								$field_icon_af = $field_icon;
2606
+								$field_icon = '';
2607
+							}
2608
+
2609
+							$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2610
+
2611
+							$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-datepicker" style="' . $field_icon . '">' . $field_icon_af;
2612
+							if ($field_set_start == 1 && $site_title != '') {
2613
+								$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2614
+							}
2615
+							$html .= ' </span>' . $value . '</div>';
2616
+						}
2617
+							break;
2618
+						case 'text': {
2619
+							if (strpos($field_icon, 'http') !== false) {
2620
+								$field_icon_af = '';
2621
+							} elseif ($field_icon == '') {
2622
+								$field_icon_af = '';
2623
+							} else {
2624
+								$field_icon_af = $field_icon;
2625
+								$field_icon = '';
2626
+							}
2627
+
2628
+							$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2629
+
2630
+							$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
2631
+							if ($field_set_start == 1 && $site_title != '') {
2632
+								$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2633
+							}
2634
+							$html .= ' </span>' . stripslashes($post->{$type['htmlvar_name']}) . '</div>';
2635
+						}
2636
+							break;
2637
+						case 'radio': {
2638
+
2639
+							if ($post->{$type['htmlvar_name']} != '') {
2640
+								if ($post->{$type['htmlvar_name']} == 'f' || $post->{$type['htmlvar_name']} == '0') {
2641
+									$html_val = __('No', 'geodirectory');
2642
+								} else if ($post->{$type['htmlvar_name']} == 't' || $post->{$type['htmlvar_name']} == '1') {
2643
+									$html_val = __('Yes', 'geodirectory');
2644
+								} else {
2645
+									$html_val = __($post->{$type['htmlvar_name']}, 'geodirectory');
2646 2646
                                     
2647
-                                    if (!empty($type['option_values'])) {
2648
-                                        $cf_option_values = geodir_string_values_to_options(stripslashes_deep($type['option_values']), true);
2647
+									if (!empty($type['option_values'])) {
2648
+										$cf_option_values = geodir_string_values_to_options(stripslashes_deep($type['option_values']), true);
2649 2649
                                         
2650
-                                        if (!empty($cf_option_values)) {
2651
-                                            foreach ($cf_option_values as $cf_option_value) {
2652
-                                                if (isset($cf_option_value['value']) && $cf_option_value['value'] == $post->{$type['htmlvar_name']}) {
2653
-                                                    $html_val = $cf_option_value['label'];
2654
-                                                }
2655
-                                            }
2656
-                                        }
2657
-                                    }
2658
-                                }
2659
-
2660
-                                if (strpos($field_icon, 'http') !== false) {
2661
-                                    $field_icon_af = '';
2662
-                                } else if ($field_icon == '') {
2663
-                                    $field_icon_af = '';
2664
-                                } else {
2665
-                                    $field_icon_af = $field_icon;
2666
-                                    $field_icon = '';
2667
-                                }
2668
-
2669
-                                $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2670
-
2671
-                                $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-radio" style="' . $field_icon . '">' . $field_icon_af;
2672
-
2673
-                                if ($field_set_start == 1 && $site_title != '') {
2674
-                                    $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2675
-                                }
2676
-
2677
-                                $html .= ' </span>' . $html_val . '</div>';
2678
-                            }
2679
-                        }
2680
-                            break;
2681
-                        case 'checkbox': {
2682
-                            $html_var = $type['htmlvar_name'];
2683
-                            $html_val = $type['htmlvar_name'];
2684
-
2685
-                            if ((int)$post->{$html_var} == 1) {
2686
-
2687
-                                if ($post->{$type['htmlvar_name']} == '1') {
2688
-                                    $html_val = __('Yes', 'geodirectory');
2689
-                                } else {
2690
-                                    $html_val = __('No', 'geodirectory');
2691
-                                }
2692
-
2693
-                                if (strpos($field_icon, 'http') !== false) {
2694
-                                    $field_icon_af = '';
2695
-                                } else if ($field_icon == '') {
2696
-                                    $field_icon_af = '';
2697
-                                } else {
2698
-                                    $field_icon_af = $field_icon;
2699
-                                    $field_icon = '';
2700
-                                }
2701
-
2702
-                                $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2703
-
2704
-                                $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-checkbox" style="' . $field_icon . '">' . $field_icon_af;
2705
-
2706
-                                if ($field_set_start == 1 && $site_title != '') {
2707
-                                    $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2708
-                                }
2709
-
2710
-                                $html .= ' </span>' . $html_val . '</div>';
2711
-                            }
2712
-                        }
2713
-                            break;
2714
-                        case 'select': {
2715
-                            if (strpos($field_icon, 'http') !== false) {
2716
-                                $field_icon_af = '';
2717
-                            } elseif ($field_icon == '') {
2718
-                                $field_icon_af = '';
2719
-                            } else {
2720
-                                $field_icon_af = $field_icon;
2721
-                                $field_icon = '';
2722
-                            }
2650
+										if (!empty($cf_option_values)) {
2651
+											foreach ($cf_option_values as $cf_option_value) {
2652
+												if (isset($cf_option_value['value']) && $cf_option_value['value'] == $post->{$type['htmlvar_name']}) {
2653
+													$html_val = $cf_option_value['label'];
2654
+												}
2655
+											}
2656
+										}
2657
+									}
2658
+								}
2659
+
2660
+								if (strpos($field_icon, 'http') !== false) {
2661
+									$field_icon_af = '';
2662
+								} else if ($field_icon == '') {
2663
+									$field_icon_af = '';
2664
+								} else {
2665
+									$field_icon_af = $field_icon;
2666
+									$field_icon = '';
2667
+								}
2668
+
2669
+								$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2670
+
2671
+								$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-radio" style="' . $field_icon . '">' . $field_icon_af;
2672
+
2673
+								if ($field_set_start == 1 && $site_title != '') {
2674
+									$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2675
+								}
2676
+
2677
+								$html .= ' </span>' . $html_val . '</div>';
2678
+							}
2679
+						}
2680
+							break;
2681
+						case 'checkbox': {
2682
+							$html_var = $type['htmlvar_name'];
2683
+							$html_val = $type['htmlvar_name'];
2684
+
2685
+							if ((int)$post->{$html_var} == 1) {
2686
+
2687
+								if ($post->{$type['htmlvar_name']} == '1') {
2688
+									$html_val = __('Yes', 'geodirectory');
2689
+								} else {
2690
+									$html_val = __('No', 'geodirectory');
2691
+								}
2692
+
2693
+								if (strpos($field_icon, 'http') !== false) {
2694
+									$field_icon_af = '';
2695
+								} else if ($field_icon == '') {
2696
+									$field_icon_af = '';
2697
+								} else {
2698
+									$field_icon_af = $field_icon;
2699
+									$field_icon = '';
2700
+								}
2701
+
2702
+								$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2703
+
2704
+								$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-checkbox" style="' . $field_icon . '">' . $field_icon_af;
2705
+
2706
+								if ($field_set_start == 1 && $site_title != '') {
2707
+									$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2708
+								}
2709
+
2710
+								$html .= ' </span>' . $html_val . '</div>';
2711
+							}
2712
+						}
2713
+							break;
2714
+						case 'select': {
2715
+							if (strpos($field_icon, 'http') !== false) {
2716
+								$field_icon_af = '';
2717
+							} elseif ($field_icon == '') {
2718
+								$field_icon_af = '';
2719
+							} else {
2720
+								$field_icon_af = $field_icon;
2721
+								$field_icon = '';
2722
+							}
2723 2723
                             
2724
-                            $field_value = __($post->{$type['htmlvar_name']}, 'geodirectory');
2724
+							$field_value = __($post->{$type['htmlvar_name']}, 'geodirectory');
2725 2725
                             
2726
-                            if (!empty($type['option_values'])) {
2727
-                                $cf_option_values = geodir_string_values_to_options(stripslashes_deep($type['option_values']), true);
2726
+							if (!empty($type['option_values'])) {
2727
+								$cf_option_values = geodir_string_values_to_options(stripslashes_deep($type['option_values']), true);
2728 2728
                                 
2729
-                                if (!empty($cf_option_values)) {
2730
-                                    foreach ($cf_option_values as $cf_option_value) {
2731
-                                        if (isset($cf_option_value['value']) && $cf_option_value['value'] == $post->{$type['htmlvar_name']}) {
2732
-                                            $field_value = $cf_option_value['label'];
2733
-                                        }
2734
-                                    }
2735
-                                }
2736
-                            }
2737
-
2738
-                            $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2739
-
2740
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
2741
-                            if ($field_set_start == 1 && $site_title != '') {
2742
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2743
-                            }
2744
-                            $html .= ' </span>' . $field_value . '</div>';
2745
-                        }
2746
-                            break;
2747
-                        case 'multiselect': {
2748
-                            if (is_array($post->{$type['htmlvar_name']})) {
2749
-                                $post->{$type['htmlvar_name']} = implode(', ', $post->{$type['htmlvar_name']});
2750
-                            }
2751
-
2752
-                            if (strpos($field_icon, 'http') !== false) {
2753
-                                $field_icon_af = '';
2754
-                            } elseif ($field_icon == '') {
2755
-                                $field_icon_af = '';
2756
-                            } else {
2757
-                                $field_icon_af = $field_icon;
2758
-                                $field_icon = '';
2759
-                            }
2760
-
2761
-                            $field_values = explode(',', trim($post->{$type['htmlvar_name']}, ","));
2762
-
2763
-                            $option_values = array();
2764
-                            if (!empty($type['option_values'])) {
2765
-                                $cf_option_values = geodir_string_values_to_options(stripslashes_deep($type['option_values']), true);
2729
+								if (!empty($cf_option_values)) {
2730
+									foreach ($cf_option_values as $cf_option_value) {
2731
+										if (isset($cf_option_value['value']) && $cf_option_value['value'] == $post->{$type['htmlvar_name']}) {
2732
+											$field_value = $cf_option_value['label'];
2733
+										}
2734
+									}
2735
+								}
2736
+							}
2737
+
2738
+							$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2739
+
2740
+							$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
2741
+							if ($field_set_start == 1 && $site_title != '') {
2742
+								$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2743
+							}
2744
+							$html .= ' </span>' . $field_value . '</div>';
2745
+						}
2746
+							break;
2747
+						case 'multiselect': {
2748
+							if (is_array($post->{$type['htmlvar_name']})) {
2749
+								$post->{$type['htmlvar_name']} = implode(', ', $post->{$type['htmlvar_name']});
2750
+							}
2751
+
2752
+							if (strpos($field_icon, 'http') !== false) {
2753
+								$field_icon_af = '';
2754
+							} elseif ($field_icon == '') {
2755
+								$field_icon_af = '';
2756
+							} else {
2757
+								$field_icon_af = $field_icon;
2758
+								$field_icon = '';
2759
+							}
2760
+
2761
+							$field_values = explode(',', trim($post->{$type['htmlvar_name']}, ","));
2762
+
2763
+							$option_values = array();
2764
+							if (!empty($type['option_values'])) {
2765
+								$cf_option_values = geodir_string_values_to_options(stripslashes_deep($type['option_values']), true);
2766 2766
                                 
2767
-                                if (!empty($cf_option_values)) {
2768
-                                    foreach ($cf_option_values as $cf_option_value) {
2769
-                                        if (isset($cf_option_value['value']) && in_array($cf_option_value['value'], $field_values)) {
2770
-                                            $option_values[] = $cf_option_value['label'];
2771
-                                        }
2772
-                                    }
2773
-                                }
2774
-                            }
2775
-
2776
-                            $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2777
-
2778
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
2779
-                            if ($field_set_start == 1 && $site_title != '') {
2780
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2781
-                            }
2782
-                            $html .= ' </span>';
2783
-
2784
-                            if (count($option_values) > 1) {
2785
-                                $html .= '<ul>';
2786
-                                foreach ($option_values as $val) {
2787
-                                    $html .= '<li>' . $val . '</li>';
2788
-                                }
2789
-                                $html .= '</ul>';
2790
-                            } else {
2791
-                                $html .= $post->{$type['htmlvar_name']};
2792
-                            }
2793
-                            $html .= '</div>';
2794
-                        }
2795
-                            break;
2796
-                        case 'email': {
2797
-                            if (strpos($field_icon, 'http') !== false) {
2798
-                                $field_icon_af = '';
2799
-                            } elseif ($field_icon == '') {
2800
-                                $field_icon_af = '<i class="fa fa-envelope"></i>';
2801
-                            } else {
2802
-                                $field_icon_af = $field_icon;
2803
-                                $field_icon = '';
2804
-                            }
2805
-
2806
-                            $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2807
-
2808
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af;
2809
-                            if ($field_set_start == 1 && $site_title != '') {
2810
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2811
-                            }
2812
-                            $html .= ' </span>' . stripslashes($post->{$type['htmlvar_name']}) . '</div>';
2813
-                        }
2814
-                            break;
2815
-                        case 'textarea': {
2816
-                            if (strpos($field_icon, 'http') !== false) {
2817
-                                $field_icon_af = '';
2818
-                            } elseif ($field_icon == '') {
2819
-                                $field_icon_af = '';
2820
-                            } else {
2821
-                                $field_icon_af = $field_icon;
2822
-                                $field_icon = '';
2823
-                            }
2824
-
2825
-                            $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2826
-
2827
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
2828
-                            if ($field_set_start == 1 && $site_title != '') {
2829
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2830
-                            }
2831
-                            $html .= '</span>' . wpautop(stripslashes($post->{$type['htmlvar_name']})) . '</div>';
2832
-                        }
2833
-                            break;
2834
-                        case 'html': {
2835
-                            if (strpos($field_icon, 'http') !== false) {
2836
-                                $field_icon_af = '';
2837
-                            } elseif ($field_icon == '') {
2838
-                                $field_icon_af = '';
2839
-                            } else {
2840
-                                $field_icon_af = $field_icon;
2841
-                                $field_icon = '';
2842
-                            }
2843
-
2844
-                            $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2845
-
2846
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
2847
-                            if ($field_set_start == 1 && $site_title != '') {
2848
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2849
-                            }
2850
-                            $html .= ' </span>' . wpautop(stripslashes($post->{$type['htmlvar_name']})) . '</div>';
2851
-                        }
2852
-                        break;
2853
-                        case 'file': {
2854
-                            $html_var = $type['htmlvar_name'];
2855
-
2856
-                            if (!empty($post->{$type['htmlvar_name']})) {
2857
-                                $files = explode(",", $post->{$type['htmlvar_name']});
2858
-
2859
-                                if (!empty($files)) {
2860
-                                    $extra_fields = !empty($type['extra_fields']) ? maybe_unserialize($type['extra_fields']) : NULL;
2861
-                                    $allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types'] ) ? $extra_fields['gd_file_types'] : '';
2767
+								if (!empty($cf_option_values)) {
2768
+									foreach ($cf_option_values as $cf_option_value) {
2769
+										if (isset($cf_option_value['value']) && in_array($cf_option_value['value'], $field_values)) {
2770
+											$option_values[] = $cf_option_value['label'];
2771
+										}
2772
+									}
2773
+								}
2774
+							}
2775
+
2776
+							$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2777
+
2778
+							$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
2779
+							if ($field_set_start == 1 && $site_title != '') {
2780
+								$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2781
+							}
2782
+							$html .= ' </span>';
2783
+
2784
+							if (count($option_values) > 1) {
2785
+								$html .= '<ul>';
2786
+								foreach ($option_values as $val) {
2787
+									$html .= '<li>' . $val . '</li>';
2788
+								}
2789
+								$html .= '</ul>';
2790
+							} else {
2791
+								$html .= $post->{$type['htmlvar_name']};
2792
+							}
2793
+							$html .= '</div>';
2794
+						}
2795
+							break;
2796
+						case 'email': {
2797
+							if (strpos($field_icon, 'http') !== false) {
2798
+								$field_icon_af = '';
2799
+							} elseif ($field_icon == '') {
2800
+								$field_icon_af = '<i class="fa fa-envelope"></i>';
2801
+							} else {
2802
+								$field_icon_af = $field_icon;
2803
+								$field_icon = '';
2804
+							}
2805
+
2806
+							$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2807
+
2808
+							$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af;
2809
+							if ($field_set_start == 1 && $site_title != '') {
2810
+								$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2811
+							}
2812
+							$html .= ' </span>' . stripslashes($post->{$type['htmlvar_name']}) . '</div>';
2813
+						}
2814
+							break;
2815
+						case 'textarea': {
2816
+							if (strpos($field_icon, 'http') !== false) {
2817
+								$field_icon_af = '';
2818
+							} elseif ($field_icon == '') {
2819
+								$field_icon_af = '';
2820
+							} else {
2821
+								$field_icon_af = $field_icon;
2822
+								$field_icon = '';
2823
+							}
2824
+
2825
+							$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2826
+
2827
+							$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
2828
+							if ($field_set_start == 1 && $site_title != '') {
2829
+								$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2830
+							}
2831
+							$html .= '</span>' . wpautop(stripslashes($post->{$type['htmlvar_name']})) . '</div>';
2832
+						}
2833
+							break;
2834
+						case 'html': {
2835
+							if (strpos($field_icon, 'http') !== false) {
2836
+								$field_icon_af = '';
2837
+							} elseif ($field_icon == '') {
2838
+								$field_icon_af = '';
2839
+							} else {
2840
+								$field_icon_af = $field_icon;
2841
+								$field_icon = '';
2842
+							}
2843
+
2844
+							$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2845
+
2846
+							$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
2847
+							if ($field_set_start == 1 && $site_title != '') {
2848
+								$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2849
+							}
2850
+							$html .= ' </span>' . wpautop(stripslashes($post->{$type['htmlvar_name']})) . '</div>';
2851
+						}
2852
+						break;
2853
+						case 'file': {
2854
+							$html_var = $type['htmlvar_name'];
2855
+
2856
+							if (!empty($post->{$type['htmlvar_name']})) {
2857
+								$files = explode(",", $post->{$type['htmlvar_name']});
2858
+
2859
+								if (!empty($files)) {
2860
+									$extra_fields = !empty($type['extra_fields']) ? maybe_unserialize($type['extra_fields']) : NULL;
2861
+									$allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types'] ) ? $extra_fields['gd_file_types'] : '';
2862 2862
                                
2863
-                                    $file_paths = '';
2864
-                                    foreach ($files as $file) {
2865
-                                        if (!empty($file)) {
2866
-                                            $image_name_arr = explode('/', $file);
2867
-                                            $filename = end($image_name_arr);
2868
-
2869
-                                            $arr_file_type = wp_check_filetype($filename);
2870
-                                            if (empty($arr_file_type['ext']) || empty($arr_file_type['type'])) {
2871
-                                                continue;
2872
-                                            }
2873
-                                            $uploaded_file_type = $arr_file_type['type'];
2874
-                                            $uploaded_file_ext = $arr_file_type['ext'];
2863
+									$file_paths = '';
2864
+									foreach ($files as $file) {
2865
+										if (!empty($file)) {
2866
+											$image_name_arr = explode('/', $file);
2867
+											$filename = end($image_name_arr);
2868
+
2869
+											$arr_file_type = wp_check_filetype($filename);
2870
+											if (empty($arr_file_type['ext']) || empty($arr_file_type['type'])) {
2871
+												continue;
2872
+											}
2873
+											$uploaded_file_type = $arr_file_type['type'];
2874
+											$uploaded_file_ext = $arr_file_type['ext'];
2875 2875
                                             
2876
-                                            if (!empty($allowed_file_types) && !in_array($uploaded_file_ext, $allowed_file_types)) {
2877
-                                                continue; // Invalid file type.
2878
-                                            }
2879
-
2880
-                                            $image_file_types = array('image/jpg', 'image/jpeg', 'image/gif', 'image/png', 'image/bmp', 'image/x-icon');
2881
-
2882
-                                            // If the uploaded file is image
2883
-                                            if (in_array($uploaded_file_type, $image_file_types)) {
2884
-                                                $file_paths .= '<div class="geodir-custom-post-gallery" class="clearfix">';
2885
-                                                $file_paths .= '<a href="'.$file.'">';
2886
-                                                $file_paths .= geodir_show_image(array('src' => $file), 'thumbnail', false, false);
2887
-                                                $file_paths .= '</a>';
2888
-                                                $file_paths .= '</div>';
2889
-                                            } else {
2890
-                                                $ext_path = '_' . $html_var . '_';
2891
-                                                $filename = explode($ext_path, $filename);
2892
-                                                $file_paths .= '<a href="' . $file . '" target="_blank">' . $filename[count($filename) - 1] . '</a>';
2893
-                                            }
2894
-                                        }
2895
-                                    }
2896
-
2897
-                                    if (strpos($field_icon, 'http') !== false) {
2898
-                                        $field_icon_af = '';
2899
-                                    } else if ($field_icon == '') {
2900
-                                        $field_icon_af = '';
2901
-                                    } else {
2902
-                                        $field_icon_af = $field_icon;
2903
-                                        $field_icon = '';
2904
-                                    }
2905
-
2906
-                                    $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2907
-
2908
-
2909
-                                    $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . ' geodir-custom-file-box" style="clear:both;"><span class="geodir-i-file" style="display:inline-block;vertical-align:top;padding-right:14px;' . $field_icon . '">' . $field_icon_af;
2910
-
2911
-                                    if ($field_set_start == 1 && $site_title != '') {
2912
-                                        $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2913
-                                    }
2914
-
2915
-                                    $html .= ' </span>' . $file_paths . '</div>';
2916
-                                }
2917
-                            }
2918
-                        }
2919
-                            break;
2920
-                    }
2921
-
2922
-
2923
-                    /**
2924
-                     * Filter custom field output in tab.
2925
-                     *
2926
-                     * @since 1.5.6
2927
-                     *
2928
-                     * @param string $html_var The HTML variable name for the field.
2929
-                     * @param string $html Custom field unfiltered HTML.
2930
-                     * @param array $variables_array Custom field variables array.
2931
-                     */
2932
-                    $html = apply_filters("geodir_tab_show_{$html_var}", $html, $variables_array);
2933
-
2934
-                    $fieldset_html = '';
2935
-                    if ($field_set_start == 1) {
2936
-                        $add_html = false;
2937
-                        if ($type['type'] == 'fieldset' && $fieldset_count > 1) {
2938
-                            if ($fieldset != '') {
2939
-                                $add_html = true;
2940
-                                $label = $fieldset_arr[$fieldset_count - 1]['label'];
2941
-                                $htmlvar_name = $fieldset_arr[$fieldset_count - 1]['htmlvar_name'];
2942
-                            }
2943
-                            $fieldset_html = $fieldset;
2944
-                            $fieldset = '';
2945
-                        } else {
2946
-                            $fieldset .= $html;
2947
-                            if ($total_fields == $count_field && $fieldset != '') {
2948
-                                $add_html = true;
2949
-                                $label = $fieldset_arr[$fieldset_count]['label'];
2950
-                                $htmlvar_name = $fieldset_arr[$fieldset_count]['htmlvar_name'];
2951
-                                $fieldset_html = $fieldset;
2952
-                            }
2953
-                        }
2954
-
2955
-                        if ($add_html) {
2956
-                            $tabs_arr[$htmlvar_name] = array(
2957
-                                'heading_text' => __($label, 'geodirectory'),
2958
-                                'is_active_tab' => false,
2959
-                                /**
2960
-                                 * Filter if a custom field should be displayed on the details page tab.
2961
-                                 *
2962
-                                 * @since 1.0.0
2963
-                                 * @param string $htmlvar_name The field HTML var name.
2964
-                                 */
2965
-                                'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, $htmlvar_name),
2966
-                                'tab_content' => '<div class="geodir-company_info field-group">' . $fieldset_html . '</html>'
2967
-                            );
2968
-                        }
2969
-                    } else {
2970
-                        if ($html != '') {
2971
-                            $tabs_arr[$field['htmlvar_name']] = array(
2972
-                                'heading_text' => __($label, 'geodirectory'),
2973
-                                'is_active_tab' => false,
2974
-                                /** This action is documented in geodirectory_hooks_actions.php */
2975
-                                'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, $field['htmlvar_name']),
2976
-                                'tab_content' => $html
2977
-                            );
2978
-                        }
2979
-                    }
2980
-                }
2981
-            }
2982
-        }
2983
-    }
2984
-    return $tabs_arr;
2876
+											if (!empty($allowed_file_types) && !in_array($uploaded_file_ext, $allowed_file_types)) {
2877
+												continue; // Invalid file type.
2878
+											}
2879
+
2880
+											$image_file_types = array('image/jpg', 'image/jpeg', 'image/gif', 'image/png', 'image/bmp', 'image/x-icon');
2881
+
2882
+											// If the uploaded file is image
2883
+											if (in_array($uploaded_file_type, $image_file_types)) {
2884
+												$file_paths .= '<div class="geodir-custom-post-gallery" class="clearfix">';
2885
+												$file_paths .= '<a href="'.$file.'">';
2886
+												$file_paths .= geodir_show_image(array('src' => $file), 'thumbnail', false, false);
2887
+												$file_paths .= '</a>';
2888
+												$file_paths .= '</div>';
2889
+											} else {
2890
+												$ext_path = '_' . $html_var . '_';
2891
+												$filename = explode($ext_path, $filename);
2892
+												$file_paths .= '<a href="' . $file . '" target="_blank">' . $filename[count($filename) - 1] . '</a>';
2893
+											}
2894
+										}
2895
+									}
2896
+
2897
+									if (strpos($field_icon, 'http') !== false) {
2898
+										$field_icon_af = '';
2899
+									} else if ($field_icon == '') {
2900
+										$field_icon_af = '';
2901
+									} else {
2902
+										$field_icon_af = $field_icon;
2903
+										$field_icon = '';
2904
+									}
2905
+
2906
+									$geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2907
+
2908
+
2909
+									$html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . ' geodir-custom-file-box" style="clear:both;"><span class="geodir-i-file" style="display:inline-block;vertical-align:top;padding-right:14px;' . $field_icon . '">' . $field_icon_af;
2910
+
2911
+									if ($field_set_start == 1 && $site_title != '') {
2912
+										$html .= ' ' . __($site_title, 'geodirectory') . ': ';
2913
+									}
2914
+
2915
+									$html .= ' </span>' . $file_paths . '</div>';
2916
+								}
2917
+							}
2918
+						}
2919
+							break;
2920
+					}
2921
+
2922
+
2923
+					/**
2924
+					 * Filter custom field output in tab.
2925
+					 *
2926
+					 * @since 1.5.6
2927
+					 *
2928
+					 * @param string $html_var The HTML variable name for the field.
2929
+					 * @param string $html Custom field unfiltered HTML.
2930
+					 * @param array $variables_array Custom field variables array.
2931
+					 */
2932
+					$html = apply_filters("geodir_tab_show_{$html_var}", $html, $variables_array);
2933
+
2934
+					$fieldset_html = '';
2935
+					if ($field_set_start == 1) {
2936
+						$add_html = false;
2937
+						if ($type['type'] == 'fieldset' && $fieldset_count > 1) {
2938
+							if ($fieldset != '') {
2939
+								$add_html = true;
2940
+								$label = $fieldset_arr[$fieldset_count - 1]['label'];
2941
+								$htmlvar_name = $fieldset_arr[$fieldset_count - 1]['htmlvar_name'];
2942
+							}
2943
+							$fieldset_html = $fieldset;
2944
+							$fieldset = '';
2945
+						} else {
2946
+							$fieldset .= $html;
2947
+							if ($total_fields == $count_field && $fieldset != '') {
2948
+								$add_html = true;
2949
+								$label = $fieldset_arr[$fieldset_count]['label'];
2950
+								$htmlvar_name = $fieldset_arr[$fieldset_count]['htmlvar_name'];
2951
+								$fieldset_html = $fieldset;
2952
+							}
2953
+						}
2954
+
2955
+						if ($add_html) {
2956
+							$tabs_arr[$htmlvar_name] = array(
2957
+								'heading_text' => __($label, 'geodirectory'),
2958
+								'is_active_tab' => false,
2959
+								/**
2960
+								 * Filter if a custom field should be displayed on the details page tab.
2961
+								 *
2962
+								 * @since 1.0.0
2963
+								 * @param string $htmlvar_name The field HTML var name.
2964
+								 */
2965
+								'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, $htmlvar_name),
2966
+								'tab_content' => '<div class="geodir-company_info field-group">' . $fieldset_html . '</html>'
2967
+							);
2968
+						}
2969
+					} else {
2970
+						if ($html != '') {
2971
+							$tabs_arr[$field['htmlvar_name']] = array(
2972
+								'heading_text' => __($label, 'geodirectory'),
2973
+								'is_active_tab' => false,
2974
+								/** This action is documented in geodirectory_hooks_actions.php */
2975
+								'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, $field['htmlvar_name']),
2976
+								'tab_content' => $html
2977
+							);
2978
+						}
2979
+					}
2980
+				}
2981
+			}
2982
+		}
2983
+	}
2984
+	return $tabs_arr;
2985 2985
 }
2986 2986
 
2987 2987
 /* display add listing page for wpml */
@@ -3005,37 +3005,37 @@  discard block
 block discarded – undo
3005 3005
  */
3006 3006
 function geodir_add_post_status_author_page()
3007 3007
 {
3008
-    global $wpdb, $post;
3009
-
3010
-    $html = '';
3011
-    if (get_current_user_id()) {
3012
-        if (geodir_is_page('author') && !empty($post) && isset($post->post_author) && $post->post_author == get_current_user_id()) {
3013
-
3014
-            // we need to query real status direct as we dynamically change the status for author on author page so even non author status can view them.
3015
-            $real_status = $wpdb->get_var("SELECT post_status from $wpdb->posts WHERE ID=$post->ID");
3016
-            $status = "<strong>(";
3017
-            $status_icon = '<i class="fa fa-play"></i>';
3018
-            if ($real_status == 'publish') {
3019
-                $status .= __('Published', 'geodirectory');
3020
-            } else {
3021
-                $status .= __('Not published', 'geodirectory');
3022
-                $status_icon = '<i class="fa fa-pause"></i>';
3023
-            }
3024
-            $status .= ")</strong>";
3008
+	global $wpdb, $post;
3009
+
3010
+	$html = '';
3011
+	if (get_current_user_id()) {
3012
+		if (geodir_is_page('author') && !empty($post) && isset($post->post_author) && $post->post_author == get_current_user_id()) {
3013
+
3014
+			// we need to query real status direct as we dynamically change the status for author on author page so even non author status can view them.
3015
+			$real_status = $wpdb->get_var("SELECT post_status from $wpdb->posts WHERE ID=$post->ID");
3016
+			$status = "<strong>(";
3017
+			$status_icon = '<i class="fa fa-play"></i>';
3018
+			if ($real_status == 'publish') {
3019
+				$status .= __('Published', 'geodirectory');
3020
+			} else {
3021
+				$status .= __('Not published', 'geodirectory');
3022
+				$status_icon = '<i class="fa fa-pause"></i>';
3023
+			}
3024
+			$status .= ")</strong>";
3025 3025
 
3026
-            $html = '<span class="geodir-post-status">' . $status_icon . ' <font class="geodir-status-label">' . __('Status: ', 'geodirectory') . '</font>' . $status . '</span>';
3027
-        }
3028
-    }
3026
+			$html = '<span class="geodir-post-status">' . $status_icon . ' <font class="geodir-status-label">' . __('Status: ', 'geodirectory') . '</font>' . $status . '</span>';
3027
+		}
3028
+	}
3029 3029
 
3030
-    if ($html != '') {
3031
-        /**
3032
-         * Filter the post status text on the author page.
3033
-         *
3034
-         * @since 1.0.0
3035
-         * @param string $html The HTML of the status.
3036
-         */
3037
-        echo apply_filters('geodir_filter_status_text_on_author_page', $html);
3038
-    }
3030
+	if ($html != '') {
3031
+		/**
3032
+		 * Filter the post status text on the author page.
3033
+		 *
3034
+		 * @since 1.0.0
3035
+		 * @param string $html The HTML of the status.
3036
+		 */
3037
+		echo apply_filters('geodir_filter_status_text_on_author_page', $html);
3038
+	}
3039 3039
 
3040 3040
 
3041 3041
 }
@@ -3049,21 +3049,21 @@  discard block
 block discarded – undo
3049 3049
  */
3050 3050
 function geodir_init_no_rating()
3051 3051
 {
3052
-    if (get_option('geodir_disable_rating')) {
3053
-        remove_action('comment_form_logged_in_after', 'geodir_comment_rating_fields');
3054
-        remove_action('comment_form_before_fields', 'geodir_comment_rating_fields');
3055
-        remove_action('comment_form_logged_in_after', 'geodir_reviewrating_comment_rating_fields');
3056
-        remove_action('comment_form_before_fields', 'geodir_reviewrating_comment_rating_fields');
3057
-        remove_action('add_meta_boxes_comment', 'geodir_comment_add_meta_box');
3058
-        remove_action('add_meta_boxes', 'geodir_reviewrating_comment_metabox', 13);
3059
-        remove_filter('comment_text', 'geodir_wrap_comment_text', 40);
3060
-
3061
-        add_action('comment_form_logged_in_after', 'geodir_no_rating_rating_fields');
3062
-        add_action('comment_form_before_fields', 'geodir_no_rating_rating_fields');
3063
-        add_filter('comment_text', 'geodir_no_rating_comment_text', 100, 2);
3064
-        add_filter('geodir_detail_page_review_rating_html', 'geodir_no_rating_review_rating_html', 100);
3065
-        add_filter('geodir_get_sort_options', 'geodir_no_rating_get_sort_options', 100, 2);
3066
-    }
3052
+	if (get_option('geodir_disable_rating')) {
3053
+		remove_action('comment_form_logged_in_after', 'geodir_comment_rating_fields');
3054
+		remove_action('comment_form_before_fields', 'geodir_comment_rating_fields');
3055
+		remove_action('comment_form_logged_in_after', 'geodir_reviewrating_comment_rating_fields');
3056
+		remove_action('comment_form_before_fields', 'geodir_reviewrating_comment_rating_fields');
3057
+		remove_action('add_meta_boxes_comment', 'geodir_comment_add_meta_box');
3058
+		remove_action('add_meta_boxes', 'geodir_reviewrating_comment_metabox', 13);
3059
+		remove_filter('comment_text', 'geodir_wrap_comment_text', 40);
3060
+
3061
+		add_action('comment_form_logged_in_after', 'geodir_no_rating_rating_fields');
3062
+		add_action('comment_form_before_fields', 'geodir_no_rating_rating_fields');
3063
+		add_filter('comment_text', 'geodir_no_rating_comment_text', 100, 2);
3064
+		add_filter('geodir_detail_page_review_rating_html', 'geodir_no_rating_review_rating_html', 100);
3065
+		add_filter('geodir_get_sort_options', 'geodir_no_rating_get_sort_options', 100, 2);
3066
+	}
3067 3067
 }
3068 3068
 
3069 3069
 /**
@@ -3075,20 +3075,20 @@  discard block
 block discarded – undo
3075 3075
  */
3076 3076
 function geodir_no_rating_rating_fields()
3077 3077
 {
3078
-    global $post;
3078
+	global $post;
3079 3079
 
3080
-    $post_types = geodir_get_posttypes();
3080
+	$post_types = geodir_get_posttypes();
3081 3081
 
3082
-    if (!empty($post) && isset($post->post_type) && in_array($post->post_type, $post_types)) {
3083
-        if (is_plugin_active('geodir_review_rating_manager/geodir_review_rating_manager.php')) {
3084
-            echo '<input type="hidden" value="1" name="geodir_rating[overall]" />';
3085
-            if (get_option('geodir_reviewrating_enable_images')) {
3086
-                geodir_reviewrating_rating_img_html();
3087
-            }
3088
-        } else {
3089
-            echo '<input type="hidden" id="geodir_overallrating" name="geodir_overallrating" value="1" />';
3090
-        }
3091
-    }
3082
+	if (!empty($post) && isset($post->post_type) && in_array($post->post_type, $post_types)) {
3083
+		if (is_plugin_active('geodir_review_rating_manager/geodir_review_rating_manager.php')) {
3084
+			echo '<input type="hidden" value="1" name="geodir_rating[overall]" />';
3085
+			if (get_option('geodir_reviewrating_enable_images')) {
3086
+				geodir_reviewrating_rating_img_html();
3087
+			}
3088
+		} else {
3089
+			echo '<input type="hidden" id="geodir_overallrating" name="geodir_overallrating" value="1" />';
3090
+		}
3091
+	}
3092 3092
 }
3093 3093
 
3094 3094
 /**
@@ -3102,11 +3102,11 @@  discard block
 block discarded – undo
3102 3102
  */
3103 3103
 function geodir_no_rating_comment_text($content, $comment = '')
3104 3104
 {
3105
-    if (!is_admin()) {
3106
-        return '<div class="description">' . $content . '</div>';
3107
-    } else {
3108
-        return $content;
3109
-    }
3105
+	if (!is_admin()) {
3106
+		return '<div class="description">' . $content . '</div>';
3107
+	} else {
3108
+		return $content;
3109
+	}
3110 3110
 }
3111 3111
 
3112 3112
 /**
@@ -3119,7 +3119,7 @@  discard block
 block discarded – undo
3119 3119
  */
3120 3120
 function geodir_no_rating_review_rating_html($content = '')
3121 3121
 {
3122
-    return NULL;
3122
+	return NULL;
3123 3123
 }
3124 3124
 
3125 3125
 /**
@@ -3133,19 +3133,19 @@  discard block
 block discarded – undo
3133 3133
  */
3134 3134
 function geodir_no_rating_get_sort_options($options, $post_type = '')
3135 3135
 {
3136
-    $new_options = array();
3137
-    if (!empty($options)) {
3138
-        foreach ($options as $option) {
3139
-            if (is_object($option) && isset($option->htmlvar_name) && $option->htmlvar_name == 'overall_rating') {
3140
-                continue;
3141
-            }
3142
-            $new_options[] = $option;
3143
-        }
3136
+	$new_options = array();
3137
+	if (!empty($options)) {
3138
+		foreach ($options as $option) {
3139
+			if (is_object($option) && isset($option->htmlvar_name) && $option->htmlvar_name == 'overall_rating') {
3140
+				continue;
3141
+			}
3142
+			$new_options[] = $option;
3143
+		}
3144 3144
 
3145
-        $options = $new_options;
3146
-    }
3145
+		$options = $new_options;
3146
+	}
3147 3147
 
3148
-    return $options;
3148
+	return $options;
3149 3149
 }
3150 3150
 
3151 3151
 add_filter('geodir_all_js_msg', 'geodir_all_js_msg_no_rating', 100);
@@ -3159,11 +3159,11 @@  discard block
 block discarded – undo
3159 3159
  */
3160 3160
 function geodir_all_js_msg_no_rating($msg = array())
3161 3161
 {
3162
-    if (get_option('geodir_disable_rating')) {
3163
-        $msg['gd_cmt_no_rating'] = true;
3164
-    }
3162
+	if (get_option('geodir_disable_rating')) {
3163
+		$msg['gd_cmt_no_rating'] = true;
3164
+	}
3165 3165
 
3166
-    return $msg;
3166
+	return $msg;
3167 3167
 }
3168 3168
 
3169 3169
 add_filter('body_class', 'geodir_body_class_no_rating', 100);
@@ -3177,13 +3177,13 @@  discard block
 block discarded – undo
3177 3177
  */
3178 3178
 function geodir_body_class_no_rating($classes = array())
3179 3179
 {
3180
-    if (get_option('geodir_disable_rating')) {
3181
-        $classes[] = 'gd-no-rating';
3182
-    }
3180
+	if (get_option('geodir_disable_rating')) {
3181
+		$classes[] = 'gd-no-rating';
3182
+	}
3183 3183
     
3184
-    $classes[] = 'gd-map-' . geodir_map_name();
3184
+	$classes[] = 'gd-map-' . geodir_map_name();
3185 3185
 
3186
-    return $classes;
3186
+	return $classes;
3187 3187
 }
3188 3188
 
3189 3189
 add_filter('admin_body_class', 'geodir_admin_body_class_no_rating', 100);
@@ -3197,13 +3197,13 @@  discard block
 block discarded – undo
3197 3197
  */
3198 3198
 function geodir_admin_body_class_no_rating($class = '')
3199 3199
 {
3200
-    if (get_option('geodir_disable_rating')) {
3201
-        $class .= ' gd-no-rating';
3202
-    }
3200
+	if (get_option('geodir_disable_rating')) {
3201
+		$class .= ' gd-no-rating';
3202
+	}
3203 3203
     
3204
-    $class .= ' gd-map-' . geodir_map_name();
3204
+	$class .= ' gd-map-' . geodir_map_name();
3205 3205
 
3206
-    return $class;
3206
+	return $class;
3207 3207
 }
3208 3208
 
3209 3209
 add_action('wp_head', 'geodir_wp_head_no_rating');
@@ -3216,10 +3216,10 @@  discard block
 block discarded – undo
3216 3216
  */
3217 3217
 function geodir_wp_head_no_rating()
3218 3218
 {
3219
-    if (get_option('geodir_disable_rating')) {
3220
-        echo '<style>body .geodir-rating, body .geodir-bubble-rating, body .gd_ratings_module_box{display:none!important;}</style>';
3221
-        echo '<script type="text/javascript">jQuery(function(){jQuery(".gd_rating_show").parent(".geodir-rating").remove();});</script>';
3222
-    }
3219
+	if (get_option('geodir_disable_rating')) {
3220
+		echo '<style>body .geodir-rating, body .geodir-bubble-rating, body .gd_ratings_module_box{display:none!important;}</style>';
3221
+		echo '<script type="text/javascript">jQuery(function(){jQuery(".gd_rating_show").parent(".geodir-rating").remove();});</script>';
3222
+	}
3223 3223
 }
3224 3224
 
3225 3225
 add_filter('geodir_load_db_language', 'geodir_load_custom_field_translation');
@@ -3236,36 +3236,36 @@  discard block
 block discarded – undo
3236 3236
  * @return array Translation texts.
3237 3237
  */
3238 3238
 function geodir_load_gd_options_text_translation($translation_texts = array()) {
3239
-    $translation_texts = !empty( $translation_texts ) && is_array( $translation_texts ) ? $translation_texts : array();
3240
-
3241
-    $gd_options = array('geodir_post_submited_success_email_subject_admin', 'geodir_post_submited_success_email_content_admin', 'geodir_post_submited_success_email_subject', 'geodir_post_submited_success_email_content', 'geodir_forgot_password_subject', 'geodir_forgot_password_content', 'geodir_registration_success_email_subject', 'geodir_registration_success_email_content', 'geodir_post_published_email_subject', 'geodir_post_published_email_content', 'geodir_email_friend_subject', 'geodir_email_friend_content', 'geodir_email_enquiry_subject', 'geodir_email_enquiry_content', 'geodir_post_added_success_msg_content', 'geodir_post_edited_email_subject_admin', 'geodir_post_edited_email_content_admin');
3242
-
3243
-    /**
3244
-     * Filters the geodirectory option names that requires to add for translation.
3245
-     *
3246
-     * @since 1.5.7
3247
-     * @package GeoDirectory
3248
-     *
3249
-     * @param  array $gd_options Array of option names.
3250
-     */
3251
-    $gd_options = apply_filters('geodir_gd_options_for_translation', $gd_options);
3252
-    $gd_options = array_unique($gd_options);
3253
-
3254
-    if (!empty($gd_options)) {
3255
-        foreach ($gd_options as $gd_option) {
3256
-            if ($gd_option != '' && $option_value = get_option($gd_option)) {
3257
-                $option_value = is_string($option_value) ? stripslashes_deep($option_value) : '';
3239
+	$translation_texts = !empty( $translation_texts ) && is_array( $translation_texts ) ? $translation_texts : array();
3240
+
3241
+	$gd_options = array('geodir_post_submited_success_email_subject_admin', 'geodir_post_submited_success_email_content_admin', 'geodir_post_submited_success_email_subject', 'geodir_post_submited_success_email_content', 'geodir_forgot_password_subject', 'geodir_forgot_password_content', 'geodir_registration_success_email_subject', 'geodir_registration_success_email_content', 'geodir_post_published_email_subject', 'geodir_post_published_email_content', 'geodir_email_friend_subject', 'geodir_email_friend_content', 'geodir_email_enquiry_subject', 'geodir_email_enquiry_content', 'geodir_post_added_success_msg_content', 'geodir_post_edited_email_subject_admin', 'geodir_post_edited_email_content_admin');
3242
+
3243
+	/**
3244
+	 * Filters the geodirectory option names that requires to add for translation.
3245
+	 *
3246
+	 * @since 1.5.7
3247
+	 * @package GeoDirectory
3248
+	 *
3249
+	 * @param  array $gd_options Array of option names.
3250
+	 */
3251
+	$gd_options = apply_filters('geodir_gd_options_for_translation', $gd_options);
3252
+	$gd_options = array_unique($gd_options);
3253
+
3254
+	if (!empty($gd_options)) {
3255
+		foreach ($gd_options as $gd_option) {
3256
+			if ($gd_option != '' && $option_value = get_option($gd_option)) {
3257
+				$option_value = is_string($option_value) ? stripslashes_deep($option_value) : '';
3258 3258
                 
3259
-                if ($option_value != '' && !in_array($option_value, $translation_texts)) {
3260
-                    $translation_texts[] = stripslashes_deep($option_value);
3261
-                }
3262
-            }
3263
-        }
3264
-    }
3259
+				if ($option_value != '' && !in_array($option_value, $translation_texts)) {
3260
+					$translation_texts[] = stripslashes_deep($option_value);
3261
+				}
3262
+			}
3263
+		}
3264
+	}
3265 3265
 
3266
-    $translation_texts = !empty($translation_texts) ? array_unique($translation_texts) : $translation_texts;
3266
+	$translation_texts = !empty($translation_texts) ? array_unique($translation_texts) : $translation_texts;
3267 3267
 
3268
-    return $translation_texts;
3268
+	return $translation_texts;
3269 3269
 }
3270 3270
 
3271 3271
 add_filter('geodir_load_db_language', 'geodir_load_gd_options_text_translation');
@@ -3279,13 +3279,13 @@  discard block
 block discarded – undo
3279 3279
 
3280 3280
 add_filter('get_comments_link', 'gd_get_comments_link', 10, 2);
3281 3281
 function gd_get_comments_link($comments_link, $post_id) {
3282
-    $post_type = get_post_type($post_id);
3282
+	$post_type = get_post_type($post_id);
3283 3283
 
3284
-    $all_postypes = geodir_get_posttypes();
3285
-    if (in_array($post_type, $all_postypes)) {
3286
-        $comments_link = str_replace('#comments', '#reviews', $comments_link);
3287
-        $comments_link = str_replace('#respond', '#reviews', $comments_link);
3288
-    }
3284
+	$all_postypes = geodir_get_posttypes();
3285
+	if (in_array($post_type, $all_postypes)) {
3286
+		$comments_link = str_replace('#comments', '#reviews', $comments_link);
3287
+		$comments_link = str_replace('#respond', '#reviews', $comments_link);
3288
+	}
3289 3289
 
3290
-    return $comments_link;
3290
+	return $comments_link;
3291 3291
 }
3292 3292
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +177 added lines, -177 removed lines patch added patch discarded remove patch
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 /* ON TEMPLATE INCLUDE */
137 137
 /////////////////////////
138 138
 
139
-add_filter('template_include', 'geodir_template_loader',9);
139
+add_filter('template_include', 'geodir_template_loader', 9);
140 140
 
141 141
 /////////////////////////
142 142
 /* CATEGORY / TAXONOMY / CUSTOM POST ACTIONS */
@@ -176,9 +176,9 @@  discard block
 block discarded – undo
176 176
 /* WP REVIEW COUNT ACTIONS */
177 177
 ////////////////////////
178 178
 
179
-add_action('geodir_update_postrating', 'geodir_term_review_count_force_update_single_post', 100,1);
179
+add_action('geodir_update_postrating', 'geodir_term_review_count_force_update_single_post', 100, 1);
180 180
 //add_action('geodir_update_postrating', 'geodir_term_review_count_force_update', 100);
181
-add_action('transition_post_status', 'geodir_term_review_count_force_update', 100,3);
181
+add_action('transition_post_status', 'geodir_term_review_count_force_update', 100, 3);
182 182
 //add_action('created_term', 'geodir_term_review_count_force_update', 100);
183 183
 add_action('edited_term', 'geodir_term_review_count_force_update', 100);
184 184
 add_action('delete_term', 'geodir_term_review_count_force_update', 100);
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
  */
223 223
 function geodir_unset_prev_theme_nav_location($newname)
224 224
 {
225
-    $geodir_theme_location = get_option('geodir_theme_location_nav_' . $newname);
225
+    $geodir_theme_location = get_option('geodir_theme_location_nav_'.$newname);
226 226
     if ($geodir_theme_location) {
227 227
         update_option('geodir_theme_location_nav', $geodir_theme_location);
228 228
     } else {
@@ -320,8 +320,8 @@  discard block
 block discarded – undo
320 320
 
321 321
 /////// GEO DIRECOTORY CUSTOM HOOKS ///
322 322
 
323
-add_action('geodir_before_tab_content', 'geodir_before_tab_content');// this function is in custom_functions.php and it is used to wrap detail page tab content 
324
-add_action('geodir_after_tab_content', 'geodir_after_tab_content');// this function is in custom_functions.php and it is used to wrap detail page tab content
323
+add_action('geodir_before_tab_content', 'geodir_before_tab_content'); // this function is in custom_functions.php and it is used to wrap detail page tab content 
324
+add_action('geodir_after_tab_content', 'geodir_after_tab_content'); // this function is in custom_functions.php and it is used to wrap detail page tab content
325 325
 
326 326
 // Detail page sidebar content 
327 327
 add_action('geodir_detail_page_sidebar', 'geodir_detail_page_sidebar_content_sorting', 1);
@@ -422,8 +422,8 @@  discard block
 block discarded – undo
422 422
     do_action('geodir_after_social_sharing_buttons');
423 423
     $content_html = ob_get_clean();
424 424
     if (trim($content_html) != '')
425
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-social-sharing">' . $content_html . '</div>';
426
-    if ((int)get_option('geodir_disable_tfg_buttons_section') != 1) {
425
+        $content_html = '<div class="geodir-company_info geodir-details-sidebar-social-sharing">'.$content_html.'</div>';
426
+    if ((int) get_option('geodir_disable_tfg_buttons_section') != 1) {
427 427
         /**
428 428
          * Filter the geodir_social_sharing_buttons() function content.
429 429
          *
@@ -469,8 +469,8 @@  discard block
 block discarded – undo
469 469
     do_action('geodir_after_share_this_button');
470 470
     $content_html = ob_get_clean();
471 471
     if (trim($content_html) != '')
472
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-sharethis">' . $content_html . '</div>';
473
-    if ((int)get_option('geodir_disable_sharethis_button_section') != 1) {
472
+        $content_html = '<div class="geodir-company_info geodir-details-sidebar-sharethis">'.$content_html.'</div>';
473
+    if ((int) get_option('geodir_disable_sharethis_button_section') != 1) {
474 474
         /**
475 475
          * Filter the geodir_share_this_button() function content.
476 476
          *
@@ -509,12 +509,12 @@  discard block
 block discarded – undo
509 509
             $post_id = $post->ID;
510 510
             
511 511
             if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
512
-                $post_id = (int)$_REQUEST['pid'];
512
+                $post_id = (int) $_REQUEST['pid'];
513 513
             }
514 514
 
515 515
             $postlink = get_permalink(geodir_add_listing_page_id());
516 516
             $editlink = geodir_getlink($postlink, array('pid' => $post_id), false);
517
-            echo ' <p class="edit_link"><i class="fa fa-pencil"></i> <a href="' . esc_url($editlink) . '">' . __('Edit this Post', 'geodirectory') . '</a></p>';
517
+            echo ' <p class="edit_link"><i class="fa fa-pencil"></i> <a href="'.esc_url($editlink).'">'.__('Edit this Post', 'geodirectory').'</a></p>';
518 518
         }
519 519
     }// end of if, if its a preview or not
520 520
     /**
@@ -525,8 +525,8 @@  discard block
 block discarded – undo
525 525
     do_action('geodir_after_edit_post_link');
526 526
     $content_html = ob_get_clean();
527 527
     if (trim($content_html) != '')
528
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-user-links">' . $content_html . '</div>';
529
-    if ((int)get_option('geodir_disable_user_links_section') != 1) {
528
+        $content_html = '<div class="geodir-company_info geodir-details-sidebar-user-links">'.$content_html.'</div>';
529
+    if ((int) get_option('geodir_disable_user_links_section') != 1) {
530 530
         /**
531 531
          * Filter the geodir_edit_post_link() function content.
532 532
          *
@@ -579,14 +579,14 @@  discard block
 block discarded – undo
579 579
     $hide_refresh = get_option('geodir_ga_auto_refresh');
580 580
     
581 581
     $auto_refresh = $hide_refresh && $refresh_time && $refresh_time > 0 ? 1 : 0;
582
-    if (get_option('geodir_ga_stats') && is_user_logged_in() &&  (isset($package_info->google_analytics) && $package_info->google_analytics == '1') && (get_current_user_id()==$post->post_author || current_user_can( 'manage_options' )) ) {
582
+    if (get_option('geodir_ga_stats') && is_user_logged_in() && (isset($package_info->google_analytics) && $package_info->google_analytics == '1') && (get_current_user_id() == $post->post_author || current_user_can('manage_options'))) {
583 583
         $page_url = urlencode($_SERVER['REQUEST_URI']);
584 584
         ?>
585 585
         <script type="text/javascript">
586 586
             var gd_gaTimeOut;
587
-            var gd_gaTime = parseInt('<?php echo $refresh_time;?>');
588
-            var gd_gaHideRefresh = <?php echo (int)$hide_refresh;?>;
589
-            var gd_gaAutoRefresh = <?php echo $auto_refresh;?>;
587
+            var gd_gaTime = parseInt('<?php echo $refresh_time; ?>');
588
+            var gd_gaHideRefresh = <?php echo (int) $hide_refresh; ?>;
589
+            var gd_gaAutoRefresh = <?php echo $auto_refresh; ?>;
590 590
             ga_data1 = false;
591 591
             ga_data2 = false;
592 592
             ga_data3 = false;
@@ -727,7 +727,7 @@  discard block
 block discarded – undo
727 727
             }
728 728
 
729 729
             function gdga_noResults() {
730
-                jQuery('#gdga-chart-container').html('<?php _e('No results available','geodirectory');?>');
730
+                jQuery('#gdga-chart-container').html('<?php _e('No results available', 'geodirectory'); ?>');
731 731
                 jQuery('#gdga-legend-container').html('');
732 732
             }
733 733
 
@@ -759,18 +759,18 @@  discard block
 block discarded – undo
759 759
                     var data2 = results[1].rows.map(function(row) { return +row[2]; });
760 760
                     //var labelsN = results[0].rows.map(function(row) { return +row[1]; });
761 761
 
762
-                    var labels = ['<?php _e('Jan', 'geodirectory');?>',
763
-                        '<?php _e('Feb', 'geodirectory');?>',
764
-                        '<?php _e('Mar', 'geodirectory');?>',
765
-                        '<?php _e('Apr', 'geodirectory');?>',
766
-                        '<?php _e('May', 'geodirectory');?>',
767
-                        '<?php _e('Jun', 'geodirectory');?>',
768
-                        '<?php _e('Jul', 'geodirectory');?>',
769
-                        '<?php _e('Aug', 'geodirectory');?>',
770
-                        '<?php _e('Sep', 'geodirectory');?>',
771
-                        '<?php _e('Oct', 'geodirectory');?>',
772
-                        '<?php _e('Nov', 'geodirectory');?>',
773
-                        '<?php _e('Dec', 'geodirectory');?>'];
762
+                    var labels = ['<?php _e('Jan', 'geodirectory'); ?>',
763
+                        '<?php _e('Feb', 'geodirectory'); ?>',
764
+                        '<?php _e('Mar', 'geodirectory'); ?>',
765
+                        '<?php _e('Apr', 'geodirectory'); ?>',
766
+                        '<?php _e('May', 'geodirectory'); ?>',
767
+                        '<?php _e('Jun', 'geodirectory'); ?>',
768
+                        '<?php _e('Jul', 'geodirectory'); ?>',
769
+                        '<?php _e('Aug', 'geodirectory'); ?>',
770
+                        '<?php _e('Sep', 'geodirectory'); ?>',
771
+                        '<?php _e('Oct', 'geodirectory'); ?>',
772
+                        '<?php _e('Nov', 'geodirectory'); ?>',
773
+                        '<?php _e('Dec', 'geodirectory'); ?>'];
774 774
 
775 775
                     // Ensure the data arrays are at least as long as the labels array.
776 776
                     // Chart.js bar charts don't (yet) accept sparse datasets.
@@ -783,13 +783,13 @@  discard block
 block discarded – undo
783 783
                         labels : labels,
784 784
                         datasets : [
785 785
                             {
786
-                                label: '<?php _e('Last Year', 'geodirectory');?>',
786
+                                label: '<?php _e('Last Year', 'geodirectory'); ?>',
787 787
                                 fillColor : "rgba(220,220,220,0.5)",
788 788
                                 strokeColor : "rgba(220,220,220,1)",
789 789
                                 data : data2
790 790
                             },
791 791
                             {
792
-                                label: '<?php _e('This Year', 'geodirectory');?>',
792
+                                label: '<?php _e('This Year', 'geodirectory'); ?>',
793 793
                                 fillColor : "rgba(151,187,205,0.5)",
794 794
                                 strokeColor : "rgba(151,187,205,1)",
795 795
                                 data : data1
@@ -834,30 +834,30 @@  discard block
 block discarded – undo
834 834
 
835 835
                     <?php
836 836
                     // Here we list the shorthand days of the week so it can be used in translation.
837
-                    __("Mon",'geodirectory');
838
-                    __("Tue",'geodirectory');
839
-                    __("Wed",'geodirectory');
840
-                    __("Thu",'geodirectory');
841
-                    __("Fri",'geodirectory');
842
-                    __("Sat",'geodirectory');
843
-                    __("Sun",'geodirectory');
837
+                    __("Mon", 'geodirectory');
838
+                    __("Tue", 'geodirectory');
839
+                    __("Wed", 'geodirectory');
840
+                    __("Thu", 'geodirectory');
841
+                    __("Fri", 'geodirectory');
842
+                    __("Sat", 'geodirectory');
843
+                    __("Sun", 'geodirectory');
844 844
                     ?>
845 845
 
846 846
                     labels = [
847
-                        "<?php _e(date('D', strtotime("+1 day")),'geodirectory'); ?>",
848
-                        "<?php _e(date('D', strtotime("+2 day")),'geodirectory'); ?>",
849
-                        "<?php _e(date('D', strtotime("+3 day")),'geodirectory'); ?>",
850
-                        "<?php _e(date('D', strtotime("+4 day")),'geodirectory'); ?>",
851
-                        "<?php _e(date('D', strtotime("+5 day")),'geodirectory'); ?>",
852
-                        "<?php _e(date('D', strtotime("+6 day")),'geodirectory'); ?>",
853
-                        "<?php _e(date('D', strtotime("+7 day")),'geodirectory'); ?>"
847
+                        "<?php _e(date('D', strtotime("+1 day")), 'geodirectory'); ?>",
848
+                        "<?php _e(date('D', strtotime("+2 day")), 'geodirectory'); ?>",
849
+                        "<?php _e(date('D', strtotime("+3 day")), 'geodirectory'); ?>",
850
+                        "<?php _e(date('D', strtotime("+4 day")), 'geodirectory'); ?>",
851
+                        "<?php _e(date('D', strtotime("+5 day")), 'geodirectory'); ?>",
852
+                        "<?php _e(date('D', strtotime("+6 day")), 'geodirectory'); ?>",
853
+                        "<?php _e(date('D', strtotime("+7 day")), 'geodirectory'); ?>"
854 854
                     ];
855 855
 
856 856
                     var data = {
857 857
                         labels : labels,
858 858
                         datasets : [
859 859
                             {
860
-                                label: '<?php _e('Last Week', 'geodirectory');?>',
860
+                                label: '<?php _e('Last Week', 'geodirectory'); ?>',
861 861
                                 fillColor : "rgba(220,220,220,0.5)",
862 862
                                 strokeColor : "rgba(220,220,220,1)",
863 863
                                 pointColor : "rgba(220,220,220,1)",
@@ -865,7 +865,7 @@  discard block
 block discarded – undo
865 865
                                 data : data2
866 866
                             },
867 867
                             {
868
-                                label: '<?php _e('This Week', 'geodirectory');?>',
868
+                                label: '<?php _e('This Week', 'geodirectory'); ?>',
869 869
                                 fillColor : "rgba(151,187,205,0.5)",
870 870
                                 strokeColor : "rgba(151,187,205,1)",
871 871
                                 pointColor : "rgba(151,187,205,1)",
@@ -1072,18 +1072,18 @@  discard block
 block discarded – undo
1072 1072
         </style>
1073 1073
         <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.2/Chart.min.js"></script>
1074 1074
         <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.2/moment.min.js"></script>
1075
-        <button type="button" class="gdga-show-analytics"><?php _e('Show Google Analytics', 'geodirectory');?></button>
1075
+        <button type="button" class="gdga-show-analytics"><?php _e('Show Google Analytics', 'geodirectory'); ?></button>
1076 1076
         <span id="ga_stats" class="gdga-analytics-box" style="display:none">
1077
-            <div id="ga-analytics-title"><?php _e("Analytics", 'geodirectory');?></div>
1077
+            <div id="ga-analytics-title"><?php _e("Analytics", 'geodirectory'); ?></div>
1078 1078
             <div id="gd-active-users-container">
1079
-                <div class="gd-ActiveUsers"><i id="gdga-loader-icon" class="fa fa-refresh fa-spin" title="<?php esc_attr_e("Refresh", 'geodirectory');?>"></i><?php _e("Active Users:", 'geodirectory');?>
1079
+                <div class="gd-ActiveUsers"><i id="gdga-loader-icon" class="fa fa-refresh fa-spin" title="<?php esc_attr_e("Refresh", 'geodirectory'); ?>"></i><?php _e("Active Users:", 'geodirectory'); ?>
1080 1080
                     <b class="gd-ActiveUsers-value">0</b>
1081 1081
                 </div>
1082 1082
             </div>
1083 1083
             <select id="gdga-select-analytic" onchange="gdga_select_option();" style="display: none;">
1084
-                <option value="weeks"><?php _e("Last Week vs This Week", 'geodirectory');?></option>
1085
-                <option value="years"><?php _e("This Year vs Last Year", 'geodirectory');?></option>
1086
-                <option value="country"><?php _e("Top Countries", 'geodirectory');?></option>
1084
+                <option value="weeks"><?php _e("Last Week vs This Week", 'geodirectory'); ?></option>
1085
+                <option value="years"><?php _e("This Year vs Last Year", 'geodirectory'); ?></option>
1086
+                <option value="country"><?php _e("Top Countries", 'geodirectory'); ?></option>
1087 1087
             </select>
1088 1088
             <div class="Chartjs-figure" id="gdga-chart-container"></div>
1089 1089
             <ol class="Chartjs-legend" id="gdga-legend-container"></ol>
@@ -1099,8 +1099,8 @@  discard block
 block discarded – undo
1099 1099
     do_action('geodir_after_google_analytics');
1100 1100
     $content_html = ob_get_clean();
1101 1101
     if (trim($content_html) != '')
1102
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-google-analytics">' . $content_html . '</div>';
1103
-    if ((int)get_option('geodir_disable_google_analytics_section') != 1) {
1102
+        $content_html = '<div class="geodir-company_info geodir-details-sidebar-google-analytics">'.$content_html.'</div>';
1103
+    if ((int) get_option('geodir_disable_google_analytics_section') != 1) {
1104 1104
         /**
1105 1105
          * Filter the geodir_edit_post_link() function content.
1106 1106
          *
@@ -1156,10 +1156,10 @@  discard block
 block discarded – undo
1156 1156
        
1157 1157
 	   $reviews_text = $comment_count > 1 ? __("reviews", 'geodirectory') : __("review", 'geodirectory');
1158 1158
 	   
1159
-	   $html .= '<span itemprop="rating" itemscope itemtype="http://data-vocabulary.org/Rating"><span class="rating" itemprop="average" content="' . $post_avgratings . '">' . $post_avgratings . '</span> / <span itemprop="best" content="5">5</span> ' . __("based on", 'geodirectory') . ' </span><span class="count" itemprop="count" content="' . $comment_count . '">' . $comment_count . ' ' . $reviews_text . '</span><br />';
1159
+	   $html .= '<span itemprop="rating" itemscope itemtype="http://data-vocabulary.org/Rating"><span class="rating" itemprop="average" content="'.$post_avgratings.'">'.$post_avgratings.'</span> / <span itemprop="best" content="5">5</span> '.__("based on", 'geodirectory').' </span><span class="count" itemprop="count" content="'.$comment_count.'">'.$comment_count.' '.$reviews_text.'</span><br />';
1160 1160
 
1161 1161
         $html .= '<span class="item">';
1162
-        $html .= '<span class="fn" itemprop="itemreviewed">' . $post->post_title . '</span>';
1162
+        $html .= '<span class="fn" itemprop="itemreviewed">'.$post->post_title.'</span>';
1163 1163
 
1164 1164
         if ($post_images) {
1165 1165
             foreach ($post_images as $img) {
@@ -1169,7 +1169,7 @@  discard block
 block discarded – undo
1169 1169
         }
1170 1170
 
1171 1171
         if (isset($post_img) && $post_img) {
1172
-            $html .= '<br /><img src="' . $post_img . '" class="photo" alt="' . esc_attr($post->post_title) . '" itemprop="photo" content="' . $post_img . '" class="photo" />';
1172
+            $html .= '<br /><img src="'.$post_img.'" class="photo" alt="'.esc_attr($post->post_title).'" itemprop="photo" content="'.$post_img.'" class="photo" />';
1173 1173
         }
1174 1174
 
1175 1175
         $html .= '</span>';
@@ -1196,9 +1196,9 @@  discard block
 block discarded – undo
1196 1196
     do_action('geodir_after_detail_page_review_rating');
1197 1197
     $content_html = ob_get_clean();
1198 1198
     if (trim($content_html) != '') {
1199
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-rating">' . $content_html . '</div>';
1199
+        $content_html = '<div class="geodir-company_info geodir-details-sidebar-rating">'.$content_html.'</div>';
1200 1200
     }
1201
-    if ((int)get_option('geodir_disable_rating_info_section') != 1) {
1201
+    if ((int) get_option('geodir_disable_rating_info_section') != 1) {
1202 1202
         /**
1203 1203
          * Filter the geodir_detail_page_review_rating() function content.
1204 1204
          *
@@ -1237,8 +1237,8 @@  discard block
 block discarded – undo
1237 1237
 
1238 1238
     $content_html = ob_get_clean();
1239 1239
     if (trim($content_html) != '')
1240
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-listing-info">' . $content_html . '</div>';
1241
-    if ((int)get_option('geodir_disable_listing_info_section') != 1) {
1240
+        $content_html = '<div class="geodir-company_info geodir-details-sidebar-listing-info">'.$content_html.'</div>';
1241
+    if ((int) get_option('geodir_disable_listing_info_section') != 1) {
1242 1242
         /**
1243 1243
          * Filter the output html for function geodir_detail_page_more_info().
1244 1244
          *
@@ -1336,7 +1336,7 @@  discard block
 block discarded – undo
1336 1336
 		'gd_allowed_img_types' => !empty($allowed_img_types) ? implode(',', $allowed_img_types) : '',
1337 1337
 		'geodir_txt_form_wait' => __('Wait...', 'geodirectory'),
1338 1338
 		'geodir_txt_form_searching' => __('Searching...', 'geodirectory'),
1339
-		'fa_rating' => (int)get_option('geodir_reviewrating_enable_font_awesome') == 1 ? 1 : '',
1339
+		'fa_rating' => (int) get_option('geodir_reviewrating_enable_font_awesome') == 1 ? 1 : '',
1340 1340
 		'reviewrating' => defined('GEODIRREVIEWRATING_VERSION') ? 1 : '',
1341 1341
         'geodir_map_name' => geodir_map_name(),
1342 1342
     );
@@ -1354,10 +1354,10 @@  discard block
 block discarded – undo
1354 1354
     foreach ($arr_alert_msg as $key => $value) {
1355 1355
         if (!is_scalar($value))
1356 1356
             continue;
1357
-        $arr_alert_msg[$key] = html_entity_decode((string)$value, ENT_QUOTES, 'UTF-8');
1357
+        $arr_alert_msg[$key] = html_entity_decode((string) $value, ENT_QUOTES, 'UTF-8');
1358 1358
     }
1359 1359
 
1360
-    $script = "var geodir_all_js_msg = " . json_encode($arr_alert_msg) . ';';
1360
+    $script = "var geodir_all_js_msg = ".json_encode($arr_alert_msg).';';
1361 1361
     echo '<script>';
1362 1362
     echo $script;
1363 1363
     echo '</script>';
@@ -1445,7 +1445,7 @@  discard block
 block discarded – undo
1445 1445
         $geodir_old_sidebars = get_option('geodir_sidebars');
1446 1446
         if (is_array($geodir_old_sidebars)) {
1447 1447
             foreach ($geodir_old_sidebars as $key => $val) {
1448
-                if(0 === strpos($key, 'geodir_'))// if gd widget
1448
+                if (0 === strpos($key, 'geodir_'))// if gd widget
1449 1449
                 {
1450 1450
                     $sidebars_widgets[$key] = $geodir_old_sidebars[$key];
1451 1451
                 }
@@ -1524,7 +1524,7 @@  discard block
 block discarded – undo
1524 1524
         global $post;
1525 1525
         $term_condition = '';
1526 1526
         if (isset($_REQUEST['backandedit'])) {
1527
-            $post = (object)$gd_session->get('listing');
1527
+            $post = (object) $gd_session->get('listing');
1528 1528
             $term_condition = isset($post->geodir_accept_term_condition) ? $post->geodir_accept_term_condition : '';
1529 1529
         }
1530 1530
 
@@ -1538,7 +1538,7 @@  discard block
 block discarded – undo
1538 1538
                     echo 'checked="checked"';
1539 1539
                 } ?> field_type="checkbox" name="geodir_accept_term_condition" id="geodir_accept_term_condition"
1540 1540
                        class="geodir_textfield" value="1"
1541
-                       style="display:inline-block"/><a href="<?php $terms_page = get_option('geodir_term_condition_page'); if($terms_page){ echo get_permalink($terms_page);}?>" target="_blank"><?php _e('Please accept our terms and conditions', 'geodirectory'); ?></a>
1541
+                       style="display:inline-block"/><a href="<?php $terms_page = get_option('geodir_term_condition_page'); if ($terms_page) { echo get_permalink($terms_page); }?>" target="_blank"><?php _e('Please accept our terms and conditions', 'geodirectory'); ?></a>
1542 1542
 				</span>
1543 1543
             </div>
1544 1544
             <span class="geodir_message_error"><?php if (isset($required_msg)) {
@@ -1578,7 +1578,7 @@  discard block
 block discarded – undo
1578 1578
         /** This action is documented in geodirectory_template_actions.php */
1579 1579
         $desc_limit = apply_filters('geodir_description_field_desc_limit', '');
1580 1580
         
1581
-        if (!($desc_limit === '' || (int)$desc_limit > 0)) {
1581
+        if (!($desc_limit === '' || (int) $desc_limit > 0)) {
1582 1582
             $is_display = false;
1583 1583
         }
1584 1584
     }
@@ -1626,16 +1626,16 @@  discard block
 block discarded – undo
1626 1626
     global $wpdb, $plugin_prefix;
1627 1627
 	
1628 1628
 	// Remove unused virtual page
1629
-	$listings_page_id = (int)get_option('geodir_listing_page');
1629
+	$listings_page_id = (int) get_option('geodir_listing_page');
1630 1630
 	if ($listings_page_id) {
1631
-		$wpdb->query($wpdb->prepare("DELETE FROM " . $wpdb->posts . " WHERE ID=%d AND post_name = %s AND post_type=%s", array($listings_page_id, 'listings', 'page')));
1631
+		$wpdb->query($wpdb->prepare("DELETE FROM ".$wpdb->posts." WHERE ID=%d AND post_name = %s AND post_type=%s", array($listings_page_id, 'listings', 'page')));
1632 1632
         delete_option('geodir_listing_page');
1633 1633
 	}
1634 1634
 
1635 1635
     if (!get_option('geodir_changes_in_custom_fields_table')) {
1636 1636
         $wpdb->query(
1637 1637
             $wpdb->prepare(
1638
-                "UPDATE " . GEODIR_CUSTOM_FIELDS_TABLE . " SET is_default=%s, is_admin=%s WHERE is_default=%s",
1638
+                "UPDATE ".GEODIR_CUSTOM_FIELDS_TABLE." SET is_default=%s, is_admin=%s WHERE is_default=%s",
1639 1639
                 array('1', '1', 'admin')
1640 1640
             )
1641 1641
         );
@@ -1643,9 +1643,9 @@  discard block
 block discarded – undo
1643 1643
 
1644 1644
         /* --- terms meta value set --- */
1645 1645
 
1646
-        update_option('geodir_default_marker_icon', geodir_plugin_url() . '/geodirectory-functions/map-functions/icons/pin.png');
1646
+        update_option('geodir_default_marker_icon', geodir_plugin_url().'/geodirectory-functions/map-functions/icons/pin.png');
1647 1647
 
1648
-        $options_data = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "options WHERE option_name LIKE %s", array('%tax_meta_%')));
1648
+        $options_data = $wpdb->get_results($wpdb->prepare("SELECT * FROM ".$wpdb->prefix."options WHERE option_name LIKE %s", array('%tax_meta_%')));
1649 1649
 
1650 1650
         if (!empty($options_data)) {
1651 1651
 
@@ -1653,7 +1653,7 @@  discard block
 block discarded – undo
1653 1653
 
1654 1654
                 $option_val = str_replace('tax_meta_', '', $optobj->option_name);
1655 1655
 
1656
-                $taxonomies_data = $wpdb->get_results($wpdb->prepare("SELECT taxonomy FROM " . $wpdb->prefix . "term_taxonomy WHERE taxonomy LIKE %s AND term_id=%d", array('%category%', $option_val)));
1656
+                $taxonomies_data = $wpdb->get_results($wpdb->prepare("SELECT taxonomy FROM ".$wpdb->prefix."term_taxonomy WHERE taxonomy LIKE %s AND term_id=%d", array('%category%', $option_val)));
1657 1657
 
1658 1658
                 if (!empty($taxonomies_data)) {
1659 1659
 
@@ -1662,17 +1662,17 @@  discard block
 block discarded – undo
1662 1662
                         $taxObject = get_taxonomy($taxobj->taxonomy);
1663 1663
                         $post_type = $taxObject->object_type[0];
1664 1664
 
1665
-                        $opt_value = 'tax_meta_' . $post_type . '_' . $option_val;
1665
+                        $opt_value = 'tax_meta_'.$post_type.'_'.$option_val;
1666 1666
 
1667
-                        $duplicate_data = $wpdb->get_var($wpdb->prepare("SELECT option_id FROM " . $wpdb->prefix . "options WHERE option_name=%s", array('tax_meta_' . $option_val)));
1667
+                        $duplicate_data = $wpdb->get_var($wpdb->prepare("SELECT option_id FROM ".$wpdb->prefix."options WHERE option_name=%s", array('tax_meta_'.$option_val)));
1668 1668
 
1669 1669
                         if ($duplicate_data) {
1670 1670
 
1671
-                            $wpdb->query($wpdb->prepare("UPDATE " . $wpdb->prefix . "options SET	option_name=%s WHERE option_id=%d", array($opt_value, $optobj->option_id)));
1671
+                            $wpdb->query($wpdb->prepare("UPDATE ".$wpdb->prefix."options SET	option_name=%s WHERE option_id=%d", array($opt_value, $optobj->option_id)));
1672 1672
 
1673 1673
                         } else {
1674 1674
 
1675
-                            $wpdb->query($wpdb->prepare("INSERT INTO " . $wpdb->prefix . "options (option_name,option_value,autoload) VALUES (%s, %s, %s)", array($opt_value, $optobj->option_value, $optobj->autoload)));
1675
+                            $wpdb->query($wpdb->prepare("INSERT INTO ".$wpdb->prefix."options (option_name,option_value,autoload) VALUES (%s, %s, %s)", array($opt_value, $optobj->option_value, $optobj->autoload)));
1676 1676
 
1677 1677
                         }
1678 1678
 
@@ -1706,14 +1706,14 @@  discard block
 block discarded – undo
1706 1706
 
1707 1707
     global $wpdb, $table_prefix;
1708 1708
 
1709
-    $slug_exists = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($slug)));
1709
+    $slug_exists = $wpdb->get_var($wpdb->prepare("SELECT slug FROM ".$table_prefix."terms WHERE slug=%s", array($slug)));
1710 1710
 
1711 1711
     if ($slug_exists) {
1712 1712
 
1713 1713
         $suffix = 1;
1714 1714
         do {
1715
-            $alt_location_name = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix";
1716
-            $location_slug_check = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($alt_location_name)));
1715
+            $alt_location_name = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1))."-$suffix";
1716
+            $location_slug_check = $wpdb->get_var($wpdb->prepare("SELECT slug FROM ".$table_prefix."terms WHERE slug=%s", array($alt_location_name)));
1717 1717
             $suffix++;
1718 1718
         } while ($location_slug_check && $suffix < 100);
1719 1719
 
@@ -1767,7 +1767,7 @@  discard block
 block discarded – undo
1767 1767
 
1768 1768
         $suffix = 1;
1769 1769
         do {
1770
-            $new_slug = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix";
1770
+            $new_slug = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1))."-$suffix";
1771 1771
 
1772 1772
             /** This action is documented in geodirectory_hooks_actions.php */
1773 1773
             $term_slug_check = apply_filters('geodir_term_slug_is_exists', false, $new_slug, $term_id);
@@ -1779,7 +1779,7 @@  discard block
 block discarded – undo
1779 1779
 
1780 1780
         //wp_update_term( $term_id, $taxonomy, array('slug' => $slug) );
1781 1781
 
1782
-        $wpdb->query($wpdb->prepare("UPDATE " . $table_prefix . "terms SET slug=%s WHERE term_id=%d", array($slug, $term_id)));
1782
+        $wpdb->query($wpdb->prepare("UPDATE ".$table_prefix."terms SET slug=%s WHERE term_id=%d", array($slug, $term_id)));
1783 1783
 
1784 1784
     }
1785 1785
 	
@@ -1788,18 +1788,18 @@  discard block
 block discarded – undo
1788 1788
 	$post_type = !empty($taxonomy_obj) ? $taxonomy_obj->object_type[0] : NULL;
1789 1789
 	
1790 1790
 	$post_types = geodir_get_posttypes();
1791
-	if ($post_type && in_array($post_type, $post_types) && $post_type . '_tags' == $taxonomy) {		
1792
-		$posts_obj = $wpdb->get_results($wpdb->prepare("SELECT object_id FROM " . $wpdb->term_relationships . " WHERE term_taxonomy_id = %d", array($tt_id)));
1791
+	if ($post_type && in_array($post_type, $post_types) && $post_type.'_tags' == $taxonomy) {		
1792
+		$posts_obj = $wpdb->get_results($wpdb->prepare("SELECT object_id FROM ".$wpdb->term_relationships." WHERE term_taxonomy_id = %d", array($tt_id)));
1793 1793
 		
1794 1794
 		if (!empty($posts_obj)) {
1795 1795
 			foreach ($posts_obj as $post_obj) {
1796 1796
 				$post_id = $post_obj->object_id;
1797 1797
 				
1798
-				$raw_tags = wp_get_object_terms($post_id, $post_type . '_tags', array('fields' => 'names'));
1798
+				$raw_tags = wp_get_object_terms($post_id, $post_type.'_tags', array('fields' => 'names'));
1799 1799
 				$post_tags = !empty($raw_tags) ? implode(',', $raw_tags) : '';
1800 1800
 				
1801
-				$listing_table = $plugin_prefix . $post_type . '_detail';
1802
-				$wpdb->query($wpdb->prepare("UPDATE " . $listing_table . " SET post_tags=%s WHERE post_id =%d", array($post_tags, $post_id)));
1801
+				$listing_table = $plugin_prefix.$post_type.'_detail';
1802
+				$wpdb->query($wpdb->prepare("UPDATE ".$listing_table." SET post_tags=%s WHERE post_id =%d", array($post_tags, $post_id)));
1803 1803
 			}
1804 1804
 		}
1805 1805
 	}
@@ -1833,7 +1833,7 @@  discard block
 block discarded – undo
1833 1833
     if ($country_slug == $slug || $region_slug == $slug || $city_slug == $slug)
1834 1834
         return $slug_exists = true;
1835 1835
 
1836
-    if ($wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s AND term_id != %d", array($slug, $term_id))))
1836
+    if ($wpdb->get_var($wpdb->prepare("SELECT slug FROM ".$table_prefix."terms WHERE slug=%s AND term_id != %d", array($slug, $term_id))))
1837 1837
         return $slug_exists = true;
1838 1838
 
1839 1839
     return $slug_exists;
@@ -1873,43 +1873,43 @@  discard block
 block discarded – undo
1873 1873
 
1874 1874
 
1875 1875
     $gd_page = '';
1876
-    if(geodir_is_page('home')){
1876
+    if (geodir_is_page('home')) {
1877 1877
         $gd_page = 'home';
1878 1878
         $title = (get_option('geodir_meta_title_homepage')) ? get_option('geodir_meta_title_homepage') : $title;
1879 1879
     }
1880
-    elseif(geodir_is_page('detail')){
1880
+    elseif (geodir_is_page('detail')) {
1881 1881
         $gd_page = 'detail';
1882 1882
         $title = (get_option('geodir_meta_title_detail')) ? get_option('geodir_meta_title_detail') : $title;
1883 1883
     }
1884
-    elseif(geodir_is_page('pt')){
1884
+    elseif (geodir_is_page('pt')) {
1885 1885
         $gd_page = 'pt';
1886 1886
         $title = (get_option('geodir_meta_title_pt')) ? get_option('geodir_meta_title_pt') : $title;
1887 1887
     }
1888
-    elseif(geodir_is_page('listing')){
1888
+    elseif (geodir_is_page('listing')) {
1889 1889
         $gd_page = 'listing';
1890 1890
         $title = (get_option('geodir_meta_title_listing')) ? get_option('geodir_meta_title_listing') : $title;
1891 1891
     }
1892
-    elseif(geodir_is_page('location')){
1892
+    elseif (geodir_is_page('location')) {
1893 1893
         $gd_page = 'location';
1894 1894
         $title = (get_option('geodir_meta_title_location')) ? get_option('geodir_meta_title_location') : $title;
1895 1895
     }
1896
-    elseif(geodir_is_page('search')){
1896
+    elseif (geodir_is_page('search')) {
1897 1897
         $gd_page = 'search';
1898 1898
         $title = (get_option('geodir_meta_title_search')) ? get_option('geodir_meta_title_search') : $title;
1899 1899
     }
1900
-    elseif(geodir_is_page('add-listing')){
1900
+    elseif (geodir_is_page('add-listing')) {
1901 1901
         $gd_page = 'add-listing';
1902 1902
         $title = (get_option('geodir_meta_title_add-listing')) ? get_option('geodir_meta_title_add-listing') : $title;
1903 1903
     }
1904
-    elseif(geodir_is_page('author')){
1904
+    elseif (geodir_is_page('author')) {
1905 1905
         $gd_page = 'author';
1906 1906
         $title = (get_option('geodir_meta_title_author')) ? get_option('geodir_meta_title_author') : $title;
1907 1907
     }
1908
-    elseif(geodir_is_page('login')){
1908
+    elseif (geodir_is_page('login')) {
1909 1909
         $gd_page = 'login';
1910 1910
         $title = (get_option('geodir_meta_title_login')) ? get_option('geodir_meta_title_login') : $title;
1911 1911
     }
1912
-    elseif(geodir_is_page('listing-success')){
1912
+    elseif (geodir_is_page('listing-success')) {
1913 1913
         $gd_page = 'listing-success';
1914 1914
         $title = (get_option('geodir_meta_title_listing-success')) ? get_option('geodir_meta_title_listing-success') : $title;
1915 1915
     }
@@ -1941,8 +1941,8 @@  discard block
 block discarded – undo
1941 1941
 
1942 1942
     if (!get_option('geodir_set_post_attachments')) {
1943 1943
 
1944
-        require_once(ABSPATH . 'wp-admin/includes/image.php');
1945
-        require_once(ABSPATH . 'wp-admin/includes/file.php');
1944
+        require_once(ABSPATH.'wp-admin/includes/image.php');
1945
+        require_once(ABSPATH.'wp-admin/includes/file.php');
1946 1946
 
1947 1947
         $all_postypes = geodir_get_posttypes();
1948 1948
 
@@ -2143,7 +2143,7 @@  discard block
 block discarded – undo
2143 2143
 
2144 2144
         if (array_key_exists('post_video', $tabs_arr)) {
2145 2145
 
2146
-            $field_title = $wpdb->get_var($wpdb->prepare("select site_title from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array('geodir_video', $post_type)));
2146
+            $field_title = $wpdb->get_var($wpdb->prepare("select site_title from ".GEODIR_CUSTOM_FIELDS_TABLE." where htmlvar_name = %s and post_type = %s ", array('geodir_video', $post_type)));
2147 2147
 
2148 2148
             if (isset($tabs_arr['post_video']['heading_text']) && $field_title != '')
2149 2149
                 $tabs_arr['post_video']['heading_text'] = $field_title;
@@ -2151,7 +2151,7 @@  discard block
 block discarded – undo
2151 2151
 
2152 2152
         if (array_key_exists('special_offers', $tabs_arr)) {
2153 2153
 
2154
-            $field_title = $wpdb->get_var($wpdb->prepare("select site_title from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array('geodir_special_offers', $post_type)));
2154
+            $field_title = $wpdb->get_var($wpdb->prepare("select site_title from ".GEODIR_CUSTOM_FIELDS_TABLE." where htmlvar_name = %s and post_type = %s ", array('geodir_special_offers', $post_type)));
2155 2155
 
2156 2156
             if (isset($tabs_arr['special_offers']['heading_text']) && $field_title != '')
2157 2157
                 $tabs_arr['special_offers']['heading_text'] = $field_title;
@@ -2172,7 +2172,7 @@  discard block
 block discarded – undo
2172 2172
  */
2173 2173
 function geodir_remove_template_redirect_actions()
2174 2174
 {
2175
-    if (geodir_is_page('login')){
2175
+    if (geodir_is_page('login')) {
2176 2176
         remove_all_actions('template_redirect');
2177 2177
         remove_action('init', 'avia_modify_front', 10);
2178 2178
     }
@@ -2219,25 +2219,25 @@  discard block
 block discarded – undo
2219 2219
         $split_img_file_path = isset($split_img_path[1]) ? $split_img_path[1] : '';
2220 2220
 
2221 2221
         $wpdb->query(
2222
-            $wpdb->prepare("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id = %d AND file=%s ",
2222
+            $wpdb->prepare("DELETE FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id = %d AND file=%s ",
2223 2223
                 array($post_id, $split_img_file_path)
2224 2224
             )
2225 2225
         );
2226 2226
 
2227 2227
         $attachment_data = $wpdb->get_row(
2228
-            $wpdb->prepare("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=%d",
2228
+            $wpdb->prepare("SELECT ID, MIN(`menu_order`) FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id=%d",
2229 2229
                 array($post_id)
2230 2230
             )
2231 2231
         );
2232 2232
 
2233 2233
         if (!empty($attachment_data)) {
2234
-            $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
2234
+            $wpdb->query("UPDATE ".GEODIR_ATTACHMENT_TABLE." SET menu_order=1 WHERE ID=".$attachment_data->ID);
2235 2235
         }
2236 2236
 
2237 2237
 
2238
-        $table_name = $plugin_prefix . $post_type . '_detail';
2238
+        $table_name = $plugin_prefix.$post_type.'_detail';
2239 2239
 
2240
-        $wpdb->query("UPDATE " . $table_name . " SET featured_image='' WHERE post_id =" . $post_id);
2240
+        $wpdb->query("UPDATE ".$table_name." SET featured_image='' WHERE post_id =".$post_id);
2241 2241
 
2242 2242
         geodir_set_wp_featured_image($post_id);
2243 2243
 
@@ -2265,9 +2265,9 @@  discard block
 block discarded – undo
2265 2265
 
2266 2266
     foreach ($all_postypes as $posttype) {
2267 2267
 
2268
-        $tablename = $plugin_prefix . $posttype . '_detail';
2268
+        $tablename = $plugin_prefix.$posttype.'_detail';
2269 2269
 
2270
-        $get_post_data = $wpdb->get_results("SELECT post_id FROM " . $tablename);
2270
+        $get_post_data = $wpdb->get_results("SELECT post_id FROM ".$tablename);
2271 2271
 
2272 2272
         if (!empty($get_post_data)) {
2273 2273
 
@@ -2275,7 +2275,7 @@  discard block
 block discarded – undo
2275 2275
 
2276 2276
                 $post_id = $data->post_id;
2277 2277
 
2278
-                $attachment_data = $wpdb->get_results("SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id =" . $post_id . " AND file!=''");
2278
+                $attachment_data = $wpdb->get_results("SELECT * FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id =".$post_id." AND file!=''");
2279 2279
 
2280 2280
                 if (!empty($attachment_data)) {
2281 2281
 
@@ -2292,22 +2292,22 @@  discard block
 block discarded – undo
2292 2292
 
2293 2293
                         $file_name = $file_info['basename'];
2294 2294
 
2295
-                        $img_arr['path'] = $uploads_path . $sub_dir . '/' . $file_name;
2295
+                        $img_arr['path'] = $uploads_path.$sub_dir.'/'.$file_name;
2296 2296
 
2297 2297
                         if (!file_exists($img_arr['path'])) {
2298 2298
 
2299
-                            $wpdb->query("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE ID=" . $attach->ID);
2299
+                            $wpdb->query("DELETE FROM ".GEODIR_ATTACHMENT_TABLE." WHERE ID=".$attach->ID);
2300 2300
 
2301 2301
                         }
2302 2302
 
2303 2303
                     }
2304 2304
 
2305
-                    $attachment_data = $wpdb->get_row("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=" . $post_id . " GROUP BY post_id");
2305
+                    $attachment_data = $wpdb->get_row("SELECT ID, MIN(`menu_order`) FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id=".$post_id." GROUP BY post_id");
2306 2306
 
2307 2307
                     if (!empty($attachment_data)) {
2308 2308
 
2309 2309
                         if ($attachment_data->ID)
2310
-                            $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
2310
+                            $wpdb->query("UPDATE ".GEODIR_ATTACHMENT_TABLE." SET menu_order=1 WHERE ID=".$attachment_data->ID);
2311 2311
 
2312 2312
                     } else {
2313 2313
 
@@ -2321,7 +2321,7 @@  discard block
 block discarded – undo
2321 2321
 
2322 2322
                     }
2323 2323
 
2324
-                    $wpdb->query("UPDATE " . $tablename . " SET featured_image='' WHERE post_id =" . $post_id);
2324
+                    $wpdb->query("UPDATE ".$tablename." SET featured_image='' WHERE post_id =".$post_id);
2325 2325
 
2326 2326
                     geodir_set_wp_featured_image($post_id);
2327 2327
 
@@ -2350,7 +2350,7 @@  discard block
 block discarded – undo
2350 2350
 {
2351 2351
 
2352 2352
     if (!get_option('geodir_default_rating_star_icon')) {
2353
-        update_option('geodir_default_rating_star_icon', geodir_plugin_url() . '/geodirectory-assets/images/stars.png');
2353
+        update_option('geodir_default_rating_star_icon', geodir_plugin_url().'/geodirectory-assets/images/stars.png');
2354 2354
     }
2355 2355
 
2356 2356
 }
@@ -2367,10 +2367,10 @@  discard block
 block discarded – undo
2367 2367
  * @global string $plugin_prefix Geodirectory plugin table prefix.
2368 2368
  * @return array User listing count for each post type.
2369 2369
  */
2370
-function geodir_user_post_listing_count($user_id=null)
2370
+function geodir_user_post_listing_count($user_id = null)
2371 2371
 {
2372 2372
     global $wpdb, $plugin_prefix, $current_user;
2373
-    if(!$user_id){
2373
+    if (!$user_id) {
2374 2374
         $user_id = $current_user->ID;
2375 2375
     }
2376 2376
 
@@ -2381,7 +2381,7 @@  discard block
 block discarded – undo
2381 2381
     $user_listing = array();
2382 2382
     if (is_array($all_posts) && !empty($all_posts)) {
2383 2383
         foreach ($all_posts as $ptype) {
2384
-            $total_posts = $wpdb->get_var("SELECT count( ID ) FROM " . $wpdb->prefix . "posts WHERE post_author=" . $user_id . " AND post_type='" . $ptype . "' AND ( post_status = 'publish' OR post_status = 'draft' OR post_status = 'private' )");
2384
+            $total_posts = $wpdb->get_var("SELECT count( ID ) FROM ".$wpdb->prefix."posts WHERE post_author=".$user_id." AND post_type='".$ptype."' AND ( post_status = 'publish' OR post_status = 'draft' OR post_status = 'private' )");
2385 2385
 
2386 2386
             if ($total_posts > 0) {
2387 2387
                 $user_listing[$ptype] = $total_posts;
@@ -2482,9 +2482,9 @@  discard block
 block discarded – undo
2482 2482
                     }
2483 2483
 
2484 2484
                     if (strpos($type['field_icon'], 'http') !== false) {
2485
-                        $field_icon = ' background: url(' . $type['field_icon'] . ') no-repeat left center;background-size:18px 18px;padding-left: 21px;';
2485
+                        $field_icon = ' background: url('.$type['field_icon'].') no-repeat left center;background-size:18px 18px;padding-left: 21px;';
2486 2486
                     } elseif (strpos($type['field_icon'], 'fa fa-') !== false) {
2487
-                        $field_icon = '<i class="' . $type['field_icon'] . '"></i>';
2487
+                        $field_icon = '<i class="'.$type['field_icon'].'"></i>';
2488 2488
                     }
2489 2489
 
2490 2490
                     switch ($type['type']) {
@@ -2492,7 +2492,7 @@  discard block
 block discarded – undo
2492 2492
                             $i = 0;
2493 2493
                             $fieldset_count++;
2494 2494
                             $field_set_start = 1;
2495
-                            $fieldset_arr[$fieldset_count]['htmlvar_name'] = 'gd_tab_' . $fieldset_count;
2495
+                            $fieldset_arr[$fieldset_count]['htmlvar_name'] = 'gd_tab_'.$fieldset_count;
2496 2496
                             $fieldset_arr[$fieldset_count]['label'] = $label;
2497 2497
                         }
2498 2498
                             break;
@@ -2525,7 +2525,7 @@  discard block
 block discarded – undo
2525 2525
                             // all search engines that use the nofollow value exclude links that use it from their ranking calculation
2526 2526
                             $rel = strpos($website, get_site_url()) !== false ? '' : 'rel="nofollow"';
2527 2527
 
2528
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '"><span class="geodir-i-website" style="' . $field_icon . '">' . $field_icon_af . ' <a href="' . $website . '" target="_blank" ' . $rel . ' ><strong>' .
2528
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'"><span class="geodir-i-website" style="'.$field_icon.'">'.$field_icon_af.' <a href="'.$website.'" target="_blank" '.$rel.' ><strong>'.
2529 2529
                                 /**
2530 2530
                                  * Filer the custom field website name.
2531 2531
                                  *
@@ -2534,7 +2534,7 @@  discard block
 block discarded – undo
2534 2534
                                  * @param string $website The website address.
2535 2535
                                  * @param int $post->ID The post ID.
2536 2536
                                  */
2537
-                                apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID) . '</strong></a></span></div>';
2537
+                                apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID).'</strong></a></span></div>';
2538 2538
                         }
2539 2539
                             break;
2540 2540
                         case 'phone': {
@@ -2549,11 +2549,11 @@  discard block
 block discarded – undo
2549 2549
 
2550 2550
                             $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2551 2551
 
2552
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-contact" style="' . $field_icon . '">' . $field_icon_af;
2552
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-contact" style="'.$field_icon.'">'.$field_icon_af;
2553 2553
                             if ($field_set_start == 1 && $site_title != '') {
2554
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2554
+                                $html .= ' '.__($site_title, 'geodirectory').': ';
2555 2555
                             }
2556
-                            $html .= ' </span>' . stripslashes($post->{$type['htmlvar_name']}) . '</div>';
2556
+                            $html .= ' </span>'.stripslashes($post->{$type['htmlvar_name']}).'</div>';
2557 2557
                         }
2558 2558
                             break;
2559 2559
                         case 'time': {
@@ -2572,11 +2572,11 @@  discard block
 block discarded – undo
2572 2572
 
2573 2573
                             $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2574 2574
 
2575
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-time" style="' . $field_icon . '">' . $field_icon_af;
2575
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-time" style="'.$field_icon.'">'.$field_icon_af;
2576 2576
                             if ($field_set_start == 1 && $site_title != '') {
2577
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2577
+                                $html .= ' '.__($site_title, 'geodirectory').': ';
2578 2578
                             }
2579
-                            $html .= ' </span>' . stripslashes($value) . '</div>';
2579
+                            $html .= ' </span>'.stripslashes($value).'</div>';
2580 2580
                         }
2581 2581
                             break;
2582 2582
                         case 'datepicker': {
@@ -2586,8 +2586,8 @@  discard block
 block discarded – undo
2586 2586
                                 $date_format = $date_format['date_format'];
2587 2587
                             }
2588 2588
 
2589
-                            $search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format
2590
-                            $replace = array('d','j','l','m','n','F','Y');//PHP date format
2589
+                            $search = array('dd', 'd', 'DD', 'mm', 'm', 'MM', 'yy'); //jQuery UI datepicker format
2590
+                            $replace = array('d', 'j', 'l', 'm', 'n', 'F', 'Y'); //PHP date format
2591 2591
 
2592 2592
                             $date_format = str_replace($search, $replace, $date_format);
2593 2593
 
@@ -2608,11 +2608,11 @@  discard block
 block discarded – undo
2608 2608
 
2609 2609
                             $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2610 2610
 
2611
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-datepicker" style="' . $field_icon . '">' . $field_icon_af;
2611
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-datepicker" style="'.$field_icon.'">'.$field_icon_af;
2612 2612
                             if ($field_set_start == 1 && $site_title != '') {
2613
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2613
+                                $html .= ' '.__($site_title, 'geodirectory').': ';
2614 2614
                             }
2615
-                            $html .= ' </span>' . $value . '</div>';
2615
+                            $html .= ' </span>'.$value.'</div>';
2616 2616
                         }
2617 2617
                             break;
2618 2618
                         case 'text': {
@@ -2627,11 +2627,11 @@  discard block
 block discarded – undo
2627 2627
 
2628 2628
                             $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2629 2629
 
2630
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
2630
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-text" style="'.$field_icon.'">'.$field_icon_af;
2631 2631
                             if ($field_set_start == 1 && $site_title != '') {
2632
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2632
+                                $html .= ' '.__($site_title, 'geodirectory').': ';
2633 2633
                             }
2634
-                            $html .= ' </span>' . stripslashes($post->{$type['htmlvar_name']}) . '</div>';
2634
+                            $html .= ' </span>'.stripslashes($post->{$type['htmlvar_name']}).'</div>';
2635 2635
                         }
2636 2636
                             break;
2637 2637
                         case 'radio': {
@@ -2668,13 +2668,13 @@  discard block
 block discarded – undo
2668 2668
 
2669 2669
                                 $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2670 2670
 
2671
-                                $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-radio" style="' . $field_icon . '">' . $field_icon_af;
2671
+                                $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-radio" style="'.$field_icon.'">'.$field_icon_af;
2672 2672
 
2673 2673
                                 if ($field_set_start == 1 && $site_title != '') {
2674
-                                    $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2674
+                                    $html .= ' '.__($site_title, 'geodirectory').': ';
2675 2675
                                 }
2676 2676
 
2677
-                                $html .= ' </span>' . $html_val . '</div>';
2677
+                                $html .= ' </span>'.$html_val.'</div>';
2678 2678
                             }
2679 2679
                         }
2680 2680
                             break;
@@ -2682,7 +2682,7 @@  discard block
 block discarded – undo
2682 2682
                             $html_var = $type['htmlvar_name'];
2683 2683
                             $html_val = $type['htmlvar_name'];
2684 2684
 
2685
-                            if ((int)$post->{$html_var} == 1) {
2685
+                            if ((int) $post->{$html_var} == 1) {
2686 2686
 
2687 2687
                                 if ($post->{$type['htmlvar_name']} == '1') {
2688 2688
                                     $html_val = __('Yes', 'geodirectory');
@@ -2701,13 +2701,13 @@  discard block
 block discarded – undo
2701 2701
 
2702 2702
                                 $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2703 2703
 
2704
-                                $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-checkbox" style="' . $field_icon . '">' . $field_icon_af;
2704
+                                $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-checkbox" style="'.$field_icon.'">'.$field_icon_af;
2705 2705
 
2706 2706
                                 if ($field_set_start == 1 && $site_title != '') {
2707
-                                    $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2707
+                                    $html .= ' '.__($site_title, 'geodirectory').': ';
2708 2708
                                 }
2709 2709
 
2710
-                                $html .= ' </span>' . $html_val . '</div>';
2710
+                                $html .= ' </span>'.$html_val.'</div>';
2711 2711
                             }
2712 2712
                         }
2713 2713
                             break;
@@ -2737,11 +2737,11 @@  discard block
 block discarded – undo
2737 2737
 
2738 2738
                             $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2739 2739
 
2740
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
2740
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-select" style="'.$field_icon.'">'.$field_icon_af;
2741 2741
                             if ($field_set_start == 1 && $site_title != '') {
2742
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2742
+                                $html .= ' '.__($site_title, 'geodirectory').': ';
2743 2743
                             }
2744
-                            $html .= ' </span>' . $field_value . '</div>';
2744
+                            $html .= ' </span>'.$field_value.'</div>';
2745 2745
                         }
2746 2746
                             break;
2747 2747
                         case 'multiselect': {
@@ -2775,16 +2775,16 @@  discard block
 block discarded – undo
2775 2775
 
2776 2776
                             $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2777 2777
 
2778
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
2778
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-select" style="'.$field_icon.'">'.$field_icon_af;
2779 2779
                             if ($field_set_start == 1 && $site_title != '') {
2780
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2780
+                                $html .= ' '.__($site_title, 'geodirectory').': ';
2781 2781
                             }
2782 2782
                             $html .= ' </span>';
2783 2783
 
2784 2784
                             if (count($option_values) > 1) {
2785 2785
                                 $html .= '<ul>';
2786 2786
                                 foreach ($option_values as $val) {
2787
-                                    $html .= '<li>' . $val . '</li>';
2787
+                                    $html .= '<li>'.$val.'</li>';
2788 2788
                                 }
2789 2789
                                 $html .= '</ul>';
2790 2790
                             } else {
@@ -2805,11 +2805,11 @@  discard block
 block discarded – undo
2805 2805
 
2806 2806
                             $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2807 2807
 
2808
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af;
2808
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-email" style="'.$field_icon.'">'.$field_icon_af;
2809 2809
                             if ($field_set_start == 1 && $site_title != '') {
2810
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2810
+                                $html .= ' '.__($site_title, 'geodirectory').': ';
2811 2811
                             }
2812
-                            $html .= ' </span>' . stripslashes($post->{$type['htmlvar_name']}) . '</div>';
2812
+                            $html .= ' </span>'.stripslashes($post->{$type['htmlvar_name']}).'</div>';
2813 2813
                         }
2814 2814
                             break;
2815 2815
                         case 'textarea': {
@@ -2824,11 +2824,11 @@  discard block
 block discarded – undo
2824 2824
 
2825 2825
                             $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2826 2826
 
2827
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
2827
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-text" style="'.$field_icon.'">'.$field_icon_af;
2828 2828
                             if ($field_set_start == 1 && $site_title != '') {
2829
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2829
+                                $html .= ' '.__($site_title, 'geodirectory').': ';
2830 2830
                             }
2831
-                            $html .= '</span>' . wpautop(stripslashes($post->{$type['htmlvar_name']})) . '</div>';
2831
+                            $html .= '</span>'.wpautop(stripslashes($post->{$type['htmlvar_name']})).'</div>';
2832 2832
                         }
2833 2833
                             break;
2834 2834
                         case 'html': {
@@ -2843,11 +2843,11 @@  discard block
 block discarded – undo
2843 2843
 
2844 2844
                             $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2845 2845
 
2846
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
2846
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-text" style="'.$field_icon.'">'.$field_icon_af;
2847 2847
                             if ($field_set_start == 1 && $site_title != '') {
2848
-                                $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2848
+                                $html .= ' '.__($site_title, 'geodirectory').': ';
2849 2849
                             }
2850
-                            $html .= ' </span>' . wpautop(stripslashes($post->{$type['htmlvar_name']})) . '</div>';
2850
+                            $html .= ' </span>'.wpautop(stripslashes($post->{$type['htmlvar_name']})).'</div>';
2851 2851
                         }
2852 2852
                         break;
2853 2853
                         case 'file': {
@@ -2858,7 +2858,7 @@  discard block
 block discarded – undo
2858 2858
 
2859 2859
                                 if (!empty($files)) {
2860 2860
                                     $extra_fields = !empty($type['extra_fields']) ? maybe_unserialize($type['extra_fields']) : NULL;
2861
-                                    $allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types'] ) ? $extra_fields['gd_file_types'] : '';
2861
+                                    $allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types']) ? $extra_fields['gd_file_types'] : '';
2862 2862
                                
2863 2863
                                     $file_paths = '';
2864 2864
                                     foreach ($files as $file) {
@@ -2887,9 +2887,9 @@  discard block
 block discarded – undo
2887 2887
                                                 $file_paths .= '</a>';
2888 2888
                                                 $file_paths .= '</div>';
2889 2889
                                             } else {
2890
-                                                $ext_path = '_' . $html_var . '_';
2890
+                                                $ext_path = '_'.$html_var.'_';
2891 2891
                                                 $filename = explode($ext_path, $filename);
2892
-                                                $file_paths .= '<a href="' . $file . '" target="_blank">' . $filename[count($filename) - 1] . '</a>';
2892
+                                                $file_paths .= '<a href="'.$file.'" target="_blank">'.$filename[count($filename) - 1].'</a>';
2893 2893
                                             }
2894 2894
                                         }
2895 2895
                                     }
@@ -2906,13 +2906,13 @@  discard block
 block discarded – undo
2906 2906
                                     $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd';
2907 2907
 
2908 2908
 
2909
-                                    $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . ' geodir-custom-file-box" style="clear:both;"><span class="geodir-i-file" style="display:inline-block;vertical-align:top;padding-right:14px;' . $field_icon . '">' . $field_icon_af;
2909
+                                    $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].' geodir-custom-file-box" style="clear:both;"><span class="geodir-i-file" style="display:inline-block;vertical-align:top;padding-right:14px;'.$field_icon.'">'.$field_icon_af;
2910 2910
 
2911 2911
                                     if ($field_set_start == 1 && $site_title != '') {
2912
-                                        $html .= ' ' . __($site_title, 'geodirectory') . ': ';
2912
+                                        $html .= ' '.__($site_title, 'geodirectory').': ';
2913 2913
                                     }
2914 2914
 
2915
-                                    $html .= ' </span>' . $file_paths . '</div>';
2915
+                                    $html .= ' </span>'.$file_paths.'</div>';
2916 2916
                                 }
2917 2917
                             }
2918 2918
                         }
@@ -2963,7 +2963,7 @@  discard block
 block discarded – undo
2963 2963
                                  * @param string $htmlvar_name The field HTML var name.
2964 2964
                                  */
2965 2965
                                 'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, $htmlvar_name),
2966
-                                'tab_content' => '<div class="geodir-company_info field-group">' . $fieldset_html . '</html>'
2966
+                                'tab_content' => '<div class="geodir-company_info field-group">'.$fieldset_html.'</html>'
2967 2967
                             );
2968 2968
                         }
2969 2969
                     } else {
@@ -3023,7 +3023,7 @@  discard block
 block discarded – undo
3023 3023
             }
3024 3024
             $status .= ")</strong>";
3025 3025
 
3026
-            $html = '<span class="geodir-post-status">' . $status_icon . ' <font class="geodir-status-label">' . __('Status: ', 'geodirectory') . '</font>' . $status . '</span>';
3026
+            $html = '<span class="geodir-post-status">'.$status_icon.' <font class="geodir-status-label">'.__('Status: ', 'geodirectory').'</font>'.$status.'</span>';
3027 3027
         }
3028 3028
     }
3029 3029
 
@@ -3103,7 +3103,7 @@  discard block
 block discarded – undo
3103 3103
 function geodir_no_rating_comment_text($content, $comment = '')
3104 3104
 {
3105 3105
     if (!is_admin()) {
3106
-        return '<div class="description">' . $content . '</div>';
3106
+        return '<div class="description">'.$content.'</div>';
3107 3107
     } else {
3108 3108
         return $content;
3109 3109
     }
@@ -3181,7 +3181,7 @@  discard block
 block discarded – undo
3181 3181
         $classes[] = 'gd-no-rating';
3182 3182
     }
3183 3183
     
3184
-    $classes[] = 'gd-map-' . geodir_map_name();
3184
+    $classes[] = 'gd-map-'.geodir_map_name();
3185 3185
 
3186 3186
     return $classes;
3187 3187
 }
@@ -3201,7 +3201,7 @@  discard block
 block discarded – undo
3201 3201
         $class .= ' gd-no-rating';
3202 3202
     }
3203 3203
     
3204
-    $class .= ' gd-map-' . geodir_map_name();
3204
+    $class .= ' gd-map-'.geodir_map_name();
3205 3205
 
3206 3206
     return $class;
3207 3207
 }
@@ -3236,7 +3236,7 @@  discard block
 block discarded – undo
3236 3236
  * @return array Translation texts.
3237 3237
  */
3238 3238
 function geodir_load_gd_options_text_translation($translation_texts = array()) {
3239
-    $translation_texts = !empty( $translation_texts ) && is_array( $translation_texts ) ? $translation_texts : array();
3239
+    $translation_texts = !empty($translation_texts) && is_array($translation_texts) ? $translation_texts : array();
3240 3240
 
3241 3241
     $gd_options = array('geodir_post_submited_success_email_subject_admin', 'geodir_post_submited_success_email_content_admin', 'geodir_post_submited_success_email_subject', 'geodir_post_submited_success_email_content', 'geodir_forgot_password_subject', 'geodir_forgot_password_content', 'geodir_registration_success_email_subject', 'geodir_registration_success_email_content', 'geodir_post_published_email_subject', 'geodir_post_published_email_content', 'geodir_email_friend_subject', 'geodir_email_friend_content', 'geodir_email_enquiry_subject', 'geodir_email_enquiry_content', 'geodir_post_added_success_msg_content', 'geodir_post_edited_email_subject_admin', 'geodir_post_edited_email_content_admin');
3242 3242
 
Please login to merge, or discard this patch.
Braces   +96 added lines, -76 removed lines patch added patch discarded remove patch
@@ -86,8 +86,9 @@  discard block
 block discarded – undo
86 86
 add_filter('query_vars', 'geodir_add_location_var');
87 87
 add_filter('query_vars', 'geodir_add_geodir_page_var');
88 88
 add_action('wp', 'geodir_add_page_id_in_query_var'); // problem fix in wordpress 3.8
89
-if (get_option('permalink_structure') != '')
90
-    add_filter('parse_request', 'geodir_set_location_var_in_session_in_core');
89
+if (get_option('permalink_structure') != '') {
90
+    add_filter('parse_request', 'geodir_set_location_var_in_session_in_core');
91
+}
91 92
 
92 93
 add_filter('parse_query', 'geodir_modified_query');
93 94
 
@@ -421,8 +422,9 @@  discard block
 block discarded – undo
421 422
      */
422 423
     do_action('geodir_after_social_sharing_buttons');
423 424
     $content_html = ob_get_clean();
424
-    if (trim($content_html) != '')
425
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-social-sharing">' . $content_html . '</div>';
425
+    if (trim($content_html) != '') {
426
+            $content_html = '<div class="geodir-company_info geodir-details-sidebar-social-sharing">' . $content_html . '</div>';
427
+    }
426 428
     if ((int)get_option('geodir_disable_tfg_buttons_section') != 1) {
427 429
         /**
428 430
          * Filter the geodir_social_sharing_buttons() function content.
@@ -468,8 +470,9 @@  discard block
 block discarded – undo
468 470
      */
469 471
     do_action('geodir_after_share_this_button');
470 472
     $content_html = ob_get_clean();
471
-    if (trim($content_html) != '')
472
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-sharethis">' . $content_html . '</div>';
473
+    if (trim($content_html) != '') {
474
+            $content_html = '<div class="geodir-company_info geodir-details-sidebar-sharethis">' . $content_html . '</div>';
475
+    }
473 476
     if ((int)get_option('geodir_disable_sharethis_button_section') != 1) {
474 477
         /**
475 478
          * Filter the geodir_share_this_button() function content.
@@ -524,8 +527,9 @@  discard block
 block discarded – undo
524 527
      */
525 528
     do_action('geodir_after_edit_post_link');
526 529
     $content_html = ob_get_clean();
527
-    if (trim($content_html) != '')
528
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-user-links">' . $content_html . '</div>';
530
+    if (trim($content_html) != '') {
531
+            $content_html = '<div class="geodir-company_info geodir-details-sidebar-user-links">' . $content_html . '</div>';
532
+    }
529 533
     if ((int)get_option('geodir_disable_user_links_section') != 1) {
530 534
         /**
531 535
          * Filter the geodir_edit_post_link() function content.
@@ -1098,8 +1102,9 @@  discard block
 block discarded – undo
1098 1102
      */
1099 1103
     do_action('geodir_after_google_analytics');
1100 1104
     $content_html = ob_get_clean();
1101
-    if (trim($content_html) != '')
1102
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-google-analytics">' . $content_html . '</div>';
1105
+    if (trim($content_html) != '') {
1106
+            $content_html = '<div class="geodir-company_info geodir-details-sidebar-google-analytics">' . $content_html . '</div>';
1107
+    }
1103 1108
     if ((int)get_option('geodir_disable_google_analytics_section') != 1) {
1104 1109
         /**
1105 1110
          * Filter the geodir_edit_post_link() function content.
@@ -1236,8 +1241,9 @@  discard block
 block discarded – undo
1236 1241
     do_action('geodir_after_detail_page_more_info');
1237 1242
 
1238 1243
     $content_html = ob_get_clean();
1239
-    if (trim($content_html) != '')
1240
-        $content_html = '<div class="geodir-company_info geodir-details-sidebar-listing-info">' . $content_html . '</div>';
1244
+    if (trim($content_html) != '') {
1245
+            $content_html = '<div class="geodir-company_info geodir-details-sidebar-listing-info">' . $content_html . '</div>';
1246
+    }
1241 1247
     if ((int)get_option('geodir_disable_listing_info_section') != 1) {
1242 1248
         /**
1243 1249
          * Filter the output html for function geodir_detail_page_more_info().
@@ -1352,8 +1358,9 @@  discard block
 block discarded – undo
1352 1358
     $arr_alert_msg = apply_filters('geodir_all_js_msg', $arr_alert_msg);
1353 1359
 
1354 1360
     foreach ($arr_alert_msg as $key => $value) {
1355
-        if (!is_scalar($value))
1356
-            continue;
1361
+        if (!is_scalar($value)) {
1362
+                    continue;
1363
+        }
1357 1364
         $arr_alert_msg[$key] = html_entity_decode((string)$value, ENT_QUOTES, 'UTF-8');
1358 1365
     }
1359 1366
 
@@ -1407,17 +1414,19 @@  discard block
 block discarded – undo
1407 1414
     global $geodir_sidebars;
1408 1415
     global $sidebars_widgets;
1409 1416
 
1410
-    if (!is_array($sidebars_widgets))
1411
-        $sidebars_widgets = wp_get_sidebars_widgets();
1417
+    if (!is_array($sidebars_widgets)) {
1418
+            $sidebars_widgets = wp_get_sidebars_widgets();
1419
+    }
1412 1420
     $geodir_old_sidebars = array();
1413 1421
 
1414 1422
     if (is_array($geodir_sidebars)) {
1415 1423
         foreach ($geodir_sidebars as $val) {
1416 1424
             if (is_array($sidebars_widgets)) {
1417
-                if (array_key_exists($val, $sidebars_widgets))
1418
-                    $geodir_old_sidebars[$val] = $sidebars_widgets[$val];
1419
-                else
1420
-                    $geodir_old_sidebars[$val] = array();
1425
+                if (array_key_exists($val, $sidebars_widgets)) {
1426
+                                    $geodir_old_sidebars[$val] = $sidebars_widgets[$val];
1427
+                } else {
1428
+                                    $geodir_old_sidebars[$val] = array();
1429
+                }
1421 1430
             }
1422 1431
         }
1423 1432
     }
@@ -1438,16 +1447,19 @@  discard block
 block discarded – undo
1438 1447
 {
1439 1448
     global $sidebars_widgets;
1440 1449
 
1441
-    if (!is_array($sidebars_widgets))
1442
-        $sidebars_widgets = wp_get_sidebars_widgets();
1450
+    if (!is_array($sidebars_widgets)) {
1451
+            $sidebars_widgets = wp_get_sidebars_widgets();
1452
+    }
1443 1453
 
1444 1454
     if (is_array($sidebars_widgets)) {
1445 1455
         $geodir_old_sidebars = get_option('geodir_sidebars');
1446 1456
         if (is_array($geodir_old_sidebars)) {
1447 1457
             foreach ($geodir_old_sidebars as $key => $val) {
1448
-                if(0 === strpos($key, 'geodir_'))// if gd widget
1458
+                if(0 === strpos($key, 'geodir_')) {
1459
+                	// if gd widget
1449 1460
                 {
1450
-                    $sidebars_widgets[$key] = $geodir_old_sidebars[$key];
1461
+                    $sidebars_widgets[$key] = $geodir_old_sidebars[$key];
1462
+                }
1451 1463
                 }
1452 1464
 
1453 1465
 
@@ -1583,20 +1595,25 @@  discard block
 block discarded – undo
1583 1595
         }
1584 1596
     }
1585 1597
     
1586
-    if ($tab == 'post_info')
1587
-        $is_display = (!empty($geodir_post_detail_fields)) ? true : false;
1598
+    if ($tab == 'post_info') {
1599
+            $is_display = (!empty($geodir_post_detail_fields)) ? true : false;
1600
+    }
1588 1601
 
1589
-    if ($tab == 'post_images')
1590
-        $is_display = (!empty($post_images)) ? true : false;
1602
+    if ($tab == 'post_images') {
1603
+            $is_display = (!empty($post_images)) ? true : false;
1604
+    }
1591 1605
 
1592
-    if ($tab == 'post_video')
1593
-        $is_display = (!empty($video)) ? true : false;
1606
+    if ($tab == 'post_video') {
1607
+            $is_display = (!empty($video)) ? true : false;
1608
+    }
1594 1609
 
1595
-    if ($tab == 'special_offers')
1596
-        $is_display = (!empty($special_offers)) ? true : false;
1610
+    if ($tab == 'special_offers') {
1611
+            $is_display = (!empty($special_offers)) ? true : false;
1612
+    }
1597 1613
 
1598
-    if ($tab == 'reviews')
1599
-        $is_display = (geodir_is_page('detail')) ? true : false;
1614
+    if ($tab == 'reviews') {
1615
+            $is_display = (geodir_is_page('detail')) ? true : false;
1616
+    }
1600 1617
 
1601 1618
     if ($tab == 'related_listing') {
1602 1619
        $message = __('No listings found which match your selection.', 'geodirectory');
@@ -1830,11 +1847,13 @@  discard block
 block discarded – undo
1830 1847
     $region_slug = $default_location->region_slug;
1831 1848
     $city_slug = $default_location->city_slug;
1832 1849
 
1833
-    if ($country_slug == $slug || $region_slug == $slug || $city_slug == $slug)
1834
-        return $slug_exists = true;
1850
+    if ($country_slug == $slug || $region_slug == $slug || $city_slug == $slug) {
1851
+            return $slug_exists = true;
1852
+    }
1835 1853
 
1836
-    if ($wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s AND term_id != %d", array($slug, $term_id))))
1837
-        return $slug_exists = true;
1854
+    if ($wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s AND term_id != %d", array($slug, $term_id)))) {
1855
+            return $slug_exists = true;
1856
+    }
1838 1857
 
1839 1858
     return $slug_exists;
1840 1859
 }
@@ -1876,40 +1895,31 @@  discard block
 block discarded – undo
1876 1895
     if(geodir_is_page('home')){
1877 1896
         $gd_page = 'home';
1878 1897
         $title = (get_option('geodir_meta_title_homepage')) ? get_option('geodir_meta_title_homepage') : $title;
1879
-    }
1880
-    elseif(geodir_is_page('detail')){
1898
+    } elseif(geodir_is_page('detail')){
1881 1899
         $gd_page = 'detail';
1882 1900
         $title = (get_option('geodir_meta_title_detail')) ? get_option('geodir_meta_title_detail') : $title;
1883
-    }
1884
-    elseif(geodir_is_page('pt')){
1901
+    } elseif(geodir_is_page('pt')){
1885 1902
         $gd_page = 'pt';
1886 1903
         $title = (get_option('geodir_meta_title_pt')) ? get_option('geodir_meta_title_pt') : $title;
1887
-    }
1888
-    elseif(geodir_is_page('listing')){
1904
+    } elseif(geodir_is_page('listing')){
1889 1905
         $gd_page = 'listing';
1890 1906
         $title = (get_option('geodir_meta_title_listing')) ? get_option('geodir_meta_title_listing') : $title;
1891
-    }
1892
-    elseif(geodir_is_page('location')){
1907
+    } elseif(geodir_is_page('location')){
1893 1908
         $gd_page = 'location';
1894 1909
         $title = (get_option('geodir_meta_title_location')) ? get_option('geodir_meta_title_location') : $title;
1895
-    }
1896
-    elseif(geodir_is_page('search')){
1910
+    } elseif(geodir_is_page('search')){
1897 1911
         $gd_page = 'search';
1898 1912
         $title = (get_option('geodir_meta_title_search')) ? get_option('geodir_meta_title_search') : $title;
1899
-    }
1900
-    elseif(geodir_is_page('add-listing')){
1913
+    } elseif(geodir_is_page('add-listing')){
1901 1914
         $gd_page = 'add-listing';
1902 1915
         $title = (get_option('geodir_meta_title_add-listing')) ? get_option('geodir_meta_title_add-listing') : $title;
1903
-    }
1904
-    elseif(geodir_is_page('author')){
1916
+    } elseif(geodir_is_page('author')){
1905 1917
         $gd_page = 'author';
1906 1918
         $title = (get_option('geodir_meta_title_author')) ? get_option('geodir_meta_title_author') : $title;
1907
-    }
1908
-    elseif(geodir_is_page('login')){
1919
+    } elseif(geodir_is_page('login')){
1909 1920
         $gd_page = 'login';
1910 1921
         $title = (get_option('geodir_meta_title_login')) ? get_option('geodir_meta_title_login') : $title;
1911
-    }
1912
-    elseif(geodir_is_page('listing-success')){
1922
+    } elseif(geodir_is_page('listing-success')){
1913 1923
         $gd_page = 'listing-success';
1914 1924
         $title = (get_option('geodir_meta_title_listing-success')) ? get_option('geodir_meta_title_listing-success') : $title;
1915 1925
     }
@@ -1984,11 +1994,13 @@  discard block
 block discarded – undo
1984 1994
 
1985 1995
     if (!get_option('geodir_remove_url_seperator')) {
1986 1996
 
1987
-        if (get_option('geodir_listingurl_separator'))
1988
-            delete_option('geodir_listingurl_separator');
1997
+        if (get_option('geodir_listingurl_separator')) {
1998
+                    delete_option('geodir_listingurl_separator');
1999
+        }
1989 2000
 
1990
-        if (get_option('geodir_detailurl_separator'))
1991
-            delete_option('geodir_detailurl_separator');
2001
+        if (get_option('geodir_detailurl_separator')) {
2002
+                    delete_option('geodir_detailurl_separator');
2003
+        }
1992 2004
 
1993 2005
         flush_rewrite_rules(false);
1994 2006
 
@@ -2012,8 +2024,9 @@  discard block
 block discarded – undo
2012 2024
 {
2013 2025
     foreach ($permalink_arr as $key => $value) {
2014 2026
 
2015
-        if ($value['id'] == 'geodir_listingurl_separator' || $value['id'] == 'geodir_detailurl_separator')
2016
-            unset($permalink_arr[$key]);
2027
+        if ($value['id'] == 'geodir_listingurl_separator' || $value['id'] == 'geodir_detailurl_separator') {
2028
+                    unset($permalink_arr[$key]);
2029
+        }
2017 2030
 
2018 2031
     }
2019 2032
 
@@ -2145,16 +2158,18 @@  discard block
 block discarded – undo
2145 2158
 
2146 2159
             $field_title = $wpdb->get_var($wpdb->prepare("select site_title from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array('geodir_video', $post_type)));
2147 2160
 
2148
-            if (isset($tabs_arr['post_video']['heading_text']) && $field_title != '')
2149
-                $tabs_arr['post_video']['heading_text'] = $field_title;
2161
+            if (isset($tabs_arr['post_video']['heading_text']) && $field_title != '') {
2162
+                            $tabs_arr['post_video']['heading_text'] = $field_title;
2163
+            }
2150 2164
         }
2151 2165
 
2152 2166
         if (array_key_exists('special_offers', $tabs_arr)) {
2153 2167
 
2154 2168
             $field_title = $wpdb->get_var($wpdb->prepare("select site_title from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array('geodir_special_offers', $post_type)));
2155 2169
 
2156
-            if (isset($tabs_arr['special_offers']['heading_text']) && $field_title != '')
2157
-                $tabs_arr['special_offers']['heading_text'] = $field_title;
2170
+            if (isset($tabs_arr['special_offers']['heading_text']) && $field_title != '') {
2171
+                            $tabs_arr['special_offers']['heading_text'] = $field_title;
2172
+            }
2158 2173
         }
2159 2174
 
2160 2175
     }
@@ -2209,8 +2224,9 @@  discard block
 block discarded – undo
2209 2224
 
2210 2225
         $all_postypes = geodir_get_posttypes();
2211 2226
 
2212
-        if (!in_array($post_type, $all_postypes) || !is_admin())
2213
-            return false;
2227
+        if (!in_array($post_type, $all_postypes) || !is_admin()) {
2228
+                    return false;
2229
+        }
2214 2230
 
2215 2231
         $uploads = wp_upload_dir();
2216 2232
 
@@ -2284,8 +2300,9 @@  discard block
 block discarded – undo
2284 2300
                         $file_info = pathinfo($attach->file);
2285 2301
 
2286 2302
                         $sub_dir = '';
2287
-                        if ($file_info['dirname'] != '.' && $file_info['dirname'] != '..')
2288
-                            $sub_dir = stripslashes_deep($file_info['dirname']);
2303
+                        if ($file_info['dirname'] != '.' && $file_info['dirname'] != '..') {
2304
+                                                    $sub_dir = stripslashes_deep($file_info['dirname']);
2305
+                        }
2289 2306
 
2290 2307
                         $uploads = wp_upload_dir(trim($sub_dir, '/')); // Array of key => value pairs
2291 2308
                         $uploads_path = $uploads['basedir'];
@@ -2306,8 +2323,9 @@  discard block
 block discarded – undo
2306 2323
 
2307 2324
                     if (!empty($attachment_data)) {
2308 2325
 
2309
-                        if ($attachment_data->ID)
2310
-                            $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
2326
+                        if ($attachment_data->ID) {
2327
+                                                    $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID);
2328
+                        }
2311 2329
 
2312 2330
                     } else {
2313 2331
 
@@ -2558,8 +2576,9 @@  discard block
 block discarded – undo
2558 2576
                             break;
2559 2577
                         case 'time': {
2560 2578
                             $value = '';
2561
-                            if ($post->{$type['htmlvar_name']} != '')
2562
-                                $value = date_i18n(get_option('time_format'), strtotime($post->{$type['htmlvar_name']}));
2579
+                            if ($post->{$type['htmlvar_name']} != '') {
2580
+                                                            $value = date_i18n(get_option('time_format'), strtotime($post->{$type['htmlvar_name']}));
2581
+                            }
2563 2582
 
2564 2583
                             if (strpos($field_icon, 'http') !== false) {
2565 2584
                                 $field_icon_af = '';
@@ -2594,8 +2613,9 @@  discard block
 block discarded – undo
2594 2613
                             $post_htmlvar_value = $date_format == 'd/m/Y' ? str_replace('/', '-', $post->{$type['htmlvar_name']}) : $post->{$type['htmlvar_name']}; // PHP doesn't work well with dd/mm/yyyy format
2595 2614
 
2596 2615
                             $value = '';
2597
-                            if ($post->{$type['htmlvar_name']} != '')
2598
-                                $value = date($date_format, strtotime($post_htmlvar_value));
2616
+                            if ($post->{$type['htmlvar_name']} != '') {
2617
+                                                            $value = date($date_format, strtotime($post_htmlvar_value));
2618
+                            }
2599 2619
 
2600 2620
                             if (strpos($field_icon, 'http') !== false) {
2601 2621
                                 $field_icon_af = '';
Please login to merge, or discard this patch.
geodirectory_template_tags.php 3 patches
Indentation   +321 added lines, -321 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
  */
23 23
 function geodir_core_dequeue_script()
24 24
 {
25
-    wp_dequeue_script('flexslider');
25
+	wp_dequeue_script('flexslider');
26 26
 }
27 27
 
28 28
 add_action('wp_print_scripts', 'geodir_core_dequeue_script', 100);
@@ -35,159 +35,159 @@  discard block
 block discarded – undo
35 35
  */
36 36
 function geodir_templates_scripts()
37 37
 {
38
-    $is_detail_page = false;
39
-    $geodir_map_name = geodir_map_name();
40
-
41
-    if((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview') )) {
42
-        $is_detail_page = true;
43
-    }
44
-
45
-    wp_enqueue_script('jquery');
46
-
47
-    wp_register_script('geodirectory-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory.min.js#asyncload', array(), GEODIRECTORY_VERSION);
48
-    wp_enqueue_script('geodirectory-script');
49
-
50
-    $geodir_vars_data = array(
51
-        'siteurl' => get_option('siteurl'),
52
-        'geodir_plugin_url' => geodir_plugin_url(),
53
-        'geodir_lazy_load' => get_option('geodir_lazy_load',1),
54
-        'geodir_ajax_url' => geodir_get_ajax_url(),
55
-        'geodir_gd_modal' => (int)get_option('geodir_disable_gb_modal'),
56
-        'is_rtl' => is_rtl() ? 1 : 0 // fix rtl issue
57
-    );
58
-
59
-    /**
60
-     * Filter the `geodir_var` data array that outputs the  wp_localize_script() translations and variables.
61
-     *
62
-     * This is used by addons to add JS translatable variables.
63
-     *
64
-     * @since 1.4.4
65
-     * @param array $geodir_vars_data {
66
-     *    geodir var data used by addons to add JS translatable variables.
67
-     *
68
-     *    @type string $siteurl Site url.
69
-     *    @type string $geodir_plugin_url Geodirectory core plugin url.
70
-     *    @type string $geodir_ajax_url Geodirectory plugin ajax url.
71
-     *    @type int $geodir_gd_modal Disable GD modal that displays slideshow images in popup?.
72
-     *    @type int $is_rtl Checks if current locale is RTL.
73
-     *
74
-     * }
75
-     */
76
-    $geodir_vars_data = apply_filters('geodir_vars_data',$geodir_vars_data);
77
-
78
-    wp_localize_script('geodirectory-script', 'geodir_var', $geodir_vars_data);
79
-
80
-    wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION,true);
81
-    if($is_detail_page){wp_enqueue_script('geodirectory-jquery-flexslider-js');}
82
-
83
-    wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url() . '/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION,true);
84
-    wp_enqueue_script('geodirectory-lightbox-jquery');
85
-
86
-    wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url() . '/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION,true);
87
-    if ($is_detail_page) {
88
-        wp_enqueue_script('geodirectory-jquery-simplemodal');
89
-    }
90
-
91
-    if (in_array($geodir_map_name, array('auto', 'google'))) {
92
-        $map_lang = "&language=" . geodir_get_map_default_language();
93
-        /**
94
-         * Filter the variables that are added to the end of the google maps script call.
95
-         *
96
-         * This i used to change things like google maps language etc.
97
-         *
98
-         * @since 1.0.0
99
-         * @param string $var The string to filter, default is empty string.
100
-         */
101
-        $map_extra = apply_filters('geodir_googlemap_script_extra', '');
102
-        wp_enqueue_script('geodirectory-googlemap-script', '//maps.google.com/maps/api/js?' . $map_lang . $map_extra, '', NULL);
103
-    }
38
+	$is_detail_page = false;
39
+	$geodir_map_name = geodir_map_name();
40
+
41
+	if((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview') )) {
42
+		$is_detail_page = true;
43
+	}
44
+
45
+	wp_enqueue_script('jquery');
46
+
47
+	wp_register_script('geodirectory-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory.min.js#asyncload', array(), GEODIRECTORY_VERSION);
48
+	wp_enqueue_script('geodirectory-script');
49
+
50
+	$geodir_vars_data = array(
51
+		'siteurl' => get_option('siteurl'),
52
+		'geodir_plugin_url' => geodir_plugin_url(),
53
+		'geodir_lazy_load' => get_option('geodir_lazy_load',1),
54
+		'geodir_ajax_url' => geodir_get_ajax_url(),
55
+		'geodir_gd_modal' => (int)get_option('geodir_disable_gb_modal'),
56
+		'is_rtl' => is_rtl() ? 1 : 0 // fix rtl issue
57
+	);
58
+
59
+	/**
60
+	 * Filter the `geodir_var` data array that outputs the  wp_localize_script() translations and variables.
61
+	 *
62
+	 * This is used by addons to add JS translatable variables.
63
+	 *
64
+	 * @since 1.4.4
65
+	 * @param array $geodir_vars_data {
66
+	 *    geodir var data used by addons to add JS translatable variables.
67
+	 *
68
+	 *    @type string $siteurl Site url.
69
+	 *    @type string $geodir_plugin_url Geodirectory core plugin url.
70
+	 *    @type string $geodir_ajax_url Geodirectory plugin ajax url.
71
+	 *    @type int $geodir_gd_modal Disable GD modal that displays slideshow images in popup?.
72
+	 *    @type int $is_rtl Checks if current locale is RTL.
73
+	 *
74
+	 * }
75
+	 */
76
+	$geodir_vars_data = apply_filters('geodir_vars_data',$geodir_vars_data);
77
+
78
+	wp_localize_script('geodirectory-script', 'geodir_var', $geodir_vars_data);
79
+
80
+	wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION,true);
81
+	if($is_detail_page){wp_enqueue_script('geodirectory-jquery-flexslider-js');}
82
+
83
+	wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url() . '/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION,true);
84
+	wp_enqueue_script('geodirectory-lightbox-jquery');
85
+
86
+	wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url() . '/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION,true);
87
+	if ($is_detail_page) {
88
+		wp_enqueue_script('geodirectory-jquery-simplemodal');
89
+	}
90
+
91
+	if (in_array($geodir_map_name, array('auto', 'google'))) {
92
+		$map_lang = "&language=" . geodir_get_map_default_language();
93
+		/**
94
+		 * Filter the variables that are added to the end of the google maps script call.
95
+		 *
96
+		 * This i used to change things like google maps language etc.
97
+		 *
98
+		 * @since 1.0.0
99
+		 * @param string $var The string to filter, default is empty string.
100
+		 */
101
+		$map_extra = apply_filters('geodir_googlemap_script_extra', '');
102
+		wp_enqueue_script('geodirectory-googlemap-script', '//maps.google.com/maps/api/js?' . $map_lang . $map_extra, '', NULL);
103
+	}
104 104
     
105
-    if ($geodir_map_name == 'osm') {
106
-        // Leaflet OpenStreetMap
107
-        wp_register_style('geodirectory-leaflet-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
108
-        wp_enqueue_style('geodirectory-leaflet-style');
105
+	if ($geodir_map_name == 'osm') {
106
+		// Leaflet OpenStreetMap
107
+		wp_register_style('geodirectory-leaflet-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
108
+		wp_enqueue_style('geodirectory-leaflet-style');
109 109
             
110
-        wp_register_script('geodirectory-leaflet-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION);
111
-        wp_enqueue_script('geodirectory-leaflet-script');
110
+		wp_register_script('geodirectory-leaflet-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION);
111
+		wp_enqueue_script('geodirectory-leaflet-script');
112 112
         
113
-        wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/osm.geocode.js', array(), GEODIRECTORY_VERSION);
114
-        wp_enqueue_script('geodirectory-leaflet-geo-script');
115
-    }
116
-    wp_enqueue_script( 'jquery-ui-autocomplete' );
113
+		wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/osm.geocode.js', array(), GEODIRECTORY_VERSION);
114
+		wp_enqueue_script('geodirectory-leaflet-geo-script');
115
+	}
116
+	wp_enqueue_script( 'jquery-ui-autocomplete' );
117 117
     
118
-    wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION,true);
119
-    wp_enqueue_script('geodirectory-goMap-script');
120
-
121
-
122
-    wp_register_script('chosen', geodir_plugin_url() . '/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
123
-    wp_enqueue_script('chosen');
124
-
125
-    wp_register_script('geodirectory-choose-ajax', geodir_plugin_url() . '/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION);
126
-    wp_enqueue_script('geodirectory-choose-ajax');
127
-
128
-    wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.ui.timepicker.min.js#asyncload', array('jquery-ui-datepicker', 'jquery-ui-slider', 'jquery-effects-core', 'jquery-effects-slide'), '', true);
129
-
130
-    if (is_page() && geodir_is_page('add-listing')) {
131
-        // SCRIPT FOR UPLOAD
132
-        wp_enqueue_script('plupload-all');
133
-        wp_enqueue_script('jquery-ui-sortable');
134
-
135
-        wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION,true);
136
-        wp_enqueue_script('geodirectory-plupload-script');
137
-        // SCRIPT FOR UPLOAD END
138
-
139
-        // check_ajax_referer function is used to make sure no files are uplaoded remotly but it will fail if used between https and non https so we do the check below of the urls
140
-        if (str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
141
-            $ajax_url = admin_url('admin-ajax.php');
142
-        } elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
143
-            $ajax_url = admin_url('admin-ajax.php');
144
-        } elseif (str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
145
-            $ajax_url = str_replace("https", "http", admin_url('admin-ajax.php'));
146
-        } elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
147
-            $ajax_url = str_replace("http", "https", admin_url('admin-ajax.php'));
148
-        } else {
149
-            $ajax_url = admin_url('admin-ajax.php');
150
-        }
118
+	wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION,true);
119
+	wp_enqueue_script('geodirectory-goMap-script');
120
+
121
+
122
+	wp_register_script('chosen', geodir_plugin_url() . '/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
123
+	wp_enqueue_script('chosen');
124
+
125
+	wp_register_script('geodirectory-choose-ajax', geodir_plugin_url() . '/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION);
126
+	wp_enqueue_script('geodirectory-choose-ajax');
127
+
128
+	wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.ui.timepicker.min.js#asyncload', array('jquery-ui-datepicker', 'jquery-ui-slider', 'jquery-effects-core', 'jquery-effects-slide'), '', true);
129
+
130
+	if (is_page() && geodir_is_page('add-listing')) {
131
+		// SCRIPT FOR UPLOAD
132
+		wp_enqueue_script('plupload-all');
133
+		wp_enqueue_script('jquery-ui-sortable');
134
+
135
+		wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION,true);
136
+		wp_enqueue_script('geodirectory-plupload-script');
137
+		// SCRIPT FOR UPLOAD END
138
+
139
+		// check_ajax_referer function is used to make sure no files are uplaoded remotly but it will fail if used between https and non https so we do the check below of the urls
140
+		if (str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
141
+			$ajax_url = admin_url('admin-ajax.php');
142
+		} elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
143
+			$ajax_url = admin_url('admin-ajax.php');
144
+		} elseif (str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
145
+			$ajax_url = str_replace("https", "http", admin_url('admin-ajax.php'));
146
+		} elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
147
+			$ajax_url = str_replace("http", "https", admin_url('admin-ajax.php'));
148
+		} else {
149
+			$ajax_url = admin_url('admin-ajax.php');
150
+		}
151 151
 
152
-        // place js config array for plupload
153
-        $plupload_init = array(
154
-            'runtimes' => 'html5,silverlight,flash,browserplus,gears,html4',
155
-            'browse_button' => 'plupload-browse-button', // will be adjusted per uploader
156
-            'container' => 'plupload-upload-ui', // will be adjusted per uploader
157
-            'drop_element' => 'dropbox', // will be adjusted per uploader
158
-            'file_data_name' => 'async-upload', // will be adjusted per uploader
159
-            'multiple_queues' => true,
160
-            'max_file_size' => geodir_max_upload_size(),
161
-            'url' => $ajax_url,
162
-            'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'),
163
-            'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'),
164
-            'filters' => array(array('title' => __('Allowed Files', 'geodirectory'), 'extensions' => '*')),
165
-            'multipart' => true,
166
-            'urlstream_upload' => true,
167
-            'multi_selection' => false, // will be added per uploader
168
-            // additional post data to send to our ajax hook
169
-            'multipart_params' => array(
170
-                '_ajax_nonce' => "", // will be added per uploader
171
-                'action' => 'plupload_action', // the ajax action name
172
-                'imgid' => 0 // will be added per uploader
173
-            )
174
-        );
175
-        $base_plupload_config = json_encode($plupload_init);
176
-
177
-        $gd_plupload_init = array('base_plupload_config' => $base_plupload_config,
178
-            'upload_img_size' => geodir_max_upload_size());
179
-
180
-        wp_localize_script('geodirectory-plupload-script', 'gd_plupload', $gd_plupload_init);
181
-
182
-        wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url() . '/geodirectory-assets/js/listing_validation.min.js#asyncload');
183
-    } // End if for add place page
184
-
185
-    wp_register_script('geodirectory-post-custom-js', geodir_plugin_url() . '/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
186
-    if ($is_detail_page) {
152
+		// place js config array for plupload
153
+		$plupload_init = array(
154
+			'runtimes' => 'html5,silverlight,flash,browserplus,gears,html4',
155
+			'browse_button' => 'plupload-browse-button', // will be adjusted per uploader
156
+			'container' => 'plupload-upload-ui', // will be adjusted per uploader
157
+			'drop_element' => 'dropbox', // will be adjusted per uploader
158
+			'file_data_name' => 'async-upload', // will be adjusted per uploader
159
+			'multiple_queues' => true,
160
+			'max_file_size' => geodir_max_upload_size(),
161
+			'url' => $ajax_url,
162
+			'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'),
163
+			'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'),
164
+			'filters' => array(array('title' => __('Allowed Files', 'geodirectory'), 'extensions' => '*')),
165
+			'multipart' => true,
166
+			'urlstream_upload' => true,
167
+			'multi_selection' => false, // will be added per uploader
168
+			// additional post data to send to our ajax hook
169
+			'multipart_params' => array(
170
+				'_ajax_nonce' => "", // will be added per uploader
171
+				'action' => 'plupload_action', // the ajax action name
172
+				'imgid' => 0 // will be added per uploader
173
+			)
174
+		);
175
+		$base_plupload_config = json_encode($plupload_init);
176
+
177
+		$gd_plupload_init = array('base_plupload_config' => $base_plupload_config,
178
+			'upload_img_size' => geodir_max_upload_size());
179
+
180
+		wp_localize_script('geodirectory-plupload-script', 'gd_plupload', $gd_plupload_init);
181
+
182
+		wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url() . '/geodirectory-assets/js/listing_validation.min.js#asyncload');
183
+	} // End if for add place page
184
+
185
+	wp_register_script('geodirectory-post-custom-js', geodir_plugin_url() . '/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
186
+	if ($is_detail_page) {
187 187
 		wp_enqueue_script('geodirectory-post-custom-js');
188 188
 	}
189 189
 
190
-    // font awesome rating script
190
+	// font awesome rating script
191 191
 	if (get_option('geodir_reviewrating_enable_font_awesome')) {
192 192
 		wp_register_script('geodir-barrating-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION, true);
193 193
 		wp_enqueue_script('geodir-barrating-js');
@@ -196,11 +196,11 @@  discard block
 block discarded – undo
196 196
 		wp_enqueue_script('geodir-jRating-js');
197 197
 	}
198 198
 
199
-    wp_register_script('geodir-on-document-load', geodir_plugin_url() . '/geodirectory-assets/js/on_document_load.js#asyncload', array(), GEODIRECTORY_VERSION, true);
200
-    wp_enqueue_script('geodir-on-document-load');
199
+	wp_register_script('geodir-on-document-load', geodir_plugin_url() . '/geodirectory-assets/js/on_document_load.js#asyncload', array(), GEODIRECTORY_VERSION, true);
200
+	wp_enqueue_script('geodir-on-document-load');
201 201
 
202
-    wp_register_script('google-geometa', geodir_plugin_url() . '/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
203
-    wp_enqueue_script('google-geometa');
202
+	wp_register_script('google-geometa', geodir_plugin_url() . '/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
203
+	wp_enqueue_script('google-geometa');
204 204
 }
205 205
 
206 206
 /**
@@ -214,8 +214,8 @@  discard block
 block discarded – undo
214 214
  */
215 215
 function geodir_header_scripts()
216 216
 {
217
-    echo '<style>' . stripslashes(get_option('geodir_coustem_css')) . '</style>';
218
-    echo stripslashes(get_option('geodir_header_scripts'));
217
+	echo '<style>' . stripslashes(get_option('geodir_coustem_css')) . '</style>';
218
+	echo stripslashes(get_option('geodir_header_scripts'));
219 219
 }
220 220
 
221 221
 
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
 function geodir_footer_scripts()
232 232
 {	
233 233
 	echo stripslashes(get_option('geodir_ga_tracking_code'));
234
-    echo stripslashes(get_option('geodir_footer_scripts'));
234
+	echo stripslashes(get_option('geodir_footer_scripts'));
235 235
 }
236 236
 
237 237
 
@@ -245,12 +245,12 @@  discard block
 block discarded – undo
245 245
  */
246 246
 function geodir_add_async_forscript($url)
247 247
 {
248
-    if (strpos($url, '#asyncload')===false)
249
-        return $url;
250
-    else if (is_admin())
251
-        return str_replace('#asyncload', '', $url);
252
-    else
253
-        return str_replace('#asyncload', '', $url)."' async='async";
248
+	if (strpos($url, '#asyncload')===false)
249
+		return $url;
250
+	else if (is_admin())
251
+		return str_replace('#asyncload', '', $url);
252
+	else
253
+		return str_replace('#asyncload', '', $url)."' async='async";
254 254
 }
255 255
 add_filter('clean_url', 'geodir_add_async_forscript', 11, 1);
256 256
 
@@ -263,17 +263,17 @@  discard block
 block discarded – undo
263 263
 function geodir_templates_styles()
264 264
 {
265 265
 
266
-    wp_register_style('geodir-core-scss', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
267
-    wp_enqueue_style('geodir-core-scss');
268
-    wp_register_style('geodir-core-scss-footer', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION);
266
+	wp_register_style('geodir-core-scss', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
267
+	wp_enqueue_style('geodir-core-scss');
268
+	wp_register_style('geodir-core-scss-footer', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION);
269 269
 
270
-    if(is_rtl()){
271
-    wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url() . '/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION);
272
-    wp_enqueue_style('geodirectory-frontend-rtl-style');
273
-    }
270
+	if(is_rtl()){
271
+	wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url() . '/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION);
272
+	wp_enqueue_style('geodirectory-frontend-rtl-style');
273
+	}
274 274
 
275
-    wp_register_style('geodirectory-font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css', array(), GEODIRECTORY_VERSION);
276
-    wp_enqueue_style('geodirectory-font-awesome');
275
+	wp_register_style('geodirectory-font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css', array(), GEODIRECTORY_VERSION);
276
+	wp_enqueue_style('geodirectory-font-awesome');
277 277
 
278 278
 
279 279
 }
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
  */
288 288
 function geodir_get_sidebar()
289 289
 {
290
-    get_sidebar('geodirectory');
290
+	get_sidebar('geodirectory');
291 291
 }
292 292
 
293 293
 /**
@@ -306,122 +306,122 @@  discard block
 block discarded – undo
306 306
  * @param bool $always_show Do you want to show the pagination always? Default: false.
307 307
  */
308 308
 function geodir_pagination($before = '', $after = '', $prelabel = '', $nxtlabel = '', $pages_to_show = 5, $always_show = false) {
309
-    global $wp_query, $posts_per_page, $wpdb, $paged, $blog_id;
309
+	global $wp_query, $posts_per_page, $wpdb, $paged, $blog_id;
310 310
 
311
-    if (empty($prelabel)) {
312
-        $prelabel = '<strong>&laquo;</strong>';
313
-    }
311
+	if (empty($prelabel)) {
312
+		$prelabel = '<strong>&laquo;</strong>';
313
+	}
314 314
 
315
-    if (empty($nxtlabel)) {
316
-        $nxtlabel = '<strong>&raquo;</strong>';
317
-    }
315
+	if (empty($nxtlabel)) {
316
+		$nxtlabel = '<strong>&raquo;</strong>';
317
+	}
318 318
 
319
-    $half_pages_to_show = round($pages_to_show / 2);
319
+	$half_pages_to_show = round($pages_to_show / 2);
320 320
 
321
-    if (geodir_is_page('home') || (get_option('geodir_set_as_home') && is_home())) // dont apply default  pagination for geodirectory home page.
322
-        return;
321
+	if (geodir_is_page('home') || (get_option('geodir_set_as_home') && is_home())) // dont apply default  pagination for geodirectory home page.
322
+		return;
323 323
 
324
-    if (!is_single()) {
325
-        if (function_exists('geodir_location_geo_home_link')) {
326
-            remove_filter('home_url', 'geodir_location_geo_home_link', 100000);
327
-        }
328
-        $numposts = $wp_query->found_posts;
324
+	if (!is_single()) {
325
+		if (function_exists('geodir_location_geo_home_link')) {
326
+			remove_filter('home_url', 'geodir_location_geo_home_link', 100000);
327
+		}
328
+		$numposts = $wp_query->found_posts;
329 329
 
330
-        $max_page = ceil($numposts / $posts_per_page);
330
+		$max_page = ceil($numposts / $posts_per_page);
331 331
 
332
-        if (empty($paged)) {
333
-            $paged = 1;
334
-        }
332
+		if (empty($paged)) {
333
+			$paged = 1;
334
+		}
335 335
         
336
-        $post_type = geodir_get_current_posttype();
337
-        $listing_type_name = get_post_type_plural_label($post_type);
338
-        if (geodir_is_page('listing') || geodir_is_page('search')) {            
339
-            $term = array();
336
+		$post_type = geodir_get_current_posttype();
337
+		$listing_type_name = get_post_type_plural_label($post_type);
338
+		if (geodir_is_page('listing') || geodir_is_page('search')) {            
339
+			$term = array();
340 340
             
341
-            if (is_tax()) {
342
-                $term_id = get_queried_object_id();
343
-                $taxonomy = get_query_var('taxonomy');
341
+			if (is_tax()) {
342
+				$term_id = get_queried_object_id();
343
+				$taxonomy = get_query_var('taxonomy');
344 344
 
345
-                if ($term_id && $post_type && get_query_var('taxonomy') == $post_type . 'category' ) {
346
-                    $term = get_term($term_id, $post_type . 'category');
347
-                }
348
-            }
345
+				if ($term_id && $post_type && get_query_var('taxonomy') == $post_type . 'category' ) {
346
+					$term = get_term($term_id, $post_type . 'category');
347
+				}
348
+			}
349 349
             
350
-            if (geodir_is_page('search') && !empty($_REQUEST['s' . $post_type . 'category'])) {
351
-                $taxonomy_search = $_REQUEST['s' . $post_type . 'category'];
350
+			if (geodir_is_page('search') && !empty($_REQUEST['s' . $post_type . 'category'])) {
351
+				$taxonomy_search = $_REQUEST['s' . $post_type . 'category'];
352 352
                 
353
-                if (!is_array($taxonomy_search)) {
354
-                    $term = get_term((int)$taxonomy_search, $post_type . 'category');
355
-                } else if(is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search
356
-                    $term = get_term((int)$taxonomy_search[0], $post_type . 'category');
357
-                }
358
-            }
353
+				if (!is_array($taxonomy_search)) {
354
+					$term = get_term((int)$taxonomy_search, $post_type . 'category');
355
+				} else if(is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search
356
+					$term = get_term((int)$taxonomy_search[0], $post_type . 'category');
357
+				}
358
+			}
359 359
             
360
-            if (!empty($term) && !is_wp_error($term)) {
361
-                $listing_type_name = $term->name;
362
-            }
363
-        }
360
+			if (!empty($term) && !is_wp_error($term)) {
361
+				$listing_type_name = $term->name;
362
+			}
363
+		}
364 364
 
365
-        if ($max_page > 1 || $always_show) {            
366
-            // Extra pagination info
367
-            $geodir_pagination_more_info = get_option('geodir_pagination_advance_info');
368
-            $start_no = ( $paged - 1 ) * $posts_per_page + 1;
369
-            $end_no = min($paged * $posts_per_page, $numposts);
365
+		if ($max_page > 1 || $always_show) {            
366
+			// Extra pagination info
367
+			$geodir_pagination_more_info = get_option('geodir_pagination_advance_info');
368
+			$start_no = ( $paged - 1 ) * $posts_per_page + 1;
369
+			$end_no = min($paged * $posts_per_page, $numposts);
370 370
 
371
-            if ($geodir_pagination_more_info != '') {
372
-                if ($listing_type_name) {
373
-                    $listing_type_name = __($listing_type_name, 'geodirectory');
374
-                    $pegination_desc = wp_sprintf(__('Showing %s %d-%d of %d', 'geodirectory'), $listing_type_name, $start_no, $end_no, $numposts);
375
-                } else {
376
-                    $pegination_desc = wp_sprintf(__('Showing listings %d-%d of %d', 'geodirectory'), $start_no, $end_no, $numposts);
377
-                }
378
-                $pagination_info = '<div class="gd-pagination-details">' . $pegination_desc . '</div>';
379
-                /**
380
-                 * Adds an extra pagination info above/under pagination.
381
-                 *
382
-                 * @since 1.5.9
383
-                 *
384
-                 * @param string $pagination_info Extra pagination info content.
385
-                 * @param string $listing_type_name Listing results type.
386
-                 * @param string $start_no First result number.
387
-                 * @param string $end_no Last result number.
388
-                 * @param string $numposts Total number of listings.
389
-                 * @param string $post_type The post type.
390
-                 */
391
-                $pagination_info = apply_filters('geodir_pagination_advance_info', $pagination_info, $listing_type_name, $start_no, $end_no, $numposts, $post_type);
371
+			if ($geodir_pagination_more_info != '') {
372
+				if ($listing_type_name) {
373
+					$listing_type_name = __($listing_type_name, 'geodirectory');
374
+					$pegination_desc = wp_sprintf(__('Showing %s %d-%d of %d', 'geodirectory'), $listing_type_name, $start_no, $end_no, $numposts);
375
+				} else {
376
+					$pegination_desc = wp_sprintf(__('Showing listings %d-%d of %d', 'geodirectory'), $start_no, $end_no, $numposts);
377
+				}
378
+				$pagination_info = '<div class="gd-pagination-details">' . $pegination_desc . '</div>';
379
+				/**
380
+				 * Adds an extra pagination info above/under pagination.
381
+				 *
382
+				 * @since 1.5.9
383
+				 *
384
+				 * @param string $pagination_info Extra pagination info content.
385
+				 * @param string $listing_type_name Listing results type.
386
+				 * @param string $start_no First result number.
387
+				 * @param string $end_no Last result number.
388
+				 * @param string $numposts Total number of listings.
389
+				 * @param string $post_type The post type.
390
+				 */
391
+				$pagination_info = apply_filters('geodir_pagination_advance_info', $pagination_info, $listing_type_name, $start_no, $end_no, $numposts, $post_type);
392 392
                 
393
-                if ($geodir_pagination_more_info == 'before') {
394
-                    $before = $before . $pagination_info;
395
-                } else if ($geodir_pagination_more_info == 'after') {
396
-                    $after = $pagination_info . $after;
397
-                }
398
-            }
393
+				if ($geodir_pagination_more_info == 'before') {
394
+					$before = $before . $pagination_info;
395
+				} else if ($geodir_pagination_more_info == 'after') {
396
+					$after = $pagination_info . $after;
397
+				}
398
+			}
399 399
             
400
-            echo "$before <div class='Navi gd-navi'>";
401
-            if ($paged >= ($pages_to_show - 1)) {
402
-                echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link()) . '">&laquo;</a>';
403
-            }
404
-            previous_posts_link($prelabel);
405
-            for ($i = $paged - $half_pages_to_show; $i <= $paged + $half_pages_to_show; $i++) {
406
-                if ($i >= 1 && $i <= $max_page) {
407
-                    if ($i == $paged) {
408
-                        echo "<strong class='on'>$i</strong>";
409
-                    } else {
410
-                        echo ' <a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($i)) . '">' . $i . '</a> ';
411
-                    }
412
-                }
413
-            }
414
-            next_posts_link($nxtlabel, $max_page);
415
-            if (($paged + $half_pages_to_show) < ($max_page)) {
416
-                echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($max_page)) . '">&raquo;</a>';
417
-            }
418
-            echo "</div> $after";
419
-        }
400
+			echo "$before <div class='Navi gd-navi'>";
401
+			if ($paged >= ($pages_to_show - 1)) {
402
+				echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link()) . '">&laquo;</a>';
403
+			}
404
+			previous_posts_link($prelabel);
405
+			for ($i = $paged - $half_pages_to_show; $i <= $paged + $half_pages_to_show; $i++) {
406
+				if ($i >= 1 && $i <= $max_page) {
407
+					if ($i == $paged) {
408
+						echo "<strong class='on'>$i</strong>";
409
+					} else {
410
+						echo ' <a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($i)) . '">' . $i . '</a> ';
411
+					}
412
+				}
413
+			}
414
+			next_posts_link($nxtlabel, $max_page);
415
+			if (($paged + $half_pages_to_show) < ($max_page)) {
416
+				echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($max_page)) . '">&raquo;</a>';
417
+			}
418
+			echo "</div> $after";
419
+		}
420 420
         
421
-        if (function_exists('geodir_location_geo_home_link')) {
422
-            add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2);
423
-        }
424
-    }
421
+		if (function_exists('geodir_location_geo_home_link')) {
422
+			add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2);
423
+		}
424
+	}
425 425
 }
426 426
 
427 427
 /**
@@ -432,20 +432,20 @@  discard block
 block discarded – undo
432 432
  */
433 433
 function geodir_listingsearch_scripts()
434 434
 {
435
-    if (get_option('gd_search_dist') != '') {
436
-        $dist = get_option('gd_search_dist');
437
-    } else {
438
-        $dist = 500;
439
-    }
440
-    $dist_dif = 1000;
441
-
442
-    if ($dist <= 5000) $dist_dif = 500;
443
-    if ($dist <= 1000) $dist_dif = 100;
444
-    if ($dist <= 500) $dist_dif = 50;
445
-    if ($dist <= 100) $dist_dif = 10;
446
-    if ($dist <= 50) $dist_dif = 5;
447
-
448
-    ?>
435
+	if (get_option('gd_search_dist') != '') {
436
+		$dist = get_option('gd_search_dist');
437
+	} else {
438
+		$dist = 500;
439
+	}
440
+	$dist_dif = 1000;
441
+
442
+	if ($dist <= 5000) $dist_dif = 500;
443
+	if ($dist <= 1000) $dist_dif = 100;
444
+	if ($dist <= 500) $dist_dif = 50;
445
+	if ($dist <= 100) $dist_dif = 10;
446
+	if ($dist <= 50) $dist_dif = 5;
447
+
448
+	?>
449 449
     <script type="text/javascript">
450 450
 
451 451
         jQuery(function ($) {
@@ -504,15 +504,15 @@  discard block
 block discarded – undo
504 504
 function geodir_add_sharelocation_scripts()
505 505
 {
506 506
 
507
-    $default_search_for_text = SEARCH_FOR_TEXT;
508
-    if (get_option('geodir_search_field_default_text'))
509
-        $default_search_for_text = __(get_option('geodir_search_field_default_text'), 'geodirectory');
507
+	$default_search_for_text = SEARCH_FOR_TEXT;
508
+	if (get_option('geodir_search_field_default_text'))
509
+		$default_search_for_text = __(get_option('geodir_search_field_default_text'), 'geodirectory');
510 510
 
511
-    $default_near_text = NEAR_TEXT;
512
-    if (get_option('geodir_near_field_default_text'))
513
-        $default_near_text = __(get_option('geodir_near_field_default_text'), 'geodirectory');
511
+	$default_near_text = NEAR_TEXT;
512
+	if (get_option('geodir_near_field_default_text'))
513
+		$default_near_text = __(get_option('geodir_near_field_default_text'), 'geodirectory');
514 514
 
515
-    ?>
515
+	?>
516 516
 
517 517
 
518 518
     <script type="text/javascript">
@@ -593,14 +593,14 @@  discard block
 block discarded – undo
593 593
                     initialise2();
594 594
                 } else {
595 595
                     <?php
596
-                    $near_add = get_option('geodir_search_near_addition');
597
-                    /**
598
-                     * Adds any extra info to the near search box query when trying to geolocate it via google api.
599
-                     *
600
-                     * @since 1.0.0
601
-                     */
602
-                    $near_add2 = apply_filters('geodir_search_near_addition', '');
603
-                    ?>
596
+					$near_add = get_option('geodir_search_near_addition');
597
+					/**
598
+					 * Adds any extra info to the near search box query when trying to geolocate it via google api.
599
+					 *
600
+					 * @since 1.0.0
601
+					 */
602
+					$near_add2 = apply_filters('geodir_search_near_addition', '');
603
+					?>
604 604
                     if (window.gdMaps === 'google') {
605 605
                         Sgeocoder.geocode({'address': address<?php echo ($near_add ? '+", ' . $near_add . '"' : '') . $near_add2;?>},
606 606
                             function (results, status) {
@@ -703,30 +703,30 @@  discard block
 block discarded – undo
703 703
  */
704 704
 function geodir_show_badges_on_image($which, $post, $link)
705 705
 {
706
-    $return = '';
707
-    switch ($which) {
708
-        case 'featured':
709
-            /**
710
-             * Filter the featured image badge html that appears in the listings pages over the thumbnail.
711
-             *
712
-             * @since 1.0.0
713
-             * @param object $post The post object.
714
-             * @param string $link The link to the post.
715
-             */
716
-            $return = apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img">&nbsp;</span></a>',$post,$link);
717
-            break;
718
-        case 'new' :
719
-            /**
720
-             * Filter the new image badge html that appears in the listings pages over the thumbnail.
721
-             *
722
-             * @since 1.0.0
723
-             * @param object $post The post object.
724
-             * @param string $link The link to the post.
725
-             */
726
-            $return = apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing">&nbsp;</span></a>',$post,$link);
727
-            break;
728
-
729
-    }
706
+	$return = '';
707
+	switch ($which) {
708
+		case 'featured':
709
+			/**
710
+			 * Filter the featured image badge html that appears in the listings pages over the thumbnail.
711
+			 *
712
+			 * @since 1.0.0
713
+			 * @param object $post The post object.
714
+			 * @param string $link The link to the post.
715
+			 */
716
+			$return = apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img">&nbsp;</span></a>',$post,$link);
717
+			break;
718
+		case 'new' :
719
+			/**
720
+			 * Filter the new image badge html that appears in the listings pages over the thumbnail.
721
+			 *
722
+			 * @since 1.0.0
723
+			 * @param object $post The post object.
724
+			 * @param string $link The link to the post.
725
+			 */
726
+			$return = apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing">&nbsp;</span></a>',$post,$link);
727
+			break;
728
+
729
+	}
730 730
     
731
-    return $return;
731
+	return $return;
732 732
 }
Please login to merge, or discard this patch.
Spacing   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -38,21 +38,21 @@  discard block
 block discarded – undo
38 38
     $is_detail_page = false;
39 39
     $geodir_map_name = geodir_map_name();
40 40
 
41
-    if((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview') )) {
41
+    if ((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview'))) {
42 42
         $is_detail_page = true;
43 43
     }
44 44
 
45 45
     wp_enqueue_script('jquery');
46 46
 
47
-    wp_register_script('geodirectory-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory.min.js#asyncload', array(), GEODIRECTORY_VERSION);
47
+    wp_register_script('geodirectory-script', geodir_plugin_url().'/geodirectory-assets/js/geodirectory.min.js#asyncload', array(), GEODIRECTORY_VERSION);
48 48
     wp_enqueue_script('geodirectory-script');
49 49
 
50 50
     $geodir_vars_data = array(
51 51
         'siteurl' => get_option('siteurl'),
52 52
         'geodir_plugin_url' => geodir_plugin_url(),
53
-        'geodir_lazy_load' => get_option('geodir_lazy_load',1),
53
+        'geodir_lazy_load' => get_option('geodir_lazy_load', 1),
54 54
         'geodir_ajax_url' => geodir_get_ajax_url(),
55
-        'geodir_gd_modal' => (int)get_option('geodir_disable_gb_modal'),
55
+        'geodir_gd_modal' => (int) get_option('geodir_disable_gb_modal'),
56 56
         'is_rtl' => is_rtl() ? 1 : 0 // fix rtl issue
57 57
     );
58 58
 
@@ -73,23 +73,23 @@  discard block
 block discarded – undo
73 73
      *
74 74
      * }
75 75
      */
76
-    $geodir_vars_data = apply_filters('geodir_vars_data',$geodir_vars_data);
76
+    $geodir_vars_data = apply_filters('geodir_vars_data', $geodir_vars_data);
77 77
 
78 78
     wp_localize_script('geodirectory-script', 'geodir_var', $geodir_vars_data);
79 79
 
80
-    wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION,true);
81
-    if($is_detail_page){wp_enqueue_script('geodirectory-jquery-flexslider-js');}
80
+    wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url().'/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION, true);
81
+    if ($is_detail_page) {wp_enqueue_script('geodirectory-jquery-flexslider-js'); }
82 82
 
83
-    wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url() . '/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION,true);
83
+    wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url().'/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION, true);
84 84
     wp_enqueue_script('geodirectory-lightbox-jquery');
85 85
 
86
-    wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url() . '/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION,true);
86
+    wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url().'/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION, true);
87 87
     if ($is_detail_page) {
88 88
         wp_enqueue_script('geodirectory-jquery-simplemodal');
89 89
     }
90 90
 
91 91
     if (in_array($geodir_map_name, array('auto', 'google'))) {
92
-        $map_lang = "&language=" . geodir_get_map_default_language();
92
+        $map_lang = "&language=".geodir_get_map_default_language();
93 93
         /**
94 94
          * Filter the variables that are added to the end of the google maps script call.
95 95
          *
@@ -99,40 +99,40 @@  discard block
 block discarded – undo
99 99
          * @param string $var The string to filter, default is empty string.
100 100
          */
101 101
         $map_extra = apply_filters('geodir_googlemap_script_extra', '');
102
-        wp_enqueue_script('geodirectory-googlemap-script', '//maps.google.com/maps/api/js?' . $map_lang . $map_extra, '', NULL);
102
+        wp_enqueue_script('geodirectory-googlemap-script', '//maps.google.com/maps/api/js?'.$map_lang.$map_extra, '', NULL);
103 103
     }
104 104
     
105 105
     if ($geodir_map_name == 'osm') {
106 106
         // Leaflet OpenStreetMap
107
-        wp_register_style('geodirectory-leaflet-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
107
+        wp_register_style('geodirectory-leaflet-style', geodir_plugin_url().'/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
108 108
         wp_enqueue_style('geodirectory-leaflet-style');
109 109
             
110
-        wp_register_script('geodirectory-leaflet-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION);
110
+        wp_register_script('geodirectory-leaflet-script', geodir_plugin_url().'/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION);
111 111
         wp_enqueue_script('geodirectory-leaflet-script');
112 112
         
113
-        wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/osm.geocode.js', array(), GEODIRECTORY_VERSION);
113
+        wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url().'/geodirectory-assets/leaflet/osm.geocode.js', array(), GEODIRECTORY_VERSION);
114 114
         wp_enqueue_script('geodirectory-leaflet-geo-script');
115 115
     }
116
-    wp_enqueue_script( 'jquery-ui-autocomplete' );
116
+    wp_enqueue_script('jquery-ui-autocomplete');
117 117
     
118
-    wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION,true);
118
+    wp_register_script('geodirectory-goMap-script', geodir_plugin_url().'/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION, true);
119 119
     wp_enqueue_script('geodirectory-goMap-script');
120 120
 
121 121
 
122
-    wp_register_script('chosen', geodir_plugin_url() . '/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
122
+    wp_register_script('chosen', geodir_plugin_url().'/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
123 123
     wp_enqueue_script('chosen');
124 124
 
125
-    wp_register_script('geodirectory-choose-ajax', geodir_plugin_url() . '/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION);
125
+    wp_register_script('geodirectory-choose-ajax', geodir_plugin_url().'/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION);
126 126
     wp_enqueue_script('geodirectory-choose-ajax');
127 127
 
128
-    wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.ui.timepicker.min.js#asyncload', array('jquery-ui-datepicker', 'jquery-ui-slider', 'jquery-effects-core', 'jquery-effects-slide'), '', true);
128
+    wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url().'/geodirectory-assets/js/jquery.ui.timepicker.min.js#asyncload', array('jquery-ui-datepicker', 'jquery-ui-slider', 'jquery-effects-core', 'jquery-effects-slide'), '', true);
129 129
 
130 130
     if (is_page() && geodir_is_page('add-listing')) {
131 131
         // SCRIPT FOR UPLOAD
132 132
         wp_enqueue_script('plupload-all');
133 133
         wp_enqueue_script('jquery-ui-sortable');
134 134
 
135
-        wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION,true);
135
+        wp_register_script('geodirectory-plupload-script', geodir_plugin_url().'/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
136 136
         wp_enqueue_script('geodirectory-plupload-script');
137 137
         // SCRIPT FOR UPLOAD END
138 138
 
@@ -179,27 +179,27 @@  discard block
 block discarded – undo
179 179
 
180 180
         wp_localize_script('geodirectory-plupload-script', 'gd_plupload', $gd_plupload_init);
181 181
 
182
-        wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url() . '/geodirectory-assets/js/listing_validation.min.js#asyncload');
182
+        wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url().'/geodirectory-assets/js/listing_validation.min.js#asyncload');
183 183
     } // End if for add place page
184 184
 
185
-    wp_register_script('geodirectory-post-custom-js', geodir_plugin_url() . '/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
185
+    wp_register_script('geodirectory-post-custom-js', geodir_plugin_url().'/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
186 186
     if ($is_detail_page) {
187 187
 		wp_enqueue_script('geodirectory-post-custom-js');
188 188
 	}
189 189
 
190 190
     // font awesome rating script
191 191
 	if (get_option('geodir_reviewrating_enable_font_awesome')) {
192
-		wp_register_script('geodir-barrating-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION, true);
192
+		wp_register_script('geodir-barrating-js', geodir_plugin_url().'/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION, true);
193 193
 		wp_enqueue_script('geodir-barrating-js');
194 194
 	} else { // default rating script
195
-		wp_register_script('geodir-jRating-js', geodir_plugin_url() . '/geodirectory-assets/js/jRating.jquery.min.js', array(), GEODIRECTORY_VERSION, true);
195
+		wp_register_script('geodir-jRating-js', geodir_plugin_url().'/geodirectory-assets/js/jRating.jquery.min.js', array(), GEODIRECTORY_VERSION, true);
196 196
 		wp_enqueue_script('geodir-jRating-js');
197 197
 	}
198 198
 
199
-    wp_register_script('geodir-on-document-load', geodir_plugin_url() . '/geodirectory-assets/js/on_document_load.js#asyncload', array(), GEODIRECTORY_VERSION, true);
199
+    wp_register_script('geodir-on-document-load', geodir_plugin_url().'/geodirectory-assets/js/on_document_load.js#asyncload', array(), GEODIRECTORY_VERSION, true);
200 200
     wp_enqueue_script('geodir-on-document-load');
201 201
 
202
-    wp_register_script('google-geometa', geodir_plugin_url() . '/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
202
+    wp_register_script('google-geometa', geodir_plugin_url().'/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
203 203
     wp_enqueue_script('google-geometa');
204 204
 }
205 205
 
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
  */
215 215
 function geodir_header_scripts()
216 216
 {
217
-    echo '<style>' . stripslashes(get_option('geodir_coustem_css')) . '</style>';
217
+    echo '<style>'.stripslashes(get_option('geodir_coustem_css')).'</style>';
218 218
     echo stripslashes(get_option('geodir_header_scripts'));
219 219
 }
220 220
 
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
  */
246 246
 function geodir_add_async_forscript($url)
247 247
 {
248
-    if (strpos($url, '#asyncload')===false)
248
+    if (strpos($url, '#asyncload') === false)
249 249
         return $url;
250 250
     else if (is_admin())
251 251
         return str_replace('#asyncload', '', $url);
@@ -263,12 +263,12 @@  discard block
 block discarded – undo
263 263
 function geodir_templates_styles()
264 264
 {
265 265
 
266
-    wp_register_style('geodir-core-scss', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
266
+    wp_register_style('geodir-core-scss', geodir_plugin_url().'/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
267 267
     wp_enqueue_style('geodir-core-scss');
268
-    wp_register_style('geodir-core-scss-footer', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION);
268
+    wp_register_style('geodir-core-scss-footer', geodir_plugin_url().'/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION);
269 269
 
270
-    if(is_rtl()){
271
-    wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url() . '/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION);
270
+    if (is_rtl()) {
271
+    wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url().'/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION);
272 272
     wp_enqueue_style('geodirectory-frontend-rtl-style');
273 273
     }
274 274
 
@@ -342,18 +342,18 @@  discard block
 block discarded – undo
342 342
                 $term_id = get_queried_object_id();
343 343
                 $taxonomy = get_query_var('taxonomy');
344 344
 
345
-                if ($term_id && $post_type && get_query_var('taxonomy') == $post_type . 'category' ) {
346
-                    $term = get_term($term_id, $post_type . 'category');
345
+                if ($term_id && $post_type && get_query_var('taxonomy') == $post_type.'category') {
346
+                    $term = get_term($term_id, $post_type.'category');
347 347
                 }
348 348
             }
349 349
             
350
-            if (geodir_is_page('search') && !empty($_REQUEST['s' . $post_type . 'category'])) {
351
-                $taxonomy_search = $_REQUEST['s' . $post_type . 'category'];
350
+            if (geodir_is_page('search') && !empty($_REQUEST['s'.$post_type.'category'])) {
351
+                $taxonomy_search = $_REQUEST['s'.$post_type.'category'];
352 352
                 
353 353
                 if (!is_array($taxonomy_search)) {
354
-                    $term = get_term((int)$taxonomy_search, $post_type . 'category');
355
-                } else if(is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search
356
-                    $term = get_term((int)$taxonomy_search[0], $post_type . 'category');
354
+                    $term = get_term((int) $taxonomy_search, $post_type.'category');
355
+                } else if (is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search
356
+                    $term = get_term((int) $taxonomy_search[0], $post_type.'category');
357 357
                 }
358 358
             }
359 359
             
@@ -365,7 +365,7 @@  discard block
 block discarded – undo
365 365
         if ($max_page > 1 || $always_show) {            
366 366
             // Extra pagination info
367 367
             $geodir_pagination_more_info = get_option('geodir_pagination_advance_info');
368
-            $start_no = ( $paged - 1 ) * $posts_per_page + 1;
368
+            $start_no = ($paged - 1) * $posts_per_page + 1;
369 369
             $end_no = min($paged * $posts_per_page, $numposts);
370 370
 
371 371
             if ($geodir_pagination_more_info != '') {
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
                 } else {
376 376
                     $pegination_desc = wp_sprintf(__('Showing listings %d-%d of %d', 'geodirectory'), $start_no, $end_no, $numposts);
377 377
                 }
378
-                $pagination_info = '<div class="gd-pagination-details">' . $pegination_desc . '</div>';
378
+                $pagination_info = '<div class="gd-pagination-details">'.$pegination_desc.'</div>';
379 379
                 /**
380 380
                  * Adds an extra pagination info above/under pagination.
381 381
                  *
@@ -391,15 +391,15 @@  discard block
 block discarded – undo
391 391
                 $pagination_info = apply_filters('geodir_pagination_advance_info', $pagination_info, $listing_type_name, $start_no, $end_no, $numposts, $post_type);
392 392
                 
393 393
                 if ($geodir_pagination_more_info == 'before') {
394
-                    $before = $before . $pagination_info;
394
+                    $before = $before.$pagination_info;
395 395
                 } else if ($geodir_pagination_more_info == 'after') {
396
-                    $after = $pagination_info . $after;
396
+                    $after = $pagination_info.$after;
397 397
                 }
398 398
             }
399 399
             
400 400
             echo "$before <div class='Navi gd-navi'>";
401 401
             if ($paged >= ($pages_to_show - 1)) {
402
-                echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link()) . '">&laquo;</a>';
402
+                echo '<a href="'.str_replace('&paged', '&amp;paged', get_pagenum_link()).'">&laquo;</a>';
403 403
             }
404 404
             previous_posts_link($prelabel);
405 405
             for ($i = $paged - $half_pages_to_show; $i <= $paged + $half_pages_to_show; $i++) {
@@ -407,13 +407,13 @@  discard block
 block discarded – undo
407 407
                     if ($i == $paged) {
408 408
                         echo "<strong class='on'>$i</strong>";
409 409
                     } else {
410
-                        echo ' <a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($i)) . '">' . $i . '</a> ';
410
+                        echo ' <a href="'.str_replace('&paged', '&amp;paged', get_pagenum_link($i)).'">'.$i.'</a> ';
411 411
                     }
412 412
                 }
413 413
             }
414 414
             next_posts_link($nxtlabel, $max_page);
415 415
             if (($paged + $half_pages_to_show) < ($max_page)) {
416
-                echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($max_page)) . '">&raquo;</a>';
416
+                echo '<a href="'.str_replace('&paged', '&amp;paged', get_pagenum_link($max_page)).'">&raquo;</a>';
417 417
             }
418 418
             echo "</div> $after";
419 419
         }
@@ -451,7 +451,7 @@  discard block
 block discarded – undo
451 451
         jQuery(function ($) {
452 452
             $("#distance_slider").slider({
453 453
                 range: true,
454
-                values: [0, <?php echo ($_REQUEST['sdist']!='') ? sanitize_text_field($_REQUEST['sdist']) : "0"; ?>],
454
+                values: [0, <?php echo ($_REQUEST['sdist'] != '') ? sanitize_text_field($_REQUEST['sdist']) : "0"; ?>],
455 455
                 min: 0,
456 456
                 max: <?php echo $dist; ?>,
457 457
                 step: <?php echo $dist_dif; ?>,
@@ -516,7 +516,7 @@  discard block
 block discarded – undo
516 516
 
517 517
 
518 518
     <script type="text/javascript">
519
-        var default_location = '<?php if($search_location = geodir_get_default_location())  echo $search_location->city ;?>';
519
+        var default_location = '<?php if ($search_location = geodir_get_default_location())  echo $search_location->city; ?>';
520 520
         var latlng;
521 521
         var address;
522 522
         var dist = 0;
@@ -529,7 +529,7 @@  discard block
 block discarded – undo
529 529
 				var $form = jQuery(this).closest('form');
530 530
 				
531 531
 				if (jQuery("#sdist input[type='radio']:checked").length != 0) dist = jQuery("#sdist input[type='radio']:checked").val();
532
-				if (jQuery('.search_text', $form).val() == '' || jQuery('.search_text', $form).val() == '<?php echo $default_search_for_text;?>') jQuery('.search_text', $form).val(s);
532
+				if (jQuery('.search_text', $form).val() == '' || jQuery('.search_text', $form).val() == '<?php echo $default_search_for_text; ?>') jQuery('.search_text', $form).val(s);
533 533
 				
534 534
 				// Disable location based search for disabled location post type.
535 535
 				if (jQuery('.search_by_post', $form).val() != '' && typeof gd_cpt_no_location == 'function') {
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
 					}
544 544
 				}
545 545
 				
546
-				if (dist > 0 || (jQuery('select[name="sort_by"]').val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest') || (jQuery(".snear", $form).val() != '' && jQuery(".snear", $form).val() != '<?php echo $default_near_text;?>')) {
546
+				if (dist > 0 || (jQuery('select[name="sort_by"]').val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest') || (jQuery(".snear", $form).val() != '' && jQuery(".snear", $form).val() != '<?php echo $default_near_text; ?>')) {
547 547
 					geodir_setsearch($form);
548 548
 				} else {
549 549
 					jQuery(".snear", $form).val('');
@@ -562,7 +562,7 @@  discard block
 block discarded – undo
562 562
         });
563 563
         
564 564
 		function geodir_setsearch($form) {
565
-			if ((dist > 0 || (jQuery('select[name="sort_by"]', $form).val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest')) && (jQuery(".snear", $form).val() == '' || jQuery(".snear", $form).val() == '<?php echo $default_near_text;?>')) jQuery(".snear", $form).val(default_location);
565
+			if ((dist > 0 || (jQuery('select[name="sort_by"]', $form).val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest')) && (jQuery(".snear", $form).val() == '' || jQuery(".snear", $form).val() == '<?php echo $default_near_text; ?>')) jQuery(".snear", $form).val(default_location);
566 566
 			geocodeAddress($form);
567 567
 		}
568 568
 
@@ -581,15 +581,15 @@  discard block
 block discarded – undo
581 581
             // Call the geocode function
582 582
             Sgeocoder = window.gdMaps == 'google' ? new google.maps.Geocoder() : null;
583 583
 
584
-            if (jQuery('.snear', $form).val() == '' || ( jQuery('.sgeo_lat').val() != '' && jQuery('.sgeo_lon').val() != ''  ) || jQuery('.snear', $form).val().match("^<?php _e('In:','geodirectory');?>")) {
585
-                if (jQuery('.snear', $form).val().match("^<?php _e('In:','geodirectory');?>")) {
584
+            if (jQuery('.snear', $form).val() == '' || ( jQuery('.sgeo_lat').val() != '' && jQuery('.sgeo_lon').val() != ''  ) || jQuery('.snear', $form).val().match("^<?php _e('In:', 'geodirectory'); ?>")) {
585
+                if (jQuery('.snear', $form).val().match("^<?php _e('In:', 'geodirectory'); ?>")) {
586 586
                     jQuery(".snear", $form).val('');
587 587
                 }
588 588
                 jQuery($form).submit();
589 589
             } else {
590 590
                 var address = jQuery(".snear", $form).val();
591 591
 
592
-                if (jQuery('.snear', $form).val() == '<?php echo $default_near_text;?>') {
592
+                if (jQuery('.snear', $form).val() == '<?php echo $default_near_text; ?>') {
593 593
                     initialise2();
594 594
                 } else {
595 595
                     <?php
@@ -602,12 +602,12 @@  discard block
 block discarded – undo
602 602
                     $near_add2 = apply_filters('geodir_search_near_addition', '');
603 603
                     ?>
604 604
                     if (window.gdMaps === 'google') {
605
-                        Sgeocoder.geocode({'address': address<?php echo ($near_add ? '+", ' . $near_add . '"' : '') . $near_add2;?>},
605
+                        Sgeocoder.geocode({'address': address<?php echo ($near_add ? '+", '.$near_add.'"' : '').$near_add2; ?>},
606 606
                             function (results, status) {
607 607
                                 if (status == google.maps.GeocoderStatus.OK) {
608 608
                                     updateSearchPosition(results[0].geometry.location, $form);
609 609
                                 } else {
610
-                                    alert("<?php esc_attr_e('Search was not successful for the following reason:', 'geodirectory');?>" + status);
610
+                                    alert("<?php esc_attr_e('Search was not successful for the following reason:', 'geodirectory'); ?>" + status);
611 611
                                 }
612 612
                             });
613 613
                     } else if (window.gdMaps === 'osm') {
@@ -616,7 +616,7 @@  discard block
 block discarded – undo
616 616
                                 if (typeof geo !== 'undefined' && geo.lat && geo.lon) {
617 617
                                     updateSearchPosition(geo, $form);
618 618
                                 } else {
619
-                                    alert("<?php esc_attr_e('Search was not successful for the requested address.', 'geodirectory');?>");
619
+                                    alert("<?php esc_attr_e('Search was not successful for the requested address.', 'geodirectory'); ?>");
620 620
                                 }
621 621
                             });
622 622
                     } else {
@@ -662,19 +662,19 @@  discard block
 block discarded – undo
662 662
             var msg;
663 663
             switch (err.code) {
664 664
                 case err.UNKNOWN_ERROR:
665
-                    msg = "<?php _e('Unable to find your location','geodirectory');?>";
665
+                    msg = "<?php _e('Unable to find your location', 'geodirectory'); ?>";
666 666
                     break;
667 667
                 case err.PERMISSION_DENINED:
668
-                    msg = "<?php _e('Permission denied in finding your location','geodirectory');?>";
668
+                    msg = "<?php _e('Permission denied in finding your location', 'geodirectory'); ?>";
669 669
                     break;
670 670
                 case err.POSITION_UNAVAILABLE:
671
-                    msg = "<?php _e('Your location is currently unknown','geodirectory');?>";
671
+                    msg = "<?php _e('Your location is currently unknown', 'geodirectory'); ?>";
672 672
                     break;
673 673
                 case err.BREAK:
674
-                    msg = "<?php _e('Attempt to find location took too long','geodirectory');?>";
674
+                    msg = "<?php _e('Attempt to find location took too long', 'geodirectory'); ?>";
675 675
                     break;
676 676
                 default:
677
-                    msg = "<?php _e('Location detection not supported in browser','geodirectory');?>";
677
+                    msg = "<?php _e('Location detection not supported in browser', 'geodirectory'); ?>";
678 678
             }
679 679
             jQuery('#info').html(msg);
680 680
         }
@@ -713,7 +713,7 @@  discard block
 block discarded – undo
713 713
              * @param object $post The post object.
714 714
              * @param string $link The link to the post.
715 715
              */
716
-            $return = apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img">&nbsp;</span></a>',$post,$link);
716
+            $return = apply_filters('geodir_featured_badge_on_image', '<a href="'.$link.'"><span class="geodir_featured_img">&nbsp;</span></a>', $post, $link);
717 717
             break;
718 718
         case 'new' :
719 719
             /**
@@ -723,7 +723,7 @@  discard block
 block discarded – undo
723 723
              * @param object $post The post object.
724 724
              * @param string $link The link to the post.
725 725
              */
726
-            $return = apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing">&nbsp;</span></a>',$post,$link);
726
+            $return = apply_filters('geodir_new_badge_on_image', '<a href="'.$link.'"><span class="geodir_new_listing">&nbsp;</span></a>', $post, $link);
727 727
             break;
728 728
 
729 729
     }
Please login to merge, or discard this patch.
Braces   +37 added lines, -19 removed lines patch added patch discarded remove patch
@@ -245,13 +245,14 @@  discard block
 block discarded – undo
245 245
  */
246 246
 function geodir_add_async_forscript($url)
247 247
 {
248
-    if (strpos($url, '#asyncload')===false)
249
-        return $url;
250
-    else if (is_admin())
251
-        return str_replace('#asyncload', '', $url);
252
-    else
253
-        return str_replace('#asyncload', '', $url)."' async='async";
254
-}
248
+    if (strpos($url, '#asyncload')===false) {
249
+            return $url;
250
+    } else if (is_admin()) {
251
+            return str_replace('#asyncload', '', $url);
252
+    } else {
253
+            return str_replace('#asyncload', '', $url)."' async='async";
254
+    }
255
+    }
255 256
 add_filter('clean_url', 'geodir_add_async_forscript', 11, 1);
256 257
 
257 258
 /**
@@ -318,8 +319,10 @@  discard block
 block discarded – undo
318 319
 
319 320
     $half_pages_to_show = round($pages_to_show / 2);
320 321
 
321
-    if (geodir_is_page('home') || (get_option('geodir_set_as_home') && is_home())) // dont apply default  pagination for geodirectory home page.
322
-        return;
322
+    if (geodir_is_page('home') || (get_option('geodir_set_as_home') && is_home())) {
323
+    	// dont apply default  pagination for geodirectory home page.
324
+        return;
325
+    }
323 326
 
324 327
     if (!is_single()) {
325 328
         if (function_exists('geodir_location_geo_home_link')) {
@@ -439,11 +442,21 @@  discard block
 block discarded – undo
439 442
     }
440 443
     $dist_dif = 1000;
441 444
 
442
-    if ($dist <= 5000) $dist_dif = 500;
443
-    if ($dist <= 1000) $dist_dif = 100;
444
-    if ($dist <= 500) $dist_dif = 50;
445
-    if ($dist <= 100) $dist_dif = 10;
446
-    if ($dist <= 50) $dist_dif = 5;
445
+    if ($dist <= 5000) {
446
+    	$dist_dif = 500;
447
+    }
448
+    if ($dist <= 1000) {
449
+    	$dist_dif = 100;
450
+    }
451
+    if ($dist <= 500) {
452
+    	$dist_dif = 50;
453
+    }
454
+    if ($dist <= 100) {
455
+    	$dist_dif = 10;
456
+    }
457
+    if ($dist <= 50) {
458
+    	$dist_dif = 5;
459
+    }
447 460
 
448 461
     ?>
449 462
     <script type="text/javascript">
@@ -505,18 +518,23 @@  discard block
 block discarded – undo
505 518
 {
506 519
 
507 520
     $default_search_for_text = SEARCH_FOR_TEXT;
508
-    if (get_option('geodir_search_field_default_text'))
509
-        $default_search_for_text = __(get_option('geodir_search_field_default_text'), 'geodirectory');
521
+    if (get_option('geodir_search_field_default_text')) {
522
+            $default_search_for_text = __(get_option('geodir_search_field_default_text'), 'geodirectory');
523
+    }
510 524
 
511 525
     $default_near_text = NEAR_TEXT;
512
-    if (get_option('geodir_near_field_default_text'))
513
-        $default_near_text = __(get_option('geodir_near_field_default_text'), 'geodirectory');
526
+    if (get_option('geodir_near_field_default_text')) {
527
+            $default_near_text = __(get_option('geodir_near_field_default_text'), 'geodirectory');
528
+    }
514 529
 
515 530
     ?>
516 531
 
517 532
 
518 533
     <script type="text/javascript">
519
-        var default_location = '<?php if($search_location = geodir_get_default_location())  echo $search_location->city ;?>';
534
+        var default_location = '<?php if($search_location = geodir_get_default_location()) {
535
+	echo $search_location->city ;
536
+}
537
+?>';
520 538
         var latlng;
521 539
         var address;
522 540
         var dist = 0;
Please login to merge, or discard this patch.