Test Failed
Pull Request — master (#291)
by
unknown
08:28
created
geodirectory-admin/place_dummy_post.php 3 patches
Indentation   +1220 added lines, -1220 removed lines patch added patch discarded remove patch
@@ -12,32 +12,32 @@  discard block
 block discarded – undo
12 12
 $post_meta = array();
13 13
 
14 14
 if (geodir_dummy_folder_exists())
15
-    $dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy";
15
+	$dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy";
16 16
 else
17
-    $dummy_image_url = 'http://www.wpgeodirectory.com/dummy';
17
+	$dummy_image_url = 'http://www.wpgeodirectory.com/dummy';
18 18
 
19 19
 $dummy_image_url = apply_filters('place_dummy_image_url', $dummy_image_url);
20 20
 
21 21
 switch ($dummy_post_index) {
22 22
 
23
-    case(1):
24
-        $image_array[] = "$dummy_image_url/a1.jpg";
25
-        $image_array[] = "$dummy_image_url/a2.jpg";
26
-        $image_array[] = "$dummy_image_url/a3.jpg";
27
-        $image_array[] = "$dummy_image_url/a4.jpg";
28
-        $image_array[] = "$dummy_image_url/a5.jpg";
29
-        $image_array[] = "$dummy_image_url/a6.jpg";
30
-        $image_array[] = "$dummy_image_url/a7.jpg";
31
-        $image_array[] = "$dummy_image_url/a8.jpg";
32
-        $image_array[] = "$dummy_image_url/a9.jpg";
33
-        $image_array[] = "$dummy_image_url/a10.jpg";
34
-        $image_array[] = "$dummy_image_url/a11.jpg";
35
-
36
-
37
-        $post_info[] = array(
38
-            "listing_type" => 'gd_place',
39
-            "post_title" => 'Franklin Square',
40
-            "post_desc" => ' <h3> Location </h3>
23
+	case(1):
24
+		$image_array[] = "$dummy_image_url/a1.jpg";
25
+		$image_array[] = "$dummy_image_url/a2.jpg";
26
+		$image_array[] = "$dummy_image_url/a3.jpg";
27
+		$image_array[] = "$dummy_image_url/a4.jpg";
28
+		$image_array[] = "$dummy_image_url/a5.jpg";
29
+		$image_array[] = "$dummy_image_url/a6.jpg";
30
+		$image_array[] = "$dummy_image_url/a7.jpg";
31
+		$image_array[] = "$dummy_image_url/a8.jpg";
32
+		$image_array[] = "$dummy_image_url/a9.jpg";
33
+		$image_array[] = "$dummy_image_url/a10.jpg";
34
+		$image_array[] = "$dummy_image_url/a11.jpg";
35
+
36
+
37
+		$post_info[] = array(
38
+			"listing_type" => 'gd_place',
39
+			"post_title" => 'Franklin Square',
40
+			"post_desc" => ' <h3> Location </h3>
41 41
 		
42 42
 		6th and Race Streets in Historic Philadelphia
43 43
 		<h3>The Experience</h3>
@@ -72,42 +72,42 @@  discard block
 block discarded – undo
72 72
 		Just in time for summer, Franklin Square has opened SquareBurger, a Stephen Starr-run “burger shack” selling summer staples: hot dogs, fries, milkshakes (made with Tasty Kakes) and, of course, hamburgers and cheeseburgers.
73 73
 		
74 74
 		SquareBurger is open until October - perfect for a couple bites between rounds of miniature golf!',
75
-            "post_images" => $image_array,
76
-            "post_category" => array('gd_placecategory' => array('Attractions', 'Feature')),
77
-            "post_tags" => array('Tags', 'Sample Tags'),
78
-            "geodir_video" => '',
79
-            "geodir_timing" => 'Open today until 1 p.m., Sunday 10 am to 9 pm',
80
-            "geodir_contact" => '(111) 677-4444',
81
-            "geodir_email" => '[email protected]',
82
-            "geodir_website" => 'http://franklinsquare.com',
83
-            "geodir_twitter" => 'http://twitter.com/franklinsquare',
84
-            "geodir_facebook" => 'http://facebook.com/franklinsquare',
85
-            "post_dummy" => '1'
86
-        );
87
-
88
-
89
-        break;
90
-    case 2:
91
-        $image_array = array();
92
-        $post_meta = array();
93
-
94
-        /// Attractions ////post start 2///
95
-        $image_array[] = "$dummy_image_url/a6.jpg";
96
-        $image_array[] = "$dummy_image_url/a1.jpg";
97
-        $image_array[] = "$dummy_image_url/a3.jpg";
98
-        $image_array[] = "$dummy_image_url/a4.jpg";
99
-        $image_array[] = "$dummy_image_url/a5.jpg";
100
-        $image_array[] = "$dummy_image_url/a2.jpg";
101
-        $image_array[] = "$dummy_image_url/a7.jpg";
102
-        $image_array[] = "$dummy_image_url/a8.jpg";
103
-        $image_array[] = "$dummy_image_url/a9.jpg";
104
-        $image_array[] = "$dummy_image_url/a10.jpg";
105
-        $image_array[] = "$dummy_image_url/a11.jpg";
106
-
107
-        $post_info[] = array(
108
-            "listing_type" => 'gd_place',
109
-            "post_title" => 'Please Touch Museum',
110
-            "post_desc" => '<h3>New Location! </h3>
75
+			"post_images" => $image_array,
76
+			"post_category" => array('gd_placecategory' => array('Attractions', 'Feature')),
77
+			"post_tags" => array('Tags', 'Sample Tags'),
78
+			"geodir_video" => '',
79
+			"geodir_timing" => 'Open today until 1 p.m., Sunday 10 am to 9 pm',
80
+			"geodir_contact" => '(111) 677-4444',
81
+			"geodir_email" => '[email protected]',
82
+			"geodir_website" => 'http://franklinsquare.com',
83
+			"geodir_twitter" => 'http://twitter.com/franklinsquare',
84
+			"geodir_facebook" => 'http://facebook.com/franklinsquare',
85
+			"post_dummy" => '1'
86
+		);
87
+
88
+
89
+		break;
90
+	case 2:
91
+		$image_array = array();
92
+		$post_meta = array();
93
+
94
+		/// Attractions ////post start 2///
95
+		$image_array[] = "$dummy_image_url/a6.jpg";
96
+		$image_array[] = "$dummy_image_url/a1.jpg";
97
+		$image_array[] = "$dummy_image_url/a3.jpg";
98
+		$image_array[] = "$dummy_image_url/a4.jpg";
99
+		$image_array[] = "$dummy_image_url/a5.jpg";
100
+		$image_array[] = "$dummy_image_url/a2.jpg";
101
+		$image_array[] = "$dummy_image_url/a7.jpg";
102
+		$image_array[] = "$dummy_image_url/a8.jpg";
103
+		$image_array[] = "$dummy_image_url/a9.jpg";
104
+		$image_array[] = "$dummy_image_url/a10.jpg";
105
+		$image_array[] = "$dummy_image_url/a11.jpg";
106
+
107
+		$post_info[] = array(
108
+			"listing_type" => 'gd_place',
109
+			"post_title" => 'Please Touch Museum',
110
+			"post_desc" => '<h3>New Location! </h3>
111 111
 		
112 112
 		Who doesn&acute;t love the Please Touch Museum? And now, taking kids to the Museum is better than ever. The nation&acute;s premier children&acute;s museum - which has been a beloved landmark since it opened in 1976 - has a new home in Fairmount Park, opening its doors to a world of educational, hands-on fun.
113 113
 		
@@ -139,42 +139,42 @@  discard block
 block discarded – undo
139 139
 		
140 140
 		You can buy admission tickets to the Please Touch Museum online through our partners at the Independence Visitor Center. Just click the button below.',
141 141
 
142
-            "post_images" => $image_array,
143
-            "post_category" => array('gd_placecategory' => array('Attractions', 'Feature')),
144
-            "post_tags" => array('Tags', 'Sample Tags'),
145
-            "geodir_video" => '',
146
-            "geodir_timing" => 'Open today until 1 p.m., Sunday 10 am to 9 pm',
147
-            "geodir_contact" => '(222) 777-1111',
148
-            "geodir_email" => '[email protected]',
149
-            "geodir_website" => 'http://pleasetouchmuseum.com',
150
-            "geodir_twitter" => 'http://twitter.com/pleasetouchmuseum',
151
-            "geodir_facebook" => 'http://facebook.com/pleasetouchmuseum',
152
-            "post_dummy" => '1'
153
-        );
154
-
155
-        break;
156
-    case 3:
157
-        $image_array = array();
158
-        $post_meta = array();
159
-
160
-        ////post end///
161
-        /// Attractions ////post start 3///
162
-        $image_array[] = "$dummy_image_url/a9.jpg";
163
-        $image_array[] = "$dummy_image_url/a10.jpg";
164
-        $image_array[] = "$dummy_image_url/a3.jpg";
165
-        $image_array[] = "$dummy_image_url/a4.jpg";
166
-        $image_array[] = "$dummy_image_url/a5.jpg";
167
-        $image_array[] = "$dummy_image_url/a2.jpg";
168
-        $image_array[] = "$dummy_image_url/a7.jpg";
169
-        $image_array[] = "$dummy_image_url/a8.jpg";
170
-        $image_array[] = "$dummy_image_url/a6.jpg";
171
-        $image_array[] = "$dummy_image_url/a1.jpg";
172
-        $image_array[] = "$dummy_image_url/a11.jpg";
173
-
174
-        $post_info[] = array(
175
-            "listing_type" => 'gd_place',
176
-            "post_title" => 'Longwood Gardens',
177
-            "post_desc" => '<h3>The Experience </h3>
142
+			"post_images" => $image_array,
143
+			"post_category" => array('gd_placecategory' => array('Attractions', 'Feature')),
144
+			"post_tags" => array('Tags', 'Sample Tags'),
145
+			"geodir_video" => '',
146
+			"geodir_timing" => 'Open today until 1 p.m., Sunday 10 am to 9 pm',
147
+			"geodir_contact" => '(222) 777-1111',
148
+			"geodir_email" => '[email protected]',
149
+			"geodir_website" => 'http://pleasetouchmuseum.com',
150
+			"geodir_twitter" => 'http://twitter.com/pleasetouchmuseum',
151
+			"geodir_facebook" => 'http://facebook.com/pleasetouchmuseum',
152
+			"post_dummy" => '1'
153
+		);
154
+
155
+		break;
156
+	case 3:
157
+		$image_array = array();
158
+		$post_meta = array();
159
+
160
+		////post end///
161
+		/// Attractions ////post start 3///
162
+		$image_array[] = "$dummy_image_url/a9.jpg";
163
+		$image_array[] = "$dummy_image_url/a10.jpg";
164
+		$image_array[] = "$dummy_image_url/a3.jpg";
165
+		$image_array[] = "$dummy_image_url/a4.jpg";
166
+		$image_array[] = "$dummy_image_url/a5.jpg";
167
+		$image_array[] = "$dummy_image_url/a2.jpg";
168
+		$image_array[] = "$dummy_image_url/a7.jpg";
169
+		$image_array[] = "$dummy_image_url/a8.jpg";
170
+		$image_array[] = "$dummy_image_url/a6.jpg";
171
+		$image_array[] = "$dummy_image_url/a1.jpg";
172
+		$image_array[] = "$dummy_image_url/a11.jpg";
173
+
174
+		$post_info[] = array(
175
+			"listing_type" => 'gd_place',
176
+			"post_title" => 'Longwood Gardens',
177
+			"post_desc" => '<h3>The Experience </h3>
178 178
 		
179 179
 		When you&acute;re at Longwood Gardens, it&acute;s easy to imagine that you&acute;re at a giant, royal garden in Europe. Stroll along the many paths through acres of exquisitely maintained grounds featuring 11,000 different types of plants.
180 180
 		
@@ -199,42 +199,42 @@  discard block
 block discarded – undo
199 199
 		<h3>Buy Tickets Online In Advance </h3>
200 200
 		
201 201
 		You can buy admission tickets to Longwood Gardens online through our partners at the Independence Visitor Center. Just click the button below.',
202
-            "post_images" => $image_array,
203
-            "post_category" => array('gd_placecategory' => array('Attractions')),
204
-            "post_tags" => array('wood', 'garden'),
205
-            "geodir_video" => '',
206
-            "geodir_timing" => 'Open today until 1 p.m., Sunday 10 am to 9 pm',
207
-            "geodir_contact" => '(111) 888-1111',
208
-            "geodir_email" => '[email protected]',
209
-            "geodir_website" => 'http://longwoodgardens.com',
210
-            "geodir_twitter" => 'http://twitter.com/longwoodgardens',
211
-            "geodir_facebook" => 'http://facebook.com/longwoodgardens',
212
-            "post_dummy" => '1'
213
-        );
214
-        break;
215
-    ////post end///
216
-    /// Attractions ////post start 4///
217
-
218
-    case 4:
219
-
220
-        $image_array = array();
221
-        $post_meta = array();
222
-        $image_array[] = "$dummy_image_url/a11.jpg";
223
-        $image_array[] = "$dummy_image_url/a10.jpg";
224
-        $image_array[] = "$dummy_image_url/a3.jpg";
225
-        $image_array[] = "$dummy_image_url/a4.jpg";
226
-        $image_array[] = "$dummy_image_url/a5.jpg";
227
-        $image_array[] = "$dummy_image_url/a2.jpg";
228
-        $image_array[] = "$dummy_image_url/a7.jpg";
229
-        $image_array[] = "$dummy_image_url/a8.jpg";
230
-        $image_array[] = "$dummy_image_url/a6.jpg";
231
-        $image_array[] = "$dummy_image_url/a1.jpg";
232
-        $image_array[] = "$dummy_image_url/a9.jpg";
233
-
234
-        $post_info[] = array(
235
-            "listing_type" => 'gd_place',
236
-            "post_title" => 'The Philadelphia Zoo',
237
-            "post_desc" => '<h3>The Zoo 150th Birthday</h3>
202
+			"post_images" => $image_array,
203
+			"post_category" => array('gd_placecategory' => array('Attractions')),
204
+			"post_tags" => array('wood', 'garden'),
205
+			"geodir_video" => '',
206
+			"geodir_timing" => 'Open today until 1 p.m., Sunday 10 am to 9 pm',
207
+			"geodir_contact" => '(111) 888-1111',
208
+			"geodir_email" => '[email protected]',
209
+			"geodir_website" => 'http://longwoodgardens.com',
210
+			"geodir_twitter" => 'http://twitter.com/longwoodgardens',
211
+			"geodir_facebook" => 'http://facebook.com/longwoodgardens',
212
+			"post_dummy" => '1'
213
+		);
214
+		break;
215
+	////post end///
216
+	/// Attractions ////post start 4///
217
+
218
+	case 4:
219
+
220
+		$image_array = array();
221
+		$post_meta = array();
222
+		$image_array[] = "$dummy_image_url/a11.jpg";
223
+		$image_array[] = "$dummy_image_url/a10.jpg";
224
+		$image_array[] = "$dummy_image_url/a3.jpg";
225
+		$image_array[] = "$dummy_image_url/a4.jpg";
226
+		$image_array[] = "$dummy_image_url/a5.jpg";
227
+		$image_array[] = "$dummy_image_url/a2.jpg";
228
+		$image_array[] = "$dummy_image_url/a7.jpg";
229
+		$image_array[] = "$dummy_image_url/a8.jpg";
230
+		$image_array[] = "$dummy_image_url/a6.jpg";
231
+		$image_array[] = "$dummy_image_url/a1.jpg";
232
+		$image_array[] = "$dummy_image_url/a9.jpg";
233
+
234
+		$post_info[] = array(
235
+			"listing_type" => 'gd_place',
236
+			"post_title" => 'The Philadelphia Zoo',
237
+			"post_desc" => '<h3>The Zoo 150th Birthday</h3>
238 238
 		
239 239
 		The Philadelphia Zoo celebrated its 150th anniversary in 2009. So stop by and celebrate this major achievement at America&acute;s first zoo!
240 240
 		
@@ -269,45 +269,45 @@  discard block
 block discarded – undo
269 269
 		The nation&acute;s oldest zoo was chartered in 1859, but the impending Civil War delayed its opening until 1874. In addition to its animals, the zoo is known for its historic architecture, which includes the country home of William Penn&acute;s grandson; its botanical collections of over 500 plant species; its groundbreaking research and its fine veterinary facilities.
270 270
 		
271 271
 		The Primate Reserve, Carnivore Kingdom, and Rare Animal Conservation Center, with its tree kangaroos and blue-eyed lemurs, are brand new, but there&acute;s still fun to be had in the historic, old-style bird, pachyderm and carnivore houses. In the Treehouse, kids can investigate the world from an animal&acute;s perspective; outdoors, the Zoo Balloon lifts passengers 400 feet into the air for a bird&acute;s-eye view of the zoo.',
272
-            "post_images" => $image_array,
273
-            "post_category" => array('gd_placecategory' => array('Attractions')),
274
-            "post_tags" => array('wood', 'garden'),
275
-            "geodir_video" => '',
276
-            "geodir_timing" => 'Open today until 11.30 a.m., Sunday 11 am to 7 pm',
277
-            "geodir_contact" => '(211) 143-1900',
278
-            "geodir_email" => '[email protected]',
279
-            "geodir_website" => 'http://philadelphiazoo.com',
280
-            "geodir_twitter" => 'http://twitter.com/philadelphiazoo',
281
-            "geodir_facebook" => 'http://facebook.com/philadelphiazoo',
282
-            "post_dummy" => '1'
283
-        );
284
-
285
-        ////post end///
286
-        /// Attractions ////post start 4///
287
-        break;
288
-    case 5:
289
-
290
-
291
-        $image_array = array();
292
-        $post_meta = array();
293
-
294
-        /// Attractions ////post start 5///
295
-        $image_array[] = "$dummy_image_url/a12.jpg";
296
-        $image_array[] = "$dummy_image_url/a13.jpg";
297
-        $image_array[] = "$dummy_image_url/a3.jpg";
298
-        $image_array[] = "$dummy_image_url/a4.jpg";
299
-        $image_array[] = "$dummy_image_url/a5.jpg";
300
-        $image_array[] = "$dummy_image_url/a2.jpg";
301
-        $image_array[] = "$dummy_image_url/a7.jpg";
302
-        $image_array[] = "$dummy_image_url/a8.jpg";
303
-        $image_array[] = "$dummy_image_url/a6.jpg";
304
-        $image_array[] = "$dummy_image_url/a1.jpg";
305
-        $image_array[] = "$dummy_image_url/a9.jpg";
306
-
307
-        $post_info[] = array(
308
-            "listing_type" => 'gd_place',
309
-            "post_title" => 'National Constitution Center',
310
-            "post_desc" => '<h3>The Experience</h3>
272
+			"post_images" => $image_array,
273
+			"post_category" => array('gd_placecategory' => array('Attractions')),
274
+			"post_tags" => array('wood', 'garden'),
275
+			"geodir_video" => '',
276
+			"geodir_timing" => 'Open today until 11.30 a.m., Sunday 11 am to 7 pm',
277
+			"geodir_contact" => '(211) 143-1900',
278
+			"geodir_email" => '[email protected]',
279
+			"geodir_website" => 'http://philadelphiazoo.com',
280
+			"geodir_twitter" => 'http://twitter.com/philadelphiazoo',
281
+			"geodir_facebook" => 'http://facebook.com/philadelphiazoo',
282
+			"post_dummy" => '1'
283
+		);
284
+
285
+		////post end///
286
+		/// Attractions ////post start 4///
287
+		break;
288
+	case 5:
289
+
290
+
291
+		$image_array = array();
292
+		$post_meta = array();
293
+
294
+		/// Attractions ////post start 5///
295
+		$image_array[] = "$dummy_image_url/a12.jpg";
296
+		$image_array[] = "$dummy_image_url/a13.jpg";
297
+		$image_array[] = "$dummy_image_url/a3.jpg";
298
+		$image_array[] = "$dummy_image_url/a4.jpg";
299
+		$image_array[] = "$dummy_image_url/a5.jpg";
300
+		$image_array[] = "$dummy_image_url/a2.jpg";
301
+		$image_array[] = "$dummy_image_url/a7.jpg";
302
+		$image_array[] = "$dummy_image_url/a8.jpg";
303
+		$image_array[] = "$dummy_image_url/a6.jpg";
304
+		$image_array[] = "$dummy_image_url/a1.jpg";
305
+		$image_array[] = "$dummy_image_url/a9.jpg";
306
+
307
+		$post_info[] = array(
308
+			"listing_type" => 'gd_place',
309
+			"post_title" => 'National Constitution Center',
310
+			"post_desc" => '<h3>The Experience</h3>
311 311
 	
312 312
 	It only four pages long, but the U.S. Constitution is among the most influential and important documents in the history of the world.
313 313
 	
@@ -329,45 +329,45 @@  discard block
 block discarded – undo
329 329
 	<h3>Kids Stuff </h3>
330 330
 	
331 331
 	The Center frequently hosts special events with a focus on children that include informative and engaging hands-on activities. For specific information, check out the Center website.',
332
-            "post_images" => $image_array,
333
-            "post_category" => array('gd_placecategory' => array('Attractions', 'Feature')),
334
-            "post_tags" => array('Tag', 'Center'),
335
-            "geodir_video" => '',
336
-            "geodir_timing" => 'Open today until 9.30 a.m., Sunday 11 am to 7 pm',
337
-            "geodir_contact" => '(111) 111-1111',
338
-            "geodir_email" => '[email protected]',
339
-            "geodir_website" => 'http://ncc.com',
340
-            "geodir_twitter" => 'http://twitter.com/ncc',
341
-            "geodir_facebook" => 'http://facebook.com/ncc',
342
-            "post_dummy" => '1'
343
-        );
344
-
345
-        ////post end///
346
-        /// Attractions ////post start 5///
347
-        break;
348
-    case 6:
349
-
350
-
351
-        $image_array = array();
352
-        $post_meta = array();
353
-
354
-        /// Attractions ////post start 6///
355
-        $image_array[] = "$dummy_image_url/a14.jpg";
356
-        $image_array[] = "$dummy_image_url/a13.jpg";
357
-        $image_array[] = "$dummy_image_url/a3.jpg";
358
-        $image_array[] = "$dummy_image_url/a4.jpg";
359
-        $image_array[] = "$dummy_image_url/a5.jpg";
360
-        $image_array[] = "$dummy_image_url/a2.jpg";
361
-        $image_array[] = "$dummy_image_url/a7.jpg";
362
-        $image_array[] = "$dummy_image_url/a8.jpg";
363
-        $image_array[] = "$dummy_image_url/a6.jpg";
364
-        $image_array[] = "$dummy_image_url/a1.jpg";
365
-        $image_array[] = "$dummy_image_url/a9.jpg";
366
-
367
-        $post_info[] = array(
368
-            "listing_type" => 'gd_place',
369
-            "post_title" => 'Sadsbury Woods Preserve',
370
-            "post_desc" => 'A more than 500-acre nature preserve ideal for walking and hiking, Sadsbury Woods is also an important habitat for interior nesting birds and small mammals. An increasingly rare area of interior woodlands, defined as an area at least 300 feet from any road, lawn or meadow, provides a critical habitat for many species of birds, especially neo-tropical migrant songbirds.
332
+			"post_images" => $image_array,
333
+			"post_category" => array('gd_placecategory' => array('Attractions', 'Feature')),
334
+			"post_tags" => array('Tag', 'Center'),
335
+			"geodir_video" => '',
336
+			"geodir_timing" => 'Open today until 9.30 a.m., Sunday 11 am to 7 pm',
337
+			"geodir_contact" => '(111) 111-1111',
338
+			"geodir_email" => '[email protected]',
339
+			"geodir_website" => 'http://ncc.com',
340
+			"geodir_twitter" => 'http://twitter.com/ncc',
341
+			"geodir_facebook" => 'http://facebook.com/ncc',
342
+			"post_dummy" => '1'
343
+		);
344
+
345
+		////post end///
346
+		/// Attractions ////post start 5///
347
+		break;
348
+	case 6:
349
+
350
+
351
+		$image_array = array();
352
+		$post_meta = array();
353
+
354
+		/// Attractions ////post start 6///
355
+		$image_array[] = "$dummy_image_url/a14.jpg";
356
+		$image_array[] = "$dummy_image_url/a13.jpg";
357
+		$image_array[] = "$dummy_image_url/a3.jpg";
358
+		$image_array[] = "$dummy_image_url/a4.jpg";
359
+		$image_array[] = "$dummy_image_url/a5.jpg";
360
+		$image_array[] = "$dummy_image_url/a2.jpg";
361
+		$image_array[] = "$dummy_image_url/a7.jpg";
362
+		$image_array[] = "$dummy_image_url/a8.jpg";
363
+		$image_array[] = "$dummy_image_url/a6.jpg";
364
+		$image_array[] = "$dummy_image_url/a1.jpg";
365
+		$image_array[] = "$dummy_image_url/a9.jpg";
366
+
367
+		$post_info[] = array(
368
+			"listing_type" => 'gd_place',
369
+			"post_title" => 'Sadsbury Woods Preserve',
370
+			"post_desc" => 'A more than 500-acre nature preserve ideal for walking and hiking, Sadsbury Woods is also an important habitat for interior nesting birds and small mammals. An increasingly rare area of interior woodlands, defined as an area at least 300 feet from any road, lawn or meadow, provides a critical habitat for many species of birds, especially neo-tropical migrant songbirds.
371 371
 	
372 372
 	Situated on the western edge of Chester County, the land remains much as it did centuries ago, and now serves as a permanent refuge in an area facing dramatically increasing development pressure.
373 373
 	
@@ -383,45 +383,45 @@  discard block
 block discarded – undo
383 383
 	Outsider Tip
384 384
 	
385 385
 	The deep forest is a great place for spotting neo-tropical songbirds in the spring and summer months',
386
-            "post_images" => $image_array,
387
-            "post_category" => array('gd_placecategory' => array('Attractions')),
388
-            "post_tags" => array('sample', 'tags'),
389
-            "geodir_video" => '',
390
-            "geodir_timing" => 'Open today until 12.30 p.m., Sunday 12 pm to 7 pm',
391
-            "geodir_contact" => '(222) 999-9999',
392
-            "geodir_email" => '[email protected]',
393
-            "geodir_website" => 'http://swp.com',
394
-            "geodir_twitter" => 'http://twitter.com/swp',
395
-            "geodir_facebook" => 'http://facebook.com/swp',
396
-            "post_dummy" => '1'
397
-        );
398
-
399
-        ////post end///
400
-        /// Attractions ////post start 6///
401
-
402
-        break;
403
-    case 7:
404
-
405
-        $image_array = array();
406
-        $post_meta = array();
407
-
408
-        /// Attractions ////post start 7///
409
-        $image_array[] = "$dummy_image_url/a15.jpg";
410
-        $image_array[] = "$dummy_image_url/a16.jpg";
411
-        $image_array[] = "$dummy_image_url/a17.jpg";
412
-        $image_array[] = "$dummy_image_url/a4.jpg";
413
-        $image_array[] = "$dummy_image_url/a5.jpg";
414
-        $image_array[] = "$dummy_image_url/a2.jpg";
415
-        $image_array[] = "$dummy_image_url/a7.jpg";
416
-        $image_array[] = "$dummy_image_url/a8.jpg";
417
-        $image_array[] = "$dummy_image_url/a6.jpg";
418
-        $image_array[] = "$dummy_image_url/a1.jpg";
419
-        $image_array[] = "$dummy_image_url/a9.jpg";
420
-
421
-        $post_info[] = array(
422
-            "listing_type" => 'gd_place',
423
-            "post_title" => 'Museum Without Walls',
424
-            "post_desc" => '<h3>The Experience </h3>
386
+			"post_images" => $image_array,
387
+			"post_category" => array('gd_placecategory' => array('Attractions')),
388
+			"post_tags" => array('sample', 'tags'),
389
+			"geodir_video" => '',
390
+			"geodir_timing" => 'Open today until 12.30 p.m., Sunday 12 pm to 7 pm',
391
+			"geodir_contact" => '(222) 999-9999',
392
+			"geodir_email" => '[email protected]',
393
+			"geodir_website" => 'http://swp.com',
394
+			"geodir_twitter" => 'http://twitter.com/swp',
395
+			"geodir_facebook" => 'http://facebook.com/swp',
396
+			"post_dummy" => '1'
397
+		);
398
+
399
+		////post end///
400
+		/// Attractions ////post start 6///
401
+
402
+		break;
403
+	case 7:
404
+
405
+		$image_array = array();
406
+		$post_meta = array();
407
+
408
+		/// Attractions ////post start 7///
409
+		$image_array[] = "$dummy_image_url/a15.jpg";
410
+		$image_array[] = "$dummy_image_url/a16.jpg";
411
+		$image_array[] = "$dummy_image_url/a17.jpg";
412
+		$image_array[] = "$dummy_image_url/a4.jpg";
413
+		$image_array[] = "$dummy_image_url/a5.jpg";
414
+		$image_array[] = "$dummy_image_url/a2.jpg";
415
+		$image_array[] = "$dummy_image_url/a7.jpg";
416
+		$image_array[] = "$dummy_image_url/a8.jpg";
417
+		$image_array[] = "$dummy_image_url/a6.jpg";
418
+		$image_array[] = "$dummy_image_url/a1.jpg";
419
+		$image_array[] = "$dummy_image_url/a9.jpg";
420
+
421
+		$post_info[] = array(
422
+			"listing_type" => 'gd_place',
423
+			"post_title" => 'Museum Without Walls',
424
+			"post_desc" => '<h3>The Experience </h3>
425 425
 	
426 426
 	Museum Without Walls: AUDIO is a multi-platform, interactive audio tour, designed to allow locals and visitors alike to experience Philadelphia extensive collection of public art and outdoor sculpture along the Benjamin Franklin Parkway and Kelly Drive. This innovative program invites passersby to stop, look, listen and see this city public art in a new way. Discover the untold histories of the 51 outdoor sculptures at 35 stops through these professionally produced three-minute interpretive audio segments. The many narratives have been spoken by more than 100 individuals, all with personal connections to the pieces of art.
427 427
 	
@@ -431,45 +431,45 @@  discard block
 block discarded – undo
431 431
 	<h3>History </h3>
432 432
 	
433 433
 	Philadelphia has more outdoor sculpture than any other American city, yet this extensive collection often goes unnoticed. This program is intended to reveal the distinct stories behind each of these works, that have become visual white noise for so many of the city residents and visitors. ',
434
-            "post_images" => $image_array,
435
-            "post_category" => array('gd_placecategory' => array('Attractions')),
436
-            "post_tags" => array('Museum'),
437
-            "geodir_video" => '',
438
-            "geodir_timing" => 'Open today until 10.30 a.m., Sunday 10 am to 7 pm',
439
-            "geodir_contact" => '(222) 999-9999',
440
-            "geodir_email" => '[email protected]',
441
-            "geodir_website" => 'http://museumwithoutwallsaudio.org/',
442
-            "geodir_twitter" => 'http://twitter.com/mwwalls',
443
-            "geodir_facebook" => 'http://facebook.com/mwwalls',
444
-            "post_dummy" => '1'
445
-        );
446
-
447
-        ////post end///
448
-        /// Attractions ////post start 7///
449
-
450
-        break;
451
-    case 8:
452
-
453
-        $image_array = array();
454
-        $post_meta = array();
455
-
456
-        /// Attractions ////post start 8///
457
-        $image_array[] = "$dummy_image_url/a18.jpg";
458
-        $image_array[] = "$dummy_image_url/a10.jpg";
459
-        $image_array[] = "$dummy_image_url/a3.jpg";
460
-        $image_array[] = "$dummy_image_url/a4.jpg";
461
-        $image_array[] = "$dummy_image_url/a5.jpg";
462
-        $image_array[] = "$dummy_image_url/a2.jpg";
463
-        $image_array[] = "$dummy_image_url/a7.jpg";
464
-        $image_array[] = "$dummy_image_url/a8.jpg";
465
-        $image_array[] = "$dummy_image_url/a6.jpg";
466
-        $image_array[] = "$dummy_image_url/a1.jpg";
467
-        $image_array[] = "$dummy_image_url/a9.jpg";
468
-
469
-        $post_info[] = array(
470
-            "listing_type" => 'gd_place',
471
-            "post_title" => 'Audacious Freedom',
472
-            "post_desc" => 'Audacious Freedom, the major, new exhibit at the African American Museum in Philadelphia , explores the lives of people of African descent living in Philadelphia between 1776 and 1876.
434
+			"post_images" => $image_array,
435
+			"post_category" => array('gd_placecategory' => array('Attractions')),
436
+			"post_tags" => array('Museum'),
437
+			"geodir_video" => '',
438
+			"geodir_timing" => 'Open today until 10.30 a.m., Sunday 10 am to 7 pm',
439
+			"geodir_contact" => '(222) 999-9999',
440
+			"geodir_email" => '[email protected]',
441
+			"geodir_website" => 'http://museumwithoutwallsaudio.org/',
442
+			"geodir_twitter" => 'http://twitter.com/mwwalls',
443
+			"geodir_facebook" => 'http://facebook.com/mwwalls',
444
+			"post_dummy" => '1'
445
+		);
446
+
447
+		////post end///
448
+		/// Attractions ////post start 7///
449
+
450
+		break;
451
+	case 8:
452
+
453
+		$image_array = array();
454
+		$post_meta = array();
455
+
456
+		/// Attractions ////post start 8///
457
+		$image_array[] = "$dummy_image_url/a18.jpg";
458
+		$image_array[] = "$dummy_image_url/a10.jpg";
459
+		$image_array[] = "$dummy_image_url/a3.jpg";
460
+		$image_array[] = "$dummy_image_url/a4.jpg";
461
+		$image_array[] = "$dummy_image_url/a5.jpg";
462
+		$image_array[] = "$dummy_image_url/a2.jpg";
463
+		$image_array[] = "$dummy_image_url/a7.jpg";
464
+		$image_array[] = "$dummy_image_url/a8.jpg";
465
+		$image_array[] = "$dummy_image_url/a6.jpg";
466
+		$image_array[] = "$dummy_image_url/a1.jpg";
467
+		$image_array[] = "$dummy_image_url/a9.jpg";
468
+
469
+		$post_info[] = array(
470
+			"listing_type" => 'gd_place',
471
+			"post_title" => 'Audacious Freedom',
472
+			"post_desc" => 'Audacious Freedom, the major, new exhibit at the African American Museum in Philadelphia , explores the lives of people of African descent living in Philadelphia between 1776 and 1876.
473 473
 	
474 474
 	Discover how African Americans in Philadelphia lived and worked while helping to shape the young nation in its formative stages.
475 475
 	
@@ -477,45 +477,45 @@  discard block
 block discarded – undo
477 477
 	
478 478
 	The groundbreaking exhibit allows visitors to “walk the streets” of Historic Philadelphia using a large-scale map. Young children can join the action with Children&acute;s Corner, which highlights the daily lives of children during that period.
479 479
 	',
480
-            "post_images" => $image_array,
481
-            "post_category" => array('gd_placecategory' => array('Attractions')),
482
-            "post_tags" => array('Tag1'),
483
-            "geodir_video" => '',
484
-            "geodir_timing" => 'Open today until 11.30 a.m., Sunday 1 pm to 7 pm',
485
-            "geodir_contact" => '(777) 777-7777',
486
-            "geodir_email" => '[email protected]',
487
-            "geodir_website" => 'http://www.aampmuseum.org/',
488
-            "geodir_twitter" => 'http://twitter.com/aampmuseum',
489
-            "geodir_facebook" => 'http://facebook.com/aampmuseum',
490
-            "post_dummy" => '1'
491
-        );
492
-
493
-        ////post end///
494
-        /// Attractions ////post start 8///
495
-
496
-
497
-        break;
498
-    case 9:
499
-        $image_array = array();
500
-        $post_meta = array();
501
-
502
-        /// Attractions ////post start 9///
503
-        $image_array[] = "$dummy_image_url/a19.jpg";
504
-        $image_array[] = "$dummy_image_url/a20.jpg";
505
-        $image_array[] = "$dummy_image_url/a3.jpg";
506
-        $image_array[] = "$dummy_image_url/a4.jpg";
507
-        $image_array[] = "$dummy_image_url/a5.jpg";
508
-        $image_array[] = "$dummy_image_url/a2.jpg";
509
-        $image_array[] = "$dummy_image_url/a7.jpg";
510
-        $image_array[] = "$dummy_image_url/a8.jpg";
511
-        $image_array[] = "$dummy_image_url/a6.jpg";
512
-        $image_array[] = "$dummy_image_url/a1.jpg";
513
-        $image_array[] = "$dummy_image_url/a9.jpg";
514
-
515
-        $post_info[] = array(
516
-            "listing_type" => 'gd_place',
517
-            "post_title" => 'The Liberty Bell Center',
518
-            "post_desc" => '<h3>The Experience </h3>
480
+			"post_images" => $image_array,
481
+			"post_category" => array('gd_placecategory' => array('Attractions')),
482
+			"post_tags" => array('Tag1'),
483
+			"geodir_video" => '',
484
+			"geodir_timing" => 'Open today until 11.30 a.m., Sunday 1 pm to 7 pm',
485
+			"geodir_contact" => '(777) 777-7777',
486
+			"geodir_email" => '[email protected]',
487
+			"geodir_website" => 'http://www.aampmuseum.org/',
488
+			"geodir_twitter" => 'http://twitter.com/aampmuseum',
489
+			"geodir_facebook" => 'http://facebook.com/aampmuseum',
490
+			"post_dummy" => '1'
491
+		);
492
+
493
+		////post end///
494
+		/// Attractions ////post start 8///
495
+
496
+
497
+		break;
498
+	case 9:
499
+		$image_array = array();
500
+		$post_meta = array();
501
+
502
+		/// Attractions ////post start 9///
503
+		$image_array[] = "$dummy_image_url/a19.jpg";
504
+		$image_array[] = "$dummy_image_url/a20.jpg";
505
+		$image_array[] = "$dummy_image_url/a3.jpg";
506
+		$image_array[] = "$dummy_image_url/a4.jpg";
507
+		$image_array[] = "$dummy_image_url/a5.jpg";
508
+		$image_array[] = "$dummy_image_url/a2.jpg";
509
+		$image_array[] = "$dummy_image_url/a7.jpg";
510
+		$image_array[] = "$dummy_image_url/a8.jpg";
511
+		$image_array[] = "$dummy_image_url/a6.jpg";
512
+		$image_array[] = "$dummy_image_url/a1.jpg";
513
+		$image_array[] = "$dummy_image_url/a9.jpg";
514
+
515
+		$post_info[] = array(
516
+			"listing_type" => 'gd_place',
517
+			"post_title" => 'The Liberty Bell Center',
518
+			"post_desc" => '<h3>The Experience </h3>
519 519
 	
520 520
 	The Liberty Bell has a new home, and it is as powerful and dramatic as the Bell itself. Throughout the expansive, light-filled Center, larger-than-life historic documents and graphic images explore the facts and the myths surrounding the Bell.
521 521
 	
@@ -536,45 +536,45 @@  discard block
 block discarded – undo
536 536
 	The Bell is suspended from what is believed to be its original yoke, made of American elm.
537 537
 	
538 538
 	The Liberty Bell weighs 2,080 pounds. The yoke weighs about 100 pounds.',
539
-            "post_images" => $image_array,
540
-            "post_category" => array('gd_placecategory' => array('Attractions', 'Feature')),
541
-            "post_tags" => array(''),
542
-            "geodir_video" => '',
543
-            "geodir_timing" => 'The center is open year round, 9 a.m. – 5 p.m., with extended hours in the summer.',
544
-            "geodir_contact" => '(777) 666-6666',
545
-            "geodir_email" => '[email protected]',
546
-            "geodir_website" => 'http://www.nps.gov/inde',
547
-            "geodir_twitter" => 'http://twitter.com/nps',
548
-            "geodir_facebook" => 'http://facebook.com/nps',
549
-            "post_dummy" => '1'
550
-        );
551
-
552
-        ////post end///
553
-        /// Attractions ////post start 9///
554
-        break;
555
-    case 10:
556
-
557
-
558
-        $image_array = array();
559
-        $post_meta = array();
560
-
561
-        /// Attractions ////post start 10///
562
-        $image_array[] = "$dummy_image_url/a19.jpg";
563
-        $image_array[] = "$dummy_image_url/a20.jpg";
564
-        $image_array[] = "$dummy_image_url/a3.jpg";
565
-        $image_array[] = "$dummy_image_url/a4.jpg";
566
-        $image_array[] = "$dummy_image_url/a5.jpg";
567
-        $image_array[] = "$dummy_image_url/a2.jpg";
568
-        $image_array[] = "$dummy_image_url/a7.jpg";
569
-        $image_array[] = "$dummy_image_url/a8.jpg";
570
-        $image_array[] = "$dummy_image_url/a6.jpg";
571
-        $image_array[] = "$dummy_image_url/a1.jpg";
572
-        $image_array[] = "$dummy_image_url/a9.jpg";
573
-
574
-        $post_info[] = array(
575
-            "listing_type" => 'gd_place',
576
-            "post_title" => 'Rittenhouse Square',
577
-            "post_desc" => '
539
+			"post_images" => $image_array,
540
+			"post_category" => array('gd_placecategory' => array('Attractions', 'Feature')),
541
+			"post_tags" => array(''),
542
+			"geodir_video" => '',
543
+			"geodir_timing" => 'The center is open year round, 9 a.m. – 5 p.m., with extended hours in the summer.',
544
+			"geodir_contact" => '(777) 666-6666',
545
+			"geodir_email" => '[email protected]',
546
+			"geodir_website" => 'http://www.nps.gov/inde',
547
+			"geodir_twitter" => 'http://twitter.com/nps',
548
+			"geodir_facebook" => 'http://facebook.com/nps',
549
+			"post_dummy" => '1'
550
+		);
551
+
552
+		////post end///
553
+		/// Attractions ////post start 9///
554
+		break;
555
+	case 10:
556
+
557
+
558
+		$image_array = array();
559
+		$post_meta = array();
560
+
561
+		/// Attractions ////post start 10///
562
+		$image_array[] = "$dummy_image_url/a19.jpg";
563
+		$image_array[] = "$dummy_image_url/a20.jpg";
564
+		$image_array[] = "$dummy_image_url/a3.jpg";
565
+		$image_array[] = "$dummy_image_url/a4.jpg";
566
+		$image_array[] = "$dummy_image_url/a5.jpg";
567
+		$image_array[] = "$dummy_image_url/a2.jpg";
568
+		$image_array[] = "$dummy_image_url/a7.jpg";
569
+		$image_array[] = "$dummy_image_url/a8.jpg";
570
+		$image_array[] = "$dummy_image_url/a6.jpg";
571
+		$image_array[] = "$dummy_image_url/a1.jpg";
572
+		$image_array[] = "$dummy_image_url/a9.jpg";
573
+
574
+		$post_info[] = array(
575
+			"listing_type" => 'gd_place',
576
+			"post_title" => 'Rittenhouse Square',
577
+			"post_desc" => '
578 578
 	
579 579
 	Unlike the other squares, the early Southwest Square was never used as a burial ground, although it offered pasturage for local livestock and a convenient dumping spot for “night soil”.
580 580
 	<h3> History </h3>
@@ -607,45 +607,45 @@  discard block
 block discarded – undo
607 607
 	
608 608
 	Meanwhile, several more restaurants, bars and clubs have opened along the surrounding blocks in recent years, like Parc, Tria, Continental Midtown, Alfa, Walnut Room, and Twenty Manning just to name a few.
609 609
 	',
610
-            "post_images" => $image_array,
611
-            "post_category" => array('gd_placecategory' => array('Attractions')),
612
-            "post_tags" => array('Museum'),
613
-            "geodir_video" => '',
614
-            "geodir_timing" => 'The center is open year round, 9 a.m. – 5 p.m., with extended hours in the summer.',
615
-            "geodir_contact" => '(777) 666-6666',
616
-            "geodir_email" => '[email protected]',
617
-            "geodir_website" => 'http://www.fairmountpark.org/rittenhousesquare.asp',
618
-            "geodir_twitter" => 'http://twitter.com/fairmountpark',
619
-            "geodir_facebook" => 'http://facebook.com/fairmountpark',
620
-            "post_dummy" => '1'
621
-        );
622
-
623
-        ////post end///
624
-        /// Attractions ////post start 10///
625
-        break;
626
-    case 11:
627
-
628
-
629
-        $image_array = array();
630
-        $post_meta = array();
631
-
632
-        /// Hotels ////post start 1///
633
-        $image_array[] = "$dummy_image_url/hotels1.jpg";
634
-        $image_array[] = "$dummy_image_url/hotels2.jpg";
635
-        $image_array[] = "$dummy_image_url/hotels3.jpg";
636
-        $image_array[] = "$dummy_image_url/hotels4.jpg";
637
-        $image_array[] = "$dummy_image_url/hotels5.jpg";
638
-        $image_array[] = "$dummy_image_url/hotels6.jpg";
639
-        $image_array[] = "$dummy_image_url/hotels7.jpg";
640
-        $image_array[] = "$dummy_image_url/hotels8.jpg";
641
-        $image_array[] = "$dummy_image_url/hotels9.jpg";
642
-        $image_array[] = "$dummy_image_url/hotels10.jpg";
643
-        $image_array[] = "$dummy_image_url/hotels11.jpg";
644
-
645
-        $post_info[] = array(
646
-            "listing_type" => 'gd_place',
647
-            "post_title" => 'Loews Philadelphia Hotel',
648
-            "post_desc" => '
610
+			"post_images" => $image_array,
611
+			"post_category" => array('gd_placecategory' => array('Attractions')),
612
+			"post_tags" => array('Museum'),
613
+			"geodir_video" => '',
614
+			"geodir_timing" => 'The center is open year round, 9 a.m. – 5 p.m., with extended hours in the summer.',
615
+			"geodir_contact" => '(777) 666-6666',
616
+			"geodir_email" => '[email protected]',
617
+			"geodir_website" => 'http://www.fairmountpark.org/rittenhousesquare.asp',
618
+			"geodir_twitter" => 'http://twitter.com/fairmountpark',
619
+			"geodir_facebook" => 'http://facebook.com/fairmountpark',
620
+			"post_dummy" => '1'
621
+		);
622
+
623
+		////post end///
624
+		/// Attractions ////post start 10///
625
+		break;
626
+	case 11:
627
+
628
+
629
+		$image_array = array();
630
+		$post_meta = array();
631
+
632
+		/// Hotels ////post start 1///
633
+		$image_array[] = "$dummy_image_url/hotels1.jpg";
634
+		$image_array[] = "$dummy_image_url/hotels2.jpg";
635
+		$image_array[] = "$dummy_image_url/hotels3.jpg";
636
+		$image_array[] = "$dummy_image_url/hotels4.jpg";
637
+		$image_array[] = "$dummy_image_url/hotels5.jpg";
638
+		$image_array[] = "$dummy_image_url/hotels6.jpg";
639
+		$image_array[] = "$dummy_image_url/hotels7.jpg";
640
+		$image_array[] = "$dummy_image_url/hotels8.jpg";
641
+		$image_array[] = "$dummy_image_url/hotels9.jpg";
642
+		$image_array[] = "$dummy_image_url/hotels10.jpg";
643
+		$image_array[] = "$dummy_image_url/hotels11.jpg";
644
+
645
+		$post_info[] = array(
646
+			"listing_type" => 'gd_place',
647
+			"post_title" => 'Loews Philadelphia Hotel',
648
+			"post_desc" => '
649 649
 	
650 650
 	<h3>OVERVIEW </h3>
651 651
 	
@@ -712,45 +712,45 @@  discard block
 block discarded – undo
712 712
 	
713 713
 	SoleFood Restaurant is proud to be serving Starbucks. Come in and enjoy a fresh cup of coffee during your morning rush. The Coffee Bar also offer small breakfast items for your enjoyment.
714 714
 	',
715
-            "post_images" => $image_array,
716
-            "post_category" => array('gd_placecategory' => array('Hotels', 'Feature')),
717
-            "post_tags" => array(''),
718
-            "geodir_video" => '',
719
-            "geodir_timing" => 'Daily, 6:30 am – 12:00 pm',
720
-            "geodir_contact" => '(111) 111-0000',
721
-            "geodir_email" => '[email protected]',
722
-            "geodir_website" => 'http://www.loewshotels.com/en/hotels/philadelphia-hotel/overview.aspx',
723
-            "geodir_twitter" => 'http://twitter.com/loewshotels',
724
-            "geodir_facebook" => 'http://facebook.com/loewshotels',
725
-            "post_dummy" => '1'
726
-        );
727
-
728
-        ////post end///
729
-        /// Hotels ////post start 1///
730
-        break;
731
-    case 12:
732
-
733
-
734
-        $image_array = array();
735
-        $post_meta = array();
736
-
737
-        /// Hotels ////post start 2///
738
-        $image_array[] = "$dummy_image_url/hotels5.jpg";
739
-        $image_array[] = "$dummy_image_url/hotels2.jpg";
740
-        $image_array[] = "$dummy_image_url/hotels3.jpg";
741
-        $image_array[] = "$dummy_image_url/hotels4.jpg";
742
-        $image_array[] = "$dummy_image_url/hotels1.jpg";
743
-        $image_array[] = "$dummy_image_url/hotels6.jpg";
744
-        $image_array[] = "$dummy_image_url/hotels7.jpg";
745
-        $image_array[] = "$dummy_image_url/hotels8.jpg";
746
-        $image_array[] = "$dummy_image_url/hotels9.jpg";
747
-        $image_array[] = "$dummy_image_url/hotels10.jpg";
748
-        $image_array[] = "$dummy_image_url/hotels11.jpg";
749
-
750
-        $post_info[] = array(
751
-            "listing_type" => 'gd_place',
752
-            "post_title" => 'Embassy Suites Philadelphia',
753
-            "post_desc" => '
715
+			"post_images" => $image_array,
716
+			"post_category" => array('gd_placecategory' => array('Hotels', 'Feature')),
717
+			"post_tags" => array(''),
718
+			"geodir_video" => '',
719
+			"geodir_timing" => 'Daily, 6:30 am – 12:00 pm',
720
+			"geodir_contact" => '(111) 111-0000',
721
+			"geodir_email" => '[email protected]',
722
+			"geodir_website" => 'http://www.loewshotels.com/en/hotels/philadelphia-hotel/overview.aspx',
723
+			"geodir_twitter" => 'http://twitter.com/loewshotels',
724
+			"geodir_facebook" => 'http://facebook.com/loewshotels',
725
+			"post_dummy" => '1'
726
+		);
727
+
728
+		////post end///
729
+		/// Hotels ////post start 1///
730
+		break;
731
+	case 12:
732
+
733
+
734
+		$image_array = array();
735
+		$post_meta = array();
736
+
737
+		/// Hotels ////post start 2///
738
+		$image_array[] = "$dummy_image_url/hotels5.jpg";
739
+		$image_array[] = "$dummy_image_url/hotels2.jpg";
740
+		$image_array[] = "$dummy_image_url/hotels3.jpg";
741
+		$image_array[] = "$dummy_image_url/hotels4.jpg";
742
+		$image_array[] = "$dummy_image_url/hotels1.jpg";
743
+		$image_array[] = "$dummy_image_url/hotels6.jpg";
744
+		$image_array[] = "$dummy_image_url/hotels7.jpg";
745
+		$image_array[] = "$dummy_image_url/hotels8.jpg";
746
+		$image_array[] = "$dummy_image_url/hotels9.jpg";
747
+		$image_array[] = "$dummy_image_url/hotels10.jpg";
748
+		$image_array[] = "$dummy_image_url/hotels11.jpg";
749
+
750
+		$post_info[] = array(
751
+			"listing_type" => 'gd_place',
752
+			"post_title" => 'Embassy Suites Philadelphia',
753
+			"post_desc" => '
754 754
 	The newly renovated Embassy Suites Philadelphia – Center City hotel is conveniently situated in the heart of downtown Philadelphia, Pennsylvania and Philadelphia&acute;s Center City business district. This hotel in Philadelphia is located only eight miles from Philadelphia International Airport and just minutes from top Philadelphia attractions, including:
755 755
 	
756 756
 	Philadelphia Museum of Art
@@ -766,45 +766,45 @@  discard block
 block discarded – undo
766 766
 	
767 767
 	A delicious, complimentary cooked-to-order breakfast is offered each morning, and a hotel Manager&acute;s Reception every night – featuring complimentary refreshments and great company.
768 768
 	',
769
-            "post_images" => $image_array,
770
-            "post_category" => array('gd_placecategory' => array('Hotels')),
771
-            "post_tags" => array(''),
772
-            "geodir_video" => '',
773
-            "geodir_timing" => 'Daily, 10:30 am – 10 pm',
774
-            "geodir_contact" => '(111) 111-0000',
775
-            "geodir_email" => '[email protected]',
776
-            "geodir_website" => 'http://embassysuites1.hilton.com/en_US/es/hotel/PHLDTES-Embassy-Suites-Philadelphia-Center-City-Pennsylvania/index.do',
777
-            "geodir_twitter" => 'http://twitter.com/embassysuites1',
778
-            "geodir_facebook" => 'http://facebook.com/embassysuites1',
779
-            "post_dummy" => '1'
780
-        );
781
-
782
-        ////post end///
783
-        /// Hotels ////post start 2///
784
-
785
-        break;
786
-    case 13:
787
-
788
-        $image_array = array();
789
-        $post_meta = array();
790
-
791
-        /// Hotels ////post start 3///
792
-        $image_array[] = "$dummy_image_url/hotels10.jpg";
793
-        $image_array[] = "$dummy_image_url/hotels11.jpg";
794
-        $image_array[] = "$dummy_image_url/hotels12.jpg";
795
-        $image_array[] = "$dummy_image_url/hotels4.jpg";
796
-        $image_array[] = "$dummy_image_url/hotels1.jpg";
797
-        $image_array[] = "$dummy_image_url/hotels6.jpg";
798
-        $image_array[] = "$dummy_image_url/hotels7.jpg";
799
-        $image_array[] = "$dummy_image_url/hotels8.jpg";
800
-        $image_array[] = "$dummy_image_url/hotels9.jpg";
801
-        $image_array[] = "$dummy_image_url/hotels1.jpg";
802
-        $image_array[] = "$dummy_image_url/hotels2.jpg";
803
-
804
-        $post_info[] = array(
805
-            "listing_type" => 'gd_place',
806
-            "post_title" => 'Doubletree Hotel Philadelphia',
807
-            "post_desc" => '
769
+			"post_images" => $image_array,
770
+			"post_category" => array('gd_placecategory' => array('Hotels')),
771
+			"post_tags" => array(''),
772
+			"geodir_video" => '',
773
+			"geodir_timing" => 'Daily, 10:30 am – 10 pm',
774
+			"geodir_contact" => '(111) 111-0000',
775
+			"geodir_email" => '[email protected]',
776
+			"geodir_website" => 'http://embassysuites1.hilton.com/en_US/es/hotel/PHLDTES-Embassy-Suites-Philadelphia-Center-City-Pennsylvania/index.do',
777
+			"geodir_twitter" => 'http://twitter.com/embassysuites1',
778
+			"geodir_facebook" => 'http://facebook.com/embassysuites1',
779
+			"post_dummy" => '1'
780
+		);
781
+
782
+		////post end///
783
+		/// Hotels ////post start 2///
784
+
785
+		break;
786
+	case 13:
787
+
788
+		$image_array = array();
789
+		$post_meta = array();
790
+
791
+		/// Hotels ////post start 3///
792
+		$image_array[] = "$dummy_image_url/hotels10.jpg";
793
+		$image_array[] = "$dummy_image_url/hotels11.jpg";
794
+		$image_array[] = "$dummy_image_url/hotels12.jpg";
795
+		$image_array[] = "$dummy_image_url/hotels4.jpg";
796
+		$image_array[] = "$dummy_image_url/hotels1.jpg";
797
+		$image_array[] = "$dummy_image_url/hotels6.jpg";
798
+		$image_array[] = "$dummy_image_url/hotels7.jpg";
799
+		$image_array[] = "$dummy_image_url/hotels8.jpg";
800
+		$image_array[] = "$dummy_image_url/hotels9.jpg";
801
+		$image_array[] = "$dummy_image_url/hotels1.jpg";
802
+		$image_array[] = "$dummy_image_url/hotels2.jpg";
803
+
804
+		$post_info[] = array(
805
+			"listing_type" => 'gd_place',
806
+			"post_title" => 'Doubletree Hotel Philadelphia',
807
+			"post_desc" => '
808 808
 	With 434 rooms, the Doubletree Hotel is a great option for your upcoming stay in Philadelphia.
809 809
 	
810 810
 	<h3>Location </h3>
@@ -834,47 +834,47 @@  discard block
 block discarded – undo
834 834
 	Stop in the restaurant - which serves lunch and dinner daily - for a drink and some light fare. With its location right on Broad Street, you&acute;re close to everything you could ever want in a night on the town.
835 835
 	',
836 836
 
837
-            "post_images" => $image_array,
838
-
839
-            "post_category" => array('gd_placecategory' => array('Hotels')),
840
-            "post_tags" => array(''),
841
-            "geodir_video" => '',
842
-            "geodir_timing" => 'Daily, 10:30 am – 10 pm',
843
-            "geodir_contact" => '(111) 111-0000',
844
-            "geodir_email" => '[email protected]',
845
-            "geodir_website" => 'http://doubletree1.hilton.com/en_US/dt/hotel/PHLBLDT-Doubletree-Hotel-Philadelphia-Pennsylvania/index.do',
846
-            "geodir_twitter" => 'http://twitter.com/doubletree1',
847
-            "geodir_facebook" => 'http://facebook.com/doubletree1',
848
-            "post_dummy" => '1'
849
-        );
850
-
851
-        ////post end///
852
-        /// Hotels ////post start 3///
853
-
854
-        break;
855
-    case 14:
856
-
857
-
858
-        $image_array = array();
859
-        $post_meta = array();
860
-
861
-        /// Hotels ////post start 4///
862
-        $image_array[] = "$dummy_image_url/hotels15.jpg";
863
-        $image_array[] = "$dummy_image_url/hotels16.jpg";
864
-        $image_array[] = "$dummy_image_url/hotels12.jpg";
865
-        $image_array[] = "$dummy_image_url/hotels4.jpg";
866
-        $image_array[] = "$dummy_image_url/hotels1.jpg";
867
-        $image_array[] = "$dummy_image_url/hotels6.jpg";
868
-        $image_array[] = "$dummy_image_url/hotels7.jpg";
869
-        $image_array[] = "$dummy_image_url/hotels8.jpg";
870
-        $image_array[] = "$dummy_image_url/hotels9.jpg";
871
-        $image_array[] = "$dummy_image_url/hotels1.jpg";
872
-        $image_array[] = "$dummy_image_url/hotels2.jpg";
873
-
874
-        $post_info[] = array(
875
-            "listing_type" => 'gd_place',
876
-            "post_title" => 'Philadelphia Marriott Downtown',
877
-            "post_desc" => '
837
+			"post_images" => $image_array,
838
+
839
+			"post_category" => array('gd_placecategory' => array('Hotels')),
840
+			"post_tags" => array(''),
841
+			"geodir_video" => '',
842
+			"geodir_timing" => 'Daily, 10:30 am – 10 pm',
843
+			"geodir_contact" => '(111) 111-0000',
844
+			"geodir_email" => '[email protected]',
845
+			"geodir_website" => 'http://doubletree1.hilton.com/en_US/dt/hotel/PHLBLDT-Doubletree-Hotel-Philadelphia-Pennsylvania/index.do',
846
+			"geodir_twitter" => 'http://twitter.com/doubletree1',
847
+			"geodir_facebook" => 'http://facebook.com/doubletree1',
848
+			"post_dummy" => '1'
849
+		);
850
+
851
+		////post end///
852
+		/// Hotels ////post start 3///
853
+
854
+		break;
855
+	case 14:
856
+
857
+
858
+		$image_array = array();
859
+		$post_meta = array();
860
+
861
+		/// Hotels ////post start 4///
862
+		$image_array[] = "$dummy_image_url/hotels15.jpg";
863
+		$image_array[] = "$dummy_image_url/hotels16.jpg";
864
+		$image_array[] = "$dummy_image_url/hotels12.jpg";
865
+		$image_array[] = "$dummy_image_url/hotels4.jpg";
866
+		$image_array[] = "$dummy_image_url/hotels1.jpg";
867
+		$image_array[] = "$dummy_image_url/hotels6.jpg";
868
+		$image_array[] = "$dummy_image_url/hotels7.jpg";
869
+		$image_array[] = "$dummy_image_url/hotels8.jpg";
870
+		$image_array[] = "$dummy_image_url/hotels9.jpg";
871
+		$image_array[] = "$dummy_image_url/hotels1.jpg";
872
+		$image_array[] = "$dummy_image_url/hotels2.jpg";
873
+
874
+		$post_info[] = array(
875
+			"listing_type" => 'gd_place',
876
+			"post_title" => 'Philadelphia Marriott Downtown',
877
+			"post_desc" => '
878 878
 	Get ready to stay and play at the new aloft Philadelphia Airport!
879 879
 	
880 880
 	This incredibly modern hotel is located just five minutes from Philadelphia International Airport, offering a great convenience to travelers looking for fresh and fun accommodations.
@@ -901,45 +901,45 @@  discard block
 block discarded – undo
901 901
 	
902 902
 	Aahh…breathe deep at Aloft. This hotel is smoke-free.
903 903
 	',
904
-            "post_images" => $image_array,
905
-            "post_category" => array('gd_placecategory' => array('Hotels', 'Feature')),
906
-            "post_tags" => array(''),
907
-            "geodir_video" => '',
908
-            "geodir_timing" => '24 Hours',
909
-            "geodir_contact" => '(123) 111-2222',
910
-            "geodir_email" => '[email protected]',
911
-            "geodir_website" => 'http://www.marriott.com/hotels/travel/phldt-philadelphia-marriott-downtown/',
912
-            "geodir_twitter" => 'http://twitter.com/marriott',
913
-            "geodir_facebook" => 'http://facebook.com/marriott',
914
-            "post_dummy" => '1'
915
-        );
916
-
917
-        ////post end///
918
-        /// Hotels ////post start 4///
919
-        break;
920
-    case 15:
921
-
922
-
923
-        $image_array = array();
924
-        $post_meta = array();
925
-
926
-        /// Hotels ////post start 5///
927
-        $image_array[] = "$dummy_image_url/hotels10.jpg";
928
-        $image_array[] = "$dummy_image_url/hotels16.jpg";
929
-        $image_array[] = "$dummy_image_url/hotels12.jpg";
930
-        $image_array[] = "$dummy_image_url/hotels4.jpg";
931
-        $image_array[] = "$dummy_image_url/hotels1.jpg";
932
-        $image_array[] = "$dummy_image_url/hotels6.jpg";
933
-        $image_array[] = "$dummy_image_url/hotels7.jpg";
934
-        $image_array[] = "$dummy_image_url/hotels8.jpg";
935
-        $image_array[] = "$dummy_image_url/hotels9.jpg";
936
-        $image_array[] = "$dummy_image_url/hotels1.jpg";
937
-        $image_array[] = "$dummy_image_url/hotels2.jpg";
938
-
939
-        $post_info[] = array(
940
-            "listing_type" => 'gd_place',
941
-            "post_title" => 'Hilton Inn at Penn',
942
-            "post_desc" => '
904
+			"post_images" => $image_array,
905
+			"post_category" => array('gd_placecategory' => array('Hotels', 'Feature')),
906
+			"post_tags" => array(''),
907
+			"geodir_video" => '',
908
+			"geodir_timing" => '24 Hours',
909
+			"geodir_contact" => '(123) 111-2222',
910
+			"geodir_email" => '[email protected]',
911
+			"geodir_website" => 'http://www.marriott.com/hotels/travel/phldt-philadelphia-marriott-downtown/',
912
+			"geodir_twitter" => 'http://twitter.com/marriott',
913
+			"geodir_facebook" => 'http://facebook.com/marriott',
914
+			"post_dummy" => '1'
915
+		);
916
+
917
+		////post end///
918
+		/// Hotels ////post start 4///
919
+		break;
920
+	case 15:
921
+
922
+
923
+		$image_array = array();
924
+		$post_meta = array();
925
+
926
+		/// Hotels ////post start 5///
927
+		$image_array[] = "$dummy_image_url/hotels10.jpg";
928
+		$image_array[] = "$dummy_image_url/hotels16.jpg";
929
+		$image_array[] = "$dummy_image_url/hotels12.jpg";
930
+		$image_array[] = "$dummy_image_url/hotels4.jpg";
931
+		$image_array[] = "$dummy_image_url/hotels1.jpg";
932
+		$image_array[] = "$dummy_image_url/hotels6.jpg";
933
+		$image_array[] = "$dummy_image_url/hotels7.jpg";
934
+		$image_array[] = "$dummy_image_url/hotels8.jpg";
935
+		$image_array[] = "$dummy_image_url/hotels9.jpg";
936
+		$image_array[] = "$dummy_image_url/hotels1.jpg";
937
+		$image_array[] = "$dummy_image_url/hotels2.jpg";
938
+
939
+		$post_info[] = array(
940
+			"listing_type" => 'gd_place',
941
+			"post_title" => 'Hilton Inn at Penn',
942
+			"post_desc" => '
943 943
 	Located in the heart of Penn&acute;s campus in the beautiful University City neighborhood of Philadelphia, The Hilton Inn at Penn is a great choice for accommodations during your upcoming visit to Philadelphia.
944 944
 	
945 945
 	The location puts you right in the middle of the prestigious University of Pennsylvania and its many nearby educational, medical and corporate centers. And Center City Philadelphia is only a short cab ride away. So if you want to get out and explore the city, you are set.
@@ -955,45 +955,45 @@  discard block
 block discarded – undo
955 955
 	
956 956
 	The pasta is handmade right in front of you and then dished up along side delectable entrées such as grilled veal tenderloin and honey glazed sea scallops. And the wine bar offers more than 30 varieties by the glass and more than 100 by the bottle.  
957 957
 	',
958
-            "post_images" => $image_array,
959
-            "post_category" => array('gd_placecategory' => array('Hotels', 'Food Nightlife')),
960
-            "post_tags" => array(''),
961
-            "geodir_video" => '',
962
-            "geodir_timing" => 'Daily : 11 am to 11 pm',
963
-            "geodir_contact" => '(888) 888-8888',
964
-            "geodir_email" => '[email protected]',
965
-            "geodir_website" => 'http://www.theinnatpenn.com/',
966
-            "geodir_twitter" => 'http://twitter.com/theinnatpenn',
967
-            "geodir_facebook" => 'http://facebook.com/theinnatpenn',
968
-            "post_dummy" => '1'
969
-        );
970
-
971
-        ////post end///
972
-        /// Hotels ////post start 5///
973
-        break;
974
-    case 16:
975
-
976
-
977
-        $image_array = array();
978
-        $post_meta = array();
979
-
980
-        /// Hotels ////post start 6///
981
-        $image_array[] = "$dummy_image_url/hotels17.jpg";
982
-        $image_array[] = "$dummy_image_url/hotels18.jpg";
983
-        $image_array[] = "$dummy_image_url/hotels12.jpg";
984
-        $image_array[] = "$dummy_image_url/hotels4.jpg";
985
-        $image_array[] = "$dummy_image_url/hotels1.jpg";
986
-        $image_array[] = "$dummy_image_url/hotels6.jpg";
987
-        $image_array[] = "$dummy_image_url/hotels7.jpg";
988
-        $image_array[] = "$dummy_image_url/hotels8.jpg";
989
-        $image_array[] = "$dummy_image_url/hotels9.jpg";
990
-        $image_array[] = "$dummy_image_url/hotels1.jpg";
991
-        $image_array[] = "$dummy_image_url/hotels2.jpg";
992
-
993
-        $post_info[] = array(
994
-            "listing_type" => 'gd_place',
995
-            "post_title" => 'Courtyard Philadelphia Downtown',
996
-            "post_desc" => '
958
+			"post_images" => $image_array,
959
+			"post_category" => array('gd_placecategory' => array('Hotels', 'Food Nightlife')),
960
+			"post_tags" => array(''),
961
+			"geodir_video" => '',
962
+			"geodir_timing" => 'Daily : 11 am to 11 pm',
963
+			"geodir_contact" => '(888) 888-8888',
964
+			"geodir_email" => '[email protected]',
965
+			"geodir_website" => 'http://www.theinnatpenn.com/',
966
+			"geodir_twitter" => 'http://twitter.com/theinnatpenn',
967
+			"geodir_facebook" => 'http://facebook.com/theinnatpenn',
968
+			"post_dummy" => '1'
969
+		);
970
+
971
+		////post end///
972
+		/// Hotels ////post start 5///
973
+		break;
974
+	case 16:
975
+
976
+
977
+		$image_array = array();
978
+		$post_meta = array();
979
+
980
+		/// Hotels ////post start 6///
981
+		$image_array[] = "$dummy_image_url/hotels17.jpg";
982
+		$image_array[] = "$dummy_image_url/hotels18.jpg";
983
+		$image_array[] = "$dummy_image_url/hotels12.jpg";
984
+		$image_array[] = "$dummy_image_url/hotels4.jpg";
985
+		$image_array[] = "$dummy_image_url/hotels1.jpg";
986
+		$image_array[] = "$dummy_image_url/hotels6.jpg";
987
+		$image_array[] = "$dummy_image_url/hotels7.jpg";
988
+		$image_array[] = "$dummy_image_url/hotels8.jpg";
989
+		$image_array[] = "$dummy_image_url/hotels9.jpg";
990
+		$image_array[] = "$dummy_image_url/hotels1.jpg";
991
+		$image_array[] = "$dummy_image_url/hotels2.jpg";
992
+
993
+		$post_info[] = array(
994
+			"listing_type" => 'gd_place',
995
+			"post_title" => 'Courtyard Philadelphia Downtown',
996
+			"post_desc" => '
997 997
 	<h3>Overview </h3>
998 998
 	
999 999
 	The Philadelphia Downtown Courtyard opened it&acute;s doors after a grand $75 million restoration, recapturing the grandeur of its 1926 origins while incorporating state of the art systems throughout.
@@ -1023,45 +1023,45 @@  discard block
 block discarded – undo
1023 1023
 	
1024 1024
 	Recently featured on WE TV&acute;s “My Fair Wedding”, the Courtyard Marriott Philadelphia is one of the city&acute;s leading venues for corporate and social affairs with over 10,000 sq ft of flexible meeting space, including two Grand Ballrooms each with over 3,000 square feet accommodating up to 250 people. In addition, the hotel has a total of 11 meeting rooms making it an ideal home for all occasions. The hotel boasts an experienced full-service Event and Culinary Teams, ready to take care of all the details and ensure your event is not only a success, but a lasting memory. 
1025 1025
 	',
1026
-            "post_images" => $image_array,
1027
-            "post_category" => array('gd_placecategory' => array('Hotels', 'Food Nightlife')),
1028
-            "post_tags" => array(''),
1029
-            "geodir_video" => '',
1030
-            "geodir_timing" => 'Daily : 11 am to 11 pm',
1031
-            "geodir_contact" => '(888) 888-8888',
1032
-            "geodir_email" => '[email protected]',
1033
-            "geodir_website" => 'http://www.theinnatpenn.com/',
1034
-            "geodir_twitter" => 'http://twitter.com/theinnatpenn',
1035
-            "geodir_facebook" => 'http://facebook.com/theinnatpenn',
1036
-            "post_dummy" => '1'
1037
-        );
1038
-
1039
-        ////post end///
1040
-        /// Hotels ////post start 6///
1041
-
1042
-        break;
1043
-    case 17:
1044
-
1045
-        $image_array = array();
1046
-        $post_meta = array();
1047
-
1048
-        /// Hotels ////post start 7///
1049
-        $image_array[] = "$dummy_image_url/hotels11.jpg";
1050
-        $image_array[] = "$dummy_image_url/hotels10.jpg";
1051
-        $image_array[] = "$dummy_image_url/hotels12.jpg";
1052
-        $image_array[] = "$dummy_image_url/hotels4.jpg";
1053
-        $image_array[] = "$dummy_image_url/hotels1.jpg";
1054
-        $image_array[] = "$dummy_image_url/hotels6.jpg";
1055
-        $image_array[] = "$dummy_image_url/hotels7.jpg";
1056
-        $image_array[] = "$dummy_image_url/hotels8.jpg";
1057
-        $image_array[] = "$dummy_image_url/hotels9.jpg";
1058
-        $image_array[] = "$dummy_image_url/hotels1.jpg";
1059
-        $image_array[] = "$dummy_image_url/hotels2.jpg";
1060
-
1061
-        $post_info[] = array(
1062
-            "listing_type" => 'gd_place',
1063
-            "post_title" => 'Four Seasons Philadelphia',
1064
-            "post_desc" => '
1026
+			"post_images" => $image_array,
1027
+			"post_category" => array('gd_placecategory' => array('Hotels', 'Food Nightlife')),
1028
+			"post_tags" => array(''),
1029
+			"geodir_video" => '',
1030
+			"geodir_timing" => 'Daily : 11 am to 11 pm',
1031
+			"geodir_contact" => '(888) 888-8888',
1032
+			"geodir_email" => '[email protected]',
1033
+			"geodir_website" => 'http://www.theinnatpenn.com/',
1034
+			"geodir_twitter" => 'http://twitter.com/theinnatpenn',
1035
+			"geodir_facebook" => 'http://facebook.com/theinnatpenn',
1036
+			"post_dummy" => '1'
1037
+		);
1038
+
1039
+		////post end///
1040
+		/// Hotels ////post start 6///
1041
+
1042
+		break;
1043
+	case 17:
1044
+
1045
+		$image_array = array();
1046
+		$post_meta = array();
1047
+
1048
+		/// Hotels ////post start 7///
1049
+		$image_array[] = "$dummy_image_url/hotels11.jpg";
1050
+		$image_array[] = "$dummy_image_url/hotels10.jpg";
1051
+		$image_array[] = "$dummy_image_url/hotels12.jpg";
1052
+		$image_array[] = "$dummy_image_url/hotels4.jpg";
1053
+		$image_array[] = "$dummy_image_url/hotels1.jpg";
1054
+		$image_array[] = "$dummy_image_url/hotels6.jpg";
1055
+		$image_array[] = "$dummy_image_url/hotels7.jpg";
1056
+		$image_array[] = "$dummy_image_url/hotels8.jpg";
1057
+		$image_array[] = "$dummy_image_url/hotels9.jpg";
1058
+		$image_array[] = "$dummy_image_url/hotels1.jpg";
1059
+		$image_array[] = "$dummy_image_url/hotels2.jpg";
1060
+
1061
+		$post_info[] = array(
1062
+			"listing_type" => 'gd_place',
1063
+			"post_title" => 'Four Seasons Philadelphia',
1064
+			"post_desc" => '
1065 1065
 	<h3>Overview </h3>
1066 1066
 	
1067 1067
 	The Philadelphia Downtown Courtyard opened it&acute;s doors after a grand $75 million restoration, recapturing the grandeur of its 1926 origins while incorporating state of the art systems throughout.
@@ -1091,45 +1091,45 @@  discard block
 block discarded – undo
1091 1091
 	
1092 1092
 	Recently featured on WE TV&acute;s “My Fair Wedding”, the Courtyard Marriott Philadelphia is one of the city&acute;s leading venues for corporate and social affairs with over 10,000 sq ft of flexible meeting space, including two Grand Ballrooms each with over 3,000 square feet accommodating up to 250 people. In addition, the hotel has a total of 11 meeting rooms making it an ideal home for all occasions. The hotel boasts an experienced full-service Event and Culinary Teams, ready to take care of all the details and ensure your event is not only a success, but a lasting memory. 
1093 1093
 	',
1094
-            "post_images" => $image_array,
1095
-            "post_category" => array('gd_placecategory' => array('Hotels', 'Food Nightlife')),
1096
-            "post_tags" => array(''),
1097
-            "geodir_video" => '',
1098
-            "geodir_timing" => 'Daily : 11 am to 11 pm',
1099
-            "geodir_contact" => '(143) 888-8888',
1100
-            "geodir_email" => '[email protected]',
1101
-            "geodir_website" => 'http://www.fourseasons.com/philadelphia/',
1102
-            "geodir_twitter" => 'http://twitter.com/fourseasons',
1103
-            "geodir_facebook" => 'http://facebook.com/fourseasons',
1104
-            "post_dummy" => '1'
1105
-        );
1106
-
1107
-        ////post end///
1108
-        /// Hotels ////post start 7///
1109
-        break;
1110
-    case 18:
1111
-
1112
-
1113
-        $image_array = array();
1114
-        $post_meta = array();
1115
-
1116
-        /// Hotels ////post start 8///
1117
-        $image_array[] = "$dummy_image_url/hotels11.jpg";
1118
-        $image_array[] = "$dummy_image_url/hotels10.jpg";
1119
-        $image_array[] = "$dummy_image_url/hotels12.jpg";
1120
-        $image_array[] = "$dummy_image_url/hotels4.jpg";
1121
-        $image_array[] = "$dummy_image_url/hotels1.jpg";
1122
-        $image_array[] = "$dummy_image_url/hotels6.jpg";
1123
-        $image_array[] = "$dummy_image_url/hotels7.jpg";
1124
-        $image_array[] = "$dummy_image_url/hotels8.jpg";
1125
-        $image_array[] = "$dummy_image_url/hotels9.jpg";
1126
-        $image_array[] = "$dummy_image_url/hotels1.jpg";
1127
-        $image_array[] = "$dummy_image_url/hotels2.jpg";
1128
-
1129
-        $post_info[] = array(
1130
-            "listing_type" => 'gd_place',
1131
-            "post_title" => 'Alexander Inn',
1132
-            "post_desc" => '
1094
+			"post_images" => $image_array,
1095
+			"post_category" => array('gd_placecategory' => array('Hotels', 'Food Nightlife')),
1096
+			"post_tags" => array(''),
1097
+			"geodir_video" => '',
1098
+			"geodir_timing" => 'Daily : 11 am to 11 pm',
1099
+			"geodir_contact" => '(143) 888-8888',
1100
+			"geodir_email" => '[email protected]',
1101
+			"geodir_website" => 'http://www.fourseasons.com/philadelphia/',
1102
+			"geodir_twitter" => 'http://twitter.com/fourseasons',
1103
+			"geodir_facebook" => 'http://facebook.com/fourseasons',
1104
+			"post_dummy" => '1'
1105
+		);
1106
+
1107
+		////post end///
1108
+		/// Hotels ////post start 7///
1109
+		break;
1110
+	case 18:
1111
+
1112
+
1113
+		$image_array = array();
1114
+		$post_meta = array();
1115
+
1116
+		/// Hotels ////post start 8///
1117
+		$image_array[] = "$dummy_image_url/hotels11.jpg";
1118
+		$image_array[] = "$dummy_image_url/hotels10.jpg";
1119
+		$image_array[] = "$dummy_image_url/hotels12.jpg";
1120
+		$image_array[] = "$dummy_image_url/hotels4.jpg";
1121
+		$image_array[] = "$dummy_image_url/hotels1.jpg";
1122
+		$image_array[] = "$dummy_image_url/hotels6.jpg";
1123
+		$image_array[] = "$dummy_image_url/hotels7.jpg";
1124
+		$image_array[] = "$dummy_image_url/hotels8.jpg";
1125
+		$image_array[] = "$dummy_image_url/hotels9.jpg";
1126
+		$image_array[] = "$dummy_image_url/hotels1.jpg";
1127
+		$image_array[] = "$dummy_image_url/hotels2.jpg";
1128
+
1129
+		$post_info[] = array(
1130
+			"listing_type" => 'gd_place',
1131
+			"post_title" => 'Alexander Inn',
1132
+			"post_desc" => '
1133 1133
 	The Alexander Inn is one of Philadelphia&acute;s most popular and reasonably priced small hotels.
1134 1134
 	
1135 1135
 	Conveniently located in the heart of the Washington Square West neighborhood in Center City Philadelphia, the Alexander Inn is a great place to base your stay in Philadelphia.
@@ -1138,45 +1138,45 @@  discard block
 block discarded – undo
1138 1138
 	
1139 1139
 	Rooms are also fitted with DirecTV (including many complimentary channels like CNN, ESPN, eight movie channels, etc.) and telephones with modem ports and direct dial. You will also have access to the hotel&acute;s free 24-hour fitness and e-mail centers.  
1140 1140
 	',
1141
-            "post_images" => $image_array,
1142
-            "post_category" => array('gd_placecategory' => array('Hotels')),
1143
-            "post_tags" => array(''),
1144
-            "geodir_video" => '',
1145
-            "geodir_timing" => 'Daily : 11 am to 11 pm',
1146
-            "geodir_contact" => '(143) 888-8888',
1147
-            "geodir_email" => '[email protected]',
1148
-            "geodir_website" => 'http://www.alexanderinn.com/',
1149
-            "geodir_twitter" => 'http://twitter.com/alexanderinn',
1150
-            "geodir_facebook" => 'http://facebook.com/alexanderinn',
1151
-            "post_dummy" => '1'
1152
-        );
1153
-
1154
-        ////post end///
1155
-        /// Hotels ////post start 8///
1156
-        break;
1157
-    case 19:
1158
-
1159
-
1160
-        $image_array = array();
1161
-        $post_meta = array();
1162
-
1163
-        /// Hotels ////post start 9///
1164
-        $image_array[] = "$dummy_image_url/hotels5.jpg";
1165
-        $image_array[] = "$dummy_image_url/hotels10.jpg";
1166
-        $image_array[] = "$dummy_image_url/hotels12.jpg";
1167
-        $image_array[] = "$dummy_image_url/hotels4.jpg";
1168
-        $image_array[] = "$dummy_image_url/hotels1.jpg";
1169
-        $image_array[] = "$dummy_image_url/hotels6.jpg";
1170
-        $image_array[] = "$dummy_image_url/hotels7.jpg";
1171
-        $image_array[] = "$dummy_image_url/hotels8.jpg";
1172
-        $image_array[] = "$dummy_image_url/hotels9.jpg";
1173
-        $image_array[] = "$dummy_image_url/hotels1.jpg";
1174
-        $image_array[] = "$dummy_image_url/hotels2.jpg";
1175
-
1176
-        $post_info[] = array(
1177
-            "listing_type" => 'gd_place',
1178
-            "post_title" => 'Best Western Center City Hotel',
1179
-            "post_desc" => '
1141
+			"post_images" => $image_array,
1142
+			"post_category" => array('gd_placecategory' => array('Hotels')),
1143
+			"post_tags" => array(''),
1144
+			"geodir_video" => '',
1145
+			"geodir_timing" => 'Daily : 11 am to 11 pm',
1146
+			"geodir_contact" => '(143) 888-8888',
1147
+			"geodir_email" => '[email protected]',
1148
+			"geodir_website" => 'http://www.alexanderinn.com/',
1149
+			"geodir_twitter" => 'http://twitter.com/alexanderinn',
1150
+			"geodir_facebook" => 'http://facebook.com/alexanderinn',
1151
+			"post_dummy" => '1'
1152
+		);
1153
+
1154
+		////post end///
1155
+		/// Hotels ////post start 8///
1156
+		break;
1157
+	case 19:
1158
+
1159
+
1160
+		$image_array = array();
1161
+		$post_meta = array();
1162
+
1163
+		/// Hotels ////post start 9///
1164
+		$image_array[] = "$dummy_image_url/hotels5.jpg";
1165
+		$image_array[] = "$dummy_image_url/hotels10.jpg";
1166
+		$image_array[] = "$dummy_image_url/hotels12.jpg";
1167
+		$image_array[] = "$dummy_image_url/hotels4.jpg";
1168
+		$image_array[] = "$dummy_image_url/hotels1.jpg";
1169
+		$image_array[] = "$dummy_image_url/hotels6.jpg";
1170
+		$image_array[] = "$dummy_image_url/hotels7.jpg";
1171
+		$image_array[] = "$dummy_image_url/hotels8.jpg";
1172
+		$image_array[] = "$dummy_image_url/hotels9.jpg";
1173
+		$image_array[] = "$dummy_image_url/hotels1.jpg";
1174
+		$image_array[] = "$dummy_image_url/hotels2.jpg";
1175
+
1176
+		$post_info[] = array(
1177
+			"listing_type" => 'gd_place',
1178
+			"post_title" => 'Best Western Center City Hotel',
1179
+			"post_desc" => '
1180 1180
 	The Alexander Inn is one of Philadelphia&acute;s most popular and reasonably priced small hotels.
1181 1181
 	
1182 1182
 	Conveniently located in the heart of the Washington Square West neighborhood in Center City Philadelphia, the Alexander Inn is a great place to base your stay in Philadelphia.
@@ -1185,91 +1185,91 @@  discard block
 block discarded – undo
1185 1185
 	
1186 1186
 	Rooms are also fitted with DirecTV (including many complimentary channels like CNN, ESPN, eight movie channels, etc.) and telephones with modem ports and direct dial. You will also have access to the hotel&acute;s free 24-hour fitness and e-mail centers.  
1187 1187
 	',
1188
-            "post_images" => $image_array,
1189
-            "post_category" => array('gd_placecategory' => array('Hotels', 'Food Nightlife')),
1190
-            "post_tags" => array(''),
1191
-            "geodir_video" => '',
1192
-            "geodir_timing" => 'Daily : 10 am to 11 pm',
1193
-            "geodir_contact" => '(243) 222-12344',
1194
-            "geodir_email" => '[email protected]',
1195
-            "geodir_website" => 'http://book.bestwestern.com/bestwestern/productInfo.do?propertyCode=39087',
1196
-            "geodir_twitter" => 'http://twitter.com/bestwestern',
1197
-            "geodir_facebook" => 'http://facebook.com/bestwestern',
1198
-            "post_dummy" => '1'
1199
-        );
1200
-
1201
-        ////post end///
1202
-        /// Hotels ////post start 9///
1203
-        break;
1204
-    case 20:
1205
-
1206
-
1207
-        $image_array = array();
1208
-        $post_meta = array();
1209
-
1210
-        /// Hotels ////post start 10///
1211
-        $image_array[] = "$dummy_image_url/hotels7.jpg";
1212
-        $image_array[] = "$dummy_image_url/hotels10.jpg";
1213
-        $image_array[] = "$dummy_image_url/hotels12.jpg";
1214
-        $image_array[] = "$dummy_image_url/hotels4.jpg";
1215
-        $image_array[] = "$dummy_image_url/hotels1.jpg";
1216
-        $image_array[] = "$dummy_image_url/hotels6.jpg";
1217
-        $image_array[] = "$dummy_image_url/hotels12.jpg";
1218
-        $image_array[] = "$dummy_image_url/hotels8.jpg";
1219
-        $image_array[] = "$dummy_image_url/hotels9.jpg";
1220
-        $image_array[] = "$dummy_image_url/hotels1.jpg";
1221
-        $image_array[] = "$dummy_image_url/hotels2.jpg";
1222
-
1223
-        $post_info[] = array(
1224
-            "listing_type" => 'gd_place',
1225
-            "post_title" => 'Chestnut Hill Hotel',
1226
-            "post_desc" => '
1188
+			"post_images" => $image_array,
1189
+			"post_category" => array('gd_placecategory' => array('Hotels', 'Food Nightlife')),
1190
+			"post_tags" => array(''),
1191
+			"geodir_video" => '',
1192
+			"geodir_timing" => 'Daily : 10 am to 11 pm',
1193
+			"geodir_contact" => '(243) 222-12344',
1194
+			"geodir_email" => '[email protected]',
1195
+			"geodir_website" => 'http://book.bestwestern.com/bestwestern/productInfo.do?propertyCode=39087',
1196
+			"geodir_twitter" => 'http://twitter.com/bestwestern',
1197
+			"geodir_facebook" => 'http://facebook.com/bestwestern',
1198
+			"post_dummy" => '1'
1199
+		);
1200
+
1201
+		////post end///
1202
+		/// Hotels ////post start 9///
1203
+		break;
1204
+	case 20:
1205
+
1206
+
1207
+		$image_array = array();
1208
+		$post_meta = array();
1209
+
1210
+		/// Hotels ////post start 10///
1211
+		$image_array[] = "$dummy_image_url/hotels7.jpg";
1212
+		$image_array[] = "$dummy_image_url/hotels10.jpg";
1213
+		$image_array[] = "$dummy_image_url/hotels12.jpg";
1214
+		$image_array[] = "$dummy_image_url/hotels4.jpg";
1215
+		$image_array[] = "$dummy_image_url/hotels1.jpg";
1216
+		$image_array[] = "$dummy_image_url/hotels6.jpg";
1217
+		$image_array[] = "$dummy_image_url/hotels12.jpg";
1218
+		$image_array[] = "$dummy_image_url/hotels8.jpg";
1219
+		$image_array[] = "$dummy_image_url/hotels9.jpg";
1220
+		$image_array[] = "$dummy_image_url/hotels1.jpg";
1221
+		$image_array[] = "$dummy_image_url/hotels2.jpg";
1222
+
1223
+		$post_info[] = array(
1224
+			"listing_type" => 'gd_place',
1225
+			"post_title" => 'Chestnut Hill Hotel',
1226
+			"post_desc" => '
1227 1227
 	The Chestnut Hill Hotel is located in the historic community of Chestnut Hill, approximately nine miles northwest from Center City Philadelphia. Although Chestnut Hill is close to Center City by today&acute;s standards, it was originally a distant “suburb” on the outskirts of the Philadelphia countryside.
1228 1228
 	
1229 1229
 	Today, it is one of the region&acute;s most charming neighborhoods. Tree-lined streets and grand estates surround its main street, Germantown Avenue, where you can stroll and shop at more than 200 specialty shops and restaurants, along with trendy salons and other modern boutiques.
1230 1230
 	
1231 1231
 	The Chestnut Hill Hotel fits perfectly in this setting - the hotel&acute;s 36 rooms and suites, decorated in an 18th-century style, hold the hotel to its boutique roots. It&acute;s a perfect place at which to enjoy a romantic getaway in Philadelphia. 
1232 1232
 	',
1233
-            "post_images" => $image_array,
1234
-            "post_category" => array('gd_placecategory' => array('Hotels', 'Feature')),
1235
-            "post_tags" => array(''),
1236
-            "geodir_video" => '',
1237
-            "geodir_timing" => 'Daily : 10 am to 11 pm',
1238
-            "geodir_contact" => '(243) 222-12344',
1239
-            "geodir_email" => '[email protected]',
1240
-            "geodir_website" => 'http://www.chestnuthillhotel.com/',
1241
-            "geodir_twitter" => 'http://twitter.com/chestnuthillhotel',
1242
-            "geodir_facebook" => 'http://facebook.com/chestnuthillhotel',
1243
-            "post_dummy" => '1'
1244
-        );
1245
-
1246
-        ////post end///
1247
-        /// Hotels ////post start 10///
1248
-
1249
-        break;
1250
-    case 21:
1251
-
1252
-
1253
-        $image_array = array();
1254
-        $post_meta = array();
1255
-
1256
-        /// Restaurants ////post start 1//
1257
-        $image_array[] = "$dummy_image_url/restaurants1.jpg";
1258
-        $image_array[] = "$dummy_image_url/restaurants2.jpg";
1259
-        $image_array[] = "$dummy_image_url/restaurants3.jpg";
1260
-        $image_array[] = "$dummy_image_url/restaurants4.jpg";
1261
-        $image_array[] = "$dummy_image_url/restaurants5.jpg";
1262
-        $image_array[] = "$dummy_image_url/restaurants6.jpg";
1263
-        $image_array[] = "$dummy_image_url/restaurants7.jpg";
1264
-        $image_array[] = "$dummy_image_url/restaurants8.jpg";
1265
-        $image_array[] = "$dummy_image_url/restaurants9.jpg";
1266
-        $image_array[] = "$dummy_image_url/restaurants10.jpg";
1267
-        $image_array[] = "$dummy_image_url/restaurants11.jpg";
1268
-
1269
-        $post_info[] = array(
1270
-            "listing_type" => 'gd_place',
1271
-            "post_title" => 'Village Whiskey',
1272
-            "post_desc" => '
1233
+			"post_images" => $image_array,
1234
+			"post_category" => array('gd_placecategory' => array('Hotels', 'Feature')),
1235
+			"post_tags" => array(''),
1236
+			"geodir_video" => '',
1237
+			"geodir_timing" => 'Daily : 10 am to 11 pm',
1238
+			"geodir_contact" => '(243) 222-12344',
1239
+			"geodir_email" => '[email protected]',
1240
+			"geodir_website" => 'http://www.chestnuthillhotel.com/',
1241
+			"geodir_twitter" => 'http://twitter.com/chestnuthillhotel',
1242
+			"geodir_facebook" => 'http://facebook.com/chestnuthillhotel',
1243
+			"post_dummy" => '1'
1244
+		);
1245
+
1246
+		////post end///
1247
+		/// Hotels ////post start 10///
1248
+
1249
+		break;
1250
+	case 21:
1251
+
1252
+
1253
+		$image_array = array();
1254
+		$post_meta = array();
1255
+
1256
+		/// Restaurants ////post start 1//
1257
+		$image_array[] = "$dummy_image_url/restaurants1.jpg";
1258
+		$image_array[] = "$dummy_image_url/restaurants2.jpg";
1259
+		$image_array[] = "$dummy_image_url/restaurants3.jpg";
1260
+		$image_array[] = "$dummy_image_url/restaurants4.jpg";
1261
+		$image_array[] = "$dummy_image_url/restaurants5.jpg";
1262
+		$image_array[] = "$dummy_image_url/restaurants6.jpg";
1263
+		$image_array[] = "$dummy_image_url/restaurants7.jpg";
1264
+		$image_array[] = "$dummy_image_url/restaurants8.jpg";
1265
+		$image_array[] = "$dummy_image_url/restaurants9.jpg";
1266
+		$image_array[] = "$dummy_image_url/restaurants10.jpg";
1267
+		$image_array[] = "$dummy_image_url/restaurants11.jpg";
1268
+
1269
+		$post_info[] = array(
1270
+			"listing_type" => 'gd_place',
1271
+			"post_title" => 'Village Whiskey',
1272
+			"post_desc" => '
1273 1273
 	
1274 1274
 	
1275 1275
 	Located in a Rittenhouse Square space evoking the free-wheeling spirit of a speakeasy, Village Whiskey is prolific Chef Jose Garces’ intimate, 30-seat tribute to the time-honored liquor.
@@ -1295,45 +1295,45 @@  discard block
 block discarded – undo
1295 1295
 	
1296 1296
 	During the warmer months, diners can sit at large, wooden tables placed along Sansom Street for whiskey alfresco.
1297 1297
 	',
1298
-            "post_images" => $image_array,
1299
-            "post_category" => array('gd_placecategory' => array('Restaurants', 'Feature')),
1300
-            "post_tags" => array('Sample Tag1'),
1301
-            "geodir_video" => '',
1302
-            "geodir_timing" => 'Daily : 10 am to 11 pm',
1303
-            "geodir_contact" => '(243) 222-12344',
1304
-            "geodir_email" => '[email protected]',
1305
-            "geodir_website" => 'http://www.villagewhiskey.com/',
1306
-            "geodir_twitter" => 'http://twitter.com/villagewhiskey',
1307
-            "geodir_facebook" => 'http://facebook.com/villagewhiskey',
1308
-            "post_dummy" => '1'
1309
-        );
1310
-
1311
-        ////post end///
1312
-        /// Restaurants ////post start 1///
1313
-        break;
1314
-    case 22:
1315
-
1316
-
1317
-        $image_array = array();
1318
-        $post_meta = array();
1319
-
1320
-        /// Restaurants ////post start 2//
1321
-        $image_array[] = "$dummy_image_url/restaurants4.jpg";
1322
-        $image_array[] = "$dummy_image_url/restaurants2.jpg";
1323
-        $image_array[] = "$dummy_image_url/restaurants3.jpg";
1324
-        $image_array[] = "$dummy_image_url/restaurants1.jpg";
1325
-        $image_array[] = "$dummy_image_url/restaurants5.jpg";
1326
-        $image_array[] = "$dummy_image_url/restaurants6.jpg";
1327
-        $image_array[] = "$dummy_image_url/restaurants7.jpg";
1328
-        $image_array[] = "$dummy_image_url/restaurants8.jpg";
1329
-        $image_array[] = "$dummy_image_url/restaurants9.jpg";
1330
-        $image_array[] = "$dummy_image_url/restaurants10.jpg";
1331
-        $image_array[] = "$dummy_image_url/restaurants11.jpg";
1332
-
1333
-        $post_info[] = array(
1334
-            "listing_type" => 'gd_place',
1335
-            "post_title" => 'Zavino Pizzeria and Wine Bar',
1336
-            "post_desc" => '
1298
+			"post_images" => $image_array,
1299
+			"post_category" => array('gd_placecategory' => array('Restaurants', 'Feature')),
1300
+			"post_tags" => array('Sample Tag1'),
1301
+			"geodir_video" => '',
1302
+			"geodir_timing" => 'Daily : 10 am to 11 pm',
1303
+			"geodir_contact" => '(243) 222-12344',
1304
+			"geodir_email" => '[email protected]',
1305
+			"geodir_website" => 'http://www.villagewhiskey.com/',
1306
+			"geodir_twitter" => 'http://twitter.com/villagewhiskey',
1307
+			"geodir_facebook" => 'http://facebook.com/villagewhiskey',
1308
+			"post_dummy" => '1'
1309
+		);
1310
+
1311
+		////post end///
1312
+		/// Restaurants ////post start 1///
1313
+		break;
1314
+	case 22:
1315
+
1316
+
1317
+		$image_array = array();
1318
+		$post_meta = array();
1319
+
1320
+		/// Restaurants ////post start 2//
1321
+		$image_array[] = "$dummy_image_url/restaurants4.jpg";
1322
+		$image_array[] = "$dummy_image_url/restaurants2.jpg";
1323
+		$image_array[] = "$dummy_image_url/restaurants3.jpg";
1324
+		$image_array[] = "$dummy_image_url/restaurants1.jpg";
1325
+		$image_array[] = "$dummy_image_url/restaurants5.jpg";
1326
+		$image_array[] = "$dummy_image_url/restaurants6.jpg";
1327
+		$image_array[] = "$dummy_image_url/restaurants7.jpg";
1328
+		$image_array[] = "$dummy_image_url/restaurants8.jpg";
1329
+		$image_array[] = "$dummy_image_url/restaurants9.jpg";
1330
+		$image_array[] = "$dummy_image_url/restaurants10.jpg";
1331
+		$image_array[] = "$dummy_image_url/restaurants11.jpg";
1332
+
1333
+		$post_info[] = array(
1334
+			"listing_type" => 'gd_place',
1335
+			"post_title" => 'Zavino Pizzeria and Wine Bar',
1336
+			"post_desc" => '
1337 1337
 	Zavino is a new pizzeria and wine bar located at the epicenter of the city&acute;s trendy Midtown Village neighborhood. The restaurant features a seasonal menu, classic cocktails, an approachable selection of wine and beer and some of the best late night menu offerings in the area.
1338 1338
 	
1339 1339
 	The restaurant&acute;s interior looks great - it has a simple, rustic feel with an original brick wall, large picture windows, a long bar and a large outdoor cafe coming this spring.
@@ -1352,46 +1352,46 @@  discard block
 block discarded – undo
1352 1352
 	
1353 1353
 	Pizzas vary in price from $8 to $12.
1354 1354
 	',
1355
-            "post_images" => $image_array,
1356
-            "post_category" => array('gd_placecategory' => array('Restaurants')),
1357
-            "post_tags" => array('Sample Tag1'),
1358
-            "geodir_video" => '',
1359
-            "geodir_timing" => 'Daily : 10 am to 11 pm',
1360
-            "geodir_contact" => '(243) 222-12344',
1361
-            "geodir_email" => '[email protected]',
1362
-            "geodir_website" => 'http://www.villagewhiskey.com/',
1363
-            "geodir_twitter" => 'http://twitter.com/villagewhiskey',
1364
-            "geodir_facebook" => 'http://facebook.com/villagewhiskey',
1365
-            "post_dummy" => '1'
1366
-        );
1367
-
1368
-        ////post end///
1369
-        /// Restaurants ////post start 2///
1370
-
1371
-        break;
1372
-    case 23:
1373
-
1374
-
1375
-        $image_array = array();
1376
-        $post_meta = array();
1377
-
1378
-        /// Restaurants ////post start 3//
1379
-        $image_array[] = "$dummy_image_url/restaurants5.jpg";
1380
-        $image_array[] = "$dummy_image_url/restaurants6.jpg";
1381
-        $image_array[] = "$dummy_image_url/restaurants7.jpg";
1382
-        $image_array[] = "$dummy_image_url/restaurants1.jpg";
1383
-        $image_array[] = "$dummy_image_url/restaurants2.jpg";
1384
-        $image_array[] = "$dummy_image_url/restaurants3.jpg";
1385
-        $image_array[] = "$dummy_image_url/restaurants4.jpg";
1386
-        $image_array[] = "$dummy_image_url/restaurants8.jpg";
1387
-        $image_array[] = "$dummy_image_url/restaurants9.jpg";
1388
-        $image_array[] = "$dummy_image_url/restaurants10.jpg";
1389
-        $image_array[] = "$dummy_image_url/restaurants11.jpg";
1390
-
1391
-        $post_info[] = array(
1392
-            "listing_type" => 'gd_place',
1393
-            "post_title" => 'Parc',
1394
-            "post_desc" => '
1355
+			"post_images" => $image_array,
1356
+			"post_category" => array('gd_placecategory' => array('Restaurants')),
1357
+			"post_tags" => array('Sample Tag1'),
1358
+			"geodir_video" => '',
1359
+			"geodir_timing" => 'Daily : 10 am to 11 pm',
1360
+			"geodir_contact" => '(243) 222-12344',
1361
+			"geodir_email" => '[email protected]',
1362
+			"geodir_website" => 'http://www.villagewhiskey.com/',
1363
+			"geodir_twitter" => 'http://twitter.com/villagewhiskey',
1364
+			"geodir_facebook" => 'http://facebook.com/villagewhiskey',
1365
+			"post_dummy" => '1'
1366
+		);
1367
+
1368
+		////post end///
1369
+		/// Restaurants ////post start 2///
1370
+
1371
+		break;
1372
+	case 23:
1373
+
1374
+
1375
+		$image_array = array();
1376
+		$post_meta = array();
1377
+
1378
+		/// Restaurants ////post start 3//
1379
+		$image_array[] = "$dummy_image_url/restaurants5.jpg";
1380
+		$image_array[] = "$dummy_image_url/restaurants6.jpg";
1381
+		$image_array[] = "$dummy_image_url/restaurants7.jpg";
1382
+		$image_array[] = "$dummy_image_url/restaurants1.jpg";
1383
+		$image_array[] = "$dummy_image_url/restaurants2.jpg";
1384
+		$image_array[] = "$dummy_image_url/restaurants3.jpg";
1385
+		$image_array[] = "$dummy_image_url/restaurants4.jpg";
1386
+		$image_array[] = "$dummy_image_url/restaurants8.jpg";
1387
+		$image_array[] = "$dummy_image_url/restaurants9.jpg";
1388
+		$image_array[] = "$dummy_image_url/restaurants10.jpg";
1389
+		$image_array[] = "$dummy_image_url/restaurants11.jpg";
1390
+
1391
+		$post_info[] = array(
1392
+			"listing_type" => 'gd_place',
1393
+			"post_title" => 'Parc',
1394
+			"post_desc" => '
1395 1395
 	If you love Paris in the springtime, Parc is a veritable grand cru.
1396 1396
 	
1397 1397
 	With Parc, famed restaurateur Stephen Starr brings a certain je ne sais quoi to Rittenhouse Square. Parc offers an authentic French bistro experience, fully equipped with a chic Parisian ambiance and gorgeous sidewalk seating overlooking the Square.
@@ -1419,45 +1419,45 @@  discard block
 block discarded – undo
1419 1419
 	
1420 1420
 	To put it simply, Parc is nothing short of an authentic Parisian dining experience - right here in the heart of Rittenhouse Square.
1421 1421
 	',
1422
-            "post_images" => $image_array,
1423
-            "post_category" => array('gd_placecategory' => array('Restaurants')),
1424
-            "post_tags" => array('Sample Tag1'),
1425
-            "geodir_video" => '',
1426
-            "geodir_timing" => 'Daily : 10 am to 12 pm',
1427
-            "geodir_contact" => '(143) 222-12344',
1428
-            "geodir_email" => '[email protected]',
1429
-            "geodir_website" => 'http://www.parc-restaurant.com/',
1430
-            "geodir_twitter" => 'http://twitter.com/parc-restaurant',
1431
-            "geodir_facebook" => 'http://facebook.com/parc-restaurant',
1432
-            "post_dummy" => '1'
1433
-        );
1434
-
1435
-        ////post end///
1436
-        /// Restaurants ////post start 3///
1437
-        break;
1438
-    case 24:
1439
-
1440
-
1441
-        $image_array = array();
1442
-        $post_meta = array();
1443
-
1444
-        /// Restaurants ////post start 4//
1445
-        $image_array[] = "$dummy_image_url/restaurants9.jpg";
1446
-        $image_array[] = "$dummy_image_url/restaurants10.jpg";
1447
-        $image_array[] = "$dummy_image_url/restaurants3.jpg";
1448
-        $image_array[] = "$dummy_image_url/restaurants1.jpg";
1449
-        $image_array[] = "$dummy_image_url/restaurants5.jpg";
1450
-        $image_array[] = "$dummy_image_url/restaurants6.jpg";
1451
-        $image_array[] = "$dummy_image_url/restaurants7.jpg";
1452
-        $image_array[] = "$dummy_image_url/restaurants8.jpg";
1453
-        $image_array[] = "$dummy_image_url/restaurants9.jpg";
1454
-        $image_array[] = "$dummy_image_url/restaurants2.jpg";
1455
-        $image_array[] = "$dummy_image_url/restaurants4.jpg";
1456
-
1457
-        $post_info[] = array(
1458
-            "listing_type" => 'gd_place',
1459
-            "post_title" => 'Percy Street Barbecue',
1460
-            "post_desc" => '
1422
+			"post_images" => $image_array,
1423
+			"post_category" => array('gd_placecategory' => array('Restaurants')),
1424
+			"post_tags" => array('Sample Tag1'),
1425
+			"geodir_video" => '',
1426
+			"geodir_timing" => 'Daily : 10 am to 12 pm',
1427
+			"geodir_contact" => '(143) 222-12344',
1428
+			"geodir_email" => '[email protected]',
1429
+			"geodir_website" => 'http://www.parc-restaurant.com/',
1430
+			"geodir_twitter" => 'http://twitter.com/parc-restaurant',
1431
+			"geodir_facebook" => 'http://facebook.com/parc-restaurant',
1432
+			"post_dummy" => '1'
1433
+		);
1434
+
1435
+		////post end///
1436
+		/// Restaurants ////post start 3///
1437
+		break;
1438
+	case 24:
1439
+
1440
+
1441
+		$image_array = array();
1442
+		$post_meta = array();
1443
+
1444
+		/// Restaurants ////post start 4//
1445
+		$image_array[] = "$dummy_image_url/restaurants9.jpg";
1446
+		$image_array[] = "$dummy_image_url/restaurants10.jpg";
1447
+		$image_array[] = "$dummy_image_url/restaurants3.jpg";
1448
+		$image_array[] = "$dummy_image_url/restaurants1.jpg";
1449
+		$image_array[] = "$dummy_image_url/restaurants5.jpg";
1450
+		$image_array[] = "$dummy_image_url/restaurants6.jpg";
1451
+		$image_array[] = "$dummy_image_url/restaurants7.jpg";
1452
+		$image_array[] = "$dummy_image_url/restaurants8.jpg";
1453
+		$image_array[] = "$dummy_image_url/restaurants9.jpg";
1454
+		$image_array[] = "$dummy_image_url/restaurants2.jpg";
1455
+		$image_array[] = "$dummy_image_url/restaurants4.jpg";
1456
+
1457
+		$post_info[] = array(
1458
+			"listing_type" => 'gd_place',
1459
+			"post_title" => 'Percy Street Barbecue',
1460
+			"post_desc" => '
1461 1461
 	Percy Street Barbecue sees the South Street debut of restaurateurs Steven Cook and Michael Solomonov (Zahav, Xochitl).
1462 1462
 	
1463 1463
 	Serving a straightforward selection of slowly smoked meats and homey side dishes alongside craft beers and tasty cocktails, Percy Street is an ideal venue for Chef Erin OShea much-lauded Southern cooking, and is on its way to become the city top spot for barbecue.
@@ -1483,46 +1483,46 @@  discard block
 block discarded – undo
1483 1483
 	
1484 1484
 	Seating in the form of repurposed church pews, and bare light bulbs overhead in the dining room lend to the restaurant Texas-esque aesthetic.
1485 1485
 	',
1486
-            "post_images" => $image_array,
1487
-            "post_category" => array('gd_placecategory' => array('Restaurants', 'Feature')),
1488
-            "post_tags" => array('Sample Tag1'),
1489
-            "geodir_video" => '',
1490
-            "geodir_timing" => 'Percy Street is closed on Mondays. The restaurant is also open for weekend lunch/brunch from 11:30 a.m. to 2:30 p.m.',
1491
-            "geodir_contact" => '(143) 222-12344',
1492
-            "geodir_email" => '[email protected]',
1493
-            "geodir_website" => 'http://www.percystreet.com/',
1494
-            "geodir_twitter" => 'http://twitter.com/percystreet',
1495
-            "geodir_facebook" => 'http://facebook.com/percystreet',
1496
-            "post_dummy" => '1'
1497
-        );
1498
-
1499
-        ////post end///
1500
-        /// Restaurants ////post start 4///
1501
-
1502
-        break;
1503
-    case 25:
1504
-
1505
-
1506
-        $image_array = array();
1507
-        $post_meta = array();
1508
-
1509
-        /// Restaurants ////post start 5//
1510
-        $image_array[] = "$dummy_image_url/restaurants4.jpg";
1511
-        $image_array[] = "$dummy_image_url/restaurants10.jpg";
1512
-        $image_array[] = "$dummy_image_url/restaurants3.jpg";
1513
-        $image_array[] = "$dummy_image_url/restaurants1.jpg";
1514
-        $image_array[] = "$dummy_image_url/restaurants5.jpg";
1515
-        $image_array[] = "$dummy_image_url/restaurants6.jpg";
1516
-        $image_array[] = "$dummy_image_url/restaurants7.jpg";
1517
-        $image_array[] = "$dummy_image_url/restaurants8.jpg";
1518
-        $image_array[] = "$dummy_image_url/restaurants9.jpg";
1519
-        $image_array[] = "$dummy_image_url/restaurants2.jpg";
1520
-        $image_array[] = "$dummy_image_url/restaurants4.jpg";
1521
-
1522
-        $post_info[] = array(
1523
-            "listing_type" => 'gd_place',
1524
-            "post_title" => 'The Fountain Restaurant',
1525
-            "post_desc" => '
1486
+			"post_images" => $image_array,
1487
+			"post_category" => array('gd_placecategory' => array('Restaurants', 'Feature')),
1488
+			"post_tags" => array('Sample Tag1'),
1489
+			"geodir_video" => '',
1490
+			"geodir_timing" => 'Percy Street is closed on Mondays. The restaurant is also open for weekend lunch/brunch from 11:30 a.m. to 2:30 p.m.',
1491
+			"geodir_contact" => '(143) 222-12344',
1492
+			"geodir_email" => '[email protected]',
1493
+			"geodir_website" => 'http://www.percystreet.com/',
1494
+			"geodir_twitter" => 'http://twitter.com/percystreet',
1495
+			"geodir_facebook" => 'http://facebook.com/percystreet',
1496
+			"post_dummy" => '1'
1497
+		);
1498
+
1499
+		////post end///
1500
+		/// Restaurants ////post start 4///
1501
+
1502
+		break;
1503
+	case 25:
1504
+
1505
+
1506
+		$image_array = array();
1507
+		$post_meta = array();
1508
+
1509
+		/// Restaurants ////post start 5//
1510
+		$image_array[] = "$dummy_image_url/restaurants4.jpg";
1511
+		$image_array[] = "$dummy_image_url/restaurants10.jpg";
1512
+		$image_array[] = "$dummy_image_url/restaurants3.jpg";
1513
+		$image_array[] = "$dummy_image_url/restaurants1.jpg";
1514
+		$image_array[] = "$dummy_image_url/restaurants5.jpg";
1515
+		$image_array[] = "$dummy_image_url/restaurants6.jpg";
1516
+		$image_array[] = "$dummy_image_url/restaurants7.jpg";
1517
+		$image_array[] = "$dummy_image_url/restaurants8.jpg";
1518
+		$image_array[] = "$dummy_image_url/restaurants9.jpg";
1519
+		$image_array[] = "$dummy_image_url/restaurants2.jpg";
1520
+		$image_array[] = "$dummy_image_url/restaurants4.jpg";
1521
+
1522
+		$post_info[] = array(
1523
+			"listing_type" => 'gd_place',
1524
+			"post_title" => 'The Fountain Restaurant',
1525
+			"post_desc" => '
1526 1526
 	The Fountain Restaurant in the Four Seasons Hotel Philadelphia has received seemingly every type of accolade there is, from top honors in Gourmet magazine to Forbes Travel Guide&acute;s 2010 Five Star award to a perfect Five Diamond rating from AAA. It&acute;s been a Philadelphia favorite for special occasion meals for decades.
1527 1527
 	
1528 1528
 	Additionally rated as the best restaurant in Philadelphia by Zagat&acute;s, the Fountain Restaurant overlooks the majestic Swann Memorial Fountain sculpture by Alexander Stirling Calder in the center of Logan Square. You&acute;ll also enjoy sweeping views of the grand Benjamin Franklin Parkway and its gorgeous Beaux Arts architecture.
@@ -1532,45 +1532,45 @@  discard block
 block discarded – undo
1532 1532
 	You can order a la carte or select the prix fix option to enjoy the “spontaneous tastes” menu which gives the chef control of a few courses. The menu changes regularly, but you can expect to see globaly influenced items like Pan-fried Veal Sweetbreads, Braised Dover Sole Roulade, Sautéed Venison Medallions and Roasted Australian Lamb Saddle.
1533 1533
 	
1534 1534
 	',
1535
-            "post_images" => $image_array,
1536
-            "post_category" => array('gd_placecategory' => array('Restaurants')),
1537
-            "post_tags" => array('food'),
1538
-            "geodir_video" => '',
1539
-            "geodir_timing" => 'The restaurant is also open for weekend lunch/brunch from 11:30 a.m. to 2:30 p.m.',
1540
-            "geodir_contact" => '(103) 100-12344',
1541
-            "geodir_email" => '[email protected]',
1542
-            "geodir_website" => 'http://www.fourseasons.com/philadelphia/dining',
1543
-            "geodir_twitter" => 'http://twitter.com/fourseasons',
1544
-            "geodir_facebook" => 'http://facebook.com/fourseasons',
1545
-            "post_dummy" => '1'
1546
-        );
1547
-
1548
-        ////post end///
1549
-        /// Restaurants ////post start 5///
1550
-        break;
1551
-    case 26:
1552
-
1553
-
1554
-        $image_array = array();
1555
-        $post_meta = array();
1556
-
1557
-        /// Restaurants ////post start 6//
1558
-        $image_array[] = "$dummy_image_url/restaurants11.jpg";
1559
-        $image_array[] = "$dummy_image_url/restaurants10.jpg";
1560
-        $image_array[] = "$dummy_image_url/restaurants3.jpg";
1561
-        $image_array[] = "$dummy_image_url/restaurants1.jpg";
1562
-        $image_array[] = "$dummy_image_url/restaurants5.jpg";
1563
-        $image_array[] = "$dummy_image_url/restaurants6.jpg";
1564
-        $image_array[] = "$dummy_image_url/restaurants7.jpg";
1565
-        $image_array[] = "$dummy_image_url/restaurants8.jpg";
1566
-        $image_array[] = "$dummy_image_url/restaurants9.jpg";
1567
-        $image_array[] = "$dummy_image_url/restaurants2.jpg";
1568
-        $image_array[] = "$dummy_image_url/restaurants4.jpg";
1569
-
1570
-        $post_info[] = array(
1571
-            "listing_type" => 'gd_place',
1572
-            "post_title" => 'Lacroix at The Rittenhouse',
1573
-            "post_desc" => '
1535
+			"post_images" => $image_array,
1536
+			"post_category" => array('gd_placecategory' => array('Restaurants')),
1537
+			"post_tags" => array('food'),
1538
+			"geodir_video" => '',
1539
+			"geodir_timing" => 'The restaurant is also open for weekend lunch/brunch from 11:30 a.m. to 2:30 p.m.',
1540
+			"geodir_contact" => '(103) 100-12344',
1541
+			"geodir_email" => '[email protected]',
1542
+			"geodir_website" => 'http://www.fourseasons.com/philadelphia/dining',
1543
+			"geodir_twitter" => 'http://twitter.com/fourseasons',
1544
+			"geodir_facebook" => 'http://facebook.com/fourseasons',
1545
+			"post_dummy" => '1'
1546
+		);
1547
+
1548
+		////post end///
1549
+		/// Restaurants ////post start 5///
1550
+		break;
1551
+	case 26:
1552
+
1553
+
1554
+		$image_array = array();
1555
+		$post_meta = array();
1556
+
1557
+		/// Restaurants ////post start 6//
1558
+		$image_array[] = "$dummy_image_url/restaurants11.jpg";
1559
+		$image_array[] = "$dummy_image_url/restaurants10.jpg";
1560
+		$image_array[] = "$dummy_image_url/restaurants3.jpg";
1561
+		$image_array[] = "$dummy_image_url/restaurants1.jpg";
1562
+		$image_array[] = "$dummy_image_url/restaurants5.jpg";
1563
+		$image_array[] = "$dummy_image_url/restaurants6.jpg";
1564
+		$image_array[] = "$dummy_image_url/restaurants7.jpg";
1565
+		$image_array[] = "$dummy_image_url/restaurants8.jpg";
1566
+		$image_array[] = "$dummy_image_url/restaurants9.jpg";
1567
+		$image_array[] = "$dummy_image_url/restaurants2.jpg";
1568
+		$image_array[] = "$dummy_image_url/restaurants4.jpg";
1569
+
1570
+		$post_info[] = array(
1571
+			"listing_type" => 'gd_place',
1572
+			"post_title" => 'Lacroix at The Rittenhouse',
1573
+			"post_desc" => '
1574 1574
 	A deluxe hotel like The Rittenhouse deserves a deluxe restaurant, a fitting description for Lacroix, named “Restaurant of the Year” in 2003 by Esquire magazine.
1575 1575
 	
1576 1576
 	Located on the second floor of the Rittenhouse Hotel, Lacroix features elegant décor and a broad view of Rittenhouse Square, which combine to make the ambiance at Lacroix as enjoyable as the meal itself.
@@ -1581,46 +1581,46 @@  discard block
 block discarded – undo
1581 1581
 	
1582 1582
 	Sunday Brunch at Lacroix - which features such delectable dishes as baby lamb chops with garlic crust and banyuls sauce, niman ranch smoked bacon, quail eggs with artichoke, golden beet and shiitakes, and french baguette toast with apple, raspberry and rosemary jam - is also highly recommended.
1583 1583
 	',
1584
-            "post_images" => $image_array,
1585
-            "post_category" => array('gd_placecategory' => array('Restaurants')),
1586
-            "post_tags" => array('food'),
1587
-            "geodir_video" => '',
1588
-            "geodir_timing" => 'The restaurant is also open for weekend lunch/brunch from 10:30 a.m. to 6:30 p.m.',
1589
-            "geodir_contact" => '(113) 121-12344',
1590
-            "geodir_email" => '[email protected]',
1591
-            "geodir_website" => 'http://www.rittenhousehotel.com/lacroix.cfm',
1592
-            "geodir_twitter" => 'http://twitter.com/rittenhousehotel',
1593
-            "geodir_facebook" => 'http://facebook.com/rittenhousehotel',
1594
-            "post_dummy" => '1'
1595
-        );
1596
-
1597
-        ////post end///
1598
-        /// Restaurants ////post start 6///
1599
-
1600
-        break;
1601
-    case 27:
1602
-
1603
-
1604
-        $image_array = array();
1605
-        $post_meta = array();
1606
-
1607
-        /// Restaurants ////post start 7//
1608
-        $image_array[] = "$dummy_image_url/restaurants12.jpg";
1609
-        $image_array[] = "$dummy_image_url/restaurants13.jpg";
1610
-        $image_array[] = "$dummy_image_url/restaurants14.jpg";
1611
-        $image_array[] = "$dummy_image_url/restaurants15.jpg";
1612
-        $image_array[] = "$dummy_image_url/restaurants5.jpg";
1613
-        $image_array[] = "$dummy_image_url/restaurants6.jpg";
1614
-        $image_array[] = "$dummy_image_url/restaurants7.jpg";
1615
-        $image_array[] = "$dummy_image_url/restaurants8.jpg";
1616
-        $image_array[] = "$dummy_image_url/restaurants9.jpg";
1617
-        $image_array[] = "$dummy_image_url/restaurants2.jpg";
1618
-        $image_array[] = "$dummy_image_url/restaurants4.jpg";
1619
-
1620
-        $post_info[] = array(
1621
-            "listing_type" => 'gd_place',
1622
-            "post_title" => 'Lacroix at The Rittenhouse',
1623
-            "post_desc" => '
1584
+			"post_images" => $image_array,
1585
+			"post_category" => array('gd_placecategory' => array('Restaurants')),
1586
+			"post_tags" => array('food'),
1587
+			"geodir_video" => '',
1588
+			"geodir_timing" => 'The restaurant is also open for weekend lunch/brunch from 10:30 a.m. to 6:30 p.m.',
1589
+			"geodir_contact" => '(113) 121-12344',
1590
+			"geodir_email" => '[email protected]',
1591
+			"geodir_website" => 'http://www.rittenhousehotel.com/lacroix.cfm',
1592
+			"geodir_twitter" => 'http://twitter.com/rittenhousehotel',
1593
+			"geodir_facebook" => 'http://facebook.com/rittenhousehotel',
1594
+			"post_dummy" => '1'
1595
+		);
1596
+
1597
+		////post end///
1598
+		/// Restaurants ////post start 6///
1599
+
1600
+		break;
1601
+	case 27:
1602
+
1603
+
1604
+		$image_array = array();
1605
+		$post_meta = array();
1606
+
1607
+		/// Restaurants ////post start 7//
1608
+		$image_array[] = "$dummy_image_url/restaurants12.jpg";
1609
+		$image_array[] = "$dummy_image_url/restaurants13.jpg";
1610
+		$image_array[] = "$dummy_image_url/restaurants14.jpg";
1611
+		$image_array[] = "$dummy_image_url/restaurants15.jpg";
1612
+		$image_array[] = "$dummy_image_url/restaurants5.jpg";
1613
+		$image_array[] = "$dummy_image_url/restaurants6.jpg";
1614
+		$image_array[] = "$dummy_image_url/restaurants7.jpg";
1615
+		$image_array[] = "$dummy_image_url/restaurants8.jpg";
1616
+		$image_array[] = "$dummy_image_url/restaurants9.jpg";
1617
+		$image_array[] = "$dummy_image_url/restaurants2.jpg";
1618
+		$image_array[] = "$dummy_image_url/restaurants4.jpg";
1619
+
1620
+		$post_info[] = array(
1621
+			"listing_type" => 'gd_place',
1622
+			"post_title" => 'Lacroix at The Rittenhouse',
1623
+			"post_desc" => '
1624 1624
 	A deluxe hotel like The Rittenhouse deserves a deluxe restaurant, a fitting description for Lacroix, named “Restaurant of the Year” in 2003 by Esquire magazine.
1625 1625
 	
1626 1626
 	Located on the second floor of the Rittenhouse Hotel, Lacroix features elegant décor and a broad view of Rittenhouse Square, which combine to make the ambiance at Lacroix as enjoyable as the meal itself.
@@ -1631,45 +1631,45 @@  discard block
 block discarded – undo
1631 1631
 	
1632 1632
 	Sunday Brunch at Lacroix - which features such delectable dishes as baby lamb chops with garlic crust and banyuls sauce, niman ranch smoked bacon, quail eggs with artichoke, golden beet and shiitakes, and french baguette toast with apple, raspberry and rosemary jam - is also highly recommended.
1633 1633
 	',
1634
-            "post_images" => $image_array,
1635
-            "post_category" => array('gd_placecategory' => array('Restaurants', 'Food Nightlife')),
1636
-            "post_tags" => array('food'),
1637
-            "geodir_video" => '',
1638
-            "geodir_timing" => 'The restaurant is also open for weekend lunch/brunch from 10:30 a.m. to 6:30 p.m.',
1639
-            "geodir_contact" => '(113) 121-12344',
1640
-            "geodir_email" => '[email protected]',
1641
-            "geodir_website" => 'http://www.zamarestaurant.com/',
1642
-            "geodir_twitter" => 'http://twitter.com/zamarestaurant',
1643
-            "geodir_facebook" => 'http://facebook.com/zamarestaurant',
1644
-            "post_dummy" => '1'
1645
-        );
1646
-
1647
-        ////post end///
1648
-        /// Restaurants ////post start 7///
1649
-
1650
-        break;
1651
-    case 28:
1652
-
1653
-        $image_array = array();
1654
-        $post_meta = array();
1655
-
1656
-        /// Restaurants ////post start 8//
1657
-        $image_array[] = "$dummy_image_url/restaurants16.jpg";
1658
-        $image_array[] = "$dummy_image_url/restaurants17.jpg";
1659
-        $image_array[] = "$dummy_image_url/restaurants18.jpg";
1660
-        $image_array[] = "$dummy_image_url/restaurants19.jpg";
1661
-        $image_array[] = "$dummy_image_url/restaurants5.jpg";
1662
-        $image_array[] = "$dummy_image_url/restaurants6.jpg";
1663
-        $image_array[] = "$dummy_image_url/restaurants7.jpg";
1664
-        $image_array[] = "$dummy_image_url/restaurants8.jpg";
1665
-        $image_array[] = "$dummy_image_url/restaurants9.jpg";
1666
-        $image_array[] = "$dummy_image_url/restaurants2.jpg";
1667
-        $image_array[] = "$dummy_image_url/restaurants4.jpg";
1668
-
1669
-        $post_info[] = array(
1670
-            "listing_type" => 'gd_place',
1671
-            "post_title" => 'Sampan',
1672
-            "post_desc" => '
1634
+			"post_images" => $image_array,
1635
+			"post_category" => array('gd_placecategory' => array('Restaurants', 'Food Nightlife')),
1636
+			"post_tags" => array('food'),
1637
+			"geodir_video" => '',
1638
+			"geodir_timing" => 'The restaurant is also open for weekend lunch/brunch from 10:30 a.m. to 6:30 p.m.',
1639
+			"geodir_contact" => '(113) 121-12344',
1640
+			"geodir_email" => '[email protected]',
1641
+			"geodir_website" => 'http://www.zamarestaurant.com/',
1642
+			"geodir_twitter" => 'http://twitter.com/zamarestaurant',
1643
+			"geodir_facebook" => 'http://facebook.com/zamarestaurant',
1644
+			"post_dummy" => '1'
1645
+		);
1646
+
1647
+		////post end///
1648
+		/// Restaurants ////post start 7///
1649
+
1650
+		break;
1651
+	case 28:
1652
+
1653
+		$image_array = array();
1654
+		$post_meta = array();
1655
+
1656
+		/// Restaurants ////post start 8//
1657
+		$image_array[] = "$dummy_image_url/restaurants16.jpg";
1658
+		$image_array[] = "$dummy_image_url/restaurants17.jpg";
1659
+		$image_array[] = "$dummy_image_url/restaurants18.jpg";
1660
+		$image_array[] = "$dummy_image_url/restaurants19.jpg";
1661
+		$image_array[] = "$dummy_image_url/restaurants5.jpg";
1662
+		$image_array[] = "$dummy_image_url/restaurants6.jpg";
1663
+		$image_array[] = "$dummy_image_url/restaurants7.jpg";
1664
+		$image_array[] = "$dummy_image_url/restaurants8.jpg";
1665
+		$image_array[] = "$dummy_image_url/restaurants9.jpg";
1666
+		$image_array[] = "$dummy_image_url/restaurants2.jpg";
1667
+		$image_array[] = "$dummy_image_url/restaurants4.jpg";
1668
+
1669
+		$post_info[] = array(
1670
+			"listing_type" => 'gd_place',
1671
+			"post_title" => 'Sampan',
1672
+			"post_desc" => '
1673 1673
 	Chef and charismatic television star Michael Schulson returns to Philadelphia with the opening of Sampan, a modern Asian restaurant where he serves the acclaimed cuisine that has made him one of the country&acute;s highly sought-after culinary talents.
1674 1674
 	
1675 1675
 	Schulson returns to Philadelphia after having opened Buddakan in New York City for Stephen Starr and Izakaya at the Borgata in Atlantic City and then having gone on to star in Style network&acute;s popular series Pantry Raid and TLC Ultimate Cake Off.
@@ -1688,45 +1688,45 @@  discard block
 block discarded – undo
1688 1688
 	
1689 1689
 	Prices range from $5 to $19.
1690 1690
 	',
1691
-            "post_images" => $image_array,
1692
-            "post_category" => array('gd_placecategory' => array('Restaurants', 'Food Nightlife')),
1693
-            "post_tags" => array('restaurant'),
1694
-            "geodir_video" => '',
1695
-            "geodir_timing" => 'The restaurant is also open for weekend lunch/brunch from 10:30 a.m. to 6:30 p.m.',
1696
-            "geodir_contact" => '(000) 111-2222',
1697
-            "geodir_email" => '[email protected]',
1698
-            "geodir_website" => 'http://www.sampanphilly.com/',
1699
-            "geodir_twitter" => 'http://twitter.com/sampanphilly',
1700
-            "geodir_facebook" => 'http://facebook.com/sampanphilly',
1701
-            "post_dummy" => '1'
1702
-        );
1703
-
1704
-        ////post end///
1705
-        /// Restaurants ////post start 8///
1706
-
1707
-        break;
1708
-    case 29:
1709
-
1710
-        $image_array = array();
1711
-        $post_meta = array();
1712
-
1713
-        /// Restaurants ////post start 9//
1714
-        $image_array[] = "$dummy_image_url/restaurants17.jpg";
1715
-        $image_array[] = "$dummy_image_url/restaurants16.jpg";
1716
-        $image_array[] = "$dummy_image_url/restaurants18.jpg";
1717
-        $image_array[] = "$dummy_image_url/restaurants19.jpg";
1718
-        $image_array[] = "$dummy_image_url/restaurants5.jpg";
1719
-        $image_array[] = "$dummy_image_url/restaurants6.jpg";
1720
-        $image_array[] = "$dummy_image_url/restaurants7.jpg";
1721
-        $image_array[] = "$dummy_image_url/restaurants8.jpg";
1722
-        $image_array[] = "$dummy_image_url/restaurants9.jpg";
1723
-        $image_array[] = "$dummy_image_url/restaurants2.jpg";
1724
-        $image_array[] = "$dummy_image_url/restaurants4.jpg";
1725
-
1726
-        $post_info[] = array(
1727
-            "listing_type" => 'gd_place',
1728
-            "post_title" => 'Morimoto',
1729
-            "post_desc" => '
1691
+			"post_images" => $image_array,
1692
+			"post_category" => array('gd_placecategory' => array('Restaurants', 'Food Nightlife')),
1693
+			"post_tags" => array('restaurant'),
1694
+			"geodir_video" => '',
1695
+			"geodir_timing" => 'The restaurant is also open for weekend lunch/brunch from 10:30 a.m. to 6:30 p.m.',
1696
+			"geodir_contact" => '(000) 111-2222',
1697
+			"geodir_email" => '[email protected]',
1698
+			"geodir_website" => 'http://www.sampanphilly.com/',
1699
+			"geodir_twitter" => 'http://twitter.com/sampanphilly',
1700
+			"geodir_facebook" => 'http://facebook.com/sampanphilly',
1701
+			"post_dummy" => '1'
1702
+		);
1703
+
1704
+		////post end///
1705
+		/// Restaurants ////post start 8///
1706
+
1707
+		break;
1708
+	case 29:
1709
+
1710
+		$image_array = array();
1711
+		$post_meta = array();
1712
+
1713
+		/// Restaurants ////post start 9//
1714
+		$image_array[] = "$dummy_image_url/restaurants17.jpg";
1715
+		$image_array[] = "$dummy_image_url/restaurants16.jpg";
1716
+		$image_array[] = "$dummy_image_url/restaurants18.jpg";
1717
+		$image_array[] = "$dummy_image_url/restaurants19.jpg";
1718
+		$image_array[] = "$dummy_image_url/restaurants5.jpg";
1719
+		$image_array[] = "$dummy_image_url/restaurants6.jpg";
1720
+		$image_array[] = "$dummy_image_url/restaurants7.jpg";
1721
+		$image_array[] = "$dummy_image_url/restaurants8.jpg";
1722
+		$image_array[] = "$dummy_image_url/restaurants9.jpg";
1723
+		$image_array[] = "$dummy_image_url/restaurants2.jpg";
1724
+		$image_array[] = "$dummy_image_url/restaurants4.jpg";
1725
+
1726
+		$post_info[] = array(
1727
+			"listing_type" => 'gd_place',
1728
+			"post_title" => 'Morimoto',
1729
+			"post_desc" => '
1730 1730
 	Stephen Starr creative Japanese restaurant has garnered all kinds of national and international attention since opening a few years back. Located a block from Independence Hall on Chestnut Street, Morimoto has an interior - awash in glass and colors - that is both striking and serene in its design.
1731 1731
 	
1732 1732
 	The restaurant&acute;s namesake and head chef, Morimoto (of Food Network&acute;s Iron Chef fame), has created a menu offering the very best in contemporary Japanese cusine. While regulars flock here for the exquisitely prepared sushi, Morimoto offers diners a broad spectrum of flavors that delve beyond nigiri and sashimi.
@@ -1739,45 +1739,45 @@  discard block
 block discarded – undo
1739 1739
 	
1740 1740
 	The mezzanine level lounge is a great spot to have a pre-meal cocktail while waiting for your table. You can enjoy a sake or try a “Sakura” - a cosmo made with Sake - in the sleek space that overlooks the brilliant restaurant below.
1741 1741
 	',
1742
-            "post_images" => $image_array,
1743
-            "post_category" => array('gd_placecategory' => array('Restaurants', 'Food Nightlife', 'Feature')),
1744
-            "post_tags" => array('America'),
1745
-            "geodir_video" => '',
1746
-            "geodir_timing" => 'The restaurant is also open for weekend lunch/brunch from 10:30 a.m. to 6:30 p.m.',
1747
-            "geodir_contact" => '(000) 111-2222',
1748
-            "geodir_email" => '[email protected]',
1749
-            "geodir_website" => 'http://www.morimotorestaurant.com/',
1750
-            "geodir_twitter" => 'http://twitter.com/morimotorestaurant',
1751
-            "geodir_facebook" => 'http://facebook.com/morimotorestaurant',
1752
-            "post_dummy" => '1'
1753
-        );
1754
-
1755
-        ////post end///
1756
-        /// Restaurants ////post start 9///
1757
-        break;
1758
-    case 30:
1759
-
1760
-
1761
-        $image_array = array();
1762
-        $post_meta = array();
1763
-
1764
-        /// Restaurants ////post start 10//
1765
-        $image_array[] = "$dummy_image_url/restaurants19.jpg";
1766
-        $image_array[] = "$dummy_image_url/restaurants17.jpg";
1767
-        $image_array[] = "$dummy_image_url/restaurants18.jpg";
1768
-        $image_array[] = "$dummy_image_url/restaurants16.jpg";
1769
-        $image_array[] = "$dummy_image_url/restaurants5.jpg";
1770
-        $image_array[] = "$dummy_image_url/restaurants6.jpg";
1771
-        $image_array[] = "$dummy_image_url/restaurants7.jpg";
1772
-        $image_array[] = "$dummy_image_url/restaurants8.jpg";
1773
-        $image_array[] = "$dummy_image_url/restaurants9.jpg";
1774
-        $image_array[] = "$dummy_image_url/restaurants2.jpg";
1775
-        $image_array[] = "$dummy_image_url/restaurants4.jpg";
1776
-
1777
-        $post_info[] = array(
1778
-            "listing_type" => 'gd_place',
1779
-            "post_title" => 'Buddakan',
1780
-            "post_desc" => '
1742
+			"post_images" => $image_array,
1743
+			"post_category" => array('gd_placecategory' => array('Restaurants', 'Food Nightlife', 'Feature')),
1744
+			"post_tags" => array('America'),
1745
+			"geodir_video" => '',
1746
+			"geodir_timing" => 'The restaurant is also open for weekend lunch/brunch from 10:30 a.m. to 6:30 p.m.',
1747
+			"geodir_contact" => '(000) 111-2222',
1748
+			"geodir_email" => '[email protected]',
1749
+			"geodir_website" => 'http://www.morimotorestaurant.com/',
1750
+			"geodir_twitter" => 'http://twitter.com/morimotorestaurant',
1751
+			"geodir_facebook" => 'http://facebook.com/morimotorestaurant',
1752
+			"post_dummy" => '1'
1753
+		);
1754
+
1755
+		////post end///
1756
+		/// Restaurants ////post start 9///
1757
+		break;
1758
+	case 30:
1759
+
1760
+
1761
+		$image_array = array();
1762
+		$post_meta = array();
1763
+
1764
+		/// Restaurants ////post start 10//
1765
+		$image_array[] = "$dummy_image_url/restaurants19.jpg";
1766
+		$image_array[] = "$dummy_image_url/restaurants17.jpg";
1767
+		$image_array[] = "$dummy_image_url/restaurants18.jpg";
1768
+		$image_array[] = "$dummy_image_url/restaurants16.jpg";
1769
+		$image_array[] = "$dummy_image_url/restaurants5.jpg";
1770
+		$image_array[] = "$dummy_image_url/restaurants6.jpg";
1771
+		$image_array[] = "$dummy_image_url/restaurants7.jpg";
1772
+		$image_array[] = "$dummy_image_url/restaurants8.jpg";
1773
+		$image_array[] = "$dummy_image_url/restaurants9.jpg";
1774
+		$image_array[] = "$dummy_image_url/restaurants2.jpg";
1775
+		$image_array[] = "$dummy_image_url/restaurants4.jpg";
1776
+
1777
+		$post_info[] = array(
1778
+			"listing_type" => 'gd_place',
1779
+			"post_title" => 'Buddakan',
1780
+			"post_desc" => '
1781 1781
 	<h3>The Experience </h3>
1782 1782
 	
1783 1783
 	A towering gilded statue of the Buddha generates elegant calm in this 175-seat, Pan Asian restaurant with sleek, modern decor. Immensely popular, Buddakan is a restaurant that is great for both large parties and intimate dinners.
@@ -1788,86 +1788,86 @@  discard block
 block discarded – undo
1788 1788
 	
1789 1789
 	Be sure to make your reservation before coming to town as Buddakan fills up quickly especially on weekends. Better yet, make your reservation right now .
1790 1790
 	',
1791
-            "post_images" => $image_array,
1792
-            "post_category" => array('gd_placecategory' => array('Restaurants', 'Food Nightlife')),
1793
-            "post_tags" => array('America'),
1794
-            "geodir_video" => '',
1795
-            "geodir_timing" => 'The restaurant is also open for weekend lunch/brunch from 10:30 a.m. to 6:30 p.m.',
1796
-            "geodir_contact" => '(000) 111-2222',
1797
-            "geodir_email" => '[email protected]',
1798
-            "geodir_website" => 'http://www.buddakan.com/',
1799
-            "geodir_twitter" => 'http://twitter.com/buddakan',
1800
-            "geodir_facebook" => 'http://facebook.com/buddakan',
1801
-            "post_dummy" => '1'
1802
-        );
1803
-        break;
1804
-
1805
-    ////post end///
1806
-    /// Restaurants ////post start 10///
1791
+			"post_images" => $image_array,
1792
+			"post_category" => array('gd_placecategory' => array('Restaurants', 'Food Nightlife')),
1793
+			"post_tags" => array('America'),
1794
+			"geodir_video" => '',
1795
+			"geodir_timing" => 'The restaurant is also open for weekend lunch/brunch from 10:30 a.m. to 6:30 p.m.',
1796
+			"geodir_contact" => '(000) 111-2222',
1797
+			"geodir_email" => '[email protected]',
1798
+			"geodir_website" => 'http://www.buddakan.com/',
1799
+			"geodir_twitter" => 'http://twitter.com/buddakan',
1800
+			"geodir_facebook" => 'http://facebook.com/buddakan',
1801
+			"post_dummy" => '1'
1802
+		);
1803
+		break;
1804
+
1805
+	////post end///
1806
+	/// Restaurants ////post start 10///
1807 1807
 } // end of switch
1808 1808
 
1809 1809
 
1810 1810
 foreach ($post_info as $post_info) {
1811
-    $default_location = geodir_get_default_location();
1812
-    if ($city_bound_lat1 > $city_bound_lat2)
1813
-        $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat1, $city_bound_lat2), geodir_random_float($city_bound_lat2, $city_bound_lat1));
1814
-    else
1815
-        $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat2, $city_bound_lat1), geodir_random_float($city_bound_lat1, $city_bound_lat2));
1811
+	$default_location = geodir_get_default_location();
1812
+	if ($city_bound_lat1 > $city_bound_lat2)
1813
+		$dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat1, $city_bound_lat2), geodir_random_float($city_bound_lat2, $city_bound_lat1));
1814
+	else
1815
+		$dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat2, $city_bound_lat1), geodir_random_float($city_bound_lat1, $city_bound_lat2));
1816 1816
 
1817 1817
 
1818
-    if ($city_bound_lng1 > $city_bound_lng2)
1819
-        $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng1, $city_bound_lng2), geodir_random_float($city_bound_lng2, $city_bound_lng1));
1820
-    else
1821
-        $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng2, $city_bound_lng1), geodir_random_float($city_bound_lng1, $city_bound_lng2));
1818
+	if ($city_bound_lng1 > $city_bound_lng2)
1819
+		$dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng1, $city_bound_lng2), geodir_random_float($city_bound_lng2, $city_bound_lng1));
1820
+	else
1821
+		$dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng2, $city_bound_lng1), geodir_random_float($city_bound_lng1, $city_bound_lng2));
1822 1822
 
1823
-    $load_map = get_option('geodir_load_map');
1823
+	$load_map = get_option('geodir_load_map');
1824 1824
     
1825
-    if ($load_map == 'osm') {
1826
-        $post_address = geodir_get_osm_address_by_lat_lan($dummy_post_latitude, $dummy_post_longitude);
1827
-    } else {
1828
-        $post_address = geodir_get_address_by_lat_lan($dummy_post_latitude, $dummy_post_longitude);
1829
-    }
1830
-
1831
-    $postal_code = '';
1832
-    if (!empty($post_address)) {
1833
-        if ($load_map == 'osm') {
1834
-            $address = !empty($post_address->formatted_address) ? $post_address->formatted_address : '';
1835
-            $postal_code = !empty($post_address->address->postcode) ? $post_address->address->postcode : '';
1836
-        } else {
1837
-            $addresses = array();
1838
-            $addresses_default = array();
1825
+	if ($load_map == 'osm') {
1826
+		$post_address = geodir_get_osm_address_by_lat_lan($dummy_post_latitude, $dummy_post_longitude);
1827
+	} else {
1828
+		$post_address = geodir_get_address_by_lat_lan($dummy_post_latitude, $dummy_post_longitude);
1829
+	}
1830
+
1831
+	$postal_code = '';
1832
+	if (!empty($post_address)) {
1833
+		if ($load_map == 'osm') {
1834
+			$address = !empty($post_address->formatted_address) ? $post_address->formatted_address : '';
1835
+			$postal_code = !empty($post_address->address->postcode) ? $post_address->address->postcode : '';
1836
+		} else {
1837
+			$addresses = array();
1838
+			$addresses_default = array();
1839 1839
             
1840
-            foreach ($post_address as $add_key => $add_value) {
1841
-                if ($add_key < 2 && !empty($add_value->long_name)) {
1842
-                    $addresses_default[] = $add_value->long_name;
1843
-                }
1844
-                if ($add_value->types[0] == 'postal_code') {
1845
-                    $postal_code = $add_value->long_name;
1846
-                }
1847
-                if ($add_value->types[0] == 'street_number') {
1848
-                    $addresses[] = $add_value->long_name;
1849
-                }
1850
-                if ($add_value->types[0] == 'route') {
1851
-                    $addresses[] = $add_value->long_name;
1852
-                }
1853
-                if ($add_value->types[0] == 'neighborhood') {
1854
-                    $addresses[] = $add_value->long_name;
1855
-                }
1856
-                if ($add_value->types[0] == 'sublocality') {
1857
-                    $addresses[] = $add_value->long_name;
1858
-                }
1859
-            }
1860
-            $address = !empty($addresses) ? implode(', ', $addresses) : (!empty($addresses_default) ? implode(', ', $addresses_default) : '');
1861
-        }
1862
-
1863
-        $post_info['post_address'] = !empty($address) ? $address : $default_location->city;
1864
-        $post_info['post_city'] = $default_location->city;
1865
-        $post_info['post_region'] = $default_location->region;
1866
-        $post_info['post_country'] = $default_location->country;
1867
-        $post_info['post_zip'] = $postal_code;
1868
-        $post_info['post_latitude'] = $dummy_post_latitude;
1869
-        $post_info['post_longitude'] = $dummy_post_longitude;
1870
-    }
1840
+			foreach ($post_address as $add_key => $add_value) {
1841
+				if ($add_key < 2 && !empty($add_value->long_name)) {
1842
+					$addresses_default[] = $add_value->long_name;
1843
+				}
1844
+				if ($add_value->types[0] == 'postal_code') {
1845
+					$postal_code = $add_value->long_name;
1846
+				}
1847
+				if ($add_value->types[0] == 'street_number') {
1848
+					$addresses[] = $add_value->long_name;
1849
+				}
1850
+				if ($add_value->types[0] == 'route') {
1851
+					$addresses[] = $add_value->long_name;
1852
+				}
1853
+				if ($add_value->types[0] == 'neighborhood') {
1854
+					$addresses[] = $add_value->long_name;
1855
+				}
1856
+				if ($add_value->types[0] == 'sublocality') {
1857
+					$addresses[] = $add_value->long_name;
1858
+				}
1859
+			}
1860
+			$address = !empty($addresses) ? implode(', ', $addresses) : (!empty($addresses_default) ? implode(', ', $addresses_default) : '');
1861
+		}
1862
+
1863
+		$post_info['post_address'] = !empty($address) ? $address : $default_location->city;
1864
+		$post_info['post_city'] = $default_location->city;
1865
+		$post_info['post_region'] = $default_location->region;
1866
+		$post_info['post_country'] = $default_location->country;
1867
+		$post_info['post_zip'] = $postal_code;
1868
+		$post_info['post_latitude'] = $dummy_post_latitude;
1869
+		$post_info['post_longitude'] = $dummy_post_longitude;
1870
+	}
1871 1871
     
1872
-    geodir_save_listing($post_info, true);
1872
+	geodir_save_listing($post_info, true);
1873 1873
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
 $post_meta = array();
13 13
 
14 14
 if (geodir_dummy_folder_exists())
15
-    $dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy";
15
+    $dummy_image_url = geodir_plugin_url()."/geodirectory-admin/dummy";
16 16
 else
17 17
     $dummy_image_url = 'http://www.wpgeodirectory.com/dummy';
18 18
 
Please login to merge, or discard this patch.
Braces   +17 added lines, -14 removed lines patch added patch discarded remove patch
@@ -11,10 +11,11 @@  discard block
 block discarded – undo
11 11
 $image_array = array();
12 12
 $post_meta = array();
13 13
 
14
-if (geodir_dummy_folder_exists())
15
-    $dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy";
16
-else
17
-    $dummy_image_url = 'http://www.wpgeodirectory.com/dummy';
14
+if (geodir_dummy_folder_exists()) {
15
+    $dummy_image_url = geodir_plugin_url() . "/geodirectory-admin/dummy";
16
+} else {
17
+    $dummy_image_url = 'http://www.wpgeodirectory.com/dummy';
18
+}
18 19
 
19 20
 $dummy_image_url = apply_filters('place_dummy_image_url', $dummy_image_url);
20 21
 
@@ -1809,16 +1810,18 @@  discard block
 block discarded – undo
1809 1810
 
1810 1811
 foreach ($post_info as $post_info) {
1811 1812
     $default_location = geodir_get_default_location();
1812
-    if ($city_bound_lat1 > $city_bound_lat2)
1813
-        $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat1, $city_bound_lat2), geodir_random_float($city_bound_lat2, $city_bound_lat1));
1814
-    else
1815
-        $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat2, $city_bound_lat1), geodir_random_float($city_bound_lat1, $city_bound_lat2));
1816
-
1817
-
1818
-    if ($city_bound_lng1 > $city_bound_lng2)
1819
-        $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng1, $city_bound_lng2), geodir_random_float($city_bound_lng2, $city_bound_lng1));
1820
-    else
1821
-        $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng2, $city_bound_lng1), geodir_random_float($city_bound_lng1, $city_bound_lng2));
1813
+    if ($city_bound_lat1 > $city_bound_lat2) {
1814
+            $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat1, $city_bound_lat2), geodir_random_float($city_bound_lat2, $city_bound_lat1));
1815
+    } else {
1816
+            $dummy_post_latitude = geodir_random_float(geodir_random_float($city_bound_lat2, $city_bound_lat1), geodir_random_float($city_bound_lat1, $city_bound_lat2));
1817
+    }
1818
+
1819
+
1820
+    if ($city_bound_lng1 > $city_bound_lng2) {
1821
+            $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng1, $city_bound_lng2), geodir_random_float($city_bound_lng2, $city_bound_lng1));
1822
+    } else {
1823
+            $dummy_post_longitude = geodir_random_float(geodir_random_float($city_bound_lng2, $city_bound_lng1), geodir_random_float($city_bound_lng1, $city_bound_lng2));
1824
+    }
1822 1825
 
1823 1826
     $load_map = get_option('geodir_load_map');
1824 1827
     
Please login to merge, or discard this patch.
geodirectory-templates/listing-detail.php 2 patches
Indentation   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 
12 12
 // We are submitting iframes etc so we turn this off to allow them to show on preview.
13 13
 if(geodir_is_page('preview')){
14
-    header("X-XSS-Protection: 0");
14
+	header("X-XSS-Protection: 0");
15 15
 }
16 16
 
17 17
 
@@ -38,12 +38,12 @@  discard block
 block discarded – undo
38 38
 
39 39
 ###### SIDEBAR ON LEFT ######
40 40
 if (get_option('geodir_detail_sidebar_left_section')) {
41
-    /**
42
-     * Adds the details page sidebar to the details template page.
43
-     *
44
-     * @since 1.1.0
45
-     */
46
-    do_action('geodir_detail_sidebar');
41
+	/**
42
+	 * Adds the details page sidebar to the details template page.
43
+	 *
44
+	 * @since 1.1.0
45
+	 */
46
+	do_action('geodir_detail_sidebar');
47 47
 }
48 48
 
49 49
 ###### MAIN CONTENT WRAPPERS OPEN ######
@@ -72,29 +72,29 @@  discard block
 block discarded – undo
72 72
 // this call the main page content
73 73
 global $preview;
74 74
 if (have_posts() && !$preview) {
75
-    the_post();
76
-    global $post, $post_images;
77
-    /**
78
-     * Calls the details page main content on the details template page.
79
-     *
80
-     * @since 1.1.0
81
-     * @param object $post The current post object.
82
-     */
83
-    do_action('geodir_details_main_content', $post);
75
+	the_post();
76
+	global $post, $post_images;
77
+	/**
78
+	 * Calls the details page main content on the details template page.
79
+	 *
80
+	 * @since 1.1.0
81
+	 * @param object $post The current post object.
82
+	 */
83
+	do_action('geodir_details_main_content', $post);
84 84
 } elseif ($preview) {
85
-    /**
86
-     * Called on the details page if the page is being previewed.
87
-     *
88
-     * This sets the value of `$post` to the preview values before the main content is called.
89
-     *
90
-     * @since 1.1.0
91
-     */
92
-    do_action('geodir_action_geodir_set_preview_post'); // set the $post to the preview values
93
-    if (defined( 'GD_TESTING_MODE' )) {
94
-        global $post;
95
-    }
96
-    /** This action is documented in geodirectory-templates/listing-detail.php */
97
-    do_action('geodir_details_main_content', $post);
85
+	/**
86
+	 * Called on the details page if the page is being previewed.
87
+	 *
88
+	 * This sets the value of `$post` to the preview values before the main content is called.
89
+	 *
90
+	 * @since 1.1.0
91
+	 */
92
+	do_action('geodir_action_geodir_set_preview_post'); // set the $post to the preview values
93
+	if (defined( 'GD_TESTING_MODE' )) {
94
+		global $post;
95
+	}
96
+	/** This action is documented in geodirectory-templates/listing-detail.php */
97
+	do_action('geodir_details_main_content', $post);
98 98
 }
99 99
 
100 100
 /** This action is documented in geodirectory-templates/geodir-home.php */
@@ -118,8 +118,8 @@  discard block
 block discarded – undo
118 118
 
119 119
 ###### SIDEBAR ON RIGHT ######
120 120
 if (!get_option('geodir_detail_sidebar_left_section')) {
121
-    /** This action is documented in geodirectory-templates/listing-detail.php */
122
-    do_action('geodir_detail_sidebar');
121
+	/** This action is documented in geodirectory-templates/listing-detail.php */
122
+	do_action('geodir_detail_sidebar');
123 123
 }
124 124
 
125 125
 
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
  */
11 11
 
12 12
 // We are submitting iframes etc so we turn this off to allow them to show on preview.
13
-if(geodir_is_page('preview')){
13
+if (geodir_is_page('preview')) {
14 14
     header("X-XSS-Protection: 0");
15 15
 }
16 16
 
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
  * @param string $itemtype The itemtype value of the HTML element.
64 64
  * @see 'geodir_article_close'
65 65
  */
66
-do_action('geodir_article_open', 'details-page', 'post-' . get_the_ID(), get_post_class(), '');
66
+do_action('geodir_article_open', 'details-page', 'post-'.get_the_ID(), get_post_class(), '');
67 67
 
68 68
 ###### MAIN CONTENT ######
69 69
 /** This action is documented in geodirectory-templates/geodir-home.php */
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
      * @since 1.1.0
91 91
      */
92 92
     do_action('geodir_action_geodir_set_preview_post'); // set the $post to the preview values
93
-    if (defined( 'GD_TESTING_MODE' )) {
93
+    if (defined('GD_TESTING_MODE')) {
94 94
         global $post;
95 95
     }
96 96
     /** This action is documented in geodirectory-templates/listing-detail.php */
Please login to merge, or discard this patch.
geodirectory-functions/general_functions.php 4 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2301,7 +2301,7 @@  discard block
 block discarded – undo
2301 2301
  * @global string $table_prefix  WordPress Database Table prefix.
2302 2302
  *
2303 2303
  * @param array $query_args      The query array.
2304
- * @param  int|bool $count_only  If true returns listings count only, otherwise returns array
2304
+ * @param  boolean $count_only  If true returns listings count only, otherwise returns array
2305 2305
  *
2306 2306
  * @return mixed Result object.
2307 2307
  */
@@ -3958,7 +3958,7 @@  discard block
 block discarded – undo
3958 3958
  * @since   1.0.0
3959 3959
  * @since   1.6.1 Fixed add listing page load time.
3960 3960
  * @package GeoDirectory
3961
- * @return bool
3961
+ * @return null|boolean
3962 3962
  */
3963 3963
 function geodir_term_review_count_force_update( $new_status, $old_status = '', $post = '' ) {
3964 3964
 	if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'geodir_import_export' ) {
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
 			break;
302 302
 		case 'preview':
303 303
 			if ( ( is_page() && get_query_var( 'page_id' ) == geodir_preview_page_id() ) && isset( $_REQUEST['listing_type'] )
304
-			     && in_array( $_REQUEST['listing_type'], geodir_get_posttypes() )
304
+				 && in_array( $_REQUEST['listing_type'], geodir_get_posttypes() )
305 305
 			) {
306 306
 				return true;
307 307
 			}
@@ -505,9 +505,9 @@  discard block
 block discarded – undo
505 505
 
506 506
 //check if homepage
507 507
 		if ( ! isset( $wp->query_vars['gd_is_geodir_page'] )
508
-		     && ! isset( $wp->query_vars['page_id'] )
509
-		     && ! isset( $wp->query_vars['pagename'] )
510
-		     && is_page_geodir_home()
508
+			 && ! isset( $wp->query_vars['page_id'] )
509
+			 && ! isset( $wp->query_vars['pagename'] )
510
+			 && is_page_geodir_home()
511 511
 		) {
512 512
 			$wp->query_vars['gd_is_geodir_page'] = true;
513 513
 		}
@@ -692,8 +692,8 @@  discard block
 block discarded – undo
692 692
 		$deltaLatitude  = deg2rad( (float) $point2['latitude'] - (float) $point1['latitude'] );
693 693
 		$deltaLongitude = deg2rad( (float) $point2['longitude'] - (float) $point1['longitude'] );
694 694
 		$a              = sin( $deltaLatitude / 2 ) * sin( $deltaLatitude / 2 ) +
695
-		                  cos( deg2rad( (float) $point1['latitude'] ) ) * cos( deg2rad( (float) $point2['latitude'] ) ) *
696
-		                  sin( $deltaLongitude / 2 ) * sin( $deltaLongitude / 2 );
695
+						  cos( deg2rad( (float) $point1['latitude'] ) ) * cos( deg2rad( (float) $point2['latitude'] ) ) *
696
+						  sin( $deltaLongitude / 2 ) * sin( $deltaLongitude / 2 );
697 697
 		$c              = 2 * atan2( sqrt( $a ), sqrt( 1 - $a ) );
698 698
 		$distance       = $earthMeanRadius * $c;
699 699
 
Please login to merge, or discard this patch.
Braces   +9 added lines, -5 removed lines patch added patch discarded remove patch
@@ -29,8 +29,10 @@  discard block
 block discarded – undo
29 29
 
30 30
 	if ( is_ssl() ) :
31 31
 		return str_replace( 'http://', 'https://', WP_PLUGIN_URL ) . "/" . plugin_basename( dirname( dirname( __FILE__ ) ) );
32
-	else :
33
-		return WP_PLUGIN_URL . "/" . plugin_basename( dirname( dirname( __FILE__ ) ) );
32
+	else {
33
+		:
34
+		return WP_PLUGIN_URL . "/" . plugin_basename( dirname( dirname( __FILE__ ) ) );
35
+	}
34 36
 	endif;
35 37
 }
36 38
 
@@ -764,7 +766,7 @@  discard block
 block discarded – undo
764 766
 			$post_author = get_post_field( 'post_author', $post_id );
765 767
 			if(is_super_admin( $post_author  )){// if admin probably not the post author so change name
766 768
 				$toEmailName = __('Business Owner','geodirectory');
767
-			}elseif(defined('GEODIRCLAIM_VERSION') && geodir_get_post_meta($post_id,'claimed')!='1'){// if claim manager installed but listing not claimed
769
+			} elseif(defined('GEODIRCLAIM_VERSION') && geodir_get_post_meta($post_id,'claimed')!='1'){// if claim manager installed but listing not claimed
768 770
 				$toEmailName = __('Business Owner','geodirectory');
769 771
 			}
770 772
 
@@ -1569,12 +1571,14 @@  discard block
 block discarded – undo
1569 1571
 	 */
1570 1572
 	function geodir_allow_wpadmin() {
1571 1573
 		global $wpdb;
1572
-		if ( get_option( 'geodir_allow_wpadmin' ) == '0' && is_user_logged_in() && ( ! defined( 'DOING_AJAX' ) ) ) // checking action in request to allow ajax request go through
1574
+		if ( get_option( 'geodir_allow_wpadmin' ) == '0' && is_user_logged_in() && ( ! defined( 'DOING_AJAX' ) ) ) {
1575
+			// checking action in request to allow ajax request go through
1573 1576
 		{
1574 1577
 			if ( current_user_can( 'administrator' ) ) {
1575 1578
 			} else {
1576 1579
 
1577
-				wp_redirect( home_url() );
1580
+				wp_redirect( home_url() );
1581
+		}
1578 1582
 				exit;
1579 1583
 			}
1580 1584
 
Please login to merge, or discard this patch.
Spacing   +1340 added lines, -1340 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 /**
11 11
  * Get All Plugin functions from WordPress
12 12
  */
13
-include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
13
+include_once(ABSPATH.'wp-admin/includes/plugin.php');
14 14
 
15 15
 /*-----------------------------------------------------------------------------------*/
16 16
 /* Helper functions */
@@ -27,10 +27,10 @@  discard block
 block discarded – undo
27 27
  */
28 28
 function geodir_plugin_url() {
29 29
 
30
-	if ( is_ssl() ) :
31
-		return str_replace( 'http://', 'https://', WP_PLUGIN_URL ) . "/" . plugin_basename( dirname( dirname( __FILE__ ) ) );
30
+	if (is_ssl()) :
31
+		return str_replace('http://', 'https://', WP_PLUGIN_URL)."/".plugin_basename(dirname(dirname(__FILE__)));
32 32
 	else :
33
-		return WP_PLUGIN_URL . "/" . plugin_basename( dirname( dirname( __FILE__ ) ) );
33
+		return WP_PLUGIN_URL."/".plugin_basename(dirname(dirname(__FILE__)));
34 34
 	endif;
35 35
 }
36 36
 
@@ -45,10 +45,10 @@  discard block
 block discarded – undo
45 45
  * @return string example url eg: /home/geo/public_html/wp-content/plugins/geodirectory
46 46
  */
47 47
 function geodir_plugin_path() {
48
-	if ( defined( 'GD_TESTING_MODE' ) && GD_TESTING_MODE ) {
49
-		return dirname( dirname( __FILE__ ) );
48
+	if (defined('GD_TESTING_MODE') && GD_TESTING_MODE) {
49
+		return dirname(dirname(__FILE__));
50 50
 	} else {
51
-		return WP_PLUGIN_DIR . "/" . plugin_basename( dirname( dirname( __FILE__ ) ) );
51
+		return WP_PLUGIN_DIR."/".plugin_basename(dirname(dirname(__FILE__)));
52 52
 	}
53 53
 }
54 54
 
@@ -63,10 +63,10 @@  discard block
 block discarded – undo
63 63
  * @return bool true or false.
64 64
  * @todo    check if this is faster than normal WP check and remove if not.
65 65
  */
66
-function geodir_is_plugin_active( $plugin ) {
67
-	$active_plugins = get_option( 'active_plugins' );
68
-	foreach ( $active_plugins as $key => $active_plugin ) {
69
-		if ( strstr( $active_plugin, $plugin ) ) {
66
+function geodir_is_plugin_active($plugin) {
67
+	$active_plugins = get_option('active_plugins');
68
+	foreach ($active_plugins as $key => $active_plugin) {
69
+		if (strstr($active_plugin, $plugin)) {
70 70
 			return true;
71 71
 		}
72 72
 	}
@@ -88,8 +88,8 @@  discard block
 block discarded – undo
88 88
  *
89 89
  * @return bool|int|string the formatted date.
90 90
  */
91
-function geodir_get_formated_date( $date ) {
92
-	return mysql2date( get_option( 'date_format' ), $date );
91
+function geodir_get_formated_date($date) {
92
+	return mysql2date(get_option('date_format'), $date);
93 93
 }
94 94
 
95 95
 /**
@@ -105,8 +105,8 @@  discard block
 block discarded – undo
105 105
  *
106 106
  * @return bool|int|string the formatted time.
107 107
  */
108
-function geodir_get_formated_time( $time ) {
109
-	return mysql2date( get_option( 'time_format' ), $time, $translate = true );
108
+function geodir_get_formated_time($time) {
109
+	return mysql2date(get_option('time_format'), $time, $translate = true);
110 110
 }
111 111
 
112 112
 
@@ -124,35 +124,35 @@  discard block
 block discarded – undo
124 124
  *
125 125
  * @return string Formatted link.
126 126
  */
127
-function geodir_getlink( $url, $params = array(), $use_existing_arguments = false ) {
128
-	if ( $use_existing_arguments ) {
127
+function geodir_getlink($url, $params = array(), $use_existing_arguments = false) {
128
+	if ($use_existing_arguments) {
129 129
 		$params = $params + $_GET;
130 130
 	}
131
-	if ( ! $params ) {
131
+	if (!$params) {
132 132
 		return $url;
133 133
 	}
134 134
 	$link = $url;
135
-	if ( strpos( $link, '?' ) === false ) {
135
+	if (strpos($link, '?') === false) {
136 136
 		$link .= '?';
137 137
 	} //If there is no '?' add one at the end
138
-	elseif ( strpos( $link, '//maps.google.com/maps/api/js?language=' ) ) {
138
+	elseif (strpos($link, '//maps.google.com/maps/api/js?language=')) {
139 139
 		$link .= '&amp;';
140 140
 	} //If there is no '&' at the END, add one.
141
-	elseif ( ! preg_match( '/(\?|\&(amp;)?)$/', $link ) ) {
141
+	elseif (!preg_match('/(\?|\&(amp;)?)$/', $link)) {
142 142
 		$link .= '&';
143 143
 	} //If there is no '&' at the END, add one.
144 144
 
145 145
 	$params_arr = array();
146
-	foreach ( $params as $key => $value ) {
147
-		if ( gettype( $value ) == 'array' ) { //Handle array data properly
148
-			foreach ( $value as $val ) {
149
-				$params_arr[] = $key . '[]=' . urlencode( $val );
146
+	foreach ($params as $key => $value) {
147
+		if (gettype($value) == 'array') { //Handle array data properly
148
+			foreach ($value as $val) {
149
+				$params_arr[] = $key.'[]='.urlencode($val);
150 150
 			}
151 151
 		} else {
152
-			$params_arr[] = $key . '=' . urlencode( $value );
152
+			$params_arr[] = $key.'='.urlencode($value);
153 153
 		}
154 154
 	}
155
-	$link .= implode( '&', $params_arr );
155
+	$link .= implode('&', $params_arr);
156 156
 
157 157
 	return $link;
158 158
 }
@@ -169,18 +169,18 @@  discard block
 block discarded – undo
169 169
  *
170 170
  * @return string Listing page url if valid. Otherwise home url will be returned.
171 171
  */
172
-function geodir_get_addlisting_link( $post_type = '' ) {
172
+function geodir_get_addlisting_link($post_type = '') {
173 173
 	global $wpdb;
174 174
 
175 175
 	//$check_pkg  = $wpdb->get_var("SELECT pid FROM ".GEODIR_PRICE_TABLE." WHERE post_type='".$post_type."' and status != '0'");
176 176
 	$check_pkg = 1;
177
-	if ( post_type_exists( $post_type ) && $check_pkg ) {
177
+	if (post_type_exists($post_type) && $check_pkg) {
178 178
 
179
-		$add_listing_link = get_page_link( geodir_add_listing_page_id() );
179
+		$add_listing_link = get_page_link(geodir_add_listing_page_id());
180 180
 
181
-		return esc_url( add_query_arg( array( 'listing_type' => $post_type ), $add_listing_link ) );
181
+		return esc_url(add_query_arg(array('listing_type' => $post_type), $add_listing_link));
182 182
 	} else {
183
-		return get_bloginfo( 'url' );
183
+		return get_bloginfo('url');
184 184
 	}
185 185
 }
186 186
 
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 	if (!empty($_SERVER['PHP_SELF']) && !empty($_SERVER['REQUEST_URI'])) {
209 209
 		// To build the entire URI we need to prepend the protocol, and the http host
210 210
 		// to the URI string.
211
-		$pageURL .= $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
211
+		$pageURL .= $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
212 212
 	} else {
213 213
 		/*
214 214
 		 * Since we do not have REQUEST_URI to work with, we will assume we are
@@ -217,11 +217,11 @@  discard block
 block discarded – undo
217 217
 		 *
218 218
 		 * IIS uses the SCRIPT_NAME variable instead of a REQUEST_URI variable... thanks, MS
219 219
 		 */
220
-		$pageURL .= $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME'];
220
+		$pageURL .= $_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME'];
221 221
 		
222 222
 		// If the query string exists append it to the URI string
223 223
 		if (isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING'])) {
224
-			$pageURL .= '?' . $_SERVER['QUERY_STRING'];
224
+			$pageURL .= '?'.$_SERVER['QUERY_STRING'];
225 225
 		}
226 226
 	}
227 227
 	
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
 	 *
233 233
 	 * @param string $pageURL The URL of the current page.
234 234
 	 */
235
-	return apply_filters( 'geodir_curPageURL', $pageURL );
235
+	return apply_filters('geodir_curPageURL', $pageURL);
236 236
 }
237 237
 
238 238
 /**
@@ -247,12 +247,12 @@  discard block
 block discarded – undo
247 247
  *
248 248
  * @return string Cleaned variable.
249 249
  */
250
-function geodir_clean( $string ) {
250
+function geodir_clean($string) {
251 251
 
252
-	$string = trim( strip_tags( stripslashes( $string ) ) );
253
-	$string = str_replace( " ", "-", $string ); // Replaces all spaces with hyphens.
254
-	$string = preg_replace( '/[^A-Za-z0-9\-\_]/', '', $string ); // Removes special chars.
255
-	$string = preg_replace( '/-+/', '-', $string ); // Replaces multiple hyphens with single one.
252
+	$string = trim(strip_tags(stripslashes($string)));
253
+	$string = str_replace(" ", "-", $string); // Replaces all spaces with hyphens.
254
+	$string = preg_replace('/[^A-Za-z0-9\-\_]/', '', $string); // Removes special chars.
255
+	$string = preg_replace('/-+/', '-', $string); // Replaces multiple hyphens with single one.
256 256
 
257 257
 	return $string;
258 258
 }
@@ -266,13 +266,13 @@  discard block
 block discarded – undo
266 266
  */
267 267
 function geodir_get_weekday() {
268 268
 	return array(
269
-		__( 'Sunday', 'geodirectory' ),
270
-		__( 'Monday', 'geodirectory' ),
271
-		__( 'Tuesday', 'geodirectory' ),
272
-		__( 'Wednesday', 'geodirectory' ),
273
-		__( 'Thursday', 'geodirectory' ),
274
-		__( 'Friday', 'geodirectory' ),
275
-		__( 'Saturday', 'geodirectory' )
269
+		__('Sunday', 'geodirectory'),
270
+		__('Monday', 'geodirectory'),
271
+		__('Tuesday', 'geodirectory'),
272
+		__('Wednesday', 'geodirectory'),
273
+		__('Thursday', 'geodirectory'),
274
+		__('Friday', 'geodirectory'),
275
+		__('Saturday', 'geodirectory')
276 276
 	);
277 277
 }
278 278
 
@@ -285,11 +285,11 @@  discard block
 block discarded – undo
285 285
  */
286 286
 function geodir_get_weeks() {
287 287
 	return array(
288
-		__( 'First', 'geodirectory' ),
289
-		__( 'Second', 'geodirectory' ),
290
-		__( 'Third', 'geodirectory' ),
291
-		__( 'Fourth', 'geodirectory' ),
292
-		__( 'Last', 'geodirectory' )
288
+		__('First', 'geodirectory'),
289
+		__('Second', 'geodirectory'),
290
+		__('Third', 'geodirectory'),
291
+		__('Fourth', 'geodirectory'),
292
+		__('Last', 'geodirectory')
293 293
 	);
294 294
 }
295 295
 
@@ -308,112 +308,112 @@  discard block
 block discarded – undo
308 308
  *
309 309
  * @return bool If valid returns true. Otherwise false.
310 310
  */
311
-function geodir_is_page( $gdpage = '' ) {
311
+function geodir_is_page($gdpage = '') {
312 312
 
313 313
 	global $wp_query, $post, $wp;
314 314
 	//if(!is_admin()):
315 315
 
316
-	switch ( $gdpage ):
316
+	switch ($gdpage):
317 317
 		case 'add-listing':
318 318
 
319
-			if ( is_page() && get_query_var( 'page_id' ) == geodir_add_listing_page_id() ) {
319
+			if (is_page() && get_query_var('page_id') == geodir_add_listing_page_id()) {
320 320
 				return true;
321
-			} elseif ( is_page() && isset( $post->post_content ) && has_shortcode( $post->post_content, 'gd_add_listing' ) ) {
321
+			} elseif (is_page() && isset($post->post_content) && has_shortcode($post->post_content, 'gd_add_listing')) {
322 322
 				return true;
323 323
 			}
324 324
 
325 325
 			break;
326 326
 		case 'preview':
327
-			if ( ( is_page() && get_query_var( 'page_id' ) == geodir_preview_page_id() ) && isset( $_REQUEST['listing_type'] )
328
-			     && in_array( $_REQUEST['listing_type'], geodir_get_posttypes() )
327
+			if ((is_page() && get_query_var('page_id') == geodir_preview_page_id()) && isset($_REQUEST['listing_type'])
328
+			     && in_array($_REQUEST['listing_type'], geodir_get_posttypes())
329 329
 			) {
330 330
 				return true;
331 331
 			}
332 332
 			break;
333 333
 		case 'listing-success':
334
-			if ( is_page() && get_query_var( 'page_id' ) == geodir_success_page_id() ) {
334
+			if (is_page() && get_query_var('page_id') == geodir_success_page_id()) {
335 335
 				return true;
336 336
 			}
337 337
 			break;
338 338
 		case 'detail':
339
-			$post_type = get_query_var( 'post_type' );
340
-			if ( is_array( $post_type ) ) {
341
-				$post_type = reset( $post_type );
339
+			$post_type = get_query_var('post_type');
340
+			if (is_array($post_type)) {
341
+				$post_type = reset($post_type);
342 342
 			}
343
-			if ( is_single() && in_array( $post_type, geodir_get_posttypes() ) ) {
343
+			if (is_single() && in_array($post_type, geodir_get_posttypes())) {
344 344
 				return true;
345 345
 			}
346 346
 			break;
347 347
 		case 'pt':
348
-			$post_type = get_query_var( 'post_type' );
349
-			if ( is_array( $post_type ) ) {
350
-				$post_type = reset( $post_type );
348
+			$post_type = get_query_var('post_type');
349
+			if (is_array($post_type)) {
350
+				$post_type = reset($post_type);
351 351
 			}
352
-			if ( is_post_type_archive() && in_array( $post_type, geodir_get_posttypes() ) && ! is_tax() ) {
352
+			if (is_post_type_archive() && in_array($post_type, geodir_get_posttypes()) && !is_tax()) {
353 353
 				return true;
354 354
 			}
355 355
 
356 356
 			break;
357 357
 		case 'listing':
358
-			if ( is_tax() && geodir_get_taxonomy_posttype() ) {
358
+			if (is_tax() && geodir_get_taxonomy_posttype()) {
359 359
 				global $current_term, $taxonomy, $term;
360 360
 
361 361
 				return true;
362 362
 			}
363
-			$post_type = get_query_var( 'post_type' );
364
-			if ( is_array( $post_type ) ) {
365
-				$post_type = reset( $post_type );
363
+			$post_type = get_query_var('post_type');
364
+			if (is_array($post_type)) {
365
+				$post_type = reset($post_type);
366 366
 			}
367
-			if ( is_post_type_archive() && in_array( $post_type, geodir_get_posttypes() ) ) {
367
+			if (is_post_type_archive() && in_array($post_type, geodir_get_posttypes())) {
368 368
 				return true;
369 369
 			}
370 370
 
371 371
 			break;
372 372
 		case 'home':
373 373
 
374
-			if ( ( is_page() && get_query_var( 'page_id' ) == geodir_home_page_id() ) || is_page_geodir_home() ) {
374
+			if ((is_page() && get_query_var('page_id') == geodir_home_page_id()) || is_page_geodir_home()) {
375 375
 				return true;
376 376
 			}
377 377
 
378 378
 			break;
379 379
 		case 'location':
380
-			if ( is_page() && get_query_var( 'page_id' ) == geodir_location_page_id() ) {
380
+			if (is_page() && get_query_var('page_id') == geodir_location_page_id()) {
381 381
 				return true;
382 382
 			}
383 383
 			break;
384 384
 		case 'author':
385
-			if ( is_author() && isset( $_REQUEST['geodir_dashbord'] ) ) {
385
+			if (is_author() && isset($_REQUEST['geodir_dashbord'])) {
386 386
 				return true;
387 387
 			}
388 388
 
389
-			if ( function_exists( 'bp_loggedin_user_id' ) && function_exists( 'bp_displayed_user_id' ) && $my_id = (int) bp_loggedin_user_id() ) {
390
-				if ( ( (bool) bp_is_current_component( 'listings' ) || (bool) bp_is_current_component( 'favorites' ) ) && $my_id > 0 && $my_id == (int) bp_displayed_user_id() ) {
389
+			if (function_exists('bp_loggedin_user_id') && function_exists('bp_displayed_user_id') && $my_id = (int) bp_loggedin_user_id()) {
390
+				if (((bool) bp_is_current_component('listings') || (bool) bp_is_current_component('favorites')) && $my_id > 0 && $my_id == (int) bp_displayed_user_id()) {
391 391
 					return true;
392 392
 				}
393 393
 			}
394 394
 			break;
395 395
 		case 'search':
396
-			if ( is_search() && isset( $_REQUEST['geodir_search'] ) ) {
396
+			if (is_search() && isset($_REQUEST['geodir_search'])) {
397 397
 				return true;
398 398
 			}
399 399
 			break;
400 400
 		case 'info':
401
-			if ( is_page() && get_query_var( 'page_id' ) == geodir_info_page_id() ) {
401
+			if (is_page() && get_query_var('page_id') == geodir_info_page_id()) {
402 402
 				return true;
403 403
 			}
404 404
 			break;
405 405
 		case 'login':
406
-			if ( is_page() && get_query_var( 'page_id' ) == geodir_login_page_id() ) {
406
+			if (is_page() && get_query_var('page_id') == geodir_login_page_id()) {
407 407
 				return true;
408 408
 			}
409 409
 			break;
410 410
 		case 'checkout':
411
-			if ( is_page() && function_exists( 'geodir_payment_checkout_page_id' ) && get_query_var( 'page_id' ) == geodir_payment_checkout_page_id() ) {
411
+			if (is_page() && function_exists('geodir_payment_checkout_page_id') && get_query_var('page_id') == geodir_payment_checkout_page_id()) {
412 412
 				return true;
413 413
 			}
414 414
 			break;
415 415
 		case 'invoices':
416
-			if ( is_page() && function_exists( 'geodir_payment_invoices_page_id' ) && get_query_var( 'page_id' ) == geodir_payment_invoices_page_id() ) {
416
+			if (is_page() && function_exists('geodir_payment_invoices_page_id') && get_query_var('page_id') == geodir_payment_invoices_page_id()) {
417 417
 				return true;
418 418
 			}
419 419
 			break;
@@ -438,25 +438,25 @@  discard block
 block discarded – undo
438 438
  *
439 439
  * @param object $wp WordPress object.
440 440
  */
441
-function geodir_set_is_geodir_page( $wp ) {
442
-	if ( ! is_admin() ) {
441
+function geodir_set_is_geodir_page($wp) {
442
+	if (!is_admin()) {
443 443
 		//$wp->query_vars['gd_is_geodir_page'] = false;
444 444
 		//print_r()
445
-		if ( empty( $wp->query_vars ) || ! array_diff( array_keys( $wp->query_vars ), array(
445
+		if (empty($wp->query_vars) || !array_diff(array_keys($wp->query_vars), array(
446 446
 				'preview',
447 447
 				'page',
448 448
 				'paged',
449 449
 				'cpage'
450
-			) )
450
+			))
451 451
 		) {
452
-			if ( geodir_is_page( 'home' ) ) {
452
+			if (geodir_is_page('home')) {
453 453
 				$wp->query_vars['gd_is_geodir_page'] = true;
454 454
 			}
455 455
 
456 456
 
457 457
 		}
458 458
 
459
-		if ( ! isset( $wp->query_vars['gd_is_geodir_page'] ) && isset( $wp->query_vars['page_id'] ) ) {
459
+		if (!isset($wp->query_vars['gd_is_geodir_page']) && isset($wp->query_vars['page_id'])) {
460 460
 			if (
461 461
 				$wp->query_vars['page_id'] == geodir_add_listing_page_id()
462 462
 				|| $wp->query_vars['page_id'] == geodir_preview_page_id()
@@ -465,26 +465,26 @@  discard block
 block discarded – undo
465 465
 				|| $wp->query_vars['page_id'] == geodir_home_page_id()
466 466
 				|| $wp->query_vars['page_id'] == geodir_info_page_id()
467 467
 				|| $wp->query_vars['page_id'] == geodir_login_page_id()
468
-				|| ( function_exists( 'geodir_payment_checkout_page_id' ) && $wp->query_vars['page_id'] == geodir_payment_checkout_page_id() )
469
-				|| ( function_exists( 'geodir_payment_invoices_page_id' ) && $wp->query_vars['page_id'] == geodir_payment_invoices_page_id() )
468
+				|| (function_exists('geodir_payment_checkout_page_id') && $wp->query_vars['page_id'] == geodir_payment_checkout_page_id())
469
+				|| (function_exists('geodir_payment_invoices_page_id') && $wp->query_vars['page_id'] == geodir_payment_invoices_page_id())
470 470
 			) {
471 471
 				$wp->query_vars['gd_is_geodir_page'] = true;
472 472
 			}
473 473
 		}
474 474
 
475
-		if ( ! isset( $wp->query_vars['gd_is_geodir_page'] ) && isset( $wp->query_vars['pagename'] ) ) {
476
-			$page = get_page_by_path( $wp->query_vars['pagename'] );
475
+		if (!isset($wp->query_vars['gd_is_geodir_page']) && isset($wp->query_vars['pagename'])) {
476
+			$page = get_page_by_path($wp->query_vars['pagename']);
477 477
 
478
-			if ( ! empty( $page ) && (
478
+			if (!empty($page) && (
479 479
 					$page->ID == geodir_add_listing_page_id()
480 480
 					|| $page->ID == geodir_preview_page_id()
481 481
 					|| $page->ID == geodir_success_page_id()
482 482
 					|| $page->ID == geodir_location_page_id()
483
-					|| ( isset( $wp->query_vars['page_id'] ) && $wp->query_vars['page_id'] == geodir_home_page_id() )
484
-					|| ( isset( $wp->query_vars['page_id'] ) && $wp->query_vars['page_id'] == geodir_info_page_id() )
485
-					|| ( isset( $wp->query_vars['page_id'] ) && $wp->query_vars['page_id'] == geodir_login_page_id() )
486
-					|| ( isset( $wp->query_vars['page_id'] ) && function_exists( 'geodir_payment_checkout_page_id' ) && $wp->query_vars['page_id'] == geodir_payment_checkout_page_id() )
487
-					|| ( isset( $wp->query_vars['page_id'] ) && function_exists( 'geodir_payment_invoices_page_id' ) && $wp->query_vars['page_id'] == geodir_payment_invoices_page_id() )
483
+					|| (isset($wp->query_vars['page_id']) && $wp->query_vars['page_id'] == geodir_home_page_id())
484
+					|| (isset($wp->query_vars['page_id']) && $wp->query_vars['page_id'] == geodir_info_page_id())
485
+					|| (isset($wp->query_vars['page_id']) && $wp->query_vars['page_id'] == geodir_login_page_id())
486
+					|| (isset($wp->query_vars['page_id']) && function_exists('geodir_payment_checkout_page_id') && $wp->query_vars['page_id'] == geodir_payment_checkout_page_id())
487
+					|| (isset($wp->query_vars['page_id']) && function_exists('geodir_payment_invoices_page_id') && $wp->query_vars['page_id'] == geodir_payment_invoices_page_id())
488 488
 				)
489 489
 			) {
490 490
 				$wp->query_vars['gd_is_geodir_page'] = true;
@@ -492,20 +492,20 @@  discard block
 block discarded – undo
492 492
 		}
493 493
 
494 494
 
495
-		if ( ! isset( $wp->query_vars['gd_is_geodir_page'] ) && isset( $wp->query_vars['post_type'] ) && $wp->query_vars['post_type'] != '' ) {
495
+		if (!isset($wp->query_vars['gd_is_geodir_page']) && isset($wp->query_vars['post_type']) && $wp->query_vars['post_type'] != '') {
496 496
 			$requested_post_type = $wp->query_vars['post_type'];
497 497
 			// check if this post type is geodirectory post types
498 498
 			$post_type_array = geodir_get_posttypes();
499
-			if ( in_array( $requested_post_type, $post_type_array ) ) {
499
+			if (in_array($requested_post_type, $post_type_array)) {
500 500
 				$wp->query_vars['gd_is_geodir_page'] = true;
501 501
 			}
502 502
 		}
503 503
 
504
-		if ( ! isset( $wp->query_vars['gd_is_geodir_page'] ) ) {
505
-			$geodir_taxonomis = geodir_get_taxonomies( '', true );
506
-			if ( ! empty( $geodir_taxonomis ) ) {
507
-				foreach ( $geodir_taxonomis as $taxonomy ) {
508
-					if ( array_key_exists( $taxonomy, $wp->query_vars ) ) {
504
+		if (!isset($wp->query_vars['gd_is_geodir_page'])) {
505
+			$geodir_taxonomis = geodir_get_taxonomies('', true);
506
+			if (!empty($geodir_taxonomis)) {
507
+				foreach ($geodir_taxonomis as $taxonomy) {
508
+					if (array_key_exists($taxonomy, $wp->query_vars)) {
509 509
 						$wp->query_vars['gd_is_geodir_page'] = true;
510 510
 						break;
511 511
 					}
@@ -514,20 +514,20 @@  discard block
 block discarded – undo
514 514
 
515 515
 		}
516 516
 
517
-		if ( ! isset( $wp->query_vars['gd_is_geodir_page'] ) && isset( $wp->query_vars['author_name'] ) && isset( $_REQUEST['geodir_dashbord'] ) ) {
517
+		if (!isset($wp->query_vars['gd_is_geodir_page']) && isset($wp->query_vars['author_name']) && isset($_REQUEST['geodir_dashbord'])) {
518 518
 			$wp->query_vars['gd_is_geodir_page'] = true;
519 519
 		}
520 520
 
521 521
 
522
-		if ( ! isset( $wp->query_vars['gd_is_geodir_page'] ) && isset( $_REQUEST['geodir_search'] ) ) {
522
+		if (!isset($wp->query_vars['gd_is_geodir_page']) && isset($_REQUEST['geodir_search'])) {
523 523
 			$wp->query_vars['gd_is_geodir_page'] = true;
524 524
 		}
525 525
 
526 526
 
527 527
 //check if homepage
528
-		if ( ! isset( $wp->query_vars['gd_is_geodir_page'] )
529
-		     && ! isset( $wp->query_vars['page_id'] )
530
-		     && ! isset( $wp->query_vars['pagename'] )
528
+		if (!isset($wp->query_vars['gd_is_geodir_page'])
529
+		     && !isset($wp->query_vars['page_id'])
530
+		     && !isset($wp->query_vars['pagename'])
531 531
 		     && is_page_geodir_home()
532 532
 		) {
533 533
 			$wp->query_vars['gd_is_geodir_page'] = true;
@@ -551,14 +551,14 @@  discard block
 block discarded – undo
551 551
  */
552 552
 function geodir_is_geodir_page() {
553 553
 	global $wp;
554
-	if ( isset( $wp->query_vars['gd_is_geodir_page'] ) && $wp->query_vars['gd_is_geodir_page'] ) {
554
+	if (isset($wp->query_vars['gd_is_geodir_page']) && $wp->query_vars['gd_is_geodir_page']) {
555 555
 		return true;
556 556
 	} else {
557 557
 		return false;
558 558
 	}
559 559
 }
560 560
 
561
-if ( ! function_exists( 'geodir_get_imagesize' ) ) {
561
+if (!function_exists('geodir_get_imagesize')) {
562 562
 	/**
563 563
 	 * Get image size using the size key .
564 564
 	 *
@@ -569,13 +569,13 @@  discard block
 block discarded – undo
569 569
 	 *
570 570
 	 * @return array|mixed|void|WP_Error If valid returns image size. Else returns error.
571 571
 	 */
572
-	function geodir_get_imagesize( $size = '' ) {
572
+	function geodir_get_imagesize($size = '') {
573 573
 
574 574
 		$imagesizes = array(
575
-			'list-thumb'   => array( 'w' => 283, 'h' => 188 ),
576
-			'thumbnail'    => array( 'w' => 125, 'h' => 125 ),
577
-			'widget-thumb' => array( 'w' => 50, 'h' => 50 ),
578
-			'slider-thumb' => array( 'w' => 100, 'h' => 100 )
575
+			'list-thumb'   => array('w' => 283, 'h' => 188),
576
+			'thumbnail'    => array('w' => 125, 'h' => 125),
577
+			'widget-thumb' => array('w' => 50, 'h' => 50),
578
+			'slider-thumb' => array('w' => 100, 'h' => 100)
579 579
 		);
580 580
 
581 581
 		/**
@@ -585,9 +585,9 @@  discard block
 block discarded – undo
585 585
 		 *
586 586
 		 * @param array $imagesizes Image size array.
587 587
 		 */
588
-		$imagesizes = apply_filters( 'geodir_imagesizes', $imagesizes );
588
+		$imagesizes = apply_filters('geodir_imagesizes', $imagesizes);
589 589
 
590
-		if ( ! empty( $size ) && array_key_exists( $size, $imagesizes ) ) {
590
+		if (!empty($size) && array_key_exists($size, $imagesizes)) {
591 591
 			/**
592 592
 			 * Filters image size of the passed key.
593 593
 			 *
@@ -595,11 +595,11 @@  discard block
 block discarded – undo
595 595
 			 *
596 596
 			 * @param array $imagesizes [$size] Image size array of the passed key.
597 597
 			 */
598
-			return apply_filters( 'geodir_get_imagesize_' . $size, $imagesizes[ $size ] );
598
+			return apply_filters('geodir_get_imagesize_'.$size, $imagesizes[$size]);
599 599
 
600
-		} elseif ( ! empty( $size ) ) {
600
+		} elseif (!empty($size)) {
601 601
 
602
-			return new WP_Error( 'geodir_no_imagesize', __( "Given image size is not valid", 'geodirectory' ) );
602
+			return new WP_Error('geodir_no_imagesize', __("Given image size is not valid", 'geodirectory'));
603 603
 
604 604
 		}
605 605
 
@@ -623,7 +623,7 @@  discard block
 block discarded – undo
623 623
 */
624 624
 
625 625
 
626
-if ( ! function_exists( 'createRandomString' ) ) {
626
+if (!function_exists('createRandomString')) {
627 627
 	/**
628 628
 	 * Creates random string.
629 629
 	 *
@@ -633,21 +633,21 @@  discard block
 block discarded – undo
633 633
 	 */
634 634
 	function createRandomString() {
635 635
 		$chars = "abcdefghijkmlnopqrstuvwxyz1023456789";
636
-		srand( (double) microtime() * 1000000 );
636
+		srand((double) microtime() * 1000000);
637 637
 		$i       = 0;
638 638
 		$rstring = '';
639
-		while ( $i <= 25 ) {
639
+		while ($i <= 25) {
640 640
 			$num     = rand() % 33;
641
-			$tmp     = substr( $chars, $num, 1 );
642
-			$rstring = $rstring . $tmp;
643
-			$i ++;
641
+			$tmp     = substr($chars, $num, 1);
642
+			$rstring = $rstring.$tmp;
643
+			$i++;
644 644
 		}
645 645
 
646 646
 		return $rstring;
647 647
 	}
648 648
 }
649 649
 
650
-if ( ! function_exists( 'geodir_getDistanceRadius' ) ) {
650
+if (!function_exists('geodir_getDistanceRadius')) {
651 651
 	/**
652 652
 	 * Calculates the distance radius.
653 653
 	 *
@@ -658,9 +658,9 @@  discard block
 block discarded – undo
658 658
 	 *
659 659
 	 * @return float The mean radius.
660 660
 	 */
661
-	function geodir_getDistanceRadius( $uom = 'km' ) {
661
+	function geodir_getDistanceRadius($uom = 'km') {
662 662
 //	Use Haversine formula to calculate the great circle distance between two points identified by longitude and latitude
663
-		switch ( geodir_strtolower( $uom ) ):
663
+		switch (geodir_strtolower($uom)):
664 664
 			case 'km'    :
665 665
 				$earthMeanRadius = 6371.009; // km
666 666
 				break;
@@ -692,7 +692,7 @@  discard block
 block discarded – undo
692 692
 }
693 693
 
694 694
 
695
-if ( ! function_exists( 'geodir_calculateDistanceFromLatLong' ) ) {
695
+if (!function_exists('geodir_calculateDistanceFromLatLong')) {
696 696
 	/**
697 697
 	 * Calculate the great circle distance between two points identified by longitude and latitude.
698 698
 	 *
@@ -705,17 +705,17 @@  discard block
 block discarded – undo
705 705
 	 *
706 706
 	 * @return float The distance.
707 707
 	 */
708
-	function geodir_calculateDistanceFromLatLong( $point1, $point2, $uom = 'km' ) {
708
+	function geodir_calculateDistanceFromLatLong($point1, $point2, $uom = 'km') {
709 709
 //	Use Haversine formula to calculate the great circle distance between two points identified by longitude and latitude
710 710
 
711
-		$earthMeanRadius = geodir_getDistanceRadius( $uom );
711
+		$earthMeanRadius = geodir_getDistanceRadius($uom);
712 712
 
713
-		$deltaLatitude  = deg2rad( (float) $point2['latitude'] - (float) $point1['latitude'] );
714
-		$deltaLongitude = deg2rad( (float) $point2['longitude'] - (float) $point1['longitude'] );
715
-		$a              = sin( $deltaLatitude / 2 ) * sin( $deltaLatitude / 2 ) +
716
-		                  cos( deg2rad( (float) $point1['latitude'] ) ) * cos( deg2rad( (float) $point2['latitude'] ) ) *
717
-		                  sin( $deltaLongitude / 2 ) * sin( $deltaLongitude / 2 );
718
-		$c              = 2 * atan2( sqrt( $a ), sqrt( 1 - $a ) );
713
+		$deltaLatitude  = deg2rad((float) $point2['latitude'] - (float) $point1['latitude']);
714
+		$deltaLongitude = deg2rad((float) $point2['longitude'] - (float) $point1['longitude']);
715
+		$a              = sin($deltaLatitude / 2) * sin($deltaLatitude / 2) +
716
+		                  cos(deg2rad((float) $point1['latitude'])) * cos(deg2rad((float) $point2['latitude'])) *
717
+		                  sin($deltaLongitude / 2) * sin($deltaLongitude / 2);
718
+		$c              = 2 * atan2(sqrt($a), sqrt(1 - $a));
719 719
 		$distance       = $earthMeanRadius * $c;
720 720
 
721 721
 		return $distance;
@@ -724,7 +724,7 @@  discard block
 block discarded – undo
724 724
 }
725 725
 
726 726
 
727
-if ( ! function_exists( 'geodir_sendEmail' ) ) {
727
+if (!function_exists('geodir_sendEmail')) {
728 728
 	/**
729 729
 	 * The main function that send transactional emails using the args provided.
730 730
 	 *
@@ -743,93 +743,93 @@  discard block
 block discarded – undo
743 743
 	 * @param string $post_id       The post ID.
744 744
 	 * @param string $user_id       The user ID.
745 745
 	 */
746
-	function geodir_sendEmail( $fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra = '', $message_type, $post_id = '', $user_id = '' ) {
746
+	function geodir_sendEmail($fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra = '', $message_type, $post_id = '', $user_id = '') {
747 747
 		$login_details = '';
748 748
 
749 749
 		// strip slashes from subject & message text
750
-		$to_subject = stripslashes_deep( $to_subject );
751
-		$to_message = stripslashes_deep( $to_message );
750
+		$to_subject = stripslashes_deep($to_subject);
751
+		$to_message = stripslashes_deep($to_message);
752 752
 
753
-		if ( $message_type == 'send_friend' ) {
754
-			$subject = get_option( 'geodir_email_friend_subject' );
755
-			$message = get_option( 'geodir_email_friend_content' );
756
-		} elseif ( $message_type == 'send_enquiry' ) {
757
-			$subject = get_option( 'geodir_email_enquiry_subject' );
758
-			$message = get_option( 'geodir_email_enquiry_content' );
753
+		if ($message_type == 'send_friend') {
754
+			$subject = get_option('geodir_email_friend_subject');
755
+			$message = get_option('geodir_email_friend_content');
756
+		} elseif ($message_type == 'send_enquiry') {
757
+			$subject = get_option('geodir_email_enquiry_subject');
758
+			$message = get_option('geodir_email_enquiry_content');
759 759
 
760 760
 			// change to name in some cases
761
-			$post_author = get_post_field( 'post_author', $post_id );
762
-			if(is_super_admin( $post_author  )){// if admin probably not the post author so change name
763
-				$toEmailName = __('Business Owner','geodirectory');
764
-			}elseif(defined('GEODIRCLAIM_VERSION') && geodir_get_post_meta($post_id,'claimed')!='1'){// if claim manager installed but listing not claimed
765
-				$toEmailName = __('Business Owner','geodirectory');
761
+			$post_author = get_post_field('post_author', $post_id);
762
+			if (is_super_admin($post_author)) {// if admin probably not the post author so change name
763
+				$toEmailName = __('Business Owner', 'geodirectory');
764
+			}elseif (defined('GEODIRCLAIM_VERSION') && geodir_get_post_meta($post_id, 'claimed') != '1') {// if claim manager installed but listing not claimed
765
+				$toEmailName = __('Business Owner', 'geodirectory');
766 766
 			}
767 767
 
768 768
 
769
-		} elseif ( $message_type == 'forgot_password' ) {
770
-			$subject       = get_option( 'geodir_forgot_password_subject' );
771
-			$message       = get_option( 'geodir_forgot_password_content' );
769
+		} elseif ($message_type == 'forgot_password') {
770
+			$subject       = get_option('geodir_forgot_password_subject');
771
+			$message       = get_option('geodir_forgot_password_content');
772 772
 			$login_details = $to_message;
773
-		} elseif ( $message_type == 'registration' ) {
774
-			$subject       = get_option( 'geodir_registration_success_email_subject' );
775
-			$message       = get_option( 'geodir_registration_success_email_content' );
773
+		} elseif ($message_type == 'registration') {
774
+			$subject       = get_option('geodir_registration_success_email_subject');
775
+			$message       = get_option('geodir_registration_success_email_content');
776 776
 			$login_details = $to_message;
777
-		} elseif ( $message_type == 'post_submit' ) {
778
-			$subject = get_option( 'geodir_post_submited_success_email_subject' );
779
-			$message = get_option( 'geodir_post_submited_success_email_content' );
780
-		} elseif ( $message_type == 'listing_published' ) {
781
-			$subject = get_option( 'geodir_post_published_email_subject' );
782
-			$message = get_option( 'geodir_post_published_email_content' );
783
-		} elseif ( $message_type == 'listing_edited' ) {
784
-			$subject = get_option( 'geodir_post_edited_email_subject_admin' );
785
-			$message = get_option( 'geodir_post_edited_email_content_admin' );
777
+		} elseif ($message_type == 'post_submit') {
778
+			$subject = get_option('geodir_post_submited_success_email_subject');
779
+			$message = get_option('geodir_post_submited_success_email_content');
780
+		} elseif ($message_type == 'listing_published') {
781
+			$subject = get_option('geodir_post_published_email_subject');
782
+			$message = get_option('geodir_post_published_email_content');
783
+		} elseif ($message_type == 'listing_edited') {
784
+			$subject = get_option('geodir_post_edited_email_subject_admin');
785
+			$message = get_option('geodir_post_edited_email_content_admin');
786 786
 		}
787 787
 
788
-		if ( ! empty( $subject ) ) {
789
-			$subject = __( stripslashes_deep( $subject ), 'geodirectory' );
788
+		if (!empty($subject)) {
789
+			$subject = __(stripslashes_deep($subject), 'geodirectory');
790 790
 		}
791 791
 
792
-		if ( ! empty( $message ) ) {
793
-			$message = __( stripslashes_deep( $message ), 'geodirectory' );
792
+		if (!empty($message)) {
793
+			$message = __(stripslashes_deep($message), 'geodirectory');
794 794
 		}
795 795
 
796
-		$to_message        = nl2br( $to_message );
797
-		$sitefromEmail     = get_option( 'site_email' );
796
+		$to_message        = nl2br($to_message);
797
+		$sitefromEmail     = get_option('site_email');
798 798
 		$sitefromEmailName = get_site_emailName();
799
-		$productlink       = get_permalink( $post_id );
799
+		$productlink       = get_permalink($post_id);
800 800
 
801 801
 		$user_login = '';
802
-		if ( $user_id > 0 && $user_info = get_userdata( $user_id ) ) {
802
+		if ($user_id > 0 && $user_info = get_userdata($user_id)) {
803 803
 			$user_login = $user_info->user_login;
804 804
 		}
805 805
 
806 806
 		$posted_date = '';
807 807
 		$listingLink = '';
808 808
 
809
-		$post_info = get_post( $post_id );
809
+		$post_info = get_post($post_id);
810 810
 
811
-		if ( $post_info ) {
811
+		if ($post_info) {
812 812
 			$posted_date = $post_info->post_date;
813
-			$listingLink = '<a href="' . $productlink . '"><b>' . $post_info->post_title . '</b></a>';
813
+			$listingLink = '<a href="'.$productlink.'"><b>'.$post_info->post_title.'</b></a>';
814 814
 		}
815 815
 		$siteurl       = home_url();
816
-		$siteurl_link  = '<a href="' . $siteurl . '">' . $siteurl . '</a>';
816
+		$siteurl_link  = '<a href="'.$siteurl.'">'.$siteurl.'</a>';
817 817
 		$loginurl      = geodir_login_url();
818
-		$loginurl_link = '<a href="' . $loginurl . '">login</a>';
818
+		$loginurl_link = '<a href="'.$loginurl.'">login</a>';
819 819
 
820
-		$post_author_id   = ! empty( $post_info ) ? $post_info->post_author : 0;
821
-		$post_author_name = geodir_get_client_name( $post_author_id );
822
-		$current_date     = date_i18n( 'Y-m-d H:i:s', current_time( 'timestamp' ) );
820
+		$post_author_id   = !empty($post_info) ? $post_info->post_author : 0;
821
+		$post_author_name = geodir_get_client_name($post_author_id);
822
+		$current_date     = date_i18n('Y-m-d H:i:s', current_time('timestamp'));
823 823
 
824
-		if ( $fromEmail == '' ) {
825
-			$fromEmail = get_option( 'site_email' );
824
+		if ($fromEmail == '') {
825
+			$fromEmail = get_option('site_email');
826 826
 		}
827 827
 
828
-		if ( $fromEmailName == '' ) {
829
-			$fromEmailName = get_option( 'site_email_name' );
828
+		if ($fromEmailName == '') {
829
+			$fromEmailName = get_option('site_email_name');
830 830
 		}
831 831
 
832
-		$search_array  = array(
832
+		$search_array = array(
833 833
 			'[#listing_link#]',
834 834
 			'[#site_name_url#]',
835 835
 			'[#post_id#]',
@@ -869,7 +869,7 @@  discard block
 block discarded – undo
869 869
 			$post_author_name,
870 870
 			$current_date
871 871
 		);
872
-		$message       = str_replace( $search_array, $replace_array, $message );
872
+		$message       = str_replace($search_array, $replace_array, $message);
873 873
 
874 874
 		$search_array  = array(
875 875
 			'[#listing_link#]',
@@ -905,12 +905,12 @@  discard block
 block discarded – undo
905 905
 			$post_author_name,
906 906
 			$current_date
907 907
 		);
908
-		$subject       = str_replace( $search_array, $replace_array, $subject );
908
+		$subject = str_replace($search_array, $replace_array, $subject);
909 909
 
910
-		$headers = 'MIME-Version: 1.0' . "\r\n";
911
-		$headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n";
912
-		$headers .= "Reply-To: " . $fromEmail . "\r\n";
913
-		$headers .= 'From: ' . $sitefromEmailName . ' <' . $sitefromEmail . '>' . "\r\n";
910
+		$headers = 'MIME-Version: 1.0'."\r\n";
911
+		$headers .= 'Content-type: text/html; charset=UTF-8'."\r\n";
912
+		$headers .= "Reply-To: ".$fromEmail."\r\n";
913
+		$headers .= 'From: '.$sitefromEmailName.' <'.$sitefromEmail.'>'."\r\n";
914 914
 
915 915
 		$to = $toEmail;
916 916
 
@@ -932,7 +932,7 @@  discard block
 block discarded – undo
932 932
 		 * @param string $post_id       The post ID.
933 933
 		 * @param string $user_id       The user ID.
934 934
 		 */
935
-		$to = apply_filters( 'geodir_sendEmail_to', $to, $fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id );
935
+		$to = apply_filters('geodir_sendEmail_to', $to, $fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id);
936 936
 		/**
937 937
 		 * Filter the client email subject.
938 938
 		 *
@@ -951,7 +951,7 @@  discard block
 block discarded – undo
951 951
 		 * @param string $post_id       The post ID.
952 952
 		 * @param string $user_id       The user ID.
953 953
 		 */
954
-		$subject = apply_filters( 'geodir_sendEmail_subject', $subject, $fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id );
954
+		$subject = apply_filters('geodir_sendEmail_subject', $subject, $fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id);
955 955
 		/**
956 956
 		 * Filter the client email message.
957 957
 		 *
@@ -970,7 +970,7 @@  discard block
 block discarded – undo
970 970
 		 * @param string $post_id       The post ID.
971 971
 		 * @param string $user_id       The user ID.
972 972
 		 */
973
-		$message = apply_filters( 'geodir_sendEmail_message', $message, $fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id );
973
+		$message = apply_filters('geodir_sendEmail_message', $message, $fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id);
974 974
 		/**
975 975
 		 * Filter the client email headers.
976 976
 		 *
@@ -989,39 +989,39 @@  discard block
 block discarded – undo
989 989
 		 * @param string $post_id       The post ID.
990 990
 		 * @param string $user_id       The user ID.
991 991
 		 */
992
-		$headers = apply_filters( 'geodir_sendEmail_headers', $headers, $fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id );
992
+		$headers = apply_filters('geodir_sendEmail_headers', $headers, $fromEmail, $fromEmailName, $toEmail, $toEmailName, $to_subject, $to_message, $extra, $message_type, $post_id, $user_id);
993 993
 
994
-		$sent = wp_mail( $to, $subject, $message, $headers );
994
+		$sent = wp_mail($to, $subject, $message, $headers);
995 995
 
996
-		if ( ! $sent ) {
997
-			if ( is_array( $to ) ) {
998
-				$to = implode( ',', $to );
996
+		if (!$sent) {
997
+			if (is_array($to)) {
998
+				$to = implode(',', $to);
999 999
 			}
1000 1000
 			$log_message = sprintf(
1001
-				__( "Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory' ),
1001
+				__("Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory'),
1002 1002
 				$message_type,
1003
-				date_i18n( 'F j Y H:i:s', current_time( 'timestamp' ) ),
1003
+				date_i18n('F j Y H:i:s', current_time('timestamp')),
1004 1004
 				$to,
1005 1005
 				$subject
1006 1006
 			);
1007
-			geodir_error_log( $log_message );
1007
+			geodir_error_log($log_message);
1008 1008
 		}
1009 1009
 
1010 1010
 		///////// ADMIN BCC EMIALS
1011
-		$adminEmail = get_bloginfo( 'admin_email' );
1011
+		$adminEmail = get_bloginfo('admin_email');
1012 1012
 		$to         = $adminEmail;
1013 1013
 
1014 1014
 		$admin_bcc = false;
1015
-		if ( $message_type == 'registration' ) {
1016
-			$message_raw  = explode( __( "Password:", 'geodirectory' ), $message );
1017
-			$message_raw2 = explode( "</p>", $message_raw[1], 2 );
1018
-			$message      = $message_raw[0] . __( 'Password:', 'geodirectory' ) . ' **********</p>' . $message_raw2[1];
1015
+		if ($message_type == 'registration') {
1016
+			$message_raw  = explode(__("Password:", 'geodirectory'), $message);
1017
+			$message_raw2 = explode("</p>", $message_raw[1], 2);
1018
+			$message      = $message_raw[0].__('Password:', 'geodirectory').' **********</p>'.$message_raw2[1];
1019 1019
 		}
1020
-		if ( $message_type == 'post_submit' ) {
1021
-			$subject = __( stripslashes_deep( get_option( 'geodir_post_submited_success_email_subject_admin' ) ), 'geodirectory' );
1022
-			$message = __( stripslashes_deep( get_option( 'geodir_post_submited_success_email_content_admin' ) ), 'geodirectory' );
1020
+		if ($message_type == 'post_submit') {
1021
+			$subject = __(stripslashes_deep(get_option('geodir_post_submited_success_email_subject_admin')), 'geodirectory');
1022
+			$message = __(stripslashes_deep(get_option('geodir_post_submited_success_email_content_admin')), 'geodirectory');
1023 1023
 
1024
-			$search_array  = array(
1024
+			$search_array = array(
1025 1025
 				'[#listing_link#]',
1026 1026
 				'[#site_name_url#]',
1027 1027
 				'[#post_id#]',
@@ -1053,7 +1053,7 @@  discard block
 block discarded – undo
1053 1053
 				$user_login,
1054 1054
 				$user_login
1055 1055
 			);
1056
-			$message       = str_replace( $search_array, $replace_array, $message );
1056
+			$message       = str_replace($search_array, $replace_array, $message);
1057 1057
 
1058 1058
 			$search_array  = array(
1059 1059
 				'[#listing_link#]',
@@ -1081,40 +1081,40 @@  discard block
 block discarded – undo
1081 1081
 				$user_login,
1082 1082
 				$user_login
1083 1083
 			);
1084
-			$subject       = str_replace( $search_array, $replace_array, $subject );
1084
+			$subject = str_replace($search_array, $replace_array, $subject);
1085 1085
 
1086 1086
 			$subject .= ' - ADMIN BCC COPY';
1087 1087
 			$admin_bcc = true;
1088 1088
 
1089
-		} elseif ( $message_type == 'registration' && get_option( 'geodir_bcc_new_user' ) ) {
1089
+		} elseif ($message_type == 'registration' && get_option('geodir_bcc_new_user')) {
1090 1090
 			$subject .= ' - ADMIN BCC COPY';
1091 1091
 			$admin_bcc = true;
1092
-		} elseif ( $message_type == 'send_friend' && get_option( 'geodir_bcc_friend' ) ) {
1092
+		} elseif ($message_type == 'send_friend' && get_option('geodir_bcc_friend')) {
1093 1093
 			$subject .= ' - ADMIN BCC COPY';
1094 1094
 			$admin_bcc = true;
1095
-		} elseif ( $message_type == 'send_enquiry' && get_option( 'geodir_bcc_enquiry' ) ) {
1095
+		} elseif ($message_type == 'send_enquiry' && get_option('geodir_bcc_enquiry')) {
1096 1096
 			$subject .= ' - ADMIN BCC COPY';
1097 1097
 			$admin_bcc = true;
1098
-		} elseif ( $message_type == 'listing_published' && get_option( 'geodir_bcc_listing_published' ) ) {
1098
+		} elseif ($message_type == 'listing_published' && get_option('geodir_bcc_listing_published')) {
1099 1099
 			$subject .= ' - ADMIN BCC COPY';
1100 1100
 			$admin_bcc = true;
1101 1101
 		}
1102 1102
 
1103
-		if ( $admin_bcc === true ) {
1104
-			$sent = wp_mail( $to, $subject, $message, $headers );
1103
+		if ($admin_bcc === true) {
1104
+			$sent = wp_mail($to, $subject, $message, $headers);
1105 1105
 
1106
-			if ( ! $sent ) {
1107
-				if ( is_array( $to ) ) {
1108
-					$to = implode( ',', $to );
1106
+			if (!$sent) {
1107
+				if (is_array($to)) {
1108
+					$to = implode(',', $to);
1109 1109
 				}
1110 1110
 				$log_message = sprintf(
1111
-					__( "Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory' ),
1111
+					__("Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory'),
1112 1112
 					$message_type,
1113
-					date_i18n( 'F j Y H:i:s', current_time( 'timestamp' ) ),
1113
+					date_i18n('F j Y H:i:s', current_time('timestamp')),
1114 1114
 					$to,
1115 1115
 					$subject
1116 1116
 				);
1117
-				geodir_error_log( $log_message );
1117
+				geodir_error_log($log_message);
1118 1118
 			}
1119 1119
 		}
1120 1120
 
@@ -1130,52 +1130,52 @@  discard block
 block discarded – undo
1130 1130
  */
1131 1131
 function geodir_taxonomy_breadcrumb() {
1132 1132
 
1133
-	$term   = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
1133
+	$term   = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy'));
1134 1134
 	$parent = $term->parent;
1135 1135
 
1136
-	while ( $parent ):
1136
+	while ($parent):
1137 1137
 		$parents[]  = $parent;
1138
-		$new_parent = get_term_by( 'id', $parent, get_query_var( 'taxonomy' ) );
1138
+		$new_parent = get_term_by('id', $parent, get_query_var('taxonomy'));
1139 1139
 		$parent     = $new_parent->parent;
1140 1140
 	endwhile;
1141 1141
 
1142
-	if ( ! empty( $parents ) ):
1143
-		$parents = array_reverse( $parents );
1142
+	if (!empty($parents)):
1143
+		$parents = array_reverse($parents);
1144 1144
 
1145
-		foreach ( $parents as $parent ):
1146
-			$item = get_term_by( 'id', $parent, get_query_var( 'taxonomy' ) );
1147
-			$url  = get_term_link( $item, get_query_var( 'taxonomy' ) );
1148
-			echo '<li> > <a href="' . $url . '">' . $item->name . '</a></li>';
1145
+		foreach ($parents as $parent):
1146
+			$item = get_term_by('id', $parent, get_query_var('taxonomy'));
1147
+			$url  = get_term_link($item, get_query_var('taxonomy'));
1148
+			echo '<li> > <a href="'.$url.'">'.$item->name.'</a></li>';
1149 1149
 		endforeach;
1150 1150
 
1151 1151
 	endif;
1152 1152
 
1153
-	echo '<li> > ' . $term->name . '</li>';
1153
+	echo '<li> > '.$term->name.'</li>';
1154 1154
 }
1155 1155
 
1156
-function geodir_wpml_post_type_archive_link($link, $post_type){
1156
+function geodir_wpml_post_type_archive_link($link, $post_type) {
1157 1157
 
1158
-	if(function_exists('icl_object_id')) {
1159
-		$post_types   = get_option( 'geodir_post_types' );
1160
-		$slug         = $post_types[ $post_type ]['rewrite']['slug'];
1158
+	if (function_exists('icl_object_id')) {
1159
+		$post_types   = get_option('geodir_post_types');
1160
+		$slug         = $post_types[$post_type]['rewrite']['slug'];
1161 1161
 
1162 1162
 		//echo $link.'###'.gd_wpml_get_lang_from_url( $link) ;
1163 1163
 
1164 1164
 		// Alter the CPT slug if WPML is set to do so
1165
-		if ( function_exists( 'icl_object_id' ) ) {
1166
-			if ( gd_wpml_slug_translation_turned_on( $post_type ) && $language_code = gd_wpml_get_lang_from_url( $link) ) {
1165
+		if (function_exists('icl_object_id')) {
1166
+			if (gd_wpml_slug_translation_turned_on($post_type) && $language_code = gd_wpml_get_lang_from_url($link)) {
1167 1167
 
1168 1168
 				$org_slug = $slug;
1169
-				$slug     = apply_filters( 'wpml_translate_single_string',
1169
+				$slug     = apply_filters('wpml_translate_single_string',
1170 1170
 					$slug,
1171 1171
 					'WordPress',
1172
-					'URL slug: ' . $slug,
1173
-					$language_code );
1172
+					'URL slug: '.$slug,
1173
+					$language_code);
1174 1174
 
1175
-				if ( ! $slug ) {
1175
+				if (!$slug) {
1176 1176
 					$slug = $org_slug;
1177 1177
 				} else {
1178
-					$link = str_replace( $org_slug, $slug, $link );
1178
+					$link = str_replace($org_slug, $slug, $link);
1179 1179
 				}
1180 1180
 
1181 1181
 			}
@@ -1206,9 +1206,9 @@  discard block
 block discarded – undo
1206 1206
 	 *
1207 1207
 	 * @since 1.0.0
1208 1208
 	 */
1209
-	$separator = apply_filters( 'geodir_breadcrumb_separator', ' > ' );
1209
+	$separator = apply_filters('geodir_breadcrumb_separator', ' > ');
1210 1210
 
1211
-	if ( ! geodir_is_page( 'home' ) ) {
1211
+	if (!geodir_is_page('home')) {
1212 1212
 		$breadcrumb    = '';
1213 1213
 		$url_categoris = '';
1214 1214
 		$breadcrumb .= '<div class="geodir-breadcrumb clearfix"><ul id="breadcrumbs">';
@@ -1217,162 +1217,162 @@  discard block
 block discarded – undo
1217 1217
 		 *
1218 1218
 		 * @since 1.0.0
1219 1219
 		 */
1220
-		$breadcrumb .= '<li>' . apply_filters( 'geodir_breadcrumb_first_link', '<a href="' . home_url() . '">' . __( 'Home', 'geodirectory' ) . '</a>' ) . '</li>';
1220
+		$breadcrumb .= '<li>'.apply_filters('geodir_breadcrumb_first_link', '<a href="'.home_url().'">'.__('Home', 'geodirectory').'</a>').'</li>';
1221 1221
 
1222 1222
 		$gd_post_type   = geodir_get_current_posttype();
1223
-		$post_type_info = get_post_type_object( $gd_post_type );
1223
+		$post_type_info = get_post_type_object($gd_post_type);
1224 1224
 
1225
-		remove_filter( 'post_type_archive_link', 'geodir_get_posttype_link' );
1225
+		remove_filter('post_type_archive_link', 'geodir_get_posttype_link');
1226 1226
 
1227
-		$listing_link = get_post_type_archive_link( $gd_post_type );
1227
+		$listing_link = get_post_type_archive_link($gd_post_type);
1228 1228
 
1229
-		add_filter( 'post_type_archive_link', 'geodir_get_posttype_link', 10, 2 );
1230
-		$listing_link = rtrim( $listing_link, '/' );
1229
+		add_filter('post_type_archive_link', 'geodir_get_posttype_link', 10, 2);
1230
+		$listing_link = rtrim($listing_link, '/');
1231 1231
 		$listing_link .= '/';
1232 1232
 
1233 1233
 		$post_type_for_location_link = $listing_link;
1234
-		$location_terms              = geodir_get_current_location_terms( 'query_vars', $gd_post_type );
1234
+		$location_terms              = geodir_get_current_location_terms('query_vars', $gd_post_type);
1235 1235
 
1236 1236
 		global $wp, $gd_session;
1237 1237
 		$location_link = $post_type_for_location_link;
1238 1238
 
1239
-		if ( geodir_is_page( 'detail' ) || geodir_is_page( 'listing' ) ) {
1239
+		if (geodir_is_page('detail') || geodir_is_page('listing')) {
1240 1240
 			global $post;
1241
-			$location_manager     = defined( 'POST_LOCATION_TABLE' ) ? true : false;
1242
-			$neighbourhood_active = $location_manager && get_option( 'location_neighbourhoods' ) ? true : false;
1241
+			$location_manager     = defined('POST_LOCATION_TABLE') ? true : false;
1242
+			$neighbourhood_active = $location_manager && get_option('location_neighbourhoods') ? true : false;
1243 1243
 
1244
-			if ( geodir_is_page( 'detail' ) && isset( $post->country_slug ) ) {
1244
+			if (geodir_is_page('detail') && isset($post->country_slug)) {
1245 1245
 				$location_terms = array(
1246 1246
 					'gd_country' => $post->country_slug,
1247 1247
 					'gd_region'  => $post->region_slug,
1248 1248
 					'gd_city'    => $post->city_slug
1249 1249
 				);
1250 1250
 
1251
-				if ( $neighbourhood_active && ! empty( $location_terms['gd_city'] ) && $gd_ses_neighbourhood = $gd_session->get( 'gd_neighbourhood' ) ) {
1251
+				if ($neighbourhood_active && !empty($location_terms['gd_city']) && $gd_ses_neighbourhood = $gd_session->get('gd_neighbourhood')) {
1252 1252
 					$location_terms['gd_neighbourhood'] = $gd_ses_neighbourhood;
1253 1253
 				}
1254 1254
 			}
1255 1255
 
1256
-			$geodir_show_location_url = get_option( 'geodir_show_location_url' );
1256
+			$geodir_show_location_url = get_option('geodir_show_location_url');
1257 1257
 
1258 1258
 			$hide_url_part = array();
1259
-			if ( $location_manager ) {
1260
-				$hide_country_part = get_option( 'geodir_location_hide_country_part' );
1261
-				$hide_region_part  = get_option( 'geodir_location_hide_region_part' );
1262
-
1263
-				if ( $hide_region_part && $hide_country_part ) {
1264
-					$hide_url_part = array( 'gd_country', 'gd_region' );
1265
-				} else if ( $hide_region_part && ! $hide_country_part ) {
1266
-					$hide_url_part = array( 'gd_region' );
1267
-				} else if ( ! $hide_region_part && $hide_country_part ) {
1268
-					$hide_url_part = array( 'gd_country' );
1259
+			if ($location_manager) {
1260
+				$hide_country_part = get_option('geodir_location_hide_country_part');
1261
+				$hide_region_part  = get_option('geodir_location_hide_region_part');
1262
+
1263
+				if ($hide_region_part && $hide_country_part) {
1264
+					$hide_url_part = array('gd_country', 'gd_region');
1265
+				} else if ($hide_region_part && !$hide_country_part) {
1266
+					$hide_url_part = array('gd_region');
1267
+				} else if (!$hide_region_part && $hide_country_part) {
1268
+					$hide_url_part = array('gd_country');
1269 1269
 				}
1270 1270
 			}
1271 1271
 
1272 1272
 			$hide_text_part = array();
1273
-			if ( $geodir_show_location_url == 'country_city' ) {
1274
-				$hide_text_part = array( 'gd_region' );
1273
+			if ($geodir_show_location_url == 'country_city') {
1274
+				$hide_text_part = array('gd_region');
1275 1275
 
1276
-				if ( isset( $location_terms['gd_region'] ) && ! $location_manager ) {
1277
-					unset( $location_terms['gd_region'] );
1276
+				if (isset($location_terms['gd_region']) && !$location_manager) {
1277
+					unset($location_terms['gd_region']);
1278 1278
 				}
1279
-			} else if ( $geodir_show_location_url == 'region_city' ) {
1280
-				$hide_text_part = array( 'gd_country' );
1279
+			} else if ($geodir_show_location_url == 'region_city') {
1280
+				$hide_text_part = array('gd_country');
1281 1281
 
1282
-				if ( isset( $location_terms['gd_country'] ) && ! $location_manager ) {
1283
-					unset( $location_terms['gd_country'] );
1282
+				if (isset($location_terms['gd_country']) && !$location_manager) {
1283
+					unset($location_terms['gd_country']);
1284 1284
 				}
1285
-			} else if ( $geodir_show_location_url == 'city' ) {
1286
-				$hide_text_part = array( 'gd_country', 'gd_region' );
1285
+			} else if ($geodir_show_location_url == 'city') {
1286
+				$hide_text_part = array('gd_country', 'gd_region');
1287 1287
 
1288
-				if ( isset( $location_terms['gd_country'] ) && ! $location_manager ) {
1289
-					unset( $location_terms['gd_country'] );
1288
+				if (isset($location_terms['gd_country']) && !$location_manager) {
1289
+					unset($location_terms['gd_country']);
1290 1290
 				}
1291
-				if ( isset( $location_terms['gd_region'] ) && ! $location_manager ) {
1292
-					unset( $location_terms['gd_region'] );
1291
+				if (isset($location_terms['gd_region']) && !$location_manager) {
1292
+					unset($location_terms['gd_region']);
1293 1293
 				}
1294 1294
 			}
1295 1295
 
1296 1296
 			$is_location_last = '';
1297 1297
 			$is_taxonomy_last = '';
1298 1298
 			$breadcrumb .= '<li>';
1299
-			if ( get_query_var( $gd_post_type . 'category' ) ) {
1300
-				$gd_taxonomy = $gd_post_type . 'category';
1301
-			} elseif ( get_query_var( $gd_post_type . '_tags' ) ) {
1302
-				$gd_taxonomy = $gd_post_type . '_tags';
1299
+			if (get_query_var($gd_post_type.'category')) {
1300
+				$gd_taxonomy = $gd_post_type.'category';
1301
+			} elseif (get_query_var($gd_post_type.'_tags')) {
1302
+				$gd_taxonomy = $gd_post_type.'_tags';
1303 1303
 			}
1304 1304
 
1305
-			$breadcrumb .= $separator . '<a href="' . $listing_link . '">' . __( ucfirst( $post_type_info->label ), 'geodirectory' ) . '</a>';
1306
-			if ( ! empty( $gd_taxonomy ) || geodir_is_page( 'detail' ) ) {
1305
+			$breadcrumb .= $separator.'<a href="'.$listing_link.'">'.__(ucfirst($post_type_info->label), 'geodirectory').'</a>';
1306
+			if (!empty($gd_taxonomy) || geodir_is_page('detail')) {
1307 1307
 				$is_location_last = false;
1308 1308
 			} else {
1309 1309
 				$is_location_last = true;
1310 1310
 			}
1311 1311
 
1312
-			if ( ! empty( $gd_taxonomy ) && geodir_is_page( 'listing' ) ) {
1312
+			if (!empty($gd_taxonomy) && geodir_is_page('listing')) {
1313 1313
 				$is_taxonomy_last = true;
1314 1314
 			} else {
1315 1315
 				$is_taxonomy_last = false;
1316 1316
 			}
1317 1317
 
1318
-			if ( ! empty( $location_terms ) ) {
1319
-				$geodir_get_locations = function_exists( 'get_actual_location_name' ) ? true : false;
1318
+			if (!empty($location_terms)) {
1319
+				$geodir_get_locations = function_exists('get_actual_location_name') ? true : false;
1320 1320
 
1321
-				foreach ( $location_terms as $key => $location_term ) {
1322
-					if ( $location_term != '' ) {
1323
-						if ( ! empty( $hide_url_part ) && in_array( $key, $hide_url_part ) ) { // Hide location part from url & breadcrumb.
1321
+				foreach ($location_terms as $key => $location_term) {
1322
+					if ($location_term != '') {
1323
+						if (!empty($hide_url_part) && in_array($key, $hide_url_part)) { // Hide location part from url & breadcrumb.
1324 1324
 							continue;
1325 1325
 						}
1326 1326
 
1327
-						$gd_location_link_text = preg_replace( '/-(\d+)$/', '', $location_term );
1328
-						$gd_location_link_text = preg_replace( '/[_-]/', ' ', $gd_location_link_text );
1329
-						$gd_location_link_text = ucfirst( $gd_location_link_text );
1327
+						$gd_location_link_text = preg_replace('/-(\d+)$/', '', $location_term);
1328
+						$gd_location_link_text = preg_replace('/[_-]/', ' ', $gd_location_link_text);
1329
+						$gd_location_link_text = ucfirst($gd_location_link_text);
1330 1330
 
1331 1331
 						$location_term_actual_country = '';
1332 1332
 						$location_term_actual_region  = '';
1333 1333
 						$location_term_actual_city    = '';
1334
-						if ( $geodir_get_locations ) {
1335
-							if ( $key == 'gd_country' ) {
1336
-								$location_term_actual_country = get_actual_location_name( 'country', $location_term, true );
1337
-							} else if ( $key == 'gd_region' ) {
1338
-								$location_term_actual_region = get_actual_location_name( 'region', $location_term, true );
1339
-							} else if ( $key == 'gd_city' ) {
1340
-								$location_term_actual_city = get_actual_location_name( 'city', $location_term, true );
1334
+						if ($geodir_get_locations) {
1335
+							if ($key == 'gd_country') {
1336
+								$location_term_actual_country = get_actual_location_name('country', $location_term, true);
1337
+							} else if ($key == 'gd_region') {
1338
+								$location_term_actual_region = get_actual_location_name('region', $location_term, true);
1339
+							} else if ($key == 'gd_city') {
1340
+								$location_term_actual_city = get_actual_location_name('city', $location_term, true);
1341 1341
 							}
1342 1342
 						} else {
1343 1343
 							$location_info = geodir_get_location();
1344 1344
 
1345
-							if ( ! empty( $location_info ) && isset( $location_info->location_id ) ) {
1346
-								if ( $key == 'gd_country' ) {
1347
-									$location_term_actual_country = __( $location_info->country, 'geodirectory' );
1348
-								} else if ( $key == 'gd_region' ) {
1349
-									$location_term_actual_region = __( $location_info->region, 'geodirectory' );
1350
-								} else if ( $key == 'gd_city' ) {
1351
-									$location_term_actual_city = __( $location_info->city, 'geodirectory' );
1345
+							if (!empty($location_info) && isset($location_info->location_id)) {
1346
+								if ($key == 'gd_country') {
1347
+									$location_term_actual_country = __($location_info->country, 'geodirectory');
1348
+								} else if ($key == 'gd_region') {
1349
+									$location_term_actual_region = __($location_info->region, 'geodirectory');
1350
+								} else if ($key == 'gd_city') {
1351
+									$location_term_actual_city = __($location_info->city, 'geodirectory');
1352 1352
 								}
1353 1353
 							}
1354 1354
 						}
1355 1355
 
1356
-						if ( $is_location_last && $key == 'gd_country' && ! ( isset( $location_terms['gd_region'] ) && $location_terms['gd_region'] != '' ) && ! ( isset( $location_terms['gd_city'] ) && $location_terms['gd_city'] != '' ) ) {
1357
-							$breadcrumb .= $location_term_actual_country != '' ? $separator . $location_term_actual_country : $separator . $gd_location_link_text;
1358
-						} else if ( $is_location_last && $key == 'gd_region' && ! ( isset( $location_terms['gd_city'] ) && $location_terms['gd_city'] != '' ) ) {
1359
-							$breadcrumb .= $location_term_actual_region != '' ? $separator . $location_term_actual_region : $separator . $gd_location_link_text;
1360
-						} else if ( $is_location_last && $key == 'gd_city' && empty( $location_terms['gd_neighbourhood'] ) ) {
1361
-							$breadcrumb .= $location_term_actual_city != '' ? $separator . $location_term_actual_city : $separator . $gd_location_link_text;
1362
-						} else if ( $is_location_last && $key == 'gd_neighbourhood' ) {
1363
-							$breadcrumb .= $separator . $gd_location_link_text;
1356
+						if ($is_location_last && $key == 'gd_country' && !(isset($location_terms['gd_region']) && $location_terms['gd_region'] != '') && !(isset($location_terms['gd_city']) && $location_terms['gd_city'] != '')) {
1357
+							$breadcrumb .= $location_term_actual_country != '' ? $separator.$location_term_actual_country : $separator.$gd_location_link_text;
1358
+						} else if ($is_location_last && $key == 'gd_region' && !(isset($location_terms['gd_city']) && $location_terms['gd_city'] != '')) {
1359
+							$breadcrumb .= $location_term_actual_region != '' ? $separator.$location_term_actual_region : $separator.$gd_location_link_text;
1360
+						} else if ($is_location_last && $key == 'gd_city' && empty($location_terms['gd_neighbourhood'])) {
1361
+							$breadcrumb .= $location_term_actual_city != '' ? $separator.$location_term_actual_city : $separator.$gd_location_link_text;
1362
+						} else if ($is_location_last && $key == 'gd_neighbourhood') {
1363
+							$breadcrumb .= $separator.$gd_location_link_text;
1364 1364
 						} else {
1365
-							if ( get_option( 'permalink_structure' ) != '' ) {
1366
-								$location_link .= $location_term . '/';
1365
+							if (get_option('permalink_structure') != '') {
1366
+								$location_link .= $location_term.'/';
1367 1367
 							} else {
1368
-								$location_link .= "&$key=" . $location_term;
1368
+								$location_link .= "&$key=".$location_term;
1369 1369
 							}
1370 1370
 
1371
-							if ( $key == 'gd_country' && $location_term_actual_country != '' ) {
1371
+							if ($key == 'gd_country' && $location_term_actual_country != '') {
1372 1372
 								$gd_location_link_text = $location_term_actual_country;
1373
-							} else if ( $key == 'gd_region' && $location_term_actual_region != '' ) {
1373
+							} else if ($key == 'gd_region' && $location_term_actual_region != '') {
1374 1374
 								$gd_location_link_text = $location_term_actual_region;
1375
-							} else if ( $key == 'gd_city' && $location_term_actual_city != '' ) {
1375
+							} else if ($key == 'gd_city' && $location_term_actual_city != '') {
1376 1376
 								$gd_location_link_text = $location_term_actual_city;
1377 1377
 							}
1378 1378
 
@@ -1382,76 +1382,76 @@  discard block
 block discarded – undo
1382 1382
                             }
1383 1383
                             */
1384 1384
 
1385
-							$breadcrumb .= $separator . '<a href="' . $location_link . '">' . $gd_location_link_text . '</a>';
1385
+							$breadcrumb .= $separator.'<a href="'.$location_link.'">'.$gd_location_link_text.'</a>';
1386 1386
 						}
1387 1387
 					}
1388 1388
 				}
1389 1389
 			}
1390 1390
 
1391
-			if ( ! empty( $gd_taxonomy ) ) {
1391
+			if (!empty($gd_taxonomy)) {
1392 1392
 				$term_index = 1;
1393 1393
 
1394 1394
 				//if(get_option('geodir_add_categories_url'))
1395 1395
 				{
1396
-					if ( get_query_var( $gd_post_type . '_tags' ) ) {
1397
-						$cat_link = $listing_link . 'tags/';
1396
+					if (get_query_var($gd_post_type.'_tags')) {
1397
+						$cat_link = $listing_link.'tags/';
1398 1398
 					} else {
1399 1399
 						$cat_link = $listing_link;
1400 1400
 					}
1401 1401
 
1402
-					foreach ( $location_terms as $key => $location_term ) {
1403
-						if ( $location_manager && in_array( $key, $hide_url_part ) ) {
1402
+					foreach ($location_terms as $key => $location_term) {
1403
+						if ($location_manager && in_array($key, $hide_url_part)) {
1404 1404
 							continue;
1405 1405
 						}
1406 1406
 
1407
-						if ( $location_term != '' ) {
1408
-							if ( get_option( 'permalink_structure' ) != '' ) {
1409
-								$cat_link .= $location_term . '/';
1407
+						if ($location_term != '') {
1408
+							if (get_option('permalink_structure') != '') {
1409
+								$cat_link .= $location_term.'/';
1410 1410
 							}
1411 1411
 						}
1412 1412
 					}
1413 1413
 
1414
-					$term_array = explode( "/", trim( $wp_query->query[ $gd_taxonomy ], "/" ) );
1415
-					foreach ( $term_array as $term ) {
1416
-						$term_link_text = preg_replace( '/-(\d+)$/', '', $term );
1417
-						$term_link_text = preg_replace( '/[_-]/', ' ', $term_link_text );
1414
+					$term_array = explode("/", trim($wp_query->query[$gd_taxonomy], "/"));
1415
+					foreach ($term_array as $term) {
1416
+						$term_link_text = preg_replace('/-(\d+)$/', '', $term);
1417
+						$term_link_text = preg_replace('/[_-]/', ' ', $term_link_text);
1418 1418
 
1419 1419
 						// get term actual name
1420
-						$term_info = get_term_by( 'slug', $term, $gd_taxonomy, 'ARRAY_A' );
1421
-						if ( ! empty( $term_info ) && isset( $term_info['name'] ) && $term_info['name'] != '' ) {
1422
-							$term_link_text = urldecode( $term_info['name'] );
1420
+						$term_info = get_term_by('slug', $term, $gd_taxonomy, 'ARRAY_A');
1421
+						if (!empty($term_info) && isset($term_info['name']) && $term_info['name'] != '') {
1422
+							$term_link_text = urldecode($term_info['name']);
1423 1423
 						} else {
1424 1424
 							continue;
1425 1425
 							//$term_link_text = wp_strip_all_tags(geodir_ucwords(urldecode($term_link_text)));
1426 1426
 						}
1427 1427
 
1428
-						if ( $term_index == count( $term_array ) && $is_taxonomy_last ) {
1429
-							$breadcrumb .= $separator . $term_link_text;
1428
+						if ($term_index == count($term_array) && $is_taxonomy_last) {
1429
+							$breadcrumb .= $separator.$term_link_text;
1430 1430
 						} else {
1431
-							$cat_link .= $term . '/';
1432
-							$breadcrumb .= $separator . '<a href="' . $cat_link . '">' . $term_link_text . '</a>';
1431
+							$cat_link .= $term.'/';
1432
+							$breadcrumb .= $separator.'<a href="'.$cat_link.'">'.$term_link_text.'</a>';
1433 1433
 						}
1434
-						$term_index ++;
1434
+						$term_index++;
1435 1435
 					}
1436 1436
 				}
1437 1437
 
1438 1438
 
1439 1439
 			}
1440 1440
 
1441
-			if ( geodir_is_page( 'detail' ) ) {
1442
-				$breadcrumb .= $separator . get_the_title();
1441
+			if (geodir_is_page('detail')) {
1442
+				$breadcrumb .= $separator.get_the_title();
1443 1443
 			}
1444 1444
 
1445 1445
 			$breadcrumb .= '</li>';
1446 1446
 
1447 1447
 
1448
-		} elseif ( geodir_is_page( 'author' ) ) {
1448
+		} elseif (geodir_is_page('author')) {
1449 1449
 			$user_id             = get_current_user_id();
1450
-			$author_link         = get_author_posts_url( $user_id );
1451
-			$default_author_link = geodir_getlink( $author_link, array(
1450
+			$author_link         = get_author_posts_url($user_id);
1451
+			$default_author_link = geodir_getlink($author_link, array(
1452 1452
 				'geodir_dashbord' => 'true',
1453 1453
 				'stype'           => 'gd_place'
1454
-			), false );
1454
+			), false);
1455 1455
 
1456 1456
 			/**
1457 1457
 			 * Filter author page link.
@@ -1461,16 +1461,16 @@  discard block
 block discarded – undo
1461 1461
 			 * @param string $default_author_link Default author link.
1462 1462
 			 * @param int $user_id                Author ID.
1463 1463
 			 */
1464
-			$default_author_link = apply_filters( 'geodir_dashboard_author_link', $default_author_link, $user_id );
1464
+			$default_author_link = apply_filters('geodir_dashboard_author_link', $default_author_link, $user_id);
1465 1465
 
1466 1466
 			$breadcrumb .= '<li>';
1467
-			$breadcrumb .= $separator . '<a href="' . $default_author_link . '">' . __( 'My Dashboard', 'geodirectory' ) . '</a>';
1467
+			$breadcrumb .= $separator.'<a href="'.$default_author_link.'">'.__('My Dashboard', 'geodirectory').'</a>';
1468 1468
 
1469
-			if ( isset( $_REQUEST['list'] ) ) {
1470
-				$author_link = geodir_getlink( $author_link, array(
1469
+			if (isset($_REQUEST['list'])) {
1470
+				$author_link = geodir_getlink($author_link, array(
1471 1471
 					'geodir_dashbord' => 'true',
1472 1472
 					'stype'           => $_REQUEST['stype']
1473
-				), false );
1473
+				), false);
1474 1474
 
1475 1475
 				/**
1476 1476
 				 * Filter author page link.
@@ -1481,61 +1481,61 @@  discard block
 block discarded – undo
1481 1481
 				 * @param int $user_id        Author ID.
1482 1482
 				 * @param string $_REQUEST    ['stype'] Post type.
1483 1483
 				 */
1484
-				$author_link = apply_filters( 'geodir_dashboard_author_link', $author_link, $user_id, $_REQUEST['stype'] );
1484
+				$author_link = apply_filters('geodir_dashboard_author_link', $author_link, $user_id, $_REQUEST['stype']);
1485 1485
 
1486
-				$breadcrumb .= $separator . '<a href="' . $author_link . '">' . __( ucfirst( $post_type_info->label ), 'geodirectory' ) . '</a>';
1487
-				$breadcrumb .= $separator . ucfirst( __( 'My', 'geodirectory' ) . ' ' . $_REQUEST['list'] );
1486
+				$breadcrumb .= $separator.'<a href="'.$author_link.'">'.__(ucfirst($post_type_info->label), 'geodirectory').'</a>';
1487
+				$breadcrumb .= $separator.ucfirst(__('My', 'geodirectory').' '.$_REQUEST['list']);
1488 1488
 			} else {
1489
-				$breadcrumb .= $separator . __( ucfirst( $post_type_info->label ), 'geodirectory' );
1489
+				$breadcrumb .= $separator.__(ucfirst($post_type_info->label), 'geodirectory');
1490 1490
 			}
1491 1491
 
1492 1492
 			$breadcrumb .= '</li>';
1493
-		} elseif ( is_category() || is_single() ) {
1493
+		} elseif (is_category() || is_single()) {
1494 1494
 			$category = get_the_category();
1495
-			if ( is_category() ) {
1496
-				$breadcrumb .= '<li>' . $separator . $category[0]->cat_name . '</li>';
1495
+			if (is_category()) {
1496
+				$breadcrumb .= '<li>'.$separator.$category[0]->cat_name.'</li>';
1497 1497
 			}
1498
-			if ( is_single() ) {
1499
-				$breadcrumb .= '<li>' . $separator . '<a href="' . get_category_link( $category[0]->term_id ) . '">' . $category[0]->cat_name . '</a></li>';
1500
-				$breadcrumb .= '<li>' . $separator . get_the_title() . '</li>';
1498
+			if (is_single()) {
1499
+				$breadcrumb .= '<li>'.$separator.'<a href="'.get_category_link($category[0]->term_id).'">'.$category[0]->cat_name.'</a></li>';
1500
+				$breadcrumb .= '<li>'.$separator.get_the_title().'</li>';
1501 1501
 			}
1502 1502
 			/* End of my version ##################################################### */
1503
-		} else if ( is_page() ) {
1503
+		} else if (is_page()) {
1504 1504
 			$page_title = get_the_title();
1505 1505
 
1506
-			if ( geodir_is_page( 'location' ) ) {
1506
+			if (geodir_is_page('location')) {
1507 1507
 				$location_page_id = geodir_location_page_id();
1508
-				$loc_post         = get_post( $location_page_id );
1508
+				$loc_post         = get_post($location_page_id);
1509 1509
 				$post_name        = $loc_post->post_name;
1510
-				$slug             = ucwords( str_replace( '-', ' ', $post_name ) );
1511
-				$page_title       = ! empty( $slug ) ? $slug : __( 'Location', 'geodirectory' );
1510
+				$slug             = ucwords(str_replace('-', ' ', $post_name));
1511
+				$page_title       = !empty($slug) ? $slug : __('Location', 'geodirectory');
1512 1512
 			}
1513 1513
 
1514
-			$breadcrumb .= '<li>' . $separator;
1515
-			$breadcrumb .= stripslashes_deep( $page_title );
1514
+			$breadcrumb .= '<li>'.$separator;
1515
+			$breadcrumb .= stripslashes_deep($page_title);
1516 1516
 			$breadcrumb .= '</li>';
1517
-		} else if ( is_tag() ) {
1518
-			$breadcrumb .= "<li> " . $separator . single_tag_title( '', false ) . '</li>';
1519
-		} else if ( is_day() ) {
1520
-			$breadcrumb .= "<li> " . $separator . __( " Archive for", 'geodirectory' ) . " ";
1521
-			the_time( 'F jS, Y' );
1517
+		} else if (is_tag()) {
1518
+			$breadcrumb .= "<li> ".$separator.single_tag_title('', false).'</li>';
1519
+		} else if (is_day()) {
1520
+			$breadcrumb .= "<li> ".$separator.__(" Archive for", 'geodirectory')." ";
1521
+			the_time('F jS, Y');
1522 1522
 			$breadcrumb .= '</li>';
1523
-		} else if ( is_month() ) {
1524
-			$breadcrumb .= "<li> " . $separator . __( " Archive for", 'geodirectory' ) . " ";
1525
-			the_time( 'F, Y' );
1523
+		} else if (is_month()) {
1524
+			$breadcrumb .= "<li> ".$separator.__(" Archive for", 'geodirectory')." ";
1525
+			the_time('F, Y');
1526 1526
 			$breadcrumb .= '</li>';
1527
-		} else if ( is_year() ) {
1528
-			$breadcrumb .= "<li> " . $separator . __( " Archive for", 'geodirectory' ) . " ";
1529
-			the_time( 'Y' );
1527
+		} else if (is_year()) {
1528
+			$breadcrumb .= "<li> ".$separator.__(" Archive for", 'geodirectory')." ";
1529
+			the_time('Y');
1530 1530
 			$breadcrumb .= '</li>';
1531
-		} else if ( is_author() ) {
1532
-			$breadcrumb .= "<li> " . $separator . __( " Author Archive", 'geodirectory' );
1531
+		} else if (is_author()) {
1532
+			$breadcrumb .= "<li> ".$separator.__(" Author Archive", 'geodirectory');
1533 1533
 			$breadcrumb .= '</li>';
1534
-		} else if ( isset( $_GET['paged'] ) && ! empty( $_GET['paged'] ) ) {
1535
-			$breadcrumb .= "<li>" . $separator . __( "Blog Archives", 'geodirectory' );
1534
+		} else if (isset($_GET['paged']) && !empty($_GET['paged'])) {
1535
+			$breadcrumb .= "<li>".$separator.__("Blog Archives", 'geodirectory');
1536 1536
 			$breadcrumb .= '</li>';
1537
-		} else if ( is_search() ) {
1538
-			$breadcrumb .= "<li> " . $separator . __( " Search Results", 'geodirectory' );
1537
+		} else if (is_search()) {
1538
+			$breadcrumb .= "<li> ".$separator.__(" Search Results", 'geodirectory');
1539 1539
 			$breadcrumb .= '</li>';
1540 1540
 		}
1541 1541
 		$breadcrumb .= '</ul></div>';
@@ -1548,13 +1548,13 @@  discard block
 block discarded – undo
1548 1548
 		 * @param string $breadcrumb Breadcrumb HTML.
1549 1549
 		 * @param string $separator  Breadcrumb separator.
1550 1550
 		 */
1551
-		echo $breadcrumb = apply_filters( 'geodir_breadcrumb', $breadcrumb, $separator );
1551
+		echo $breadcrumb = apply_filters('geodir_breadcrumb', $breadcrumb, $separator);
1552 1552
 	}
1553 1553
 }
1554 1554
 
1555 1555
 
1556
-add_action( "admin_init", "geodir_allow_wpadmin" ); // check user is admin
1557
-if ( ! function_exists( 'geodir_allow_wpadmin' ) ) {
1556
+add_action("admin_init", "geodir_allow_wpadmin"); // check user is admin
1557
+if (!function_exists('geodir_allow_wpadmin')) {
1558 1558
 	/**
1559 1559
 	 * Allow only admins to access wp-admin.
1560 1560
 	 *
@@ -1566,12 +1566,12 @@  discard block
 block discarded – undo
1566 1566
 	 */
1567 1567
 	function geodir_allow_wpadmin() {
1568 1568
 		global $wpdb;
1569
-		if ( get_option( 'geodir_allow_wpadmin' ) == '0' && is_user_logged_in() && ( ! defined( 'DOING_AJAX' ) ) ) // checking action in request to allow ajax request go through
1569
+		if (get_option('geodir_allow_wpadmin') == '0' && is_user_logged_in() && (!defined('DOING_AJAX'))) // checking action in request to allow ajax request go through
1570 1570
 		{
1571
-			if ( current_user_can( 'administrator' ) ) {
1571
+			if (current_user_can('administrator')) {
1572 1572
 			} else {
1573 1573
 
1574
-				wp_redirect( home_url() );
1574
+				wp_redirect(home_url());
1575 1575
 				exit;
1576 1576
 			}
1577 1577
 
@@ -1590,23 +1590,23 @@  discard block
 block discarded – undo
1590 1590
  *
1591 1591
  * @return array|WP_Error The uploaded data as array. When failure returns error.
1592 1592
  */
1593
-function fetch_remote_file( $url ) {
1593
+function fetch_remote_file($url) {
1594 1594
 	// extract the file name and extension from the url
1595
-	require_once( ABSPATH . 'wp-includes/pluggable.php' );
1596
-	$file_name = basename( $url );
1597
-	if ( strpos( $file_name, '?' ) !== false ) {
1598
-		list( $file_name ) = explode( '?', $file_name );
1595
+	require_once(ABSPATH.'wp-includes/pluggable.php');
1596
+	$file_name = basename($url);
1597
+	if (strpos($file_name, '?') !== false) {
1598
+		list($file_name) = explode('?', $file_name);
1599 1599
 	}
1600 1600
 	$dummy        = false;
1601 1601
 	$add_to_cache = false;
1602 1602
 	$key          = null;
1603
-	if ( strpos( $url, '/dummy/' ) !== false ) {
1603
+	if (strpos($url, '/dummy/') !== false) {
1604 1604
 		$dummy = true;
1605
-		$key   = "dummy_" . str_replace( '.', '_', $file_name );
1606
-		$value = get_transient( 'cached_dummy_images' );
1607
-		if ( $value ) {
1608
-			if ( isset( $value[ $key ] ) ) {
1609
-				return $value[ $key ];
1605
+		$key   = "dummy_".str_replace('.', '_', $file_name);
1606
+		$value = get_transient('cached_dummy_images');
1607
+		if ($value) {
1608
+			if (isset($value[$key])) {
1609
+				return $value[$key];
1610 1610
 			} else {
1611 1611
 				$add_to_cache = true;
1612 1612
 			}
@@ -1617,58 +1617,58 @@  discard block
 block discarded – undo
1617 1617
 
1618 1618
 	// get placeholder file in the upload dir with a unique, sanitized filename
1619 1619
 
1620
-	$post_upload_date = isset( $post['upload_date'] ) ? $post['upload_date'] : '';
1620
+	$post_upload_date = isset($post['upload_date']) ? $post['upload_date'] : '';
1621 1621
 
1622
-	$upload = wp_upload_bits( $file_name, 0, '', $post_upload_date );
1623
-	if ( $upload['error'] ) {
1624
-		return new WP_Error( 'upload_dir_error', $upload['error'] );
1622
+	$upload = wp_upload_bits($file_name, 0, '', $post_upload_date);
1623
+	if ($upload['error']) {
1624
+		return new WP_Error('upload_dir_error', $upload['error']);
1625 1625
 	}
1626 1626
 
1627 1627
 
1628
-	sleep( 0.3 );// if multiple remote file this can cause the remote server to timeout so we add a slight delay
1628
+	sleep(0.3); // if multiple remote file this can cause the remote server to timeout so we add a slight delay
1629 1629
 
1630 1630
 	// fetch the remote url and write it to the placeholder file
1631
-	$headers = wp_remote_get( $url, array( 'stream' => true, 'filename' => $upload['file'] ) );
1631
+	$headers = wp_remote_get($url, array('stream' => true, 'filename' => $upload['file']));
1632 1632
 
1633 1633
 	$log_message = '';
1634
-	if ( is_wp_error( $headers ) ) {
1635
-		echo 'file: ' . $url;
1634
+	if (is_wp_error($headers)) {
1635
+		echo 'file: '.$url;
1636 1636
 
1637
-		return new WP_Error( 'import_file_error', $headers->get_error_message() );
1637
+		return new WP_Error('import_file_error', $headers->get_error_message());
1638 1638
 	}
1639 1639
 
1640
-	$filesize = filesize( $upload['file'] );
1640
+	$filesize = filesize($upload['file']);
1641 1641
 	// request failed
1642
-	if ( ! $headers ) {
1643
-		$log_message = __( 'Remote server did not respond', 'geodirectory' );
1642
+	if (!$headers) {
1643
+		$log_message = __('Remote server did not respond', 'geodirectory');
1644 1644
 	} // make sure the fetch was successful
1645
-	elseif ( $headers['response']['code'] != '200' ) {
1646
-		$log_message = sprintf( __( 'Remote server returned error response %1$d %2$s', 'geodirectory' ), esc_html( $headers['response'] ), get_status_header_desc( $headers['response'] ) );
1647
-	} elseif ( isset( $headers['headers']['content-length'] ) && $filesize != $headers['headers']['content-length'] ) {
1648
-		$log_message = __( 'Remote file is incorrect size', 'geodirectory' );
1649
-	} elseif ( 0 == $filesize ) {
1650
-		$log_message = __( 'Zero size file downloaded', 'geodirectory' );
1651
-	}
1652
-
1653
-	if ( $log_message ) {
1654
-		$del = unlink( $upload['file'] );
1655
-		if ( ! $del ) {
1656
-			geodir_error_log( __( 'GeoDirectory: fetch_remote_file() failed to delete temp file.', 'geodirectory' ) );
1645
+	elseif ($headers['response']['code'] != '200') {
1646
+		$log_message = sprintf(__('Remote server returned error response %1$d %2$s', 'geodirectory'), esc_html($headers['response']), get_status_header_desc($headers['response']));
1647
+	} elseif (isset($headers['headers']['content-length']) && $filesize != $headers['headers']['content-length']) {
1648
+		$log_message = __('Remote file is incorrect size', 'geodirectory');
1649
+	} elseif (0 == $filesize) {
1650
+		$log_message = __('Zero size file downloaded', 'geodirectory');
1651
+	}
1652
+
1653
+	if ($log_message) {
1654
+		$del = unlink($upload['file']);
1655
+		if (!$del) {
1656
+			geodir_error_log(__('GeoDirectory: fetch_remote_file() failed to delete temp file.', 'geodirectory'));
1657 1657
 		}
1658 1658
 
1659
-		return new WP_Error( 'import_file_error', $log_message );
1659
+		return new WP_Error('import_file_error', $log_message);
1660 1660
 	}
1661 1661
 
1662
-	if ( $dummy && $add_to_cache && is_array( $upload ) ) {
1663
-		$images = get_transient( 'cached_dummy_images' );
1664
-		if ( is_array( $images ) ) {
1665
-			$images[ $key ] = $upload;
1662
+	if ($dummy && $add_to_cache && is_array($upload)) {
1663
+		$images = get_transient('cached_dummy_images');
1664
+		if (is_array($images)) {
1665
+			$images[$key] = $upload;
1666 1666
 		} else {
1667
-			$images = array( $key => $upload );
1667
+			$images = array($key => $upload);
1668 1668
 		}
1669 1669
 
1670 1670
 		//setting the cache using the WP Transient API
1671
-		set_transient( 'cached_dummy_images', $images, 60 * 10 ); //10 minutes cache
1671
+		set_transient('cached_dummy_images', $images, 60 * 10); //10 minutes cache
1672 1672
 	}
1673 1673
 
1674 1674
 	return $upload;
@@ -1682,12 +1682,12 @@  discard block
 block discarded – undo
1682 1682
  * @return string|void Max upload size.
1683 1683
  */
1684 1684
 function geodir_max_upload_size() {
1685
-	$max_filesize = (float) get_option( 'geodir_upload_max_filesize', 2 );
1685
+	$max_filesize = (float) get_option('geodir_upload_max_filesize', 2);
1686 1686
 
1687
-	if ( $max_filesize > 0 && $max_filesize < 1 ) {
1688
-		$max_filesize = (int) ( $max_filesize * 1024 ) . 'kb';
1687
+	if ($max_filesize > 0 && $max_filesize < 1) {
1688
+		$max_filesize = (int) ($max_filesize * 1024).'kb';
1689 1689
 	} else {
1690
-		$max_filesize = $max_filesize > 0 ? $max_filesize . 'mb' : '2mb';
1690
+		$max_filesize = $max_filesize > 0 ? $max_filesize.'mb' : '2mb';
1691 1691
 	}
1692 1692
 
1693 1693
 	/**
@@ -1697,7 +1697,7 @@  discard block
 block discarded – undo
1697 1697
 	 *
1698 1698
 	 * @param string $max_filesize Max file upload size. Ex. 10mb, 512kb.
1699 1699
 	 */
1700
-	return apply_filters( 'geodir_default_image_upload_size_limit', $max_filesize );
1700
+	return apply_filters('geodir_default_image_upload_size_limit', $max_filesize);
1701 1701
 }
1702 1702
 
1703 1703
 /**
@@ -1710,8 +1710,8 @@  discard block
 block discarded – undo
1710 1710
  * @return bool If dummy folder exists returns true, else false.
1711 1711
  */
1712 1712
 function geodir_dummy_folder_exists() {
1713
-	$path = geodir_plugin_path() . '/geodirectory-admin/dummy/';
1714
-	if ( ! is_dir( $path ) ) {
1713
+	$path = geodir_plugin_path().'/geodirectory-admin/dummy/';
1714
+	if (!is_dir($path)) {
1715 1715
 		return false;
1716 1716
 	} else {
1717 1717
 		return true;
@@ -1730,17 +1730,17 @@  discard block
 block discarded – undo
1730 1730
  *
1731 1731
  * @return object Author info.
1732 1732
  */
1733
-function geodir_get_author_info( $aid ) {
1733
+function geodir_get_author_info($aid) {
1734 1734
 	global $wpdb;
1735 1735
 	/*$infosql = "select * from $wpdb->users where ID=$aid";*/
1736
-	$infosql = $wpdb->prepare( "select * from $wpdb->users where ID=%d", array( $aid ) );
1737
-	$info    = $wpdb->get_results( $infosql );
1738
-	if ( $info ) {
1736
+	$infosql = $wpdb->prepare("select * from $wpdb->users where ID=%d", array($aid));
1737
+	$info    = $wpdb->get_results($infosql);
1738
+	if ($info) {
1739 1739
 		return $info[0];
1740 1740
 	}
1741 1741
 }
1742 1742
 
1743
-if ( ! function_exists( 'adminEmail' ) ) {
1743
+if (!function_exists('adminEmail')) {
1744 1744
 	/**
1745 1745
 	 * Send emails to client on post submission, renew etc.
1746 1746
 	 *
@@ -1753,67 +1753,67 @@  discard block
 block discarded – undo
1753 1753
 	 * @param string $message_type Can be 'expiration','post_submited','renew','upgrade','claim_approved','claim_rejected','claim_requested','auto_claim','payment_success','payment_fail'.
1754 1754
 	 * @param string $custom_1     Custom data to be sent.
1755 1755
 	 */
1756
-	function adminEmail( $page_id, $user_id, $message_type, $custom_1 = '' ) {
1756
+	function adminEmail($page_id, $user_id, $message_type, $custom_1 = '') {
1757 1757
 		global $wpdb;
1758
-		if ( $message_type == 'expiration' ) {
1759
-			$subject        = stripslashes( __( get_option( 'renew_email_subject' ), 'geodirectory' ) );
1760
-			$client_message = stripslashes( __( get_option( 'renew_email_content' ), 'geodirectory' ) );
1761
-		} elseif ( $message_type == 'post_submited' ) {
1762
-			$subject        = __( get_option( 'post_submited_success_email_subject_admin' ), 'geodirectory' );
1763
-			$client_message = __( get_option( 'post_submited_success_email_content_admin' ), 'geodirectory' );
1764
-		} elseif ( $message_type == 'renew' ) {
1765
-			$subject        = __( get_option( 'post_renew_success_email_subject_admin' ), 'geodirectory' );
1766
-			$client_message = __( get_option( 'post_renew_success_email_content_admin' ), 'geodirectory' );
1767
-		} elseif ( $message_type == 'upgrade' ) {
1768
-			$subject        = __( get_option( 'post_upgrade_success_email_subject_admin' ), 'geodirectory' );
1769
-			$client_message = __( get_option( 'post_upgrade_success_email_content_admin' ), 'geodirectory' );
1770
-		} elseif ( $message_type == 'claim_approved' ) {
1771
-			$subject        = __( get_option( 'claim_approved_email_subject' ), 'geodirectory' );
1772
-			$client_message = __( get_option( 'claim_approved_email_content' ), 'geodirectory' );
1773
-		} elseif ( $message_type == 'claim_rejected' ) {
1774
-			$subject        = __( get_option( 'claim_rejected_email_subject' ), 'geodirectory' );
1775
-			$client_message = __( get_option( 'claim_rejected_email_content' ), 'geodirectory' );
1776
-		} elseif ( $message_type == 'claim_requested' ) {
1777
-			$subject        = __( get_option( 'claim_email_subject_admin' ), 'geodirectory' );
1778
-			$client_message = __( get_option( 'claim_email_content_admin' ), 'geodirectory' );
1779
-		} elseif ( $message_type == 'auto_claim' ) {
1780
-			$subject        = __( get_option( 'auto_claim_email_subject' ), 'geodirectory' );
1781
-			$client_message = __( get_option( 'auto_claim_email_content' ), 'geodirectory' );
1782
-		} elseif ( $message_type == 'payment_success' ) {
1783
-			$subject        = __( get_option( 'post_payment_success_admin_email_subject' ), 'geodirectory' );
1784
-			$client_message = __( get_option( 'post_payment_success_admin_email_content' ), 'geodirectory' );
1785
-		} elseif ( $message_type == 'payment_fail' ) {
1786
-			$subject        = __( get_option( 'post_payment_fail_admin_email_subject' ), 'geodirectory' );
1787
-			$client_message = __( get_option( 'post_payment_fail_admin_email_content' ), 'geodirectory' );
1758
+		if ($message_type == 'expiration') {
1759
+			$subject        = stripslashes(__(get_option('renew_email_subject'), 'geodirectory'));
1760
+			$client_message = stripslashes(__(get_option('renew_email_content'), 'geodirectory'));
1761
+		} elseif ($message_type == 'post_submited') {
1762
+			$subject        = __(get_option('post_submited_success_email_subject_admin'), 'geodirectory');
1763
+			$client_message = __(get_option('post_submited_success_email_content_admin'), 'geodirectory');
1764
+		} elseif ($message_type == 'renew') {
1765
+			$subject        = __(get_option('post_renew_success_email_subject_admin'), 'geodirectory');
1766
+			$client_message = __(get_option('post_renew_success_email_content_admin'), 'geodirectory');
1767
+		} elseif ($message_type == 'upgrade') {
1768
+			$subject        = __(get_option('post_upgrade_success_email_subject_admin'), 'geodirectory');
1769
+			$client_message = __(get_option('post_upgrade_success_email_content_admin'), 'geodirectory');
1770
+		} elseif ($message_type == 'claim_approved') {
1771
+			$subject        = __(get_option('claim_approved_email_subject'), 'geodirectory');
1772
+			$client_message = __(get_option('claim_approved_email_content'), 'geodirectory');
1773
+		} elseif ($message_type == 'claim_rejected') {
1774
+			$subject        = __(get_option('claim_rejected_email_subject'), 'geodirectory');
1775
+			$client_message = __(get_option('claim_rejected_email_content'), 'geodirectory');
1776
+		} elseif ($message_type == 'claim_requested') {
1777
+			$subject        = __(get_option('claim_email_subject_admin'), 'geodirectory');
1778
+			$client_message = __(get_option('claim_email_content_admin'), 'geodirectory');
1779
+		} elseif ($message_type == 'auto_claim') {
1780
+			$subject        = __(get_option('auto_claim_email_subject'), 'geodirectory');
1781
+			$client_message = __(get_option('auto_claim_email_content'), 'geodirectory');
1782
+		} elseif ($message_type == 'payment_success') {
1783
+			$subject        = __(get_option('post_payment_success_admin_email_subject'), 'geodirectory');
1784
+			$client_message = __(get_option('post_payment_success_admin_email_content'), 'geodirectory');
1785
+		} elseif ($message_type == 'payment_fail') {
1786
+			$subject        = __(get_option('post_payment_fail_admin_email_subject'), 'geodirectory');
1787
+			$client_message = __(get_option('post_payment_fail_admin_email_content'), 'geodirectory');
1788 1788
 		}
1789 1789
 		$transaction_details = $custom_1;
1790
-		$fromEmail           = get_option( 'site_email' );
1790
+		$fromEmail           = get_option('site_email');
1791 1791
 		$fromEmailName       = get_site_emailName();
1792 1792
 //$alivedays = get_post_meta($page_id,'alive_days',true);
1793
-		$pkg_limit            = get_property_price_info_listing( $page_id );
1793
+		$pkg_limit            = get_property_price_info_listing($page_id);
1794 1794
 		$alivedays            = $pkg_limit['days'];
1795
-		$productlink          = get_permalink( $page_id );
1796
-		$post_info            = get_post( $page_id );
1797
-		$post_date            = date( 'dS F,Y', strtotime( $post_info->post_date ) );
1798
-		$listingLink          = '<a href="' . $productlink . '"><b>' . $post_info->post_title . '</b></a>';
1795
+		$productlink          = get_permalink($page_id);
1796
+		$post_info            = get_post($page_id);
1797
+		$post_date            = date('dS F,Y', strtotime($post_info->post_date));
1798
+		$listingLink          = '<a href="'.$productlink.'"><b>'.$post_info->post_title.'</b></a>';
1799 1799
 		$loginurl             = geodir_login_url();
1800
-		$loginurl_link        = '<a href="' . $loginurl . '">login</a>';
1800
+		$loginurl_link        = '<a href="'.$loginurl.'">login</a>';
1801 1801
 		$siteurl              = home_url();
1802
-		$siteurl_link         = '<a href="' . $siteurl . '">' . $fromEmailName . '</a>';
1803
-		$user_info            = get_userdata( $user_id );
1802
+		$siteurl_link         = '<a href="'.$siteurl.'">'.$fromEmailName.'</a>';
1803
+		$user_info            = get_userdata($user_id);
1804 1804
 		$user_email           = $user_info->user_email;
1805
-		$display_name         = geodir_get_client_name( $user_id );
1805
+		$display_name         = geodir_get_client_name($user_id);
1806 1806
 		$user_login           = $user_info->user_login;
1807
-		$number_of_grace_days = get_option( 'ptthemes_listing_preexpiry_notice_days' );
1808
-		if ( $number_of_grace_days == '' ) {
1807
+		$number_of_grace_days = get_option('ptthemes_listing_preexpiry_notice_days');
1808
+		if ($number_of_grace_days == '') {
1809 1809
 			$number_of_grace_days = 1;
1810 1810
 		}
1811
-		if ( $post_info->post_type == 'event' ) {
1811
+		if ($post_info->post_type == 'event') {
1812 1812
 			$post_type = 'event';
1813 1813
 		} else {
1814 1814
 			$post_type = 'listing';
1815 1815
 		}
1816
-		$renew_link     = '<a href="' . $siteurl . '?ptype=post_' . $post_type . '&renew=1&pid=' . $page_id . '">' . RENEW_LINK . '</a>';
1816
+		$renew_link     = '<a href="'.$siteurl.'?ptype=post_'.$post_type.'&renew=1&pid='.$page_id.'">'.RENEW_LINK.'</a>';
1817 1817
 		$search_array   = array(
1818 1818
 			'[#client_name#]',
1819 1819
 			'[#listing_link#]',
@@ -1829,7 +1829,7 @@  discard block
 block discarded – undo
1829 1829
 			'[#site_name#]',
1830 1830
 			'[#transaction_details#]'
1831 1831
 		);
1832
-		$replace_array  = array(
1832
+		$replace_array = array(
1833 1833
 			$display_name,
1834 1834
 			$listingLink,
1835 1835
 			$post_date,
@@ -1844,11 +1844,11 @@  discard block
 block discarded – undo
1844 1844
 			$fromEmailName,
1845 1845
 			$transaction_details
1846 1846
 		);
1847
-		$client_message = str_replace( $search_array, $replace_array, $client_message );
1848
-		$subject        = str_replace( $search_array, $replace_array, $subject );
1849
-		$headers        = 'MIME-Version: 1.0' . "\r\n";
1850
-		$headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n";
1851
-		$headers .= 'From: ' . $fromEmailName . ' <' . $fromEmail . '>' . "\r\n";
1847
+		$client_message = str_replace($search_array, $replace_array, $client_message);
1848
+		$subject        = str_replace($search_array, $replace_array, $subject);
1849
+		$headers        = 'MIME-Version: 1.0'."\r\n";
1850
+		$headers .= 'Content-type: text/html; charset=UTF-8'."\r\n";
1851
+		$headers .= 'From: '.$fromEmailName.' <'.$fromEmail.'>'."\r\n";
1852 1852
 
1853 1853
 		$to      = $fromEmail;
1854 1854
 		$message = $client_message;
@@ -1866,7 +1866,7 @@  discard block
 block discarded – undo
1866 1866
 		 * @param string $message_type Can be 'expiration','post_submited','renew','upgrade','claim_approved','claim_rejected','claim_requested','auto_claim','payment_success','payment_fail'.
1867 1867
 		 * @param string $custom_1     Custom data to be sent.
1868 1868
 		 */
1869
-		$to = apply_filters( 'geodir_adminEmail_to', $to, $page_id, $user_id, $message_type, $custom_1 );
1869
+		$to = apply_filters('geodir_adminEmail_to', $to, $page_id, $user_id, $message_type, $custom_1);
1870 1870
 		/**
1871 1871
 		 * Filter the admin email subject.
1872 1872
 		 *
@@ -1879,7 +1879,7 @@  discard block
 block discarded – undo
1879 1879
 		 * @param string $message_type Can be 'expiration','post_submited','renew','upgrade','claim_approved','claim_rejected','claim_requested','auto_claim','payment_success','payment_fail'.
1880 1880
 		 * @param string $custom_1     Custom data to be sent.
1881 1881
 		 */
1882
-		$subject = apply_filters( 'geodir_adminEmail_subject', $subject, $page_id, $user_id, $message_type, $custom_1 );
1882
+		$subject = apply_filters('geodir_adminEmail_subject', $subject, $page_id, $user_id, $message_type, $custom_1);
1883 1883
 		/**
1884 1884
 		 * Filter the admin email message.
1885 1885
 		 *
@@ -1892,7 +1892,7 @@  discard block
 block discarded – undo
1892 1892
 		 * @param string $message_type Can be 'expiration','post_submited','renew','upgrade','claim_approved','claim_rejected','claim_requested','auto_claim','payment_success','payment_fail'.
1893 1893
 		 * @param string $custom_1     Custom data to be sent.
1894 1894
 		 */
1895
-		$message = apply_filters( 'geodir_adminEmail_message', $message, $page_id, $user_id, $message_type, $custom_1 );
1895
+		$message = apply_filters('geodir_adminEmail_message', $message, $page_id, $user_id, $message_type, $custom_1);
1896 1896
 		/**
1897 1897
 		 * Filter the admin email headers.
1898 1898
 		 *
@@ -1905,22 +1905,22 @@  discard block
 block discarded – undo
1905 1905
 		 * @param string $message_type Can be 'expiration','post_submited','renew','upgrade','claim_approved','claim_rejected','claim_requested','auto_claim','payment_success','payment_fail'.
1906 1906
 		 * @param string $custom_1     Custom data to be sent.
1907 1907
 		 */
1908
-		$headers = apply_filters( 'geodir_adminEmail_headers', $headers, $page_id, $user_id, $message_type, $custom_1 );
1908
+		$headers = apply_filters('geodir_adminEmail_headers', $headers, $page_id, $user_id, $message_type, $custom_1);
1909 1909
 
1910 1910
 
1911
-		$sent = wp_mail( $to, $subject, $message, $headers );
1912
-		if ( ! $sent ) {
1913
-			if ( is_array( $to ) ) {
1914
-				$to = implode( ',', $to );
1911
+		$sent = wp_mail($to, $subject, $message, $headers);
1912
+		if (!$sent) {
1913
+			if (is_array($to)) {
1914
+				$to = implode(',', $to);
1915 1915
 			}
1916 1916
 			$log_message = sprintf(
1917
-				__( "Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory' ),
1917
+				__("Email from GeoDirectory failed to send.\nMessage type: %s\nSend time: %s\nTo: %s\nSubject: %s\n\n", 'geodirectory'),
1918 1918
 				$message_type,
1919
-				date_i18n( 'F j Y H:i:s', current_time( 'timestamp' ) ),
1919
+				date_i18n('F j Y H:i:s', current_time('timestamp')),
1920 1920
 				$to,
1921 1921
 				$subject
1922 1922
 			);
1923
-			geodir_error_log( $log_message );
1923
+			geodir_error_log($log_message);
1924 1924
 		}
1925 1925
 	}
1926 1926
 }
@@ -1940,12 +1940,12 @@  discard block
 block discarded – undo
1940 1940
  *
1941 1941
  * @return array Category IDs.
1942 1942
  */
1943
-function gd_lang_object_ids( $ids_array, $type ) {
1944
-	if ( function_exists( 'icl_object_id' ) ) {
1943
+function gd_lang_object_ids($ids_array, $type) {
1944
+	if (function_exists('icl_object_id')) {
1945 1945
 		$res = array();
1946
-		foreach ( $ids_array as $id ) {
1947
-			$xlat = icl_object_id( $id, $type, false );
1948
-			if ( ! is_null( $xlat ) ) {
1946
+		foreach ($ids_array as $id) {
1947
+			$xlat = icl_object_id($id, $type, false);
1948
+			if (!is_null($xlat)) {
1949 1949
 				$res[] = $xlat;
1950 1950
 			}
1951 1951
 		}
@@ -1969,20 +1969,20 @@  discard block
 block discarded – undo
1969 1969
  *
1970 1970
  * @return array Modified Body CSS classes.
1971 1971
  */
1972
-function geodir_custom_posts_body_class( $classes ) {
1972
+function geodir_custom_posts_body_class($classes) {
1973 1973
 	global $wpdb, $wp;
1974
-	$post_types = geodir_get_posttypes( 'object' );
1975
-	if ( ! empty( $post_types ) && count( (array) $post_types ) > 1 ) {
1974
+	$post_types = geodir_get_posttypes('object');
1975
+	if (!empty($post_types) && count((array) $post_types) > 1) {
1976 1976
 		$classes[] = 'geodir_custom_posts';
1977 1977
 	}
1978 1978
 
1979 1979
 	// fix body class for signup page
1980
-	if ( geodir_is_page( 'login' ) ) {
1980
+	if (geodir_is_page('login')) {
1981 1981
 		$new_classes   = array();
1982 1982
 		$new_classes[] = 'signup page-geodir-signup';
1983
-		if ( ! empty( $classes ) ) {
1984
-			foreach ( $classes as $class ) {
1985
-				if ( $class && $class != 'home' && $class != 'blog' ) {
1983
+		if (!empty($classes)) {
1984
+			foreach ($classes as $class) {
1985
+				if ($class && $class != 'home' && $class != 'blog') {
1986 1986
 					$new_classes[] = $class;
1987 1987
 				}
1988 1988
 			}
@@ -1990,14 +1990,14 @@  discard block
 block discarded – undo
1990 1990
 		$classes = $new_classes;
1991 1991
 	}
1992 1992
 
1993
-	if ( geodir_is_geodir_page() ) {
1993
+	if (geodir_is_geodir_page()) {
1994 1994
 		$classes[] = 'geodir-page';
1995 1995
 	}
1996 1996
 
1997 1997
 	return $classes;
1998 1998
 }
1999 1999
 
2000
-add_filter( 'body_class', 'geodir_custom_posts_body_class' ); // let's add a class to the body so we can style the new addition to the search
2000
+add_filter('body_class', 'geodir_custom_posts_body_class'); // let's add a class to the body so we can style the new addition to the search
2001 2001
 
2002 2002
 
2003 2003
 /**
@@ -2013,7 +2013,7 @@  discard block
 block discarded – undo
2013 2013
 	 *
2014 2014
 	 * @since 1.0.0
2015 2015
 	 */
2016
-	return apply_filters( 'geodir_map_zoom_level', array(
2016
+	return apply_filters('geodir_map_zoom_level', array(
2017 2017
 		1,
2018 2018
 		2,
2019 2019
 		3,
@@ -2033,7 +2033,7 @@  discard block
 block discarded – undo
2033 2033
 		17,
2034 2034
 		18,
2035 2035
 		19
2036
-	) );
2036
+	));
2037 2037
 
2038 2038
 }
2039 2039
 
@@ -2046,12 +2046,12 @@  discard block
 block discarded – undo
2046 2046
  *
2047 2047
  * @param string $geodir_option_name Option key.
2048 2048
  */
2049
-function geodir_option_version_backup( $geodir_option_name ) {
2049
+function geodir_option_version_backup($geodir_option_name) {
2050 2050
 	$version_date  = time();
2051
-	$geodir_option = get_option( $geodir_option_name );
2051
+	$geodir_option = get_option($geodir_option_name);
2052 2052
 
2053
-	if ( ! empty( $geodir_option ) ) {
2054
-		add_option( $geodir_option_name . '_' . $version_date, $geodir_option );
2053
+	if (!empty($geodir_option)) {
2054
+		add_option($geodir_option_name.'_'.$version_date, $geodir_option);
2055 2055
 	}
2056 2056
 }
2057 2057
 
@@ -2065,10 +2065,10 @@  discard block
 block discarded – undo
2065 2065
  *
2066 2066
  * @return int Page ID.
2067 2067
  */
2068
-function get_page_id_geodir_add_listing_page( $page_id ) {
2069
-	if ( geodir_wpml_multilingual_status() ) {
2068
+function get_page_id_geodir_add_listing_page($page_id) {
2069
+	if (geodir_wpml_multilingual_status()) {
2070 2070
 		$post_type = 'post_page';
2071
-		$page_id   = geodir_get_wpml_element_id( $page_id, $post_type );
2071
+		$page_id   = geodir_get_wpml_element_id($page_id, $post_type);
2072 2072
 	}
2073 2073
 
2074 2074
 	return $page_id;
@@ -2082,7 +2082,7 @@  discard block
 block discarded – undo
2082 2082
  * @return bool Returns true when sitepress multilingual CMS active. else returns false.
2083 2083
  */
2084 2084
 function geodir_wpml_multilingual_status() {
2085
-	if ( function_exists( 'icl_object_id' ) ) {
2085
+	if (function_exists('icl_object_id')) {
2086 2086
 		return true;
2087 2087
 	}
2088 2088
 
@@ -2100,19 +2100,19 @@  discard block
 block discarded – undo
2100 2100
  *
2101 2101
  * @return int Element ID when exists. Else the page id.
2102 2102
  */
2103
-function geodir_get_wpml_element_id( $page_id, $post_type ) {
2103
+function geodir_get_wpml_element_id($page_id, $post_type) {
2104 2104
 	global $sitepress;
2105
-	if ( geodir_wpml_multilingual_status() && ! empty( $sitepress ) && isset( $sitepress->queries ) ) {
2106
-		$trid = $sitepress->get_element_trid( $page_id, $post_type );
2105
+	if (geodir_wpml_multilingual_status() && !empty($sitepress) && isset($sitepress->queries)) {
2106
+		$trid = $sitepress->get_element_trid($page_id, $post_type);
2107 2107
 
2108
-		if ( $trid > 0 ) {
2109
-			$translations = $sitepress->get_element_translations( $trid, $post_type );
2108
+		if ($trid > 0) {
2109
+			$translations = $sitepress->get_element_translations($trid, $post_type);
2110 2110
 
2111 2111
 			$lang = $sitepress->get_current_language();
2112 2112
 			$lang = $lang ? $lang : $sitepress->get_default_language();
2113 2113
 
2114
-			if ( ! empty( $translations ) && ! empty( $lang ) && isset( $translations[ $lang ] ) && isset( $translations[ $lang ]->element_id ) && ! empty( $translations[ $lang ]->element_id ) ) {
2115
-				$page_id = $translations[ $lang ]->element_id;
2114
+			if (!empty($translations) && !empty($lang) && isset($translations[$lang]) && isset($translations[$lang]->element_id) && !empty($translations[$lang]->element_id)) {
2115
+				$page_id = $translations[$lang]->element_id;
2116 2116
 			}
2117 2117
 		}
2118 2118
 	}
@@ -2129,15 +2129,15 @@  discard block
 block discarded – undo
2129 2129
  */
2130 2130
 function geodir_wpml_check_element_id() {
2131 2131
 	global $sitepress;
2132
-	if ( geodir_wpml_multilingual_status() && ! empty( $sitepress ) && isset( $sitepress->queries ) ) {
2132
+	if (geodir_wpml_multilingual_status() && !empty($sitepress) && isset($sitepress->queries)) {
2133 2133
 		$el_type      = 'post_page';
2134
-		$el_id        = get_option( 'geodir_add_listing_page' );
2134
+		$el_id        = get_option('geodir_add_listing_page');
2135 2135
 		$default_lang = $sitepress->get_default_language();
2136
-		$el_details   = $sitepress->get_element_language_details( $el_id, $el_type );
2136
+		$el_details   = $sitepress->get_element_language_details($el_id, $el_type);
2137 2137
 
2138
-		if ( ! ( $el_id > 0 && $default_lang && ! empty( $el_details ) && isset( $el_details->language_code ) && $el_details->language_code == $default_lang ) ) {
2139
-			if ( ! $el_details->source_language_code ) {
2140
-				$sitepress->set_element_language_details( $el_id, $el_type, '', $default_lang );
2138
+		if (!($el_id > 0 && $default_lang && !empty($el_details) && isset($el_details->language_code) && $el_details->language_code == $default_lang)) {
2139
+			if (!$el_details->source_language_code) {
2140
+				$sitepress->set_element_language_details($el_id, $el_type, '', $default_lang);
2141 2141
 				$sitepress->icl_translations_cache->clear();
2142 2142
 			}
2143 2143
 		}
@@ -2156,41 +2156,41 @@  discard block
 block discarded – undo
2156 2156
  *
2157 2157
  * @return string Orderby SQL.
2158 2158
  */
2159
-function geodir_widget_listings_get_order( $query_args ) {
2159
+function geodir_widget_listings_get_order($query_args) {
2160 2160
 	global $wpdb, $plugin_prefix, $gd_query_args_widgets;
2161 2161
 
2162 2162
 	$query_args = $gd_query_args_widgets;
2163
-	if ( empty( $query_args ) || empty( $query_args['is_geodir_loop'] ) ) {
2164
-		return $wpdb->posts . ".post_date DESC, ";
2163
+	if (empty($query_args) || empty($query_args['is_geodir_loop'])) {
2164
+		return $wpdb->posts.".post_date DESC, ";
2165 2165
 	}
2166 2166
 
2167
-	$post_type = empty( $query_args['post_type'] ) ? 'gd_place' : $query_args['post_type'];
2168
-	$table     = $plugin_prefix . $post_type . '_detail';
2167
+	$post_type = empty($query_args['post_type']) ? 'gd_place' : $query_args['post_type'];
2168
+	$table     = $plugin_prefix.$post_type.'_detail';
2169 2169
 
2170
-	$sort_by = ! empty( $query_args['order_by'] ) ? $query_args['order_by'] : '';
2170
+	$sort_by = !empty($query_args['order_by']) ? $query_args['order_by'] : '';
2171 2171
 
2172
-	switch ( $sort_by ) {
2172
+	switch ($sort_by) {
2173 2173
 		case 'latest':
2174 2174
 		case 'newest':
2175
-			$orderby = $wpdb->posts . ".post_date DESC, ";
2175
+			$orderby = $wpdb->posts.".post_date DESC, ";
2176 2176
 			break;
2177 2177
 		case 'featured':
2178
-			$orderby = $table . ".is_featured ASC, ";
2178
+			$orderby = $table.".is_featured ASC, ";
2179 2179
 			break;
2180 2180
 		case 'az':
2181
-			$orderby = $wpdb->posts . ".post_title ASC, ";
2181
+			$orderby = $wpdb->posts.".post_title ASC, ";
2182 2182
 			break;
2183 2183
 		case 'high_review':
2184
-			$orderby = $table . ".rating_count DESC, " . $table . ".overall_rating DESC, ";
2184
+			$orderby = $table.".rating_count DESC, ".$table.".overall_rating DESC, ";
2185 2185
 			break;
2186 2186
 		case 'high_rating':
2187
-			$orderby = "( " . $table . ".overall_rating  ) DESC, ";
2187
+			$orderby = "( ".$table.".overall_rating  ) DESC, ";
2188 2188
 			break;
2189 2189
 		case 'random':
2190 2190
 			$orderby = "RAND(), ";
2191 2191
 			break;
2192 2192
 		default:
2193
-			$orderby = $wpdb->posts . ".post_title ASC, ";
2193
+			$orderby = $wpdb->posts.".post_title ASC, ";
2194 2194
 			break;
2195 2195
 	}
2196 2196
 
@@ -2212,15 +2212,15 @@  discard block
 block discarded – undo
2212 2212
  *
2213 2213
  * @return mixed Result object.
2214 2214
  */
2215
-function geodir_get_widget_listings( $query_args = array(), $count_only = false ) {
2215
+function geodir_get_widget_listings($query_args = array(), $count_only = false) {
2216 2216
 	global $wpdb, $plugin_prefix, $table_prefix;
2217 2217
 	$GLOBALS['gd_query_args_widgets'] = $query_args;
2218 2218
 	$gd_query_args_widgets            = $query_args;
2219 2219
 
2220
-	$post_type = empty( $query_args['post_type'] ) ? 'gd_place' : $query_args['post_type'];
2221
-	$table     = $plugin_prefix . $post_type . '_detail';
2220
+	$post_type = empty($query_args['post_type']) ? 'gd_place' : $query_args['post_type'];
2221
+	$table     = $plugin_prefix.$post_type.'_detail';
2222 2222
 
2223
-	$fields = $wpdb->posts . ".*, " . $table . ".*";
2223
+	$fields = $wpdb->posts.".*, ".$table.".*";
2224 2224
 	/**
2225 2225
 	 * Filter widget listing fields string part that is being used for query.
2226 2226
 	 *
@@ -2230,17 +2230,17 @@  discard block
 block discarded – undo
2230 2230
 	 * @param string $table     Table name.
2231 2231
 	 * @param string $post_type Post type.
2232 2232
 	 */
2233
-	$fields = apply_filters( 'geodir_filter_widget_listings_fields', $fields, $table, $post_type );
2233
+	$fields = apply_filters('geodir_filter_widget_listings_fields', $fields, $table, $post_type);
2234 2234
 
2235
-	$join = "INNER JOIN " . $table . " ON (" . $table . ".post_id = " . $wpdb->posts . ".ID)";
2235
+	$join = "INNER JOIN ".$table." ON (".$table.".post_id = ".$wpdb->posts.".ID)";
2236 2236
 
2237 2237
 	########### WPML ###########
2238 2238
 
2239
-	if ( function_exists( 'icl_object_id' ) ) {
2239
+	if (function_exists('icl_object_id')) {
2240 2240
 		global $sitepress;
2241 2241
 		$lang_code = ICL_LANGUAGE_CODE;
2242
-		if ( $lang_code ) {
2243
-			$join .= " JOIN " . $table_prefix . "icl_translations icl_t ON icl_t.element_id = " . $table_prefix . "posts.ID";
2242
+		if ($lang_code) {
2243
+			$join .= " JOIN ".$table_prefix."icl_translations icl_t ON icl_t.element_id = ".$table_prefix."posts.ID";
2244 2244
 		}
2245 2245
 	}
2246 2246
 
@@ -2254,15 +2254,15 @@  discard block
 block discarded – undo
2254 2254
 	 * @param string $join      Join clause string.
2255 2255
 	 * @param string $post_type Post type.
2256 2256
 	 */
2257
-	$join = apply_filters( 'geodir_filter_widget_listings_join', $join, $post_type );
2257
+	$join = apply_filters('geodir_filter_widget_listings_join', $join, $post_type);
2258 2258
 
2259
-	$post_status = is_super_admin() ? " OR " . $wpdb->posts . ".post_status = 'private'" : '';
2259
+	$post_status = is_super_admin() ? " OR ".$wpdb->posts.".post_status = 'private'" : '';
2260 2260
 
2261
-	$where = " AND ( " . $wpdb->posts . ".post_status = 'publish' " . $post_status . " ) AND " . $wpdb->posts . ".post_type = '" . $post_type . "'";
2261
+	$where = " AND ( ".$wpdb->posts.".post_status = 'publish' ".$post_status." ) AND ".$wpdb->posts.".post_type = '".$post_type."'";
2262 2262
 
2263 2263
 	########### WPML ###########
2264
-	if ( function_exists( 'icl_object_id' ) ) {
2265
-		if ( $lang_code ) {
2264
+	if (function_exists('icl_object_id')) {
2265
+		if ($lang_code) {
2266 2266
 			$where .= " AND icl_t.language_code = '$lang_code' AND icl_t.element_type = 'post_$post_type' ";
2267 2267
 		}
2268 2268
 	}
@@ -2275,8 +2275,8 @@  discard block
 block discarded – undo
2275 2275
 	 * @param string $where     Where clause string.
2276 2276
 	 * @param string $post_type Post type.
2277 2277
 	 */
2278
-	$where = apply_filters( 'geodir_filter_widget_listings_where', $where, $post_type );
2279
-	$where = $where != '' ? " WHERE 1=1 " . $where : '';
2278
+	$where = apply_filters('geodir_filter_widget_listings_where', $where, $post_type);
2279
+	$where = $where != '' ? " WHERE 1=1 ".$where : '';
2280 2280
 
2281 2281
 	$groupby = " GROUP BY $wpdb->posts.ID ";
2282 2282
 	/**
@@ -2287,15 +2287,15 @@  discard block
 block discarded – undo
2287 2287
 	 * @param string $groupby   Group by clause string.
2288 2288
 	 * @param string $post_type Post type.
2289 2289
 	 */
2290
-	$groupby = apply_filters( 'geodir_filter_widget_listings_groupby', $groupby, $post_type );
2290
+	$groupby = apply_filters('geodir_filter_widget_listings_groupby', $groupby, $post_type);
2291 2291
 
2292
-	if ( $count_only ) {
2293
-		$sql  = "SELECT COUNT(" . $wpdb->posts . ".ID) AS total FROM " . $wpdb->posts . "
2294
-			" . $join . "
2292
+	if ($count_only) {
2293
+		$sql  = "SELECT COUNT(".$wpdb->posts.".ID) AS total FROM ".$wpdb->posts."
2294
+			" . $join."
2295 2295
 			" . $where;
2296
-		$rows = (int) $wpdb->get_var( $sql );
2296
+		$rows = (int) $wpdb->get_var($sql);
2297 2297
 	} else {
2298
-		$orderby = geodir_widget_listings_get_order( $query_args );
2298
+		$orderby = geodir_widget_listings_get_order($query_args);
2299 2299
 		/**
2300 2300
 		 * Filter widget listing orderby clause string part that is being used for query.
2301 2301
 		 *
@@ -2305,11 +2305,11 @@  discard block
 block discarded – undo
2305 2305
 		 * @param string $table     Table name.
2306 2306
 		 * @param string $post_type Post type.
2307 2307
 		 */
2308
-		$orderby = apply_filters( 'geodir_filter_widget_listings_orderby', $orderby, $table, $post_type );
2309
-		$orderby .= $wpdb->posts . ".post_title ASC";
2310
-		$orderby = $orderby != '' ? " ORDER BY " . $orderby : '';
2308
+		$orderby = apply_filters('geodir_filter_widget_listings_orderby', $orderby, $table, $post_type);
2309
+		$orderby .= $wpdb->posts.".post_title ASC";
2310
+		$orderby = $orderby != '' ? " ORDER BY ".$orderby : '';
2311 2311
 
2312
-		$limit = ! empty( $query_args['posts_per_page'] ) ? $query_args['posts_per_page'] : 5;
2312
+		$limit = !empty($query_args['posts_per_page']) ? $query_args['posts_per_page'] : 5;
2313 2313
 		/**
2314 2314
 		 * Filter widget listing limit that is being used for query.
2315 2315
 		 *
@@ -2318,26 +2318,26 @@  discard block
 block discarded – undo
2318 2318
 		 * @param int $limit        Query results limit.
2319 2319
 		 * @param string $post_type Post type.
2320 2320
 		 */
2321
-		$limit = apply_filters( 'geodir_filter_widget_listings_limit', $limit, $post_type );
2321
+		$limit = apply_filters('geodir_filter_widget_listings_limit', $limit, $post_type);
2322 2322
 
2323
-		$page = ! empty( $query_args['pageno'] ) ? absint( $query_args['pageno'] ) : 1;
2324
-		if ( ! $page ) {
2323
+		$page = !empty($query_args['pageno']) ? absint($query_args['pageno']) : 1;
2324
+		if (!$page) {
2325 2325
 			$page = 1;
2326 2326
 		}
2327 2327
 
2328
-		$limit = (int) $limit > 0 ? " LIMIT " . absint( ( $page - 1 ) * (int) $limit ) . ", " . (int) $limit : "";
2328
+		$limit = (int) $limit > 0 ? " LIMIT ".absint(($page - 1) * (int) $limit).", ".(int) $limit : "";
2329 2329
 
2330
-		$sql  = "SELECT SQL_CALC_FOUND_ROWS " . $fields . " FROM " . $wpdb->posts . "
2331
-			" . $join . "
2332
-			" . $where . "
2333
-			" . $groupby . "
2334
-			" . $orderby . "
2330
+		$sql = "SELECT SQL_CALC_FOUND_ROWS ".$fields." FROM ".$wpdb->posts."
2331
+			" . $join."
2332
+			" . $where."
2333
+			" . $groupby."
2334
+			" . $orderby."
2335 2335
 			" . $limit;
2336
-		$rows = $wpdb->get_results( $sql );
2336
+		$rows = $wpdb->get_results($sql);
2337 2337
 	}
2338 2338
 
2339
-	unset( $GLOBALS['gd_query_args_widgets'] );
2340
-	unset( $gd_query_args_widgets );
2339
+	unset($GLOBALS['gd_query_args_widgets']);
2340
+	unset($gd_query_args_widgets);
2341 2341
 
2342 2342
 	return $rows;
2343 2343
 }
@@ -2354,11 +2354,11 @@  discard block
 block discarded – undo
2354 2354
  *
2355 2355
  * @return string Modified fields SQL.
2356 2356
  */
2357
-function geodir_function_widget_listings_fields( $fields ) {
2357
+function geodir_function_widget_listings_fields($fields) {
2358 2358
 	global $wpdb, $plugin_prefix, $gd_query_args_widgets;
2359 2359
 
2360 2360
 	$query_args = $gd_query_args_widgets;
2361
-	if ( empty( $query_args ) || empty( $query_args['is_geodir_loop'] ) ) {
2361
+	if (empty($query_args) || empty($query_args['is_geodir_loop'])) {
2362 2362
 		return $fields;
2363 2363
 	}
2364 2364
 
@@ -2377,24 +2377,24 @@  discard block
 block discarded – undo
2377 2377
  *
2378 2378
  * @return string Modified join clause SQL.
2379 2379
  */
2380
-function geodir_function_widget_listings_join( $join ) {
2380
+function geodir_function_widget_listings_join($join) {
2381 2381
 	global $wpdb, $plugin_prefix, $gd_query_args_widgets;
2382 2382
 
2383 2383
 	$query_args = $gd_query_args_widgets;
2384
-	if ( empty( $query_args ) || empty( $query_args['is_geodir_loop'] ) ) {
2384
+	if (empty($query_args) || empty($query_args['is_geodir_loop'])) {
2385 2385
 		return $join;
2386 2386
 	}
2387 2387
 
2388
-	$post_type = empty( $query_args['post_type'] ) ? 'gd_place' : $query_args['post_type'];
2389
-	$table     = $plugin_prefix . $post_type . '_detail';
2388
+	$post_type = empty($query_args['post_type']) ? 'gd_place' : $query_args['post_type'];
2389
+	$table     = $plugin_prefix.$post_type.'_detail';
2390 2390
 
2391
-	if ( ! empty( $query_args['with_pics_only'] ) ) {
2392
-		$join .= " LEFT JOIN " . GEODIR_ATTACHMENT_TABLE . " ON ( " . GEODIR_ATTACHMENT_TABLE . ".post_id=" . $table . ".post_id AND " . GEODIR_ATTACHMENT_TABLE . ".mime_type LIKE '%image%' )";
2391
+	if (!empty($query_args['with_pics_only'])) {
2392
+		$join .= " LEFT JOIN ".GEODIR_ATTACHMENT_TABLE." ON ( ".GEODIR_ATTACHMENT_TABLE.".post_id=".$table.".post_id AND ".GEODIR_ATTACHMENT_TABLE.".mime_type LIKE '%image%' )";
2393 2393
 	}
2394 2394
 
2395
-	if ( ! empty( $query_args['tax_query'] ) ) {
2396
-		$tax_queries = get_tax_sql( $query_args['tax_query'], $wpdb->posts, 'ID' );
2397
-		if ( ! empty( $tax_queries['join'] ) && ! empty( $tax_queries['where'] ) ) {
2395
+	if (!empty($query_args['tax_query'])) {
2396
+		$tax_queries = get_tax_sql($query_args['tax_query'], $wpdb->posts, 'ID');
2397
+		if (!empty($tax_queries['join']) && !empty($tax_queries['where'])) {
2398 2398
 			$join .= $tax_queries['join'];
2399 2399
 		}
2400 2400
 	}
@@ -2414,49 +2414,49 @@  discard block
 block discarded – undo
2414 2414
  *
2415 2415
  * @return string Modified where clause SQL.
2416 2416
  */
2417
-function geodir_function_widget_listings_where( $where ) {
2417
+function geodir_function_widget_listings_where($where) {
2418 2418
 	global $wpdb, $plugin_prefix, $gd_query_args_widgets;
2419 2419
 
2420 2420
 	$query_args = $gd_query_args_widgets;
2421
-	if ( empty( $query_args ) || empty( $query_args['is_geodir_loop'] ) ) {
2421
+	if (empty($query_args) || empty($query_args['is_geodir_loop'])) {
2422 2422
 		return $where;
2423 2423
 	}
2424
-	$post_type = empty( $query_args['post_type'] ) ? 'gd_place' : $query_args['post_type'];
2425
-	$table     = $plugin_prefix . $post_type . '_detail';
2424
+	$post_type = empty($query_args['post_type']) ? 'gd_place' : $query_args['post_type'];
2425
+	$table     = $plugin_prefix.$post_type.'_detail';
2426 2426
 
2427
-	if ( ! empty( $query_args ) ) {
2428
-		if ( ! empty( $query_args['gd_location'] ) && function_exists( 'geodir_default_location_where' ) ) {
2429
-			$where = geodir_default_location_where( $where, $table );
2427
+	if (!empty($query_args)) {
2428
+		if (!empty($query_args['gd_location']) && function_exists('geodir_default_location_where')) {
2429
+			$where = geodir_default_location_where($where, $table);
2430 2430
 		}
2431 2431
 
2432
-		if ( ! empty( $query_args['post_author'] ) ) {
2433
-			$where .= " AND " . $wpdb->posts . ".post_author = " . (int) $query_args['post_author'];
2432
+		if (!empty($query_args['post_author'])) {
2433
+			$where .= " AND ".$wpdb->posts.".post_author = ".(int) $query_args['post_author'];
2434 2434
 		}
2435 2435
 
2436
-		if ( ! empty( $query_args['show_featured_only'] ) ) {
2437
-			$where .= " AND " . $table . ".is_featured = '1'";
2436
+		if (!empty($query_args['show_featured_only'])) {
2437
+			$where .= " AND ".$table.".is_featured = '1'";
2438 2438
 		}
2439 2439
 
2440
-		if ( ! empty( $query_args['show_special_only'] ) ) {
2441
-			$where .= " AND ( " . $table . ".geodir_special_offers != '' AND " . $table . ".geodir_special_offers IS NOT NULL )";
2440
+		if (!empty($query_args['show_special_only'])) {
2441
+			$where .= " AND ( ".$table.".geodir_special_offers != '' AND ".$table.".geodir_special_offers IS NOT NULL )";
2442 2442
 		}
2443 2443
 
2444
-		if ( ! empty( $query_args['with_pics_only'] ) ) {
2445
-			$where .= " AND " . GEODIR_ATTACHMENT_TABLE . ".ID IS NOT NULL ";
2444
+		if (!empty($query_args['with_pics_only'])) {
2445
+			$where .= " AND ".GEODIR_ATTACHMENT_TABLE.".ID IS NOT NULL ";
2446 2446
 		}
2447 2447
 
2448
-		if ( ! empty( $query_args['featured_image_only'] ) ) {
2449
-			$where .= " AND " . $table . ".featured_image IS NOT NULL AND " . $table . ".featured_image!='' ";
2448
+		if (!empty($query_args['featured_image_only'])) {
2449
+			$where .= " AND ".$table.".featured_image IS NOT NULL AND ".$table.".featured_image!='' ";
2450 2450
 		}
2451 2451
 
2452
-		if ( ! empty( $query_args['with_videos_only'] ) ) {
2453
-			$where .= " AND ( " . $table . ".geodir_video != '' AND " . $table . ".geodir_video IS NOT NULL )";
2452
+		if (!empty($query_args['with_videos_only'])) {
2453
+			$where .= " AND ( ".$table.".geodir_video != '' AND ".$table.".geodir_video IS NOT NULL )";
2454 2454
 		}
2455 2455
 
2456
-		if ( ! empty( $query_args['tax_query'] ) ) {
2457
-			$tax_queries = get_tax_sql( $query_args['tax_query'], $wpdb->posts, 'ID' );
2456
+		if (!empty($query_args['tax_query'])) {
2457
+			$tax_queries = get_tax_sql($query_args['tax_query'], $wpdb->posts, 'ID');
2458 2458
 
2459
-			if ( ! empty( $tax_queries['join'] ) && ! empty( $tax_queries['where'] ) ) {
2459
+			if (!empty($tax_queries['join']) && !empty($tax_queries['where'])) {
2460 2460
 				$where .= $tax_queries['where'];
2461 2461
 			}
2462 2462
 		}
@@ -2477,11 +2477,11 @@  discard block
 block discarded – undo
2477 2477
  *
2478 2478
  * @return string Modified orderby clause SQL.
2479 2479
  */
2480
-function geodir_function_widget_listings_orderby( $orderby ) {
2480
+function geodir_function_widget_listings_orderby($orderby) {
2481 2481
 	global $wpdb, $plugin_prefix, $gd_query_args_widgets;
2482 2482
 
2483 2483
 	$query_args = $gd_query_args_widgets;
2484
-	if ( empty( $query_args ) || empty( $query_args['is_geodir_loop'] ) ) {
2484
+	if (empty($query_args) || empty($query_args['is_geodir_loop'])) {
2485 2485
 		return $orderby;
2486 2486
 	}
2487 2487
 
@@ -2500,15 +2500,15 @@  discard block
 block discarded – undo
2500 2500
  *
2501 2501
  * @return int Query limit.
2502 2502
  */
2503
-function geodir_function_widget_listings_limit( $limit ) {
2503
+function geodir_function_widget_listings_limit($limit) {
2504 2504
 	global $wpdb, $plugin_prefix, $gd_query_args_widgets;
2505 2505
 
2506 2506
 	$query_args = $gd_query_args_widgets;
2507
-	if ( empty( $query_args ) || empty( $query_args['is_geodir_loop'] ) ) {
2507
+	if (empty($query_args) || empty($query_args['is_geodir_loop'])) {
2508 2508
 		return $limit;
2509 2509
 	}
2510 2510
 
2511
-	if ( ! empty( $query_args ) && ! empty( $query_args['posts_per_page'] ) ) {
2511
+	if (!empty($query_args) && !empty($query_args['posts_per_page'])) {
2512 2512
 		$limit = (int) $query_args['posts_per_page'];
2513 2513
 	}
2514 2514
 
@@ -2526,12 +2526,12 @@  discard block
 block discarded – undo
2526 2526
  *
2527 2527
  * @return int Large size width.
2528 2528
  */
2529
-function geodir_media_image_large_width( $default = 800, $params = '' ) {
2530
-	$large_size_w = get_option( 'large_size_w' );
2529
+function geodir_media_image_large_width($default = 800, $params = '') {
2530
+	$large_size_w = get_option('large_size_w');
2531 2531
 	$large_size_w = $large_size_w > 0 ? $large_size_w : $default;
2532
-	$large_size_w = absint( $large_size_w );
2532
+	$large_size_w = absint($large_size_w);
2533 2533
 
2534
-	if ( ! get_option( 'geodir_use_wp_media_large_size' ) ) {
2534
+	if (!get_option('geodir_use_wp_media_large_size')) {
2535 2535
 		$large_size_w = 800;
2536 2536
 	}
2537 2537
 
@@ -2544,7 +2544,7 @@  discard block
 block discarded – undo
2544 2544
 	 * @param int $default         Default width.
2545 2545
 	 * @param string|array $params Image parameters.
2546 2546
 	 */
2547
-	$large_size_w = apply_filters( 'geodir_filter_media_image_large_width', $large_size_w, $default, $params );
2547
+	$large_size_w = apply_filters('geodir_filter_media_image_large_width', $large_size_w, $default, $params);
2548 2548
 
2549 2549
 	return $large_size_w;
2550 2550
 }
@@ -2560,12 +2560,12 @@  discard block
 block discarded – undo
2560 2560
  *
2561 2561
  * @return int Large size height.
2562 2562
  */
2563
-function geodir_media_image_large_height( $default = 800, $params = '' ) {
2564
-	$large_size_h = get_option( 'large_size_h' );
2563
+function geodir_media_image_large_height($default = 800, $params = '') {
2564
+	$large_size_h = get_option('large_size_h');
2565 2565
 	$large_size_h = $large_size_h > 0 ? $large_size_h : $default;
2566
-	$large_size_h = absint( $large_size_h );
2566
+	$large_size_h = absint($large_size_h);
2567 2567
 
2568
-	if ( ! get_option( 'geodir_use_wp_media_large_size' ) ) {
2568
+	if (!get_option('geodir_use_wp_media_large_size')) {
2569 2569
 		$large_size_h = 800;
2570 2570
 	}
2571 2571
 
@@ -2578,7 +2578,7 @@  discard block
 block discarded – undo
2578 2578
 	 * @param int $default         Default height.
2579 2579
 	 * @param string|array $params Image parameters.
2580 2580
 	 */
2581
-	$large_size_h = apply_filters( 'geodir_filter_media_image_large_height', $large_size_h, $default, $params );
2581
+	$large_size_h = apply_filters('geodir_filter_media_image_large_height', $large_size_h, $default, $params);
2582 2582
 
2583 2583
 	return $large_size_h;
2584 2584
 }
@@ -2595,8 +2595,8 @@  discard block
 block discarded – undo
2595 2595
  *
2596 2596
  * @return string Sanitized name.
2597 2597
  */
2598
-function geodir_sanitize_location_name( $type, $name, $translate = true ) {
2599
-	if ( $name == '' ) {
2598
+function geodir_sanitize_location_name($type, $name, $translate = true) {
2599
+	if ($name == '') {
2600 2600
 		return null;
2601 2601
 	}
2602 2602
 
@@ -2605,13 +2605,13 @@  discard block
 block discarded – undo
2605 2605
 	$type = $type == 'gd_city' ? 'city' : $type;
2606 2606
 
2607 2607
 	$return = $name;
2608
-	if ( function_exists( 'get_actual_location_name' ) ) {
2609
-		$return = get_actual_location_name( $type, $name, $translate );
2608
+	if (function_exists('get_actual_location_name')) {
2609
+		$return = get_actual_location_name($type, $name, $translate);
2610 2610
 	} else {
2611
-		$return = preg_replace( '/-(\d+)$/', '', $return );
2612
-		$return = preg_replace( '/[_-]/', ' ', $return );
2613
-		$return = geodir_ucwords( $return );
2614
-		$return = $translate ? __( $return, 'geodirectory' ) : $return;
2611
+		$return = preg_replace('/-(\d+)$/', '', $return);
2612
+		$return = preg_replace('/[_-]/', ' ', $return);
2613
+		$return = geodir_ucwords($return);
2614
+		$return = $translate ? __($return, 'geodirectory') : $return;
2615 2615
 	}
2616 2616
 
2617 2617
 	return $return;
@@ -2626,14 +2626,14 @@  discard block
 block discarded – undo
2626 2626
  *
2627 2627
  * @param int $number Comments number.
2628 2628
  */
2629
-function geodir_comments_number( $number ) {
2629
+function geodir_comments_number($number) {
2630 2630
 
2631
-	if ( $number > 1 ) {
2632
-		$output = str_replace( '%', number_format_i18n( $number ), __( '% Reviews', 'geodirectory' ) );
2633
-	} elseif ( $number == 0 || $number == '' ) {
2634
-		$output = __( 'No Reviews', 'geodirectory' );
2631
+	if ($number > 1) {
2632
+		$output = str_replace('%', number_format_i18n($number), __('% Reviews', 'geodirectory'));
2633
+	} elseif ($number == 0 || $number == '') {
2634
+		$output = __('No Reviews', 'geodirectory');
2635 2635
 	} else { // must be one
2636
-		$output = __( '1 Review', 'geodirectory' );
2636
+		$output = __('1 Review', 'geodirectory');
2637 2637
 	}
2638 2638
 	echo $output;
2639 2639
 }
@@ -2648,18 +2648,18 @@  discard block
 block discarded – undo
2648 2648
  */
2649 2649
 function is_page_geodir_home() {
2650 2650
 	global $wpdb;
2651
-	$cur_url = str_replace( array( "https://", "http://", "www." ), array( '', '', '' ), geodir_curPageURL() );
2652
-	if ( function_exists( 'geodir_location_geo_home_link' ) ) {
2653
-		remove_filter( 'home_url', 'geodir_location_geo_home_link', 100000 );
2651
+	$cur_url = str_replace(array("https://", "http://", "www."), array('', '', ''), geodir_curPageURL());
2652
+	if (function_exists('geodir_location_geo_home_link')) {
2653
+		remove_filter('home_url', 'geodir_location_geo_home_link', 100000);
2654 2654
 	}
2655
-	$home_url = home_url( '', 'http' );
2656
-	if ( function_exists( 'geodir_location_geo_home_link' ) ) {
2657
-		add_filter( 'home_url', 'geodir_location_geo_home_link', 100000, 2 );
2655
+	$home_url = home_url('', 'http');
2656
+	if (function_exists('geodir_location_geo_home_link')) {
2657
+		add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2);
2658 2658
 	}
2659
-	$home_url = str_replace( "www.", "", $home_url );
2660
-	if ( ( strpos( $home_url, $cur_url ) !== false || strpos( $home_url . '/', $cur_url ) !== false ) && ( 'page' == get_option( 'show_on_front' ) && get_option( 'page_on_front' ) && get_option( 'page_on_front' ) == get_option( 'geodir_home_page' ) ) ) {
2659
+	$home_url = str_replace("www.", "", $home_url);
2660
+	if ((strpos($home_url, $cur_url) !== false || strpos($home_url.'/', $cur_url) !== false) && ('page' == get_option('show_on_front') && get_option('page_on_front') && get_option('page_on_front') == get_option('geodir_home_page'))) {
2661 2661
 		return true;
2662
-	} elseif ( get_query_var( 'page_id' ) == get_option( 'page_on_front' ) && 'page' == get_option( 'show_on_front' ) && get_option( 'page_on_front' ) && get_option( 'page_on_front' ) == get_option( 'geodir_home_page' ) ) {
2662
+	} elseif (get_query_var('page_id') == get_option('page_on_front') && 'page' == get_option('show_on_front') && get_option('page_on_front') && get_option('page_on_front') == get_option('geodir_home_page')) {
2663 2663
 		return true;
2664 2664
 	} else {
2665 2665
 		return false;
@@ -2679,18 +2679,18 @@  discard block
 block discarded – undo
2679 2679
  *
2680 2680
  * @return string The canonical URL.
2681 2681
  */
2682
-function geodir_wpseo_homepage_canonical( $url ) {
2682
+function geodir_wpseo_homepage_canonical($url) {
2683 2683
 	global $post;
2684 2684
 
2685
-	if ( is_page_geodir_home() ) {
2685
+	if (is_page_geodir_home()) {
2686 2686
 		return home_url();
2687 2687
 	}
2688 2688
 
2689 2689
 	return $url;
2690 2690
 }
2691 2691
 
2692
-add_filter( 'wpseo_canonical', 'geodir_wpseo_homepage_canonical', 10 );
2693
-add_filter( 'aioseop_canonical_url', 'geodir_wpseo_homepage_canonical', 10 );
2692
+add_filter('wpseo_canonical', 'geodir_wpseo_homepage_canonical', 10);
2693
+add_filter('aioseop_canonical_url', 'geodir_wpseo_homepage_canonical', 10);
2694 2694
 
2695 2695
 /**
2696 2696
  * Add extra fields to google maps script call.
@@ -2703,20 +2703,20 @@  discard block
 block discarded – undo
2703 2703
  *
2704 2704
  * @return string Modified extra string.
2705 2705
  */
2706
-function geodir_googlemap_script_extra_details_page( $extra ) {
2706
+function geodir_googlemap_script_extra_details_page($extra) {
2707 2707
 	global $post;
2708 2708
 	$add_google_places_api = false;
2709
-	if ( isset( $post->post_content ) && has_shortcode( $post->post_content, 'gd_add_listing' ) ) {
2709
+	if (isset($post->post_content) && has_shortcode($post->post_content, 'gd_add_listing')) {
2710 2710
 		$add_google_places_api = true;
2711 2711
 	}
2712
-	if ( ! str_replace( 'libraries=places', '', $extra ) && ( geodir_is_page( 'detail' ) || $add_google_places_api ) ) {
2712
+	if (!str_replace('libraries=places', '', $extra) && (geodir_is_page('detail') || $add_google_places_api)) {
2713 2713
 		$extra .= "&amp;libraries=places";
2714 2714
 	}
2715 2715
 
2716 2716
 	return $extra;
2717 2717
 }
2718 2718
 
2719
-add_filter( 'geodir_googlemap_script_extra', 'geodir_googlemap_script_extra_details_page', 101, 1 );
2719
+add_filter('geodir_googlemap_script_extra', 'geodir_googlemap_script_extra_details_page', 101, 1);
2720 2720
 
2721 2721
 
2722 2722
 /**
@@ -2734,99 +2734,99 @@  discard block
 block discarded – undo
2734 2734
  *                                          after_widget.
2735 2735
  * @param array|string $instance            The settings for the particular instance of the widget.
2736 2736
  */
2737
-function geodir_popular_post_category_output( $args = '', $instance = '' ) {
2737
+function geodir_popular_post_category_output($args = '', $instance = '') {
2738 2738
 	// prints the widget
2739 2739
 	global $wpdb, $plugin_prefix, $geodir_post_category_str;
2740
-	extract( $args, EXTR_SKIP );
2740
+	extract($args, EXTR_SKIP);
2741 2741
 
2742 2742
 	echo $before_widget;
2743 2743
 
2744 2744
 	/** This filter is documented in geodirectory_widgets.php */
2745
-	$title = empty( $instance['title'] ) ? __( 'Popular Categories', 'geodirectory' ) : apply_filters( 'widget_title', __( $instance['title'], 'geodirectory' ) );
2745
+	$title = empty($instance['title']) ? __('Popular Categories', 'geodirectory') : apply_filters('widget_title', __($instance['title'], 'geodirectory'));
2746 2746
 
2747 2747
 	$gd_post_type = geodir_get_current_posttype();
2748 2748
 
2749
-	$category_limit = isset( $instance['category_limit'] ) && $instance['category_limit'] > 0 ? (int) $instance['category_limit'] : 15;
2750
-	if ( ! empty( $gd_post_type ) ) {
2749
+	$category_limit = isset($instance['category_limit']) && $instance['category_limit'] > 0 ? (int) $instance['category_limit'] : 15;
2750
+	if (!empty($gd_post_type)) {
2751 2751
 		$default_post_type = $gd_post_type;
2752
-	} elseif ( isset( $instance['default_post_type'] ) && gdsc_is_post_type_valid( $instance['default_post_type'] ) ) {
2752
+	} elseif (isset($instance['default_post_type']) && gdsc_is_post_type_valid($instance['default_post_type'])) {
2753 2753
 		$default_post_type = $instance['default_post_type'];
2754 2754
 	} else {
2755 2755
 		$all_gd_post_type  = geodir_get_posttypes();
2756
-		$default_post_type = ( isset( $all_gd_post_type[0] ) ) ? $all_gd_post_type[0] : '';
2756
+		$default_post_type = (isset($all_gd_post_type[0])) ? $all_gd_post_type[0] : '';
2757 2757
 	}
2758
-	$parent_only = !empty( $instance['parent_only'] ) ? true : false;
2758
+	$parent_only = !empty($instance['parent_only']) ? true : false;
2759 2759
 
2760 2760
 	$taxonomy = array();
2761
-	if ( ! empty( $gd_post_type ) ) {
2762
-		$taxonomy[] = $gd_post_type . "category";
2761
+	if (!empty($gd_post_type)) {
2762
+		$taxonomy[] = $gd_post_type."category";
2763 2763
 	} else {
2764
-		$taxonomy = geodir_get_taxonomies( $gd_post_type );
2764
+		$taxonomy = geodir_get_taxonomies($gd_post_type);
2765 2765
 	}
2766 2766
     
2767
-	$term_args = array( 'taxonomy' => $taxonomy );
2768
-	if ( $parent_only ) {
2767
+	$term_args = array('taxonomy' => $taxonomy);
2768
+	if ($parent_only) {
2769 2769
 		$term_args['parent'] = 0;
2770 2770
 	}
2771 2771
 
2772
-	$terms   = get_terms( $term_args );
2772
+	$terms   = get_terms($term_args);
2773 2773
 	$a_terms = array();
2774 2774
 	$b_terms = array();
2775 2775
 
2776
-	foreach ( $terms as $term ) {
2777
-		if ( $term->count > 0 ) {
2778
-			$a_terms[ $term->taxonomy ][] = $term;
2776
+	foreach ($terms as $term) {
2777
+		if ($term->count > 0) {
2778
+			$a_terms[$term->taxonomy][] = $term;
2779 2779
 		}
2780 2780
 	}
2781 2781
 
2782
-	if ( ! empty( $a_terms ) ) {
2783
-		foreach ( $a_terms as $b_key => $b_val ) {
2784
-			$b_terms[ $b_key ] = geodir_sort_terms( $b_val, 'count' );
2782
+	if (!empty($a_terms)) {
2783
+		foreach ($a_terms as $b_key => $b_val) {
2784
+			$b_terms[$b_key] = geodir_sort_terms($b_val, 'count');
2785 2785
 		}
2786 2786
 
2787
-		$default_taxonomy = $default_post_type != '' && isset( $b_terms[ $default_post_type . 'category' ] ) ? $default_post_type . 'category' : '';
2787
+		$default_taxonomy = $default_post_type != '' && isset($b_terms[$default_post_type.'category']) ? $default_post_type.'category' : '';
2788 2788
 
2789 2789
 		$tax_change_output = '';
2790
-		if ( count( $b_terms ) > 1 ) {
2791
-			$tax_change_output .= "<select data-limit='$category_limit' data-parent='" . (int)$parent_only . "' class='geodir-cat-list-tax'  onchange='geodir_get_post_term(this);'>";
2792
-			foreach ( $b_terms as $key => $val ) {
2793
-				$ptype    = get_post_type_object( str_replace( "category", "", $key ) );
2794
-				$cpt_name = __( $ptype->labels->singular_name, 'geodirectory' );
2795
-				$tax_change_output .= "<option value='$key' " . selected( $key, $default_taxonomy, false ) . ">" . sprintf( __( '%s Categories', 'geodirectory' ), $cpt_name ) . "</option>";
2790
+		if (count($b_terms) > 1) {
2791
+			$tax_change_output .= "<select data-limit='$category_limit' data-parent='".(int) $parent_only."' class='geodir-cat-list-tax'  onchange='geodir_get_post_term(this);'>";
2792
+			foreach ($b_terms as $key => $val) {
2793
+				$ptype    = get_post_type_object(str_replace("category", "", $key));
2794
+				$cpt_name = __($ptype->labels->singular_name, 'geodirectory');
2795
+				$tax_change_output .= "<option value='$key' ".selected($key, $default_taxonomy, false).">".sprintf(__('%s Categories', 'geodirectory'), $cpt_name)."</option>";
2796 2796
 			}
2797 2797
 			$tax_change_output .= "</select>";
2798 2798
 		}
2799 2799
 
2800
-		if ( ! empty( $b_terms ) ) {
2801
-			$terms = $default_taxonomy != '' && isset( $b_terms[ $default_taxonomy ] ) ? $b_terms[ $default_taxonomy ] : reset( $b_terms );// get the first array
2802
-			global $cat_count;//make global so we can change via function
2800
+		if (!empty($b_terms)) {
2801
+			$terms = $default_taxonomy != '' && isset($b_terms[$default_taxonomy]) ? $b_terms[$default_taxonomy] : reset($b_terms); // get the first array
2802
+			global $cat_count; //make global so we can change via function
2803 2803
 			$cat_count = 0;
2804 2804
 			?>
2805 2805
 			<div class="geodir-category-list-in clearfix">
2806 2806
 				<div class="geodir-cat-list clearfix">
2807 2807
 					<?php
2808
-					echo $before_title . __( $title ) . $after_title;
2808
+					echo $before_title.__($title).$after_title;
2809 2809
 
2810 2810
 					echo $tax_change_output;
2811 2811
 
2812 2812
 					echo '<ul class="geodir-popular-cat-list">';
2813 2813
 
2814
-					geodir_helper_cat_list_output( $terms, $category_limit );
2814
+					geodir_helper_cat_list_output($terms, $category_limit);
2815 2815
 
2816 2816
 					echo '</ul>';
2817 2817
 					?>
2818 2818
 				</div>
2819 2819
 				<?php
2820 2820
 				$hide = '';
2821
-				if ( $cat_count < $category_limit ) {
2821
+				if ($cat_count < $category_limit) {
2822 2822
 					$hide = 'style="display:none;"';
2823 2823
 				}
2824 2824
 				echo "<div class='geodir-cat-list-more' $hide >";
2825
-				echo '<a href="javascript:void(0)" class="geodir-morecat geodir-showcat">' . __( 'More Categories', 'geodirectory' ) . '</a>';
2826
-				echo '<a href="javascript:void(0)" class="geodir-morecat geodir-hidecat geodir-hide">' . __( 'Less Categories', 'geodirectory' ) . '</a>';
2825
+				echo '<a href="javascript:void(0)" class="geodir-morecat geodir-showcat">'.__('More Categories', 'geodirectory').'</a>';
2826
+				echo '<a href="javascript:void(0)" class="geodir-morecat geodir-hidecat geodir-hide">'.__('Less Categories', 'geodirectory').'</a>';
2827 2827
 				echo "</div>";
2828 2828
 				/* add scripts */
2829
-				add_action( 'wp_footer', 'geodir_popular_category_add_scripts', 100 );
2829
+				add_action('wp_footer', 'geodir_popular_category_add_scripts', 100);
2830 2830
 				?>
2831 2831
 			</div>
2832 2832
 			<?php
@@ -2845,25 +2845,25 @@  discard block
 block discarded – undo
2845 2845
  * @param array $terms                      An array of term objects.
2846 2846
  * @param int $category_limit               Number of categories to display by default.
2847 2847
  */
2848
-function geodir_helper_cat_list_output( $terms, $category_limit ) {
2848
+function geodir_helper_cat_list_output($terms, $category_limit) {
2849 2849
 	global $geodir_post_category_str, $cat_count;
2850 2850
 	$term_icons = geodir_get_term_icon();
2851 2851
 
2852 2852
 	$geodir_post_category_str = array();
2853 2853
 
2854 2854
 
2855
-	foreach ( $terms as $cat ) {
2856
-		$post_type     = str_replace( "category", "", $cat->taxonomy );
2857
-		$term_icon_url = ! empty( $term_icons ) && isset( $term_icons[ $cat->term_id ] ) ? $term_icons[ $cat->term_id ] : '';
2855
+	foreach ($terms as $cat) {
2856
+		$post_type     = str_replace("category", "", $cat->taxonomy);
2857
+		$term_icon_url = !empty($term_icons) && isset($term_icons[$cat->term_id]) ? $term_icons[$cat->term_id] : '';
2858 2858
 
2859
-		$cat_count ++;
2859
+		$cat_count++;
2860 2860
 
2861
-		$geodir_post_category_str[] = array( 'posttype' => $post_type, 'termid' => $cat->term_id );
2861
+		$geodir_post_category_str[] = array('posttype' => $post_type, 'termid' => $cat->term_id);
2862 2862
 
2863 2863
 		$class_row  = $cat_count > $category_limit ? 'geodir-pcat-hide geodir-hide' : 'geodir-pcat-show';
2864 2864
 		$total_post = $cat->count;
2865 2865
 
2866
-		$term_link = get_term_link( $cat, $cat->taxonomy );
2866
+		$term_link = get_term_link($cat, $cat->taxonomy);
2867 2867
 		/**
2868 2868
 		 * Filer the category term link.
2869 2869
 		 *
@@ -2873,11 +2873,11 @@  discard block
 block discarded – undo
2873 2873
 		 * @param int $cat          ->term_id The term id.
2874 2874
 		 * @param string $post_type Wordpress post type.
2875 2875
 		 */
2876
-		$term_link = apply_filters( 'geodir_category_term_link', $term_link, $cat->term_id, $post_type );
2876
+		$term_link = apply_filters('geodir_category_term_link', $term_link, $cat->term_id, $post_type);
2877 2877
 
2878
-		echo '<li class="' . $class_row . '"><a href="' . $term_link . '">';
2879
-		echo '<img alt="' . esc_attr( $cat->name ) . ' icon" style="height:20px;vertical-align:middle;" src="' . $term_icon_url . '"/> <span class="cat-link">';
2880
-		echo $cat->name . '</span> <span class="geodir_term_class geodir_link_span geodir_category_class_' . $post_type . '_' . $cat->term_id . '">(' . $total_post . ')</span> ';
2878
+		echo '<li class="'.$class_row.'"><a href="'.$term_link.'">';
2879
+		echo '<img alt="'.esc_attr($cat->name).' icon" style="height:20px;vertical-align:middle;" src="'.$term_icon_url.'"/> <span class="cat-link">';
2880
+		echo $cat->name.'</span> <span class="geodir_term_class geodir_link_span geodir_category_class_'.$post_type.'_'.$cat->term_id.'">('.$total_post.')</span> ';
2881 2881
 		echo '</a></li>';
2882 2882
 	}
2883 2883
 }
@@ -2892,14 +2892,14 @@  discard block
 block discarded – undo
2892 2892
  * @param array|string $args     Display arguments including before_title, after_title, before_widget, and after_widget.
2893 2893
  * @param array|string $instance The settings for the particular instance of the widget.
2894 2894
  */
2895
-function geodir_listing_slider_widget_output( $args = '', $instance = '' ) {
2895
+function geodir_listing_slider_widget_output($args = '', $instance = '') {
2896 2896
 	// prints the widget
2897
-	extract( $args, EXTR_SKIP );
2897
+	extract($args, EXTR_SKIP);
2898 2898
 
2899 2899
 	echo $before_widget;
2900 2900
 
2901 2901
 	/** This filter is documented in geodirectory_widgets.php */
2902
-	$title = empty( $instance['title'] ) ? '' : apply_filters( 'widget_title', __( $instance['title'], 'geodirectory' ) );
2902
+	$title = empty($instance['title']) ? '' : apply_filters('widget_title', __($instance['title'], 'geodirectory'));
2903 2903
 	/**
2904 2904
 	 * Filter the widget post type.
2905 2905
 	 *
@@ -2907,7 +2907,7 @@  discard block
 block discarded – undo
2907 2907
 	 *
2908 2908
 	 * @param string $instance ['post_type'] Post type of listing.
2909 2909
 	 */
2910
-	$post_type = empty( $instance['post_type'] ) ? 'gd_place' : apply_filters( 'widget_post_type', $instance['post_type'] );
2910
+	$post_type = empty($instance['post_type']) ? 'gd_place' : apply_filters('widget_post_type', $instance['post_type']);
2911 2911
 	/**
2912 2912
 	 * Filter the widget's term.
2913 2913
 	 *
@@ -2915,7 +2915,7 @@  discard block
 block discarded – undo
2915 2915
 	 *
2916 2916
 	 * @param string $instance ['category'] Filter by term. Can be any valid term.
2917 2917
 	 */
2918
-	$category = empty( $instance['category'] ) ? '0' : apply_filters( 'widget_category', $instance['category'] );
2918
+	$category = empty($instance['category']) ? '0' : apply_filters('widget_category', $instance['category']);
2919 2919
 	/**
2920 2920
 	 * Filter widget's "add_location_filter" value.
2921 2921
 	 *
@@ -2923,7 +2923,7 @@  discard block
 block discarded – undo
2923 2923
 	 *
2924 2924
 	 * @param string|bool $instance ['add_location_filter'] Do you want to add location filter? Can be 1 or 0.
2925 2925
 	 */
2926
-	$add_location_filter = empty( $instance['add_location_filter'] ) ? '0' : apply_filters( 'widget_add_location_filter', $instance['add_location_filter'] );
2926
+	$add_location_filter = empty($instance['add_location_filter']) ? '0' : apply_filters('widget_add_location_filter', $instance['add_location_filter']);
2927 2927
 	/**
2928 2928
 	 * Filter the widget listings limit.
2929 2929
 	 *
@@ -2931,7 +2931,7 @@  discard block
 block discarded – undo
2931 2931
 	 *
2932 2932
 	 * @param string $instance ['post_number'] Number of listings to display.
2933 2933
 	 */
2934
-	$post_number = empty( $instance['post_number'] ) ? '5' : apply_filters( 'widget_post_number', $instance['post_number'] );
2934
+	$post_number = empty($instance['post_number']) ? '5' : apply_filters('widget_post_number', $instance['post_number']);
2935 2935
 	/**
2936 2936
 	 * Filter the widget listings limit shown at one time.
2937 2937
 	 *
@@ -2939,7 +2939,7 @@  discard block
 block discarded – undo
2939 2939
 	 *
2940 2940
 	 * @param string $instance ['max_show'] Number of listings to display on screen.
2941 2941
 	 */
2942
-	$max_show = empty( $instance['max_show'] ) ? '1' : apply_filters( 'widget_max_show', $instance['max_show'] );
2942
+	$max_show = empty($instance['max_show']) ? '1' : apply_filters('widget_max_show', $instance['max_show']);
2943 2943
 	/**
2944 2944
 	 * Filter the widget slide width.
2945 2945
 	 *
@@ -2947,7 +2947,7 @@  discard block
 block discarded – undo
2947 2947
 	 *
2948 2948
 	 * @param string $instance ['slide_width'] Width of the slides shown.
2949 2949
 	 */
2950
-	$slide_width = empty( $instance['slide_width'] ) ? '' : apply_filters( 'widget_slide_width', $instance['slide_width'] );
2950
+	$slide_width = empty($instance['slide_width']) ? '' : apply_filters('widget_slide_width', $instance['slide_width']);
2951 2951
 	/**
2952 2952
 	 * Filter widget's "show title" value.
2953 2953
 	 *
@@ -2955,7 +2955,7 @@  discard block
 block discarded – undo
2955 2955
 	 *
2956 2956
 	 * @param string|bool $instance ['show_title'] Do you want to display title? Can be 1 or 0.
2957 2957
 	 */
2958
-	$show_title = empty( $instance['show_title'] ) ? '' : apply_filters( 'widget_show_title', $instance['show_title'] );
2958
+	$show_title = empty($instance['show_title']) ? '' : apply_filters('widget_show_title', $instance['show_title']);
2959 2959
 	/**
2960 2960
 	 * Filter widget's "slideshow" value.
2961 2961
 	 *
@@ -2963,7 +2963,7 @@  discard block
 block discarded – undo
2963 2963
 	 *
2964 2964
 	 * @param int $instance ['slideshow'] Setup a slideshow for the slider to animate automatically.
2965 2965
 	 */
2966
-	$slideshow = empty( $instance['slideshow'] ) ? 0 : apply_filters( 'widget_slideshow', $instance['slideshow'] );
2966
+	$slideshow = empty($instance['slideshow']) ? 0 : apply_filters('widget_slideshow', $instance['slideshow']);
2967 2967
 	/**
2968 2968
 	 * Filter widget's "animationLoop" value.
2969 2969
 	 *
@@ -2971,7 +2971,7 @@  discard block
 block discarded – undo
2971 2971
 	 *
2972 2972
 	 * @param int $instance ['animationLoop'] Gives the slider a seamless infinite loop.
2973 2973
 	 */
2974
-	$animationLoop = empty( $instance['animationLoop'] ) ? 0 : apply_filters( 'widget_animationLoop', $instance['animationLoop'] );
2974
+	$animationLoop = empty($instance['animationLoop']) ? 0 : apply_filters('widget_animationLoop', $instance['animationLoop']);
2975 2975
 	/**
2976 2976
 	 * Filter widget's "directionNav" value.
2977 2977
 	 *
@@ -2979,7 +2979,7 @@  discard block
 block discarded – undo
2979 2979
 	 *
2980 2980
 	 * @param int $instance ['directionNav'] Enable previous/next arrow navigation?. Can be 1 or 0.
2981 2981
 	 */
2982
-	$directionNav = empty( $instance['directionNav'] ) ? 0 : apply_filters( 'widget_directionNav', $instance['directionNav'] );
2982
+	$directionNav = empty($instance['directionNav']) ? 0 : apply_filters('widget_directionNav', $instance['directionNav']);
2983 2983
 	/**
2984 2984
 	 * Filter widget's "slideshowSpeed" value.
2985 2985
 	 *
@@ -2987,7 +2987,7 @@  discard block
 block discarded – undo
2987 2987
 	 *
2988 2988
 	 * @param int $instance ['slideshowSpeed'] Set the speed of the slideshow cycling, in milliseconds.
2989 2989
 	 */
2990
-	$slideshowSpeed = empty( $instance['slideshowSpeed'] ) ? 5000 : apply_filters( 'widget_slideshowSpeed', $instance['slideshowSpeed'] );
2990
+	$slideshowSpeed = empty($instance['slideshowSpeed']) ? 5000 : apply_filters('widget_slideshowSpeed', $instance['slideshowSpeed']);
2991 2991
 	/**
2992 2992
 	 * Filter widget's "animationSpeed" value.
2993 2993
 	 *
@@ -2995,7 +2995,7 @@  discard block
 block discarded – undo
2995 2995
 	 *
2996 2996
 	 * @param int $instance ['animationSpeed'] Set the speed of animations, in milliseconds.
2997 2997
 	 */
2998
-	$animationSpeed = empty( $instance['animationSpeed'] ) ? 600 : apply_filters( 'widget_animationSpeed', $instance['animationSpeed'] );
2998
+	$animationSpeed = empty($instance['animationSpeed']) ? 600 : apply_filters('widget_animationSpeed', $instance['animationSpeed']);
2999 2999
 	/**
3000 3000
 	 * Filter widget's "animation" value.
3001 3001
 	 *
@@ -3003,7 +3003,7 @@  discard block
 block discarded – undo
3003 3003
 	 *
3004 3004
 	 * @param string $instance ['animation'] Controls the animation type, "fade" or "slide".
3005 3005
 	 */
3006
-	$animation = empty( $instance['animation'] ) ? 'slide' : apply_filters( 'widget_animation', $instance['animation'] );
3006
+	$animation = empty($instance['animation']) ? 'slide' : apply_filters('widget_animation', $instance['animation']);
3007 3007
 	/**
3008 3008
 	 * Filter widget's "list_sort" type.
3009 3009
 	 *
@@ -3011,10 +3011,10 @@  discard block
 block discarded – undo
3011 3011
 	 *
3012 3012
 	 * @param string $instance ['list_sort'] Listing sort by type.
3013 3013
 	 */
3014
-	$list_sort          = empty( $instance['list_sort'] ) ? 'latest' : apply_filters( 'widget_list_sort', $instance['list_sort'] );
3015
-	$show_featured_only = ! empty( $instance['show_featured_only'] ) ? 1 : null;
3014
+	$list_sort          = empty($instance['list_sort']) ? 'latest' : apply_filters('widget_list_sort', $instance['list_sort']);
3015
+	$show_featured_only = !empty($instance['show_featured_only']) ? 1 : null;
3016 3016
 
3017
-	wp_enqueue_script( 'geodirectory-jquery-flexslider-js' );
3017
+	wp_enqueue_script('geodirectory-jquery-flexslider-js');
3018 3018
 	?>
3019 3019
 	<script type="text/javascript">
3020 3020
 		jQuery(window).load(function () {
@@ -3032,23 +3032,23 @@  discard block
 block discarded – undo
3032 3032
 				itemWidth: 75,
3033 3033
 				itemMargin: 5,
3034 3034
 				asNavFor: '#geodir_widget_slider',
3035
-				rtl: <?php echo( is_rtl() ? 'true' : 'false' ); /* fix rtl issue */ ?>
3035
+				rtl: <?php echo(is_rtl() ? 'true' : 'false'); /* fix rtl issue */ ?>
3036 3036
 			});
3037 3037
 
3038 3038
 			jQuery('#geodir_widget_slider').flexslider({
3039
-				animation: "<?php echo $animation;?>",
3039
+				animation: "<?php echo $animation; ?>",
3040 3040
 				selector: ".geodir-slides > li",
3041 3041
 				namespace: "geodir-",
3042 3042
 				controlNav: true,
3043
-				animationLoop: <?php echo $animationLoop;?>,
3044
-				slideshow: <?php echo $slideshow;?>,
3045
-				slideshowSpeed: <?php echo $slideshowSpeed;?>,
3046
-				animationSpeed: <?php echo $animationSpeed;?>,
3047
-				directionNav: <?php echo $directionNav;?>,
3048
-				maxItems: <?php echo $max_show;?>,
3043
+				animationLoop: <?php echo $animationLoop; ?>,
3044
+				slideshow: <?php echo $slideshow; ?>,
3045
+				slideshowSpeed: <?php echo $slideshowSpeed; ?>,
3046
+				animationSpeed: <?php echo $animationSpeed; ?>,
3047
+				directionNav: <?php echo $directionNav; ?>,
3048
+				maxItems: <?php echo $max_show; ?>,
3049 3049
 				move: 1,
3050
-				<?php if ( $slide_width ) {
3051
-				echo "itemWidth: " . $slide_width . ",";
3050
+				<?php if ($slide_width) {
3051
+				echo "itemWidth: ".$slide_width.",";
3052 3052
 			}?>
3053 3053
 				sync: "#geodir_widget_carousel",
3054 3054
 				start: function (slider) {
@@ -3060,7 +3060,7 @@  discard block
 block discarded – undo
3060 3060
 					jQuery('#geodir_widget_slider').css({'visibility': 'visible'});
3061 3061
 					jQuery('#geodir_widget_carousel').css({'visibility': 'visible'});
3062 3062
 				},
3063
-				rtl: <?php echo( is_rtl() ? 'true' : 'false' ); /* fix rtl issue */ ?>
3063
+				rtl: <?php echo(is_rtl() ? 'true' : 'false'); /* fix rtl issue */ ?>
3064 3064
 			});
3065 3065
 		});
3066 3066
 	</script>
@@ -3073,62 +3073,62 @@  discard block
 block discarded – undo
3073 3073
 		'order_by'       => $list_sort
3074 3074
 	);
3075 3075
 
3076
-	if ( $show_featured_only ) {
3076
+	if ($show_featured_only) {
3077 3077
 		$query_args['show_featured_only'] = 1;
3078 3078
 	}
3079 3079
 
3080
-	if ( $category != 0 || $category != '' ) {
3081
-		$category_taxonomy = geodir_get_taxonomies( $post_type );
3080
+	if ($category != 0 || $category != '') {
3081
+		$category_taxonomy = geodir_get_taxonomies($post_type);
3082 3082
 		$tax_query         = array(
3083 3083
 			'taxonomy' => $category_taxonomy[0],
3084 3084
 			'field'    => 'id',
3085 3085
 			'terms'    => $category
3086 3086
 		);
3087 3087
 
3088
-		$query_args['tax_query'] = array( $tax_query );
3088
+		$query_args['tax_query'] = array($tax_query);
3089 3089
 	}
3090 3090
 
3091 3091
 	// we want listings with featured image only
3092 3092
 	$query_args['featured_image_only'] = 1;
3093 3093
 
3094
-	if ( $post_type == 'gd_event' ) {
3094
+	if ($post_type == 'gd_event') {
3095 3095
 		$query_args['gedir_event_listing_filter'] = 'upcoming';
3096 3096
 	}// show only upcoming events
3097 3097
 
3098
-	$widget_listings = geodir_get_widget_listings( $query_args );
3099
-	if ( ! empty( $widget_listings ) || ( isset( $with_no_results ) && $with_no_results ) ) {
3100
-		if ( $title ) {
3101
-			echo $before_title . $title . $after_title;
3098
+	$widget_listings = geodir_get_widget_listings($query_args);
3099
+	if (!empty($widget_listings) || (isset($with_no_results) && $with_no_results)) {
3100
+		if ($title) {
3101
+			echo $before_title.$title.$after_title;
3102 3102
 		}
3103 3103
 
3104 3104
 		global $post;
3105 3105
 
3106
-		$current_post = $post;// keep current post info
3106
+		$current_post = $post; // keep current post info
3107 3107
 
3108 3108
 		$widget_main_slides = '';
3109 3109
 		$nav_slides         = '';
3110 3110
 		$widget_slides      = 0;
3111 3111
 
3112
-		foreach ( $widget_listings as $widget_listing ) {
3112
+		foreach ($widget_listings as $widget_listing) {
3113 3113
 			global $gd_widget_listing_type;
3114 3114
 			$post         = $widget_listing;
3115
-			$widget_image = geodir_get_featured_image( $post->ID, 'thumbnail', get_option( 'geodir_listing_no_img' ) );
3115
+			$widget_image = geodir_get_featured_image($post->ID, 'thumbnail', get_option('geodir_listing_no_img'));
3116 3116
 
3117
-			if ( ! empty( $widget_image ) ) {
3118
-				if ( $widget_image->height >= 200 ) {
3117
+			if (!empty($widget_image)) {
3118
+				if ($widget_image->height >= 200) {
3119 3119
 					$widget_spacer_height = 0;
3120 3120
 				} else {
3121
-					$widget_spacer_height = ( ( 200 - $widget_image->height ) / 2 );
3121
+					$widget_spacer_height = ((200 - $widget_image->height) / 2);
3122 3122
 				}
3123 3123
 
3124
-				$widget_main_slides .= '<li class="geodir-listing-slider-widget"><img class="geodir-listing-slider-spacer" src="' . geodir_plugin_url() . "/geodirectory-assets/images/spacer.gif" . '" alt="' . $widget_image->title . '" title="' . $widget_image->title . '" style="max-height:' . $widget_spacer_height . 'px !important;margin:0 auto;" width="100" />';
3124
+				$widget_main_slides .= '<li class="geodir-listing-slider-widget"><img class="geodir-listing-slider-spacer" src="'.geodir_plugin_url()."/geodirectory-assets/images/spacer.gif".'" alt="'.$widget_image->title.'" title="'.$widget_image->title.'" style="max-height:'.$widget_spacer_height.'px !important;margin:0 auto;" width="100" />';
3125 3125
 
3126 3126
 				$title = '';
3127
-				if ( $show_title ) {
3128
-					$title_html     = '<div class="geodir-slider-title"><a href="' . get_permalink( $post->ID ) . '">' . get_the_title( $post->ID ) . '</a></div>';
3127
+				if ($show_title) {
3128
+					$title_html     = '<div class="geodir-slider-title"><a href="'.get_permalink($post->ID).'">'.get_the_title($post->ID).'</a></div>';
3129 3129
 					$post_id        = $post->ID;
3130
-					$post_permalink = get_permalink( $post->ID );
3131
-					$post_title     = get_the_title( $post->ID );
3130
+					$post_permalink = get_permalink($post->ID);
3131
+					$post_title     = get_the_title($post->ID);
3132 3132
 					/**
3133 3133
 					 * Filter the listing slider widget title.
3134 3134
 					 *
@@ -3139,12 +3139,12 @@  discard block
 block discarded – undo
3139 3139
 					 * @param string $post_permalink The post permalink url.
3140 3140
 					 * @param string $post_title     The post title text.
3141 3141
 					 */
3142
-					$title = apply_filters( 'geodir_listing_slider_title', $title_html, $post_id, $post_permalink, $post_title );
3142
+					$title = apply_filters('geodir_listing_slider_title', $title_html, $post_id, $post_permalink, $post_title);
3143 3143
 				}
3144 3144
 
3145
-				$widget_main_slides .= $title . '<img src="' . $widget_image->src . '" alt="' . $widget_image->title . '" title="' . $widget_image->title . '" style="max-height:200px;margin:0 auto;" /></li>';
3146
-				$nav_slides .= '<li><img src="' . $widget_image->src . '" alt="' . $widget_image->title . '" title="' . $widget_image->title . '" style="max-height:48px;margin:0 auto;" /></li>';
3147
-				$widget_slides ++;
3145
+				$widget_main_slides .= $title.'<img src="'.$widget_image->src.'" alt="'.$widget_image->title.'" title="'.$widget_image->title.'" style="max-height:200px;margin:0 auto;" /></li>';
3146
+				$nav_slides .= '<li><img src="'.$widget_image->src.'" alt="'.$widget_image->title.'" title="'.$widget_image->title.'" style="max-height:48px;margin:0 auto;" /></li>';
3147
+				$widget_slides++;
3148 3148
 			}
3149 3149
 		}
3150 3150
 		?>
@@ -3153,7 +3153,7 @@  discard block
 block discarded – undo
3153 3153
 			<div id="geodir_widget_slider" class="geodir_flexslider">
3154 3154
 				<ul class="geodir-slides clearfix"><?php echo $widget_main_slides; ?></ul>
3155 3155
 			</div>
3156
-			<?php if ( $widget_slides > 1 ) { ?>
3156
+			<?php if ($widget_slides > 1) { ?>
3157 3157
 				<div id="geodir_widget_carousel" class="geodir_flexslider">
3158 3158
 					<ul class="geodir-slides clearfix"><?php echo $nav_slides; ?></ul>
3159 3159
 				</div>
@@ -3161,7 +3161,7 @@  discard block
 block discarded – undo
3161 3161
 		</div>
3162 3162
 		<?php
3163 3163
 		$GLOBALS['post'] = $current_post;
3164
-		setup_postdata( $current_post );
3164
+		setup_postdata($current_post);
3165 3165
 	}
3166 3166
 	echo $after_widget;
3167 3167
 }
@@ -3177,46 +3177,46 @@  discard block
 block discarded – undo
3177 3177
  * @param array|string $args     Display arguments including before_title, after_title, before_widget, and after_widget.
3178 3178
  * @param array|string $instance The settings for the particular instance of the widget.
3179 3179
  */
3180
-function geodir_loginwidget_output( $args = '', $instance = '' ) {
3180
+function geodir_loginwidget_output($args = '', $instance = '') {
3181 3181
 	//print_r($args);
3182 3182
 	//print_r($instance);
3183 3183
 	// prints the widget
3184
-	extract( $args, EXTR_SKIP );
3184
+	extract($args, EXTR_SKIP);
3185 3185
 
3186 3186
 	/** This filter is documented in geodirectory_widgets.php */
3187
-	$title = empty( $instance['title'] ) ? __( 'My Dashboard', 'geodirectory' ) : apply_filters( 'my_dashboard_widget_title', __( $instance['title'], 'geodirectory' ) );
3187
+	$title = empty($instance['title']) ? __('My Dashboard', 'geodirectory') : apply_filters('my_dashboard_widget_title', __($instance['title'], 'geodirectory'));
3188 3188
 
3189 3189
 	echo $before_widget;
3190
-	echo $before_title . $title . $after_title;
3190
+	echo $before_title.$title.$after_title;
3191 3191
 
3192
-	if ( is_user_logged_in() ) {
3192
+	if (is_user_logged_in()) {
3193 3193
 		global $current_user;
3194 3194
 
3195
-		$author_link = get_author_posts_url( $current_user->data->ID );
3196
-		$author_link = geodir_getlink( $author_link, array( 'geodir_dashbord' => 'true' ), false );
3195
+		$author_link = get_author_posts_url($current_user->data->ID);
3196
+		$author_link = geodir_getlink($author_link, array('geodir_dashbord' => 'true'), false);
3197 3197
 
3198 3198
 		echo '<ul class="geodir-loginbox-list">';
3199 3199
 		ob_start();
3200 3200
 		?>
3201 3201
 		<li><a class="signin"
3202
-		       href="<?php echo wp_logout_url( home_url() ); ?>"><?php _e( 'Logout', 'geodirectory' ); ?></a></li>
3202
+		       href="<?php echo wp_logout_url(home_url()); ?>"><?php _e('Logout', 'geodirectory'); ?></a></li>
3203 3203
 		<?php
3204
-		$post_types                           = geodir_get_posttypes( 'object' );
3205
-		$show_add_listing_post_types_main_nav = get_option( 'geodir_add_listing_link_user_dashboard' );
3206
-		$geodir_allow_posttype_frontend       = get_option( 'geodir_allow_posttype_frontend' );
3204
+		$post_types                           = geodir_get_posttypes('object');
3205
+		$show_add_listing_post_types_main_nav = get_option('geodir_add_listing_link_user_dashboard');
3206
+		$geodir_allow_posttype_frontend       = get_option('geodir_allow_posttype_frontend');
3207 3207
 
3208
-		if ( ! empty( $show_add_listing_post_types_main_nav ) ) {
3208
+		if (!empty($show_add_listing_post_types_main_nav)) {
3209 3209
 			$addlisting_links = '';
3210
-			foreach ( $post_types as $key => $postobj ) {
3210
+			foreach ($post_types as $key => $postobj) {
3211 3211
 
3212
-				if ( in_array( $key, $show_add_listing_post_types_main_nav ) ) {
3212
+				if (in_array($key, $show_add_listing_post_types_main_nav)) {
3213 3213
 
3214
-					if ( $add_link = geodir_get_addlisting_link( $key ) ) {
3214
+					if ($add_link = geodir_get_addlisting_link($key)) {
3215 3215
 
3216 3216
 						$name = $postobj->labels->name;
3217 3217
 
3218 3218
 						$selected = '';
3219
-						if ( geodir_get_current_posttype() == $key && geodir_is_page( 'add-listing' ) ) {
3219
+						if (geodir_get_current_posttype() == $key && geodir_is_page('add-listing')) {
3220 3220
 							$selected = 'selected="selected"';
3221 3221
 						}
3222 3222
 
@@ -3229,22 +3229,22 @@  discard block
 block discarded – undo
3229 3229
 						 * @param string $key       Add listing array key.
3230 3230
 						 * @param int $current_user ->ID Current user ID.
3231 3231
 						 */
3232
-						$add_link = apply_filters( 'geodir_dashboard_link_add_listing', $add_link, $key, $current_user->ID );
3232
+						$add_link = apply_filters('geodir_dashboard_link_add_listing', $add_link, $key, $current_user->ID);
3233 3233
 
3234
-						$addlisting_links .= '<option ' . $selected . ' value="' . $add_link . '">' . __( ucfirst( $name ), 'geodirectory' ) . '</option>';
3234
+						$addlisting_links .= '<option '.$selected.' value="'.$add_link.'">'.__(ucfirst($name), 'geodirectory').'</option>';
3235 3235
 
3236 3236
 					}
3237 3237
 				}
3238 3238
 
3239 3239
 			}
3240 3240
 
3241
-			if ( $addlisting_links != '' ) { ?>
3241
+			if ($addlisting_links != '') { ?>
3242 3242
 
3243 3243
 				<li><select id="geodir_add_listing" class="chosen_select" onchange="window.location.href=this.value"
3244 3244
 				            option-autoredirect="1" name="geodir_add_listing" option-ajaxchosen="false"
3245
-				            data-placeholder="<?php echo esc_attr( __( 'Add Listing', 'geodirectory' ) ); ?>">
3245
+				            data-placeholder="<?php echo esc_attr(__('Add Listing', 'geodirectory')); ?>">
3246 3246
 						<option value="" disabled="disabled" selected="selected"
3247
-						        style='display:none;'><?php echo esc_attr( __( 'Add Listing', 'geodirectory' ) ); ?></option>
3247
+						        style='display:none;'><?php echo esc_attr(__('Add Listing', 'geodirectory')); ?></option>
3248 3248
 						<?php echo $addlisting_links; ?>
3249 3249
 					</select></li> <?php
3250 3250
 
@@ -3252,23 +3252,23 @@  discard block
 block discarded – undo
3252 3252
 
3253 3253
 		}
3254 3254
 		// My Favourites in Dashboard
3255
-		$show_favorite_link_user_dashboard = get_option( 'geodir_favorite_link_user_dashboard' );
3255
+		$show_favorite_link_user_dashboard = get_option('geodir_favorite_link_user_dashboard');
3256 3256
 		$user_favourite                    = geodir_user_favourite_listing_count();
3257 3257
 
3258
-		if ( ! empty( $show_favorite_link_user_dashboard ) && ! empty( $user_favourite ) ) {
3258
+		if (!empty($show_favorite_link_user_dashboard) && !empty($user_favourite)) {
3259 3259
 			$favourite_links = '';
3260 3260
 
3261
-			foreach ( $post_types as $key => $postobj ) {
3262
-				if ( in_array( $key, $show_favorite_link_user_dashboard ) && array_key_exists( $key, $user_favourite ) ) {
3261
+			foreach ($post_types as $key => $postobj) {
3262
+				if (in_array($key, $show_favorite_link_user_dashboard) && array_key_exists($key, $user_favourite)) {
3263 3263
 					$name           = $postobj->labels->name;
3264
-					$post_type_link = geodir_getlink( $author_link, array(
3264
+					$post_type_link = geodir_getlink($author_link, array(
3265 3265
 						'stype' => $key,
3266 3266
 						'list'  => 'favourite'
3267
-					), false );
3267
+					), false);
3268 3268
 
3269 3269
 					$selected = '';
3270 3270
 
3271
-					if ( isset( $_REQUEST['list'] ) && $_REQUEST['list'] == 'favourite' && isset( $_REQUEST['stype'] ) && $_REQUEST['stype'] == $key && isset( $_REQUEST['geodir_dashbord'] ) ) {
3271
+					if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite' && isset($_REQUEST['stype']) && $_REQUEST['stype'] == $key && isset($_REQUEST['geodir_dashbord'])) {
3272 3272
 						$selected = 'selected="selected"';
3273 3273
 					}
3274 3274
 					/**
@@ -3280,20 +3280,20 @@  discard block
 block discarded – undo
3280 3280
 					 * @param string $key            Favorite listing array key.
3281 3281
 					 * @param int $current_user      ->ID Current user ID.
3282 3282
 					 */
3283
-					$post_type_link = apply_filters( 'geodir_dashboard_link_favorite_listing', $post_type_link, $key, $current_user->ID );
3283
+					$post_type_link = apply_filters('geodir_dashboard_link_favorite_listing', $post_type_link, $key, $current_user->ID);
3284 3284
 
3285
-					$favourite_links .= '<option ' . $selected . ' value="' . $post_type_link . '">' . __( ucfirst( $name ), 'geodirectory' ) . '</option>';
3285
+					$favourite_links .= '<option '.$selected.' value="'.$post_type_link.'">'.__(ucfirst($name), 'geodirectory').'</option>';
3286 3286
 				}
3287 3287
 			}
3288 3288
 
3289
-			if ( $favourite_links != '' ) {
3289
+			if ($favourite_links != '') {
3290 3290
 				?>
3291 3291
 				<li>
3292 3292
 					<select id="geodir_my_favourites" class="chosen_select" onchange="window.location.href=this.value"
3293 3293
 					        option-autoredirect="1" name="geodir_my_favourites" option-ajaxchosen="false"
3294
-					        data-placeholder="<?php echo esc_attr( __( 'My Favorites', 'geodirectory' ) ); ?>">
3294
+					        data-placeholder="<?php echo esc_attr(__('My Favorites', 'geodirectory')); ?>">
3295 3295
 						<option value="" disabled="disabled" selected="selected"
3296
-						        style='display:none;'><?php echo esc_attr( __( 'My Favorites', 'geodirectory' ) ); ?></option>
3296
+						        style='display:none;'><?php echo esc_attr(__('My Favorites', 'geodirectory')); ?></option>
3297 3297
 						<?php echo $favourite_links; ?>
3298 3298
 					</select>
3299 3299
 				</li>
@@ -3302,19 +3302,19 @@  discard block
 block discarded – undo
3302 3302
 		}
3303 3303
 
3304 3304
 
3305
-		$show_listing_link_user_dashboard = get_option( 'geodir_listing_link_user_dashboard' );
3305
+		$show_listing_link_user_dashboard = get_option('geodir_listing_link_user_dashboard');
3306 3306
 		$user_listing                     = geodir_user_post_listing_count();
3307 3307
 
3308
-		if ( ! empty( $show_listing_link_user_dashboard ) && ! empty( $user_listing ) ) {
3308
+		if (!empty($show_listing_link_user_dashboard) && !empty($user_listing)) {
3309 3309
 			$listing_links = '';
3310 3310
 
3311
-			foreach ( $post_types as $key => $postobj ) {
3312
-				if ( in_array( $key, $show_listing_link_user_dashboard ) && array_key_exists( $key, $user_listing ) ) {
3311
+			foreach ($post_types as $key => $postobj) {
3312
+				if (in_array($key, $show_listing_link_user_dashboard) && array_key_exists($key, $user_listing)) {
3313 3313
 					$name         = $postobj->labels->name;
3314
-					$listing_link = geodir_getlink( $author_link, array( 'stype' => $key ), false );
3314
+					$listing_link = geodir_getlink($author_link, array('stype' => $key), false);
3315 3315
 
3316 3316
 					$selected = '';
3317
-					if ( ! isset( $_REQUEST['list'] ) && isset( $_REQUEST['geodir_dashbord'] ) && isset( $_REQUEST['stype'] ) && $_REQUEST['stype'] == $key ) {
3317
+					if (!isset($_REQUEST['list']) && isset($_REQUEST['geodir_dashbord']) && isset($_REQUEST['stype']) && $_REQUEST['stype'] == $key) {
3318 3318
 						$selected = 'selected="selected"';
3319 3319
 					}
3320 3320
 
@@ -3327,20 +3327,20 @@  discard block
 block discarded – undo
3327 3327
 					 * @param string $key          My listing array key.
3328 3328
 					 * @param int $current_user    ->ID Current user ID.
3329 3329
 					 */
3330
-					$listing_link = apply_filters( 'geodir_dashboard_link_my_listing', $listing_link, $key, $current_user->ID );
3330
+					$listing_link = apply_filters('geodir_dashboard_link_my_listing', $listing_link, $key, $current_user->ID);
3331 3331
 
3332
-					$listing_links .= '<option ' . $selected . ' value="' . $listing_link . '">' . __( ucfirst( $name ), 'geodirectory' ) . '</option>';
3332
+					$listing_links .= '<option '.$selected.' value="'.$listing_link.'">'.__(ucfirst($name), 'geodirectory').'</option>';
3333 3333
 				}
3334 3334
 			}
3335 3335
 
3336
-			if ( $listing_links != '' ) {
3336
+			if ($listing_links != '') {
3337 3337
 				?>
3338 3338
 				<li>
3339 3339
 					<select id="geodir_my_listings" class="chosen_select" onchange="window.location.href=this.value"
3340 3340
 					        option-autoredirect="1" name="geodir_my_listings" option-ajaxchosen="false"
3341
-					        data-placeholder="<?php echo esc_attr( __( 'My Listings', 'geodirectory' ) ); ?>">
3341
+					        data-placeholder="<?php echo esc_attr(__('My Listings', 'geodirectory')); ?>">
3342 3342
 						<option value="" disabled="disabled" selected="selected"
3343
-						        style='display:none;'><?php echo esc_attr( __( 'My Listings', 'geodirectory' ) ); ?></option>
3343
+						        style='display:none;'><?php echo esc_attr(__('My Listings', 'geodirectory')); ?></option>
3344 3344
 						<?php echo $listing_links; ?>
3345 3345
 					</select>
3346 3346
 				</li>
@@ -3356,7 +3356,7 @@  discard block
 block discarded – undo
3356 3356
 		 *
3357 3357
 		 * @param string $dashboard_link Dashboard links HTML.
3358 3358
 		 */
3359
-		echo apply_filters( 'geodir_dashboard_links', $dashboard_link );
3359
+		echo apply_filters('geodir_dashboard_links', $dashboard_link);
3360 3360
 		echo '</ul>';
3361 3361
 
3362 3362
 		/**
@@ -3364,7 +3364,7 @@  discard block
 block discarded – undo
3364 3364
 		 *
3365 3365
 		 * @since 1.6.6
3366 3366
 		 */
3367
-		do_action( 'geodir_after_loginwidget_form_logged_in' );
3367
+		do_action('geodir_after_loginwidget_form_logged_in');
3368 3368
 
3369 3369
 
3370 3370
 	} else {
@@ -3379,18 +3379,18 @@  discard block
 block discarded – undo
3379 3379
 		<form name="loginform" class="loginform1"
3380 3380
 		      action="<?php echo geodir_login_url(); ?>"
3381 3381
 		      method="post">
3382
-			<div class="geodir_form_row"><input placeholder="<?php _e( 'Email', 'geodirectory' ); ?>" name="log"
3382
+			<div class="geodir_form_row"><input placeholder="<?php _e('Email', 'geodirectory'); ?>" name="log"
3383 3383
 			                                    type="text" class="textfield user_login1"/> <span
3384 3384
 					class="user_loginInfo"></span></div>
3385
-			<div class="geodir_form_row"><input placeholder="<?php _e( 'Password', 'geodirectory' ); ?>"
3385
+			<div class="geodir_form_row"><input placeholder="<?php _e('Password', 'geodirectory'); ?>"
3386 3386
 			                                    name="pwd" type="password"
3387 3387
 			                                    class="textfield user_pass1 input-text"/><span
3388 3388
 					class="user_passInfo"></span></div>
3389 3389
 
3390
-			<input type="hidden" name="redirect_to" value="<?php echo htmlspecialchars( geodir_curPageURL() ); ?>"/>
3390
+			<input type="hidden" name="redirect_to" value="<?php echo htmlspecialchars(geodir_curPageURL()); ?>"/>
3391 3391
 			<input type="hidden" name="testcookie" value="1"/>
3392 3392
 
3393
-				<?php do_action( 'login_form' ); ?>
3393
+				<?php do_action('login_form'); ?>
3394 3394
 
3395 3395
 			<div class="geodir_form_row clearfix"><input type="submit" name="submit"
3396 3396
 			                                             value="<?php echo SIGN_IN_BUTTON; ?>" class="b_signin"/>
@@ -3403,7 +3403,7 @@  discard block
 block discarded – undo
3403 3403
 					 * @since 1.0.0
3404 3404
 					 */
3405 3405
 					?>
3406
-					<a href="<?php echo geodir_login_url( array( 'signup' => true ) ); ?>"
3406
+					<a href="<?php echo geodir_login_url(array('signup' => true)); ?>"
3407 3407
 					   class="goedir-newuser-link"><?php echo NEW_USER_TEXT; ?></a>
3408 3408
 
3409 3409
 					<?php
@@ -3413,7 +3413,7 @@  discard block
 block discarded – undo
3413 3413
 					 * @since 1.0.0
3414 3414
 					 */
3415 3415
 					?>
3416
-					<a href="<?php echo geodir_login_url( array( 'forgot' => true ) ); ?>"
3416
+					<a href="<?php echo geodir_login_url(array('forgot' => true)); ?>"
3417 3417
 					   class="goedir-forgot-link"><?php echo FORGOT_PW_TEXT; ?></a></p></div>
3418 3418
 		</form>
3419 3419
 		<?php
@@ -3422,7 +3422,7 @@  discard block
 block discarded – undo
3422 3422
 		 *
3423 3423
 		 * @since 1.6.6
3424 3424
 		 */
3425
-		do_action( 'geodir_after_loginwidget_form_logged_out' );
3425
+		do_action('geodir_after_loginwidget_form_logged_out');
3426 3426
 	}
3427 3427
 
3428 3428
 	echo $after_widget;
@@ -3444,16 +3444,16 @@  discard block
 block discarded – undo
3444 3444
  *                                         after_widget.
3445 3445
  * @param array|string $instance           The settings for the particular instance of the widget.
3446 3446
  */
3447
-function geodir_popular_postview_output( $args = '', $instance = '' ) {
3447
+function geodir_popular_postview_output($args = '', $instance = '') {
3448 3448
 	global $gd_session;
3449 3449
 
3450 3450
 	// prints the widget
3451
-	extract( $args, EXTR_SKIP );
3451
+	extract($args, EXTR_SKIP);
3452 3452
 
3453 3453
 	echo $before_widget;
3454 3454
 
3455 3455
 	/** This filter is documented in geodirectory_widgets.php */
3456
-	$title = empty( $instance['title'] ) ? geodir_ucwords( $instance['category_title'] ) : apply_filters( 'widget_title', __( $instance['title'], 'geodirectory' ) );
3456
+	$title = empty($instance['title']) ? geodir_ucwords($instance['category_title']) : apply_filters('widget_title', __($instance['title'], 'geodirectory'));
3457 3457
 	/**
3458 3458
 	 * Filter the widget post type.
3459 3459
 	 *
@@ -3461,7 +3461,7 @@  discard block
 block discarded – undo
3461 3461
 	 *
3462 3462
 	 * @param string $instance ['post_type'] Post type of listing.
3463 3463
 	 */
3464
-	$post_type = empty( $instance['post_type'] ) ? 'gd_place' : apply_filters( 'widget_post_type', $instance['post_type'] );
3464
+	$post_type = empty($instance['post_type']) ? 'gd_place' : apply_filters('widget_post_type', $instance['post_type']);
3465 3465
 	/**
3466 3466
 	 * Filter the widget's term.
3467 3467
 	 *
@@ -3469,7 +3469,7 @@  discard block
 block discarded – undo
3469 3469
 	 *
3470 3470
 	 * @param string $instance ['category'] Filter by term. Can be any valid term.
3471 3471
 	 */
3472
-	$category = empty( $instance['category'] ) ? '0' : apply_filters( 'widget_category', $instance['category'] );
3472
+	$category = empty($instance['category']) ? '0' : apply_filters('widget_category', $instance['category']);
3473 3473
 	/**
3474 3474
 	 * Filter the widget listings limit.
3475 3475
 	 *
@@ -3477,7 +3477,7 @@  discard block
 block discarded – undo
3477 3477
 	 *
3478 3478
 	 * @param string $instance ['post_number'] Number of listings to display.
3479 3479
 	 */
3480
-	$post_number = empty( $instance['post_number'] ) ? '5' : apply_filters( 'widget_post_number', $instance['post_number'] );
3480
+	$post_number = empty($instance['post_number']) ? '5' : apply_filters('widget_post_number', $instance['post_number']);
3481 3481
 	/**
3482 3482
 	 * Filter widget's "layout" type.
3483 3483
 	 *
@@ -3485,7 +3485,7 @@  discard block
 block discarded – undo
3485 3485
 	 *
3486 3486
 	 * @param string $instance ['layout'] Widget layout type.
3487 3487
 	 */
3488
-	$layout = empty( $instance['layout'] ) ? 'gridview_onehalf' : apply_filters( 'widget_layout', $instance['layout'] );
3488
+	$layout = empty($instance['layout']) ? 'gridview_onehalf' : apply_filters('widget_layout', $instance['layout']);
3489 3489
 	/**
3490 3490
 	 * Filter widget's "add_location_filter" value.
3491 3491
 	 *
@@ -3493,7 +3493,7 @@  discard block
 block discarded – undo
3493 3493
 	 *
3494 3494
 	 * @param string|bool $instance ['add_location_filter'] Do you want to add location filter? Can be 1 or 0.
3495 3495
 	 */
3496
-	$add_location_filter = empty( $instance['add_location_filter'] ) ? '0' : apply_filters( 'widget_add_location_filter', $instance['add_location_filter'] );
3496
+	$add_location_filter = empty($instance['add_location_filter']) ? '0' : apply_filters('widget_add_location_filter', $instance['add_location_filter']);
3497 3497
 	/**
3498 3498
 	 * Filter widget's listing width.
3499 3499
 	 *
@@ -3501,7 +3501,7 @@  discard block
 block discarded – undo
3501 3501
 	 *
3502 3502
 	 * @param string $instance ['listing_width'] Listing width.
3503 3503
 	 */
3504
-	$listing_width = empty( $instance['listing_width'] ) ? '' : apply_filters( 'widget_listing_width', $instance['listing_width'] );
3504
+	$listing_width = empty($instance['listing_width']) ? '' : apply_filters('widget_listing_width', $instance['listing_width']);
3505 3505
 	/**
3506 3506
 	 * Filter widget's "list_sort" type.
3507 3507
 	 *
@@ -3509,25 +3509,25 @@  discard block
 block discarded – undo
3509 3509
 	 *
3510 3510
 	 * @param string $instance ['list_sort'] Listing sort by type.
3511 3511
 	 */
3512
-	$list_sort             = empty( $instance['list_sort'] ) ? 'latest' : apply_filters( 'widget_list_sort', $instance['list_sort'] );
3513
-	$use_viewing_post_type = ! empty( $instance['use_viewing_post_type'] ) ? true : false;
3512
+	$list_sort             = empty($instance['list_sort']) ? 'latest' : apply_filters('widget_list_sort', $instance['list_sort']);
3513
+	$use_viewing_post_type = !empty($instance['use_viewing_post_type']) ? true : false;
3514 3514
 
3515 3515
 	// set post type to current viewing post type
3516
-	if ( $use_viewing_post_type ) {
3516
+	if ($use_viewing_post_type) {
3517 3517
 		$current_post_type = geodir_get_current_posttype();
3518
-		if ( $current_post_type != '' && $current_post_type != $post_type ) {
3518
+		if ($current_post_type != '' && $current_post_type != $post_type) {
3519 3519
 			$post_type = $current_post_type;
3520 3520
 			$category  = array(); // old post type category will not work for current changed post type
3521 3521
 		}
3522 3522
 	}
3523 3523
 	// replace widget title dynamically
3524
-	$posttype_plural_label   = __( get_post_type_plural_label( $post_type ), 'geodirectory' );
3525
-	$posttype_singular_label = __( get_post_type_singular_label( $post_type ), 'geodirectory' );
3524
+	$posttype_plural_label   = __(get_post_type_plural_label($post_type), 'geodirectory');
3525
+	$posttype_singular_label = __(get_post_type_singular_label($post_type), 'geodirectory');
3526 3526
 
3527
-	$title = str_replace( "%posttype_plural_label%", $posttype_plural_label, $title );
3528
-	$title = str_replace( "%posttype_singular_label%", $posttype_singular_label, $title );
3527
+	$title = str_replace("%posttype_plural_label%", $posttype_plural_label, $title);
3528
+	$title = str_replace("%posttype_singular_label%", $posttype_singular_label, $title);
3529 3529
 
3530
-	if ( isset( $instance['character_count'] ) ) {
3530
+	if (isset($instance['character_count'])) {
3531 3531
 		/**
3532 3532
 		 * Filter the widget's excerpt character count.
3533 3533
 		 *
@@ -3535,37 +3535,37 @@  discard block
 block discarded – undo
3535 3535
 		 *
3536 3536
 		 * @param int $instance ['character_count'] Excerpt character count.
3537 3537
 		 */
3538
-		$character_count = apply_filters( 'widget_list_character_count', $instance['character_count'] );
3538
+		$character_count = apply_filters('widget_list_character_count', $instance['character_count']);
3539 3539
 	} else {
3540 3540
 		$character_count = '';
3541 3541
 	}
3542 3542
 
3543
-	if ( empty( $title ) || $title == 'All' ) {
3544
-		$title .= ' ' . __( get_post_type_plural_label( $post_type ), 'geodirectory' );
3543
+	if (empty($title) || $title == 'All') {
3544
+		$title .= ' '.__(get_post_type_plural_label($post_type), 'geodirectory');
3545 3545
 	}
3546 3546
 
3547 3547
 	$location_url = array();
3548
-	$city         = get_query_var( 'gd_city' );
3549
-	if ( ! empty( $city ) ) {
3550
-		$country = get_query_var( 'gd_country' );
3551
-		$region  = get_query_var( 'gd_region' );
3548
+	$city         = get_query_var('gd_city');
3549
+	if (!empty($city)) {
3550
+		$country = get_query_var('gd_country');
3551
+		$region  = get_query_var('gd_region');
3552 3552
 
3553
-		$geodir_show_location_url = get_option( 'geodir_show_location_url' );
3553
+		$geodir_show_location_url = get_option('geodir_show_location_url');
3554 3554
 
3555
-		if ( $geodir_show_location_url == 'all' ) {
3556
-			if ( $country != '' ) {
3555
+		if ($geodir_show_location_url == 'all') {
3556
+			if ($country != '') {
3557 3557
 				$location_url[] = $country;
3558 3558
 			}
3559 3559
 
3560
-			if ( $region != '' ) {
3560
+			if ($region != '') {
3561 3561
 				$location_url[] = $region;
3562 3562
 			}
3563
-		} else if ( $geodir_show_location_url == 'country_city' ) {
3564
-			if ( $country != '' ) {
3563
+		} else if ($geodir_show_location_url == 'country_city') {
3564
+			if ($country != '') {
3565 3565
 				$location_url[] = $country;
3566 3566
 			}
3567
-		} else if ( $geodir_show_location_url == 'region_city' ) {
3568
-			if ( $region != '' ) {
3567
+		} else if ($geodir_show_location_url == 'region_city') {
3568
+			if ($region != '') {
3569 3569
 				$location_url[] = $region;
3570 3570
 			}
3571 3571
 		}
@@ -3573,37 +3573,37 @@  discard block
 block discarded – undo
3573 3573
 		$location_url[] = $city;
3574 3574
 	}
3575 3575
 
3576
-	$location_url  = implode( '/', $location_url );
3576
+	$location_url  = implode('/', $location_url);
3577 3577
 	$skip_location = false;
3578
-	if ( ! $add_location_filter && $gd_session->get( 'gd_multi_location' ) ) {
3578
+	if (!$add_location_filter && $gd_session->get('gd_multi_location')) {
3579 3579
 		$skip_location = true;
3580
-		$gd_session->un_set( 'gd_multi_location' );
3580
+		$gd_session->un_set('gd_multi_location');
3581 3581
 	}
3582 3582
 
3583
-	if ( get_option( 'permalink_structure' ) ) {
3584
-		$viewall_url = get_post_type_archive_link( $post_type );
3583
+	if (get_option('permalink_structure')) {
3584
+		$viewall_url = get_post_type_archive_link($post_type);
3585 3585
 	} else {
3586
-		$viewall_url = get_post_type_archive_link( $post_type );
3586
+		$viewall_url = get_post_type_archive_link($post_type);
3587 3587
 	}
3588 3588
 
3589
-	if ( ! empty( $category ) && $category[0] != '0' ) {
3589
+	if (!empty($category) && $category[0] != '0') {
3590 3590
 		global $geodir_add_location_url;
3591 3591
 
3592 3592
 		$geodir_add_location_url = '0';
3593 3593
 
3594
-		if ( $add_location_filter != '0' ) {
3594
+		if ($add_location_filter != '0') {
3595 3595
 			$geodir_add_location_url = '1';
3596 3596
 		}
3597 3597
 
3598
-		$viewall_url = get_term_link( (int) $category[0], $post_type . 'category' );
3598
+		$viewall_url = get_term_link((int) $category[0], $post_type.'category');
3599 3599
 
3600 3600
 		$geodir_add_location_url = null;
3601 3601
 	}
3602
-	if ( $skip_location ) {
3603
-		$gd_session->set( 'gd_multi_location', 1 );
3602
+	if ($skip_location) {
3603
+		$gd_session->set('gd_multi_location', 1);
3604 3604
 	}
3605 3605
 
3606
-	if ( is_wp_error( $viewall_url ) ) {
3606
+	if (is_wp_error($viewall_url)) {
3607 3607
 		$viewall_url = '';
3608 3608
 	}
3609 3609
 
@@ -3615,34 +3615,34 @@  discard block
 block discarded – undo
3615 3615
 		'order_by'       => $list_sort
3616 3616
 	);
3617 3617
 
3618
-	if ( $character_count ) {
3618
+	if ($character_count) {
3619 3619
 		$query_args['excerpt_length'] = $character_count;
3620 3620
 	}
3621 3621
 
3622
-	if ( ! empty( $instance['show_featured_only'] ) ) {
3622
+	if (!empty($instance['show_featured_only'])) {
3623 3623
 		$query_args['show_featured_only'] = 1;
3624 3624
 	}
3625 3625
 
3626
-	if ( ! empty( $instance['show_special_only'] ) ) {
3626
+	if (!empty($instance['show_special_only'])) {
3627 3627
 		$query_args['show_special_only'] = 1;
3628 3628
 	}
3629 3629
 
3630
-	if ( ! empty( $instance['with_pics_only'] ) ) {
3630
+	if (!empty($instance['with_pics_only'])) {
3631 3631
 		$query_args['with_pics_only']      = 0;
3632 3632
 		$query_args['featured_image_only'] = 1;
3633 3633
 	}
3634 3634
 
3635
-	if ( ! empty( $instance['with_videos_only'] ) ) {
3635
+	if (!empty($instance['with_videos_only'])) {
3636 3636
 		$query_args['with_videos_only'] = 1;
3637 3637
 	}
3638
-	$with_no_results = ! empty( $instance['without_no_results'] ) ? false : true;
3638
+	$with_no_results = !empty($instance['without_no_results']) ? false : true;
3639 3639
 
3640
-	if ( ! empty( $category ) && $category[0] != '0' ) {
3641
-		$category_taxonomy = geodir_get_taxonomies( $post_type );
3640
+	if (!empty($category) && $category[0] != '0') {
3641
+		$category_taxonomy = geodir_get_taxonomies($post_type);
3642 3642
 
3643 3643
 		######### WPML #########
3644
-		if ( function_exists( 'icl_object_id' ) ) {
3645
-			$category = gd_lang_object_ids( $category, $category_taxonomy[0] );
3644
+		if (function_exists('icl_object_id')) {
3645
+			$category = gd_lang_object_ids($category, $category_taxonomy[0]);
3646 3646
 		}
3647 3647
 		######### WPML #########
3648 3648
 
@@ -3652,14 +3652,14 @@  discard block
 block discarded – undo
3652 3652
 			'terms'    => $category
3653 3653
 		);
3654 3654
 
3655
-		$query_args['tax_query'] = array( $tax_query );
3655
+		$query_args['tax_query'] = array($tax_query);
3656 3656
 	}
3657 3657
 
3658 3658
 	global $gridview_columns_widget, $geodir_is_widget_listing;
3659 3659
 
3660
-	$widget_listings = geodir_get_widget_listings( $query_args );
3660
+	$widget_listings = geodir_get_widget_listings($query_args);
3661 3661
 
3662
-	if ( ! empty( $widget_listings ) || $with_no_results ) {
3662
+	if (!empty($widget_listings) || $with_no_results) {
3663 3663
 		?>
3664 3664
 		<div class="geodir_locations geodir_location_listing">
3665 3665
 
@@ -3669,11 +3669,11 @@  discard block
 block discarded – undo
3669 3669
 			 *
3670 3670
 			 * @since 1.0.0
3671 3671
 			 */
3672
-			do_action( 'geodir_before_view_all_link_in_widget' ); ?>
3672
+			do_action('geodir_before_view_all_link_in_widget'); ?>
3673 3673
 			<div class="geodir_list_heading clearfix">
3674
-				<?php echo $before_title . $title . $after_title; ?>
3674
+				<?php echo $before_title.$title.$after_title; ?>
3675 3675
 				<a href="<?php echo $viewall_url; ?>"
3676
-				   class="geodir-viewall"><?php _e( 'View all', 'geodirectory' ); ?></a>
3676
+				   class="geodir-viewall"><?php _e('View all', 'geodirectory'); ?></a>
3677 3677
 			</div>
3678 3678
 			<?php
3679 3679
 			/**
@@ -3681,10 +3681,10 @@  discard block
 block discarded – undo
3681 3681
 			 *
3682 3682
 			 * @since 1.0.0
3683 3683
 			 */
3684
-			do_action( 'geodir_after_view_all_link_in_widget' ); ?>
3684
+			do_action('geodir_after_view_all_link_in_widget'); ?>
3685 3685
 			<?php
3686
-			if ( strstr( $layout, 'gridview' ) ) {
3687
-				$listing_view_exp        = explode( '_', $layout );
3686
+			if (strstr($layout, 'gridview')) {
3687
+				$listing_view_exp        = explode('_', $layout);
3688 3688
 				$gridview_columns_widget = $layout;
3689 3689
 				$layout                  = $listing_view_exp[0];
3690 3690
 			} else {
@@ -3696,8 +3696,8 @@  discard block
 block discarded – undo
3696 3696
 			 *
3697 3697
 			 * @since 1.0.0
3698 3698
 			 */
3699
-			$template = apply_filters( "geodir_template_part-widget-listing-listview", geodir_locate_template( 'widget-listing-listview' ) );
3700
-			if ( ! isset( $character_count ) ) {
3699
+			$template = apply_filters("geodir_template_part-widget-listing-listview", geodir_locate_template('widget-listing-listview'));
3700
+			if (!isset($character_count)) {
3701 3701
 				/**
3702 3702
 				 * Filter the widget's excerpt character count.
3703 3703
 				 *
@@ -3705,7 +3705,7 @@  discard block
 block discarded – undo
3705 3705
 				 *
3706 3706
 				 * @param int $instance ['character_count'] Excerpt character count.
3707 3707
 				 */
3708
-				$character_count = $character_count == '' ? 50 : apply_filters( 'widget_character_count', $character_count );
3708
+				$character_count = $character_count == '' ? 50 : apply_filters('widget_character_count', $character_count);
3709 3709
 			}
3710 3710
 
3711 3711
 			global $post, $map_jason, $map_canvas_arr;
@@ -3720,13 +3720,13 @@  discard block
 block discarded – undo
3720 3720
 			 *
3721 3721
 			 * @since 1.0.0
3722 3722
 			 */
3723
-			include( $template );
3723
+			include($template);
3724 3724
 
3725 3725
 			$geodir_is_widget_listing = false;
3726 3726
 
3727 3727
 			$GLOBALS['post'] = $current_post;
3728
-			if ( ! empty( $current_post ) ) {
3729
-				setup_postdata( $current_post );
3728
+			if (!empty($current_post)) {
3729
+				setup_postdata($current_post);
3730 3730
 			}
3731 3731
 			$map_jason      = $current_map_jason;
3732 3732
 			$map_canvas_arr = $current_map_canvas_arr;
@@ -3757,12 +3757,12 @@  discard block
 block discarded – undo
3757 3757
  *
3758 3758
  * @return int Reviews count.
3759 3759
  */
3760
-function geodir_count_reviews_by_term_id( $term_id, $taxonomy, $post_type ) {
3760
+function geodir_count_reviews_by_term_id($term_id, $taxonomy, $post_type) {
3761 3761
 	global $wpdb, $plugin_prefix;
3762 3762
 
3763
-	$detail_table = $plugin_prefix . $post_type . '_detail';
3763
+	$detail_table = $plugin_prefix.$post_type.'_detail';
3764 3764
 
3765
-	$sql = "SELECT COALESCE(SUM(rating_count),0) FROM " . $detail_table . " WHERE post_status = 'publish' AND rating_count > 0 AND FIND_IN_SET(" . $term_id . ", " . $taxonomy . ")";
3765
+	$sql = "SELECT COALESCE(SUM(rating_count),0) FROM ".$detail_table." WHERE post_status = 'publish' AND rating_count > 0 AND FIND_IN_SET(".$term_id.", ".$taxonomy.")";
3766 3766
 
3767 3767
 	/**
3768 3768
 	 * Filter count review sql query.
@@ -3774,9 +3774,9 @@  discard block
 block discarded – undo
3774 3774
 	 * @param int $taxonomy     The taxonomy Id.
3775 3775
 	 * @param string $post_type The post type.
3776 3776
 	 */
3777
-	$sql = apply_filters( 'geodir_count_reviews_by_term_sql', $sql, $term_id, $taxonomy, $post_type );
3777
+	$sql = apply_filters('geodir_count_reviews_by_term_sql', $sql, $term_id, $taxonomy, $post_type);
3778 3778
 
3779
-	$count = $wpdb->get_var( $sql );
3779
+	$count = $wpdb->get_var($sql);
3780 3780
 
3781 3781
 	return $count;
3782 3782
 }
@@ -3794,7 +3794,7 @@  discard block
 block discarded – undo
3794 3794
  *
3795 3795
  * @return array Term array data.
3796 3796
  */
3797
-function geodir_count_reviews_by_terms( $force_update = false, $post_ID = 0 ) {
3797
+function geodir_count_reviews_by_terms($force_update = false, $post_ID = 0) {
3798 3798
 	/**
3799 3799
 	 * Filter review count option data.
3800 3800
 	 *
@@ -3804,78 +3804,78 @@  discard block
 block discarded – undo
3804 3804
 	 * @param bool $force_update Force update option value?. Default.false.
3805 3805
 	 * @param int $post_ID       The post id to update if any.
3806 3806
 	 */
3807
-	$option_data = apply_filters( 'geodir_count_reviews_by_terms_before', '', $force_update, $post_ID );
3808
-	if ( ! empty( $option_data ) ) {
3807
+	$option_data = apply_filters('geodir_count_reviews_by_terms_before', '', $force_update, $post_ID);
3808
+	if (!empty($option_data)) {
3809 3809
 		return $option_data;
3810 3810
 	}
3811 3811
 
3812
-	$option_data = get_option( 'geodir_global_review_count' );
3812
+	$option_data = get_option('geodir_global_review_count');
3813 3813
 
3814
-	if ( ! $option_data || $force_update ) {
3815
-		if ( (int) $post_ID > 0 ) { // Update reviews count for specific post categories only.
3814
+	if (!$option_data || $force_update) {
3815
+		if ((int) $post_ID > 0) { // Update reviews count for specific post categories only.
3816 3816
 			global $gd_session;
3817 3817
 			$term_array = (array) $option_data;
3818
-			$post_type  = get_post_type( $post_ID );
3819
-			$taxonomy   = $post_type . 'category';
3820
-			$terms      = wp_get_object_terms( $post_ID, $taxonomy, array( 'fields' => 'ids' ) );
3821
-
3822
-			if ( ! empty( $terms ) && ! is_wp_error( $terms ) ) {
3823
-				foreach ( $terms as $term_id ) {
3824
-					$count                  = geodir_count_reviews_by_term_id( $term_id, $taxonomy, $post_type );
3825
-					$children               = get_term_children( $term_id, $taxonomy );
3826
-					$term_array[ $term_id ] = $count;
3818
+			$post_type  = get_post_type($post_ID);
3819
+			$taxonomy   = $post_type.'category';
3820
+			$terms      = wp_get_object_terms($post_ID, $taxonomy, array('fields' => 'ids'));
3821
+
3822
+			if (!empty($terms) && !is_wp_error($terms)) {
3823
+				foreach ($terms as $term_id) {
3824
+					$count                  = geodir_count_reviews_by_term_id($term_id, $taxonomy, $post_type);
3825
+					$children               = get_term_children($term_id, $taxonomy);
3826
+					$term_array[$term_id] = $count;
3827 3827
 				}
3828 3828
 			}
3829 3829
 
3830
-			$session_listing = $gd_session->get( 'listing' );
3830
+			$session_listing = $gd_session->get('listing');
3831 3831
 
3832 3832
 			$terms = array();
3833
-			if ( isset( $_POST['post_category'][ $taxonomy ] ) ) {
3834
-				$terms = (array) $_POST['post_category'][ $taxonomy ];
3835
-			} else if ( ! empty( $session_listing ) && isset( $session_listing['post_category'][ $taxonomy ] ) ) {
3836
-				$terms = (array) $session_listing['post_category'][ $taxonomy ];
3833
+			if (isset($_POST['post_category'][$taxonomy])) {
3834
+				$terms = (array) $_POST['post_category'][$taxonomy];
3835
+			} else if (!empty($session_listing) && isset($session_listing['post_category'][$taxonomy])) {
3836
+				$terms = (array) $session_listing['post_category'][$taxonomy];
3837 3837
 			}
3838 3838
 
3839
-			if ( ! empty( $terms ) ) {
3840
-				foreach ( $terms as $term_id ) {
3841
-					if ( $term_id > 0 ) {
3842
-						$count                  = geodir_count_reviews_by_term_id( $term_id, $taxonomy, $post_type );
3843
-						$children               = get_term_children( $term_id, $taxonomy );
3844
-						$term_array[ $term_id ] = $count;
3839
+			if (!empty($terms)) {
3840
+				foreach ($terms as $term_id) {
3841
+					if ($term_id > 0) {
3842
+						$count                  = geodir_count_reviews_by_term_id($term_id, $taxonomy, $post_type);
3843
+						$children               = get_term_children($term_id, $taxonomy);
3844
+						$term_array[$term_id] = $count;
3845 3845
 					}
3846 3846
 				}
3847 3847
 			}
3848 3848
 		} else { // Update reviews count for all post categories.
3849 3849
 			$term_array = array();
3850 3850
 			$post_types = geodir_get_posttypes();
3851
-			foreach ( $post_types as $post_type ) {
3851
+			foreach ($post_types as $post_type) {
3852 3852
 
3853
-				$taxonomy = geodir_get_taxonomies( $post_type );
3853
+				$taxonomy = geodir_get_taxonomies($post_type);
3854 3854
 				$taxonomy = $taxonomy[0];
3855 3855
 
3856 3856
 				$args = array(
3857 3857
 					'hide_empty' => false
3858 3858
 				);
3859 3859
 
3860
-				$terms = get_terms( $taxonomy, $args );
3860
+				$terms = get_terms($taxonomy, $args);
3861 3861
 
3862
-				foreach ( $terms as $term ) {
3863
-					$count    = geodir_count_reviews_by_term_id( $term->term_id, $taxonomy, $post_type );
3864
-					$children = get_term_children( $term->term_id, $taxonomy );
3862
+				foreach ($terms as $term) {
3863
+					$count    = geodir_count_reviews_by_term_id($term->term_id, $taxonomy, $post_type);
3864
+					$children = get_term_children($term->term_id, $taxonomy);
3865 3865
 					/*if ( is_array( $children ) ) {
3866 3866
                         foreach ( $children as $child_id ) {
3867 3867
                             $child_count = geodir_count_reviews_by_term_id($child_id, $taxonomy, $post_type);
3868 3868
                             $count = $count + $child_count;
3869 3869
                         }
3870 3870
                     }*/
3871
-					$term_array[ $term->term_id ] = $count;
3871
+					$term_array[$term->term_id] = $count;
3872 3872
 				}
3873 3873
 			}
3874 3874
 		}
3875 3875
 
3876
-		update_option( 'geodir_global_review_count', $term_array );
3876
+		update_option('geodir_global_review_count', $term_array);
3877 3877
 		//clear cache
3878
-		wp_cache_delete( 'geodir_global_review_count' );
3878
+		wp_cache_delete('geodir_global_review_count');
3879 3879
 
3880 3880
 		return $term_array;
3881 3881
 	} else {
@@ -3891,39 +3891,39 @@  discard block
 block discarded – undo
3891 3891
  * @package GeoDirectory
3892 3892
  * @return bool
3893 3893
  */
3894
-function geodir_term_review_count_force_update( $new_status, $old_status = '', $post = '' ) {
3895
-	if ( isset( $_REQUEST['action'] ) && $_REQUEST['action'] == 'geodir_import_export' ) {
3894
+function geodir_term_review_count_force_update($new_status, $old_status = '', $post = '') {
3895
+	if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'geodir_import_export') {
3896 3896
 		return; // do not run if importing listings
3897 3897
 	}
3898 3898
 
3899
-	if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
3899
+	if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
3900 3900
 		return;
3901 3901
 	}
3902 3902
 
3903 3903
 	$post_ID = 0;
3904
-	if ( ! empty( $post ) ) {
3905
-		if ( isset( $post->post_type ) && strpos( $post->post_type, 'gd_' ) !== 0 ) {
3904
+	if (!empty($post)) {
3905
+		if (isset($post->post_type) && strpos($post->post_type, 'gd_') !== 0) {
3906 3906
 			return;
3907 3907
 		}
3908 3908
 
3909
-		if ( $new_status == 'auto-draft' && $old_status == 'new' ) {
3909
+		if ($new_status == 'auto-draft' && $old_status == 'new') {
3910 3910
 			return;
3911 3911
 		}
3912 3912
 
3913
-		if ( ! empty( $post->ID ) ) {
3913
+		if (!empty($post->ID)) {
3914 3914
 			$post_ID = $post->ID;
3915 3915
 		}
3916 3916
 	}
3917 3917
 
3918
-	if ( $new_status != $old_status ) {
3919
-		geodir_count_reviews_by_terms( true, $post_ID );
3918
+	if ($new_status != $old_status) {
3919
+		geodir_count_reviews_by_terms(true, $post_ID);
3920 3920
 	}
3921 3921
 
3922 3922
 	return true;
3923 3923
 }
3924 3924
 
3925
-function geodir_term_review_count_force_update_single_post( $post_id ) {
3926
-	geodir_count_reviews_by_terms( true, $post_id );
3925
+function geodir_term_review_count_force_update_single_post($post_id) {
3926
+	geodir_count_reviews_by_terms(true, $post_id);
3927 3927
 }
3928 3928
 
3929 3929
 /*-----------------------------------------------------------------------------------*/
@@ -3940,11 +3940,11 @@  discard block
 block discarded – undo
3940 3940
  *
3941 3941
  * @return int Post count.
3942 3942
  */
3943
-function geodir_count_posts_by_term( $data, $term ) {
3943
+function geodir_count_posts_by_term($data, $term) {
3944 3944
 
3945
-	if ( $data ) {
3946
-		if ( isset( $data[ $term->term_id ] ) ) {
3947
-			return $data[ $term->term_id ];
3945
+	if ($data) {
3946
+		if (isset($data[$term->term_id])) {
3947
+			return $data[$term->term_id];
3948 3948
 		} else {
3949 3949
 			return 0;
3950 3950
 		}
@@ -3961,8 +3961,8 @@  discard block
 block discarded – undo
3961 3961
  * param array $terms An array of term objects.
3962 3962
  * @return array Sorted terms array.
3963 3963
  */
3964
-function geodir_sort_terms_by_count( $terms ) {
3965
-	usort( $terms, "geodir_sort_by_count_obj" );
3964
+function geodir_sort_terms_by_count($terms) {
3965
+	usort($terms, "geodir_sort_by_count_obj");
3966 3966
 
3967 3967
 	return $terms;
3968 3968
 }
@@ -3977,8 +3977,8 @@  discard block
 block discarded – undo
3977 3977
  *
3978 3978
  * @return array Sorted terms array.
3979 3979
  */
3980
-function geodir_sort_terms_by_review_count( $terms ) {
3981
-	usort( $terms, "geodir_sort_by_review_count_obj" );
3980
+function geodir_sort_terms_by_review_count($terms) {
3981
+	usort($terms, "geodir_sort_by_review_count_obj");
3982 3982
 
3983 3983
 	return $terms;
3984 3984
 }
@@ -3994,12 +3994,12 @@  discard block
 block discarded – undo
3994 3994
  *
3995 3995
  * @return array Sorted terms array.
3996 3996
  */
3997
-function geodir_sort_terms( $terms, $sort = 'count' ) {
3998
-	if ( $sort == 'count' ) {
3999
-		return geodir_sort_terms_by_count( $terms );
3997
+function geodir_sort_terms($terms, $sort = 'count') {
3998
+	if ($sort == 'count') {
3999
+		return geodir_sort_terms_by_count($terms);
4000 4000
 	}
4001
-	if ( $sort == 'review_count' ) {
4002
-		return geodir_sort_terms_by_review_count( $terms );
4001
+	if ($sort == 'review_count') {
4002
+		return geodir_sort_terms_by_review_count($terms);
4003 4003
 	}
4004 4004
 }
4005 4005
 
@@ -4017,7 +4017,7 @@  discard block
 block discarded – undo
4017 4017
  *
4018 4018
  * @return bool
4019 4019
  */
4020
-function geodir_sort_by_count( $a, $b ) {
4020
+function geodir_sort_by_count($a, $b) {
4021 4021
 	return $a['count'] < $b['count'];
4022 4022
 }
4023 4023
 
@@ -4032,7 +4032,7 @@  discard block
 block discarded – undo
4032 4032
  *
4033 4033
  * @return bool
4034 4034
  */
4035
-function geodir_sort_by_count_obj( $a, $b ) {
4035
+function geodir_sort_by_count_obj($a, $b) {
4036 4036
 	return $a->count < $b->count;
4037 4037
 }
4038 4038
 
@@ -4047,7 +4047,7 @@  discard block
 block discarded – undo
4047 4047
  *
4048 4048
  * @return bool
4049 4049
  */
4050
-function geodir_sort_by_review_count_obj( $a, $b ) {
4050
+function geodir_sort_by_review_count_obj($a, $b) {
4051 4051
 	return $a->review_count < $b->review_count;
4052 4052
 }
4053 4053
 
@@ -4064,35 +4064,35 @@  discard block
 block discarded – undo
4064 4064
 	 * @since   1.4.2
4065 4065
 	 * @package GeoDirectory
4066 4066
 	 */
4067
-	$locale = apply_filters( 'plugin_locale', get_locale(), 'geodirectory' );
4067
+	$locale = apply_filters('plugin_locale', get_locale(), 'geodirectory');
4068 4068
 
4069
-	load_textdomain( 'geodirectory', WP_LANG_DIR . '/' . 'geodirectory' . '/' . 'geodirectory' . '-' . $locale . '.mo' );
4070
-	load_plugin_textdomain( 'geodirectory', false, plugin_basename( dirname( dirname( __FILE__ ) ) ) . '/geodirectory-languages' );
4069
+	load_textdomain('geodirectory', WP_LANG_DIR.'/'.'geodirectory'.'/'.'geodirectory'.'-'.$locale.'.mo');
4070
+	load_plugin_textdomain('geodirectory', false, plugin_basename(dirname(dirname(__FILE__))).'/geodirectory-languages');
4071 4071
 
4072 4072
 	/**
4073 4073
 	 * Define language constants.
4074 4074
 	 *
4075 4075
 	 * @since 1.0.0
4076 4076
 	 */
4077
-	require_once( geodir_plugin_path() . '/language.php' );
4077
+	require_once(geodir_plugin_path().'/language.php');
4078 4078
 
4079
-	$language_file = geodir_plugin_path() . '/db-language.php';
4079
+	$language_file = geodir_plugin_path().'/db-language.php';
4080 4080
 
4081 4081
 	// Load language string file if not created yet
4082
-	if ( ! file_exists( $language_file ) ) {
4082
+	if (!file_exists($language_file)) {
4083 4083
 		geodirectory_load_db_language();
4084 4084
 	}
4085 4085
 
4086
-	if ( file_exists( $language_file ) ) {
4086
+	if (file_exists($language_file)) {
4087 4087
 		/**
4088 4088
 		 * Language strings from database.
4089 4089
 		 *
4090 4090
 		 * @since 1.4.2
4091 4091
 		 */
4092 4092
 		try {
4093
-			require_once( $language_file );
4094
-		} catch ( Exception $e ) {
4095
-			error_log( 'Language Error: ' . $e->getMessage() );
4093
+			require_once($language_file);
4094
+		} catch (Exception $e) {
4095
+			error_log('Language Error: '.$e->getMessage());
4096 4096
 		}
4097 4097
 	}
4098 4098
 }
@@ -4109,19 +4109,19 @@  discard block
 block discarded – undo
4109 4109
  */
4110 4110
 function geodirectory_load_db_language() {
4111 4111
 	global $wp_filesystem;
4112
-	if ( empty( $wp_filesystem ) ) {
4113
-		require_once( ABSPATH . '/wp-admin/includes/file.php' );
4112
+	if (empty($wp_filesystem)) {
4113
+		require_once(ABSPATH.'/wp-admin/includes/file.php');
4114 4114
 		WP_Filesystem();
4115 4115
 		global $wp_filesystem;
4116 4116
 	}
4117 4117
 
4118
-	$language_file = geodir_plugin_path() . '/db-language.php';
4118
+	$language_file = geodir_plugin_path().'/db-language.php';
4119 4119
 
4120
-	if ( is_file( $language_file ) && ! is_writable( $language_file ) ) {
4120
+	if (is_file($language_file) && !is_writable($language_file)) {
4121 4121
 		return false;
4122 4122
 	} // Not possible to create.
4123 4123
 
4124
-	if ( ! is_file( $language_file ) && ! is_writable( dirname( $language_file ) ) ) {
4124
+	if (!is_file($language_file) && !is_writable(dirname($language_file))) {
4125 4125
 		return false;
4126 4126
 	} // Not possible to create.
4127 4127
 
@@ -4134,9 +4134,9 @@  discard block
 block discarded – undo
4134 4134
 	 *
4135 4135
 	 * @param array $contents_strings Array of strings.
4136 4136
 	 */
4137
-	$contents_strings = apply_filters( 'geodir_load_db_language', $contents_strings );
4137
+	$contents_strings = apply_filters('geodir_load_db_language', $contents_strings);
4138 4138
 
4139
-	$contents_strings = array_unique( $contents_strings );
4139
+	$contents_strings = array_unique($contents_strings);
4140 4140
 
4141 4141
 	$contents_head   = array();
4142 4142
 	$contents_head[] = "<?php";
@@ -4153,20 +4153,20 @@  discard block
 block discarded – undo
4153 4153
 	$contents_foot[] = "";
4154 4154
 	$contents_foot[] = "";
4155 4155
 
4156
-	$contents = implode( PHP_EOL, $contents_head );
4156
+	$contents = implode(PHP_EOL, $contents_head);
4157 4157
 
4158
-	if ( ! empty( $contents_strings ) ) {
4159
-		foreach ( $contents_strings as $string ) {
4160
-			if ( is_scalar( $string ) && $string != '' ) {
4161
-				$string = str_replace( "'", "\'", $string );
4162
-				$contents .= PHP_EOL . "__('" . $string . "', 'geodirectory');";
4158
+	if (!empty($contents_strings)) {
4159
+		foreach ($contents_strings as $string) {
4160
+			if (is_scalar($string) && $string != '') {
4161
+				$string = str_replace("'", "\'", $string);
4162
+				$contents .= PHP_EOL."__('".$string."', 'geodirectory');";
4163 4163
 			}
4164 4164
 		}
4165 4165
 	}
4166 4166
 
4167
-	$contents .= implode( PHP_EOL, $contents_foot );
4167
+	$contents .= implode(PHP_EOL, $contents_foot);
4168 4168
 
4169
-	if ( $wp_filesystem->put_contents( $language_file, $contents, FS_CHMOD_FILE ) ) {
4169
+	if ($wp_filesystem->put_contents($language_file, $contents, FS_CHMOD_FILE)) {
4170 4170
 		return false;
4171 4171
 	} // Failure; could not write file.
4172 4172
 
@@ -4186,45 +4186,45 @@  discard block
 block discarded – undo
4186 4186
  *
4187 4187
  * @return array Translation texts.
4188 4188
  */
4189
-function geodir_load_custom_field_translation( $translation_texts = array() ) {
4189
+function geodir_load_custom_field_translation($translation_texts = array()) {
4190 4190
 	global $wpdb;
4191 4191
 
4192 4192
 	// Custom fields table
4193
-	$sql  = "SELECT admin_title, admin_desc, site_title, clabels, required_msg, default_value, option_values FROM " . GEODIR_CUSTOM_FIELDS_TABLE;
4194
-	$rows = $wpdb->get_results( $sql );
4193
+	$sql  = "SELECT admin_title, admin_desc, site_title, clabels, required_msg, default_value, option_values FROM ".GEODIR_CUSTOM_FIELDS_TABLE;
4194
+	$rows = $wpdb->get_results($sql);
4195 4195
 
4196
-	if ( ! empty( $rows ) ) {
4197
-		foreach ( $rows as $row ) {
4198
-			if ( ! empty( $row->admin_title ) ) {
4199
-				$translation_texts[] = stripslashes_deep( $row->admin_title );
4196
+	if (!empty($rows)) {
4197
+		foreach ($rows as $row) {
4198
+			if (!empty($row->admin_title)) {
4199
+				$translation_texts[] = stripslashes_deep($row->admin_title);
4200 4200
 			}
4201 4201
 
4202
-			if ( ! empty( $row->admin_desc ) ) {
4203
-				$translation_texts[] = stripslashes_deep( $row->admin_desc );
4202
+			if (!empty($row->admin_desc)) {
4203
+				$translation_texts[] = stripslashes_deep($row->admin_desc);
4204 4204
 			}
4205 4205
 
4206
-			if ( ! empty( $row->site_title ) ) {
4207
-				$translation_texts[] = stripslashes_deep( $row->site_title );
4206
+			if (!empty($row->site_title)) {
4207
+				$translation_texts[] = stripslashes_deep($row->site_title);
4208 4208
 			}
4209 4209
 
4210
-			if ( ! empty( $row->clabels ) ) {
4211
-				$translation_texts[] = stripslashes_deep( $row->clabels );
4210
+			if (!empty($row->clabels)) {
4211
+				$translation_texts[] = stripslashes_deep($row->clabels);
4212 4212
 			}
4213 4213
 
4214
-			if ( ! empty( $row->required_msg ) ) {
4215
-				$translation_texts[] = stripslashes_deep( $row->required_msg );
4214
+			if (!empty($row->required_msg)) {
4215
+				$translation_texts[] = stripslashes_deep($row->required_msg);
4216 4216
 			}
4217 4217
 
4218
-			if ( ! empty( $row->default_value ) ) {
4219
-				$translation_texts[] = stripslashes_deep( $row->default_value );
4218
+			if (!empty($row->default_value)) {
4219
+				$translation_texts[] = stripslashes_deep($row->default_value);
4220 4220
 			}
4221 4221
 
4222
-			if ( ! empty( $row->option_values ) ) {
4223
-				$option_values = geodir_string_values_to_options( stripslashes_deep( $row->option_values ) );
4222
+			if (!empty($row->option_values)) {
4223
+				$option_values = geodir_string_values_to_options(stripslashes_deep($row->option_values));
4224 4224
 
4225
-				if ( ! empty( $option_values ) ) {
4226
-					foreach ( $option_values as $option_value ) {
4227
-						if ( ! empty( $option_value['label'] ) ) {
4225
+				if (!empty($option_values)) {
4226
+					foreach ($option_values as $option_value) {
4227
+						if (!empty($option_value['label'])) {
4228 4228
 							$translation_texts[] = $option_value['label'];
4229 4229
 						}
4230 4230
 					}
@@ -4234,48 +4234,48 @@  discard block
 block discarded – undo
4234 4234
 	}
4235 4235
 
4236 4236
 	// Custom sorting fields table
4237
-	$sql  = "SELECT site_title, asc_title, desc_title FROM " . GEODIR_CUSTOM_SORT_FIELDS_TABLE;
4238
-	$rows = $wpdb->get_results( $sql );
4237
+	$sql  = "SELECT site_title, asc_title, desc_title FROM ".GEODIR_CUSTOM_SORT_FIELDS_TABLE;
4238
+	$rows = $wpdb->get_results($sql);
4239 4239
 
4240
-	if ( ! empty( $rows ) ) {
4241
-		foreach ( $rows as $row ) {
4242
-			if ( ! empty( $row->site_title ) ) {
4243
-				$translation_texts[] = stripslashes_deep( $row->site_title );
4240
+	if (!empty($rows)) {
4241
+		foreach ($rows as $row) {
4242
+			if (!empty($row->site_title)) {
4243
+				$translation_texts[] = stripslashes_deep($row->site_title);
4244 4244
 			}
4245 4245
 
4246
-			if ( ! empty( $row->asc_title ) ) {
4247
-				$translation_texts[] = stripslashes_deep( $row->asc_title );
4246
+			if (!empty($row->asc_title)) {
4247
+				$translation_texts[] = stripslashes_deep($row->asc_title);
4248 4248
 			}
4249 4249
 
4250
-			if ( ! empty( $row->desc_title ) ) {
4251
-				$translation_texts[] = stripslashes_deep( $row->desc_title );
4250
+			if (!empty($row->desc_title)) {
4251
+				$translation_texts[] = stripslashes_deep($row->desc_title);
4252 4252
 			}
4253 4253
 		}
4254 4254
 	}
4255 4255
 
4256 4256
 	// Advance search filter fields table
4257
-	if ( defined( 'GEODIR_ADVANCE_SEARCH_TABLE' ) ) {
4258
-		$sql  = "SELECT field_site_name, front_search_title, field_desc FROM " . GEODIR_ADVANCE_SEARCH_TABLE;
4259
-		$rows = $wpdb->get_results( $sql );
4260
-
4261
-		if ( ! empty( $rows ) ) {
4262
-			foreach ( $rows as $row ) {
4263
-				if ( ! empty( $row->field_site_name ) ) {
4264
-					$translation_texts[] = stripslashes_deep( $row->field_site_name );
4257
+	if (defined('GEODIR_ADVANCE_SEARCH_TABLE')) {
4258
+		$sql  = "SELECT field_site_name, front_search_title, field_desc FROM ".GEODIR_ADVANCE_SEARCH_TABLE;
4259
+		$rows = $wpdb->get_results($sql);
4260
+
4261
+		if (!empty($rows)) {
4262
+			foreach ($rows as $row) {
4263
+				if (!empty($row->field_site_name)) {
4264
+					$translation_texts[] = stripslashes_deep($row->field_site_name);
4265 4265
 				}
4266 4266
 
4267
-				if ( ! empty( $row->front_search_title ) ) {
4268
-					$translation_texts[] = stripslashes_deep( $row->front_search_title );
4267
+				if (!empty($row->front_search_title)) {
4268
+					$translation_texts[] = stripslashes_deep($row->front_search_title);
4269 4269
 				}
4270 4270
 
4271
-				if ( ! empty( $row->field_desc ) ) {
4272
-					$translation_texts[] = stripslashes_deep( $row->field_desc );
4271
+				if (!empty($row->field_desc)) {
4272
+					$translation_texts[] = stripslashes_deep($row->field_desc);
4273 4273
 				}
4274 4274
 			}
4275 4275
 		}
4276 4276
 	}
4277 4277
 
4278
-	$translation_texts = ! empty( $translation_texts ) ? array_unique( $translation_texts ) : $translation_texts;
4278
+	$translation_texts = !empty($translation_texts) ? array_unique($translation_texts) : $translation_texts;
4279 4279
 
4280 4280
 	return $translation_texts;
4281 4281
 }
@@ -4297,7 +4297,7 @@  discard block
 block discarded – undo
4297 4297
 	 *
4298 4298
 	 * @param array $geodir_allowed_mime_types and file extensions.
4299 4299
 	 */
4300
-	return apply_filters( 'geodir_allowed_mime_types', array(
4300
+	return apply_filters('geodir_allowed_mime_types', array(
4301 4301
 			'Image'       => array( // Image formats.
4302 4302
 				'jpg'  => 'image/jpeg',
4303 4303
 				'jpe'  => 'image/jpeg',
@@ -4365,18 +4365,18 @@  discard block
 block discarded – undo
4365 4365
  *
4366 4366
  * @return string User display name.
4367 4367
  */
4368
-function geodir_get_client_name( $user_id ) {
4368
+function geodir_get_client_name($user_id) {
4369 4369
 	$client_name = '';
4370 4370
 
4371
-	$user_data = get_userdata( $user_id );
4371
+	$user_data = get_userdata($user_id);
4372 4372
 
4373
-	if ( ! empty( $user_data ) ) {
4374
-		if ( isset( $user_data->display_name ) && trim( $user_data->display_name ) != '' ) {
4375
-			$client_name = trim( $user_data->display_name );
4376
-		} else if ( isset( $user_data->user_nicename ) && trim( $user_data->user_nicename ) != '' ) {
4377
-			$client_name = trim( $user_data->user_nicename );
4373
+	if (!empty($user_data)) {
4374
+		if (isset($user_data->display_name) && trim($user_data->display_name) != '') {
4375
+			$client_name = trim($user_data->display_name);
4376
+		} else if (isset($user_data->user_nicename) && trim($user_data->user_nicename) != '') {
4377
+			$client_name = trim($user_data->user_nicename);
4378 4378
 		} else {
4379
-			$client_name = trim( $user_data->user_login );
4379
+			$client_name = trim($user_data->user_login);
4380 4380
 		}
4381 4381
 	}
4382 4382
 
@@ -4384,19 +4384,19 @@  discard block
 block discarded – undo
4384 4384
 }
4385 4385
 
4386 4386
 
4387
-add_filter( 'wpseo_replacements', 'geodir_wpseo_replacements', 10, 1 );
4387
+add_filter('wpseo_replacements', 'geodir_wpseo_replacements', 10, 1);
4388 4388
 /*
4389 4389
  * Add location variables to wpseo replacements.
4390 4390
  *
4391 4391
  * @since 1.5.4
4392 4392
  */
4393
-function geodir_wpseo_replacements( $vars ) {
4393
+function geodir_wpseo_replacements($vars) {
4394 4394
 
4395 4395
 	global $wp;
4396 4396
 	$title = '';
4397 4397
 	// location variables
4398 4398
 	$gd_post_type   = geodir_get_current_posttype();
4399
-	$location_array = geodir_get_current_location_terms( 'query_vars', $gd_post_type );
4399
+	$location_array = geodir_get_current_location_terms('query_vars', $gd_post_type);
4400 4400
 	/**
4401 4401
 	 * Filter the title variables location variables array
4402 4402
 	 *
@@ -4406,105 +4406,105 @@  discard block
 block discarded – undo
4406 4406
 	 * @param array $location_array The array of location variables.
4407 4407
 	 * @param array $vars           The page title variables.
4408 4408
 	 */
4409
-	$location_array  = apply_filters( 'geodir_filter_title_variables_location_arr_seo', $location_array, $vars );
4409
+	$location_array  = apply_filters('geodir_filter_title_variables_location_arr_seo', $location_array, $vars);
4410 4410
 	$location_titles = array();
4411
-	if ( get_query_var( 'gd_country_full' ) ) {
4412
-		if ( get_query_var( 'gd_country_full' ) ) {
4413
-			$location_array['gd_country'] = get_query_var( 'gd_country_full' );
4411
+	if (get_query_var('gd_country_full')) {
4412
+		if (get_query_var('gd_country_full')) {
4413
+			$location_array['gd_country'] = get_query_var('gd_country_full');
4414 4414
 		}
4415
-		if ( get_query_var( 'gd_region_full' ) ) {
4416
-			$location_array['gd_region'] = get_query_var( 'gd_region_full' );
4415
+		if (get_query_var('gd_region_full')) {
4416
+			$location_array['gd_region'] = get_query_var('gd_region_full');
4417 4417
 		}
4418
-		if ( get_query_var( 'gd_city_full' ) ) {
4419
-			$location_array['gd_city'] = get_query_var( 'gd_city_full' );
4418
+		if (get_query_var('gd_city_full')) {
4419
+			$location_array['gd_city'] = get_query_var('gd_city_full');
4420 4420
 		}
4421 4421
 	}
4422 4422
 	$location_single = '';
4423
-	$gd_country      = ( isset( $wp->query_vars['gd_country'] ) && $wp->query_vars['gd_country'] != '' ) ? $wp->query_vars['gd_country'] : '';
4424
-	$gd_region       = ( isset( $wp->query_vars['gd_region'] ) && $wp->query_vars['gd_region'] != '' ) ? $wp->query_vars['gd_region'] : '';
4425
-	$gd_city         = ( isset( $wp->query_vars['gd_city'] ) && $wp->query_vars['gd_city'] != '' ) ? $wp->query_vars['gd_city'] : '';
4423
+	$gd_country      = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : '';
4424
+	$gd_region       = (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') ? $wp->query_vars['gd_region'] : '';
4425
+	$gd_city         = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : '';
4426 4426
 
4427 4427
 	$gd_country_actual = $gd_region_actual = $gd_city_actual = '';
4428 4428
 
4429
-	if ( function_exists( 'get_actual_location_name' ) ) {
4430
-		$gd_country_actual = $gd_country != '' ? get_actual_location_name( 'country', $gd_country, true ) : $gd_country;
4431
-		$gd_region_actual  = $gd_region != '' ? get_actual_location_name( 'region', $gd_region ) : $gd_region;
4432
-		$gd_city_actual    = $gd_city != '' ? get_actual_location_name( 'city', $gd_city ) : $gd_city;
4429
+	if (function_exists('get_actual_location_name')) {
4430
+		$gd_country_actual = $gd_country != '' ? get_actual_location_name('country', $gd_country, true) : $gd_country;
4431
+		$gd_region_actual  = $gd_region != '' ? get_actual_location_name('region', $gd_region) : $gd_region;
4432
+		$gd_city_actual    = $gd_city != '' ? get_actual_location_name('city', $gd_city) : $gd_city;
4433 4433
 	}
4434 4434
 
4435
-	if ( $gd_city != '' ) {
4436
-		if ( $gd_city_actual != '' ) {
4435
+	if ($gd_city != '') {
4436
+		if ($gd_city_actual != '') {
4437 4437
 			$gd_city = $gd_city_actual;
4438 4438
 		} else {
4439
-			$gd_city = preg_replace( '/-(\d+)$/', '', $gd_city );
4440
-			$gd_city = preg_replace( '/[_-]/', ' ', $gd_city );
4441
-			$gd_city = __( geodir_ucwords( $gd_city ), 'geodirectory' );
4439
+			$gd_city = preg_replace('/-(\d+)$/', '', $gd_city);
4440
+			$gd_city = preg_replace('/[_-]/', ' ', $gd_city);
4441
+			$gd_city = __(geodir_ucwords($gd_city), 'geodirectory');
4442 4442
 		}
4443 4443
 		$location_single = $gd_city;
4444 4444
 
4445
-	} else if ( $gd_region != '' ) {
4446
-		if ( $gd_region_actual != '' ) {
4445
+	} else if ($gd_region != '') {
4446
+		if ($gd_region_actual != '') {
4447 4447
 			$gd_region = $gd_region_actual;
4448 4448
 		} else {
4449
-			$gd_region = preg_replace( '/-(\d+)$/', '', $gd_region );
4450
-			$gd_region = preg_replace( '/[_-]/', ' ', $gd_region );
4451
-			$gd_region = __( geodir_ucwords( $gd_region ), 'geodirectory' );
4449
+			$gd_region = preg_replace('/-(\d+)$/', '', $gd_region);
4450
+			$gd_region = preg_replace('/[_-]/', ' ', $gd_region);
4451
+			$gd_region = __(geodir_ucwords($gd_region), 'geodirectory');
4452 4452
 		}
4453 4453
 
4454 4454
 		$location_single = $gd_region;
4455
-	} else if ( $gd_country != '' ) {
4456
-		if ( $gd_country_actual != '' ) {
4455
+	} else if ($gd_country != '') {
4456
+		if ($gd_country_actual != '') {
4457 4457
 			$gd_country = $gd_country_actual;
4458 4458
 		} else {
4459
-			$gd_country = preg_replace( '/-(\d+)$/', '', $gd_country );
4460
-			$gd_country = preg_replace( '/[_-]/', ' ', $gd_country );
4461
-			$gd_country = __( geodir_ucwords( $gd_country ), 'geodirectory' );
4459
+			$gd_country = preg_replace('/-(\d+)$/', '', $gd_country);
4460
+			$gd_country = preg_replace('/[_-]/', ' ', $gd_country);
4461
+			$gd_country = __(geodir_ucwords($gd_country), 'geodirectory');
4462 4462
 		}
4463 4463
 
4464 4464
 		$location_single = $gd_country;
4465 4465
 	}
4466 4466
 
4467
-	if ( ! empty( $location_array ) ) {
4467
+	if (!empty($location_array)) {
4468 4468
 
4469
-		$actual_location_name = function_exists( 'get_actual_location_name' ) ? true : false;
4470
-		$location_array       = array_reverse( $location_array );
4469
+		$actual_location_name = function_exists('get_actual_location_name') ? true : false;
4470
+		$location_array       = array_reverse($location_array);
4471 4471
 
4472
-		foreach ( $location_array as $location_type => $location ) {
4473
-			$gd_location_link_text = preg_replace( '/-(\d+)$/', '', $location );
4474
-			$gd_location_link_text = preg_replace( '/[_-]/', ' ', $gd_location_link_text );
4472
+		foreach ($location_array as $location_type => $location) {
4473
+			$gd_location_link_text = preg_replace('/-(\d+)$/', '', $location);
4474
+			$gd_location_link_text = preg_replace('/[_-]/', ' ', $gd_location_link_text);
4475 4475
 
4476
-			$location_name = geodir_ucwords( $gd_location_link_text );
4477
-			$location_name = __( $location_name, 'geodirectory' );
4476
+			$location_name = geodir_ucwords($gd_location_link_text);
4477
+			$location_name = __($location_name, 'geodirectory');
4478 4478
 
4479
-			if ( $actual_location_name ) {
4480
-				$location_type = strpos( $location_type, 'gd_' ) === 0 ? substr( $location_type, 3 ) : $location_type;
4481
-				$location_name = get_actual_location_name( $location_type, $location, true );
4479
+			if ($actual_location_name) {
4480
+				$location_type = strpos($location_type, 'gd_') === 0 ? substr($location_type, 3) : $location_type;
4481
+				$location_name = get_actual_location_name($location_type, $location, true);
4482 4482
 			}
4483 4483
 
4484 4484
 			$location_titles[] = $location_name;
4485 4485
 		}
4486
-		if ( ! empty( $location_titles ) ) {
4487
-			$location_titles = array_unique( $location_titles );
4486
+		if (!empty($location_titles)) {
4487
+			$location_titles = array_unique($location_titles);
4488 4488
 		}
4489 4489
 	}
4490 4490
 
4491 4491
 
4492
-	if ( ! empty( $location_titles ) ) {
4493
-		$vars['%%location%%'] = implode( ", ", $location_titles );
4492
+	if (!empty($location_titles)) {
4493
+		$vars['%%location%%'] = implode(", ", $location_titles);
4494 4494
 	}
4495 4495
 
4496 4496
 
4497
-	if ( ! empty( $location_titles ) ) {
4498
-		$vars['%%in_location%%'] = __( 'in ', 'geodirectory' ) . implode( ", ", $location_titles );
4497
+	if (!empty($location_titles)) {
4498
+		$vars['%%in_location%%'] = __('in ', 'geodirectory').implode(", ", $location_titles);
4499 4499
 	}
4500 4500
 
4501 4501
 
4502
-	if ( $location_single ) {
4503
-		$vars['%%in_location_single%%'] = __( 'in', 'geodirectory' ) . ' ' . $location_single;
4502
+	if ($location_single) {
4503
+		$vars['%%in_location_single%%'] = __('in', 'geodirectory').' '.$location_single;
4504 4504
 	}
4505 4505
 
4506 4506
 
4507
-	if ( $location_single ) {
4507
+	if ($location_single) {
4508 4508
 		$vars['%%location_single%%'] = $location_single;
4509 4509
 	}
4510 4510
 
@@ -4517,13 +4517,13 @@  discard block
 block discarded – undo
4517 4517
 	 * @param string $vars          The title with variables.
4518 4518
 	 * @param array $location_array The array of location variables.
4519 4519
 	 */
4520
-	return apply_filters( 'geodir_wpseo_replacements_vars', $vars, $location_array );
4520
+	return apply_filters('geodir_wpseo_replacements_vars', $vars, $location_array);
4521 4521
 }
4522 4522
 
4523 4523
 
4524
-add_filter( 'geodir_seo_meta_title', 'geodir_filter_title_variables', 10, 3 );
4525
-add_filter( 'geodir_seo_page_title', 'geodir_filter_title_variables', 10, 2 );
4526
-add_filter( 'geodir_seo_meta_description_pre', 'geodir_filter_title_variables', 10, 3 );
4524
+add_filter('geodir_seo_meta_title', 'geodir_filter_title_variables', 10, 3);
4525
+add_filter('geodir_seo_page_title', 'geodir_filter_title_variables', 10, 2);
4526
+add_filter('geodir_seo_meta_description_pre', 'geodir_filter_title_variables', 10, 3);
4527 4527
 
4528 4528
 /**
4529 4529
  * Filter the title variables.
@@ -4565,14 +4565,14 @@  discard block
 block discarded – undo
4565 4565
  *
4566 4566
  * @return string Title after filtered variables.
4567 4567
  */
4568
-function geodir_filter_title_variables( $title, $gd_page, $sep = '' ) {
4568
+function geodir_filter_title_variables($title, $gd_page, $sep = '') {
4569 4569
 	global $wp, $post;
4570 4570
 
4571
-	if ( ! $gd_page || ! $title ) {
4571
+	if (!$gd_page || !$title) {
4572 4572
 		return $title; // if no a GD page then bail.
4573 4573
 	}
4574 4574
 
4575
-	if ( $sep == '' ) {
4575
+	if ($sep == '') {
4576 4576
 		/**
4577 4577
 		 * Filter the page title separator.
4578 4578
 		 *
@@ -4581,100 +4581,100 @@  discard block
 block discarded – undo
4581 4581
 		 *
4582 4582
 		 * @param string $sep The separator, default: `|`.
4583 4583
 		 */
4584
-		$sep = apply_filters( 'geodir_page_title_separator', '|' );
4584
+		$sep = apply_filters('geodir_page_title_separator', '|');
4585 4585
 	}
4586 4586
 
4587
-	if ( strpos( $title, '%%title%%' ) !== false ) {
4588
-		$title = str_replace( "%%title%%", $post->post_title, $title );
4587
+	if (strpos($title, '%%title%%') !== false) {
4588
+		$title = str_replace("%%title%%", $post->post_title, $title);
4589 4589
 	}
4590 4590
 
4591
-	if ( strpos( $title, '%%sitename%%' ) !== false ) {
4592
-		$title = str_replace( "%%sitename%%", get_bloginfo( 'name' ), $title );
4591
+	if (strpos($title, '%%sitename%%') !== false) {
4592
+		$title = str_replace("%%sitename%%", get_bloginfo('name'), $title);
4593 4593
 	}
4594 4594
 
4595
-	if ( strpos( $title, '%%sitedesc%%' ) !== false ) {
4596
-		$title = str_replace( "%%sitedesc%%", get_bloginfo( 'description' ), $title );
4595
+	if (strpos($title, '%%sitedesc%%') !== false) {
4596
+		$title = str_replace("%%sitedesc%%", get_bloginfo('description'), $title);
4597 4597
 	}
4598 4598
 
4599
-	if ( strpos( $title, '%%excerpt%%' ) !== false ) {
4600
-		$title = str_replace( "%%excerpt%%", strip_tags( get_the_excerpt() ), $title );
4599
+	if (strpos($title, '%%excerpt%%') !== false) {
4600
+		$title = str_replace("%%excerpt%%", strip_tags(get_the_excerpt()), $title);
4601 4601
 	}
4602 4602
 
4603
-	if ( $gd_page == 'search' || $gd_page == 'author' ) {
4604
-		$post_type = isset( $_REQUEST['stype'] ) ? sanitize_text_field( $_REQUEST['stype'] ) : '';
4605
-	} else if ( $gd_page == 'add-listing' ) {
4606
-		$post_type = ( isset( $_REQUEST['listing_type'] ) ) ? sanitize_text_field( $_REQUEST['listing_type'] ) : '';
4607
-		$post_type = ! $post_type && ! empty( $_REQUEST['pid'] ) ? get_post_type( (int) $_REQUEST['pid'] ) : $post_type;
4608
-	} else if ( isset( $post->post_type ) && $post->post_type && in_array( $post->post_type, geodir_get_posttypes() ) ) {
4603
+	if ($gd_page == 'search' || $gd_page == 'author') {
4604
+		$post_type = isset($_REQUEST['stype']) ? sanitize_text_field($_REQUEST['stype']) : '';
4605
+	} else if ($gd_page == 'add-listing') {
4606
+		$post_type = (isset($_REQUEST['listing_type'])) ? sanitize_text_field($_REQUEST['listing_type']) : '';
4607
+		$post_type = !$post_type && !empty($_REQUEST['pid']) ? get_post_type((int) $_REQUEST['pid']) : $post_type;
4608
+	} else if (isset($post->post_type) && $post->post_type && in_array($post->post_type, geodir_get_posttypes())) {
4609 4609
 		$post_type = $post->post_type;
4610 4610
 	} else {
4611
-		$post_type = get_query_var( 'post_type' );
4611
+		$post_type = get_query_var('post_type');
4612 4612
 	}
4613 4613
 
4614
-	if ( strpos( $title, '%%pt_single%%' ) !== false ) {
4614
+	if (strpos($title, '%%pt_single%%') !== false) {
4615 4615
 		$singular_name = '';
4616
-		if ( $post_type && $singular_name = get_post_type_singular_label( $post_type ) ) {
4617
-			$singular_name = __( $singular_name, 'geodirectory' );
4616
+		if ($post_type && $singular_name = get_post_type_singular_label($post_type)) {
4617
+			$singular_name = __($singular_name, 'geodirectory');
4618 4618
 		}
4619 4619
 
4620
-		$title = str_replace( "%%pt_single%%", $singular_name, $title );
4620
+		$title = str_replace("%%pt_single%%", $singular_name, $title);
4621 4621
 	}
4622 4622
 
4623
-	if ( strpos( $title, '%%pt_plural%%' ) !== false ) {
4623
+	if (strpos($title, '%%pt_plural%%') !== false) {
4624 4624
 		$plural_name = '';
4625
-		if ( $post_type && $plural_name = get_post_type_plural_label( $post_type ) ) {
4626
-			$plural_name = __( $plural_name, 'geodirectory' );
4625
+		if ($post_type && $plural_name = get_post_type_plural_label($post_type)) {
4626
+			$plural_name = __($plural_name, 'geodirectory');
4627 4627
 		}
4628 4628
 
4629
-		$title = str_replace( "%%pt_plural%%", $plural_name, $title );
4629
+		$title = str_replace("%%pt_plural%%", $plural_name, $title);
4630 4630
 	}
4631 4631
 
4632
-	if ( strpos( $title, '%%category%%' ) !== false ) {
4632
+	if (strpos($title, '%%category%%') !== false) {
4633 4633
 		$cat_name = '';
4634 4634
 
4635
-		if ( $gd_page == 'detail' ) {
4636
-			if ( $post->default_category ) {
4637
-				$cat      = get_term( $post->default_category, $post->post_type . 'category' );
4638
-				$cat_name = ( isset( $cat->name ) ) ? $cat->name : '';
4635
+		if ($gd_page == 'detail') {
4636
+			if ($post->default_category) {
4637
+				$cat      = get_term($post->default_category, $post->post_type.'category');
4638
+				$cat_name = (isset($cat->name)) ? $cat->name : '';
4639 4639
 			}
4640
-		} else if ( $gd_page == 'listing' ) {
4640
+		} else if ($gd_page == 'listing') {
4641 4641
 			$queried_object = get_queried_object();
4642
-			if ( isset( $queried_object->name ) ) {
4642
+			if (isset($queried_object->name)) {
4643 4643
 				$cat_name = $queried_object->name;
4644 4644
 			}
4645 4645
 		}
4646
-		$title = str_replace( "%%category%%", $cat_name, $title );
4646
+		$title = str_replace("%%category%%", $cat_name, $title);
4647 4647
 	}
4648 4648
 
4649
-	if ( strpos( $title, '%%tag%%' ) !== false ) {
4649
+	if (strpos($title, '%%tag%%') !== false) {
4650 4650
 		$cat_name = '';
4651 4651
 
4652
-		if ( $gd_page == 'detail' ) {
4653
-			if ( $post->default_category ) {
4654
-				$cat      = get_term( $post->default_category, $post->post_type . 'category' );
4655
-				$cat_name = ( isset( $cat->name ) ) ? $cat->name : '';
4652
+		if ($gd_page == 'detail') {
4653
+			if ($post->default_category) {
4654
+				$cat      = get_term($post->default_category, $post->post_type.'category');
4655
+				$cat_name = (isset($cat->name)) ? $cat->name : '';
4656 4656
 			}
4657
-		} else if ( $gd_page == 'listing' ) {
4657
+		} else if ($gd_page == 'listing') {
4658 4658
 			$queried_object = get_queried_object();
4659
-			if ( isset( $queried_object->name ) ) {
4659
+			if (isset($queried_object->name)) {
4660 4660
 				$cat_name = $queried_object->name;
4661 4661
 			}
4662 4662
 		}
4663
-		$title = str_replace( "%%tag%%", $cat_name, $title );
4663
+		$title = str_replace("%%tag%%", $cat_name, $title);
4664 4664
 	}
4665 4665
 
4666
-	if ( strpos( $title, '%%id%%' ) !== false ) {
4667
-		$ID    = ( isset( $post->ID ) ) ? $post->ID : '';
4668
-		$title = str_replace( "%%id%%", $ID, $title );
4666
+	if (strpos($title, '%%id%%') !== false) {
4667
+		$ID    = (isset($post->ID)) ? $post->ID : '';
4668
+		$title = str_replace("%%id%%", $ID, $title);
4669 4669
 	}
4670 4670
 
4671
-	if ( strpos( $title, '%%sep%%' ) !== false ) {
4672
-		$title = str_replace( "%%sep%%", $sep, $title );
4671
+	if (strpos($title, '%%sep%%') !== false) {
4672
+		$title = str_replace("%%sep%%", $sep, $title);
4673 4673
 	}
4674 4674
 
4675 4675
 	// location variables
4676 4676
 	$gd_post_type   = geodir_get_current_posttype();
4677
-	$location_array = geodir_get_current_location_terms( 'query_vars', $gd_post_type );
4677
+	$location_array = geodir_get_current_location_terms('query_vars', $gd_post_type);
4678 4678
 	/**
4679 4679
 	 * Filter the title variables location variables array
4680 4680
 	 *
@@ -4686,166 +4686,166 @@  discard block
 block discarded – undo
4686 4686
 	 * @param string $gd_page       The page being filtered.
4687 4687
 	 * @param string $sep           The separator, default: `|`.
4688 4688
 	 */
4689
-	$location_array  = apply_filters( 'geodir_filter_title_variables_location_arr', $location_array, $title, $gd_page, $sep );
4689
+	$location_array  = apply_filters('geodir_filter_title_variables_location_arr', $location_array, $title, $gd_page, $sep);
4690 4690
 	$location_titles = array();
4691
-	if ( $gd_page == 'location' && get_query_var( 'gd_country_full' ) ) {
4692
-		if ( get_query_var( 'gd_country_full' ) ) {
4693
-			$location_array['gd_country'] = get_query_var( 'gd_country_full' );
4691
+	if ($gd_page == 'location' && get_query_var('gd_country_full')) {
4692
+		if (get_query_var('gd_country_full')) {
4693
+			$location_array['gd_country'] = get_query_var('gd_country_full');
4694 4694
 		}
4695
-		if ( get_query_var( 'gd_region_full' ) ) {
4696
-			$location_array['gd_region'] = get_query_var( 'gd_region_full' );
4695
+		if (get_query_var('gd_region_full')) {
4696
+			$location_array['gd_region'] = get_query_var('gd_region_full');
4697 4697
 		}
4698
-		if ( get_query_var( 'gd_city_full' ) ) {
4699
-			$location_array['gd_city'] = get_query_var( 'gd_city_full' );
4698
+		if (get_query_var('gd_city_full')) {
4699
+			$location_array['gd_city'] = get_query_var('gd_city_full');
4700 4700
 		}
4701 4701
 	}
4702 4702
 	$location_single = '';
4703
-	$gd_country      = ( isset( $wp->query_vars['gd_country'] ) && $wp->query_vars['gd_country'] != '' ) ? $wp->query_vars['gd_country'] : '';
4704
-	$gd_region       = ( isset( $wp->query_vars['gd_region'] ) && $wp->query_vars['gd_region'] != '' ) ? $wp->query_vars['gd_region'] : '';
4705
-	$gd_city         = ( isset( $wp->query_vars['gd_city'] ) && $wp->query_vars['gd_city'] != '' ) ? $wp->query_vars['gd_city'] : '';
4703
+	$gd_country      = (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') ? $wp->query_vars['gd_country'] : '';
4704
+	$gd_region       = (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') ? $wp->query_vars['gd_region'] : '';
4705
+	$gd_city         = (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') ? $wp->query_vars['gd_city'] : '';
4706 4706
 
4707 4707
 	$gd_country_actual = $gd_region_actual = $gd_city_actual = '';
4708 4708
 
4709
-	if ( function_exists( 'get_actual_location_name' ) ) {
4710
-		$gd_country_actual = $gd_country != '' ? get_actual_location_name( 'country', $gd_country, true ) : $gd_country;
4711
-		$gd_region_actual  = $gd_region != '' ? get_actual_location_name( 'region', $gd_region ) : $gd_region;
4712
-		$gd_city_actual    = $gd_city != '' ? get_actual_location_name( 'city', $gd_city ) : $gd_city;
4709
+	if (function_exists('get_actual_location_name')) {
4710
+		$gd_country_actual = $gd_country != '' ? get_actual_location_name('country', $gd_country, true) : $gd_country;
4711
+		$gd_region_actual  = $gd_region != '' ? get_actual_location_name('region', $gd_region) : $gd_region;
4712
+		$gd_city_actual    = $gd_city != '' ? get_actual_location_name('city', $gd_city) : $gd_city;
4713 4713
 	}
4714 4714
 
4715
-	if ( $gd_city != '' ) {
4716
-		if ( $gd_city_actual != '' ) {
4715
+	if ($gd_city != '') {
4716
+		if ($gd_city_actual != '') {
4717 4717
 			$gd_city = $gd_city_actual;
4718 4718
 		} else {
4719
-			$gd_city = preg_replace( '/-(\d+)$/', '', $gd_city );
4720
-			$gd_city = preg_replace( '/[_-]/', ' ', $gd_city );
4721
-			$gd_city = __( geodir_ucwords( $gd_city ), 'geodirectory' );
4719
+			$gd_city = preg_replace('/-(\d+)$/', '', $gd_city);
4720
+			$gd_city = preg_replace('/[_-]/', ' ', $gd_city);
4721
+			$gd_city = __(geodir_ucwords($gd_city), 'geodirectory');
4722 4722
 		}
4723 4723
 		$location_single = $gd_city;
4724 4724
 
4725
-	} else if ( $gd_region != '' ) {
4726
-		if ( $gd_region_actual != '' ) {
4725
+	} else if ($gd_region != '') {
4726
+		if ($gd_region_actual != '') {
4727 4727
 			$gd_region = $gd_region_actual;
4728 4728
 		} else {
4729
-			$gd_region = preg_replace( '/-(\d+)$/', '', $gd_region );
4730
-			$gd_region = preg_replace( '/[_-]/', ' ', $gd_region );
4731
-			$gd_region = __( geodir_ucwords( $gd_region ), 'geodirectory' );
4729
+			$gd_region = preg_replace('/-(\d+)$/', '', $gd_region);
4730
+			$gd_region = preg_replace('/[_-]/', ' ', $gd_region);
4731
+			$gd_region = __(geodir_ucwords($gd_region), 'geodirectory');
4732 4732
 		}
4733 4733
 
4734 4734
 		$location_single = $gd_region;
4735
-	} else if ( $gd_country != '' ) {
4736
-		if ( $gd_country_actual != '' ) {
4735
+	} else if ($gd_country != '') {
4736
+		if ($gd_country_actual != '') {
4737 4737
 			$gd_country = $gd_country_actual;
4738 4738
 		} else {
4739
-			$gd_country = preg_replace( '/-(\d+)$/', '', $gd_country );
4740
-			$gd_country = preg_replace( '/[_-]/', ' ', $gd_country );
4741
-			$gd_country = __( geodir_ucwords( $gd_country ), 'geodirectory' );
4739
+			$gd_country = preg_replace('/-(\d+)$/', '', $gd_country);
4740
+			$gd_country = preg_replace('/[_-]/', ' ', $gd_country);
4741
+			$gd_country = __(geodir_ucwords($gd_country), 'geodirectory');
4742 4742
 		}
4743 4743
 
4744 4744
 		$location_single = $gd_country;
4745 4745
 	}
4746 4746
 
4747
-	if ( ! empty( $location_array ) ) {
4747
+	if (!empty($location_array)) {
4748 4748
 
4749
-		$actual_location_name = function_exists( 'get_actual_location_name' ) ? true : false;
4750
-		$location_array       = array_reverse( $location_array );
4749
+		$actual_location_name = function_exists('get_actual_location_name') ? true : false;
4750
+		$location_array       = array_reverse($location_array);
4751 4751
 
4752
-		foreach ( $location_array as $location_type => $location ) {
4753
-			$gd_location_link_text = preg_replace( '/-(\d+)$/', '', $location );
4754
-			$gd_location_link_text = preg_replace( '/[_-]/', ' ', $gd_location_link_text );
4752
+		foreach ($location_array as $location_type => $location) {
4753
+			$gd_location_link_text = preg_replace('/-(\d+)$/', '', $location);
4754
+			$gd_location_link_text = preg_replace('/[_-]/', ' ', $gd_location_link_text);
4755 4755
 
4756
-			$location_name = geodir_ucwords( $gd_location_link_text );
4757
-			$location_name = __( $location_name, 'geodirectory' );
4756
+			$location_name = geodir_ucwords($gd_location_link_text);
4757
+			$location_name = __($location_name, 'geodirectory');
4758 4758
 
4759
-			if ( $actual_location_name ) {
4760
-				$location_type = strpos( $location_type, 'gd_' ) === 0 ? substr( $location_type, 3 ) : $location_type;
4761
-				$location_name = get_actual_location_name( $location_type, $location, true );
4759
+			if ($actual_location_name) {
4760
+				$location_type = strpos($location_type, 'gd_') === 0 ? substr($location_type, 3) : $location_type;
4761
+				$location_name = get_actual_location_name($location_type, $location, true);
4762 4762
 			}
4763 4763
 
4764 4764
 			$location_titles[] = $location_name;
4765 4765
 		}
4766
-		if ( ! empty( $location_titles ) ) {
4767
-			$location_titles = array_unique( $location_titles );
4766
+		if (!empty($location_titles)) {
4767
+			$location_titles = array_unique($location_titles);
4768 4768
 		}
4769 4769
 	}
4770 4770
 
4771 4771
 
4772
-	if ( strpos( $title, '%%location%%' ) !== false ) {
4772
+	if (strpos($title, '%%location%%') !== false) {
4773 4773
 		$location = '';
4774
-		if ( $location_titles ) {
4775
-			$location = implode( ", ", $location_titles );
4774
+		if ($location_titles) {
4775
+			$location = implode(", ", $location_titles);
4776 4776
 		}
4777
-		$title = str_replace( "%%location%%", $location, $title );
4777
+		$title = str_replace("%%location%%", $location, $title);
4778 4778
 	}
4779 4779
 
4780
-	if ( strpos( $title, '%%in_location%%' ) !== false ) {
4780
+	if (strpos($title, '%%in_location%%') !== false) {
4781 4781
 		$location = '';
4782
-		if ( $location_titles ) {
4783
-			$location = __( 'in ', 'geodirectory' ) . implode( ", ", $location_titles );
4782
+		if ($location_titles) {
4783
+			$location = __('in ', 'geodirectory').implode(", ", $location_titles);
4784 4784
 		}
4785
-		$title = str_replace( "%%in_location%%", $location, $title );
4785
+		$title = str_replace("%%in_location%%", $location, $title);
4786 4786
 	}
4787 4787
 
4788
-	if ( strpos( $title, '%%in_location_single%%' ) !== false ) {
4789
-		if ( $location_single ) {
4790
-			$location_single = __( 'in', 'geodirectory' ) . ' ' . $location_single;
4788
+	if (strpos($title, '%%in_location_single%%') !== false) {
4789
+		if ($location_single) {
4790
+			$location_single = __('in', 'geodirectory').' '.$location_single;
4791 4791
 		}
4792
-		$title = str_replace( "%%in_location_single%%", $location_single, $title );
4792
+		$title = str_replace("%%in_location_single%%", $location_single, $title);
4793 4793
 	}
4794 4794
 
4795
-	if ( strpos( $title, '%%location_single%%' ) !== false ) {
4796
-		$title = str_replace( "%%location_single%%", $location_single, $title );
4795
+	if (strpos($title, '%%location_single%%') !== false) {
4796
+		$title = str_replace("%%location_single%%", $location_single, $title);
4797 4797
 	}
4798 4798
 
4799 4799
 
4800
-	if ( strpos( $title, '%%search_term%%' ) !== false ) {
4800
+	if (strpos($title, '%%search_term%%') !== false) {
4801 4801
 		$search_term = '';
4802
-		if ( isset( $_REQUEST['s'] ) ) {
4803
-			$search_term = esc_attr( $_REQUEST['s'] );
4802
+		if (isset($_REQUEST['s'])) {
4803
+			$search_term = esc_attr($_REQUEST['s']);
4804 4804
 		}
4805
-		$title = str_replace( "%%search_term%%", $search_term, $title );
4805
+		$title = str_replace("%%search_term%%", $search_term, $title);
4806 4806
 	}
4807 4807
 
4808
-	if ( strpos( $title, '%%search_near%%' ) !== false ) {
4808
+	if (strpos($title, '%%search_near%%') !== false) {
4809 4809
 		$search_term = '';
4810
-		if ( isset( $_REQUEST['snear'] ) ) {
4811
-			$search_term = esc_attr( $_REQUEST['snear'] );
4810
+		if (isset($_REQUEST['snear'])) {
4811
+			$search_term = esc_attr($_REQUEST['snear']);
4812 4812
 		}
4813
-		$title = str_replace( "%%search_near%%", $search_term, $title );
4813
+		$title = str_replace("%%search_near%%", $search_term, $title);
4814 4814
 	}
4815 4815
 
4816
-	if ( strpos( $title, '%%name%%' ) !== false ) {
4817
-		if ( is_author() ) {
4818
-			$curauth     = ( get_query_var( 'author_name' ) ) ? get_user_by( 'slug', get_query_var( 'author_name' ) ) : get_userdata( get_query_var( 'author' ) );
4816
+	if (strpos($title, '%%name%%') !== false) {
4817
+		if (is_author()) {
4818
+			$curauth     = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
4819 4819
 			$author_name = $curauth->display_name;
4820 4820
 		} else {
4821 4821
 			$author_name = get_the_author();
4822 4822
 		}
4823
-		if ( ! $author_name || $author_name === '' ) {
4823
+		if (!$author_name || $author_name === '') {
4824 4824
 			$queried_object = get_queried_object();
4825 4825
 
4826
-			if ( isset( $queried_object->data->user_nicename ) ) {
4826
+			if (isset($queried_object->data->user_nicename)) {
4827 4827
 				$author_name = $queried_object->data->display_name;
4828 4828
 			}
4829 4829
 		}
4830
-		$title = str_replace( "%%name%%", $author_name, $title );
4830
+		$title = str_replace("%%name%%", $author_name, $title);
4831 4831
 	}
4832 4832
 
4833
-	if ( strpos( $title, '%%page%%' ) !== false ) {
4834
-		$page  = geodir_title_meta_page( $sep );
4835
-		$title = str_replace( "%%page%%", $page, $title );
4833
+	if (strpos($title, '%%page%%') !== false) {
4834
+		$page  = geodir_title_meta_page($sep);
4835
+		$title = str_replace("%%page%%", $page, $title);
4836 4836
 	}
4837
-	if ( strpos( $title, '%%pagenumber%%' ) !== false ) {
4837
+	if (strpos($title, '%%pagenumber%%') !== false) {
4838 4838
 		$pagenumber = geodir_title_meta_pagenumber();
4839
-		$title      = str_replace( "%%pagenumber%%", $pagenumber, $title );
4839
+		$title      = str_replace("%%pagenumber%%", $pagenumber, $title);
4840 4840
 	}
4841
-	if ( strpos( $title, '%%pagetotal%%' ) !== false ) {
4841
+	if (strpos($title, '%%pagetotal%%') !== false) {
4842 4842
 		$pagetotal = geodir_title_meta_pagetotal();
4843
-		$title     = str_replace( "%%pagetotal%%", $pagetotal, $title );
4843
+		$title     = str_replace("%%pagetotal%%", $pagetotal, $title);
4844 4844
 	}
4845 4845
 
4846
-	$title = wptexturize( $title );
4847
-	$title = convert_chars( $title );
4848
-	$title = esc_html( $title );
4846
+	$title = wptexturize($title);
4847
+	$title = convert_chars($title);
4848
+	$title = esc_html($title);
4849 4849
 
4850 4850
 	/**
4851 4851
 	 * Filter the title variables after standard ones have been filtered.
@@ -4859,7 +4859,7 @@  discard block
 block discarded – undo
4859 4859
 	 * @param string $sep           The separator, default: `|`.
4860 4860
 	 */
4861 4861
 
4862
-	return apply_filters( 'geodir_filter_title_variables_vars', $title, $location_array, $gd_page, $sep );
4862
+	return apply_filters('geodir_filter_title_variables_vars', $title, $location_array, $gd_page, $sep);
4863 4863
 }
4864 4864
 
4865 4865
 /**
@@ -4872,82 +4872,82 @@  discard block
 block discarded – undo
4872 4872
  *
4873 4873
  * @return array Translation texts.
4874 4874
  */
4875
-function geodir_load_cpt_text_translation( $translation_texts = array() ) {
4876
-	$gd_post_types = geodir_get_posttypes( 'array' );
4875
+function geodir_load_cpt_text_translation($translation_texts = array()) {
4876
+	$gd_post_types = geodir_get_posttypes('array');
4877 4877
 
4878
-	if ( ! empty( $gd_post_types ) ) {
4879
-		foreach ( $gd_post_types as $post_type => $cpt_info ) {
4880
-			$labels      = isset( $cpt_info['labels'] ) ? $cpt_info['labels'] : '';
4881
-			$description = isset( $cpt_info['description'] ) ? $cpt_info['description'] : '';
4882
-			$seo         = isset( $cpt_info['seo'] ) ? $cpt_info['seo'] : '';
4878
+	if (!empty($gd_post_types)) {
4879
+		foreach ($gd_post_types as $post_type => $cpt_info) {
4880
+			$labels      = isset($cpt_info['labels']) ? $cpt_info['labels'] : '';
4881
+			$description = isset($cpt_info['description']) ? $cpt_info['description'] : '';
4882
+			$seo         = isset($cpt_info['seo']) ? $cpt_info['seo'] : '';
4883 4883
 
4884
-			if ( ! empty( $labels ) ) {
4885
-				if ( $labels['name'] != '' && ! in_array( $labels['name'], $translation_texts ) ) {
4884
+			if (!empty($labels)) {
4885
+				if ($labels['name'] != '' && !in_array($labels['name'], $translation_texts)) {
4886 4886
 					$translation_texts[] = $labels['name'];
4887 4887
 				}
4888
-				if ( $labels['singular_name'] != '' && ! in_array( $labels['singular_name'], $translation_texts ) ) {
4888
+				if ($labels['singular_name'] != '' && !in_array($labels['singular_name'], $translation_texts)) {
4889 4889
 					$translation_texts[] = $labels['singular_name'];
4890 4890
 				}
4891
-				if ( $labels['add_new'] != '' && ! in_array( $labels['add_new'], $translation_texts ) ) {
4891
+				if ($labels['add_new'] != '' && !in_array($labels['add_new'], $translation_texts)) {
4892 4892
 					$translation_texts[] = $labels['add_new'];
4893 4893
 				}
4894
-				if ( $labels['add_new_item'] != '' && ! in_array( $labels['add_new_item'], $translation_texts ) ) {
4894
+				if ($labels['add_new_item'] != '' && !in_array($labels['add_new_item'], $translation_texts)) {
4895 4895
 					$translation_texts[] = $labels['add_new_item'];
4896 4896
 				}
4897
-				if ( $labels['edit_item'] != '' && ! in_array( $labels['edit_item'], $translation_texts ) ) {
4897
+				if ($labels['edit_item'] != '' && !in_array($labels['edit_item'], $translation_texts)) {
4898 4898
 					$translation_texts[] = $labels['edit_item'];
4899 4899
 				}
4900
-				if ( $labels['new_item'] != '' && ! in_array( $labels['new_item'], $translation_texts ) ) {
4900
+				if ($labels['new_item'] != '' && !in_array($labels['new_item'], $translation_texts)) {
4901 4901
 					$translation_texts[] = $labels['new_item'];
4902 4902
 				}
4903
-				if ( $labels['view_item'] != '' && ! in_array( $labels['view_item'], $translation_texts ) ) {
4903
+				if ($labels['view_item'] != '' && !in_array($labels['view_item'], $translation_texts)) {
4904 4904
 					$translation_texts[] = $labels['view_item'];
4905 4905
 				}
4906
-				if ( $labels['search_items'] != '' && ! in_array( $labels['search_items'], $translation_texts ) ) {
4906
+				if ($labels['search_items'] != '' && !in_array($labels['search_items'], $translation_texts)) {
4907 4907
 					$translation_texts[] = $labels['search_items'];
4908 4908
 				}
4909
-				if ( $labels['not_found'] != '' && ! in_array( $labels['not_found'], $translation_texts ) ) {
4909
+				if ($labels['not_found'] != '' && !in_array($labels['not_found'], $translation_texts)) {
4910 4910
 					$translation_texts[] = $labels['not_found'];
4911 4911
 				}
4912
-				if ( $labels['not_found_in_trash'] != '' && ! in_array( $labels['not_found_in_trash'], $translation_texts ) ) {
4912
+				if ($labels['not_found_in_trash'] != '' && !in_array($labels['not_found_in_trash'], $translation_texts)) {
4913 4913
 					$translation_texts[] = $labels['not_found_in_trash'];
4914 4914
 				}
4915
-				if ( isset( $labels['label_post_profile'] ) && $labels['label_post_profile'] != '' && ! in_array( $labels['label_post_profile'], $translation_texts ) ) {
4915
+				if (isset($labels['label_post_profile']) && $labels['label_post_profile'] != '' && !in_array($labels['label_post_profile'], $translation_texts)) {
4916 4916
 					$translation_texts[] = $labels['label_post_profile'];
4917 4917
 				}
4918
-				if ( isset( $labels['label_post_info'] ) && $labels['label_post_info'] != '' && ! in_array( $labels['label_post_info'], $translation_texts ) ) {
4918
+				if (isset($labels['label_post_info']) && $labels['label_post_info'] != '' && !in_array($labels['label_post_info'], $translation_texts)) {
4919 4919
 					$translation_texts[] = $labels['label_post_info'];
4920 4920
 				}
4921
-				if ( isset( $labels['label_post_images'] ) && $labels['label_post_images'] != '' && ! in_array( $labels['label_post_images'], $translation_texts ) ) {
4921
+				if (isset($labels['label_post_images']) && $labels['label_post_images'] != '' && !in_array($labels['label_post_images'], $translation_texts)) {
4922 4922
 					$translation_texts[] = $labels['label_post_images'];
4923 4923
 				}
4924
-				if ( isset( $labels['label_post_map'] ) && $labels['label_post_map'] != '' && ! in_array( $labels['label_post_map'], $translation_texts ) ) {
4924
+				if (isset($labels['label_post_map']) && $labels['label_post_map'] != '' && !in_array($labels['label_post_map'], $translation_texts)) {
4925 4925
 					$translation_texts[] = $labels['label_post_map'];
4926 4926
 				}
4927
-				if ( isset( $labels['label_reviews'] ) && $labels['label_reviews'] != '' && ! in_array( $labels['label_reviews'], $translation_texts ) ) {
4927
+				if (isset($labels['label_reviews']) && $labels['label_reviews'] != '' && !in_array($labels['label_reviews'], $translation_texts)) {
4928 4928
 					$translation_texts[] = $labels['label_reviews'];
4929 4929
 				}
4930
-				if ( isset( $labels['label_related_listing'] ) && $labels['label_related_listing'] != '' && ! in_array( $labels['label_related_listing'], $translation_texts ) ) {
4930
+				if (isset($labels['label_related_listing']) && $labels['label_related_listing'] != '' && !in_array($labels['label_related_listing'], $translation_texts)) {
4931 4931
 					$translation_texts[] = $labels['label_related_listing'];
4932 4932
 				}
4933 4933
 			}
4934 4934
 
4935
-			if ( $description != '' && ! in_array( $description, $translation_texts ) ) {
4936
-				$translation_texts[] = normalize_whitespace( $description );
4935
+			if ($description != '' && !in_array($description, $translation_texts)) {
4936
+				$translation_texts[] = normalize_whitespace($description);
4937 4937
 			}
4938 4938
 
4939
-			if ( ! empty( $seo ) ) {
4940
-				if ( isset( $seo['meta_keyword'] ) && $seo['meta_keyword'] != '' && ! in_array( $seo['meta_keyword'], $translation_texts ) ) {
4941
-					$translation_texts[] = normalize_whitespace( $seo['meta_keyword'] );
4939
+			if (!empty($seo)) {
4940
+				if (isset($seo['meta_keyword']) && $seo['meta_keyword'] != '' && !in_array($seo['meta_keyword'], $translation_texts)) {
4941
+					$translation_texts[] = normalize_whitespace($seo['meta_keyword']);
4942 4942
 				}
4943 4943
 
4944
-				if ( isset( $seo['meta_description'] ) && $seo['meta_description'] != '' && ! in_array( $seo['meta_description'], $translation_texts ) ) {
4945
-					$translation_texts[] = normalize_whitespace( $seo['meta_description'] );
4944
+				if (isset($seo['meta_description']) && $seo['meta_description'] != '' && !in_array($seo['meta_description'], $translation_texts)) {
4945
+					$translation_texts[] = normalize_whitespace($seo['meta_description']);
4946 4946
 				}
4947 4947
 			}
4948 4948
 		}
4949 4949
 	}
4950
-	$translation_texts = ! empty( $translation_texts ) ? array_unique( $translation_texts ) : $translation_texts;
4950
+	$translation_texts = !empty($translation_texts) ? array_unique($translation_texts) : $translation_texts;
4951 4951
 
4952 4952
 	return $translation_texts;
4953 4953
 }
@@ -4962,27 +4962,27 @@  discard block
 block discarded – undo
4962 4962
  *
4963 4963
  * @return array Location terms.
4964 4964
  */
4965
-function geodir_remove_location_terms( $location_terms = array() ) {
4966
-	$location_manager = defined( 'POST_LOCATION_TABLE' ) ? true : false;
4965
+function geodir_remove_location_terms($location_terms = array()) {
4966
+	$location_manager = defined('POST_LOCATION_TABLE') ? true : false;
4967 4967
 
4968
-	if ( ! empty( $location_terms ) && $location_manager ) {
4969
-		$hide_country_part = get_option( 'geodir_location_hide_country_part' );
4970
-		$hide_region_part  = get_option( 'geodir_location_hide_region_part' );
4968
+	if (!empty($location_terms) && $location_manager) {
4969
+		$hide_country_part = get_option('geodir_location_hide_country_part');
4970
+		$hide_region_part  = get_option('geodir_location_hide_region_part');
4971 4971
 
4972
-		if ( $hide_region_part && $hide_country_part ) {
4973
-			if ( isset( $location_terms['gd_country'] ) ) {
4974
-				unset( $location_terms['gd_country'] );
4972
+		if ($hide_region_part && $hide_country_part) {
4973
+			if (isset($location_terms['gd_country'])) {
4974
+				unset($location_terms['gd_country']);
4975 4975
 			}
4976
-			if ( isset( $location_terms['gd_region'] ) ) {
4977
-				unset( $location_terms['gd_region'] );
4976
+			if (isset($location_terms['gd_region'])) {
4977
+				unset($location_terms['gd_region']);
4978 4978
 			}
4979
-		} else if ( $hide_region_part && ! $hide_country_part ) {
4980
-			if ( isset( $location_terms['gd_region'] ) ) {
4981
-				unset( $location_terms['gd_region'] );
4979
+		} else if ($hide_region_part && !$hide_country_part) {
4980
+			if (isset($location_terms['gd_region'])) {
4981
+				unset($location_terms['gd_region']);
4982 4982
 			}
4983
-		} else if ( ! $hide_region_part && $hide_country_part ) {
4984
-			if ( isset( $location_terms['gd_country'] ) ) {
4985
-				unset( $location_terms['gd_country'] );
4983
+		} else if (!$hide_region_part && $hide_country_part) {
4984
+			if (isset($location_terms['gd_country'])) {
4985
+				unset($location_terms['gd_country']);
4986 4986
 			}
4987 4987
 		}
4988 4988
 	}
@@ -5000,33 +5000,33 @@  discard block
 block discarded – undo
5000 5000
  * @param WP_Post $post Post object.
5001 5001
  * @param bool $update  Whether this is an existing listing being updated or not.
5002 5002
  */
5003
-function geodir_on_wp_insert_post( $post_ID, $post, $update ) {
5004
-	if ( ! $update ) {
5003
+function geodir_on_wp_insert_post($post_ID, $post, $update) {
5004
+	if (!$update) {
5005 5005
 		return;
5006 5006
 	}
5007 5007
 
5008
-	$action      = isset( $_REQUEST['action'] ) ? sanitize_text_field( $_REQUEST['action'] ) : '';
5009
-	$is_admin    = is_admin() && ( ! defined( 'DOING_AJAX' ) || ( defined( 'DOING_AJAX' ) && ! DOING_AJAX ) ) ? true : false;
5008
+	$action      = isset($_REQUEST['action']) ? sanitize_text_field($_REQUEST['action']) : '';
5009
+	$is_admin    = is_admin() && (!defined('DOING_AJAX') || (defined('DOING_AJAX') && !DOING_AJAX)) ? true : false;
5010 5010
 	$inline_save = $action == 'inline-save' ? true : false;
5011 5011
 
5012
-	if ( empty( $post->post_type ) || $is_admin || $inline_save || ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) ) {
5012
+	if (empty($post->post_type) || $is_admin || $inline_save || (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE)) {
5013 5013
 		return;
5014 5014
 	}
5015 5015
 
5016
-	if ( $action != '' && in_array( $action, array( 'geodir_import_export' ) ) ) {
5016
+	if ($action != '' && in_array($action, array('geodir_import_export'))) {
5017 5017
 		return;
5018 5018
 	}
5019 5019
 
5020 5020
 	$user_id = (int) get_current_user_id();
5021 5021
 
5022
-	if ( $user_id > 0 && get_option( 'geodir_notify_post_edited' ) && ! wp_is_post_revision( $post_ID ) && in_array( $post->post_type, geodir_get_posttypes() ) ) {
5023
-		$author_id = ! empty( $post->post_author ) ? $post->post_author : 0;
5022
+	if ($user_id > 0 && get_option('geodir_notify_post_edited') && !wp_is_post_revision($post_ID) && in_array($post->post_type, geodir_get_posttypes())) {
5023
+		$author_id = !empty($post->post_author) ? $post->post_author : 0;
5024 5024
 
5025
-		if ( $user_id == $author_id && ! is_super_admin() ) {
5026
-			$from_email   = get_option( 'site_email' );
5025
+		if ($user_id == $author_id && !is_super_admin()) {
5026
+			$from_email   = get_option('site_email');
5027 5027
 			$from_name    = get_site_emailName();
5028
-			$to_email     = get_option( 'admin_email' );
5029
-			$to_name      = get_option( 'name' );
5028
+			$to_email     = get_option('admin_email');
5029
+			$to_name      = get_option('name');
5030 5030
 			$message_type = 'listing_edited';
5031 5031
 
5032 5032
 			$notify_edited = true;
@@ -5038,9 +5038,9 @@  discard block
 block discarded – undo
5038 5038
 			 * @param bool $notify_edited Notify on listing edited by author?
5039 5039
 			 * @param object $post        The current post object.
5040 5040
 			 */
5041
-			$notify_edited = apply_filters( 'geodir_notify_on_listing_edited', $notify_edited, $post );
5041
+			$notify_edited = apply_filters('geodir_notify_on_listing_edited', $notify_edited, $post);
5042 5042
 
5043
-			geodir_sendEmail( $from_email, $from_name, $to_email, $to_name, '', '', '', $message_type, $post_ID );
5043
+			geodir_sendEmail($from_email, $from_name, $to_email, $to_name, '', '', '', $message_type, $post_ID);
5044 5044
 		}
5045 5045
 	}
5046 5046
 }
@@ -5055,14 +5055,14 @@  discard block
 block discarded – undo
5055 5055
  *
5056 5056
  * @return string|null The current page start & end numbering.
5057 5057
  */
5058
-function geodir_title_meta_page( $sep ) {
5058
+function geodir_title_meta_page($sep) {
5059 5059
 	$replacement = null;
5060 5060
 
5061
-	$max = geodir_title_meta_pagenumbering( 'max' );
5062
-	$nr  = geodir_title_meta_pagenumbering( 'nr' );
5061
+	$max = geodir_title_meta_pagenumbering('max');
5062
+	$nr  = geodir_title_meta_pagenumbering('nr');
5063 5063
 
5064
-	if ( $max > 1 && $nr > 1 ) {
5065
-		$replacement = sprintf( $sep . ' ' . __( 'Page %1$d of %2$d', 'geodirectory' ), $nr, $max );
5064
+	if ($max > 1 && $nr > 1) {
5065
+		$replacement = sprintf($sep.' '.__('Page %1$d of %2$d', 'geodirectory'), $nr, $max);
5066 5066
 	}
5067 5067
 
5068 5068
 	return $replacement;
@@ -5079,8 +5079,8 @@  discard block
 block discarded – undo
5079 5079
 function geodir_title_meta_pagenumber() {
5080 5080
 	$replacement = null;
5081 5081
 
5082
-	$nr = geodir_title_meta_pagenumbering( 'nr' );
5083
-	if ( isset( $nr ) && $nr > 0 ) {
5082
+	$nr = geodir_title_meta_pagenumbering('nr');
5083
+	if (isset($nr) && $nr > 0) {
5084 5084
 		$replacement = (string) $nr;
5085 5085
 	}
5086 5086
 
@@ -5098,8 +5098,8 @@  discard block
 block discarded – undo
5098 5098
 function geodir_title_meta_pagetotal() {
5099 5099
 	$replacement = null;
5100 5100
 
5101
-	$max = geodir_title_meta_pagenumbering( 'max' );
5102
-	if ( isset( $max ) && $max > 0 ) {
5101
+	$max = geodir_title_meta_pagenumbering('max');
5102
+	if (isset($max) && $max > 0) {
5103 5103
 		$replacement = (string) $max;
5104 5104
 	}
5105 5105
 
@@ -5119,36 +5119,36 @@  discard block
 block discarded – undo
5119 5119
  *
5120 5120
  * @return int|null The current page numbering.
5121 5121
  */
5122
-function geodir_title_meta_pagenumbering( $request = 'nr' ) {
5122
+function geodir_title_meta_pagenumbering($request = 'nr') {
5123 5123
 	global $wp_query, $post;
5124 5124
 	$max_num_pages = null;
5125 5125
 	$page_number   = null;
5126 5126
 
5127 5127
 	$max_num_pages = 1;
5128 5128
 
5129
-	if ( ! is_singular() ) {
5130
-		$page_number = get_query_var( 'paged' );
5131
-		if ( $page_number === 0 || $page_number === '' ) {
5129
+	if (!is_singular()) {
5130
+		$page_number = get_query_var('paged');
5131
+		if ($page_number === 0 || $page_number === '') {
5132 5132
 			$page_number = 1;
5133 5133
 		}
5134 5134
 
5135
-		if ( isset( $wp_query->max_num_pages ) && ( $wp_query->max_num_pages != '' && $wp_query->max_num_pages != 0 ) ) {
5135
+		if (isset($wp_query->max_num_pages) && ($wp_query->max_num_pages != '' && $wp_query->max_num_pages != 0)) {
5136 5136
 			$max_num_pages = $wp_query->max_num_pages;
5137 5137
 		}
5138 5138
 	} else {
5139
-		$page_number = get_query_var( 'page' );
5140
-		if ( $page_number === 0 || $page_number === '' ) {
5139
+		$page_number = get_query_var('page');
5140
+		if ($page_number === 0 || $page_number === '') {
5141 5141
 			$page_number = 1;
5142 5142
 		}
5143 5143
 
5144
-		if ( isset( $post->post_content ) ) {
5145
-			$max_num_pages = ( substr_count( $post->post_content, '<!--nextpage-->' ) + 1 );
5144
+		if (isset($post->post_content)) {
5145
+			$max_num_pages = (substr_count($post->post_content, '<!--nextpage-->') + 1);
5146 5146
 		}
5147 5147
 	}
5148 5148
 
5149 5149
 	$return = null;
5150 5150
 
5151
-	switch ( $request ) {
5151
+	switch ($request) {
5152 5152
 		case 'nr':
5153 5153
 			$return = $page_number;
5154 5154
 			break;
@@ -5169,14 +5169,14 @@  discard block
 block discarded – undo
5169 5169
  *
5170 5170
  * @return array Terms.
5171 5171
  */
5172
-function geodir_filter_empty_terms( $terms ) {
5173
-	if ( empty( $terms ) ) {
5172
+function geodir_filter_empty_terms($terms) {
5173
+	if (empty($terms)) {
5174 5174
 		return $terms;
5175 5175
 	}
5176 5176
 
5177 5177
 	$return = array();
5178
-	foreach ( $terms as $term ) {
5179
-		if ( isset( $term->count ) && $term->count > 0 ) {
5178
+	foreach ($terms as $term) {
5179
+		if (isset($term->count) && $term->count > 0) {
5180 5180
 			$return[] = $term;
5181 5181
 		} else {
5182 5182
 			/**
@@ -5187,7 +5187,7 @@  discard block
 block discarded – undo
5187 5187
 			 * @param array $return The array of terms to return.
5188 5188
 			 * @param object $term  The term object.
5189 5189
 			 */
5190
-			$return = apply_filters( 'geodir_filter_empty_terms_filter', $return, $term );
5190
+			$return = apply_filters('geodir_filter_empty_terms_filter', $return, $term);
5191 5191
 		}
5192 5192
 	}
5193 5193
 
@@ -5204,12 +5204,12 @@  discard block
 block discarded – undo
5204 5204
  *
5205 5205
  * @return array
5206 5206
  */
5207
-function geodir_remove_hentry( $class ) {
5208
-	if ( geodir_is_page( 'detail' ) ) {
5209
-		$class = array_diff( $class, array( 'hentry' ) );
5207
+function geodir_remove_hentry($class) {
5208
+	if (geodir_is_page('detail')) {
5209
+		$class = array_diff($class, array('hentry'));
5210 5210
 	}
5211 5211
 
5212 5212
 	return $class;
5213 5213
 }
5214 5214
 
5215
-add_filter( 'post_class', 'geodir_remove_hentry' );
5216 5215
\ No newline at end of file
5216
+add_filter('post_class', 'geodir_remove_hentry');
5217 5217
\ No newline at end of file
Please login to merge, or discard this patch.
upgrade.php 3 patches
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -324,7 +324,7 @@
 block discarded – undo
324 324
 
325 325
             if(!empty($show_in_arr )){
326 326
                 $show_in_arr = implode(',',$show_in_arr);
327
-            }else{
327
+            } else{
328 328
                 $show_in_arr = '';
329 329
             }
330 330
 
Please login to merge, or discard this patch.
Indentation   +541 added lines, -541 removed lines patch added patch discarded remove patch
@@ -10,47 +10,47 @@  discard block
 block discarded – undo
10 10
 global $wpdb;
11 11
 
12 12
 if (get_option('geodirectory' . '_db_version') != GEODIRECTORY_VERSION) {
13
-    /**
14
-     * Include custom database table related functions.
15
-     *
16
-     * @since 1.0.0
17
-     * @package GeoDirectory
18
-     */
19
-    include_once('geodirectory-admin/admin_db_install.php');
20
-    add_action('plugins_loaded', 'geodirectory_upgrade_all', 10);
21
-    if (GEODIRECTORY_VERSION <= '1.3.6') {
22
-        add_action('plugins_loaded', 'geodir_upgrade_136', 11);
23
-    }
13
+	/**
14
+	 * Include custom database table related functions.
15
+	 *
16
+	 * @since 1.0.0
17
+	 * @package GeoDirectory
18
+	 */
19
+	include_once('geodirectory-admin/admin_db_install.php');
20
+	add_action('plugins_loaded', 'geodirectory_upgrade_all', 10);
21
+	if (GEODIRECTORY_VERSION <= '1.3.6') {
22
+		add_action('plugins_loaded', 'geodir_upgrade_136', 11);
23
+	}
24 24
 
25
-    if (GEODIRECTORY_VERSION <= '1.4.6') {
26
-        add_action('init', 'geodir_upgrade_146', 11);
27
-    }
25
+	if (GEODIRECTORY_VERSION <= '1.4.6') {
26
+		add_action('init', 'geodir_upgrade_146', 11);
27
+	}
28 28
 
29
-    if (GEODIRECTORY_VERSION <= '1.4.8') {
30
-        add_action('init', 'geodir_upgrade_148', 11);
31
-    }
29
+	if (GEODIRECTORY_VERSION <= '1.4.8') {
30
+		add_action('init', 'geodir_upgrade_148', 11);
31
+	}
32 32
 
33
-    if (GEODIRECTORY_VERSION <= '1.5.0') {
34
-        add_action('init', 'geodir_upgrade_150', 11);
35
-    }
33
+	if (GEODIRECTORY_VERSION <= '1.5.0') {
34
+		add_action('init', 'geodir_upgrade_150', 11);
35
+	}
36 36
 
37
-    if (GEODIRECTORY_VERSION <= '1.5.2') {
38
-        add_action('init', 'geodir_upgrade_152', 11);
39
-    }
37
+	if (GEODIRECTORY_VERSION <= '1.5.2') {
38
+		add_action('init', 'geodir_upgrade_152', 11);
39
+	}
40 40
 
41
-    if (GEODIRECTORY_VERSION <= '1.5.3') {
42
-        add_action('init', 'geodir_upgrade_153', 11);
43
-    }
41
+	if (GEODIRECTORY_VERSION <= '1.5.3') {
42
+		add_action('init', 'geodir_upgrade_153', 11);
43
+	}
44 44
 
45
-    if (GEODIRECTORY_VERSION <= '1.5.4') {
46
-        add_action('init', 'geodir_upgrade_154', 11);
47
-    }
45
+	if (GEODIRECTORY_VERSION <= '1.5.4') {
46
+		add_action('init', 'geodir_upgrade_154', 11);
47
+	}
48 48
 
49 49
 
50 50
 
51
-    add_action('init', 'gd_fix_cpt_rewrite_slug', 11);// this needs to be kept for a few versions
51
+	add_action('init', 'gd_fix_cpt_rewrite_slug', 11);// this needs to be kept for a few versions
52 52
 
53
-    update_option('geodirectory' . '_db_version', GEODIRECTORY_VERSION);
53
+	update_option('geodirectory' . '_db_version', GEODIRECTORY_VERSION);
54 54
 
55 55
 }
56 56
 
@@ -63,10 +63,10 @@  discard block
 block discarded – undo
63 63
  */
64 64
 function geodirectory_upgrade_all()
65 65
 {
66
-    geodir_create_tables();
67
-    geodir_update_review_db();
68
-    gd_install_theme_compat();
69
-    gd_convert_custom_field_display();
66
+	geodir_create_tables();
67
+	geodir_update_review_db();
68
+	gd_install_theme_compat();
69
+	gd_convert_custom_field_display();
70 70
 }
71 71
 
72 72
 /**
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
  */
78 78
 function geodir_upgrade_136()
79 79
 {
80
-    geodir_fix_review_overall_rating();
80
+	geodir_fix_review_overall_rating();
81 81
 }
82 82
 
83 83
 /**
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
  * @package GeoDirectory
88 88
  */
89 89
 function geodir_upgrade_146(){
90
-    gd_convert_virtual_pages();
90
+	gd_convert_virtual_pages();
91 91
 }
92 92
 
93 93
 /**
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
  * @package GeoDirectory
98 98
  */
99 99
 function geodir_upgrade_150(){
100
-    gd_fix_cpt_rewrite_slug();
100
+	gd_fix_cpt_rewrite_slug();
101 101
 }
102 102
 
103 103
 
@@ -109,11 +109,11 @@  discard block
 block discarded – undo
109 109
  * @package GeoDirectory
110 110
  */
111 111
 function geodir_upgrade_148(){
112
-    /*
112
+	/*
113 113
      * Blank the users google password if present as we now use oAuth 2.0
114 114
      */
115
-    update_option('geodir_ga_pass','');
116
-    update_option('geodir_ga_user','');
115
+	update_option('geodir_ga_pass','');
116
+	update_option('geodir_ga_user','');
117 117
 
118 118
 }
119 119
 
@@ -125,8 +125,8 @@  discard block
 block discarded – undo
125 125
  * @package GeoDirectory
126 126
  */
127 127
 function geodir_upgrade_153(){
128
-    geodir_create_page(esc_sql(_x('gd-info', 'page_slug', 'geodirectory')), 'geodir_info_page', __('Info', 'geodirectory'), '');
129
-    geodir_create_page(esc_sql(_x('gd-login', 'page_slug', 'geodirectory')), 'geodir_login_page', __('Login', 'geodirectory'), '');
128
+	geodir_create_page(esc_sql(_x('gd-info', 'page_slug', 'geodirectory')), 'geodir_info_page', __('Info', 'geodirectory'), '');
129
+	geodir_create_page(esc_sql(_x('gd-login', 'page_slug', 'geodirectory')), 'geodir_login_page', __('Login', 'geodirectory'), '');
130 130
 }
131 131
 
132 132
 /**
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
  * @package GeoDirectory
137 137
  */
138 138
 function geodir_upgrade_154(){
139
-    geodir_create_page(esc_sql(_x('gd-home', 'page_slug', 'geodirectory')), 'geodir_home_page', __('GD Home page', 'geodirectory'), '');
139
+	geodir_create_page(esc_sql(_x('gd-home', 'page_slug', 'geodirectory')), 'geodir_home_page', __('GD Home page', 'geodirectory'), '');
140 140
 }
141 141
 
142 142
 /**
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
  * @package GeoDirectory
147 147
  */
148 148
 function geodir_upgrade_152(){
149
-    gd_fix_address_detail_table_limit();
149
+	gd_fix_address_detail_table_limit();
150 150
 }
151 151
 
152 152
 
@@ -162,12 +162,12 @@  discard block
 block discarded – undo
162 162
  */
163 163
 function geodir_update_review_db()
164 164
 {
165
-    global $wpdb, $plugin_prefix;
165
+	global $wpdb, $plugin_prefix;
166 166
 
167
-    geodir_fix_review_date();
168
-    geodir_fix_review_post_status();
169
-    geodir_fix_review_content();
170
-    geodir_fix_review_location();
167
+	geodir_fix_review_date();
168
+	geodir_fix_review_post_status();
169
+	geodir_fix_review_content();
170
+	geodir_fix_review_location();
171 171
 
172 172
 }
173 173
 
@@ -180,8 +180,8 @@  discard block
 block discarded – undo
180 180
  */
181 181
 function geodir_fix_review_date()
182 182
 {
183
-    global $wpdb;
184
-    $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.post_date = c.comment_date WHERE gdr.post_date='0000-00-00 00:00:00'");
183
+	global $wpdb;
184
+	$wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.post_date = c.comment_date WHERE gdr.post_date='0000-00-00 00:00:00'");
185 185
 }
186 186
 
187 187
 /**
@@ -193,8 +193,8 @@  discard block
 block discarded – undo
193 193
  */
194 194
 function geodir_fix_review_post_status()
195 195
 {
196
-    global $wpdb;
197
-    $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->posts p ON gdr.post_id=p.ID SET gdr.post_status = 1 WHERE gdr.post_status IS NULL AND p.post_status='publish'");
196
+	global $wpdb;
197
+	$wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->posts p ON gdr.post_id=p.ID SET gdr.post_status = 1 WHERE gdr.post_status IS NULL AND p.post_status='publish'");
198 198
 }
199 199
 
200 200
 /**
@@ -207,12 +207,12 @@  discard block
 block discarded – undo
207 207
  */
208 208
 function geodir_fix_review_content()
209 209
 {
210
-    global $wpdb;
211
-    if ($wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.comment_content = c.comment_content WHERE gdr.comment_content IS NULL")) {
212
-        return true;
213
-    } else {
214
-        return false;
215
-    }
210
+	global $wpdb;
211
+	if ($wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.comment_content = c.comment_content WHERE gdr.comment_content IS NULL")) {
212
+		return true;
213
+	} else {
214
+		return false;
215
+	}
216 216
 }
217 217
 
218 218
 /**
@@ -225,20 +225,20 @@  discard block
 block discarded – undo
225 225
  */
226 226
 function geodir_fix_review_location()
227 227
 {
228
-    global $wpdb;
228
+	global $wpdb;
229 229
 
230
-    $all_postypes = geodir_get_posttypes();
230
+	$all_postypes = geodir_get_posttypes();
231 231
 
232
-    if (!empty($all_postypes)) {
233
-        foreach ($all_postypes as $key) {
234
-            // update each GD CTP
232
+	if (!empty($all_postypes)) {
233
+		foreach ($all_postypes as $key) {
234
+			// update each GD CTP
235 235
 
236
-            $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN " . $wpdb->prefix . "geodir_" . $key . "_detail d ON gdr.post_id=d.post_id SET gdr.post_latitude = d.post_latitude, gdr.post_longitude = d.post_longitude, gdr.post_city = d.post_city,  gdr.post_region=d.post_region, gdr.post_country=d.post_country WHERE gdr.post_latitude IS NULL OR gdr.post_city IS NULL");
236
+			$wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN " . $wpdb->prefix . "geodir_" . $key . "_detail d ON gdr.post_id=d.post_id SET gdr.post_latitude = d.post_latitude, gdr.post_longitude = d.post_longitude, gdr.post_city = d.post_city,  gdr.post_region=d.post_region, gdr.post_country=d.post_country WHERE gdr.post_latitude IS NULL OR gdr.post_city IS NULL");
237 237
 
238
-        }
239
-        return true;
240
-    }
241
-    return false;
238
+		}
239
+		return true;
240
+	}
241
+	return false;
242 242
 }
243 243
 
244 244
 /**
@@ -250,82 +250,82 @@  discard block
 block discarded – undo
250 250
  */
251 251
 function geodir_fix_review_overall_rating()
252 252
 {
253
-    global $wpdb;
253
+	global $wpdb;
254 254
 
255
-    $all_postypes = geodir_get_posttypes();
255
+	$all_postypes = geodir_get_posttypes();
256 256
 
257
-    if (!empty($all_postypes)) {
258
-        foreach ($all_postypes as $key) {
259
-            // update each GD CTP
260
-            $reviews = $wpdb->get_results("SELECT post_id FROM " . $wpdb->prefix . "geodir_" . $key . "_detail d");
257
+	if (!empty($all_postypes)) {
258
+		foreach ($all_postypes as $key) {
259
+			// update each GD CTP
260
+			$reviews = $wpdb->get_results("SELECT post_id FROM " . $wpdb->prefix . "geodir_" . $key . "_detail d");
261 261
 
262
-            if (!empty($reviews)) {
263
-                foreach ($reviews as $post_id) {
264
-                    geodir_update_postrating($post_id->post_id, $key);
265
-                }
262
+			if (!empty($reviews)) {
263
+				foreach ($reviews as $post_id) {
264
+					geodir_update_postrating($post_id->post_id, $key);
265
+				}
266 266
 
267
-            }
267
+			}
268 268
 
269
-        }
269
+		}
270 270
 
271
-    }
271
+	}
272 272
 }
273 273
 
274 274
 
275 275
 function gd_convert_custom_field_display(){
276
-    global $wpdb;
276
+	global $wpdb;
277 277
 
278
-    $field_info = $wpdb->get_results("select * from " . GEODIR_CUSTOM_FIELDS_TABLE);
278
+	$field_info = $wpdb->get_results("select * from " . GEODIR_CUSTOM_FIELDS_TABLE);
279 279
 
280
-    $has_run = get_option('gd_convert_custom_field_display');
281
-    if($has_run){return;}
280
+	$has_run = get_option('gd_convert_custom_field_display');
281
+	if($has_run){return;}
282 282
 
283
-    // set the field_type_key for standard fields
284
-    $wpdb->query("UPDATE ".GEODIR_CUSTOM_FIELDS_TABLE." SET field_type_key = field_type");
283
+	// set the field_type_key for standard fields
284
+	$wpdb->query("UPDATE ".GEODIR_CUSTOM_FIELDS_TABLE." SET field_type_key = field_type");
285 285
 
286 286
 
287
-    if(is_array( $field_info)){
287
+	if(is_array( $field_info)){
288 288
 
289
-        foreach( $field_info as $cf){
289
+		foreach( $field_info as $cf){
290 290
 
291
-            $id = $cf->id;
291
+			$id = $cf->id;
292 292
 
293
-            if(!property_exists($cf,'show_in') || !$id){return;}
293
+			if(!property_exists($cf,'show_in') || !$id){return;}
294 294
 
295
-            $show_in_arr = array();
295
+			$show_in_arr = array();
296 296
 
297
-            if($cf->is_default){
298
-                $show_in_arr[] = "[detail]";
299
-            }
297
+			if($cf->is_default){
298
+				$show_in_arr[] = "[detail]";
299
+			}
300 300
 
301
-            if($cf->show_on_detail){
302
-                $show_in_arr[] = "[moreinfo]";
303
-            }
301
+			if($cf->show_on_detail){
302
+				$show_in_arr[] = "[moreinfo]";
303
+			}
304 304
 
305
-            if($cf->show_on_listing){
306
-                $show_in_arr[] = "[listing]";
307
-            }
305
+			if($cf->show_on_listing){
306
+				$show_in_arr[] = "[listing]";
307
+			}
308 308
 
309
-            if($cf->show_as_tab || $cf->htmlvar_name=='geodir_video' || $cf->htmlvar_name=='geodir_special_offers'){
310
-                $show_in_arr[] = "[owntab]";
311
-            }
309
+			if($cf->show_as_tab || $cf->htmlvar_name=='geodir_video' || $cf->htmlvar_name=='geodir_special_offers'){
310
+				$show_in_arr[] = "[owntab]";
311
+			}
312 312
 
313
-            if($cf->htmlvar_name=='post' || $cf->htmlvar_name=='geodir_contact' || $cf->htmlvar_name=='geodir_timing'){
314
-                $show_in_arr[] = "[mapbubble]";
315
-            }
313
+			if($cf->htmlvar_name=='post' || $cf->htmlvar_name=='geodir_contact' || $cf->htmlvar_name=='geodir_timing'){
314
+				$show_in_arr[] = "[mapbubble]";
315
+			}
316 316
 
317
-            if(!empty($show_in_arr )){
318
-                $show_in_arr = implode(',',$show_in_arr);
319
-            }else{
320
-                $show_in_arr = '';
321
-            }
317
+			if(!empty($show_in_arr )){
318
+				$show_in_arr = implode(',',$show_in_arr);
319
+			}else{
320
+				$show_in_arr = '';
321
+			}
322 322
 
323
-            $wpdb->query("UPDATE ".GEODIR_CUSTOM_FIELDS_TABLE." SET show_in='$show_in_arr' WHERE id=$id");
323
+			$wpdb->query("UPDATE ".GEODIR_CUSTOM_FIELDS_TABLE." SET show_in='$show_in_arr' WHERE id=$id");
324 324
 
325
-        }
325
+		}
326 326
 
327
-        update_option('gd_convert_custom_field_display',1);
328
-    }
327
+		update_option('gd_convert_custom_field_display',1);
328
+	}
329 329
 }
330 330
 
331 331
 ############################################
@@ -341,367 +341,367 @@  discard block
 block discarded – undo
341 341
  */
342 342
 function gd_install_theme_compat()
343 343
 {
344
-    global $wpdb;
344
+	global $wpdb;
345 345
 
346
-    $theme_compat = array();
347
-    $theme_compat = get_option('gd_theme_compats');
346
+	$theme_compat = array();
347
+	$theme_compat = get_option('gd_theme_compats');
348 348
 //GDF
349
-    $theme_compat['GeoDirectory_Framework'] = array(
350
-        'geodir_wrapper_open_id' => 'geodir_wrapper',
351
-        'geodir_wrapper_open_class' => '',
352
-        'geodir_wrapper_open_replace' => '',
353
-        'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->',
354
-        'geodir_wrapper_content_open_id' => 'geodir_content',
355
-        'geodir_wrapper_content_open_class' => '',
356
-        'geodir_wrapper_content_open_replace' => '',
357
-        'geodir_wrapper_content_close_replace' => '',
358
-        'geodir_article_open_id' => '',
359
-        'geodir_article_open_class' => '',
360
-        'geodir_article_open_replace' => '',
361
-        'geodir_article_close_replace' => '',
362
-        'geodir_sidebar_right_open_id' => '',
363
-        'geodir_sidebar_right_open_class' => '',
364
-        'geodir_sidebar_right_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
365
-        'geodir_sidebar_right_close_replace' => '',
366
-        'geodir_sidebar_left_open_id' => '',
367
-        'geodir_sidebar_left_open_class' => '',
368
-        'geodir_sidebar_left_open_replace' => '<aside  id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
369
-        'geodir_sidebar_left_close_replace' => '',
370
-        'geodir_main_content_open_id' => '',
371
-        'geodir_main_content_open_class' => '',
372
-        'geodir_main_content_open_replace' => '<!-- removed -->',
373
-        'geodir_main_content_close_replace' => '<!-- removed -->',
374
-        'geodir_top_content_add' => '',
375
-        'geodir_before_main_content_add' => '<div class="clearfix geodir-common">',
376
-        'geodir_before_widget_filter' => '',
377
-        'geodir_after_widget_filter' => '',
378
-        'geodir_theme_compat_css' => '',
379
-        'geodir_theme_compat_js' => '',
380
-        'geodir_theme_compat_default_options' => '',
381
-        'geodir_theme_compat_code' => ''
382
-    );
349
+	$theme_compat['GeoDirectory_Framework'] = array(
350
+		'geodir_wrapper_open_id' => 'geodir_wrapper',
351
+		'geodir_wrapper_open_class' => '',
352
+		'geodir_wrapper_open_replace' => '',
353
+		'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->',
354
+		'geodir_wrapper_content_open_id' => 'geodir_content',
355
+		'geodir_wrapper_content_open_class' => '',
356
+		'geodir_wrapper_content_open_replace' => '',
357
+		'geodir_wrapper_content_close_replace' => '',
358
+		'geodir_article_open_id' => '',
359
+		'geodir_article_open_class' => '',
360
+		'geodir_article_open_replace' => '',
361
+		'geodir_article_close_replace' => '',
362
+		'geodir_sidebar_right_open_id' => '',
363
+		'geodir_sidebar_right_open_class' => '',
364
+		'geodir_sidebar_right_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
365
+		'geodir_sidebar_right_close_replace' => '',
366
+		'geodir_sidebar_left_open_id' => '',
367
+		'geodir_sidebar_left_open_class' => '',
368
+		'geodir_sidebar_left_open_replace' => '<aside  id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
369
+		'geodir_sidebar_left_close_replace' => '',
370
+		'geodir_main_content_open_id' => '',
371
+		'geodir_main_content_open_class' => '',
372
+		'geodir_main_content_open_replace' => '<!-- removed -->',
373
+		'geodir_main_content_close_replace' => '<!-- removed -->',
374
+		'geodir_top_content_add' => '',
375
+		'geodir_before_main_content_add' => '<div class="clearfix geodir-common">',
376
+		'geodir_before_widget_filter' => '',
377
+		'geodir_after_widget_filter' => '',
378
+		'geodir_theme_compat_css' => '',
379
+		'geodir_theme_compat_js' => '',
380
+		'geodir_theme_compat_default_options' => '',
381
+		'geodir_theme_compat_code' => ''
382
+	);
383 383
 
384 384
 //Directory Theme
385
-    $theme_compat['Directory_Starter'] = array(
386
-        'geodir_wrapper_open_id' => 'geodir_wrapper',
387
-        'geodir_wrapper_open_class' => '',
388
-        'geodir_wrapper_open_replace' => '',
389
-        'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->',
390
-        'geodir_wrapper_content_open_id' => 'geodir_content',
391
-        'geodir_wrapper_content_open_class' => '',
392
-        'geodir_wrapper_content_open_replace' => '',
393
-        'geodir_wrapper_content_close_replace' => '',
394
-        'geodir_article_open_id' => '',
395
-        'geodir_article_open_class' => '',
396
-        'geodir_article_open_replace' => '',
397
-        'geodir_article_close_replace' => '',
398
-        'geodir_sidebar_right_open_id' => '',
399
-        'geodir_sidebar_right_open_class' => '',
400
-        'geodir_sidebar_right_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
401
-        'geodir_sidebar_right_close_replace' => '',
402
-        'geodir_sidebar_left_open_id' => '',
403
-        'geodir_sidebar_left_open_class' => '',
404
-        'geodir_sidebar_left_open_replace' => '<aside  id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
405
-        'geodir_sidebar_left_close_replace' => '',
406
-        'geodir_main_content_open_id' => '',
407
-        'geodir_main_content_open_class' => '',
408
-        'geodir_main_content_open_replace' => '<!-- removed -->',
409
-        'geodir_main_content_close_replace' => '<!-- removed -->',
410
-        'geodir_top_content_add' => '',
411
-        'geodir_before_main_content_add' => '<div class="clearfix geodir-common">',
412
-        'geodir_before_widget_filter' => '',
413
-        'geodir_after_widget_filter' => '',
414
-        'geodir_theme_compat_css' => '',
415
-        'geodir_theme_compat_js' => '',
416
-        'geodir_theme_compat_default_options' => '',
417
-        'geodir_theme_compat_code' => ''
418
-    );
385
+	$theme_compat['Directory_Starter'] = array(
386
+		'geodir_wrapper_open_id' => 'geodir_wrapper',
387
+		'geodir_wrapper_open_class' => '',
388
+		'geodir_wrapper_open_replace' => '',
389
+		'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->',
390
+		'geodir_wrapper_content_open_id' => 'geodir_content',
391
+		'geodir_wrapper_content_open_class' => '',
392
+		'geodir_wrapper_content_open_replace' => '',
393
+		'geodir_wrapper_content_close_replace' => '',
394
+		'geodir_article_open_id' => '',
395
+		'geodir_article_open_class' => '',
396
+		'geodir_article_open_replace' => '',
397
+		'geodir_article_close_replace' => '',
398
+		'geodir_sidebar_right_open_id' => '',
399
+		'geodir_sidebar_right_open_class' => '',
400
+		'geodir_sidebar_right_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
401
+		'geodir_sidebar_right_close_replace' => '',
402
+		'geodir_sidebar_left_open_id' => '',
403
+		'geodir_sidebar_left_open_class' => '',
404
+		'geodir_sidebar_left_open_replace' => '<aside  id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
405
+		'geodir_sidebar_left_close_replace' => '',
406
+		'geodir_main_content_open_id' => '',
407
+		'geodir_main_content_open_class' => '',
408
+		'geodir_main_content_open_replace' => '<!-- removed -->',
409
+		'geodir_main_content_close_replace' => '<!-- removed -->',
410
+		'geodir_top_content_add' => '',
411
+		'geodir_before_main_content_add' => '<div class="clearfix geodir-common">',
412
+		'geodir_before_widget_filter' => '',
413
+		'geodir_after_widget_filter' => '',
414
+		'geodir_theme_compat_css' => '',
415
+		'geodir_theme_compat_js' => '',
416
+		'geodir_theme_compat_default_options' => '',
417
+		'geodir_theme_compat_code' => ''
418
+	);
419 419
 
420 420
 //Jobby
421
-    $theme_compat['Jobby'] = $theme_compat['Directory_Starter'];
421
+	$theme_compat['Jobby'] = $theme_compat['Directory_Starter'];
422 422
 
423 423
 //GeoProperty
424
-    $theme_compat['GeoProperty'] = $theme_compat['Directory_Starter'];
424
+	$theme_compat['GeoProperty'] = $theme_compat['Directory_Starter'];
425 425
 
426 426
 //Avada
427
-    $theme_compat['Avada'] = array(
428
-        'geodir_wrapper_open_id' => '',
429
-        'geodir_wrapper_open_class' => '',
430
-        'geodir_wrapper_open_replace' => '<!-- removed -->',
431
-        'geodir_wrapper_close_replace' => '<!-- removed -->',
432
-        'geodir_wrapper_content_open_id' => 'content',
433
-        'geodir_wrapper_content_open_class' => '',
434
-        'geodir_wrapper_content_open_replace' => '',
435
-        'geodir_wrapper_content_close_replace' => '',
436
-        'geodir_article_open_id' => '',
437
-        'geodir_article_open_class' => '',
438
-        'geodir_article_open_replace' => '',
439
-        'geodir_article_close_replace' => '',
440
-        'geodir_sidebar_right_open_id' => '',
441
-        'geodir_sidebar_right_open_class' => '',
442
-        'geodir_sidebar_right_open_replace' => '<div id="sidebar" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
443
-        'geodir_sidebar_right_close_replace' => '</div><!-- end sidebar -->',
444
-        'geodir_sidebar_left_open_id' => '',
445
-        'geodir_sidebar_left_open_class' => '',
446
-        'geodir_sidebar_left_open_replace' => '<div id="sidebar" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
447
-        'geodir_sidebar_left_close_replace' => '</div><!-- end sidebar -->',
448
-        'geodir_main_content_open_id' => '',
449
-        'geodir_main_content_open_class' => '',
450
-        'geodir_main_content_open_replace' => '<!-- removed -->',
451
-        'geodir_main_content_close_replace' => '<!-- removed -->',
452
-        'geodir_top_content_add' => '',
453
-        'geodir_before_main_content_add' => '',
454
-        'geodir_before_widget_filter' => '',
455
-        'geodir_after_widget_filter' => '',
456
-        'geodir_theme_compat_css' => stripslashes('.geodir-sidebar-left{float:left}select,textarea{border-style:solid;border-width:1px}.top-menu li > div{visibility:visible}.geodir-chosen-container-single .chosen-single{height:auto}ul li#menu-item-gd-location-switcher ul{width:222px}ul li#menu-item-gd-location-switcher ul li{padding-right:0!important}#mobile-nav li#mobile-menu-item-gd-location-switcher li a{padding-left:10px;padding-right:10px}#menu-item-gd-location-switcher dd,#mobile-menu-item-gd-location-switcher{margin-left:0}#menu-item-gd-location-switcher dd a{display:block}.geodir-chosen-container .chosen-results li.highlighted{background-color:#eee;background-image:none;color:#444}#mobile-nav li.mobile-nav-item li a:before{content:\'\';margin:0}#mobile-nav li.mobile-nav-item li a{padding:10px;width:auto}.geodir-listing-search{text-align:center}.geodir-search{float:none;margin:0}.geodir-search select,.geodir-search .search_by_post,.geodir-search input[type="text"],.geodir-search button[type="button"], .geodir-search input[type="button"],.geodir-search input[type="submit"]{display:inline-block;float:none}.geodir-cat-list ul li,.map_category ul li{list-style-type:none}.wpgeo-avada .page-title ul li:after{content:\'\'}.top_banner_section{margin-bottom:0}.geodir-category-list-in{margin:0;padding:15px}.geodir_full_page .geodir-cat-list .widget-title{margin-top:0}.geodir_full_page .geodir-cat-list ul li{padding-left:0}.geodir-loc-bar{border:none;margin:0;padding:0}.geodir-loc-bar-in{padding:15px 0}.geodir_full_page section.widget{margin-bottom:20px}.sidebar .geodir-loginbox-list li{margin-bottom:10px;padding-bottom:10px}.sidebar .geodir-loginbox-list li a{display:block}.sidebar .geodir-chosen-container .chosen-results li{margin:0;padding:5px 6px}.sidebar .geodir-chosen-container .chosen-results li.highlighted{background:#eee;background-image:none;color:#000}.sidebar .geodir_category_list_view li.geodir-gridview{display:inline-block;margin-bottom:15px}.wpgeo-avada.double-sidebars #main #sidebar{margin-left:3%}.wpgeo-avada.double-sidebars #main #sidebar-2{margin-left:-100%}.wpgeo-avada.double-sidebars #content{float:left;margin-left:0}.geodir_full_page section.widget{margin-bottom: 0px;} .sidebar .widget .geodir-hide {display: none;}li.fusion-mobile-nav-item .geodir_location_tab_container a:before{content: "" !important; margin-right: auto !important;}li.fusion-mobile-nav-item .geodir_location_tab_container a{padding-left:5px !important;}'),
457
-        'geodir_theme_compat_js' => '',
458
-        'geodir_theme_compat_default_options' => '',
459
-        'geodir_theme_compat_code' => 'Avada'
460
-    );
427
+	$theme_compat['Avada'] = array(
428
+		'geodir_wrapper_open_id' => '',
429
+		'geodir_wrapper_open_class' => '',
430
+		'geodir_wrapper_open_replace' => '<!-- removed -->',
431
+		'geodir_wrapper_close_replace' => '<!-- removed -->',
432
+		'geodir_wrapper_content_open_id' => 'content',
433
+		'geodir_wrapper_content_open_class' => '',
434
+		'geodir_wrapper_content_open_replace' => '',
435
+		'geodir_wrapper_content_close_replace' => '',
436
+		'geodir_article_open_id' => '',
437
+		'geodir_article_open_class' => '',
438
+		'geodir_article_open_replace' => '',
439
+		'geodir_article_close_replace' => '',
440
+		'geodir_sidebar_right_open_id' => '',
441
+		'geodir_sidebar_right_open_class' => '',
442
+		'geodir_sidebar_right_open_replace' => '<div id="sidebar" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
443
+		'geodir_sidebar_right_close_replace' => '</div><!-- end sidebar -->',
444
+		'geodir_sidebar_left_open_id' => '',
445
+		'geodir_sidebar_left_open_class' => '',
446
+		'geodir_sidebar_left_open_replace' => '<div id="sidebar" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
447
+		'geodir_sidebar_left_close_replace' => '</div><!-- end sidebar -->',
448
+		'geodir_main_content_open_id' => '',
449
+		'geodir_main_content_open_class' => '',
450
+		'geodir_main_content_open_replace' => '<!-- removed -->',
451
+		'geodir_main_content_close_replace' => '<!-- removed -->',
452
+		'geodir_top_content_add' => '',
453
+		'geodir_before_main_content_add' => '',
454
+		'geodir_before_widget_filter' => '',
455
+		'geodir_after_widget_filter' => '',
456
+		'geodir_theme_compat_css' => stripslashes('.geodir-sidebar-left{float:left}select,textarea{border-style:solid;border-width:1px}.top-menu li > div{visibility:visible}.geodir-chosen-container-single .chosen-single{height:auto}ul li#menu-item-gd-location-switcher ul{width:222px}ul li#menu-item-gd-location-switcher ul li{padding-right:0!important}#mobile-nav li#mobile-menu-item-gd-location-switcher li a{padding-left:10px;padding-right:10px}#menu-item-gd-location-switcher dd,#mobile-menu-item-gd-location-switcher{margin-left:0}#menu-item-gd-location-switcher dd a{display:block}.geodir-chosen-container .chosen-results li.highlighted{background-color:#eee;background-image:none;color:#444}#mobile-nav li.mobile-nav-item li a:before{content:\'\';margin:0}#mobile-nav li.mobile-nav-item li a{padding:10px;width:auto}.geodir-listing-search{text-align:center}.geodir-search{float:none;margin:0}.geodir-search select,.geodir-search .search_by_post,.geodir-search input[type="text"],.geodir-search button[type="button"], .geodir-search input[type="button"],.geodir-search input[type="submit"]{display:inline-block;float:none}.geodir-cat-list ul li,.map_category ul li{list-style-type:none}.wpgeo-avada .page-title ul li:after{content:\'\'}.top_banner_section{margin-bottom:0}.geodir-category-list-in{margin:0;padding:15px}.geodir_full_page .geodir-cat-list .widget-title{margin-top:0}.geodir_full_page .geodir-cat-list ul li{padding-left:0}.geodir-loc-bar{border:none;margin:0;padding:0}.geodir-loc-bar-in{padding:15px 0}.geodir_full_page section.widget{margin-bottom:20px}.sidebar .geodir-loginbox-list li{margin-bottom:10px;padding-bottom:10px}.sidebar .geodir-loginbox-list li a{display:block}.sidebar .geodir-chosen-container .chosen-results li{margin:0;padding:5px 6px}.sidebar .geodir-chosen-container .chosen-results li.highlighted{background:#eee;background-image:none;color:#000}.sidebar .geodir_category_list_view li.geodir-gridview{display:inline-block;margin-bottom:15px}.wpgeo-avada.double-sidebars #main #sidebar{margin-left:3%}.wpgeo-avada.double-sidebars #main #sidebar-2{margin-left:-100%}.wpgeo-avada.double-sidebars #content{float:left;margin-left:0}.geodir_full_page section.widget{margin-bottom: 0px;} .sidebar .widget .geodir-hide {display: none;}li.fusion-mobile-nav-item .geodir_location_tab_container a:before{content: "" !important; margin-right: auto !important;}li.fusion-mobile-nav-item .geodir_location_tab_container a{padding-left:5px !important;}'),
457
+		'geodir_theme_compat_js' => '',
458
+		'geodir_theme_compat_default_options' => '',
459
+		'geodir_theme_compat_code' => 'Avada'
460
+	);
461 461
 
462 462
 //Enfold
463
-    $theme_compat['Enfold'] = array(
464
-        'geodir_wrapper_open_id' => '',
465
-        'geodir_wrapper_open_class' => '',
466
-        'geodir_wrapper_open_replace' => '',
467
-        'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->',
468
-        'geodir_wrapper_content_open_id' => '',
469
-        'geodir_wrapper_content_open_class' => '',
470
-        'geodir_wrapper_content_open_replace' => '',
471
-        'geodir_wrapper_content_close_replace' => '</div></main>',
472
-        'geodir_article_open_id' => '',
473
-        'geodir_article_open_class' => '',
474
-        'geodir_article_open_replace' => '',
475
-        'geodir_article_close_replace' => '',
476
-        'geodir_sidebar_right_open_id' => '',
477
-        'geodir_sidebar_right_open_class' => '',
478
-        'geodir_sidebar_right_open_replace' => '',
479
-        'geodir_sidebar_right_close_replace' => '</div></aside><!-- sidebar ends here-->',
480
-        'geodir_sidebar_left_open_id' => '',
481
-        'geodir_sidebar_left_open_class' => '',
482
-        'geodir_sidebar_left_open_replace' => '',
483
-        'geodir_sidebar_left_close_replace' => '</div></aside><!-- sidebar ends here-->',
484
-        'geodir_main_content_open_id' => '',
485
-        'geodir_main_content_open_class' => '',
486
-        'geodir_main_content_open_replace' => '',
487
-        'geodir_main_content_close_replace' => '',
488
-        'geodir_top_content_add' => '',
489
-        'geodir_before_main_content_add' => '',
490
-        'geodir_before_widget_filter' => '',
491
-        'geodir_after_widget_filter' => '',
492
-        'geodir_theme_compat_css' => stripslashes('.geodir_full_page .top_banner_section{margin-bottom:0}.widget .geodir-cat-list ul li{clear:none}.wpgeo-enfold .av-main-nav ul{width:222px}.geodir-listing-search .geodir-loc-bar{border-top:none;padding:0}#main .geodir-listing-search,.geodir-listing-search .geodir-loc-bar{margin-bottom:0}#main .geodir-loc-bar-in,#main .geodir-category-list-in{background-color:#fcfcfc;margin:20px 0;padding:20px}#main .geodir_full_page .geodir-loc-bar-in,#main .geodir_full_page .geodir-loc-bar,#main .geodir_full_page .geodir-category-list-in{margin-top:0;margin-bottom:0}#main .geodir-loc-bar-in{padding:20px}#main .geodir-search{margin:0;width:100%}#main .geodir-search select{margin:0 3% 0 0;padding:8px 10px;width:13%}#main .geodir-search input[type="text"]{margin:0 3% 0 0;padding:10px;width:32.4%}#main .geodir-search input[type="button"],#main .geodir-search input[type="submit"]{font-size:inherit;line-height:2.25;margin:0;padding:7px;width:13%}.enfold-home-top section.widget{margin:0;padding:0}.enfold-home-top .top_banner_section{margin-bottom:0}.enfold-home-top .geodir-loc-bar{background:#fcfcfc;border:none;margin:0;padding:0}#main .enfold-home-top .geodir-loc-bar-in{background:none;border:none;margin:0 auto;padding:20px 0}#main .geodir-breadcrumb{border-bottom-style:solid;border-bottom-width:1px}#gd-tabs dt{clear:none}#geodir_slider ul li{list-style-type:none;margin:0;padding:0}#respond{clear:both}#comments .comments-title span{display:inline;font-size:inherit;font-weight:700}#reviewsTab .comments-area .bypostauthor cite span{display:inline}#top #comments .commentlist .comment,#top #comments .commentlist .comment > div{min-height:0}.commentlist .commenttext{padding-top:15px}#comment_imagesdropbox{margin-bottom:20px}.wpgeo-enfold .geodir_category_list_view li{margin-left:0;padding:0}.widget ul.geodir-loginbox-list{overflow:visible}.geodir_category_list_view li .geodir-post-img{display:block}.wpgeo-enfold .geodir_event_listing_calendar tr.title{background:#ccc}@media only screen and (max-width:480px){.geodir_category_list_view li .geodir-content,.geodir_category_list_view li .geodir-post-img,.geodir_category_list_view li .geodir-addinfo{float:none;width:100%;margin:10px 0}#main .geodir-search input[type="text"],#main .geodir-search input[type="button"],#main .geodir-search input[type="submit"],#main .geodir-search select{margin:10px 0;width:100%}}#main .geodir_full_page section:last-child .geodir-loc-bar{margin-bottom: -1px;border-bottom: none;}'),
493
-        'geodir_theme_compat_js' => '',
494
-        'geodir_theme_compat_default_options' => '',
495
-        'geodir_theme_compat_code' => 'Enfold'
496
-    );
463
+	$theme_compat['Enfold'] = array(
464
+		'geodir_wrapper_open_id' => '',
465
+		'geodir_wrapper_open_class' => '',
466
+		'geodir_wrapper_open_replace' => '',
467
+		'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->',
468
+		'geodir_wrapper_content_open_id' => '',
469
+		'geodir_wrapper_content_open_class' => '',
470
+		'geodir_wrapper_content_open_replace' => '',
471
+		'geodir_wrapper_content_close_replace' => '</div></main>',
472
+		'geodir_article_open_id' => '',
473
+		'geodir_article_open_class' => '',
474
+		'geodir_article_open_replace' => '',
475
+		'geodir_article_close_replace' => '',
476
+		'geodir_sidebar_right_open_id' => '',
477
+		'geodir_sidebar_right_open_class' => '',
478
+		'geodir_sidebar_right_open_replace' => '',
479
+		'geodir_sidebar_right_close_replace' => '</div></aside><!-- sidebar ends here-->',
480
+		'geodir_sidebar_left_open_id' => '',
481
+		'geodir_sidebar_left_open_class' => '',
482
+		'geodir_sidebar_left_open_replace' => '',
483
+		'geodir_sidebar_left_close_replace' => '</div></aside><!-- sidebar ends here-->',
484
+		'geodir_main_content_open_id' => '',
485
+		'geodir_main_content_open_class' => '',
486
+		'geodir_main_content_open_replace' => '',
487
+		'geodir_main_content_close_replace' => '',
488
+		'geodir_top_content_add' => '',
489
+		'geodir_before_main_content_add' => '',
490
+		'geodir_before_widget_filter' => '',
491
+		'geodir_after_widget_filter' => '',
492
+		'geodir_theme_compat_css' => stripslashes('.geodir_full_page .top_banner_section{margin-bottom:0}.widget .geodir-cat-list ul li{clear:none}.wpgeo-enfold .av-main-nav ul{width:222px}.geodir-listing-search .geodir-loc-bar{border-top:none;padding:0}#main .geodir-listing-search,.geodir-listing-search .geodir-loc-bar{margin-bottom:0}#main .geodir-loc-bar-in,#main .geodir-category-list-in{background-color:#fcfcfc;margin:20px 0;padding:20px}#main .geodir_full_page .geodir-loc-bar-in,#main .geodir_full_page .geodir-loc-bar,#main .geodir_full_page .geodir-category-list-in{margin-top:0;margin-bottom:0}#main .geodir-loc-bar-in{padding:20px}#main .geodir-search{margin:0;width:100%}#main .geodir-search select{margin:0 3% 0 0;padding:8px 10px;width:13%}#main .geodir-search input[type="text"]{margin:0 3% 0 0;padding:10px;width:32.4%}#main .geodir-search input[type="button"],#main .geodir-search input[type="submit"]{font-size:inherit;line-height:2.25;margin:0;padding:7px;width:13%}.enfold-home-top section.widget{margin:0;padding:0}.enfold-home-top .top_banner_section{margin-bottom:0}.enfold-home-top .geodir-loc-bar{background:#fcfcfc;border:none;margin:0;padding:0}#main .enfold-home-top .geodir-loc-bar-in{background:none;border:none;margin:0 auto;padding:20px 0}#main .geodir-breadcrumb{border-bottom-style:solid;border-bottom-width:1px}#gd-tabs dt{clear:none}#geodir_slider ul li{list-style-type:none;margin:0;padding:0}#respond{clear:both}#comments .comments-title span{display:inline;font-size:inherit;font-weight:700}#reviewsTab .comments-area .bypostauthor cite span{display:inline}#top #comments .commentlist .comment,#top #comments .commentlist .comment > div{min-height:0}.commentlist .commenttext{padding-top:15px}#comment_imagesdropbox{margin-bottom:20px}.wpgeo-enfold .geodir_category_list_view li{margin-left:0;padding:0}.widget ul.geodir-loginbox-list{overflow:visible}.geodir_category_list_view li .geodir-post-img{display:block}.wpgeo-enfold .geodir_event_listing_calendar tr.title{background:#ccc}@media only screen and (max-width:480px){.geodir_category_list_view li .geodir-content,.geodir_category_list_view li .geodir-post-img,.geodir_category_list_view li .geodir-addinfo{float:none;width:100%;margin:10px 0}#main .geodir-search input[type="text"],#main .geodir-search input[type="button"],#main .geodir-search input[type="submit"],#main .geodir-search select{margin:10px 0;width:100%}}#main .geodir_full_page section:last-child .geodir-loc-bar{margin-bottom: -1px;border-bottom: none;}'),
493
+		'geodir_theme_compat_js' => '',
494
+		'geodir_theme_compat_default_options' => '',
495
+		'geodir_theme_compat_code' => 'Enfold'
496
+	);
497 497
 
498 498
 // X
499
-    $theme_compat['X'] = array(
500
-        'geodir_wrapper_open_id' => '',
501
-        'geodir_wrapper_open_class' => '',
502
-        'geodir_wrapper_open_replace' => '',
503
-        'geodir_wrapper_close_replace' => '',
504
-        'geodir_wrapper_content_open_id' => '',
505
-        'geodir_wrapper_content_open_class' => '',
506
-        'geodir_wrapper_content_open_replace' => '',
507
-        'geodir_wrapper_content_close_replace' => '',
508
-        'geodir_article_open_id' => '',
509
-        'geodir_article_open_class' => '',
510
-        'geodir_article_open_replace' => '',
511
-        'geodir_article_close_replace' => '',
512
-        'geodir_sidebar_right_open_id' => '',
513
-        'geodir_sidebar_right_open_class' => '',
514
-        'geodir_sidebar_right_open_replace' => '',
515
-        'geodir_sidebar_right_close_replace' => '',
516
-        'geodir_sidebar_left_open_id' => '',
517
-        'geodir_sidebar_left_open_class' => '',
518
-        'geodir_sidebar_left_open_replace' => '',
519
-        'geodir_sidebar_left_close_replace' => '',
520
-        'geodir_main_content_open_id' => '',
521
-        'geodir_main_content_open_class' => '',
522
-        'geodir_main_content_open_replace' => '',
523
-        'geodir_main_content_close_replace' => '',
524
-        'geodir_top_content_add' => '',
525
-        'geodir_before_main_content_add' => '',
526
-        'geodir_before_widget_filter' => '',
527
-        'geodir_after_widget_filter' => '',
528
-        'geodir_theme_compat_css' => stripslashes('.x-colophon.bottom{clear:both}#geodir-main-content,.geodir_flex-container{margin-top:16px}.geodir-x ul{list-style:none}.widget ul.geodir_category_list_view{border:none}.geodir_category_list_view li.geodir-gridview:last-child{border-bottom:1px solid #e1e1e1}.home .x-header-landmark{display:none}.geodir-x .x-main .geodir_advance_search_widget{margin:0}.geodir-x .top_banner_section{margin-bottom:0}.geodir-loc-bar{background:rgba(0,0,0,0.05);margin:0;padding:0}.geodir-loc-bar-in{background:none;border:none;padding:10px}.geodir-search{margin:0;width:100%}.widget .geodir-search select,.geodir-search input[type="text"],.geodir-search input[type="button"],.geodir-search input[type="submit"]{border:1px solid #ccc;box-shadow:none;height:auto;line-height:21px;margin:0 1% 0 0;padding:5px 10px}.widget .geodir-search select,.geodir-search input[type="text"]{width:28%}.geodir-search input[type="submit"],.geodir-search input[type="button"]{line-height:19px;margin-right:0;width:11%}.geodir-search input:hover[type="submit"],.geodir-search input:hover[type="button"]{background:#333;color:#fff}.geodir-cat-list .widget-title{margin-top:0}.geodir-x .geodir-category-list-in{background:rgba(0,0,0,0.05);border:none}.widget .geodir-cat-list ul.geodir-popular-cat-list{border:none;border-radius:0;box-shadow:none}.geodir_full_page .geodir-cat-list ul li{border:none}.geodir_full_page .geodir-cat-list ul li a{border:none}.post-type-archive .geodir-loc-bar{border:none;margin-top:20px}#menu-item-gd-location-switcher dd{margin-left:0}.geodir-chosen-container-single .chosen-single{height:auto}.widget ul.geodir-loginbox-list{overflow:visible}.geodir_full_page section.widget{clear:both}.x-ethos .entry-title{margin-bottom:20px}.x-ethos .geodir-chosen-container-single .chosen-single{padding:0 0 0 8px}.x-ethos .widget ul li a,.x-ethos .geodir_category_list_view li{color:#333}@media only screen and (max-width:767px){.widget .geodir-search select,.geodir-search input[type="text"],.geodir-search input[type="button"],.geodir-search input[type="submit"]{margin:0 0 10px;width:100%}}.geodir_full_page .geodir-loc-bar-in,.geodir_full_page .geodir-loc-bar,.geodir_full_page .geodir-category-list-in{margin-top:0;margin-bottom:0}.geodir_full_page .geodir-loc-bar-in,.geodir_full_page .geodir-category-list-in{border-bottom:1px solid rgba(0,0,0,0.1)}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}'),
529
-        'geodir_theme_compat_js' => '',
530
-        'geodir_theme_compat_default_options' => '',
531
-        'geodir_theme_compat_code' => 'X'
532
-    );
499
+	$theme_compat['X'] = array(
500
+		'geodir_wrapper_open_id' => '',
501
+		'geodir_wrapper_open_class' => '',
502
+		'geodir_wrapper_open_replace' => '',
503
+		'geodir_wrapper_close_replace' => '',
504
+		'geodir_wrapper_content_open_id' => '',
505
+		'geodir_wrapper_content_open_class' => '',
506
+		'geodir_wrapper_content_open_replace' => '',
507
+		'geodir_wrapper_content_close_replace' => '',
508
+		'geodir_article_open_id' => '',
509
+		'geodir_article_open_class' => '',
510
+		'geodir_article_open_replace' => '',
511
+		'geodir_article_close_replace' => '',
512
+		'geodir_sidebar_right_open_id' => '',
513
+		'geodir_sidebar_right_open_class' => '',
514
+		'geodir_sidebar_right_open_replace' => '',
515
+		'geodir_sidebar_right_close_replace' => '',
516
+		'geodir_sidebar_left_open_id' => '',
517
+		'geodir_sidebar_left_open_class' => '',
518
+		'geodir_sidebar_left_open_replace' => '',
519
+		'geodir_sidebar_left_close_replace' => '',
520
+		'geodir_main_content_open_id' => '',
521
+		'geodir_main_content_open_class' => '',
522
+		'geodir_main_content_open_replace' => '',
523
+		'geodir_main_content_close_replace' => '',
524
+		'geodir_top_content_add' => '',
525
+		'geodir_before_main_content_add' => '',
526
+		'geodir_before_widget_filter' => '',
527
+		'geodir_after_widget_filter' => '',
528
+		'geodir_theme_compat_css' => stripslashes('.x-colophon.bottom{clear:both}#geodir-main-content,.geodir_flex-container{margin-top:16px}.geodir-x ul{list-style:none}.widget ul.geodir_category_list_view{border:none}.geodir_category_list_view li.geodir-gridview:last-child{border-bottom:1px solid #e1e1e1}.home .x-header-landmark{display:none}.geodir-x .x-main .geodir_advance_search_widget{margin:0}.geodir-x .top_banner_section{margin-bottom:0}.geodir-loc-bar{background:rgba(0,0,0,0.05);margin:0;padding:0}.geodir-loc-bar-in{background:none;border:none;padding:10px}.geodir-search{margin:0;width:100%}.widget .geodir-search select,.geodir-search input[type="text"],.geodir-search input[type="button"],.geodir-search input[type="submit"]{border:1px solid #ccc;box-shadow:none;height:auto;line-height:21px;margin:0 1% 0 0;padding:5px 10px}.widget .geodir-search select,.geodir-search input[type="text"]{width:28%}.geodir-search input[type="submit"],.geodir-search input[type="button"]{line-height:19px;margin-right:0;width:11%}.geodir-search input:hover[type="submit"],.geodir-search input:hover[type="button"]{background:#333;color:#fff}.geodir-cat-list .widget-title{margin-top:0}.geodir-x .geodir-category-list-in{background:rgba(0,0,0,0.05);border:none}.widget .geodir-cat-list ul.geodir-popular-cat-list{border:none;border-radius:0;box-shadow:none}.geodir_full_page .geodir-cat-list ul li{border:none}.geodir_full_page .geodir-cat-list ul li a{border:none}.post-type-archive .geodir-loc-bar{border:none;margin-top:20px}#menu-item-gd-location-switcher dd{margin-left:0}.geodir-chosen-container-single .chosen-single{height:auto}.widget ul.geodir-loginbox-list{overflow:visible}.geodir_full_page section.widget{clear:both}.x-ethos .entry-title{margin-bottom:20px}.x-ethos .geodir-chosen-container-single .chosen-single{padding:0 0 0 8px}.x-ethos .widget ul li a,.x-ethos .geodir_category_list_view li{color:#333}@media only screen and (max-width:767px){.widget .geodir-search select,.geodir-search input[type="text"],.geodir-search input[type="button"],.geodir-search input[type="submit"]{margin:0 0 10px;width:100%}}.geodir_full_page .geodir-loc-bar-in,.geodir_full_page .geodir-loc-bar,.geodir_full_page .geodir-category-list-in{margin-top:0;margin-bottom:0}.geodir_full_page .geodir-loc-bar-in,.geodir_full_page .geodir-category-list-in{border-bottom:1px solid rgba(0,0,0,0.1)}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}'),
529
+		'geodir_theme_compat_js' => '',
530
+		'geodir_theme_compat_default_options' => '',
531
+		'geodir_theme_compat_code' => 'X'
532
+	);
533 533
 
534 534
 // Divi
535
-    $theme_compat['Divi'] = array(
536
-        'geodir_wrapper_open_id' => 'main-content',
537
-        'geodir_wrapper_open_class' => '',
538
-        'geodir_wrapper_open_replace' => '',
539
-        'geodir_wrapper_close_replace' => '',
540
-        'geodir_wrapper_content_open_id' => 'left-area',
541
-        'geodir_wrapper_content_open_class' => '',
542
-        'geodir_wrapper_content_open_replace' => '<div class="container"><div id="content-area" class="clearfix"><div id="[id]" class="[class]" role="main" >',
543
-        'geodir_wrapper_content_close_replace' => '',
544
-        'geodir_article_open_id' => '',
545
-        'geodir_article_open_class' => '',
546
-        'geodir_article_open_replace' => '',
547
-        'geodir_article_close_replace' => '',
548
-        'geodir_sidebar_right_open_id' => 'sidebar',
549
-        'geodir_sidebar_right_open_class' => '',
550
-        'geodir_sidebar_right_open_replace' => '<aside  id="[id]" class="" role="complementary" itemscope itemtype="[itemtype]" >',
551
-        'geodir_sidebar_right_close_replace' => '</aside><!-- sidebar ends here--></div></div>',
552
-        'geodir_sidebar_left_open_id' => 'sidebar',
553
-        'geodir_sidebar_left_open_class' => '',
554
-        'geodir_sidebar_left_open_replace' => '<aside  id="[id]" class="" role="complementary" itemscope itemtype="[itemtype]" >',
555
-        'geodir_sidebar_left_close_replace' => '</aside><!-- sidebar ends here--></div></div>',
556
-        'geodir_main_content_open_id' => '',
557
-        'geodir_main_content_open_class' => '',
558
-        'geodir_main_content_open_replace' => '',
559
-        'geodir_main_content_close_replace' => '',
560
-        'geodir_top_content_add' => '',
561
-        'geodir_before_main_content_add' => '',
562
-        'geodir_before_widget_filter' => '',
563
-        'geodir_after_widget_filter' => '',
564
-        'geodir_theme_compat_css' => stripslashes('#left-area ul.geodir-direction-nav{list-style-type:none}#sidebar .geodir-company_info{margin-left:30px}#sidebar .geodir-widget{float:none;margin:0 0 30px 30px}.geodir_full_page .geodir-loc-bar{padding:0;margin:0;border:none}.geodir_full_page .geodir-category-list-in{margin-top:0}.geodir_full_page .top_banner_section{margin-bottom:0}.archive .entry-header,.geodir-breadcrumb{border-bottom:1px solid #e2e2e2}.archive .entry-header h1,ul#breadcrumbs{margin:0 auto;width:1080px}#left-area ul.geodir_category_list_view{padding:10px 0}.nav li#menu-item-gd-location-switcher ul{width:222px}#menu-item-gd-location-switcher li.gd-location-switcher-menu-item{padding-right:0}#menu-item-gd-location-switcher dd{margin-left:0}#menu-item-gd-location-switcher .geodir_location_tab_container dd a{padding:5px;width:auto}@media only screen and ( max-width: 980px ){.geodir-loc-bar-in,.geodir-cat-list,ul#breadcrumbs{width:690px}}@media only screen and ( max-width: 767px ){.geodir-loc-bar-in,.geodir-cat-list,ul#breadcrumbs{width:400px}}@media only screen and ( max-width: 479px ){.geodir-loc-bar-in,.geodir-cat-list,ul#breadcrumbs{width:280px}}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}'),
565
-        'geodir_theme_compat_js' => '',
566
-        'geodir_theme_compat_default_options' => '',
567
-        'geodir_theme_compat_code' => 'Divi'
568
-    );
535
+	$theme_compat['Divi'] = array(
536
+		'geodir_wrapper_open_id' => 'main-content',
537
+		'geodir_wrapper_open_class' => '',
538
+		'geodir_wrapper_open_replace' => '',
539
+		'geodir_wrapper_close_replace' => '',
540
+		'geodir_wrapper_content_open_id' => 'left-area',
541
+		'geodir_wrapper_content_open_class' => '',
542
+		'geodir_wrapper_content_open_replace' => '<div class="container"><div id="content-area" class="clearfix"><div id="[id]" class="[class]" role="main" >',
543
+		'geodir_wrapper_content_close_replace' => '',
544
+		'geodir_article_open_id' => '',
545
+		'geodir_article_open_class' => '',
546
+		'geodir_article_open_replace' => '',
547
+		'geodir_article_close_replace' => '',
548
+		'geodir_sidebar_right_open_id' => 'sidebar',
549
+		'geodir_sidebar_right_open_class' => '',
550
+		'geodir_sidebar_right_open_replace' => '<aside  id="[id]" class="" role="complementary" itemscope itemtype="[itemtype]" >',
551
+		'geodir_sidebar_right_close_replace' => '</aside><!-- sidebar ends here--></div></div>',
552
+		'geodir_sidebar_left_open_id' => 'sidebar',
553
+		'geodir_sidebar_left_open_class' => '',
554
+		'geodir_sidebar_left_open_replace' => '<aside  id="[id]" class="" role="complementary" itemscope itemtype="[itemtype]" >',
555
+		'geodir_sidebar_left_close_replace' => '</aside><!-- sidebar ends here--></div></div>',
556
+		'geodir_main_content_open_id' => '',
557
+		'geodir_main_content_open_class' => '',
558
+		'geodir_main_content_open_replace' => '',
559
+		'geodir_main_content_close_replace' => '',
560
+		'geodir_top_content_add' => '',
561
+		'geodir_before_main_content_add' => '',
562
+		'geodir_before_widget_filter' => '',
563
+		'geodir_after_widget_filter' => '',
564
+		'geodir_theme_compat_css' => stripslashes('#left-area ul.geodir-direction-nav{list-style-type:none}#sidebar .geodir-company_info{margin-left:30px}#sidebar .geodir-widget{float:none;margin:0 0 30px 30px}.geodir_full_page .geodir-loc-bar{padding:0;margin:0;border:none}.geodir_full_page .geodir-category-list-in{margin-top:0}.geodir_full_page .top_banner_section{margin-bottom:0}.archive .entry-header,.geodir-breadcrumb{border-bottom:1px solid #e2e2e2}.archive .entry-header h1,ul#breadcrumbs{margin:0 auto;width:1080px}#left-area ul.geodir_category_list_view{padding:10px 0}.nav li#menu-item-gd-location-switcher ul{width:222px}#menu-item-gd-location-switcher li.gd-location-switcher-menu-item{padding-right:0}#menu-item-gd-location-switcher dd{margin-left:0}#menu-item-gd-location-switcher .geodir_location_tab_container dd a{padding:5px;width:auto}@media only screen and ( max-width: 980px ){.geodir-loc-bar-in,.geodir-cat-list,ul#breadcrumbs{width:690px}}@media only screen and ( max-width: 767px ){.geodir-loc-bar-in,.geodir-cat-list,ul#breadcrumbs{width:400px}}@media only screen and ( max-width: 479px ){.geodir-loc-bar-in,.geodir-cat-list,ul#breadcrumbs{width:280px}}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}'),
565
+		'geodir_theme_compat_js' => '',
566
+		'geodir_theme_compat_default_options' => '',
567
+		'geodir_theme_compat_code' => 'Divi'
568
+	);
569 569
 
570 570
 // Genesis
571
-    $theme_compat['Genesis'] = array(
572
-        'geodir_wrapper_open_id' => '',
573
-        'geodir_wrapper_open_class' => 'content-sidebar-wrap',
574
-        'geodir_wrapper_open_replace' => '',
575
-        'geodir_wrapper_close_replace' => '',
576
-        'geodir_wrapper_content_open_id' => '',
577
-        'geodir_wrapper_content_open_class' => 'content',
578
-        'geodir_wrapper_content_open_replace' => '<div class="[class]" role="main" >',
579
-        'geodir_wrapper_content_close_replace' => '',
580
-        'geodir_article_open_id' => '',
581
-        'geodir_article_open_class' => '',
582
-        'geodir_article_open_replace' => '',
583
-        'geodir_article_close_replace' => '',
584
-        'geodir_sidebar_right_open_id' => '',
585
-        'geodir_sidebar_right_open_class' => 'sidebar sidebar-primary widget-area',
586
-        'geodir_sidebar_right_open_replace' => '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]">',
587
-        'geodir_sidebar_right_close_replace' => '',
588
-        'geodir_sidebar_left_open_id' => '',
589
-        'geodir_sidebar_left_open_class' => 'sidebar sidebar-secondary widget-area',
590
-        'geodir_sidebar_left_open_replace' => '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]">',
591
-        'geodir_sidebar_left_close_replace' => '',
592
-        'geodir_main_content_open_id' => '',
593
-        'geodir_main_content_open_class' => '',
594
-        'geodir_main_content_open_replace' => '<main  id="[id]" class="entry [class]"  role="main">',
595
-        'geodir_main_content_close_replace' => '',
596
-        'geodir_top_content_add' => '',
597
-        'geodir_before_main_content_add' => '',
598
-        'geodir_before_widget_filter' => '',
599
-        'geodir_after_widget_filter' => '',
600
-        'geodir_location_switcher_menu_li_class_filter' => 'menu-item menu-item-gd-location-switcher menu-item-has-children gd-location-switcher',
601
-        'geodir_theme_compat_css' => stripslashes('.full-width-content #geodir-wrapper-content{width:100%}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}.content{float:left}.sidebar-content .content,.sidebar-content #geodir-wrapper-content{float:right}.sidebar .geodir-company_info{background-color:#fff;border:none}.geodir_full_page .geodir-loc-bar{padding:0;margin:0;border:none}.geodir_full_page .geodir-category-list-in{margin-top:0}.geodir_full_page .top_banner_section{margin-bottom:0}.geodir-breadcrumb-bar{margin-bottom:-35px} .search-page .entry-title,.listings-page .entry-title{font-size: 20px;}.site-inner .geodir-breadcrumb-bar{margin-bottom:0px}'),
602
-        'geodir_theme_compat_js' => '',
603
-        'geodir_theme_compat_default_options' => '',
604
-        'geodir_theme_compat_code' => 'Genesis'
605
-    );
571
+	$theme_compat['Genesis'] = array(
572
+		'geodir_wrapper_open_id' => '',
573
+		'geodir_wrapper_open_class' => 'content-sidebar-wrap',
574
+		'geodir_wrapper_open_replace' => '',
575
+		'geodir_wrapper_close_replace' => '',
576
+		'geodir_wrapper_content_open_id' => '',
577
+		'geodir_wrapper_content_open_class' => 'content',
578
+		'geodir_wrapper_content_open_replace' => '<div class="[class]" role="main" >',
579
+		'geodir_wrapper_content_close_replace' => '',
580
+		'geodir_article_open_id' => '',
581
+		'geodir_article_open_class' => '',
582
+		'geodir_article_open_replace' => '',
583
+		'geodir_article_close_replace' => '',
584
+		'geodir_sidebar_right_open_id' => '',
585
+		'geodir_sidebar_right_open_class' => 'sidebar sidebar-primary widget-area',
586
+		'geodir_sidebar_right_open_replace' => '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]">',
587
+		'geodir_sidebar_right_close_replace' => '',
588
+		'geodir_sidebar_left_open_id' => '',
589
+		'geodir_sidebar_left_open_class' => 'sidebar sidebar-secondary widget-area',
590
+		'geodir_sidebar_left_open_replace' => '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]">',
591
+		'geodir_sidebar_left_close_replace' => '',
592
+		'geodir_main_content_open_id' => '',
593
+		'geodir_main_content_open_class' => '',
594
+		'geodir_main_content_open_replace' => '<main  id="[id]" class="entry [class]"  role="main">',
595
+		'geodir_main_content_close_replace' => '',
596
+		'geodir_top_content_add' => '',
597
+		'geodir_before_main_content_add' => '',
598
+		'geodir_before_widget_filter' => '',
599
+		'geodir_after_widget_filter' => '',
600
+		'geodir_location_switcher_menu_li_class_filter' => 'menu-item menu-item-gd-location-switcher menu-item-has-children gd-location-switcher',
601
+		'geodir_theme_compat_css' => stripslashes('.full-width-content #geodir-wrapper-content{width:100%}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}.content{float:left}.sidebar-content .content,.sidebar-content #geodir-wrapper-content{float:right}.sidebar .geodir-company_info{background-color:#fff;border:none}.geodir_full_page .geodir-loc-bar{padding:0;margin:0;border:none}.geodir_full_page .geodir-category-list-in{margin-top:0}.geodir_full_page .top_banner_section{margin-bottom:0}.geodir-breadcrumb-bar{margin-bottom:-35px} .search-page .entry-title,.listings-page .entry-title{font-size: 20px;}.site-inner .geodir-breadcrumb-bar{margin-bottom:0px}'),
602
+		'geodir_theme_compat_js' => '',
603
+		'geodir_theme_compat_default_options' => '',
604
+		'geodir_theme_compat_code' => 'Genesis'
605
+	);
606 606
 
607 607
 // Jupiter
608
-    $theme_compat['Jupiter'] = array(
609
-        'geodir_wrapper_open_id' => '',
610
-        'geodir_wrapper_open_class' => '',
611
-        'geodir_wrapper_open_replace' => '<div id="theme-page"><div class="mk-main-wrapper-holder"><div  class="theme-page-wrapper mk-main-wrapper  mk-grid vc_row-fluid">',
612
-        'geodir_wrapper_close_replace' => '</div></div></div>',
613
-        'geodir_wrapper_content_open_id' => '',
614
-        'geodir_wrapper_content_open_class' => '',
615
-        'geodir_wrapper_content_open_replace' => '',
616
-        'geodir_wrapper_content_close_replace' => '',
617
-        'geodir_article_open_id' => '',
618
-        'geodir_article_open_class' => '',
619
-        'geodir_article_open_replace' => '',
620
-        'geodir_article_close_replace' => '',
621
-        'geodir_sidebar_right_open_id' => 'mk-sidebar',
622
-        'geodir_sidebar_right_open_class' => 'mk-builtin geodir-sidebar-right geodir-listings-sidebar-right',
623
-        'geodir_sidebar_right_open_replace' => '',
624
-        'geodir_sidebar_right_close_replace' => '',
625
-        'geodir_sidebar_left_open_id' => 'mk-sidebar',
626
-        'geodir_sidebar_left_open_class' => 'mk-builtin geodir-sidebar-right geodir-listings-sidebar-right',
627
-        'geodir_sidebar_left_open_replace' => '',
628
-        'geodir_sidebar_left_close_replace' => '',
629
-        'geodir_main_content_open_id' => '',
630
-        'geodir_main_content_open_class' => '',
631
-        'geodir_main_content_open_replace' => '',
632
-        'geodir_main_content_close_replace' => '',
633
-        'geodir_top_content_add' => '',
634
-        'geodir_before_main_content_add' => '',
635
-        'geodir_before_widget_filter' => '',
636
-        'geodir_after_widget_filter' => '',
637
-        'geodir_before_title_filter' => '<h3 class="widgettitle geodir-widget-title">',
638
-        'geodir_after_title_filter' => '',
639
-        'geodir_menu_li_class_filter' => 'menu-item menu-item-has-children no-mega-menu',
640
-        'geodir_sub_menu_ul_class_filter' => '',
641
-        'geodir_sub_menu_li_class_filter' => '',
642
-        'geodir_menu_a_class_filter' => 'menu-item-link',
643
-        'geodir_sub_menu_a_class_filter' => 'menu-item-link one-page-nav-item',
644
-        'geodir_location_switcher_menu_li_class_filter' => 'menu-item menu-item-type-social menu-item-type-social gd-location-switcher menu-item-has-children no-mega-menu',
645
-        'geodir_location_switcher_menu_a_class_filter' => 'menu-item-link',
646
-        'geodir_location_switcher_menu_sub_ul_class_filter' => '',
647
-        'geodir_location_switcher_menu_sub_li_class_filter' => '',
648
-        'geodir_theme_compat_css' => stripslashes('.geodir-widget li,.geodir_category_list_view li{margin:0}#theme-page h3.geodir-entry-title{font-size:14px}#menu-item-gd-location-switcher dd{line-height:44px}#menu-item-gd-location-switcher .geodir_location_sugestion{line-height:20px}.geodir_loginbox{overflow:visible}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}'),
649
-        'geodir_theme_compat_js' => '',
650
-        'geodir_theme_compat_default_options' => '',
651
-        'geodir_theme_compat_code' => 'Jupiter'
652
-    );
608
+	$theme_compat['Jupiter'] = array(
609
+		'geodir_wrapper_open_id' => '',
610
+		'geodir_wrapper_open_class' => '',
611
+		'geodir_wrapper_open_replace' => '<div id="theme-page"><div class="mk-main-wrapper-holder"><div  class="theme-page-wrapper mk-main-wrapper  mk-grid vc_row-fluid">',
612
+		'geodir_wrapper_close_replace' => '</div></div></div>',
613
+		'geodir_wrapper_content_open_id' => '',
614
+		'geodir_wrapper_content_open_class' => '',
615
+		'geodir_wrapper_content_open_replace' => '',
616
+		'geodir_wrapper_content_close_replace' => '',
617
+		'geodir_article_open_id' => '',
618
+		'geodir_article_open_class' => '',
619
+		'geodir_article_open_replace' => '',
620
+		'geodir_article_close_replace' => '',
621
+		'geodir_sidebar_right_open_id' => 'mk-sidebar',
622
+		'geodir_sidebar_right_open_class' => 'mk-builtin geodir-sidebar-right geodir-listings-sidebar-right',
623
+		'geodir_sidebar_right_open_replace' => '',
624
+		'geodir_sidebar_right_close_replace' => '',
625
+		'geodir_sidebar_left_open_id' => 'mk-sidebar',
626
+		'geodir_sidebar_left_open_class' => 'mk-builtin geodir-sidebar-right geodir-listings-sidebar-right',
627
+		'geodir_sidebar_left_open_replace' => '',
628
+		'geodir_sidebar_left_close_replace' => '',
629
+		'geodir_main_content_open_id' => '',
630
+		'geodir_main_content_open_class' => '',
631
+		'geodir_main_content_open_replace' => '',
632
+		'geodir_main_content_close_replace' => '',
633
+		'geodir_top_content_add' => '',
634
+		'geodir_before_main_content_add' => '',
635
+		'geodir_before_widget_filter' => '',
636
+		'geodir_after_widget_filter' => '',
637
+		'geodir_before_title_filter' => '<h3 class="widgettitle geodir-widget-title">',
638
+		'geodir_after_title_filter' => '',
639
+		'geodir_menu_li_class_filter' => 'menu-item menu-item-has-children no-mega-menu',
640
+		'geodir_sub_menu_ul_class_filter' => '',
641
+		'geodir_sub_menu_li_class_filter' => '',
642
+		'geodir_menu_a_class_filter' => 'menu-item-link',
643
+		'geodir_sub_menu_a_class_filter' => 'menu-item-link one-page-nav-item',
644
+		'geodir_location_switcher_menu_li_class_filter' => 'menu-item menu-item-type-social menu-item-type-social gd-location-switcher menu-item-has-children no-mega-menu',
645
+		'geodir_location_switcher_menu_a_class_filter' => 'menu-item-link',
646
+		'geodir_location_switcher_menu_sub_ul_class_filter' => '',
647
+		'geodir_location_switcher_menu_sub_li_class_filter' => '',
648
+		'geodir_theme_compat_css' => stripslashes('.geodir-widget li,.geodir_category_list_view li{margin:0}#theme-page h3.geodir-entry-title{font-size:14px}#menu-item-gd-location-switcher dd{line-height:44px}#menu-item-gd-location-switcher .geodir_location_sugestion{line-height:20px}.geodir_loginbox{overflow:visible}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}'),
649
+		'geodir_theme_compat_js' => '',
650
+		'geodir_theme_compat_default_options' => '',
651
+		'geodir_theme_compat_code' => 'Jupiter'
652
+	);
653 653
 
654 654
 // Multi News
655
-    $theme_compat['Multi_News'] = array(
656
-        'geodir_wrapper_open_id' => '',
657
-        'geodir_wrapper_open_class' => 'main-container clearfix',
658
-        'geodir_wrapper_open_replace' => '',
659
-        'geodir_wrapper_close_replace' => '',
660
-        'geodir_wrapper_content_open_id' => '',
661
-        'geodir_wrapper_content_open_class' => '',
662
-        'geodir_wrapper_content_open_replace' => '<div class="main-left" ><div class="main-content  "><div class="site-content page-wrap">',
663
-        'geodir_wrapper_content_close_replace' => '</div></div></div>',
664
-        'geodir_article_open_id' => '',
665
-        'geodir_article_open_class' => '',
666
-        'geodir_article_open_replace' => '',
667
-        'geodir_article_close_replace' => '',
668
-        'geodir_sidebar_right_open_id' => '',
669
-        'geodir_sidebar_right_open_class' => '',
670
-        'geodir_sidebar_right_open_replace' => '<aside  class="sidebar" role="complementary" itemscope itemtype="[itemtype]" >',
671
-        'geodir_sidebar_right_close_replace' => '',
672
-        'geodir_sidebar_left_open_id' => '',
673
-        'geodir_sidebar_left_open_class' => '',
674
-        'geodir_sidebar_left_open_replace' => '<aside  class="secondary-sidebar" role="complementary" itemscope itemtype="[itemtype]" >',
675
-        'geodir_sidebar_left_close_replace' => '',
676
-        'geodir_main_content_open_id' => '',
677
-        'geodir_main_content_open_class' => '',
678
-        'geodir_main_content_open_replace' => '<div class="site-content page-wrap">',
679
-        'geodir_main_content_close_replace' => '</div>',
680
-        'geodir_top_content_add' => '',
681
-        'geodir_before_main_content_add' => '',
682
-        'geodir_full_page_class_filter' => 'section full-width-section',
683
-        'geodir_before_widget_filter' => '',
684
-        'geodir_after_widget_filter' => '',
685
-        'geodir_before_title_filter' => '<div class="widget-title"><h2>',
686
-        'geodir_after_title_filter' => '</h2></div>',
687
-        'geodir_menu_li_class_filter' => '',
688
-        'geodir_sub_menu_ul_class_filter' => '',
689
-        'geodir_sub_menu_li_class_filter' => '',
690
-        'geodir_menu_a_class_filter' => '',
691
-        'geodir_sub_menu_a_class_filter' => '',
692
-        'geodir_location_switcher_menu_li_class_filter' => '',
693
-        'geodir_location_switcher_menu_a_class_filter' => '',
694
-        'geodir_location_switcher_menu_sub_ul_class_filter' => '',
695
-        'geodir_location_switcher_menu_sub_li_class_filter' => '',
696
-        'geodir_theme_compat_css' => stripslashes('.full-width-section .geodir-search{margin:0;width:100%}.geodir_full_page .geodir-search{margin:0 auto;float:none}.geodir-search input[type=button],.geodir-search input[type=submit]{width:13%}.geodir-search input[type=text]{border:1px solid #ddd;border-radius:0;padding:0 8px}.geodir-category-list-in,.geodir-loc-bar-in{background:#f2f2f2;border-color:#dbdbdb}.geodir-category-list-in{margin-top:0}.geodir-cat-list .widget-title h2{margin:-13px -13px 13px}.widget .geodir-cat-list ul li.geodir-pcat-show a:before{display:none!important}.widget .geodir-cat-list ul li.geodir-pcat-show i{margin-right:5px}.container .geodir-search select{margin:0 3% 0 0;padding:8px 10px;width:13%}#geodir_carousel,#geodir_slider{border-radius:0;-webkit-border-radius:0;-moz-border-radius:0;margin-bottom:20px!important;border:1px solid #e1e1e1;box-shadow:none}#geodir_carousel{padding:10px}.geodir-tabs-content ol.commentlist{margin:40px 0;padding:0}li#post_mapTab{min-height:400px}#reviewsTab ol.commentlist li{border-bottom:none}#reviewsTab ol.commentlist li article.comment{border-bottom:1px solid #e1e1e1;padding-bottom:10px}.comment-content .rating{display:none}.comment-respond .gd_rating{margin-bottom:20px}div.geodir-rating{width:85px!important}.comment-respond .comment-notes{margin-bottom:10px}.average-review span,.comment-form label,.dtreviewed,.geodir-details-sidebar-user-links a,.geodir-viewall,.geodir_more_info span,.reviewer,dl.geodir-tab-head dd a{font-family:"Archivo Narrow",sans-serif}section.comment-content{margin:0 0 0 12%}#reviewsTab .comments-area .comment-content{width:auto}section.comment-content .description,section.comment-content p{margin:15px 0}dl.geodir-tab-head dd a{background:#f3f3f3;margin-top:-1px;font-size:14px;padding:0 15px}dl.geodir-tab-head dd.geodir-tab-active a{padding-bottom:1px}.geodir-widget .geodir_list_heading,.geodir-widget h3.widget-title{padding:0 15px;background:#e9e9e9;border:1px solid #dbdbdb;height:38px;line-height:38px;color:#2d2d2d}.geodir-widget .geodir_list_heading h3{background:0 0;border:none}.geodir-widget .geodir_list_heading{margin:-13px -14px 13px}.geodir-map-listing-page{border-width:1px 0 0;border-style:solid;border-color:#dbdbdb}.geodir-sidebar-wrap .geodir-company_info{margin:15px}.geodir-details-sidebar-social-sharing iframe{float:left}.geodir-details-sidebar-rating{overflow:hidden}.geodir-details-sidebar-rating .gd_rating_show,.geodir-details-sidebar-rating .geodir-rating{float:left;margin-right:15px}.geodir-details-sidebar-rating span.item{float:left;margin-top:5px}.geodir-details-sidebar-rating .average-review{top:-4px;position:relative}.geodir-details-sidebar-rating span.item img{margin-top:5px}.geodir_full_page{background:#fff;border:1px solid #e1e1e1;-webkit-box-shadow:0 1px 0 #e5e5e5;box-shadow:0 1px 0 #e5e5e5;padding:15px;margin-bottom:20px;clear:both}.geodir_map_container .main_list img{margin:0 5px}.geodir_category_list_view li.geodir-gridview .geodir-post-img .geodir_thumbnail{margin-bottom:10px}.geodir-addinfo .geodir-pinpoint,.geodir-addinfo a i{margin-right:5px}.geodir_category_list_view li.geodir-gridview h3{font-size:18px;margin-bottom:10px}#related_listingTab ul.geodir_category_list_view{padding:0!important}#reviewsTab #comments .gd_rating{margin-top:5px}.widget .geodir_category_list_view li .geodir-entry-content,.widget .geodir_category_list_view li a:before{display:none!important}.geodir_category_list_view li .geodir-entry-title{margin-bottom:10px}.widget ul.geodir_category_list_view{padding:15px}.sidebar .widget .geodir_category_list_view li{width:calc(100% - 25px)}.widget .geodir-loginbox-list li{overflow:visible!important}.widget ul.chosen-results{margin:0!important}.main_list_selecter{margin-right:5px}.geodir-viewall{float:right;width:auto!important}.widget-title h2{padding:0 15px;background:#e9e9e9;border:1px solid #dbdbdb;height:38px;line-height:38px}.widget:first-child .geodir_list_heading .widget-title{margin-top:0}.geodir_list_heading .widget-title{float:left;width:80%;margin-top:0}.geodir_list_heading .widget-title h2{padding:0 px;background:0 0;border:none;height:auto;line-height:auto}.chosen-default:before{content:none;display:none;position:absolute;margin-left:-1000000px;float:left}#geodir-wrapper .entry-crumbs{margin-bottom:20px}.geodir-search .mom-select{float:left;width:150px;margin:5px;border:1px solid #ddd;height:40px}.iprelative .gm-style .gm-style-iw{width:100%!important}'),
697
-        'geodir_theme_compat_js' => 'jQuery(document).ready(function(e){e(".geodir_full_page").length&&""===e.trim(e(".geodir_full_page").html())&&e(".geodir_full_page").css({display:"none"})});',
698
-        'geodir_theme_compat_default_options' => '',
699
-        'geodir_theme_compat_code' => 'Multi_News'
700
-    );
701
-
702
-    update_option('gd_theme_compats', $theme_compat);
703
-
704
-    gd_set_theme_compat();// set the compat pack if avail
655
+	$theme_compat['Multi_News'] = array(
656
+		'geodir_wrapper_open_id' => '',
657
+		'geodir_wrapper_open_class' => 'main-container clearfix',
658
+		'geodir_wrapper_open_replace' => '',
659
+		'geodir_wrapper_close_replace' => '',
660
+		'geodir_wrapper_content_open_id' => '',
661
+		'geodir_wrapper_content_open_class' => '',
662
+		'geodir_wrapper_content_open_replace' => '<div class="main-left" ><div class="main-content  "><div class="site-content page-wrap">',
663
+		'geodir_wrapper_content_close_replace' => '</div></div></div>',
664
+		'geodir_article_open_id' => '',
665
+		'geodir_article_open_class' => '',
666
+		'geodir_article_open_replace' => '',
667
+		'geodir_article_close_replace' => '',
668
+		'geodir_sidebar_right_open_id' => '',
669
+		'geodir_sidebar_right_open_class' => '',
670
+		'geodir_sidebar_right_open_replace' => '<aside  class="sidebar" role="complementary" itemscope itemtype="[itemtype]" >',
671
+		'geodir_sidebar_right_close_replace' => '',
672
+		'geodir_sidebar_left_open_id' => '',
673
+		'geodir_sidebar_left_open_class' => '',
674
+		'geodir_sidebar_left_open_replace' => '<aside  class="secondary-sidebar" role="complementary" itemscope itemtype="[itemtype]" >',
675
+		'geodir_sidebar_left_close_replace' => '',
676
+		'geodir_main_content_open_id' => '',
677
+		'geodir_main_content_open_class' => '',
678
+		'geodir_main_content_open_replace' => '<div class="site-content page-wrap">',
679
+		'geodir_main_content_close_replace' => '</div>',
680
+		'geodir_top_content_add' => '',
681
+		'geodir_before_main_content_add' => '',
682
+		'geodir_full_page_class_filter' => 'section full-width-section',
683
+		'geodir_before_widget_filter' => '',
684
+		'geodir_after_widget_filter' => '',
685
+		'geodir_before_title_filter' => '<div class="widget-title"><h2>',
686
+		'geodir_after_title_filter' => '</h2></div>',
687
+		'geodir_menu_li_class_filter' => '',
688
+		'geodir_sub_menu_ul_class_filter' => '',
689
+		'geodir_sub_menu_li_class_filter' => '',
690
+		'geodir_menu_a_class_filter' => '',
691
+		'geodir_sub_menu_a_class_filter' => '',
692
+		'geodir_location_switcher_menu_li_class_filter' => '',
693
+		'geodir_location_switcher_menu_a_class_filter' => '',
694
+		'geodir_location_switcher_menu_sub_ul_class_filter' => '',
695
+		'geodir_location_switcher_menu_sub_li_class_filter' => '',
696
+		'geodir_theme_compat_css' => stripslashes('.full-width-section .geodir-search{margin:0;width:100%}.geodir_full_page .geodir-search{margin:0 auto;float:none}.geodir-search input[type=button],.geodir-search input[type=submit]{width:13%}.geodir-search input[type=text]{border:1px solid #ddd;border-radius:0;padding:0 8px}.geodir-category-list-in,.geodir-loc-bar-in{background:#f2f2f2;border-color:#dbdbdb}.geodir-category-list-in{margin-top:0}.geodir-cat-list .widget-title h2{margin:-13px -13px 13px}.widget .geodir-cat-list ul li.geodir-pcat-show a:before{display:none!important}.widget .geodir-cat-list ul li.geodir-pcat-show i{margin-right:5px}.container .geodir-search select{margin:0 3% 0 0;padding:8px 10px;width:13%}#geodir_carousel,#geodir_slider{border-radius:0;-webkit-border-radius:0;-moz-border-radius:0;margin-bottom:20px!important;border:1px solid #e1e1e1;box-shadow:none}#geodir_carousel{padding:10px}.geodir-tabs-content ol.commentlist{margin:40px 0;padding:0}li#post_mapTab{min-height:400px}#reviewsTab ol.commentlist li{border-bottom:none}#reviewsTab ol.commentlist li article.comment{border-bottom:1px solid #e1e1e1;padding-bottom:10px}.comment-content .rating{display:none}.comment-respond .gd_rating{margin-bottom:20px}div.geodir-rating{width:85px!important}.comment-respond .comment-notes{margin-bottom:10px}.average-review span,.comment-form label,.dtreviewed,.geodir-details-sidebar-user-links a,.geodir-viewall,.geodir_more_info span,.reviewer,dl.geodir-tab-head dd a{font-family:"Archivo Narrow",sans-serif}section.comment-content{margin:0 0 0 12%}#reviewsTab .comments-area .comment-content{width:auto}section.comment-content .description,section.comment-content p{margin:15px 0}dl.geodir-tab-head dd a{background:#f3f3f3;margin-top:-1px;font-size:14px;padding:0 15px}dl.geodir-tab-head dd.geodir-tab-active a{padding-bottom:1px}.geodir-widget .geodir_list_heading,.geodir-widget h3.widget-title{padding:0 15px;background:#e9e9e9;border:1px solid #dbdbdb;height:38px;line-height:38px;color:#2d2d2d}.geodir-widget .geodir_list_heading h3{background:0 0;border:none}.geodir-widget .geodir_list_heading{margin:-13px -14px 13px}.geodir-map-listing-page{border-width:1px 0 0;border-style:solid;border-color:#dbdbdb}.geodir-sidebar-wrap .geodir-company_info{margin:15px}.geodir-details-sidebar-social-sharing iframe{float:left}.geodir-details-sidebar-rating{overflow:hidden}.geodir-details-sidebar-rating .gd_rating_show,.geodir-details-sidebar-rating .geodir-rating{float:left;margin-right:15px}.geodir-details-sidebar-rating span.item{float:left;margin-top:5px}.geodir-details-sidebar-rating .average-review{top:-4px;position:relative}.geodir-details-sidebar-rating span.item img{margin-top:5px}.geodir_full_page{background:#fff;border:1px solid #e1e1e1;-webkit-box-shadow:0 1px 0 #e5e5e5;box-shadow:0 1px 0 #e5e5e5;padding:15px;margin-bottom:20px;clear:both}.geodir_map_container .main_list img{margin:0 5px}.geodir_category_list_view li.geodir-gridview .geodir-post-img .geodir_thumbnail{margin-bottom:10px}.geodir-addinfo .geodir-pinpoint,.geodir-addinfo a i{margin-right:5px}.geodir_category_list_view li.geodir-gridview h3{font-size:18px;margin-bottom:10px}#related_listingTab ul.geodir_category_list_view{padding:0!important}#reviewsTab #comments .gd_rating{margin-top:5px}.widget .geodir_category_list_view li .geodir-entry-content,.widget .geodir_category_list_view li a:before{display:none!important}.geodir_category_list_view li .geodir-entry-title{margin-bottom:10px}.widget ul.geodir_category_list_view{padding:15px}.sidebar .widget .geodir_category_list_view li{width:calc(100% - 25px)}.widget .geodir-loginbox-list li{overflow:visible!important}.widget ul.chosen-results{margin:0!important}.main_list_selecter{margin-right:5px}.geodir-viewall{float:right;width:auto!important}.widget-title h2{padding:0 15px;background:#e9e9e9;border:1px solid #dbdbdb;height:38px;line-height:38px}.widget:first-child .geodir_list_heading .widget-title{margin-top:0}.geodir_list_heading .widget-title{float:left;width:80%;margin-top:0}.geodir_list_heading .widget-title h2{padding:0 px;background:0 0;border:none;height:auto;line-height:auto}.chosen-default:before{content:none;display:none;position:absolute;margin-left:-1000000px;float:left}#geodir-wrapper .entry-crumbs{margin-bottom:20px}.geodir-search .mom-select{float:left;width:150px;margin:5px;border:1px solid #ddd;height:40px}.iprelative .gm-style .gm-style-iw{width:100%!important}'),
697
+		'geodir_theme_compat_js' => 'jQuery(document).ready(function(e){e(".geodir_full_page").length&&""===e.trim(e(".geodir_full_page").html())&&e(".geodir_full_page").css({display:"none"})});',
698
+		'geodir_theme_compat_default_options' => '',
699
+		'geodir_theme_compat_code' => 'Multi_News'
700
+	);
701
+
702
+	update_option('gd_theme_compats', $theme_compat);
703
+
704
+	gd_set_theme_compat();// set the compat pack if avail
705 705
 }
706 706
 
707 707
 
@@ -713,61 +713,61 @@  discard block
 block discarded – undo
713 713
  * @global object $wpdb WordPress Database object.
714 714
  */
715 715
 function gd_convert_virtual_pages(){
716
-    global $wpdb;
717
-
718
-    // Update the add listing page settings
719
-    $add_listing_page = $wpdb->get_var(
720
-        $wpdb->prepare(
721
-            "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
722
-            array('add-listing')
723
-        )
724
-    );
725
-
726
-    if($add_listing_page){
727
-        wp_update_post( array('ID' => $add_listing_page, 'post_status' => 'publish') );
728
-        update_option( 'geodir_add_listing_page', $add_listing_page);
729
-    }
730
-
731
-    // Update the listing preview page settings
732
-    $listing_preview_page = $wpdb->get_var(
733
-        $wpdb->prepare(
734
-            "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
735
-            array('listing-preview')
736
-        )
737
-    );
738
-
739
-    if($listing_preview_page){
740
-        wp_update_post( array('ID' => $listing_preview_page, 'post_status' => 'publish') );
741
-        update_option( 'geodir_preview_page', $listing_preview_page);
742
-    }
743
-
744
-    // Update the listing success page settings
745
-    $listing_success_page = $wpdb->get_var(
746
-        $wpdb->prepare(
747
-            "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
748
-            array('listing-success')
749
-        )
750
-    );
751
-
752
-    if($listing_success_page){
753
-        wp_update_post( array('ID' => $listing_success_page, 'post_status' => 'publish') );
754
-        update_option( 'geodir_success_page', $listing_success_page);
755
-    }
756
-
757
-    // Update the listing success page settings
758
-    $location_page = $wpdb->get_var(
759
-        $wpdb->prepare(
760
-            "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
761
-            array('location')
762
-        )
763
-    );
764
-
765
-    if($location_page){
766
-        $location_slug = get_option('geodir_location_prefix');
767
-        if(!$location_slug ){$location_slug  = 'location';}
768
-        wp_update_post( array('ID' => $location_page, 'post_status' => 'publish','post_name' => $location_slug) );
769
-        update_option( 'geodir_location_page', $location_page);
770
-    }
716
+	global $wpdb;
717
+
718
+	// Update the add listing page settings
719
+	$add_listing_page = $wpdb->get_var(
720
+		$wpdb->prepare(
721
+			"SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
722
+			array('add-listing')
723
+		)
724
+	);
725
+
726
+	if($add_listing_page){
727
+		wp_update_post( array('ID' => $add_listing_page, 'post_status' => 'publish') );
728
+		update_option( 'geodir_add_listing_page', $add_listing_page);
729
+	}
730
+
731
+	// Update the listing preview page settings
732
+	$listing_preview_page = $wpdb->get_var(
733
+		$wpdb->prepare(
734
+			"SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
735
+			array('listing-preview')
736
+		)
737
+	);
738
+
739
+	if($listing_preview_page){
740
+		wp_update_post( array('ID' => $listing_preview_page, 'post_status' => 'publish') );
741
+		update_option( 'geodir_preview_page', $listing_preview_page);
742
+	}
743
+
744
+	// Update the listing success page settings
745
+	$listing_success_page = $wpdb->get_var(
746
+		$wpdb->prepare(
747
+			"SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
748
+			array('listing-success')
749
+		)
750
+	);
751
+
752
+	if($listing_success_page){
753
+		wp_update_post( array('ID' => $listing_success_page, 'post_status' => 'publish') );
754
+		update_option( 'geodir_success_page', $listing_success_page);
755
+	}
756
+
757
+	// Update the listing success page settings
758
+	$location_page = $wpdb->get_var(
759
+		$wpdb->prepare(
760
+			"SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
761
+			array('location')
762
+		)
763
+	);
764
+
765
+	if($location_page){
766
+		$location_slug = get_option('geodir_location_prefix');
767
+		if(!$location_slug ){$location_slug  = 'location';}
768
+		wp_update_post( array('ID' => $location_page, 'post_status' => 'publish','post_name' => $location_slug) );
769
+		update_option( 'geodir_location_page', $location_page);
770
+	}
771 771
 
772 772
 }
773 773
 
@@ -781,31 +781,31 @@  discard block
 block discarded – undo
781 781
 function gd_fix_cpt_rewrite_slug()
782 782
 {
783 783
 
784
-    $alt_post_types = array();
785
-    $post_types = get_option('geodir_post_types');
784
+	$alt_post_types = array();
785
+	$post_types = get_option('geodir_post_types');
786 786
 
787 787
 
788
-    if (is_array($post_types)){
788
+	if (is_array($post_types)){
789 789
 
790
-        foreach ($post_types as $post_type => $args) {
790
+		foreach ($post_types as $post_type => $args) {
791 791
 
792 792
 
793
-            if(isset($args['rewrite']['slug'])){
794
-                $args['rewrite']['slug'] = str_replace("/%gd_taxonomy%","",$args['rewrite']['slug']);
795
-            }
793
+			if(isset($args['rewrite']['slug'])){
794
+				$args['rewrite']['slug'] = str_replace("/%gd_taxonomy%","",$args['rewrite']['slug']);
795
+			}
796 796
 
797
-                $alt_post_types[$post_type] = $args;
797
+				$alt_post_types[$post_type] = $args;
798 798
 
799
-        }
800
-    }
799
+		}
800
+	}
801 801
 
802
-    if(!empty($alt_post_types)) {
803
-        update_option('geodir_post_types',$alt_post_types);
804
-        }
802
+	if(!empty($alt_post_types)) {
803
+		update_option('geodir_post_types',$alt_post_types);
804
+		}
805 805
 
806 806
 
807
-    // flush the rewrite rules
808
-    flush_rewrite_rules();
807
+	// flush the rewrite rules
808
+	flush_rewrite_rules();
809 809
 }
810 810
 
811 811
 
@@ -818,18 +818,18 @@  discard block
 block discarded – undo
818 818
  */
819 819
 function gd_fix_address_detail_table_limit()
820 820
 {
821
-    global $wpdb;
822
-
823
-    $all_postypes = geodir_get_posttypes();
824
-
825
-    if (!empty($all_postypes)) {
826
-        foreach ($all_postypes as $key) {
827
-            // update each GD CTP
828
-            try {
829
-                $wpdb->query("ALTER TABLE " . $wpdb->prefix . "geodir_" . $key . "_detail MODIFY post_city VARCHAR( 50 ) NULL,MODIFY post_region VARCHAR( 50 ) NULL,MODIFY post_country VARCHAR( 50 ) NULL");
830
-            } catch(Exception $e) {
831
-                error_log( 'Error: ' . $e->getMessage() );
832
-            }
833
-        }
834
-    }
821
+	global $wpdb;
822
+
823
+	$all_postypes = geodir_get_posttypes();
824
+
825
+	if (!empty($all_postypes)) {
826
+		foreach ($all_postypes as $key) {
827
+			// update each GD CTP
828
+			try {
829
+				$wpdb->query("ALTER TABLE " . $wpdb->prefix . "geodir_" . $key . "_detail MODIFY post_city VARCHAR( 50 ) NULL,MODIFY post_region VARCHAR( 50 ) NULL,MODIFY post_country VARCHAR( 50 ) NULL");
830
+			} catch(Exception $e) {
831
+				error_log( 'Error: ' . $e->getMessage() );
832
+			}
833
+		}
834
+	}
835 835
 }
Please login to merge, or discard this patch.
Spacing   +58 added lines, -58 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 
10 10
 global $wpdb;
11 11
 
12
-if (get_option('geodirectory' . '_db_version') != GEODIRECTORY_VERSION) {
12
+if (get_option('geodirectory'.'_db_version') != GEODIRECTORY_VERSION) {
13 13
     /**
14 14
      * Include custom database table related functions.
15 15
      *
@@ -48,9 +48,9 @@  discard block
 block discarded – undo
48 48
 
49 49
 
50 50
 
51
-    add_action('init', 'gd_fix_cpt_rewrite_slug', 11);// this needs to be kept for a few versions
51
+    add_action('init', 'gd_fix_cpt_rewrite_slug', 11); // this needs to be kept for a few versions
52 52
 
53
-    update_option('geodirectory' . '_db_version', GEODIRECTORY_VERSION);
53
+    update_option('geodirectory'.'_db_version', GEODIRECTORY_VERSION);
54 54
 
55 55
 }
56 56
 
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
  * @since 1.0.0
87 87
  * @package GeoDirectory
88 88
  */
89
-function geodir_upgrade_146(){
89
+function geodir_upgrade_146() {
90 90
     gd_convert_virtual_pages();
91 91
 }
92 92
 
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
  * @since 1.5.0
97 97
  * @package GeoDirectory
98 98
  */
99
-function geodir_upgrade_150(){
99
+function geodir_upgrade_150() {
100 100
     gd_fix_cpt_rewrite_slug();
101 101
 }
102 102
 
@@ -108,12 +108,12 @@  discard block
 block discarded – undo
108 108
  * @since 1.4.8
109 109
  * @package GeoDirectory
110 110
  */
111
-function geodir_upgrade_148(){
111
+function geodir_upgrade_148() {
112 112
     /*
113 113
      * Blank the users google password if present as we now use oAuth 2.0
114 114
      */
115
-    update_option('geodir_ga_pass','');
116
-    update_option('geodir_ga_user','');
115
+    update_option('geodir_ga_pass', '');
116
+    update_option('geodir_ga_user', '');
117 117
 
118 118
 }
119 119
 
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
  * @since 1.5.3
125 125
  * @package GeoDirectory
126 126
  */
127
-function geodir_upgrade_153(){
127
+function geodir_upgrade_153() {
128 128
     geodir_create_page(esc_sql(_x('gd-info', 'page_slug', 'geodirectory')), 'geodir_info_page', __('Info', 'geodirectory'), '');
129 129
     geodir_create_page(esc_sql(_x('gd-login', 'page_slug', 'geodirectory')), 'geodir_login_page', __('Login', 'geodirectory'), '');
130 130
 }
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
  * @since 1.5.3
136 136
  * @package GeoDirectory
137 137
  */
138
-function geodir_upgrade_154(){
138
+function geodir_upgrade_154() {
139 139
     geodir_create_page(esc_sql(_x('gd-home', 'page_slug', 'geodirectory')), 'geodir_home_page', __('GD Home page', 'geodirectory'), '');
140 140
 }
141 141
 
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
  * @since 1.5.2
146 146
  * @package GeoDirectory
147 147
  */
148
-function geodir_upgrade_152(){
148
+function geodir_upgrade_152() {
149 149
     gd_fix_address_detail_table_limit();
150 150
 }
151 151
 
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 function geodir_fix_review_date()
182 182
 {
183 183
     global $wpdb;
184
-    $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.post_date = c.comment_date WHERE gdr.post_date='0000-00-00 00:00:00'");
184
+    $wpdb->query("UPDATE ".GEODIR_REVIEW_TABLE." gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.post_date = c.comment_date WHERE gdr.post_date='0000-00-00 00:00:00'");
185 185
 }
186 186
 
187 187
 /**
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
 function geodir_fix_review_post_status()
195 195
 {
196 196
     global $wpdb;
197
-    $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->posts p ON gdr.post_id=p.ID SET gdr.post_status = 1 WHERE gdr.post_status IS NULL AND p.post_status='publish'");
197
+    $wpdb->query("UPDATE ".GEODIR_REVIEW_TABLE." gdr JOIN $wpdb->posts p ON gdr.post_id=p.ID SET gdr.post_status = 1 WHERE gdr.post_status IS NULL AND p.post_status='publish'");
198 198
 }
199 199
 
200 200
 /**
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 function geodir_fix_review_content()
209 209
 {
210 210
     global $wpdb;
211
-    if ($wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.comment_content = c.comment_content WHERE gdr.comment_content IS NULL")) {
211
+    if ($wpdb->query("UPDATE ".GEODIR_REVIEW_TABLE." gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.comment_content = c.comment_content WHERE gdr.comment_content IS NULL")) {
212 212
         return true;
213 213
     } else {
214 214
         return false;
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
         foreach ($all_postypes as $key) {
234 234
             // update each GD CTP
235 235
 
236
-            $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN " . $wpdb->prefix . "geodir_" . $key . "_detail d ON gdr.post_id=d.post_id SET gdr.post_latitude = d.post_latitude, gdr.post_longitude = d.post_longitude, gdr.post_city = d.post_city,  gdr.post_region=d.post_region, gdr.post_country=d.post_country WHERE gdr.post_latitude IS NULL OR gdr.post_city IS NULL");
236
+            $wpdb->query("UPDATE ".GEODIR_REVIEW_TABLE." gdr JOIN ".$wpdb->prefix."geodir_".$key."_detail d ON gdr.post_id=d.post_id SET gdr.post_latitude = d.post_latitude, gdr.post_longitude = d.post_longitude, gdr.post_city = d.post_city,  gdr.post_region=d.post_region, gdr.post_country=d.post_country WHERE gdr.post_latitude IS NULL OR gdr.post_city IS NULL");
237 237
 
238 238
         }
239 239
         return true;
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
     if (!empty($all_postypes)) {
258 258
         foreach ($all_postypes as $key) {
259 259
             // update each GD CTP
260
-            $reviews = $wpdb->get_results("SELECT post_id FROM " . $wpdb->prefix . "geodir_" . $key . "_detail d");
260
+            $reviews = $wpdb->get_results("SELECT post_id FROM ".$wpdb->prefix."geodir_".$key."_detail d");
261 261
 
262 262
             if (!empty($reviews)) {
263 263
                 foreach ($reviews as $post_id) {
@@ -272,51 +272,51 @@  discard block
 block discarded – undo
272 272
 }
273 273
 
274 274
 
275
-function gd_convert_custom_field_display(){
275
+function gd_convert_custom_field_display() {
276 276
     global $wpdb;
277 277
 
278
-    $field_info = $wpdb->get_results("select * from " . GEODIR_CUSTOM_FIELDS_TABLE);
278
+    $field_info = $wpdb->get_results("select * from ".GEODIR_CUSTOM_FIELDS_TABLE);
279 279
 
280 280
     $has_run = get_option('gd_convert_custom_field_display');
281
-    if($has_run){return;}
281
+    if ($has_run) {return; }
282 282
 
283 283
     // set the field_type_key for standard fields
284 284
     $wpdb->query("UPDATE ".GEODIR_CUSTOM_FIELDS_TABLE." SET field_type_key = field_type");
285 285
 
286 286
 
287
-    if(is_array( $field_info)){
287
+    if (is_array($field_info)) {
288 288
 
289
-        foreach( $field_info as $cf){
289
+        foreach ($field_info as $cf) {
290 290
 
291 291
             $id = $cf->id;
292 292
 
293
-            if(!property_exists($cf,'show_in') || !$id){return;}
293
+            if (!property_exists($cf, 'show_in') || !$id) {return; }
294 294
 
295 295
             $show_in_arr = array();
296 296
 
297
-            if($cf->is_default){
297
+            if ($cf->is_default) {
298 298
                 $show_in_arr[] = "[detail]";
299 299
             }
300 300
 
301
-            if($cf->show_on_detail){
301
+            if ($cf->show_on_detail) {
302 302
                 $show_in_arr[] = "[moreinfo]";
303 303
             }
304 304
 
305
-            if($cf->show_on_listing){
305
+            if ($cf->show_on_listing) {
306 306
                 $show_in_arr[] = "[listing]";
307 307
             }
308 308
 
309
-            if($cf->show_as_tab || $cf->htmlvar_name=='geodir_video' || $cf->htmlvar_name=='geodir_special_offers'){
309
+            if ($cf->show_as_tab || $cf->htmlvar_name == 'geodir_video' || $cf->htmlvar_name == 'geodir_special_offers') {
310 310
                 $show_in_arr[] = "[owntab]";
311 311
             }
312 312
 
313
-            if($cf->htmlvar_name=='post' || $cf->htmlvar_name=='geodir_contact' || $cf->htmlvar_name=='geodir_timing'){
313
+            if ($cf->htmlvar_name == 'post' || $cf->htmlvar_name == 'geodir_contact' || $cf->htmlvar_name == 'geodir_timing') {
314 314
                 $show_in_arr[] = "[mapbubble]";
315 315
             }
316 316
 
317
-            if(!empty($show_in_arr )){
318
-                $show_in_arr = implode(',',$show_in_arr);
319
-            }else{
317
+            if (!empty($show_in_arr)) {
318
+                $show_in_arr = implode(',', $show_in_arr);
319
+            } else {
320 320
                 $show_in_arr = '';
321 321
             }
322 322
 
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
 
325 325
         }
326 326
 
327
-        update_option('gd_convert_custom_field_display',1);
327
+        update_option('gd_convert_custom_field_display', 1);
328 328
     }
329 329
 }
330 330
 
@@ -701,7 +701,7 @@  discard block
 block discarded – undo
701 701
 
702 702
     update_option('gd_theme_compats', $theme_compat);
703 703
 
704
-    gd_set_theme_compat();// set the compat pack if avail
704
+    gd_set_theme_compat(); // set the compat pack if avail
705 705
 }
706 706
 
707 707
 
@@ -712,61 +712,61 @@  discard block
 block discarded – undo
712 712
  * @package GeoDirectory
713 713
  * @global object $wpdb WordPress Database object.
714 714
  */
715
-function gd_convert_virtual_pages(){
715
+function gd_convert_virtual_pages() {
716 716
     global $wpdb;
717 717
 
718 718
     // Update the add listing page settings
719 719
     $add_listing_page = $wpdb->get_var(
720 720
         $wpdb->prepare(
721
-            "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
721
+            "SELECT ID FROM ".$wpdb->posts." WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
722 722
             array('add-listing')
723 723
         )
724 724
     );
725 725
 
726
-    if($add_listing_page){
727
-        wp_update_post( array('ID' => $add_listing_page, 'post_status' => 'publish') );
728
-        update_option( 'geodir_add_listing_page', $add_listing_page);
726
+    if ($add_listing_page) {
727
+        wp_update_post(array('ID' => $add_listing_page, 'post_status' => 'publish'));
728
+        update_option('geodir_add_listing_page', $add_listing_page);
729 729
     }
730 730
 
731 731
     // Update the listing preview page settings
732 732
     $listing_preview_page = $wpdb->get_var(
733 733
         $wpdb->prepare(
734
-            "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
734
+            "SELECT ID FROM ".$wpdb->posts." WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
735 735
             array('listing-preview')
736 736
         )
737 737
     );
738 738
 
739
-    if($listing_preview_page){
740
-        wp_update_post( array('ID' => $listing_preview_page, 'post_status' => 'publish') );
741
-        update_option( 'geodir_preview_page', $listing_preview_page);
739
+    if ($listing_preview_page) {
740
+        wp_update_post(array('ID' => $listing_preview_page, 'post_status' => 'publish'));
741
+        update_option('geodir_preview_page', $listing_preview_page);
742 742
     }
743 743
 
744 744
     // Update the listing success page settings
745 745
     $listing_success_page = $wpdb->get_var(
746 746
         $wpdb->prepare(
747
-            "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
747
+            "SELECT ID FROM ".$wpdb->posts." WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
748 748
             array('listing-success')
749 749
         )
750 750
     );
751 751
 
752
-    if($listing_success_page){
753
-        wp_update_post( array('ID' => $listing_success_page, 'post_status' => 'publish') );
754
-        update_option( 'geodir_success_page', $listing_success_page);
752
+    if ($listing_success_page) {
753
+        wp_update_post(array('ID' => $listing_success_page, 'post_status' => 'publish'));
754
+        update_option('geodir_success_page', $listing_success_page);
755 755
     }
756 756
 
757 757
     // Update the listing success page settings
758 758
     $location_page = $wpdb->get_var(
759 759
         $wpdb->prepare(
760
-            "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
760
+            "SELECT ID FROM ".$wpdb->posts." WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
761 761
             array('location')
762 762
         )
763 763
     );
764 764
 
765
-    if($location_page){
765
+    if ($location_page) {
766 766
         $location_slug = get_option('geodir_location_prefix');
767
-        if(!$location_slug ){$location_slug  = 'location';}
768
-        wp_update_post( array('ID' => $location_page, 'post_status' => 'publish','post_name' => $location_slug) );
769
-        update_option( 'geodir_location_page', $location_page);
767
+        if (!$location_slug) {$location_slug = 'location'; }
768
+        wp_update_post(array('ID' => $location_page, 'post_status' => 'publish', 'post_name' => $location_slug));
769
+        update_option('geodir_location_page', $location_page);
770 770
     }
771 771
 
772 772
 }
@@ -785,13 +785,13 @@  discard block
 block discarded – undo
785 785
     $post_types = get_option('geodir_post_types');
786 786
 
787 787
 
788
-    if (is_array($post_types)){
788
+    if (is_array($post_types)) {
789 789
 
790 790
         foreach ($post_types as $post_type => $args) {
791 791
 
792 792
 
793
-            if(isset($args['rewrite']['slug'])){
794
-                $args['rewrite']['slug'] = str_replace("/%gd_taxonomy%","",$args['rewrite']['slug']);
793
+            if (isset($args['rewrite']['slug'])) {
794
+                $args['rewrite']['slug'] = str_replace("/%gd_taxonomy%", "", $args['rewrite']['slug']);
795 795
             }
796 796
 
797 797
                 $alt_post_types[$post_type] = $args;
@@ -799,8 +799,8 @@  discard block
 block discarded – undo
799 799
         }
800 800
     }
801 801
 
802
-    if(!empty($alt_post_types)) {
803
-        update_option('geodir_post_types',$alt_post_types);
802
+    if (!empty($alt_post_types)) {
803
+        update_option('geodir_post_types', $alt_post_types);
804 804
         }
805 805
 
806 806
 
@@ -826,9 +826,9 @@  discard block
 block discarded – undo
826 826
         foreach ($all_postypes as $key) {
827 827
             // update each GD CTP
828 828
             try {
829
-                $wpdb->query("ALTER TABLE " . $wpdb->prefix . "geodir_" . $key . "_detail MODIFY post_city VARCHAR( 50 ) NULL,MODIFY post_region VARCHAR( 50 ) NULL,MODIFY post_country VARCHAR( 50 ) NULL");
830
-            } catch(Exception $e) {
831
-                error_log( 'Error: ' . $e->getMessage() );
829
+                $wpdb->query("ALTER TABLE ".$wpdb->prefix."geodir_".$key."_detail MODIFY post_city VARCHAR( 50 ) NULL,MODIFY post_region VARCHAR( 50 ) NULL,MODIFY post_country VARCHAR( 50 ) NULL");
830
+            } catch (Exception $e) {
831
+                error_log('Error: '.$e->getMessage());
832 832
             }
833 833
         }
834 834
     }
Please login to merge, or discard this patch.
geodirectory-functions/custom_fields_output_functions.php 3 patches
Braces   +25 added lines, -38 removed lines patch added patch discarded remove patch
@@ -22,8 +22,7 @@  discard block
 block discarded – undo
22 22
 function geodir_cf_checkbox($html,$location,$cf,$p=''){
23 23
 
24 24
     // check we have the post value
25
-    if(is_int($p)){$post = geodir_get_post_info($p);}
26
-    else{ global $post;}
25
+    if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;}
27 26
 
28 27
     if(!is_array($cf) && $cf!=''){
29 28
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
@@ -76,8 +75,10 @@  discard block
 block discarded – undo
76 75
 
77 76
             if ( $post->{$html_var} == '1' ):
78 77
                 $html_val = __( 'Yes', 'geodirectory' );
79
-            else:
78
+            else {
79
+            	:
80 80
                 $html_val = __( 'No', 'geodirectory' );
81
+            }
81 82
             endif;
82 83
 
83 84
             $field_icon = geodir_field_icon_proccess($cf);
@@ -115,8 +116,7 @@  discard block
 block discarded – undo
115 116
 function geodir_cf_fieldset($html,$location,$cf,$p=''){
116 117
 
117 118
     // check we have the post value
118
-    if(is_int($p)){$post = geodir_get_post_info($p);}
119
-    else{ global $post;}
119
+    if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;}
120 120
 
121 121
     if(!is_array($cf) && $cf!=''){
122 122
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
@@ -195,8 +195,7 @@  discard block
 block discarded – undo
195 195
 function geodir_cf_url($html,$location,$cf,$p=''){
196 196
 
197 197
     // check we have the post value
198
-    if(is_int($p)){$post = geodir_get_post_info($p);}
199
-    else{ global $post;}
198
+    if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;}
200 199
 
201 200
     if(!is_array($cf) && $cf!=''){
202 201
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
@@ -310,8 +309,7 @@  discard block
 block discarded – undo
310 309
 function geodir_cf_phone($html,$location,$cf,$p=''){
311 310
 
312 311
     // check we have the post value
313
-    if(is_int($p)){$post = geodir_get_post_info($p);}
314
-    else{ global $post;}
312
+    if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;}
315 313
 
316 314
     if(!is_array($cf) && $cf!=''){
317 315
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
@@ -399,8 +397,7 @@  discard block
 block discarded – undo
399 397
 function geodir_cf_time($html,$location,$cf,$p=''){
400 398
 
401 399
     // check we have the post value
402
-    if(is_int($p)){$post = geodir_get_post_info($p);}
403
-    else{ global $post;}
400
+    if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;}
404 401
 
405 402
     if(!is_array($cf) && $cf!=''){
406 403
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
@@ -452,9 +449,10 @@  discard block
 block discarded – undo
452 449
         if ($post->{$cf['htmlvar_name']}):
453 450
 
454 451
             $value = '';
455
-            if ($post->{$cf['htmlvar_name']} != '')
456
-                //$value = date('h:i',strtotime($post->{$cf['htmlvar_name']}));
452
+            if ($post->{$cf['htmlvar_name']} != '') {
453
+                            //$value = date('h:i',strtotime($post->{$cf['htmlvar_name']}));
457 454
                 $value = date(get_option('time_format'), strtotime($post->{$cf['htmlvar_name']}));
455
+            }
458 456
 
459 457
             $field_icon = geodir_field_icon_proccess($cf);
460 458
             if (strpos($field_icon, 'http') !== false) {
@@ -493,8 +491,7 @@  discard block
 block discarded – undo
493 491
 function geodir_cf_datepicker($html,$location,$cf,$p=''){
494 492
 
495 493
     // check we have the post value
496
-    if(is_int($p)){$post = geodir_get_post_info($p);}
497
-    else{ global $post;}
494
+    if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;}
498 495
 
499 496
     if(!is_array($cf) && $cf!=''){
500 497
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
@@ -560,13 +557,13 @@  discard block
 block discarded – undo
560 557
                 $date_format = str_replace($search, $replace, $date_format);
561 558
 
562 559
                 $post_htmlvar_value = ($date_format == 'd/m/Y' || $date_format == 'j/n/Y' ) ? str_replace('/', '-', $post->{$cf['htmlvar_name']}) : $post->{$cf['htmlvar_name']}; // PHP doesn't work well with dd/mm/yyyy format
563
-            }else{
560
+            } else{
564 561
                 $post_htmlvar_value = $post->{$cf['htmlvar_name']};
565 562
             }
566 563
 
567 564
             if ($post->{$cf['htmlvar_name']} != '' && $post->{$cf['htmlvar_name']}!="0000-00-00") {
568 565
                 $value = date_i18n($date_format, strtotime($post_htmlvar_value));
569
-            }else{
566
+            } else{
570 567
                 return '';
571 568
             }
572 569
 
@@ -609,8 +606,7 @@  discard block
 block discarded – undo
609 606
 function geodir_cf_text($html,$location,$cf,$p=''){
610 607
 
611 608
     // check we have the post value
612
-    if(is_int($p)){$post = geodir_get_post_info($p);}
613
-    else{ global $post;}
609
+    if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;}
614 610
 
615 611
     if(!is_array($cf) && $cf!=''){
616 612
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
@@ -700,8 +696,7 @@  discard block
 block discarded – undo
700 696
 function geodir_cf_radio($html,$location,$cf,$p=''){
701 697
 
702 698
     // check we have the post value
703
-    if(is_int($p)){$post = geodir_get_post_info($p);}
704
-    else{ global $post;}
699
+    if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;}
705 700
 
706 701
     if(!is_array($cf) && $cf!=''){
707 702
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
@@ -807,8 +802,7 @@  discard block
 block discarded – undo
807 802
 function geodir_cf_select($html,$location,$cf,$p=''){
808 803
 
809 804
     // check we have the post value
810
-    if(is_int($p)){$post = geodir_get_post_info($p);}
811
-    else{ global $post;}
805
+    if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;}
812 806
 
813 807
     if(!is_array($cf) && $cf!=''){
814 808
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
@@ -908,8 +902,7 @@  discard block
 block discarded – undo
908 902
 function geodir_cf_multiselect($html,$location,$cf,$p=''){
909 903
 
910 904
     // check we have the post value
911
-    if(is_int($p)){$post = geodir_get_post_info($p);}
912
-    else{ global $post;}
905
+    if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;}
913 906
 
914 907
     if(!is_array($cf) && $cf!=''){
915 908
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
@@ -1030,8 +1023,7 @@  discard block
 block discarded – undo
1030 1023
 function geodir_cf_email($html,$location,$cf,$p=''){
1031 1024
 
1032 1025
     // check we have the post value
1033
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1034
-    else{ global $post;}
1026
+    if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;}
1035 1027
 
1036 1028
     if(!is_array($cf) && $cf!=''){
1037 1029
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
@@ -1162,7 +1154,7 @@  discard block
 block discarded – undo
1162 1154
                      */
1163 1155
                     $email_name = apply_filters('geodir_email_field_name_output',$email,$cf);
1164 1156
                     $html .=  "<script>document.write('<a href=\"mailto:'+'$e_split[0]' + '@' + '$e_split[1]'+'\">$email_name</a>')</script>";
1165
-                }else{
1157
+                } else{
1166 1158
                     $html .=  $email;
1167 1159
                 }
1168 1160
                 $html .= '</span></div>';
@@ -1190,8 +1182,7 @@  discard block
 block discarded – undo
1190 1182
 function geodir_cf_file($html,$location,$cf,$p=''){
1191 1183
 
1192 1184
     // check we have the post value
1193
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1194
-    else{ global $post;}
1185
+    if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;}
1195 1186
 
1196 1187
     if(!is_array($cf) && $cf!=''){
1197 1188
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
@@ -1330,8 +1321,7 @@  discard block
 block discarded – undo
1330 1321
 function geodir_cf_textarea($html,$location,$cf,$p=''){
1331 1322
 
1332 1323
     // check we have the post value
1333
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1334
-    else{ global $post;}
1324
+    if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;}
1335 1325
 
1336 1326
     if(!is_array($cf) && $cf!=''){
1337 1327
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
@@ -1420,8 +1410,7 @@  discard block
 block discarded – undo
1420 1410
 function geodir_cf_html($html,$location,$cf,$p=''){
1421 1411
 
1422 1412
     // check we have the post value
1423
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1424
-    else{ global $post;}
1413
+    if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;}
1425 1414
 
1426 1415
     if(!is_array($cf) && $cf!=''){
1427 1416
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
@@ -1509,8 +1498,7 @@  discard block
 block discarded – undo
1509 1498
 function geodir_cf_taxonomy($html,$location,$cf,$p=''){
1510 1499
 
1511 1500
     // check we have the post value
1512
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1513
-    else{ global $post;}
1501
+    if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;}
1514 1502
 
1515 1503
     if(!is_array($cf) && $cf!=''){
1516 1504
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
@@ -1631,8 +1619,7 @@  discard block
 block discarded – undo
1631 1619
 function geodir_cf_address($html,$location,$cf,$p=''){
1632 1620
 
1633 1621
     // check we have the post value
1634
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1635
-    else{ global $post;}
1622
+    if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;}
1636 1623
 
1637 1624
     if(!is_array($cf) && $cf!=''){
1638 1625
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
Please login to merge, or discard this patch.
Indentation   +1538 added lines, -1538 removed lines patch added patch discarded remove patch
@@ -21,84 +21,84 @@  discard block
 block discarded – undo
21 21
  */
22 22
 function geodir_cf_checkbox($html,$location,$cf,$p=''){
23 23
 
24
-    // check we have the post value
25
-    if(is_int($p)){$post = geodir_get_post_info($p);}
26
-    else{ global $post;}
27
-
28
-    if(!is_array($cf) && $cf!=''){
29
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
30
-        if(!$cf){return NULL;}
31
-    }
32
-
33
-    $html_var = $cf['htmlvar_name'];
34
-
35
-    // Check if there is a location specific filter.
36
-    if(has_filter("geodir_custom_field_output_checkbox_loc_{$location}")){
37
-        /**
38
-         * Filter the checkbox html by location.
39
-         *
40
-         * @param string $html The html to filter.
41
-         * @param array $cf The custom field array.
42
-         * @since 1.6.6
43
-         */
44
-        $html = apply_filters("geodir_custom_field_output_checkbox_loc_{$location}",$html,$cf);
45
-    }
46
-
47
-    // Check if there is a custom field specific filter.
48
-    if(has_filter("geodir_custom_field_output_checkbox_var_{$html_var}")){
49
-        /**
50
-         * Filter the checkbox html by individual custom field.
51
-         *
52
-         * @param string $html The html to filter.
53
-         * @param string $location The location to output the html.
54
-         * @param array $cf The custom field array.
55
-         * @since 1.6.6
56
-         */
57
-        $html = apply_filters("geodir_custom_field_output_checkbox_var_{$html_var}",$html,$location,$cf);
58
-    }
59
-
60
-    // Check if there is a custom field key specific filter.
61
-    if(has_filter("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}")){
62
-        /**
63
-         * Filter the checkbox html by field type key.
64
-         *
65
-         * @param string $html The html to filter.
66
-         * @param string $location The location to output the html.
67
-         * @param array $cf The custom field array.
68
-         * @since 1.6.6
69
-         */
70
-        $html = apply_filters("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}",$html,$location,$cf);
71
-    }
72
-
73
-    // If not html then we run the standard output.
74
-    if(empty($html)){
75
-
76
-        if ( (int) $post->{$html_var} == 1 ):
77
-
78
-            if ( $post->{$html_var} == '1' ):
79
-                $html_val = __( 'Yes', 'geodirectory' );
80
-            else:
81
-                $html_val = __( 'No', 'geodirectory' );
82
-            endif;
83
-
84
-            $field_icon = geodir_field_icon_proccess($cf);
85
-            if (strpos($field_icon, 'http') !== false) {
86
-                $field_icon_af = '';
87
-            } elseif ($field_icon == '') {
88
-                $field_icon_af = '';
89
-            } else {
90
-                $field_icon_af = $field_icon;
91
-                $field_icon = '';
92
-            }
93
-
94
-            $html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-checkbox" style="' . $field_icon . '">' . $field_icon_af;
95
-            $html .= ( trim( $cf['site_title'] ) ) ? __( $cf['site_title'], 'geodirectory' ) . ': ' : '';
96
-            $html .= '</span>' . $html_val . '</div>';
97
-        endif;
98
-
99
-    }
100
-
101
-    return $html;
24
+	// check we have the post value
25
+	if(is_int($p)){$post = geodir_get_post_info($p);}
26
+	else{ global $post;}
27
+
28
+	if(!is_array($cf) && $cf!=''){
29
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
30
+		if(!$cf){return NULL;}
31
+	}
32
+
33
+	$html_var = $cf['htmlvar_name'];
34
+
35
+	// Check if there is a location specific filter.
36
+	if(has_filter("geodir_custom_field_output_checkbox_loc_{$location}")){
37
+		/**
38
+		 * Filter the checkbox html by location.
39
+		 *
40
+		 * @param string $html The html to filter.
41
+		 * @param array $cf The custom field array.
42
+		 * @since 1.6.6
43
+		 */
44
+		$html = apply_filters("geodir_custom_field_output_checkbox_loc_{$location}",$html,$cf);
45
+	}
46
+
47
+	// Check if there is a custom field specific filter.
48
+	if(has_filter("geodir_custom_field_output_checkbox_var_{$html_var}")){
49
+		/**
50
+		 * Filter the checkbox html by individual custom field.
51
+		 *
52
+		 * @param string $html The html to filter.
53
+		 * @param string $location The location to output the html.
54
+		 * @param array $cf The custom field array.
55
+		 * @since 1.6.6
56
+		 */
57
+		$html = apply_filters("geodir_custom_field_output_checkbox_var_{$html_var}",$html,$location,$cf);
58
+	}
59
+
60
+	// Check if there is a custom field key specific filter.
61
+	if(has_filter("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}")){
62
+		/**
63
+		 * Filter the checkbox html by field type key.
64
+		 *
65
+		 * @param string $html The html to filter.
66
+		 * @param string $location The location to output the html.
67
+		 * @param array $cf The custom field array.
68
+		 * @since 1.6.6
69
+		 */
70
+		$html = apply_filters("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}",$html,$location,$cf);
71
+	}
72
+
73
+	// If not html then we run the standard output.
74
+	if(empty($html)){
75
+
76
+		if ( (int) $post->{$html_var} == 1 ):
77
+
78
+			if ( $post->{$html_var} == '1' ):
79
+				$html_val = __( 'Yes', 'geodirectory' );
80
+			else:
81
+				$html_val = __( 'No', 'geodirectory' );
82
+			endif;
83
+
84
+			$field_icon = geodir_field_icon_proccess($cf);
85
+			if (strpos($field_icon, 'http') !== false) {
86
+				$field_icon_af = '';
87
+			} elseif ($field_icon == '') {
88
+				$field_icon_af = '';
89
+			} else {
90
+				$field_icon_af = $field_icon;
91
+				$field_icon = '';
92
+			}
93
+
94
+			$html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-checkbox" style="' . $field_icon . '">' . $field_icon_af;
95
+			$html .= ( trim( $cf['site_title'] ) ) ? __( $cf['site_title'], 'geodirectory' ) . ': ' : '';
96
+			$html .= '</span>' . $html_val . '</div>';
97
+		endif;
98
+
99
+	}
100
+
101
+	return $html;
102 102
 }
103 103
 add_filter('geodir_custom_field_output_checkbox','geodir_cf_checkbox',10,3);
104 104
 
@@ -115,71 +115,71 @@  discard block
 block discarded – undo
115 115
  */
116 116
 function geodir_cf_fieldset($html,$location,$cf,$p=''){
117 117
 
118
-    // check we have the post value
119
-    if(is_int($p)){$post = geodir_get_post_info($p);}
120
-    else{ global $post;}
121
-
122
-    if(!is_array($cf) && $cf!=''){
123
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
124
-        if(!$cf){return NULL;}
125
-    }
126
-
127
-    $html_var = $cf['htmlvar_name'];
128
-
129
-    // Check if there is a location specific filter.
130
-    if(has_filter("geodir_custom_field_output_fieldset_loc_{$location}")){
131
-        /**
132
-         * Filter the fieldset html by location.
133
-         *
134
-         * @param string $html The html to filter.
135
-         * @param array $cf The custom field array.
136
-         * @since 1.6.6
137
-         */
138
-        $html = apply_filters("geodir_custom_field_output_fieldset_loc_{$location}",$html,$cf);
139
-    }
140
-
141
-    // Check if there is a custom field specific filter.
142
-    if(has_filter("geodir_custom_field_output_fieldset_var_{$html_var}")){
143
-        /**
144
-         * Filter the fieldset html by individual custom field.
145
-         *
146
-         * @param string $html The html to filter.
147
-         * @param string $location The location to output the html.
148
-         * @param array $cf The custom field array.
149
-         * @since 1.6.6
150
-         */
151
-        $html = apply_filters("geodir_custom_field_output_fieldset_var_{$html_var}",$html,$location,$cf);
152
-    }
153
-
154
-    // Check if there is a custom field key specific filter.
155
-    if(has_filter("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}")){
156
-        /**
157
-         * Filter the fieldset html by field type key.
158
-         *
159
-         * @param string $html The html to filter.
160
-         * @param string $location The location to output the html.
161
-         * @param array $cf The custom field array.
162
-         * @since 1.6.6
163
-         */
164
-        $html = apply_filters("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}",$html,$location,$cf);
165
-    }
166
-
167
-    // If not html then we run the standard output.
168
-    if(empty($html)){
169
-
170
-        global $field_set_start;
171
-        $fieldset_class = 'fieldset-'.sanitize_title_with_dashes($cf['site_title']);
172
-
173
-        if ($field_set_start == 1) {
174
-            $html = '';
175
-        } else {
176
-            $html = '<h2 class="'.$fieldset_class.'">'. __($cf['site_title'], 'geodirectory') . '</h2>';
177
-            //$field_set_start = 1;
178
-        }
179
-
180
-    }
181
-
182
-    return $html;
118
+	// check we have the post value
119
+	if(is_int($p)){$post = geodir_get_post_info($p);}
120
+	else{ global $post;}
121
+
122
+	if(!is_array($cf) && $cf!=''){
123
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
124
+		if(!$cf){return NULL;}
125
+	}
126
+
127
+	$html_var = $cf['htmlvar_name'];
128
+
129
+	// Check if there is a location specific filter.
130
+	if(has_filter("geodir_custom_field_output_fieldset_loc_{$location}")){
131
+		/**
132
+		 * Filter the fieldset html by location.
133
+		 *
134
+		 * @param string $html The html to filter.
135
+		 * @param array $cf The custom field array.
136
+		 * @since 1.6.6
137
+		 */
138
+		$html = apply_filters("geodir_custom_field_output_fieldset_loc_{$location}",$html,$cf);
139
+	}
140
+
141
+	// Check if there is a custom field specific filter.
142
+	if(has_filter("geodir_custom_field_output_fieldset_var_{$html_var}")){
143
+		/**
144
+		 * Filter the fieldset html by individual custom field.
145
+		 *
146
+		 * @param string $html The html to filter.
147
+		 * @param string $location The location to output the html.
148
+		 * @param array $cf The custom field array.
149
+		 * @since 1.6.6
150
+		 */
151
+		$html = apply_filters("geodir_custom_field_output_fieldset_var_{$html_var}",$html,$location,$cf);
152
+	}
153
+
154
+	// Check if there is a custom field key specific filter.
155
+	if(has_filter("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}")){
156
+		/**
157
+		 * Filter the fieldset html by field type key.
158
+		 *
159
+		 * @param string $html The html to filter.
160
+		 * @param string $location The location to output the html.
161
+		 * @param array $cf The custom field array.
162
+		 * @since 1.6.6
163
+		 */
164
+		$html = apply_filters("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}",$html,$location,$cf);
165
+	}
166
+
167
+	// If not html then we run the standard output.
168
+	if(empty($html)){
169
+
170
+		global $field_set_start;
171
+		$fieldset_class = 'fieldset-'.sanitize_title_with_dashes($cf['site_title']);
172
+
173
+		if ($field_set_start == 1) {
174
+			$html = '';
175
+		} else {
176
+			$html = '<h2 class="'.$fieldset_class.'">'. __($cf['site_title'], 'geodirectory') . '</h2>';
177
+			//$field_set_start = 1;
178
+		}
179
+
180
+	}
181
+
182
+	return $html;
183 183
 }
184 184
 add_filter('geodir_custom_field_output_fieldset','geodir_cf_fieldset',10,3);
185 185
 
@@ -196,106 +196,106 @@  discard block
 block discarded – undo
196 196
  */
197 197
 function geodir_cf_url($html,$location,$cf,$p=''){
198 198
 
199
-    // check we have the post value
200
-    if(is_int($p)){$post = geodir_get_post_info($p);}
201
-    else{ global $post;}
202
-
203
-    if(!is_array($cf) && $cf!=''){
204
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
205
-        if(!$cf){return NULL;}
206
-    }
207
-
208
-    $html_var = $cf['htmlvar_name'];
209
-
210
-    // Check if there is a location specific filter.
211
-    if(has_filter("geodir_custom_field_output_url_loc_{$location}")){
212
-        /**
213
-         * Filter the url html by location.
214
-         *
215
-         * @param string $html The html to filter.
216
-         * @param array $cf The custom field array.
217
-         * @since 1.6.6
218
-         */
219
-        $html = apply_filters("geodir_custom_field_output_url_loc_{$location}",$html,$cf);
220
-    }
221
-
222
-    // Check if there is a custom field specific filter.
223
-    if(has_filter("geodir_custom_field_output_url_var_{$html_var}")){
224
-        /**
225
-         * Filter the url html by individual custom field.
226
-         *
227
-         * @param string $html The html to filter.
228
-         * @param string $location The location to output the html.
229
-         * @param array $cf The custom field array.
230
-         * @since 1.6.6
231
-         */
232
-        $html = apply_filters("geodir_custom_field_output_url_var_{$html_var}",$html,$location,$cf);
233
-    }
234
-
235
-    // Check if there is a custom field key specific filter.
236
-    if(has_filter("geodir_custom_field_output_url_key_{$cf['field_type_key']}")){
237
-        /**
238
-         * Filter the url html by field type key.
239
-         *
240
-         * @param string $html The html to filter.
241
-         * @param string $location The location to output the html.
242
-         * @param array $cf The custom field array.
243
-         * @since 1.6.6
244
-         */
245
-        $html = apply_filters("geodir_custom_field_output_url_key_{$cf['field_type_key']}",$html,$location,$cf);
246
-    }
247
-
248
-    // If not html then we run the standard output.
249
-    if(empty($html)){
250
-
251
-        if ($post->{$cf['htmlvar_name']}):
252
-
253
-            $field_icon = geodir_field_icon_proccess($cf);
254
-            if (strpos($field_icon, 'http') !== false) {
255
-                $field_icon_af = '';
256
-            } elseif ($field_icon == '') {
257
-
258
-                if ($cf['name'] == 'geodir_facebook') {
259
-                    $field_icon_af = '<i class="fa fa-facebook-square"></i>';
260
-                } elseif ($cf['name'] == 'geodir_twitter') {
261
-                    $field_icon_af = '<i class="fa fa-twitter-square"></i>';
262
-                } else {
263
-                    $field_icon_af = '<i class="fa fa-link"></i>';
264
-                }
265
-
266
-            } else {
267
-                $field_icon_af = $field_icon;
268
-                $field_icon = '';
269
-            }
270
-
271
-            $a_url = geodir_parse_custom_field_url($post->{$cf['htmlvar_name']});
272
-
273
-
274
-            $website = !empty($a_url['url']) ? $a_url['url'] : '';
275
-            $title = !empty($a_url['label']) ? $a_url['label'] : $cf['site_title'];
276
-            if(!empty($cf['default_value'])){$title = $cf['default_value'];}
277
-            $title = $title != '' ? __(stripslashes($title), 'geodirectory') : '';
278
-
279
-
280
-
281
-            // all search engines that use the nofollow value exclude links that use it from their ranking calculation
282
-            $rel = strpos($website, get_site_url()) !== false ? '' : 'rel="nofollow"';
283
-            /**
284
-             * Filter custom field website name.
285
-             *
286
-             * @since 1.0.0
287
-             *
288
-             * @param string $title Website Title.
289
-             * @param string $website Website URL.
290
-             * @param int $post->ID Post ID.
291
-             */
292
-            $html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '"><span class="geodir-i-website" style="' . $field_icon . '">' . $field_icon_af . '<a href="' . $website . '" target="_blank" ' . $rel . ' ><strong>' . apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID) . '</strong></a></span></div>';
293
-
294
-        endif;
295
-
296
-    }
297
-
298
-    return $html;
199
+	// check we have the post value
200
+	if(is_int($p)){$post = geodir_get_post_info($p);}
201
+	else{ global $post;}
202
+
203
+	if(!is_array($cf) && $cf!=''){
204
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
205
+		if(!$cf){return NULL;}
206
+	}
207
+
208
+	$html_var = $cf['htmlvar_name'];
209
+
210
+	// Check if there is a location specific filter.
211
+	if(has_filter("geodir_custom_field_output_url_loc_{$location}")){
212
+		/**
213
+		 * Filter the url html by location.
214
+		 *
215
+		 * @param string $html The html to filter.
216
+		 * @param array $cf The custom field array.
217
+		 * @since 1.6.6
218
+		 */
219
+		$html = apply_filters("geodir_custom_field_output_url_loc_{$location}",$html,$cf);
220
+	}
221
+
222
+	// Check if there is a custom field specific filter.
223
+	if(has_filter("geodir_custom_field_output_url_var_{$html_var}")){
224
+		/**
225
+		 * Filter the url html by individual custom field.
226
+		 *
227
+		 * @param string $html The html to filter.
228
+		 * @param string $location The location to output the html.
229
+		 * @param array $cf The custom field array.
230
+		 * @since 1.6.6
231
+		 */
232
+		$html = apply_filters("geodir_custom_field_output_url_var_{$html_var}",$html,$location,$cf);
233
+	}
234
+
235
+	// Check if there is a custom field key specific filter.
236
+	if(has_filter("geodir_custom_field_output_url_key_{$cf['field_type_key']}")){
237
+		/**
238
+		 * Filter the url html by field type key.
239
+		 *
240
+		 * @param string $html The html to filter.
241
+		 * @param string $location The location to output the html.
242
+		 * @param array $cf The custom field array.
243
+		 * @since 1.6.6
244
+		 */
245
+		$html = apply_filters("geodir_custom_field_output_url_key_{$cf['field_type_key']}",$html,$location,$cf);
246
+	}
247
+
248
+	// If not html then we run the standard output.
249
+	if(empty($html)){
250
+
251
+		if ($post->{$cf['htmlvar_name']}):
252
+
253
+			$field_icon = geodir_field_icon_proccess($cf);
254
+			if (strpos($field_icon, 'http') !== false) {
255
+				$field_icon_af = '';
256
+			} elseif ($field_icon == '') {
257
+
258
+				if ($cf['name'] == 'geodir_facebook') {
259
+					$field_icon_af = '<i class="fa fa-facebook-square"></i>';
260
+				} elseif ($cf['name'] == 'geodir_twitter') {
261
+					$field_icon_af = '<i class="fa fa-twitter-square"></i>';
262
+				} else {
263
+					$field_icon_af = '<i class="fa fa-link"></i>';
264
+				}
265
+
266
+			} else {
267
+				$field_icon_af = $field_icon;
268
+				$field_icon = '';
269
+			}
270
+
271
+			$a_url = geodir_parse_custom_field_url($post->{$cf['htmlvar_name']});
272
+
273
+
274
+			$website = !empty($a_url['url']) ? $a_url['url'] : '';
275
+			$title = !empty($a_url['label']) ? $a_url['label'] : $cf['site_title'];
276
+			if(!empty($cf['default_value'])){$title = $cf['default_value'];}
277
+			$title = $title != '' ? __(stripslashes($title), 'geodirectory') : '';
278
+
279
+
280
+
281
+			// all search engines that use the nofollow value exclude links that use it from their ranking calculation
282
+			$rel = strpos($website, get_site_url()) !== false ? '' : 'rel="nofollow"';
283
+			/**
284
+			 * Filter custom field website name.
285
+			 *
286
+			 * @since 1.0.0
287
+			 *
288
+			 * @param string $title Website Title.
289
+			 * @param string $website Website URL.
290
+			 * @param int $post->ID Post ID.
291
+			 */
292
+			$html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '"><span class="geodir-i-website" style="' . $field_icon . '">' . $field_icon_af . '<a href="' . $website . '" target="_blank" ' . $rel . ' ><strong>' . apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID) . '</strong></a></span></div>';
293
+
294
+		endif;
295
+
296
+	}
297
+
298
+	return $html;
299 299
 }
300 300
 add_filter('geodir_custom_field_output_url','geodir_cf_url',10,3);
301 301
 
@@ -312,80 +312,80 @@  discard block
 block discarded – undo
312 312
  */
313 313
 function geodir_cf_phone($html,$location,$cf,$p=''){
314 314
 
315
-    // check we have the post value
316
-    if(is_int($p)){$post = geodir_get_post_info($p);}
317
-    else{ global $post;}
318
-
319
-    if(!is_array($cf) && $cf!=''){
320
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
321
-        if(!$cf){return NULL;}
322
-    }
323
-
324
-    $html_var = $cf['htmlvar_name'];
325
-
326
-    // Check if there is a location specific filter.
327
-    if(has_filter("geodir_custom_field_output_phone_loc_{$location}")){
328
-        /**
329
-         * Filter the phone html by location.
330
-         *
331
-         * @param string $html The html to filter.
332
-         * @param array $cf The custom field array.
333
-         * @since 1.6.6
334
-         */
335
-        $html = apply_filters("geodir_custom_field_output_phone_loc_{$location}",$html,$cf);
336
-    }
337
-
338
-    // Check if there is a custom field specific filter.
339
-    if(has_filter("geodir_custom_field_output_phone_var_{$html_var}")){
340
-        /**
341
-         * Filter the phone html by individual custom field.
342
-         *
343
-         * @param string $html The html to filter.
344
-         * @param string $location The location to output the html.
345
-         * @param array $cf The custom field array.
346
-         * @since 1.6.6
347
-         */
348
-        $html = apply_filters("geodir_custom_field_output_phone_var_{$html_var}",$html,$location,$cf);
349
-    }
350
-
351
-    // Check if there is a custom field key specific filter.
352
-    if(has_filter("geodir_custom_field_output_phone_key_{$cf['field_type_key']}")){
353
-        /**
354
-         * Filter the phone html by field type key.
355
-         *
356
-         * @param string $html The html to filter.
357
-         * @param string $location The location to output the html.
358
-         * @param array $cf The custom field array.
359
-         * @since 1.6.6
360
-         */
361
-        $html = apply_filters("geodir_custom_field_output_phone_key_{$cf['field_type_key']}",$html,$location,$cf);
362
-    }
363
-
364
-    // If not html then we run the standard output.
365
-    if(empty($html)){
366
-
367
-        if ($post->{$cf['htmlvar_name']}):
368
-
369
-            $field_icon = geodir_field_icon_proccess($cf);
370
-            if (strpos($field_icon, 'http') !== false) {
371
-                $field_icon_af = '';
372
-            } elseif ($field_icon == '') {
373
-                $field_icon_af = '<i class="fa fa-phone"></i>';
374
-            } else {
375
-                $field_icon_af = $field_icon;
376
-                $field_icon = '';
377
-            }
378
-
379
-
380
-            $html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-contact" style="' . $field_icon . '">' . $field_icon_af .
381
-                    $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '&nbsp;';
382
-            $html .= '</span><a href="tel:' . preg_replace('/[^0-9+]/', '', $post->{$cf['htmlvar_name']}) . '">' . $post->{$cf['htmlvar_name']} . '</a></div>';
383
-
384
-        endif;
385
-
386
-    }
387
-
388
-    return $html;
315
+	// check we have the post value
316
+	if(is_int($p)){$post = geodir_get_post_info($p);}
317
+	else{ global $post;}
318
+
319
+	if(!is_array($cf) && $cf!=''){
320
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
321
+		if(!$cf){return NULL;}
322
+	}
323
+
324
+	$html_var = $cf['htmlvar_name'];
325
+
326
+	// Check if there is a location specific filter.
327
+	if(has_filter("geodir_custom_field_output_phone_loc_{$location}")){
328
+		/**
329
+		 * Filter the phone html by location.
330
+		 *
331
+		 * @param string $html The html to filter.
332
+		 * @param array $cf The custom field array.
333
+		 * @since 1.6.6
334
+		 */
335
+		$html = apply_filters("geodir_custom_field_output_phone_loc_{$location}",$html,$cf);
336
+	}
337
+
338
+	// Check if there is a custom field specific filter.
339
+	if(has_filter("geodir_custom_field_output_phone_var_{$html_var}")){
340
+		/**
341
+		 * Filter the phone html by individual custom field.
342
+		 *
343
+		 * @param string $html The html to filter.
344
+		 * @param string $location The location to output the html.
345
+		 * @param array $cf The custom field array.
346
+		 * @since 1.6.6
347
+		 */
348
+		$html = apply_filters("geodir_custom_field_output_phone_var_{$html_var}",$html,$location,$cf);
349
+	}
350
+
351
+	// Check if there is a custom field key specific filter.
352
+	if(has_filter("geodir_custom_field_output_phone_key_{$cf['field_type_key']}")){
353
+		/**
354
+		 * Filter the phone html by field type key.
355
+		 *
356
+		 * @param string $html The html to filter.
357
+		 * @param string $location The location to output the html.
358
+		 * @param array $cf The custom field array.
359
+		 * @since 1.6.6
360
+		 */
361
+		$html = apply_filters("geodir_custom_field_output_phone_key_{$cf['field_type_key']}",$html,$location,$cf);
362
+	}
363
+
364
+	// If not html then we run the standard output.
365
+	if(empty($html)){
366
+
367
+		if ($post->{$cf['htmlvar_name']}):
368
+
369
+			$field_icon = geodir_field_icon_proccess($cf);
370
+			if (strpos($field_icon, 'http') !== false) {
371
+				$field_icon_af = '';
372
+			} elseif ($field_icon == '') {
373
+				$field_icon_af = '<i class="fa fa-phone"></i>';
374
+			} else {
375
+				$field_icon_af = $field_icon;
376
+				$field_icon = '';
377
+			}
378
+
379
+
380
+			$html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-contact" style="' . $field_icon . '">' . $field_icon_af .
381
+					$html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '&nbsp;';
382
+			$html .= '</span><a href="tel:' . preg_replace('/[^0-9+]/', '', $post->{$cf['htmlvar_name']}) . '">' . $post->{$cf['htmlvar_name']} . '</a></div>';
383
+
384
+		endif;
385
+
386
+	}
387
+
388
+	return $html;
389 389
 }
390 390
 add_filter('geodir_custom_field_output_phone','geodir_cf_phone',10,3);
391 391
 
@@ -402,85 +402,85 @@  discard block
 block discarded – undo
402 402
  */
403 403
 function geodir_cf_time($html,$location,$cf,$p=''){
404 404
 
405
-    // check we have the post value
406
-    if(is_int($p)){$post = geodir_get_post_info($p);}
407
-    else{ global $post;}
408
-
409
-    if(!is_array($cf) && $cf!=''){
410
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
411
-        if(!$cf){return NULL;}
412
-    }
413
-
414
-    $html_var = $cf['htmlvar_name'];
415
-
416
-    // Check if there is a location specific filter.
417
-    if(has_filter("geodir_custom_field_output_time_loc_{$location}")){
418
-        /**
419
-         * Filter the time html by location.
420
-         *
421
-         * @param string $html The html to filter.
422
-         * @param array $cf The custom field array.
423
-         * @since 1.6.6
424
-         */
425
-        $html = apply_filters("geodir_custom_field_output_time_loc_{$location}",$html,$cf);
426
-    }
427
-
428
-    // Check if there is a custom field specific filter.
429
-    if(has_filter("geodir_custom_field_output_time_var_{$html_var}")){
430
-        /**
431
-         * Filter the time html by individual custom field.
432
-         *
433
-         * @param string $html The html to filter.
434
-         * @param string $location The location to output the html.
435
-         * @param array $cf The custom field array.
436
-         * @since 1.6.6
437
-         */
438
-        $html = apply_filters("geodir_custom_field_output_time_var_{$html_var}",$html,$location,$cf);
439
-    }
440
-
441
-    // Check if there is a custom field key specific filter.
442
-    if(has_filter("geodir_custom_field_output_time_key_{$cf['field_type_key']}")){
443
-        /**
444
-         * Filter the time html by field type key.
445
-         *
446
-         * @param string $html The html to filter.
447
-         * @param string $location The location to output the html.
448
-         * @param array $cf The custom field array.
449
-         * @since 1.6.6
450
-         */
451
-        $html = apply_filters("geodir_custom_field_output_time_key_{$cf['field_type_key']}",$html,$location,$cf);
452
-    }
453
-
454
-    // If not html then we run the standard output.
455
-    if(empty($html)){
456
-
457
-        if ($post->{$cf['htmlvar_name']}):
458
-
459
-            $value = '';
460
-            if ($post->{$cf['htmlvar_name']} != '')
461
-                //$value = date('h:i',strtotime($post->{$cf['htmlvar_name']}));
462
-                $value = date(get_option('time_format'), strtotime($post->{$cf['htmlvar_name']}));
463
-
464
-            $field_icon = geodir_field_icon_proccess($cf);
465
-            if (strpos($field_icon, 'http') !== false) {
466
-                $field_icon_af = '';
467
-            } elseif ($field_icon == '') {
468
-                $field_icon_af = '<i class="fa fa-clock-o"></i>';
469
-            } else {
470
-                $field_icon_af = $field_icon;
471
-                $field_icon = '';
472
-            }
473
-
474
-
475
-            $html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-time" style="' . $field_icon . '">' . $field_icon_af;
476
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '&nbsp;';
477
-            $html .= '</span>' . $value . '</div>';
478
-
479
-        endif;
480
-
481
-    }
482
-
483
-    return $html;
405
+	// check we have the post value
406
+	if(is_int($p)){$post = geodir_get_post_info($p);}
407
+	else{ global $post;}
408
+
409
+	if(!is_array($cf) && $cf!=''){
410
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
411
+		if(!$cf){return NULL;}
412
+	}
413
+
414
+	$html_var = $cf['htmlvar_name'];
415
+
416
+	// Check if there is a location specific filter.
417
+	if(has_filter("geodir_custom_field_output_time_loc_{$location}")){
418
+		/**
419
+		 * Filter the time html by location.
420
+		 *
421
+		 * @param string $html The html to filter.
422
+		 * @param array $cf The custom field array.
423
+		 * @since 1.6.6
424
+		 */
425
+		$html = apply_filters("geodir_custom_field_output_time_loc_{$location}",$html,$cf);
426
+	}
427
+
428
+	// Check if there is a custom field specific filter.
429
+	if(has_filter("geodir_custom_field_output_time_var_{$html_var}")){
430
+		/**
431
+		 * Filter the time html by individual custom field.
432
+		 *
433
+		 * @param string $html The html to filter.
434
+		 * @param string $location The location to output the html.
435
+		 * @param array $cf The custom field array.
436
+		 * @since 1.6.6
437
+		 */
438
+		$html = apply_filters("geodir_custom_field_output_time_var_{$html_var}",$html,$location,$cf);
439
+	}
440
+
441
+	// Check if there is a custom field key specific filter.
442
+	if(has_filter("geodir_custom_field_output_time_key_{$cf['field_type_key']}")){
443
+		/**
444
+		 * Filter the time html by field type key.
445
+		 *
446
+		 * @param string $html The html to filter.
447
+		 * @param string $location The location to output the html.
448
+		 * @param array $cf The custom field array.
449
+		 * @since 1.6.6
450
+		 */
451
+		$html = apply_filters("geodir_custom_field_output_time_key_{$cf['field_type_key']}",$html,$location,$cf);
452
+	}
453
+
454
+	// If not html then we run the standard output.
455
+	if(empty($html)){
456
+
457
+		if ($post->{$cf['htmlvar_name']}):
458
+
459
+			$value = '';
460
+			if ($post->{$cf['htmlvar_name']} != '')
461
+				//$value = date('h:i',strtotime($post->{$cf['htmlvar_name']}));
462
+				$value = date(get_option('time_format'), strtotime($post->{$cf['htmlvar_name']}));
463
+
464
+			$field_icon = geodir_field_icon_proccess($cf);
465
+			if (strpos($field_icon, 'http') !== false) {
466
+				$field_icon_af = '';
467
+			} elseif ($field_icon == '') {
468
+				$field_icon_af = '<i class="fa fa-clock-o"></i>';
469
+			} else {
470
+				$field_icon_af = $field_icon;
471
+				$field_icon = '';
472
+			}
473
+
474
+
475
+			$html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-time" style="' . $field_icon . '">' . $field_icon_af;
476
+			$html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '&nbsp;';
477
+			$html .= '</span>' . $value . '</div>';
478
+
479
+		endif;
480
+
481
+	}
482
+
483
+	return $html;
484 484
 }
485 485
 add_filter('geodir_custom_field_output_time','geodir_cf_time',10,3);
486 486
 
@@ -496,111 +496,111 @@  discard block
 block discarded – undo
496 496
  * @return string The html to output for the custom field.
497 497
  */
498 498
 function geodir_cf_datepicker($html,$location,$cf,$p=''){
499
-    global $preview;
500
-    // check we have the post value
501
-    if(is_int($p)){$post = geodir_get_post_info($p);}
502
-    else{ global $post;}
503
-
504
-    if(!is_array($cf) && $cf!=''){
505
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
506
-        if(!$cf){return NULL;}
507
-    }
508
-
509
-    $html_var = $cf['htmlvar_name'];
510
-
511
-    // Check if there is a location specific filter.
512
-    if(has_filter("geodir_custom_field_output_datepicker_loc_{$location}")){
513
-        /**
514
-         * Filter the datepicker html by location.
515
-         *
516
-         * @param string $html The html to filter.
517
-         * @param array $cf The custom field array.
518
-         * @since 1.6.6
519
-         */
520
-        $html = apply_filters("geodir_custom_field_output_datepicker_loc_{$location}",$html,$cf);
521
-    }
522
-
523
-    // Check if there is a custom field specific filter.
524
-    if(has_filter("geodir_custom_field_output_datepicker_var_{$html_var}")){
525
-        /**
526
-         * Filter the datepicker html by individual custom field.
527
-         *
528
-         * @param string $html The html to filter.
529
-         * @param string $location The location to output the html.
530
-         * @param array $cf The custom field array.
531
-         * @since 1.6.6
532
-         */
533
-        $html = apply_filters("geodir_custom_field_output_datepicker_var_{$html_var}",$html,$location,$cf);
534
-    }
535
-
536
-    // Check if there is a custom field key specific filter.
537
-    if(has_filter("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}")){
538
-        /**
539
-         * Filter the datepicker html by field type key.
540
-         *
541
-         * @param string $html The html to filter.
542
-         * @param string $location The location to output the html.
543
-         * @param array $cf The custom field array.
544
-         * @since 1.6.6
545
-         */
546
-        $html = apply_filters("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}",$html,$location,$cf);
547
-    }
548
-
549
-    // If not html then we run the standard output.
550
-    if(empty($html)){
551
-
552
-        if ($post->{$cf['htmlvar_name']}):
553
-
554
-            $date_format = geodir_default_date_format();
555
-            if ($cf['extra_fields'] != '') {
556
-                $date_format = unserialize($cf['extra_fields']);
557
-                $date_format = $date_format['date_format'];
558
-            }
559
-            // check if we need to change the format or not
560
-            $date_format_len = strlen(str_replace(' ', '', $date_format));
561
-            if($date_format_len>5){// if greater then 4 then it's the old style format.
562
-
563
-                $search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format
564
-                $replace = array('d','j','l','m','n','F','Y');//PHP date format
565
-
566
-                $date_format = str_replace($search, $replace, $date_format);
567
-
568
-                $post_htmlvar_value = ($date_format == 'd/m/Y' || $date_format == 'j/n/Y' ) ? str_replace('/', '-', $post->{$cf['htmlvar_name']}) : $post->{$cf['htmlvar_name']}; // PHP doesn't work well with dd/mm/yyyy format
569
-            }else{
570
-                $post_htmlvar_value = $post->{$cf['htmlvar_name']};
571
-            }
572
-
573
-            if ($post->{$cf['htmlvar_name']} != '' && $post->{$cf['htmlvar_name']}!="0000-00-00") {
574
-                $date_format_from = $preview ? $date_format : 'Y-m-d';
575
-                $value = geodir_date($post_htmlvar_value, $date_format, $date_format_from); // save as sql format Y-m-d
576
-                //$post_htmlvar_value = strpos($post_htmlvar_value, '/') !== false ? str_replace('/', '-', $post_htmlvar_value) : $post_htmlvar_value;
577
-                //$value = date_i18n($date_format, strtotime($post_htmlvar_value));
578
-            }else{
579
-                return '';
580
-            }
581
-
582
-            $field_icon = geodir_field_icon_proccess($cf);
583
-
584
-            if (strpos($field_icon, 'http') !== false) {
585
-                $field_icon_af = '';
586
-            } elseif ($field_icon == '') {
587
-                $field_icon_af = '<i class="fa fa-calendar"></i>';
588
-            } else {
589
-                $field_icon_af = $field_icon;
590
-                $field_icon = '';
591
-            }
592
-
593
-
594
-
595
-            $html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-datepicker" style="' . $field_icon . '">' . $field_icon_af;
596
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
597
-            $html .= '</span>' . $value . '</div>';
598
-
599
-        endif;
600
-
601
-    }
602
-
603
-    return $html;
499
+	global $preview;
500
+	// check we have the post value
501
+	if(is_int($p)){$post = geodir_get_post_info($p);}
502
+	else{ global $post;}
503
+
504
+	if(!is_array($cf) && $cf!=''){
505
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
506
+		if(!$cf){return NULL;}
507
+	}
508
+
509
+	$html_var = $cf['htmlvar_name'];
510
+
511
+	// Check if there is a location specific filter.
512
+	if(has_filter("geodir_custom_field_output_datepicker_loc_{$location}")){
513
+		/**
514
+		 * Filter the datepicker html by location.
515
+		 *
516
+		 * @param string $html The html to filter.
517
+		 * @param array $cf The custom field array.
518
+		 * @since 1.6.6
519
+		 */
520
+		$html = apply_filters("geodir_custom_field_output_datepicker_loc_{$location}",$html,$cf);
521
+	}
522
+
523
+	// Check if there is a custom field specific filter.
524
+	if(has_filter("geodir_custom_field_output_datepicker_var_{$html_var}")){
525
+		/**
526
+		 * Filter the datepicker html by individual custom field.
527
+		 *
528
+		 * @param string $html The html to filter.
529
+		 * @param string $location The location to output the html.
530
+		 * @param array $cf The custom field array.
531
+		 * @since 1.6.6
532
+		 */
533
+		$html = apply_filters("geodir_custom_field_output_datepicker_var_{$html_var}",$html,$location,$cf);
534
+	}
535
+
536
+	// Check if there is a custom field key specific filter.
537
+	if(has_filter("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}")){
538
+		/**
539
+		 * Filter the datepicker html by field type key.
540
+		 *
541
+		 * @param string $html The html to filter.
542
+		 * @param string $location The location to output the html.
543
+		 * @param array $cf The custom field array.
544
+		 * @since 1.6.6
545
+		 */
546
+		$html = apply_filters("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}",$html,$location,$cf);
547
+	}
548
+
549
+	// If not html then we run the standard output.
550
+	if(empty($html)){
551
+
552
+		if ($post->{$cf['htmlvar_name']}):
553
+
554
+			$date_format = geodir_default_date_format();
555
+			if ($cf['extra_fields'] != '') {
556
+				$date_format = unserialize($cf['extra_fields']);
557
+				$date_format = $date_format['date_format'];
558
+			}
559
+			// check if we need to change the format or not
560
+			$date_format_len = strlen(str_replace(' ', '', $date_format));
561
+			if($date_format_len>5){// if greater then 4 then it's the old style format.
562
+
563
+				$search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format
564
+				$replace = array('d','j','l','m','n','F','Y');//PHP date format
565
+
566
+				$date_format = str_replace($search, $replace, $date_format);
567
+
568
+				$post_htmlvar_value = ($date_format == 'd/m/Y' || $date_format == 'j/n/Y' ) ? str_replace('/', '-', $post->{$cf['htmlvar_name']}) : $post->{$cf['htmlvar_name']}; // PHP doesn't work well with dd/mm/yyyy format
569
+			}else{
570
+				$post_htmlvar_value = $post->{$cf['htmlvar_name']};
571
+			}
572
+
573
+			if ($post->{$cf['htmlvar_name']} != '' && $post->{$cf['htmlvar_name']}!="0000-00-00") {
574
+				$date_format_from = $preview ? $date_format : 'Y-m-d';
575
+				$value = geodir_date($post_htmlvar_value, $date_format, $date_format_from); // save as sql format Y-m-d
576
+				//$post_htmlvar_value = strpos($post_htmlvar_value, '/') !== false ? str_replace('/', '-', $post_htmlvar_value) : $post_htmlvar_value;
577
+				//$value = date_i18n($date_format, strtotime($post_htmlvar_value));
578
+			}else{
579
+				return '';
580
+			}
581
+
582
+			$field_icon = geodir_field_icon_proccess($cf);
583
+
584
+			if (strpos($field_icon, 'http') !== false) {
585
+				$field_icon_af = '';
586
+			} elseif ($field_icon == '') {
587
+				$field_icon_af = '<i class="fa fa-calendar"></i>';
588
+			} else {
589
+				$field_icon_af = $field_icon;
590
+				$field_icon = '';
591
+			}
592
+
593
+
594
+
595
+			$html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-datepicker" style="' . $field_icon . '">' . $field_icon_af;
596
+			$html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
597
+			$html .= '</span>' . $value . '</div>';
598
+
599
+		endif;
600
+
601
+	}
602
+
603
+	return $html;
604 604
 }
605 605
 add_filter('geodir_custom_field_output_datepicker','geodir_cf_datepicker',10,3);
606 606
 
@@ -617,96 +617,96 @@  discard block
 block discarded – undo
617 617
  */
618 618
 function geodir_cf_text($html,$location,$cf,$p=''){
619 619
 
620
-    // check we have the post value
621
-    if(is_int($p)){$post = geodir_get_post_info($p);}
622
-    else{ global $post;}
623
-
624
-    if(!is_array($cf) && $cf!=''){
625
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
626
-        if(!$cf){return NULL;}
627
-    }
628
-
629
-    $html_var = $cf['htmlvar_name'];
630
-
631
-    // Check if there is a location specific filter.
632
-    if(has_filter("geodir_custom_field_output_text_loc_{$location}")){
633
-        /**
634
-         * Filter the text html by location.
635
-         *
636
-         * @param string $html The html to filter.
637
-         * @param array $cf The custom field array.
638
-         * @since 1.6.6
639
-         */
640
-        $html = apply_filters("geodir_custom_field_output_text_loc_{$location}",$html,$cf);
641
-    }
642
-
643
-    // Check if there is a custom field specific filter.
644
-    if(has_filter("geodir_custom_field_output_text_var_{$html_var}")){
645
-        /**
646
-         * Filter the text html by individual custom field.
647
-         *
648
-         * @param string $html The html to filter.
649
-         * @param string $location The location to output the html.
650
-         * @param array $cf The custom field array.
651
-         * @since 1.6.6
652
-         */
653
-        $html = apply_filters("geodir_custom_field_output_text_var_{$html_var}",$html,$location,$cf);
654
-    }
655
-
656
-    // Check if there is a custom field key specific filter.
657
-    if(has_filter("geodir_custom_field_output_text_key_{$cf['field_type_key']}")){
658
-        /**
659
-         * Filter the text html by field type key.
660
-         *
661
-         * @param string $html The html to filter.
662
-         * @param string $location The location to output the html.
663
-         * @param array $cf The custom field array.
664
-         * @since 1.6.6
665
-         */
666
-        $html = apply_filters("geodir_custom_field_output_text_key_{$cf['field_type_key']}",$html,$location,$cf);
667
-    }
620
+	// check we have the post value
621
+	if(is_int($p)){$post = geodir_get_post_info($p);}
622
+	else{ global $post;}
623
+
624
+	if(!is_array($cf) && $cf!=''){
625
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
626
+		if(!$cf){return NULL;}
627
+	}
628
+
629
+	$html_var = $cf['htmlvar_name'];
630
+
631
+	// Check if there is a location specific filter.
632
+	if(has_filter("geodir_custom_field_output_text_loc_{$location}")){
633
+		/**
634
+		 * Filter the text html by location.
635
+		 *
636
+		 * @param string $html The html to filter.
637
+		 * @param array $cf The custom field array.
638
+		 * @since 1.6.6
639
+		 */
640
+		$html = apply_filters("geodir_custom_field_output_text_loc_{$location}",$html,$cf);
641
+	}
642
+
643
+	// Check if there is a custom field specific filter.
644
+	if(has_filter("geodir_custom_field_output_text_var_{$html_var}")){
645
+		/**
646
+		 * Filter the text html by individual custom field.
647
+		 *
648
+		 * @param string $html The html to filter.
649
+		 * @param string $location The location to output the html.
650
+		 * @param array $cf The custom field array.
651
+		 * @since 1.6.6
652
+		 */
653
+		$html = apply_filters("geodir_custom_field_output_text_var_{$html_var}",$html,$location,$cf);
654
+	}
655
+
656
+	// Check if there is a custom field key specific filter.
657
+	if(has_filter("geodir_custom_field_output_text_key_{$cf['field_type_key']}")){
658
+		/**
659
+		 * Filter the text html by field type key.
660
+		 *
661
+		 * @param string $html The html to filter.
662
+		 * @param string $location The location to output the html.
663
+		 * @param array $cf The custom field array.
664
+		 * @since 1.6.6
665
+		 */
666
+		$html = apply_filters("geodir_custom_field_output_text_key_{$cf['field_type_key']}",$html,$location,$cf);
667
+	}
668 668
 
669 669
     
670 670
 
671
-    // If not html then we run the standard output.
672
-    if(empty($html)){
671
+	// If not html then we run the standard output.
672
+	if(empty($html)){
673 673
 
674
-        if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != '' ):
674
+		if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != '' ):
675 675
 
676
-            $class = ($cf['htmlvar_name'] == 'geodir_timing') ? "geodir-i-time" : "geodir-i-text";
676
+			$class = ($cf['htmlvar_name'] == 'geodir_timing') ? "geodir-i-time" : "geodir-i-text";
677 677
 
678
-            $field_icon = geodir_field_icon_proccess($cf);
679
-            if (strpos($field_icon, 'http') !== false) {
680
-                $field_icon_af = '';
681
-            } elseif ($field_icon == '') {
682
-                $field_icon_af = ($cf['htmlvar_name'] == 'geodir_timing') ? '<i class="fa fa-clock-o"></i>' : "";
683
-            } else {
684
-                $field_icon_af = $field_icon;
685
-                $field_icon = '';
686
-            }
678
+			$field_icon = geodir_field_icon_proccess($cf);
679
+			if (strpos($field_icon, 'http') !== false) {
680
+				$field_icon_af = '';
681
+			} elseif ($field_icon == '') {
682
+				$field_icon_af = ($cf['htmlvar_name'] == 'geodir_timing') ? '<i class="fa fa-clock-o"></i>' : "";
683
+			} else {
684
+				$field_icon_af = $field_icon;
685
+				$field_icon = '';
686
+			}
687 687
 
688 688
 
689
-            $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="'.$class.'" style="' . $field_icon . '">' . $field_icon_af;
690
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
691
-            $html .= '</span>';
689
+			$html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="'.$class.'" style="' . $field_icon . '">' . $field_icon_af;
690
+			$html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
691
+			$html .= '</span>';
692 692
 
693
-            $value = $post->{$cf['htmlvar_name']};
694
-            if(isset($cf['data_type']) && ($cf['data_type']=='INT' || $cf['data_type']=='FLOAT') && isset($cf['extra_fields']) && $cf['extra_fields']){
695
-                $extra_fields = maybe_unserialize($cf['extra_fields']);
696
-                if(isset($extra_fields['is_price']) && $extra_fields['is_price']){
697
-                    $value = geodir_currency_format_number($value,$cf);
698
-                }
699
-            }
693
+			$value = $post->{$cf['htmlvar_name']};
694
+			if(isset($cf['data_type']) && ($cf['data_type']=='INT' || $cf['data_type']=='FLOAT') && isset($cf['extra_fields']) && $cf['extra_fields']){
695
+				$extra_fields = maybe_unserialize($cf['extra_fields']);
696
+				if(isset($extra_fields['is_price']) && $extra_fields['is_price']){
697
+					$value = geodir_currency_format_number($value,$cf);
698
+				}
699
+			}
700 700
 
701 701
 
702
-            $html .= $value;
703
-            $html .= '</div>';
702
+			$html .= $value;
703
+			$html .= '</div>';
704 704
 
705
-        endif;
705
+		endif;
706 706
 
707
-    }
707
+	}
708 708
 
709
-    return $html;
709
+	return $html;
710 710
 }
711 711
 add_filter('geodir_custom_field_output_text','geodir_cf_text',10,3);
712 712
 
@@ -723,98 +723,98 @@  discard block
 block discarded – undo
723 723
  */
724 724
 function geodir_cf_radio($html,$location,$cf,$p=''){
725 725
 
726
-    // check we have the post value
727
-    if(is_int($p)){$post = geodir_get_post_info($p);}
728
-    else{ global $post;}
729
-
730
-    if(!is_array($cf) && $cf!=''){
731
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
732
-        if(!$cf){return NULL;}
733
-    }
734
-
735
-    $html_var = $cf['htmlvar_name'];
736
-
737
-    // Check if there is a location specific filter.
738
-    if(has_filter("geodir_custom_field_output_radio_loc_{$location}")){
739
-        /**
740
-         * Filter the radio html by location.
741
-         *
742
-         * @param string $html The html to filter.
743
-         * @param array $cf The custom field array.
744
-         * @since 1.6.6
745
-         */
746
-        $html = apply_filters("geodir_custom_field_output_radio_loc_{$location}",$html,$cf);
747
-    }
748
-
749
-    // Check if there is a custom field specific filter.
750
-    if(has_filter("geodir_custom_field_output_radio_var_{$html_var}")){
751
-        /**
752
-         * Filter the radio html by individual custom field.
753
-         *
754
-         * @param string $html The html to filter.
755
-         * @param string $location The location to output the html.
756
-         * @param array $cf The custom field array.
757
-         * @since 1.6.6
758
-         */
759
-        $html = apply_filters("geodir_custom_field_output_radio_var_{$html_var}",$html,$location,$cf);
760
-    }
761
-
762
-    // Check if there is a custom field key specific filter.
763
-    if(has_filter("geodir_custom_field_output_radio_key_{$cf['field_type_key']}")){
764
-        /**
765
-         * Filter the radio html by field type key.
766
-         *
767
-         * @param string $html The html to filter.
768
-         * @param string $location The location to output the html.
769
-         * @param array $cf The custom field array.
770
-         * @since 1.6.6
771
-         */
772
-        $html = apply_filters("geodir_custom_field_output_radio_key_{$cf['field_type_key']}",$html,$location,$cf);
773
-    }
774
-
775
-    // If not html then we run the standard output.
776
-    if(empty($html)){
777
-
778
-        $html_val = isset($post->{$cf['htmlvar_name']}) ? __($post->{$cf['htmlvar_name']}, 'geodirectory') : '';
779
-        if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != ''):
780
-
781
-            if ($post->{$cf['htmlvar_name']} == 'f' || $post->{$cf['htmlvar_name']} == '0') {
782
-                $html_val = __('No', 'geodirectory');
783
-            } else if ($post->{$cf['htmlvar_name']} == 't' || $post->{$cf['htmlvar_name']} == '1') {
784
-                $html_val = __('Yes', 'geodirectory');
785
-            } else {
786
-                if (!empty($cf['option_values'])) {
787
-                    $cf_option_values = geodir_string_values_to_options(stripslashes_deep($cf['option_values']), true);
788
-
789
-                    if (!empty($cf_option_values)) {
790
-                        foreach ($cf_option_values as $cf_option_value) {
791
-                            if (isset($cf_option_value['value']) && $cf_option_value['value'] == $post->{$cf['htmlvar_name']}) {
792
-                                $html_val = $cf_option_value['label'];
793
-                            }
794
-                        }
795
-                    }
796
-                }
797
-            }
798
-
799
-            $field_icon = geodir_field_icon_proccess($cf);
800
-            if (strpos($field_icon, 'http') !== false) {
801
-                $field_icon_af = '';
802
-            } elseif ($field_icon == '') {
803
-                $field_icon_af = '';
804
-            } else {
805
-                $field_icon_af = $field_icon;
806
-                $field_icon = '';
807
-            }
808
-
809
-
810
-            $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-radio" style="' . $field_icon . '">' . $field_icon_af;
811
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
812
-            $html .= '</span>' . $html_val . '</div>';
813
-        endif;
814
-
815
-    }
816
-
817
-    return $html;
726
+	// check we have the post value
727
+	if(is_int($p)){$post = geodir_get_post_info($p);}
728
+	else{ global $post;}
729
+
730
+	if(!is_array($cf) && $cf!=''){
731
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
732
+		if(!$cf){return NULL;}
733
+	}
734
+
735
+	$html_var = $cf['htmlvar_name'];
736
+
737
+	// Check if there is a location specific filter.
738
+	if(has_filter("geodir_custom_field_output_radio_loc_{$location}")){
739
+		/**
740
+		 * Filter the radio html by location.
741
+		 *
742
+		 * @param string $html The html to filter.
743
+		 * @param array $cf The custom field array.
744
+		 * @since 1.6.6
745
+		 */
746
+		$html = apply_filters("geodir_custom_field_output_radio_loc_{$location}",$html,$cf);
747
+	}
748
+
749
+	// Check if there is a custom field specific filter.
750
+	if(has_filter("geodir_custom_field_output_radio_var_{$html_var}")){
751
+		/**
752
+		 * Filter the radio html by individual custom field.
753
+		 *
754
+		 * @param string $html The html to filter.
755
+		 * @param string $location The location to output the html.
756
+		 * @param array $cf The custom field array.
757
+		 * @since 1.6.6
758
+		 */
759
+		$html = apply_filters("geodir_custom_field_output_radio_var_{$html_var}",$html,$location,$cf);
760
+	}
761
+
762
+	// Check if there is a custom field key specific filter.
763
+	if(has_filter("geodir_custom_field_output_radio_key_{$cf['field_type_key']}")){
764
+		/**
765
+		 * Filter the radio html by field type key.
766
+		 *
767
+		 * @param string $html The html to filter.
768
+		 * @param string $location The location to output the html.
769
+		 * @param array $cf The custom field array.
770
+		 * @since 1.6.6
771
+		 */
772
+		$html = apply_filters("geodir_custom_field_output_radio_key_{$cf['field_type_key']}",$html,$location,$cf);
773
+	}
774
+
775
+	// If not html then we run the standard output.
776
+	if(empty($html)){
777
+
778
+		$html_val = isset($post->{$cf['htmlvar_name']}) ? __($post->{$cf['htmlvar_name']}, 'geodirectory') : '';
779
+		if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != ''):
780
+
781
+			if ($post->{$cf['htmlvar_name']} == 'f' || $post->{$cf['htmlvar_name']} == '0') {
782
+				$html_val = __('No', 'geodirectory');
783
+			} else if ($post->{$cf['htmlvar_name']} == 't' || $post->{$cf['htmlvar_name']} == '1') {
784
+				$html_val = __('Yes', 'geodirectory');
785
+			} else {
786
+				if (!empty($cf['option_values'])) {
787
+					$cf_option_values = geodir_string_values_to_options(stripslashes_deep($cf['option_values']), true);
788
+
789
+					if (!empty($cf_option_values)) {
790
+						foreach ($cf_option_values as $cf_option_value) {
791
+							if (isset($cf_option_value['value']) && $cf_option_value['value'] == $post->{$cf['htmlvar_name']}) {
792
+								$html_val = $cf_option_value['label'];
793
+							}
794
+						}
795
+					}
796
+				}
797
+			}
798
+
799
+			$field_icon = geodir_field_icon_proccess($cf);
800
+			if (strpos($field_icon, 'http') !== false) {
801
+				$field_icon_af = '';
802
+			} elseif ($field_icon == '') {
803
+				$field_icon_af = '';
804
+			} else {
805
+				$field_icon_af = $field_icon;
806
+				$field_icon = '';
807
+			}
808
+
809
+
810
+			$html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-radio" style="' . $field_icon . '">' . $field_icon_af;
811
+			$html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
812
+			$html .= '</span>' . $html_val . '</div>';
813
+		endif;
814
+
815
+	}
816
+
817
+	return $html;
818 818
 }
819 819
 add_filter('geodir_custom_field_output_radio','geodir_cf_radio',10,3);
820 820
 
@@ -831,92 +831,92 @@  discard block
 block discarded – undo
831 831
  */
832 832
 function geodir_cf_select($html,$location,$cf,$p=''){
833 833
 
834
-    // check we have the post value
835
-    if(is_int($p)){$post = geodir_get_post_info($p);}
836
-    else{ global $post;}
837
-
838
-    if(!is_array($cf) && $cf!=''){
839
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
840
-        if(!$cf){return NULL;}
841
-    }
842
-
843
-    $html_var = $cf['htmlvar_name'];
844
-
845
-    // Check if there is a location specific filter.
846
-    if(has_filter("geodir_custom_field_output_select_loc_{$location}")){
847
-        /**
848
-         * Filter the select html by location.
849
-         *
850
-         * @param string $html The html to filter.
851
-         * @param array $cf The custom field array.
852
-         * @since 1.6.6
853
-         */
854
-        $html = apply_filters("geodir_custom_field_output_select_loc_{$location}",$html,$cf);
855
-    }
856
-
857
-    // Check if there is a custom field specific filter.
858
-    if(has_filter("geodir_custom_field_output_select_var_{$html_var}")){
859
-        /**
860
-         * Filter the select html by individual custom field.
861
-         *
862
-         * @param string $html The html to filter.
863
-         * @param string $location The location to output the html.
864
-         * @param array $cf The custom field array.
865
-         * @since 1.6.6
866
-         */
867
-        $html = apply_filters("geodir_custom_field_output_select_var_{$html_var}",$html,$location,$cf);
868
-    }
869
-
870
-    // Check if there is a custom field key specific filter.
871
-    if(has_filter("geodir_custom_field_output_select_key_{$cf['field_type_key']}")){
872
-        /**
873
-         * Filter the select html by field type key.
874
-         *
875
-         * @param string $html The html to filter.
876
-         * @param string $location The location to output the html.
877
-         * @param array $cf The custom field array.
878
-         * @since 1.6.6
879
-         */
880
-        $html = apply_filters("geodir_custom_field_output_select_key_{$cf['field_type_key']}",$html,$location,$cf);
881
-    }
882
-
883
-    // If not html then we run the standard output.
884
-    if(empty($html)){
885
-
886
-        if ($post->{$cf['htmlvar_name']}):
887
-            $field_value = __($post->{$cf['htmlvar_name']}, 'geodirectory');
888
-
889
-            if (!empty($cf['option_values'])) {
890
-                $cf_option_values = geodir_string_values_to_options(stripslashes_deep($cf['option_values']), true);
891
-
892
-                if (!empty($cf_option_values)) {
893
-                    foreach ($cf_option_values as $cf_option_value) {
894
-                        if (isset($cf_option_value['value']) && $cf_option_value['value'] == $post->{$cf['htmlvar_name']}) {
895
-                            //$field_value = $cf_option_value['label']; // no longer needed here.
896
-                        }
897
-                    }
898
-                }
899
-            }
900
-
901
-            $field_icon = geodir_field_icon_proccess($cf);
902
-            if (strpos($field_icon, 'http') !== false) {
903
-                $field_icon_af = '';
904
-            } elseif ($field_icon == '') {
905
-                $field_icon_af = '';
906
-            } else {
907
-                $field_icon_af = $field_icon;
908
-                $field_icon = '';
909
-            }
910
-
911
-
912
-            $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
913
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
914
-            $html .= '</span>' . $field_value . '</div>';
915
-        endif;
916
-
917
-    }
918
-
919
-    return $html;
834
+	// check we have the post value
835
+	if(is_int($p)){$post = geodir_get_post_info($p);}
836
+	else{ global $post;}
837
+
838
+	if(!is_array($cf) && $cf!=''){
839
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
840
+		if(!$cf){return NULL;}
841
+	}
842
+
843
+	$html_var = $cf['htmlvar_name'];
844
+
845
+	// Check if there is a location specific filter.
846
+	if(has_filter("geodir_custom_field_output_select_loc_{$location}")){
847
+		/**
848
+		 * Filter the select html by location.
849
+		 *
850
+		 * @param string $html The html to filter.
851
+		 * @param array $cf The custom field array.
852
+		 * @since 1.6.6
853
+		 */
854
+		$html = apply_filters("geodir_custom_field_output_select_loc_{$location}",$html,$cf);
855
+	}
856
+
857
+	// Check if there is a custom field specific filter.
858
+	if(has_filter("geodir_custom_field_output_select_var_{$html_var}")){
859
+		/**
860
+		 * Filter the select html by individual custom field.
861
+		 *
862
+		 * @param string $html The html to filter.
863
+		 * @param string $location The location to output the html.
864
+		 * @param array $cf The custom field array.
865
+		 * @since 1.6.6
866
+		 */
867
+		$html = apply_filters("geodir_custom_field_output_select_var_{$html_var}",$html,$location,$cf);
868
+	}
869
+
870
+	// Check if there is a custom field key specific filter.
871
+	if(has_filter("geodir_custom_field_output_select_key_{$cf['field_type_key']}")){
872
+		/**
873
+		 * Filter the select html by field type key.
874
+		 *
875
+		 * @param string $html The html to filter.
876
+		 * @param string $location The location to output the html.
877
+		 * @param array $cf The custom field array.
878
+		 * @since 1.6.6
879
+		 */
880
+		$html = apply_filters("geodir_custom_field_output_select_key_{$cf['field_type_key']}",$html,$location,$cf);
881
+	}
882
+
883
+	// If not html then we run the standard output.
884
+	if(empty($html)){
885
+
886
+		if ($post->{$cf['htmlvar_name']}):
887
+			$field_value = __($post->{$cf['htmlvar_name']}, 'geodirectory');
888
+
889
+			if (!empty($cf['option_values'])) {
890
+				$cf_option_values = geodir_string_values_to_options(stripslashes_deep($cf['option_values']), true);
891
+
892
+				if (!empty($cf_option_values)) {
893
+					foreach ($cf_option_values as $cf_option_value) {
894
+						if (isset($cf_option_value['value']) && $cf_option_value['value'] == $post->{$cf['htmlvar_name']}) {
895
+							//$field_value = $cf_option_value['label']; // no longer needed here.
896
+						}
897
+					}
898
+				}
899
+			}
900
+
901
+			$field_icon = geodir_field_icon_proccess($cf);
902
+			if (strpos($field_icon, 'http') !== false) {
903
+				$field_icon_af = '';
904
+			} elseif ($field_icon == '') {
905
+				$field_icon_af = '';
906
+			} else {
907
+				$field_icon_af = $field_icon;
908
+				$field_icon = '';
909
+			}
910
+
911
+
912
+			$html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
913
+			$html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
914
+			$html .= '</span>' . $field_value . '</div>';
915
+		endif;
916
+
917
+	}
918
+
919
+	return $html;
920 920
 }
921 921
 add_filter('geodir_custom_field_output_select','geodir_cf_select',10,3);
922 922
 
@@ -933,117 +933,117 @@  discard block
 block discarded – undo
933 933
  */
934 934
 function geodir_cf_multiselect($html,$location,$cf,$p=''){
935 935
 
936
-    // check we have the post value
937
-    if(is_int($p)){$post = geodir_get_post_info($p);}
938
-    else{ global $post;}
939
-
940
-    if(!is_array($cf) && $cf!=''){
941
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
942
-        if(!$cf){return NULL;}
943
-    }
944
-
945
-    $html_var = $cf['htmlvar_name'];
946
-
947
-    // Check if there is a location specific filter.
948
-    if(has_filter("geodir_custom_field_output_multiselect_loc_{$location}")){
949
-        /**
950
-         * Filter the multiselect html by location.
951
-         *
952
-         * @param string $html The html to filter.
953
-         * @param array $cf The custom field array.
954
-         * @since 1.6.6
955
-         */
956
-        $html = apply_filters("geodir_custom_field_output_multiselect_loc_{$location}",$html,$cf);
957
-    }
958
-
959
-    // Check if there is a custom field specific filter.
960
-    if(has_filter("geodir_custom_field_output_multiselect_var_{$html_var}")){
961
-        /**
962
-         * Filter the multiselect html by individual custom field.
963
-         *
964
-         * @param string $html The html to filter.
965
-         * @param string $location The location to output the html.
966
-         * @param array $cf The custom field array.
967
-         * @since 1.6.6
968
-         */
969
-        $html = apply_filters("geodir_custom_field_output_multiselect_var_{$html_var}",$html,$location,$cf);
970
-    }
971
-
972
-    // Check if there is a custom field key specific filter.
973
-    if(has_filter("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}")){
974
-        /**
975
-         * Filter the multiselect html by field type key.
976
-         *
977
-         * @param string $html The html to filter.
978
-         * @param string $location The location to output the html.
979
-         * @param array $cf The custom field array.
980
-         * @since 1.6.6
981
-         */
982
-        $html = apply_filters("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}",$html,$location,$cf);
983
-    }
984
-
985
-    // If not html then we run the standard output.
986
-    if(empty($html)){
987
-
988
-
989
-        if (!empty($post->{$cf['htmlvar_name']})):
990
-
991
-            if (is_array($post->{$cf['htmlvar_name']})) {
992
-                $post->{$cf['htmlvar_name']} = implode(', ', $post->{$cf['htmlvar_name']});
993
-            }
994
-
995
-            $field_icon = geodir_field_icon_proccess($cf);
996
-            if (strpos($field_icon, 'http') !== false) {
997
-                $field_icon_af = '';
998
-            } elseif ($field_icon == '') {
999
-                $field_icon_af = '';
1000
-            } else {
1001
-                $field_icon_af = $field_icon;
1002
-                $field_icon = '';
1003
-            }
1004
-
1005
-            $field_values = explode(',', trim($post->{$cf['htmlvar_name']}, ","));
1006
-
1007
-            if(is_array($field_values)){
1008
-                $field_values = array_map('trim', $field_values);
1009
-            }
1010
-
1011
-            $option_values = array();
1012
-            if (!empty($cf['option_values'])) {
1013
-                $cf_option_values = geodir_string_values_to_options(stripslashes_deep($cf['option_values']), true);
1014
-
1015
-                if (!empty($cf_option_values)) {
1016
-                    foreach ($cf_option_values as $cf_option_value) {
1017
-                        if (isset($cf_option_value['value']) && in_array($cf_option_value['value'], $field_values)) {
1018
-                            $option_values[] = $cf_option_value['label'];
1019
-                        }
1020
-                    }
1021
-                }
1022
-            }
1023
-
1024
-
1025
-            $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
1026
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1027
-            $html .= '</span>';
1028
-
1029
-            if (count($option_values) > 1) {
1030
-                $html .= '<ul>';
1031
-
1032
-                foreach ($option_values as $val) {
1033
-                    $html .= '<li>' . $val . '</li>';
1034
-                }
1035
-
1036
-                $html .= '</ul>';
1037
-            } else {
1038
-                $html .= $post->{$cf['htmlvar_name']};
1039
-            }
1040
-
1041
-            $html .= '</div>';
1042
-        endif;
1043
-
1044
-    }
1045
-
1046
-    return $html;
936
+	// check we have the post value
937
+	if(is_int($p)){$post = geodir_get_post_info($p);}
938
+	else{ global $post;}
939
+
940
+	if(!is_array($cf) && $cf!=''){
941
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
942
+		if(!$cf){return NULL;}
943
+	}
944
+
945
+	$html_var = $cf['htmlvar_name'];
946
+
947
+	// Check if there is a location specific filter.
948
+	if(has_filter("geodir_custom_field_output_multiselect_loc_{$location}")){
949
+		/**
950
+		 * Filter the multiselect html by location.
951
+		 *
952
+		 * @param string $html The html to filter.
953
+		 * @param array $cf The custom field array.
954
+		 * @since 1.6.6
955
+		 */
956
+		$html = apply_filters("geodir_custom_field_output_multiselect_loc_{$location}",$html,$cf);
957
+	}
958
+
959
+	// Check if there is a custom field specific filter.
960
+	if(has_filter("geodir_custom_field_output_multiselect_var_{$html_var}")){
961
+		/**
962
+		 * Filter the multiselect html by individual custom field.
963
+		 *
964
+		 * @param string $html The html to filter.
965
+		 * @param string $location The location to output the html.
966
+		 * @param array $cf The custom field array.
967
+		 * @since 1.6.6
968
+		 */
969
+		$html = apply_filters("geodir_custom_field_output_multiselect_var_{$html_var}",$html,$location,$cf);
970
+	}
971
+
972
+	// Check if there is a custom field key specific filter.
973
+	if(has_filter("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}")){
974
+		/**
975
+		 * Filter the multiselect html by field type key.
976
+		 *
977
+		 * @param string $html The html to filter.
978
+		 * @param string $location The location to output the html.
979
+		 * @param array $cf The custom field array.
980
+		 * @since 1.6.6
981
+		 */
982
+		$html = apply_filters("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}",$html,$location,$cf);
983
+	}
984
+
985
+	// If not html then we run the standard output.
986
+	if(empty($html)){
987
+
988
+
989
+		if (!empty($post->{$cf['htmlvar_name']})):
990
+
991
+			if (is_array($post->{$cf['htmlvar_name']})) {
992
+				$post->{$cf['htmlvar_name']} = implode(', ', $post->{$cf['htmlvar_name']});
993
+			}
994
+
995
+			$field_icon = geodir_field_icon_proccess($cf);
996
+			if (strpos($field_icon, 'http') !== false) {
997
+				$field_icon_af = '';
998
+			} elseif ($field_icon == '') {
999
+				$field_icon_af = '';
1000
+			} else {
1001
+				$field_icon_af = $field_icon;
1002
+				$field_icon = '';
1003
+			}
1004
+
1005
+			$field_values = explode(',', trim($post->{$cf['htmlvar_name']}, ","));
1006
+
1007
+			if(is_array($field_values)){
1008
+				$field_values = array_map('trim', $field_values);
1009
+			}
1010
+
1011
+			$option_values = array();
1012
+			if (!empty($cf['option_values'])) {
1013
+				$cf_option_values = geodir_string_values_to_options(stripslashes_deep($cf['option_values']), true);
1014
+
1015
+				if (!empty($cf_option_values)) {
1016
+					foreach ($cf_option_values as $cf_option_value) {
1017
+						if (isset($cf_option_value['value']) && in_array($cf_option_value['value'], $field_values)) {
1018
+							$option_values[] = $cf_option_value['label'];
1019
+						}
1020
+					}
1021
+				}
1022
+			}
1023
+
1024
+
1025
+			$html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
1026
+			$html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1027
+			$html .= '</span>';
1028
+
1029
+			if (count($option_values) > 1) {
1030
+				$html .= '<ul>';
1031
+
1032
+				foreach ($option_values as $val) {
1033
+					$html .= '<li>' . $val . '</li>';
1034
+				}
1035
+
1036
+				$html .= '</ul>';
1037
+			} else {
1038
+				$html .= $post->{$cf['htmlvar_name']};
1039
+			}
1040
+
1041
+			$html .= '</div>';
1042
+		endif;
1043
+
1044
+	}
1045
+
1046
+	return $html;
1047 1047
 }
1048 1048
 add_filter('geodir_custom_field_output_multiselect','geodir_cf_multiselect',10,3);
1049 1049
 
@@ -1060,152 +1060,152 @@  discard block
 block discarded – undo
1060 1060
  */
1061 1061
 function geodir_cf_email($html,$location,$cf,$p=''){
1062 1062
 
1063
-    // check we have the post value
1064
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1065
-    else{ global $post;}
1066
-
1067
-    if(!is_array($cf) && $cf!=''){
1068
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1069
-        if(!$cf){return NULL;}
1070
-    }
1071
-
1072
-    $html_var = $cf['htmlvar_name'];
1073
-
1074
-    // Check if there is a location specific filter.
1075
-    if(has_filter("geodir_custom_field_output_email_loc_{$location}")){
1076
-        /**
1077
-         * Filter the email html by location.
1078
-         *
1079
-         * @param string $html The html to filter.
1080
-         * @param array $cf The custom field array.
1081
-         * @since 1.6.6
1082
-         */
1083
-        $html = apply_filters("geodir_custom_field_output_email_loc_{$location}",$html,$cf);
1084
-    }
1085
-
1086
-    // Check if there is a custom field specific filter.
1087
-    if(has_filter("geodir_custom_field_output_email_var_{$html_var}")){
1088
-        /**
1089
-         * Filter the email html by individual custom field.
1090
-         *
1091
-         * @param string $html The html to filter.
1092
-         * @param string $location The location to output the html.
1093
-         * @param array $cf The custom field array.
1094
-         * @since 1.6.6
1095
-         */
1096
-        $html = apply_filters("geodir_custom_field_output_email_var_{$html_var}",$html,$location,$cf);
1097
-    }
1098
-
1099
-    // Check if there is a custom field key specific filter.
1100
-    if(has_filter("geodir_custom_field_output_email_key_{$cf['field_type_key']}")){
1101
-        /**
1102
-         * Filter the email html by field type key.
1103
-         *
1104
-         * @param string $html The html to filter.
1105
-         * @param string $location The location to output the html.
1106
-         * @param array $cf The custom field array.
1107
-         * @since 1.6.6
1108
-         */
1109
-        $html = apply_filters("geodir_custom_field_output_email_key_{$cf['field_type_key']}",$html,$location,$cf);
1110
-    }
1111
-
1112
-    // If not html then we run the standard output.
1113
-    if(empty($html)){
1114
-
1115
-        global $preview;
1116
-        if ($cf['htmlvar_name'] == 'geodir_email' && !(geodir_is_page('detail') || geodir_is_page('preview'))) {
1117
-            return ''; // Remove Send Enquiry | Send To Friend from listings page
1118
-        }
1119
-
1120
-        $package_info = (array)geodir_post_package_info(array(), $post, $post->post_type);
1121
-
1122
-        if ($cf['htmlvar_name'] == 'geodir_email' && ((isset($package_info['sendtofriend']) && $package_info['sendtofriend']) || $post->{$cf['htmlvar_name']})) {
1123
-            $send_to_friend = true;
1124
-            $b_send_inquiry = '';
1125
-            $b_sendtofriend = '';
1126
-
1127
-            $html = '';
1128
-            if (!$preview) {
1129
-                $b_send_inquiry = 'b_send_inquiry';
1130
-                $b_sendtofriend = 'b_sendtofriend';
1131
-                $html = '<input type="hidden" name="geodir_popup_post_id" value="' . $post->ID . '" /><div class="geodir_display_popup_forms"></div>';
1132
-            }
1133
-
1134
-            $field_icon = geodir_field_icon_proccess($cf);
1135
-            if (strpos($field_icon, 'http') !== false) {
1136
-                $field_icon_af = '';
1137
-            } elseif ($field_icon == '') {
1138
-                $field_icon_af = '<i class="fa fa-envelope"></i>';
1139
-            } else {
1140
-                $field_icon_af = $field_icon;
1141
-                $field_icon = '';
1142
-            }
1143
-
1144
-            $html .= '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af;
1145
-            $seperator = '';
1146
-            if ($post->{$cf['htmlvar_name']}) {
1147
-                $html .= '<a href="javascript:void(0);" class="' . $b_send_inquiry . '" >' . SEND_INQUIRY . '</a>';
1148
-                $seperator = ' | ';
1149
-            }
1150
-
1151
-            if (isset($package_info['sendtofriend']) && $package_info['sendtofriend']) {
1152
-                $html .= $seperator . '<a href="javascript:void(0);" class="' . $b_sendtofriend . '">' . SEND_TO_FRIEND . '</a>';
1153
-            }
1154
-
1155
-            $html .= '</span></div>';
1156
-
1157
-
1158
-            if (isset($_REQUEST['send_inquiry']) && $_REQUEST['send_inquiry'] == 'success') {
1159
-                $html .= '<p class="sucess_msg">' . SEND_INQUIRY_SUCCESS . '</p>';
1160
-            } elseif (isset($_REQUEST['sendtofrnd']) && $_REQUEST['sendtofrnd'] == 'success') {
1161
-                $html .= '<p class="sucess_msg">' . SEND_FRIEND_SUCCESS . '</p>';
1162
-            } elseif (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 'captch') {
1163
-                $html .= '<p class="error_msg_fix">' . WRONG_CAPTCH_MSG . '</p>';
1164
-            }
1165
-
1166
-            /*if(!$preview){require_once (geodir_plugin_path().'/geodirectory-templates/popup-forms.php');}*/
1167
-
1168
-        } else {
1169
-
1170
-            if ($post->{$cf['htmlvar_name']}) {
1171
-
1172
-                $field_icon = geodir_field_icon_proccess($cf);
1173
-                if (strpos($field_icon, 'http') !== false) {
1174
-                    $field_icon_af = '';
1175
-                } elseif ($field_icon == '') {
1176
-                    $field_icon_af = '<i class="fa fa-envelope"></i>';
1177
-                } else {
1178
-                    $field_icon_af = $field_icon;
1179
-                    $field_icon = '';
1180
-                }
1181
-
1182
-
1183
-                $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af;
1184
-                $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1185
-                $html .= '</span><span class="geodir-email-address-output">';
1186
-                $email = $post->{$cf['htmlvar_name']} ;
1187
-                if($e_split = explode('@',$email)){
1188
-                    /**
1189
-                     * Filter email custom field name output.
1190
-                     *
1191
-                     * @since 1.5.3
1192
-                     *
1193
-                     * @param string $email The email string being output.
1194
-                     * @param array $cf Custom field variables array.
1195
-                     */
1196
-                    $email_name = apply_filters('geodir_email_field_name_output',$email,$cf);
1197
-                    $html .=  "<script>document.write('<a href=\"mailto:'+'$e_split[0]' + '@' + '$e_split[1]'+'\">$email_name</a>')</script>";
1198
-                }else{
1199
-                    $html .=  $email;
1200
-                }
1201
-                $html .= '</span></div>';
1202
-            }
1203
-
1204
-        }
1205
-
1206
-    }
1207
-
1208
-    return $html;
1063
+	// check we have the post value
1064
+	if(is_int($p)){$post = geodir_get_post_info($p);}
1065
+	else{ global $post;}
1066
+
1067
+	if(!is_array($cf) && $cf!=''){
1068
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1069
+		if(!$cf){return NULL;}
1070
+	}
1071
+
1072
+	$html_var = $cf['htmlvar_name'];
1073
+
1074
+	// Check if there is a location specific filter.
1075
+	if(has_filter("geodir_custom_field_output_email_loc_{$location}")){
1076
+		/**
1077
+		 * Filter the email html by location.
1078
+		 *
1079
+		 * @param string $html The html to filter.
1080
+		 * @param array $cf The custom field array.
1081
+		 * @since 1.6.6
1082
+		 */
1083
+		$html = apply_filters("geodir_custom_field_output_email_loc_{$location}",$html,$cf);
1084
+	}
1085
+
1086
+	// Check if there is a custom field specific filter.
1087
+	if(has_filter("geodir_custom_field_output_email_var_{$html_var}")){
1088
+		/**
1089
+		 * Filter the email html by individual custom field.
1090
+		 *
1091
+		 * @param string $html The html to filter.
1092
+		 * @param string $location The location to output the html.
1093
+		 * @param array $cf The custom field array.
1094
+		 * @since 1.6.6
1095
+		 */
1096
+		$html = apply_filters("geodir_custom_field_output_email_var_{$html_var}",$html,$location,$cf);
1097
+	}
1098
+
1099
+	// Check if there is a custom field key specific filter.
1100
+	if(has_filter("geodir_custom_field_output_email_key_{$cf['field_type_key']}")){
1101
+		/**
1102
+		 * Filter the email html by field type key.
1103
+		 *
1104
+		 * @param string $html The html to filter.
1105
+		 * @param string $location The location to output the html.
1106
+		 * @param array $cf The custom field array.
1107
+		 * @since 1.6.6
1108
+		 */
1109
+		$html = apply_filters("geodir_custom_field_output_email_key_{$cf['field_type_key']}",$html,$location,$cf);
1110
+	}
1111
+
1112
+	// If not html then we run the standard output.
1113
+	if(empty($html)){
1114
+
1115
+		global $preview;
1116
+		if ($cf['htmlvar_name'] == 'geodir_email' && !(geodir_is_page('detail') || geodir_is_page('preview'))) {
1117
+			return ''; // Remove Send Enquiry | Send To Friend from listings page
1118
+		}
1119
+
1120
+		$package_info = (array)geodir_post_package_info(array(), $post, $post->post_type);
1121
+
1122
+		if ($cf['htmlvar_name'] == 'geodir_email' && ((isset($package_info['sendtofriend']) && $package_info['sendtofriend']) || $post->{$cf['htmlvar_name']})) {
1123
+			$send_to_friend = true;
1124
+			$b_send_inquiry = '';
1125
+			$b_sendtofriend = '';
1126
+
1127
+			$html = '';
1128
+			if (!$preview) {
1129
+				$b_send_inquiry = 'b_send_inquiry';
1130
+				$b_sendtofriend = 'b_sendtofriend';
1131
+				$html = '<input type="hidden" name="geodir_popup_post_id" value="' . $post->ID . '" /><div class="geodir_display_popup_forms"></div>';
1132
+			}
1133
+
1134
+			$field_icon = geodir_field_icon_proccess($cf);
1135
+			if (strpos($field_icon, 'http') !== false) {
1136
+				$field_icon_af = '';
1137
+			} elseif ($field_icon == '') {
1138
+				$field_icon_af = '<i class="fa fa-envelope"></i>';
1139
+			} else {
1140
+				$field_icon_af = $field_icon;
1141
+				$field_icon = '';
1142
+			}
1143
+
1144
+			$html .= '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af;
1145
+			$seperator = '';
1146
+			if ($post->{$cf['htmlvar_name']}) {
1147
+				$html .= '<a href="javascript:void(0);" class="' . $b_send_inquiry . '" >' . SEND_INQUIRY . '</a>';
1148
+				$seperator = ' | ';
1149
+			}
1150
+
1151
+			if (isset($package_info['sendtofriend']) && $package_info['sendtofriend']) {
1152
+				$html .= $seperator . '<a href="javascript:void(0);" class="' . $b_sendtofriend . '">' . SEND_TO_FRIEND . '</a>';
1153
+			}
1154
+
1155
+			$html .= '</span></div>';
1156
+
1157
+
1158
+			if (isset($_REQUEST['send_inquiry']) && $_REQUEST['send_inquiry'] == 'success') {
1159
+				$html .= '<p class="sucess_msg">' . SEND_INQUIRY_SUCCESS . '</p>';
1160
+			} elseif (isset($_REQUEST['sendtofrnd']) && $_REQUEST['sendtofrnd'] == 'success') {
1161
+				$html .= '<p class="sucess_msg">' . SEND_FRIEND_SUCCESS . '</p>';
1162
+			} elseif (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 'captch') {
1163
+				$html .= '<p class="error_msg_fix">' . WRONG_CAPTCH_MSG . '</p>';
1164
+			}
1165
+
1166
+			/*if(!$preview){require_once (geodir_plugin_path().'/geodirectory-templates/popup-forms.php');}*/
1167
+
1168
+		} else {
1169
+
1170
+			if ($post->{$cf['htmlvar_name']}) {
1171
+
1172
+				$field_icon = geodir_field_icon_proccess($cf);
1173
+				if (strpos($field_icon, 'http') !== false) {
1174
+					$field_icon_af = '';
1175
+				} elseif ($field_icon == '') {
1176
+					$field_icon_af = '<i class="fa fa-envelope"></i>';
1177
+				} else {
1178
+					$field_icon_af = $field_icon;
1179
+					$field_icon = '';
1180
+				}
1181
+
1182
+
1183
+				$html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af;
1184
+				$html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1185
+				$html .= '</span><span class="geodir-email-address-output">';
1186
+				$email = $post->{$cf['htmlvar_name']} ;
1187
+				if($e_split = explode('@',$email)){
1188
+					/**
1189
+					 * Filter email custom field name output.
1190
+					 *
1191
+					 * @since 1.5.3
1192
+					 *
1193
+					 * @param string $email The email string being output.
1194
+					 * @param array $cf Custom field variables array.
1195
+					 */
1196
+					$email_name = apply_filters('geodir_email_field_name_output',$email,$cf);
1197
+					$html .=  "<script>document.write('<a href=\"mailto:'+'$e_split[0]' + '@' + '$e_split[1]'+'\">$email_name</a>')</script>";
1198
+				}else{
1199
+					$html .=  $email;
1200
+				}
1201
+				$html .= '</span></div>';
1202
+			}
1203
+
1204
+		}
1205
+
1206
+	}
1207
+
1208
+	return $html;
1209 1209
 }
1210 1210
 add_filter('geodir_custom_field_output_email','geodir_cf_email',10,3);
1211 1211
 
@@ -1222,130 +1222,130 @@  discard block
 block discarded – undo
1222 1222
  */
1223 1223
 function geodir_cf_file($html,$location,$cf,$p=''){
1224 1224
 
1225
-    // check we have the post value
1226
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1227
-    else{ global $post;}
1228
-
1229
-    if(!is_array($cf) && $cf!=''){
1230
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1231
-        if(!$cf){return NULL;}
1232
-    }
1233
-
1234
-    $html_var = $cf['htmlvar_name'];
1235
-
1236
-    // Check if there is a location specific filter.
1237
-    if(has_filter("geodir_custom_field_output_file_loc_{$location}")){
1238
-        /**
1239
-         * Filter the file html by location.
1240
-         *
1241
-         * @param string $html The html to filter.
1242
-         * @param array $cf The custom field array.
1243
-         * @since 1.6.6
1244
-         */
1245
-        $html = apply_filters("geodir_custom_field_output_file_loc_{$location}",$html,$cf);
1246
-    }
1247
-
1248
-    // Check if there is a custom field specific filter.
1249
-    if(has_filter("geodir_custom_field_output_file_var_{$html_var}")){
1250
-        /**
1251
-         * Filter the file html by individual custom field.
1252
-         *
1253
-         * @param string $html The html to filter.
1254
-         * @param string $location The location to output the html.
1255
-         * @param array $cf The custom field array.
1256
-         * @since 1.6.6
1257
-         */
1258
-        $html = apply_filters("geodir_custom_field_output_file_var_{$html_var}",$html,$location,$cf);
1259
-    }
1260
-
1261
-    // Check if there is a custom field key specific filter.
1262
-    if(has_filter("geodir_custom_field_output_file_key_{$cf['field_type_key']}")){
1263
-        /**
1264
-         * Filter the file html by field type key.
1265
-         *
1266
-         * @param string $html The html to filter.
1267
-         * @param string $location The location to output the html.
1268
-         * @param array $cf The custom field array.
1269
-         * @since 1.6.6
1270
-         */
1271
-        $html = apply_filters("geodir_custom_field_output_file_key_{$cf['field_type_key']}",$html,$location,$cf);
1272
-    }
1273
-
1274
-    // If not html then we run the standard output.
1275
-    if(empty($html)){
1276
-
1277
-        if (!empty($post->{$cf['htmlvar_name']})):
1278
-
1279
-            $files = explode(",", $post->{$cf['htmlvar_name']});
1280
-            if (!empty($files)):
1281
-
1282
-                $extra_fields = !empty($cf['extra_fields']) ? maybe_unserialize($cf['extra_fields']) : NULL;
1283
-                $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'] : '';
1284
-
1285
-                $file_paths = '';
1286
-                foreach ($files as $file) {
1287
-                    if (!empty($file)) {
1288
-
1289
-                        // $filetype = wp_check_filetype($file);
1290
-
1291
-                        $image_name_arr = explode('/', $file);
1292
-                        $curr_img_dir = $image_name_arr[count($image_name_arr) - 2];
1293
-                        $filename = end($image_name_arr);
1294
-                        $img_name_arr = explode('.', $filename);
1295
-
1296
-                        $arr_file_type = wp_check_filetype($filename);
1297
-                        if (empty($arr_file_type['ext']) || empty($arr_file_type['type'])) {
1298
-                            continue;
1299
-                        }
1300
-
1301
-                        $uploaded_file_type = $arr_file_type['type'];
1302
-                        $uploaded_file_ext = $arr_file_type['ext'];
1303
-
1304
-                        if (!empty($allowed_file_types) && !in_array($uploaded_file_ext, $allowed_file_types)) {
1305
-                            continue; // Invalid file type.
1306
-                        }
1307
-
1308
-                        //$allowed_file_types = array('application/pdf', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'text/csv', 'text/plain');
1309
-                        $image_file_types = array('image/jpg', 'image/jpeg', 'image/gif', 'image/png', 'image/bmp', 'image/x-icon');
1310
-
1311
-                        // If the uploaded file is image
1312
-                        if (in_array($uploaded_file_type, $image_file_types)) {
1313
-                            $file_paths .= '<div class="geodir-custom-post-gallery" class="clearfix">';
1314
-                            $file_paths .= '<a href="'.$file.'">';
1315
-                            $file_paths .= geodir_show_image(array('src' => $file), 'thumbnail', false, false);
1316
-                            $file_paths .= '</a>';
1317
-                            //$file_paths .= '<img src="'.$file.'"  />';	
1318
-                            $file_paths .= '</div>';
1319
-                        } else {
1320
-                            $ext_path = '_' . $html_var . '_';
1321
-                            $filename = explode($ext_path, $filename);
1322
-                            $file_paths .= '<a href="' . $file . '" target="_blank">' . $filename[count($filename) - 1] . '</a>';
1323
-                        }
1324
-                    }
1325
-                }
1326
-
1327
-                $field_icon = geodir_field_icon_proccess($cf);
1328
-                if (strpos($field_icon, 'http') !== false) {
1329
-                    $field_icon_af = '';
1330
-                } elseif ($field_icon == '') {
1331
-                    $field_icon_af = '';
1332
-                } else {
1333
-                    $field_icon_af = $field_icon;
1334
-                    $field_icon = '';
1335
-                }
1336
-
1337
-                $html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' geodir-custom-file-box ' . $cf['htmlvar_name'] . '"><div class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
1338
-                $html .= '<span style="display: inline-block; vertical-align: top; padding-right: 14px;">';
1339
-                $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1340
-                $html .= '</span>';
1341
-                $html .= $file_paths . '</div></div>';
1342
-
1343
-            endif;
1344
-        endif;
1345
-
1346
-    }
1347
-
1348
-    return $html;
1225
+	// check we have the post value
1226
+	if(is_int($p)){$post = geodir_get_post_info($p);}
1227
+	else{ global $post;}
1228
+
1229
+	if(!is_array($cf) && $cf!=''){
1230
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1231
+		if(!$cf){return NULL;}
1232
+	}
1233
+
1234
+	$html_var = $cf['htmlvar_name'];
1235
+
1236
+	// Check if there is a location specific filter.
1237
+	if(has_filter("geodir_custom_field_output_file_loc_{$location}")){
1238
+		/**
1239
+		 * Filter the file html by location.
1240
+		 *
1241
+		 * @param string $html The html to filter.
1242
+		 * @param array $cf The custom field array.
1243
+		 * @since 1.6.6
1244
+		 */
1245
+		$html = apply_filters("geodir_custom_field_output_file_loc_{$location}",$html,$cf);
1246
+	}
1247
+
1248
+	// Check if there is a custom field specific filter.
1249
+	if(has_filter("geodir_custom_field_output_file_var_{$html_var}")){
1250
+		/**
1251
+		 * Filter the file html by individual custom field.
1252
+		 *
1253
+		 * @param string $html The html to filter.
1254
+		 * @param string $location The location to output the html.
1255
+		 * @param array $cf The custom field array.
1256
+		 * @since 1.6.6
1257
+		 */
1258
+		$html = apply_filters("geodir_custom_field_output_file_var_{$html_var}",$html,$location,$cf);
1259
+	}
1260
+
1261
+	// Check if there is a custom field key specific filter.
1262
+	if(has_filter("geodir_custom_field_output_file_key_{$cf['field_type_key']}")){
1263
+		/**
1264
+		 * Filter the file html by field type key.
1265
+		 *
1266
+		 * @param string $html The html to filter.
1267
+		 * @param string $location The location to output the html.
1268
+		 * @param array $cf The custom field array.
1269
+		 * @since 1.6.6
1270
+		 */
1271
+		$html = apply_filters("geodir_custom_field_output_file_key_{$cf['field_type_key']}",$html,$location,$cf);
1272
+	}
1273
+
1274
+	// If not html then we run the standard output.
1275
+	if(empty($html)){
1276
+
1277
+		if (!empty($post->{$cf['htmlvar_name']})):
1278
+
1279
+			$files = explode(",", $post->{$cf['htmlvar_name']});
1280
+			if (!empty($files)):
1281
+
1282
+				$extra_fields = !empty($cf['extra_fields']) ? maybe_unserialize($cf['extra_fields']) : NULL;
1283
+				$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'] : '';
1284
+
1285
+				$file_paths = '';
1286
+				foreach ($files as $file) {
1287
+					if (!empty($file)) {
1288
+
1289
+						// $filetype = wp_check_filetype($file);
1290
+
1291
+						$image_name_arr = explode('/', $file);
1292
+						$curr_img_dir = $image_name_arr[count($image_name_arr) - 2];
1293
+						$filename = end($image_name_arr);
1294
+						$img_name_arr = explode('.', $filename);
1295
+
1296
+						$arr_file_type = wp_check_filetype($filename);
1297
+						if (empty($arr_file_type['ext']) || empty($arr_file_type['type'])) {
1298
+							continue;
1299
+						}
1300
+
1301
+						$uploaded_file_type = $arr_file_type['type'];
1302
+						$uploaded_file_ext = $arr_file_type['ext'];
1303
+
1304
+						if (!empty($allowed_file_types) && !in_array($uploaded_file_ext, $allowed_file_types)) {
1305
+							continue; // Invalid file type.
1306
+						}
1307
+
1308
+						//$allowed_file_types = array('application/pdf', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'text/csv', 'text/plain');
1309
+						$image_file_types = array('image/jpg', 'image/jpeg', 'image/gif', 'image/png', 'image/bmp', 'image/x-icon');
1310
+
1311
+						// If the uploaded file is image
1312
+						if (in_array($uploaded_file_type, $image_file_types)) {
1313
+							$file_paths .= '<div class="geodir-custom-post-gallery" class="clearfix">';
1314
+							$file_paths .= '<a href="'.$file.'">';
1315
+							$file_paths .= geodir_show_image(array('src' => $file), 'thumbnail', false, false);
1316
+							$file_paths .= '</a>';
1317
+							//$file_paths .= '<img src="'.$file.'"  />';	
1318
+							$file_paths .= '</div>';
1319
+						} else {
1320
+							$ext_path = '_' . $html_var . '_';
1321
+							$filename = explode($ext_path, $filename);
1322
+							$file_paths .= '<a href="' . $file . '" target="_blank">' . $filename[count($filename) - 1] . '</a>';
1323
+						}
1324
+					}
1325
+				}
1326
+
1327
+				$field_icon = geodir_field_icon_proccess($cf);
1328
+				if (strpos($field_icon, 'http') !== false) {
1329
+					$field_icon_af = '';
1330
+				} elseif ($field_icon == '') {
1331
+					$field_icon_af = '';
1332
+				} else {
1333
+					$field_icon_af = $field_icon;
1334
+					$field_icon = '';
1335
+				}
1336
+
1337
+				$html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' geodir-custom-file-box ' . $cf['htmlvar_name'] . '"><div class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
1338
+				$html .= '<span style="display: inline-block; vertical-align: top; padding-right: 14px;">';
1339
+				$html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1340
+				$html .= '</span>';
1341
+				$html .= $file_paths . '</div></div>';
1342
+
1343
+			endif;
1344
+		endif;
1345
+
1346
+	}
1347
+
1348
+	return $html;
1349 1349
 }
1350 1350
 add_filter('geodir_custom_field_output_file','geodir_cf_file',10,3);
1351 1351
 
@@ -1363,80 +1363,80 @@  discard block
 block discarded – undo
1363 1363
  */
1364 1364
 function geodir_cf_textarea($html,$location,$cf,$p=''){
1365 1365
 
1366
-    // check we have the post value
1367
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1368
-    else{ global $post;}
1369
-
1370
-    if(!is_array($cf) && $cf!=''){
1371
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1372
-        if(!$cf){return NULL;}
1373
-    }
1374
-
1375
-    $html_var = $cf['htmlvar_name'];
1376
-
1377
-    // Check if there is a location specific filter.
1378
-    if(has_filter("geodir_custom_field_output_textarea_loc_{$location}")){
1379
-        /**
1380
-         * Filter the textarea html by location.
1381
-         *
1382
-         * @param string $html The html to filter.
1383
-         * @param array $cf The custom field array.
1384
-         * @since 1.6.6
1385
-         */
1386
-        $html = apply_filters("geodir_custom_field_output_textarea_loc_{$location}",$html,$cf);
1387
-    }
1388
-
1389
-    // Check if there is a custom field specific filter.
1390
-    if(has_filter("geodir_custom_field_output_textarea_var_{$html_var}")){
1391
-        /**
1392
-         * Filter the textarea html by individual custom field.
1393
-         *
1394
-         * @param string $html The html to filter.
1395
-         * @param string $location The location to output the html.
1396
-         * @param array $cf The custom field array.
1397
-         * @since 1.6.6
1398
-         */
1399
-        $html = apply_filters("geodir_custom_field_output_textarea_var_{$html_var}",$html,$location,$cf);
1400
-    }
1401
-
1402
-    // Check if there is a custom field key specific filter.
1403
-    if(has_filter("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}")){
1404
-        /**
1405
-         * Filter the textarea html by field type key.
1406
-         *
1407
-         * @param string $html The html to filter.
1408
-         * @param string $location The location to output the html.
1409
-         * @param array $cf The custom field array.
1410
-         * @since 1.6.6
1411
-         */
1412
-        $html = apply_filters("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}",$html,$location,$cf);
1413
-    }
1414
-
1415
-    // If not html then we run the standard output.
1416
-    if(empty($html)){
1417
-
1418
-        if (!empty($post->{$cf['htmlvar_name']})) {
1419
-
1420
-            $field_icon = geodir_field_icon_proccess($cf);
1421
-            if (strpos($field_icon, 'http') !== false) {
1422
-                $field_icon_af = '';
1423
-            } elseif ($field_icon == '') {
1424
-                $field_icon_af = '';
1425
-            } else {
1426
-                $field_icon_af = $field_icon;
1427
-                $field_icon = '';
1428
-            }
1429
-
1430
-
1431
-            $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
1432
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1433
-            $html .= '</span>' . wpautop($post->{$cf['htmlvar_name']}) . '</div>';
1434
-
1435
-        }
1436
-
1437
-    }
1438
-
1439
-    return $html;
1366
+	// check we have the post value
1367
+	if(is_int($p)){$post = geodir_get_post_info($p);}
1368
+	else{ global $post;}
1369
+
1370
+	if(!is_array($cf) && $cf!=''){
1371
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1372
+		if(!$cf){return NULL;}
1373
+	}
1374
+
1375
+	$html_var = $cf['htmlvar_name'];
1376
+
1377
+	// Check if there is a location specific filter.
1378
+	if(has_filter("geodir_custom_field_output_textarea_loc_{$location}")){
1379
+		/**
1380
+		 * Filter the textarea html by location.
1381
+		 *
1382
+		 * @param string $html The html to filter.
1383
+		 * @param array $cf The custom field array.
1384
+		 * @since 1.6.6
1385
+		 */
1386
+		$html = apply_filters("geodir_custom_field_output_textarea_loc_{$location}",$html,$cf);
1387
+	}
1388
+
1389
+	// Check if there is a custom field specific filter.
1390
+	if(has_filter("geodir_custom_field_output_textarea_var_{$html_var}")){
1391
+		/**
1392
+		 * Filter the textarea html by individual custom field.
1393
+		 *
1394
+		 * @param string $html The html to filter.
1395
+		 * @param string $location The location to output the html.
1396
+		 * @param array $cf The custom field array.
1397
+		 * @since 1.6.6
1398
+		 */
1399
+		$html = apply_filters("geodir_custom_field_output_textarea_var_{$html_var}",$html,$location,$cf);
1400
+	}
1401
+
1402
+	// Check if there is a custom field key specific filter.
1403
+	if(has_filter("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}")){
1404
+		/**
1405
+		 * Filter the textarea html by field type key.
1406
+		 *
1407
+		 * @param string $html The html to filter.
1408
+		 * @param string $location The location to output the html.
1409
+		 * @param array $cf The custom field array.
1410
+		 * @since 1.6.6
1411
+		 */
1412
+		$html = apply_filters("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}",$html,$location,$cf);
1413
+	}
1414
+
1415
+	// If not html then we run the standard output.
1416
+	if(empty($html)){
1417
+
1418
+		if (!empty($post->{$cf['htmlvar_name']})) {
1419
+
1420
+			$field_icon = geodir_field_icon_proccess($cf);
1421
+			if (strpos($field_icon, 'http') !== false) {
1422
+				$field_icon_af = '';
1423
+			} elseif ($field_icon == '') {
1424
+				$field_icon_af = '';
1425
+			} else {
1426
+				$field_icon_af = $field_icon;
1427
+				$field_icon = '';
1428
+			}
1429
+
1430
+
1431
+			$html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
1432
+			$html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1433
+			$html .= '</span>' . wpautop($post->{$cf['htmlvar_name']}) . '</div>';
1434
+
1435
+		}
1436
+
1437
+	}
1438
+
1439
+	return $html;
1440 1440
 }
1441 1441
 add_filter('geodir_custom_field_output_textarea','geodir_cf_textarea',10,3);
1442 1442
 
@@ -1454,79 +1454,79 @@  discard block
 block discarded – undo
1454 1454
  */
1455 1455
 function geodir_cf_html($html,$location,$cf,$p=''){
1456 1456
 
1457
-    // check we have the post value
1458
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1459
-    else{ global $post;}
1460
-
1461
-    if(!is_array($cf) && $cf!=''){
1462
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1463
-        if(!$cf){return NULL;}
1464
-    }
1465
-
1466
-    $html_var = $cf['htmlvar_name'];
1467
-
1468
-    // Check if there is a location specific filter.
1469
-    if(has_filter("geodir_custom_field_output_html_loc_{$location}")){
1470
-        /**
1471
-         * Filter the html html by location.
1472
-         *
1473
-         * @param string $html The html to filter.
1474
-         * @param array $cf The custom field array.
1475
-         * @since 1.6.6
1476
-         */
1477
-        $html = apply_filters("geodir_custom_field_output_html_loc_{$location}",$html,$cf);
1478
-    }
1479
-
1480
-    // Check if there is a custom field specific filter.
1481
-    if(has_filter("geodir_custom_field_output_html_var_{$html_var}")){
1482
-        /**
1483
-         * Filter the html html by individual custom field.
1484
-         *
1485
-         * @param string $html The html to filter.
1486
-         * @param string $location The location to output the html.
1487
-         * @param array $cf The custom field array.
1488
-         * @since 1.6.6
1489
-         */
1490
-        $html = apply_filters("geodir_custom_field_output_html_var_{$html_var}",$html,$location,$cf);
1491
-    }
1492
-
1493
-    // Check if there is a custom field key specific filter.
1494
-    if(has_filter("geodir_custom_field_output_html_key_{$cf['field_type_key']}")){
1495
-        /**
1496
-         * Filter the html html by field type key.
1497
-         *
1498
-         * @param string $html The html to filter.
1499
-         * @param string $location The location to output the html.
1500
-         * @param array $cf The custom field array.
1501
-         * @since 1.6.6
1502
-         */
1503
-        $html = apply_filters("geodir_custom_field_output_html_key_{$cf['field_type_key']}",$html,$location,$cf);
1504
-    }
1505
-
1506
-    // If not html then we run the standard output.
1507
-    if(empty($html)){
1508
-
1509
-        if (!empty($post->{$cf['htmlvar_name']})) {
1510
-
1511
-            $field_icon = geodir_field_icon_proccess($cf);
1512
-            if (strpos($field_icon, 'http') !== false) {
1513
-                $field_icon_af = '';
1514
-            } elseif ($field_icon == '') {
1515
-                $field_icon_af = '';
1516
-            } else {
1517
-                $field_icon_af = $field_icon;
1518
-                $field_icon = '';
1519
-            }
1520
-
1521
-            $html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
1522
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1523
-            $html .= '</span>' . wpautop($post->{$cf['htmlvar_name']}) . '</div>';
1524
-
1525
-        }
1526
-
1527
-    }
1528
-
1529
-    return $html;
1457
+	// check we have the post value
1458
+	if(is_int($p)){$post = geodir_get_post_info($p);}
1459
+	else{ global $post;}
1460
+
1461
+	if(!is_array($cf) && $cf!=''){
1462
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1463
+		if(!$cf){return NULL;}
1464
+	}
1465
+
1466
+	$html_var = $cf['htmlvar_name'];
1467
+
1468
+	// Check if there is a location specific filter.
1469
+	if(has_filter("geodir_custom_field_output_html_loc_{$location}")){
1470
+		/**
1471
+		 * Filter the html html by location.
1472
+		 *
1473
+		 * @param string $html The html to filter.
1474
+		 * @param array $cf The custom field array.
1475
+		 * @since 1.6.6
1476
+		 */
1477
+		$html = apply_filters("geodir_custom_field_output_html_loc_{$location}",$html,$cf);
1478
+	}
1479
+
1480
+	// Check if there is a custom field specific filter.
1481
+	if(has_filter("geodir_custom_field_output_html_var_{$html_var}")){
1482
+		/**
1483
+		 * Filter the html html by individual custom field.
1484
+		 *
1485
+		 * @param string $html The html to filter.
1486
+		 * @param string $location The location to output the html.
1487
+		 * @param array $cf The custom field array.
1488
+		 * @since 1.6.6
1489
+		 */
1490
+		$html = apply_filters("geodir_custom_field_output_html_var_{$html_var}",$html,$location,$cf);
1491
+	}
1492
+
1493
+	// Check if there is a custom field key specific filter.
1494
+	if(has_filter("geodir_custom_field_output_html_key_{$cf['field_type_key']}")){
1495
+		/**
1496
+		 * Filter the html html by field type key.
1497
+		 *
1498
+		 * @param string $html The html to filter.
1499
+		 * @param string $location The location to output the html.
1500
+		 * @param array $cf The custom field array.
1501
+		 * @since 1.6.6
1502
+		 */
1503
+		$html = apply_filters("geodir_custom_field_output_html_key_{$cf['field_type_key']}",$html,$location,$cf);
1504
+	}
1505
+
1506
+	// If not html then we run the standard output.
1507
+	if(empty($html)){
1508
+
1509
+		if (!empty($post->{$cf['htmlvar_name']})) {
1510
+
1511
+			$field_icon = geodir_field_icon_proccess($cf);
1512
+			if (strpos($field_icon, 'http') !== false) {
1513
+				$field_icon_af = '';
1514
+			} elseif ($field_icon == '') {
1515
+				$field_icon_af = '';
1516
+			} else {
1517
+				$field_icon_af = $field_icon;
1518
+				$field_icon = '';
1519
+			}
1520
+
1521
+			$html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
1522
+			$html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1523
+			$html .= '</span>' . wpautop($post->{$cf['htmlvar_name']}) . '</div>';
1524
+
1525
+		}
1526
+
1527
+	}
1528
+
1529
+	return $html;
1530 1530
 }
1531 1531
 add_filter('geodir_custom_field_output_html','geodir_cf_html',10,3);
1532 1532
 
@@ -1544,113 +1544,113 @@  discard block
 block discarded – undo
1544 1544
  */
1545 1545
 function geodir_cf_taxonomy($html,$location,$cf,$p=''){
1546 1546
 
1547
-    // check we have the post value
1548
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1549
-    else{ global $post;}
1550
-
1551
-    if(!is_array($cf) && $cf!=''){
1552
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1553
-        if(!$cf){return NULL;}
1554
-    }
1555
-
1556
-    $html_var = $cf['htmlvar_name'];
1557
-
1558
-    // Check if there is a location specific filter.
1559
-    if(has_filter("geodir_custom_field_output_taxonomy_loc_{$location}")){
1560
-        /**
1561
-         * Filter the taxonomy html by location.
1562
-         *
1563
-         * @param string $html The html to filter.
1564
-         * @param array $cf The custom field array.
1565
-         * @since 1.6.6
1566
-         */
1567
-        $html = apply_filters("geodir_custom_field_output_taxonomy_loc_{$location}",$html,$cf);
1568
-    }
1569
-
1570
-    // Check if there is a custom field specific filter.
1571
-    if(has_filter("geodir_custom_field_output_taxonomy_var_{$html_var}")){
1572
-        /**
1573
-         * Filter the taxonomy html by individual custom field.
1574
-         *
1575
-         * @param string $html The html to filter.
1576
-         * @param string $location The location to output the html.
1577
-         * @param array $cf The custom field array.
1578
-         * @since 1.6.6
1579
-         */
1580
-        $html = apply_filters("geodir_custom_field_output_taxonomy_var_{$html_var}",$html,$location,$cf);
1581
-    }
1582
-
1583
-    // Check if there is a custom field key specific filter.
1584
-    if(has_filter("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}")){
1585
-        /**
1586
-         * Filter the taxonomy html by field type key.
1587
-         *
1588
-         * @param string $html The html to filter.
1589
-         * @param string $location The location to output the html.
1590
-         * @param array $cf The custom field array.
1591
-         * @since 1.6.6
1592
-         */
1593
-        $html = apply_filters("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}",$html,$location,$cf);
1594
-    }
1595
-
1596
-    // If not html then we run the standard output.
1597
-    if(empty($html)){
1598
-
1599
-        if ($html_var == $post->post_type . 'category' && !empty($post->{$html_var})) {
1600
-            $post_taxonomy = $post->post_type . 'category';
1601
-            $field_value = $post->{$html_var};
1602
-            $links = array();
1603
-            $terms = array();
1604
-            $termsOrdered = array();
1605
-            if (!is_array($field_value)) {
1606
-                $field_value = explode(",", trim($field_value, ","));
1607
-            }
1608
-
1609
-            $field_value = array_unique($field_value);
1610
-
1611
-            if (!empty($field_value)) {
1612
-                foreach ($field_value as $term) {
1613
-                    $term = trim($term);
1614
-
1615
-                    if ($term != '') {
1616
-                        $term = get_term_by('id', $term, $html_var);
1617
-                        if (is_object($term)) {
1618
-                            $links[] = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>" . $term->name . "</a>";
1619
-                            $terms[] = $term;
1620
-                        }
1621
-                    }
1622
-                }
1623
-                if (!empty($links)) {
1624
-                    // order alphabetically
1625
-                    asort($links);
1626
-                    foreach (array_keys($links) as $key) {
1627
-                        $termsOrdered[$key] = $terms[$key];
1628
-                    }
1629
-                    $terms = $termsOrdered;
1630
-                }
1631
-            }
1632
-            $html_value = !empty($links) && !empty($terms) ? wp_sprintf('%l', $links, (object)$terms) : '';
1633
-
1634
-            if ($html_value != '') {
1635
-                $field_icon = geodir_field_icon_proccess($cf);
1636
-                if (strpos($field_icon, 'http') !== false) {
1637
-                    $field_icon_af = '';
1638
-                } else if ($field_icon == '') {
1639
-                    $field_icon_af = '';
1640
-                } else {
1641
-                    $field_icon_af = $field_icon;
1642
-                    $field_icon = '';
1643
-                }
1644
-
1645
-                $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $html_var . '" style="clear:both;"><span class="geodir-i-taxonomy geodir-i-category" style="' . $field_icon . '">' . $field_icon_af;
1646
-                $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1647
-                $html .= '</span> ' . $html_value . '</div>';
1648
-            }
1649
-        }
1650
-
1651
-    }
1652
-
1653
-    return $html;
1547
+	// check we have the post value
1548
+	if(is_int($p)){$post = geodir_get_post_info($p);}
1549
+	else{ global $post;}
1550
+
1551
+	if(!is_array($cf) && $cf!=''){
1552
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1553
+		if(!$cf){return NULL;}
1554
+	}
1555
+
1556
+	$html_var = $cf['htmlvar_name'];
1557
+
1558
+	// Check if there is a location specific filter.
1559
+	if(has_filter("geodir_custom_field_output_taxonomy_loc_{$location}")){
1560
+		/**
1561
+		 * Filter the taxonomy html by location.
1562
+		 *
1563
+		 * @param string $html The html to filter.
1564
+		 * @param array $cf The custom field array.
1565
+		 * @since 1.6.6
1566
+		 */
1567
+		$html = apply_filters("geodir_custom_field_output_taxonomy_loc_{$location}",$html,$cf);
1568
+	}
1569
+
1570
+	// Check if there is a custom field specific filter.
1571
+	if(has_filter("geodir_custom_field_output_taxonomy_var_{$html_var}")){
1572
+		/**
1573
+		 * Filter the taxonomy html by individual custom field.
1574
+		 *
1575
+		 * @param string $html The html to filter.
1576
+		 * @param string $location The location to output the html.
1577
+		 * @param array $cf The custom field array.
1578
+		 * @since 1.6.6
1579
+		 */
1580
+		$html = apply_filters("geodir_custom_field_output_taxonomy_var_{$html_var}",$html,$location,$cf);
1581
+	}
1582
+
1583
+	// Check if there is a custom field key specific filter.
1584
+	if(has_filter("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}")){
1585
+		/**
1586
+		 * Filter the taxonomy html by field type key.
1587
+		 *
1588
+		 * @param string $html The html to filter.
1589
+		 * @param string $location The location to output the html.
1590
+		 * @param array $cf The custom field array.
1591
+		 * @since 1.6.6
1592
+		 */
1593
+		$html = apply_filters("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}",$html,$location,$cf);
1594
+	}
1595
+
1596
+	// If not html then we run the standard output.
1597
+	if(empty($html)){
1598
+
1599
+		if ($html_var == $post->post_type . 'category' && !empty($post->{$html_var})) {
1600
+			$post_taxonomy = $post->post_type . 'category';
1601
+			$field_value = $post->{$html_var};
1602
+			$links = array();
1603
+			$terms = array();
1604
+			$termsOrdered = array();
1605
+			if (!is_array($field_value)) {
1606
+				$field_value = explode(",", trim($field_value, ","));
1607
+			}
1608
+
1609
+			$field_value = array_unique($field_value);
1610
+
1611
+			if (!empty($field_value)) {
1612
+				foreach ($field_value as $term) {
1613
+					$term = trim($term);
1614
+
1615
+					if ($term != '') {
1616
+						$term = get_term_by('id', $term, $html_var);
1617
+						if (is_object($term)) {
1618
+							$links[] = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>" . $term->name . "</a>";
1619
+							$terms[] = $term;
1620
+						}
1621
+					}
1622
+				}
1623
+				if (!empty($links)) {
1624
+					// order alphabetically
1625
+					asort($links);
1626
+					foreach (array_keys($links) as $key) {
1627
+						$termsOrdered[$key] = $terms[$key];
1628
+					}
1629
+					$terms = $termsOrdered;
1630
+				}
1631
+			}
1632
+			$html_value = !empty($links) && !empty($terms) ? wp_sprintf('%l', $links, (object)$terms) : '';
1633
+
1634
+			if ($html_value != '') {
1635
+				$field_icon = geodir_field_icon_proccess($cf);
1636
+				if (strpos($field_icon, 'http') !== false) {
1637
+					$field_icon_af = '';
1638
+				} else if ($field_icon == '') {
1639
+					$field_icon_af = '';
1640
+				} else {
1641
+					$field_icon_af = $field_icon;
1642
+					$field_icon = '';
1643
+				}
1644
+
1645
+				$html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $html_var . '" style="clear:both;"><span class="geodir-i-taxonomy geodir-i-category" style="' . $field_icon . '">' . $field_icon_af;
1646
+				$html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1647
+				$html .= '</span> ' . $html_value . '</div>';
1648
+			}
1649
+		}
1650
+
1651
+	}
1652
+
1653
+	return $html;
1654 1654
 }
1655 1655
 add_filter('geodir_custom_field_output_taxonomy','geodir_cf_taxonomy',10,3);
1656 1656
 
@@ -1667,161 +1667,161 @@  discard block
 block discarded – undo
1667 1667
  */
1668 1668
 function geodir_cf_address($html,$location,$cf,$p=''){
1669 1669
 
1670
-    // check we have the post value
1671
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1672
-    else{ global $post;}
1673
-
1674
-    if(!is_array($cf) && $cf!=''){
1675
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1676
-        if(!$cf){return NULL;}
1677
-    }
1678
-
1679
-    $html_var = $cf['htmlvar_name'];
1680
-
1681
-    // Check if there is a location specific filter.
1682
-    if(has_filter("geodir_custom_field_output_address_loc_{$location}")){
1683
-        /**
1684
-         * Filter the address html by location.
1685
-         *
1686
-         * @param string $html The html to filter.
1687
-         * @param array $cf The custom field array.
1688
-         * @since 1.6.6
1689
-         */
1690
-        $html = apply_filters("geodir_custom_field_output_address_loc_{$location}",$html,$cf);
1691
-    }
1692
-
1693
-    // Check if there is a custom field specific filter.
1694
-    if(has_filter("geodir_custom_field_output_address_var_{$html_var}")){
1695
-        /**
1696
-         * Filter the address html by individual custom field.
1697
-         *
1698
-         * @param string $html The html to filter.
1699
-         * @param string $location The location to output the html.
1700
-         * @param array $cf The custom field array.
1701
-         * @since 1.6.6
1702
-         */
1703
-        $html = apply_filters("geodir_custom_field_output_address_var_{$html_var}",$html,$location,$cf);
1704
-    }
1705
-
1706
-    // Check if there is a custom field key specific filter.
1707
-    if(has_filter("geodir_custom_field_output_address_key_{$cf['field_type_key']}")){
1708
-        /**
1709
-         * Filter the address html by field type key.
1710
-         *
1711
-         * @param string $html The html to filter.
1712
-         * @param string $location The location to output the html.
1713
-         * @param array $cf The custom field array.
1714
-         * @since 1.6.6
1715
-         */
1716
-        $html = apply_filters("geodir_custom_field_output_address_key_{$cf['field_type_key']}",$html,$location,$cf);
1717
-    }
1718
-
1719
-    // If not html then we run the standard output.
1720
-    if(empty($html)){
1721
-
1722
-        global $preview;
1723
-        $html_var = $cf['htmlvar_name'] . '_address';
1724
-
1725
-        if ($cf['extra_fields']) {
1726
-
1727
-            $extra_fields = unserialize($cf['extra_fields']);
1728
-
1729
-            $addition_fields = '';
1730
-
1731
-            if (!empty($extra_fields)) {
1732
-
1733
-                $show_city_in_address = false;
1734
-                if (isset($extra_fields['show_city']) && $extra_fields['show_city']) {
1735
-                    $show_city_in_address = true;
1736
-                }
1737
-                /**
1738
-                 * Filter "show city in address" value.
1739
-                 *
1740
-                 * @since 1.0.0
1741
-                 */
1742
-                $show_city_in_address = apply_filters('geodir_show_city_in_address', $show_city_in_address);
1743
-
1744
-
1745
-                $show_region_in_address = false;
1746
-                if (isset($extra_fields['show_region']) && $extra_fields['show_region']) {
1747
-                    $show_region_in_address = true;
1748
-                }
1749
-                /**
1750
-                 * Filter "show region in address" value.
1751
-                 *
1752
-                 * @since 1.6.6
1753
-                 */
1754
-                $show_region_in_address = apply_filters('geodir_show_region_in_address', $show_region_in_address);
1755
-
1756
-                $show_country_in_address = false;
1757
-                if (isset($extra_fields['show_country']) && $extra_fields['show_country']) {
1758
-                    $show_country_in_address = true;
1759
-                }
1760
-                /**
1761
-                 * Filter "show country in address" value.
1762
-                 *
1763
-                 * @since 1.6.6
1764
-                 */
1765
-                $show_country_in_address = apply_filters('geodir_show_country_in_address', $show_country_in_address);
1766
-
1767
-                $show_zip_in_address = false;
1768
-                if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) {
1769
-                    $show_zip_in_address = true;
1770
-                }
1771
-                /**
1772
-                 * Filter "show zip in address" value.
1773
-                 *
1774
-                 * @since 1.6.6
1775
-                 */
1776
-                $show_zip_in_address = apply_filters('geodir_show_zip_in_address', $show_zip_in_address);
1777
-
1778
-
1779
-            }
1780
-
1781
-        }
1782
-
1783
-
1784
-        if ($post->{$html_var}) {
1785
-
1786
-            $field_icon = geodir_field_icon_proccess( $cf );
1787
-            if ( strpos( $field_icon, 'http' ) !== false ) {
1788
-                $field_icon_af = '';
1789
-            } elseif ( $field_icon == '' ) {
1790
-                $field_icon_af = '<i class="fa fa-home"></i>';
1791
-            } else {
1792
-                $field_icon_af = $field_icon;
1793
-                $field_icon    = '';
1794
-            }
1670
+	// check we have the post value
1671
+	if(is_int($p)){$post = geodir_get_post_info($p);}
1672
+	else{ global $post;}
1673
+
1674
+	if(!is_array($cf) && $cf!=''){
1675
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1676
+		if(!$cf){return NULL;}
1677
+	}
1678
+
1679
+	$html_var = $cf['htmlvar_name'];
1680
+
1681
+	// Check if there is a location specific filter.
1682
+	if(has_filter("geodir_custom_field_output_address_loc_{$location}")){
1683
+		/**
1684
+		 * Filter the address html by location.
1685
+		 *
1686
+		 * @param string $html The html to filter.
1687
+		 * @param array $cf The custom field array.
1688
+		 * @since 1.6.6
1689
+		 */
1690
+		$html = apply_filters("geodir_custom_field_output_address_loc_{$location}",$html,$cf);
1691
+	}
1692
+
1693
+	// Check if there is a custom field specific filter.
1694
+	if(has_filter("geodir_custom_field_output_address_var_{$html_var}")){
1695
+		/**
1696
+		 * Filter the address html by individual custom field.
1697
+		 *
1698
+		 * @param string $html The html to filter.
1699
+		 * @param string $location The location to output the html.
1700
+		 * @param array $cf The custom field array.
1701
+		 * @since 1.6.6
1702
+		 */
1703
+		$html = apply_filters("geodir_custom_field_output_address_var_{$html_var}",$html,$location,$cf);
1704
+	}
1705
+
1706
+	// Check if there is a custom field key specific filter.
1707
+	if(has_filter("geodir_custom_field_output_address_key_{$cf['field_type_key']}")){
1708
+		/**
1709
+		 * Filter the address html by field type key.
1710
+		 *
1711
+		 * @param string $html The html to filter.
1712
+		 * @param string $location The location to output the html.
1713
+		 * @param array $cf The custom field array.
1714
+		 * @since 1.6.6
1715
+		 */
1716
+		$html = apply_filters("geodir_custom_field_output_address_key_{$cf['field_type_key']}",$html,$location,$cf);
1717
+	}
1718
+
1719
+	// If not html then we run the standard output.
1720
+	if(empty($html)){
1721
+
1722
+		global $preview;
1723
+		$html_var = $cf['htmlvar_name'] . '_address';
1724
+
1725
+		if ($cf['extra_fields']) {
1726
+
1727
+			$extra_fields = unserialize($cf['extra_fields']);
1728
+
1729
+			$addition_fields = '';
1730
+
1731
+			if (!empty($extra_fields)) {
1732
+
1733
+				$show_city_in_address = false;
1734
+				if (isset($extra_fields['show_city']) && $extra_fields['show_city']) {
1735
+					$show_city_in_address = true;
1736
+				}
1737
+				/**
1738
+				 * Filter "show city in address" value.
1739
+				 *
1740
+				 * @since 1.0.0
1741
+				 */
1742
+				$show_city_in_address = apply_filters('geodir_show_city_in_address', $show_city_in_address);
1743
+
1744
+
1745
+				$show_region_in_address = false;
1746
+				if (isset($extra_fields['show_region']) && $extra_fields['show_region']) {
1747
+					$show_region_in_address = true;
1748
+				}
1749
+				/**
1750
+				 * Filter "show region in address" value.
1751
+				 *
1752
+				 * @since 1.6.6
1753
+				 */
1754
+				$show_region_in_address = apply_filters('geodir_show_region_in_address', $show_region_in_address);
1755
+
1756
+				$show_country_in_address = false;
1757
+				if (isset($extra_fields['show_country']) && $extra_fields['show_country']) {
1758
+					$show_country_in_address = true;
1759
+				}
1760
+				/**
1761
+				 * Filter "show country in address" value.
1762
+				 *
1763
+				 * @since 1.6.6
1764
+				 */
1765
+				$show_country_in_address = apply_filters('geodir_show_country_in_address', $show_country_in_address);
1766
+
1767
+				$show_zip_in_address = false;
1768
+				if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) {
1769
+					$show_zip_in_address = true;
1770
+				}
1771
+				/**
1772
+				 * Filter "show zip in address" value.
1773
+				 *
1774
+				 * @since 1.6.6
1775
+				 */
1776
+				$show_zip_in_address = apply_filters('geodir_show_zip_in_address', $show_zip_in_address);
1777
+
1778
+
1779
+			}
1780
+
1781
+		}
1782
+
1783
+
1784
+		if ($post->{$html_var}) {
1785
+
1786
+			$field_icon = geodir_field_icon_proccess( $cf );
1787
+			if ( strpos( $field_icon, 'http' ) !== false ) {
1788
+				$field_icon_af = '';
1789
+			} elseif ( $field_icon == '' ) {
1790
+				$field_icon_af = '<i class="fa fa-home"></i>';
1791
+			} else {
1792
+				$field_icon_af = $field_icon;
1793
+				$field_icon    = '';
1794
+			}
1795 1795
             
1796 1796
 
1797 1797
 
1798
-            $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $html_var . '" style="clear:both;"  itemscope itemtype="https://schema.org/PostalAddress">';
1799
-            $html .= '<span class="geodir-i-location" style="' . $field_icon . '">' . $field_icon_af;
1800
-            $html .= ( trim( $cf['site_title'] ) ) ? __( $cf['site_title'], 'geodirectory' ) . ': ' : '&nbsp;';
1801
-            $html .= '</span>';
1798
+			$html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $html_var . '" style="clear:both;"  itemscope itemtype="https://schema.org/PostalAddress">';
1799
+			$html .= '<span class="geodir-i-location" style="' . $field_icon . '">' . $field_icon_af;
1800
+			$html .= ( trim( $cf['site_title'] ) ) ? __( $cf['site_title'], 'geodirectory' ) . ': ' : '&nbsp;';
1801
+			$html .= '</span>';
1802 1802
 
1803
-            if ( isset($post->post_address) ) {
1804
-                $html .= '<span itemprop="streetAddress">' . $post->post_address . '</span><br>';
1805
-            }
1806
-            if ($show_city_in_address && isset( $post->post_city ) && $post->post_city ) {
1807
-                $html .= '<span itemprop="addressLocality">' . $post->post_city . '</span><br>';
1808
-            }
1809
-            if ($show_region_in_address && isset( $post->post_region ) && $post->post_region ) {
1810
-                $html .= '<span itemprop="addressRegion">' . $post->post_region . '</span><br>';
1811
-            }
1812
-            if ($show_zip_in_address && isset( $post->post_zip ) && $post->post_zip ) {
1813
-                $html .= '<span itemprop="postalCode">' . $post->post_zip . '</span><br>';
1814
-            }
1815
-            if ($show_country_in_address && isset( $post->post_country ) && $post->post_country ) {
1816
-                $html .= '<span itemprop="addressCountry">' . __( $post->post_country, 'geodirectory' ) . '</span><br>';
1817
-            }
1818
-            $html .= '</div>';
1803
+			if ( isset($post->post_address) ) {
1804
+				$html .= '<span itemprop="streetAddress">' . $post->post_address . '</span><br>';
1805
+			}
1806
+			if ($show_city_in_address && isset( $post->post_city ) && $post->post_city ) {
1807
+				$html .= '<span itemprop="addressLocality">' . $post->post_city . '</span><br>';
1808
+			}
1809
+			if ($show_region_in_address && isset( $post->post_region ) && $post->post_region ) {
1810
+				$html .= '<span itemprop="addressRegion">' . $post->post_region . '</span><br>';
1811
+			}
1812
+			if ($show_zip_in_address && isset( $post->post_zip ) && $post->post_zip ) {
1813
+				$html .= '<span itemprop="postalCode">' . $post->post_zip . '</span><br>';
1814
+			}
1815
+			if ($show_country_in_address && isset( $post->post_country ) && $post->post_country ) {
1816
+				$html .= '<span itemprop="addressCountry">' . __( $post->post_country, 'geodirectory' ) . '</span><br>';
1817
+			}
1818
+			$html .= '</div>';
1819 1819
 
1820
-        }
1820
+		}
1821 1821
 
1822
-    }
1822
+	}
1823 1823
 
1824 1824
 
1825
-    return $html;
1825
+	return $html;
1826 1826
 }
1827 1827
 add_filter('geodir_custom_field_output_address','geodir_cf_address',10,3);
1828 1828
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +301 added lines, -301 removed lines patch added patch discarded remove patch
@@ -19,21 +19,21 @@  discard block
 block discarded – undo
19 19
  *
20 20
  * @return string The html to output for the custom field.
21 21
  */
22
-function geodir_cf_checkbox($html,$location,$cf,$p=''){
22
+function geodir_cf_checkbox($html, $location, $cf, $p = '') {
23 23
 
24 24
     // check we have the post value
25
-    if(is_int($p)){$post = geodir_get_post_info($p);}
26
-    else{ global $post;}
25
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
26
+    else { global $post; }
27 27
 
28
-    if(!is_array($cf) && $cf!=''){
28
+    if (!is_array($cf) && $cf != '') {
29 29
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
30
-        if(!$cf){return NULL;}
30
+        if (!$cf) {return NULL; }
31 31
     }
32 32
 
33 33
     $html_var = $cf['htmlvar_name'];
34 34
 
35 35
     // Check if there is a location specific filter.
36
-    if(has_filter("geodir_custom_field_output_checkbox_loc_{$location}")){
36
+    if (has_filter("geodir_custom_field_output_checkbox_loc_{$location}")) {
37 37
         /**
38 38
          * Filter the checkbox html by location.
39 39
          *
@@ -41,11 +41,11 @@  discard block
 block discarded – undo
41 41
          * @param array $cf The custom field array.
42 42
          * @since 1.6.6
43 43
          */
44
-        $html = apply_filters("geodir_custom_field_output_checkbox_loc_{$location}",$html,$cf);
44
+        $html = apply_filters("geodir_custom_field_output_checkbox_loc_{$location}", $html, $cf);
45 45
     }
46 46
 
47 47
     // Check if there is a custom field specific filter.
48
-    if(has_filter("geodir_custom_field_output_checkbox_var_{$html_var}")){
48
+    if (has_filter("geodir_custom_field_output_checkbox_var_{$html_var}")) {
49 49
         /**
50 50
          * Filter the checkbox html by individual custom field.
51 51
          *
@@ -54,11 +54,11 @@  discard block
 block discarded – undo
54 54
          * @param array $cf The custom field array.
55 55
          * @since 1.6.6
56 56
          */
57
-        $html = apply_filters("geodir_custom_field_output_checkbox_var_{$html_var}",$html,$location,$cf);
57
+        $html = apply_filters("geodir_custom_field_output_checkbox_var_{$html_var}", $html, $location, $cf);
58 58
     }
59 59
 
60 60
     // Check if there is a custom field key specific filter.
61
-    if(has_filter("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}")){
61
+    if (has_filter("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}")) {
62 62
         /**
63 63
          * Filter the checkbox html by field type key.
64 64
          *
@@ -67,18 +67,18 @@  discard block
 block discarded – undo
67 67
          * @param array $cf The custom field array.
68 68
          * @since 1.6.6
69 69
          */
70
-        $html = apply_filters("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}",$html,$location,$cf);
70
+        $html = apply_filters("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}", $html, $location, $cf);
71 71
     }
72 72
 
73 73
     // If not html then we run the standard output.
74
-    if(empty($html)){
74
+    if (empty($html)) {
75 75
 
76
-        if ( (int) $post->{$html_var} == 1 ):
76
+        if ((int) $post->{$html_var} == 1):
77 77
 
78
-            if ( $post->{$html_var} == '1' ):
79
-                $html_val = __( 'Yes', 'geodirectory' );
78
+            if ($post->{$html_var} == '1'):
79
+                $html_val = __('Yes', 'geodirectory');
80 80
             else:
81
-                $html_val = __( 'No', 'geodirectory' );
81
+                $html_val = __('No', 'geodirectory');
82 82
             endif;
83 83
 
84 84
             $field_icon = geodir_field_icon_proccess($cf);
@@ -91,16 +91,16 @@  discard block
 block discarded – undo
91 91
                 $field_icon = '';
92 92
             }
93 93
 
94
-            $html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-checkbox" style="' . $field_icon . '">' . $field_icon_af;
95
-            $html .= ( trim( $cf['site_title'] ) ) ? __( $cf['site_title'], 'geodirectory' ) . ': ' : '';
96
-            $html .= '</span>' . $html_val . '</div>';
94
+            $html = '<div class="geodir_more_info  '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-checkbox" style="'.$field_icon.'">'.$field_icon_af;
95
+            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : '';
96
+            $html .= '</span>'.$html_val.'</div>';
97 97
         endif;
98 98
 
99 99
     }
100 100
 
101 101
     return $html;
102 102
 }
103
-add_filter('geodir_custom_field_output_checkbox','geodir_cf_checkbox',10,3);
103
+add_filter('geodir_custom_field_output_checkbox', 'geodir_cf_checkbox', 10, 3);
104 104
 
105 105
 
106 106
 /**
@@ -113,21 +113,21 @@  discard block
 block discarded – undo
113 113
  *
114 114
  * @return string The html to output for the custom field.
115 115
  */
116
-function geodir_cf_fieldset($html,$location,$cf,$p=''){
116
+function geodir_cf_fieldset($html, $location, $cf, $p = '') {
117 117
 
118 118
     // check we have the post value
119
-    if(is_int($p)){$post = geodir_get_post_info($p);}
120
-    else{ global $post;}
119
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
120
+    else { global $post; }
121 121
 
122
-    if(!is_array($cf) && $cf!=''){
122
+    if (!is_array($cf) && $cf != '') {
123 123
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
124
-        if(!$cf){return NULL;}
124
+        if (!$cf) {return NULL; }
125 125
     }
126 126
 
127 127
     $html_var = $cf['htmlvar_name'];
128 128
 
129 129
     // Check if there is a location specific filter.
130
-    if(has_filter("geodir_custom_field_output_fieldset_loc_{$location}")){
130
+    if (has_filter("geodir_custom_field_output_fieldset_loc_{$location}")) {
131 131
         /**
132 132
          * Filter the fieldset html by location.
133 133
          *
@@ -135,11 +135,11 @@  discard block
 block discarded – undo
135 135
          * @param array $cf The custom field array.
136 136
          * @since 1.6.6
137 137
          */
138
-        $html = apply_filters("geodir_custom_field_output_fieldset_loc_{$location}",$html,$cf);
138
+        $html = apply_filters("geodir_custom_field_output_fieldset_loc_{$location}", $html, $cf);
139 139
     }
140 140
 
141 141
     // Check if there is a custom field specific filter.
142
-    if(has_filter("geodir_custom_field_output_fieldset_var_{$html_var}")){
142
+    if (has_filter("geodir_custom_field_output_fieldset_var_{$html_var}")) {
143 143
         /**
144 144
          * Filter the fieldset html by individual custom field.
145 145
          *
@@ -148,11 +148,11 @@  discard block
 block discarded – undo
148 148
          * @param array $cf The custom field array.
149 149
          * @since 1.6.6
150 150
          */
151
-        $html = apply_filters("geodir_custom_field_output_fieldset_var_{$html_var}",$html,$location,$cf);
151
+        $html = apply_filters("geodir_custom_field_output_fieldset_var_{$html_var}", $html, $location, $cf);
152 152
     }
153 153
 
154 154
     // Check if there is a custom field key specific filter.
155
-    if(has_filter("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}")){
155
+    if (has_filter("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}")) {
156 156
         /**
157 157
          * Filter the fieldset html by field type key.
158 158
          *
@@ -161,11 +161,11 @@  discard block
 block discarded – undo
161 161
          * @param array $cf The custom field array.
162 162
          * @since 1.6.6
163 163
          */
164
-        $html = apply_filters("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}",$html,$location,$cf);
164
+        $html = apply_filters("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}", $html, $location, $cf);
165 165
     }
166 166
 
167 167
     // If not html then we run the standard output.
168
-    if(empty($html)){
168
+    if (empty($html)) {
169 169
 
170 170
         global $field_set_start;
171 171
         $fieldset_class = 'fieldset-'.sanitize_title_with_dashes($cf['site_title']);
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
         if ($field_set_start == 1) {
174 174
             $html = '';
175 175
         } else {
176
-            $html = '<h2 class="'.$fieldset_class.'">'. __($cf['site_title'], 'geodirectory') . '</h2>';
176
+            $html = '<h2 class="'.$fieldset_class.'">'.__($cf['site_title'], 'geodirectory').'</h2>';
177 177
             //$field_set_start = 1;
178 178
         }
179 179
 
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 
182 182
     return $html;
183 183
 }
184
-add_filter('geodir_custom_field_output_fieldset','geodir_cf_fieldset',10,3);
184
+add_filter('geodir_custom_field_output_fieldset', 'geodir_cf_fieldset', 10, 3);
185 185
 
186 186
 
187 187
 /**
@@ -194,21 +194,21 @@  discard block
 block discarded – undo
194 194
  *
195 195
  * @return string The html to output for the custom field.
196 196
  */
197
-function geodir_cf_url($html,$location,$cf,$p=''){
197
+function geodir_cf_url($html, $location, $cf, $p = '') {
198 198
 
199 199
     // check we have the post value
200
-    if(is_int($p)){$post = geodir_get_post_info($p);}
201
-    else{ global $post;}
200
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
201
+    else { global $post; }
202 202
 
203
-    if(!is_array($cf) && $cf!=''){
203
+    if (!is_array($cf) && $cf != '') {
204 204
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
205
-        if(!$cf){return NULL;}
205
+        if (!$cf) {return NULL; }
206 206
     }
207 207
 
208 208
     $html_var = $cf['htmlvar_name'];
209 209
 
210 210
     // Check if there is a location specific filter.
211
-    if(has_filter("geodir_custom_field_output_url_loc_{$location}")){
211
+    if (has_filter("geodir_custom_field_output_url_loc_{$location}")) {
212 212
         /**
213 213
          * Filter the url html by location.
214 214
          *
@@ -216,11 +216,11 @@  discard block
 block discarded – undo
216 216
          * @param array $cf The custom field array.
217 217
          * @since 1.6.6
218 218
          */
219
-        $html = apply_filters("geodir_custom_field_output_url_loc_{$location}",$html,$cf);
219
+        $html = apply_filters("geodir_custom_field_output_url_loc_{$location}", $html, $cf);
220 220
     }
221 221
 
222 222
     // Check if there is a custom field specific filter.
223
-    if(has_filter("geodir_custom_field_output_url_var_{$html_var}")){
223
+    if (has_filter("geodir_custom_field_output_url_var_{$html_var}")) {
224 224
         /**
225 225
          * Filter the url html by individual custom field.
226 226
          *
@@ -229,11 +229,11 @@  discard block
 block discarded – undo
229 229
          * @param array $cf The custom field array.
230 230
          * @since 1.6.6
231 231
          */
232
-        $html = apply_filters("geodir_custom_field_output_url_var_{$html_var}",$html,$location,$cf);
232
+        $html = apply_filters("geodir_custom_field_output_url_var_{$html_var}", $html, $location, $cf);
233 233
     }
234 234
 
235 235
     // Check if there is a custom field key specific filter.
236
-    if(has_filter("geodir_custom_field_output_url_key_{$cf['field_type_key']}")){
236
+    if (has_filter("geodir_custom_field_output_url_key_{$cf['field_type_key']}")) {
237 237
         /**
238 238
          * Filter the url html by field type key.
239 239
          *
@@ -242,11 +242,11 @@  discard block
 block discarded – undo
242 242
          * @param array $cf The custom field array.
243 243
          * @since 1.6.6
244 244
          */
245
-        $html = apply_filters("geodir_custom_field_output_url_key_{$cf['field_type_key']}",$html,$location,$cf);
245
+        $html = apply_filters("geodir_custom_field_output_url_key_{$cf['field_type_key']}", $html, $location, $cf);
246 246
     }
247 247
 
248 248
     // If not html then we run the standard output.
249
-    if(empty($html)){
249
+    if (empty($html)) {
250 250
 
251 251
         if ($post->{$cf['htmlvar_name']}):
252 252
 
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
 
274 274
             $website = !empty($a_url['url']) ? $a_url['url'] : '';
275 275
             $title = !empty($a_url['label']) ? $a_url['label'] : $cf['site_title'];
276
-            if(!empty($cf['default_value'])){$title = $cf['default_value'];}
276
+            if (!empty($cf['default_value'])) {$title = $cf['default_value']; }
277 277
             $title = $title != '' ? __(stripslashes($title), 'geodirectory') : '';
278 278
 
279 279
 
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
              * @param string $website Website URL.
290 290
              * @param int $post->ID Post ID.
291 291
              */
292
-            $html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '"><span class="geodir-i-website" style="' . $field_icon . '">' . $field_icon_af . '<a href="' . $website . '" target="_blank" ' . $rel . ' ><strong>' . apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID) . '</strong></a></span></div>';
292
+            $html = '<div class="geodir_more_info  '.$cf['css_class'].' '.$cf['htmlvar_name'].'"><span class="geodir-i-website" style="'.$field_icon.'">'.$field_icon_af.'<a href="'.$website.'" target="_blank" '.$rel.' ><strong>'.apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID).'</strong></a></span></div>';
293 293
 
294 294
         endif;
295 295
 
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
 
298 298
     return $html;
299 299
 }
300
-add_filter('geodir_custom_field_output_url','geodir_cf_url',10,3);
300
+add_filter('geodir_custom_field_output_url', 'geodir_cf_url', 10, 3);
301 301
 
302 302
 
303 303
 /**
@@ -310,21 +310,21 @@  discard block
 block discarded – undo
310 310
  *
311 311
  * @return string The html to output for the custom field.
312 312
  */
313
-function geodir_cf_phone($html,$location,$cf,$p=''){
313
+function geodir_cf_phone($html, $location, $cf, $p = '') {
314 314
 
315 315
     // check we have the post value
316
-    if(is_int($p)){$post = geodir_get_post_info($p);}
317
-    else{ global $post;}
316
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
317
+    else { global $post; }
318 318
 
319
-    if(!is_array($cf) && $cf!=''){
319
+    if (!is_array($cf) && $cf != '') {
320 320
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
321
-        if(!$cf){return NULL;}
321
+        if (!$cf) {return NULL; }
322 322
     }
323 323
 
324 324
     $html_var = $cf['htmlvar_name'];
325 325
 
326 326
     // Check if there is a location specific filter.
327
-    if(has_filter("geodir_custom_field_output_phone_loc_{$location}")){
327
+    if (has_filter("geodir_custom_field_output_phone_loc_{$location}")) {
328 328
         /**
329 329
          * Filter the phone html by location.
330 330
          *
@@ -332,11 +332,11 @@  discard block
 block discarded – undo
332 332
          * @param array $cf The custom field array.
333 333
          * @since 1.6.6
334 334
          */
335
-        $html = apply_filters("geodir_custom_field_output_phone_loc_{$location}",$html,$cf);
335
+        $html = apply_filters("geodir_custom_field_output_phone_loc_{$location}", $html, $cf);
336 336
     }
337 337
 
338 338
     // Check if there is a custom field specific filter.
339
-    if(has_filter("geodir_custom_field_output_phone_var_{$html_var}")){
339
+    if (has_filter("geodir_custom_field_output_phone_var_{$html_var}")) {
340 340
         /**
341 341
          * Filter the phone html by individual custom field.
342 342
          *
@@ -345,11 +345,11 @@  discard block
 block discarded – undo
345 345
          * @param array $cf The custom field array.
346 346
          * @since 1.6.6
347 347
          */
348
-        $html = apply_filters("geodir_custom_field_output_phone_var_{$html_var}",$html,$location,$cf);
348
+        $html = apply_filters("geodir_custom_field_output_phone_var_{$html_var}", $html, $location, $cf);
349 349
     }
350 350
 
351 351
     // Check if there is a custom field key specific filter.
352
-    if(has_filter("geodir_custom_field_output_phone_key_{$cf['field_type_key']}")){
352
+    if (has_filter("geodir_custom_field_output_phone_key_{$cf['field_type_key']}")) {
353 353
         /**
354 354
          * Filter the phone html by field type key.
355 355
          *
@@ -358,11 +358,11 @@  discard block
 block discarded – undo
358 358
          * @param array $cf The custom field array.
359 359
          * @since 1.6.6
360 360
          */
361
-        $html = apply_filters("geodir_custom_field_output_phone_key_{$cf['field_type_key']}",$html,$location,$cf);
361
+        $html = apply_filters("geodir_custom_field_output_phone_key_{$cf['field_type_key']}", $html, $location, $cf);
362 362
     }
363 363
 
364 364
     // If not html then we run the standard output.
365
-    if(empty($html)){
365
+    if (empty($html)) {
366 366
 
367 367
         if ($post->{$cf['htmlvar_name']}):
368 368
 
@@ -377,9 +377,9 @@  discard block
 block discarded – undo
377 377
             }
378 378
 
379 379
 
380
-            $html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-contact" style="' . $field_icon . '">' . $field_icon_af .
381
-                    $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '&nbsp;';
382
-            $html .= '</span><a href="tel:' . preg_replace('/[^0-9+]/', '', $post->{$cf['htmlvar_name']}) . '">' . $post->{$cf['htmlvar_name']} . '</a></div>';
380
+            $html = '<div class="geodir_more_info  '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-contact" style="'.$field_icon.'">'.$field_icon_af.
381
+                    $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : '&nbsp;';
382
+            $html .= '</span><a href="tel:'.preg_replace('/[^0-9+]/', '', $post->{$cf['htmlvar_name']}).'">'.$post->{$cf['htmlvar_name']}.'</a></div>';
383 383
 
384 384
         endif;
385 385
 
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
 
388 388
     return $html;
389 389
 }
390
-add_filter('geodir_custom_field_output_phone','geodir_cf_phone',10,3);
390
+add_filter('geodir_custom_field_output_phone', 'geodir_cf_phone', 10, 3);
391 391
 
392 392
 
393 393
 /**
@@ -400,21 +400,21 @@  discard block
 block discarded – undo
400 400
  *
401 401
  * @return string The html to output for the custom field.
402 402
  */
403
-function geodir_cf_time($html,$location,$cf,$p=''){
403
+function geodir_cf_time($html, $location, $cf, $p = '') {
404 404
 
405 405
     // check we have the post value
406
-    if(is_int($p)){$post = geodir_get_post_info($p);}
407
-    else{ global $post;}
406
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
407
+    else { global $post; }
408 408
 
409
-    if(!is_array($cf) && $cf!=''){
409
+    if (!is_array($cf) && $cf != '') {
410 410
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
411
-        if(!$cf){return NULL;}
411
+        if (!$cf) {return NULL; }
412 412
     }
413 413
 
414 414
     $html_var = $cf['htmlvar_name'];
415 415
 
416 416
     // Check if there is a location specific filter.
417
-    if(has_filter("geodir_custom_field_output_time_loc_{$location}")){
417
+    if (has_filter("geodir_custom_field_output_time_loc_{$location}")) {
418 418
         /**
419 419
          * Filter the time html by location.
420 420
          *
@@ -422,11 +422,11 @@  discard block
 block discarded – undo
422 422
          * @param array $cf The custom field array.
423 423
          * @since 1.6.6
424 424
          */
425
-        $html = apply_filters("geodir_custom_field_output_time_loc_{$location}",$html,$cf);
425
+        $html = apply_filters("geodir_custom_field_output_time_loc_{$location}", $html, $cf);
426 426
     }
427 427
 
428 428
     // Check if there is a custom field specific filter.
429
-    if(has_filter("geodir_custom_field_output_time_var_{$html_var}")){
429
+    if (has_filter("geodir_custom_field_output_time_var_{$html_var}")) {
430 430
         /**
431 431
          * Filter the time html by individual custom field.
432 432
          *
@@ -435,11 +435,11 @@  discard block
 block discarded – undo
435 435
          * @param array $cf The custom field array.
436 436
          * @since 1.6.6
437 437
          */
438
-        $html = apply_filters("geodir_custom_field_output_time_var_{$html_var}",$html,$location,$cf);
438
+        $html = apply_filters("geodir_custom_field_output_time_var_{$html_var}", $html, $location, $cf);
439 439
     }
440 440
 
441 441
     // Check if there is a custom field key specific filter.
442
-    if(has_filter("geodir_custom_field_output_time_key_{$cf['field_type_key']}")){
442
+    if (has_filter("geodir_custom_field_output_time_key_{$cf['field_type_key']}")) {
443 443
         /**
444 444
          * Filter the time html by field type key.
445 445
          *
@@ -448,11 +448,11 @@  discard block
 block discarded – undo
448 448
          * @param array $cf The custom field array.
449 449
          * @since 1.6.6
450 450
          */
451
-        $html = apply_filters("geodir_custom_field_output_time_key_{$cf['field_type_key']}",$html,$location,$cf);
451
+        $html = apply_filters("geodir_custom_field_output_time_key_{$cf['field_type_key']}", $html, $location, $cf);
452 452
     }
453 453
 
454 454
     // If not html then we run the standard output.
455
-    if(empty($html)){
455
+    if (empty($html)) {
456 456
 
457 457
         if ($post->{$cf['htmlvar_name']}):
458 458
 
@@ -472,9 +472,9 @@  discard block
 block discarded – undo
472 472
             }
473 473
 
474 474
 
475
-            $html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-time" style="' . $field_icon . '">' . $field_icon_af;
476
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '&nbsp;';
477
-            $html .= '</span>' . $value . '</div>';
475
+            $html = '<div class="geodir_more_info  '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-time" style="'.$field_icon.'">'.$field_icon_af;
476
+            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : '&nbsp;';
477
+            $html .= '</span>'.$value.'</div>';
478 478
 
479 479
         endif;
480 480
 
@@ -482,7 +482,7 @@  discard block
 block discarded – undo
482 482
 
483 483
     return $html;
484 484
 }
485
-add_filter('geodir_custom_field_output_time','geodir_cf_time',10,3);
485
+add_filter('geodir_custom_field_output_time', 'geodir_cf_time', 10, 3);
486 486
 
487 487
 
488 488
 /**
@@ -495,21 +495,21 @@  discard block
 block discarded – undo
495 495
  *
496 496
  * @return string The html to output for the custom field.
497 497
  */
498
-function geodir_cf_datepicker($html,$location,$cf,$p=''){
498
+function geodir_cf_datepicker($html, $location, $cf, $p = '') {
499 499
     global $preview;
500 500
     // check we have the post value
501
-    if(is_int($p)){$post = geodir_get_post_info($p);}
502
-    else{ global $post;}
501
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
502
+    else { global $post; }
503 503
 
504
-    if(!is_array($cf) && $cf!=''){
504
+    if (!is_array($cf) && $cf != '') {
505 505
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
506
-        if(!$cf){return NULL;}
506
+        if (!$cf) {return NULL; }
507 507
     }
508 508
 
509 509
     $html_var = $cf['htmlvar_name'];
510 510
 
511 511
     // Check if there is a location specific filter.
512
-    if(has_filter("geodir_custom_field_output_datepicker_loc_{$location}")){
512
+    if (has_filter("geodir_custom_field_output_datepicker_loc_{$location}")) {
513 513
         /**
514 514
          * Filter the datepicker html by location.
515 515
          *
@@ -517,11 +517,11 @@  discard block
 block discarded – undo
517 517
          * @param array $cf The custom field array.
518 518
          * @since 1.6.6
519 519
          */
520
-        $html = apply_filters("geodir_custom_field_output_datepicker_loc_{$location}",$html,$cf);
520
+        $html = apply_filters("geodir_custom_field_output_datepicker_loc_{$location}", $html, $cf);
521 521
     }
522 522
 
523 523
     // Check if there is a custom field specific filter.
524
-    if(has_filter("geodir_custom_field_output_datepicker_var_{$html_var}")){
524
+    if (has_filter("geodir_custom_field_output_datepicker_var_{$html_var}")) {
525 525
         /**
526 526
          * Filter the datepicker html by individual custom field.
527 527
          *
@@ -530,11 +530,11 @@  discard block
 block discarded – undo
530 530
          * @param array $cf The custom field array.
531 531
          * @since 1.6.6
532 532
          */
533
-        $html = apply_filters("geodir_custom_field_output_datepicker_var_{$html_var}",$html,$location,$cf);
533
+        $html = apply_filters("geodir_custom_field_output_datepicker_var_{$html_var}", $html, $location, $cf);
534 534
     }
535 535
 
536 536
     // Check if there is a custom field key specific filter.
537
-    if(has_filter("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}")){
537
+    if (has_filter("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}")) {
538 538
         /**
539 539
          * Filter the datepicker html by field type key.
540 540
          *
@@ -543,11 +543,11 @@  discard block
 block discarded – undo
543 543
          * @param array $cf The custom field array.
544 544
          * @since 1.6.6
545 545
          */
546
-        $html = apply_filters("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}",$html,$location,$cf);
546
+        $html = apply_filters("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}", $html, $location, $cf);
547 547
     }
548 548
 
549 549
     // If not html then we run the standard output.
550
-    if(empty($html)){
550
+    if (empty($html)) {
551 551
 
552 552
         if ($post->{$cf['htmlvar_name']}):
553 553
 
@@ -558,24 +558,24 @@  discard block
 block discarded – undo
558 558
             }
559 559
             // check if we need to change the format or not
560 560
             $date_format_len = strlen(str_replace(' ', '', $date_format));
561
-            if($date_format_len>5){// if greater then 4 then it's the old style format.
561
+            if ($date_format_len > 5) {// if greater then 4 then it's the old style format.
562 562
 
563
-                $search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format
564
-                $replace = array('d','j','l','m','n','F','Y');//PHP date format
563
+                $search = array('dd', 'd', 'DD', 'mm', 'm', 'MM', 'yy'); //jQuery UI datepicker format
564
+                $replace = array('d', 'j', 'l', 'm', 'n', 'F', 'Y'); //PHP date format
565 565
 
566 566
                 $date_format = str_replace($search, $replace, $date_format);
567 567
 
568
-                $post_htmlvar_value = ($date_format == 'd/m/Y' || $date_format == 'j/n/Y' ) ? str_replace('/', '-', $post->{$cf['htmlvar_name']}) : $post->{$cf['htmlvar_name']}; // PHP doesn't work well with dd/mm/yyyy format
569
-            }else{
568
+                $post_htmlvar_value = ($date_format == 'd/m/Y' || $date_format == 'j/n/Y') ? str_replace('/', '-', $post->{$cf['htmlvar_name']}) : $post->{$cf['htmlvar_name']}; // PHP doesn't work well with dd/mm/yyyy format
569
+            } else {
570 570
                 $post_htmlvar_value = $post->{$cf['htmlvar_name']};
571 571
             }
572 572
 
573
-            if ($post->{$cf['htmlvar_name']} != '' && $post->{$cf['htmlvar_name']}!="0000-00-00") {
573
+            if ($post->{$cf['htmlvar_name']} != '' && $post->{$cf['htmlvar_name']} != "0000-00-00") {
574 574
                 $date_format_from = $preview ? $date_format : 'Y-m-d';
575 575
                 $value = geodir_date($post_htmlvar_value, $date_format, $date_format_from); // save as sql format Y-m-d
576 576
                 //$post_htmlvar_value = strpos($post_htmlvar_value, '/') !== false ? str_replace('/', '-', $post_htmlvar_value) : $post_htmlvar_value;
577 577
                 //$value = date_i18n($date_format, strtotime($post_htmlvar_value));
578
-            }else{
578
+            } else {
579 579
                 return '';
580 580
             }
581 581
 
@@ -592,9 +592,9 @@  discard block
 block discarded – undo
592 592
 
593 593
 
594 594
 
595
-            $html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-datepicker" style="' . $field_icon . '">' . $field_icon_af;
596
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
597
-            $html .= '</span>' . $value . '</div>';
595
+            $html = '<div class="geodir_more_info  '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-datepicker" style="'.$field_icon.'">'.$field_icon_af;
596
+            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : '';
597
+            $html .= '</span>'.$value.'</div>';
598 598
 
599 599
         endif;
600 600
 
@@ -602,7 +602,7 @@  discard block
 block discarded – undo
602 602
 
603 603
     return $html;
604 604
 }
605
-add_filter('geodir_custom_field_output_datepicker','geodir_cf_datepicker',10,3);
605
+add_filter('geodir_custom_field_output_datepicker', 'geodir_cf_datepicker', 10, 3);
606 606
 
607 607
 
608 608
 /**
@@ -615,21 +615,21 @@  discard block
 block discarded – undo
615 615
  *
616 616
  * @return string The html to output for the custom field.
617 617
  */
618
-function geodir_cf_text($html,$location,$cf,$p=''){
618
+function geodir_cf_text($html, $location, $cf, $p = '') {
619 619
 
620 620
     // check we have the post value
621
-    if(is_int($p)){$post = geodir_get_post_info($p);}
622
-    else{ global $post;}
621
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
622
+    else { global $post; }
623 623
 
624
-    if(!is_array($cf) && $cf!=''){
624
+    if (!is_array($cf) && $cf != '') {
625 625
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
626
-        if(!$cf){return NULL;}
626
+        if (!$cf) {return NULL; }
627 627
     }
628 628
 
629 629
     $html_var = $cf['htmlvar_name'];
630 630
 
631 631
     // Check if there is a location specific filter.
632
-    if(has_filter("geodir_custom_field_output_text_loc_{$location}")){
632
+    if (has_filter("geodir_custom_field_output_text_loc_{$location}")) {
633 633
         /**
634 634
          * Filter the text html by location.
635 635
          *
@@ -637,11 +637,11 @@  discard block
 block discarded – undo
637 637
          * @param array $cf The custom field array.
638 638
          * @since 1.6.6
639 639
          */
640
-        $html = apply_filters("geodir_custom_field_output_text_loc_{$location}",$html,$cf);
640
+        $html = apply_filters("geodir_custom_field_output_text_loc_{$location}", $html, $cf);
641 641
     }
642 642
 
643 643
     // Check if there is a custom field specific filter.
644
-    if(has_filter("geodir_custom_field_output_text_var_{$html_var}")){
644
+    if (has_filter("geodir_custom_field_output_text_var_{$html_var}")) {
645 645
         /**
646 646
          * Filter the text html by individual custom field.
647 647
          *
@@ -650,11 +650,11 @@  discard block
 block discarded – undo
650 650
          * @param array $cf The custom field array.
651 651
          * @since 1.6.6
652 652
          */
653
-        $html = apply_filters("geodir_custom_field_output_text_var_{$html_var}",$html,$location,$cf);
653
+        $html = apply_filters("geodir_custom_field_output_text_var_{$html_var}", $html, $location, $cf);
654 654
     }
655 655
 
656 656
     // Check if there is a custom field key specific filter.
657
-    if(has_filter("geodir_custom_field_output_text_key_{$cf['field_type_key']}")){
657
+    if (has_filter("geodir_custom_field_output_text_key_{$cf['field_type_key']}")) {
658 658
         /**
659 659
          * Filter the text html by field type key.
660 660
          *
@@ -663,15 +663,15 @@  discard block
 block discarded – undo
663 663
          * @param array $cf The custom field array.
664 664
          * @since 1.6.6
665 665
          */
666
-        $html = apply_filters("geodir_custom_field_output_text_key_{$cf['field_type_key']}",$html,$location,$cf);
666
+        $html = apply_filters("geodir_custom_field_output_text_key_{$cf['field_type_key']}", $html, $location, $cf);
667 667
     }
668 668
 
669 669
     
670 670
 
671 671
     // If not html then we run the standard output.
672
-    if(empty($html)){
672
+    if (empty($html)) {
673 673
 
674
-        if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != '' ):
674
+        if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != ''):
675 675
 
676 676
             $class = ($cf['htmlvar_name'] == 'geodir_timing') ? "geodir-i-time" : "geodir-i-text";
677 677
 
@@ -686,15 +686,15 @@  discard block
 block discarded – undo
686 686
             }
687 687
 
688 688
 
689
-            $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="'.$class.'" style="' . $field_icon . '">' . $field_icon_af;
690
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
689
+            $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="'.$class.'" style="'.$field_icon.'">'.$field_icon_af;
690
+            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : '';
691 691
             $html .= '</span>';
692 692
 
693 693
             $value = $post->{$cf['htmlvar_name']};
694
-            if(isset($cf['data_type']) && ($cf['data_type']=='INT' || $cf['data_type']=='FLOAT') && isset($cf['extra_fields']) && $cf['extra_fields']){
694
+            if (isset($cf['data_type']) && ($cf['data_type'] == 'INT' || $cf['data_type'] == 'FLOAT') && isset($cf['extra_fields']) && $cf['extra_fields']) {
695 695
                 $extra_fields = maybe_unserialize($cf['extra_fields']);
696
-                if(isset($extra_fields['is_price']) && $extra_fields['is_price']){
697
-                    $value = geodir_currency_format_number($value,$cf);
696
+                if (isset($extra_fields['is_price']) && $extra_fields['is_price']) {
697
+                    $value = geodir_currency_format_number($value, $cf);
698 698
                 }
699 699
             }
700 700
 
@@ -708,7 +708,7 @@  discard block
 block discarded – undo
708 708
 
709 709
     return $html;
710 710
 }
711
-add_filter('geodir_custom_field_output_text','geodir_cf_text',10,3);
711
+add_filter('geodir_custom_field_output_text', 'geodir_cf_text', 10, 3);
712 712
 
713 713
 
714 714
 /**
@@ -721,21 +721,21 @@  discard block
 block discarded – undo
721 721
  *
722 722
  * @return string The html to output for the custom field.
723 723
  */
724
-function geodir_cf_radio($html,$location,$cf,$p=''){
724
+function geodir_cf_radio($html, $location, $cf, $p = '') {
725 725
 
726 726
     // check we have the post value
727
-    if(is_int($p)){$post = geodir_get_post_info($p);}
728
-    else{ global $post;}
727
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
728
+    else { global $post; }
729 729
 
730
-    if(!is_array($cf) && $cf!=''){
730
+    if (!is_array($cf) && $cf != '') {
731 731
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
732
-        if(!$cf){return NULL;}
732
+        if (!$cf) {return NULL; }
733 733
     }
734 734
 
735 735
     $html_var = $cf['htmlvar_name'];
736 736
 
737 737
     // Check if there is a location specific filter.
738
-    if(has_filter("geodir_custom_field_output_radio_loc_{$location}")){
738
+    if (has_filter("geodir_custom_field_output_radio_loc_{$location}")) {
739 739
         /**
740 740
          * Filter the radio html by location.
741 741
          *
@@ -743,11 +743,11 @@  discard block
 block discarded – undo
743 743
          * @param array $cf The custom field array.
744 744
          * @since 1.6.6
745 745
          */
746
-        $html = apply_filters("geodir_custom_field_output_radio_loc_{$location}",$html,$cf);
746
+        $html = apply_filters("geodir_custom_field_output_radio_loc_{$location}", $html, $cf);
747 747
     }
748 748
 
749 749
     // Check if there is a custom field specific filter.
750
-    if(has_filter("geodir_custom_field_output_radio_var_{$html_var}")){
750
+    if (has_filter("geodir_custom_field_output_radio_var_{$html_var}")) {
751 751
         /**
752 752
          * Filter the radio html by individual custom field.
753 753
          *
@@ -756,11 +756,11 @@  discard block
 block discarded – undo
756 756
          * @param array $cf The custom field array.
757 757
          * @since 1.6.6
758 758
          */
759
-        $html = apply_filters("geodir_custom_field_output_radio_var_{$html_var}",$html,$location,$cf);
759
+        $html = apply_filters("geodir_custom_field_output_radio_var_{$html_var}", $html, $location, $cf);
760 760
     }
761 761
 
762 762
     // Check if there is a custom field key specific filter.
763
-    if(has_filter("geodir_custom_field_output_radio_key_{$cf['field_type_key']}")){
763
+    if (has_filter("geodir_custom_field_output_radio_key_{$cf['field_type_key']}")) {
764 764
         /**
765 765
          * Filter the radio html by field type key.
766 766
          *
@@ -769,11 +769,11 @@  discard block
 block discarded – undo
769 769
          * @param array $cf The custom field array.
770 770
          * @since 1.6.6
771 771
          */
772
-        $html = apply_filters("geodir_custom_field_output_radio_key_{$cf['field_type_key']}",$html,$location,$cf);
772
+        $html = apply_filters("geodir_custom_field_output_radio_key_{$cf['field_type_key']}", $html, $location, $cf);
773 773
     }
774 774
 
775 775
     // If not html then we run the standard output.
776
-    if(empty($html)){
776
+    if (empty($html)) {
777 777
 
778 778
         $html_val = isset($post->{$cf['htmlvar_name']}) ? __($post->{$cf['htmlvar_name']}, 'geodirectory') : '';
779 779
         if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != ''):
@@ -807,16 +807,16 @@  discard block
 block discarded – undo
807 807
             }
808 808
 
809 809
 
810
-            $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-radio" style="' . $field_icon . '">' . $field_icon_af;
811
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
812
-            $html .= '</span>' . $html_val . '</div>';
810
+            $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-radio" style="'.$field_icon.'">'.$field_icon_af;
811
+            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : '';
812
+            $html .= '</span>'.$html_val.'</div>';
813 813
         endif;
814 814
 
815 815
     }
816 816
 
817 817
     return $html;
818 818
 }
819
-add_filter('geodir_custom_field_output_radio','geodir_cf_radio',10,3);
819
+add_filter('geodir_custom_field_output_radio', 'geodir_cf_radio', 10, 3);
820 820
 
821 821
 
822 822
 /**
@@ -829,21 +829,21 @@  discard block
 block discarded – undo
829 829
  *
830 830
  * @return string The html to output for the custom field.
831 831
  */
832
-function geodir_cf_select($html,$location,$cf,$p=''){
832
+function geodir_cf_select($html, $location, $cf, $p = '') {
833 833
 
834 834
     // check we have the post value
835
-    if(is_int($p)){$post = geodir_get_post_info($p);}
836
-    else{ global $post;}
835
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
836
+    else { global $post; }
837 837
 
838
-    if(!is_array($cf) && $cf!=''){
838
+    if (!is_array($cf) && $cf != '') {
839 839
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
840
-        if(!$cf){return NULL;}
840
+        if (!$cf) {return NULL; }
841 841
     }
842 842
 
843 843
     $html_var = $cf['htmlvar_name'];
844 844
 
845 845
     // Check if there is a location specific filter.
846
-    if(has_filter("geodir_custom_field_output_select_loc_{$location}")){
846
+    if (has_filter("geodir_custom_field_output_select_loc_{$location}")) {
847 847
         /**
848 848
          * Filter the select html by location.
849 849
          *
@@ -851,11 +851,11 @@  discard block
 block discarded – undo
851 851
          * @param array $cf The custom field array.
852 852
          * @since 1.6.6
853 853
          */
854
-        $html = apply_filters("geodir_custom_field_output_select_loc_{$location}",$html,$cf);
854
+        $html = apply_filters("geodir_custom_field_output_select_loc_{$location}", $html, $cf);
855 855
     }
856 856
 
857 857
     // Check if there is a custom field specific filter.
858
-    if(has_filter("geodir_custom_field_output_select_var_{$html_var}")){
858
+    if (has_filter("geodir_custom_field_output_select_var_{$html_var}")) {
859 859
         /**
860 860
          * Filter the select html by individual custom field.
861 861
          *
@@ -864,11 +864,11 @@  discard block
 block discarded – undo
864 864
          * @param array $cf The custom field array.
865 865
          * @since 1.6.6
866 866
          */
867
-        $html = apply_filters("geodir_custom_field_output_select_var_{$html_var}",$html,$location,$cf);
867
+        $html = apply_filters("geodir_custom_field_output_select_var_{$html_var}", $html, $location, $cf);
868 868
     }
869 869
 
870 870
     // Check if there is a custom field key specific filter.
871
-    if(has_filter("geodir_custom_field_output_select_key_{$cf['field_type_key']}")){
871
+    if (has_filter("geodir_custom_field_output_select_key_{$cf['field_type_key']}")) {
872 872
         /**
873 873
          * Filter the select html by field type key.
874 874
          *
@@ -877,11 +877,11 @@  discard block
 block discarded – undo
877 877
          * @param array $cf The custom field array.
878 878
          * @since 1.6.6
879 879
          */
880
-        $html = apply_filters("geodir_custom_field_output_select_key_{$cf['field_type_key']}",$html,$location,$cf);
880
+        $html = apply_filters("geodir_custom_field_output_select_key_{$cf['field_type_key']}", $html, $location, $cf);
881 881
     }
882 882
 
883 883
     // If not html then we run the standard output.
884
-    if(empty($html)){
884
+    if (empty($html)) {
885 885
 
886 886
         if ($post->{$cf['htmlvar_name']}):
887 887
             $field_value = __($post->{$cf['htmlvar_name']}, 'geodirectory');
@@ -909,16 +909,16 @@  discard block
 block discarded – undo
909 909
             }
910 910
 
911 911
 
912
-            $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
913
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
914
-            $html .= '</span>' . $field_value . '</div>';
912
+            $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-select" style="'.$field_icon.'">'.$field_icon_af;
913
+            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : '';
914
+            $html .= '</span>'.$field_value.'</div>';
915 915
         endif;
916 916
 
917 917
     }
918 918
 
919 919
     return $html;
920 920
 }
921
-add_filter('geodir_custom_field_output_select','geodir_cf_select',10,3);
921
+add_filter('geodir_custom_field_output_select', 'geodir_cf_select', 10, 3);
922 922
 
923 923
 
924 924
 /**
@@ -931,21 +931,21 @@  discard block
 block discarded – undo
931 931
  *
932 932
  * @return string The html to output for the custom field.
933 933
  */
934
-function geodir_cf_multiselect($html,$location,$cf,$p=''){
934
+function geodir_cf_multiselect($html, $location, $cf, $p = '') {
935 935
 
936 936
     // check we have the post value
937
-    if(is_int($p)){$post = geodir_get_post_info($p);}
938
-    else{ global $post;}
937
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
938
+    else { global $post; }
939 939
 
940
-    if(!is_array($cf) && $cf!=''){
940
+    if (!is_array($cf) && $cf != '') {
941 941
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
942
-        if(!$cf){return NULL;}
942
+        if (!$cf) {return NULL; }
943 943
     }
944 944
 
945 945
     $html_var = $cf['htmlvar_name'];
946 946
 
947 947
     // Check if there is a location specific filter.
948
-    if(has_filter("geodir_custom_field_output_multiselect_loc_{$location}")){
948
+    if (has_filter("geodir_custom_field_output_multiselect_loc_{$location}")) {
949 949
         /**
950 950
          * Filter the multiselect html by location.
951 951
          *
@@ -953,11 +953,11 @@  discard block
 block discarded – undo
953 953
          * @param array $cf The custom field array.
954 954
          * @since 1.6.6
955 955
          */
956
-        $html = apply_filters("geodir_custom_field_output_multiselect_loc_{$location}",$html,$cf);
956
+        $html = apply_filters("geodir_custom_field_output_multiselect_loc_{$location}", $html, $cf);
957 957
     }
958 958
 
959 959
     // Check if there is a custom field specific filter.
960
-    if(has_filter("geodir_custom_field_output_multiselect_var_{$html_var}")){
960
+    if (has_filter("geodir_custom_field_output_multiselect_var_{$html_var}")) {
961 961
         /**
962 962
          * Filter the multiselect html by individual custom field.
963 963
          *
@@ -966,11 +966,11 @@  discard block
 block discarded – undo
966 966
          * @param array $cf The custom field array.
967 967
          * @since 1.6.6
968 968
          */
969
-        $html = apply_filters("geodir_custom_field_output_multiselect_var_{$html_var}",$html,$location,$cf);
969
+        $html = apply_filters("geodir_custom_field_output_multiselect_var_{$html_var}", $html, $location, $cf);
970 970
     }
971 971
 
972 972
     // Check if there is a custom field key specific filter.
973
-    if(has_filter("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}")){
973
+    if (has_filter("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}")) {
974 974
         /**
975 975
          * Filter the multiselect html by field type key.
976 976
          *
@@ -979,11 +979,11 @@  discard block
 block discarded – undo
979 979
          * @param array $cf The custom field array.
980 980
          * @since 1.6.6
981 981
          */
982
-        $html = apply_filters("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}",$html,$location,$cf);
982
+        $html = apply_filters("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}", $html, $location, $cf);
983 983
     }
984 984
 
985 985
     // If not html then we run the standard output.
986
-    if(empty($html)){
986
+    if (empty($html)) {
987 987
 
988 988
 
989 989
         if (!empty($post->{$cf['htmlvar_name']})):
@@ -1004,7 +1004,7 @@  discard block
 block discarded – undo
1004 1004
 
1005 1005
             $field_values = explode(',', trim($post->{$cf['htmlvar_name']}, ","));
1006 1006
 
1007
-            if(is_array($field_values)){
1007
+            if (is_array($field_values)) {
1008 1008
                 $field_values = array_map('trim', $field_values);
1009 1009
             }
1010 1010
 
@@ -1022,15 +1022,15 @@  discard block
 block discarded – undo
1022 1022
             }
1023 1023
 
1024 1024
 
1025
-            $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
1026
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1025
+            $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-select" style="'.$field_icon.'">'.$field_icon_af;
1026
+            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : '';
1027 1027
             $html .= '</span>';
1028 1028
 
1029 1029
             if (count($option_values) > 1) {
1030 1030
                 $html .= '<ul>';
1031 1031
 
1032 1032
                 foreach ($option_values as $val) {
1033
-                    $html .= '<li>' . $val . '</li>';
1033
+                    $html .= '<li>'.$val.'</li>';
1034 1034
                 }
1035 1035
 
1036 1036
                 $html .= '</ul>';
@@ -1045,7 +1045,7 @@  discard block
 block discarded – undo
1045 1045
 
1046 1046
     return $html;
1047 1047
 }
1048
-add_filter('geodir_custom_field_output_multiselect','geodir_cf_multiselect',10,3);
1048
+add_filter('geodir_custom_field_output_multiselect', 'geodir_cf_multiselect', 10, 3);
1049 1049
 
1050 1050
 
1051 1051
 /**
@@ -1058,21 +1058,21 @@  discard block
 block discarded – undo
1058 1058
  *
1059 1059
  * @return string The html to output for the custom field.
1060 1060
  */
1061
-function geodir_cf_email($html,$location,$cf,$p=''){
1061
+function geodir_cf_email($html, $location, $cf, $p = '') {
1062 1062
 
1063 1063
     // check we have the post value
1064
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1065
-    else{ global $post;}
1064
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
1065
+    else { global $post; }
1066 1066
 
1067
-    if(!is_array($cf) && $cf!=''){
1067
+    if (!is_array($cf) && $cf != '') {
1068 1068
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1069
-        if(!$cf){return NULL;}
1069
+        if (!$cf) {return NULL; }
1070 1070
     }
1071 1071
 
1072 1072
     $html_var = $cf['htmlvar_name'];
1073 1073
 
1074 1074
     // Check if there is a location specific filter.
1075
-    if(has_filter("geodir_custom_field_output_email_loc_{$location}")){
1075
+    if (has_filter("geodir_custom_field_output_email_loc_{$location}")) {
1076 1076
         /**
1077 1077
          * Filter the email html by location.
1078 1078
          *
@@ -1080,11 +1080,11 @@  discard block
 block discarded – undo
1080 1080
          * @param array $cf The custom field array.
1081 1081
          * @since 1.6.6
1082 1082
          */
1083
-        $html = apply_filters("geodir_custom_field_output_email_loc_{$location}",$html,$cf);
1083
+        $html = apply_filters("geodir_custom_field_output_email_loc_{$location}", $html, $cf);
1084 1084
     }
1085 1085
 
1086 1086
     // Check if there is a custom field specific filter.
1087
-    if(has_filter("geodir_custom_field_output_email_var_{$html_var}")){
1087
+    if (has_filter("geodir_custom_field_output_email_var_{$html_var}")) {
1088 1088
         /**
1089 1089
          * Filter the email html by individual custom field.
1090 1090
          *
@@ -1093,11 +1093,11 @@  discard block
 block discarded – undo
1093 1093
          * @param array $cf The custom field array.
1094 1094
          * @since 1.6.6
1095 1095
          */
1096
-        $html = apply_filters("geodir_custom_field_output_email_var_{$html_var}",$html,$location,$cf);
1096
+        $html = apply_filters("geodir_custom_field_output_email_var_{$html_var}", $html, $location, $cf);
1097 1097
     }
1098 1098
 
1099 1099
     // Check if there is a custom field key specific filter.
1100
-    if(has_filter("geodir_custom_field_output_email_key_{$cf['field_type_key']}")){
1100
+    if (has_filter("geodir_custom_field_output_email_key_{$cf['field_type_key']}")) {
1101 1101
         /**
1102 1102
          * Filter the email html by field type key.
1103 1103
          *
@@ -1106,18 +1106,18 @@  discard block
 block discarded – undo
1106 1106
          * @param array $cf The custom field array.
1107 1107
          * @since 1.6.6
1108 1108
          */
1109
-        $html = apply_filters("geodir_custom_field_output_email_key_{$cf['field_type_key']}",$html,$location,$cf);
1109
+        $html = apply_filters("geodir_custom_field_output_email_key_{$cf['field_type_key']}", $html, $location, $cf);
1110 1110
     }
1111 1111
 
1112 1112
     // If not html then we run the standard output.
1113
-    if(empty($html)){
1113
+    if (empty($html)) {
1114 1114
 
1115 1115
         global $preview;
1116 1116
         if ($cf['htmlvar_name'] == 'geodir_email' && !(geodir_is_page('detail') || geodir_is_page('preview'))) {
1117 1117
             return ''; // Remove Send Enquiry | Send To Friend from listings page
1118 1118
         }
1119 1119
 
1120
-        $package_info = (array)geodir_post_package_info(array(), $post, $post->post_type);
1120
+        $package_info = (array) geodir_post_package_info(array(), $post, $post->post_type);
1121 1121
 
1122 1122
         if ($cf['htmlvar_name'] == 'geodir_email' && ((isset($package_info['sendtofriend']) && $package_info['sendtofriend']) || $post->{$cf['htmlvar_name']})) {
1123 1123
             $send_to_friend = true;
@@ -1128,7 +1128,7 @@  discard block
 block discarded – undo
1128 1128
             if (!$preview) {
1129 1129
                 $b_send_inquiry = 'b_send_inquiry';
1130 1130
                 $b_sendtofriend = 'b_sendtofriend';
1131
-                $html = '<input type="hidden" name="geodir_popup_post_id" value="' . $post->ID . '" /><div class="geodir_display_popup_forms"></div>';
1131
+                $html = '<input type="hidden" name="geodir_popup_post_id" value="'.$post->ID.'" /><div class="geodir_display_popup_forms"></div>';
1132 1132
             }
1133 1133
 
1134 1134
             $field_icon = geodir_field_icon_proccess($cf);
@@ -1141,26 +1141,26 @@  discard block
 block discarded – undo
1141 1141
                 $field_icon = '';
1142 1142
             }
1143 1143
 
1144
-            $html .= '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af;
1144
+            $html .= '<div class="geodir_more_info  '.$cf['css_class'].' '.$cf['htmlvar_name'].'"><span class="geodir-i-email" style="'.$field_icon.'">'.$field_icon_af;
1145 1145
             $seperator = '';
1146 1146
             if ($post->{$cf['htmlvar_name']}) {
1147
-                $html .= '<a href="javascript:void(0);" class="' . $b_send_inquiry . '" >' . SEND_INQUIRY . '</a>';
1147
+                $html .= '<a href="javascript:void(0);" class="'.$b_send_inquiry.'" >'.SEND_INQUIRY.'</a>';
1148 1148
                 $seperator = ' | ';
1149 1149
             }
1150 1150
 
1151 1151
             if (isset($package_info['sendtofriend']) && $package_info['sendtofriend']) {
1152
-                $html .= $seperator . '<a href="javascript:void(0);" class="' . $b_sendtofriend . '">' . SEND_TO_FRIEND . '</a>';
1152
+                $html .= $seperator.'<a href="javascript:void(0);" class="'.$b_sendtofriend.'">'.SEND_TO_FRIEND.'</a>';
1153 1153
             }
1154 1154
 
1155 1155
             $html .= '</span></div>';
1156 1156
 
1157 1157
 
1158 1158
             if (isset($_REQUEST['send_inquiry']) && $_REQUEST['send_inquiry'] == 'success') {
1159
-                $html .= '<p class="sucess_msg">' . SEND_INQUIRY_SUCCESS . '</p>';
1159
+                $html .= '<p class="sucess_msg">'.SEND_INQUIRY_SUCCESS.'</p>';
1160 1160
             } elseif (isset($_REQUEST['sendtofrnd']) && $_REQUEST['sendtofrnd'] == 'success') {
1161
-                $html .= '<p class="sucess_msg">' . SEND_FRIEND_SUCCESS . '</p>';
1161
+                $html .= '<p class="sucess_msg">'.SEND_FRIEND_SUCCESS.'</p>';
1162 1162
             } elseif (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 'captch') {
1163
-                $html .= '<p class="error_msg_fix">' . WRONG_CAPTCH_MSG . '</p>';
1163
+                $html .= '<p class="error_msg_fix">'.WRONG_CAPTCH_MSG.'</p>';
1164 1164
             }
1165 1165
 
1166 1166
             /*if(!$preview){require_once (geodir_plugin_path().'/geodirectory-templates/popup-forms.php');}*/
@@ -1180,11 +1180,11 @@  discard block
 block discarded – undo
1180 1180
                 }
1181 1181
 
1182 1182
 
1183
-                $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af;
1184
-                $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1183
+                $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-email" style="'.$field_icon.'">'.$field_icon_af;
1184
+                $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : '';
1185 1185
                 $html .= '</span><span class="geodir-email-address-output">';
1186 1186
                 $email = $post->{$cf['htmlvar_name']} ;
1187
-                if($e_split = explode('@',$email)){
1187
+                if ($e_split = explode('@', $email)) {
1188 1188
                     /**
1189 1189
                      * Filter email custom field name output.
1190 1190
                      *
@@ -1193,10 +1193,10 @@  discard block
 block discarded – undo
1193 1193
                      * @param string $email The email string being output.
1194 1194
                      * @param array $cf Custom field variables array.
1195 1195
                      */
1196
-                    $email_name = apply_filters('geodir_email_field_name_output',$email,$cf);
1197
-                    $html .=  "<script>document.write('<a href=\"mailto:'+'$e_split[0]' + '@' + '$e_split[1]'+'\">$email_name</a>')</script>";
1198
-                }else{
1199
-                    $html .=  $email;
1196
+                    $email_name = apply_filters('geodir_email_field_name_output', $email, $cf);
1197
+                    $html .= "<script>document.write('<a href=\"mailto:'+'$e_split[0]' + '@' + '$e_split[1]'+'\">$email_name</a>')</script>";
1198
+                } else {
1199
+                    $html .= $email;
1200 1200
                 }
1201 1201
                 $html .= '</span></div>';
1202 1202
             }
@@ -1207,7 +1207,7 @@  discard block
 block discarded – undo
1207 1207
 
1208 1208
     return $html;
1209 1209
 }
1210
-add_filter('geodir_custom_field_output_email','geodir_cf_email',10,3);
1210
+add_filter('geodir_custom_field_output_email', 'geodir_cf_email', 10, 3);
1211 1211
 
1212 1212
 
1213 1213
 /**
@@ -1220,21 +1220,21 @@  discard block
 block discarded – undo
1220 1220
  *
1221 1221
  * @return string The html to output for the custom field.
1222 1222
  */
1223
-function geodir_cf_file($html,$location,$cf,$p=''){
1223
+function geodir_cf_file($html, $location, $cf, $p = '') {
1224 1224
 
1225 1225
     // check we have the post value
1226
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1227
-    else{ global $post;}
1226
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
1227
+    else { global $post; }
1228 1228
 
1229
-    if(!is_array($cf) && $cf!=''){
1229
+    if (!is_array($cf) && $cf != '') {
1230 1230
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1231
-        if(!$cf){return NULL;}
1231
+        if (!$cf) {return NULL; }
1232 1232
     }
1233 1233
 
1234 1234
     $html_var = $cf['htmlvar_name'];
1235 1235
 
1236 1236
     // Check if there is a location specific filter.
1237
-    if(has_filter("geodir_custom_field_output_file_loc_{$location}")){
1237
+    if (has_filter("geodir_custom_field_output_file_loc_{$location}")) {
1238 1238
         /**
1239 1239
          * Filter the file html by location.
1240 1240
          *
@@ -1242,11 +1242,11 @@  discard block
 block discarded – undo
1242 1242
          * @param array $cf The custom field array.
1243 1243
          * @since 1.6.6
1244 1244
          */
1245
-        $html = apply_filters("geodir_custom_field_output_file_loc_{$location}",$html,$cf);
1245
+        $html = apply_filters("geodir_custom_field_output_file_loc_{$location}", $html, $cf);
1246 1246
     }
1247 1247
 
1248 1248
     // Check if there is a custom field specific filter.
1249
-    if(has_filter("geodir_custom_field_output_file_var_{$html_var}")){
1249
+    if (has_filter("geodir_custom_field_output_file_var_{$html_var}")) {
1250 1250
         /**
1251 1251
          * Filter the file html by individual custom field.
1252 1252
          *
@@ -1255,11 +1255,11 @@  discard block
 block discarded – undo
1255 1255
          * @param array $cf The custom field array.
1256 1256
          * @since 1.6.6
1257 1257
          */
1258
-        $html = apply_filters("geodir_custom_field_output_file_var_{$html_var}",$html,$location,$cf);
1258
+        $html = apply_filters("geodir_custom_field_output_file_var_{$html_var}", $html, $location, $cf);
1259 1259
     }
1260 1260
 
1261 1261
     // Check if there is a custom field key specific filter.
1262
-    if(has_filter("geodir_custom_field_output_file_key_{$cf['field_type_key']}")){
1262
+    if (has_filter("geodir_custom_field_output_file_key_{$cf['field_type_key']}")) {
1263 1263
         /**
1264 1264
          * Filter the file html by field type key.
1265 1265
          *
@@ -1268,11 +1268,11 @@  discard block
 block discarded – undo
1268 1268
          * @param array $cf The custom field array.
1269 1269
          * @since 1.6.6
1270 1270
          */
1271
-        $html = apply_filters("geodir_custom_field_output_file_key_{$cf['field_type_key']}",$html,$location,$cf);
1271
+        $html = apply_filters("geodir_custom_field_output_file_key_{$cf['field_type_key']}", $html, $location, $cf);
1272 1272
     }
1273 1273
 
1274 1274
     // If not html then we run the standard output.
1275
-    if(empty($html)){
1275
+    if (empty($html)) {
1276 1276
 
1277 1277
         if (!empty($post->{$cf['htmlvar_name']})):
1278 1278
 
@@ -1280,7 +1280,7 @@  discard block
 block discarded – undo
1280 1280
             if (!empty($files)):
1281 1281
 
1282 1282
                 $extra_fields = !empty($cf['extra_fields']) ? maybe_unserialize($cf['extra_fields']) : NULL;
1283
-                $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'] : '';
1283
+                $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'] : '';
1284 1284
 
1285 1285
                 $file_paths = '';
1286 1286
                 foreach ($files as $file) {
@@ -1317,9 +1317,9 @@  discard block
 block discarded – undo
1317 1317
                             //$file_paths .= '<img src="'.$file.'"  />';	
1318 1318
                             $file_paths .= '</div>';
1319 1319
                         } else {
1320
-                            $ext_path = '_' . $html_var . '_';
1320
+                            $ext_path = '_'.$html_var.'_';
1321 1321
                             $filename = explode($ext_path, $filename);
1322
-                            $file_paths .= '<a href="' . $file . '" target="_blank">' . $filename[count($filename) - 1] . '</a>';
1322
+                            $file_paths .= '<a href="'.$file.'" target="_blank">'.$filename[count($filename) - 1].'</a>';
1323 1323
                         }
1324 1324
                     }
1325 1325
                 }
@@ -1334,11 +1334,11 @@  discard block
 block discarded – undo
1334 1334
                     $field_icon = '';
1335 1335
                 }
1336 1336
 
1337
-                $html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' geodir-custom-file-box ' . $cf['htmlvar_name'] . '"><div class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
1337
+                $html = '<div class="geodir_more_info  '.$cf['css_class'].' geodir-custom-file-box '.$cf['htmlvar_name'].'"><div class="geodir-i-select" style="'.$field_icon.'">'.$field_icon_af;
1338 1338
                 $html .= '<span style="display: inline-block; vertical-align: top; padding-right: 14px;">';
1339
-                $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1339
+                $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : '';
1340 1340
                 $html .= '</span>';
1341
-                $html .= $file_paths . '</div></div>';
1341
+                $html .= $file_paths.'</div></div>';
1342 1342
 
1343 1343
             endif;
1344 1344
         endif;
@@ -1347,7 +1347,7 @@  discard block
 block discarded – undo
1347 1347
 
1348 1348
     return $html;
1349 1349
 }
1350
-add_filter('geodir_custom_field_output_file','geodir_cf_file',10,3);
1350
+add_filter('geodir_custom_field_output_file', 'geodir_cf_file', 10, 3);
1351 1351
 
1352 1352
 
1353 1353
 
@@ -1361,21 +1361,21 @@  discard block
 block discarded – undo
1361 1361
  *
1362 1362
  * @return string The html to output for the custom field.
1363 1363
  */
1364
-function geodir_cf_textarea($html,$location,$cf,$p=''){
1364
+function geodir_cf_textarea($html, $location, $cf, $p = '') {
1365 1365
 
1366 1366
     // check we have the post value
1367
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1368
-    else{ global $post;}
1367
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
1368
+    else { global $post; }
1369 1369
 
1370
-    if(!is_array($cf) && $cf!=''){
1370
+    if (!is_array($cf) && $cf != '') {
1371 1371
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1372
-        if(!$cf){return NULL;}
1372
+        if (!$cf) {return NULL; }
1373 1373
     }
1374 1374
 
1375 1375
     $html_var = $cf['htmlvar_name'];
1376 1376
 
1377 1377
     // Check if there is a location specific filter.
1378
-    if(has_filter("geodir_custom_field_output_textarea_loc_{$location}")){
1378
+    if (has_filter("geodir_custom_field_output_textarea_loc_{$location}")) {
1379 1379
         /**
1380 1380
          * Filter the textarea html by location.
1381 1381
          *
@@ -1383,11 +1383,11 @@  discard block
 block discarded – undo
1383 1383
          * @param array $cf The custom field array.
1384 1384
          * @since 1.6.6
1385 1385
          */
1386
-        $html = apply_filters("geodir_custom_field_output_textarea_loc_{$location}",$html,$cf);
1386
+        $html = apply_filters("geodir_custom_field_output_textarea_loc_{$location}", $html, $cf);
1387 1387
     }
1388 1388
 
1389 1389
     // Check if there is a custom field specific filter.
1390
-    if(has_filter("geodir_custom_field_output_textarea_var_{$html_var}")){
1390
+    if (has_filter("geodir_custom_field_output_textarea_var_{$html_var}")) {
1391 1391
         /**
1392 1392
          * Filter the textarea html by individual custom field.
1393 1393
          *
@@ -1396,11 +1396,11 @@  discard block
 block discarded – undo
1396 1396
          * @param array $cf The custom field array.
1397 1397
          * @since 1.6.6
1398 1398
          */
1399
-        $html = apply_filters("geodir_custom_field_output_textarea_var_{$html_var}",$html,$location,$cf);
1399
+        $html = apply_filters("geodir_custom_field_output_textarea_var_{$html_var}", $html, $location, $cf);
1400 1400
     }
1401 1401
 
1402 1402
     // Check if there is a custom field key specific filter.
1403
-    if(has_filter("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}")){
1403
+    if (has_filter("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}")) {
1404 1404
         /**
1405 1405
          * Filter the textarea html by field type key.
1406 1406
          *
@@ -1409,11 +1409,11 @@  discard block
 block discarded – undo
1409 1409
          * @param array $cf The custom field array.
1410 1410
          * @since 1.6.6
1411 1411
          */
1412
-        $html = apply_filters("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}",$html,$location,$cf);
1412
+        $html = apply_filters("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}", $html, $location, $cf);
1413 1413
     }
1414 1414
 
1415 1415
     // If not html then we run the standard output.
1416
-    if(empty($html)){
1416
+    if (empty($html)) {
1417 1417
 
1418 1418
         if (!empty($post->{$cf['htmlvar_name']})) {
1419 1419
 
@@ -1428,9 +1428,9 @@  discard block
 block discarded – undo
1428 1428
             }
1429 1429
 
1430 1430
 
1431
-            $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
1432
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1433
-            $html .= '</span>' . wpautop($post->{$cf['htmlvar_name']}) . '</div>';
1431
+            $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-text" style="'.$field_icon.'">'.$field_icon_af;
1432
+            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : '';
1433
+            $html .= '</span>'.wpautop($post->{$cf['htmlvar_name']}).'</div>';
1434 1434
 
1435 1435
         }
1436 1436
 
@@ -1438,7 +1438,7 @@  discard block
 block discarded – undo
1438 1438
 
1439 1439
     return $html;
1440 1440
 }
1441
-add_filter('geodir_custom_field_output_textarea','geodir_cf_textarea',10,3);
1441
+add_filter('geodir_custom_field_output_textarea', 'geodir_cf_textarea', 10, 3);
1442 1442
 
1443 1443
 
1444 1444
 
@@ -1452,21 +1452,21 @@  discard block
 block discarded – undo
1452 1452
  *
1453 1453
  * @return string The html to output for the custom field.
1454 1454
  */
1455
-function geodir_cf_html($html,$location,$cf,$p=''){
1455
+function geodir_cf_html($html, $location, $cf, $p = '') {
1456 1456
 
1457 1457
     // check we have the post value
1458
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1459
-    else{ global $post;}
1458
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
1459
+    else { global $post; }
1460 1460
 
1461
-    if(!is_array($cf) && $cf!=''){
1461
+    if (!is_array($cf) && $cf != '') {
1462 1462
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1463
-        if(!$cf){return NULL;}
1463
+        if (!$cf) {return NULL; }
1464 1464
     }
1465 1465
 
1466 1466
     $html_var = $cf['htmlvar_name'];
1467 1467
 
1468 1468
     // Check if there is a location specific filter.
1469
-    if(has_filter("geodir_custom_field_output_html_loc_{$location}")){
1469
+    if (has_filter("geodir_custom_field_output_html_loc_{$location}")) {
1470 1470
         /**
1471 1471
          * Filter the html html by location.
1472 1472
          *
@@ -1474,11 +1474,11 @@  discard block
 block discarded – undo
1474 1474
          * @param array $cf The custom field array.
1475 1475
          * @since 1.6.6
1476 1476
          */
1477
-        $html = apply_filters("geodir_custom_field_output_html_loc_{$location}",$html,$cf);
1477
+        $html = apply_filters("geodir_custom_field_output_html_loc_{$location}", $html, $cf);
1478 1478
     }
1479 1479
 
1480 1480
     // Check if there is a custom field specific filter.
1481
-    if(has_filter("geodir_custom_field_output_html_var_{$html_var}")){
1481
+    if (has_filter("geodir_custom_field_output_html_var_{$html_var}")) {
1482 1482
         /**
1483 1483
          * Filter the html html by individual custom field.
1484 1484
          *
@@ -1487,11 +1487,11 @@  discard block
 block discarded – undo
1487 1487
          * @param array $cf The custom field array.
1488 1488
          * @since 1.6.6
1489 1489
          */
1490
-        $html = apply_filters("geodir_custom_field_output_html_var_{$html_var}",$html,$location,$cf);
1490
+        $html = apply_filters("geodir_custom_field_output_html_var_{$html_var}", $html, $location, $cf);
1491 1491
     }
1492 1492
 
1493 1493
     // Check if there is a custom field key specific filter.
1494
-    if(has_filter("geodir_custom_field_output_html_key_{$cf['field_type_key']}")){
1494
+    if (has_filter("geodir_custom_field_output_html_key_{$cf['field_type_key']}")) {
1495 1495
         /**
1496 1496
          * Filter the html html by field type key.
1497 1497
          *
@@ -1500,11 +1500,11 @@  discard block
 block discarded – undo
1500 1500
          * @param array $cf The custom field array.
1501 1501
          * @since 1.6.6
1502 1502
          */
1503
-        $html = apply_filters("geodir_custom_field_output_html_key_{$cf['field_type_key']}",$html,$location,$cf);
1503
+        $html = apply_filters("geodir_custom_field_output_html_key_{$cf['field_type_key']}", $html, $location, $cf);
1504 1504
     }
1505 1505
 
1506 1506
     // If not html then we run the standard output.
1507
-    if(empty($html)){
1507
+    if (empty($html)) {
1508 1508
 
1509 1509
         if (!empty($post->{$cf['htmlvar_name']})) {
1510 1510
 
@@ -1518,9 +1518,9 @@  discard block
 block discarded – undo
1518 1518
                 $field_icon = '';
1519 1519
             }
1520 1520
 
1521
-            $html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
1522
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1523
-            $html .= '</span>' . wpautop($post->{$cf['htmlvar_name']}) . '</div>';
1521
+            $html = '<div class="geodir_more_info  '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-text" style="'.$field_icon.'">'.$field_icon_af;
1522
+            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : '';
1523
+            $html .= '</span>'.wpautop($post->{$cf['htmlvar_name']}).'</div>';
1524 1524
 
1525 1525
         }
1526 1526
 
@@ -1528,7 +1528,7 @@  discard block
 block discarded – undo
1528 1528
 
1529 1529
     return $html;
1530 1530
 }
1531
-add_filter('geodir_custom_field_output_html','geodir_cf_html',10,3);
1531
+add_filter('geodir_custom_field_output_html', 'geodir_cf_html', 10, 3);
1532 1532
 
1533 1533
 
1534 1534
 
@@ -1542,21 +1542,21 @@  discard block
 block discarded – undo
1542 1542
  *
1543 1543
  * @return string The html to output for the custom field.
1544 1544
  */
1545
-function geodir_cf_taxonomy($html,$location,$cf,$p=''){
1545
+function geodir_cf_taxonomy($html, $location, $cf, $p = '') {
1546 1546
 
1547 1547
     // check we have the post value
1548
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1549
-    else{ global $post;}
1548
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
1549
+    else { global $post; }
1550 1550
 
1551
-    if(!is_array($cf) && $cf!=''){
1551
+    if (!is_array($cf) && $cf != '') {
1552 1552
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1553
-        if(!$cf){return NULL;}
1553
+        if (!$cf) {return NULL; }
1554 1554
     }
1555 1555
 
1556 1556
     $html_var = $cf['htmlvar_name'];
1557 1557
 
1558 1558
     // Check if there is a location specific filter.
1559
-    if(has_filter("geodir_custom_field_output_taxonomy_loc_{$location}")){
1559
+    if (has_filter("geodir_custom_field_output_taxonomy_loc_{$location}")) {
1560 1560
         /**
1561 1561
          * Filter the taxonomy html by location.
1562 1562
          *
@@ -1564,11 +1564,11 @@  discard block
 block discarded – undo
1564 1564
          * @param array $cf The custom field array.
1565 1565
          * @since 1.6.6
1566 1566
          */
1567
-        $html = apply_filters("geodir_custom_field_output_taxonomy_loc_{$location}",$html,$cf);
1567
+        $html = apply_filters("geodir_custom_field_output_taxonomy_loc_{$location}", $html, $cf);
1568 1568
     }
1569 1569
 
1570 1570
     // Check if there is a custom field specific filter.
1571
-    if(has_filter("geodir_custom_field_output_taxonomy_var_{$html_var}")){
1571
+    if (has_filter("geodir_custom_field_output_taxonomy_var_{$html_var}")) {
1572 1572
         /**
1573 1573
          * Filter the taxonomy html by individual custom field.
1574 1574
          *
@@ -1577,11 +1577,11 @@  discard block
 block discarded – undo
1577 1577
          * @param array $cf The custom field array.
1578 1578
          * @since 1.6.6
1579 1579
          */
1580
-        $html = apply_filters("geodir_custom_field_output_taxonomy_var_{$html_var}",$html,$location,$cf);
1580
+        $html = apply_filters("geodir_custom_field_output_taxonomy_var_{$html_var}", $html, $location, $cf);
1581 1581
     }
1582 1582
 
1583 1583
     // Check if there is a custom field key specific filter.
1584
-    if(has_filter("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}")){
1584
+    if (has_filter("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}")) {
1585 1585
         /**
1586 1586
          * Filter the taxonomy html by field type key.
1587 1587
          *
@@ -1590,14 +1590,14 @@  discard block
 block discarded – undo
1590 1590
          * @param array $cf The custom field array.
1591 1591
          * @since 1.6.6
1592 1592
          */
1593
-        $html = apply_filters("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}",$html,$location,$cf);
1593
+        $html = apply_filters("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}", $html, $location, $cf);
1594 1594
     }
1595 1595
 
1596 1596
     // If not html then we run the standard output.
1597
-    if(empty($html)){
1597
+    if (empty($html)) {
1598 1598
 
1599
-        if ($html_var == $post->post_type . 'category' && !empty($post->{$html_var})) {
1600
-            $post_taxonomy = $post->post_type . 'category';
1599
+        if ($html_var == $post->post_type.'category' && !empty($post->{$html_var})) {
1600
+            $post_taxonomy = $post->post_type.'category';
1601 1601
             $field_value = $post->{$html_var};
1602 1602
             $links = array();
1603 1603
             $terms = array();
@@ -1615,7 +1615,7 @@  discard block
 block discarded – undo
1615 1615
                     if ($term != '') {
1616 1616
                         $term = get_term_by('id', $term, $html_var);
1617 1617
                         if (is_object($term)) {
1618
-                            $links[] = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>" . $term->name . "</a>";
1618
+                            $links[] = "<a href='".esc_attr(get_term_link($term, $post_taxonomy))."'>".$term->name."</a>";
1619 1619
                             $terms[] = $term;
1620 1620
                         }
1621 1621
                     }
@@ -1629,7 +1629,7 @@  discard block
 block discarded – undo
1629 1629
                     $terms = $termsOrdered;
1630 1630
                 }
1631 1631
             }
1632
-            $html_value = !empty($links) && !empty($terms) ? wp_sprintf('%l', $links, (object)$terms) : '';
1632
+            $html_value = !empty($links) && !empty($terms) ? wp_sprintf('%l', $links, (object) $terms) : '';
1633 1633
 
1634 1634
             if ($html_value != '') {
1635 1635
                 $field_icon = geodir_field_icon_proccess($cf);
@@ -1642,9 +1642,9 @@  discard block
 block discarded – undo
1642 1642
                     $field_icon = '';
1643 1643
                 }
1644 1644
 
1645
-                $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $html_var . '" style="clear:both;"><span class="geodir-i-taxonomy geodir-i-category" style="' . $field_icon . '">' . $field_icon_af;
1646
-                $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1647
-                $html .= '</span> ' . $html_value . '</div>';
1645
+                $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$html_var.'" style="clear:both;"><span class="geodir-i-taxonomy geodir-i-category" style="'.$field_icon.'">'.$field_icon_af;
1646
+                $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : '';
1647
+                $html .= '</span> '.$html_value.'</div>';
1648 1648
             }
1649 1649
         }
1650 1650
 
@@ -1652,7 +1652,7 @@  discard block
 block discarded – undo
1652 1652
 
1653 1653
     return $html;
1654 1654
 }
1655
-add_filter('geodir_custom_field_output_taxonomy','geodir_cf_taxonomy',10,3);
1655
+add_filter('geodir_custom_field_output_taxonomy', 'geodir_cf_taxonomy', 10, 3);
1656 1656
 
1657 1657
 
1658 1658
 /**
@@ -1665,21 +1665,21 @@  discard block
 block discarded – undo
1665 1665
  *
1666 1666
  * @return string The html to output for the custom field.
1667 1667
  */
1668
-function geodir_cf_address($html,$location,$cf,$p=''){
1668
+function geodir_cf_address($html, $location, $cf, $p = '') {
1669 1669
 
1670 1670
     // check we have the post value
1671
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1672
-    else{ global $post;}
1671
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
1672
+    else { global $post; }
1673 1673
 
1674
-    if(!is_array($cf) && $cf!=''){
1674
+    if (!is_array($cf) && $cf != '') {
1675 1675
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1676
-        if(!$cf){return NULL;}
1676
+        if (!$cf) {return NULL; }
1677 1677
     }
1678 1678
 
1679 1679
     $html_var = $cf['htmlvar_name'];
1680 1680
 
1681 1681
     // Check if there is a location specific filter.
1682
-    if(has_filter("geodir_custom_field_output_address_loc_{$location}")){
1682
+    if (has_filter("geodir_custom_field_output_address_loc_{$location}")) {
1683 1683
         /**
1684 1684
          * Filter the address html by location.
1685 1685
          *
@@ -1687,11 +1687,11 @@  discard block
 block discarded – undo
1687 1687
          * @param array $cf The custom field array.
1688 1688
          * @since 1.6.6
1689 1689
          */
1690
-        $html = apply_filters("geodir_custom_field_output_address_loc_{$location}",$html,$cf);
1690
+        $html = apply_filters("geodir_custom_field_output_address_loc_{$location}", $html, $cf);
1691 1691
     }
1692 1692
 
1693 1693
     // Check if there is a custom field specific filter.
1694
-    if(has_filter("geodir_custom_field_output_address_var_{$html_var}")){
1694
+    if (has_filter("geodir_custom_field_output_address_var_{$html_var}")) {
1695 1695
         /**
1696 1696
          * Filter the address html by individual custom field.
1697 1697
          *
@@ -1700,11 +1700,11 @@  discard block
 block discarded – undo
1700 1700
          * @param array $cf The custom field array.
1701 1701
          * @since 1.6.6
1702 1702
          */
1703
-        $html = apply_filters("geodir_custom_field_output_address_var_{$html_var}",$html,$location,$cf);
1703
+        $html = apply_filters("geodir_custom_field_output_address_var_{$html_var}", $html, $location, $cf);
1704 1704
     }
1705 1705
 
1706 1706
     // Check if there is a custom field key specific filter.
1707
-    if(has_filter("geodir_custom_field_output_address_key_{$cf['field_type_key']}")){
1707
+    if (has_filter("geodir_custom_field_output_address_key_{$cf['field_type_key']}")) {
1708 1708
         /**
1709 1709
          * Filter the address html by field type key.
1710 1710
          *
@@ -1713,14 +1713,14 @@  discard block
 block discarded – undo
1713 1713
          * @param array $cf The custom field array.
1714 1714
          * @since 1.6.6
1715 1715
          */
1716
-        $html = apply_filters("geodir_custom_field_output_address_key_{$cf['field_type_key']}",$html,$location,$cf);
1716
+        $html = apply_filters("geodir_custom_field_output_address_key_{$cf['field_type_key']}", $html, $location, $cf);
1717 1717
     }
1718 1718
 
1719 1719
     // If not html then we run the standard output.
1720
-    if(empty($html)){
1720
+    if (empty($html)) {
1721 1721
 
1722 1722
         global $preview;
1723
-        $html_var = $cf['htmlvar_name'] . '_address';
1723
+        $html_var = $cf['htmlvar_name'].'_address';
1724 1724
 
1725 1725
         if ($cf['extra_fields']) {
1726 1726
 
@@ -1783,10 +1783,10 @@  discard block
 block discarded – undo
1783 1783
 
1784 1784
         if ($post->{$html_var}) {
1785 1785
 
1786
-            $field_icon = geodir_field_icon_proccess( $cf );
1787
-            if ( strpos( $field_icon, 'http' ) !== false ) {
1786
+            $field_icon = geodir_field_icon_proccess($cf);
1787
+            if (strpos($field_icon, 'http') !== false) {
1788 1788
                 $field_icon_af = '';
1789
-            } elseif ( $field_icon == '' ) {
1789
+            } elseif ($field_icon == '') {
1790 1790
                 $field_icon_af = '<i class="fa fa-home"></i>';
1791 1791
             } else {
1792 1792
                 $field_icon_af = $field_icon;
@@ -1795,25 +1795,25 @@  discard block
 block discarded – undo
1795 1795
             
1796 1796
 
1797 1797
 
1798
-            $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $html_var . '" style="clear:both;"  itemscope itemtype="https://schema.org/PostalAddress">';
1799
-            $html .= '<span class="geodir-i-location" style="' . $field_icon . '">' . $field_icon_af;
1800
-            $html .= ( trim( $cf['site_title'] ) ) ? __( $cf['site_title'], 'geodirectory' ) . ': ' : '&nbsp;';
1798
+            $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$html_var.'" style="clear:both;"  itemscope itemtype="https://schema.org/PostalAddress">';
1799
+            $html .= '<span class="geodir-i-location" style="'.$field_icon.'">'.$field_icon_af;
1800
+            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : '&nbsp;';
1801 1801
             $html .= '</span>';
1802 1802
 
1803
-            if ( isset($post->post_address) ) {
1804
-                $html .= '<span itemprop="streetAddress">' . $post->post_address . '</span><br>';
1803
+            if (isset($post->post_address)) {
1804
+                $html .= '<span itemprop="streetAddress">'.$post->post_address.'</span><br>';
1805 1805
             }
1806
-            if ($show_city_in_address && isset( $post->post_city ) && $post->post_city ) {
1807
-                $html .= '<span itemprop="addressLocality">' . $post->post_city . '</span><br>';
1806
+            if ($show_city_in_address && isset($post->post_city) && $post->post_city) {
1807
+                $html .= '<span itemprop="addressLocality">'.$post->post_city.'</span><br>';
1808 1808
             }
1809
-            if ($show_region_in_address && isset( $post->post_region ) && $post->post_region ) {
1810
-                $html .= '<span itemprop="addressRegion">' . $post->post_region . '</span><br>';
1809
+            if ($show_region_in_address && isset($post->post_region) && $post->post_region) {
1810
+                $html .= '<span itemprop="addressRegion">'.$post->post_region.'</span><br>';
1811 1811
             }
1812
-            if ($show_zip_in_address && isset( $post->post_zip ) && $post->post_zip ) {
1813
-                $html .= '<span itemprop="postalCode">' . $post->post_zip . '</span><br>';
1812
+            if ($show_zip_in_address && isset($post->post_zip) && $post->post_zip) {
1813
+                $html .= '<span itemprop="postalCode">'.$post->post_zip.'</span><br>';
1814 1814
             }
1815
-            if ($show_country_in_address && isset( $post->post_country ) && $post->post_country ) {
1816
-                $html .= '<span itemprop="addressCountry">' . __( $post->post_country, 'geodirectory' ) . '</span><br>';
1815
+            if ($show_country_in_address && isset($post->post_country) && $post->post_country) {
1816
+                $html .= '<span itemprop="addressCountry">'.__($post->post_country, 'geodirectory').'</span><br>';
1817 1817
             }
1818 1818
             $html .= '</div>';
1819 1819
 
@@ -1824,4 +1824,4 @@  discard block
 block discarded – undo
1824 1824
 
1825 1825
     return $html;
1826 1826
 }
1827
-add_filter('geodir_custom_field_output_address','geodir_cf_address',10,3);
1828 1827
\ No newline at end of file
1828
+add_filter('geodir_custom_field_output_address', 'geodir_cf_address', 10, 3);
1829 1829
\ No newline at end of file
Please login to merge, or discard this patch.
geodirectory-functions/custom_fields_input_functions.php 3 patches
Braces   +191 added lines, -68 removed lines patch added patch discarded remove patch
@@ -86,26 +86,31 @@  discard block
 block discarded – undo
86 86
         $value = geodir_get_cf_value($cf);
87 87
         $type = $cf['type'];
88 88
         //number and float validation $validation_pattern
89
-        if(isset($cf['data_type']) && $cf['data_type']=='INT'){$type = 'number';}
90
-        elseif(isset($cf['data_type']) && $cf['data_type']=='FLOAT'){$type = 'float';}
89
+        if(isset($cf['data_type']) && $cf['data_type']=='INT'){$type = 'number';} elseif(isset($cf['data_type']) && $cf['data_type']=='FLOAT'){$type = 'float';}
91 90
 
92 91
         //validation
93 92
         if(isset($cf['validation_pattern']) && $cf['validation_pattern']){
94 93
             $validation = 'pattern="'.$cf['validation_pattern'].'"';
95
-        }else{$validation='';}
94
+        } else{$validation='';}
96 95
 
97 96
         // validation message
98 97
         if(isset($cf['validation_msg']) && $cf['validation_msg']){
99 98
             $validation_msg = 'title="'.$cf['validation_msg'].'"';
100
-        }else{$validation_msg='';}
99
+        } else{$validation_msg='';}
101 100
         ?>
102 101
 
103 102
         <div id="<?php echo $cf['name'];?>_row"
104
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
103
+             class="<?php if ($cf['is_required']) {
104
+	echo 'required_field';
105
+}
106
+?> geodir_form_row clearfix gd-fieldset-details">
105 107
             <label>
106 108
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
107 109
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
108
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
110
+                <?php if ($cf['is_required']) {
111
+	echo '<span>*</span>';
112
+}
113
+?>
109 114
             </label>
110 115
             <input field_type="<?php echo $type;?>" name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>"
111 116
                    value="<?php echo esc_attr(stripslashes($value));?>" type="<?php echo $type;?>" class="geodir_textfield" <?php echo $validation;echo $validation_msg;?> />
@@ -160,11 +165,17 @@  discard block
 block discarded – undo
160 165
         }?>
161 166
 
162 167
         <div id="<?php echo $cf['name'];?>_row"
163
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
168
+             class="<?php if ($cf['is_required']) {
169
+	echo 'required_field';
170
+}
171
+?> geodir_form_row clearfix gd-fieldset-details">
164 172
             <label>
165 173
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
166 174
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
167
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
175
+                <?php if ($cf['is_required']) {
176
+	echo '<span>*</span>';
177
+}
178
+?>
168 179
             </label>
169 180
             <input field_type="<?php echo $cf['type'];?>" name="<?php  $cf['name'];?>" id="<?php echo $cf['name'];?>"
170 181
                    value="<?php echo esc_attr(stripslashes($value));?>" type="email" class="geodir_textfield"/>
@@ -220,11 +231,17 @@  discard block
 block discarded – undo
220 231
         }?>
221 232
 
222 233
         <div id="<?php echo $cf['name'];?>_row"
223
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
234
+             class="<?php if ($cf['is_required']) {
235
+	echo 'required_field';
236
+}
237
+?> geodir_form_row clearfix gd-fieldset-details">
224 238
             <label>
225 239
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
226 240
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
227
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
241
+                <?php if ($cf['is_required']) {
242
+	echo '<span>*</span>';
243
+}
244
+?>
228 245
             </label>
229 246
             <input field_type="<?php echo $cf['type'];?>" name="<?php  $cf['name'];?>" id="<?php echo $cf['name'];?>"
230 247
                    value="<?php echo esc_attr(stripslashes($value));?>" type="tel" class="geodir_textfield"/>
@@ -280,11 +297,17 @@  discard block
 block discarded – undo
280 297
         }?>
281 298
 
282 299
         <div id="<?php echo $cf['name'];?>_row"
283
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
300
+             class="<?php if ($cf['is_required']) {
301
+	echo 'required_field';
302
+}
303
+?> geodir_form_row clearfix gd-fieldset-details">
284 304
             <label>
285 305
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
286 306
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
287
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
307
+                <?php if ($cf['is_required']) {
308
+	echo '<span>*</span>';
309
+}
310
+?>
288 311
             </label>
289 312
             <input field_type="<?php echo $cf['type'];?>" name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>"
290 313
                    value="<?php echo esc_attr(stripslashes($value));?>" type="url" class="geodir_textfield"
@@ -339,11 +362,17 @@  discard block
 block discarded – undo
339 362
 
340 363
         ?>
341 364
         <div id="<?php echo $cf['name'];?>_row"
342
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
365
+             class="<?php if ($cf['is_required']) {
366
+	echo 'required_field';
367
+}
368
+?> geodir_form_row clearfix gd-fieldset-details">
343 369
             <label>
344 370
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
345 371
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
346
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
372
+                <?php if ($cf['is_required']) {
373
+	echo '<span>*</span>';
374
+}
375
+?>
347 376
             </label>
348 377
             <?php if ($cf['option_values']) {
349 378
                 $option_values = geodir_string_values_to_options($cf['option_values'], true);
@@ -410,11 +439,17 @@  discard block
 block discarded – undo
410 439
         }?>
411 440
 
412 441
         <div id="<?php echo $cf['name'];?>_row"
413
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
442
+             class="<?php if ($cf['is_required']) {
443
+	echo 'required_field';
444
+}
445
+?> geodir_form_row clearfix gd-fieldset-details">
414 446
             <label>
415 447
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
416 448
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
417
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
449
+                <?php if ($cf['is_required']) {
450
+	echo '<span>*</span>';
451
+}
452
+?>
418 453
             </label>
419 454
             <?php if ($value != '1') {
420 455
                 $value = '0';
@@ -474,11 +509,17 @@  discard block
 block discarded – undo
474 509
         ?>
475 510
 
476 511
         <div id="<?php echo $cf['name'];?>_row"
477
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
512
+             class="<?php if ($cf['is_required']) {
513
+	echo 'required_field';
514
+}
515
+?> geodir_form_row clearfix gd-fieldset-details">
478 516
             <label>
479 517
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
480 518
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
481
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
519
+                <?php if ($cf['is_required']) {
520
+	echo '<span>*</span>';
521
+}
522
+?>
482 523
             </label><?php
483 524
 
484 525
 
@@ -546,11 +587,17 @@  discard block
 block discarded – undo
546 587
 
547 588
         ?>
548 589
         <div id="<?php echo $cf['name'];?>_row"
549
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row geodir_custom_fields clearfix gd-fieldset-details">
590
+             class="<?php if ($cf['is_required']) {
591
+	echo 'required_field';
592
+}
593
+?> geodir_form_row geodir_custom_fields clearfix gd-fieldset-details">
550 594
             <label>
551 595
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
552 596
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
553
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
597
+                <?php if ($cf['is_required']) {
598
+	echo '<span>*</span>';
599
+}
600
+?>
554 601
             </label>
555 602
             <?php
556 603
             $option_values_arr = geodir_string_values_to_options($cf['option_values'], true);
@@ -627,11 +674,17 @@  discard block
 block discarded – undo
627 674
         }
628 675
         ?>
629 676
         <div id="<?php echo $cf['name']; ?>_row"
630
-             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
677
+             class="<?php if ($cf['is_required']) {
678
+	echo 'required_field';
679
+}
680
+?> geodir_form_row clearfix gd-fieldset-details">
631 681
             <label>
632 682
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
633 683
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
634
-                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
684
+                <?php if ($cf['is_required']) {
685
+	echo '<span>*</span>';
686
+}
687
+?>
635 688
             </label>
636 689
             <input type="hidden" name="gd_field_<?php echo $cf['name']; ?>" value="1"/>
637 690
             <?php if ($multi_display == 'select') { ?>
@@ -738,11 +791,17 @@  discard block
 block discarded – undo
738 791
         ?>
739 792
 
740 793
         <div id="<?php echo $cf['name']; ?>_row"
741
-             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
794
+             class="<?php if ($cf['is_required']) {
795
+	echo 'required_field';
796
+}
797
+?> geodir_form_row clearfix gd-fieldset-details">
742 798
             <label>
743 799
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
744 800
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
745
-                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
801
+                <?php if ($cf['is_required']) {
802
+	echo '<span>*</span>';
803
+}
804
+?>
746 805
             </label>
747 806
 
748 807
             <?php $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10); ?>
@@ -802,8 +861,9 @@  discard block
 block discarded – undo
802 861
         $extra_fields = unserialize($cf['extra_fields']);
803 862
         $name = $cf['name'];
804 863
 
805
-        if ($extra_fields['date_format'] == '')
806
-            $extra_fields['date_format'] = 'yy-mm-dd';
864
+        if ($extra_fields['date_format'] == '') {
865
+                    $extra_fields['date_format'] = 'yy-mm-dd';
866
+        }
807 867
 
808 868
         $date_format = $extra_fields['date_format'];
809 869
         $jquery_date_format  = $date_format;
@@ -817,7 +877,7 @@  discard block
 block discarded – undo
817 877
             $replace = array('d','j','l','m','n','F','Y');//PHP date format
818 878
 
819 879
             $date_format = str_replace($search, $replace, $date_format);
820
-        }else{
880
+        } else{
821 881
             $jquery_date_format = geodir_date_format_php_to_jqueryui( $jquery_date_format );
822 882
         }
823 883
 
@@ -851,12 +911,18 @@  discard block
 block discarded – undo
851 911
 
852 912
         </script>
853 913
         <div id="<?php echo $name;?>_row"
854
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
914
+             class="<?php if ($cf['is_required']) {
915
+	echo 'required_field';
916
+}
917
+?> geodir_form_row clearfix gd-fieldset-details">
855 918
             <label>
856 919
 
857 920
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
858 921
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
859
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
922
+                <?php if ($cf['is_required']) {
923
+	echo '<span>*</span>';
924
+}
925
+?>
860 926
             </label>
861 927
 
862 928
             <input field_type="<?php echo $cf['type'];?>" name="<?php echo $name;?>" id="<?php echo $name;?>"
@@ -910,8 +976,9 @@  discard block
 block discarded – undo
910 976
 
911 977
         $name = $cf['name'];
912 978
 
913
-        if ($value != '')
914
-            $value = date('H:i', strtotime($value));
979
+        if ($value != '') {
980
+                    $value = date('H:i', strtotime($value));
981
+        }
915 982
         ?>
916 983
         <script type="text/javascript">
917 984
             jQuery(document).ready(function () {
@@ -924,12 +991,18 @@  discard block
 block discarded – undo
924 991
             });
925 992
         </script>
926 993
         <div id="<?php echo $name;?>_row"
927
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
994
+             class="<?php if ($cf['is_required']) {
995
+	echo 'required_field';
996
+}
997
+?> geodir_form_row clearfix gd-fieldset-details">
928 998
             <label>
929 999
 
930 1000
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
931 1001
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
932
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
1002
+                <?php if ($cf['is_required']) {
1003
+	echo '<span>*</span>';
1004
+}
1005
+?>
933 1006
             </label>
934 1007
             <input readonly="readonly" field_type="<?php echo $cf['type'];?>" name="<?php echo $name;?>"
935 1008
                    id="<?php echo $name;?>" value="<?php echo esc_attr($value);?>" type="text" class="geodir_textfield"/>
@@ -1021,17 +1094,27 @@  discard block
 block discarded – undo
1021 1094
         }
1022 1095
 
1023 1096
         $location = geodir_get_default_location();
1024
-        if (empty($city)) $city = isset($location->city) ? $location->city : '';
1025
-        if (empty($region)) $region = isset($location->region) ? $location->region : '';
1026
-        if (empty($country)) $country = isset($location->country) ? $location->country : '';
1097
+        if (empty($city)) {
1098
+        	$city = isset($location->city) ? $location->city : '';
1099
+        }
1100
+        if (empty($region)) {
1101
+        	$region = isset($location->region) ? $location->region : '';
1102
+        }
1103
+        if (empty($country)) {
1104
+        	$country = isset($location->country) ? $location->country : '';
1105
+        }
1027 1106
 
1028 1107
         $lat_lng_blank = false;
1029 1108
         if (empty($lat) && empty($lng)) {
1030 1109
             $lat_lng_blank = true;
1031 1110
         }
1032 1111
 
1033
-        if (empty($lat)) $lat = isset($location->city_latitude) ? $location->city_latitude : '';
1034
-        if (empty($lng)) $lng = isset($location->city_longitude) ? $location->city_longitude : '';
1112
+        if (empty($lat)) {
1113
+        	$lat = isset($location->city_latitude) ? $location->city_latitude : '';
1114
+        }
1115
+        if (empty($lng)) {
1116
+        	$lng = isset($location->city_longitude) ? $location->city_longitude : '';
1117
+        }
1035 1118
 
1036 1119
         /**
1037 1120
          * Filter the default latitude.
@@ -1055,10 +1138,16 @@  discard block
 block discarded – undo
1055 1138
         ?>
1056 1139
 
1057 1140
         <div id="geodir_<?php echo $prefix . 'address';?>_row"
1058
-             class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
1141
+             class="<?php if ($is_required) {
1142
+	echo 'required_field';
1143
+}
1144
+?> geodir_form_row clearfix gd-fieldset-details">
1059 1145
             <label>
1060 1146
                 <?php _e($address_title, 'geodirectory'); ?>
1061
-                <?php if ($is_required) echo '<span>*</span>';?>
1147
+                <?php if ($is_required) {
1148
+	echo '<span>*</span>';
1149
+}
1150
+?>
1062 1151
             </label>
1063 1152
             <input type="text" field_type="<?php echo $type;?>" name="<?php echo $prefix . 'address';?>"
1064 1153
                    id="<?php echo $prefix . 'address';?>" class="geodir_textfield"
@@ -1119,10 +1208,16 @@  discard block
 block discarded – undo
1119 1208
             /* show lat lng */
1120 1209
             $style_latlng = ((isset($extra_fields['show_latlng']) && $extra_fields['show_latlng']) || is_admin()) ? '' : 'style="display:none"'; ?>
1121 1210
             <div id="geodir_<?php echo $prefix . 'latitude'; ?>_row"
1122
-                 class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details" <?php echo $style_latlng; ?>>
1211
+                 class="<?php if ($is_required) {
1212
+	echo 'required_field';
1213
+}
1214
+?> geodir_form_row clearfix gd-fieldset-details" <?php echo $style_latlng; ?>>
1123 1215
                 <label>
1124 1216
                     <?php echo PLACE_ADDRESS_LAT; ?>
1125
-                    <?php if ($is_required) echo '<span>*</span>'; ?>
1217
+                    <?php if ($is_required) {
1218
+	echo '<span>*</span>';
1219
+}
1220
+?>
1126 1221
                 </label>
1127 1222
                 <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix . 'latitude'; ?>"
1128 1223
                        id="<?php echo $prefix . 'latitude'; ?>" class="geodir_textfield"
@@ -1134,10 +1229,16 @@  discard block
 block discarded – undo
1134 1229
             </div>
1135 1230
 
1136 1231
             <div id="geodir_<?php echo $prefix . 'longitude'; ?>_row"
1137
-                 class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details" <?php echo $style_latlng; ?>>
1232
+                 class="<?php if ($is_required) {
1233
+	echo 'required_field';
1234
+}
1235
+?> geodir_form_row clearfix gd-fieldset-details" <?php echo $style_latlng; ?>>
1138 1236
                 <label>
1139 1237
                     <?php echo PLACE_ADDRESS_LNG; ?>
1140
-                    <?php if ($is_required) echo '<span>*</span>'; ?>
1238
+                    <?php if ($is_required) {
1239
+	echo '<span>*</span>';
1240
+}
1241
+?>
1141 1242
                 </label>
1142 1243
                 <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix . 'longitude'; ?>"
1143 1244
                        id="<?php echo $prefix . 'longitude'; ?>" class="geodir_textfield"
@@ -1241,11 +1342,17 @@  discard block
 block discarded – undo
1241 1342
             $value = '';
1242 1343
         } ?>
1243 1344
         <div id="<?php echo $name;?>_row"
1244
-             class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
1345
+             class="<?php if ($is_required) {
1346
+	echo 'required_field';
1347
+}
1348
+?> geodir_form_row clearfix gd-fieldset-details">
1245 1349
             <label>
1246 1350
                 <?php $site_title = __($site_title, 'geodirectory');
1247 1351
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
1248
-                <?php if ($is_required) echo '<span>*</span>';?>
1352
+                <?php if ($is_required) {
1353
+	echo '<span>*</span>';
1354
+}
1355
+?>
1249 1356
             </label>
1250 1357
 
1251 1358
             <div id="<?php echo $name;?>" class="geodir_taxonomy_field" style="float:left; width:70%;">
@@ -1279,8 +1386,9 @@  discard block
 block discarded – undo
1279 1386
                     $post_cat = implode(",", $post_cat[$name]);
1280 1387
 
1281 1388
                 } else {
1282
-                    if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '')
1283
-                        $post_cat = geodir_get_post_meta($_REQUEST['pid'], $name, true);
1389
+                    if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
1390
+                                            $post_cat = geodir_get_post_meta($_REQUEST['pid'], $name, true);
1391
+                    }
1284 1392
                 }
1285 1393
 
1286 1394
 
@@ -1318,21 +1426,24 @@  discard block
 block discarded – undo
1318 1426
 
1319 1427
                         $cat_display == '';
1320 1428
                         $multiple = '';
1321
-                        if ($cat_display == 'multiselect')
1322
-                            $multiple = 'multiple="multiple"';
1429
+                        if ($cat_display == 'multiselect') {
1430
+                                                    $multiple = 'multiple="multiple"';
1431
+                        }
1323 1432
 
1324 1433
                         echo '<select id="' . $name . '" ' . $multiple . ' type="' . $name . '" name="post_category[' . $name . '][]" alt="' . $name . '" field_type="' . $cat_display . '" class="geodir_textfield textfield_x chosen_select" data-placeholder="' . __('Select Category', 'geodirectory') . '">';
1325 1434
 
1326 1435
 
1327
-                        if ($cat_display == 'select')
1328
-                            echo '<option value="">' . __('Select Category', 'geodirectory') . '</option>';
1436
+                        if ($cat_display == 'select') {
1437
+                                                    echo '<option value="">' . __('Select Category', 'geodirectory') . '</option>';
1438
+                        }
1329 1439
 
1330 1440
                     }
1331 1441
 
1332 1442
                     echo geodir_custom_taxonomy_walker($name, $catadd_limit = 0);
1333 1443
 
1334
-                    if ($cat_display == 'select' || $cat_display == 'multiselect')
1335
-                        echo '</select>';
1444
+                    if ($cat_display == 'select' || $cat_display == 'multiselect') {
1445
+                                            echo '</select>';
1446
+                    }
1336 1447
 
1337 1448
                 } else {
1338 1449
 
@@ -1404,18 +1515,23 @@  discard block
 block discarded – undo
1404 1515
 
1405 1516
             $file_value = trim($value, ","); // this will be initial value of the above form field. Image urls.
1406 1517
 
1407
-        } else
1408
-            $file_value = '';
1518
+        } else {
1519
+                    $file_value = '';
1520
+        }
1409 1521
 
1410
-        if (isset($extra_fields['file_multiple']) && $extra_fields['file_multiple'])
1411
-            $file_multiple = true; // allow multiple files upload
1412
-        else
1413
-            $file_multiple = false;
1522
+        if (isset($extra_fields['file_multiple']) && $extra_fields['file_multiple']) {
1523
+                    $file_multiple = true;
1524
+        }
1525
+        // allow multiple files upload
1526
+        else {
1527
+                    $file_multiple = false;
1528
+        }
1414 1529
 
1415
-        if (isset($extra_fields['image_limit']) && $extra_fields['image_limit'])
1416
-            $file_image_limit = $extra_fields['image_limit'];
1417
-        else
1418
-            $file_image_limit = 1;
1530
+        if (isset($extra_fields['image_limit']) && $extra_fields['image_limit']) {
1531
+                    $file_image_limit = $extra_fields['image_limit'];
1532
+        } else {
1533
+                    $file_image_limit = 1;
1534
+        }
1419 1535
 
1420 1536
         $file_width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels)
1421 1537
 
@@ -1423,8 +1539,9 @@  discard block
 block discarded – undo
1423 1539
 
1424 1540
         if (!empty($file_value)) {
1425 1541
             $curImages = explode(',', $file_value);
1426
-            if (!empty($curImages))
1427
-                $file_totImg = count($curImages);
1542
+            if (!empty($curImages)) {
1543
+                            $file_totImg = count($curImages);
1544
+            }
1428 1545
         }
1429 1546
 
1430 1547
         $allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types'] ) ? implode(",", $extra_fields['gd_file_types']) : '';
@@ -1439,12 +1556,18 @@  discard block
 block discarded – undo
1439 1556
         ?>
1440 1557
 
1441 1558
         <div id="<?php echo $name;?>_row"
1442
-             class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
1559
+             class="<?php if ($is_required) {
1560
+	echo 'required_field';
1561
+}
1562
+?> geodir_form_row clearfix gd-fieldset-details">
1443 1563
 
1444 1564
             <div id="<?php echo $file_id; ?>dropbox" style="text-align:center;">
1445 1565
                 <label
1446 1566
                     style="text-align:left; padding-top:10px;"><?php $site_title = __($site_title, 'geodirectory');
1447
-                    echo $site_title; ?><?php if ($is_required) echo '<span>*</span>';?></label>
1567
+                    echo $site_title; ?><?php if ($is_required) {
1568
+                    	echo '<span>*</span>';
1569
+                    }
1570
+                    ?></label>
1448 1571
                 <input class="geodir-custom-file-upload" field_type="file" type="hidden"
1449 1572
                        name="<?php echo $file_id; ?>" id="<?php echo $file_id; ?>"
1450 1573
                        value="<?php echo esc_attr($file_value); ?>"/>
Please login to merge, or discard this patch.
Spacing   +233 added lines, -233 removed lines patch added patch discarded remove patch
@@ -17,12 +17,12 @@  discard block
 block discarded – undo
17 17
  *
18 18
  * @return string The html to output for the custom field.
19 19
  */
20
-function geodir_cfi_fieldset($html,$cf){
20
+function geodir_cfi_fieldset($html, $cf) {
21 21
 
22 22
     $html_var = $cf['htmlvar_name'];
23 23
 
24 24
     // Check if there is a custom field specific filter.
25
-    if(has_filter("geodir_custom_field_input_fieldset_{$html_var}")){
25
+    if (has_filter("geodir_custom_field_input_fieldset_{$html_var}")) {
26 26
         /**
27 27
          * Filter the fieldset html by individual custom field.
28 28
          *
@@ -30,18 +30,18 @@  discard block
 block discarded – undo
30 30
          * @param array $cf The custom field array.
31 31
          * @since 1.6.6
32 32
          */
33
-        $html = apply_filters("geodir_custom_field_input_fieldset_{$html_var}",$html,$cf);
33
+        $html = apply_filters("geodir_custom_field_input_fieldset_{$html_var}", $html, $cf);
34 34
     }
35 35
 
36 36
     // If no html then we run the standard output.
37
-    if(empty($html)) {
37
+    if (empty($html)) {
38 38
 
39 39
         ob_start(); // Start  buffering;
40 40
         ?>
41 41
         <h5 id="geodir_fieldset_<?php echo (int) $cf['id']; ?>" class="geodir-fieldset-row"
42 42
             gd-fieldset="<?php echo (int) $cf['id']; ?>"><?php echo $cf['site_title']; ?>
43
-            <?php if ( $cf['desc'] != '' ) {
44
-                echo '<small>( ' . $cf['desc'] . ' )</small>';
43
+            <?php if ($cf['desc'] != '') {
44
+                echo '<small>( '.$cf['desc'].' )</small>';
45 45
             } ?></h5>
46 46
         <?php
47 47
         $html = ob_get_clean();
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 
50 50
     return $html;
51 51
 }
52
-add_filter('geodir_custom_field_input_fieldset','geodir_cfi_fieldset',10,2);
52
+add_filter('geodir_custom_field_input_fieldset', 'geodir_cfi_fieldset', 10, 2);
53 53
 
54 54
 
55 55
 
@@ -62,12 +62,12 @@  discard block
 block discarded – undo
62 62
  *
63 63
  * @return string The html to output for the custom field.
64 64
  */
65
-function geodir_cfi_text($html,$cf){
65
+function geodir_cfi_text($html, $cf) {
66 66
 
67 67
     $html_var = $cf['htmlvar_name'];
68 68
 
69 69
     // Check if there is a custom field specific filter.
70
-    if(has_filter("geodir_custom_field_input_text_{$html_var}")){
70
+    if (has_filter("geodir_custom_field_input_text_{$html_var}")) {
71 71
         /**
72 72
          * Filter the text html by individual custom field.
73 73
          *
@@ -75,41 +75,41 @@  discard block
 block discarded – undo
75 75
          * @param array $cf The custom field array.
76 76
          * @since 1.6.6
77 77
          */
78
-        $html = apply_filters("geodir_custom_field_input_text_{$html_var}",$html,$cf);
78
+        $html = apply_filters("geodir_custom_field_input_text_{$html_var}", $html, $cf);
79 79
     }
80 80
 
81 81
     // If no html then we run the standard output.
82
-    if(empty($html)) {
82
+    if (empty($html)) {
83 83
 
84 84
         ob_start(); // Start  buffering;
85 85
 
86 86
         $value = geodir_get_cf_value($cf);
87 87
         $type = $cf['type'];
88 88
         //number and float validation $validation_pattern
89
-        if(isset($cf['data_type']) && $cf['data_type']=='INT'){$type = 'number';}
90
-        elseif(isset($cf['data_type']) && $cf['data_type']=='FLOAT'){$type = 'float';}
89
+        if (isset($cf['data_type']) && $cf['data_type'] == 'INT') {$type = 'number'; }
90
+        elseif (isset($cf['data_type']) && $cf['data_type'] == 'FLOAT') {$type = 'float'; }
91 91
 
92 92
         //validation
93
-        if(isset($cf['validation_pattern']) && $cf['validation_pattern']){
93
+        if (isset($cf['validation_pattern']) && $cf['validation_pattern']) {
94 94
             $validation = 'pattern="'.$cf['validation_pattern'].'"';
95
-        }else{$validation='';}
95
+        } else {$validation = ''; }
96 96
 
97 97
         // validation message
98
-        if(isset($cf['validation_msg']) && $cf['validation_msg']){
98
+        if (isset($cf['validation_msg']) && $cf['validation_msg']) {
99 99
             $validation_msg = 'title="'.$cf['validation_msg'].'"';
100
-        }else{$validation_msg='';}
100
+        } else {$validation_msg = ''; }
101 101
         ?>
102 102
 
103
-        <div id="<?php echo $cf['name'];?>_row"
104
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
103
+        <div id="<?php echo $cf['name']; ?>_row"
104
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
105 105
             <label>
106 106
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
107 107
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
108
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
108
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
109 109
             </label>
110
-            <input field_type="<?php echo $type;?>" name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>"
111
-                   value="<?php echo esc_attr(stripslashes($value));?>" type="<?php echo $type;?>" class="geodir_textfield" <?php echo $validation;echo $validation_msg;?> />
112
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
110
+            <input field_type="<?php echo $type; ?>" name="<?php echo $cf['name']; ?>" id="<?php echo $cf['name']; ?>"
111
+                   value="<?php echo esc_attr(stripslashes($value)); ?>" type="<?php echo $type; ?>" class="geodir_textfield" <?php echo $validation; echo $validation_msg; ?> />
112
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
113 113
             <?php if ($cf['is_required']) { ?>
114 114
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
115 115
             <?php } ?>
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 
122 122
     return $html;
123 123
 }
124
-add_filter('geodir_custom_field_input_text','geodir_cfi_text',10,2);
124
+add_filter('geodir_custom_field_input_text', 'geodir_cfi_text', 10, 2);
125 125
 
126 126
 
127 127
 /**
@@ -133,12 +133,12 @@  discard block
 block discarded – undo
133 133
  *
134 134
  * @return string The html to output for the custom field.
135 135
  */
136
-function geodir_cfi_email($html,$cf){
136
+function geodir_cfi_email($html, $cf) {
137 137
 
138 138
     $html_var = $cf['htmlvar_name'];
139 139
 
140 140
     // Check if there is a custom field specific filter.
141
-    if(has_filter("geodir_custom_field_input_email_{$html_var}")){
141
+    if (has_filter("geodir_custom_field_input_email_{$html_var}")) {
142 142
         /**
143 143
          * Filter the email html by individual custom field.
144 144
          *
@@ -146,11 +146,11 @@  discard block
 block discarded – undo
146 146
          * @param array $cf The custom field array.
147 147
          * @since 1.6.6
148 148
          */
149
-        $html = apply_filters("geodir_custom_field_input_email_{$html_var}",$html,$cf);
149
+        $html = apply_filters("geodir_custom_field_input_email_{$html_var}", $html, $cf);
150 150
     }
151 151
 
152 152
     // If no html then we run the standard output.
153
-    if(empty($html)) {
153
+    if (empty($html)) {
154 154
 
155 155
         ob_start(); // Start  buffering;
156 156
         $value = geodir_get_cf_value($cf);
@@ -159,16 +159,16 @@  discard block
 block discarded – undo
159 159
             $value = '';
160 160
         }?>
161 161
 
162
-        <div id="<?php echo $cf['name'];?>_row"
163
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
162
+        <div id="<?php echo $cf['name']; ?>_row"
163
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
164 164
             <label>
165 165
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
166 166
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
167
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
167
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
168 168
             </label>
169
-            <input field_type="<?php echo $cf['type'];?>" name="<?php  echo $cf['name'];?>" id="<?php echo $cf['name'];?>"
170
-                   value="<?php echo esc_attr(stripslashes($value));?>" type="email" class="geodir_textfield"/>
171
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
169
+            <input field_type="<?php echo $cf['type']; ?>" name="<?php  echo $cf['name']; ?>" id="<?php echo $cf['name']; ?>"
170
+                   value="<?php echo esc_attr(stripslashes($value)); ?>" type="email" class="geodir_textfield"/>
171
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
172 172
             <?php if ($cf['is_required']) { ?>
173 173
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
174 174
             <?php } ?>
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 
181 181
     return $html;
182 182
 }
183
-add_filter('geodir_custom_field_input_email','geodir_cfi_email',10,2);
183
+add_filter('geodir_custom_field_input_email', 'geodir_cfi_email', 10, 2);
184 184
 
185 185
 
186 186
 
@@ -193,12 +193,12 @@  discard block
 block discarded – undo
193 193
  *
194 194
  * @return string The html to output for the custom field.
195 195
  */
196
-function geodir_cfi_phone($html,$cf){
196
+function geodir_cfi_phone($html, $cf) {
197 197
 
198 198
     $html_var = $cf['htmlvar_name'];
199 199
 
200 200
     // Check if there is a custom field specific filter.
201
-    if(has_filter("geodir_custom_field_input_phone_{$html_var}")){
201
+    if (has_filter("geodir_custom_field_input_phone_{$html_var}")) {
202 202
         /**
203 203
          * Filter the phone html by individual custom field.
204 204
          *
@@ -206,11 +206,11 @@  discard block
 block discarded – undo
206 206
          * @param array $cf The custom field array.
207 207
          * @since 1.6.6
208 208
          */
209
-        $html = apply_filters("geodir_custom_field_input_phone_{$html_var}",$html,$cf);
209
+        $html = apply_filters("geodir_custom_field_input_phone_{$html_var}", $html, $cf);
210 210
     }
211 211
 
212 212
     // If no html then we run the standard output.
213
-    if(empty($html)) {
213
+    if (empty($html)) {
214 214
 
215 215
         ob_start(); // Start  buffering;
216 216
         $value = geodir_get_cf_value($cf);
@@ -219,16 +219,16 @@  discard block
 block discarded – undo
219 219
             $value = '';
220 220
         }?>
221 221
 
222
-        <div id="<?php echo $cf['name'];?>_row"
223
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
222
+        <div id="<?php echo $cf['name']; ?>_row"
223
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
224 224
             <label>
225 225
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
226 226
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
227
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
227
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
228 228
             </label>
229
-            <input field_type="<?php echo $cf['type'];?>" name="<?php  echo $cf['name'];?>" id="<?php echo $cf['name'];?>"
230
-                   value="<?php echo esc_attr(stripslashes($value));?>" type="tel" class="geodir_textfield"/>
231
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
229
+            <input field_type="<?php echo $cf['type']; ?>" name="<?php  echo $cf['name']; ?>" id="<?php echo $cf['name']; ?>"
230
+                   value="<?php echo esc_attr(stripslashes($value)); ?>" type="tel" class="geodir_textfield"/>
231
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
232 232
             <?php if ($cf['is_required']) { ?>
233 233
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
234 234
             <?php } ?>
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
 
241 241
     return $html;
242 242
 }
243
-add_filter('geodir_custom_field_input_phone','geodir_cfi_phone',10,2);
243
+add_filter('geodir_custom_field_input_phone', 'geodir_cfi_phone', 10, 2);
244 244
 
245 245
 
246 246
 
@@ -253,12 +253,12 @@  discard block
 block discarded – undo
253 253
  *
254 254
  * @return string The html to output for the custom field.
255 255
  */
256
-function geodir_cfi_url($html,$cf){
256
+function geodir_cfi_url($html, $cf) {
257 257
 
258 258
     $html_var = $cf['htmlvar_name'];
259 259
 
260 260
     // Check if there is a custom field specific filter.
261
-    if(has_filter("geodir_custom_field_input_url_{$html_var}")){
261
+    if (has_filter("geodir_custom_field_input_url_{$html_var}")) {
262 262
         /**
263 263
          * Filter the url html by individual custom field.
264 264
          *
@@ -266,11 +266,11 @@  discard block
 block discarded – undo
266 266
          * @param array $cf The custom field array.
267 267
          * @since 1.6.6
268 268
          */
269
-        $html = apply_filters("geodir_custom_field_input_url_{$html_var}",$html,$cf);
269
+        $html = apply_filters("geodir_custom_field_input_url_{$html_var}", $html, $cf);
270 270
     }
271 271
 
272 272
     // If no html then we run the standard output.
273
-    if(empty($html)) {
273
+    if (empty($html)) {
274 274
 
275 275
         ob_start(); // Start  buffering;
276 276
         $value = geodir_get_cf_value($cf);
@@ -279,19 +279,19 @@  discard block
 block discarded – undo
279 279
             $value = '';
280 280
         }?>
281 281
 
282
-        <div id="<?php echo $cf['name'];?>_row"
283
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
282
+        <div id="<?php echo $cf['name']; ?>_row"
283
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
284 284
             <label>
285 285
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
286 286
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
287
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
287
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
288 288
             </label>
289
-            <input field_type="<?php echo $cf['type'];?>" name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>"
290
-                   value="<?php echo esc_attr(stripslashes($value));?>" type="url" class="geodir_textfield"
289
+            <input field_type="<?php echo $cf['type']; ?>" name="<?php echo $cf['name']; ?>" id="<?php echo $cf['name']; ?>"
290
+                   value="<?php echo esc_attr(stripslashes($value)); ?>" type="url" class="geodir_textfield"
291 291
                    oninvalid="setCustomValidity('<?php _e('Please enter a valid URL including http://', 'geodirectory'); ?>')"
292 292
                    onchange="try{setCustomValidity('')}catch(e){}"
293 293
             />
294
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
294
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
295 295
             <?php if ($cf['is_required']) { ?>
296 296
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
297 297
             <?php } ?>
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
 
304 304
     return $html;
305 305
 }
306
-add_filter('geodir_custom_field_input_url','geodir_cfi_url',10,2);
306
+add_filter('geodir_custom_field_input_url', 'geodir_cfi_url', 10, 2);
307 307
 
308 308
 
309 309
 /**
@@ -315,12 +315,12 @@  discard block
 block discarded – undo
315 315
  *
316 316
  * @return string The html to output for the custom field.
317 317
  */
318
-function geodir_cfi_radio($html,$cf){
318
+function geodir_cfi_radio($html, $cf) {
319 319
 
320 320
     $html_var = $cf['htmlvar_name'];
321 321
 
322 322
     // Check if there is a custom field specific filter.
323
-    if(has_filter("geodir_custom_field_input_radio_{$html_var}")){
323
+    if (has_filter("geodir_custom_field_input_radio_{$html_var}")) {
324 324
         /**
325 325
          * Filter the radio html by individual custom field.
326 326
          *
@@ -328,22 +328,22 @@  discard block
 block discarded – undo
328 328
          * @param array $cf The custom field array.
329 329
          * @since 1.6.6
330 330
          */
331
-        $html = apply_filters("geodir_custom_field_input_radio_{$html_var}",$html,$cf);
331
+        $html = apply_filters("geodir_custom_field_input_radio_{$html_var}", $html, $cf);
332 332
     }
333 333
 
334 334
     // If no html then we run the standard output.
335
-    if(empty($html)) {
335
+    if (empty($html)) {
336 336
 
337 337
         ob_start(); // Start  buffering;
338 338
         $value = geodir_get_cf_value($cf);
339 339
 
340 340
         ?>
341
-        <div id="<?php echo $cf['name'];?>_row"
342
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
341
+        <div id="<?php echo $cf['name']; ?>_row"
342
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
343 343
             <label>
344 344
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
345 345
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
346
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
346
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
347 347
             </label>
348 348
             <?php if ($cf['option_values']) {
349 349
                 $option_values = geodir_string_values_to_options($cf['option_values'], true);
@@ -352,14 +352,14 @@  discard block
 block discarded – undo
352 352
                     foreach ($option_values as $option_value) {
353 353
                         if (empty($option_value['optgroup'])) {
354 354
                             ?>
355
-                            <span class="gd-radios"><input name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>" <?php checked($value, $option_value['value']);?> value="<?php echo esc_attr($option_value['value']); ?>" class="gd-checkbox" field_type="<?php echo $cf['type'];?>" type="radio" /><?php echo $option_value['label']; ?></span>
355
+                            <span class="gd-radios"><input name="<?php echo $cf['name']; ?>" id="<?php echo $cf['name']; ?>" <?php checked($value, $option_value['value']); ?> value="<?php echo esc_attr($option_value['value']); ?>" class="gd-checkbox" field_type="<?php echo $cf['type']; ?>" type="radio" /><?php echo $option_value['label']; ?></span>
356 356
                             <?php
357 357
                         }
358 358
                     }
359 359
                 }
360 360
             }
361 361
             ?>
362
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
362
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
363 363
             <?php if ($cf['is_required']) { ?>
364 364
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
365 365
             <?php } ?>
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
 
372 372
     return $html;
373 373
 }
374
-add_filter('geodir_custom_field_input_radio','geodir_cfi_radio',10,2);
374
+add_filter('geodir_custom_field_input_radio', 'geodir_cfi_radio', 10, 2);
375 375
 
376 376
 
377 377
 /**
@@ -383,12 +383,12 @@  discard block
 block discarded – undo
383 383
  *
384 384
  * @return string The html to output for the custom field.
385 385
  */
386
-function geodir_cfi_checkbox($html,$cf){
386
+function geodir_cfi_checkbox($html, $cf) {
387 387
 
388 388
     $html_var = $cf['htmlvar_name'];
389 389
 
390 390
     // Check if there is a custom field specific filter.
391
-    if(has_filter("geodir_custom_field_input_checkbox_{$html_var}")){
391
+    if (has_filter("geodir_custom_field_input_checkbox_{$html_var}")) {
392 392
         /**
393 393
          * Filter the checkbox html by individual custom field.
394 394
          *
@@ -396,11 +396,11 @@  discard block
 block discarded – undo
396 396
          * @param array $cf The custom field array.
397 397
          * @since 1.6.6
398 398
          */
399
-        $html = apply_filters("geodir_custom_field_input_checkbox_{$html_var}",$html,$cf);
399
+        $html = apply_filters("geodir_custom_field_input_checkbox_{$html_var}", $html, $cf);
400 400
     }
401 401
 
402 402
     // If no html then we run the standard output.
403
-    if(empty($html)) {
403
+    if (empty($html)) {
404 404
 
405 405
         ob_start(); // Start  buffering;
406 406
         $value = geodir_get_cf_value($cf);
@@ -409,22 +409,22 @@  discard block
 block discarded – undo
409 409
             $value = '';
410 410
         }?>
411 411
 
412
-        <div id="<?php echo $cf['name'];?>_row"
413
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
412
+        <div id="<?php echo $cf['name']; ?>_row"
413
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
414 414
             <label>
415 415
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
416 416
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
417
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
417
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
418 418
             </label>
419 419
             <?php if ($value != '1') {
420 420
                 $value = '0';
421 421
             }?>
422
-            <input type="hidden" name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>" value="<?php echo esc_attr($value);?>"/>
422
+            <input type="hidden" name="<?php echo $cf['name']; ?>" id="<?php echo $cf['name']; ?>" value="<?php echo esc_attr($value); ?>"/>
423 423
             <input  <?php if ($value == '1') {
424 424
                 echo 'checked="checked"';
425
-            }?>  value="1" class="gd-checkbox" field_type="<?php echo $cf['type'];?>" type="checkbox"
426
-                 onchange="if(this.checked){jQuery('#<?php echo $cf['name'];?>').val('1');} else{ jQuery('#<?php echo $cf['name'];?>').val('0');}"/>
427
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
425
+            }?>  value="1" class="gd-checkbox" field_type="<?php echo $cf['type']; ?>" type="checkbox"
426
+                 onchange="if(this.checked){jQuery('#<?php echo $cf['name']; ?>').val('1');} else{ jQuery('#<?php echo $cf['name']; ?>').val('0');}"/>
427
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
428 428
             <?php if ($cf['is_required']) { ?>
429 429
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
430 430
             <?php } ?>
@@ -436,7 +436,7 @@  discard block
 block discarded – undo
436 436
 
437 437
     return $html;
438 438
 }
439
-add_filter('geodir_custom_field_input_checkbox','geodir_cfi_checkbox',10,2);
439
+add_filter('geodir_custom_field_input_checkbox', 'geodir_cfi_checkbox', 10, 2);
440 440
 
441 441
 
442 442
 /**
@@ -448,12 +448,12 @@  discard block
 block discarded – undo
448 448
  *
449 449
  * @return string The html to output for the custom field.
450 450
  */
451
-function geodir_cfi_textarea($html,$cf){
451
+function geodir_cfi_textarea($html, $cf) {
452 452
 
453 453
     $html_var = $cf['htmlvar_name'];
454 454
 
455 455
     // Check if there is a custom field specific filter.
456
-    if(has_filter("geodir_custom_field_input_textarea_{$html_var}")){
456
+    if (has_filter("geodir_custom_field_input_textarea_{$html_var}")) {
457 457
         /**
458 458
          * Filter the textarea html by individual custom field.
459 459
          *
@@ -461,11 +461,11 @@  discard block
 block discarded – undo
461 461
          * @param array $cf The custom field array.
462 462
          * @since 1.6.6
463 463
          */
464
-        $html = apply_filters("geodir_custom_field_input_textarea_{$html_var}",$html,$cf);
464
+        $html = apply_filters("geodir_custom_field_input_textarea_{$html_var}", $html, $cf);
465 465
     }
466 466
 
467 467
     // If no html then we run the standard output.
468
-    if(empty($html)) {
468
+    if (empty($html)) {
469 469
 
470 470
         ob_start(); // Start  buffering;
471 471
         $value = geodir_get_cf_value($cf);
@@ -473,32 +473,32 @@  discard block
 block discarded – undo
473 473
         $extra_fields = unserialize($cf['extra_fields']);
474 474
         ?>
475 475
 
476
-        <div id="<?php echo $cf['name'];?>_row"
477
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
476
+        <div id="<?php echo $cf['name']; ?>_row"
477
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
478 478
             <label>
479 479
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
480 480
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
481
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
481
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
482 482
             </label><?php
483 483
 
484 484
 
485 485
             if (is_array($extra_fields) && in_array('1', $extra_fields)) {
486 486
 
487
-                $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);?>
487
+                $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10); ?>
488 488
 
489
-            <div class="editor" field_id="<?php echo $cf['name'];?>" field_type="editor">
489
+            <div class="editor" field_id="<?php echo $cf['name']; ?>" field_type="editor">
490 490
                 <?php wp_editor(stripslashes($value), $cf['name'], $editor_settings); ?>
491 491
                 </div><?php
492 492
 
493 493
             } else {
494 494
 
495
-                ?><textarea field_type="<?php echo $cf['type'];?>" class="geodir_textarea" name="<?php echo $cf['name'];?>"
496
-                            id="<?php echo $cf['name'];?>"><?php echo stripslashes($value);?></textarea><?php
495
+                ?><textarea field_type="<?php echo $cf['type']; ?>" class="geodir_textarea" name="<?php echo $cf['name']; ?>"
496
+                            id="<?php echo $cf['name']; ?>"><?php echo stripslashes($value); ?></textarea><?php
497 497
 
498 498
             }?>
499 499
 
500 500
 
501
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
501
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
502 502
             <?php if ($cf['is_required']) { ?>
503 503
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
504 504
             <?php } ?>
@@ -510,7 +510,7 @@  discard block
 block discarded – undo
510 510
 
511 511
     return $html;
512 512
 }
513
-add_filter('geodir_custom_field_input_textarea','geodir_cfi_textarea',10,2);
513
+add_filter('geodir_custom_field_input_textarea', 'geodir_cfi_textarea', 10, 2);
514 514
 
515 515
 
516 516
 /**
@@ -522,12 +522,12 @@  discard block
 block discarded – undo
522 522
  *
523 523
  * @return string The html to output for the custom field.
524 524
  */
525
-function geodir_cfi_select($html,$cf){
525
+function geodir_cfi_select($html, $cf) {
526 526
 
527 527
     $html_var = $cf['htmlvar_name'];
528 528
 
529 529
     // Check if there is a custom field specific filter.
530
-    if(has_filter("geodir_custom_field_input_select_{$html_var}")){
530
+    if (has_filter("geodir_custom_field_input_select_{$html_var}")) {
531 531
         /**
532 532
          * Filter the select html by individual custom field.
533 533
          *
@@ -535,22 +535,22 @@  discard block
 block discarded – undo
535 535
          * @param array $cf The custom field array.
536 536
          * @since 1.6.6
537 537
          */
538
-        $html = apply_filters("geodir_custom_field_input_select_{$html_var}",$html,$cf);
538
+        $html = apply_filters("geodir_custom_field_input_select_{$html_var}", $html, $cf);
539 539
     }
540 540
 
541 541
     // If no html then we run the standard output.
542
-    if(empty($html)) {
542
+    if (empty($html)) {
543 543
 
544 544
         ob_start(); // Start  buffering;
545 545
         $value = geodir_get_cf_value($cf);
546 546
 
547 547
         ?>
548
-        <div id="<?php echo $cf['name'];?>_row"
549
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row geodir_custom_fields clearfix gd-fieldset-details">
548
+        <div id="<?php echo $cf['name']; ?>_row"
549
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row geodir_custom_fields clearfix gd-fieldset-details">
550 550
             <label>
551 551
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
552 552
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
553
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
553
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
554 554
             </label>
555 555
             <?php
556 556
             $option_values_arr = geodir_string_values_to_options($cf['option_values'], true);
@@ -560,22 +560,22 @@  discard block
 block discarded – undo
560 560
                     if (isset($option_row['optgroup']) && ($option_row['optgroup'] == 'start' || $option_row['optgroup'] == 'end')) {
561 561
                         $option_label = isset($option_row['label']) ? $option_row['label'] : '';
562 562
 
563
-                        $select_options .= $option_row['optgroup'] == 'start' ? '<optgroup label="' . esc_attr($option_label) . '">' : '</optgroup>';
563
+                        $select_options .= $option_row['optgroup'] == 'start' ? '<optgroup label="'.esc_attr($option_label).'">' : '</optgroup>';
564 564
                     } else {
565 565
                         $option_label = isset($option_row['label']) ? $option_row['label'] : '';
566 566
                         $option_value = isset($option_row['value']) ? $option_row['value'] : '';
567 567
                         $selected = $option_value == $value ? 'selected="selected"' : '';
568 568
 
569
-                        $select_options .= '<option value="' . esc_attr($option_value) . '" ' . $selected . '>' . $option_label . '</option>';
569
+                        $select_options .= '<option value="'.esc_attr($option_value).'" '.$selected.'>'.$option_label.'</option>';
570 570
                     }
571 571
                 }
572 572
             }
573 573
             ?>
574
-            <select field_type="<?php echo $cf['type'];?>" name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>"
574
+            <select field_type="<?php echo $cf['type']; ?>" name="<?php echo $cf['name']; ?>" id="<?php echo $cf['name']; ?>"
575 575
                     class="geodir_textfield textfield_x chosen_select"
576
-                    data-placeholder="<?php echo __('Choose', 'geodirectory') . ' ' . $site_title . '&hellip;';?>"
577
-                    option-ajaxchosen="false"><?php echo $select_options;?></select>
578
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
576
+                    data-placeholder="<?php echo __('Choose', 'geodirectory').' '.$site_title.'&hellip;'; ?>"
577
+                    option-ajaxchosen="false"><?php echo $select_options; ?></select>
578
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
579 579
             <?php if ($cf['is_required']) { ?>
580 580
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
581 581
             <?php } ?>
@@ -587,7 +587,7 @@  discard block
 block discarded – undo
587 587
 
588 588
     return $html;
589 589
 }
590
-add_filter('geodir_custom_field_input_select','geodir_cfi_select',10,2);
590
+add_filter('geodir_custom_field_input_select', 'geodir_cfi_select', 10, 2);
591 591
 
592 592
 
593 593
 /**
@@ -599,12 +599,12 @@  discard block
 block discarded – undo
599 599
  *
600 600
  * @return string The html to output for the custom field.
601 601
  */
602
-function geodir_cfi_multiselect($html,$cf){
602
+function geodir_cfi_multiselect($html, $cf) {
603 603
 
604 604
     $html_var = $cf['htmlvar_name'];
605 605
 
606 606
     // Check if there is a custom field specific filter.
607
-    if(has_filter("geodir_custom_field_input_multiselect_{$html_var}")){
607
+    if (has_filter("geodir_custom_field_input_multiselect_{$html_var}")) {
608 608
         /**
609 609
          * Filter the multiselect html by individual custom field.
610 610
          *
@@ -612,11 +612,11 @@  discard block
 block discarded – undo
612 612
          * @param array $cf The custom field array.
613 613
          * @since 1.6.6
614 614
          */
615
-        $html = apply_filters("geodir_custom_field_input_multiselect_{$html_var}",$html,$cf);
615
+        $html = apply_filters("geodir_custom_field_input_multiselect_{$html_var}", $html, $cf);
616 616
     }
617 617
 
618 618
     // If no html then we run the standard output.
619
-    if(empty($html)) {
619
+    if (empty($html)) {
620 620
 
621 621
         ob_start(); // Start  buffering;
622 622
         $value = geodir_get_cf_value($cf);
@@ -653,9 +653,9 @@  discard block
 block discarded – undo
653 653
                                 $option_label = isset($option_row['label']) ? $option_row['label'] : '';
654 654
 
655 655
                                 if ($multi_display == 'select') {
656
-                                    $select_options .= $option_row['optgroup'] == 'start' ? '<optgroup label="' . esc_attr($option_label) . '">' : '</optgroup>';
656
+                                    $select_options .= $option_row['optgroup'] == 'start' ? '<optgroup label="'.esc_attr($option_label).'">' : '</optgroup>';
657 657
                                 } else {
658
-                                    $select_options .= $option_row['optgroup'] == 'start' ? '<li>' . $option_label . '</li>' : '';
658
+                                    $select_options .= $option_row['optgroup'] == 'start' ? '<li>'.$option_label.'</li>' : '';
659 659
                                 }
660 660
                             } else {
661 661
                                 $option_label = isset($option_row['label']) ? $option_row['label'] : '';
@@ -680,9 +680,9 @@  discard block
 block discarded – undo
680 680
                                 }
681 681
 
682 682
                                 if ($multi_display == 'select') {
683
-                                    $select_options .= '<option value="' . esc_attr($option_value) . '" ' . $selected . '>' . $option_label . '</option>';
683
+                                    $select_options .= '<option value="'.esc_attr($option_value).'" '.$selected.'>'.$option_label.'</option>';
684 684
                                 } else {
685
-                                    $select_options .= '<li><input name="' . $cf['name'] . '[]" ' . $checked . ' value="' . esc_attr($option_value) . '" class="gd-' . $multi_display . '" field_type="' . $multi_display . '" type="' . $multi_display . '" />&nbsp;' . $option_label . ' </li>';
685
+                                    $select_options .= '<li><input name="'.$cf['name'].'[]" '.$checked.' value="'.esc_attr($option_value).'" class="gd-'.$multi_display.'" field_type="'.$multi_display.'" type="'.$multi_display.'" />&nbsp;'.$option_label.' </li>';
686 686
                                 }
687 687
                             }
688 688
                         }
@@ -702,7 +702,7 @@  discard block
 block discarded – undo
702 702
 
703 703
     return $html;
704 704
 }
705
-add_filter('geodir_custom_field_input_multiselect','geodir_cfi_multiselect',10,2);
705
+add_filter('geodir_custom_field_input_multiselect', 'geodir_cfi_multiselect', 10, 2);
706 706
 
707 707
 
708 708
 /**
@@ -714,12 +714,12 @@  discard block
 block discarded – undo
714 714
  *
715 715
  * @return string The html to output for the custom field.
716 716
  */
717
-function geodir_cfi_html($html,$cf){
717
+function geodir_cfi_html($html, $cf) {
718 718
 
719 719
     $html_var = $cf['htmlvar_name'];
720 720
 
721 721
     // Check if there is a custom field specific filter.
722
-    if(has_filter("geodir_custom_field_input_html_{$html_var}")){
722
+    if (has_filter("geodir_custom_field_input_html_{$html_var}")) {
723 723
         /**
724 724
          * Filter the html html by individual custom field.
725 725
          *
@@ -727,11 +727,11 @@  discard block
 block discarded – undo
727 727
          * @param array $cf The custom field array.
728 728
          * @since 1.6.6
729 729
          */
730
-        $html = apply_filters("geodir_custom_field_input_html_{$html_var}",$html,$cf);
730
+        $html = apply_filters("geodir_custom_field_input_html_{$html_var}", $html, $cf);
731 731
     }
732 732
 
733 733
     // If no html then we run the standard output.
734
-    if(empty($html)) {
734
+    if (empty($html)) {
735 735
 
736 736
         ob_start(); // Start  buffering;
737 737
         $value = geodir_get_cf_value($cf);
@@ -764,7 +764,7 @@  discard block
 block discarded – undo
764 764
 
765 765
     return $html;
766 766
 }
767
-add_filter('geodir_custom_field_input_html','geodir_cfi_html',10,2);
767
+add_filter('geodir_custom_field_input_html', 'geodir_cfi_html', 10, 2);
768 768
 
769 769
 
770 770
 
@@ -777,12 +777,12 @@  discard block
 block discarded – undo
777 777
  *
778 778
  * @return string The html to output for the custom field.
779 779
  */
780
-function geodir_cfi_datepicker($html,$cf){
780
+function geodir_cfi_datepicker($html, $cf) {
781 781
 
782 782
     $html_var = $cf['htmlvar_name'];
783 783
 
784 784
     // Check if there is a custom field specific filter.
785
-    if(has_filter("geodir_custom_field_input_datepicker_{$html_var}")){
785
+    if (has_filter("geodir_custom_field_input_datepicker_{$html_var}")) {
786 786
         /**
787 787
          * Filter the datepicker html by individual custom field.
788 788
          *
@@ -790,11 +790,11 @@  discard block
 block discarded – undo
790 790
          * @param array $cf The custom field array.
791 791
          * @since 1.6.6
792 792
          */
793
-        $html = apply_filters("geodir_custom_field_input_datepicker_{$html_var}",$html,$cf);
793
+        $html = apply_filters("geodir_custom_field_input_datepicker_{$html_var}", $html, $cf);
794 794
     }
795 795
 
796 796
     // If no html then we run the standard output.
797
-    if(empty($html)) {
797
+    if (empty($html)) {
798 798
 
799 799
         ob_start(); // Start  buffering;
800 800
         $value = geodir_get_cf_value($cf);
@@ -806,23 +806,23 @@  discard block
 block discarded – undo
806 806
             $extra_fields['date_format'] = 'yy-mm-dd';
807 807
 
808 808
         $date_format = $extra_fields['date_format'];
809
-        $jquery_date_format  = $date_format;
809
+        $jquery_date_format = $date_format;
810 810
 
811 811
 
812 812
         // check if we need to change the format or not
813 813
         $date_format_len = strlen(str_replace(' ', '', $date_format));
814
-        if($date_format_len>5){// if greater then 5 then it's the old style format.
814
+        if ($date_format_len > 5) {// if greater then 5 then it's the old style format.
815 815
 
816
-            $search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format
817
-            $replace = array('d','j','l','m','n','F','Y');//PHP date format
816
+            $search = array('dd', 'd', 'DD', 'mm', 'm', 'MM', 'yy'); //jQuery UI datepicker format
817
+            $replace = array('d', 'j', 'l', 'm', 'n', 'F', 'Y'); //PHP date format
818 818
 
819 819
             $date_format = str_replace($search, $replace, $date_format);
820
-        }else{
821
-            $jquery_date_format = geodir_date_format_php_to_jqueryui( $jquery_date_format );
820
+        } else {
821
+            $jquery_date_format = geodir_date_format_php_to_jqueryui($jquery_date_format);
822 822
         }
823 823
 
824
-        if($value=='0000-00-00'){$value='';}//if date not set, then mark it empty
825
-        if($value && !isset($_REQUEST['backandedit'])) {
824
+        if ($value == '0000-00-00') {$value = ''; }//if date not set, then mark it empty
825
+        if ($value && !isset($_REQUEST['backandedit'])) {
826 826
             //$time = strtotime($value);
827 827
             //$value = date_i18n($date_format, $time);
828 828
         }
@@ -833,37 +833,37 @@  discard block
 block discarded – undo
833 833
 
834 834
             jQuery(function () {
835 835
 
836
-                jQuery("#<?php echo $cf['name'];?>").datepicker({changeMonth: true, changeYear: true <?php
836
+                jQuery("#<?php echo $cf['name']; ?>").datepicker({changeMonth: true, changeYear: true <?php
837 837
                     /**
838 838
                      * Used to add extra option to datepicker per custom field.
839 839
                      *
840 840
                      * @since 1.5.7
841 841
                      * @param string $name The custom field name.
842 842
                      */
843
-                    echo apply_filters("gd_datepicker_extra_{$name}",'');?>});
843
+                    echo apply_filters("gd_datepicker_extra_{$name}", ''); ?>});
844 844
 
845
-                jQuery("#<?php echo $name;?>").datepicker("option", "dateFormat", '<?php echo $jquery_date_format;?>');
845
+                jQuery("#<?php echo $name; ?>").datepicker("option", "dateFormat", '<?php echo $jquery_date_format; ?>');
846 846
 
847
-                <?php if(!empty($value)){?>
848
-                jQuery("#<?php echo $name;?>").datepicker("setDate", '<?php echo $value;?>');
847
+                <?php if (!empty($value)) {?>
848
+                jQuery("#<?php echo $name; ?>").datepicker("setDate", '<?php echo $value; ?>');
849 849
                 <?php } ?>
850 850
 
851 851
             });
852 852
 
853 853
         </script>
854
-        <div id="<?php echo $name;?>_row"
855
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
854
+        <div id="<?php echo $name; ?>_row"
855
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
856 856
             <label>
857 857
 
858 858
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
859 859
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
860
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
860
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
861 861
             </label>
862 862
 
863
-            <input field_type="<?php echo $cf['type'];?>" name="<?php echo $name;?>" id="<?php echo $name;?>"
864
-                   value="<?php echo esc_attr($value);?>" type="text" class="geodir_textfield"/>
863
+            <input field_type="<?php echo $cf['type']; ?>" name="<?php echo $name; ?>" id="<?php echo $name; ?>"
864
+                   value="<?php echo esc_attr($value); ?>" type="text" class="geodir_textfield"/>
865 865
 
866
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
866
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
867 867
             <?php if ($cf['is_required']) { ?>
868 868
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
869 869
             <?php } ?>
@@ -875,7 +875,7 @@  discard block
 block discarded – undo
875 875
 
876 876
     return $html;
877 877
 }
878
-add_filter('geodir_custom_field_input_datepicker','geodir_cfi_datepicker',10,2);
878
+add_filter('geodir_custom_field_input_datepicker', 'geodir_cfi_datepicker', 10, 2);
879 879
 
880 880
 
881 881
 /**
@@ -887,12 +887,12 @@  discard block
 block discarded – undo
887 887
  *
888 888
  * @return string The html to output for the custom field.
889 889
  */
890
-function geodir_cfi_time($html,$cf){
890
+function geodir_cfi_time($html, $cf) {
891 891
 
892 892
     $html_var = $cf['htmlvar_name'];
893 893
 
894 894
     // Check if there is a custom field specific filter.
895
-    if(has_filter("geodir_custom_field_input_time_{$html_var}")){
895
+    if (has_filter("geodir_custom_field_input_time_{$html_var}")) {
896 896
         /**
897 897
          * Filter the time html by individual custom field.
898 898
          *
@@ -900,11 +900,11 @@  discard block
 block discarded – undo
900 900
          * @param array $cf The custom field array.
901 901
          * @since 1.6.6
902 902
          */
903
-        $html = apply_filters("geodir_custom_field_input_time_{$html_var}",$html,$cf);
903
+        $html = apply_filters("geodir_custom_field_input_time_{$html_var}", $html, $cf);
904 904
     }
905 905
 
906 906
     // If no html then we run the standard output.
907
-    if(empty($html)) {
907
+    if (empty($html)) {
908 908
 
909 909
         ob_start(); // Start  buffering;
910 910
         $value = geodir_get_cf_value($cf);
@@ -917,25 +917,25 @@  discard block
 block discarded – undo
917 917
         <script type="text/javascript">
918 918
             jQuery(document).ready(function () {
919 919
 
920
-                jQuery('#<?php echo $name;?>').timepicker({
920
+                jQuery('#<?php echo $name; ?>').timepicker({
921 921
                     showPeriod: true,
922 922
                     showLeadingZero: true,
923 923
                     showPeriod: true,
924 924
                 });
925 925
             });
926 926
         </script>
927
-        <div id="<?php echo $name;?>_row"
928
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
927
+        <div id="<?php echo $name; ?>_row"
928
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
929 929
             <label>
930 930
 
931 931
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
932 932
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
933
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
933
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
934 934
             </label>
935
-            <input readonly="readonly" field_type="<?php echo $cf['type'];?>" name="<?php echo $name;?>"
936
-                   id="<?php echo $name;?>" value="<?php echo esc_attr($value);?>" type="text" class="geodir_textfield"/>
935
+            <input readonly="readonly" field_type="<?php echo $cf['type']; ?>" name="<?php echo $name; ?>"
936
+                   id="<?php echo $name; ?>" value="<?php echo esc_attr($value); ?>" type="text" class="geodir_textfield"/>
937 937
 
938
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
938
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
939 939
             <?php if ($cf['is_required']) { ?>
940 940
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
941 941
             <?php } ?>
@@ -946,7 +946,7 @@  discard block
 block discarded – undo
946 946
 
947 947
     return $html;
948 948
 }
949
-add_filter('geodir_custom_field_input_time','geodir_cfi_time',10,2);
949
+add_filter('geodir_custom_field_input_time', 'geodir_cfi_time', 10, 2);
950 950
 
951 951
 
952 952
 /**
@@ -958,12 +958,12 @@  discard block
 block discarded – undo
958 958
  *
959 959
  * @return string The html to output for the custom field.
960 960
  */
961
-function geodir_cfi_address($html,$cf){
961
+function geodir_cfi_address($html, $cf) {
962 962
 
963 963
     $html_var = $cf['htmlvar_name'];
964 964
 
965 965
     // Check if there is a custom field specific filter.
966
-    if(has_filter("geodir_custom_field_input_address_{$html_var}")){
966
+    if (has_filter("geodir_custom_field_input_address_{$html_var}")) {
967 967
         /**
968 968
          * Filter the address html by individual custom field.
969 969
          *
@@ -971,11 +971,11 @@  discard block
 block discarded – undo
971 971
          * @param array $cf The custom field array.
972 972
          * @since 1.6.6
973 973
          */
974
-        $html = apply_filters("geodir_custom_field_input_address_{$html_var}",$html,$cf);
974
+        $html = apply_filters("geodir_custom_field_input_address_{$html_var}", $html, $cf);
975 975
     }
976 976
 
977 977
     // If no html then we run the standard output.
978
-    if(empty($html)) {
978
+    if (empty($html)) {
979 979
 
980 980
         global $gd_session;
981 981
         ob_start(); // Start  buffering;
@@ -988,12 +988,12 @@  discard block
 block discarded – undo
988 988
         $site_title = $cf['site_title'];
989 989
         $is_admin = $cf['is_admin'];
990 990
         $extra_fields = unserialize($cf['extra_fields']);
991
-        $prefix = $name . '_';
991
+        $prefix = $name.'_';
992 992
 
993
-        ($site_title != '') ? $address_title = $site_title : $address_title = geodir_ucwords($prefix . ' address');
994
-        ($extra_fields['zip_lable'] != '') ? $zip_title = $extra_fields['zip_lable'] : $zip_title = geodir_ucwords($prefix . ' zip/post code ');
993
+        ($site_title != '') ? $address_title = $site_title : $address_title = geodir_ucwords($prefix.' address');
994
+        ($extra_fields['zip_lable'] != '') ? $zip_title = $extra_fields['zip_lable'] : $zip_title = geodir_ucwords($prefix.' zip/post code ');
995 995
         ($extra_fields['map_lable'] != '') ? $map_title = $extra_fields['map_lable'] : $map_title = geodir_ucwords('set address on map');
996
-        ($extra_fields['mapview_lable'] != '') ? $mapview_title = $extra_fields['mapview_lable'] : $mapview_title = geodir_ucwords($prefix . ' mapview');
996
+        ($extra_fields['mapview_lable'] != '') ? $mapview_title = $extra_fields['mapview_lable'] : $mapview_title = geodir_ucwords($prefix.' mapview');
997 997
 
998 998
         $address = '';
999 999
         $zip = '';
@@ -1004,21 +1004,21 @@  discard block
 block discarded – undo
1004 1004
 
1005 1005
         if (isset($_REQUEST['backandedit']) && $_REQUEST['backandedit'] && $gd_ses_listing = $gd_session->get('listing')) {
1006 1006
             $post = $gd_ses_listing;
1007
-            $address = $post[$prefix . 'address'];
1008
-            $zip = isset($post[$prefix . 'zip']) ? $post[$prefix . 'zip'] : '';
1009
-            $lat = isset($post[$prefix . 'latitude']) ? $post[$prefix . 'latitude'] : '';
1010
-            $lng = isset($post[$prefix . 'longitude']) ? $post[$prefix . 'longitude'] : '';
1011
-            $mapview = isset($post[$prefix . 'mapview']) ? $post[$prefix . 'mapview'] : '';
1012
-            $mapzoom = isset($post[$prefix . 'mapzoom']) ? $post[$prefix . 'mapzoom'] : '';
1007
+            $address = $post[$prefix.'address'];
1008
+            $zip = isset($post[$prefix.'zip']) ? $post[$prefix.'zip'] : '';
1009
+            $lat = isset($post[$prefix.'latitude']) ? $post[$prefix.'latitude'] : '';
1010
+            $lng = isset($post[$prefix.'longitude']) ? $post[$prefix.'longitude'] : '';
1011
+            $mapview = isset($post[$prefix.'mapview']) ? $post[$prefix.'mapview'] : '';
1012
+            $mapzoom = isset($post[$prefix.'mapzoom']) ? $post[$prefix.'mapzoom'] : '';
1013 1013
         } else if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '' && $post_info = geodir_get_post_info($_REQUEST['pid'])) {
1014
-            $post_info = (array)$post_info;
1015
-
1016
-            $address = $post_info[$prefix . 'address'];
1017
-            $zip = isset($post_info[$prefix . 'zip']) ? $post_info[$prefix . 'zip'] : '';
1018
-            $lat = isset($post_info[$prefix . 'latitude']) ? $post_info[$prefix . 'latitude'] : '';
1019
-            $lng = isset($post_info[$prefix . 'longitude']) ? $post_info[$prefix . 'longitude'] : '';
1020
-            $mapview = isset($post_info[$prefix . 'mapview']) ? $post_info[$prefix . 'mapview'] : '';
1021
-            $mapzoom = isset($post_info[$prefix . 'mapzoom']) ? $post_info[$prefix . 'mapzoom'] : '';
1014
+            $post_info = (array) $post_info;
1015
+
1016
+            $address = $post_info[$prefix.'address'];
1017
+            $zip = isset($post_info[$prefix.'zip']) ? $post_info[$prefix.'zip'] : '';
1018
+            $lat = isset($post_info[$prefix.'latitude']) ? $post_info[$prefix.'latitude'] : '';
1019
+            $lng = isset($post_info[$prefix.'longitude']) ? $post_info[$prefix.'longitude'] : '';
1020
+            $mapview = isset($post_info[$prefix.'mapview']) ? $post_info[$prefix.'mapview'] : '';
1021
+            $mapzoom = isset($post_info[$prefix.'mapzoom']) ? $post_info[$prefix.'mapzoom'] : '';
1022 1022
         }
1023 1023
 
1024 1024
         $location = geodir_get_default_location();
@@ -1055,16 +1055,16 @@  discard block
 block discarded – undo
1055 1055
 
1056 1056
         ?>
1057 1057
 
1058
-        <div id="geodir_<?php echo $prefix . 'address';?>_row"
1059
-             class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
1058
+        <div id="geodir_<?php echo $prefix.'address'; ?>_row"
1059
+             class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
1060 1060
             <label>
1061 1061
                 <?php _e($address_title, 'geodirectory'); ?>
1062
-                <?php if ($is_required) echo '<span>*</span>';?>
1062
+                <?php if ($is_required) echo '<span>*</span>'; ?>
1063 1063
             </label>
1064
-            <input type="text" field_type="<?php echo $type;?>" name="<?php echo $prefix . 'address';?>"
1065
-                   id="<?php echo $prefix . 'address';?>" class="geodir_textfield"
1064
+            <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix.'address'; ?>"
1065
+                   id="<?php echo $prefix.'address'; ?>" class="geodir_textfield"
1066 1066
                    value="<?php echo esc_attr(stripslashes($address)); ?>"/>
1067
-            <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory');?></span>
1067
+            <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory'); ?></span>
1068 1068
             <?php if ($is_required) { ?>
1069 1069
                 <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span>
1070 1070
             <?php } ?>
@@ -1084,14 +1084,14 @@  discard block
 block discarded – undo
1084 1084
 
1085 1085
         if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) { ?>
1086 1086
 
1087
-            <div id="geodir_<?php echo $prefix . 'zip'; ?>_row"
1087
+            <div id="geodir_<?php echo $prefix.'zip'; ?>_row"
1088 1088
                  class="<?php /*if($is_required) echo 'required_field';*/ ?> geodir_form_row clearfix gd-fieldset-details">
1089 1089
                 <label>
1090 1090
                     <?php _e($zip_title, 'geodirectory'); ?>
1091 1091
                     <?php /*if($is_required) echo '<span>*</span>';*/ ?>
1092 1092
                 </label>
1093
-                <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix . 'zip'; ?>"
1094
-                       id="<?php echo $prefix . 'zip'; ?>" class="geodir_textfield autofill"
1093
+                <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix.'zip'; ?>"
1094
+                       id="<?php echo $prefix.'zip'; ?>" class="geodir_textfield autofill"
1095 1095
                        value="<?php echo esc_attr(stripslashes($zip)); ?>"/>
1096 1096
                 <?php /*if($is_required) {?>
1097 1097
 					<span class="geodir_message_error"><?php echo _e($required_msg,'geodirectory');?></span>
@@ -1101,14 +1101,14 @@  discard block
 block discarded – undo
1101 1101
 
1102 1102
         <?php if (isset($extra_fields['show_map']) && $extra_fields['show_map']) { ?>
1103 1103
 
1104
-            <div id="geodir_<?php echo $prefix . 'map'; ?>_row" class="geodir_form_row clearfix gd-fieldset-details">
1104
+            <div id="geodir_<?php echo $prefix.'map'; ?>_row" class="geodir_form_row clearfix gd-fieldset-details">
1105 1105
                 <?php
1106 1106
                 /**
1107 1107
                  * Contains add listing page map functions.
1108 1108
                  *
1109 1109
                  * @since 1.0.0
1110 1110
                  */
1111
-                include(geodir_plugin_path() . "/geodirectory-functions/map-functions/map_on_add_listing_page.php");
1111
+                include(geodir_plugin_path()."/geodirectory-functions/map-functions/map_on_add_listing_page.php");
1112 1112
                 if ($lat_lng_blank) {
1113 1113
                     $lat = '';
1114 1114
                     $lng = '';
@@ -1119,14 +1119,14 @@  discard block
 block discarded – undo
1119 1119
             <?php
1120 1120
             /* show lat lng */
1121 1121
             $style_latlng = ((isset($extra_fields['show_latlng']) && $extra_fields['show_latlng']) || is_admin()) ? '' : 'style="display:none"'; ?>
1122
-            <div id="geodir_<?php echo $prefix . 'latitude'; ?>_row"
1122
+            <div id="geodir_<?php echo $prefix.'latitude'; ?>_row"
1123 1123
                  class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details" <?php echo $style_latlng; ?>>
1124 1124
                 <label>
1125 1125
                     <?php echo PLACE_ADDRESS_LAT; ?>
1126 1126
                     <?php if ($is_required) echo '<span>*</span>'; ?>
1127 1127
                 </label>
1128
-                <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix . 'latitude'; ?>"
1129
-                       id="<?php echo $prefix . 'latitude'; ?>" class="geodir_textfield"
1128
+                <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix.'latitude'; ?>"
1129
+                       id="<?php echo $prefix.'latitude'; ?>" class="geodir_textfield"
1130 1130
                        value="<?php echo esc_attr(stripslashes($lat)); ?>" size="25"/>
1131 1131
                 <span class="geodir_message_note"><?php echo GET_LATITUDE_MSG; ?></span>
1132 1132
                 <?php if ($is_required) { ?>
@@ -1134,14 +1134,14 @@  discard block
 block discarded – undo
1134 1134
                 <?php } ?>
1135 1135
             </div>
1136 1136
 
1137
-            <div id="geodir_<?php echo $prefix . 'longitude'; ?>_row"
1137
+            <div id="geodir_<?php echo $prefix.'longitude'; ?>_row"
1138 1138
                  class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details" <?php echo $style_latlng; ?>>
1139 1139
                 <label>
1140 1140
                     <?php echo PLACE_ADDRESS_LNG; ?>
1141 1141
                     <?php if ($is_required) echo '<span>*</span>'; ?>
1142 1142
                 </label>
1143
-                <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix . 'longitude'; ?>"
1144
-                       id="<?php echo $prefix . 'longitude'; ?>" class="geodir_textfield"
1143
+                <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix.'longitude'; ?>"
1144
+                       id="<?php echo $prefix.'longitude'; ?>" class="geodir_textfield"
1145 1145
                        value="<?php echo esc_attr(stripslashes($lng)); ?>" size="25"/>
1146 1146
                 <span class="geodir_message_note"><?php echo GET_LOGNGITUDE_MSG; ?></span>
1147 1147
                 <?php if ($is_required) { ?>
@@ -1151,32 +1151,32 @@  discard block
 block discarded – undo
1151 1151
         <?php } ?>
1152 1152
 
1153 1153
         <?php if (isset($extra_fields['show_mapview']) && $extra_fields['show_mapview']) { ?>
1154
-            <div id="geodir_<?php echo $prefix . 'mapview'; ?>_row" class="geodir_form_row clearfix gd-fieldset-details">
1154
+            <div id="geodir_<?php echo $prefix.'mapview'; ?>_row" class="geodir_form_row clearfix gd-fieldset-details">
1155 1155
                 <label><?php _e($mapview_title, 'geodirectory'); ?></label>
1156 1156
 
1157 1157
 
1158 1158
                     <span class="geodir_user_define"><input field_type="<?php echo $type; ?>" type="radio"
1159 1159
                                                             class="gd-checkbox"
1160
-                                                            name="<?php echo $prefix . 'mapview'; ?>"
1161
-                                                            id="<?php echo $prefix . 'mapview'; ?>" <?php if ($mapview == 'ROADMAP' || $mapview == '') {
1160
+                                                            name="<?php echo $prefix.'mapview'; ?>"
1161
+                                                            id="<?php echo $prefix.'mapview'; ?>" <?php if ($mapview == 'ROADMAP' || $mapview == '') {
1162 1162
                             echo 'checked="checked"';
1163 1163
                         } ?>  value="ROADMAP" size="25"/> <?php _e('Default Map', 'geodirectory'); ?></span>
1164 1164
                     <span class="geodir_user_define"> <input field_type="<?php echo $type; ?>" type="radio"
1165 1165
                                                              class="gd-checkbox"
1166
-                                                             name="<?php echo $prefix . 'mapview'; ?>"
1166
+                                                             name="<?php echo $prefix.'mapview'; ?>"
1167 1167
                                                              id="map_view1" <?php if ($mapview == 'SATELLITE') {
1168 1168
                             echo 'checked="checked"';
1169 1169
                         } ?> value="SATELLITE" size="25"/> <?php _e('Satellite Map', 'geodirectory'); ?></span>
1170 1170
 
1171 1171
                     <span class="geodir_user_define"><input field_type="<?php echo $type; ?>" type="radio"
1172 1172
                                                             class="gd-checkbox"
1173
-                                                            name="<?php echo $prefix . 'mapview'; ?>"
1173
+                                                            name="<?php echo $prefix.'mapview'; ?>"
1174 1174
                                                             id="map_view2" <?php if ($mapview == 'HYBRID') {
1175 1175
                             echo 'checked="checked"';
1176 1176
                         } ?>  value="HYBRID" size="25"/> <?php _e('Hybrid Map', 'geodirectory'); ?></span>
1177 1177
 					<span class="geodir_user_define"><input field_type="<?php echo $type; ?>" type="radio"
1178 1178
                                                             class="gd-checkbox"
1179
-                                                            name="<?php echo $prefix . 'mapview'; ?>"
1179
+                                                            name="<?php echo $prefix.'mapview'; ?>"
1180 1180
                                                             id="map_view3" <?php if ($mapview == 'TERRAIN') {
1181 1181
                             echo 'checked="checked"';
1182 1182
                         } ?>  value="TERRAIN" size="25"/> <?php _e('Terrain Map', 'geodirectory'); ?></span>
@@ -1188,7 +1188,7 @@  discard block
 block discarded – undo
1188 1188
         <?php if (isset($extra_fields['show_mapzoom']) && $extra_fields['show_mapzoom']) { ?>
1189 1189
             <input type="hidden" value="<?php if (isset($mapzoom)) {
1190 1190
                 echo esc_attr($mapzoom);
1191
-            } ?>" name="<?php echo $prefix . 'mapzoom'; ?>" id="<?php echo $prefix . 'mapzoom'; ?>"/>
1191
+            } ?>" name="<?php echo $prefix.'mapzoom'; ?>" id="<?php echo $prefix.'mapzoom'; ?>"/>
1192 1192
         <?php }
1193 1193
 
1194 1194
         $html = ob_get_clean();
@@ -1196,7 +1196,7 @@  discard block
 block discarded – undo
1196 1196
 
1197 1197
     return $html;
1198 1198
 }
1199
-add_filter('geodir_custom_field_input_address','geodir_cfi_address',10,2);
1199
+add_filter('geodir_custom_field_input_address', 'geodir_cfi_address', 10, 2);
1200 1200
 
1201 1201
 
1202 1202
 
@@ -1209,12 +1209,12 @@  discard block
 block discarded – undo
1209 1209
  *
1210 1210
  * @return string The html to output for the custom field.
1211 1211
  */
1212
-function geodir_cfi_taxonomy($html,$cf){
1212
+function geodir_cfi_taxonomy($html, $cf) {
1213 1213
 
1214 1214
     $html_var = $cf['htmlvar_name'];
1215 1215
 
1216 1216
     // Check if there is a custom field specific filter.
1217
-    if(has_filter("geodir_custom_field_input_taxonomy_{$html_var}")){
1217
+    if (has_filter("geodir_custom_field_input_taxonomy_{$html_var}")) {
1218 1218
         /**
1219 1219
          * Filter the taxonomy html by individual custom field.
1220 1220
          *
@@ -1222,11 +1222,11 @@  discard block
 block discarded – undo
1222 1222
          * @param array $cf The custom field array.
1223 1223
          * @since 1.6.6
1224 1224
          */
1225
-        $html = apply_filters("geodir_custom_field_input_taxonomy_{$html_var}",$html,$cf);
1225
+        $html = apply_filters("geodir_custom_field_input_taxonomy_{$html_var}", $html, $cf);
1226 1226
     }
1227 1227
 
1228 1228
     // If no html then we run the standard output.
1229
-    if(empty($html)) {
1229
+    if (empty($html)) {
1230 1230
 
1231 1231
         ob_start(); // Start  buffering;
1232 1232
         $value = geodir_get_cf_value($cf);
@@ -1241,15 +1241,15 @@  discard block
 block discarded – undo
1241 1241
         if ($value == $cf['default']) {
1242 1242
             $value = '';
1243 1243
         } ?>
1244
-        <div id="<?php echo $name;?>_row"
1245
-             class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
1244
+        <div id="<?php echo $name; ?>_row"
1245
+             class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
1246 1246
             <label>
1247 1247
                 <?php $site_title = __($site_title, 'geodirectory');
1248 1248
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
1249
-                <?php if ($is_required) echo '<span>*</span>';?>
1249
+                <?php if ($is_required) echo '<span>*</span>'; ?>
1250 1250
             </label>
1251 1251
 
1252
-            <div id="<?php echo $name;?>" class="geodir_taxonomy_field" style="float:left; width:70%;">
1252
+            <div id="<?php echo $name; ?>" class="geodir_taxonomy_field" style="float:left; width:70%;">
1253 1253
                 <?php
1254 1254
                 global $wpdb, $post, $cat_display, $post_cat, $package_id, $exclude_cats;
1255 1255
 
@@ -1261,7 +1261,7 @@  discard block
 block discarded – undo
1261 1261
 
1262 1262
                     $package_info = array();
1263 1263
 
1264
-                    $package_info = (array)geodir_post_package_info($package_info, $post, $post_type);
1264
+                    $package_info = (array) geodir_post_package_info($package_info, $post, $post_type);
1265 1265
 
1266 1266
                     if (!empty($package_info)) {
1267 1267
 
@@ -1290,7 +1290,7 @@  discard block
 block discarded – undo
1290 1290
 
1291 1291
                     $catadd_limit = $wpdb->get_var(
1292 1292
                         $wpdb->prepare(
1293
-                            "SELECT cat_limit FROM " . GEODIR_PRICE_TABLE . " WHERE pid = %d",
1293
+                            "SELECT cat_limit FROM ".GEODIR_PRICE_TABLE." WHERE pid = %d",
1294 1294
                             array($package_id)
1295 1295
                         )
1296 1296
                     );
@@ -1306,13 +1306,13 @@  discard block
 block discarded – undo
1306 1306
                     $required_limit_msg = '';
1307 1307
                     if ($catadd_limit > 0 && $cat_display != 'select' && $cat_display != 'radio') {
1308 1308
 
1309
-                        $required_limit_msg = __('Only select', 'geodirectory') . ' ' . $catadd_limit . __(' categories for this package.', 'geodirectory');
1309
+                        $required_limit_msg = __('Only select', 'geodirectory').' '.$catadd_limit.__(' categories for this package.', 'geodirectory');
1310 1310
 
1311 1311
                     } else {
1312 1312
                         $required_limit_msg = $required_msg;
1313 1313
                     }
1314 1314
 
1315
-                    echo '<input type="hidden" cat_limit="' . $catadd_limit . '" id="cat_limit" value="' . esc_attr($required_limit_msg) . '" name="cat_limit[' . $name . ']"  />';
1315
+                    echo '<input type="hidden" cat_limit="'.$catadd_limit.'" id="cat_limit" value="'.esc_attr($required_limit_msg).'" name="cat_limit['.$name.']"  />';
1316 1316
 
1317 1317
 
1318 1318
                     if ($cat_display == 'select' || $cat_display == 'multiselect') {
@@ -1322,11 +1322,11 @@  discard block
 block discarded – undo
1322 1322
                         if ($cat_display == 'multiselect')
1323 1323
                             $multiple = 'multiple="multiple"';
1324 1324
 
1325
-                        echo '<select id="' . $name . '" ' . $multiple . ' type="' . $name . '" name="post_category[' . $name . '][]" alt="' . $name . '" field_type="' . $cat_display . '" class="geodir_textfield textfield_x chosen_select" data-placeholder="' . __('Select Category', 'geodirectory') . '">';
1325
+                        echo '<select id="'.$name.'" '.$multiple.' type="'.$name.'" name="post_category['.$name.'][]" alt="'.$name.'" field_type="'.$cat_display.'" class="geodir_textfield textfield_x chosen_select" data-placeholder="'.__('Select Category', 'geodirectory').'">';
1326 1326
 
1327 1327
 
1328 1328
                         if ($cat_display == 'select')
1329
-                            echo '<option value="">' . __('Select Category', 'geodirectory') . '</option>';
1329
+                            echo '<option value="">'.__('Select Category', 'geodirectory').'</option>';
1330 1330
 
1331 1331
                     }
1332 1332
 
@@ -1344,7 +1344,7 @@  discard block
 block discarded – undo
1344 1344
                 ?>
1345 1345
             </div>
1346 1346
 
1347
-            <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory');?></span>
1347
+            <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory'); ?></span>
1348 1348
             <?php if ($is_required) { ?>
1349 1349
                 <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span>
1350 1350
             <?php } ?>
@@ -1356,7 +1356,7 @@  discard block
 block discarded – undo
1356 1356
 
1357 1357
     return $html;
1358 1358
 }
1359
-add_filter('geodir_custom_field_input_taxonomy','geodir_cfi_taxonomy',10,2);
1359
+add_filter('geodir_custom_field_input_taxonomy', 'geodir_cfi_taxonomy', 10, 2);
1360 1360
 
1361 1361
 
1362 1362
 /**
@@ -1368,12 +1368,12 @@  discard block
 block discarded – undo
1368 1368
  *
1369 1369
  * @return string The html to output for the custom field.
1370 1370
  */
1371
-function geodir_cfi_file($html,$cf){
1371
+function geodir_cfi_file($html, $cf) {
1372 1372
 
1373 1373
     $html_var = $cf['htmlvar_name'];
1374 1374
 
1375 1375
     // Check if there is a custom field specific filter.
1376
-    if(has_filter("geodir_custom_field_input_file_{$html_var}")){
1376
+    if (has_filter("geodir_custom_field_input_file_{$html_var}")) {
1377 1377
         /**
1378 1378
          * Filter the file html by individual custom field.
1379 1379
          *
@@ -1381,11 +1381,11 @@  discard block
 block discarded – undo
1381 1381
          * @param array $cf The custom field array.
1382 1382
          * @since 1.6.6
1383 1383
          */
1384
-        $html = apply_filters("geodir_custom_field_input_file_{$html_var}",$html,$cf);
1384
+        $html = apply_filters("geodir_custom_field_input_file_{$html_var}", $html, $cf);
1385 1385
     }
1386 1386
 
1387 1387
     // If no html then we run the standard output.
1388
-    if(empty($html)) {
1388
+    if (empty($html)) {
1389 1389
 
1390 1390
         ob_start(); // Start  buffering;
1391 1391
         $value = geodir_get_cf_value($cf);
@@ -1428,8 +1428,8 @@  discard block
 block discarded – undo
1428 1428
                 $file_totImg = count($curImages);
1429 1429
         }
1430 1430
 
1431
-        $allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types'] ) ? implode(",", $extra_fields['gd_file_types']) : '';
1432
-        $display_file_types = $allowed_file_types != '' ? '.' . implode(", .", $extra_fields['gd_file_types']) : '';
1431
+        $allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types']) ? implode(",", $extra_fields['gd_file_types']) : '';
1432
+        $display_file_types = $allowed_file_types != '' ? '.'.implode(", .", $extra_fields['gd_file_types']) : '';
1433 1433
 
1434 1434
         ?>
1435 1435
         <?php /*?> <h5 class="geodir-form_title"> <?php echo $site_title; ?>
@@ -1439,13 +1439,13 @@  discard block
 block discarded – undo
1439 1439
 			</h5>   <?php */
1440 1440
         ?>
1441 1441
 
1442
-        <div id="<?php echo $name;?>_row"
1443
-             class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
1442
+        <div id="<?php echo $name; ?>_row"
1443
+             class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
1444 1444
 
1445 1445
             <div id="<?php echo $file_id; ?>dropbox" style="text-align:center;">
1446 1446
                 <label
1447 1447
                     style="text-align:left; padding-top:10px;"><?php $site_title = __($site_title, 'geodirectory');
1448
-                    echo $site_title; ?><?php if ($is_required) echo '<span>*</span>';?></label>
1448
+                    echo $site_title; ?><?php if ($is_required) echo '<span>*</span>'; ?></label>
1449 1449
                 <input class="geodir-custom-file-upload" field_type="file" type="hidden"
1450 1450
                        name="<?php echo $file_id; ?>" id="<?php echo $file_id; ?>"
1451 1451
                        value="<?php echo esc_attr($file_value); ?>"/>
@@ -1453,7 +1453,7 @@  discard block
 block discarded – undo
1453 1453
                        id="<?php echo $file_id; ?>image_limit" value="<?php echo $file_image_limit; ?>"/>
1454 1454
                 <?php if ($allowed_file_types != '') { ?>
1455 1455
                     <input type="hidden" name="<?php echo $file_id; ?>_allowed_types"
1456
-                           id="<?php echo $file_id; ?>_allowed_types" value="<?php echo esc_attr($allowed_file_types); ?>" data-exts="<?php echo esc_attr($display_file_types);?>"/>
1456
+                           id="<?php echo $file_id; ?>_allowed_types" value="<?php echo esc_attr($allowed_file_types); ?>" data-exts="<?php echo esc_attr($display_file_types); ?>"/>
1457 1457
                 <?php } ?>
1458 1458
                 <input type="hidden" name="<?php echo $file_id; ?>totImg" id="<?php echo $file_id; ?>totImg"
1459 1459
                        value="<?php if (isset($file_totImg)) {
@@ -1469,10 +1469,10 @@  discard block
 block discarded – undo
1469 1469
                         <?php /*?><h4><?php _e('Drop files to upload');?></h4><br/><?php */
1470 1470
                         ?>
1471 1471
                         <input id="<?php echo $file_id; ?>plupload-browse-button" type="button"
1472
-                               value="<?php ($file_image_limit > 1 ? esc_attr_e('Select Files', 'geodirectory') : esc_attr_e('Select File', 'geodirectory') ); ?>"
1472
+                               value="<?php ($file_image_limit > 1 ? esc_attr_e('Select Files', 'geodirectory') : esc_attr_e('Select File', 'geodirectory')); ?>"
1473 1473
                                class="geodir_button" style="margin-top:10px;"/>
1474 1474
                             <span class="ajaxnonceplu"
1475
-                                  id="ajaxnonceplu<?php echo wp_create_nonce($file_id . 'pluploadan'); ?>"></span>
1475
+                                  id="ajaxnonceplu<?php echo wp_create_nonce($file_id.'pluploadan'); ?>"></span>
1476 1476
                         <?php if ($file_width && $file_height): ?>
1477 1477
                             <span class="plupload-resize"></span>
1478 1478
                             <span class="plupload-width" id="plupload-width<?php echo $file_width; ?>"></span>
@@ -1492,7 +1492,7 @@  discard block
 block discarded – undo
1492 1492
 
1493 1493
                 </div>
1494 1494
             </div>
1495
-            <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory');?> <?php echo ( $display_file_types != '' ? __('Allowed file types:', 'geodirectory') . ' ' . $display_file_types : '' );?></span>
1495
+            <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory'); ?> <?php echo ($display_file_types != '' ? __('Allowed file types:', 'geodirectory').' '.$display_file_types : ''); ?></span>
1496 1496
             <?php if ($is_required) { ?>
1497 1497
                 <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span>
1498 1498
             <?php } ?>
@@ -1505,4 +1505,4 @@  discard block
 block discarded – undo
1505 1505
 
1506 1506
     return $html;
1507 1507
 }
1508
-add_filter('geodir_custom_field_input_file','geodir_cfi_file',10,2);
1509 1508
\ No newline at end of file
1509
+add_filter('geodir_custom_field_input_file', 'geodir_cfi_file', 10, 2);
1510 1510
\ No newline at end of file
Please login to merge, or discard this patch.
Indentation   +705 added lines, -705 removed lines patch added patch discarded remove patch
@@ -19,35 +19,35 @@  discard block
 block discarded – undo
19 19
  */
20 20
 function geodir_cfi_fieldset($html,$cf){
21 21
 
22
-    $html_var = $cf['htmlvar_name'];
23
-
24
-    // Check if there is a custom field specific filter.
25
-    if(has_filter("geodir_custom_field_input_fieldset_{$html_var}")){
26
-        /**
27
-         * Filter the fieldset html by individual custom field.
28
-         *
29
-         * @param string $html The html to filter.
30
-         * @param array $cf The custom field array.
31
-         * @since 1.6.6
32
-         */
33
-        $html = apply_filters("geodir_custom_field_input_fieldset_{$html_var}",$html,$cf);
34
-    }
35
-
36
-    // If no html then we run the standard output.
37
-    if(empty($html)) {
38
-
39
-        ob_start(); // Start  buffering;
40
-        ?>
22
+	$html_var = $cf['htmlvar_name'];
23
+
24
+	// Check if there is a custom field specific filter.
25
+	if(has_filter("geodir_custom_field_input_fieldset_{$html_var}")){
26
+		/**
27
+		 * Filter the fieldset html by individual custom field.
28
+		 *
29
+		 * @param string $html The html to filter.
30
+		 * @param array $cf The custom field array.
31
+		 * @since 1.6.6
32
+		 */
33
+		$html = apply_filters("geodir_custom_field_input_fieldset_{$html_var}",$html,$cf);
34
+	}
35
+
36
+	// If no html then we run the standard output.
37
+	if(empty($html)) {
38
+
39
+		ob_start(); // Start  buffering;
40
+		?>
41 41
         <h5 id="geodir_fieldset_<?php echo (int) $cf['id']; ?>" class="geodir-fieldset-row"
42 42
             gd-fieldset="<?php echo (int) $cf['id']; ?>"><?php echo $cf['site_title']; ?>
43 43
             <?php if ( $cf['desc'] != '' ) {
44
-                echo '<small>( ' . $cf['desc'] . ' )</small>';
45
-            } ?></h5>
44
+				echo '<small>( ' . $cf['desc'] . ' )</small>';
45
+			} ?></h5>
46 46
         <?php
47
-        $html = ob_get_clean();
48
-    }
47
+		$html = ob_get_clean();
48
+	}
49 49
 
50
-    return $html;
50
+	return $html;
51 51
 }
52 52
 add_filter('geodir_custom_field_input_fieldset','geodir_cfi_fieldset',10,2);
53 53
 
@@ -64,47 +64,47 @@  discard block
 block discarded – undo
64 64
  */
65 65
 function geodir_cfi_text($html,$cf){
66 66
 
67
-    $html_var = $cf['htmlvar_name'];
68
-
69
-    // Check if there is a custom field specific filter.
70
-    if(has_filter("geodir_custom_field_input_text_{$html_var}")){
71
-        /**
72
-         * Filter the text html by individual custom field.
73
-         *
74
-         * @param string $html The html to filter.
75
-         * @param array $cf The custom field array.
76
-         * @since 1.6.6
77
-         */
78
-        $html = apply_filters("geodir_custom_field_input_text_{$html_var}",$html,$cf);
79
-    }
80
-
81
-    // If no html then we run the standard output.
82
-    if(empty($html)) {
83
-
84
-        ob_start(); // Start  buffering;
85
-
86
-        $value = geodir_get_cf_value($cf);
87
-        $type = $cf['type'];
88
-        //number and float validation $validation_pattern
89
-        if(isset($cf['data_type']) && $cf['data_type']=='INT'){$type = 'number';}
90
-        elseif(isset($cf['data_type']) && $cf['data_type']=='FLOAT'){$type = 'float';}
91
-
92
-        //validation
93
-        if(isset($cf['validation_pattern']) && $cf['validation_pattern']){
94
-            $validation = 'pattern="'.$cf['validation_pattern'].'"';
95
-        }else{$validation='';}
96
-
97
-        // validation message
98
-        if(isset($cf['validation_msg']) && $cf['validation_msg']){
99
-            $validation_msg = 'title="'.$cf['validation_msg'].'"';
100
-        }else{$validation_msg='';}
101
-        ?>
67
+	$html_var = $cf['htmlvar_name'];
68
+
69
+	// Check if there is a custom field specific filter.
70
+	if(has_filter("geodir_custom_field_input_text_{$html_var}")){
71
+		/**
72
+		 * Filter the text html by individual custom field.
73
+		 *
74
+		 * @param string $html The html to filter.
75
+		 * @param array $cf The custom field array.
76
+		 * @since 1.6.6
77
+		 */
78
+		$html = apply_filters("geodir_custom_field_input_text_{$html_var}",$html,$cf);
79
+	}
80
+
81
+	// If no html then we run the standard output.
82
+	if(empty($html)) {
83
+
84
+		ob_start(); // Start  buffering;
85
+
86
+		$value = geodir_get_cf_value($cf);
87
+		$type = $cf['type'];
88
+		//number and float validation $validation_pattern
89
+		if(isset($cf['data_type']) && $cf['data_type']=='INT'){$type = 'number';}
90
+		elseif(isset($cf['data_type']) && $cf['data_type']=='FLOAT'){$type = 'float';}
91
+
92
+		//validation
93
+		if(isset($cf['validation_pattern']) && $cf['validation_pattern']){
94
+			$validation = 'pattern="'.$cf['validation_pattern'].'"';
95
+		}else{$validation='';}
96
+
97
+		// validation message
98
+		if(isset($cf['validation_msg']) && $cf['validation_msg']){
99
+			$validation_msg = 'title="'.$cf['validation_msg'].'"';
100
+		}else{$validation_msg='';}
101
+		?>
102 102
 
103 103
         <div id="<?php echo $cf['name'];?>_row"
104 104
              class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
105 105
             <label>
106 106
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
107
-                echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
107
+				echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
108 108
                 <?php if ($cf['is_required']) echo '<span>*</span>';?>
109 109
             </label>
110 110
             <input field_type="<?php echo $type;?>" name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>"
@@ -116,10 +116,10 @@  discard block
 block discarded – undo
116 116
         </div>
117 117
 
118 118
         <?php
119
-        $html = ob_get_clean();
120
-    }
119
+		$html = ob_get_clean();
120
+	}
121 121
 
122
-    return $html;
122
+	return $html;
123 123
 }
124 124
 add_filter('geodir_custom_field_input_text','geodir_cfi_text',10,2);
125 125
 
@@ -135,35 +135,35 @@  discard block
 block discarded – undo
135 135
  */
136 136
 function geodir_cfi_email($html,$cf){
137 137
 
138
-    $html_var = $cf['htmlvar_name'];
138
+	$html_var = $cf['htmlvar_name'];
139 139
 
140
-    // Check if there is a custom field specific filter.
141
-    if(has_filter("geodir_custom_field_input_email_{$html_var}")){
142
-        /**
143
-         * Filter the email html by individual custom field.
144
-         *
145
-         * @param string $html The html to filter.
146
-         * @param array $cf The custom field array.
147
-         * @since 1.6.6
148
-         */
149
-        $html = apply_filters("geodir_custom_field_input_email_{$html_var}",$html,$cf);
150
-    }
140
+	// Check if there is a custom field specific filter.
141
+	if(has_filter("geodir_custom_field_input_email_{$html_var}")){
142
+		/**
143
+		 * Filter the email html by individual custom field.
144
+		 *
145
+		 * @param string $html The html to filter.
146
+		 * @param array $cf The custom field array.
147
+		 * @since 1.6.6
148
+		 */
149
+		$html = apply_filters("geodir_custom_field_input_email_{$html_var}",$html,$cf);
150
+	}
151 151
 
152
-    // If no html then we run the standard output.
153
-    if(empty($html)) {
152
+	// If no html then we run the standard output.
153
+	if(empty($html)) {
154 154
 
155
-        ob_start(); // Start  buffering;
156
-        $value = geodir_get_cf_value($cf);
155
+		ob_start(); // Start  buffering;
156
+		$value = geodir_get_cf_value($cf);
157 157
 
158
-        if ($value == $cf['default']) {
159
-            $value = '';
160
-        }?>
158
+		if ($value == $cf['default']) {
159
+			$value = '';
160
+		}?>
161 161
 
162 162
         <div id="<?php echo $cf['name'];?>_row"
163 163
              class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
164 164
             <label>
165 165
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
166
-                echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
166
+				echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
167 167
                 <?php if ($cf['is_required']) echo '<span>*</span>';?>
168 168
             </label>
169 169
             <input field_type="<?php echo $cf['type'];?>" name="<?php  echo $cf['name'];?>" id="<?php echo $cf['name'];?>"
@@ -175,10 +175,10 @@  discard block
 block discarded – undo
175 175
         </div>
176 176
 
177 177
         <?php
178
-        $html = ob_get_clean();
179
-    }
178
+		$html = ob_get_clean();
179
+	}
180 180
 
181
-    return $html;
181
+	return $html;
182 182
 }
183 183
 add_filter('geodir_custom_field_input_email','geodir_cfi_email',10,2);
184 184
 
@@ -195,35 +195,35 @@  discard block
 block discarded – undo
195 195
  */
196 196
 function geodir_cfi_phone($html,$cf){
197 197
 
198
-    $html_var = $cf['htmlvar_name'];
198
+	$html_var = $cf['htmlvar_name'];
199 199
 
200
-    // Check if there is a custom field specific filter.
201
-    if(has_filter("geodir_custom_field_input_phone_{$html_var}")){
202
-        /**
203
-         * Filter the phone html by individual custom field.
204
-         *
205
-         * @param string $html The html to filter.
206
-         * @param array $cf The custom field array.
207
-         * @since 1.6.6
208
-         */
209
-        $html = apply_filters("geodir_custom_field_input_phone_{$html_var}",$html,$cf);
210
-    }
200
+	// Check if there is a custom field specific filter.
201
+	if(has_filter("geodir_custom_field_input_phone_{$html_var}")){
202
+		/**
203
+		 * Filter the phone html by individual custom field.
204
+		 *
205
+		 * @param string $html The html to filter.
206
+		 * @param array $cf The custom field array.
207
+		 * @since 1.6.6
208
+		 */
209
+		$html = apply_filters("geodir_custom_field_input_phone_{$html_var}",$html,$cf);
210
+	}
211 211
 
212
-    // If no html then we run the standard output.
213
-    if(empty($html)) {
212
+	// If no html then we run the standard output.
213
+	if(empty($html)) {
214 214
 
215
-        ob_start(); // Start  buffering;
216
-        $value = geodir_get_cf_value($cf);
215
+		ob_start(); // Start  buffering;
216
+		$value = geodir_get_cf_value($cf);
217 217
 
218
-        if ($value == $cf['default']) {
219
-            $value = '';
220
-        }?>
218
+		if ($value == $cf['default']) {
219
+			$value = '';
220
+		}?>
221 221
 
222 222
         <div id="<?php echo $cf['name'];?>_row"
223 223
              class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
224 224
             <label>
225 225
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
226
-                echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
226
+				echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
227 227
                 <?php if ($cf['is_required']) echo '<span>*</span>';?>
228 228
             </label>
229 229
             <input field_type="<?php echo $cf['type'];?>" name="<?php  echo $cf['name'];?>" id="<?php echo $cf['name'];?>"
@@ -235,10 +235,10 @@  discard block
 block discarded – undo
235 235
         </div>
236 236
 
237 237
         <?php
238
-        $html = ob_get_clean();
239
-    }
238
+		$html = ob_get_clean();
239
+	}
240 240
 
241
-    return $html;
241
+	return $html;
242 242
 }
243 243
 add_filter('geodir_custom_field_input_phone','geodir_cfi_phone',10,2);
244 244
 
@@ -255,35 +255,35 @@  discard block
 block discarded – undo
255 255
  */
256 256
 function geodir_cfi_url($html,$cf){
257 257
 
258
-    $html_var = $cf['htmlvar_name'];
258
+	$html_var = $cf['htmlvar_name'];
259 259
 
260
-    // Check if there is a custom field specific filter.
261
-    if(has_filter("geodir_custom_field_input_url_{$html_var}")){
262
-        /**
263
-         * Filter the url html by individual custom field.
264
-         *
265
-         * @param string $html The html to filter.
266
-         * @param array $cf The custom field array.
267
-         * @since 1.6.6
268
-         */
269
-        $html = apply_filters("geodir_custom_field_input_url_{$html_var}",$html,$cf);
270
-    }
260
+	// Check if there is a custom field specific filter.
261
+	if(has_filter("geodir_custom_field_input_url_{$html_var}")){
262
+		/**
263
+		 * Filter the url html by individual custom field.
264
+		 *
265
+		 * @param string $html The html to filter.
266
+		 * @param array $cf The custom field array.
267
+		 * @since 1.6.6
268
+		 */
269
+		$html = apply_filters("geodir_custom_field_input_url_{$html_var}",$html,$cf);
270
+	}
271 271
 
272
-    // If no html then we run the standard output.
273
-    if(empty($html)) {
272
+	// If no html then we run the standard output.
273
+	if(empty($html)) {
274 274
 
275
-        ob_start(); // Start  buffering;
276
-        $value = geodir_get_cf_value($cf);
275
+		ob_start(); // Start  buffering;
276
+		$value = geodir_get_cf_value($cf);
277 277
 
278
-        if ($value == $cf['default']) {
279
-            $value = '';
280
-        }?>
278
+		if ($value == $cf['default']) {
279
+			$value = '';
280
+		}?>
281 281
 
282 282
         <div id="<?php echo $cf['name'];?>_row"
283 283
              class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
284 284
             <label>
285 285
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
286
-                echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
286
+				echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
287 287
                 <?php if ($cf['is_required']) echo '<span>*</span>';?>
288 288
             </label>
289 289
             <input field_type="<?php echo $cf['type'];?>" name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>"
@@ -298,10 +298,10 @@  discard block
 block discarded – undo
298 298
         </div>
299 299
 
300 300
         <?php
301
-        $html = ob_get_clean();
302
-    }
301
+		$html = ob_get_clean();
302
+	}
303 303
 
304
-    return $html;
304
+	return $html;
305 305
 }
306 306
 add_filter('geodir_custom_field_input_url','geodir_cfi_url',10,2);
307 307
 
@@ -317,48 +317,48 @@  discard block
 block discarded – undo
317 317
  */
318 318
 function geodir_cfi_radio($html,$cf){
319 319
 
320
-    $html_var = $cf['htmlvar_name'];
320
+	$html_var = $cf['htmlvar_name'];
321 321
 
322
-    // Check if there is a custom field specific filter.
323
-    if(has_filter("geodir_custom_field_input_radio_{$html_var}")){
324
-        /**
325
-         * Filter the radio html by individual custom field.
326
-         *
327
-         * @param string $html The html to filter.
328
-         * @param array $cf The custom field array.
329
-         * @since 1.6.6
330
-         */
331
-        $html = apply_filters("geodir_custom_field_input_radio_{$html_var}",$html,$cf);
332
-    }
322
+	// Check if there is a custom field specific filter.
323
+	if(has_filter("geodir_custom_field_input_radio_{$html_var}")){
324
+		/**
325
+		 * Filter the radio html by individual custom field.
326
+		 *
327
+		 * @param string $html The html to filter.
328
+		 * @param array $cf The custom field array.
329
+		 * @since 1.6.6
330
+		 */
331
+		$html = apply_filters("geodir_custom_field_input_radio_{$html_var}",$html,$cf);
332
+	}
333 333
 
334
-    // If no html then we run the standard output.
335
-    if(empty($html)) {
334
+	// If no html then we run the standard output.
335
+	if(empty($html)) {
336 336
 
337
-        ob_start(); // Start  buffering;
338
-        $value = geodir_get_cf_value($cf);
337
+		ob_start(); // Start  buffering;
338
+		$value = geodir_get_cf_value($cf);
339 339
 
340
-        ?>
340
+		?>
341 341
         <div id="<?php echo $cf['name'];?>_row"
342 342
              class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
343 343
             <label>
344 344
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
345
-                echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
345
+				echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
346 346
                 <?php if ($cf['is_required']) echo '<span>*</span>';?>
347 347
             </label>
348 348
             <?php if ($cf['option_values']) {
349
-                $option_values = geodir_string_values_to_options($cf['option_values'], true);
349
+				$option_values = geodir_string_values_to_options($cf['option_values'], true);
350 350
 
351
-                if (!empty($option_values)) {
352
-                    foreach ($option_values as $option_value) {
353
-                        if (empty($option_value['optgroup'])) {
354
-                            ?>
351
+				if (!empty($option_values)) {
352
+					foreach ($option_values as $option_value) {
353
+						if (empty($option_value['optgroup'])) {
354
+							?>
355 355
                             <span class="gd-radios"><input name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>" <?php checked($value, $option_value['value']);?> value="<?php echo esc_attr($option_value['value']); ?>" class="gd-checkbox" field_type="<?php echo $cf['type'];?>" type="radio" /><?php echo $option_value['label']; ?></span>
356 356
                             <?php
357
-                        }
358
-                    }
359
-                }
360
-            }
361
-            ?>
357
+						}
358
+					}
359
+				}
360
+			}
361
+			?>
362 362
             <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
363 363
             <?php if ($cf['is_required']) { ?>
364 364
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
@@ -366,10 +366,10 @@  discard block
 block discarded – undo
366 366
         </div>
367 367
 
368 368
         <?php
369
-        $html = ob_get_clean();
370
-    }
369
+		$html = ob_get_clean();
370
+	}
371 371
 
372
-    return $html;
372
+	return $html;
373 373
 }
374 374
 add_filter('geodir_custom_field_input_radio','geodir_cfi_radio',10,2);
375 375
 
@@ -385,46 +385,46 @@  discard block
 block discarded – undo
385 385
  */
386 386
 function geodir_cfi_checkbox($html,$cf){
387 387
 
388
-    $html_var = $cf['htmlvar_name'];
388
+	$html_var = $cf['htmlvar_name'];
389 389
 
390
-    // Check if there is a custom field specific filter.
391
-    if(has_filter("geodir_custom_field_input_checkbox_{$html_var}")){
392
-        /**
393
-         * Filter the checkbox html by individual custom field.
394
-         *
395
-         * @param string $html The html to filter.
396
-         * @param array $cf The custom field array.
397
-         * @since 1.6.6
398
-         */
399
-        $html = apply_filters("geodir_custom_field_input_checkbox_{$html_var}",$html,$cf);
400
-    }
390
+	// Check if there is a custom field specific filter.
391
+	if(has_filter("geodir_custom_field_input_checkbox_{$html_var}")){
392
+		/**
393
+		 * Filter the checkbox html by individual custom field.
394
+		 *
395
+		 * @param string $html The html to filter.
396
+		 * @param array $cf The custom field array.
397
+		 * @since 1.6.6
398
+		 */
399
+		$html = apply_filters("geodir_custom_field_input_checkbox_{$html_var}",$html,$cf);
400
+	}
401 401
 
402
-    // If no html then we run the standard output.
403
-    if(empty($html)) {
402
+	// If no html then we run the standard output.
403
+	if(empty($html)) {
404 404
 
405
-        ob_start(); // Start  buffering;
406
-        $value = geodir_get_cf_value($cf);
405
+		ob_start(); // Start  buffering;
406
+		$value = geodir_get_cf_value($cf);
407 407
 
408 408
 
409
-        if ($value == '' && $cf['default']) {
410
-            $value = '1';
411
-        }
412
-        ?>
409
+		if ($value == '' && $cf['default']) {
410
+			$value = '1';
411
+		}
412
+		?>
413 413
 
414 414
         <div id="<?php echo $cf['name'];?>_row"
415 415
              class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
416 416
             <label>
417 417
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
418
-                echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
418
+				echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
419 419
                 <?php if ($cf['is_required']) echo '<span>*</span>';?>
420 420
             </label>
421 421
             <?php if ($value != '1') {
422
-                $value = '0';
423
-            }?>
422
+				$value = '0';
423
+			}?>
424 424
             <input type="hidden" name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>" value="<?php echo esc_attr($value);?>"/>
425 425
             <input  <?php if ($value == '1') {
426
-                echo 'checked="checked"';
427
-            }?>  value="1" class="gd-checkbox" field_type="<?php echo $cf['type'];?>" type="checkbox"
426
+				echo 'checked="checked"';
427
+			}?>  value="1" class="gd-checkbox" field_type="<?php echo $cf['type'];?>" type="checkbox"
428 428
                  onchange="if(this.checked){jQuery('#<?php echo $cf['name'];?>').val('1');} else{ jQuery('#<?php echo $cf['name'];?>').val('0');}"/>
429 429
             <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
430 430
             <?php if ($cf['is_required']) { ?>
@@ -433,10 +433,10 @@  discard block
 block discarded – undo
433 433
         </div>
434 434
 
435 435
         <?php
436
-        $html = ob_get_clean();
437
-    }
436
+		$html = ob_get_clean();
437
+	}
438 438
 
439
-    return $html;
439
+	return $html;
440 440
 }
441 441
 add_filter('geodir_custom_field_input_checkbox','geodir_cfi_checkbox',10,2);
442 442
 
@@ -452,52 +452,52 @@  discard block
 block discarded – undo
452 452
  */
453 453
 function geodir_cfi_textarea($html,$cf){
454 454
 
455
-    $html_var = $cf['htmlvar_name'];
455
+	$html_var = $cf['htmlvar_name'];
456 456
 
457
-    // Check if there is a custom field specific filter.
458
-    if(has_filter("geodir_custom_field_input_textarea_{$html_var}")){
459
-        /**
460
-         * Filter the textarea html by individual custom field.
461
-         *
462
-         * @param string $html The html to filter.
463
-         * @param array $cf The custom field array.
464
-         * @since 1.6.6
465
-         */
466
-        $html = apply_filters("geodir_custom_field_input_textarea_{$html_var}",$html,$cf);
467
-    }
457
+	// Check if there is a custom field specific filter.
458
+	if(has_filter("geodir_custom_field_input_textarea_{$html_var}")){
459
+		/**
460
+		 * Filter the textarea html by individual custom field.
461
+		 *
462
+		 * @param string $html The html to filter.
463
+		 * @param array $cf The custom field array.
464
+		 * @since 1.6.6
465
+		 */
466
+		$html = apply_filters("geodir_custom_field_input_textarea_{$html_var}",$html,$cf);
467
+	}
468 468
 
469
-    // If no html then we run the standard output.
470
-    if(empty($html)) {
469
+	// If no html then we run the standard output.
470
+	if(empty($html)) {
471 471
 
472
-        ob_start(); // Start  buffering;
473
-        $value = geodir_get_cf_value($cf);
472
+		ob_start(); // Start  buffering;
473
+		$value = geodir_get_cf_value($cf);
474 474
 
475
-        $extra_fields = unserialize($cf['extra_fields']);
476
-        ?>
475
+		$extra_fields = unserialize($cf['extra_fields']);
476
+		?>
477 477
 
478 478
         <div id="<?php echo $cf['name'];?>_row"
479 479
              class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
480 480
             <label>
481 481
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
482
-                echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
482
+				echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
483 483
                 <?php if ($cf['is_required']) echo '<span>*</span>';?>
484 484
             </label><?php
485 485
 
486 486
 
487
-            if (is_array($extra_fields) && in_array('1', $extra_fields)) {
487
+			if (is_array($extra_fields) && in_array('1', $extra_fields)) {
488 488
 
489
-                $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);?>
489
+				$editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);?>
490 490
 
491 491
             <div class="editor" field_id="<?php echo $cf['name'];?>" field_type="editor">
492 492
                 <?php wp_editor(stripslashes($value), $cf['name'], $editor_settings); ?>
493 493
                 </div><?php
494 494
 
495
-            } else {
495
+			} else {
496 496
 
497
-                ?><textarea field_type="<?php echo $cf['type'];?>" class="geodir_textarea" name="<?php echo $cf['name'];?>"
497
+				?><textarea field_type="<?php echo $cf['type'];?>" class="geodir_textarea" name="<?php echo $cf['name'];?>"
498 498
                             id="<?php echo $cf['name'];?>"><?php echo stripslashes($value);?></textarea><?php
499 499
 
500
-            }?>
500
+			}?>
501 501
 
502 502
 
503 503
             <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
@@ -507,10 +507,10 @@  discard block
 block discarded – undo
507 507
         </div>
508 508
 
509 509
         <?php
510
-        $html = ob_get_clean();
511
-    }
510
+		$html = ob_get_clean();
511
+	}
512 512
 
513
-    return $html;
513
+	return $html;
514 514
 }
515 515
 add_filter('geodir_custom_field_input_textarea','geodir_cfi_textarea',10,2);
516 516
 
@@ -526,53 +526,53 @@  discard block
 block discarded – undo
526 526
  */
527 527
 function geodir_cfi_select($html,$cf){
528 528
 
529
-    $html_var = $cf['htmlvar_name'];
529
+	$html_var = $cf['htmlvar_name'];
530 530
 
531
-    // Check if there is a custom field specific filter.
532
-    if(has_filter("geodir_custom_field_input_select_{$html_var}")){
533
-        /**
534
-         * Filter the select html by individual custom field.
535
-         *
536
-         * @param string $html The html to filter.
537
-         * @param array $cf The custom field array.
538
-         * @since 1.6.6
539
-         */
540
-        $html = apply_filters("geodir_custom_field_input_select_{$html_var}",$html,$cf);
541
-    }
531
+	// Check if there is a custom field specific filter.
532
+	if(has_filter("geodir_custom_field_input_select_{$html_var}")){
533
+		/**
534
+		 * Filter the select html by individual custom field.
535
+		 *
536
+		 * @param string $html The html to filter.
537
+		 * @param array $cf The custom field array.
538
+		 * @since 1.6.6
539
+		 */
540
+		$html = apply_filters("geodir_custom_field_input_select_{$html_var}",$html,$cf);
541
+	}
542 542
 
543
-    // If no html then we run the standard output.
544
-    if(empty($html)) {
543
+	// If no html then we run the standard output.
544
+	if(empty($html)) {
545 545
 
546
-        ob_start(); // Start  buffering;
547
-        $value = geodir_get_cf_value($cf);
546
+		ob_start(); // Start  buffering;
547
+		$value = geodir_get_cf_value($cf);
548 548
 
549
-        ?>
549
+		?>
550 550
         <div id="<?php echo $cf['name'];?>_row"
551 551
              class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row geodir_custom_fields clearfix gd-fieldset-details">
552 552
             <label>
553 553
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
554
-                echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
554
+				echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
555 555
                 <?php if ($cf['is_required']) echo '<span>*</span>';?>
556 556
             </label>
557 557
             <?php
558
-            $option_values_arr = geodir_string_values_to_options($cf['option_values'], true);
559
-            $select_options = '';
560
-            if (!empty($option_values_arr)) {
561
-                foreach ($option_values_arr as $option_row) {
562
-                    if (isset($option_row['optgroup']) && ($option_row['optgroup'] == 'start' || $option_row['optgroup'] == 'end')) {
563
-                        $option_label = isset($option_row['label']) ? $option_row['label'] : '';
564
-
565
-                        $select_options .= $option_row['optgroup'] == 'start' ? '<optgroup label="' . esc_attr($option_label) . '">' : '</optgroup>';
566
-                    } else {
567
-                        $option_label = isset($option_row['label']) ? $option_row['label'] : '';
568
-                        $option_value = isset($option_row['value']) ? $option_row['value'] : '';
569
-                        $selected = $option_value == $value ? 'selected="selected"' : '';
570
-
571
-                        $select_options .= '<option value="' . esc_attr($option_value) . '" ' . $selected . '>' . $option_label . '</option>';
572
-                    }
573
-                }
574
-            }
575
-            ?>
558
+			$option_values_arr = geodir_string_values_to_options($cf['option_values'], true);
559
+			$select_options = '';
560
+			if (!empty($option_values_arr)) {
561
+				foreach ($option_values_arr as $option_row) {
562
+					if (isset($option_row['optgroup']) && ($option_row['optgroup'] == 'start' || $option_row['optgroup'] == 'end')) {
563
+						$option_label = isset($option_row['label']) ? $option_row['label'] : '';
564
+
565
+						$select_options .= $option_row['optgroup'] == 'start' ? '<optgroup label="' . esc_attr($option_label) . '">' : '</optgroup>';
566
+					} else {
567
+						$option_label = isset($option_row['label']) ? $option_row['label'] : '';
568
+						$option_value = isset($option_row['value']) ? $option_row['value'] : '';
569
+						$selected = $option_value == $value ? 'selected="selected"' : '';
570
+
571
+						$select_options .= '<option value="' . esc_attr($option_value) . '" ' . $selected . '>' . $option_label . '</option>';
572
+					}
573
+				}
574
+			}
575
+			?>
576 576
             <select field_type="<?php echo $cf['type'];?>" name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>"
577 577
                     class="geodir_textfield textfield_x chosen_select"
578 578
                     data-placeholder="<?php echo __('Choose', 'geodirectory') . ' ' . $site_title . '&hellip;';?>"
@@ -584,10 +584,10 @@  discard block
 block discarded – undo
584 584
         </div>
585 585
 
586 586
         <?php
587
-        $html = ob_get_clean();
588
-    }
587
+		$html = ob_get_clean();
588
+	}
589 589
 
590
-    return $html;
590
+	return $html;
591 591
 }
592 592
 add_filter('geodir_custom_field_input_select','geodir_cfi_select',10,2);
593 593
 
@@ -603,36 +603,36 @@  discard block
 block discarded – undo
603 603
  */
604 604
 function geodir_cfi_multiselect($html,$cf){
605 605
 
606
-    $html_var = $cf['htmlvar_name'];
607
-
608
-    // Check if there is a custom field specific filter.
609
-    if(has_filter("geodir_custom_field_input_multiselect_{$html_var}")){
610
-        /**
611
-         * Filter the multiselect html by individual custom field.
612
-         *
613
-         * @param string $html The html to filter.
614
-         * @param array $cf The custom field array.
615
-         * @since 1.6.6
616
-         */
617
-        $html = apply_filters("geodir_custom_field_input_multiselect_{$html_var}",$html,$cf);
618
-    }
619
-
620
-    // If no html then we run the standard output.
621
-    if(empty($html)) {
622
-
623
-        ob_start(); // Start  buffering;
624
-        $value = geodir_get_cf_value($cf);
625
-
626
-        $multi_display = 'select';
627
-        if (!empty($cf['extra_fields'])) {
628
-            $multi_display = unserialize($cf['extra_fields']);
629
-        }
630
-        ?>
606
+	$html_var = $cf['htmlvar_name'];
607
+
608
+	// Check if there is a custom field specific filter.
609
+	if(has_filter("geodir_custom_field_input_multiselect_{$html_var}")){
610
+		/**
611
+		 * Filter the multiselect html by individual custom field.
612
+		 *
613
+		 * @param string $html The html to filter.
614
+		 * @param array $cf The custom field array.
615
+		 * @since 1.6.6
616
+		 */
617
+		$html = apply_filters("geodir_custom_field_input_multiselect_{$html_var}",$html,$cf);
618
+	}
619
+
620
+	// If no html then we run the standard output.
621
+	if(empty($html)) {
622
+
623
+		ob_start(); // Start  buffering;
624
+		$value = geodir_get_cf_value($cf);
625
+
626
+		$multi_display = 'select';
627
+		if (!empty($cf['extra_fields'])) {
628
+			$multi_display = unserialize($cf['extra_fields']);
629
+		}
630
+		?>
631 631
         <div id="<?php echo $cf['name']; ?>_row"
632 632
              class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
633 633
             <label>
634 634
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
635
-                echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
635
+				echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
636 636
                 <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
637 637
             </label>
638 638
             <input type="hidden" name="gd_field_<?php echo $cf['name']; ?>" value="1"/>
@@ -643,55 +643,55 @@  discard block
 block discarded – undo
643 643
                         data-placeholder="<?php _e('Select', 'geodirectory'); ?>"
644 644
                         option-ajaxchosen="false">
645 645
                     <?php
646
-                    } else {
647
-                        echo '<ul class="gd_multi_choice">';
648
-                    }
649
-
650
-                    $option_values_arr = geodir_string_values_to_options($cf['option_values'], true);
651
-                    $select_options = '';
652
-                    if (!empty($option_values_arr)) {
653
-                        foreach ($option_values_arr as $option_row) {
654
-                            if (isset($option_row['optgroup']) && ($option_row['optgroup'] == 'start' || $option_row['optgroup'] == 'end')) {
655
-                                $option_label = isset($option_row['label']) ? $option_row['label'] : '';
656
-
657
-                                if ($multi_display == 'select') {
658
-                                    $select_options .= $option_row['optgroup'] == 'start' ? '<optgroup label="' . esc_attr($option_label) . '">' : '</optgroup>';
659
-                                } else {
660
-                                    $select_options .= $option_row['optgroup'] == 'start' ? '<li>' . $option_label . '</li>' : '';
661
-                                }
662
-                            } else {
663
-                                $option_label = isset($option_row['label']) ? $option_row['label'] : '';
664
-                                $option_value = isset($option_row['value']) ? $option_row['value'] : '';
665
-                                $selected = $option_value == $value ? 'selected="selected"' : '';
666
-                                $selected = '';
667
-                                $checked = '';
668
-
669
-                                if ((!is_array($value) && trim($value) != '') || (is_array($value) && !empty($value))) {
670
-                                    if (!is_array($value)) {
671
-                                        $value_array = explode(',', $value);
672
-                                    } else {
673
-                                        $value_array = $value;
674
-                                    }
675
-
676
-                                    if (is_array($value_array)) {
677
-                                        if (in_array($option_value, $value_array)) {
678
-                                            $selected = 'selected="selected"';
679
-                                            $checked = 'checked="checked"';
680
-                                        }
681
-                                    }
682
-                                }
683
-
684
-                                if ($multi_display == 'select') {
685
-                                    $select_options .= '<option value="' . esc_attr($option_value) . '" ' . $selected . '>' . $option_label . '</option>';
686
-                                } else {
687
-                                    $select_options .= '<li><input name="' . $cf['name'] . '[]" ' . $checked . ' value="' . esc_attr($option_value) . '" class="gd-' . $multi_display . '" field_type="' . $multi_display . '" type="' . $multi_display . '" />&nbsp;' . $option_label . ' </li>';
688
-                                }
689
-                            }
690
-                        }
691
-                    }
692
-                    echo $select_options;
693
-
694
-                    if ($multi_display == 'select') { ?></select></div>
646
+					} else {
647
+						echo '<ul class="gd_multi_choice">';
648
+					}
649
+
650
+					$option_values_arr = geodir_string_values_to_options($cf['option_values'], true);
651
+					$select_options = '';
652
+					if (!empty($option_values_arr)) {
653
+						foreach ($option_values_arr as $option_row) {
654
+							if (isset($option_row['optgroup']) && ($option_row['optgroup'] == 'start' || $option_row['optgroup'] == 'end')) {
655
+								$option_label = isset($option_row['label']) ? $option_row['label'] : '';
656
+
657
+								if ($multi_display == 'select') {
658
+									$select_options .= $option_row['optgroup'] == 'start' ? '<optgroup label="' . esc_attr($option_label) . '">' : '</optgroup>';
659
+								} else {
660
+									$select_options .= $option_row['optgroup'] == 'start' ? '<li>' . $option_label . '</li>' : '';
661
+								}
662
+							} else {
663
+								$option_label = isset($option_row['label']) ? $option_row['label'] : '';
664
+								$option_value = isset($option_row['value']) ? $option_row['value'] : '';
665
+								$selected = $option_value == $value ? 'selected="selected"' : '';
666
+								$selected = '';
667
+								$checked = '';
668
+
669
+								if ((!is_array($value) && trim($value) != '') || (is_array($value) && !empty($value))) {
670
+									if (!is_array($value)) {
671
+										$value_array = explode(',', $value);
672
+									} else {
673
+										$value_array = $value;
674
+									}
675
+
676
+									if (is_array($value_array)) {
677
+										if (in_array($option_value, $value_array)) {
678
+											$selected = 'selected="selected"';
679
+											$checked = 'checked="checked"';
680
+										}
681
+									}
682
+								}
683
+
684
+								if ($multi_display == 'select') {
685
+									$select_options .= '<option value="' . esc_attr($option_value) . '" ' . $selected . '>' . $option_label . '</option>';
686
+								} else {
687
+									$select_options .= '<li><input name="' . $cf['name'] . '[]" ' . $checked . ' value="' . esc_attr($option_value) . '" class="gd-' . $multi_display . '" field_type="' . $multi_display . '" type="' . $multi_display . '" />&nbsp;' . $option_label . ' </li>';
688
+								}
689
+							}
690
+						}
691
+					}
692
+					echo $select_options;
693
+
694
+					if ($multi_display == 'select') { ?></select></div>
695 695
         <?php } else { ?></ul><?php } ?>
696 696
             <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
697 697
             <?php if ($cf['is_required']) { ?>
@@ -699,10 +699,10 @@  discard block
 block discarded – undo
699 699
             <?php } ?>
700 700
         </div>
701 701
         <?php
702
-        $html = ob_get_clean();
703
-    }
702
+		$html = ob_get_clean();
703
+	}
704 704
 
705
-    return $html;
705
+	return $html;
706 706
 }
707 707
 add_filter('geodir_custom_field_input_multiselect','geodir_cfi_multiselect',10,2);
708 708
 
@@ -718,32 +718,32 @@  discard block
 block discarded – undo
718 718
  */
719 719
 function geodir_cfi_html($html,$cf){
720 720
 
721
-    $html_var = $cf['htmlvar_name'];
721
+	$html_var = $cf['htmlvar_name'];
722 722
 
723
-    // Check if there is a custom field specific filter.
724
-    if(has_filter("geodir_custom_field_input_html_{$html_var}")){
725
-        /**
726
-         * Filter the html html by individual custom field.
727
-         *
728
-         * @param string $html The html to filter.
729
-         * @param array $cf The custom field array.
730
-         * @since 1.6.6
731
-         */
732
-        $html = apply_filters("geodir_custom_field_input_html_{$html_var}",$html,$cf);
733
-    }
723
+	// Check if there is a custom field specific filter.
724
+	if(has_filter("geodir_custom_field_input_html_{$html_var}")){
725
+		/**
726
+		 * Filter the html html by individual custom field.
727
+		 *
728
+		 * @param string $html The html to filter.
729
+		 * @param array $cf The custom field array.
730
+		 * @since 1.6.6
731
+		 */
732
+		$html = apply_filters("geodir_custom_field_input_html_{$html_var}",$html,$cf);
733
+	}
734 734
 
735
-    // If no html then we run the standard output.
736
-    if(empty($html)) {
735
+	// If no html then we run the standard output.
736
+	if(empty($html)) {
737 737
 
738
-        ob_start(); // Start  buffering;
739
-        $value = geodir_get_cf_value($cf);
740
-        ?>
738
+		ob_start(); // Start  buffering;
739
+		$value = geodir_get_cf_value($cf);
740
+		?>
741 741
 
742 742
         <div id="<?php echo $cf['name']; ?>_row"
743 743
              class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
744 744
             <label>
745 745
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
746
-                echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
746
+				echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
747 747
                 <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
748 748
             </label>
749 749
 
@@ -761,10 +761,10 @@  discard block
 block discarded – undo
761 761
         </div>
762 762
 
763 763
         <?php
764
-        $html = ob_get_clean();
765
-    }
764
+		$html = ob_get_clean();
765
+	}
766 766
 
767
-    return $html;
767
+	return $html;
768 768
 }
769 769
 add_filter('geodir_custom_field_input_html','geodir_cfi_html',10,2);
770 770
 
@@ -781,68 +781,68 @@  discard block
 block discarded – undo
781 781
  */
782 782
 function geodir_cfi_datepicker($html,$cf){
783 783
 
784
-    $html_var = $cf['htmlvar_name'];
784
+	$html_var = $cf['htmlvar_name'];
785 785
 
786
-    // Check if there is a custom field specific filter.
787
-    if(has_filter("geodir_custom_field_input_datepicker_{$html_var}")){
788
-        /**
789
-         * Filter the datepicker html by individual custom field.
790
-         *
791
-         * @param string $html The html to filter.
792
-         * @param array $cf The custom field array.
793
-         * @since 1.6.6
794
-         */
795
-        $html = apply_filters("geodir_custom_field_input_datepicker_{$html_var}",$html,$cf);
796
-    }
786
+	// Check if there is a custom field specific filter.
787
+	if(has_filter("geodir_custom_field_input_datepicker_{$html_var}")){
788
+		/**
789
+		 * Filter the datepicker html by individual custom field.
790
+		 *
791
+		 * @param string $html The html to filter.
792
+		 * @param array $cf The custom field array.
793
+		 * @since 1.6.6
794
+		 */
795
+		$html = apply_filters("geodir_custom_field_input_datepicker_{$html_var}",$html,$cf);
796
+	}
797 797
 
798
-    // If no html then we run the standard output.
799
-    if(empty($html)) {
798
+	// If no html then we run the standard output.
799
+	if(empty($html)) {
800 800
 
801
-        ob_start(); // Start  buffering;
802
-        $value = geodir_get_cf_value($cf);
801
+		ob_start(); // Start  buffering;
802
+		$value = geodir_get_cf_value($cf);
803 803
 
804
-        $extra_fields = unserialize($cf['extra_fields']);
805
-        $name = $cf['name'];
804
+		$extra_fields = unserialize($cf['extra_fields']);
805
+		$name = $cf['name'];
806 806
 
807
-        if ($extra_fields['date_format'] == '')
808
-            $extra_fields['date_format'] = 'yy-mm-dd';
807
+		if ($extra_fields['date_format'] == '')
808
+			$extra_fields['date_format'] = 'yy-mm-dd';
809 809
 
810
-        $date_format = $extra_fields['date_format'];
811
-        $jquery_date_format  = $date_format;
810
+		$date_format = $extra_fields['date_format'];
811
+		$jquery_date_format  = $date_format;
812 812
 
813 813
 
814
-        // check if we need to change the format or not
815
-        $date_format_len = strlen(str_replace(' ', '', $date_format));
816
-        if($date_format_len>5){// if greater then 5 then it's the old style format.
814
+		// check if we need to change the format or not
815
+		$date_format_len = strlen(str_replace(' ', '', $date_format));
816
+		if($date_format_len>5){// if greater then 5 then it's the old style format.
817 817
 
818
-            $search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format
819
-            $replace = array('d','j','l','m','n','F','Y');//PHP date format
818
+			$search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format
819
+			$replace = array('d','j','l','m','n','F','Y');//PHP date format
820 820
 
821
-            $date_format = str_replace($search, $replace, $date_format);
822
-        }else{
823
-            $jquery_date_format = geodir_date_format_php_to_jqueryui( $jquery_date_format );
824
-        }
821
+			$date_format = str_replace($search, $replace, $date_format);
822
+		}else{
823
+			$jquery_date_format = geodir_date_format_php_to_jqueryui( $jquery_date_format );
824
+		}
825 825
 
826
-        if($value=='0000-00-00'){$value='';}//if date not set, then mark it empty
827
-        if($value && !isset($_REQUEST['backandedit'])) {
828
-            //$time = strtotime($value);
829
-            //$value = date_i18n($date_format, $time);
830
-        }
831
-        $value = geodir_date($value, 'Y-m-d', $date_format);
826
+		if($value=='0000-00-00'){$value='';}//if date not set, then mark it empty
827
+		if($value && !isset($_REQUEST['backandedit'])) {
828
+			//$time = strtotime($value);
829
+			//$value = date_i18n($date_format, $time);
830
+		}
831
+		$value = geodir_date($value, 'Y-m-d', $date_format);
832 832
 
833
-        ?>
833
+		?>
834 834
         <script type="text/javascript">
835 835
 
836 836
             jQuery(function () {
837 837
 
838 838
                 jQuery("#<?php echo $cf['name'];?>").datepicker({changeMonth: true, changeYear: true <?php
839
-                    /**
840
-                     * Used to add extra option to datepicker per custom field.
841
-                     *
842
-                     * @since 1.5.7
843
-                     * @param string $name The custom field name.
844
-                     */
845
-                    echo apply_filters("gd_datepicker_extra_{$name}",'');?>});
839
+					/**
840
+					 * Used to add extra option to datepicker per custom field.
841
+					 *
842
+					 * @since 1.5.7
843
+					 * @param string $name The custom field name.
844
+					 */
845
+					echo apply_filters("gd_datepicker_extra_{$name}",'');?>});
846 846
 
847 847
                 jQuery("#<?php echo $name;?>").datepicker("option", "dateFormat", '<?php echo $jquery_date_format;?>');
848 848
 
@@ -858,7 +858,7 @@  discard block
 block discarded – undo
858 858
             <label>
859 859
 
860 860
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
861
-                echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
861
+				echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
862 862
                 <?php if ($cf['is_required']) echo '<span>*</span>';?>
863 863
             </label>
864 864
 
@@ -872,10 +872,10 @@  discard block
 block discarded – undo
872 872
         </div>
873 873
 
874 874
         <?php
875
-        $html = ob_get_clean();
876
-    }
875
+		$html = ob_get_clean();
876
+	}
877 877
 
878
-    return $html;
878
+	return $html;
879 879
 }
880 880
 add_filter('geodir_custom_field_input_datepicker','geodir_cfi_datepicker',10,2);
881 881
 
@@ -891,31 +891,31 @@  discard block
 block discarded – undo
891 891
  */
892 892
 function geodir_cfi_time($html,$cf){
893 893
 
894
-    $html_var = $cf['htmlvar_name'];
894
+	$html_var = $cf['htmlvar_name'];
895 895
 
896
-    // Check if there is a custom field specific filter.
897
-    if(has_filter("geodir_custom_field_input_time_{$html_var}")){
898
-        /**
899
-         * Filter the time html by individual custom field.
900
-         *
901
-         * @param string $html The html to filter.
902
-         * @param array $cf The custom field array.
903
-         * @since 1.6.6
904
-         */
905
-        $html = apply_filters("geodir_custom_field_input_time_{$html_var}",$html,$cf);
906
-    }
896
+	// Check if there is a custom field specific filter.
897
+	if(has_filter("geodir_custom_field_input_time_{$html_var}")){
898
+		/**
899
+		 * Filter the time html by individual custom field.
900
+		 *
901
+		 * @param string $html The html to filter.
902
+		 * @param array $cf The custom field array.
903
+		 * @since 1.6.6
904
+		 */
905
+		$html = apply_filters("geodir_custom_field_input_time_{$html_var}",$html,$cf);
906
+	}
907 907
 
908
-    // If no html then we run the standard output.
909
-    if(empty($html)) {
908
+	// If no html then we run the standard output.
909
+	if(empty($html)) {
910 910
 
911
-        ob_start(); // Start  buffering;
912
-        $value = geodir_get_cf_value($cf);
911
+		ob_start(); // Start  buffering;
912
+		$value = geodir_get_cf_value($cf);
913 913
 
914
-        $name = $cf['name'];
914
+		$name = $cf['name'];
915 915
 
916
-        if ($value != '')
917
-            $value = date('H:i', strtotime($value));
918
-        ?>
916
+		if ($value != '')
917
+			$value = date('H:i', strtotime($value));
918
+		?>
919 919
         <script type="text/javascript">
920 920
             jQuery(document).ready(function () {
921 921
 
@@ -931,7 +931,7 @@  discard block
 block discarded – undo
931 931
             <label>
932 932
 
933 933
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
934
-                echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
934
+				echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
935 935
                 <?php if ($cf['is_required']) echo '<span>*</span>';?>
936 936
             </label>
937 937
             <input readonly="readonly" field_type="<?php echo $cf['type'];?>" name="<?php echo $name;?>"
@@ -943,10 +943,10 @@  discard block
 block discarded – undo
943 943
             <?php } ?>
944 944
         </div>
945 945
         <?php
946
-        $html = ob_get_clean();
947
-    }
946
+		$html = ob_get_clean();
947
+	}
948 948
 
949
-    return $html;
949
+	return $html;
950 950
 }
951 951
 add_filter('geodir_custom_field_input_time','geodir_cfi_time',10,2);
952 952
 
@@ -962,100 +962,100 @@  discard block
 block discarded – undo
962 962
  */
963 963
 function geodir_cfi_address($html,$cf){
964 964
 
965
-    $html_var = $cf['htmlvar_name'];
966
-
967
-    // Check if there is a custom field specific filter.
968
-    if(has_filter("geodir_custom_field_input_address_{$html_var}")){
969
-        /**
970
-         * Filter the address html by individual custom field.
971
-         *
972
-         * @param string $html The html to filter.
973
-         * @param array $cf The custom field array.
974
-         * @since 1.6.6
975
-         */
976
-        $html = apply_filters("geodir_custom_field_input_address_{$html_var}",$html,$cf);
977
-    }
978
-
979
-    // If no html then we run the standard output.
980
-    if(empty($html)) {
981
-
982
-        global $gd_session;
983
-        ob_start(); // Start  buffering;
984
-        $value = geodir_get_cf_value($cf);
985
-        $name = $cf['name'];
986
-        $type = $cf['type'];
987
-        $admin_desc = $cf['desc'];
988
-        $is_required = $cf['is_required'];
989
-        $required_msg = $cf['required_msg'];
990
-        $site_title = $cf['site_title'];
991
-        $is_admin = $cf['is_admin'];
992
-        $extra_fields = unserialize($cf['extra_fields']);
993
-        $prefix = $name . '_';
994
-
995
-        ($site_title != '') ? $address_title = $site_title : $address_title = geodir_ucwords($prefix . ' address');
996
-        ($extra_fields['zip_lable'] != '') ? $zip_title = $extra_fields['zip_lable'] : $zip_title = geodir_ucwords($prefix . ' zip/post code ');
997
-        ($extra_fields['map_lable'] != '') ? $map_title = $extra_fields['map_lable'] : $map_title = geodir_ucwords('set address on map');
998
-        ($extra_fields['mapview_lable'] != '') ? $mapview_title = $extra_fields['mapview_lable'] : $mapview_title = geodir_ucwords($prefix . ' mapview');
999
-
1000
-        $address = '';
1001
-        $zip = '';
1002
-        $mapview = '';
1003
-        $mapzoom = '';
1004
-        $lat = '';
1005
-        $lng = '';
1006
-
1007
-        if (isset($_REQUEST['backandedit']) && $_REQUEST['backandedit'] && $gd_ses_listing = $gd_session->get('listing')) {
1008
-            $post = $gd_ses_listing;
1009
-            $address = $post[$prefix . 'address'];
1010
-            $zip = isset($post[$prefix . 'zip']) ? $post[$prefix . 'zip'] : '';
1011
-            $lat = isset($post[$prefix . 'latitude']) ? $post[$prefix . 'latitude'] : '';
1012
-            $lng = isset($post[$prefix . 'longitude']) ? $post[$prefix . 'longitude'] : '';
1013
-            $mapview = isset($post[$prefix . 'mapview']) ? $post[$prefix . 'mapview'] : '';
1014
-            $mapzoom = isset($post[$prefix . 'mapzoom']) ? $post[$prefix . 'mapzoom'] : '';
1015
-        } else if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '' && $post_info = geodir_get_post_info($_REQUEST['pid'])) {
1016
-            $post_info = (array)$post_info;
1017
-
1018
-            $address = $post_info[$prefix . 'address'];
1019
-            $zip = isset($post_info[$prefix . 'zip']) ? $post_info[$prefix . 'zip'] : '';
1020
-            $lat = isset($post_info[$prefix . 'latitude']) ? $post_info[$prefix . 'latitude'] : '';
1021
-            $lng = isset($post_info[$prefix . 'longitude']) ? $post_info[$prefix . 'longitude'] : '';
1022
-            $mapview = isset($post_info[$prefix . 'mapview']) ? $post_info[$prefix . 'mapview'] : '';
1023
-            $mapzoom = isset($post_info[$prefix . 'mapzoom']) ? $post_info[$prefix . 'mapzoom'] : '';
1024
-        }
1025
-
1026
-        $location = geodir_get_default_location();
1027
-        if (empty($city)) $city = isset($location->city) ? $location->city : '';
1028
-        if (empty($region)) $region = isset($location->region) ? $location->region : '';
1029
-        if (empty($country)) $country = isset($location->country) ? $location->country : '';
1030
-
1031
-        $lat_lng_blank = false;
1032
-        if (empty($lat) && empty($lng)) {
1033
-            $lat_lng_blank = true;
1034
-        }
1035
-
1036
-        if (empty($lat)) $lat = isset($location->city_latitude) ? $location->city_latitude : '';
1037
-        if (empty($lng)) $lng = isset($location->city_longitude) ? $location->city_longitude : '';
1038
-
1039
-        /**
1040
-         * Filter the default latitude.
1041
-         *
1042
-         * @since 1.0.0
1043
-         *
1044
-         * @param float $lat Default latitude.
1045
-         * @param bool $is_admin For admin use only?.
1046
-         */
1047
-        $lat = apply_filters('geodir_default_latitude', $lat, $is_admin);
1048
-        /**
1049
-         * Filter the default longitude.
1050
-         *
1051
-         * @since 1.0.0
1052
-         *
1053
-         * @param float $lat Default longitude.
1054
-         * @param bool $is_admin For admin use only?.
1055
-         */
1056
-        $lng = apply_filters('geodir_default_longitude', $lng, $is_admin);
1057
-
1058
-        ?>
965
+	$html_var = $cf['htmlvar_name'];
966
+
967
+	// Check if there is a custom field specific filter.
968
+	if(has_filter("geodir_custom_field_input_address_{$html_var}")){
969
+		/**
970
+		 * Filter the address html by individual custom field.
971
+		 *
972
+		 * @param string $html The html to filter.
973
+		 * @param array $cf The custom field array.
974
+		 * @since 1.6.6
975
+		 */
976
+		$html = apply_filters("geodir_custom_field_input_address_{$html_var}",$html,$cf);
977
+	}
978
+
979
+	// If no html then we run the standard output.
980
+	if(empty($html)) {
981
+
982
+		global $gd_session;
983
+		ob_start(); // Start  buffering;
984
+		$value = geodir_get_cf_value($cf);
985
+		$name = $cf['name'];
986
+		$type = $cf['type'];
987
+		$admin_desc = $cf['desc'];
988
+		$is_required = $cf['is_required'];
989
+		$required_msg = $cf['required_msg'];
990
+		$site_title = $cf['site_title'];
991
+		$is_admin = $cf['is_admin'];
992
+		$extra_fields = unserialize($cf['extra_fields']);
993
+		$prefix = $name . '_';
994
+
995
+		($site_title != '') ? $address_title = $site_title : $address_title = geodir_ucwords($prefix . ' address');
996
+		($extra_fields['zip_lable'] != '') ? $zip_title = $extra_fields['zip_lable'] : $zip_title = geodir_ucwords($prefix . ' zip/post code ');
997
+		($extra_fields['map_lable'] != '') ? $map_title = $extra_fields['map_lable'] : $map_title = geodir_ucwords('set address on map');
998
+		($extra_fields['mapview_lable'] != '') ? $mapview_title = $extra_fields['mapview_lable'] : $mapview_title = geodir_ucwords($prefix . ' mapview');
999
+
1000
+		$address = '';
1001
+		$zip = '';
1002
+		$mapview = '';
1003
+		$mapzoom = '';
1004
+		$lat = '';
1005
+		$lng = '';
1006
+
1007
+		if (isset($_REQUEST['backandedit']) && $_REQUEST['backandedit'] && $gd_ses_listing = $gd_session->get('listing')) {
1008
+			$post = $gd_ses_listing;
1009
+			$address = $post[$prefix . 'address'];
1010
+			$zip = isset($post[$prefix . 'zip']) ? $post[$prefix . 'zip'] : '';
1011
+			$lat = isset($post[$prefix . 'latitude']) ? $post[$prefix . 'latitude'] : '';
1012
+			$lng = isset($post[$prefix . 'longitude']) ? $post[$prefix . 'longitude'] : '';
1013
+			$mapview = isset($post[$prefix . 'mapview']) ? $post[$prefix . 'mapview'] : '';
1014
+			$mapzoom = isset($post[$prefix . 'mapzoom']) ? $post[$prefix . 'mapzoom'] : '';
1015
+		} else if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '' && $post_info = geodir_get_post_info($_REQUEST['pid'])) {
1016
+			$post_info = (array)$post_info;
1017
+
1018
+			$address = $post_info[$prefix . 'address'];
1019
+			$zip = isset($post_info[$prefix . 'zip']) ? $post_info[$prefix . 'zip'] : '';
1020
+			$lat = isset($post_info[$prefix . 'latitude']) ? $post_info[$prefix . 'latitude'] : '';
1021
+			$lng = isset($post_info[$prefix . 'longitude']) ? $post_info[$prefix . 'longitude'] : '';
1022
+			$mapview = isset($post_info[$prefix . 'mapview']) ? $post_info[$prefix . 'mapview'] : '';
1023
+			$mapzoom = isset($post_info[$prefix . 'mapzoom']) ? $post_info[$prefix . 'mapzoom'] : '';
1024
+		}
1025
+
1026
+		$location = geodir_get_default_location();
1027
+		if (empty($city)) $city = isset($location->city) ? $location->city : '';
1028
+		if (empty($region)) $region = isset($location->region) ? $location->region : '';
1029
+		if (empty($country)) $country = isset($location->country) ? $location->country : '';
1030
+
1031
+		$lat_lng_blank = false;
1032
+		if (empty($lat) && empty($lng)) {
1033
+			$lat_lng_blank = true;
1034
+		}
1035
+
1036
+		if (empty($lat)) $lat = isset($location->city_latitude) ? $location->city_latitude : '';
1037
+		if (empty($lng)) $lng = isset($location->city_longitude) ? $location->city_longitude : '';
1038
+
1039
+		/**
1040
+		 * Filter the default latitude.
1041
+		 *
1042
+		 * @since 1.0.0
1043
+		 *
1044
+		 * @param float $lat Default latitude.
1045
+		 * @param bool $is_admin For admin use only?.
1046
+		 */
1047
+		$lat = apply_filters('geodir_default_latitude', $lat, $is_admin);
1048
+		/**
1049
+		 * Filter the default longitude.
1050
+		 *
1051
+		 * @since 1.0.0
1052
+		 *
1053
+		 * @param float $lat Default longitude.
1054
+		 * @param bool $is_admin For admin use only?.
1055
+		 */
1056
+		$lng = apply_filters('geodir_default_longitude', $lng, $is_admin);
1057
+
1058
+		?>
1059 1059
 
1060 1060
         <div id="geodir_<?php echo $prefix . 'address';?>_row"
1061 1061
              class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
@@ -1074,17 +1074,17 @@  discard block
 block discarded – undo
1074 1074
 
1075 1075
 
1076 1076
         <?php
1077
-        /**
1078
-         * Called after the address input on the add listings.
1079
-         *
1080
-         * This is used by the location manage to add further locations info etc.
1081
-         *
1082
-         * @since 1.0.0
1083
-         * @param array $cf The array of setting for the custom field. {@see geodir_custom_field_save()}.
1084
-         */
1085
-        do_action('geodir_address_extra_listing_fields', $cf);
1086
-
1087
-        if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) { ?>
1077
+		/**
1078
+		 * Called after the address input on the add listings.
1079
+		 *
1080
+		 * This is used by the location manage to add further locations info etc.
1081
+		 *
1082
+		 * @since 1.0.0
1083
+		 * @param array $cf The array of setting for the custom field. {@see geodir_custom_field_save()}.
1084
+		 */
1085
+		do_action('geodir_address_extra_listing_fields', $cf);
1086
+
1087
+		if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) { ?>
1088 1088
 
1089 1089
             <div id="geodir_<?php echo $prefix . 'zip'; ?>_row"
1090 1090
                  class="<?php /*if($is_required) echo 'required_field';*/ ?> geodir_form_row clearfix gd-fieldset-details">
@@ -1105,22 +1105,22 @@  discard block
 block discarded – undo
1105 1105
 
1106 1106
             <div id="geodir_<?php echo $prefix . 'map'; ?>_row" class="geodir_form_row clearfix gd-fieldset-details">
1107 1107
                 <?php
1108
-                /**
1109
-                 * Contains add listing page map functions.
1110
-                 *
1111
-                 * @since 1.0.0
1112
-                 */
1113
-                include(geodir_plugin_path() . "/geodirectory-functions/map-functions/map_on_add_listing_page.php");
1114
-                if ($lat_lng_blank) {
1115
-                    $lat = '';
1116
-                    $lng = '';
1117
-                }
1118
-                ?>
1108
+				/**
1109
+				 * Contains add listing page map functions.
1110
+				 *
1111
+				 * @since 1.0.0
1112
+				 */
1113
+				include(geodir_plugin_path() . "/geodirectory-functions/map-functions/map_on_add_listing_page.php");
1114
+				if ($lat_lng_blank) {
1115
+					$lat = '';
1116
+					$lng = '';
1117
+				}
1118
+				?>
1119 1119
                 <span class="geodir_message_note"><?php echo GET_MAP_MSG; ?></span>
1120 1120
             </div>
1121 1121
             <?php
1122
-            /* show lat lng */
1123
-            $style_latlng = ((isset($extra_fields['show_latlng']) && $extra_fields['show_latlng']) || is_admin()) ? '' : 'style="display:none"'; ?>
1122
+			/* show lat lng */
1123
+			$style_latlng = ((isset($extra_fields['show_latlng']) && $extra_fields['show_latlng']) || is_admin()) ? '' : 'style="display:none"'; ?>
1124 1124
             <div id="geodir_<?php echo $prefix . 'latitude'; ?>_row"
1125 1125
                  class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details" <?php echo $style_latlng; ?>>
1126 1126
                 <label>
@@ -1161,27 +1161,27 @@  discard block
 block discarded – undo
1161 1161
                                                             class="gd-checkbox"
1162 1162
                                                             name="<?php echo $prefix . 'mapview'; ?>"
1163 1163
                                                             id="<?php echo $prefix . 'mapview'; ?>" <?php if ($mapview == 'ROADMAP' || $mapview == '') {
1164
-                            echo 'checked="checked"';
1165
-                        } ?>  value="ROADMAP" size="25"/> <?php _e('Default Map', 'geodirectory'); ?></span>
1164
+							echo 'checked="checked"';
1165
+						} ?>  value="ROADMAP" size="25"/> <?php _e('Default Map', 'geodirectory'); ?></span>
1166 1166
                     <span class="geodir_user_define"> <input field_type="<?php echo $type; ?>" type="radio"
1167 1167
                                                              class="gd-checkbox"
1168 1168
                                                              name="<?php echo $prefix . 'mapview'; ?>"
1169 1169
                                                              id="map_view1" <?php if ($mapview == 'SATELLITE') {
1170
-                            echo 'checked="checked"';
1171
-                        } ?> value="SATELLITE" size="25"/> <?php _e('Satellite Map', 'geodirectory'); ?></span>
1170
+							echo 'checked="checked"';
1171
+						} ?> value="SATELLITE" size="25"/> <?php _e('Satellite Map', 'geodirectory'); ?></span>
1172 1172
 
1173 1173
                     <span class="geodir_user_define"><input field_type="<?php echo $type; ?>" type="radio"
1174 1174
                                                             class="gd-checkbox"
1175 1175
                                                             name="<?php echo $prefix . 'mapview'; ?>"
1176 1176
                                                             id="map_view2" <?php if ($mapview == 'HYBRID') {
1177
-                            echo 'checked="checked"';
1178
-                        } ?>  value="HYBRID" size="25"/> <?php _e('Hybrid Map', 'geodirectory'); ?></span>
1177
+							echo 'checked="checked"';
1178
+						} ?>  value="HYBRID" size="25"/> <?php _e('Hybrid Map', 'geodirectory'); ?></span>
1179 1179
 					<span class="geodir_user_define"><input field_type="<?php echo $type; ?>" type="radio"
1180 1180
                                                             class="gd-checkbox"
1181 1181
                                                             name="<?php echo $prefix . 'mapview'; ?>"
1182 1182
                                                             id="map_view3" <?php if ($mapview == 'TERRAIN') {
1183
-                            echo 'checked="checked"';
1184
-                        } ?>  value="TERRAIN" size="25"/> <?php _e('Terrain Map', 'geodirectory'); ?></span>
1183
+							echo 'checked="checked"';
1184
+						} ?>  value="TERRAIN" size="25"/> <?php _e('Terrain Map', 'geodirectory'); ?></span>
1185 1185
 
1186 1186
 
1187 1187
             </div>
@@ -1189,14 +1189,14 @@  discard block
 block discarded – undo
1189 1189
 
1190 1190
         <?php if (isset($extra_fields['show_mapzoom']) && $extra_fields['show_mapzoom']) { ?>
1191 1191
             <input type="hidden" value="<?php if (isset($mapzoom)) {
1192
-                echo esc_attr($mapzoom);
1193
-            } ?>" name="<?php echo $prefix . 'mapzoom'; ?>" id="<?php echo $prefix . 'mapzoom'; ?>"/>
1192
+				echo esc_attr($mapzoom);
1193
+			} ?>" name="<?php echo $prefix . 'mapzoom'; ?>" id="<?php echo $prefix . 'mapzoom'; ?>"/>
1194 1194
         <?php }
1195 1195
 
1196
-        $html = ob_get_clean();
1197
-    }
1196
+		$html = ob_get_clean();
1197
+	}
1198 1198
 
1199
-    return $html;
1199
+	return $html;
1200 1200
 }
1201 1201
 add_filter('geodir_custom_field_input_address','geodir_cfi_address',10,2);
1202 1202
 
@@ -1213,137 +1213,137 @@  discard block
 block discarded – undo
1213 1213
  */
1214 1214
 function geodir_cfi_taxonomy($html,$cf){
1215 1215
 
1216
-    $html_var = $cf['htmlvar_name'];
1217
-
1218
-    // Check if there is a custom field specific filter.
1219
-    if(has_filter("geodir_custom_field_input_taxonomy_{$html_var}")){
1220
-        /**
1221
-         * Filter the taxonomy html by individual custom field.
1222
-         *
1223
-         * @param string $html The html to filter.
1224
-         * @param array $cf The custom field array.
1225
-         * @since 1.6.6
1226
-         */
1227
-        $html = apply_filters("geodir_custom_field_input_taxonomy_{$html_var}",$html,$cf);
1228
-    }
1229
-
1230
-    // If no html then we run the standard output.
1231
-    if(empty($html)) {
1232
-
1233
-        ob_start(); // Start  buffering;
1234
-        $value = geodir_get_cf_value($cf);
1235
-
1236
-        $name = $cf['name'];
1237
-        $site_title = $cf['site_title'];
1238
-        $admin_desc = $cf['desc'];
1239
-        $is_required = $cf['is_required'];
1240
-        $is_admin = $cf['is_admin'];
1241
-        $required_msg = $cf['required_msg'];
1242
-
1243
-        if ($value == $cf['default']) {
1244
-            $value = '';
1245
-        } ?>
1216
+	$html_var = $cf['htmlvar_name'];
1217
+
1218
+	// Check if there is a custom field specific filter.
1219
+	if(has_filter("geodir_custom_field_input_taxonomy_{$html_var}")){
1220
+		/**
1221
+		 * Filter the taxonomy html by individual custom field.
1222
+		 *
1223
+		 * @param string $html The html to filter.
1224
+		 * @param array $cf The custom field array.
1225
+		 * @since 1.6.6
1226
+		 */
1227
+		$html = apply_filters("geodir_custom_field_input_taxonomy_{$html_var}",$html,$cf);
1228
+	}
1229
+
1230
+	// If no html then we run the standard output.
1231
+	if(empty($html)) {
1232
+
1233
+		ob_start(); // Start  buffering;
1234
+		$value = geodir_get_cf_value($cf);
1235
+
1236
+		$name = $cf['name'];
1237
+		$site_title = $cf['site_title'];
1238
+		$admin_desc = $cf['desc'];
1239
+		$is_required = $cf['is_required'];
1240
+		$is_admin = $cf['is_admin'];
1241
+		$required_msg = $cf['required_msg'];
1242
+
1243
+		if ($value == $cf['default']) {
1244
+			$value = '';
1245
+		} ?>
1246 1246
         <div id="<?php echo $name;?>_row"
1247 1247
              class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
1248 1248
             <label>
1249 1249
                 <?php $site_title = __($site_title, 'geodirectory');
1250
-                echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
1250
+				echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
1251 1251
                 <?php if ($is_required) echo '<span>*</span>';?>
1252 1252
             </label>
1253 1253
 
1254 1254
             <div id="<?php echo $name;?>" class="geodir_taxonomy_field" style="float:left; width:70%;">
1255 1255
                 <?php
1256
-                global $wpdb, $post, $cat_display, $post_cat, $package_id, $exclude_cats;
1256
+				global $wpdb, $post, $cat_display, $post_cat, $package_id, $exclude_cats;
1257 1257
 
1258
-                $exclude_cats = array();
1258
+				$exclude_cats = array();
1259 1259
 
1260
-                if ($is_admin == '1') {
1260
+				if ($is_admin == '1') {
1261 1261
 
1262
-                    $post_type = get_post_type();
1262
+					$post_type = get_post_type();
1263 1263
 
1264
-                    $package_info = array();
1264
+					$package_info = array();
1265 1265
 
1266
-                    $package_info = (array)geodir_post_package_info($package_info, $post, $post_type);
1266
+					$package_info = (array)geodir_post_package_info($package_info, $post, $post_type);
1267 1267
 
1268
-                    if (!empty($package_info)) {
1268
+					if (!empty($package_info)) {
1269 1269
 
1270
-                        if (isset($package_info['cat']) && $package_info['cat'] != '') {
1270
+						if (isset($package_info['cat']) && $package_info['cat'] != '') {
1271 1271
 
1272
-                            $exclude_cats = explode(',', $package_info['cat']);
1272
+							$exclude_cats = explode(',', $package_info['cat']);
1273 1273
 
1274
-                        }
1275
-                    }
1276
-                }
1274
+						}
1275
+					}
1276
+				}
1277 1277
 
1278
-                $cat_display = unserialize($cf['extra_fields']);
1278
+				$cat_display = unserialize($cf['extra_fields']);
1279 1279
 
1280
-                if (isset($_REQUEST['backandedit']) && (is_array($post_cat[$name]) && !empty($post_cat[$name]))) {
1280
+				if (isset($_REQUEST['backandedit']) && (is_array($post_cat[$name]) && !empty($post_cat[$name]))) {
1281 1281
 
1282
-                    $post_cat = implode(",", $post_cat[$name]);
1282
+					$post_cat = implode(",", $post_cat[$name]);
1283 1283
 
1284
-                } else {
1285
-                    if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '')
1286
-                        $post_cat = geodir_get_post_meta($_REQUEST['pid'], $name, true);
1287
-                }
1284
+				} else {
1285
+					if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '')
1286
+						$post_cat = geodir_get_post_meta($_REQUEST['pid'], $name, true);
1287
+				}
1288 1288
 
1289 1289
 
1290
-                global $geodir_addon_list;
1291
-                if (!empty($geodir_addon_list) && array_key_exists('geodir_payment_manager', $geodir_addon_list) && $geodir_addon_list['geodir_payment_manager'] == 'yes') {
1290
+				global $geodir_addon_list;
1291
+				if (!empty($geodir_addon_list) && array_key_exists('geodir_payment_manager', $geodir_addon_list) && $geodir_addon_list['geodir_payment_manager'] == 'yes') {
1292 1292
 
1293
-                    $catadd_limit = $wpdb->get_var(
1294
-                        $wpdb->prepare(
1295
-                            "SELECT cat_limit FROM " . GEODIR_PRICE_TABLE . " WHERE pid = %d",
1296
-                            array($package_id)
1297
-                        )
1298
-                    );
1293
+					$catadd_limit = $wpdb->get_var(
1294
+						$wpdb->prepare(
1295
+							"SELECT cat_limit FROM " . GEODIR_PRICE_TABLE . " WHERE pid = %d",
1296
+							array($package_id)
1297
+						)
1298
+					);
1299 1299
 
1300 1300
 
1301
-                } else {
1302
-                    $catadd_limit = 0;
1303
-                }
1301
+				} else {
1302
+					$catadd_limit = 0;
1303
+				}
1304 1304
 
1305 1305
 
1306
-                if ($cat_display != '' && $cat_display != 'ajax_chained') {
1306
+				if ($cat_display != '' && $cat_display != 'ajax_chained') {
1307 1307
 
1308
-                    $required_limit_msg = '';
1309
-                    if ($catadd_limit > 0 && $cat_display != 'select' && $cat_display != 'radio') {
1308
+					$required_limit_msg = '';
1309
+					if ($catadd_limit > 0 && $cat_display != 'select' && $cat_display != 'radio') {
1310 1310
 
1311
-                        $required_limit_msg = __('Only select', 'geodirectory') . ' ' . $catadd_limit . __(' categories for this package.', 'geodirectory');
1311
+						$required_limit_msg = __('Only select', 'geodirectory') . ' ' . $catadd_limit . __(' categories for this package.', 'geodirectory');
1312 1312
 
1313
-                    } else {
1314
-                        $required_limit_msg = $required_msg;
1315
-                    }
1313
+					} else {
1314
+						$required_limit_msg = $required_msg;
1315
+					}
1316 1316
 
1317
-                    echo '<input type="hidden" cat_limit="' . $catadd_limit . '" id="cat_limit" value="' . esc_attr($required_limit_msg) . '" name="cat_limit[' . $name . ']"  />';
1317
+					echo '<input type="hidden" cat_limit="' . $catadd_limit . '" id="cat_limit" value="' . esc_attr($required_limit_msg) . '" name="cat_limit[' . $name . ']"  />';
1318 1318
 
1319 1319
 
1320
-                    if ($cat_display == 'select' || $cat_display == 'multiselect') {
1320
+					if ($cat_display == 'select' || $cat_display == 'multiselect') {
1321 1321
 
1322
-                        $cat_display == '';
1323
-                        $multiple = '';
1324
-                        if ($cat_display == 'multiselect')
1325
-                            $multiple = 'multiple="multiple"';
1322
+						$cat_display == '';
1323
+						$multiple = '';
1324
+						if ($cat_display == 'multiselect')
1325
+							$multiple = 'multiple="multiple"';
1326 1326
 
1327
-                        echo '<select id="' . $name . '" ' . $multiple . ' type="' . $name . '" name="post_category[' . $name . '][]" alt="' . $name . '" field_type="' . $cat_display . '" class="geodir_textfield textfield_x chosen_select" data-placeholder="' . __('Select Category', 'geodirectory') . '">';
1327
+						echo '<select id="' . $name . '" ' . $multiple . ' type="' . $name . '" name="post_category[' . $name . '][]" alt="' . $name . '" field_type="' . $cat_display . '" class="geodir_textfield textfield_x chosen_select" data-placeholder="' . __('Select Category', 'geodirectory') . '">';
1328 1328
 
1329 1329
 
1330
-                        if ($cat_display == 'select')
1331
-                            echo '<option value="">' . __('Select Category', 'geodirectory') . '</option>';
1330
+						if ($cat_display == 'select')
1331
+							echo '<option value="">' . __('Select Category', 'geodirectory') . '</option>';
1332 1332
 
1333
-                    }
1333
+					}
1334 1334
 
1335
-                    echo geodir_custom_taxonomy_walker($name, $catadd_limit = 0);
1335
+					echo geodir_custom_taxonomy_walker($name, $catadd_limit = 0);
1336 1336
 
1337
-                    if ($cat_display == 'select' || $cat_display == 'multiselect')
1338
-                        echo '</select>';
1337
+					if ($cat_display == 'select' || $cat_display == 'multiselect')
1338
+						echo '</select>';
1339 1339
 
1340
-                } else {
1340
+				} else {
1341 1341
 
1342
-                    echo geodir_custom_taxonomy_walker2($name, $catadd_limit);
1342
+					echo geodir_custom_taxonomy_walker2($name, $catadd_limit);
1343 1343
 
1344
-                }
1344
+				}
1345 1345
 
1346
-                ?>
1346
+				?>
1347 1347
             </div>
1348 1348
 
1349 1349
             <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory');?></span>
@@ -1353,10 +1353,10 @@  discard block
 block discarded – undo
1353 1353
         </div>
1354 1354
 
1355 1355
         <?php
1356
-        $html = ob_get_clean();
1357
-    }
1356
+		$html = ob_get_clean();
1357
+	}
1358 1358
 
1359
-    return $html;
1359
+	return $html;
1360 1360
 }
1361 1361
 add_filter('geodir_custom_field_input_taxonomy','geodir_cfi_taxonomy',10,2);
1362 1362
 
@@ -1372,74 +1372,74 @@  discard block
 block discarded – undo
1372 1372
  */
1373 1373
 function geodir_cfi_file($html,$cf){
1374 1374
 
1375
-    $html_var = $cf['htmlvar_name'];
1375
+	$html_var = $cf['htmlvar_name'];
1376 1376
 
1377
-    // Check if there is a custom field specific filter.
1378
-    if(has_filter("geodir_custom_field_input_file_{$html_var}")){
1379
-        /**
1380
-         * Filter the file html by individual custom field.
1381
-         *
1382
-         * @param string $html The html to filter.
1383
-         * @param array $cf The custom field array.
1384
-         * @since 1.6.6
1385
-         */
1386
-        $html = apply_filters("geodir_custom_field_input_file_{$html_var}",$html,$cf);
1387
-    }
1377
+	// Check if there is a custom field specific filter.
1378
+	if(has_filter("geodir_custom_field_input_file_{$html_var}")){
1379
+		/**
1380
+		 * Filter the file html by individual custom field.
1381
+		 *
1382
+		 * @param string $html The html to filter.
1383
+		 * @param array $cf The custom field array.
1384
+		 * @since 1.6.6
1385
+		 */
1386
+		$html = apply_filters("geodir_custom_field_input_file_{$html_var}",$html,$cf);
1387
+	}
1388 1388
 
1389
-    // If no html then we run the standard output.
1390
-    if(empty($html)) {
1389
+	// If no html then we run the standard output.
1390
+	if(empty($html)) {
1391 1391
 
1392
-        ob_start(); // Start  buffering;
1393
-        $value = geodir_get_cf_value($cf);
1392
+		ob_start(); // Start  buffering;
1393
+		$value = geodir_get_cf_value($cf);
1394 1394
 
1395
-        $name = $cf['name'];
1396
-        $site_title = $cf['site_title'];
1397
-        $admin_desc = $cf['desc'];
1398
-        $is_required = $cf['is_required'];
1399
-        $required_msg = $cf['required_msg'];
1400
-        $extra_fields = unserialize($cf['extra_fields']);
1395
+		$name = $cf['name'];
1396
+		$site_title = $cf['site_title'];
1397
+		$admin_desc = $cf['desc'];
1398
+		$is_required = $cf['is_required'];
1399
+		$required_msg = $cf['required_msg'];
1400
+		$extra_fields = unserialize($cf['extra_fields']);
1401 1401
 
1402 1402
 
1403
-        // adjust values here
1404
-        $file_id = $name; // this will be the name of form field. Image url(s) will be submitted in $_POST using this key. So if $id == �img1� then $_POST[�img1�] will have all the image urls
1403
+		// adjust values here
1404
+		$file_id = $name; // this will be the name of form field. Image url(s) will be submitted in $_POST using this key. So if $id == �img1� then $_POST[�img1�] will have all the image urls
1405 1405
 
1406
-        if ($value != '') {
1406
+		if ($value != '') {
1407 1407
 
1408
-            $file_value = trim($value, ","); // this will be initial value of the above form field. Image urls.
1408
+			$file_value = trim($value, ","); // this will be initial value of the above form field. Image urls.
1409 1409
 
1410
-        } else
1411
-            $file_value = '';
1410
+		} else
1411
+			$file_value = '';
1412 1412
 
1413
-        if (isset($extra_fields['file_multiple']) && $extra_fields['file_multiple'])
1414
-            $file_multiple = true; // allow multiple files upload
1415
-        else
1416
-            $file_multiple = false;
1413
+		if (isset($extra_fields['file_multiple']) && $extra_fields['file_multiple'])
1414
+			$file_multiple = true; // allow multiple files upload
1415
+		else
1416
+			$file_multiple = false;
1417 1417
 
1418
-        if (isset($extra_fields['image_limit']) && $extra_fields['image_limit'])
1419
-            $file_image_limit = $extra_fields['image_limit'];
1420
-        else
1421
-            $file_image_limit = 1;
1418
+		if (isset($extra_fields['image_limit']) && $extra_fields['image_limit'])
1419
+			$file_image_limit = $extra_fields['image_limit'];
1420
+		else
1421
+			$file_image_limit = 1;
1422 1422
 
1423
-        $file_width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels)
1423
+		$file_width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels)
1424 1424
 
1425
-        $file_height = geodir_media_image_large_height(); // If you want to automatically resize all uploaded images then provide height here (in pixels)
1425
+		$file_height = geodir_media_image_large_height(); // If you want to automatically resize all uploaded images then provide height here (in pixels)
1426 1426
 
1427
-        if (!empty($file_value)) {
1428
-            $curImages = explode(',', $file_value);
1429
-            if (!empty($curImages))
1430
-                $file_totImg = count($curImages);
1431
-        }
1427
+		if (!empty($file_value)) {
1428
+			$curImages = explode(',', $file_value);
1429
+			if (!empty($curImages))
1430
+				$file_totImg = count($curImages);
1431
+		}
1432 1432
 
1433
-        $allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types'] ) ? implode(",", $extra_fields['gd_file_types']) : '';
1434
-        $display_file_types = $allowed_file_types != '' ? '.' . implode(", .", $extra_fields['gd_file_types']) : '';
1433
+		$allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types'] ) ? implode(",", $extra_fields['gd_file_types']) : '';
1434
+		$display_file_types = $allowed_file_types != '' ? '.' . implode(", .", $extra_fields['gd_file_types']) : '';
1435 1435
 
1436
-        ?>
1436
+		?>
1437 1437
         <?php /*?> <h5 class="geodir-form_title"> <?php echo $site_title; ?>
1438 1438
 				 <?php if($file_image_limit!=0 && $file_image_limit==1 ){echo '<br /><small>('.__('You can upload').' '.$file_image_limit.' '.__('image with this package').')</small>';} ?>
1439 1439
 				 <?php if($file_image_limit!=0 && $file_image_limit>1 ){echo '<br /><small>('.__('You can upload').' '.$file_image_limit.' '.__('images with this package').')</small>';} ?>
1440 1440
 				 <?php if($file_image_limit==0){echo '<br /><small>('.__('You can upload unlimited images with this package').')</small>';} ?>
1441 1441
 			</h5>   <?php */
1442
-        ?>
1442
+		?>
1443 1443
 
1444 1444
         <div id="<?php echo $name;?>_row"
1445 1445
              class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
@@ -1447,7 +1447,7 @@  discard block
 block discarded – undo
1447 1447
             <div id="<?php echo $file_id; ?>dropbox" style="text-align:center;">
1448 1448
                 <label
1449 1449
                     style="text-align:left; padding-top:10px;"><?php $site_title = __($site_title, 'geodirectory');
1450
-                    echo $site_title; ?><?php if ($is_required) echo '<span>*</span>';?></label>
1450
+					echo $site_title; ?><?php if ($is_required) echo '<span>*</span>';?></label>
1451 1451
                 <input class="geodir-custom-file-upload" field_type="file" type="hidden"
1452 1452
                        name="<?php echo $file_id; ?>" id="<?php echo $file_id; ?>"
1453 1453
                        value="<?php echo esc_attr($file_value); ?>"/>
@@ -1459,17 +1459,17 @@  discard block
 block discarded – undo
1459 1459
                 <?php } ?>
1460 1460
                 <input type="hidden" name="<?php echo $file_id; ?>totImg" id="<?php echo $file_id; ?>totImg"
1461 1461
                        value="<?php if (isset($file_totImg)) {
1462
-                           echo esc_attr($file_totImg);
1463
-                       } else {
1464
-                           echo '0';
1465
-                       } ?>"/>
1462
+						   echo esc_attr($file_totImg);
1463
+					   } else {
1464
+						   echo '0';
1465
+					   } ?>"/>
1466 1466
 
1467 1467
                 <div style="float:left; width:55%;">
1468 1468
                     <div
1469 1469
                         class="plupload-upload-uic hide-if-no-js <?php if ($file_multiple): ?>plupload-upload-uic-multiple<?php endif; ?>"
1470 1470
                         id="<?php echo $file_id; ?>plupload-upload-ui" style="float:left; width:30%;">
1471 1471
                         <?php /*?><h4><?php _e('Drop files to upload');?></h4><br/><?php */
1472
-                        ?>
1472
+						?>
1473 1473
                         <input id="<?php echo $file_id; ?>plupload-browse-button" type="button"
1474 1474
                                value="<?php ($file_image_limit > 1 ? esc_attr_e('Select Files', 'geodirectory') : esc_attr_e('Select File', 'geodirectory') ); ?>"
1475 1475
                                class="geodir_button" style="margin-top:10px;"/>
@@ -1488,7 +1488,7 @@  discard block
 block discarded – undo
1488 1488
                         style=" clear:inherit; margin-top:0; margin-left:15px; padding-top:10px; float:left; width:50%;">
1489 1489
                     </div>
1490 1490
                     <?php /*?><span id="upload-msg" ><?php _e('Please drag &amp; drop the images to rearrange the order');?></span><?php */
1491
-                    ?>
1491
+					?>
1492 1492
 
1493 1493
                     <span id="<?php echo $file_id; ?>upload-error" style="display:none"></span>
1494 1494
 
@@ -1502,9 +1502,9 @@  discard block
 block discarded – undo
1502 1502
 
1503 1503
 
1504 1504
         <?php
1505
-        $html = ob_get_clean();
1506
-    }
1505
+		$html = ob_get_clean();
1506
+	}
1507 1507
 
1508
-    return $html;
1508
+	return $html;
1509 1509
 }
1510 1510
 add_filter('geodir_custom_field_input_file','geodir_cfi_file',10,2);
1511 1511
\ No newline at end of file
Please login to merge, or discard this patch.
geodirectory-functions/custom_fields_functions.php 4 patches
Doc Comments   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1345,6 +1345,9 @@  discard block
 block discarded – undo
1345 1345
 }
1346 1346
 
1347 1347
 
1348
+/**
1349
+ * @return string
1350
+ */
1348 1351
 function geodir_field_icon_proccess($cf){
1349 1352
 
1350 1353
 
@@ -1738,7 +1741,7 @@  discard block
 block discarded – undo
1738 1741
  * @global object $wpdb WordPress Database object.
1739 1742
  * @global string $plugin_prefix Geodirectory plugin table prefix.
1740 1743
  * @param int $post_id The post ID.
1741
- * @return mixed Returns video.
1744
+ * @return string Returns video.
1742 1745
  */
1743 1746
 function geodir_get_video($post_id)
1744 1747
 {
@@ -1764,7 +1767,7 @@  discard block
 block discarded – undo
1764 1767
  * @global object $wpdb WordPress Database object.
1765 1768
  * @global string $plugin_prefix Geodirectory plugin table prefix.
1766 1769
  * @param int $post_id The post ID.
1767
- * @return mixed Returns special offers.
1770
+ * @return string Returns special offers.
1768 1771
  */
1769 1772
 function geodir_get_special_offers($post_id)
1770 1773
 {
@@ -1788,7 +1791,7 @@  discard block
 block discarded – undo
1788 1791
      *
1789 1792
      * @since 1.0.0
1790 1793
      * @package GeoDirectory
1791
-     * @return mixed|void Returns max upload file size.
1794
+     * @return string|null Returns max upload file size.
1792 1795
      */
1793 1796
     function geodir_max_upload_size()
1794 1797
     {
@@ -2157,7 +2160,6 @@  discard block
 block discarded – undo
2157 2160
      * @param string $field_type The form field type.
2158 2161
      * @param object|int $result_str The custom field results object or row id.
2159 2162
      * @param string $field_ins_upd When set to "submit" displays form.
2160
-     * @param bool $default when set to true field will be for admin use only.
2161 2163
      */
2162 2164
     function geodir_custom_sort_field_adminhtml($field_type, $result_str, $field_ins_upd = '', $field_type_key='')
2163 2165
     {
Please login to merge, or discard this patch.
Braces   +136 added lines, -94 removed lines patch added patch discarded remove patch
@@ -51,8 +51,9 @@  discard block
 block discarded – undo
51 51
         global $wpdb;
52 52
         $result = 0;// no rows affected
53 53
         if (!geodir_column_exist($db, $column)) {
54
-            if (!empty($db) && !empty($column))
55
-                $result = $wpdb->query("ALTER TABLE `$db` ADD `$column`  $column_attr");
54
+            if (!empty($db) && !empty($column)) {
55
+                            $result = $wpdb->query("ALTER TABLE `$db` ADD `$column`  $column_attr");
56
+            }
56 57
         }
57 58
         return $result;
58 59
     }
@@ -82,10 +83,11 @@  discard block
 block discarded – undo
82 83
 
83 84
     $default_query = '';
84 85
 
85
-    if ($default == 'default')
86
-        $default_query .= " and is_admin IN ('1') ";
87
-    elseif ($default == 'custom')
88
-        $default_query .= " and is_admin = '0' ";
86
+    if ($default == 'default') {
87
+            $default_query .= " and is_admin IN ('1') ";
88
+    } elseif ($default == 'custom') {
89
+            $default_query .= " and is_admin = '0' ";
90
+    }
89 91
 
90 92
     if ($fields_location == 'none') {
91 93
     } else{
@@ -239,10 +241,12 @@  discard block
 block discarded – undo
239 241
                 }
240 242
 
241 243
                 return $field_id;
242
-            } else
243
-                return 0;
244
-        } else
245
-            return 0;
244
+            } else {
245
+                            return 0;
246
+            }
247
+        } else {
248
+                    return 0;
249
+        }
246 250
     }
247 251
 }
248 252
 
@@ -349,7 +353,9 @@  discard block
 block discarded – undo
349 353
 
350 354
 
351 355
 
352
-            if ($post_type == '') $post_type = 'gd_place';
356
+            if ($post_type == '') {
357
+            	$post_type = 'gd_place';
358
+            }
353 359
 
354 360
 
355 361
             $detail_table = $plugin_prefix . $post_type . '_detail';
@@ -389,16 +395,17 @@  discard block
 block discarded – undo
389 395
             }
390 396
 
391 397
             $option_values = '';
392
-            if (isset($request_field['option_values']))
393
-                $option_values = $request_field['option_values'];
398
+            if (isset($request_field['option_values'])) {
399
+                            $option_values = $request_field['option_values'];
400
+            }
394 401
 
395 402
             $cat_sort = isset($request_field['cat_sort']) ? $request_field['cat_sort'] : '0';
396 403
 
397 404
             $cat_filter = isset($request_field['cat_filter']) ? $request_field['cat_filter'] : '0';
398 405
 
399
-            if (isset($request_field['show_on_pkg']) && !empty($request_field['show_on_pkg']))
400
-                $price_pkg = implode(",", $request_field['show_on_pkg']);
401
-            else {
406
+            if (isset($request_field['show_on_pkg']) && !empty($request_field['show_on_pkg'])) {
407
+                            $price_pkg = implode(",", $request_field['show_on_pkg']);
408
+            } else {
402 409
                 $package_info = array();
403 410
 
404 411
                 $package_info = geodir_post_package_info($package_info, '', $post_type);
@@ -406,22 +413,29 @@  discard block
 block discarded – undo
406 413
             }
407 414
 
408 415
 
409
-            if (isset($request_field['extra']) && !empty($request_field['extra']))
410
-                $extra_fields = $request_field['extra'];
416
+            if (isset($request_field['extra']) && !empty($request_field['extra'])) {
417
+                            $extra_fields = $request_field['extra'];
418
+            }
411 419
 
412
-            if (isset($request_field['is_default']) && $request_field['is_default'] != '')
413
-                $is_default = $request_field['is_default'];
414
-            else
415
-                $is_default = '0';
420
+            if (isset($request_field['is_default']) && $request_field['is_default'] != '') {
421
+                            $is_default = $request_field['is_default'];
422
+            } else {
423
+                            $is_default = '0';
424
+            }
416 425
 
417
-            if (isset($request_field['is_admin']) && $request_field['is_admin'] != '')
418
-                $is_admin = $request_field['is_admin'];
419
-            else
420
-                $is_admin = '0';
426
+            if (isset($request_field['is_admin']) && $request_field['is_admin'] != '') {
427
+                            $is_admin = $request_field['is_admin'];
428
+            } else {
429
+                            $is_admin = '0';
430
+            }
421 431
 
422 432
 
423
-            if ($is_active == '') $is_active = 1;
424
-            if ($is_required == '') $is_required = 0;
433
+            if ($is_active == '') {
434
+            	$is_active = 1;
435
+            }
436
+            if ($is_required == '') {
437
+            	$is_required = 0;
438
+            }
425 439
 
426 440
 
427 441
             if ($sort_order == '') {
@@ -690,7 +704,7 @@  discard block
 block discarded – undo
690 704
                                 }
691 705
                                 if($op_max){$op_size =$op_max; }
692 706
                             }
693
-                        }elseif(isset($option_values) && $option_values && $field_type=='multiselect'){
707
+                        } elseif(isset($option_values) && $option_values && $field_type=='multiselect'){
694 708
                             if(strlen($option_values)){
695 709
                                 $op_size =  strlen($option_values);
696 710
                             }
@@ -707,11 +721,13 @@  discard block
 block discarded – undo
707 721
                             return __('Column change failed, you may have too many columns.','geodirectory');
708 722
                         }
709 723
 
710
-                        if (isset($request_field['cat_display_type']))
711
-                            $extra_fields = $request_field['cat_display_type'];
724
+                        if (isset($request_field['cat_display_type'])) {
725
+                                                    $extra_fields = $request_field['cat_display_type'];
726
+                        }
712 727
 
713
-                        if (isset($request_field['multi_display_type']))
714
-                            $extra_fields = $request_field['multi_display_type'];
728
+                        if (isset($request_field['multi_display_type'])) {
729
+                                                    $extra_fields = $request_field['multi_display_type'];
730
+                        }
715 731
 
716 732
 
717 733
                         break;
@@ -725,8 +741,9 @@  discard block
 block discarded – undo
725 741
                         if($alter_result===false){
726 742
                             return __('Column change failed, you may have too many columns.','geodirectory');
727 743
                         }
728
-                        if (isset($request_field['advanced_editor']))
729
-                            $extra_fields = $request_field['advanced_editor'];
744
+                        if (isset($request_field['advanced_editor'])) {
745
+                                                    $extra_fields = $request_field['advanced_editor'];
746
+                        }
730 747
 
731 748
                         break;
732 749
 
@@ -822,8 +839,9 @@  discard block
 block discarded – undo
822 839
                 );
823 840
 
824 841
 
825
-                if ($cat_sort == '')
826
-                    $wpdb->query($wpdb->prepare("delete from " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " where post_type = %s and htmlvar_name = %s", array($post_type, $htmlvar_name)));
842
+                if ($cat_sort == '') {
843
+                                    $wpdb->query($wpdb->prepare("delete from " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " where post_type = %s and htmlvar_name = %s", array($post_type, $htmlvar_name)));
844
+                }
827 845
 
828 846
 
829 847
                 /**
@@ -1193,8 +1211,10 @@  discard block
 block discarded – undo
1193 1211
         }
1194 1212
 
1195 1213
         return $post_meta_info;
1196
-    else:
1197
-        return false;
1214
+    else {
1215
+    	:
1216
+        return false;
1217
+    }
1198 1218
     endif;
1199 1219
 }
1200 1220
 
@@ -1205,8 +1225,9 @@  discard block
 block discarded – undo
1205 1225
     if (is_admin()) {
1206 1226
         global $post,$gd_session;
1207 1227
 
1208
-        if (isset($_REQUEST['post']))
1209
-            $_REQUEST['pid'] = $_REQUEST['post'];
1228
+        if (isset($_REQUEST['post'])) {
1229
+                    $_REQUEST['pid'] = $_REQUEST['post'];
1230
+        }
1210 1231
     }
1211 1232
 
1212 1233
     if (isset($_REQUEST['backandedit']) && $_REQUEST['backandedit'] && $gd_ses_listing = $gd_session->get('listing')) {
@@ -1259,8 +1280,9 @@  discard block
 block discarded – undo
1259 1280
         if (is_admin()) {
1260 1281
             global $post;
1261 1282
 
1262
-            if (isset($_REQUEST['post']))
1263
-                $_REQUEST['pid'] = $_REQUEST['post'];
1283
+            if (isset($_REQUEST['post'])) {
1284
+                            $_REQUEST['pid'] = $_REQUEST['post'];
1285
+            }
1264 1286
         }
1265 1287
 
1266 1288
         
@@ -1352,7 +1374,7 @@  discard block
 block discarded – undo
1352 1374
         $field_icon = ' background: url(' . $cf['field_icon'] . ') no-repeat left center;background-size:18px 18px;padding-left: 21px;';
1353 1375
     } elseif (strpos($cf['field_icon'], 'fa fa-') !== false) {
1354 1376
         $field_icon = '<i class="' . $cf['field_icon'] . '"></i>';
1355
-    }else{
1377
+    } else{
1356 1378
         $field_icon = $cf['field_icon'];
1357 1379
     }
1358 1380
 
@@ -1425,8 +1447,9 @@  discard block
 block discarded – undo
1425 1447
                     $variables_array['post_id'] = $post->ID;
1426 1448
                     $variables_array['label'] = __($type['site_title'], 'geodirectory');
1427 1449
                     $variables_array['value'] = '';
1428
-                    if (isset($post->{$type['htmlvar_name']}))
1429
-                        $variables_array['value'] = $post->{$type['htmlvar_name']};
1450
+                    if (isset($post->{$type['htmlvar_name']})) {
1451
+                                            $variables_array['value'] = $post->{$type['htmlvar_name']};
1452
+                    }
1430 1453
                 endif;
1431 1454
 
1432 1455
 
@@ -1448,7 +1471,9 @@  discard block
 block discarded – undo
1448 1471
                      * @param string $html Custom field unfiltered HTML.
1449 1472
                      * @param array $variables_array Custom field variables array.
1450 1473
                      */
1451
-                    if ($html) echo apply_filters("geodir_show_{$html_var}", $html, $variables_array);
1474
+                    if ($html) {
1475
+                    	echo apply_filters("geodir_show_{$html_var}", $html, $variables_array);
1476
+                    }
1452 1477
 
1453 1478
                     /**
1454 1479
                      * Called after a custom fields is output on the frontend.
@@ -1491,10 +1516,11 @@  discard block
 block discarded – undo
1491 1516
      */
1492 1517
     function geodir_default_date_format()
1493 1518
     {
1494
-        if ($format = get_option('date_format'))
1495
-            return $format;
1496
-        else
1497
-            return 'dd-mm-yy';
1519
+        if ($format = get_option('date_format')) {
1520
+                    return $format;
1521
+        } else {
1522
+                    return 'dd-mm-yy';
1523
+        }
1498 1524
     }
1499 1525
 }
1500 1526
 
@@ -1601,11 +1627,13 @@  discard block
 block discarded – undo
1601 1627
                     // Set an array containing a list of acceptable formats
1602 1628
                     //$allowed_file_types = array('image/jpg', 'image/jpeg', 'image/gif', 'image/png', 'application/pdf', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/octet-stream', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'text/csv', 'text/plain');
1603 1629
 
1604
-                    if (!function_exists('wp_handle_upload'))
1605
-                        require_once(ABSPATH . 'wp-admin/includes/file.php');
1630
+                    if (!function_exists('wp_handle_upload')) {
1631
+                                            require_once(ABSPATH . 'wp-admin/includes/file.php');
1632
+                    }
1606 1633
 
1607
-                    if (!is_dir($geodir_uploadpath))
1608
-                        mkdir($geodir_uploadpath);
1634
+                    if (!is_dir($geodir_uploadpath)) {
1635
+                                            mkdir($geodir_uploadpath);
1636
+                    }
1609 1637
 
1610 1638
                     $new_name = $post_id . '_' . $field_id . '_' . $img_name_arr[0] . '.' . $img_name_arr[1];
1611 1639
                     $explode_sub_dir = explode("/", $sub_dir);
@@ -1618,16 +1646,19 @@  discard block
 block discarded – undo
1618 1646
                     }
1619 1647
 
1620 1648
                     $uploaded_file = '';
1621
-                    if (file_exists($img_path))
1622
-                        $uploaded_file = copy($img_path, $geodir_uploadpath . '/' . $new_name);
1649
+                    if (file_exists($img_path)) {
1650
+                                            $uploaded_file = copy($img_path, $geodir_uploadpath . '/' . $new_name);
1651
+                    }
1623 1652
 
1624 1653
                     if ($curr_img_dir != $geodir_uploaddir) {
1625
-                        if (file_exists($img_path))
1626
-                            unlink($img_path);
1654
+                        if (file_exists($img_path)) {
1655
+                                                    unlink($img_path);
1656
+                        }
1627 1657
                     }
1628 1658
 
1629
-                    if (!empty($uploaded_file))
1630
-                        $file_urls = $geodir_uploadurl . '/' . $new_name;
1659
+                    if (!empty($uploaded_file)) {
1660
+                                            $file_urls = $geodir_uploadurl . '/' . $new_name;
1661
+                    }
1631 1662
 
1632 1663
                 } else {
1633 1664
                     $file_urls = $post_image[$m];
@@ -1648,8 +1679,9 @@  discard block
 block discarded – undo
1648 1679
 
1649 1680
         geodir_save_post_meta($post_id, $field_id, $file_urls);
1650 1681
 
1651
-        if (!empty($invalid_files))
1652
-            geodir_remove_attachments($invalid_files);
1682
+        if (!empty($invalid_files)) {
1683
+                    geodir_remove_attachments($invalid_files);
1684
+        }
1653 1685
 
1654 1686
     }
1655 1687
 }
@@ -1875,8 +1907,9 @@  discard block
 block discarded – undo
1875 1907
 
1876 1908
         $all_postypes = geodir_get_posttypes();
1877 1909
 
1878
-        if (!in_array($post_type, $all_postypes))
1879
-            return false;
1910
+        if (!in_array($post_type, $all_postypes)) {
1911
+                    return false;
1912
+        }
1880 1913
 
1881 1914
         $fields = array();
1882 1915
 
@@ -1974,8 +2007,10 @@  discard block
 block discarded – undo
1974 2007
         }
1975 2008
 
1976 2009
         return $field_ids;
1977
-    else:
1978
-        return false;
2010
+    else {
2011
+    	:
2012
+        return false;
2013
+    }
1979 2014
     endif;
1980 2015
 }
1981 2016
 
@@ -2148,8 +2183,9 @@  discard block
 block discarded – undo
2148 2183
 
2149 2184
             return $field_id;
2150 2185
 
2151
-        } else
2152
-            return 0;
2186
+        } else {
2187
+                    return 0;
2188
+        }
2153 2189
 
2154 2190
     }
2155 2191
 }
@@ -2190,8 +2226,9 @@  discard block
 block discarded – undo
2190 2226
         $htmlvar_name = isset($field_type_key) ? $field_type_key : '';
2191 2227
 
2192 2228
         $site_title = '';
2193
-        if ($site_title == '')
2194
-            $site_title = isset($field_info->site_title) ? $field_info->site_title : '';
2229
+        if ($site_title == '') {
2230
+                    $site_title = isset($field_info->site_title) ? $field_info->site_title : '';
2231
+        }
2195 2232
 
2196 2233
         if ($site_title == '') {
2197 2234
             $fields = geodir_get_custom_sort_options($post_type);
@@ -2205,8 +2242,9 @@  discard block
 block discarded – undo
2205 2242
             }
2206 2243
         }
2207 2244
 
2208
-        if ($htmlvar_name == '')
2209
-            $htmlvar_name = isset($field_info->htmlvar_name) ? $field_info->htmlvar_name : '';
2245
+        if ($htmlvar_name == '') {
2246
+                    $htmlvar_name = isset($field_info->htmlvar_name) ? $field_info->htmlvar_name : '';
2247
+        }
2210 2248
 
2211 2249
         $nonce = wp_create_nonce('custom_fields_' . $result_str);
2212 2250
 
@@ -2219,7 +2257,7 @@  discard block
 block discarded – undo
2219 2257
 
2220 2258
                 if (isset($cso['field_icon']) && strpos($cso['field_icon'], 'fa fa-') !== false) {
2221 2259
                     $field_icon = '<i class="'.$cso['field_icon'].'" aria-hidden="true"></i>';
2222
-                }elseif(isset($cso['field_icon']) && $cso['field_icon']){
2260
+                } elseif(isset($cso['field_icon']) && $cso['field_icon']){
2223 2261
                     $field_icon = '<b style="background-image: url("'.$cso['field_icon'].'")"></b>';
2224 2262
                 }
2225 2263
 
@@ -2654,7 +2692,7 @@  discard block
 block discarded – undo
2654 2692
     $dt_value = '';
2655 2693
     if (isset($field_info->data_type)) {
2656 2694
         $dt_value  = esc_attr($field_info->data_type);
2657
-    }elseif(isset($cf['defaults']['data_type']) && $cf['defaults']['data_type']){
2695
+    } elseif(isset($cf['defaults']['data_type']) && $cf['defaults']['data_type']){
2658 2696
         $dt_value  = $cf['defaults']['data_type'];
2659 2697
     }
2660 2698
     ?>
@@ -2686,7 +2724,7 @@  discard block
 block discarded – undo
2686 2724
     $value = '';
2687 2725
     if (isset($field_info->decimal_point)) {
2688 2726
         $value = esc_attr($field_info->decimal_point);
2689
-    }elseif(isset($cf['defaults']['decimal_point']) && $cf['defaults']['decimal_point']){
2727
+    } elseif(isset($cf['defaults']['decimal_point']) && $cf['defaults']['decimal_point']){
2690 2728
         $value = $cf['defaults']['decimal_point'];
2691 2729
     }
2692 2730
     ?>
@@ -2760,11 +2798,13 @@  discard block
 block discarded – undo
2760 2798
 
2761 2799
             <?php
2762 2800
             $selected = '';
2763
-            if (isset($field_info->extra_fields))
2764
-                $advanced_editor = unserialize($field_info->extra_fields);
2801
+            if (isset($field_info->extra_fields)) {
2802
+                            $advanced_editor = unserialize($field_info->extra_fields);
2803
+            }
2765 2804
 
2766
-            if (!empty($advanced_editor) && is_array($advanced_editor) && in_array('1', $advanced_editor))
2767
-                $selected = 'checked="checked"';
2805
+            if (!empty($advanced_editor) && is_array($advanced_editor) && in_array('1', $advanced_editor)) {
2806
+                            $selected = 'checked="checked"';
2807
+            }
2768 2808
             ?>
2769 2809
 
2770 2810
             <input type="checkbox" name="advanced_editor[]" id="advanced_editor"
@@ -2786,7 +2826,7 @@  discard block
 block discarded – undo
2786 2826
     $value = '';
2787 2827
     if (isset($field_info->validation_pattern)) {
2788 2828
         $value = esc_attr($field_info->validation_pattern);
2789
-    }elseif(isset($cf['defaults']['validation_pattern']) && $cf['defaults']['validation_pattern']){
2829
+    } elseif(isset($cf['defaults']['validation_pattern']) && $cf['defaults']['validation_pattern']){
2790 2830
         $value = esc_attr($cf['defaults']['validation_pattern']);
2791 2831
     }
2792 2832
     ?>
@@ -2806,7 +2846,7 @@  discard block
 block discarded – undo
2806 2846
     $value = '';
2807 2847
     if (isset($field_info->validation_msg)) {
2808 2848
         $value = esc_attr($field_info->validation_msg);
2809
-    }elseif(isset($cf['defaults']['validation_msg']) && $cf['defaults']['validation_msg']){
2849
+    } elseif(isset($cf['defaults']['validation_msg']) && $cf['defaults']['validation_msg']){
2810 2850
         $value = esc_attr($cf['defaults']['validation_msg']);
2811 2851
     }
2812 2852
     ?>
@@ -2836,8 +2876,9 @@  discard block
 block discarded – undo
2836 2876
 
2837 2877
     if (!isset($field_info->post_type)) {
2838 2878
         $post_type = sanitize_text_field($_REQUEST['listing_type']);
2839
-    } else
2840
-        $post_type = $field_info->post_type;
2879
+    } else {
2880
+            $post_type = $field_info->post_type;
2881
+    }
2841 2882
     ?>
2842 2883
     <li style="display: none;">
2843 2884
         <label for="htmlvar_name" class="gd-cf-tooltip-wrap">
@@ -3111,7 +3152,7 @@  discard block
 block discarded – undo
3111 3152
     $value = '';
3112 3153
     if (isset($field_info->option_values)) {
3113 3154
         $value = esc_attr($field_info->option_values);
3114
-    }elseif(isset($cf['defaults']['option_values']) && $cf['defaults']['option_values']){
3155
+    } elseif(isset($cf['defaults']['option_values']) && $cf['defaults']['option_values']){
3115 3156
         $value = esc_attr($cf['defaults']['option_values']);
3116 3157
     }
3117 3158
 
@@ -3254,7 +3295,7 @@  discard block
 block discarded – undo
3254 3295
     $value = '';
3255 3296
     if ($extra_fields && isset($extra_fields['is_price'])) {
3256 3297
     $value = esc_attr($extra_fields['is_price']);
3257
-    }elseif(isset($cf['defaults']['extra_fields']['is_price']) && $cf['defaults']['extra_fields']['is_price']){
3298
+    } elseif(isset($cf['defaults']['extra_fields']['is_price']) && $cf['defaults']['extra_fields']['is_price']){
3258 3299
     $value = esc_attr($cf['defaults']['extra_fields']['is_price']);
3259 3300
     }
3260 3301
 
@@ -3289,7 +3330,7 @@  discard block
 block discarded – undo
3289 3330
     $value = '';
3290 3331
     if ($extra_fields && isset($extra_fields['thousand_separator'])) {
3291 3332
         $value = esc_attr($extra_fields['thousand_separator']);
3292
-    }elseif(isset($cf['defaults']['extra_fields']['thousand_separator']) && $cf['defaults']['extra_fields']['thousand_separator']){
3333
+    } elseif(isset($cf['defaults']['extra_fields']['thousand_separator']) && $cf['defaults']['extra_fields']['thousand_separator']){
3293 3334
         $value = esc_attr($cf['defaults']['extra_fields']['thousand_separator']);
3294 3335
     }
3295 3336
     ?>
@@ -3316,7 +3357,7 @@  discard block
 block discarded – undo
3316 3357
     $value = '';
3317 3358
     if ($extra_fields && isset($extra_fields['decimal_separator'])) {
3318 3359
         $value = esc_attr($extra_fields['decimal_separator']);
3319
-    }elseif(isset($cf['defaults']['extra_fields']['decimal_separator']) && $cf['defaults']['extra_fields']['decimal_separator']){
3360
+    } elseif(isset($cf['defaults']['extra_fields']['decimal_separator']) && $cf['defaults']['extra_fields']['decimal_separator']){
3320 3361
         $value = esc_attr($cf['defaults']['extra_fields']['decimal_separator']);
3321 3362
     }
3322 3363
     ?>
@@ -3339,7 +3380,7 @@  discard block
 block discarded – undo
3339 3380
     $value = '';
3340 3381
     if ($extra_fields && isset($extra_fields['decimal_display'])) {
3341 3382
         $value = esc_attr($extra_fields['decimal_display']);
3342
-    }elseif(isset($cf['defaults']['extra_fields']['decimal_display']) && $cf['defaults']['extra_fields']['decimal_display']){
3383
+    } elseif(isset($cf['defaults']['extra_fields']['decimal_display']) && $cf['defaults']['extra_fields']['decimal_display']){
3343 3384
         $value = esc_attr($cf['defaults']['extra_fields']['decimal_display']);
3344 3385
     }
3345 3386
     ?>
@@ -3362,7 +3403,7 @@  discard block
 block discarded – undo
3362 3403
     $value = '';
3363 3404
     if ($extra_fields && isset($extra_fields['currency_symbol'])) {
3364 3405
         $value = esc_attr($extra_fields['currency_symbol']);
3365
-    }elseif(isset($cf['defaults']['extra_fields']['currency_symbol']) && $cf['defaults']['extra_fields']['currency_symbol']){
3406
+    } elseif(isset($cf['defaults']['extra_fields']['currency_symbol']) && $cf['defaults']['extra_fields']['currency_symbol']){
3366 3407
         $value = esc_attr($cf['defaults']['extra_fields']['currency_symbol']);
3367 3408
     }
3368 3409
     ?>
@@ -3383,7 +3424,7 @@  discard block
 block discarded – undo
3383 3424
     $value = '';
3384 3425
     if ($extra_fields && isset($extra_fields['currency_symbol_placement'])) {
3385 3426
         $value = esc_attr($extra_fields['currency_symbol_placement']);
3386
-    }elseif(isset($cf['defaults']['extra_fields']['currency_symbol_placement']) && $cf['defaults']['extra_fields']['currency_symbol_placement']){
3427
+    } elseif(isset($cf['defaults']['extra_fields']['currency_symbol_placement']) && $cf['defaults']['extra_fields']['currency_symbol_placement']){
3387 3428
         $value = esc_attr($cf['defaults']['extra_fields']['currency_symbol_placement']);
3388 3429
     }
3389 3430
     ?>
@@ -3610,8 +3651,9 @@  discard block
 block discarded – undo
3610 3651
     $currency_symbol_placement = isset($cs['currency_symbol_placement']) ? $cs['currency_symbol_placement'] : 'left';
3611 3652
 
3612 3653
     if($decimals>0 && $decimal_display=='if'){
3613
-        if(is_int($number) || floor( $number ) == $number)
3614
-            $decimals = 0;
3654
+        if(is_int($number) || floor( $number ) == $number) {
3655
+                    $decimals = 0;
3656
+        }
3615 3657
     }
3616 3658
 
3617 3659
     $number = number_format($number,$decimals,$decimalpoint,$separator);
@@ -3620,7 +3662,7 @@  discard block
 block discarded – undo
3620 3662
 
3621 3663
     if($currency_symbol_placement=='left'){
3622 3664
         $number = $symbol . $number;
3623
-    }else{
3665
+    } else{
3624 3666
         $number = $number . $symbol;
3625 3667
     }
3626 3668
 
Please login to merge, or discard this patch.
Spacing   +410 added lines, -410 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
     function geodir_add_column_if_not_exist($db, $column, $column_attr = "VARCHAR( 255 ) NOT NULL")
50 50
     {
51 51
         global $wpdb;
52
-        $result = 0;// no rows affected
52
+        $result = 0; // no rows affected
53 53
         if (!geodir_column_exist($db, $column)) {
54 54
             if (!empty($db) && !empty($column))
55 55
                 $result = $wpdb->query("ALTER TABLE `$db` ADD `$column`  $column_attr");
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 {
75 75
     global $wpdb, $geodir_post_custom_fields_cache;
76 76
 
77
-    $cache_stored = $post_type . '_' . $package_id . '_' . $default . '_' . $fields_location;
77
+    $cache_stored = $post_type.'_'.$package_id.'_'.$default.'_'.$fields_location;
78 78
 
79 79
     if (array_key_exists($cache_stored, $geodir_post_custom_fields_cache)) {
80 80
         return $geodir_post_custom_fields_cache[$cache_stored];
@@ -88,14 +88,14 @@  discard block
 block discarded – undo
88 88
         $default_query .= " and is_admin = '0' ";
89 89
 
90 90
     if ($fields_location == 'none') {
91
-    } else{
92
-        $fields_location = esc_sql( $fields_location );
91
+    } else {
92
+        $fields_location = esc_sql($fields_location);
93 93
         $default_query .= " and show_in LIKE '%%[$fields_location]%%' ";
94 94
     }
95 95
 
96 96
     $post_meta_info = $wpdb->get_results(
97 97
         $wpdb->prepare(
98
-            "select * from " . GEODIR_CUSTOM_FIELDS_TABLE . " where is_active = '1' and post_type = %s {$default_query} order by sort_order asc,admin_title asc",
98
+            "select * from ".GEODIR_CUSTOM_FIELDS_TABLE." where is_active = '1' and post_type = %s {$default_query} order by sort_order asc,admin_title asc",
99 99
             array($post_type)
100 100
         )
101 101
     );
@@ -162,13 +162,13 @@  discard block
 block discarded – undo
162 162
      * @param string $field_ins_upd When set to "submit" displays form.
163 163
      * @param string $field_type_key The key of the custom field.
164 164
      */
165
-    function geodir_custom_field_adminhtml($field_type, $result_str, $field_ins_upd = '', $field_type_key ='')
165
+    function geodir_custom_field_adminhtml($field_type, $result_str, $field_ins_upd = '', $field_type_key = '')
166 166
     {
167 167
         global $wpdb;
168 168
         $cf = $result_str;
169 169
         if (!is_object($cf)) {
170 170
 
171
-            $field_info = $wpdb->get_row($wpdb->prepare("select * from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id= %d", array($cf)));
171
+            $field_info = $wpdb->get_row($wpdb->prepare("select * from ".GEODIR_CUSTOM_FIELDS_TABLE." where id= %d", array($cf)));
172 172
 
173 173
         } else {
174 174
             $field_info = $cf;
@@ -202,14 +202,14 @@  discard block
 block discarded – undo
202 202
         if ($field_id != '') {
203 203
             $cf = trim($field_id, '_');
204 204
 
205
-            if ($field = $wpdb->get_row($wpdb->prepare("select htmlvar_name,post_type,field_type from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id= %d", array($cf)))) {
206
-                $wpdb->query($wpdb->prepare("delete from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id= %d ", array($cf)));
205
+            if ($field = $wpdb->get_row($wpdb->prepare("select htmlvar_name,post_type,field_type from ".GEODIR_CUSTOM_FIELDS_TABLE." where id= %d", array($cf)))) {
206
+                $wpdb->query($wpdb->prepare("delete from ".GEODIR_CUSTOM_FIELDS_TABLE." where id= %d ", array($cf)));
207 207
 
208 208
                 $post_type = $field->post_type;
209 209
                 $htmlvar_name = $field->htmlvar_name;
210 210
 
211 211
                 if ($post_type != '' && $htmlvar_name != '') {
212
-                    $wpdb->query($wpdb->prepare("DELETE FROM " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " WHERE htmlvar_name=%s AND post_type=%s LIMIT 1", array($htmlvar_name, $post_type)));
212
+                    $wpdb->query($wpdb->prepare("DELETE FROM ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." WHERE htmlvar_name=%s AND post_type=%s LIMIT 1", array($htmlvar_name, $post_type)));
213 213
                 }
214 214
 
215 215
                 /**
@@ -223,18 +223,18 @@  discard block
 block discarded – undo
223 223
                 do_action('geodir_after_custom_field_deleted', $cf, $field->htmlvar_name, $post_type);
224 224
 
225 225
                 if ($field->field_type == 'address') {
226
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_address`");
227
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_city`");
228
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_region`");
229
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_country`");
230
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_zip`");
231
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_latitude`");
232
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_longitude`");
233
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_mapview`");
234
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_mapzoom`");
226
+                    $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_address`");
227
+                    $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_city`");
228
+                    $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_region`");
229
+                    $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_country`");
230
+                    $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_zip`");
231
+                    $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_latitude`");
232
+                    $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_longitude`");
233
+                    $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_mapview`");
234
+                    $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_mapzoom`");
235 235
                 } else {
236 236
                     if ($field->field_type != 'fieldset') {
237
-                        $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "`");
237
+                        $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."`");
238 238
                     }
239 239
                 }
240 240
 
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
         $result_str = isset($request_field['field_id']) ? trim($request_field['field_id']) : '';
306 306
 
307 307
         // some servers fail if a POST value is VARCHAR so we change it.
308
-        if(isset($request_field['data_type']) && $request_field['data_type']=='XVARCHAR'){
308
+        if (isset($request_field['data_type']) && $request_field['data_type'] == 'XVARCHAR') {
309 309
             $request_field['data_type'] = 'VARCHAR';
310 310
         }
311 311
 
@@ -318,12 +318,12 @@  discard block
 block discarded – undo
318 318
         $post_type = $request_field['listing_type'];
319 319
 
320 320
         if ($request_field['field_type'] != 'address' && $request_field['field_type'] != 'taxonomy' && $request_field['field_type'] != 'fieldset') {
321
-            $cehhtmlvar_name = 'geodir_' . $cehhtmlvar_name;
321
+            $cehhtmlvar_name = 'geodir_'.$cehhtmlvar_name;
322 322
         }
323 323
 
324 324
         $check_html_variable = $wpdb->get_var(
325 325
             $wpdb->prepare(
326
-                "select htmlvar_name from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id <> %d and htmlvar_name = %s and post_type = %s ",
326
+                "select htmlvar_name from ".GEODIR_CUSTOM_FIELDS_TABLE." where id <> %d and htmlvar_name = %s and post_type = %s ",
327 327
                 array($cf, $cehhtmlvar_name, $post_type)
328 328
             )
329 329
         );
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
 
336 336
                 $post_meta_info = $wpdb->get_row(
337 337
                     $wpdb->prepare(
338
-                        "select * from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id = %d",
338
+                        "select * from ".GEODIR_CUSTOM_FIELDS_TABLE." where id = %d",
339 339
                         array($cf)
340 340
                     )
341 341
                 );
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
             if ($post_type == '') $post_type = 'gd_place';
354 354
 
355 355
 
356
-            $detail_table = $plugin_prefix . $post_type . '_detail';
356
+            $detail_table = $plugin_prefix.$post_type.'_detail';
357 357
 
358 358
             $admin_title = $request_field['admin_title'];
359 359
             $site_title = $request_field['site_title'];
@@ -381,12 +381,12 @@  discard block
 block discarded – undo
381 381
             $for_admin_use = isset($request_field['for_admin_use']) ? $request_field['for_admin_use'] : '';
382 382
 
383 383
             
384
-            if(is_array($show_in)){
384
+            if (is_array($show_in)) {
385 385
                 $show_in = implode(",", $request_field['show_in']);
386 386
             }
387 387
             
388 388
             if ($field_type != 'address' && $field_type != 'taxonomy' && $field_type != 'fieldset') {
389
-                $htmlvar_name = 'geodir_' . $htmlvar_name;
389
+                $htmlvar_name = 'geodir_'.$htmlvar_name;
390 390
             }
391 391
 
392 392
             $option_values = '';
@@ -427,9 +427,9 @@  discard block
 block discarded – undo
427 427
 
428 428
             if ($sort_order == '') {
429 429
 
430
-                $last_order = $wpdb->get_var("SELECT MAX(sort_order) as last_order FROM " . GEODIR_CUSTOM_FIELDS_TABLE);
430
+                $last_order = $wpdb->get_var("SELECT MAX(sort_order) as last_order FROM ".GEODIR_CUSTOM_FIELDS_TABLE);
431 431
 
432
-                $sort_order = (int)$last_order + 1;
432
+                $sort_order = (int) $last_order + 1;
433 433
             }
434 434
 
435 435
             $default_value_add = '';
@@ -441,15 +441,15 @@  discard block
 block discarded – undo
441 441
                     case 'address':
442 442
 
443 443
                         if ($htmlvar_name != '') {
444
-                            $prefix = $htmlvar_name . '_';
444
+                            $prefix = $htmlvar_name.'_';
445 445
                         }
446
-                        $old_prefix = $old_html_variable . '_';
446
+                        $old_prefix = $old_html_variable.'_';
447 447
 
448 448
 
449
-                        $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "address` `" . $prefix . "address` VARCHAR( 254 ) NULL";
449
+                        $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."address` `".$prefix."address` VARCHAR( 254 ) NULL";
450 450
 
451 451
                         if ($default_value != '') {
452
-                            $meta_field_add .= " DEFAULT '" . $default_value . "'";
452
+                            $meta_field_add .= " DEFAULT '".$default_value."'";
453 453
                         }
454 454
 
455 455
                         $wpdb->query($meta_field_add);
@@ -458,12 +458,12 @@  discard block
 block discarded – undo
458 458
 
459 459
                             if (isset($extra_fields['show_city']) && $extra_fields['show_city']) {
460 460
 
461
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "city'");
461
+                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."city'");
462 462
                                 if ($is_column) {
463
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "city` `" . $prefix . "city` VARCHAR( 50 ) NULL";
463
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."city` `".$prefix."city` VARCHAR( 50 ) NULL";
464 464
 
465 465
                                     if ($default_value != '') {
466
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
466
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
467 467
                                     }
468 468
 
469 469
                                     $wpdb->query($meta_field_add);
@@ -471,9 +471,9 @@  discard block
 block discarded – undo
471 471
 
472 472
                                     $meta_field_add = "VARCHAR( 50 ) NULL";
473 473
                                     if ($default_value != '') {
474
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
474
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
475 475
                                     }
476
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "city", $meta_field_add);
476
+                                    geodir_add_column_if_not_exist($detail_table, $prefix."city", $meta_field_add);
477 477
 
478 478
                                 }
479 479
 
@@ -483,36 +483,36 @@  discard block
 block discarded – undo
483 483
 
484 484
                             if (isset($extra_fields['show_region']) && $extra_fields['show_region']) {
485 485
 
486
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "region'");
486
+                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."region'");
487 487
 
488 488
                                 if ($is_column) {
489
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "region` `" . $prefix . "region` VARCHAR( 50 ) NULL";
489
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."region` `".$prefix."region` VARCHAR( 50 ) NULL";
490 490
 
491 491
                                     if ($default_value != '') {
492
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
492
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
493 493
                                     }
494 494
 
495 495
                                     $wpdb->query($meta_field_add);
496 496
                                 } else {
497 497
                                     $meta_field_add = "VARCHAR( 50 ) NULL";
498 498
                                     if ($default_value != '') {
499
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
499
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
500 500
                                     }
501 501
 
502
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "region", $meta_field_add);
502
+                                    geodir_add_column_if_not_exist($detail_table, $prefix."region", $meta_field_add);
503 503
                                 }
504 504
 
505 505
                             }
506 506
                             if (isset($extra_fields['show_country']) && $extra_fields['show_country']) {
507 507
 
508
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "country'");
508
+                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."country'");
509 509
 
510 510
                                 if ($is_column) {
511 511
 
512
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "country` `" . $prefix . "country` VARCHAR( 50 ) NULL";
512
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."country` `".$prefix."country` VARCHAR( 50 ) NULL";
513 513
 
514 514
                                     if ($default_value != '') {
515
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
515
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
516 516
                                     }
517 517
 
518 518
                                     $wpdb->query($meta_field_add);
@@ -520,24 +520,24 @@  discard block
 block discarded – undo
520 520
 
521 521
                                     $meta_field_add = "VARCHAR( 50 ) NULL";
522 522
                                     if ($default_value != '') {
523
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
523
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
524 524
                                     }
525 525
 
526
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "country", $meta_field_add);
526
+                                    geodir_add_column_if_not_exist($detail_table, $prefix."country", $meta_field_add);
527 527
 
528 528
                                 }
529 529
 
530 530
                             }
531 531
                             if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) {
532 532
 
533
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "zip'");
533
+                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."zip'");
534 534
 
535 535
                                 if ($is_column) {
536 536
 
537
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "zip` `" . $prefix . "zip` VARCHAR( 50 ) NULL";
537
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."zip` `".$prefix."zip` VARCHAR( 50 ) NULL";
538 538
 
539 539
                                     if ($default_value != '') {
540
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
540
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
541 541
                                     }
542 542
 
543 543
                                     $wpdb->query($meta_field_add);
@@ -545,128 +545,128 @@  discard block
 block discarded – undo
545 545
 
546 546
                                     $meta_field_add = "VARCHAR( 50 ) NULL";
547 547
                                     if ($default_value != '') {
548
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
548
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
549 549
                                     }
550 550
 
551
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "zip", $meta_field_add);
551
+                                    geodir_add_column_if_not_exist($detail_table, $prefix."zip", $meta_field_add);
552 552
 
553 553
                                 }
554 554
 
555 555
                             }
556 556
                             if (isset($extra_fields['show_map']) && $extra_fields['show_map']) {
557 557
 
558
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "latitude'");
558
+                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."latitude'");
559 559
                                 if ($is_column) {
560 560
 
561
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "latitude` `" . $prefix . "latitude` VARCHAR( 20 ) NULL";
561
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."latitude` `".$prefix."latitude` VARCHAR( 20 ) NULL";
562 562
 
563 563
                                     if ($default_value != '') {
564
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
564
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
565 565
                                     }
566 566
 
567 567
                                     $wpdb->query($meta_field_add);
568 568
                                 } else {
569 569
 
570
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "latitude` VARCHAR( 20 ) NULL";
570
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."latitude` VARCHAR( 20 ) NULL";
571 571
                                     $meta_field_add = "VARCHAR( 20 ) NULL";
572 572
                                     if ($default_value != '') {
573
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
573
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
574 574
                                     }
575 575
 
576
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "latitude", $meta_field_add);
576
+                                    geodir_add_column_if_not_exist($detail_table, $prefix."latitude", $meta_field_add);
577 577
 
578 578
                                 }
579 579
 
580 580
 
581
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "longitude'");
581
+                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."longitude'");
582 582
 
583 583
                                 if ($is_column) {
584
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "longitude` `" . $prefix . "longitude` VARCHAR( 20 ) NULL";
584
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."longitude` `".$prefix."longitude` VARCHAR( 20 ) NULL";
585 585
 
586 586
                                     if ($default_value != '') {
587
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
587
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
588 588
                                     }
589 589
 
590 590
                                     $wpdb->query($meta_field_add);
591 591
                                 } else {
592 592
 
593
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "longitude` VARCHAR( 20 ) NULL";
593
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."longitude` VARCHAR( 20 ) NULL";
594 594
                                     $meta_field_add = "VARCHAR( 20 ) NULL";
595 595
                                     if ($default_value != '') {
596
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
596
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
597 597
                                     }
598 598
 
599
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "longitude", $meta_field_add);
599
+                                    geodir_add_column_if_not_exist($detail_table, $prefix."longitude", $meta_field_add);
600 600
                                 }
601 601
 
602 602
                             }
603 603
                             if (isset($extra_fields['show_mapview']) && $extra_fields['show_mapview']) {
604 604
 
605
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "mapview'");
605
+                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."mapview'");
606 606
 
607 607
                                 if ($is_column) {
608
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "mapview` `" . $prefix . "mapview` VARCHAR( 15 ) NULL";
608
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."mapview` `".$prefix."mapview` VARCHAR( 15 ) NULL";
609 609
 
610 610
                                     if ($default_value != '') {
611
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
611
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
612 612
                                     }
613 613
 
614 614
                                     $wpdb->query($meta_field_add);
615 615
                                 } else {
616 616
 
617
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "mapview` VARCHAR( 15 ) NULL";
617
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."mapview` VARCHAR( 15 ) NULL";
618 618
 
619 619
                                     $meta_field_add = "VARCHAR( 15 ) NULL";
620 620
                                     if ($default_value != '') {
621
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
621
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
622 622
                                     }
623 623
 
624
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "mapview", $meta_field_add);
624
+                                    geodir_add_column_if_not_exist($detail_table, $prefix."mapview", $meta_field_add);
625 625
                                 }
626 626
 
627 627
 
628 628
                             }
629 629
                             if (isset($extra_fields['show_mapzoom']) && $extra_fields['show_mapzoom']) {
630 630
 
631
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "mapzoom'");
631
+                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."mapzoom'");
632 632
                                 if ($is_column) {
633
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "mapzoom` `" . $prefix . "mapzoom` VARCHAR( 3 ) NULL";
633
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."mapzoom` `".$prefix."mapzoom` VARCHAR( 3 ) NULL";
634 634
 
635 635
                                     if ($default_value != '') {
636
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
636
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
637 637
                                     }
638 638
 
639 639
                                     $wpdb->query($meta_field_add);
640 640
 
641 641
                                 } else {
642 642
 
643
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "mapzoom` VARCHAR( 3 ) NULL";
643
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."mapzoom` VARCHAR( 3 ) NULL";
644 644
 
645 645
                                     $meta_field_add = "VARCHAR( 3 ) NULL";
646 646
                                     if ($default_value != '') {
647
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
647
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
648 648
                                     }
649 649
 
650
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "mapzoom", $meta_field_add);
650
+                                    geodir_add_column_if_not_exist($detail_table, $prefix."mapzoom", $meta_field_add);
651 651
                                 }
652 652
 
653 653
                             }
654 654
                             // show lat lng
655 655
                             if (isset($extra_fields['show_latlng']) && $extra_fields['show_latlng']) {
656
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "latlng'");
656
+                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."latlng'");
657 657
 
658 658
                                 if ($is_column) {
659
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "latlng` `" . $prefix . "latlng` VARCHAR( 3 ) NULL";
659
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."latlng` `".$prefix."latlng` VARCHAR( 3 ) NULL";
660 660
                                     $meta_field_add .= " DEFAULT '1'";
661 661
 
662 662
                                     $wpdb->query($meta_field_add);
663 663
                                 } else {
664
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "latlng` VARCHAR( 3 ) NULL";
664
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."latlng` VARCHAR( 3 ) NULL";
665 665
 
666 666
                                     $meta_field_add = "VARCHAR( 3 ) NULL";
667 667
                                     $meta_field_add .= " DEFAULT '1'";
668 668
 
669
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "latlng", $meta_field_add);
669
+                                    geodir_add_column_if_not_exist($detail_table, $prefix."latlng", $meta_field_add);
670 670
                                 }
671 671
 
672 672
                             }
@@ -682,30 +682,30 @@  discard block
 block discarded – undo
682 682
                         $op_size = '500';
683 683
 
684 684
                         // only make the field as big as it needs to be.
685
-                        if(isset($option_values) && $option_values && $field_type=='select'){
686
-                            $option_values_arr = explode(',',$option_values);
687
-                            if(is_array($option_values_arr)){
685
+                        if (isset($option_values) && $option_values && $field_type == 'select') {
686
+                            $option_values_arr = explode(',', $option_values);
687
+                            if (is_array($option_values_arr)) {
688 688
                                 $op_max = 0;
689
-                                foreach($option_values_arr as $op_val){
690
-                                    if(strlen($op_val) && strlen($op_val)>$op_max){$op_max = strlen($op_val);}
689
+                                foreach ($option_values_arr as $op_val) {
690
+                                    if (strlen($op_val) && strlen($op_val) > $op_max) {$op_max = strlen($op_val); }
691 691
                                 }
692
-                                if($op_max){$op_size =$op_max; }
692
+                                if ($op_max) {$op_size = $op_max; }
693 693
                             }
694
-                        }elseif(isset($option_values) && $option_values && $field_type=='multiselect'){
695
-                            if(strlen($option_values)){
696
-                                $op_size =  strlen($option_values);
694
+                        }elseif (isset($option_values) && $option_values && $field_type == 'multiselect') {
695
+                            if (strlen($option_values)) {
696
+                                $op_size = strlen($option_values);
697 697
                             }
698 698
                         }
699 699
 
700
-                        $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "`VARCHAR( $op_size ) NULL";
700
+                        $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_html_variable."` `".$htmlvar_name."`VARCHAR( $op_size ) NULL";
701 701
 
702 702
                         if ($default_value != '') {
703
-                            $meta_field_add .= " DEFAULT '" . $default_value . "'";
703
+                            $meta_field_add .= " DEFAULT '".$default_value."'";
704 704
                         }
705 705
 
706 706
                         $alter_result = $wpdb->query($meta_field_add);
707
-                        if($alter_result===false){
708
-                            return __('Column change failed, you may have too many columns.','geodirectory');
707
+                        if ($alter_result === false) {
708
+                            return __('Column change failed, you may have too many columns.', 'geodirectory');
709 709
                         }
710 710
 
711 711
                         if (isset($request_field['cat_display_type']))
@@ -722,9 +722,9 @@  discard block
 block discarded – undo
722 722
                     case 'url':
723 723
                     case 'file':
724 724
 
725
-                        $alter_result = $wpdb->query("ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "` TEXT NULL");
726
-                        if($alter_result===false){
727
-                            return __('Column change failed, you may have too many columns.','geodirectory');
725
+                        $alter_result = $wpdb->query("ALTER TABLE ".$detail_table." CHANGE `".$old_html_variable."` `".$htmlvar_name."` TEXT NULL");
726
+                        if ($alter_result === false) {
727
+                            return __('Column change failed, you may have too many columns.', 'geodirectory');
728 728
                         }
729 729
                         if (isset($request_field['advanced_editor']))
730 730
                             $extra_fields = $request_field['advanced_editor'];
@@ -738,24 +738,24 @@  discard block
 block discarded – undo
738 738
                     default:
739 739
                         if ($data_type != 'VARCHAR' && $data_type != '') {
740 740
                             if ($data_type == 'FLOAT' && $decimal_point > 0) {
741
-                                $default_value_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "` DECIMAL(11, " . (int)$decimal_point . ") NULL";
741
+                                $default_value_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_html_variable."` `".$htmlvar_name."` DECIMAL(11, ".(int) $decimal_point.") NULL";
742 742
                             } else {
743
-                                $default_value_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "` " . $data_type . " NULL";
743
+                                $default_value_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_html_variable."` `".$htmlvar_name."` ".$data_type." NULL";
744 744
                             }
745 745
 
746 746
                             if (is_numeric($default_value) && $default_value != '') {
747
-                                $default_value_add .= " DEFAULT '" . $default_value . "'";
747
+                                $default_value_add .= " DEFAULT '".$default_value."'";
748 748
                             }
749 749
                         } else {
750
-                            $default_value_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "` VARCHAR( 254 ) NULL";
750
+                            $default_value_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_html_variable."` `".$htmlvar_name."` VARCHAR( 254 ) NULL";
751 751
                             if ($default_value != '') {
752
-                                $default_value_add .= " DEFAULT '" . $default_value . "'";
752
+                                $default_value_add .= " DEFAULT '".$default_value."'";
753 753
                             }
754 754
                         }
755 755
 
756 756
                         $alter_result = $wpdb->query($default_value_add);
757
-                        if($alter_result===false){
758
-                            return __('Column change failed, you may have too many columns.','geodirectory');
757
+                        if ($alter_result === false) {
758
+                            return __('Column change failed, you may have too many columns.', 'geodirectory');
759 759
                         }
760 760
                         break;
761 761
                 endswitch;
@@ -771,7 +771,7 @@  discard block
 block discarded – undo
771 771
 
772 772
                     $wpdb->prepare(
773 773
 
774
-                        "update " . GEODIR_CUSTOM_FIELDS_TABLE . " set 
774
+                        "update ".GEODIR_CUSTOM_FIELDS_TABLE." set 
775 775
 					post_type = %s,
776 776
 					admin_title = %s,
777 777
 					site_title = %s,
@@ -805,7 +805,7 @@  discard block
 block discarded – undo
805 805
 					for_admin_use = %s
806 806
 					where id = %d",
807 807
 
808
-                        array($post_type, $admin_title, $site_title, $field_type, $field_type_key, $htmlvar_name, $admin_desc, $clabels, $default_value, $sort_order, $is_active, $is_default, $is_required, $required_msg, $css_class, $field_icon, $field_icon, $show_on_listing, $show_in, $show_on_detail, $show_as_tab, $option_values, $price_pkg, $cat_sort, $cat_filter, $data_type, $extra_field_query, $decimal_point,$validation_pattern,$validation_msg, $for_admin_use, $cf)
808
+                        array($post_type, $admin_title, $site_title, $field_type, $field_type_key, $htmlvar_name, $admin_desc, $clabels, $default_value, $sort_order, $is_active, $is_default, $is_required, $required_msg, $css_class, $field_icon, $field_icon, $show_on_listing, $show_in, $show_on_detail, $show_as_tab, $option_values, $price_pkg, $cat_sort, $cat_filter, $data_type, $extra_field_query, $decimal_point, $validation_pattern, $validation_msg, $for_admin_use, $cf)
809 809
                     )
810 810
 
811 811
                 );
@@ -815,7 +815,7 @@  discard block
 block discarded – undo
815 815
 
816 816
                 $wpdb->query(
817 817
                     $wpdb->prepare(
818
-                        "update " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set 
818
+                        "update ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." set 
819 819
 					 	site_title=%s
820 820
 					where post_type = %s and htmlvar_name = %s",
821 821
                         array($site_title, $post_type, $htmlvar_name)
@@ -824,7 +824,7 @@  discard block
 block discarded – undo
824 824
 
825 825
 
826 826
                 if ($cat_sort == '')
827
-                    $wpdb->query($wpdb->prepare("delete from " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " where post_type = %s and htmlvar_name = %s", array($post_type, $htmlvar_name)));
827
+                    $wpdb->query($wpdb->prepare("delete from ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." where post_type = %s and htmlvar_name = %s", array($post_type, $htmlvar_name)));
828 828
 
829 829
 
830 830
                 /**
@@ -844,7 +844,7 @@  discard block
 block discarded – undo
844 844
                         $data_type = '';
845 845
 
846 846
                         if ($htmlvar_name != '') {
847
-                            $prefix = $htmlvar_name . '_';
847
+                            $prefix = $htmlvar_name.'_';
848 848
                         }
849 849
                         $old_prefix = $old_html_variable;
850 850
 
@@ -852,109 +852,109 @@  discard block
 block discarded – undo
852 852
 
853 853
                         $meta_field_add = "VARCHAR( 254 ) NULL";
854 854
                         if ($default_value != '') {
855
-                            $meta_field_add .= " DEFAULT '" . $default_value . "'";
855
+                            $meta_field_add .= " DEFAULT '".$default_value."'";
856 856
                         }
857 857
 
858
-                        geodir_add_column_if_not_exist($detail_table, $prefix . "address", $meta_field_add);
858
+                        geodir_add_column_if_not_exist($detail_table, $prefix."address", $meta_field_add);
859 859
                         //$wpdb->query($meta_field_add);
860 860
 
861 861
 
862 862
                         if (!empty($extra_fields)) {
863 863
 
864 864
                             if (isset($extra_fields['show_city']) && $extra_fields['show_city']) {
865
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "city` VARCHAR( 30 ) NULL";
865
+                                $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."city` VARCHAR( 30 ) NULL";
866 866
                                 $meta_field_add = "VARCHAR( 30 ) NULL";
867 867
                                 if ($default_value != '') {
868
-                                    $meta_field_add .= " DEFAULT '" . $default_value . "'";
868
+                                    $meta_field_add .= " DEFAULT '".$default_value."'";
869 869
                                 }
870 870
 
871
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "city", $meta_field_add);
871
+                                geodir_add_column_if_not_exist($detail_table, $prefix."city", $meta_field_add);
872 872
                                 //$wpdb->query($meta_field_add);
873 873
                             }
874 874
                             if (isset($extra_fields['show_region']) && $extra_fields['show_region']) {
875
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "region` VARCHAR( 30 ) NULL";
875
+                                $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."region` VARCHAR( 30 ) NULL";
876 876
                                 $meta_field_add = "VARCHAR( 30 ) NULL";
877 877
                                 if ($default_value != '') {
878
-                                    $meta_field_add .= " DEFAULT '" . $default_value . "'";
878
+                                    $meta_field_add .= " DEFAULT '".$default_value."'";
879 879
                                 }
880 880
 
881
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "region", $meta_field_add);
881
+                                geodir_add_column_if_not_exist($detail_table, $prefix."region", $meta_field_add);
882 882
                                 //$wpdb->query($meta_field_add);
883 883
                             }
884 884
                             if (isset($extra_fields['show_country']) && $extra_fields['show_country']) {
885
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "country` VARCHAR( 30 ) NULL";
885
+                                $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."country` VARCHAR( 30 ) NULL";
886 886
 
887 887
                                 $meta_field_add = "VARCHAR( 30 ) NULL";
888 888
                                 if ($default_value != '') {
889
-                                    $meta_field_add .= " DEFAULT '" . $default_value . "'";
889
+                                    $meta_field_add .= " DEFAULT '".$default_value."'";
890 890
                                 }
891 891
 
892
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "country", $meta_field_add);
892
+                                geodir_add_column_if_not_exist($detail_table, $prefix."country", $meta_field_add);
893 893
                                 //$wpdb->query($meta_field_add);
894 894
                             }
895 895
                             if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) {
896
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "zip` VARCHAR( 15 ) NULL";
896
+                                $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."zip` VARCHAR( 15 ) NULL";
897 897
                                 $meta_field_add = "VARCHAR( 15 ) NULL";
898 898
                                 if ($default_value != '') {
899
-                                    $meta_field_add .= " DEFAULT '" . $default_value . "'";
899
+                                    $meta_field_add .= " DEFAULT '".$default_value."'";
900 900
                                 }
901 901
 
902
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "zip", $meta_field_add);
902
+                                geodir_add_column_if_not_exist($detail_table, $prefix."zip", $meta_field_add);
903 903
                                 //$wpdb->query($meta_field_add);
904 904
                             }
905 905
                             if (isset($extra_fields['show_map']) && $extra_fields['show_map']) {
906
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "latitude` VARCHAR( 20 ) NULL";
906
+                                $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."latitude` VARCHAR( 20 ) NULL";
907 907
                                 $meta_field_add = "VARCHAR( 20 ) NULL";
908 908
                                 if ($default_value != '') {
909
-                                    $meta_field_add .= " DEFAULT '" . $default_value . "'";
909
+                                    $meta_field_add .= " DEFAULT '".$default_value."'";
910 910
                                 }
911 911
 
912
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "latitude", $meta_field_add);
912
+                                geodir_add_column_if_not_exist($detail_table, $prefix."latitude", $meta_field_add);
913 913
                                 //$wpdb->query($meta_field_add);
914 914
 
915
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "longitude` VARCHAR( 20 ) NULL";
915
+                                $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."longitude` VARCHAR( 20 ) NULL";
916 916
 
917 917
                                 $meta_field_add = "VARCHAR( 20 ) NULL";
918 918
                                 if ($default_value != '') {
919
-                                    $meta_field_add .= " DEFAULT '" . $default_value . "'";
919
+                                    $meta_field_add .= " DEFAULT '".$default_value."'";
920 920
                                 }
921 921
 
922
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "longitude", $meta_field_add);
922
+                                geodir_add_column_if_not_exist($detail_table, $prefix."longitude", $meta_field_add);
923 923
 
924 924
                                 //$wpdb->query($meta_field_add);
925 925
                             }
926 926
                             if (isset($extra_fields['show_mapview']) && $extra_fields['show_mapview']) {
927
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "mapview` VARCHAR( 15 ) NULL";
927
+                                $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."mapview` VARCHAR( 15 ) NULL";
928 928
 
929 929
                                 $meta_field_add = "VARCHAR( 15 ) NULL";
930 930
                                 if ($default_value != '') {
931
-                                    $meta_field_add .= " DEFAULT '" . $default_value . "'";
931
+                                    $meta_field_add .= " DEFAULT '".$default_value."'";
932 932
                                 }
933 933
 
934
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "mapview", $meta_field_add);
934
+                                geodir_add_column_if_not_exist($detail_table, $prefix."mapview", $meta_field_add);
935 935
 
936 936
                                 //$wpdb->query($meta_field_add);
937 937
                             }
938 938
                             if (isset($extra_fields['show_mapzoom']) && $extra_fields['show_mapzoom']) {
939
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "mapzoom` VARCHAR( 3 ) NULL";
939
+                                $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."mapzoom` VARCHAR( 3 ) NULL";
940 940
 
941 941
                                 $meta_field_add = "VARCHAR( 3 ) NULL";
942 942
                                 if ($default_value != '') {
943
-                                    $meta_field_add .= " DEFAULT '" . $default_value . "'";
943
+                                    $meta_field_add .= " DEFAULT '".$default_value."'";
944 944
                                 }
945 945
 
946
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "mapzoom", $meta_field_add);
946
+                                geodir_add_column_if_not_exist($detail_table, $prefix."mapzoom", $meta_field_add);
947 947
 
948 948
                                 //$wpdb->query($meta_field_add);
949 949
                             }
950 950
                             // show lat lng
951 951
                             if (isset($extra_fields['show_latlng']) && $extra_fields['show_latlng']) {
952
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "latlng` VARCHAR( 3 ) NULL";
952
+                                $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."latlng` VARCHAR( 3 ) NULL";
953 953
 
954 954
                                 $meta_field_add = "VARCHAR( 3 ) NULL";
955 955
                                 $meta_field_add .= " DEFAULT '1'";
956 956
 
957
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "latlng", $meta_field_add);
957
+                                geodir_add_column_if_not_exist($detail_table, $prefix."latlng", $meta_field_add);
958 958
                                 //$wpdb->query($meta_field_add);
959 959
                             }
960 960
                         }
@@ -964,8 +964,8 @@  discard block
 block discarded – undo
964 964
                     case 'checkbox':
965 965
                         $data_type = 'TINYINT';
966 966
 
967
-                        $meta_field_add = $data_type . "( 1 ) NOT NULL ";
968
-                        if ((int)$default_value === 1) {
967
+                        $meta_field_add = $data_type."( 1 ) NOT NULL ";
968
+                        if ((int) $default_value === 1) {
969 969
                             $meta_field_add .= " DEFAULT '1'";
970 970
                         }
971 971
 
@@ -998,7 +998,7 @@  discard block
 block discarded – undo
998 998
                             }
999 999
                         } elseif (isset($option_values) && $option_values && $field_type == 'multiselect') {
1000 1000
                             if (strlen($option_values)) {
1001
-                                $op_size =  strlen($option_values);
1001
+                                $op_size = strlen($option_values);
1002 1002
                             }
1003 1003
 
1004 1004
                             if (isset($request_field['multi_display_type'])) {
@@ -1006,9 +1006,9 @@  discard block
 block discarded – undo
1006 1006
                             }
1007 1007
                         }
1008 1008
 
1009
-                        $meta_field_add = $data_type . "( $op_size ) NULL ";
1009
+                        $meta_field_add = $data_type."( $op_size ) NULL ";
1010 1010
                         if ($default_value != '') {
1011
-                            $meta_field_add .= " DEFAULT '" . $default_value . "'";
1011
+                            $meta_field_add .= " DEFAULT '".$default_value."'";
1012 1012
                         }
1013 1013
 
1014 1014
                         $add_result = geodir_add_column_if_not_exist($detail_table, $htmlvar_name, $meta_field_add);
@@ -1023,9 +1023,9 @@  discard block
 block discarded – undo
1023 1023
 
1024 1024
                         $data_type = 'TEXT';
1025 1025
 
1026
-                        $default_value_add = " `" . $htmlvar_name . "` " . $data_type . " NULL ";
1026
+                        $default_value_add = " `".$htmlvar_name."` ".$data_type." NULL ";
1027 1027
 
1028
-                        $meta_field_add = $data_type . " NULL ";
1028
+                        $meta_field_add = $data_type." NULL ";
1029 1029
                         /*if($default_value != '')
1030 1030
 					{ $meta_field_add .= " DEFAULT '".$default_value."'"; }*/
1031 1031
 
@@ -1040,9 +1040,9 @@  discard block
 block discarded – undo
1040 1040
 
1041 1041
                         $data_type = 'DATE';
1042 1042
 
1043
-                        $default_value_add = " `" . $htmlvar_name . "` " . $data_type . " NULL ";
1043
+                        $default_value_add = " `".$htmlvar_name."` ".$data_type." NULL ";
1044 1044
 
1045
-                        $meta_field_add = $data_type . " NULL ";
1045
+                        $meta_field_add = $data_type." NULL ";
1046 1046
 
1047 1047
                         $add_result = geodir_add_column_if_not_exist($detail_table, $htmlvar_name, $meta_field_add);
1048 1048
                         if ($add_result === false) {
@@ -1055,9 +1055,9 @@  discard block
 block discarded – undo
1055 1055
 
1056 1056
                         $data_type = 'TIME';
1057 1057
 
1058
-                        $default_value_add = " `" . $htmlvar_name . "` " . $data_type . " NULL ";
1058
+                        $default_value_add = " `".$htmlvar_name."` ".$data_type." NULL ";
1059 1059
 
1060
-                        $meta_field_add = $data_type . " NULL ";
1060
+                        $meta_field_add = $data_type." NULL ";
1061 1061
 
1062 1062
                         $add_result = geodir_add_column_if_not_exist($detail_table, $htmlvar_name, $meta_field_add);
1063 1063
                         if ($add_result === false) {
@@ -1069,22 +1069,22 @@  discard block
 block discarded – undo
1069 1069
                     default:
1070 1070
 
1071 1071
                         if ($data_type != 'VARCHAR' && $data_type != '') {
1072
-                            $meta_field_add = $data_type . " NULL ";
1072
+                            $meta_field_add = $data_type." NULL ";
1073 1073
 
1074 1074
                             if ($data_type == 'FLOAT' && $decimal_point > 0) {
1075
-                                $meta_field_add = "DECIMAL(11, " . (int)$decimal_point . ") NULL ";
1075
+                                $meta_field_add = "DECIMAL(11, ".(int) $decimal_point.") NULL ";
1076 1076
                             }
1077 1077
 
1078 1078
                             if (is_numeric($default_value) && $default_value != '') {
1079
-                                $default_value_add .= " DEFAULT '" . $default_value . "'";
1080
-                                $meta_field_add .= " DEFAULT '" . $default_value . "'";
1079
+                                $default_value_add .= " DEFAULT '".$default_value."'";
1080
+                                $meta_field_add .= " DEFAULT '".$default_value."'";
1081 1081
                             }
1082 1082
                         } else {
1083 1083
                             $meta_field_add = " VARCHAR( 254 ) NULL ";
1084 1084
 
1085 1085
                             if ($default_value != '') {
1086
-                                $default_value_add .= " DEFAULT '" . $default_value . "'";
1087
-                                $meta_field_add .= " DEFAULT '" . $default_value . "'";
1086
+                                $default_value_add .= " DEFAULT '".$default_value."'";
1087
+                                $meta_field_add .= " DEFAULT '".$default_value."'";
1088 1088
                             }
1089 1089
                         }
1090 1090
 
@@ -1106,7 +1106,7 @@  discard block
 block discarded – undo
1106 1106
 
1107 1107
                     $wpdb->prepare(
1108 1108
 
1109
-                        "insert into " . GEODIR_CUSTOM_FIELDS_TABLE . " set 
1109
+                        "insert into ".GEODIR_CUSTOM_FIELDS_TABLE." set 
1110 1110
 					post_type = %s,
1111 1111
 					admin_title = %s,
1112 1112
 					site_title = %s,
@@ -1139,7 +1139,7 @@  discard block
 block discarded – undo
1139 1139
 					validation_msg = %s,
1140 1140
 					for_admin_use = %s ",
1141 1141
 
1142
-                        array($post_type, $admin_title, $site_title, $field_type, $field_type_key, $htmlvar_name, $admin_desc, $clabels, $default_value, $sort_order, $is_active, $is_default, $is_admin, $is_required, $required_msg, $css_class, $field_icon, $show_on_listing,$show_in, $show_on_detail, $show_as_tab, $option_values, $price_pkg, $cat_sort, $cat_filter, $data_type, $extra_field_query, $decimal_point,$validation_pattern,$validation_msg, $for_admin_use)
1142
+                        array($post_type, $admin_title, $site_title, $field_type, $field_type_key, $htmlvar_name, $admin_desc, $clabels, $default_value, $sort_order, $is_active, $is_default, $is_admin, $is_required, $required_msg, $css_class, $field_icon, $show_on_listing, $show_in, $show_on_detail, $show_as_tab, $option_values, $price_pkg, $cat_sort, $cat_filter, $data_type, $extra_field_query, $decimal_point, $validation_pattern, $validation_msg, $for_admin_use)
1143 1143
 
1144 1144
                     )
1145 1145
 
@@ -1151,7 +1151,7 @@  discard block
 block discarded – undo
1151 1151
 
1152 1152
             }
1153 1153
 
1154
-            return (int)$lastid;
1154
+            return (int) $lastid;
1155 1155
 
1156 1156
 
1157 1157
         } else {
@@ -1184,7 +1184,7 @@  discard block
 block discarded – undo
1184 1184
 
1185 1185
             $post_meta_info = $wpdb->query(
1186 1186
                 $wpdb->prepare(
1187
-                    "update " . GEODIR_CUSTOM_FIELDS_TABLE . " set 
1187
+                    "update ".GEODIR_CUSTOM_FIELDS_TABLE." set 
1188 1188
 															sort_order=%d 
1189 1189
 															where id= %d",
1190 1190
                     array($count, $cf)
@@ -1200,11 +1200,11 @@  discard block
 block discarded – undo
1200 1200
 }
1201 1201
 
1202 1202
 
1203
-function geodir_get_cf_value($cf){
1203
+function geodir_get_cf_value($cf) {
1204 1204
     global $gd_session;
1205 1205
     $value = '';
1206 1206
     if (is_admin()) {
1207
-        global $post,$gd_session;
1207
+        global $post, $gd_session;
1208 1208
 
1209 1209
         if (isset($_REQUEST['post']))
1210 1210
             $_REQUEST['pid'] = $_REQUEST['post'];
@@ -1252,7 +1252,7 @@  discard block
 block discarded – undo
1252 1252
         $is_default = $val['is_default'];
1253 1253
 
1254 1254
         /* field available to site admin only for edit */
1255
-        $for_admin_use = isset($val['for_admin_use']) && (int)$val['for_admin_use'] == 1 ? true : false;
1255
+        $for_admin_use = isset($val['for_admin_use']) && (int) $val['for_admin_use'] == 1 ? true : false;
1256 1256
         if ($for_admin_use && !is_super_admin()) {
1257 1257
             continue;
1258 1258
         }
@@ -1277,11 +1277,11 @@  discard block
 block discarded – undo
1277 1277
          * @param array $val The settings array for the field. {@see geodir_custom_field_save()}.
1278 1278
          * @see 'geodir_after_custom_form_field_$name'
1279 1279
          */
1280
-        do_action('geodir_before_custom_form_field_' . $name, $listing_type, $package_id, $val);
1280
+        do_action('geodir_before_custom_form_field_'.$name, $listing_type, $package_id, $val);
1281 1281
 
1282 1282
 
1283 1283
         $custom_field = $val;
1284
-        $html ='';
1284
+        $html = '';
1285 1285
         /**
1286 1286
          * Filter the output for custom fields.
1287 1287
          *
@@ -1290,7 +1290,7 @@  discard block
 block discarded – undo
1290 1290
          * @param string $html The html to be filtered (blank).
1291 1291
          * @param array $custom_field The custom field array values.
1292 1292
          */
1293
-        echo apply_filters("geodir_custom_field_input_{$type}",$html,$custom_field);
1293
+        echo apply_filters("geodir_custom_field_input_{$type}", $html, $custom_field);
1294 1294
 
1295 1295
 
1296 1296
 
@@ -1305,7 +1305,7 @@  discard block
 block discarded – undo
1305 1305
          * @param array $val The settings array for the field. {@see geodir_custom_field_save()}.
1306 1306
          * @see 'geodir_before_custom_form_field_$name'
1307 1307
          */
1308
-        do_action('geodir_after_custom_form_field_' . $name, $listing_type, $package_id, $val);
1308
+        do_action('geodir_after_custom_form_field_'.$name, $listing_type, $package_id, $val);
1309 1309
 
1310 1310
     }
1311 1311
 
@@ -1331,7 +1331,7 @@  discard block
 block discarded – undo
1331 1331
 
1332 1332
         $filter = $wpdb->get_row(
1333 1333
             $wpdb->prepare(
1334
-                "SELECT * FROM " . GEODIR_CUSTOM_FIELDS_TABLE . " WHERE post_type=%s AND " . $key . "='" . $value . "'",
1334
+                "SELECT * FROM ".GEODIR_CUSTOM_FIELDS_TABLE." WHERE post_type=%s AND ".$key."='".$value."'",
1335 1335
                 array($geodir_post_type)
1336 1336
             )
1337 1337
         );
@@ -1346,14 +1346,14 @@  discard block
 block discarded – undo
1346 1346
 }
1347 1347
 
1348 1348
 
1349
-function geodir_field_icon_proccess($cf){
1349
+function geodir_field_icon_proccess($cf) {
1350 1350
 
1351 1351
 
1352 1352
     if (strpos($cf['field_icon'], 'http') !== false) {
1353
-        $field_icon = ' background: url(' . $cf['field_icon'] . ') no-repeat left center;background-size:18px 18px;padding-left: 21px;';
1353
+        $field_icon = ' background: url('.$cf['field_icon'].') no-repeat left center;background-size:18px 18px;padding-left: 21px;';
1354 1354
     } elseif (strpos($cf['field_icon'], 'fa fa-') !== false) {
1355
-        $field_icon = '<i class="' . $cf['field_icon'] . '"></i>';
1356
-    }else{
1355
+        $field_icon = '<i class="'.$cf['field_icon'].'"></i>';
1356
+    } else {
1357 1357
         $field_icon = $cf['field_icon'];
1358 1358
     }
1359 1359
 
@@ -1403,7 +1403,7 @@  discard block
 block discarded – undo
1403 1403
                 $field_icon = geodir_field_icon_proccess($type);
1404 1404
                 $filed_type = $type['type'];
1405 1405
                 $html_var = isset($type['htmlvar_name']) ? $type['htmlvar_name'] : '';
1406
-                if($html_var=='post'){$html_var='post_address';}
1406
+                if ($html_var == 'post') {$html_var = 'post_address'; }
1407 1407
 
1408 1408
                 /**
1409 1409
                  * Filter the output for custom fields.
@@ -1414,7 +1414,7 @@  discard block
 block discarded – undo
1414 1414
                  * @param string $fields_location The location the field is to be show.
1415 1415
                  * @param array $type The array of field values.
1416 1416
                  */
1417
-                $html = apply_filters("geodir_custom_field_output_{$filed_type}",$html,$fields_location,$type);
1417
+                $html = apply_filters("geodir_custom_field_output_{$filed_type}", $html, $fields_location, $type);
1418 1418
 
1419 1419
                 $variables_array = array();
1420 1420
 
@@ -1477,7 +1477,7 @@  discard block
 block discarded – undo
1477 1477
          * @param string $fields_location The location the fields are being output.
1478 1478
          * @since 1.6.9
1479 1479
          */
1480
-        return apply_filters('geodir_show_listing_info',$html,$fields_location);
1480
+        return apply_filters('geodir_show_listing_info', $html, $fields_location);
1481 1481
 
1482 1482
     }
1483 1483
 }
@@ -1552,7 +1552,7 @@  discard block
 block discarded – undo
1552 1552
 
1553 1553
         $post_type = get_post_type($post_id);
1554 1554
         //echo $field_id; exit;
1555
-        $table = $plugin_prefix . $post_type . '_detail';
1555
+        $table = $plugin_prefix.$post_type.'_detail';
1556 1556
 
1557 1557
         $postcurr_images = array();
1558 1558
         $postcurr_images = geodir_get_post_meta($post_id, $field_id, true);
@@ -1571,13 +1571,13 @@  discard block
 block discarded – undo
1571 1571
             $geodir_uploadurl = $uploads['url'];
1572 1572
             $sub_dir = $uploads['subdir'];
1573 1573
 
1574
-            $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'] : '';
1574
+            $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'] : '';
1575 1575
 
1576 1576
             for ($m = 0; $m < count($post_image); $m++) {
1577 1577
 
1578 1578
                 /* --------- start ------- */
1579 1579
 
1580
-                if (!$find_image = $wpdb->get_var($wpdb->prepare("SELECT post_id FROM " . $table . " WHERE $field_id = %s AND post_id = %d", array($post_image[$m], $post_id)))) {
1580
+                if (!$find_image = $wpdb->get_var($wpdb->prepare("SELECT post_id FROM ".$table." WHERE $field_id = %s AND post_id = %d", array($post_image[$m], $post_id)))) {
1581 1581
 
1582 1582
 
1583 1583
                     $curr_img_url = $post_image[$m];
@@ -1603,24 +1603,24 @@  discard block
 block discarded – undo
1603 1603
                     //$allowed_file_types = array('image/jpg', 'image/jpeg', 'image/gif', 'image/png', 'application/pdf', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/octet-stream', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'text/csv', 'text/plain');
1604 1604
 
1605 1605
                     if (!function_exists('wp_handle_upload'))
1606
-                        require_once(ABSPATH . 'wp-admin/includes/file.php');
1606
+                        require_once(ABSPATH.'wp-admin/includes/file.php');
1607 1607
 
1608 1608
                     if (!is_dir($geodir_uploadpath))
1609 1609
                         mkdir($geodir_uploadpath);
1610 1610
 
1611
-                    $new_name = $post_id . '_' . $field_id . '_' . $img_name_arr[0] . '.' . $img_name_arr[1];
1611
+                    $new_name = $post_id.'_'.$field_id.'_'.$img_name_arr[0].'.'.$img_name_arr[1];
1612 1612
                     $explode_sub_dir = explode("/", $sub_dir);
1613 1613
                     if ($curr_img_dir == end($explode_sub_dir)) {
1614
-                        $img_path = $geodir_uploadpath . '/' . $filename;
1615
-                        $img_url = $geodir_uploadurl . '/' . $filename;
1614
+                        $img_path = $geodir_uploadpath.'/'.$filename;
1615
+                        $img_url = $geodir_uploadurl.'/'.$filename;
1616 1616
                     } else {
1617
-                        $img_path = $uploads_dir . '/temp_' . $current_user->data->ID . '/' . $filename;
1618
-                        $img_url = $uploads['url'] . '/temp_' . $current_user->data->ID . '/' . $filename;
1617
+                        $img_path = $uploads_dir.'/temp_'.$current_user->data->ID.'/'.$filename;
1618
+                        $img_url = $uploads['url'].'/temp_'.$current_user->data->ID.'/'.$filename;
1619 1619
                     }
1620 1620
 
1621 1621
                     $uploaded_file = '';
1622 1622
                     if (file_exists($img_path))
1623
-                        $uploaded_file = copy($img_path, $geodir_uploadpath . '/' . $new_name);
1623
+                        $uploaded_file = copy($img_path, $geodir_uploadpath.'/'.$new_name);
1624 1624
 
1625 1625
                     if ($curr_img_dir != $geodir_uploaddir) {
1626 1626
                         if (file_exists($img_path))
@@ -1628,7 +1628,7 @@  discard block
 block discarded – undo
1628 1628
                     }
1629 1629
 
1630 1630
                     if (!empty($uploaded_file))
1631
-                        $file_urls = $geodir_uploadurl . '/' . $new_name;
1631
+                        $file_urls = $geodir_uploadurl.'/'.$new_name;
1632 1632
 
1633 1633
                 } else {
1634 1634
                     $file_urls = $post_image[$m];
@@ -1642,8 +1642,8 @@  discard block
 block discarded – undo
1642 1642
         if (!empty($postcurr_images)) {
1643 1643
 
1644 1644
             if ($file_urls != $postcurr_images) {
1645
-                $invalid_files[] = (object)array('src' => $postcurr_images);
1646
-                $invalid_files = (object)$invalid_files;
1645
+                $invalid_files[] = (object) array('src' => $postcurr_images);
1646
+                $invalid_files = (object) $invalid_files;
1647 1647
             }
1648 1648
         }
1649 1649
 
@@ -1695,9 +1695,9 @@  discard block
 block discarded – undo
1695 1695
     function geodir_upload_dir($upload)
1696 1696
     {
1697 1697
         global $current_user;
1698
-        $upload['subdir'] = $upload['subdir'] . '/temp_' . $current_user->data->ID;
1699
-        $upload['path'] = $upload['basedir'] . $upload['subdir'];
1700
-        $upload['url'] = $upload['baseurl'] . $upload['subdir'];
1698
+        $upload['subdir'] = $upload['subdir'].'/temp_'.$current_user->data->ID;
1699
+        $upload['path'] = $upload['basedir'].$upload['subdir'];
1700
+        $upload['url'] = $upload['baseurl'].$upload['subdir'];
1701 1701
         return $upload;
1702 1702
     }
1703 1703
 
@@ -1712,20 +1712,20 @@  discard block
 block discarded – undo
1712 1712
         // check ajax noonce
1713 1713
         $imgid = $_POST["imgid"];
1714 1714
 
1715
-        check_ajax_referer($imgid . 'pluploadan');
1715
+        check_ajax_referer($imgid.'pluploadan');
1716 1716
 
1717 1717
         // handle custom file uploaddir
1718 1718
         add_filter('upload_dir', 'geodir_upload_dir');
1719 1719
 
1720 1720
         // change file orinetation if needed
1721
-        $fixed_file = geodir_exif($_FILES[$imgid . 'async-upload']);
1721
+        $fixed_file = geodir_exif($_FILES[$imgid.'async-upload']);
1722 1722
 
1723 1723
         // handle file upload
1724 1724
         $status = wp_handle_upload($fixed_file, array('test_form' => true, 'action' => 'plupload_action'));
1725 1725
         // remove handle custom file uploaddir
1726 1726
         remove_filter('upload_dir', 'geodir_upload_dir');
1727 1727
 
1728
-        if(!isset($status['url']) && isset($status['error'])){
1728
+        if (!isset($status['url']) && isset($status['error'])) {
1729 1729
             print_r($status);
1730 1730
         }
1731 1731
 
@@ -1755,9 +1755,9 @@  discard block
 block discarded – undo
1755 1755
 
1756 1756
     $post_type = get_post_type($post_id);
1757 1757
 
1758
-    $table = $plugin_prefix . $post_type . '_detail';
1758
+    $table = $plugin_prefix.$post_type.'_detail';
1759 1759
 
1760
-    $results = $wpdb->get_results($wpdb->prepare("SELECT geodir_video FROM " . $table . " WHERE post_id=%d", array($post_id)));
1760
+    $results = $wpdb->get_results($wpdb->prepare("SELECT geodir_video FROM ".$table." WHERE post_id=%d", array($post_id)));
1761 1761
 
1762 1762
     if ($results) {
1763 1763
         return $results[0]->geodir_video;
@@ -1781,9 +1781,9 @@  discard block
 block discarded – undo
1781 1781
 
1782 1782
     $post_type = get_post_type($post_id);
1783 1783
 
1784
-    $table = $plugin_prefix . $post_type . '_detail';
1784
+    $table = $plugin_prefix.$post_type.'_detail';
1785 1785
 
1786
-    $results = $wpdb->get_results($wpdb->prepare("SELECT geodir_special_offers FROM " . $table . " WHERE post_id=%d", array($post_id)));
1786
+    $results = $wpdb->get_results($wpdb->prepare("SELECT geodir_special_offers FROM ".$table." WHERE post_id=%d", array($post_id)));
1787 1787
 
1788 1788
     if ($results) {
1789 1789
         return $results[0]->geodir_special_offers;
@@ -1801,12 +1801,12 @@  discard block
 block discarded – undo
1801 1801
      */
1802 1802
     function geodir_max_upload_size()
1803 1803
     {
1804
-        $max_filesize = (float)get_option('geodir_upload_max_filesize', 2);
1804
+        $max_filesize = (float) get_option('geodir_upload_max_filesize', 2);
1805 1805
 
1806 1806
         if ($max_filesize > 0 && $max_filesize < 1) {
1807
-            $max_filesize = (int)($max_filesize * 1024) . 'kb';
1807
+            $max_filesize = (int) ($max_filesize * 1024).'kb';
1808 1808
         } else {
1809
-            $max_filesize = $max_filesize > 0 ? $max_filesize . 'mb' : '2mb';
1809
+            $max_filesize = $max_filesize > 0 ? $max_filesize.'mb' : '2mb';
1810 1810
         }
1811 1811
         /** Filter documented in geodirectory-functions/general_functions.php **/
1812 1812
         return apply_filters('geodir_default_image_upload_size_limit', $max_filesize);
@@ -1838,7 +1838,7 @@  discard block
 block discarded – undo
1838 1838
 
1839 1839
             $custom_fields = $wpdb->get_results(
1840 1840
                 $wpdb->prepare(
1841
-                    "select post_type,data_type,field_type,site_title,htmlvar_name,field_icon from " . GEODIR_CUSTOM_FIELDS_TABLE . " where post_type = %s and is_active='1' and cat_sort='1' AND field_type != 'address' order by sort_order asc",
1841
+                    "select post_type,data_type,field_type,site_title,htmlvar_name,field_icon from ".GEODIR_CUSTOM_FIELDS_TABLE." where post_type = %s and is_active='1' and cat_sort='1' AND field_type != 'address' order by sort_order asc",
1842 1842
                     array($post_type)
1843 1843
                 ), 'ARRAY_A'
1844 1844
             );
@@ -1965,7 +1965,7 @@  discard block
 block discarded – undo
1965 1965
 
1966 1966
             $post_meta_info = $wpdb->query(
1967 1967
                 $wpdb->prepare(
1968
-                    "update " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set 
1968
+                    "update ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." set 
1969 1969
 															sort_order=%d 
1970 1970
 															where id= %d",
1971 1971
                     array($count, $cf)
@@ -2047,14 +2047,14 @@  discard block
 block discarded – undo
2047 2047
 
2048 2048
         $check_html_variable = $wpdb->get_var(
2049 2049
             $wpdb->prepare(
2050
-                "select htmlvar_name from " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s and field_type=%s ",
2050
+                "select htmlvar_name from ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." where htmlvar_name = %s and post_type = %s and field_type=%s ",
2051 2051
                 array($cehhtmlvar_name, $post_type, $field_type)
2052 2052
             )
2053 2053
         );
2054 2054
 
2055 2055
         if ($is_default == 1) {
2056 2056
 
2057
-            $wpdb->query($wpdb->prepare("update " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set is_default='0', default_order='' where post_type = %s", array($post_type)));
2057
+            $wpdb->query($wpdb->prepare("update ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." set is_default='0', default_order='' where post_type = %s", array($post_type)));
2058 2058
 
2059 2059
         }
2060 2060
 
@@ -2065,7 +2065,7 @@  discard block
 block discarded – undo
2065 2065
 
2066 2066
                 $wpdb->prepare(
2067 2067
 
2068
-                    "insert into " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set 
2068
+                    "insert into ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." set 
2069 2069
 				post_type = %s,
2070 2070
 				data_type = %s,
2071 2071
 				field_type = %s,
@@ -2096,7 +2096,7 @@  discard block
 block discarded – undo
2096 2096
 
2097 2097
                 $wpdb->prepare(
2098 2098
 
2099
-                    "update " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set 
2099
+                    "update ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." set 
2100 2100
 				post_type = %s,
2101 2101
 				data_type = %s,
2102 2102
 				field_type = %s,
@@ -2122,7 +2122,7 @@  discard block
 block discarded – undo
2122 2122
         }
2123 2123
 
2124 2124
 
2125
-        return (int)$lastid;
2125
+        return (int) $lastid;
2126 2126
 
2127 2127
     }
2128 2128
 }
@@ -2145,7 +2145,7 @@  discard block
 block discarded – undo
2145 2145
         if ($field_id != '') {
2146 2146
             $cf = trim($field_id, '_');
2147 2147
 
2148
-            $wpdb->query($wpdb->prepare("delete from " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " where id= %d ", array($cf)));
2148
+            $wpdb->query($wpdb->prepare("delete from ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." where id= %d ", array($cf)));
2149 2149
 
2150 2150
             return $field_id;
2151 2151
 
@@ -2168,12 +2168,12 @@  discard block
 block discarded – undo
2168 2168
      * @param string $field_ins_upd When set to "submit" displays form.
2169 2169
      * @param bool $default when set to true field will be for admin use only.
2170 2170
      */
2171
-    function geodir_custom_sort_field_adminhtml($field_type, $result_str, $field_ins_upd = '', $field_type_key='')
2171
+    function geodir_custom_sort_field_adminhtml($field_type, $result_str, $field_ins_upd = '', $field_type_key = '')
2172 2172
     {
2173 2173
         global $wpdb;
2174 2174
         $cf = $result_str;
2175 2175
         if (!is_object($cf)) {
2176
-            $field_info = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " WHERE id = %d", array($cf)));
2176
+            $field_info = $wpdb->get_row($wpdb->prepare("SELECT * FROM ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." WHERE id = %d", array($cf)));
2177 2177
         } else {
2178 2178
             $field_info = $cf;
2179 2179
             $result_str = $cf->id;
@@ -2209,18 +2209,18 @@  discard block
 block discarded – undo
2209 2209
         if ($htmlvar_name == '')
2210 2210
             $htmlvar_name = isset($field_info->htmlvar_name) ? $field_info->htmlvar_name : '';
2211 2211
 
2212
-        $nonce = wp_create_nonce('custom_fields_' . $result_str);
2212
+        $nonce = wp_create_nonce('custom_fields_'.$result_str);
2213 2213
 
2214 2214
         $field_icon = '<i class="fa fa-cog" aria-hidden="true"></i>';
2215 2215
         $cso_arr = geodir_get_custom_sort_options($post_type);
2216 2216
 
2217 2217
         $cur_field_type = (isset($cf->field_type)) ? $cf->field_type : esc_html($_REQUEST['field_type']);
2218
-        foreach($cso_arr as $cso){
2219
-            if($cur_field_type==$cso['field_type']){
2218
+        foreach ($cso_arr as $cso) {
2219
+            if ($cur_field_type == $cso['field_type']) {
2220 2220
 
2221 2221
                 if (isset($cso['field_icon']) && strpos($cso['field_icon'], 'fa fa-') !== false) {
2222 2222
                     $field_icon = '<i class="'.$cso['field_icon'].'" aria-hidden="true"></i>';
2223
-                }elseif(isset($cso['field_icon']) && $cso['field_icon']){
2223
+                }elseif (isset($cso['field_icon']) && $cso['field_icon']) {
2224 2224
                     $field_icon = '<b style="background-image: url("'.$cso['field_icon'].'")"></b>';
2225 2225
                 }
2226 2226
 
@@ -2230,40 +2230,40 @@  discard block
 block discarded – undo
2230 2230
         $radio_id = (isset($field_info->htmlvar_name)) ? $field_info->htmlvar_name.$field_type : rand(5, 500);
2231 2231
         ?>
2232 2232
 
2233
-        <li class="text" id="licontainer_<?php echo $result_str;?>">
2233
+        <li class="text" id="licontainer_<?php echo $result_str; ?>">
2234 2234
             <form><!-- we need to wrap in a fom so we can use radio buttons with same name -->
2235
-            <div class="title title<?php echo $result_str;?> gt-fieldset"
2236
-                 title="<?php _e('Double Click to toggle and drag-drop to sort', 'geodirectory');?>"
2237
-                 ondblclick="show_hide('field_frm<?php echo $result_str;?>')">
2235
+            <div class="title title<?php echo $result_str; ?> gt-fieldset"
2236
+                 title="<?php _e('Double Click to toggle and drag-drop to sort', 'geodirectory'); ?>"
2237
+                 ondblclick="show_hide('field_frm<?php echo $result_str; ?>')">
2238 2238
                 <?php
2239 2239
 
2240 2240
                 ?>
2241 2241
 
2242
-                <div title="<?php _e('Click to remove field', 'geodirectory');?>"
2243
-                     onclick="delete_sort_field('<?php echo $result_str;?>', '<?php echo $nonce;?>', this)"
2242
+                <div title="<?php _e('Click to remove field', 'geodirectory'); ?>"
2243
+                     onclick="delete_sort_field('<?php echo $result_str; ?>', '<?php echo $nonce; ?>', this)"
2244 2244
                      class="handlediv close"><i class="fa fa-times" aria-hidden="true"></i></div>
2245 2245
 
2246 2246
 
2247
-                <?php echo $field_icon;?>
2247
+                <?php echo $field_icon; ?>
2248 2248
                 <b style="cursor:pointer;"
2249
-                   onclick="show_hide('field_frm<?php echo $result_str;?>')"><?php echo geodir_ucwords(__('Field:', 'geodirectory') . ' (' . $site_title . ')');?></b>
2249
+                   onclick="show_hide('field_frm<?php echo $result_str; ?>')"><?php echo geodir_ucwords(__('Field:', 'geodirectory').' ('.$site_title.')'); ?></b>
2250 2250
 
2251 2251
             </div>
2252 2252
 
2253
-            <div id="field_frm<?php echo $result_str;?>" class="field_frm"
2253
+            <div id="field_frm<?php echo $result_str; ?>" class="field_frm"
2254 2254
                  style="display:<?php if ($field_ins_upd == 'submit') {
2255 2255
                      echo 'block;';
2256 2256
                  } else {
2257 2257
                      echo 'none;';
2258 2258
                  } ?>">
2259 2259
                 <input type="hidden" name="_wpnonce" value="<?php echo $nonce; ?>"/>
2260
-                <input type="hidden" name="listing_type" id="listing_type" value="<?php echo $post_type;?>"/>
2261
-                <input type="hidden" name="field_type" id="field_type" value="<?php echo $field_type;?>"/>
2262
-                <input type="hidden" name="field_id" id="field_id" value="<?php echo $result_str;?>"/>
2260
+                <input type="hidden" name="listing_type" id="listing_type" value="<?php echo $post_type; ?>"/>
2261
+                <input type="hidden" name="field_type" id="field_type" value="<?php echo $field_type; ?>"/>
2262
+                <input type="hidden" name="field_id" id="field_id" value="<?php echo $result_str; ?>"/>
2263 2263
                 <input type="hidden" name="data_type" id="data_type" value="<?php if (isset($field_info->data_type)) {
2264 2264
                     echo $field_info->data_type;
2265 2265
                 }?>"/>
2266
-                <input type="hidden" name="htmlvar_name" id="htmlvar_name" value="<?php echo $htmlvar_name;?>"/>
2266
+                <input type="hidden" name="htmlvar_name" id="htmlvar_name" value="<?php echo $htmlvar_name; ?>"/>
2267 2267
 
2268 2268
 
2269 2269
                 <ul class="widefat post fixed" border="0" style="width:100%;">
@@ -2273,7 +2273,7 @@  discard block
 block discarded – undo
2273 2273
                         <input type="hidden" name="site_title" id="site_title" value="<?php echo esc_attr($site_title); ?>"/>
2274 2274
 
2275 2275
                         <li>
2276
-                            <?php $value = (isset($field_info->sort_asc) && $field_info->sort_asc) ? $field_info->sort_asc : 0;?>
2276
+                            <?php $value = (isset($field_info->sort_asc) && $field_info->sort_asc) ? $field_info->sort_asc : 0; ?>
2277 2277
 
2278 2278
                             <label for="asc" class="gd-cf-tooltip-wrap">
2279 2279
                                 <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Show Ascending Sort (low to high)', 'geodirectory'); ?>
@@ -2283,24 +2283,24 @@  discard block
 block discarded – undo
2283 2283
                             </label>
2284 2284
                             <div class="gd-cf-input-wrap gd-switch">
2285 2285
 
2286
-                                <input type="radio" id="asc_yes<?php echo $radio_id;?>" name="asc" class="gdri-enabled"  value="1"
2286
+                                <input type="radio" id="asc_yes<?php echo $radio_id; ?>" name="asc" class="gdri-enabled"  value="1"
2287 2287
                                     <?php if ($value == '1') {
2288 2288
                                         echo 'checked';
2289 2289
                                     } ?>/>
2290
-                                <label onclick="show_hide_radio(this,'show','cfs-asc-title');" for="asc_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
2290
+                                <label onclick="show_hide_radio(this,'show','cfs-asc-title');" for="asc_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
2291 2291
 
2292
-                                <input type="radio" id="asc_no<?php echo $radio_id;?>" name="asc" class="gdri-disabled" value="0"
2292
+                                <input type="radio" id="asc_no<?php echo $radio_id; ?>" name="asc" class="gdri-disabled" value="0"
2293 2293
                                     <?php if ($value == '0' || !$value) {
2294 2294
                                         echo 'checked';
2295 2295
                                     } ?>/>
2296
-                                <label onclick="show_hide_radio(this,'hide','cfs-asc-title');" for="asc_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
2296
+                                <label onclick="show_hide_radio(this,'hide','cfs-asc-title');" for="asc_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
2297 2297
 
2298 2298
                             </div>
2299 2299
 
2300 2300
                         </li>
2301 2301
 
2302
-                        <li class="cfs-asc-title" <?php if ((isset($field_info->sort_asc) && $field_info->sort_asc == '0') || !isset($field_info->sort_asc)) {echo "style='display:none;'";}?>>
2303
-                            <?php $value = (isset($field_info->asc_title) && $field_info->asc_title) ? esc_attr($field_info->asc_title) : '';?>
2302
+                        <li class="cfs-asc-title" <?php if ((isset($field_info->sort_asc) && $field_info->sort_asc == '0') || !isset($field_info->sort_asc)) {echo "style='display:none;'"; }?>>
2303
+                            <?php $value = (isset($field_info->asc_title) && $field_info->asc_title) ? esc_attr($field_info->asc_title) : ''; ?>
2304 2304
 
2305 2305
                             <label for="asc_title" class="gd-cf-tooltip-wrap">
2306 2306
                                 <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Ascending title', 'geodirectory'); ?>
@@ -2310,14 +2310,14 @@  discard block
 block discarded – undo
2310 2310
                             </label>
2311 2311
                             <div class="gd-cf-input-wrap">
2312 2312
 
2313
-                                <input type="text" name="asc_title" id="asc_title" value="<?php echo $value;?>" />
2313
+                                <input type="text" name="asc_title" id="asc_title" value="<?php echo $value; ?>" />
2314 2314
                             </div>
2315 2315
 
2316 2316
 
2317 2317
                         </li>
2318 2318
 
2319 2319
 
2320
-                        <li class="cfs-asc-title" <?php if ((isset($field_info->sort_asc) && $field_info->sort_asc == '0') || !isset($field_info->sort_asc)) {echo "style='display:none;'";}?>>
2320
+                        <li class="cfs-asc-title" <?php if ((isset($field_info->sort_asc) && $field_info->sort_asc == '0') || !isset($field_info->sort_asc)) {echo "style='display:none;'"; }?>>
2321 2321
 
2322 2322
                             <label for="is_default" class="gd-cf-tooltip-wrap">
2323 2323
                                 <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Default sort?', 'geodirectory'); ?>
@@ -2328,7 +2328,7 @@  discard block
 block discarded – undo
2328 2328
                             <div class="gd-cf-input-wrap">
2329 2329
 
2330 2330
                                 <input type="radio" name="is_default"
2331
-                                       value="<?php echo $htmlvar_name; ?>_asc" <?php if (isset($field_info->default_order) && $field_info->default_order == $htmlvar_name . '_asc') {
2331
+                                       value="<?php echo $htmlvar_name; ?>_asc" <?php if (isset($field_info->default_order) && $field_info->default_order == $htmlvar_name.'_asc') {
2332 2332
                                     echo 'checked="checked"';
2333 2333
                                 } ?>/>
2334 2334
                             </div>
@@ -2338,7 +2338,7 @@  discard block
 block discarded – undo
2338 2338
 
2339 2339
 
2340 2340
                         <li>
2341
-                            <?php $value = (isset($field_info->sort_desc) && $field_info->sort_desc) ? $field_info->sort_desc : 0;?>
2341
+                            <?php $value = (isset($field_info->sort_desc) && $field_info->sort_desc) ? $field_info->sort_desc : 0; ?>
2342 2342
 
2343 2343
                             <label for="desc" class="gd-cf-tooltip-wrap">
2344 2344
                                 <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Show Descending Sort (high to low)', 'geodirectory'); ?>
@@ -2348,24 +2348,24 @@  discard block
 block discarded – undo
2348 2348
                             </label>
2349 2349
                             <div class="gd-cf-input-wrap gd-switch">
2350 2350
 
2351
-                                <input type="radio" id="desc_yes<?php echo $radio_id;?>" name="desc" class="gdri-enabled"  value="1"
2351
+                                <input type="radio" id="desc_yes<?php echo $radio_id; ?>" name="desc" class="gdri-enabled"  value="1"
2352 2352
                                     <?php if ($value == '1') {
2353 2353
                                         echo 'checked';
2354 2354
                                     } ?>/>
2355
-                                <label onclick="show_hide_radio(this,'show','cfs-desc-title');" for="desc_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
2355
+                                <label onclick="show_hide_radio(this,'show','cfs-desc-title');" for="desc_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
2356 2356
 
2357
-                                <input type="radio" id="desc_no<?php echo $radio_id;?>" name="desc" class="gdri-disabled" value="0"
2357
+                                <input type="radio" id="desc_no<?php echo $radio_id; ?>" name="desc" class="gdri-disabled" value="0"
2358 2358
                                     <?php if ($value == '0' || !$value) {
2359 2359
                                         echo 'checked';
2360 2360
                                     } ?>/>
2361
-                                <label onclick="show_hide_radio(this,'hide','cfs-desc-title');" for="desc_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
2361
+                                <label onclick="show_hide_radio(this,'hide','cfs-desc-title');" for="desc_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
2362 2362
 
2363 2363
                             </div>
2364 2364
 
2365 2365
                         </li>
2366 2366
 
2367
-                        <li class="cfs-desc-title" <?php if ((isset($field_info->sort_desc) && $field_info->sort_desc == '0') || !isset($field_info->sort_desc)) {echo "style='display:none;'";}?>>
2368
-                            <?php $value = (isset($field_info->desc_title) && $field_info->desc_title) ? esc_attr($field_info->desc_title) : '';?>
2367
+                        <li class="cfs-desc-title" <?php if ((isset($field_info->sort_desc) && $field_info->sort_desc == '0') || !isset($field_info->sort_desc)) {echo "style='display:none;'"; }?>>
2368
+                            <?php $value = (isset($field_info->desc_title) && $field_info->desc_title) ? esc_attr($field_info->desc_title) : ''; ?>
2369 2369
 
2370 2370
                             <label for="desc_title" class="gd-cf-tooltip-wrap">
2371 2371
                                 <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Descending title', 'geodirectory'); ?>
@@ -2375,13 +2375,13 @@  discard block
 block discarded – undo
2375 2375
                             </label>
2376 2376
                             <div class="gd-cf-input-wrap">
2377 2377
 
2378
-                                <input type="text" name="desc_title" id="desc_title" value="<?php echo $value;?>" />
2378
+                                <input type="text" name="desc_title" id="desc_title" value="<?php echo $value; ?>" />
2379 2379
                             </div>
2380 2380
 
2381 2381
 
2382 2382
                         </li>
2383 2383
 
2384
-                        <li class="cfs-desc-title" <?php if ((isset($field_info->sort_desc) && $field_info->sort_desc == '0') || !isset($field_info->sort_desc)) {echo "style='display:none;'";}?>>
2384
+                        <li class="cfs-desc-title" <?php if ((isset($field_info->sort_desc) && $field_info->sort_desc == '0') || !isset($field_info->sort_desc)) {echo "style='display:none;'"; }?>>
2385 2385
 
2386 2386
                             <label for="is_default" class="gd-cf-tooltip-wrap">
2387 2387
                                 <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Default sort?', 'geodirectory'); ?>
@@ -2392,7 +2392,7 @@  discard block
 block discarded – undo
2392 2392
                             <div class="gd-cf-input-wrap">
2393 2393
 
2394 2394
                                 <input type="radio" name="is_default"
2395
-                                       value="<?php echo $htmlvar_name; ?>_desc" <?php if (isset($field_info->default_order) && $field_info->default_order == $htmlvar_name . '_desc') {
2395
+                                       value="<?php echo $htmlvar_name; ?>_desc" <?php if (isset($field_info->default_order) && $field_info->default_order == $htmlvar_name.'_desc') {
2396 2396
                                     echo 'checked="checked"';
2397 2397
                                 } ?>/>
2398 2398
                             </div>
@@ -2417,14 +2417,14 @@  discard block
 block discarded – undo
2417 2417
                             </label>
2418 2418
                             <div class="gd-cf-input-wrap">
2419 2419
 
2420
-                                <input type="text" name="site_title" id="site_title" value="<?php echo $value;?>" />
2420
+                                <input type="text" name="site_title" id="site_title" value="<?php echo $value; ?>" />
2421 2421
                             </div>
2422 2422
 
2423 2423
 
2424 2424
                         </li>
2425 2425
 
2426 2426
                         <li>
2427
-                            <?php $value = (isset($field_info->is_default) && $field_info->is_default) ? esc_attr($field_info->is_default) : '';?>
2427
+                            <?php $value = (isset($field_info->is_default) && $field_info->is_default) ? esc_attr($field_info->is_default) : ''; ?>
2428 2428
 
2429 2429
                             <label for="is_default" class="gd-cf-tooltip-wrap">
2430 2430
                                 <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Default sort?', 'geodirectory'); ?>
@@ -2448,7 +2448,7 @@  discard block
 block discarded – undo
2448 2448
 
2449 2449
 
2450 2450
                     <li>
2451
-                        <?php $value = (isset($field_info->is_active) && $field_info->is_active) ? $field_info->is_active: 0;?>
2451
+                        <?php $value = (isset($field_info->is_active) && $field_info->is_active) ? $field_info->is_active : 0; ?>
2452 2452
 
2453 2453
                         <label for="is_active" class="gd-cf-tooltip-wrap">
2454 2454
                             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Is active', 'geodirectory'); ?>
@@ -2458,17 +2458,17 @@  discard block
 block discarded – undo
2458 2458
                         </label>
2459 2459
                         <div class="gd-cf-input-wrap gd-switch">
2460 2460
 
2461
-                            <input type="radio" id="is_active_yes<?php echo $radio_id;?>" name="is_active" class="gdri-enabled"  value="1"
2461
+                            <input type="radio" id="is_active_yes<?php echo $radio_id; ?>" name="is_active" class="gdri-enabled"  value="1"
2462 2462
                                 <?php if ($value == '1') {
2463 2463
                                     echo 'checked';
2464 2464
                                 } ?>/>
2465
-                            <label for="is_active_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
2465
+                            <label for="is_active_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
2466 2466
 
2467
-                            <input type="radio" id="is_active_no<?php echo $radio_id;?>" name="is_active" class="gdri-disabled" value="0"
2467
+                            <input type="radio" id="is_active_no<?php echo $radio_id; ?>" name="is_active" class="gdri-disabled" value="0"
2468 2468
                                 <?php if ($value == '0' || !$value) {
2469 2469
                                     echo 'checked';
2470 2470
                                 } ?>/>
2471
-                            <label for="is_active_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
2471
+                            <label for="is_active_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
2472 2472
 
2473 2473
                         </div>
2474 2474
 
@@ -2489,10 +2489,10 @@  discard block
 block discarded – undo
2489 2489
                             <h3></h3>
2490 2490
                         </label>
2491 2491
                         <div class="gd-cf-input-wrap">
2492
-                            <input type="button" class="button button-primary" name="save" id="save" value="<?php echo esc_attr(__('Save','geodirectory'));?>"
2492
+                            <input type="button" class="button button-primary" name="save" id="save" value="<?php echo esc_attr(__('Save', 'geodirectory')); ?>"
2493 2493
                                    onclick="save_sort_field('<?php echo esc_attr($result_str); ?>')"/>
2494
-                                <a href="javascript:void(0)"><input type="button" name="delete" value="<?php echo esc_attr(__('Delete','geodirectory'));?>"
2495
-                                                                    onclick="delete_sort_field('<?php echo $result_str;?>', '<?php echo $nonce;?>', this)"
2494
+                                <a href="javascript:void(0)"><input type="button" name="delete" value="<?php echo esc_attr(__('Delete', 'geodirectory')); ?>"
2495
+                                                                    onclick="delete_sort_field('<?php echo $result_str; ?>', '<?php echo $nonce; ?>', this)"
2496 2496
                                                                     class="button"/></a>
2497 2497
                         </div>
2498 2498
                     </li>
@@ -2527,7 +2527,7 @@  discard block
 block discarded – undo
2527 2527
         if (!$package_id || !$field_name || !$post_type) {
2528 2528
             return true;
2529 2529
         }
2530
-        $sql = $wpdb->prepare("SELECT id FROM " . GEODIR_CUSTOM_FIELDS_TABLE . " WHERE is_active='1' AND htmlvar_name=%s AND post_type=%s AND FIND_IN_SET(%s, packages)", array($field_name, $post_type, (int)$package_id));
2530
+        $sql = $wpdb->prepare("SELECT id FROM ".GEODIR_CUSTOM_FIELDS_TABLE." WHERE is_active='1' AND htmlvar_name=%s AND post_type=%s AND FIND_IN_SET(%s, packages)", array($field_name, $post_type, (int) $package_id));
2531 2531
 
2532 2532
         if ($wpdb->get_var($sql)) {
2533 2533
             return true;
@@ -2649,13 +2649,13 @@  discard block
 block discarded – undo
2649 2649
 }
2650 2650
 
2651 2651
 
2652
-function geodir_cfa_data_type_text($output,$result_str,$cf,$field_info){
2652
+function geodir_cfa_data_type_text($output, $result_str, $cf, $field_info) {
2653 2653
     ob_start();
2654 2654
 
2655 2655
     $dt_value = '';
2656 2656
     if (isset($field_info->data_type)) {
2657 2657
         $dt_value  = esc_attr($field_info->data_type);
2658
-    }elseif(isset($cf['defaults']['data_type']) && $cf['defaults']['data_type']){
2658
+    }elseif (isset($cf['defaults']['data_type']) && $cf['defaults']['data_type']) {
2659 2659
         $dt_value  = $cf['defaults']['data_type'];
2660 2660
     }
2661 2661
     ?>
@@ -2666,15 +2666,15 @@  discard block
 block discarded – undo
2666 2666
             <select name="data_type" id="data_type"
2667 2667
                     onchange="javascript:gd_data_type_changed(this, '<?php echo $result_str; ?>');">
2668 2668
                 <option
2669
-                    value="XVARCHAR" <?php if ($dt_value  == 'VARCHAR') {
2669
+                    value="XVARCHAR" <?php if ($dt_value == 'VARCHAR') {
2670 2670
                     echo 'selected="selected"';
2671 2671
                 } ?>><?php _e('CHARACTER', 'geodirectory'); ?></option>
2672 2672
                 <option
2673
-                    value="INT" <?php if ($dt_value   == 'INT') {
2673
+                    value="INT" <?php if ($dt_value == 'INT') {
2674 2674
                     echo 'selected="selected"';
2675 2675
                 } ?>><?php _e('NUMBER', 'geodirectory'); ?></option>
2676 2676
                 <option
2677
-                    value="FLOAT" <?php if ($dt_value   == 'FLOAT') {
2677
+                    value="FLOAT" <?php if ($dt_value == 'FLOAT') {
2678 2678
                     echo 'selected="selected"';
2679 2679
                 } ?>><?php _e('DECIMAL', 'geodirectory'); ?></option>
2680 2680
             </select>
@@ -2687,13 +2687,13 @@  discard block
 block discarded – undo
2687 2687
     $value = '';
2688 2688
     if (isset($field_info->decimal_point)) {
2689 2689
         $value = esc_attr($field_info->decimal_point);
2690
-    }elseif(isset($cf['defaults']['decimal_point']) && $cf['defaults']['decimal_point']){
2690
+    }elseif (isset($cf['defaults']['decimal_point']) && $cf['defaults']['decimal_point']) {
2691 2691
         $value = $cf['defaults']['decimal_point'];
2692 2692
     }
2693 2693
     ?>
2694 2694
 
2695 2695
     <li class="decimal-point-wrapper"
2696
-        style="<?php echo ($dt_value  == 'FLOAT') ? '' : 'display:none' ?>">
2696
+        style="<?php echo ($dt_value == 'FLOAT') ? '' : 'display:none' ?>">
2697 2697
         <label for="decimal_point"><?php _e('Select decimal point :', 'geodirectory'); ?></label>
2698 2698
         <div class="gd-cf-input-wrap">
2699 2699
             <select name="decimal_point" id="decimal_point">
@@ -2711,43 +2711,43 @@  discard block
 block discarded – undo
2711 2711
     $output = ob_get_clean();
2712 2712
     return $output;
2713 2713
 }
2714
-add_filter('geodir_cfa_data_type_text','geodir_cfa_data_type_text',10,4);
2714
+add_filter('geodir_cfa_data_type_text', 'geodir_cfa_data_type_text', 10, 4);
2715 2715
 
2716 2716
 // htmlvar not needed for fieldset and taxonomy
2717
-add_filter('geodir_cfa_htmlvar_name_fieldset','__return_empty_string',10,4);
2718
-add_filter('geodir_cfa_htmlvar_name_taxonomy','__return_empty_string',10,4);
2717
+add_filter('geodir_cfa_htmlvar_name_fieldset', '__return_empty_string', 10, 4);
2718
+add_filter('geodir_cfa_htmlvar_name_taxonomy', '__return_empty_string', 10, 4);
2719 2719
 
2720 2720
 
2721 2721
 // default_value not needed for textarea, html, file, fieldset, taxonomy, address
2722
-add_filter('geodir_cfa_default_value_textarea','__return_empty_string',10,4);
2723
-add_filter('geodir_cfa_default_value_html','__return_empty_string',10,4);
2724
-add_filter('geodir_cfa_default_value_file','__return_empty_string',10,4);
2725
-add_filter('geodir_cfa_default_value_taxonomy','__return_empty_string',10,4);
2726
-add_filter('geodir_cfa_default_value_address','__return_empty_string',10,4);
2727
-add_filter('geodir_cfa_default_value_fieldset','__return_empty_string',10,4);
2722
+add_filter('geodir_cfa_default_value_textarea', '__return_empty_string', 10, 4);
2723
+add_filter('geodir_cfa_default_value_html', '__return_empty_string', 10, 4);
2724
+add_filter('geodir_cfa_default_value_file', '__return_empty_string', 10, 4);
2725
+add_filter('geodir_cfa_default_value_taxonomy', '__return_empty_string', 10, 4);
2726
+add_filter('geodir_cfa_default_value_address', '__return_empty_string', 10, 4);
2727
+add_filter('geodir_cfa_default_value_fieldset', '__return_empty_string', 10, 4);
2728 2728
 
2729 2729
 // is_required not needed for fieldset
2730
-add_filter('geodir_cfa_is_required_fieldset','__return_empty_string',10,4);
2731
-add_filter('geodir_cfa_required_msg_fieldset','__return_empty_string',10,4);
2730
+add_filter('geodir_cfa_is_required_fieldset', '__return_empty_string', 10, 4);
2731
+add_filter('geodir_cfa_required_msg_fieldset', '__return_empty_string', 10, 4);
2732 2732
 
2733 2733
 // field_icon not needed for fieldset
2734
-add_filter('geodir_cfa_field_icon_fieldset','__return_empty_string',10,4);
2735
-add_filter('geodir_cfa_css_class_fieldset','__return_empty_string',10,4);
2734
+add_filter('geodir_cfa_field_icon_fieldset', '__return_empty_string', 10, 4);
2735
+add_filter('geodir_cfa_css_class_fieldset', '__return_empty_string', 10, 4);
2736 2736
 
2737 2737
 // cat_sort not needed for some fields
2738
-add_filter('geodir_cfa_cat_sort_html','__return_empty_string',10,4);
2739
-add_filter('geodir_cfa_cat_sort_file','__return_empty_string',10,4);
2740
-add_filter('geodir_cfa_cat_sort_url','__return_empty_string',10,4);
2741
-add_filter('geodir_cfa_cat_sort_fieldset','__return_empty_string',10,4);
2742
-add_filter('geodir_cfa_cat_sort_multiselect','__return_empty_string',10,4);
2743
-add_filter('geodir_cfa_cat_sort_textarea','__return_empty_string',10,4);
2744
-add_filter('geodir_cfa_cat_sort_taxonomy','__return_empty_string',10,4);
2745
-add_filter('geodir_cfa_cat_sort_address','__return_empty_string',10,4);
2738
+add_filter('geodir_cfa_cat_sort_html', '__return_empty_string', 10, 4);
2739
+add_filter('geodir_cfa_cat_sort_file', '__return_empty_string', 10, 4);
2740
+add_filter('geodir_cfa_cat_sort_url', '__return_empty_string', 10, 4);
2741
+add_filter('geodir_cfa_cat_sort_fieldset', '__return_empty_string', 10, 4);
2742
+add_filter('geodir_cfa_cat_sort_multiselect', '__return_empty_string', 10, 4);
2743
+add_filter('geodir_cfa_cat_sort_textarea', '__return_empty_string', 10, 4);
2744
+add_filter('geodir_cfa_cat_sort_taxonomy', '__return_empty_string', 10, 4);
2745
+add_filter('geodir_cfa_cat_sort_address', '__return_empty_string', 10, 4);
2746 2746
 
2747 2747
 
2748 2748
 
2749
-function geodir_cfa_advanced_editor_geodir_special_offers($output,$result_str,$cf,$field_info){
2750
-    if($field_info->htmlvar_name != 'geodir_special_offers'){return '';}
2749
+function geodir_cfa_advanced_editor_geodir_special_offers($output, $result_str, $cf, $field_info) {
2750
+    if ($field_info->htmlvar_name != 'geodir_special_offers') {return ''; }
2751 2751
     ob_start();
2752 2752
     ?>
2753 2753
     <li>
@@ -2778,16 +2778,16 @@  discard block
 block discarded – undo
2778 2778
     $output = ob_get_clean();
2779 2779
     return $output;
2780 2780
 }
2781
-add_filter('geodir_cfa_advanced_editor_textarea','geodir_cfa_advanced_editor_geodir_special_offers',10,4);
2781
+add_filter('geodir_cfa_advanced_editor_textarea', 'geodir_cfa_advanced_editor_geodir_special_offers', 10, 4);
2782 2782
 
2783 2783
 
2784
-function geodir_cfa_validation_pattern_text($output,$result_str,$cf,$field_info){
2784
+function geodir_cfa_validation_pattern_text($output, $result_str, $cf, $field_info) {
2785 2785
     ob_start();
2786 2786
 
2787 2787
     $value = '';
2788 2788
     if (isset($field_info->validation_pattern)) {
2789 2789
         $value = esc_attr($field_info->validation_pattern);
2790
-    }elseif(isset($cf['defaults']['validation_pattern']) && $cf['defaults']['validation_pattern']){
2790
+    }elseif (isset($cf['defaults']['validation_pattern']) && $cf['defaults']['validation_pattern']) {
2791 2791
         $value = esc_attr($cf['defaults']['validation_pattern']);
2792 2792
     }
2793 2793
     ?>
@@ -2807,7 +2807,7 @@  discard block
 block discarded – undo
2807 2807
     $value = '';
2808 2808
     if (isset($field_info->validation_msg)) {
2809 2809
         $value = esc_attr($field_info->validation_msg);
2810
-    }elseif(isset($cf['defaults']['validation_msg']) && $cf['defaults']['validation_msg']){
2810
+    }elseif (isset($cf['defaults']['validation_msg']) && $cf['defaults']['validation_msg']) {
2811 2811
         $value = esc_attr($cf['defaults']['validation_msg']);
2812 2812
     }
2813 2813
     ?>
@@ -2828,10 +2828,10 @@  discard block
 block discarded – undo
2828 2828
     $output = ob_get_clean();
2829 2829
     return $output;
2830 2830
 }
2831
-add_filter('geodir_cfa_validation_pattern_text','geodir_cfa_validation_pattern_text',10,4);
2831
+add_filter('geodir_cfa_validation_pattern_text', 'geodir_cfa_validation_pattern_text', 10, 4);
2832 2832
 
2833 2833
 
2834
-function geodir_cfa_htmlvar_name_taxonomy($output,$result_str,$cf,$field_info){
2834
+function geodir_cfa_htmlvar_name_taxonomy($output, $result_str, $cf, $field_info) {
2835 2835
     ob_start();
2836 2836
     global $post_type;
2837 2837
 
@@ -2856,7 +2856,7 @@  discard block
 block discarded – undo
2856 2856
                     ?>
2857 2857
                     <option <?php if (isset($field_info->htmlvar_name) && $field_info->htmlvar_name == $gd_tax) {
2858 2858
                         echo 'selected="selected"';
2859
-                    }?> id="<?php echo $gd_tax;?>"><?php echo $gd_tax;?></option><?php
2859
+                    }?> id="<?php echo $gd_tax; ?>"><?php echo $gd_tax; ?></option><?php
2860 2860
                 }
2861 2861
                 ?>
2862 2862
             </select>
@@ -2867,7 +2867,7 @@  discard block
 block discarded – undo
2867 2867
         <label for="cat_display_type" class="gd-cf-tooltip-wrap">
2868 2868
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Category display type :', 'geodirectory'); ?>
2869 2869
             <div class="gdcf-tooltip">
2870
-                <?php _e('Show categories list as select, multiselect, checkbox or radio', 'geodirectory');?>
2870
+                <?php _e('Show categories list as select, multiselect, checkbox or radio', 'geodirectory'); ?>
2871 2871
             </div>
2872 2872
         </label>
2873 2873
         <div class="gd-cf-input-wrap">
@@ -2875,19 +2875,19 @@  discard block
 block discarded – undo
2875 2875
             <select name="cat_display_type" id="cat_display_type">
2876 2876
                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'ajax_chained') {
2877 2877
                     echo 'selected="selected"';
2878
-                }?> value="ajax_chained"><?php _e('Ajax Chained', 'geodirectory');?></option>
2878
+                }?> value="ajax_chained"><?php _e('Ajax Chained', 'geodirectory'); ?></option>
2879 2879
                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'select') {
2880 2880
                     echo 'selected="selected"';
2881
-                }?> value="select"><?php _e('Select', 'geodirectory');?></option>
2881
+                }?> value="select"><?php _e('Select', 'geodirectory'); ?></option>
2882 2882
                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'multiselect') {
2883 2883
                     echo 'selected="selected"';
2884
-                }?> value="multiselect"><?php _e('Multiselect', 'geodirectory');?></option>
2884
+                }?> value="multiselect"><?php _e('Multiselect', 'geodirectory'); ?></option>
2885 2885
                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'checkbox') {
2886 2886
                     echo 'selected="selected"';
2887
-                }?> value="checkbox"><?php _e('Checkbox', 'geodirectory');?></option>
2887
+                }?> value="checkbox"><?php _e('Checkbox', 'geodirectory'); ?></option>
2888 2888
                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'radio') {
2889 2889
                     echo 'selected="selected"';
2890
-                }?> value="radio"><?php _e('Radio', 'geodirectory');?></option>
2890
+                }?> value="radio"><?php _e('Radio', 'geodirectory'); ?></option>
2891 2891
             </select>
2892 2892
         </div>
2893 2893
     </li>
@@ -2896,10 +2896,10 @@  discard block
 block discarded – undo
2896 2896
     $output = ob_get_clean();
2897 2897
     return $output;
2898 2898
 }
2899
-add_filter('geodir_cfa_htmlvar_name_taxonomy','geodir_cfa_htmlvar_name_taxonomy',10,4);
2899
+add_filter('geodir_cfa_htmlvar_name_taxonomy', 'geodir_cfa_htmlvar_name_taxonomy', 10, 4);
2900 2900
 
2901 2901
 
2902
-function geodir_cfa_extra_fields_address($output,$result_str,$cf,$field_info){
2902
+function geodir_cfa_extra_fields_address($output, $result_str, $cf, $field_info) {
2903 2903
 
2904 2904
     ob_start();
2905 2905
     if (isset($field_info->extra_fields) && $field_info->extra_fields != '') {
@@ -2922,32 +2922,32 @@  discard block
 block discarded – undo
2922 2922
         <label for="show_zip" class="gd-cf-tooltip-wrap">
2923 2923
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Display zip/post code :', 'geodirectory'); ?>
2924 2924
             <div class="gdcf-tooltip">
2925
-                <?php _e('Select if you want to show zip/post code field in address section.', 'geodirectory');?>
2925
+                <?php _e('Select if you want to show zip/post code field in address section.', 'geodirectory'); ?>
2926 2926
             </div>
2927 2927
         </label>
2928 2928
         <div class="gd-cf-input-wrap gd-switch">
2929 2929
 
2930
-            <input type="radio" id="show_zip_yes<?php echo $radio_id;?>" name="extra[show_zip]" class="gdri-enabled"  value="1"
2930
+            <input type="radio" id="show_zip_yes<?php echo $radio_id; ?>" name="extra[show_zip]" class="gdri-enabled"  value="1"
2931 2931
                 <?php if (isset($address['show_zip']) && $address['show_zip'] == '1') {
2932 2932
                     echo 'checked';
2933 2933
                 } ?>/>
2934
-            <label onclick="show_hide_radio(this,'show','cf-zip-lable');" for="show_zip_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
2934
+            <label onclick="show_hide_radio(this,'show','cf-zip-lable');" for="show_zip_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
2935 2935
 
2936
-            <input type="radio" id="show_zip_no<?php echo $radio_id;?>" name="extra[show_zip]" class="gdri-disabled" value="0"
2936
+            <input type="radio" id="show_zip_no<?php echo $radio_id; ?>" name="extra[show_zip]" class="gdri-disabled" value="0"
2937 2937
                 <?php if ((isset($address['show_zip']) && !$address['show_zip']) || !isset($address['show_zip'])) {
2938 2938
                     echo 'checked';
2939 2939
                 } ?>/>
2940
-            <label onclick="show_hide_radio(this,'hide','cf-zip-lable');" for="show_zip_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
2940
+            <label onclick="show_hide_radio(this,'hide','cf-zip-lable');" for="show_zip_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
2941 2941
 
2942 2942
 
2943 2943
         </div>
2944 2944
     </li>
2945 2945
 
2946
-    <li class="cf-zip-lable"  <?php if ((isset($address['show_zip']) && !$address['show_zip']) || !isset($address['show_zip'])) {echo "style='display:none;'";}?> >
2946
+    <li class="cf-zip-lable"  <?php if ((isset($address['show_zip']) && !$address['show_zip']) || !isset($address['show_zip'])) {echo "style='display:none;'"; }?> >
2947 2947
         <label for="zip_lable" class="gd-cf-tooltip-wrap">
2948 2948
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Zip/Post code label :', 'geodirectory'); ?>
2949 2949
             <div class="gdcf-tooltip">
2950
-                <?php _e('Enter zip/post code field label in address section.', 'geodirectory');?>
2950
+                <?php _e('Enter zip/post code field label in address section.', 'geodirectory'); ?>
2951 2951
             </div>
2952 2952
         </label>
2953 2953
         <div class="gd-cf-input-wrap">
@@ -2965,7 +2965,7 @@  discard block
 block discarded – undo
2965 2965
         <label for="map_lable" class="gd-cf-tooltip-wrap">
2966 2966
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Map button label :', 'geodirectory'); ?>
2967 2967
             <div class="gdcf-tooltip">
2968
-                <?php _e('Enter text for `set address on map` button in address section.', 'geodirectory');?>
2968
+                <?php _e('Enter text for `set address on map` button in address section.', 'geodirectory'); ?>
2969 2969
             </div>
2970 2970
         </label>
2971 2971
         <div class="gd-cf-input-wrap">
@@ -2980,22 +2980,22 @@  discard block
 block discarded – undo
2980 2980
         <label for="show_mapzoom" class="gd-cf-tooltip-wrap">
2981 2981
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Use user zoom level:', 'geodirectory'); ?>
2982 2982
             <div class="gdcf-tooltip">
2983
-                <?php _e('Do you want to use the user defined map zoom level from the add listing page?', 'geodirectory');?>
2983
+                <?php _e('Do you want to use the user defined map zoom level from the add listing page?', 'geodirectory'); ?>
2984 2984
             </div>
2985 2985
         </label>
2986 2986
         <div class="gd-cf-input-wrap gd-switch">
2987 2987
 
2988
-            <input type="radio" id="show_mapzoom_yes<?php echo $radio_id;?>" name="extra[show_mapzoom]" class="gdri-enabled"  value="1"
2988
+            <input type="radio" id="show_mapzoom_yes<?php echo $radio_id; ?>" name="extra[show_mapzoom]" class="gdri-enabled"  value="1"
2989 2989
                 <?php if (isset($address['show_mapzoom']) && $address['show_mapzoom'] == '1') {
2990 2990
                     echo 'checked';
2991 2991
                 } ?>/>
2992
-            <label for="show_mapzoom_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
2992
+            <label for="show_mapzoom_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
2993 2993
 
2994
-            <input type="radio" id="show_mapzoom_no<?php echo $radio_id;?>" name="extra[show_mapzoom]" class="gdri-disabled" value="0"
2994
+            <input type="radio" id="show_mapzoom_no<?php echo $radio_id; ?>" name="extra[show_mapzoom]" class="gdri-disabled" value="0"
2995 2995
                 <?php if ((isset($address['show_mapzoom']) && !$address['show_mapzoom']) || !isset($address['show_mapzoom'])) {
2996 2996
                     echo 'checked';
2997 2997
                 } ?>/>
2998
-            <label for="show_mapzoom_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
2998
+            <label for="show_mapzoom_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
2999 2999
 
3000 3000
         </div>
3001 3001
     </li>
@@ -3004,22 +3004,22 @@  discard block
 block discarded – undo
3004 3004
         <label for="show_mapview" class="gd-cf-tooltip-wrap">
3005 3005
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Display map view:', 'geodirectory'); ?>
3006 3006
             <div class="gdcf-tooltip">
3007
-                <?php _e('Select if you want to `set default map` options in address section. ( Satellite Map, Hybrid Map, Terrain Map)', 'geodirectory');?>
3007
+                <?php _e('Select if you want to `set default map` options in address section. ( Satellite Map, Hybrid Map, Terrain Map)', 'geodirectory'); ?>
3008 3008
             </div>
3009 3009
         </label>
3010 3010
         <div class="gd-cf-input-wrap gd-switch">
3011 3011
 
3012
-            <input type="radio" id="show_mapview_yes<?php echo $radio_id;?>" name="extra[show_mapview]" class="gdri-enabled"  value="1"
3012
+            <input type="radio" id="show_mapview_yes<?php echo $radio_id; ?>" name="extra[show_mapview]" class="gdri-enabled"  value="1"
3013 3013
                 <?php if (isset($address['show_mapview']) && $address['show_mapview'] == '1') {
3014 3014
                     echo 'checked';
3015 3015
                 } ?>/>
3016
-            <label for="show_mapview_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
3016
+            <label for="show_mapview_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
3017 3017
 
3018
-            <input type="radio" id="show_mapview_no<?php echo $radio_id;?>" name="extra[show_mapview]" class="gdri-disabled" value="0"
3018
+            <input type="radio" id="show_mapview_no<?php echo $radio_id; ?>" name="extra[show_mapview]" class="gdri-disabled" value="0"
3019 3019
                 <?php if ((isset($address['show_mapview']) && !$address['show_mapview']) || !isset($address['show_mapview'])) {
3020 3020
                     echo 'checked';
3021 3021
                 } ?>/>
3022
-            <label for="show_mapview_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
3022
+            <label for="show_mapview_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
3023 3023
 
3024 3024
         </div>
3025 3025
     </li>
@@ -3029,7 +3029,7 @@  discard block
 block discarded – undo
3029 3029
         <label for="mapview_lable" class="gd-cf-tooltip-wrap">
3030 3030
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Map view label:', 'geodirectory'); ?>
3031 3031
             <div class="gdcf-tooltip">
3032
-                <?php _e('Enter mapview field label in address section.', 'geodirectory');?>
3032
+                <?php _e('Enter mapview field label in address section.', 'geodirectory'); ?>
3033 3033
             </div>
3034 3034
         </label>
3035 3035
         <div class="gd-cf-input-wrap">
@@ -3043,22 +3043,22 @@  discard block
 block discarded – undo
3043 3043
         <label for="show_latlng" class="gd-cf-tooltip-wrap">
3044 3044
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Show latitude and longitude', 'geodirectory'); ?>
3045 3045
             <div class="gdcf-tooltip">
3046
-                <?php _e('This will show/hide the longitude fields in the address section add listing form.', 'geodirectory');?>
3046
+                <?php _e('This will show/hide the longitude fields in the address section add listing form.', 'geodirectory'); ?>
3047 3047
             </div>
3048 3048
         </label>
3049 3049
         <div class="gd-cf-input-wrap gd-switch">
3050 3050
 
3051
-            <input type="radio" id="show_latlng_yes<?php echo $radio_id;?>" name="extra[show_latlng]" class="gdri-enabled"  value="1"
3051
+            <input type="radio" id="show_latlng_yes<?php echo $radio_id; ?>" name="extra[show_latlng]" class="gdri-enabled"  value="1"
3052 3052
                 <?php if (isset($address['show_latlng']) && $address['show_latlng'] == '1') {
3053 3053
                     echo 'checked';
3054 3054
                 } ?>/>
3055
-            <label for="show_latlng_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
3055
+            <label for="show_latlng_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
3056 3056
 
3057
-            <input type="radio" id="show_latlng_no<?php echo $radio_id;?>" name="extra[show_latlng]" class="gdri-disabled" value="0"
3057
+            <input type="radio" id="show_latlng_no<?php echo $radio_id; ?>" name="extra[show_latlng]" class="gdri-disabled" value="0"
3058 3058
                 <?php if ((isset($address['show_latlng']) && !$address['show_latlng']) || !isset($address['show_latlng'])) {
3059 3059
                     echo 'checked';
3060 3060
                 } ?>/>
3061
-            <label for="show_latlng_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
3061
+            <label for="show_latlng_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
3062 3062
 
3063 3063
         </div>
3064 3064
     </li>
@@ -3067,17 +3067,17 @@  discard block
 block discarded – undo
3067 3067
     $html = ob_get_clean();
3068 3068
     return $output.$html;
3069 3069
 }
3070
-add_filter('geodir_cfa_extra_fields_address','geodir_cfa_extra_fields_address',10,4);
3070
+add_filter('geodir_cfa_extra_fields_address', 'geodir_cfa_extra_fields_address', 10, 4);
3071 3071
 
3072 3072
 
3073
-function geodir_cfa_extra_fields_multiselect($output,$result_str,$cf,$field_info){
3073
+function geodir_cfa_extra_fields_multiselect($output, $result_str, $cf, $field_info) {
3074 3074
     ob_start();
3075 3075
     ?>
3076 3076
     <li>
3077 3077
         <label for="multi_display_type" class="gd-cf-tooltip-wrap">
3078 3078
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Multiselect display type :', 'geodirectory'); ?>
3079 3079
             <div class="gdcf-tooltip">
3080
-                <?php _e('Show multiselect list as multiselect,checkbox or radio.', 'geodirectory');?>
3080
+                <?php _e('Show multiselect list as multiselect,checkbox or radio.', 'geodirectory'); ?>
3081 3081
             </div>
3082 3082
         </label>
3083 3083
         <div class="gd-cf-input-wrap">
@@ -3085,13 +3085,13 @@  discard block
 block discarded – undo
3085 3085
             <select name="multi_display_type" id="multi_display_type">
3086 3086
                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'select') {
3087 3087
                     echo 'selected="selected"';
3088
-                }?> value="select"><?php _e('Select', 'geodirectory');?></option>
3088
+                }?> value="select"><?php _e('Select', 'geodirectory'); ?></option>
3089 3089
                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'checkbox') {
3090 3090
                     echo 'selected="selected"';
3091
-                }?> value="checkbox"><?php _e('Checkbox', 'geodirectory');?></option>
3091
+                }?> value="checkbox"><?php _e('Checkbox', 'geodirectory'); ?></option>
3092 3092
                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'radio') {
3093 3093
                     echo 'selected="selected"';
3094
-                }?> value="radio"><?php _e('Radio', 'geodirectory');?></option>
3094
+                }?> value="radio"><?php _e('Radio', 'geodirectory'); ?></option>
3095 3095
             </select>
3096 3096
 
3097 3097
             <br/>
@@ -3102,17 +3102,17 @@  discard block
 block discarded – undo
3102 3102
     $html = ob_get_clean();
3103 3103
     return $output.$html;
3104 3104
 }
3105
-add_filter('geodir_cfa_extra_fields_multiselect','geodir_cfa_extra_fields_multiselect',10,4);
3105
+add_filter('geodir_cfa_extra_fields_multiselect', 'geodir_cfa_extra_fields_multiselect', 10, 4);
3106 3106
 
3107 3107
 
3108
-function geodir_cfa_extra_fields_smr($output,$result_str,$cf,$field_info){
3108
+function geodir_cfa_extra_fields_smr($output, $result_str, $cf, $field_info) {
3109 3109
 
3110 3110
     ob_start();
3111 3111
 
3112 3112
     $value = '';
3113 3113
     if (isset($field_info->option_values)) {
3114 3114
         $value = esc_attr($field_info->option_values);
3115
-    }elseif(isset($cf['defaults']['option_values']) && $cf['defaults']['option_values']){
3115
+    }elseif (isset($cf['defaults']['option_values']) && $cf['defaults']['option_values']) {
3116 3116
         $value = esc_attr($cf['defaults']['option_values']);
3117 3117
     }
3118 3118
 
@@ -3122,11 +3122,11 @@  discard block
 block discarded – undo
3122 3122
         <label for="option_values" class="gd-cf-tooltip-wrap">
3123 3123
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Option Values :', 'geodirectory'); ?>
3124 3124
             <div class="gdcf-tooltip">
3125
-                <span><?php _e('Option Values should be separated by comma.', 'geodirectory');?></span>
3125
+                <span><?php _e('Option Values should be separated by comma.', 'geodirectory'); ?></span>
3126 3126
                 <br/>
3127
-                <small><span><?php _e('If using for a "tick filter" place a / and then either a 1 for true or 0 for false', 'geodirectory');?></span>
3127
+                <small><span><?php _e('If using for a "tick filter" place a / and then either a 1 for true or 0 for false', 'geodirectory'); ?></span>
3128 3128
                     <br/>
3129
-                    <span><?php _e('eg: "No Dogs Allowed/0,Dogs Allowed/1" (Select only, not multiselect)', 'geodirectory');?></span>
3129
+                    <span><?php _e('eg: "No Dogs Allowed/0,Dogs Allowed/1" (Select only, not multiselect)', 'geodirectory'); ?></span>
3130 3130
                     <?php if ($field_type == 'multiselect' || $field_type == 'select') { ?>
3131 3131
                         <br/>
3132 3132
                         <span><?php _e('- If using OPTGROUP tag to grouping options, use "{optgroup}OPTGROUP-LABEL|OPTION-1,OPTION-2{/optgroup}"', 'geodirectory'); ?></span>
@@ -3137,7 +3137,7 @@  discard block
 block discarded – undo
3137 3137
         </label>
3138 3138
         <div class="gd-cf-input-wrap">
3139 3139
             <input type="text" name="option_values" id="option_values"
3140
-                   value="<?php echo $value;?>"/>
3140
+                   value="<?php echo $value; ?>"/>
3141 3141
             <br/>
3142 3142
 
3143 3143
         </div>
@@ -3147,12 +3147,12 @@  discard block
 block discarded – undo
3147 3147
     $html = ob_get_clean();
3148 3148
     return $output.$html;
3149 3149
 }
3150
-add_filter('geodir_cfa_extra_fields_multiselect','geodir_cfa_extra_fields_smr',10,4);
3151
-add_filter('geodir_cfa_extra_fields_select','geodir_cfa_extra_fields_smr',10,4);
3152
-add_filter('geodir_cfa_extra_fields_radio','geodir_cfa_extra_fields_smr',10,4);
3150
+add_filter('geodir_cfa_extra_fields_multiselect', 'geodir_cfa_extra_fields_smr', 10, 4);
3151
+add_filter('geodir_cfa_extra_fields_select', 'geodir_cfa_extra_fields_smr', 10, 4);
3152
+add_filter('geodir_cfa_extra_fields_radio', 'geodir_cfa_extra_fields_smr', 10, 4);
3153 3153
 
3154 3154
 
3155
-function geodir_cfa_extra_fields_datepicker($output,$result_str,$cf,$field_info){
3155
+function geodir_cfa_extra_fields_datepicker($output, $result_str, $cf, $field_info) {
3156 3156
     ob_start();
3157 3157
     $extra = array();
3158 3158
     if (isset($field_info->extra_fields) && $field_info->extra_fields != '') {
@@ -3163,7 +3163,7 @@  discard block
 block discarded – undo
3163 3163
         <label for="date_format" class="gd-cf-tooltip-wrap">
3164 3164
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Date Format :', 'geodirectory'); ?>
3165 3165
             <div class="gdcf-tooltip">
3166
-                <?php _e('Select the date format.', 'geodirectory');?>
3166
+                <?php _e('Select the date format.', 'geodirectory'); ?>
3167 3167
             </div>
3168 3168
         </label>
3169 3169
         <div class="gd-cf-input-wrap" style="overflow:inherit;">
@@ -3183,16 +3183,16 @@  discard block
 block discarded – undo
3183 3183
              * @since 1.6.5
3184 3184
              * @param array $date_formats The PHP date format array.
3185 3185
              */
3186
-            $date_formats = apply_filters('geodir_date_formats',$date_formats);
3186
+            $date_formats = apply_filters('geodir_date_formats', $date_formats);
3187 3187
             ?>
3188 3188
             <select name="extra[date_format]" id="date_format">
3189 3189
                 <?php
3190
-                foreach($date_formats as $format){
3190
+                foreach ($date_formats as $format) {
3191 3191
                     $selected = '';
3192
-                    if(!empty($extra) && esc_attr($extra['date_format'])==$format){
3192
+                    if (!empty($extra) && esc_attr($extra['date_format']) == $format) {
3193 3193
                         $selected = "selected='selected'";
3194 3194
                     }
3195
-                    echo "<option $selected value='$format'>$format       (".date_i18n( $format, time()).")</option>";
3195
+                    echo "<option $selected value='$format'>$format       (".date_i18n($format, time()).")</option>";
3196 3196
                 }
3197 3197
                 ?>
3198 3198
             </select>
@@ -3204,10 +3204,10 @@  discard block
 block discarded – undo
3204 3204
     $html = ob_get_clean();
3205 3205
     return $output.$html;
3206 3206
 }
3207
-add_filter('geodir_cfa_extra_fields_datepicker','geodir_cfa_extra_fields_datepicker',10,4);
3207
+add_filter('geodir_cfa_extra_fields_datepicker', 'geodir_cfa_extra_fields_datepicker', 10, 4);
3208 3208
 
3209 3209
 
3210
-function geodir_cfa_extra_fields_file($output,$result_str,$cf,$field_info){
3210
+function geodir_cfa_extra_fields_file($output, $result_str, $cf, $field_info) {
3211 3211
     ob_start();
3212 3212
     $allowed_file_types = geodir_allowed_mime_types();
3213 3213
 
@@ -3218,16 +3218,16 @@  discard block
 block discarded – undo
3218 3218
         <label for="gd_file_types" class="gd-cf-tooltip-wrap">
3219 3219
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Allowed file types :', 'geodirectory'); ?>
3220 3220
             <div class="gdcf-tooltip">
3221
-                <?php _e('Select file types to allowed for file uploading. (Select multiple file types by holding down "Ctrl" key.)', 'geodirectory');?>
3221
+                <?php _e('Select file types to allowed for file uploading. (Select multiple file types by holding down "Ctrl" key.)', 'geodirectory'); ?>
3222 3222
             </div>
3223 3223
         </label>
3224 3224
         <div class="gd-cf-input-wrap">
3225 3225
             <select name="extra[gd_file_types][]" id="gd_file_types" multiple="multiple" style="height:100px;width:90%;">
3226
-                <option value="*" <?php selected(true, in_array('*', $gd_file_types));?>><?php _e('All types', 'geodirectory') ;?></option>
3227
-                <?php foreach ( $allowed_file_types as $format => $types ) { ?>
3228
-                    <optgroup label="<?php echo esc_attr( wp_sprintf(__('%s formats', 'geodirectory'), __($format, 'geodirectory') ) ) ;?>">
3229
-                        <?php foreach ( $types as $ext => $type ) { ?>
3230
-                            <option value="<?php echo esc_attr($ext) ;?>" <?php selected(true, in_array($ext, $gd_file_types));?>><?php echo '.' . $ext ;?></option>
3226
+                <option value="*" <?php selected(true, in_array('*', $gd_file_types)); ?>><?php _e('All types', 'geodirectory'); ?></option>
3227
+                <?php foreach ($allowed_file_types as $format => $types) { ?>
3228
+                    <optgroup label="<?php echo esc_attr(wp_sprintf(__('%s formats', 'geodirectory'), __($format, 'geodirectory'))); ?>">
3229
+                        <?php foreach ($types as $ext => $type) { ?>
3230
+                            <option value="<?php echo esc_attr($ext); ?>" <?php selected(true, in_array($ext, $gd_file_types)); ?>><?php echo '.'.$ext; ?></option>
3231 3231
                         <?php } ?>
3232 3232
                     </optgroup>
3233 3233
                 <?php } ?>
@@ -3239,9 +3239,9 @@  discard block
 block discarded – undo
3239 3239
     $html = ob_get_clean();
3240 3240
     return $output.$html;
3241 3241
 }
3242
-add_filter('geodir_cfa_extra_fields_file','geodir_cfa_extra_fields_file',10,4);
3242
+add_filter('geodir_cfa_extra_fields_file', 'geodir_cfa_extra_fields_file', 10, 4);
3243 3243
 
3244
-function geodir_cfa_extra_fields_text($output,$result_str,$cf,$field_info){
3244
+function geodir_cfa_extra_fields_text($output, $result_str, $cf, $field_info) {
3245 3245
     ob_start();
3246 3246
 
3247 3247
     $extra_fields = isset($field_info->extra_fields) && $field_info->extra_fields != '' ? maybe_unserialize($field_info->extra_fields) : '';
@@ -3255,15 +3255,15 @@  discard block
 block discarded – undo
3255 3255
     $value = '';
3256 3256
     if ($extra_fields && isset($extra_fields['is_price'])) {
3257 3257
     $value = esc_attr($extra_fields['is_price']);
3258
-    }elseif(isset($cf['defaults']['extra_fields']['is_price']) && $cf['defaults']['extra_fields']['is_price']){
3258
+    }elseif (isset($cf['defaults']['extra_fields']['is_price']) && $cf['defaults']['extra_fields']['is_price']) {
3259 3259
     $value = esc_attr($cf['defaults']['extra_fields']['is_price']);
3260 3260
     }
3261 3261
 
3262
-    $show_price_extra = ($value==1) ? 1 : 0;
3262
+    $show_price_extra = ($value == 1) ? 1 : 0;
3263 3263
 
3264
-    $show_price = (isset($field_info->data_type) && ($field_info->data_type=='INT' && $field_info->data_type=='FLOAT')) ? 1 : 0;
3264
+    $show_price = (isset($field_info->data_type) && ($field_info->data_type == 'INT' && $field_info->data_type == 'FLOAT')) ? 1 : 0;
3265 3265
     ?>
3266
-    <li class="gdcf-price-extra-set" <?php if(!$show_price){ echo "style='display:none;'";}?>>
3266
+    <li class="gdcf-price-extra-set" <?php if (!$show_price) { echo "style='display:none;'"; }?>>
3267 3267
         <label for="is_price" class="gd-cf-tooltip-wrap">
3268 3268
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Display as price? :', 'geodirectory'); ?>
3269 3269
             <div class="gdcf-tooltip">
@@ -3272,17 +3272,17 @@  discard block
 block discarded – undo
3272 3272
         </label>
3273 3273
         <div class="gd-cf-input-wrap gd-switch">
3274 3274
 
3275
-            <input type="radio" id="is_price_yes<?php echo $radio_id;?>" name="extra[is_price]" class="gdri-enabled"  value="1"
3275
+            <input type="radio" id="is_price_yes<?php echo $radio_id; ?>" name="extra[is_price]" class="gdri-enabled"  value="1"
3276 3276
                 <?php if ($value == '1') {
3277 3277
                     echo 'checked';
3278 3278
                 } ?>/>
3279
-            <label onclick="show_hide_radio(this,'show','gdcf-price-extra');" for="is_price_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
3279
+            <label onclick="show_hide_radio(this,'show','gdcf-price-extra');" for="is_price_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
3280 3280
 
3281
-            <input type="radio" id="is_price_no<?php echo $radio_id;?>" name="extra[is_price]" class="gdri-disabled" value="0"
3281
+            <input type="radio" id="is_price_no<?php echo $radio_id; ?>" name="extra[is_price]" class="gdri-disabled" value="0"
3282 3282
                 <?php if ($value == '0' || !$value) {
3283 3283
                     echo 'checked';
3284 3284
                 } ?>/>
3285
-            <label onclick="show_hide_radio(this,'hide','gdcf-price-extra');" for="is_price_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
3285
+            <label onclick="show_hide_radio(this,'hide','gdcf-price-extra');" for="is_price_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
3286 3286
 
3287 3287
         </div>
3288 3288
     </li>
@@ -3292,23 +3292,23 @@  discard block
 block discarded – undo
3292 3292
     $value = '';
3293 3293
     if ($extra_fields && isset($extra_fields['thousand_separator'])) {
3294 3294
         $value = esc_attr($extra_fields['thousand_separator']);
3295
-    }elseif(isset($cf['defaults']['extra_fields']['thousand_separator']) && $cf['defaults']['extra_fields']['thousand_separator']){
3295
+    }elseif (isset($cf['defaults']['extra_fields']['thousand_separator']) && $cf['defaults']['extra_fields']['thousand_separator']) {
3296 3296
         $value = esc_attr($cf['defaults']['extra_fields']['thousand_separator']);
3297 3297
     }
3298 3298
     ?>
3299
-    <li class="gdcf-price-extra" <?php if(!$show_price_extra){ echo "style='display:none;'";}?>>
3300
-        <label for="thousand_separator" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Thousand separator :', 'geodirectory');?>
3299
+    <li class="gdcf-price-extra" <?php if (!$show_price_extra) { echo "style='display:none;'"; }?>>
3300
+        <label for="thousand_separator" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Thousand separator :', 'geodirectory'); ?>
3301 3301
             <div class="gdcf-tooltip">
3302 3302
                 <?php _e('Select the thousand separator.', 'geodirectory'); ?>
3303 3303
             </div>
3304 3304
         </label>
3305 3305
         <div class="gd-cf-input-wrap">
3306 3306
                 <select name="extra[thousand_separator]" id="thousand_separator">
3307
-                    <option value="comma" <?php selected(true, $value == 'comma');?>><?php _e(', (comma)', 'geodirectory'); ?></option>
3308
-                    <option value="slash" <?php selected(true, $value == "slash");?>><?php _e('\ (slash)', 'geodirectory'); ?></option>
3309
-                    <option value="period" <?php selected(true, $value == 'period');?>><?php _e('. (period)', 'geodirectory'); ?></option>
3310
-                    <option value="space" <?php selected(true, $value == 'space');?>><?php _e(' (space)', 'geodirectory'); ?></option>
3311
-                    <option value="none" <?php selected(true, $value == 'none');?>><?php _e('(none)', 'geodirectory'); ?></option>
3307
+                    <option value="comma" <?php selected(true, $value == 'comma'); ?>><?php _e(', (comma)', 'geodirectory'); ?></option>
3308
+                    <option value="slash" <?php selected(true, $value == "slash"); ?>><?php _e('\ (slash)', 'geodirectory'); ?></option>
3309
+                    <option value="period" <?php selected(true, $value == 'period'); ?>><?php _e('. (period)', 'geodirectory'); ?></option>
3310
+                    <option value="space" <?php selected(true, $value == 'space'); ?>><?php _e(' (space)', 'geodirectory'); ?></option>
3311
+                    <option value="none" <?php selected(true, $value == 'none'); ?>><?php _e('(none)', 'geodirectory'); ?></option>
3312 3312
                 </select>
3313 3313
         </div>
3314 3314
     </li>
@@ -3319,20 +3319,20 @@  discard block
 block discarded – undo
3319 3319
     $value = '';
3320 3320
     if ($extra_fields && isset($extra_fields['decimal_separator'])) {
3321 3321
         $value = esc_attr($extra_fields['decimal_separator']);
3322
-    }elseif(isset($cf['defaults']['extra_fields']['decimal_separator']) && $cf['defaults']['extra_fields']['decimal_separator']){
3322
+    }elseif (isset($cf['defaults']['extra_fields']['decimal_separator']) && $cf['defaults']['extra_fields']['decimal_separator']) {
3323 3323
         $value = esc_attr($cf['defaults']['extra_fields']['decimal_separator']);
3324 3324
     }
3325 3325
     ?>
3326
-    <li class="gdcf-price-extra" <?php if(!$show_price_extra){ echo "style='display:none;'";}?>>
3327
-        <label for="decimal_separator" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Decimal separator :', 'geodirectory');?>
3326
+    <li class="gdcf-price-extra" <?php if (!$show_price_extra) { echo "style='display:none;'"; }?>>
3327
+        <label for="decimal_separator" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Decimal separator :', 'geodirectory'); ?>
3328 3328
             <div class="gdcf-tooltip">
3329 3329
                 <?php _e('Select the decimal separator.', 'geodirectory'); ?>
3330 3330
             </div>
3331 3331
         </label>
3332 3332
         <div class="gd-cf-input-wrap">
3333 3333
             <select name="extra[decimal_separator]" id="decimal_separator">
3334
-                <option value="period" <?php selected(true, $value == 'period');?>><?php _e('. (period)', 'geodirectory'); ?></option>
3335
-                <option value="comma" <?php selected(true, $value == "comma");?>><?php _e(', (comma)', 'geodirectory'); ?></option>
3334
+                <option value="period" <?php selected(true, $value == 'period'); ?>><?php _e('. (period)', 'geodirectory'); ?></option>
3335
+                <option value="comma" <?php selected(true, $value == "comma"); ?>><?php _e(', (comma)', 'geodirectory'); ?></option>
3336 3336
             </select>
3337 3337
         </div>
3338 3338
     </li>
@@ -3342,20 +3342,20 @@  discard block
 block discarded – undo
3342 3342
     $value = '';
3343 3343
     if ($extra_fields && isset($extra_fields['decimal_display'])) {
3344 3344
         $value = esc_attr($extra_fields['decimal_display']);
3345
-    }elseif(isset($cf['defaults']['extra_fields']['decimal_display']) && $cf['defaults']['extra_fields']['decimal_display']){
3345
+    }elseif (isset($cf['defaults']['extra_fields']['decimal_display']) && $cf['defaults']['extra_fields']['decimal_display']) {
3346 3346
         $value = esc_attr($cf['defaults']['extra_fields']['decimal_display']);
3347 3347
     }
3348 3348
     ?>
3349
-    <li class="gdcf-price-extra" <?php if(!$show_price_extra){ echo "style='display:none;'";}?>>
3350
-        <label for="decimal_display" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Decimal display :', 'geodirectory');?>
3349
+    <li class="gdcf-price-extra" <?php if (!$show_price_extra) { echo "style='display:none;'"; }?>>
3350
+        <label for="decimal_display" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Decimal display :', 'geodirectory'); ?>
3351 3351
             <div class="gdcf-tooltip">
3352 3352
                 <?php _e('Select how the decimal is displayed', 'geodirectory'); ?>
3353 3353
             </div>
3354 3354
         </label>
3355 3355
         <div class="gd-cf-input-wrap">
3356 3356
             <select name="extra[decimal_display]" id="decimal_display">
3357
-                <option value="if" <?php selected(true, $value == 'if');?>><?php _e('If used (not .00)', 'geodirectory'); ?></option>
3358
-                <option value="allways" <?php selected(true, $value == "allways");?>><?php _e('Always (.00)', 'geodirectory'); ?></option>
3357
+                <option value="if" <?php selected(true, $value == 'if'); ?>><?php _e('If used (not .00)', 'geodirectory'); ?></option>
3358
+                <option value="allways" <?php selected(true, $value == "allways"); ?>><?php _e('Always (.00)', 'geodirectory'); ?></option>
3359 3359
             </select>
3360 3360
         </div>
3361 3361
     </li>
@@ -3365,12 +3365,12 @@  discard block
 block discarded – undo
3365 3365
     $value = '';
3366 3366
     if ($extra_fields && isset($extra_fields['currency_symbol'])) {
3367 3367
         $value = esc_attr($extra_fields['currency_symbol']);
3368
-    }elseif(isset($cf['defaults']['extra_fields']['currency_symbol']) && $cf['defaults']['extra_fields']['currency_symbol']){
3368
+    }elseif (isset($cf['defaults']['extra_fields']['currency_symbol']) && $cf['defaults']['extra_fields']['currency_symbol']) {
3369 3369
         $value = esc_attr($cf['defaults']['extra_fields']['currency_symbol']);
3370 3370
     }
3371 3371
     ?>
3372
-    <li class="gdcf-price-extra" <?php if(!$show_price_extra){ echo "style='display:none;'";}?>>
3373
-        <label for="currency_symbol" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Currency symbol :', 'geodirectory');?>
3372
+    <li class="gdcf-price-extra" <?php if (!$show_price_extra) { echo "style='display:none;'"; }?>>
3373
+        <label for="currency_symbol" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Currency symbol :', 'geodirectory'); ?>
3374 3374
             <div class="gdcf-tooltip">
3375 3375
                 <?php _e('Select the currency symbol.', 'geodirectory'); ?>
3376 3376
             </div>
@@ -3386,20 +3386,20 @@  discard block
 block discarded – undo
3386 3386
     $value = '';
3387 3387
     if ($extra_fields && isset($extra_fields['currency_symbol_placement'])) {
3388 3388
         $value = esc_attr($extra_fields['currency_symbol_placement']);
3389
-    }elseif(isset($cf['defaults']['extra_fields']['currency_symbol_placement']) && $cf['defaults']['extra_fields']['currency_symbol_placement']){
3389
+    }elseif (isset($cf['defaults']['extra_fields']['currency_symbol_placement']) && $cf['defaults']['extra_fields']['currency_symbol_placement']) {
3390 3390
         $value = esc_attr($cf['defaults']['extra_fields']['currency_symbol_placement']);
3391 3391
     }
3392 3392
     ?>
3393
-    <li class="gdcf-price-extra" <?php if(!$show_price_extra){ echo "style='display:none;'";}?>>
3394
-        <label for="currency_symbol_placement" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Currency symbol placement :', 'geodirectory');?>
3393
+    <li class="gdcf-price-extra" <?php if (!$show_price_extra) { echo "style='display:none;'"; }?>>
3394
+        <label for="currency_symbol_placement" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Currency symbol placement :', 'geodirectory'); ?>
3395 3395
             <div class="gdcf-tooltip">
3396 3396
                 <?php _e('Select the currency symbol placement.', 'geodirectory'); ?>
3397 3397
             </div>
3398 3398
         </label>
3399 3399
         <div class="gd-cf-input-wrap">
3400 3400
             <select name="extra[currency_symbol_placement]" id="currency_symbol_placement">
3401
-                <option value="left" <?php selected(true, $value == 'left');?>><?php _e('Left', 'geodirectory'); ?></option>
3402
-                <option value="right" <?php selected(true, $value == "right");?>><?php _e('Right', 'geodirectory'); ?></option>
3401
+                <option value="left" <?php selected(true, $value == 'left'); ?>><?php _e('Left', 'geodirectory'); ?></option>
3402
+                <option value="right" <?php selected(true, $value == "right"); ?>><?php _e('Right', 'geodirectory'); ?></option>
3403 3403
             </select>
3404 3404
         </div>
3405 3405
     </li>
@@ -3410,11 +3410,11 @@  discard block
 block discarded – undo
3410 3410
     $html = ob_get_clean();
3411 3411
     return $output.$html;
3412 3412
 }
3413
-add_filter('geodir_cfa_extra_fields_text','geodir_cfa_extra_fields_text',10,4);
3413
+add_filter('geodir_cfa_extra_fields_text', 'geodir_cfa_extra_fields_text', 10, 4);
3414 3414
 
3415
-function geodir_default_custom_fields($post_type='gd_place',$package_id=''){
3415
+function geodir_default_custom_fields($post_type = 'gd_place', $package_id = '') {
3416 3416
     $fields = array();
3417
-    $package = ($package_id=='') ? '' : array($package_id);
3417
+    $package = ($package_id == '') ? '' : array($package_id);
3418 3418
 
3419 3419
     $fields[] = array('listing_type' => $post_type,
3420 3420
                       'data_type' => 'VARCHAR',
@@ -3587,7 +3587,7 @@  discard block
 block discarded – undo
3587 3587
     return  $fields;
3588 3588
 }
3589 3589
 
3590
-function geodir_currency_format_number($number='',$cf=''){
3590
+function geodir_currency_format_number($number = '', $cf = '') {
3591 3591
 
3592 3592
     $cs = isset($cf['extra_fields']) ? maybe_unserialize($cf['extra_fields']) : '';
3593 3593
 
@@ -3596,35 +3596,35 @@  discard block
 block discarded – undo
3596 3596
     $decimal_display = isset($cf['decimal_display']) && $cf['decimal_display'] ? $cf['decimal_display'] : 'if';
3597 3597
     $decimalpoint = '.';
3598 3598
 
3599
-    if(isset($cs['decimal_separator']) && $cs['decimal_separator']=='comma'){
3599
+    if (isset($cs['decimal_separator']) && $cs['decimal_separator'] == 'comma') {
3600 3600
         $decimalpoint = ',';
3601 3601
     }
3602 3602
 
3603 3603
     $separator = ',';
3604 3604
 
3605
-    if(isset($cs['thousand_separator'])){
3606
-        if($cs['thousand_separator']=='comma'){$separator = ',';}
3607
-        if($cs['thousand_separator']=='slash'){$separator = '\\';}
3608
-        if($cs['thousand_separator']=='period'){$separator = '.';}
3609
-        if($cs['thousand_separator']=='space'){$separator = ' ';}
3610
-        if($cs['thousand_separator']=='none'){$separator = '';}
3605
+    if (isset($cs['thousand_separator'])) {
3606
+        if ($cs['thousand_separator'] == 'comma') {$separator = ','; }
3607
+        if ($cs['thousand_separator'] == 'slash') {$separator = '\\'; }
3608
+        if ($cs['thousand_separator'] == 'period') {$separator = '.'; }
3609
+        if ($cs['thousand_separator'] == 'space') {$separator = ' '; }
3610
+        if ($cs['thousand_separator'] == 'none') {$separator = ''; }
3611 3611
     }
3612 3612
 
3613 3613
     $currency_symbol_placement = isset($cs['currency_symbol_placement']) ? $cs['currency_symbol_placement'] : 'left';
3614 3614
 
3615
-    if($decimals>0 && $decimal_display=='if'){
3616
-        if(is_int($number) || floor( $number ) == $number)
3615
+    if ($decimals > 0 && $decimal_display == 'if') {
3616
+        if (is_int($number) || floor($number) == $number)
3617 3617
             $decimals = 0;
3618 3618
     }
3619 3619
 
3620
-    $number = number_format($number,$decimals,$decimalpoint,$separator);
3620
+    $number = number_format($number, $decimals, $decimalpoint, $separator);
3621 3621
 
3622 3622
 
3623 3623
 
3624
-    if($currency_symbol_placement=='left'){
3625
-        $number = $symbol . $number;
3626
-    }else{
3627
-        $number = $number . $symbol;
3624
+    if ($currency_symbol_placement == 'left') {
3625
+        $number = $symbol.$number;
3626
+    } else {
3627
+        $number = $number.$symbol;
3628 3628
     }
3629 3629
 
3630 3630
 
Please login to merge, or discard this patch.
Indentation   +2254 added lines, -2254 removed lines patch added patch discarded remove patch
@@ -10,52 +10,52 @@  discard block
 block discarded – undo
10 10
 global $wpdb, $table_prefix;
11 11
 
12 12
 if (!function_exists('geodir_column_exist')) {
13
-    /**
14
-     * Check table column exist or not.
15
-     *
16
-     * @since 1.0.0
17
-     * @package GeoDirectory
18
-     * @global object $wpdb WordPress Database object.
19
-     * @param string $db The table name.
20
-     * @param string $column The column name.
21
-     * @return bool If column exists returns true. Otherwise false.
22
-     */
23
-    function geodir_column_exist($db, $column)
24
-    {
25
-        global $wpdb;
26
-        $exists = false;
27
-        $columns = $wpdb->get_col("show columns from $db");
28
-        foreach ($columns as $c) {
29
-            if ($c == $column) {
30
-                $exists = true;
31
-                break;
32
-            }
33
-        }
34
-        return $exists;
35
-    }
13
+	/**
14
+	 * Check table column exist or not.
15
+	 *
16
+	 * @since 1.0.0
17
+	 * @package GeoDirectory
18
+	 * @global object $wpdb WordPress Database object.
19
+	 * @param string $db The table name.
20
+	 * @param string $column The column name.
21
+	 * @return bool If column exists returns true. Otherwise false.
22
+	 */
23
+	function geodir_column_exist($db, $column)
24
+	{
25
+		global $wpdb;
26
+		$exists = false;
27
+		$columns = $wpdb->get_col("show columns from $db");
28
+		foreach ($columns as $c) {
29
+			if ($c == $column) {
30
+				$exists = true;
31
+				break;
32
+			}
33
+		}
34
+		return $exists;
35
+	}
36 36
 }
37 37
 
38 38
 if (!function_exists('geodir_add_column_if_not_exist')) {
39
-    /**
40
-     * Add column if table column not exist.
41
-     *
42
-     * @since 1.0.0
43
-     * @package GeoDirectory
44
-     * @global object $wpdb WordPress Database object.
45
-     * @param string $db The table name.
46
-     * @param string $column The column name.
47
-     * @param string $column_attr The column attributes.
48
-     */
49
-    function geodir_add_column_if_not_exist($db, $column, $column_attr = "VARCHAR( 255 ) NOT NULL")
50
-    {
51
-        global $wpdb;
52
-        $result = 0;// no rows affected
53
-        if (!geodir_column_exist($db, $column)) {
54
-            if (!empty($db) && !empty($column))
55
-                $result = $wpdb->query("ALTER TABLE `$db` ADD `$column`  $column_attr");
56
-        }
57
-        return $result;
58
-    }
39
+	/**
40
+	 * Add column if table column not exist.
41
+	 *
42
+	 * @since 1.0.0
43
+	 * @package GeoDirectory
44
+	 * @global object $wpdb WordPress Database object.
45
+	 * @param string $db The table name.
46
+	 * @param string $column The column name.
47
+	 * @param string $column_attr The column attributes.
48
+	 */
49
+	function geodir_add_column_if_not_exist($db, $column, $column_attr = "VARCHAR( 255 ) NOT NULL")
50
+	{
51
+		global $wpdb;
52
+		$result = 0;// no rows affected
53
+		if (!geodir_column_exist($db, $column)) {
54
+			if (!empty($db) && !empty($column))
55
+				$result = $wpdb->query("ALTER TABLE `$db` ADD `$column`  $column_attr");
56
+		}
57
+		return $result;
58
+	}
59 59
 }
60 60
 
61 61
 /**
@@ -72,706 +72,706 @@  discard block
 block discarded – undo
72 72
  */
73 73
 function geodir_post_custom_fields($package_id = '', $default = 'all', $post_type = 'gd_place', $fields_location = 'none')
74 74
 {
75
-    global $wpdb, $geodir_post_custom_fields_cache;
76
-
77
-    $cache_stored = $post_type . '_' . $package_id . '_' . $default . '_' . $fields_location;
78
-
79
-    if (array_key_exists($cache_stored, $geodir_post_custom_fields_cache)) {
80
-        return $geodir_post_custom_fields_cache[$cache_stored];
81
-    }
82
-
83
-    $default_query = '';
84
-
85
-    if ($default == 'default')
86
-        $default_query .= " and is_admin IN ('1') ";
87
-    elseif ($default == 'custom')
88
-        $default_query .= " and is_admin = '0' ";
89
-
90
-    if ($fields_location == 'none') {
91
-    } else{
92
-        $fields_location = esc_sql( $fields_location );
93
-        $default_query .= " and show_in LIKE '%%[$fields_location]%%' ";
94
-    }
95
-
96
-    $post_meta_info = $wpdb->get_results(
97
-        $wpdb->prepare(
98
-            "select * from " . GEODIR_CUSTOM_FIELDS_TABLE . " where is_active = '1' and post_type = %s {$default_query} order by sort_order asc,admin_title asc",
99
-            array($post_type)
100
-        )
101
-    );
102
-
103
-
104
-    $return_arr = array();
105
-    if ($post_meta_info) {
106
-
107
-        foreach ($post_meta_info as $post_meta_info_obj) {
108
-
109
-            $custom_fields = array(
110
-                "name" => $post_meta_info_obj->htmlvar_name,
111
-                "label" => $post_meta_info_obj->clabels,
112
-                "default" => $post_meta_info_obj->default_value,
113
-                "type" => $post_meta_info_obj->field_type,
114
-                "desc" => $post_meta_info_obj->admin_desc);
115
-
116
-            if ($post_meta_info_obj->field_type) {
117
-                $options = explode(',', $post_meta_info_obj->option_values);
118
-                $custom_fields["options"] = $options;
119
-            }
120
-
121
-            foreach ($post_meta_info_obj as $key => $val) {
122
-                $custom_fields[$key] = $val;
123
-            }
124
-
125
-            $pricearr = array();
126
-            $pricearr = explode(',', $post_meta_info_obj->packages);
127
-
128
-            if ($package_id != '' && in_array($package_id, $pricearr)) {
129
-                $return_arr[$post_meta_info_obj->sort_order] = $custom_fields;
130
-            } elseif ($package_id == '') {
131
-                $return_arr[$post_meta_info_obj->sort_order] = $custom_fields;
132
-            }
133
-        }
134
-    }
135
-    $geodir_post_custom_fields_cache[$cache_stored] = $return_arr;
136
-
137
-    if (has_filter('geodir_filter_geodir_post_custom_fields')) {
138
-        /**
139
-         * Filter the post custom fields array.
140
-         *
141
-         * @since 1.0.0
142
-         *
143
-         * @param array $return_arr Post custom fields array.
144
-         * @param int|string $package_id The package ID.
145
-         * @param string $post_type Optional. The wordpress post type.
146
-         * @param string $fields_location Optional. Where exactly are you going to place this custom fields?.
147
-         */
148
-        $return_arr = apply_filters('geodir_filter_geodir_post_custom_fields', $return_arr, $package_id, $post_type, $fields_location);
149
-    }
150
-
151
-    return $return_arr;
75
+	global $wpdb, $geodir_post_custom_fields_cache;
76
+
77
+	$cache_stored = $post_type . '_' . $package_id . '_' . $default . '_' . $fields_location;
78
+
79
+	if (array_key_exists($cache_stored, $geodir_post_custom_fields_cache)) {
80
+		return $geodir_post_custom_fields_cache[$cache_stored];
81
+	}
82
+
83
+	$default_query = '';
84
+
85
+	if ($default == 'default')
86
+		$default_query .= " and is_admin IN ('1') ";
87
+	elseif ($default == 'custom')
88
+		$default_query .= " and is_admin = '0' ";
89
+
90
+	if ($fields_location == 'none') {
91
+	} else{
92
+		$fields_location = esc_sql( $fields_location );
93
+		$default_query .= " and show_in LIKE '%%[$fields_location]%%' ";
94
+	}
95
+
96
+	$post_meta_info = $wpdb->get_results(
97
+		$wpdb->prepare(
98
+			"select * from " . GEODIR_CUSTOM_FIELDS_TABLE . " where is_active = '1' and post_type = %s {$default_query} order by sort_order asc,admin_title asc",
99
+			array($post_type)
100
+		)
101
+	);
102
+
103
+
104
+	$return_arr = array();
105
+	if ($post_meta_info) {
106
+
107
+		foreach ($post_meta_info as $post_meta_info_obj) {
108
+
109
+			$custom_fields = array(
110
+				"name" => $post_meta_info_obj->htmlvar_name,
111
+				"label" => $post_meta_info_obj->clabels,
112
+				"default" => $post_meta_info_obj->default_value,
113
+				"type" => $post_meta_info_obj->field_type,
114
+				"desc" => $post_meta_info_obj->admin_desc);
115
+
116
+			if ($post_meta_info_obj->field_type) {
117
+				$options = explode(',', $post_meta_info_obj->option_values);
118
+				$custom_fields["options"] = $options;
119
+			}
120
+
121
+			foreach ($post_meta_info_obj as $key => $val) {
122
+				$custom_fields[$key] = $val;
123
+			}
124
+
125
+			$pricearr = array();
126
+			$pricearr = explode(',', $post_meta_info_obj->packages);
127
+
128
+			if ($package_id != '' && in_array($package_id, $pricearr)) {
129
+				$return_arr[$post_meta_info_obj->sort_order] = $custom_fields;
130
+			} elseif ($package_id == '') {
131
+				$return_arr[$post_meta_info_obj->sort_order] = $custom_fields;
132
+			}
133
+		}
134
+	}
135
+	$geodir_post_custom_fields_cache[$cache_stored] = $return_arr;
136
+
137
+	if (has_filter('geodir_filter_geodir_post_custom_fields')) {
138
+		/**
139
+		 * Filter the post custom fields array.
140
+		 *
141
+		 * @since 1.0.0
142
+		 *
143
+		 * @param array $return_arr Post custom fields array.
144
+		 * @param int|string $package_id The package ID.
145
+		 * @param string $post_type Optional. The wordpress post type.
146
+		 * @param string $fields_location Optional. Where exactly are you going to place this custom fields?.
147
+		 */
148
+		$return_arr = apply_filters('geodir_filter_geodir_post_custom_fields', $return_arr, $package_id, $post_type, $fields_location);
149
+	}
150
+
151
+	return $return_arr;
152 152
 }
153 153
 
154
-    /**
155
-     * Adds admin html for custom fields.
156
-     *
157
-     * @since 1.0.0
158
-     * @package GeoDirectory
159
-     * @global object $wpdb WordPress Database object.
160
-     * @param string $field_type The form field type.
161
-     * @param object|int $result_str The custom field results object or row id.
162
-     * @param string $field_ins_upd When set to "submit" displays form.
163
-     * @param string $field_type_key The key of the custom field.
164
-     */
165
-    function geodir_custom_field_adminhtml($field_type, $result_str, $field_ins_upd = '', $field_type_key ='')
166
-    {
167
-        global $wpdb;
168
-        $cf = $result_str;
169
-        if (!is_object($cf)) {
170
-
171
-            $field_info = $wpdb->get_row($wpdb->prepare("select * from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id= %d", array($cf)));
172
-
173
-        } else {
174
-            $field_info = $cf;
175
-            $result_str = $cf->id;
176
-        }
177
-        /**
178
-         * Contains custom field html.
179
-         *
180
-         * @since 1.0.0
181
-         */
182
-        include('custom_field_html.php');
183
-
184
-    }
154
+	/**
155
+	 * Adds admin html for custom fields.
156
+	 *
157
+	 * @since 1.0.0
158
+	 * @package GeoDirectory
159
+	 * @global object $wpdb WordPress Database object.
160
+	 * @param string $field_type The form field type.
161
+	 * @param object|int $result_str The custom field results object or row id.
162
+	 * @param string $field_ins_upd When set to "submit" displays form.
163
+	 * @param string $field_type_key The key of the custom field.
164
+	 */
165
+	function geodir_custom_field_adminhtml($field_type, $result_str, $field_ins_upd = '', $field_type_key ='')
166
+	{
167
+		global $wpdb;
168
+		$cf = $result_str;
169
+		if (!is_object($cf)) {
170
+
171
+			$field_info = $wpdb->get_row($wpdb->prepare("select * from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id= %d", array($cf)));
172
+
173
+		} else {
174
+			$field_info = $cf;
175
+			$result_str = $cf->id;
176
+		}
177
+		/**
178
+		 * Contains custom field html.
179
+		 *
180
+		 * @since 1.0.0
181
+		 */
182
+		include('custom_field_html.php');
183
+
184
+	}
185 185
 
186 186
 
187 187
 if (!function_exists('geodir_custom_field_delete')) {
188
-    /**
189
-     * Delete custom field using field id.
190
-     *
191
-     * @since 1.0.0
192
-     * @since 1.5.7 Delete field from sorting fields table when custom field deleted.
193
-     * @package GeoDirectory
194
-     * @global object $wpdb WordPress Database object.
195
-     * @global string $plugin_prefix Geodirectory plugin table prefix.
196
-     * @param string $field_id The custom field ID.
197
-     * @return int|string If field deleted successfully, returns field id. Otherwise returns 0.
198
-     */
199
-    function geodir_custom_field_delete($field_id = '') {
200
-        global $wpdb, $plugin_prefix;
201
-
202
-        if ($field_id != '') {
203
-            $cf = trim($field_id, '_');
204
-
205
-            if ($field = $wpdb->get_row($wpdb->prepare("select htmlvar_name,post_type,field_type from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id= %d", array($cf)))) {
206
-                $wpdb->query($wpdb->prepare("delete from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id= %d ", array($cf)));
207
-
208
-                $post_type = $field->post_type;
209
-                $htmlvar_name = $field->htmlvar_name;
210
-
211
-                if ($post_type != '' && $htmlvar_name != '') {
212
-                    $wpdb->query($wpdb->prepare("DELETE FROM " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " WHERE htmlvar_name=%s AND post_type=%s LIMIT 1", array($htmlvar_name, $post_type)));
213
-                }
214
-
215
-                /**
216
-                 * Called after a custom field is deleted.
217
-                 *
218
-                 * @since 1.0.0
219
-                 * @param string $cf The fields ID.
220
-                 * @param string $field->htmlvar_name The html variable name for the field.
221
-                 * @param string $post_type The post type the field belongs to.
222
-                 */
223
-                do_action('geodir_after_custom_field_deleted', $cf, $field->htmlvar_name, $post_type);
224
-
225
-                if ($field->field_type == 'address') {
226
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_address`");
227
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_city`");
228
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_region`");
229
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_country`");
230
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_zip`");
231
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_latitude`");
232
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_longitude`");
233
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_mapview`");
234
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_mapzoom`");
235
-                } else {
236
-                    if ($field->field_type != 'fieldset') {
237
-                        $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "`");
238
-                    }
239
-                }
240
-
241
-                return $field_id;
242
-            } else
243
-                return 0;
244
-        } else
245
-            return 0;
246
-    }
188
+	/**
189
+	 * Delete custom field using field id.
190
+	 *
191
+	 * @since 1.0.0
192
+	 * @since 1.5.7 Delete field from sorting fields table when custom field deleted.
193
+	 * @package GeoDirectory
194
+	 * @global object $wpdb WordPress Database object.
195
+	 * @global string $plugin_prefix Geodirectory plugin table prefix.
196
+	 * @param string $field_id The custom field ID.
197
+	 * @return int|string If field deleted successfully, returns field id. Otherwise returns 0.
198
+	 */
199
+	function geodir_custom_field_delete($field_id = '') {
200
+		global $wpdb, $plugin_prefix;
201
+
202
+		if ($field_id != '') {
203
+			$cf = trim($field_id, '_');
204
+
205
+			if ($field = $wpdb->get_row($wpdb->prepare("select htmlvar_name,post_type,field_type from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id= %d", array($cf)))) {
206
+				$wpdb->query($wpdb->prepare("delete from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id= %d ", array($cf)));
207
+
208
+				$post_type = $field->post_type;
209
+				$htmlvar_name = $field->htmlvar_name;
210
+
211
+				if ($post_type != '' && $htmlvar_name != '') {
212
+					$wpdb->query($wpdb->prepare("DELETE FROM " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " WHERE htmlvar_name=%s AND post_type=%s LIMIT 1", array($htmlvar_name, $post_type)));
213
+				}
214
+
215
+				/**
216
+				 * Called after a custom field is deleted.
217
+				 *
218
+				 * @since 1.0.0
219
+				 * @param string $cf The fields ID.
220
+				 * @param string $field->htmlvar_name The html variable name for the field.
221
+				 * @param string $post_type The post type the field belongs to.
222
+				 */
223
+				do_action('geodir_after_custom_field_deleted', $cf, $field->htmlvar_name, $post_type);
224
+
225
+				if ($field->field_type == 'address') {
226
+					$wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_address`");
227
+					$wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_city`");
228
+					$wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_region`");
229
+					$wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_country`");
230
+					$wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_zip`");
231
+					$wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_latitude`");
232
+					$wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_longitude`");
233
+					$wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_mapview`");
234
+					$wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_mapzoom`");
235
+				} else {
236
+					if ($field->field_type != 'fieldset') {
237
+						$wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "`");
238
+					}
239
+				}
240
+
241
+				return $field_id;
242
+			} else
243
+				return 0;
244
+		} else
245
+			return 0;
246
+	}
247 247
 }
248 248
 
249 249
 if (!function_exists('geodir_custom_field_save')) {
250
-    /**
251
-     * Save or Update custom fields into the database.
252
-     *
253
-     * @since 1.0.0
254
-     * @since 1.5.6 Fix for saving multiselect custom field "Display Type" on first attempt.
255
-     * @package GeoDirectory
256
-     * @global object $wpdb WordPress Database object.
257
-     * @global string $plugin_prefix Geodirectory plugin table prefix.
258
-     * @param array $request_field {
259
-     *    Attributes of the request field array.
260
-     *
261
-     *    @type string $action Ajax Action name. Default "geodir_ajax_action".
262
-     *    @type string $manage_field_type Field type Default "custom_fields".
263
-     *    @type string $create_field Create field Default "true".
264
-     *    @type string $field_ins_upd Field ins upd Default "submit".
265
-     *    @type string $_wpnonce WP nonce value.
266
-     *    @type string $listing_type Listing type Example "gd_place".
267
-     *    @type string $field_type Field type Example "radio".
268
-     *    @type string $field_id Field id Example "12".
269
-     *    @type string $data_type Data type Example "VARCHAR".
270
-     *    @type string $is_active Either "1" or "0". If "0" is used then the field will not be displayed anywhere.
271
-     *    @type array $show_on_pkg Package list to display this field.
272
-     *    @type string $admin_title Personal comment, it would not be displayed anywhere except in custom field settings.
273
-     *    @type string $site_title Section title which you wish to display in frontend.
274
-     *    @type string $admin_desc Section description which will appear in frontend.
275
-     *    @type string $htmlvar_name Html variable name. This should be a unique name.
276
-     *    @type string $clabels Section Title which will appear in backend.
277
-     *    @type string $default_value The default value (for "link" this will be used as the link text).
278
-     *    @type string $sort_order The display order of this field in backend. e.g. 5.
279
-     *    @type string $is_default Either "1" or "0". If "0" is used then the field will be displayed as main form field or additional field.
280
-     *    @type string $for_admin_use Either "1" or "0". If "0" is used then only site admin can edit this field.
281
-     *    @type string $is_required Use "1" to set field as required.
282
-     *    @type string $required_msg Enter text for error message if field required and have not full fill requirment.
283
-     *    @type string $show_on_listing Want to show this on listing page?.
284
-     *    @type string $show_in What locations to show the custom field in.
285
-     *    @type string $show_on_detail Want to show this in More Info tab on detail page?.
286
-     *    @type string $show_as_tab Want to display this as a tab on detail page? If "1" then "Show on detail page?" must be Yes.
287
-     *    @type string $option_values Option Values should be separated by comma.
288
-     *    @type string $field_icon Upload icon using media and enter its url path, or enter font awesome class.
289
-     *    @type string $css_class Enter custom css class for field custom style.
290
-     *    @type array $extra_fields An array of extra fields to store.
291
-     *
292
-     * }
293
-     * @param bool $default Not yet implemented.
294
-     * @return int|string If field is unique returns inserted row id. Otherwise returns error string.
295
-     */
296
-    function geodir_custom_field_save($request_field = array(), $default = false)
297
-    {
298
-
299
-        global $wpdb, $plugin_prefix;
300
-
301
-        $old_html_variable = '';
302
-
303
-        $data_type = trim($request_field['data_type']);
304
-
305
-        $result_str = isset($request_field['field_id']) ? trim($request_field['field_id']) : '';
306
-
307
-        // some servers fail if a POST value is VARCHAR so we change it.
308
-        if(isset($request_field['data_type']) && $request_field['data_type']=='XVARCHAR'){
309
-            $request_field['data_type'] = 'VARCHAR';
310
-        }
311
-
312
-        $cf = trim($result_str, '_');
313
-
314
-
315
-        /*-------- check dublicate validation --------*/
316
-
317
-        $cehhtmlvar_name = isset($request_field['htmlvar_name']) ? $request_field['htmlvar_name'] : '';
318
-        $post_type = $request_field['listing_type'];
319
-
320
-        if ($request_field['field_type'] != 'address' && $request_field['field_type'] != 'taxonomy' && $request_field['field_type'] != 'fieldset') {
321
-            $cehhtmlvar_name = 'geodir_' . $cehhtmlvar_name;
322
-        }
323
-
324
-        $check_html_variable = $wpdb->get_var(
325
-            $wpdb->prepare(
326
-                "select htmlvar_name from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id <> %d and htmlvar_name = %s and post_type = %s ",
327
-                array($cf, $cehhtmlvar_name, $post_type)
328
-            )
329
-        );
330
-
331
-
332
-        if (!$check_html_variable || $request_field['field_type'] == 'fieldset') {
333
-
334
-            if ($cf != '') {
335
-
336
-                $post_meta_info = $wpdb->get_row(
337
-                    $wpdb->prepare(
338
-                        "select * from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id = %d",
339
-                        array($cf)
340
-                    )
341
-                );
342
-
343
-            }
344
-
345
-            if (!empty($post_meta_info)) {
346
-                $post_val = $post_meta_info;
347
-                $old_html_variable = $post_val->htmlvar_name;
348
-
349
-            }
350
-
351
-
352
-
353
-            if ($post_type == '') $post_type = 'gd_place';
354
-
355
-
356
-            $detail_table = $plugin_prefix . $post_type . '_detail';
357
-
358
-            $admin_title = $request_field['admin_title'];
359
-            $site_title = $request_field['site_title'];
360
-            $data_type = $request_field['data_type'];
361
-            $field_type = $request_field['field_type'];
362
-            $field_type_key = isset($request_field['field_type_key']) ? $request_field['field_type_key'] : $field_type;
363
-            $htmlvar_name = isset($request_field['htmlvar_name']) ? $request_field['htmlvar_name'] : '';
364
-            $admin_desc = $request_field['admin_desc'];
365
-            $clabels = $request_field['clabels'];
366
-            $default_value = isset($request_field['default_value']) ? $request_field['default_value'] : '';
367
-            $sort_order = isset($request_field['sort_order']) ? $request_field['sort_order'] : '';
368
-            $is_active = isset($request_field['is_active']) ? $request_field['is_active'] : '';
369
-            $is_required = isset($request_field['is_required']) ? $request_field['is_required'] : '';
370
-            $required_msg = isset($request_field['required_msg']) ? $request_field['required_msg'] : '';
371
-            $css_class = isset($request_field['css_class']) ? $request_field['css_class'] : '';
372
-            $field_icon = isset($request_field['field_icon']) ? $request_field['field_icon'] : '';
373
-            $show_on_listing = isset($request_field['show_on_listing']) ? $request_field['show_on_listing'] : '';
374
-            $show_in = isset($request_field['show_in']) ? $request_field['show_in'] : '';
375
-            $show_on_detail = isset($request_field['show_on_detail']) ? $request_field['show_on_detail'] : '';
376
-            $show_as_tab = isset($request_field['show_as_tab']) ? $request_field['show_as_tab'] : '';
377
-            $decimal_point = isset($request_field['decimal_point']) ? trim($request_field['decimal_point']) : ''; // decimal point for DECIMAL data type
378
-            $decimal_point = $decimal_point > 0 ? ($decimal_point > 10 ? 10 : $decimal_point) : '';
379
-            $validation_pattern = isset($request_field['validation_pattern']) ? $request_field['validation_pattern'] : '';
380
-            $validation_msg = isset($request_field['validation_msg']) ? $request_field['validation_msg'] : '';
381
-            $for_admin_use = isset($request_field['for_admin_use']) ? $request_field['for_admin_use'] : '';
250
+	/**
251
+	 * Save or Update custom fields into the database.
252
+	 *
253
+	 * @since 1.0.0
254
+	 * @since 1.5.6 Fix for saving multiselect custom field "Display Type" on first attempt.
255
+	 * @package GeoDirectory
256
+	 * @global object $wpdb WordPress Database object.
257
+	 * @global string $plugin_prefix Geodirectory plugin table prefix.
258
+	 * @param array $request_field {
259
+	 *    Attributes of the request field array.
260
+	 *
261
+	 *    @type string $action Ajax Action name. Default "geodir_ajax_action".
262
+	 *    @type string $manage_field_type Field type Default "custom_fields".
263
+	 *    @type string $create_field Create field Default "true".
264
+	 *    @type string $field_ins_upd Field ins upd Default "submit".
265
+	 *    @type string $_wpnonce WP nonce value.
266
+	 *    @type string $listing_type Listing type Example "gd_place".
267
+	 *    @type string $field_type Field type Example "radio".
268
+	 *    @type string $field_id Field id Example "12".
269
+	 *    @type string $data_type Data type Example "VARCHAR".
270
+	 *    @type string $is_active Either "1" or "0". If "0" is used then the field will not be displayed anywhere.
271
+	 *    @type array $show_on_pkg Package list to display this field.
272
+	 *    @type string $admin_title Personal comment, it would not be displayed anywhere except in custom field settings.
273
+	 *    @type string $site_title Section title which you wish to display in frontend.
274
+	 *    @type string $admin_desc Section description which will appear in frontend.
275
+	 *    @type string $htmlvar_name Html variable name. This should be a unique name.
276
+	 *    @type string $clabels Section Title which will appear in backend.
277
+	 *    @type string $default_value The default value (for "link" this will be used as the link text).
278
+	 *    @type string $sort_order The display order of this field in backend. e.g. 5.
279
+	 *    @type string $is_default Either "1" or "0". If "0" is used then the field will be displayed as main form field or additional field.
280
+	 *    @type string $for_admin_use Either "1" or "0". If "0" is used then only site admin can edit this field.
281
+	 *    @type string $is_required Use "1" to set field as required.
282
+	 *    @type string $required_msg Enter text for error message if field required and have not full fill requirment.
283
+	 *    @type string $show_on_listing Want to show this on listing page?.
284
+	 *    @type string $show_in What locations to show the custom field in.
285
+	 *    @type string $show_on_detail Want to show this in More Info tab on detail page?.
286
+	 *    @type string $show_as_tab Want to display this as a tab on detail page? If "1" then "Show on detail page?" must be Yes.
287
+	 *    @type string $option_values Option Values should be separated by comma.
288
+	 *    @type string $field_icon Upload icon using media and enter its url path, or enter font awesome class.
289
+	 *    @type string $css_class Enter custom css class for field custom style.
290
+	 *    @type array $extra_fields An array of extra fields to store.
291
+	 *
292
+	 * }
293
+	 * @param bool $default Not yet implemented.
294
+	 * @return int|string If field is unique returns inserted row id. Otherwise returns error string.
295
+	 */
296
+	function geodir_custom_field_save($request_field = array(), $default = false)
297
+	{
298
+
299
+		global $wpdb, $plugin_prefix;
300
+
301
+		$old_html_variable = '';
302
+
303
+		$data_type = trim($request_field['data_type']);
304
+
305
+		$result_str = isset($request_field['field_id']) ? trim($request_field['field_id']) : '';
306
+
307
+		// some servers fail if a POST value is VARCHAR so we change it.
308
+		if(isset($request_field['data_type']) && $request_field['data_type']=='XVARCHAR'){
309
+			$request_field['data_type'] = 'VARCHAR';
310
+		}
311
+
312
+		$cf = trim($result_str, '_');
313
+
314
+
315
+		/*-------- check dublicate validation --------*/
316
+
317
+		$cehhtmlvar_name = isset($request_field['htmlvar_name']) ? $request_field['htmlvar_name'] : '';
318
+		$post_type = $request_field['listing_type'];
319
+
320
+		if ($request_field['field_type'] != 'address' && $request_field['field_type'] != 'taxonomy' && $request_field['field_type'] != 'fieldset') {
321
+			$cehhtmlvar_name = 'geodir_' . $cehhtmlvar_name;
322
+		}
323
+
324
+		$check_html_variable = $wpdb->get_var(
325
+			$wpdb->prepare(
326
+				"select htmlvar_name from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id <> %d and htmlvar_name = %s and post_type = %s ",
327
+				array($cf, $cehhtmlvar_name, $post_type)
328
+			)
329
+		);
330
+
331
+
332
+		if (!$check_html_variable || $request_field['field_type'] == 'fieldset') {
333
+
334
+			if ($cf != '') {
335
+
336
+				$post_meta_info = $wpdb->get_row(
337
+					$wpdb->prepare(
338
+						"select * from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id = %d",
339
+						array($cf)
340
+					)
341
+				);
342
+
343
+			}
344
+
345
+			if (!empty($post_meta_info)) {
346
+				$post_val = $post_meta_info;
347
+				$old_html_variable = $post_val->htmlvar_name;
348
+
349
+			}
350
+
351
+
352
+
353
+			if ($post_type == '') $post_type = 'gd_place';
354
+
355
+
356
+			$detail_table = $plugin_prefix . $post_type . '_detail';
357
+
358
+			$admin_title = $request_field['admin_title'];
359
+			$site_title = $request_field['site_title'];
360
+			$data_type = $request_field['data_type'];
361
+			$field_type = $request_field['field_type'];
362
+			$field_type_key = isset($request_field['field_type_key']) ? $request_field['field_type_key'] : $field_type;
363
+			$htmlvar_name = isset($request_field['htmlvar_name']) ? $request_field['htmlvar_name'] : '';
364
+			$admin_desc = $request_field['admin_desc'];
365
+			$clabels = $request_field['clabels'];
366
+			$default_value = isset($request_field['default_value']) ? $request_field['default_value'] : '';
367
+			$sort_order = isset($request_field['sort_order']) ? $request_field['sort_order'] : '';
368
+			$is_active = isset($request_field['is_active']) ? $request_field['is_active'] : '';
369
+			$is_required = isset($request_field['is_required']) ? $request_field['is_required'] : '';
370
+			$required_msg = isset($request_field['required_msg']) ? $request_field['required_msg'] : '';
371
+			$css_class = isset($request_field['css_class']) ? $request_field['css_class'] : '';
372
+			$field_icon = isset($request_field['field_icon']) ? $request_field['field_icon'] : '';
373
+			$show_on_listing = isset($request_field['show_on_listing']) ? $request_field['show_on_listing'] : '';
374
+			$show_in = isset($request_field['show_in']) ? $request_field['show_in'] : '';
375
+			$show_on_detail = isset($request_field['show_on_detail']) ? $request_field['show_on_detail'] : '';
376
+			$show_as_tab = isset($request_field['show_as_tab']) ? $request_field['show_as_tab'] : '';
377
+			$decimal_point = isset($request_field['decimal_point']) ? trim($request_field['decimal_point']) : ''; // decimal point for DECIMAL data type
378
+			$decimal_point = $decimal_point > 0 ? ($decimal_point > 10 ? 10 : $decimal_point) : '';
379
+			$validation_pattern = isset($request_field['validation_pattern']) ? $request_field['validation_pattern'] : '';
380
+			$validation_msg = isset($request_field['validation_msg']) ? $request_field['validation_msg'] : '';
381
+			$for_admin_use = isset($request_field['for_admin_use']) ? $request_field['for_admin_use'] : '';
382 382
 
383 383
             
384
-            if(is_array($show_in)){
385
-                $show_in = implode(",", $request_field['show_in']);
386
-            }
384
+			if(is_array($show_in)){
385
+				$show_in = implode(",", $request_field['show_in']);
386
+			}
387 387
             
388
-            if ($field_type != 'address' && $field_type != 'taxonomy' && $field_type != 'fieldset') {
389
-                $htmlvar_name = 'geodir_' . $htmlvar_name;
390
-            }
388
+			if ($field_type != 'address' && $field_type != 'taxonomy' && $field_type != 'fieldset') {
389
+				$htmlvar_name = 'geodir_' . $htmlvar_name;
390
+			}
391 391
 
392
-            $option_values = '';
393
-            if (isset($request_field['option_values']))
394
-                $option_values = $request_field['option_values'];
392
+			$option_values = '';
393
+			if (isset($request_field['option_values']))
394
+				$option_values = $request_field['option_values'];
395 395
 
396
-            $cat_sort = isset($request_field['cat_sort']) ? $request_field['cat_sort'] : '0';
396
+			$cat_sort = isset($request_field['cat_sort']) ? $request_field['cat_sort'] : '0';
397 397
 
398
-            $cat_filter = isset($request_field['cat_filter']) ? $request_field['cat_filter'] : '0';
398
+			$cat_filter = isset($request_field['cat_filter']) ? $request_field['cat_filter'] : '0';
399 399
 
400
-            if (isset($request_field['show_on_pkg']) && !empty($request_field['show_on_pkg']))
401
-                $price_pkg = implode(",", $request_field['show_on_pkg']);
402
-            else {
403
-                $package_info = array();
400
+			if (isset($request_field['show_on_pkg']) && !empty($request_field['show_on_pkg']))
401
+				$price_pkg = implode(",", $request_field['show_on_pkg']);
402
+			else {
403
+				$package_info = array();
404 404
 
405
-                $package_info = geodir_post_package_info($package_info, '', $post_type);
406
-                $price_pkg = !empty($package_info->pid) ? $package_info->pid : '';
407
-            }
405
+				$package_info = geodir_post_package_info($package_info, '', $post_type);
406
+				$price_pkg = !empty($package_info->pid) ? $package_info->pid : '';
407
+			}
408 408
 
409 409
 
410
-            if (isset($request_field['extra']) && !empty($request_field['extra']))
411
-                $extra_fields = $request_field['extra'];
410
+			if (isset($request_field['extra']) && !empty($request_field['extra']))
411
+				$extra_fields = $request_field['extra'];
412 412
 
413
-            if (isset($request_field['is_default']) && $request_field['is_default'] != '')
414
-                $is_default = $request_field['is_default'];
415
-            else
416
-                $is_default = '0';
413
+			if (isset($request_field['is_default']) && $request_field['is_default'] != '')
414
+				$is_default = $request_field['is_default'];
415
+			else
416
+				$is_default = '0';
417 417
 
418
-            if (isset($request_field['is_admin']) && $request_field['is_admin'] != '')
419
-                $is_admin = $request_field['is_admin'];
420
-            else
421
-                $is_admin = '0';
418
+			if (isset($request_field['is_admin']) && $request_field['is_admin'] != '')
419
+				$is_admin = $request_field['is_admin'];
420
+			else
421
+				$is_admin = '0';
422 422
 
423 423
 
424
-            if ($is_active == '') $is_active = 1;
425
-            if ($is_required == '') $is_required = 0;
424
+			if ($is_active == '') $is_active = 1;
425
+			if ($is_required == '') $is_required = 0;
426 426
 
427 427
 
428
-            if ($sort_order == '') {
428
+			if ($sort_order == '') {
429 429
 
430
-                $last_order = $wpdb->get_var("SELECT MAX(sort_order) as last_order FROM " . GEODIR_CUSTOM_FIELDS_TABLE);
430
+				$last_order = $wpdb->get_var("SELECT MAX(sort_order) as last_order FROM " . GEODIR_CUSTOM_FIELDS_TABLE);
431 431
 
432
-                $sort_order = (int)$last_order + 1;
433
-            }
432
+				$sort_order = (int)$last_order + 1;
433
+			}
434 434
 
435
-            $default_value_add = '';
435
+			$default_value_add = '';
436 436
 
437 437
 
438
-            if (!empty($post_meta_info)) {
439
-                switch ($field_type):
438
+			if (!empty($post_meta_info)) {
439
+				switch ($field_type):
440 440
 
441
-                    case 'address':
441
+					case 'address':
442 442
 
443
-                        if ($htmlvar_name != '') {
444
-                            $prefix = $htmlvar_name . '_';
445
-                        }
446
-                        $old_prefix = $old_html_variable . '_';
443
+						if ($htmlvar_name != '') {
444
+							$prefix = $htmlvar_name . '_';
445
+						}
446
+						$old_prefix = $old_html_variable . '_';
447 447
 
448 448
 
449
-                        $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "address` `" . $prefix . "address` VARCHAR( 254 ) NULL";
449
+						$meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "address` `" . $prefix . "address` VARCHAR( 254 ) NULL";
450 450
 
451
-                        if ($default_value != '') {
452
-                            $meta_field_add .= " DEFAULT '" . $default_value . "'";
453
-                        }
451
+						if ($default_value != '') {
452
+							$meta_field_add .= " DEFAULT '" . $default_value . "'";
453
+						}
454 454
 
455
-                        $wpdb->query($meta_field_add);
455
+						$wpdb->query($meta_field_add);
456 456
 
457
-                        if ($extra_fields != '') {
457
+						if ($extra_fields != '') {
458 458
 
459
-                            if (isset($extra_fields['show_city']) && $extra_fields['show_city']) {
459
+							if (isset($extra_fields['show_city']) && $extra_fields['show_city']) {
460 460
 
461
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "city'");
462
-                                if ($is_column) {
463
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "city` `" . $prefix . "city` VARCHAR( 50 ) NULL";
461
+								$is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "city'");
462
+								if ($is_column) {
463
+									$meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "city` `" . $prefix . "city` VARCHAR( 50 ) NULL";
464 464
 
465
-                                    if ($default_value != '') {
466
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
467
-                                    }
465
+									if ($default_value != '') {
466
+										$meta_field_add .= " DEFAULT '" . $default_value . "'";
467
+									}
468 468
 
469
-                                    $wpdb->query($meta_field_add);
470
-                                } else {
469
+									$wpdb->query($meta_field_add);
470
+								} else {
471 471
 
472
-                                    $meta_field_add = "VARCHAR( 50 ) NULL";
473
-                                    if ($default_value != '') {
474
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
475
-                                    }
476
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "city", $meta_field_add);
472
+									$meta_field_add = "VARCHAR( 50 ) NULL";
473
+									if ($default_value != '') {
474
+										$meta_field_add .= " DEFAULT '" . $default_value . "'";
475
+									}
476
+									geodir_add_column_if_not_exist($detail_table, $prefix . "city", $meta_field_add);
477 477
 
478
-                                }
478
+								}
479 479
 
480 480
 
481
-                            }
481
+							}
482 482
 
483 483
 
484
-                            if (isset($extra_fields['show_region']) && $extra_fields['show_region']) {
484
+							if (isset($extra_fields['show_region']) && $extra_fields['show_region']) {
485 485
 
486
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "region'");
486
+								$is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "region'");
487 487
 
488
-                                if ($is_column) {
489
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "region` `" . $prefix . "region` VARCHAR( 50 ) NULL";
488
+								if ($is_column) {
489
+									$meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "region` `" . $prefix . "region` VARCHAR( 50 ) NULL";
490 490
 
491
-                                    if ($default_value != '') {
492
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
493
-                                    }
491
+									if ($default_value != '') {
492
+										$meta_field_add .= " DEFAULT '" . $default_value . "'";
493
+									}
494 494
 
495
-                                    $wpdb->query($meta_field_add);
496
-                                } else {
497
-                                    $meta_field_add = "VARCHAR( 50 ) NULL";
498
-                                    if ($default_value != '') {
499
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
500
-                                    }
495
+									$wpdb->query($meta_field_add);
496
+								} else {
497
+									$meta_field_add = "VARCHAR( 50 ) NULL";
498
+									if ($default_value != '') {
499
+										$meta_field_add .= " DEFAULT '" . $default_value . "'";
500
+									}
501 501
 
502
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "region", $meta_field_add);
503
-                                }
502
+									geodir_add_column_if_not_exist($detail_table, $prefix . "region", $meta_field_add);
503
+								}
504 504
 
505
-                            }
506
-                            if (isset($extra_fields['show_country']) && $extra_fields['show_country']) {
505
+							}
506
+							if (isset($extra_fields['show_country']) && $extra_fields['show_country']) {
507 507
 
508
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "country'");
508
+								$is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "country'");
509 509
 
510
-                                if ($is_column) {
510
+								if ($is_column) {
511 511
 
512
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "country` `" . $prefix . "country` VARCHAR( 50 ) NULL";
512
+									$meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "country` `" . $prefix . "country` VARCHAR( 50 ) NULL";
513 513
 
514
-                                    if ($default_value != '') {
515
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
516
-                                    }
514
+									if ($default_value != '') {
515
+										$meta_field_add .= " DEFAULT '" . $default_value . "'";
516
+									}
517 517
 
518
-                                    $wpdb->query($meta_field_add);
519
-                                } else {
518
+									$wpdb->query($meta_field_add);
519
+								} else {
520 520
 
521
-                                    $meta_field_add = "VARCHAR( 50 ) NULL";
522
-                                    if ($default_value != '') {
523
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
524
-                                    }
521
+									$meta_field_add = "VARCHAR( 50 ) NULL";
522
+									if ($default_value != '') {
523
+										$meta_field_add .= " DEFAULT '" . $default_value . "'";
524
+									}
525 525
 
526
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "country", $meta_field_add);
526
+									geodir_add_column_if_not_exist($detail_table, $prefix . "country", $meta_field_add);
527 527
 
528
-                                }
528
+								}
529 529
 
530
-                            }
531
-                            if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) {
530
+							}
531
+							if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) {
532 532
 
533
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "zip'");
533
+								$is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "zip'");
534 534
 
535
-                                if ($is_column) {
535
+								if ($is_column) {
536 536
 
537
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "zip` `" . $prefix . "zip` VARCHAR( 50 ) NULL";
537
+									$meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "zip` `" . $prefix . "zip` VARCHAR( 50 ) NULL";
538 538
 
539
-                                    if ($default_value != '') {
540
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
541
-                                    }
539
+									if ($default_value != '') {
540
+										$meta_field_add .= " DEFAULT '" . $default_value . "'";
541
+									}
542 542
 
543
-                                    $wpdb->query($meta_field_add);
544
-                                } else {
543
+									$wpdb->query($meta_field_add);
544
+								} else {
545 545
 
546
-                                    $meta_field_add = "VARCHAR( 50 ) NULL";
547
-                                    if ($default_value != '') {
548
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
549
-                                    }
546
+									$meta_field_add = "VARCHAR( 50 ) NULL";
547
+									if ($default_value != '') {
548
+										$meta_field_add .= " DEFAULT '" . $default_value . "'";
549
+									}
550 550
 
551
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "zip", $meta_field_add);
551
+									geodir_add_column_if_not_exist($detail_table, $prefix . "zip", $meta_field_add);
552 552
 
553
-                                }
553
+								}
554 554
 
555
-                            }
556
-                            if (isset($extra_fields['show_map']) && $extra_fields['show_map']) {
555
+							}
556
+							if (isset($extra_fields['show_map']) && $extra_fields['show_map']) {
557 557
 
558
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "latitude'");
559
-                                if ($is_column) {
558
+								$is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "latitude'");
559
+								if ($is_column) {
560 560
 
561
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "latitude` `" . $prefix . "latitude` VARCHAR( 20 ) NULL";
561
+									$meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "latitude` `" . $prefix . "latitude` VARCHAR( 20 ) NULL";
562 562
 
563
-                                    if ($default_value != '') {
564
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
565
-                                    }
563
+									if ($default_value != '') {
564
+										$meta_field_add .= " DEFAULT '" . $default_value . "'";
565
+									}
566 566
 
567
-                                    $wpdb->query($meta_field_add);
568
-                                } else {
567
+									$wpdb->query($meta_field_add);
568
+								} else {
569 569
 
570
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "latitude` VARCHAR( 20 ) NULL";
571
-                                    $meta_field_add = "VARCHAR( 20 ) NULL";
572
-                                    if ($default_value != '') {
573
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
574
-                                    }
570
+									$meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "latitude` VARCHAR( 20 ) NULL";
571
+									$meta_field_add = "VARCHAR( 20 ) NULL";
572
+									if ($default_value != '') {
573
+										$meta_field_add .= " DEFAULT '" . $default_value . "'";
574
+									}
575 575
 
576
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "latitude", $meta_field_add);
576
+									geodir_add_column_if_not_exist($detail_table, $prefix . "latitude", $meta_field_add);
577 577
 
578
-                                }
578
+								}
579 579
 
580 580
 
581
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "longitude'");
581
+								$is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "longitude'");
582 582
 
583
-                                if ($is_column) {
584
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "longitude` `" . $prefix . "longitude` VARCHAR( 20 ) NULL";
583
+								if ($is_column) {
584
+									$meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "longitude` `" . $prefix . "longitude` VARCHAR( 20 ) NULL";
585 585
 
586
-                                    if ($default_value != '') {
587
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
588
-                                    }
586
+									if ($default_value != '') {
587
+										$meta_field_add .= " DEFAULT '" . $default_value . "'";
588
+									}
589 589
 
590
-                                    $wpdb->query($meta_field_add);
591
-                                } else {
590
+									$wpdb->query($meta_field_add);
591
+								} else {
592 592
 
593
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "longitude` VARCHAR( 20 ) NULL";
594
-                                    $meta_field_add = "VARCHAR( 20 ) NULL";
595
-                                    if ($default_value != '') {
596
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
597
-                                    }
593
+									$meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "longitude` VARCHAR( 20 ) NULL";
594
+									$meta_field_add = "VARCHAR( 20 ) NULL";
595
+									if ($default_value != '') {
596
+										$meta_field_add .= " DEFAULT '" . $default_value . "'";
597
+									}
598 598
 
599
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "longitude", $meta_field_add);
600
-                                }
599
+									geodir_add_column_if_not_exist($detail_table, $prefix . "longitude", $meta_field_add);
600
+								}
601 601
 
602
-                            }
603
-                            if (isset($extra_fields['show_mapview']) && $extra_fields['show_mapview']) {
602
+							}
603
+							if (isset($extra_fields['show_mapview']) && $extra_fields['show_mapview']) {
604 604
 
605
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "mapview'");
605
+								$is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "mapview'");
606 606
 
607
-                                if ($is_column) {
608
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "mapview` `" . $prefix . "mapview` VARCHAR( 15 ) NULL";
607
+								if ($is_column) {
608
+									$meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "mapview` `" . $prefix . "mapview` VARCHAR( 15 ) NULL";
609 609
 
610
-                                    if ($default_value != '') {
611
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
612
-                                    }
610
+									if ($default_value != '') {
611
+										$meta_field_add .= " DEFAULT '" . $default_value . "'";
612
+									}
613 613
 
614
-                                    $wpdb->query($meta_field_add);
615
-                                } else {
614
+									$wpdb->query($meta_field_add);
615
+								} else {
616 616
 
617
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "mapview` VARCHAR( 15 ) NULL";
617
+									$meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "mapview` VARCHAR( 15 ) NULL";
618 618
 
619
-                                    $meta_field_add = "VARCHAR( 15 ) NULL";
620
-                                    if ($default_value != '') {
621
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
622
-                                    }
619
+									$meta_field_add = "VARCHAR( 15 ) NULL";
620
+									if ($default_value != '') {
621
+										$meta_field_add .= " DEFAULT '" . $default_value . "'";
622
+									}
623 623
 
624
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "mapview", $meta_field_add);
625
-                                }
624
+									geodir_add_column_if_not_exist($detail_table, $prefix . "mapview", $meta_field_add);
625
+								}
626 626
 
627 627
 
628
-                            }
629
-                            if (isset($extra_fields['show_mapzoom']) && $extra_fields['show_mapzoom']) {
628
+							}
629
+							if (isset($extra_fields['show_mapzoom']) && $extra_fields['show_mapzoom']) {
630 630
 
631
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "mapzoom'");
632
-                                if ($is_column) {
633
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "mapzoom` `" . $prefix . "mapzoom` VARCHAR( 3 ) NULL";
631
+								$is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "mapzoom'");
632
+								if ($is_column) {
633
+									$meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "mapzoom` `" . $prefix . "mapzoom` VARCHAR( 3 ) NULL";
634 634
 
635
-                                    if ($default_value != '') {
636
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
637
-                                    }
635
+									if ($default_value != '') {
636
+										$meta_field_add .= " DEFAULT '" . $default_value . "'";
637
+									}
638 638
 
639
-                                    $wpdb->query($meta_field_add);
639
+									$wpdb->query($meta_field_add);
640 640
 
641
-                                } else {
641
+								} else {
642 642
 
643
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "mapzoom` VARCHAR( 3 ) NULL";
643
+									$meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "mapzoom` VARCHAR( 3 ) NULL";
644 644
 
645
-                                    $meta_field_add = "VARCHAR( 3 ) NULL";
646
-                                    if ($default_value != '') {
647
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
648
-                                    }
645
+									$meta_field_add = "VARCHAR( 3 ) NULL";
646
+									if ($default_value != '') {
647
+										$meta_field_add .= " DEFAULT '" . $default_value . "'";
648
+									}
649 649
 
650
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "mapzoom", $meta_field_add);
651
-                                }
650
+									geodir_add_column_if_not_exist($detail_table, $prefix . "mapzoom", $meta_field_add);
651
+								}
652 652
 
653
-                            }
654
-                            // show lat lng
655
-                            if (isset($extra_fields['show_latlng']) && $extra_fields['show_latlng']) {
656
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "latlng'");
653
+							}
654
+							// show lat lng
655
+							if (isset($extra_fields['show_latlng']) && $extra_fields['show_latlng']) {
656
+								$is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "latlng'");
657 657
 
658
-                                if ($is_column) {
659
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "latlng` `" . $prefix . "latlng` VARCHAR( 3 ) NULL";
660
-                                    $meta_field_add .= " DEFAULT '1'";
658
+								if ($is_column) {
659
+									$meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "latlng` `" . $prefix . "latlng` VARCHAR( 3 ) NULL";
660
+									$meta_field_add .= " DEFAULT '1'";
661 661
 
662
-                                    $wpdb->query($meta_field_add);
663
-                                } else {
664
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "latlng` VARCHAR( 3 ) NULL";
662
+									$wpdb->query($meta_field_add);
663
+								} else {
664
+									$meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "latlng` VARCHAR( 3 ) NULL";
665 665
 
666
-                                    $meta_field_add = "VARCHAR( 3 ) NULL";
667
-                                    $meta_field_add .= " DEFAULT '1'";
666
+									$meta_field_add = "VARCHAR( 3 ) NULL";
667
+									$meta_field_add .= " DEFAULT '1'";
668 668
 
669
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "latlng", $meta_field_add);
670
-                                }
669
+									geodir_add_column_if_not_exist($detail_table, $prefix . "latlng", $meta_field_add);
670
+								}
671 671
 
672
-                            }
673
-                        }// end extra
672
+							}
673
+						}// end extra
674 674
 
675
-                        break;
675
+						break;
676 676
 
677
-                    case 'checkbox':
678
-                    case 'multiselect':
679
-                    case 'select':
680
-                    case 'taxonomy':
677
+					case 'checkbox':
678
+					case 'multiselect':
679
+					case 'select':
680
+					case 'taxonomy':
681 681
 
682
-                        $op_size = '500';
682
+						$op_size = '500';
683 683
 
684
-                        // only make the field as big as it needs to be.
685
-                        if(isset($option_values) && $option_values && $field_type=='select'){
686
-                            $option_values_arr = explode(',',$option_values);
687
-                            if(is_array($option_values_arr)){
688
-                                $op_max = 0;
689
-                                foreach($option_values_arr as $op_val){
690
-                                    if(strlen($op_val) && strlen($op_val)>$op_max){$op_max = strlen($op_val);}
691
-                                }
692
-                                if($op_max){$op_size =$op_max; }
693
-                            }
694
-                        }elseif(isset($option_values) && $option_values && $field_type=='multiselect'){
695
-                            if(strlen($option_values)){
696
-                                $op_size =  strlen($option_values);
697
-                            }
698
-                        }
684
+						// only make the field as big as it needs to be.
685
+						if(isset($option_values) && $option_values && $field_type=='select'){
686
+							$option_values_arr = explode(',',$option_values);
687
+							if(is_array($option_values_arr)){
688
+								$op_max = 0;
689
+								foreach($option_values_arr as $op_val){
690
+									if(strlen($op_val) && strlen($op_val)>$op_max){$op_max = strlen($op_val);}
691
+								}
692
+								if($op_max){$op_size =$op_max; }
693
+							}
694
+						}elseif(isset($option_values) && $option_values && $field_type=='multiselect'){
695
+							if(strlen($option_values)){
696
+								$op_size =  strlen($option_values);
697
+							}
698
+						}
699 699
 
700
-                        $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "`VARCHAR( $op_size ) NULL";
700
+						$meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "`VARCHAR( $op_size ) NULL";
701 701
 
702
-                        if ($default_value != '') {
703
-                            $meta_field_add .= " DEFAULT '" . $default_value . "'";
704
-                        }
702
+						if ($default_value != '') {
703
+							$meta_field_add .= " DEFAULT '" . $default_value . "'";
704
+						}
705 705
 
706
-                        $alter_result = $wpdb->query($meta_field_add);
707
-                        if($alter_result===false){
708
-                            return __('Column change failed, you may have too many columns.','geodirectory');
709
-                        }
706
+						$alter_result = $wpdb->query($meta_field_add);
707
+						if($alter_result===false){
708
+							return __('Column change failed, you may have too many columns.','geodirectory');
709
+						}
710 710
 
711
-                        if (isset($request_field['cat_display_type']))
712
-                            $extra_fields = $request_field['cat_display_type'];
711
+						if (isset($request_field['cat_display_type']))
712
+							$extra_fields = $request_field['cat_display_type'];
713 713
 
714
-                        if (isset($request_field['multi_display_type']))
715
-                            $extra_fields = $request_field['multi_display_type'];
714
+						if (isset($request_field['multi_display_type']))
715
+							$extra_fields = $request_field['multi_display_type'];
716 716
 
717 717
 
718
-                        break;
718
+						break;
719 719
 
720
-                    case 'textarea':
721
-                    case 'html':
722
-                    case 'url':
723
-                    case 'file':
720
+					case 'textarea':
721
+					case 'html':
722
+					case 'url':
723
+					case 'file':
724 724
 
725
-                        $alter_result = $wpdb->query("ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "` TEXT NULL");
726
-                        if($alter_result===false){
727
-                            return __('Column change failed, you may have too many columns.','geodirectory');
728
-                        }
729
-                        if (isset($request_field['advanced_editor']))
730
-                            $extra_fields = $request_field['advanced_editor'];
731
-
732
-                        break;
725
+						$alter_result = $wpdb->query("ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "` TEXT NULL");
726
+						if($alter_result===false){
727
+							return __('Column change failed, you may have too many columns.','geodirectory');
728
+						}
729
+						if (isset($request_field['advanced_editor']))
730
+							$extra_fields = $request_field['advanced_editor'];
731
+
732
+						break;
733 733
 
734
-                    case 'fieldset':
735
-                        // Nothig happend for fieldset
736
-                        break;
734
+					case 'fieldset':
735
+						// Nothig happend for fieldset
736
+						break;
737 737
 
738
-                    default:
739
-                        if ($data_type != 'VARCHAR' && $data_type != '') {
740
-                            if ($data_type == 'FLOAT' && $decimal_point > 0) {
741
-                                $default_value_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "` DECIMAL(11, " . (int)$decimal_point . ") NULL";
742
-                            } else {
743
-                                $default_value_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "` " . $data_type . " NULL";
744
-                            }
745
-
746
-                            if (is_numeric($default_value) && $default_value != '') {
747
-                                $default_value_add .= " DEFAULT '" . $default_value . "'";
748
-                            }
749
-                        } else {
750
-                            $default_value_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "` VARCHAR( 254 ) NULL";
751
-                            if ($default_value != '') {
752
-                                $default_value_add .= " DEFAULT '" . $default_value . "'";
753
-                            }
754
-                        }
755
-
756
-                        $alter_result = $wpdb->query($default_value_add);
757
-                        if($alter_result===false){
758
-                            return __('Column change failed, you may have too many columns.','geodirectory');
759
-                        }
760
-                        break;
761
-                endswitch;
762
-
763
-                $extra_field_query = '';
764
-                if (!empty($extra_fields)) {
765
-                    $extra_field_query = serialize($extra_fields);
766
-                }
767
-
768
-                $decimal_point = $field_type == 'text' && $data_type == 'FLOAT' ? $decimal_point : '';
769
-
770
-                $wpdb->query(
771
-
772
-                    $wpdb->prepare(
773
-
774
-                        "update " . GEODIR_CUSTOM_FIELDS_TABLE . " set 
738
+					default:
739
+						if ($data_type != 'VARCHAR' && $data_type != '') {
740
+							if ($data_type == 'FLOAT' && $decimal_point > 0) {
741
+								$default_value_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "` DECIMAL(11, " . (int)$decimal_point . ") NULL";
742
+							} else {
743
+								$default_value_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "` " . $data_type . " NULL";
744
+							}
745
+
746
+							if (is_numeric($default_value) && $default_value != '') {
747
+								$default_value_add .= " DEFAULT '" . $default_value . "'";
748
+							}
749
+						} else {
750
+							$default_value_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "` VARCHAR( 254 ) NULL";
751
+							if ($default_value != '') {
752
+								$default_value_add .= " DEFAULT '" . $default_value . "'";
753
+							}
754
+						}
755
+
756
+						$alter_result = $wpdb->query($default_value_add);
757
+						if($alter_result===false){
758
+							return __('Column change failed, you may have too many columns.','geodirectory');
759
+						}
760
+						break;
761
+				endswitch;
762
+
763
+				$extra_field_query = '';
764
+				if (!empty($extra_fields)) {
765
+					$extra_field_query = serialize($extra_fields);
766
+				}
767
+
768
+				$decimal_point = $field_type == 'text' && $data_type == 'FLOAT' ? $decimal_point : '';
769
+
770
+				$wpdb->query(
771
+
772
+					$wpdb->prepare(
773
+
774
+						"update " . GEODIR_CUSTOM_FIELDS_TABLE . " set 
775 775
 					post_type = %s,
776 776
 					admin_title = %s,
777 777
 					site_title = %s,
@@ -805,308 +805,308 @@  discard block
 block discarded – undo
805 805
 					for_admin_use = %s
806 806
 					where id = %d",
807 807
 
808
-                        array($post_type, $admin_title, $site_title, $field_type, $field_type_key, $htmlvar_name, $admin_desc, $clabels, $default_value, $sort_order, $is_active, $is_default, $is_required, $required_msg, $css_class, $field_icon, $field_icon, $show_on_listing, $show_in, $show_on_detail, $show_as_tab, $option_values, $price_pkg, $cat_sort, $cat_filter, $data_type, $extra_field_query, $decimal_point,$validation_pattern,$validation_msg, $for_admin_use, $cf)
809
-                    )
808
+						array($post_type, $admin_title, $site_title, $field_type, $field_type_key, $htmlvar_name, $admin_desc, $clabels, $default_value, $sort_order, $is_active, $is_default, $is_required, $required_msg, $css_class, $field_icon, $field_icon, $show_on_listing, $show_in, $show_on_detail, $show_as_tab, $option_values, $price_pkg, $cat_sort, $cat_filter, $data_type, $extra_field_query, $decimal_point,$validation_pattern,$validation_msg, $for_admin_use, $cf)
809
+					)
810 810
 
811
-                );
811
+				);
812 812
 
813
-                $lastid = trim($cf);
813
+				$lastid = trim($cf);
814 814
 
815 815
 
816
-                $wpdb->query(
817
-                    $wpdb->prepare(
818
-                        "update " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set 
816
+				$wpdb->query(
817
+					$wpdb->prepare(
818
+						"update " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set 
819 819
 					 	site_title=%s
820 820
 					where post_type = %s and htmlvar_name = %s",
821
-                        array($site_title, $post_type, $htmlvar_name)
822
-                    )
823
-                );
824
-
825
-
826
-                if ($cat_sort == '')
827
-                    $wpdb->query($wpdb->prepare("delete from " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " where post_type = %s and htmlvar_name = %s", array($post_type, $htmlvar_name)));
828
-
829
-
830
-                /**
831
-                 * Called after all custom fields are saved for a post.
832
-                 *
833
-                 * @since 1.0.0
834
-                 * @param int $lastid The post ID.
835
-                 */
836
-                do_action('geodir_after_custom_fields_updated', $lastid);
837
-
838
-            } else {
839
-
840
-                switch ($field_type):
841
-
842
-                    case 'address':
843
-
844
-                        $data_type = '';
845
-
846
-                        if ($htmlvar_name != '') {
847
-                            $prefix = $htmlvar_name . '_';
848
-                        }
849
-                        $old_prefix = $old_html_variable;
850
-
851
-                        //$meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."address` VARCHAR( 254 ) NULL";
852
-
853
-                        $meta_field_add = "VARCHAR( 254 ) NULL";
854
-                        if ($default_value != '') {
855
-                            $meta_field_add .= " DEFAULT '" . $default_value . "'";
856
-                        }
857
-
858
-                        geodir_add_column_if_not_exist($detail_table, $prefix . "address", $meta_field_add);
859
-                        //$wpdb->query($meta_field_add);
860
-
861
-
862
-                        if (!empty($extra_fields)) {
821
+						array($site_title, $post_type, $htmlvar_name)
822
+					)
823
+				);
824
+
825
+
826
+				if ($cat_sort == '')
827
+					$wpdb->query($wpdb->prepare("delete from " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " where post_type = %s and htmlvar_name = %s", array($post_type, $htmlvar_name)));
828
+
829
+
830
+				/**
831
+				 * Called after all custom fields are saved for a post.
832
+				 *
833
+				 * @since 1.0.0
834
+				 * @param int $lastid The post ID.
835
+				 */
836
+				do_action('geodir_after_custom_fields_updated', $lastid);
837
+
838
+			} else {
839
+
840
+				switch ($field_type):
841
+
842
+					case 'address':
843
+
844
+						$data_type = '';
845
+
846
+						if ($htmlvar_name != '') {
847
+							$prefix = $htmlvar_name . '_';
848
+						}
849
+						$old_prefix = $old_html_variable;
850
+
851
+						//$meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."address` VARCHAR( 254 ) NULL";
852
+
853
+						$meta_field_add = "VARCHAR( 254 ) NULL";
854
+						if ($default_value != '') {
855
+							$meta_field_add .= " DEFAULT '" . $default_value . "'";
856
+						}
857
+
858
+						geodir_add_column_if_not_exist($detail_table, $prefix . "address", $meta_field_add);
859
+						//$wpdb->query($meta_field_add);
860
+
861
+
862
+						if (!empty($extra_fields)) {
863 863
 
864
-                            if (isset($extra_fields['show_city']) && $extra_fields['show_city']) {
865
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "city` VARCHAR( 30 ) NULL";
866
-                                $meta_field_add = "VARCHAR( 30 ) NULL";
867
-                                if ($default_value != '') {
868
-                                    $meta_field_add .= " DEFAULT '" . $default_value . "'";
869
-                                }
870
-
871
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "city", $meta_field_add);
872
-                                //$wpdb->query($meta_field_add);
873
-                            }
874
-                            if (isset($extra_fields['show_region']) && $extra_fields['show_region']) {
875
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "region` VARCHAR( 30 ) NULL";
876
-                                $meta_field_add = "VARCHAR( 30 ) NULL";
877
-                                if ($default_value != '') {
878
-                                    $meta_field_add .= " DEFAULT '" . $default_value . "'";
879
-                                }
880
-
881
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "region", $meta_field_add);
882
-                                //$wpdb->query($meta_field_add);
883
-                            }
884
-                            if (isset($extra_fields['show_country']) && $extra_fields['show_country']) {
885
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "country` VARCHAR( 30 ) NULL";
886
-
887
-                                $meta_field_add = "VARCHAR( 30 ) NULL";
888
-                                if ($default_value != '') {
889
-                                    $meta_field_add .= " DEFAULT '" . $default_value . "'";
890
-                                }
891
-
892
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "country", $meta_field_add);
893
-                                //$wpdb->query($meta_field_add);
894
-                            }
895
-                            if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) {
896
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "zip` VARCHAR( 15 ) NULL";
897
-                                $meta_field_add = "VARCHAR( 15 ) NULL";
898
-                                if ($default_value != '') {
899
-                                    $meta_field_add .= " DEFAULT '" . $default_value . "'";
900
-                                }
901
-
902
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "zip", $meta_field_add);
903
-                                //$wpdb->query($meta_field_add);
904
-                            }
905
-                            if (isset($extra_fields['show_map']) && $extra_fields['show_map']) {
906
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "latitude` VARCHAR( 20 ) NULL";
907
-                                $meta_field_add = "VARCHAR( 20 ) NULL";
908
-                                if ($default_value != '') {
909
-                                    $meta_field_add .= " DEFAULT '" . $default_value . "'";
910
-                                }
911
-
912
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "latitude", $meta_field_add);
913
-                                //$wpdb->query($meta_field_add);
914
-
915
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "longitude` VARCHAR( 20 ) NULL";
916
-
917
-                                $meta_field_add = "VARCHAR( 20 ) NULL";
918
-                                if ($default_value != '') {
919
-                                    $meta_field_add .= " DEFAULT '" . $default_value . "'";
920
-                                }
921
-
922
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "longitude", $meta_field_add);
923
-
924
-                                //$wpdb->query($meta_field_add);
925
-                            }
926
-                            if (isset($extra_fields['show_mapview']) && $extra_fields['show_mapview']) {
927
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "mapview` VARCHAR( 15 ) NULL";
928
-
929
-                                $meta_field_add = "VARCHAR( 15 ) NULL";
930
-                                if ($default_value != '') {
931
-                                    $meta_field_add .= " DEFAULT '" . $default_value . "'";
932
-                                }
933
-
934
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "mapview", $meta_field_add);
935
-
936
-                                //$wpdb->query($meta_field_add);
937
-                            }
938
-                            if (isset($extra_fields['show_mapzoom']) && $extra_fields['show_mapzoom']) {
939
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "mapzoom` VARCHAR( 3 ) NULL";
940
-
941
-                                $meta_field_add = "VARCHAR( 3 ) NULL";
942
-                                if ($default_value != '') {
943
-                                    $meta_field_add .= " DEFAULT '" . $default_value . "'";
944
-                                }
945
-
946
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "mapzoom", $meta_field_add);
947
-
948
-                                //$wpdb->query($meta_field_add);
949
-                            }
950
-                            // show lat lng
951
-                            if (isset($extra_fields['show_latlng']) && $extra_fields['show_latlng']) {
952
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "latlng` VARCHAR( 3 ) NULL";
953
-
954
-                                $meta_field_add = "VARCHAR( 3 ) NULL";
955
-                                $meta_field_add .= " DEFAULT '1'";
956
-
957
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "latlng", $meta_field_add);
958
-                                //$wpdb->query($meta_field_add);
959
-                            }
960
-                        }
961
-
962
-                        break;
963
-
964
-                    case 'checkbox':
965
-                        $data_type = 'TINYINT';
966
-
967
-                        $meta_field_add = $data_type . "( 1 ) NOT NULL ";
968
-                        if ((int)$default_value === 1) {
969
-                            $meta_field_add .= " DEFAULT '1'";
970
-                        }
971
-
972
-                        $add_result = geodir_add_column_if_not_exist($detail_table, $htmlvar_name, $meta_field_add);
973
-                        if ($add_result === false) {
974
-                            return __('Column creation failed, you may have too many columns or the default value does not match with field data type.', 'geodirectory');
975
-                        }
976
-                        break;
977
-                    case 'multiselect':
978
-                    case 'select':
979
-                        $data_type = 'VARCHAR';
980
-                        $op_size = '500';
981
-
982
-                        // only make the field as big as it needs to be.
983
-                        if (isset($option_values) && $option_values && $field_type == 'select') {
984
-                            $option_values_arr = explode(',', $option_values);
985
-
986
-                            if (is_array($option_values_arr)) {
987
-                                $op_max = 0;
988
-
989
-                                foreach ($option_values_arr as $op_val) {
990
-                                    if (strlen($op_val) && strlen($op_val) > $op_max) {
991
-                                        $op_max = strlen($op_val);
992
-                                    }
993
-                                }
994
-
995
-                                if ($op_max) {
996
-                                    $op_size = $op_max;
997
-                                }
998
-                            }
999
-                        } elseif (isset($option_values) && $option_values && $field_type == 'multiselect') {
1000
-                            if (strlen($option_values)) {
1001
-                                $op_size =  strlen($option_values);
1002
-                            }
1003
-
1004
-                            if (isset($request_field['multi_display_type'])) {
1005
-                                $extra_fields = $request_field['multi_display_type'];
1006
-                            }
1007
-                        }
1008
-
1009
-                        $meta_field_add = $data_type . "( $op_size ) NULL ";
1010
-                        if ($default_value != '') {
1011
-                            $meta_field_add .= " DEFAULT '" . $default_value . "'";
1012
-                        }
1013
-
1014
-                        $add_result = geodir_add_column_if_not_exist($detail_table, $htmlvar_name, $meta_field_add);
1015
-                        if ($add_result === false) {
1016
-                            return __('Column creation failed, you may have too many columns or the default value does not match with field data type.', 'geodirectory');
1017
-                        }
1018
-                        break;
1019
-                    case 'textarea':
1020
-                    case 'html':
1021
-                    case 'url':
1022
-                    case 'file':
1023
-
1024
-                        $data_type = 'TEXT';
1025
-
1026
-                        $default_value_add = " `" . $htmlvar_name . "` " . $data_type . " NULL ";
1027
-
1028
-                        $meta_field_add = $data_type . " NULL ";
1029
-                        /*if($default_value != '')
864
+							if (isset($extra_fields['show_city']) && $extra_fields['show_city']) {
865
+								$meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "city` VARCHAR( 30 ) NULL";
866
+								$meta_field_add = "VARCHAR( 30 ) NULL";
867
+								if ($default_value != '') {
868
+									$meta_field_add .= " DEFAULT '" . $default_value . "'";
869
+								}
870
+
871
+								geodir_add_column_if_not_exist($detail_table, $prefix . "city", $meta_field_add);
872
+								//$wpdb->query($meta_field_add);
873
+							}
874
+							if (isset($extra_fields['show_region']) && $extra_fields['show_region']) {
875
+								$meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "region` VARCHAR( 30 ) NULL";
876
+								$meta_field_add = "VARCHAR( 30 ) NULL";
877
+								if ($default_value != '') {
878
+									$meta_field_add .= " DEFAULT '" . $default_value . "'";
879
+								}
880
+
881
+								geodir_add_column_if_not_exist($detail_table, $prefix . "region", $meta_field_add);
882
+								//$wpdb->query($meta_field_add);
883
+							}
884
+							if (isset($extra_fields['show_country']) && $extra_fields['show_country']) {
885
+								$meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "country` VARCHAR( 30 ) NULL";
886
+
887
+								$meta_field_add = "VARCHAR( 30 ) NULL";
888
+								if ($default_value != '') {
889
+									$meta_field_add .= " DEFAULT '" . $default_value . "'";
890
+								}
891
+
892
+								geodir_add_column_if_not_exist($detail_table, $prefix . "country", $meta_field_add);
893
+								//$wpdb->query($meta_field_add);
894
+							}
895
+							if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) {
896
+								$meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "zip` VARCHAR( 15 ) NULL";
897
+								$meta_field_add = "VARCHAR( 15 ) NULL";
898
+								if ($default_value != '') {
899
+									$meta_field_add .= " DEFAULT '" . $default_value . "'";
900
+								}
901
+
902
+								geodir_add_column_if_not_exist($detail_table, $prefix . "zip", $meta_field_add);
903
+								//$wpdb->query($meta_field_add);
904
+							}
905
+							if (isset($extra_fields['show_map']) && $extra_fields['show_map']) {
906
+								$meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "latitude` VARCHAR( 20 ) NULL";
907
+								$meta_field_add = "VARCHAR( 20 ) NULL";
908
+								if ($default_value != '') {
909
+									$meta_field_add .= " DEFAULT '" . $default_value . "'";
910
+								}
911
+
912
+								geodir_add_column_if_not_exist($detail_table, $prefix . "latitude", $meta_field_add);
913
+								//$wpdb->query($meta_field_add);
914
+
915
+								$meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "longitude` VARCHAR( 20 ) NULL";
916
+
917
+								$meta_field_add = "VARCHAR( 20 ) NULL";
918
+								if ($default_value != '') {
919
+									$meta_field_add .= " DEFAULT '" . $default_value . "'";
920
+								}
921
+
922
+								geodir_add_column_if_not_exist($detail_table, $prefix . "longitude", $meta_field_add);
923
+
924
+								//$wpdb->query($meta_field_add);
925
+							}
926
+							if (isset($extra_fields['show_mapview']) && $extra_fields['show_mapview']) {
927
+								$meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "mapview` VARCHAR( 15 ) NULL";
928
+
929
+								$meta_field_add = "VARCHAR( 15 ) NULL";
930
+								if ($default_value != '') {
931
+									$meta_field_add .= " DEFAULT '" . $default_value . "'";
932
+								}
933
+
934
+								geodir_add_column_if_not_exist($detail_table, $prefix . "mapview", $meta_field_add);
935
+
936
+								//$wpdb->query($meta_field_add);
937
+							}
938
+							if (isset($extra_fields['show_mapzoom']) && $extra_fields['show_mapzoom']) {
939
+								$meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "mapzoom` VARCHAR( 3 ) NULL";
940
+
941
+								$meta_field_add = "VARCHAR( 3 ) NULL";
942
+								if ($default_value != '') {
943
+									$meta_field_add .= " DEFAULT '" . $default_value . "'";
944
+								}
945
+
946
+								geodir_add_column_if_not_exist($detail_table, $prefix . "mapzoom", $meta_field_add);
947
+
948
+								//$wpdb->query($meta_field_add);
949
+							}
950
+							// show lat lng
951
+							if (isset($extra_fields['show_latlng']) && $extra_fields['show_latlng']) {
952
+								$meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "latlng` VARCHAR( 3 ) NULL";
953
+
954
+								$meta_field_add = "VARCHAR( 3 ) NULL";
955
+								$meta_field_add .= " DEFAULT '1'";
956
+
957
+								geodir_add_column_if_not_exist($detail_table, $prefix . "latlng", $meta_field_add);
958
+								//$wpdb->query($meta_field_add);
959
+							}
960
+						}
961
+
962
+						break;
963
+
964
+					case 'checkbox':
965
+						$data_type = 'TINYINT';
966
+
967
+						$meta_field_add = $data_type . "( 1 ) NOT NULL ";
968
+						if ((int)$default_value === 1) {
969
+							$meta_field_add .= " DEFAULT '1'";
970
+						}
971
+
972
+						$add_result = geodir_add_column_if_not_exist($detail_table, $htmlvar_name, $meta_field_add);
973
+						if ($add_result === false) {
974
+							return __('Column creation failed, you may have too many columns or the default value does not match with field data type.', 'geodirectory');
975
+						}
976
+						break;
977
+					case 'multiselect':
978
+					case 'select':
979
+						$data_type = 'VARCHAR';
980
+						$op_size = '500';
981
+
982
+						// only make the field as big as it needs to be.
983
+						if (isset($option_values) && $option_values && $field_type == 'select') {
984
+							$option_values_arr = explode(',', $option_values);
985
+
986
+							if (is_array($option_values_arr)) {
987
+								$op_max = 0;
988
+
989
+								foreach ($option_values_arr as $op_val) {
990
+									if (strlen($op_val) && strlen($op_val) > $op_max) {
991
+										$op_max = strlen($op_val);
992
+									}
993
+								}
994
+
995
+								if ($op_max) {
996
+									$op_size = $op_max;
997
+								}
998
+							}
999
+						} elseif (isset($option_values) && $option_values && $field_type == 'multiselect') {
1000
+							if (strlen($option_values)) {
1001
+								$op_size =  strlen($option_values);
1002
+							}
1003
+
1004
+							if (isset($request_field['multi_display_type'])) {
1005
+								$extra_fields = $request_field['multi_display_type'];
1006
+							}
1007
+						}
1008
+
1009
+						$meta_field_add = $data_type . "( $op_size ) NULL ";
1010
+						if ($default_value != '') {
1011
+							$meta_field_add .= " DEFAULT '" . $default_value . "'";
1012
+						}
1013
+
1014
+						$add_result = geodir_add_column_if_not_exist($detail_table, $htmlvar_name, $meta_field_add);
1015
+						if ($add_result === false) {
1016
+							return __('Column creation failed, you may have too many columns or the default value does not match with field data type.', 'geodirectory');
1017
+						}
1018
+						break;
1019
+					case 'textarea':
1020
+					case 'html':
1021
+					case 'url':
1022
+					case 'file':
1023
+
1024
+						$data_type = 'TEXT';
1025
+
1026
+						$default_value_add = " `" . $htmlvar_name . "` " . $data_type . " NULL ";
1027
+
1028
+						$meta_field_add = $data_type . " NULL ";
1029
+						/*if($default_value != '')
1030 1030
 					{ $meta_field_add .= " DEFAULT '".$default_value."'"; }*/
1031 1031
 
1032
-                        $add_result = geodir_add_column_if_not_exist($detail_table, $htmlvar_name, $meta_field_add);
1033
-                        if ($add_result === false) {
1034
-                            return __('Column creation failed, you may have too many columns or the default value does not match with field data type.', 'geodirectory');
1035
-                        }
1032
+						$add_result = geodir_add_column_if_not_exist($detail_table, $htmlvar_name, $meta_field_add);
1033
+						if ($add_result === false) {
1034
+							return __('Column creation failed, you may have too many columns or the default value does not match with field data type.', 'geodirectory');
1035
+						}
1036 1036
 
1037
-                        break;
1037
+						break;
1038 1038
 
1039
-                    case 'datepicker':
1039
+					case 'datepicker':
1040 1040
 
1041
-                        $data_type = 'DATE';
1041
+						$data_type = 'DATE';
1042 1042
 
1043
-                        $default_value_add = " `" . $htmlvar_name . "` " . $data_type . " NULL ";
1043
+						$default_value_add = " `" . $htmlvar_name . "` " . $data_type . " NULL ";
1044 1044
 
1045
-                        $meta_field_add = $data_type . " NULL ";
1045
+						$meta_field_add = $data_type . " NULL ";
1046 1046
 
1047
-                        $add_result = geodir_add_column_if_not_exist($detail_table, $htmlvar_name, $meta_field_add);
1048
-                        if ($add_result === false) {
1049
-                            return __('Column creation failed, you may have too many columns or the default value must have in valid date format.', 'geodirectory');
1050
-                        }
1047
+						$add_result = geodir_add_column_if_not_exist($detail_table, $htmlvar_name, $meta_field_add);
1048
+						if ($add_result === false) {
1049
+							return __('Column creation failed, you may have too many columns or the default value must have in valid date format.', 'geodirectory');
1050
+						}
1051 1051
 
1052
-                        break;
1052
+						break;
1053 1053
 
1054
-                    case 'time':
1054
+					case 'time':
1055 1055
 
1056
-                        $data_type = 'TIME';
1056
+						$data_type = 'TIME';
1057 1057
 
1058
-                        $default_value_add = " `" . $htmlvar_name . "` " . $data_type . " NULL ";
1058
+						$default_value_add = " `" . $htmlvar_name . "` " . $data_type . " NULL ";
1059 1059
 
1060
-                        $meta_field_add = $data_type . " NULL ";
1060
+						$meta_field_add = $data_type . " NULL ";
1061 1061
 
1062
-                        $add_result = geodir_add_column_if_not_exist($detail_table, $htmlvar_name, $meta_field_add);
1063
-                        if ($add_result === false) {
1064
-                            return __('Column creation failed, you may have too many columns or the default value must have in valid time format.', 'geodirectory');
1065
-                        }
1062
+						$add_result = geodir_add_column_if_not_exist($detail_table, $htmlvar_name, $meta_field_add);
1063
+						if ($add_result === false) {
1064
+							return __('Column creation failed, you may have too many columns or the default value must have in valid time format.', 'geodirectory');
1065
+						}
1066 1066
 
1067
-                        break;
1067
+						break;
1068 1068
 
1069
-                    default:
1069
+					default:
1070 1070
 
1071
-                        if ($data_type != 'VARCHAR' && $data_type != '') {
1072
-                            $meta_field_add = $data_type . " NULL ";
1071
+						if ($data_type != 'VARCHAR' && $data_type != '') {
1072
+							$meta_field_add = $data_type . " NULL ";
1073 1073
 
1074
-                            if ($data_type == 'FLOAT' && $decimal_point > 0) {
1075
-                                $meta_field_add = "DECIMAL(11, " . (int)$decimal_point . ") NULL ";
1076
-                            }
1074
+							if ($data_type == 'FLOAT' && $decimal_point > 0) {
1075
+								$meta_field_add = "DECIMAL(11, " . (int)$decimal_point . ") NULL ";
1076
+							}
1077 1077
 
1078
-                            if (is_numeric($default_value) && $default_value != '') {
1079
-                                $default_value_add .= " DEFAULT '" . $default_value . "'";
1080
-                                $meta_field_add .= " DEFAULT '" . $default_value . "'";
1081
-                            }
1082
-                        } else {
1083
-                            $meta_field_add = " VARCHAR( 254 ) NULL ";
1078
+							if (is_numeric($default_value) && $default_value != '') {
1079
+								$default_value_add .= " DEFAULT '" . $default_value . "'";
1080
+								$meta_field_add .= " DEFAULT '" . $default_value . "'";
1081
+							}
1082
+						} else {
1083
+							$meta_field_add = " VARCHAR( 254 ) NULL ";
1084 1084
 
1085
-                            if ($default_value != '') {
1086
-                                $default_value_add .= " DEFAULT '" . $default_value . "'";
1087
-                                $meta_field_add .= " DEFAULT '" . $default_value . "'";
1088
-                            }
1089
-                        }
1085
+							if ($default_value != '') {
1086
+								$default_value_add .= " DEFAULT '" . $default_value . "'";
1087
+								$meta_field_add .= " DEFAULT '" . $default_value . "'";
1088
+							}
1089
+						}
1090 1090
 
1091
-                        $add_result = geodir_add_column_if_not_exist($detail_table, $htmlvar_name, $meta_field_add);
1092
-                        if ($add_result === false) {
1093
-                            return __('Column creation failed, you may have too many columns or the default value does not match with field data type.', 'geodirectory');
1094
-                        }
1095
-                        break;
1096
-                endswitch;
1091
+						$add_result = geodir_add_column_if_not_exist($detail_table, $htmlvar_name, $meta_field_add);
1092
+						if ($add_result === false) {
1093
+							return __('Column creation failed, you may have too many columns or the default value does not match with field data type.', 'geodirectory');
1094
+						}
1095
+						break;
1096
+				endswitch;
1097 1097
 
1098
-                $extra_field_query = '';
1099
-                if (!empty($extra_fields)) {
1100
-                    $extra_field_query = serialize($extra_fields);
1101
-                }
1098
+				$extra_field_query = '';
1099
+				if (!empty($extra_fields)) {
1100
+					$extra_field_query = serialize($extra_fields);
1101
+				}
1102 1102
 
1103
-                $decimal_point = $field_type == 'text' && $data_type == 'FLOAT' ? $decimal_point : '';
1103
+				$decimal_point = $field_type == 'text' && $data_type == 'FLOAT' ? $decimal_point : '';
1104 1104
 
1105
-                $wpdb->query(
1105
+				$wpdb->query(
1106 1106
 
1107
-                    $wpdb->prepare(
1107
+					$wpdb->prepare(
1108 1108
 
1109
-                        "insert into " . GEODIR_CUSTOM_FIELDS_TABLE . " set 
1109
+						"insert into " . GEODIR_CUSTOM_FIELDS_TABLE . " set 
1110 1110
 					post_type = %s,
1111 1111
 					admin_title = %s,
1112 1112
 					site_title = %s,
@@ -1139,26 +1139,26 @@  discard block
 block discarded – undo
1139 1139
 					validation_msg = %s,
1140 1140
 					for_admin_use = %s ",
1141 1141
 
1142
-                        array($post_type, $admin_title, $site_title, $field_type, $field_type_key, $htmlvar_name, $admin_desc, $clabels, $default_value, $sort_order, $is_active, $is_default, $is_admin, $is_required, $required_msg, $css_class, $field_icon, $show_on_listing,$show_in, $show_on_detail, $show_as_tab, $option_values, $price_pkg, $cat_sort, $cat_filter, $data_type, $extra_field_query, $decimal_point,$validation_pattern,$validation_msg, $for_admin_use)
1142
+						array($post_type, $admin_title, $site_title, $field_type, $field_type_key, $htmlvar_name, $admin_desc, $clabels, $default_value, $sort_order, $is_active, $is_default, $is_admin, $is_required, $required_msg, $css_class, $field_icon, $show_on_listing,$show_in, $show_on_detail, $show_as_tab, $option_values, $price_pkg, $cat_sort, $cat_filter, $data_type, $extra_field_query, $decimal_point,$validation_pattern,$validation_msg, $for_admin_use)
1143 1143
 
1144
-                    )
1144
+					)
1145 1145
 
1146
-                );
1146
+				);
1147 1147
 
1148
-                $lastid = $wpdb->insert_id;
1148
+				$lastid = $wpdb->insert_id;
1149 1149
 
1150
-                $lastid = trim($lastid);
1150
+				$lastid = trim($lastid);
1151 1151
 
1152
-            }
1152
+			}
1153 1153
 
1154
-            return (int)$lastid;
1154
+			return (int)$lastid;
1155 1155
 
1156 1156
 
1157
-        } else {
1158
-            return 'HTML Variable Name should be a unique name';
1159
-        }
1157
+		} else {
1158
+			return 'HTML Variable Name should be a unique name';
1159
+		}
1160 1160
 
1161
-    }
1161
+	}
1162 1162
 }
1163 1163
 
1164 1164
 /**
@@ -1173,54 +1173,54 @@  discard block
 block discarded – undo
1173 1173
 function godir_set_field_order($field_ids = array())
1174 1174
 {
1175 1175
 
1176
-    global $wpdb;
1176
+	global $wpdb;
1177 1177
 
1178
-    $count = 0;
1179
-    if (!empty($field_ids)):
1180
-        $post_meta_info = false;
1181
-        foreach ($field_ids as $id) {
1178
+	$count = 0;
1179
+	if (!empty($field_ids)):
1180
+		$post_meta_info = false;
1181
+		foreach ($field_ids as $id) {
1182 1182
 
1183
-            $cf = trim($id, '_');
1183
+			$cf = trim($id, '_');
1184 1184
 
1185
-            $post_meta_info = $wpdb->query(
1186
-                $wpdb->prepare(
1187
-                    "update " . GEODIR_CUSTOM_FIELDS_TABLE . " set 
1185
+			$post_meta_info = $wpdb->query(
1186
+				$wpdb->prepare(
1187
+					"update " . GEODIR_CUSTOM_FIELDS_TABLE . " set 
1188 1188
 															sort_order=%d 
1189 1189
 															where id= %d",
1190
-                    array($count, $cf)
1191
-                )
1192
-            );
1193
-            $count++;
1194
-        }
1195
-
1196
-        return $post_meta_info;
1197
-    else:
1198
-        return false;
1199
-    endif;
1190
+					array($count, $cf)
1191
+				)
1192
+			);
1193
+			$count++;
1194
+		}
1195
+
1196
+		return $post_meta_info;
1197
+	else:
1198
+		return false;
1199
+	endif;
1200 1200
 }
1201 1201
 
1202 1202
 
1203 1203
 function geodir_get_cf_value($cf){
1204
-    global $gd_session;
1205
-    $value = '';
1206
-    if (is_admin()) {
1207
-        global $post,$gd_session;
1208
-
1209
-        if (isset($_REQUEST['post']))
1210
-            $_REQUEST['pid'] = $_REQUEST['post'];
1211
-    }
1212
-
1213
-    if (isset($_REQUEST['backandedit']) && $_REQUEST['backandedit'] && $gd_ses_listing = $gd_session->get('listing')) {
1214
-        $post = $gd_ses_listing;
1215
-        $value = isset($post[$cf['name']]) ? $post[$cf['name']] : '';
1216
-    } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
1217
-        $value = geodir_get_post_meta($_REQUEST['pid'], $cf['name'], true);
1218
-    } else {
1219
-        if ($value == '') {
1220
-            $value = $cf['default'];
1221
-        }
1222
-    }
1223
-    return $value;
1204
+	global $gd_session;
1205
+	$value = '';
1206
+	if (is_admin()) {
1207
+		global $post,$gd_session;
1208
+
1209
+		if (isset($_REQUEST['post']))
1210
+			$_REQUEST['pid'] = $_REQUEST['post'];
1211
+	}
1212
+
1213
+	if (isset($_REQUEST['backandedit']) && $_REQUEST['backandedit'] && $gd_ses_listing = $gd_session->get('listing')) {
1214
+		$post = $gd_ses_listing;
1215
+		$value = isset($post[$cf['name']]) ? $post[$cf['name']] : '';
1216
+	} elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
1217
+		$value = geodir_get_post_meta($_REQUEST['pid'], $cf['name'], true);
1218
+	} else {
1219
+		if ($value == '') {
1220
+			$value = $cf['default'];
1221
+		}
1222
+	}
1223
+	return $value;
1224 1224
 }
1225 1225
 
1226 1226
 /**
@@ -1239,417 +1239,417 @@  discard block
 block discarded – undo
1239 1239
  * @param string $post_type Optional. The wordpress post type.
1240 1240
  */
1241 1241
 function geodir_get_custom_fields_html($package_id = '', $default = 'custom', $post_type = 'gd_place') {
1242
-    global $is_default, $mapzoom, $gd_session;
1242
+	global $is_default, $mapzoom, $gd_session;
1243 1243
 
1244
-    $listing_type = $post_type;
1244
+	$listing_type = $post_type;
1245 1245
 
1246
-    $custom_fields = geodir_post_custom_fields($package_id, $default, $post_type);
1246
+	$custom_fields = geodir_post_custom_fields($package_id, $default, $post_type);
1247 1247
 
1248
-    foreach ($custom_fields as $key => $val) {
1249
-        $val = stripslashes_deep($val); // strip slashes from labels
1250
-        $name = $val['name'];
1251
-        $type = $val['type'];
1252
-        $is_default = $val['is_default'];
1248
+	foreach ($custom_fields as $key => $val) {
1249
+		$val = stripslashes_deep($val); // strip slashes from labels
1250
+		$name = $val['name'];
1251
+		$type = $val['type'];
1252
+		$is_default = $val['is_default'];
1253 1253
 
1254
-        /* field available to site admin only for edit */
1255
-        $for_admin_use = isset($val['for_admin_use']) && (int)$val['for_admin_use'] == 1 ? true : false;
1256
-        if ($for_admin_use && !is_super_admin()) {
1257
-            continue;
1258
-        }
1254
+		/* field available to site admin only for edit */
1255
+		$for_admin_use = isset($val['for_admin_use']) && (int)$val['for_admin_use'] == 1 ? true : false;
1256
+		if ($for_admin_use && !is_super_admin()) {
1257
+			continue;
1258
+		}
1259 1259
 
1260
-        if (is_admin()) {
1261
-            global $post;
1260
+		if (is_admin()) {
1261
+			global $post;
1262 1262
 
1263
-            if (isset($_REQUEST['post']))
1264
-                $_REQUEST['pid'] = $_REQUEST['post'];
1265
-        }
1263
+			if (isset($_REQUEST['post']))
1264
+				$_REQUEST['pid'] = $_REQUEST['post'];
1265
+		}
1266 1266
 
1267 1267
         
1268 1268
 
1269
-        /**
1270
-         * Called before the custom fields info is output for submitting a post.
1271
-         *
1272
-         * Used dynamic hook type geodir_before_custom_form_field_$name.
1273
-         *
1274
-         * @since 1.0.0
1275
-         * @param string $listing_type The post post type.
1276
-         * @param int $package_id The price package ID for the post.
1277
-         * @param array $val The settings array for the field. {@see geodir_custom_field_save()}.
1278
-         * @see 'geodir_after_custom_form_field_$name'
1279
-         */
1280
-        do_action('geodir_before_custom_form_field_' . $name, $listing_type, $package_id, $val);
1281
-
1282
-
1283
-        $custom_field = $val;
1284
-        $html ='';
1285
-        /**
1286
-         * Filter the output for custom fields.
1287
-         *
1288
-         * Here we can remove or add new functions depending on the field type.
1289
-         *
1290
-         * @param string $html The html to be filtered (blank).
1291
-         * @param array $custom_field The custom field array values.
1292
-         */
1293
-        echo apply_filters("geodir_custom_field_input_{$type}",$html,$custom_field);
1294
-
1295
-
1296
-
1297
-        /**
1298
-         * Called after the custom fields info is output for submitting a post.
1299
-         *
1300
-         * Used dynamic hook type geodir_after_custom_form_field_$name.
1301
-         *
1302
-         * @since 1.0.0
1303
-         * @param string $listing_type The post post type.
1304
-         * @param int $package_id The price package ID for the post.
1305
-         * @param array $val The settings array for the field. {@see geodir_custom_field_save()}.
1306
-         * @see 'geodir_before_custom_form_field_$name'
1307
-         */
1308
-        do_action('geodir_after_custom_form_field_' . $name, $listing_type, $package_id, $val);
1309
-
1310
-    }
1269
+		/**
1270
+		 * Called before the custom fields info is output for submitting a post.
1271
+		 *
1272
+		 * Used dynamic hook type geodir_before_custom_form_field_$name.
1273
+		 *
1274
+		 * @since 1.0.0
1275
+		 * @param string $listing_type The post post type.
1276
+		 * @param int $package_id The price package ID for the post.
1277
+		 * @param array $val The settings array for the field. {@see geodir_custom_field_save()}.
1278
+		 * @see 'geodir_after_custom_form_field_$name'
1279
+		 */
1280
+		do_action('geodir_before_custom_form_field_' . $name, $listing_type, $package_id, $val);
1281
+
1282
+
1283
+		$custom_field = $val;
1284
+		$html ='';
1285
+		/**
1286
+		 * Filter the output for custom fields.
1287
+		 *
1288
+		 * Here we can remove or add new functions depending on the field type.
1289
+		 *
1290
+		 * @param string $html The html to be filtered (blank).
1291
+		 * @param array $custom_field The custom field array values.
1292
+		 */
1293
+		echo apply_filters("geodir_custom_field_input_{$type}",$html,$custom_field);
1294
+
1295
+
1296
+
1297
+		/**
1298
+		 * Called after the custom fields info is output for submitting a post.
1299
+		 *
1300
+		 * Used dynamic hook type geodir_after_custom_form_field_$name.
1301
+		 *
1302
+		 * @since 1.0.0
1303
+		 * @param string $listing_type The post post type.
1304
+		 * @param int $package_id The price package ID for the post.
1305
+		 * @param array $val The settings array for the field. {@see geodir_custom_field_save()}.
1306
+		 * @see 'geodir_before_custom_form_field_$name'
1307
+		 */
1308
+		do_action('geodir_after_custom_form_field_' . $name, $listing_type, $package_id, $val);
1309
+
1310
+	}
1311 1311
 
1312 1312
 }
1313 1313
 
1314 1314
 
1315 1315
 if (!function_exists('geodir_get_field_infoby')) {
1316
-    /**
1317
-     * Get custom field using key and value.
1318
-     *
1319
-     * @since 1.0.0
1320
-     * @package GeoDirectory
1321
-     * @global object $wpdb WordPress Database object.
1322
-     * @param string $key The key you want to look for.
1323
-     * @param string $value The value of the key you want to look for.
1324
-     * @param string $geodir_post_type The post type.
1325
-     * @return bool|mixed Returns field info when available. otherwise returns false.
1326
-     */
1327
-    function geodir_get_field_infoby($key = '', $value = '', $geodir_post_type = '')
1328
-    {
1329
-
1330
-        global $wpdb;
1331
-
1332
-        $filter = $wpdb->get_row(
1333
-            $wpdb->prepare(
1334
-                "SELECT * FROM " . GEODIR_CUSTOM_FIELDS_TABLE . " WHERE post_type=%s AND " . $key . "='" . $value . "'",
1335
-                array($geodir_post_type)
1336
-            )
1337
-        );
1338
-
1339
-        if ($filter) {
1340
-            return $filter;
1341
-        } else {
1342
-            return false;
1343
-        }
1344
-
1345
-    }
1316
+	/**
1317
+	 * Get custom field using key and value.
1318
+	 *
1319
+	 * @since 1.0.0
1320
+	 * @package GeoDirectory
1321
+	 * @global object $wpdb WordPress Database object.
1322
+	 * @param string $key The key you want to look for.
1323
+	 * @param string $value The value of the key you want to look for.
1324
+	 * @param string $geodir_post_type The post type.
1325
+	 * @return bool|mixed Returns field info when available. otherwise returns false.
1326
+	 */
1327
+	function geodir_get_field_infoby($key = '', $value = '', $geodir_post_type = '')
1328
+	{
1329
+
1330
+		global $wpdb;
1331
+
1332
+		$filter = $wpdb->get_row(
1333
+			$wpdb->prepare(
1334
+				"SELECT * FROM " . GEODIR_CUSTOM_FIELDS_TABLE . " WHERE post_type=%s AND " . $key . "='" . $value . "'",
1335
+				array($geodir_post_type)
1336
+			)
1337
+		);
1338
+
1339
+		if ($filter) {
1340
+			return $filter;
1341
+		} else {
1342
+			return false;
1343
+		}
1344
+
1345
+	}
1346 1346
 }
1347 1347
 
1348 1348
 
1349 1349
 function geodir_field_icon_proccess($cf){
1350 1350
 
1351 1351
 
1352
-    if (strpos($cf['field_icon'], 'http') !== false) {
1353
-        $field_icon = ' background: url(' . $cf['field_icon'] . ') no-repeat left center;background-size:18px 18px;padding-left: 21px;';
1354
-    } elseif (strpos($cf['field_icon'], 'fa fa-') !== false) {
1355
-        $field_icon = '<i class="' . $cf['field_icon'] . '"></i>';
1356
-    }else{
1357
-        $field_icon = $cf['field_icon'];
1358
-    }
1352
+	if (strpos($cf['field_icon'], 'http') !== false) {
1353
+		$field_icon = ' background: url(' . $cf['field_icon'] . ') no-repeat left center;background-size:18px 18px;padding-left: 21px;';
1354
+	} elseif (strpos($cf['field_icon'], 'fa fa-') !== false) {
1355
+		$field_icon = '<i class="' . $cf['field_icon'] . '"></i>';
1356
+	}else{
1357
+		$field_icon = $cf['field_icon'];
1358
+	}
1359 1359
 
1360
-    return $field_icon;
1360
+	return $field_icon;
1361 1361
 }
1362 1362
 
1363 1363
 if (!function_exists('geodir_show_listing_info')) {
1364
-    /**
1365
-     * Show listing info depending on field location.
1366
-     *
1367
-     * @since 1.0.0
1368
-     * @since 1.5.7 Custom fields option values added to db translation.
1369
-     *              Changes to display url fields title.
1370
-     * @package GeoDirectory
1371
-     * @global object $wpdb WordPress Database object.
1372
-     * @global object $post The current post object.
1373
-     * @global bool $send_to_friend True if send to friend link already rendered. Otherwise false.
1374
-     *
1375
-     * @param string $fields_location In which page you are going to place this custom fields?. Ex: listing, detail etc.
1376
-     * @return string Returns listing info html.
1377
-     */
1378
-    function geodir_show_listing_info($fields_location = '') {
1379
-        global $post, $preview, $wpdb, $send_to_friend;
1380
-
1381
-        $package_info = array();
1382
-
1383
-        $package_info = geodir_post_package_info($package_info, $post);
1384
-        $post_package_id = !empty($package_info->pid) ? $package_info->pid : '';
1385
-        $p_type = !empty($post->post_type) ? $post->post_type : geodir_get_current_posttype();
1386
-        $send_to_friend = false;
1387
-
1388
-        ob_start();
1389
-        $fields_info = geodir_post_custom_fields($post_package_id, 'all', $p_type, $fields_location);
1390
-
1391
-        if (!empty($fields_info)) {
1392
-            $post = stripslashes_deep($post); // strip slashes
1364
+	/**
1365
+	 * Show listing info depending on field location.
1366
+	 *
1367
+	 * @since 1.0.0
1368
+	 * @since 1.5.7 Custom fields option values added to db translation.
1369
+	 *              Changes to display url fields title.
1370
+	 * @package GeoDirectory
1371
+	 * @global object $wpdb WordPress Database object.
1372
+	 * @global object $post The current post object.
1373
+	 * @global bool $send_to_friend True if send to friend link already rendered. Otherwise false.
1374
+	 *
1375
+	 * @param string $fields_location In which page you are going to place this custom fields?. Ex: listing, detail etc.
1376
+	 * @return string Returns listing info html.
1377
+	 */
1378
+	function geodir_show_listing_info($fields_location = '') {
1379
+		global $post, $preview, $wpdb, $send_to_friend;
1380
+
1381
+		$package_info = array();
1382
+
1383
+		$package_info = geodir_post_package_info($package_info, $post);
1384
+		$post_package_id = !empty($package_info->pid) ? $package_info->pid : '';
1385
+		$p_type = !empty($post->post_type) ? $post->post_type : geodir_get_current_posttype();
1386
+		$send_to_friend = false;
1387
+
1388
+		ob_start();
1389
+		$fields_info = geodir_post_custom_fields($post_package_id, 'all', $p_type, $fields_location);
1390
+
1391
+		if (!empty($fields_info)) {
1392
+			$post = stripslashes_deep($post); // strip slashes
1393 1393
             
1394
-            //echo '<div class="geodir-company_info field-group">';
1395
-            global $field_set_start;
1396
-            $field_set_start = 0;
1397
-
1398
-
1399
-
1400
-            foreach ($fields_info as $type) {
1401
-                $type = stripslashes_deep($type); // strip slashes
1402
-                $html = '';
1403
-                $field_icon = geodir_field_icon_proccess($type);
1404
-                $filed_type = $type['type'];
1405
-                $html_var = isset($type['htmlvar_name']) ? $type['htmlvar_name'] : '';
1406
-                if($html_var=='post'){$html_var='post_address';}
1407
-
1408
-                /**
1409
-                 * Filter the output for custom fields.
1410
-                 *
1411
-                 * Here we can remove or add new functions depending on the field type.
1412
-                 *
1413
-                 * @param string $html The html to be filtered (blank).
1414
-                 * @param string $fields_location The location the field is to be show.
1415
-                 * @param array $type The array of field values.
1416
-                 */
1417
-                $html = apply_filters("geodir_custom_field_output_{$filed_type}",$html,$fields_location,$type);
1418
-
1419
-                $variables_array = array();
1420
-
1421
-
1422
-                if ($type['type'] != 'fieldset'):
1423
-                    $variables_array['post_id'] = $post->ID;
1424
-                    $variables_array['label'] = __($type['site_title'], 'geodirectory');
1425
-                    $variables_array['value'] = '';
1426
-                    if (isset($post->{$type['htmlvar_name']}))
1427
-                        $variables_array['value'] = $post->{$type['htmlvar_name']};
1428
-                endif;
1429
-
1430
-
1431
-                if ($html):
1432
-
1433
-                    /**
1434
-                     * Called before a custom fields is output on the frontend.
1435
-                     *
1436
-                     * @since 1.0.0
1437
-                     * @param string $html_var The HTML variable name for the field.
1438
-                     */
1439
-                    do_action("geodir_before_show_{$html_var}");
1440
-                    /**
1441
-                     * Filter custom field output.
1442
-                     *
1443
-                     * @since 1.0.0
1444
-                     *
1445
-                     * @param string $html_var The HTML variable name for the field.
1446
-                     * @param string $html Custom field unfiltered HTML.
1447
-                     * @param array $variables_array Custom field variables array.
1448
-                     */
1449
-                    if ($html) echo apply_filters("geodir_show_{$html_var}", $html, $variables_array);
1450
-
1451
-                    /**
1452
-                     * Called after a custom fields is output on the frontend.
1453
-                     *
1454
-                     * @since 1.0.0
1455
-                     * @param string $html_var The HTML variable name for the field.
1456
-                     */
1457
-                    do_action("geodir_after_show_{$html_var}");
1458
-
1459
-                endif;
1460
-
1461
-            }
1462
-
1463
-            //echo '</div>';
1464
-
1465
-        }
1466
-
1467
-
1468
-        $html = ob_get_clean();
1469
-
1470
-        /**
1471
-         * Filter the custom fields over all output.
1472
-         *
1473
-         * @param string $html The html of the custom fields.
1474
-         * @param string $fields_location The location the fields are being output.
1475
-         * @since 1.6.9
1476
-         */
1477
-        return apply_filters('geodir_show_listing_info',$html,$fields_location);
1478
-
1479
-    }
1394
+			//echo '<div class="geodir-company_info field-group">';
1395
+			global $field_set_start;
1396
+			$field_set_start = 0;
1397
+
1398
+
1399
+
1400
+			foreach ($fields_info as $type) {
1401
+				$type = stripslashes_deep($type); // strip slashes
1402
+				$html = '';
1403
+				$field_icon = geodir_field_icon_proccess($type);
1404
+				$filed_type = $type['type'];
1405
+				$html_var = isset($type['htmlvar_name']) ? $type['htmlvar_name'] : '';
1406
+				if($html_var=='post'){$html_var='post_address';}
1407
+
1408
+				/**
1409
+				 * Filter the output for custom fields.
1410
+				 *
1411
+				 * Here we can remove or add new functions depending on the field type.
1412
+				 *
1413
+				 * @param string $html The html to be filtered (blank).
1414
+				 * @param string $fields_location The location the field is to be show.
1415
+				 * @param array $type The array of field values.
1416
+				 */
1417
+				$html = apply_filters("geodir_custom_field_output_{$filed_type}",$html,$fields_location,$type);
1418
+
1419
+				$variables_array = array();
1420
+
1421
+
1422
+				if ($type['type'] != 'fieldset'):
1423
+					$variables_array['post_id'] = $post->ID;
1424
+					$variables_array['label'] = __($type['site_title'], 'geodirectory');
1425
+					$variables_array['value'] = '';
1426
+					if (isset($post->{$type['htmlvar_name']}))
1427
+						$variables_array['value'] = $post->{$type['htmlvar_name']};
1428
+				endif;
1429
+
1430
+
1431
+				if ($html):
1432
+
1433
+					/**
1434
+					 * Called before a custom fields is output on the frontend.
1435
+					 *
1436
+					 * @since 1.0.0
1437
+					 * @param string $html_var The HTML variable name for the field.
1438
+					 */
1439
+					do_action("geodir_before_show_{$html_var}");
1440
+					/**
1441
+					 * Filter custom field output.
1442
+					 *
1443
+					 * @since 1.0.0
1444
+					 *
1445
+					 * @param string $html_var The HTML variable name for the field.
1446
+					 * @param string $html Custom field unfiltered HTML.
1447
+					 * @param array $variables_array Custom field variables array.
1448
+					 */
1449
+					if ($html) echo apply_filters("geodir_show_{$html_var}", $html, $variables_array);
1450
+
1451
+					/**
1452
+					 * Called after a custom fields is output on the frontend.
1453
+					 *
1454
+					 * @since 1.0.0
1455
+					 * @param string $html_var The HTML variable name for the field.
1456
+					 */
1457
+					do_action("geodir_after_show_{$html_var}");
1458
+
1459
+				endif;
1460
+
1461
+			}
1462
+
1463
+			//echo '</div>';
1464
+
1465
+		}
1466
+
1467
+
1468
+		$html = ob_get_clean();
1469
+
1470
+		/**
1471
+		 * Filter the custom fields over all output.
1472
+		 *
1473
+		 * @param string $html The html of the custom fields.
1474
+		 * @param string $fields_location The location the fields are being output.
1475
+		 * @since 1.6.9
1476
+		 */
1477
+		return apply_filters('geodir_show_listing_info',$html,$fields_location);
1478
+
1479
+	}
1480 1480
 }
1481 1481
 
1482 1482
 if (!function_exists('geodir_default_date_format')) {
1483
-    /**
1484
-     * Returns default date format.
1485
-     *
1486
-     * @since 1.0.0
1487
-     * @package GeoDirectory
1488
-     * @return mixed|string|void Returns default date format.
1489
-     */
1490
-    function geodir_default_date_format()
1491
-    {
1492
-        if ($format = get_option('date_format'))
1493
-            return $format;
1494
-        else
1495
-            return 'dd-mm-yy';
1496
-    }
1483
+	/**
1484
+	 * Returns default date format.
1485
+	 *
1486
+	 * @since 1.0.0
1487
+	 * @package GeoDirectory
1488
+	 * @return mixed|string|void Returns default date format.
1489
+	 */
1490
+	function geodir_default_date_format()
1491
+	{
1492
+		if ($format = get_option('date_format'))
1493
+			return $format;
1494
+		else
1495
+			return 'dd-mm-yy';
1496
+	}
1497 1497
 }
1498 1498
 
1499 1499
 if (!function_exists('geodir_get_formated_date')) {
1500
-    /**
1501
-     * Returns formatted date.
1502
-     *
1503
-     * @since 1.0.0
1504
-     * @package GeoDirectory
1505
-     * @param string $date Date string to convert.
1506
-     * @return bool|int|string Returns formatted date.
1507
-     */
1508
-    function geodir_get_formated_date($date)
1509
-    {
1510
-        return mysql2date(get_option('date_format'), $date);
1511
-    }
1500
+	/**
1501
+	 * Returns formatted date.
1502
+	 *
1503
+	 * @since 1.0.0
1504
+	 * @package GeoDirectory
1505
+	 * @param string $date Date string to convert.
1506
+	 * @return bool|int|string Returns formatted date.
1507
+	 */
1508
+	function geodir_get_formated_date($date)
1509
+	{
1510
+		return mysql2date(get_option('date_format'), $date);
1511
+	}
1512 1512
 }
1513 1513
 
1514 1514
 if (!function_exists('geodir_get_formated_time')) {
1515
-    /**
1516
-     * Returns formatted time.
1517
-     *
1518
-     * @since 1.0.0
1519
-     * @package GeoDirectory
1520
-     * @param string $time Time string to convert.
1521
-     * @return bool|int|string Returns formatted time.
1522
-     */
1523
-    function geodir_get_formated_time($time)
1524
-    {
1525
-        return mysql2date(get_option('time_format'), $time, $translate = true);
1526
-    }
1515
+	/**
1516
+	 * Returns formatted time.
1517
+	 *
1518
+	 * @since 1.0.0
1519
+	 * @package GeoDirectory
1520
+	 * @param string $time Time string to convert.
1521
+	 * @return bool|int|string Returns formatted time.
1522
+	 */
1523
+	function geodir_get_formated_time($time)
1524
+	{
1525
+		return mysql2date(get_option('time_format'), $time, $translate = true);
1526
+	}
1527 1527
 }
1528 1528
 
1529 1529
 
1530 1530
 if (!function_exists('geodir_save_post_file_fields')) {
1531
-    /**
1532
-     * Save post file fields
1533
-     *
1534
-     * @since 1.0.0
1535
-     * @since 1.4.7 Added `$extra_fields` parameter.
1536
-     * @package GeoDirectory
1537
-     * @global object $wpdb WordPress Database object.
1538
-     * @global string $plugin_prefix Geodirectory plugin table prefix.
1539
-     * @global object $current_user Current user object.
1540
-     * @param int $post_id
1541
-     * @param string $field_id
1542
-     * @param array $post_image
1543
-     * @param array $extra_fields Array of extra fields.
1544
-     */
1545
-    function geodir_save_post_file_fields($post_id = 0, $field_id = '', $post_image = array(), $extra_fields = array())
1546
-    {
1531
+	/**
1532
+	 * Save post file fields
1533
+	 *
1534
+	 * @since 1.0.0
1535
+	 * @since 1.4.7 Added `$extra_fields` parameter.
1536
+	 * @package GeoDirectory
1537
+	 * @global object $wpdb WordPress Database object.
1538
+	 * @global string $plugin_prefix Geodirectory plugin table prefix.
1539
+	 * @global object $current_user Current user object.
1540
+	 * @param int $post_id
1541
+	 * @param string $field_id
1542
+	 * @param array $post_image
1543
+	 * @param array $extra_fields Array of extra fields.
1544
+	 */
1545
+	function geodir_save_post_file_fields($post_id = 0, $field_id = '', $post_image = array(), $extra_fields = array())
1546
+	{
1547 1547
 
1548
-        global $wpdb, $plugin_prefix, $current_user;
1548
+		global $wpdb, $plugin_prefix, $current_user;
1549 1549
 
1550
-        $post_type = get_post_type($post_id);
1551
-        //echo $field_id; exit;
1552
-        $table = $plugin_prefix . $post_type . '_detail';
1550
+		$post_type = get_post_type($post_id);
1551
+		//echo $field_id; exit;
1552
+		$table = $plugin_prefix . $post_type . '_detail';
1553 1553
 
1554
-        $postcurr_images = array();
1555
-        $postcurr_images = geodir_get_post_meta($post_id, $field_id, true);
1556
-        $file_urls = '';
1554
+		$postcurr_images = array();
1555
+		$postcurr_images = geodir_get_post_meta($post_id, $field_id, true);
1556
+		$file_urls = '';
1557 1557
 
1558
-        if (!empty($post_image)) {
1558
+		if (!empty($post_image)) {
1559 1559
 
1560
-            $invalid_files = array();
1560
+			$invalid_files = array();
1561 1561
 
1562
-            //Get and remove all old images of post from database to set by new order
1563
-            $geodir_uploaddir = '';
1564
-            $uploads = wp_upload_dir();
1565
-            $uploads_dir = $uploads['path'];
1562
+			//Get and remove all old images of post from database to set by new order
1563
+			$geodir_uploaddir = '';
1564
+			$uploads = wp_upload_dir();
1565
+			$uploads_dir = $uploads['path'];
1566 1566
 
1567
-            $geodir_uploadpath = $uploads['path'];
1568
-            $geodir_uploadurl = $uploads['url'];
1569
-            $sub_dir = $uploads['subdir'];
1567
+			$geodir_uploadpath = $uploads['path'];
1568
+			$geodir_uploadurl = $uploads['url'];
1569
+			$sub_dir = $uploads['subdir'];
1570 1570
 
1571
-            $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'] : '';
1571
+			$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'] : '';
1572 1572
 
1573
-            for ($m = 0; $m < count($post_image); $m++) {
1573
+			for ($m = 0; $m < count($post_image); $m++) {
1574 1574
 
1575
-                /* --------- start ------- */
1575
+				/* --------- start ------- */
1576 1576
 
1577
-                if (!$find_image = $wpdb->get_var($wpdb->prepare("SELECT post_id FROM " . $table . " WHERE $field_id = %s AND post_id = %d", array($post_image[$m], $post_id)))) {
1577
+				if (!$find_image = $wpdb->get_var($wpdb->prepare("SELECT post_id FROM " . $table . " WHERE $field_id = %s AND post_id = %d", array($post_image[$m], $post_id)))) {
1578 1578
 
1579 1579
 
1580
-                    $curr_img_url = $post_image[$m];
1581
-                    $image_name_arr = explode('/', $curr_img_url);
1582
-                    $curr_img_dir = $image_name_arr[count($image_name_arr) - 2];
1583
-                    $filename = end($image_name_arr);
1584
-                    $img_name_arr = explode('.', $filename);
1580
+					$curr_img_url = $post_image[$m];
1581
+					$image_name_arr = explode('/', $curr_img_url);
1582
+					$curr_img_dir = $image_name_arr[count($image_name_arr) - 2];
1583
+					$filename = end($image_name_arr);
1584
+					$img_name_arr = explode('.', $filename);
1585 1585
 
1586
-                    $arr_file_type = wp_check_filetype($filename);
1586
+					$arr_file_type = wp_check_filetype($filename);
1587 1587
 
1588
-                    if (empty($arr_file_type['ext']) || empty($arr_file_type['type'])) {
1589
-                        continue;
1590
-                    }
1588
+					if (empty($arr_file_type['ext']) || empty($arr_file_type['type'])) {
1589
+						continue;
1590
+					}
1591 1591
 
1592
-                    $uploaded_file_type = $arr_file_type['type'];
1593
-                    $uploaded_file_ext = $arr_file_type['ext'];
1592
+					$uploaded_file_type = $arr_file_type['type'];
1593
+					$uploaded_file_ext = $arr_file_type['ext'];
1594 1594
 
1595
-                    if (!empty($allowed_file_types) && !in_array($uploaded_file_ext, $allowed_file_types)) {
1596
-                        continue; // Invalid file type.
1597
-                    }
1595
+					if (!empty($allowed_file_types) && !in_array($uploaded_file_ext, $allowed_file_types)) {
1596
+						continue; // Invalid file type.
1597
+					}
1598 1598
 
1599
-                    // Set an array containing a list of acceptable formats
1600
-                    //$allowed_file_types = array('image/jpg', 'image/jpeg', 'image/gif', 'image/png', 'application/pdf', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/octet-stream', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'text/csv', 'text/plain');
1599
+					// Set an array containing a list of acceptable formats
1600
+					//$allowed_file_types = array('image/jpg', 'image/jpeg', 'image/gif', 'image/png', 'application/pdf', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/octet-stream', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'text/csv', 'text/plain');
1601 1601
 
1602
-                    if (!function_exists('wp_handle_upload'))
1603
-                        require_once(ABSPATH . 'wp-admin/includes/file.php');
1602
+					if (!function_exists('wp_handle_upload'))
1603
+						require_once(ABSPATH . 'wp-admin/includes/file.php');
1604 1604
 
1605
-                    if (!is_dir($geodir_uploadpath))
1606
-                        mkdir($geodir_uploadpath);
1605
+					if (!is_dir($geodir_uploadpath))
1606
+						mkdir($geodir_uploadpath);
1607 1607
 
1608
-                    $new_name = $post_id . '_' . $field_id . '_' . $img_name_arr[0] . '.' . $img_name_arr[1];
1609
-                    $explode_sub_dir = explode("/", $sub_dir);
1610
-                    if ($curr_img_dir == end($explode_sub_dir)) {
1611
-                        $img_path = $geodir_uploadpath . '/' . $filename;
1612
-                        $img_url = $geodir_uploadurl . '/' . $filename;
1613
-                    } else {
1614
-                        $img_path = $uploads_dir . '/temp_' . $current_user->data->ID . '/' . $filename;
1615
-                        $img_url = $uploads['url'] . '/temp_' . $current_user->data->ID . '/' . $filename;
1616
-                    }
1608
+					$new_name = $post_id . '_' . $field_id . '_' . $img_name_arr[0] . '.' . $img_name_arr[1];
1609
+					$explode_sub_dir = explode("/", $sub_dir);
1610
+					if ($curr_img_dir == end($explode_sub_dir)) {
1611
+						$img_path = $geodir_uploadpath . '/' . $filename;
1612
+						$img_url = $geodir_uploadurl . '/' . $filename;
1613
+					} else {
1614
+						$img_path = $uploads_dir . '/temp_' . $current_user->data->ID . '/' . $filename;
1615
+						$img_url = $uploads['url'] . '/temp_' . $current_user->data->ID . '/' . $filename;
1616
+					}
1617 1617
 
1618
-                    $uploaded_file = '';
1619
-                    if (file_exists($img_path))
1620
-                        $uploaded_file = copy($img_path, $geodir_uploadpath . '/' . $new_name);
1618
+					$uploaded_file = '';
1619
+					if (file_exists($img_path))
1620
+						$uploaded_file = copy($img_path, $geodir_uploadpath . '/' . $new_name);
1621 1621
 
1622
-                    if ($curr_img_dir != $geodir_uploaddir) {
1623
-                        if (file_exists($img_path))
1624
-                            unlink($img_path);
1625
-                    }
1622
+					if ($curr_img_dir != $geodir_uploaddir) {
1623
+						if (file_exists($img_path))
1624
+							unlink($img_path);
1625
+					}
1626 1626
 
1627
-                    if (!empty($uploaded_file))
1628
-                        $file_urls = $geodir_uploadurl . '/' . $new_name;
1627
+					if (!empty($uploaded_file))
1628
+						$file_urls = $geodir_uploadurl . '/' . $new_name;
1629 1629
 
1630
-                } else {
1631
-                    $file_urls = $post_image[$m];
1632
-                }
1633
-            }
1630
+				} else {
1631
+					$file_urls = $post_image[$m];
1632
+				}
1633
+			}
1634 1634
 
1635 1635
 
1636
-        }
1636
+		}
1637 1637
 
1638
-        //Remove all old attachments and temp images
1639
-        if (!empty($postcurr_images)) {
1638
+		//Remove all old attachments and temp images
1639
+		if (!empty($postcurr_images)) {
1640 1640
 
1641
-            if ($file_urls != $postcurr_images) {
1642
-                $invalid_files[] = (object)array('src' => $postcurr_images);
1643
-                $invalid_files = (object)$invalid_files;
1644
-            }
1645
-        }
1641
+			if ($file_urls != $postcurr_images) {
1642
+				$invalid_files[] = (object)array('src' => $postcurr_images);
1643
+				$invalid_files = (object)$invalid_files;
1644
+			}
1645
+		}
1646 1646
 
1647
-        geodir_save_post_meta($post_id, $field_id, $file_urls);
1647
+		geodir_save_post_meta($post_id, $field_id, $file_urls);
1648 1648
 
1649
-        if (!empty($invalid_files))
1650
-            geodir_remove_attachments($invalid_files);
1649
+		if (!empty($invalid_files))
1650
+			geodir_remove_attachments($invalid_files);
1651 1651
 
1652
-    }
1652
+	}
1653 1653
 }
1654 1654
 
1655 1655
 
@@ -1664,76 +1664,76 @@  discard block
 block discarded – undo
1664 1664
  */
1665 1665
 function geodir_custom_upload_mimes($existing_mimes = array())
1666 1666
 {
1667
-    $existing_mimes['wif'] = 'text/plain';
1668
-    $existing_mimes['jpg|jpeg'] = 'image/jpeg';
1669
-    $existing_mimes['gif'] = 'image/gif';
1670
-    $existing_mimes['png'] = 'image/png';
1671
-    $existing_mimes['pdf'] = 'application/pdf';
1672
-    $existing_mimes['txt'] = 'text/text';
1673
-    $existing_mimes['csv'] = 'application/octet-stream';
1674
-    $existing_mimes['doc'] = 'application/msword';
1675
-    $existing_mimes['xla|xls|xlt|xlw'] = 'application/vnd.ms-excel';
1676
-    $existing_mimes['docx'] = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
1677
-    $existing_mimes['xlsx'] = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
1678
-    return $existing_mimes;
1667
+	$existing_mimes['wif'] = 'text/plain';
1668
+	$existing_mimes['jpg|jpeg'] = 'image/jpeg';
1669
+	$existing_mimes['gif'] = 'image/gif';
1670
+	$existing_mimes['png'] = 'image/png';
1671
+	$existing_mimes['pdf'] = 'application/pdf';
1672
+	$existing_mimes['txt'] = 'text/text';
1673
+	$existing_mimes['csv'] = 'application/octet-stream';
1674
+	$existing_mimes['doc'] = 'application/msword';
1675
+	$existing_mimes['xla|xls|xlt|xlw'] = 'application/vnd.ms-excel';
1676
+	$existing_mimes['docx'] = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
1677
+	$existing_mimes['xlsx'] = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
1678
+	return $existing_mimes;
1679 1679
 }
1680 1680
 
1681 1681
 if (!function_exists('geodir_plupload_action')) {
1682 1682
 
1683
-    /**
1684
-     * Get upload directory path details
1685
-     *
1686
-     * @since 1.0.0
1687
-     * @package GeoDirectory
1688
-     * @global object $current_user Current user object.
1689
-     * @param array $upload Array of upload directory data with keys of 'path','url', 'subdir, 'basedir', and 'error'.
1690
-     * @return mixed Returns upload directory details as an array.
1691
-     */
1692
-    function geodir_upload_dir($upload)
1693
-    {
1694
-        global $current_user;
1695
-        $upload['subdir'] = $upload['subdir'] . '/temp_' . $current_user->data->ID;
1696
-        $upload['path'] = $upload['basedir'] . $upload['subdir'];
1697
-        $upload['url'] = $upload['baseurl'] . $upload['subdir'];
1698
-        return $upload;
1699
-    }
1700
-
1701
-    /**
1702
-     * Handles place file and image upload.
1703
-     *
1704
-     * @since 1.0.0
1705
-     * @package GeoDirectory
1706
-     */
1707
-    function geodir_plupload_action()
1708
-    {
1709
-        // check ajax noonce
1710
-        $imgid = $_POST["imgid"];
1711
-
1712
-        check_ajax_referer($imgid . 'pluploadan');
1713
-
1714
-        // handle custom file uploaddir
1715
-        add_filter('upload_dir', 'geodir_upload_dir');
1716
-
1717
-        // change file orinetation if needed
1718
-        $fixed_file = geodir_exif($_FILES[$imgid . 'async-upload']);
1719
-
1720
-        // handle file upload
1721
-        $status = wp_handle_upload($fixed_file, array('test_form' => true, 'action' => 'plupload_action'));
1722
-        // remove handle custom file uploaddir
1723
-        remove_filter('upload_dir', 'geodir_upload_dir');
1724
-
1725
-        if(!isset($status['url']) && isset($status['error'])){
1726
-            print_r($status);
1727
-        }
1728
-
1729
-        // send the uploaded file url in response
1730
-        if (isset($status['url'])) {
1731
-            echo $status['url'];
1732
-        } else {
1733
-            echo 'x';
1734
-        }
1735
-        exit;
1736
-    }
1683
+	/**
1684
+	 * Get upload directory path details
1685
+	 *
1686
+	 * @since 1.0.0
1687
+	 * @package GeoDirectory
1688
+	 * @global object $current_user Current user object.
1689
+	 * @param array $upload Array of upload directory data with keys of 'path','url', 'subdir, 'basedir', and 'error'.
1690
+	 * @return mixed Returns upload directory details as an array.
1691
+	 */
1692
+	function geodir_upload_dir($upload)
1693
+	{
1694
+		global $current_user;
1695
+		$upload['subdir'] = $upload['subdir'] . '/temp_' . $current_user->data->ID;
1696
+		$upload['path'] = $upload['basedir'] . $upload['subdir'];
1697
+		$upload['url'] = $upload['baseurl'] . $upload['subdir'];
1698
+		return $upload;
1699
+	}
1700
+
1701
+	/**
1702
+	 * Handles place file and image upload.
1703
+	 *
1704
+	 * @since 1.0.0
1705
+	 * @package GeoDirectory
1706
+	 */
1707
+	function geodir_plupload_action()
1708
+	{
1709
+		// check ajax noonce
1710
+		$imgid = $_POST["imgid"];
1711
+
1712
+		check_ajax_referer($imgid . 'pluploadan');
1713
+
1714
+		// handle custom file uploaddir
1715
+		add_filter('upload_dir', 'geodir_upload_dir');
1716
+
1717
+		// change file orinetation if needed
1718
+		$fixed_file = geodir_exif($_FILES[$imgid . 'async-upload']);
1719
+
1720
+		// handle file upload
1721
+		$status = wp_handle_upload($fixed_file, array('test_form' => true, 'action' => 'plupload_action'));
1722
+		// remove handle custom file uploaddir
1723
+		remove_filter('upload_dir', 'geodir_upload_dir');
1724
+
1725
+		if(!isset($status['url']) && isset($status['error'])){
1726
+			print_r($status);
1727
+		}
1728
+
1729
+		// send the uploaded file url in response
1730
+		if (isset($status['url'])) {
1731
+			echo $status['url'];
1732
+		} else {
1733
+			echo 'x';
1734
+		}
1735
+		exit;
1736
+	}
1737 1737
 }
1738 1738
 
1739 1739
 /**
@@ -1748,17 +1748,17 @@  discard block
 block discarded – undo
1748 1748
  */
1749 1749
 function geodir_get_video($post_id)
1750 1750
 {
1751
-    global $wpdb, $plugin_prefix;
1751
+	global $wpdb, $plugin_prefix;
1752 1752
 
1753
-    $post_type = get_post_type($post_id);
1753
+	$post_type = get_post_type($post_id);
1754 1754
 
1755
-    $table = $plugin_prefix . $post_type . '_detail';
1755
+	$table = $plugin_prefix . $post_type . '_detail';
1756 1756
 
1757
-    $results = $wpdb->get_results($wpdb->prepare("SELECT geodir_video FROM " . $table . " WHERE post_id=%d", array($post_id)));
1757
+	$results = $wpdb->get_results($wpdb->prepare("SELECT geodir_video FROM " . $table . " WHERE post_id=%d", array($post_id)));
1758 1758
 
1759
-    if ($results) {
1760
-        return $results[0]->geodir_video;
1761
-    }
1759
+	if ($results) {
1760
+		return $results[0]->geodir_video;
1761
+	}
1762 1762
 
1763 1763
 }
1764 1764
 
@@ -1774,40 +1774,40 @@  discard block
 block discarded – undo
1774 1774
  */
1775 1775
 function geodir_get_special_offers($post_id)
1776 1776
 {
1777
-    global $wpdb, $plugin_prefix;
1777
+	global $wpdb, $plugin_prefix;
1778 1778
 
1779
-    $post_type = get_post_type($post_id);
1779
+	$post_type = get_post_type($post_id);
1780 1780
 
1781
-    $table = $plugin_prefix . $post_type . '_detail';
1781
+	$table = $plugin_prefix . $post_type . '_detail';
1782 1782
 
1783
-    $results = $wpdb->get_results($wpdb->prepare("SELECT geodir_special_offers FROM " . $table . " WHERE post_id=%d", array($post_id)));
1783
+	$results = $wpdb->get_results($wpdb->prepare("SELECT geodir_special_offers FROM " . $table . " WHERE post_id=%d", array($post_id)));
1784 1784
 
1785
-    if ($results) {
1786
-        return $results[0]->geodir_special_offers;
1787
-    }
1785
+	if ($results) {
1786
+		return $results[0]->geodir_special_offers;
1787
+	}
1788 1788
 
1789 1789
 }
1790 1790
 
1791 1791
 if (!function_exists('geodir_max_upload_size')) {
1792
-    /**
1793
-     * Get max upload file size
1794
-     *
1795
-     * @since 1.0.0
1796
-     * @package GeoDirectory
1797
-     * @return mixed|void Returns max upload file size.
1798
-     */
1799
-    function geodir_max_upload_size()
1800
-    {
1801
-        $max_filesize = (float)get_option('geodir_upload_max_filesize', 2);
1802
-
1803
-        if ($max_filesize > 0 && $max_filesize < 1) {
1804
-            $max_filesize = (int)($max_filesize * 1024) . 'kb';
1805
-        } else {
1806
-            $max_filesize = $max_filesize > 0 ? $max_filesize . 'mb' : '2mb';
1807
-        }
1808
-        /** Filter documented in geodirectory-functions/general_functions.php **/
1809
-        return apply_filters('geodir_default_image_upload_size_limit', $max_filesize);
1810
-    }
1792
+	/**
1793
+	 * Get max upload file size
1794
+	 *
1795
+	 * @since 1.0.0
1796
+	 * @package GeoDirectory
1797
+	 * @return mixed|void Returns max upload file size.
1798
+	 */
1799
+	function geodir_max_upload_size()
1800
+	{
1801
+		$max_filesize = (float)get_option('geodir_upload_max_filesize', 2);
1802
+
1803
+		if ($max_filesize > 0 && $max_filesize < 1) {
1804
+			$max_filesize = (int)($max_filesize * 1024) . 'kb';
1805
+		} else {
1806
+			$max_filesize = $max_filesize > 0 ? $max_filesize . 'mb' : '2mb';
1807
+		}
1808
+		/** Filter documented in geodirectory-functions/general_functions.php **/
1809
+		return apply_filters('geodir_default_image_upload_size_limit', $max_filesize);
1810
+	}
1811 1811
 }
1812 1812
 
1813 1813
 
@@ -1825,33 +1825,33 @@  discard block
 block discarded – undo
1825 1825
  */
1826 1826
 function geodir_add_custom_sort_options($fields, $post_type)
1827 1827
 {
1828
-    global $wpdb;
1828
+	global $wpdb;
1829 1829
 
1830
-    if ($post_type != '') {
1830
+	if ($post_type != '') {
1831 1831
 
1832
-        $all_postypes = geodir_get_posttypes();
1832
+		$all_postypes = geodir_get_posttypes();
1833 1833
 
1834
-        if (in_array($post_type, $all_postypes)) {
1834
+		if (in_array($post_type, $all_postypes)) {
1835 1835
 
1836
-            $custom_fields = $wpdb->get_results(
1837
-                $wpdb->prepare(
1838
-                    "select post_type,data_type,field_type,site_title,htmlvar_name,field_icon from " . GEODIR_CUSTOM_FIELDS_TABLE . " where post_type = %s and is_active='1' and cat_sort='1' AND field_type != 'address' order by sort_order asc",
1839
-                    array($post_type)
1840
-                ), 'ARRAY_A'
1841
-            );
1836
+			$custom_fields = $wpdb->get_results(
1837
+				$wpdb->prepare(
1838
+					"select post_type,data_type,field_type,site_title,htmlvar_name,field_icon from " . GEODIR_CUSTOM_FIELDS_TABLE . " where post_type = %s and is_active='1' and cat_sort='1' AND field_type != 'address' order by sort_order asc",
1839
+					array($post_type)
1840
+				), 'ARRAY_A'
1841
+			);
1842 1842
 
1843
-            if (!empty($custom_fields)) {
1843
+			if (!empty($custom_fields)) {
1844 1844
 
1845
-                foreach ($custom_fields as $val) {
1846
-                    $fields[] = $val;
1847
-                }
1848
-            }
1845
+				foreach ($custom_fields as $val) {
1846
+					$fields[] = $val;
1847
+				}
1848
+			}
1849 1849
 
1850
-        }
1850
+		}
1851 1851
 
1852
-    }
1852
+	}
1853 1853
 
1854
-    return $fields;
1854
+	return $fields;
1855 1855
 }
1856 1856
 
1857 1857
 
@@ -1867,76 +1867,76 @@  discard block
 block discarded – undo
1867 1867
 function geodir_get_custom_sort_options($post_type = '')
1868 1868
 {
1869 1869
 
1870
-    global $wpdb;
1871
-
1872
-    if ($post_type != '') {
1873
-
1874
-        $all_postypes = geodir_get_posttypes();
1875
-
1876
-        if (!in_array($post_type, $all_postypes))
1877
-            return false;
1878
-
1879
-        $fields = array();
1880
-
1881
-        $fields[] = array(
1882
-            'post_type' => $post_type,
1883
-            'data_type' => '',
1884
-            'field_type' => 'random',
1885
-            'site_title' => 'Random',
1886
-            'htmlvar_name' => 'post_title',
1887
-            'field_icon' =>  'fa fa-random',
1888
-            'description' =>  __('Random sort (not recommended for large sites)', 'geodirectory')
1889
-        );
1890
-
1891
-        $fields[] = array(
1892
-            'post_type' => $post_type,
1893
-            'data_type' => '',
1894
-            'field_type' => 'datetime',
1895
-            'site_title' => __('Add date', 'geodirectory'),
1896
-            'htmlvar_name' => 'post_date',
1897
-            'field_icon' =>  'fa fa-calendar',
1898
-            'description' =>  __('Sort by date added', 'geodirectory')
1899
-        );
1900
-        $fields[] = array(
1901
-            'post_type' => $post_type,
1902
-            'data_type' => '',
1903
-            'field_type' => 'bigint',
1904
-            'site_title' => __('Review', 'geodirectory'),
1905
-            'htmlvar_name' => 'comment_count',
1906
-            'field_icon' =>  'fa fa-commenting-o',
1907
-            'description' =>  __('Sort by the number of reviews', 'geodirectory')
1908
-        );
1909
-        $fields[] = array(
1910
-            'post_type' => $post_type,
1911
-            'data_type' => '',
1912
-            'field_type' => 'float',
1913
-            'site_title' => __('Rating', 'geodirectory'),
1914
-            'htmlvar_name' => 'overall_rating',
1915
-            'field_icon' =>  'fa fa-star-o',
1916
-            'description' =>  __('Sort by the overall rating value', 'geodirectory')
1917
-        );
1918
-        $fields[] = array(
1919
-            'post_type' => $post_type,
1920
-            'data_type' => '',
1921
-            'field_type' => 'text',
1922
-            'site_title' => __('Title', 'geodirectory'),
1923
-            'htmlvar_name' => 'post_title',
1924
-            'field_icon' =>  'fa fa-sort-alpha-desc',
1925
-            'description' =>  __('Sort alphabetically by title', 'geodirectory')
1926
-        );
1927
-
1928
-        /**
1929
-         * Hook to add custom sort options.
1930
-         *
1931
-         * @since 1.0.0
1932
-         * @param array $fields Unmodified sort options array.
1933
-         * @param string $post_type Post type.
1934
-         */
1935
-        return $fields = apply_filters('geodir_add_custom_sort_options', $fields, $post_type);
1936
-
1937
-    }
1938
-
1939
-    return false;
1870
+	global $wpdb;
1871
+
1872
+	if ($post_type != '') {
1873
+
1874
+		$all_postypes = geodir_get_posttypes();
1875
+
1876
+		if (!in_array($post_type, $all_postypes))
1877
+			return false;
1878
+
1879
+		$fields = array();
1880
+
1881
+		$fields[] = array(
1882
+			'post_type' => $post_type,
1883
+			'data_type' => '',
1884
+			'field_type' => 'random',
1885
+			'site_title' => 'Random',
1886
+			'htmlvar_name' => 'post_title',
1887
+			'field_icon' =>  'fa fa-random',
1888
+			'description' =>  __('Random sort (not recommended for large sites)', 'geodirectory')
1889
+		);
1890
+
1891
+		$fields[] = array(
1892
+			'post_type' => $post_type,
1893
+			'data_type' => '',
1894
+			'field_type' => 'datetime',
1895
+			'site_title' => __('Add date', 'geodirectory'),
1896
+			'htmlvar_name' => 'post_date',
1897
+			'field_icon' =>  'fa fa-calendar',
1898
+			'description' =>  __('Sort by date added', 'geodirectory')
1899
+		);
1900
+		$fields[] = array(
1901
+			'post_type' => $post_type,
1902
+			'data_type' => '',
1903
+			'field_type' => 'bigint',
1904
+			'site_title' => __('Review', 'geodirectory'),
1905
+			'htmlvar_name' => 'comment_count',
1906
+			'field_icon' =>  'fa fa-commenting-o',
1907
+			'description' =>  __('Sort by the number of reviews', 'geodirectory')
1908
+		);
1909
+		$fields[] = array(
1910
+			'post_type' => $post_type,
1911
+			'data_type' => '',
1912
+			'field_type' => 'float',
1913
+			'site_title' => __('Rating', 'geodirectory'),
1914
+			'htmlvar_name' => 'overall_rating',
1915
+			'field_icon' =>  'fa fa-star-o',
1916
+			'description' =>  __('Sort by the overall rating value', 'geodirectory')
1917
+		);
1918
+		$fields[] = array(
1919
+			'post_type' => $post_type,
1920
+			'data_type' => '',
1921
+			'field_type' => 'text',
1922
+			'site_title' => __('Title', 'geodirectory'),
1923
+			'htmlvar_name' => 'post_title',
1924
+			'field_icon' =>  'fa fa-sort-alpha-desc',
1925
+			'description' =>  __('Sort alphabetically by title', 'geodirectory')
1926
+		);
1927
+
1928
+		/**
1929
+		 * Hook to add custom sort options.
1930
+		 *
1931
+		 * @since 1.0.0
1932
+		 * @param array $fields Unmodified sort options array.
1933
+		 * @param string $post_type Post type.
1934
+		 */
1935
+		return $fields = apply_filters('geodir_add_custom_sort_options', $fields, $post_type);
1936
+
1937
+	}
1938
+
1939
+	return false;
1940 1940
 }
1941 1941
 
1942 1942
 
@@ -1952,117 +1952,117 @@  discard block
 block discarded – undo
1952 1952
 function godir_set_sort_field_order($field_ids = array())
1953 1953
 {
1954 1954
 
1955
-    global $wpdb;
1955
+	global $wpdb;
1956 1956
 
1957
-    $count = 0;
1958
-    if (!empty($field_ids)):
1959
-        foreach ($field_ids as $id) {
1957
+	$count = 0;
1958
+	if (!empty($field_ids)):
1959
+		foreach ($field_ids as $id) {
1960 1960
 
1961
-            $cf = trim($id, '_');
1961
+			$cf = trim($id, '_');
1962 1962
 
1963
-            $post_meta_info = $wpdb->query(
1964
-                $wpdb->prepare(
1965
-                    "update " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set 
1963
+			$post_meta_info = $wpdb->query(
1964
+				$wpdb->prepare(
1965
+					"update " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set 
1966 1966
 															sort_order=%d 
1967 1967
 															where id= %d",
1968
-                    array($count, $cf)
1969
-                )
1970
-            );
1971
-            $count++;
1972
-        }
1973
-
1974
-        return $field_ids;
1975
-    else:
1976
-        return false;
1977
-    endif;
1968
+					array($count, $cf)
1969
+				)
1970
+			);
1971
+			$count++;
1972
+		}
1973
+
1974
+		return $field_ids;
1975
+	else:
1976
+		return false;
1977
+	endif;
1978 1978
 }
1979 1979
 
1980 1980
 
1981 1981
 if (!function_exists('geodir_custom_sort_field_save')) {
1982
-    /**
1983
-     * Save or Update custom sort fields into the database.
1984
-     *
1985
-     * @since 1.0.0
1986
-     * @package GeoDirectory
1987
-     * @global object $wpdb WordPress Database object.
1988
-     * @global string $plugin_prefix Geodirectory plugin table prefix.
1989
-     * @param array $request_field {
1990
-     *    Attributes of the Request field.
1991
-     *
1992
-     *    @type string $action Ajax action name.
1993
-     *    @type string $manage_field_type Manage field type Default "sorting_options".
1994
-     *    @type string $create_field Do you want to create this field?.
1995
-     *    @type string $field_ins_upd Field created or updated?.
1996
-     *    @type string $_wpnonce Nonce value.
1997
-     *    @type string $listing_type The Post type.
1998
-     *    @type string $field_type Field Type.
1999
-     *    @type string $field_id Field ID.
2000
-     *    @type string $data_type Data Type.
2001
-     *    @type string $htmlvar_name HTML variable name.
2002
-     *    @type string $site_title Section title which you wish to display in frontend.
2003
-     *    @type string $is_default Is this default sorting?.
2004
-     *    @type string $is_active If not active then the field will not be displayed anywhere.
2005
-     *    @type string $sort_order Sort Order.
2006
-     *
2007
-     * }
2008
-     * @param bool $default Not yet implemented.
2009
-     * @return int Returns the last affected db table row id.
2010
-     */
2011
-    function geodir_custom_sort_field_save($request_field = array(), $default = false)
2012
-    {
2013
-
2014
-        global $wpdb, $plugin_prefix;
2015
-
2016
-        $result_str = isset($request_field['field_id']) ? trim($request_field['field_id']) : '';
2017
-
2018
-        $cf = trim($result_str, '_');
2019
-
2020
-        /*-------- check dublicate validation --------*/
2021
-
2022
-        $field_type = isset($request_field['field_type']) ? $request_field['field_type'] : '';
2023
-        $cehhtmlvar_name = isset($request_field['htmlvar_name']) ? $request_field['htmlvar_name'] : '';
2024
-
2025
-        $post_type = $request_field['listing_type'];
2026
-        $data_type = isset($request_field['data_type']) ? $request_field['data_type'] : '';
2027
-        $field_type = isset($request_field['field_type']) ? $request_field['field_type'] : '';
2028
-        $site_title = isset($request_field['site_title']) ? $request_field['site_title'] : '';
2029
-        $htmlvar_name = isset($request_field['htmlvar_name']) ? $request_field['htmlvar_name'] : '';
2030
-        $sort_order = isset($request_field['sort_order']) ? $request_field['sort_order'] : 0;
2031
-        $is_active = isset($request_field['is_active']) ? $request_field['is_active'] : 0;
2032
-        $is_default = isset($request_field['is_default']) ? $request_field['is_default'] : '';
2033
-        $asc = isset($request_field['asc']) ? $request_field['asc'] : 0;
2034
-        $desc = isset($request_field['desc']) ? $request_field['desc'] : 0;
2035
-        $asc_title = isset($request_field['asc_title']) ? $request_field['asc_title'] : '';
2036
-        $desc_title = isset($request_field['desc_title']) ? $request_field['desc_title'] : '';
2037
-
2038
-        $default_order = '';
2039
-        if ($is_default != '') {
2040
-            $default_order = $is_default;
2041
-            $is_default = '1';
2042
-        }
2043
-
2044
-
2045
-        $check_html_variable = $wpdb->get_var(
2046
-            $wpdb->prepare(
2047
-                "select htmlvar_name from " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s and field_type=%s ",
2048
-                array($cehhtmlvar_name, $post_type, $field_type)
2049
-            )
2050
-        );
2051
-
2052
-        if ($is_default == 1) {
2053
-
2054
-            $wpdb->query($wpdb->prepare("update " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set is_default='0', default_order='' where post_type = %s", array($post_type)));
2055
-
2056
-        }
2057
-
2058
-
2059
-        if (!$check_html_variable) {
2060
-
2061
-            $wpdb->query(
2062
-
2063
-                $wpdb->prepare(
2064
-
2065
-                    "insert into " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set 
1982
+	/**
1983
+	 * Save or Update custom sort fields into the database.
1984
+	 *
1985
+	 * @since 1.0.0
1986
+	 * @package GeoDirectory
1987
+	 * @global object $wpdb WordPress Database object.
1988
+	 * @global string $plugin_prefix Geodirectory plugin table prefix.
1989
+	 * @param array $request_field {
1990
+	 *    Attributes of the Request field.
1991
+	 *
1992
+	 *    @type string $action Ajax action name.
1993
+	 *    @type string $manage_field_type Manage field type Default "sorting_options".
1994
+	 *    @type string $create_field Do you want to create this field?.
1995
+	 *    @type string $field_ins_upd Field created or updated?.
1996
+	 *    @type string $_wpnonce Nonce value.
1997
+	 *    @type string $listing_type The Post type.
1998
+	 *    @type string $field_type Field Type.
1999
+	 *    @type string $field_id Field ID.
2000
+	 *    @type string $data_type Data Type.
2001
+	 *    @type string $htmlvar_name HTML variable name.
2002
+	 *    @type string $site_title Section title which you wish to display in frontend.
2003
+	 *    @type string $is_default Is this default sorting?.
2004
+	 *    @type string $is_active If not active then the field will not be displayed anywhere.
2005
+	 *    @type string $sort_order Sort Order.
2006
+	 *
2007
+	 * }
2008
+	 * @param bool $default Not yet implemented.
2009
+	 * @return int Returns the last affected db table row id.
2010
+	 */
2011
+	function geodir_custom_sort_field_save($request_field = array(), $default = false)
2012
+	{
2013
+
2014
+		global $wpdb, $plugin_prefix;
2015
+
2016
+		$result_str = isset($request_field['field_id']) ? trim($request_field['field_id']) : '';
2017
+
2018
+		$cf = trim($result_str, '_');
2019
+
2020
+		/*-------- check dublicate validation --------*/
2021
+
2022
+		$field_type = isset($request_field['field_type']) ? $request_field['field_type'] : '';
2023
+		$cehhtmlvar_name = isset($request_field['htmlvar_name']) ? $request_field['htmlvar_name'] : '';
2024
+
2025
+		$post_type = $request_field['listing_type'];
2026
+		$data_type = isset($request_field['data_type']) ? $request_field['data_type'] : '';
2027
+		$field_type = isset($request_field['field_type']) ? $request_field['field_type'] : '';
2028
+		$site_title = isset($request_field['site_title']) ? $request_field['site_title'] : '';
2029
+		$htmlvar_name = isset($request_field['htmlvar_name']) ? $request_field['htmlvar_name'] : '';
2030
+		$sort_order = isset($request_field['sort_order']) ? $request_field['sort_order'] : 0;
2031
+		$is_active = isset($request_field['is_active']) ? $request_field['is_active'] : 0;
2032
+		$is_default = isset($request_field['is_default']) ? $request_field['is_default'] : '';
2033
+		$asc = isset($request_field['asc']) ? $request_field['asc'] : 0;
2034
+		$desc = isset($request_field['desc']) ? $request_field['desc'] : 0;
2035
+		$asc_title = isset($request_field['asc_title']) ? $request_field['asc_title'] : '';
2036
+		$desc_title = isset($request_field['desc_title']) ? $request_field['desc_title'] : '';
2037
+
2038
+		$default_order = '';
2039
+		if ($is_default != '') {
2040
+			$default_order = $is_default;
2041
+			$is_default = '1';
2042
+		}
2043
+
2044
+
2045
+		$check_html_variable = $wpdb->get_var(
2046
+			$wpdb->prepare(
2047
+				"select htmlvar_name from " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s and field_type=%s ",
2048
+				array($cehhtmlvar_name, $post_type, $field_type)
2049
+			)
2050
+		);
2051
+
2052
+		if ($is_default == 1) {
2053
+
2054
+			$wpdb->query($wpdb->prepare("update " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set is_default='0', default_order='' where post_type = %s", array($post_type)));
2055
+
2056
+		}
2057
+
2058
+
2059
+		if (!$check_html_variable) {
2060
+
2061
+			$wpdb->query(
2062
+
2063
+				$wpdb->prepare(
2064
+
2065
+					"insert into " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set 
2066 2066
 				post_type = %s,
2067 2067
 				data_type = %s,
2068 2068
 				field_type = %s,
@@ -2077,23 +2077,23 @@  discard block
 block discarded – undo
2077 2077
 				asc_title = %s,
2078 2078
 				desc_title = %s",
2079 2079
 
2080
-                    array($post_type, $data_type, $field_type, $site_title, $htmlvar_name, $sort_order, $is_active, $is_default, $default_order, $asc, $desc, $asc_title, $desc_title)
2081
-                )
2080
+					array($post_type, $data_type, $field_type, $site_title, $htmlvar_name, $sort_order, $is_active, $is_default, $default_order, $asc, $desc, $asc_title, $desc_title)
2081
+				)
2082 2082
 
2083
-            );
2083
+			);
2084 2084
 
2085 2085
 
2086
-            $lastid = $wpdb->insert_id;
2086
+			$lastid = $wpdb->insert_id;
2087 2087
 
2088
-            $lastid = trim($lastid);
2088
+			$lastid = trim($lastid);
2089 2089
 
2090
-        } else {
2090
+		} else {
2091 2091
 
2092
-            $wpdb->query(
2092
+			$wpdb->query(
2093 2093
 
2094
-                $wpdb->prepare(
2094
+				$wpdb->prepare(
2095 2095
 
2096
-                    "update " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set 
2096
+					"update " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set 
2097 2097
 				post_type = %s,
2098 2098
 				data_type = %s,
2099 2099
 				field_type = %s,
@@ -2109,123 +2109,123 @@  discard block
 block discarded – undo
2109 2109
 				desc_title = %s
2110 2110
 				where id = %d",
2111 2111
 
2112
-                    array($post_type, $data_type, $field_type, $site_title, $htmlvar_name, $sort_order, $is_active, $is_default, $default_order, $asc, $desc, $asc_title, $desc_title, $cf)
2113
-                )
2112
+					array($post_type, $data_type, $field_type, $site_title, $htmlvar_name, $sort_order, $is_active, $is_default, $default_order, $asc, $desc, $asc_title, $desc_title, $cf)
2113
+				)
2114 2114
 
2115
-            );
2115
+			);
2116 2116
 
2117
-            $lastid = trim($cf);
2117
+			$lastid = trim($cf);
2118 2118
 
2119
-        }
2119
+		}
2120 2120
 
2121 2121
 
2122
-        return (int)$lastid;
2122
+		return (int)$lastid;
2123 2123
 
2124
-    }
2124
+	}
2125 2125
 }
2126 2126
 
2127 2127
 
2128 2128
 if (!function_exists('geodir_custom_sort_field_delete')) {
2129
-    /**
2130
-     * Delete a custom sort field using field id.
2131
-     * @since 1.0.0
2132
-     * @package GeoDirectory
2133
-     * @global object $wpdb WordPress Database object.
2134
-     * @global string $plugin_prefix Geodirectory plugin table prefix.
2135
-     * @param string $field_id The field ID.
2136
-     * @return int|string Returns field id when successful deletion, else returns 0.
2137
-     */
2138
-    function geodir_custom_sort_field_delete($field_id = '')
2139
-    {
2140
-
2141
-        global $wpdb, $plugin_prefix;
2142
-        if ($field_id != '') {
2143
-            $cf = trim($field_id, '_');
2144
-
2145
-            $wpdb->query($wpdb->prepare("delete from " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " where id= %d ", array($cf)));
2146
-
2147
-            return $field_id;
2148
-
2149
-        } else
2150
-            return 0;
2151
-
2152
-    }
2129
+	/**
2130
+	 * Delete a custom sort field using field id.
2131
+	 * @since 1.0.0
2132
+	 * @package GeoDirectory
2133
+	 * @global object $wpdb WordPress Database object.
2134
+	 * @global string $plugin_prefix Geodirectory plugin table prefix.
2135
+	 * @param string $field_id The field ID.
2136
+	 * @return int|string Returns field id when successful deletion, else returns 0.
2137
+	 */
2138
+	function geodir_custom_sort_field_delete($field_id = '')
2139
+	{
2140
+
2141
+		global $wpdb, $plugin_prefix;
2142
+		if ($field_id != '') {
2143
+			$cf = trim($field_id, '_');
2144
+
2145
+			$wpdb->query($wpdb->prepare("delete from " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " where id= %d ", array($cf)));
2146
+
2147
+			return $field_id;
2148
+
2149
+		} else
2150
+			return 0;
2151
+
2152
+	}
2153 2153
 }
2154 2154
 
2155 2155
 
2156 2156
 if (!function_exists('geodir_custom_sort_field_adminhtml')) {
2157
-    /**
2158
-     * Custom sort field admin html.
2159
-     *
2160
-     * @since 1.0.0
2161
-     * @package GeoDirectory
2162
-     * @global object $wpdb WordPress Database object.
2163
-     * @param string $field_type The form field type.
2164
-     * @param object|int $result_str The custom field results object or row id.
2165
-     * @param string $field_ins_upd When set to "submit" displays form.
2166
-     * @param bool $default when set to true field will be for admin use only.
2167
-     */
2168
-    function geodir_custom_sort_field_adminhtml($field_type, $result_str, $field_ins_upd = '', $field_type_key='')
2169
-    {
2170
-        global $wpdb;
2171
-        $cf = $result_str;
2172
-        if (!is_object($cf)) {
2173
-            $field_info = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " WHERE id = %d", array($cf)));
2174
-        } else {
2175
-            $field_info = $cf;
2176
-            $result_str = $cf->id;
2177
-        }
2178
-
2179
-        $field_info = stripslashes_deep($field_info); // strip slashes
2180
-
2181
-        if (!isset($field_info->post_type)) {
2182
-            $post_type = sanitize_text_field($_REQUEST['listing_type']);
2183
-        } else {
2184
-            $post_type = $field_info->post_type;
2185
-        }
2186
-
2187
-
2188
-        $htmlvar_name = isset($field_type_key) ? $field_type_key : '';
2189
-
2190
-        $site_title = '';
2191
-        if ($site_title == '')
2192
-            $site_title = isset($field_info->site_title) ? $field_info->site_title : '';
2193
-
2194
-        if ($site_title == '') {
2195
-            $fields = geodir_get_custom_sort_options($post_type);
2196
-
2197
-            foreach ($fields as $val) {
2198
-                $val = stripslashes_deep($val); // strip slashes
2199
-
2200
-                if ($val['field_type'] == $field_type && $val['htmlvar_name'] == $htmlvar_name) {
2201
-                    $site_title = isset($val['site_title']) ? $val['site_title'] : '';
2202
-                }
2203
-            }
2204
-        }
2205
-
2206
-        if ($htmlvar_name == '')
2207
-            $htmlvar_name = isset($field_info->htmlvar_name) ? $field_info->htmlvar_name : '';
2208
-
2209
-        $nonce = wp_create_nonce('custom_fields_' . $result_str);
2210
-
2211
-        $field_icon = '<i class="fa fa-cog" aria-hidden="true"></i>';
2212
-        $cso_arr = geodir_get_custom_sort_options($post_type);
2213
-
2214
-        $cur_field_type = (isset($cf->field_type)) ? $cf->field_type : esc_html($_REQUEST['field_type']);
2215
-        foreach($cso_arr as $cso){
2216
-            if($cur_field_type==$cso['field_type']){
2217
-
2218
-                if (isset($cso['field_icon']) && strpos($cso['field_icon'], 'fa fa-') !== false) {
2219
-                    $field_icon = '<i class="'.$cso['field_icon'].'" aria-hidden="true"></i>';
2220
-                }elseif(isset($cso['field_icon']) && $cso['field_icon']){
2221
-                    $field_icon = '<b style="background-image: url("'.$cso['field_icon'].'")"></b>';
2222
-                }
2223
-
2224
-            }
2225
-        }
2226
-
2227
-        $radio_id = (isset($field_info->htmlvar_name)) ? $field_info->htmlvar_name.$field_type : rand(5, 500);
2228
-        ?>
2157
+	/**
2158
+	 * Custom sort field admin html.
2159
+	 *
2160
+	 * @since 1.0.0
2161
+	 * @package GeoDirectory
2162
+	 * @global object $wpdb WordPress Database object.
2163
+	 * @param string $field_type The form field type.
2164
+	 * @param object|int $result_str The custom field results object or row id.
2165
+	 * @param string $field_ins_upd When set to "submit" displays form.
2166
+	 * @param bool $default when set to true field will be for admin use only.
2167
+	 */
2168
+	function geodir_custom_sort_field_adminhtml($field_type, $result_str, $field_ins_upd = '', $field_type_key='')
2169
+	{
2170
+		global $wpdb;
2171
+		$cf = $result_str;
2172
+		if (!is_object($cf)) {
2173
+			$field_info = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " WHERE id = %d", array($cf)));
2174
+		} else {
2175
+			$field_info = $cf;
2176
+			$result_str = $cf->id;
2177
+		}
2178
+
2179
+		$field_info = stripslashes_deep($field_info); // strip slashes
2180
+
2181
+		if (!isset($field_info->post_type)) {
2182
+			$post_type = sanitize_text_field($_REQUEST['listing_type']);
2183
+		} else {
2184
+			$post_type = $field_info->post_type;
2185
+		}
2186
+
2187
+
2188
+		$htmlvar_name = isset($field_type_key) ? $field_type_key : '';
2189
+
2190
+		$site_title = '';
2191
+		if ($site_title == '')
2192
+			$site_title = isset($field_info->site_title) ? $field_info->site_title : '';
2193
+
2194
+		if ($site_title == '') {
2195
+			$fields = geodir_get_custom_sort_options($post_type);
2196
+
2197
+			foreach ($fields as $val) {
2198
+				$val = stripslashes_deep($val); // strip slashes
2199
+
2200
+				if ($val['field_type'] == $field_type && $val['htmlvar_name'] == $htmlvar_name) {
2201
+					$site_title = isset($val['site_title']) ? $val['site_title'] : '';
2202
+				}
2203
+			}
2204
+		}
2205
+
2206
+		if ($htmlvar_name == '')
2207
+			$htmlvar_name = isset($field_info->htmlvar_name) ? $field_info->htmlvar_name : '';
2208
+
2209
+		$nonce = wp_create_nonce('custom_fields_' . $result_str);
2210
+
2211
+		$field_icon = '<i class="fa fa-cog" aria-hidden="true"></i>';
2212
+		$cso_arr = geodir_get_custom_sort_options($post_type);
2213
+
2214
+		$cur_field_type = (isset($cf->field_type)) ? $cf->field_type : esc_html($_REQUEST['field_type']);
2215
+		foreach($cso_arr as $cso){
2216
+			if($cur_field_type==$cso['field_type']){
2217
+
2218
+				if (isset($cso['field_icon']) && strpos($cso['field_icon'], 'fa fa-') !== false) {
2219
+					$field_icon = '<i class="'.$cso['field_icon'].'" aria-hidden="true"></i>';
2220
+				}elseif(isset($cso['field_icon']) && $cso['field_icon']){
2221
+					$field_icon = '<b style="background-image: url("'.$cso['field_icon'].'")"></b>';
2222
+				}
2223
+
2224
+			}
2225
+		}
2226
+
2227
+		$radio_id = (isset($field_info->htmlvar_name)) ? $field_info->htmlvar_name.$field_type : rand(5, 500);
2228
+		?>
2229 2229
 
2230 2230
         <li class="text" id="licontainer_<?php echo $result_str;?>">
2231 2231
             <form><!-- we need to wrap in a fom so we can use radio buttons with same name -->
@@ -2234,7 +2234,7 @@  discard block
 block discarded – undo
2234 2234
                  ondblclick="show_hide('field_frm<?php echo $result_str;?>')">
2235 2235
                 <?php
2236 2236
 
2237
-                ?>
2237
+				?>
2238 2238
 
2239 2239
                 <div title="<?php _e('Click to remove field', 'geodirectory');?>"
2240 2240
                      onclick="delete_sort_field('<?php echo $result_str;?>', '<?php echo $nonce;?>', this)"
@@ -2249,17 +2249,17 @@  discard block
 block discarded – undo
2249 2249
 
2250 2250
             <div id="field_frm<?php echo $result_str;?>" class="field_frm"
2251 2251
                  style="display:<?php if ($field_ins_upd == 'submit') {
2252
-                     echo 'block;';
2253
-                 } else {
2254
-                     echo 'none;';
2255
-                 } ?>">
2252
+					 echo 'block;';
2253
+				 } else {
2254
+					 echo 'none;';
2255
+				 } ?>">
2256 2256
                 <input type="hidden" name="_wpnonce" value="<?php echo $nonce; ?>"/>
2257 2257
                 <input type="hidden" name="listing_type" id="listing_type" value="<?php echo $post_type;?>"/>
2258 2258
                 <input type="hidden" name="field_type" id="field_type" value="<?php echo $field_type;?>"/>
2259 2259
                 <input type="hidden" name="field_id" id="field_id" value="<?php echo $result_str;?>"/>
2260 2260
                 <input type="hidden" name="data_type" id="data_type" value="<?php if (isset($field_info->data_type)) {
2261
-                    echo $field_info->data_type;
2262
-                }?>"/>
2261
+					echo $field_info->data_type;
2262
+				}?>"/>
2263 2263
                 <input type="hidden" name="htmlvar_name" id="htmlvar_name" value="<?php echo $htmlvar_name;?>"/>
2264 2264
 
2265 2265
 
@@ -2282,14 +2282,14 @@  discard block
 block discarded – undo
2282 2282
 
2283 2283
                                 <input type="radio" id="asc_yes<?php echo $radio_id;?>" name="asc" class="gdri-enabled"  value="1"
2284 2284
                                     <?php if ($value == '1') {
2285
-                                        echo 'checked';
2286
-                                    } ?>/>
2285
+										echo 'checked';
2286
+									} ?>/>
2287 2287
                                 <label onclick="show_hide_radio(this,'show','cfs-asc-title');" for="asc_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
2288 2288
 
2289 2289
                                 <input type="radio" id="asc_no<?php echo $radio_id;?>" name="asc" class="gdri-disabled" value="0"
2290 2290
                                     <?php if ($value == '0' || !$value) {
2291
-                                        echo 'checked';
2292
-                                    } ?>/>
2291
+										echo 'checked';
2292
+									} ?>/>
2293 2293
                                 <label onclick="show_hide_radio(this,'hide','cfs-asc-title');" for="asc_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
2294 2294
 
2295 2295
                             </div>
@@ -2326,8 +2326,8 @@  discard block
 block discarded – undo
2326 2326
 
2327 2327
                                 <input type="radio" name="is_default"
2328 2328
                                        value="<?php echo $htmlvar_name; ?>_asc" <?php if (isset($field_info->default_order) && $field_info->default_order == $htmlvar_name . '_asc') {
2329
-                                    echo 'checked="checked"';
2330
-                                } ?>/>
2329
+									echo 'checked="checked"';
2330
+								} ?>/>
2331 2331
                             </div>
2332 2332
 
2333 2333
                         </li>
@@ -2347,14 +2347,14 @@  discard block
 block discarded – undo
2347 2347
 
2348 2348
                                 <input type="radio" id="desc_yes<?php echo $radio_id;?>" name="desc" class="gdri-enabled"  value="1"
2349 2349
                                     <?php if ($value == '1') {
2350
-                                        echo 'checked';
2351
-                                    } ?>/>
2350
+										echo 'checked';
2351
+									} ?>/>
2352 2352
                                 <label onclick="show_hide_radio(this,'show','cfs-desc-title');" for="desc_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
2353 2353
 
2354 2354
                                 <input type="radio" id="desc_no<?php echo $radio_id;?>" name="desc" class="gdri-disabled" value="0"
2355 2355
                                     <?php if ($value == '0' || !$value) {
2356
-                                        echo 'checked';
2357
-                                    } ?>/>
2356
+										echo 'checked';
2357
+									} ?>/>
2358 2358
                                 <label onclick="show_hide_radio(this,'hide','cfs-desc-title');" for="desc_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
2359 2359
 
2360 2360
                             </div>
@@ -2390,8 +2390,8 @@  discard block
 block discarded – undo
2390 2390
 
2391 2391
                                 <input type="radio" name="is_default"
2392 2392
                                        value="<?php echo $htmlvar_name; ?>_desc" <?php if (isset($field_info->default_order) && $field_info->default_order == $htmlvar_name . '_desc') {
2393
-                                    echo 'checked="checked"';
2394
-                                } ?>/>
2393
+									echo 'checked="checked"';
2394
+								} ?>/>
2395 2395
                             </div>
2396 2396
 
2397 2397
                         </li>
@@ -2433,8 +2433,8 @@  discard block
 block discarded – undo
2433 2433
 
2434 2434
                                 <input type="checkbox" name="is_default"
2435 2435
                                        value="<?php echo $field_type; ?>"  <?php if (isset($value) && $value == '1') {
2436
-                                    echo 'checked="checked"';
2437
-                                } ?>/>
2436
+									echo 'checked="checked"';
2437
+								} ?>/>
2438 2438
                             </div>
2439 2439
 
2440 2440
 
@@ -2457,14 +2457,14 @@  discard block
 block discarded – undo
2457 2457
 
2458 2458
                             <input type="radio" id="is_active_yes<?php echo $radio_id;?>" name="is_active" class="gdri-enabled"  value="1"
2459 2459
                                 <?php if ($value == '1') {
2460
-                                    echo 'checked';
2461
-                                } ?>/>
2460
+									echo 'checked';
2461
+								} ?>/>
2462 2462
                             <label for="is_active_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
2463 2463
 
2464 2464
                             <input type="radio" id="is_active_no<?php echo $radio_id;?>" name="is_active" class="gdri-disabled" value="0"
2465 2465
                                 <?php if ($value == '0' || !$value) {
2466
-                                    echo 'checked';
2467
-                                } ?>/>
2466
+									echo 'checked';
2467
+								} ?>/>
2468 2468
                             <label for="is_active_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
2469 2469
 
2470 2470
                         </div>
@@ -2474,8 +2474,8 @@  discard block
 block discarded – undo
2474 2474
 
2475 2475
                     <input type="hidden" readonly="readonly" name="sort_order" id="sort_order"
2476 2476
                                                 value="<?php if (isset($field_info->sort_order)) {
2477
-                                                    echo esc_attr($field_info->sort_order);
2478
-                                                }?>" size="50"/>
2477
+													echo esc_attr($field_info->sort_order);
2478
+												}?>" size="50"/>
2479 2479
 
2480 2480
 
2481 2481
 
@@ -2499,38 +2499,38 @@  discard block
 block discarded – undo
2499 2499
             </form>
2500 2500
         </li> <?php
2501 2501
 
2502
-    }
2502
+	}
2503 2503
 }
2504 2504
 
2505 2505
 if (!function_exists('check_field_visibility')) {
2506
-    /**
2507
-     * Check field visibility as per price package.
2508
-     *
2509
-     * @since 1.0.0
2510
-     * @package GeoDirectory
2511
-     * @global object $wpdb WordPress Database object.
2512
-     * @global array $geodir_addon_list List of active GeoDirectory extensions.
2513
-     * @param int|string $package_id The package ID.
2514
-     * @param string $field_name The field name.
2515
-     * @param string $post_type Optional. The wordpress post type.
2516
-     * @return bool Returns true when field visible, otherwise false.
2517
-     */
2518
-    function check_field_visibility($package_id, $field_name, $post_type)
2519
-    {
2520
-        global $wpdb, $geodir_addon_list;
2521
-        if (!(isset($geodir_addon_list['geodir_payment_manager']) && $geodir_addon_list['geodir_payment_manager'] == 'yes')) {
2522
-            return true;
2523
-        }
2524
-        if (!$package_id || !$field_name || !$post_type) {
2525
-            return true;
2526
-        }
2527
-        $sql = $wpdb->prepare("SELECT id FROM " . GEODIR_CUSTOM_FIELDS_TABLE . " WHERE is_active='1' AND htmlvar_name=%s AND post_type=%s AND FIND_IN_SET(%s, packages)", array($field_name, $post_type, (int)$package_id));
2528
-
2529
-        if ($wpdb->get_var($sql)) {
2530
-            return true;
2531
-        }
2532
-        return false;
2533
-    }
2506
+	/**
2507
+	 * Check field visibility as per price package.
2508
+	 *
2509
+	 * @since 1.0.0
2510
+	 * @package GeoDirectory
2511
+	 * @global object $wpdb WordPress Database object.
2512
+	 * @global array $geodir_addon_list List of active GeoDirectory extensions.
2513
+	 * @param int|string $package_id The package ID.
2514
+	 * @param string $field_name The field name.
2515
+	 * @param string $post_type Optional. The wordpress post type.
2516
+	 * @return bool Returns true when field visible, otherwise false.
2517
+	 */
2518
+	function check_field_visibility($package_id, $field_name, $post_type)
2519
+	{
2520
+		global $wpdb, $geodir_addon_list;
2521
+		if (!(isset($geodir_addon_list['geodir_payment_manager']) && $geodir_addon_list['geodir_payment_manager'] == 'yes')) {
2522
+			return true;
2523
+		}
2524
+		if (!$package_id || !$field_name || !$post_type) {
2525
+			return true;
2526
+		}
2527
+		$sql = $wpdb->prepare("SELECT id FROM " . GEODIR_CUSTOM_FIELDS_TABLE . " WHERE is_active='1' AND htmlvar_name=%s AND post_type=%s AND FIND_IN_SET(%s, packages)", array($field_name, $post_type, (int)$package_id));
2528
+
2529
+		if ($wpdb->get_var($sql)) {
2530
+			return true;
2531
+		}
2532
+		return false;
2533
+	}
2534 2534
 }
2535 2535
 
2536 2536
 /**
@@ -2545,43 +2545,43 @@  discard block
 block discarded – undo
2545 2545
  */
2546 2546
 function geodir_string_to_options($input = '', $translated = false)
2547 2547
 {
2548
-    $return = array();
2549
-    if ($input != '') {
2550
-        $input = trim($input);
2551
-        $input = rtrim($input, ",");
2552
-        $input = ltrim($input, ",");
2553
-        $input = trim($input);
2554
-    }
2555
-
2556
-    $input_arr = explode(',', $input);
2557
-
2558
-    if (!empty($input_arr)) {
2559
-        foreach ($input_arr as $input_str) {
2560
-            $input_str = trim($input_str);
2561
-
2562
-            if (strpos($input_str, "/") !== false) {
2563
-                $input_str = explode("/", $input_str, 2);
2564
-                $label = trim($input_str[0]);
2565
-                if ($translated && $label != '') {
2566
-                    $label = __($label, 'geodirectory');
2567
-                }
2568
-                $label = ucfirst($label);
2569
-                $value = trim($input_str[1]);
2570
-            } else {
2571
-                if ($translated && $input_str != '') {
2572
-                    $input_str = __($input_str, 'geodirectory');
2573
-                }
2574
-                $label = ucfirst($input_str);
2575
-                $value = $input_str;
2576
-            }
2577
-
2578
-            if ($label != '') {
2579
-                $return[] = array('label' => $label, 'value' => $value, 'optgroup' => NULL);
2580
-            }
2581
-        }
2582
-    }
2583
-
2584
-    return $return;
2548
+	$return = array();
2549
+	if ($input != '') {
2550
+		$input = trim($input);
2551
+		$input = rtrim($input, ",");
2552
+		$input = ltrim($input, ",");
2553
+		$input = trim($input);
2554
+	}
2555
+
2556
+	$input_arr = explode(',', $input);
2557
+
2558
+	if (!empty($input_arr)) {
2559
+		foreach ($input_arr as $input_str) {
2560
+			$input_str = trim($input_str);
2561
+
2562
+			if (strpos($input_str, "/") !== false) {
2563
+				$input_str = explode("/", $input_str, 2);
2564
+				$label = trim($input_str[0]);
2565
+				if ($translated && $label != '') {
2566
+					$label = __($label, 'geodirectory');
2567
+				}
2568
+				$label = ucfirst($label);
2569
+				$value = trim($input_str[1]);
2570
+			} else {
2571
+				if ($translated && $input_str != '') {
2572
+					$input_str = __($input_str, 'geodirectory');
2573
+				}
2574
+				$label = ucfirst($input_str);
2575
+				$value = $input_str;
2576
+			}
2577
+
2578
+			if ($label != '') {
2579
+				$return[] = array('label' => $label, 'value' => $value, 'optgroup' => NULL);
2580
+			}
2581
+		}
2582
+	}
2583
+
2584
+	return $return;
2585 2585
 }
2586 2586
 
2587 2587
 /**
@@ -2596,66 +2596,66 @@  discard block
 block discarded – undo
2596 2596
  */
2597 2597
 function geodir_string_values_to_options($option_values = '', $translated = false)
2598 2598
 {
2599
-    $options = array();
2600
-    if ($option_values == '') {
2601
-        return NULL;
2602
-    }
2603
-
2604
-    if (strpos($option_values, "{/optgroup}") !== false) {
2605
-        $option_values_arr = explode("{/optgroup}", $option_values);
2606
-
2607
-        foreach ($option_values_arr as $optgroup) {
2608
-            if (strpos($optgroup, "{optgroup}") !== false) {
2609
-                $optgroup_arr = explode("{optgroup}", $optgroup);
2610
-
2611
-                $count = 0;
2612
-                foreach ($optgroup_arr as $optgroup_str) {
2613
-                    $count++;
2614
-                    $optgroup_str = trim($optgroup_str);
2615
-
2616
-                    $optgroup_label = '';
2617
-                    if (strpos($optgroup_str, "|") !== false) {
2618
-                        $optgroup_str_arr = explode("|", $optgroup_str, 2);
2619
-                        $optgroup_label = trim($optgroup_str_arr[0]);
2620
-                        if ($translated && $optgroup_label != '') {
2621
-                            $optgroup_label = __($optgroup_label, 'geodirectory');
2622
-                        }
2623
-                        $optgroup_label = ucfirst($optgroup_label);
2624
-                        $optgroup_str = $optgroup_str_arr[1];
2625
-                    }
2626
-
2627
-                    $optgroup3 = geodir_string_to_options($optgroup_str, $translated);
2628
-
2629
-                    if ($count > 1 && $optgroup_label != '' && !empty($optgroup3)) {
2630
-                        $optgroup_start = array(array('label' => $optgroup_label, 'value' => NULL, 'optgroup' => 'start'));
2631
-                        $optgroup_end = array(array('label' => $optgroup_label, 'value' => NULL, 'optgroup' => 'end'));
2632
-                        $optgroup3 = array_merge($optgroup_start, $optgroup3, $optgroup_end);
2633
-                    }
2634
-                    $options = array_merge($options, $optgroup3);
2635
-                }
2636
-            } else {
2637
-                $optgroup1 = geodir_string_to_options($optgroup, $translated);
2638
-                $options = array_merge($options, $optgroup1);
2639
-            }
2640
-        }
2641
-    } else {
2642
-        $options = geodir_string_to_options($option_values, $translated);
2643
-    }
2644
-
2645
-    return $options;
2599
+	$options = array();
2600
+	if ($option_values == '') {
2601
+		return NULL;
2602
+	}
2603
+
2604
+	if (strpos($option_values, "{/optgroup}") !== false) {
2605
+		$option_values_arr = explode("{/optgroup}", $option_values);
2606
+
2607
+		foreach ($option_values_arr as $optgroup) {
2608
+			if (strpos($optgroup, "{optgroup}") !== false) {
2609
+				$optgroup_arr = explode("{optgroup}", $optgroup);
2610
+
2611
+				$count = 0;
2612
+				foreach ($optgroup_arr as $optgroup_str) {
2613
+					$count++;
2614
+					$optgroup_str = trim($optgroup_str);
2615
+
2616
+					$optgroup_label = '';
2617
+					if (strpos($optgroup_str, "|") !== false) {
2618
+						$optgroup_str_arr = explode("|", $optgroup_str, 2);
2619
+						$optgroup_label = trim($optgroup_str_arr[0]);
2620
+						if ($translated && $optgroup_label != '') {
2621
+							$optgroup_label = __($optgroup_label, 'geodirectory');
2622
+						}
2623
+						$optgroup_label = ucfirst($optgroup_label);
2624
+						$optgroup_str = $optgroup_str_arr[1];
2625
+					}
2626
+
2627
+					$optgroup3 = geodir_string_to_options($optgroup_str, $translated);
2628
+
2629
+					if ($count > 1 && $optgroup_label != '' && !empty($optgroup3)) {
2630
+						$optgroup_start = array(array('label' => $optgroup_label, 'value' => NULL, 'optgroup' => 'start'));
2631
+						$optgroup_end = array(array('label' => $optgroup_label, 'value' => NULL, 'optgroup' => 'end'));
2632
+						$optgroup3 = array_merge($optgroup_start, $optgroup3, $optgroup_end);
2633
+					}
2634
+					$options = array_merge($options, $optgroup3);
2635
+				}
2636
+			} else {
2637
+				$optgroup1 = geodir_string_to_options($optgroup, $translated);
2638
+				$options = array_merge($options, $optgroup1);
2639
+			}
2640
+		}
2641
+	} else {
2642
+		$options = geodir_string_to_options($option_values, $translated);
2643
+	}
2644
+
2645
+	return $options;
2646 2646
 }
2647 2647
 
2648 2648
 
2649 2649
 function geodir_cfa_data_type_text($output,$result_str,$cf,$field_info){
2650
-    ob_start();
2651
-
2652
-    $dt_value = '';
2653
-    if (isset($field_info->data_type)) {
2654
-        $dt_value  = esc_attr($field_info->data_type);
2655
-    }elseif(isset($cf['defaults']['data_type']) && $cf['defaults']['data_type']){
2656
-        $dt_value  = $cf['defaults']['data_type'];
2657
-    }
2658
-    ?>
2650
+	ob_start();
2651
+
2652
+	$dt_value = '';
2653
+	if (isset($field_info->data_type)) {
2654
+		$dt_value  = esc_attr($field_info->data_type);
2655
+	}elseif(isset($cf['defaults']['data_type']) && $cf['defaults']['data_type']){
2656
+		$dt_value  = $cf['defaults']['data_type'];
2657
+	}
2658
+	?>
2659 2659
     <li>
2660 2660
         <label for="data_type"><?php _e('Field Data Type ? :', 'geodirectory'); ?></label>
2661 2661
         <div class="gd-cf-input-wrap">
@@ -2664,16 +2664,16 @@  discard block
 block discarded – undo
2664 2664
                     onchange="javascript:gd_data_type_changed(this, '<?php echo $result_str; ?>');">
2665 2665
                 <option
2666 2666
                     value="XVARCHAR" <?php if ($dt_value  == 'VARCHAR') {
2667
-                    echo 'selected="selected"';
2668
-                } ?>><?php _e('CHARACTER', 'geodirectory'); ?></option>
2667
+					echo 'selected="selected"';
2668
+				} ?>><?php _e('CHARACTER', 'geodirectory'); ?></option>
2669 2669
                 <option
2670 2670
                     value="INT" <?php if ($dt_value   == 'INT') {
2671
-                    echo 'selected="selected"';
2672
-                } ?>><?php _e('NUMBER', 'geodirectory'); ?></option>
2671
+					echo 'selected="selected"';
2672
+				} ?>><?php _e('NUMBER', 'geodirectory'); ?></option>
2673 2673
                 <option
2674 2674
                     value="FLOAT" <?php if ($dt_value   == 'FLOAT') {
2675
-                    echo 'selected="selected"';
2676
-                } ?>><?php _e('DECIMAL', 'geodirectory'); ?></option>
2675
+					echo 'selected="selected"';
2676
+				} ?>><?php _e('DECIMAL', 'geodirectory'); ?></option>
2677 2677
             </select>
2678 2678
             <br/> <span><?php _e('Select Custom Field type', 'geodirectory'); ?></span>
2679 2679
 
@@ -2681,13 +2681,13 @@  discard block
 block discarded – undo
2681 2681
     </li>
2682 2682
 
2683 2683
     <?php
2684
-    $value = '';
2685
-    if (isset($field_info->decimal_point)) {
2686
-        $value = esc_attr($field_info->decimal_point);
2687
-    }elseif(isset($cf['defaults']['decimal_point']) && $cf['defaults']['decimal_point']){
2688
-        $value = $cf['defaults']['decimal_point'];
2689
-    }
2690
-    ?>
2684
+	$value = '';
2685
+	if (isset($field_info->decimal_point)) {
2686
+		$value = esc_attr($field_info->decimal_point);
2687
+	}elseif(isset($cf['defaults']['decimal_point']) && $cf['defaults']['decimal_point']){
2688
+		$value = $cf['defaults']['decimal_point'];
2689
+	}
2690
+	?>
2691 2691
 
2692 2692
     <li class="decimal-point-wrapper"
2693 2693
         style="<?php echo ($dt_value  == 'FLOAT') ? '' : 'display:none' ?>">
@@ -2696,7 +2696,7 @@  discard block
 block discarded – undo
2696 2696
             <select name="decimal_point" id="decimal_point">
2697 2697
                 <option value=""><?php echo _e('Select', 'geodirectory'); ?></option>
2698 2698
                 <?php for ($i = 1; $i <= 10; $i++) {
2699
-                    $selected = $i == $value ? 'selected="selected"' : ''; ?>
2699
+					$selected = $i == $value ? 'selected="selected"' : ''; ?>
2700 2700
                     <option value="<?php echo $i; ?>" <?php echo $selected; ?>><?php echo $i; ?></option>
2701 2701
                 <?php } ?>
2702 2702
             </select>
@@ -2705,8 +2705,8 @@  discard block
 block discarded – undo
2705 2705
     </li>
2706 2706
 <?php
2707 2707
 
2708
-    $output = ob_get_clean();
2709
-    return $output;
2708
+	$output = ob_get_clean();
2709
+	return $output;
2710 2710
 }
2711 2711
 add_filter('geodir_cfa_data_type_text','geodir_cfa_data_type_text',10,4);
2712 2712
 
@@ -2744,9 +2744,9 @@  discard block
 block discarded – undo
2744 2744
 
2745 2745
 
2746 2746
 function geodir_cfa_advanced_editor_geodir_special_offers($output,$result_str,$cf,$field_info){
2747
-    if($field_info->htmlvar_name != 'geodir_special_offers'){return '';}
2748
-    ob_start();
2749
-    ?>
2747
+	if($field_info->htmlvar_name != 'geodir_special_offers'){return '';}
2748
+	ob_start();
2749
+	?>
2750 2750
     <li>
2751 2751
         <label for="advanced_editor" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Show advanced editor :', 'geodirectory'); ?>
2752 2752
             <div class="gdcf-tooltip">
@@ -2757,13 +2757,13 @@  discard block
 block discarded – undo
2757 2757
         <div class="gd-cf-input-wrap">
2758 2758
 
2759 2759
             <?php
2760
-            $selected = '';
2761
-            if (isset($field_info->extra_fields))
2762
-                $advanced_editor = unserialize($field_info->extra_fields);
2760
+			$selected = '';
2761
+			if (isset($field_info->extra_fields))
2762
+				$advanced_editor = unserialize($field_info->extra_fields);
2763 2763
 
2764
-            if (!empty($advanced_editor) && is_array($advanced_editor) && in_array('1', $advanced_editor))
2765
-                $selected = 'checked="checked"';
2766
-            ?>
2764
+			if (!empty($advanced_editor) && is_array($advanced_editor) && in_array('1', $advanced_editor))
2765
+				$selected = 'checked="checked"';
2766
+			?>
2767 2767
 
2768 2768
             <input type="checkbox" name="advanced_editor[]" id="advanced_editor"
2769 2769
                    value="1" <?php echo $selected; ?>/>
@@ -2772,22 +2772,22 @@  discard block
 block discarded – undo
2772 2772
     </li>
2773 2773
     <?php
2774 2774
 
2775
-    $output = ob_get_clean();
2776
-    return $output;
2775
+	$output = ob_get_clean();
2776
+	return $output;
2777 2777
 }
2778 2778
 add_filter('geodir_cfa_advanced_editor_textarea','geodir_cfa_advanced_editor_geodir_special_offers',10,4);
2779 2779
 
2780 2780
 
2781 2781
 function geodir_cfa_validation_pattern_text($output,$result_str,$cf,$field_info){
2782
-    ob_start();
2783
-
2784
-    $value = '';
2785
-    if (isset($field_info->validation_pattern)) {
2786
-        $value = esc_attr($field_info->validation_pattern);
2787
-    }elseif(isset($cf['defaults']['validation_pattern']) && $cf['defaults']['validation_pattern']){
2788
-        $value = esc_attr($cf['defaults']['validation_pattern']);
2789
-    }
2790
-    ?>
2782
+	ob_start();
2783
+
2784
+	$value = '';
2785
+	if (isset($field_info->validation_pattern)) {
2786
+		$value = esc_attr($field_info->validation_pattern);
2787
+	}elseif(isset($cf['defaults']['validation_pattern']) && $cf['defaults']['validation_pattern']){
2788
+		$value = esc_attr($cf['defaults']['validation_pattern']);
2789
+	}
2790
+	?>
2791 2791
     <li>
2792 2792
         <label for="validation_pattern" class="gd-cf-tooltip-wrap">
2793 2793
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Validation Pattern:', 'geodirectory'); ?>
@@ -2801,13 +2801,13 @@  discard block
 block discarded – undo
2801 2801
         </div>
2802 2802
     </li>
2803 2803
     <?php
2804
-    $value = '';
2805
-    if (isset($field_info->validation_msg)) {
2806
-        $value = esc_attr($field_info->validation_msg);
2807
-    }elseif(isset($cf['defaults']['validation_msg']) && $cf['defaults']['validation_msg']){
2808
-        $value = esc_attr($cf['defaults']['validation_msg']);
2809
-    }
2810
-    ?>
2804
+	$value = '';
2805
+	if (isset($field_info->validation_msg)) {
2806
+		$value = esc_attr($field_info->validation_msg);
2807
+	}elseif(isset($cf['defaults']['validation_msg']) && $cf['defaults']['validation_msg']){
2808
+		$value = esc_attr($cf['defaults']['validation_msg']);
2809
+	}
2810
+	?>
2811 2811
     <li>
2812 2812
         <label for="validation_msg" class="gd-cf-tooltip-wrap">
2813 2813
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Validation Message:', 'geodirectory'); ?>
@@ -2822,21 +2822,21 @@  discard block
 block discarded – undo
2822 2822
     </li>
2823 2823
     <?php
2824 2824
 
2825
-    $output = ob_get_clean();
2826
-    return $output;
2825
+	$output = ob_get_clean();
2826
+	return $output;
2827 2827
 }
2828 2828
 add_filter('geodir_cfa_validation_pattern_text','geodir_cfa_validation_pattern_text',10,4);
2829 2829
 
2830 2830
 
2831 2831
 function geodir_cfa_htmlvar_name_taxonomy($output,$result_str,$cf,$field_info){
2832
-    ob_start();
2833
-    global $post_type;
2834
-
2835
-    if (!isset($field_info->post_type)) {
2836
-        $post_type = sanitize_text_field($_REQUEST['listing_type']);
2837
-    } else
2838
-        $post_type = $field_info->post_type;
2839
-    ?>
2832
+	ob_start();
2833
+	global $post_type;
2834
+
2835
+	if (!isset($field_info->post_type)) {
2836
+		$post_type = sanitize_text_field($_REQUEST['listing_type']);
2837
+	} else
2838
+		$post_type = $field_info->post_type;
2839
+	?>
2840 2840
     <li style="display: none;">
2841 2841
         <label for="htmlvar_name" class="gd-cf-tooltip-wrap">
2842 2842
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Select taxonomy:', 'geodirectory'); ?>
@@ -2847,15 +2847,15 @@  discard block
 block discarded – undo
2847 2847
         <div class="gd-cf-input-wrap">
2848 2848
             <select name="htmlvar_name" id="htmlvar_name">
2849 2849
                 <?php
2850
-                $gd_taxonomy = geodir_get_taxonomies($post_type);
2850
+				$gd_taxonomy = geodir_get_taxonomies($post_type);
2851 2851
 
2852
-                foreach ($gd_taxonomy as $gd_tax) {
2853
-                    ?>
2852
+				foreach ($gd_taxonomy as $gd_tax) {
2853
+					?>
2854 2854
                     <option <?php if (isset($field_info->htmlvar_name) && $field_info->htmlvar_name == $gd_tax) {
2855
-                        echo 'selected="selected"';
2856
-                    }?> id="<?php echo $gd_tax;?>"><?php echo $gd_tax;?></option><?php
2857
-                }
2858
-                ?>
2855
+						echo 'selected="selected"';
2856
+					}?> id="<?php echo $gd_tax;?>"><?php echo $gd_tax;?></option><?php
2857
+				}
2858
+				?>
2859 2859
             </select>
2860 2860
         </div>
2861 2861
     </li>
@@ -2871,49 +2871,49 @@  discard block
 block discarded – undo
2871 2871
 
2872 2872
             <select name="cat_display_type" id="cat_display_type">
2873 2873
                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'ajax_chained') {
2874
-                    echo 'selected="selected"';
2875
-                }?> value="ajax_chained"><?php _e('Ajax Chained', 'geodirectory');?></option>
2874
+					echo 'selected="selected"';
2875
+				}?> value="ajax_chained"><?php _e('Ajax Chained', 'geodirectory');?></option>
2876 2876
                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'select') {
2877
-                    echo 'selected="selected"';
2878
-                }?> value="select"><?php _e('Select', 'geodirectory');?></option>
2877
+					echo 'selected="selected"';
2878
+				}?> value="select"><?php _e('Select', 'geodirectory');?></option>
2879 2879
                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'multiselect') {
2880
-                    echo 'selected="selected"';
2881
-                }?> value="multiselect"><?php _e('Multiselect', 'geodirectory');?></option>
2880
+					echo 'selected="selected"';
2881
+				}?> value="multiselect"><?php _e('Multiselect', 'geodirectory');?></option>
2882 2882
                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'checkbox') {
2883
-                    echo 'selected="selected"';
2884
-                }?> value="checkbox"><?php _e('Checkbox', 'geodirectory');?></option>
2883
+					echo 'selected="selected"';
2884
+				}?> value="checkbox"><?php _e('Checkbox', 'geodirectory');?></option>
2885 2885
                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'radio') {
2886
-                    echo 'selected="selected"';
2887
-                }?> value="radio"><?php _e('Radio', 'geodirectory');?></option>
2886
+					echo 'selected="selected"';
2887
+				}?> value="radio"><?php _e('Radio', 'geodirectory');?></option>
2888 2888
             </select>
2889 2889
         </div>
2890 2890
     </li>
2891 2891
     <?php
2892 2892
 
2893
-    $output = ob_get_clean();
2894
-    return $output;
2893
+	$output = ob_get_clean();
2894
+	return $output;
2895 2895
 }
2896 2896
 add_filter('geodir_cfa_htmlvar_name_taxonomy','geodir_cfa_htmlvar_name_taxonomy',10,4);
2897 2897
 
2898 2898
 
2899 2899
 function geodir_cfa_extra_fields_address($output,$result_str,$cf,$field_info){
2900 2900
 
2901
-    ob_start();
2902
-    if (isset($field_info->extra_fields) && $field_info->extra_fields != '') {
2903
-        $address = unserialize($field_info->extra_fields);
2904
-    }
2901
+	ob_start();
2902
+	if (isset($field_info->extra_fields) && $field_info->extra_fields != '') {
2903
+		$address = unserialize($field_info->extra_fields);
2904
+	}
2905 2905
 
2906
-    $radio_id = (isset($field_info->htmlvar_name)) ? $field_info->htmlvar_name : rand(5, 500);
2907
-    ?>
2906
+	$radio_id = (isset($field_info->htmlvar_name)) ? $field_info->htmlvar_name : rand(5, 500);
2907
+	?>
2908 2908
     <?php
2909
-    /**
2910
-     * Called on the add custom fields settings page before the address field is output.
2911
-     *
2912
-     * @since 1.0.0
2913
-     * @param array $address The address settings array.
2914
-     * @param object $field_info Extra fields info.
2915
-     */
2916
-    do_action('geodir_address_extra_admin_fields', $address, $field_info); ?>
2909
+	/**
2910
+	 * Called on the add custom fields settings page before the address field is output.
2911
+	 *
2912
+	 * @since 1.0.0
2913
+	 * @param array $address The address settings array.
2914
+	 * @param object $field_info Extra fields info.
2915
+	 */
2916
+	do_action('geodir_address_extra_admin_fields', $address, $field_info); ?>
2917 2917
 
2918 2918
     <li>
2919 2919
         <label for="show_zip" class="gd-cf-tooltip-wrap">
@@ -2926,14 +2926,14 @@  discard block
 block discarded – undo
2926 2926
 
2927 2927
             <input type="radio" id="show_zip_yes<?php echo $radio_id;?>" name="extra[show_zip]" class="gdri-enabled"  value="1"
2928 2928
                 <?php if (isset($address['show_zip']) && $address['show_zip'] == '1') {
2929
-                    echo 'checked';
2930
-                } ?>/>
2929
+					echo 'checked';
2930
+				} ?>/>
2931 2931
             <label onclick="show_hide_radio(this,'show','cf-zip-lable');" for="show_zip_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
2932 2932
 
2933 2933
             <input type="radio" id="show_zip_no<?php echo $radio_id;?>" name="extra[show_zip]" class="gdri-disabled" value="0"
2934 2934
                 <?php if ((isset($address['show_zip']) && !$address['show_zip']) || !isset($address['show_zip'])) {
2935
-                    echo 'checked';
2936
-                } ?>/>
2935
+					echo 'checked';
2936
+				} ?>/>
2937 2937
             <label onclick="show_hide_radio(this,'hide','cf-zip-lable');" for="show_zip_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
2938 2938
 
2939 2939
 
@@ -2950,8 +2950,8 @@  discard block
 block discarded – undo
2950 2950
         <div class="gd-cf-input-wrap">
2951 2951
             <input type="text" name="extra[zip_lable]" id="zip_lable"
2952 2952
                    value="<?php if (isset($address['zip_lable'])) {
2953
-                       echo esc_attr($address['zip_lable']);
2954
-                   }?>"/>
2953
+					   echo esc_attr($address['zip_lable']);
2954
+				   }?>"/>
2955 2955
         </div>
2956 2956
     </li>
2957 2957
 
@@ -2968,8 +2968,8 @@  discard block
 block discarded – undo
2968 2968
         <div class="gd-cf-input-wrap">
2969 2969
             <input type="text" name="extra[map_lable]" id="map_lable"
2970 2970
                    value="<?php if (isset($address['map_lable'])) {
2971
-                       echo esc_attr($address['map_lable']);
2972
-                   }?>"/>
2971
+					   echo esc_attr($address['map_lable']);
2972
+				   }?>"/>
2973 2973
         </div>
2974 2974
     </li>
2975 2975
 
@@ -2984,14 +2984,14 @@  discard block
 block discarded – undo
2984 2984
 
2985 2985
             <input type="radio" id="show_mapzoom_yes<?php echo $radio_id;?>" name="extra[show_mapzoom]" class="gdri-enabled"  value="1"
2986 2986
                 <?php if (isset($address['show_mapzoom']) && $address['show_mapzoom'] == '1') {
2987
-                    echo 'checked';
2988
-                } ?>/>
2987
+					echo 'checked';
2988
+				} ?>/>
2989 2989
             <label for="show_mapzoom_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
2990 2990
 
2991 2991
             <input type="radio" id="show_mapzoom_no<?php echo $radio_id;?>" name="extra[show_mapzoom]" class="gdri-disabled" value="0"
2992 2992
                 <?php if ((isset($address['show_mapzoom']) && !$address['show_mapzoom']) || !isset($address['show_mapzoom'])) {
2993
-                    echo 'checked';
2994
-                } ?>/>
2993
+					echo 'checked';
2994
+				} ?>/>
2995 2995
             <label for="show_mapzoom_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
2996 2996
 
2997 2997
         </div>
@@ -3008,14 +3008,14 @@  discard block
 block discarded – undo
3008 3008
 
3009 3009
             <input type="radio" id="show_mapview_yes<?php echo $radio_id;?>" name="extra[show_mapview]" class="gdri-enabled"  value="1"
3010 3010
                 <?php if (isset($address['show_mapview']) && $address['show_mapview'] == '1') {
3011
-                    echo 'checked';
3012
-                } ?>/>
3011
+					echo 'checked';
3012
+				} ?>/>
3013 3013
             <label for="show_mapview_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
3014 3014
 
3015 3015
             <input type="radio" id="show_mapview_no<?php echo $radio_id;?>" name="extra[show_mapview]" class="gdri-disabled" value="0"
3016 3016
                 <?php if ((isset($address['show_mapview']) && !$address['show_mapview']) || !isset($address['show_mapview'])) {
3017
-                    echo 'checked';
3018
-                } ?>/>
3017
+					echo 'checked';
3018
+				} ?>/>
3019 3019
             <label for="show_mapview_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
3020 3020
 
3021 3021
         </div>
@@ -3032,8 +3032,8 @@  discard block
 block discarded – undo
3032 3032
         <div class="gd-cf-input-wrap">
3033 3033
             <input type="text" name="extra[mapview_lable]" id="mapview_lable"
3034 3034
                    value="<?php if (isset($address['mapview_lable'])) {
3035
-                       echo esc_attr($address['mapview_lable']);
3036
-                   }?>"/>
3035
+					   echo esc_attr($address['mapview_lable']);
3036
+				   }?>"/>
3037 3037
         </div>
3038 3038
     </li>
3039 3039
     <li>
@@ -3047,29 +3047,29 @@  discard block
 block discarded – undo
3047 3047
 
3048 3048
             <input type="radio" id="show_latlng_yes<?php echo $radio_id;?>" name="extra[show_latlng]" class="gdri-enabled"  value="1"
3049 3049
                 <?php if (isset($address['show_latlng']) && $address['show_latlng'] == '1') {
3050
-                    echo 'checked';
3051
-                } ?>/>
3050
+					echo 'checked';
3051
+				} ?>/>
3052 3052
             <label for="show_latlng_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
3053 3053
 
3054 3054
             <input type="radio" id="show_latlng_no<?php echo $radio_id;?>" name="extra[show_latlng]" class="gdri-disabled" value="0"
3055 3055
                 <?php if ((isset($address['show_latlng']) && !$address['show_latlng']) || !isset($address['show_latlng'])) {
3056
-                    echo 'checked';
3057
-                } ?>/>
3056
+					echo 'checked';
3057
+				} ?>/>
3058 3058
             <label for="show_latlng_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
3059 3059
 
3060 3060
         </div>
3061 3061
     </li>
3062 3062
     <?php
3063 3063
 
3064
-    $html = ob_get_clean();
3065
-    return $output.$html;
3064
+	$html = ob_get_clean();
3065
+	return $output.$html;
3066 3066
 }
3067 3067
 add_filter('geodir_cfa_extra_fields_address','geodir_cfa_extra_fields_address',10,4);
3068 3068
 
3069 3069
 
3070 3070
 function geodir_cfa_extra_fields_multiselect($output,$result_str,$cf,$field_info){
3071
-    ob_start();
3072
-    ?>
3071
+	ob_start();
3072
+	?>
3073 3073
     <li>
3074 3074
         <label for="multi_display_type" class="gd-cf-tooltip-wrap">
3075 3075
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Multiselect display type :', 'geodirectory'); ?>
@@ -3081,14 +3081,14 @@  discard block
 block discarded – undo
3081 3081
 
3082 3082
             <select name="multi_display_type" id="multi_display_type">
3083 3083
                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'select') {
3084
-                    echo 'selected="selected"';
3085
-                }?> value="select"><?php _e('Select', 'geodirectory');?></option>
3084
+					echo 'selected="selected"';
3085
+				}?> value="select"><?php _e('Select', 'geodirectory');?></option>
3086 3086
                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'checkbox') {
3087
-                    echo 'selected="selected"';
3088
-                }?> value="checkbox"><?php _e('Checkbox', 'geodirectory');?></option>
3087
+					echo 'selected="selected"';
3088
+				}?> value="checkbox"><?php _e('Checkbox', 'geodirectory');?></option>
3089 3089
                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'radio') {
3090
-                    echo 'selected="selected"';
3091
-                }?> value="radio"><?php _e('Radio', 'geodirectory');?></option>
3090
+					echo 'selected="selected"';
3091
+				}?> value="radio"><?php _e('Radio', 'geodirectory');?></option>
3092 3092
             </select>
3093 3093
 
3094 3094
             <br/>
@@ -3096,25 +3096,25 @@  discard block
 block discarded – undo
3096 3096
     </li>
3097 3097
     <?php
3098 3098
 
3099
-    $html = ob_get_clean();
3100
-    return $output.$html;
3099
+	$html = ob_get_clean();
3100
+	return $output.$html;
3101 3101
 }
3102 3102
 add_filter('geodir_cfa_extra_fields_multiselect','geodir_cfa_extra_fields_multiselect',10,4);
3103 3103
 
3104 3104
 
3105 3105
 function geodir_cfa_extra_fields_smr($output,$result_str,$cf,$field_info){
3106 3106
 
3107
-    ob_start();
3107
+	ob_start();
3108 3108
 
3109
-    $value = '';
3110
-    if (isset($field_info->option_values)) {
3111
-        $value = esc_attr($field_info->option_values);
3112
-    }elseif(isset($cf['defaults']['option_values']) && $cf['defaults']['option_values']){
3113
-        $value = esc_attr($cf['defaults']['option_values']);
3114
-    }
3109
+	$value = '';
3110
+	if (isset($field_info->option_values)) {
3111
+		$value = esc_attr($field_info->option_values);
3112
+	}elseif(isset($cf['defaults']['option_values']) && $cf['defaults']['option_values']){
3113
+		$value = esc_attr($cf['defaults']['option_values']);
3114
+	}
3115 3115
 
3116
-    $field_type = isset($field_info->field_type) ? $field_info->field_type : '';
3117
-    ?>
3116
+	$field_type = isset($field_info->field_type) ? $field_info->field_type : '';
3117
+	?>
3118 3118
     <li>
3119 3119
         <label for="option_values" class="gd-cf-tooltip-wrap">
3120 3120
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Option Values :', 'geodirectory'); ?>
@@ -3141,8 +3141,8 @@  discard block
 block discarded – undo
3141 3141
     </li>
3142 3142
     <?php
3143 3143
 
3144
-    $html = ob_get_clean();
3145
-    return $output.$html;
3144
+	$html = ob_get_clean();
3145
+	return $output.$html;
3146 3146
 }
3147 3147
 add_filter('geodir_cfa_extra_fields_multiselect','geodir_cfa_extra_fields_smr',10,4);
3148 3148
 add_filter('geodir_cfa_extra_fields_select','geodir_cfa_extra_fields_smr',10,4);
@@ -3150,12 +3150,12 @@  discard block
 block discarded – undo
3150 3150
 
3151 3151
 
3152 3152
 function geodir_cfa_extra_fields_datepicker($output,$result_str,$cf,$field_info){
3153
-    ob_start();
3154
-    $extra = array();
3155
-    if (isset($field_info->extra_fields) && $field_info->extra_fields != '') {
3156
-        $extra = unserialize($field_info->extra_fields);
3157
-    }
3158
-    ?>
3153
+	ob_start();
3154
+	$extra = array();
3155
+	if (isset($field_info->extra_fields) && $field_info->extra_fields != '') {
3156
+		$extra = unserialize($field_info->extra_fields);
3157
+	}
3158
+	?>
3159 3159
     <li>
3160 3160
         <label for="date_format" class="gd-cf-tooltip-wrap">
3161 3161
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Date Format :', 'geodirectory'); ?>
@@ -3165,52 +3165,52 @@  discard block
 block discarded – undo
3165 3165
         </label>
3166 3166
         <div class="gd-cf-input-wrap" style="overflow:inherit;">
3167 3167
             <?php
3168
-            $date_formats = array(
3169
-                'm/d/Y',
3170
-                'd/m/Y',
3171
-                'Y/m/d',
3172
-                'm-d-Y',
3173
-                'd-m-Y',
3174
-                'Y-m-d',
3175
-                'F j, Y',
3176
-            );
3177
-            /**
3178
-             * Filter the custom field date format options.
3179
-             *
3180
-             * @since 1.6.5
3181
-             * @param array $date_formats The PHP date format array.
3182
-             */
3183
-            $date_formats = apply_filters('geodir_date_formats',$date_formats);
3184
-            ?>
3168
+			$date_formats = array(
3169
+				'm/d/Y',
3170
+				'd/m/Y',
3171
+				'Y/m/d',
3172
+				'm-d-Y',
3173
+				'd-m-Y',
3174
+				'Y-m-d',
3175
+				'F j, Y',
3176
+			);
3177
+			/**
3178
+			 * Filter the custom field date format options.
3179
+			 *
3180
+			 * @since 1.6.5
3181
+			 * @param array $date_formats The PHP date format array.
3182
+			 */
3183
+			$date_formats = apply_filters('geodir_date_formats',$date_formats);
3184
+			?>
3185 3185
             <select name="extra[date_format]" id="date_format">
3186 3186
                 <?php
3187
-                foreach($date_formats as $format){
3188
-                    $selected = '';
3189
-                    if(!empty($extra) && esc_attr($extra['date_format'])==$format){
3190
-                        $selected = "selected='selected'";
3191
-                    }
3192
-                    echo "<option $selected value='$format'>$format       (".date_i18n( $format, time()).")</option>";
3193
-                }
3194
-                ?>
3187
+				foreach($date_formats as $format){
3188
+					$selected = '';
3189
+					if(!empty($extra) && esc_attr($extra['date_format'])==$format){
3190
+						$selected = "selected='selected'";
3191
+					}
3192
+					echo "<option $selected value='$format'>$format       (".date_i18n( $format, time()).")</option>";
3193
+				}
3194
+				?>
3195 3195
             </select>
3196 3196
 
3197 3197
         </div>
3198 3198
     </li>
3199 3199
     <?php
3200 3200
 
3201
-    $html = ob_get_clean();
3202
-    return $output.$html;
3201
+	$html = ob_get_clean();
3202
+	return $output.$html;
3203 3203
 }
3204 3204
 add_filter('geodir_cfa_extra_fields_datepicker','geodir_cfa_extra_fields_datepicker',10,4);
3205 3205
 
3206 3206
 
3207 3207
 function geodir_cfa_extra_fields_file($output,$result_str,$cf,$field_info){
3208
-    ob_start();
3209
-    $allowed_file_types = geodir_allowed_mime_types();
3208
+	ob_start();
3209
+	$allowed_file_types = geodir_allowed_mime_types();
3210 3210
 
3211
-    $extra_fields = isset($field_info->extra_fields) && $field_info->extra_fields != '' ? maybe_unserialize($field_info->extra_fields) : '';
3212
-    $gd_file_types = !empty($extra_fields) && !empty($extra_fields['gd_file_types']) ? $extra_fields['gd_file_types'] : array('*');
3213
-    ?>
3211
+	$extra_fields = isset($field_info->extra_fields) && $field_info->extra_fields != '' ? maybe_unserialize($field_info->extra_fields) : '';
3212
+	$gd_file_types = !empty($extra_fields) && !empty($extra_fields['gd_file_types']) ? $extra_fields['gd_file_types'] : array('*');
3213
+	?>
3214 3214
     <li>
3215 3215
         <label for="gd_file_types" class="gd-cf-tooltip-wrap">
3216 3216
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Allowed file types :', 'geodirectory'); ?>
@@ -3233,33 +3233,33 @@  discard block
 block discarded – undo
3233 3233
     </li>
3234 3234
     <?php
3235 3235
 
3236
-    $html = ob_get_clean();
3237
-    return $output.$html;
3236
+	$html = ob_get_clean();
3237
+	return $output.$html;
3238 3238
 }
3239 3239
 add_filter('geodir_cfa_extra_fields_file','geodir_cfa_extra_fields_file',10,4);
3240 3240
 
3241 3241
 function geodir_cfa_extra_fields_text($output,$result_str,$cf,$field_info){
3242
-    ob_start();
3242
+	ob_start();
3243 3243
 
3244
-    $extra_fields = isset($field_info->extra_fields) && $field_info->extra_fields != '' ? maybe_unserialize($field_info->extra_fields) : '';
3244
+	$extra_fields = isset($field_info->extra_fields) && $field_info->extra_fields != '' ? maybe_unserialize($field_info->extra_fields) : '';
3245 3245
    // print_r($cf);echo '###';
3246 3246
 
3247 3247
 
3248 3248
 
3249
-    $radio_id = (isset($field_info->htmlvar_name)) ? $field_info->htmlvar_name : rand(5, 500);
3249
+	$radio_id = (isset($field_info->htmlvar_name)) ? $field_info->htmlvar_name : rand(5, 500);
3250 3250
 
3251 3251
 
3252
-    $value = '';
3253
-    if ($extra_fields && isset($extra_fields['is_price'])) {
3254
-    $value = esc_attr($extra_fields['is_price']);
3255
-    }elseif(isset($cf['defaults']['extra_fields']['is_price']) && $cf['defaults']['extra_fields']['is_price']){
3256
-    $value = esc_attr($cf['defaults']['extra_fields']['is_price']);
3257
-    }
3252
+	$value = '';
3253
+	if ($extra_fields && isset($extra_fields['is_price'])) {
3254
+	$value = esc_attr($extra_fields['is_price']);
3255
+	}elseif(isset($cf['defaults']['extra_fields']['is_price']) && $cf['defaults']['extra_fields']['is_price']){
3256
+	$value = esc_attr($cf['defaults']['extra_fields']['is_price']);
3257
+	}
3258 3258
 
3259
-    $show_price_extra = ($value==1) ? 1 : 0;
3259
+	$show_price_extra = ($value==1) ? 1 : 0;
3260 3260
 
3261
-    $show_price = (isset($field_info->data_type) && ($field_info->data_type=='INT' && $field_info->data_type=='FLOAT')) ? 1 : 0;
3262
-    ?>
3261
+	$show_price = (isset($field_info->data_type) && ($field_info->data_type=='INT' && $field_info->data_type=='FLOAT')) ? 1 : 0;
3262
+	?>
3263 3263
     <li class="gdcf-price-extra-set" <?php if(!$show_price){ echo "style='display:none;'";}?>>
3264 3264
         <label for="is_price" class="gd-cf-tooltip-wrap">
3265 3265
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Display as price? :', 'geodirectory'); ?>
@@ -3271,14 +3271,14 @@  discard block
 block discarded – undo
3271 3271
 
3272 3272
             <input type="radio" id="is_price_yes<?php echo $radio_id;?>" name="extra[is_price]" class="gdri-enabled"  value="1"
3273 3273
                 <?php if ($value == '1') {
3274
-                    echo 'checked';
3275
-                } ?>/>
3274
+					echo 'checked';
3275
+				} ?>/>
3276 3276
             <label onclick="show_hide_radio(this,'show','gdcf-price-extra');" for="is_price_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
3277 3277
 
3278 3278
             <input type="radio" id="is_price_no<?php echo $radio_id;?>" name="extra[is_price]" class="gdri-disabled" value="0"
3279 3279
                 <?php if ($value == '0' || !$value) {
3280
-                    echo 'checked';
3281
-                } ?>/>
3280
+					echo 'checked';
3281
+				} ?>/>
3282 3282
             <label onclick="show_hide_radio(this,'hide','gdcf-price-extra');" for="is_price_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
3283 3283
 
3284 3284
         </div>
@@ -3286,13 +3286,13 @@  discard block
 block discarded – undo
3286 3286
 
3287 3287
     <?php
3288 3288
 
3289
-    $value = '';
3290
-    if ($extra_fields && isset($extra_fields['thousand_separator'])) {
3291
-        $value = esc_attr($extra_fields['thousand_separator']);
3292
-    }elseif(isset($cf['defaults']['extra_fields']['thousand_separator']) && $cf['defaults']['extra_fields']['thousand_separator']){
3293
-        $value = esc_attr($cf['defaults']['extra_fields']['thousand_separator']);
3294
-    }
3295
-    ?>
3289
+	$value = '';
3290
+	if ($extra_fields && isset($extra_fields['thousand_separator'])) {
3291
+		$value = esc_attr($extra_fields['thousand_separator']);
3292
+	}elseif(isset($cf['defaults']['extra_fields']['thousand_separator']) && $cf['defaults']['extra_fields']['thousand_separator']){
3293
+		$value = esc_attr($cf['defaults']['extra_fields']['thousand_separator']);
3294
+	}
3295
+	?>
3296 3296
     <li class="gdcf-price-extra" <?php if(!$show_price_extra){ echo "style='display:none;'";}?>>
3297 3297
         <label for="thousand_separator" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Thousand separator :', 'geodirectory');?>
3298 3298
             <div class="gdcf-tooltip">
@@ -3313,13 +3313,13 @@  discard block
 block discarded – undo
3313 3313
 
3314 3314
     <?php
3315 3315
 
3316
-    $value = '';
3317
-    if ($extra_fields && isset($extra_fields['decimal_separator'])) {
3318
-        $value = esc_attr($extra_fields['decimal_separator']);
3319
-    }elseif(isset($cf['defaults']['extra_fields']['decimal_separator']) && $cf['defaults']['extra_fields']['decimal_separator']){
3320
-        $value = esc_attr($cf['defaults']['extra_fields']['decimal_separator']);
3321
-    }
3322
-    ?>
3316
+	$value = '';
3317
+	if ($extra_fields && isset($extra_fields['decimal_separator'])) {
3318
+		$value = esc_attr($extra_fields['decimal_separator']);
3319
+	}elseif(isset($cf['defaults']['extra_fields']['decimal_separator']) && $cf['defaults']['extra_fields']['decimal_separator']){
3320
+		$value = esc_attr($cf['defaults']['extra_fields']['decimal_separator']);
3321
+	}
3322
+	?>
3323 3323
     <li class="gdcf-price-extra" <?php if(!$show_price_extra){ echo "style='display:none;'";}?>>
3324 3324
         <label for="decimal_separator" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Decimal separator :', 'geodirectory');?>
3325 3325
             <div class="gdcf-tooltip">
@@ -3336,13 +3336,13 @@  discard block
 block discarded – undo
3336 3336
 
3337 3337
     <?php
3338 3338
 
3339
-    $value = '';
3340
-    if ($extra_fields && isset($extra_fields['decimal_display'])) {
3341
-        $value = esc_attr($extra_fields['decimal_display']);
3342
-    }elseif(isset($cf['defaults']['extra_fields']['decimal_display']) && $cf['defaults']['extra_fields']['decimal_display']){
3343
-        $value = esc_attr($cf['defaults']['extra_fields']['decimal_display']);
3344
-    }
3345
-    ?>
3339
+	$value = '';
3340
+	if ($extra_fields && isset($extra_fields['decimal_display'])) {
3341
+		$value = esc_attr($extra_fields['decimal_display']);
3342
+	}elseif(isset($cf['defaults']['extra_fields']['decimal_display']) && $cf['defaults']['extra_fields']['decimal_display']){
3343
+		$value = esc_attr($cf['defaults']['extra_fields']['decimal_display']);
3344
+	}
3345
+	?>
3346 3346
     <li class="gdcf-price-extra" <?php if(!$show_price_extra){ echo "style='display:none;'";}?>>
3347 3347
         <label for="decimal_display" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Decimal display :', 'geodirectory');?>
3348 3348
             <div class="gdcf-tooltip">
@@ -3359,13 +3359,13 @@  discard block
 block discarded – undo
3359 3359
 
3360 3360
     <?php
3361 3361
 
3362
-    $value = '';
3363
-    if ($extra_fields && isset($extra_fields['currency_symbol'])) {
3364
-        $value = esc_attr($extra_fields['currency_symbol']);
3365
-    }elseif(isset($cf['defaults']['extra_fields']['currency_symbol']) && $cf['defaults']['extra_fields']['currency_symbol']){
3366
-        $value = esc_attr($cf['defaults']['extra_fields']['currency_symbol']);
3367
-    }
3368
-    ?>
3362
+	$value = '';
3363
+	if ($extra_fields && isset($extra_fields['currency_symbol'])) {
3364
+		$value = esc_attr($extra_fields['currency_symbol']);
3365
+	}elseif(isset($cf['defaults']['extra_fields']['currency_symbol']) && $cf['defaults']['extra_fields']['currency_symbol']){
3366
+		$value = esc_attr($cf['defaults']['extra_fields']['currency_symbol']);
3367
+	}
3368
+	?>
3369 3369
     <li class="gdcf-price-extra" <?php if(!$show_price_extra){ echo "style='display:none;'";}?>>
3370 3370
         <label for="currency_symbol" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Currency symbol :', 'geodirectory');?>
3371 3371
             <div class="gdcf-tooltip">
@@ -3380,13 +3380,13 @@  discard block
 block discarded – undo
3380 3380
 
3381 3381
     <?php
3382 3382
 
3383
-    $value = '';
3384
-    if ($extra_fields && isset($extra_fields['currency_symbol_placement'])) {
3385
-        $value = esc_attr($extra_fields['currency_symbol_placement']);
3386
-    }elseif(isset($cf['defaults']['extra_fields']['currency_symbol_placement']) && $cf['defaults']['extra_fields']['currency_symbol_placement']){
3387
-        $value = esc_attr($cf['defaults']['extra_fields']['currency_symbol_placement']);
3388
-    }
3389
-    ?>
3383
+	$value = '';
3384
+	if ($extra_fields && isset($extra_fields['currency_symbol_placement'])) {
3385
+		$value = esc_attr($extra_fields['currency_symbol_placement']);
3386
+	}elseif(isset($cf['defaults']['extra_fields']['currency_symbol_placement']) && $cf['defaults']['extra_fields']['currency_symbol_placement']){
3387
+		$value = esc_attr($cf['defaults']['extra_fields']['currency_symbol_placement']);
3388
+	}
3389
+	?>
3390 3390
     <li class="gdcf-price-extra" <?php if(!$show_price_extra){ echo "style='display:none;'";}?>>
3391 3391
         <label for="currency_symbol_placement" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Currency symbol placement :', 'geodirectory');?>
3392 3392
             <div class="gdcf-tooltip">
@@ -3404,225 +3404,225 @@  discard block
 block discarded – undo
3404 3404
 
3405 3405
     <?php
3406 3406
 
3407
-    $html = ob_get_clean();
3408
-    return $output.$html;
3407
+	$html = ob_get_clean();
3408
+	return $output.$html;
3409 3409
 }
3410 3410
 add_filter('geodir_cfa_extra_fields_text','geodir_cfa_extra_fields_text',10,4);
3411 3411
 
3412 3412
 function geodir_default_custom_fields($post_type='gd_place',$package_id=''){
3413
-    $fields = array();
3414
-    $package = ($package_id=='') ? '' : array($package_id);
3415
-
3416
-    $fields[] = array('listing_type' => $post_type,
3417
-                      'data_type' => 'VARCHAR',
3418
-                      'field_type' => 'taxonomy',
3419
-                      'admin_title' => __('Category', 'geodirectory'),
3420
-                      'admin_desc' => __('SELECT listing category FROM here. SELECT at least one CATEGORY', 'geodirectory'),
3421
-                      'site_title' => __('Category', 'geodirectory'),
3422
-                      'htmlvar_name' => $post_type.'category',
3423
-                      'default_value' => '',
3424
-                      'is_default' => '1',
3425
-                      'is_admin' => '1',
3426
-                      'is_required' => '1',
3427
-                      'show_in'   =>  '[detail]',
3428
-                      'show_on_pkg' => $package,
3429
-                      'clabels' => __('Category', 'geodirectory'));
3430
-
3431
-    $fields[] = array('listing_type' => $post_type,
3432
-                      'data_type' => 'VARCHAR',
3433
-                      'field_type' => 'address',
3434
-                      'admin_title' => __('Address', 'geodirectory'),
3435
-                      'admin_desc' => ADDRESS_MSG,
3436
-                      'site_title' => __('Address', 'geodirectory'),
3437
-                      'htmlvar_name' => 'post',
3438
-                      'default_value' => '',
3439
-                      'option_values' => '',
3440
-                      'is_default' => '1',
3441
-                      'is_admin' => '1',
3442
-                      'is_required' => '1',
3443
-                      'show_in'   =>  '[detail],[mapbubble]',
3444
-                      'show_on_pkg' => $package,
3445
-                      'required_msg' => __('Address fields are required', 'geodirectory'),
3446
-                      'clabels' => __('Address', 'geodirectory'),
3447
-                      'extra' => array('show_city' => 1, 'city_lable' => __('City', 'geodirectory'),
3448
-                                       'show_region' => 1, 'region_lable' => __('Region', 'geodirectory'),
3449
-                                       'show_country' => 1, 'country_lable' => __('Country', 'geodirectory'),
3450
-                                       'show_zip' => 1, 'zip_lable' => __('Zip/Post Code', 'geodirectory'),
3451
-                                       'show_map' => 1, 'map_lable' => __('Set Address On Map', 'geodirectory'),
3452
-                                       'show_mapview' => 1, 'mapview_lable' => __('Select Map View', 'geodirectory'),
3453
-                                       'show_mapzoom' => 1, 'mapzoom_lable' => 'hidden',
3454
-                                       'show_latlng' => 1));
3455
-
3456
-    $fields[] = array('listing_type' => $post_type,
3457
-                      'data_type' => 'VARCHAR',
3458
-                      'field_type' => 'text',
3459
-                      'admin_title' => __('Time', 'geodirectory'),
3460
-                      'admin_desc' => __('Enter Business or Listing Timing Information.<br/>eg. : 10.00 am to 6 pm every day', 'geodirectory'),
3461
-                      'site_title' => __('Time', 'geodirectory'),
3462
-                      'htmlvar_name' => 'timing',
3463
-                      'default_value' => '',
3464
-                      'option_values' => '',
3465
-                      'is_default' => '1',
3466
-                      'is_admin' => '1',
3467
-                      'show_in' =>  '[detail],[mapbubble]',
3468
-                      'show_on_pkg' => $package,
3469
-                      'clabels' => __('Time', 'geodirectory'));
3470
-
3471
-    $fields[] = array('listing_type' => $post_type,
3472
-                      'data_type' => 'VARCHAR',
3473
-                      'field_type' => 'phone',
3474
-                      'admin_title' => __('Phone', 'geodirectory'),
3475
-                      'admin_desc' => __('You can enter phone number,cell phone number etc.', 'geodirectory'),
3476
-                      'site_title' => __('Phone', 'geodirectory'),
3477
-                      'htmlvar_name' => 'contact',
3478
-                      'default_value' => '',
3479
-                      'option_values' => '',
3480
-                      'is_default' => '1',
3481
-                      'is_admin' => '1',
3482
-                      'show_in' =>  '[detail],[mapbubble]',
3483
-                      'show_on_pkg' => $package,
3484
-                      'clabels' => __('Phone', 'geodirectory'));
3485
-
3486
-    $fields[] = array('listing_type' => $post_type,
3487
-                      'data_type' => 'VARCHAR',
3488
-                      'field_type' => 'email',
3489
-                      'admin_title' => __('Email', 'geodirectory'),
3490
-                      'admin_desc' => __('You can enter your business or listing email.', 'geodirectory'),
3491
-                      'site_title' => __('Email', 'geodirectory'),
3492
-                      'htmlvar_name' => 'email',
3493
-                      'default_value' => '',
3494
-                      'option_values' => '',
3495
-                      'is_default' => '1',
3496
-                      'is_admin' => '1',
3497
-                      'show_in' => '[detail]',
3498
-                      'show_on_pkg' => $package,
3499
-                      'clabels' => __('Email', 'geodirectory'));
3500
-
3501
-    $fields[] = array('listing_type' => $post_type,
3502
-                      'data_type' => 'VARCHAR',
3503
-                      'field_type' => 'url',
3504
-                      'admin_title' => __('Website', 'geodirectory'),
3505
-                      'admin_desc' => __('You can enter your business or listing website.', 'geodirectory'),
3506
-                      'site_title' => __('Website', 'geodirectory'),
3507
-                      'htmlvar_name' => 'website',
3508
-                      'default_value' => '',
3509
-                      'option_values' => '',
3510
-                      'is_default' => '1',
3511
-                      'is_admin' => '1',
3512
-                      'show_in' => '[detail]',
3513
-                      'show_on_pkg' => $package,
3514
-                      'clabels' => __('Website', 'geodirectory'));
3515
-
3516
-    $fields[] = array('listing_type' => $post_type,
3517
-                      'data_type' => 'VARCHAR',
3518
-                      'field_type' => 'url',
3519
-                      'admin_title' => __('Twitter', 'geodirectory'),
3520
-                      'admin_desc' => __('You can enter your business or listing twitter url.', 'geodirectory'),
3521
-                      'site_title' => __('Twitter', 'geodirectory'),
3522
-                      'htmlvar_name' => 'twitter',
3523
-                      'default_value' => '',
3524
-                      'option_values' => '',
3525
-                      'is_default' => '1',
3526
-                      'is_admin' => '1',
3527
-                      'show_in' => '[detail]',
3528
-                      'show_on_pkg' => $package,
3529
-                      'clabels' => __('Twitter', 'geodirectory'));
3530
-
3531
-    $fields[] = array('listing_type' => $post_type,
3532
-                      'data_type' => 'VARCHAR',
3533
-                      'field_type' => 'url',
3534
-                      'admin_title' => __('Facebook', 'geodirectory'),
3535
-                      'admin_desc' => __('You can enter your business or listing facebook url.', 'geodirectory'),
3536
-                      'site_title' => __('Facebook', 'geodirectory'),
3537
-                      'htmlvar_name' => 'facebook',
3538
-                      'default_value' => '',
3539
-                      'option_values' => '',
3540
-                      'is_default' => '1',
3541
-                      'is_admin' => '1',
3542
-                      'show_in' => '[detail]',
3543
-                      'show_on_pkg' => $package,
3544
-                      'clabels' => __('Facebook', 'geodirectory'));
3545
-
3546
-    $fields[] = array('listing_type' => $post_type,
3547
-                      'data_type' => 'TEXT',
3548
-                      'field_type' => 'textarea',
3549
-                      'admin_title' => __('Video', 'geodirectory'),
3550
-                      'admin_desc' => __('Add video code here, YouTube etc.', 'geodirectory'),
3551
-                      'site_title' => __('Video', 'geodirectory'),
3552
-                      'htmlvar_name' => 'video',
3553
-                      'default_value' => '',
3554
-                      'option_values' => '',
3555
-                      'is_default' => '0',
3556
-                      'is_admin' => '1',
3557
-                      'show_in' => '[owntab]',
3558
-                      'show_on_pkg' => $package,
3559
-                      'clabels' => __('Video', 'geodirectory'));
3560
-
3561
-    $fields[] = array('listing_type' => $post_type,
3562
-                      'data_type' => 'TEXT',
3563
-                      'field_type' => 'textarea',
3564
-                      'admin_title' => __('Special Offers', 'geodirectory'),
3565
-                      'admin_desc' => __('Note: List out any special offers (optional)', 'geodirectory'),
3566
-                      'site_title' => __('Special Offers', 'geodirectory'),
3567
-                      'htmlvar_name' => 'special_offers',
3568
-                      'default_value' => '',
3569
-                      'option_values' => '',
3570
-                      'is_default' => '0',
3571
-                      'is_admin' => '1',
3572
-                      'show_in' => '[owntab]',
3573
-                      'show_on_pkg' => $package,
3574
-                      'clabels' => __('Special Offers', 'geodirectory'));
3575
-
3576
-    /**
3577
-     * Filter the array of default custom fields DB table data.
3578
-     *
3579
-     * @since 1.6.6
3580
-     * @param string $fields The default custom fields as an array.
3581
-     */
3582
-    $fields = apply_filters('geodir_default_custom_fields', $fields);
3583
-
3584
-    return  $fields;
3413
+	$fields = array();
3414
+	$package = ($package_id=='') ? '' : array($package_id);
3415
+
3416
+	$fields[] = array('listing_type' => $post_type,
3417
+					  'data_type' => 'VARCHAR',
3418
+					  'field_type' => 'taxonomy',
3419
+					  'admin_title' => __('Category', 'geodirectory'),
3420
+					  'admin_desc' => __('SELECT listing category FROM here. SELECT at least one CATEGORY', 'geodirectory'),
3421
+					  'site_title' => __('Category', 'geodirectory'),
3422
+					  'htmlvar_name' => $post_type.'category',
3423
+					  'default_value' => '',
3424
+					  'is_default' => '1',
3425
+					  'is_admin' => '1',
3426
+					  'is_required' => '1',
3427
+					  'show_in'   =>  '[detail]',
3428
+					  'show_on_pkg' => $package,
3429
+					  'clabels' => __('Category', 'geodirectory'));
3430
+
3431
+	$fields[] = array('listing_type' => $post_type,
3432
+					  'data_type' => 'VARCHAR',
3433
+					  'field_type' => 'address',
3434
+					  'admin_title' => __('Address', 'geodirectory'),
3435
+					  'admin_desc' => ADDRESS_MSG,
3436
+					  'site_title' => __('Address', 'geodirectory'),
3437
+					  'htmlvar_name' => 'post',
3438
+					  'default_value' => '',
3439
+					  'option_values' => '',
3440
+					  'is_default' => '1',
3441
+					  'is_admin' => '1',
3442
+					  'is_required' => '1',
3443
+					  'show_in'   =>  '[detail],[mapbubble]',
3444
+					  'show_on_pkg' => $package,
3445
+					  'required_msg' => __('Address fields are required', 'geodirectory'),
3446
+					  'clabels' => __('Address', 'geodirectory'),
3447
+					  'extra' => array('show_city' => 1, 'city_lable' => __('City', 'geodirectory'),
3448
+									   'show_region' => 1, 'region_lable' => __('Region', 'geodirectory'),
3449
+									   'show_country' => 1, 'country_lable' => __('Country', 'geodirectory'),
3450
+									   'show_zip' => 1, 'zip_lable' => __('Zip/Post Code', 'geodirectory'),
3451
+									   'show_map' => 1, 'map_lable' => __('Set Address On Map', 'geodirectory'),
3452
+									   'show_mapview' => 1, 'mapview_lable' => __('Select Map View', 'geodirectory'),
3453
+									   'show_mapzoom' => 1, 'mapzoom_lable' => 'hidden',
3454
+									   'show_latlng' => 1));
3455
+
3456
+	$fields[] = array('listing_type' => $post_type,
3457
+					  'data_type' => 'VARCHAR',
3458
+					  'field_type' => 'text',
3459
+					  'admin_title' => __('Time', 'geodirectory'),
3460
+					  'admin_desc' => __('Enter Business or Listing Timing Information.<br/>eg. : 10.00 am to 6 pm every day', 'geodirectory'),
3461
+					  'site_title' => __('Time', 'geodirectory'),
3462
+					  'htmlvar_name' => 'timing',
3463
+					  'default_value' => '',
3464
+					  'option_values' => '',
3465
+					  'is_default' => '1',
3466
+					  'is_admin' => '1',
3467
+					  'show_in' =>  '[detail],[mapbubble]',
3468
+					  'show_on_pkg' => $package,
3469
+					  'clabels' => __('Time', 'geodirectory'));
3470
+
3471
+	$fields[] = array('listing_type' => $post_type,
3472
+					  'data_type' => 'VARCHAR',
3473
+					  'field_type' => 'phone',
3474
+					  'admin_title' => __('Phone', 'geodirectory'),
3475
+					  'admin_desc' => __('You can enter phone number,cell phone number etc.', 'geodirectory'),
3476
+					  'site_title' => __('Phone', 'geodirectory'),
3477
+					  'htmlvar_name' => 'contact',
3478
+					  'default_value' => '',
3479
+					  'option_values' => '',
3480
+					  'is_default' => '1',
3481
+					  'is_admin' => '1',
3482
+					  'show_in' =>  '[detail],[mapbubble]',
3483
+					  'show_on_pkg' => $package,
3484
+					  'clabels' => __('Phone', 'geodirectory'));
3485
+
3486
+	$fields[] = array('listing_type' => $post_type,
3487
+					  'data_type' => 'VARCHAR',
3488
+					  'field_type' => 'email',
3489
+					  'admin_title' => __('Email', 'geodirectory'),
3490
+					  'admin_desc' => __('You can enter your business or listing email.', 'geodirectory'),
3491
+					  'site_title' => __('Email', 'geodirectory'),
3492
+					  'htmlvar_name' => 'email',
3493
+					  'default_value' => '',
3494
+					  'option_values' => '',
3495
+					  'is_default' => '1',
3496
+					  'is_admin' => '1',
3497
+					  'show_in' => '[detail]',
3498
+					  'show_on_pkg' => $package,
3499
+					  'clabels' => __('Email', 'geodirectory'));
3500
+
3501
+	$fields[] = array('listing_type' => $post_type,
3502
+					  'data_type' => 'VARCHAR',
3503
+					  'field_type' => 'url',
3504
+					  'admin_title' => __('Website', 'geodirectory'),
3505
+					  'admin_desc' => __('You can enter your business or listing website.', 'geodirectory'),
3506
+					  'site_title' => __('Website', 'geodirectory'),
3507
+					  'htmlvar_name' => 'website',
3508
+					  'default_value' => '',
3509
+					  'option_values' => '',
3510
+					  'is_default' => '1',
3511
+					  'is_admin' => '1',
3512
+					  'show_in' => '[detail]',
3513
+					  'show_on_pkg' => $package,
3514
+					  'clabels' => __('Website', 'geodirectory'));
3515
+
3516
+	$fields[] = array('listing_type' => $post_type,
3517
+					  'data_type' => 'VARCHAR',
3518
+					  'field_type' => 'url',
3519
+					  'admin_title' => __('Twitter', 'geodirectory'),
3520
+					  'admin_desc' => __('You can enter your business or listing twitter url.', 'geodirectory'),
3521
+					  'site_title' => __('Twitter', 'geodirectory'),
3522
+					  'htmlvar_name' => 'twitter',
3523
+					  'default_value' => '',
3524
+					  'option_values' => '',
3525
+					  'is_default' => '1',
3526
+					  'is_admin' => '1',
3527
+					  'show_in' => '[detail]',
3528
+					  'show_on_pkg' => $package,
3529
+					  'clabels' => __('Twitter', 'geodirectory'));
3530
+
3531
+	$fields[] = array('listing_type' => $post_type,
3532
+					  'data_type' => 'VARCHAR',
3533
+					  'field_type' => 'url',
3534
+					  'admin_title' => __('Facebook', 'geodirectory'),
3535
+					  'admin_desc' => __('You can enter your business or listing facebook url.', 'geodirectory'),
3536
+					  'site_title' => __('Facebook', 'geodirectory'),
3537
+					  'htmlvar_name' => 'facebook',
3538
+					  'default_value' => '',
3539
+					  'option_values' => '',
3540
+					  'is_default' => '1',
3541
+					  'is_admin' => '1',
3542
+					  'show_in' => '[detail]',
3543
+					  'show_on_pkg' => $package,
3544
+					  'clabels' => __('Facebook', 'geodirectory'));
3545
+
3546
+	$fields[] = array('listing_type' => $post_type,
3547
+					  'data_type' => 'TEXT',
3548
+					  'field_type' => 'textarea',
3549
+					  'admin_title' => __('Video', 'geodirectory'),
3550
+					  'admin_desc' => __('Add video code here, YouTube etc.', 'geodirectory'),
3551
+					  'site_title' => __('Video', 'geodirectory'),
3552
+					  'htmlvar_name' => 'video',
3553
+					  'default_value' => '',
3554
+					  'option_values' => '',
3555
+					  'is_default' => '0',
3556
+					  'is_admin' => '1',
3557
+					  'show_in' => '[owntab]',
3558
+					  'show_on_pkg' => $package,
3559
+					  'clabels' => __('Video', 'geodirectory'));
3560
+
3561
+	$fields[] = array('listing_type' => $post_type,
3562
+					  'data_type' => 'TEXT',
3563
+					  'field_type' => 'textarea',
3564
+					  'admin_title' => __('Special Offers', 'geodirectory'),
3565
+					  'admin_desc' => __('Note: List out any special offers (optional)', 'geodirectory'),
3566
+					  'site_title' => __('Special Offers', 'geodirectory'),
3567
+					  'htmlvar_name' => 'special_offers',
3568
+					  'default_value' => '',
3569
+					  'option_values' => '',
3570
+					  'is_default' => '0',
3571
+					  'is_admin' => '1',
3572
+					  'show_in' => '[owntab]',
3573
+					  'show_on_pkg' => $package,
3574
+					  'clabels' => __('Special Offers', 'geodirectory'));
3575
+
3576
+	/**
3577
+	 * Filter the array of default custom fields DB table data.
3578
+	 *
3579
+	 * @since 1.6.6
3580
+	 * @param string $fields The default custom fields as an array.
3581
+	 */
3582
+	$fields = apply_filters('geodir_default_custom_fields', $fields);
3583
+
3584
+	return  $fields;
3585 3585
 }
3586 3586
 
3587 3587
 function geodir_currency_format_number($number='',$cf=''){
3588 3588
 
3589
-    $cs = isset($cf['extra_fields']) ? maybe_unserialize($cf['extra_fields']) : '';
3589
+	$cs = isset($cf['extra_fields']) ? maybe_unserialize($cf['extra_fields']) : '';
3590 3590
 
3591
-    $symbol = isset($cs['currency_symbol']) ? $cs['currency_symbol'] : '$';
3592
-    $decimals = isset($cf['decimal_point']) && $cf['decimal_point'] ? $cf['decimal_point'] : 2;
3593
-    $decimal_display = isset($cf['decimal_display']) && $cf['decimal_display'] ? $cf['decimal_display'] : 'if';
3594
-    $decimalpoint = '.';
3591
+	$symbol = isset($cs['currency_symbol']) ? $cs['currency_symbol'] : '$';
3592
+	$decimals = isset($cf['decimal_point']) && $cf['decimal_point'] ? $cf['decimal_point'] : 2;
3593
+	$decimal_display = isset($cf['decimal_display']) && $cf['decimal_display'] ? $cf['decimal_display'] : 'if';
3594
+	$decimalpoint = '.';
3595 3595
 
3596
-    if(isset($cs['decimal_separator']) && $cs['decimal_separator']=='comma'){
3597
-        $decimalpoint = ',';
3598
-    }
3596
+	if(isset($cs['decimal_separator']) && $cs['decimal_separator']=='comma'){
3597
+		$decimalpoint = ',';
3598
+	}
3599 3599
 
3600
-    $separator = ',';
3600
+	$separator = ',';
3601 3601
 
3602
-    if(isset($cs['thousand_separator'])){
3603
-        if($cs['thousand_separator']=='comma'){$separator = ',';}
3604
-        if($cs['thousand_separator']=='slash'){$separator = '\\';}
3605
-        if($cs['thousand_separator']=='period'){$separator = '.';}
3606
-        if($cs['thousand_separator']=='space'){$separator = ' ';}
3607
-        if($cs['thousand_separator']=='none'){$separator = '';}
3608
-    }
3602
+	if(isset($cs['thousand_separator'])){
3603
+		if($cs['thousand_separator']=='comma'){$separator = ',';}
3604
+		if($cs['thousand_separator']=='slash'){$separator = '\\';}
3605
+		if($cs['thousand_separator']=='period'){$separator = '.';}
3606
+		if($cs['thousand_separator']=='space'){$separator = ' ';}
3607
+		if($cs['thousand_separator']=='none'){$separator = '';}
3608
+	}
3609 3609
 
3610
-    $currency_symbol_placement = isset($cs['currency_symbol_placement']) ? $cs['currency_symbol_placement'] : 'left';
3610
+	$currency_symbol_placement = isset($cs['currency_symbol_placement']) ? $cs['currency_symbol_placement'] : 'left';
3611 3611
 
3612
-    if($decimals>0 && $decimal_display=='if'){
3613
-        if(is_int($number) || floor( $number ) == $number)
3614
-            $decimals = 0;
3615
-    }
3612
+	if($decimals>0 && $decimal_display=='if'){
3613
+		if(is_int($number) || floor( $number ) == $number)
3614
+			$decimals = 0;
3615
+	}
3616 3616
 
3617
-    $number = number_format($number,$decimals,$decimalpoint,$separator);
3617
+	$number = number_format($number,$decimals,$decimalpoint,$separator);
3618 3618
 
3619 3619
 
3620 3620
 
3621
-    if($currency_symbol_placement=='left'){
3622
-        $number = $symbol . $number;
3623
-    }else{
3624
-        $number = $number . $symbol;
3625
-    }
3621
+	if($currency_symbol_placement=='left'){
3622
+		$number = $symbol . $number;
3623
+	}else{
3624
+		$number = $number . $symbol;
3625
+	}
3626 3626
 
3627 3627
 
3628 3628
    return $number;
Please login to merge, or discard this patch.
geodirectory-functions/ajax_handler_functions.php 3 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
  */
45 45
 function geodir_on_wp()
46 46
 {
47
-    if(geodir_is_page('login')) {
47
+    if (geodir_is_page('login')) {
48 48
         geodir_user_signup();
49 49
     }
50 50
 
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
          * @since 1.0.0
83 83
          * @package GeoDirectory
84 84
          */
85
-        include_once(geodir_plugin_path() . '/geodirectory-functions/map-functions/get_markers.php');
85
+        include_once(geodir_plugin_path().'/geodirectory-functions/map-functions/get_markers.php');
86 86
         die;
87 87
     }
88 88
 
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
              * @since 1.0.0
141 141
              * @package GeoDirectory
142 142
              */
143
-            include_once(geodir_plugin_path() . '/geodirectory-admin/geodir_admin_ajax.php');
143
+            include_once(geodir_plugin_path().'/geodirectory-admin/geodir_admin_ajax.php');
144 144
         } else {
145 145
             wp_redirect(geodir_login_url());
146 146
             gd_die();
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
                          *
163 163
                          * @since 1.0.0
164 164
                          */
165
-                        do_action('geodir_delete_dummy_posts_' . $_REQUEST['posttype']);
165
+                        do_action('geodir_delete_dummy_posts_'.$_REQUEST['posttype']);
166 166
                     break;
167 167
                 case "geodir_dummy_insert" :
168 168
                     if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'geodir_dummy_posts_insert_noncename'))
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
                          *
184 184
                          * @since 1.0.0
185 185
                          */
186
-                        do_action('geodir_insert_dummy_posts_' . $_REQUEST['posttype']);
186
+                        do_action('geodir_insert_dummy_posts_'.$_REQUEST['posttype']);
187 187
 
188 188
                     break;
189 189
             endswitch;
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
         if ($_REQUEST['popuptype'] == 'b_send_inquiry' || $_REQUEST['popuptype'] == 'b_sendtofriend') {
199 199
             $template = locate_template(array("geodirectory/popup-forms.php"));
200 200
             if (!$template) {
201
-                $template = geodir_plugin_path() . '/geodirectory-templates/popup-forms.php';
201
+                $template = geodir_plugin_path().'/geodirectory-templates/popup-forms.php';
202 202
             }
203 203
             require_once($template);
204 204
         }
@@ -217,17 +217,17 @@  discard block
 block discarded – undo
217 217
          * @since 1.0.0
218 218
          * @package GeoDirectory
219 219
          */
220
-        include_once(geodir_plugin_path() . '/geodirectory-functions/map-functions/get_markers.php');
220
+        include_once(geodir_plugin_path().'/geodirectory-functions/map-functions/get_markers.php');
221 221
     }
222 222
 
223 223
     if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'favorite') {
224 224
         if (is_user_logged_in()) {
225 225
             switch ($_REQUEST['ajax_action']):
226 226
                 case "add" :
227
-                    geodir_add_to_favorite((int)$_REQUEST['pid']);
227
+                    geodir_add_to_favorite((int) $_REQUEST['pid']);
228 228
                     break;
229 229
                 case "remove" :
230
-                    geodir_remove_from_favorite((int)$_REQUEST['pid']);
230
+                    geodir_remove_from_favorite((int) $_REQUEST['pid']);
231 231
                     break;
232 232
             endswitch;
233 233
         } else {
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
 
241 241
         $is_current_user_owner = true;
242 242
         if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
243
-            $is_current_user_owner = geodir_listing_belong_to_current_user((int)$_REQUEST['pid']);
243
+            $is_current_user_owner = geodir_listing_belong_to_current_user((int) $_REQUEST['pid']);
244 244
         }
245 245
 
246 246
         $request = $gd_session->get('listing');
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
          * @since 1.0.0
352 352
          * @package GeoDirectory
353 353
          */
354
-        include_once(geodir_plugin_path() . '/geodirectory-functions/geodirectory_reg.php');
354
+        include_once(geodir_plugin_path().'/geodirectory-functions/geodirectory_reg.php');
355 355
     }
356 356
 
357 357
 
Please login to merge, or discard this patch.
Braces   +31 added lines, -23 removed lines patch added patch discarded remove patch
@@ -126,10 +126,11 @@  discard block
 block discarded – undo
126 126
     }
127 127
 
128 128
     if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'category_ajax') {
129
-        if (isset($_REQUEST['main_catid']) && isset($_REQUEST['cat_tax']) && isset($_REQUEST['exclude']))
130
-            geodir_addpost_categories_html($_REQUEST['cat_tax'], $_REQUEST['main_catid'], '', '', '', $_REQUEST['exclude']);
131
-        else if (isset($_REQUEST['catpid']) && isset($_REQUEST['cat_tax']))
132
-            geodir_editpost_categories_html($_REQUEST['cat_tax'], $_REQUEST['catpid']);
129
+        if (isset($_REQUEST['main_catid']) && isset($_REQUEST['cat_tax']) && isset($_REQUEST['exclude'])) {
130
+                    geodir_addpost_categories_html($_REQUEST['cat_tax'], $_REQUEST['main_catid'], '', '', '', $_REQUEST['exclude']);
131
+        } else if (isset($_REQUEST['catpid']) && isset($_REQUEST['cat_tax'])) {
132
+                    geodir_editpost_categories_html($_REQUEST['cat_tax'], $_REQUEST['catpid']);
133
+        }
133 134
     }
134 135
 
135 136
     if ((isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'admin_ajax') || isset($_REQUEST['create_field']) || isset($_REQUEST['sort_create_field'])) {
@@ -151,22 +152,25 @@  discard block
 block discarded – undo
151 152
         if (current_user_can('manage_options')) {
152 153
             switch ($_REQUEST['geodir_autofill']):
153 154
                 case "geodir_dummy_delete" :
154
-                    if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'geodir_dummy_posts_delete_noncename'))
155
-                        return;
155
+                    if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'geodir_dummy_posts_delete_noncename')) {
156
+                                            return;
157
+                    }
156 158
 
157
-                    if (isset($_REQUEST['posttype']))
158
-                        /**
159
+                    if (isset($_REQUEST['posttype'])) {
160
+                                            /**
159 161
                          * Used to delete the dummy post data per post type.
160 162
                          *
161 163
                          * Uses dynamic hook, geodir_delete_dummy_posts_$_REQUEST['posttype'].
162 164
                          *
163 165
                          * @since 1.0.0
164 166
                          */
165
-                        do_action('geodir_delete_dummy_posts_' . $_REQUEST['posttype']);
167
+                        do_action('geodir_delete_dummy_posts_' . $_REQUEST['posttype']);
168
+                    }
166 169
                     break;
167 170
                 case "geodir_dummy_insert" :
168
-                    if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'geodir_dummy_posts_insert_noncename'))
169
-                        return;
171
+                    if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'geodir_dummy_posts_insert_noncename')) {
172
+                                            return;
173
+                    }
170 174
 
171 175
                     global $dummy_post_index, $city_bound_lat1, $city_bound_lng1, $city_bound_lat2, $city_bound_lng2;
172 176
                     $dummy_post_index = $_REQUEST['insert_dummy_post_index'];
@@ -175,15 +179,16 @@  discard block
 block discarded – undo
175 179
                     $city_bound_lat2 = $_REQUEST['city_bound_lat2'];
176 180
                     $city_bound_lng2 = $_REQUEST['city_bound_lng2'];
177 181
 
178
-                    if (isset($_REQUEST['posttype']))
179
-                        /**
182
+                    if (isset($_REQUEST['posttype'])) {
183
+                                            /**
180 184
                          * Used to insert the dummy post data per post type.
181 185
                          *
182 186
                          * Uses dynamic hook, geodir_insert_dummy_posts_$_REQUEST['posttype'].
183 187
                          *
184 188
                          * @since 1.0.0
185 189
                          */
186
-                        do_action('geodir_insert_dummy_posts_' . $_REQUEST['posttype']);
190
+                        do_action('geodir_insert_dummy_posts_' . $_REQUEST['posttype']);
191
+                    }
187 192
 
188 193
                     break;
189 194
             endswitch;
@@ -261,8 +266,9 @@  discard block
 block discarded – undo
261 266
                         } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
262 267
                             $redirect_to = get_permalink(geodir_add_listing_page_id());
263 268
                             $redirect_to = geodir_getlink($redirect_to, array('pid' => $post->pid), false);
264
-                        } else
265
-                            $redirect_to = get_permalink(geodir_add_listing_page_id());
269
+                        } else {
270
+                                                    $redirect_to = get_permalink(geodir_add_listing_page_id());
271
+                        }
266 272
 
267 273
                         wp_redirect($redirect_to);
268 274
                     } else {
@@ -275,9 +281,9 @@  discard block
 block discarded – undo
275 281
 
276 282
                     $gd_session->un_set('listing');
277 283
 
278
-                    if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '' && get_permalink($_REQUEST['pid']))
279
-                        wp_redirect(get_permalink($_REQUEST['pid']));
280
-                    else {
284
+                    if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '' && get_permalink($_REQUEST['pid'])) {
285
+                                            wp_redirect(get_permalink($_REQUEST['pid']));
286
+                    } else {
281 287
                         geodir_remove_temp_images();
282 288
                         wp_redirect(geodir_getlink(get_permalink(geodir_add_listing_page_id()), array('listing_type' => $_REQUEST['listing_type'])));
283 289
                     }
@@ -305,8 +311,9 @@  discard block
 block discarded – undo
305 311
                             } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
306 312
                                 $redirect_to = get_permalink(geodir_add_listing_page_id());
307 313
                                 $redirect_to = geodir_getlink($redirect_to, array('pid' => $post->pid), false);
308
-                            } else
309
-                                $redirect_to = get_permalink(geodir_add_listing_page_id());
314
+                            } else {
315
+                                                            $redirect_to = get_permalink(geodir_add_listing_page_id());
316
+                            }
310 317
 
311 318
                             $gd_session->un_set('listing');
312 319
                             wp_redirect($redirect_to);
@@ -327,8 +334,9 @@  discard block
 block discarded – undo
327 334
                             $lastid = wp_delete_post($_REQUEST['pid']);
328 335
                         }
329 336
 
330
-                        if ($lastid && !is_wp_error($lastid))
331
-                            wp_redirect($_SERVER['HTTP_REFERER']);
337
+                        if ($lastid && !is_wp_error($lastid)) {
338
+                                                    wp_redirect($_SERVER['HTTP_REFERER']);
339
+                        }
332 340
 
333 341
                         //wp_redirect( geodir_getlink(get_author_posts_url($current_user->ID),array('geodir_dashbord'=>'true','stype'=>$post_type ),false) );
334 342
                     }
Please login to merge, or discard this patch.
Indentation   +308 added lines, -308 removed lines patch added patch discarded remove patch
@@ -16,22 +16,22 @@  discard block
 block discarded – undo
16 16
  */
17 17
 function geodir_on_wp_loaded()
18 18
 {
19
-    /**
20
-     * Called on the wp_loaded WP hook and used to send the send inquiry and send to friend forms.
21
-     *
22
-     * @since 1.0.0
23
-     */
24
-    do_action('giodir_handle_request_plugins_loaded');
25
-    global $wpdb;
19
+	/**
20
+	 * Called on the wp_loaded WP hook and used to send the send inquiry and send to friend forms.
21
+	 *
22
+	 * @since 1.0.0
23
+	 */
24
+	do_action('giodir_handle_request_plugins_loaded');
25
+	global $wpdb;
26 26
 
27 27
 
28
-    if (isset($_POST['sendact']) && $_POST['sendact'] == 'send_inqury') {
29
-        geodir_send_inquiry($_REQUEST); // function in custom_functions.php
28
+	if (isset($_POST['sendact']) && $_POST['sendact'] == 'send_inqury') {
29
+		geodir_send_inquiry($_REQUEST); // function in custom_functions.php
30 30
 
31
-    } elseif (isset($_POST['sendact']) && $_POST['sendact'] == 'email_frnd') {
32
-        geodir_send_friend($_REQUEST); // function in custom_functions.php
31
+	} elseif (isset($_POST['sendact']) && $_POST['sendact'] == 'email_frnd') {
32
+		geodir_send_friend($_REQUEST); // function in custom_functions.php
33 33
 
34
-    }
34
+	}
35 35
 
36 36
 }
37 37
 
@@ -44,9 +44,9 @@  discard block
 block discarded – undo
44 44
  */
45 45
 function geodir_on_wp()
46 46
 {
47
-    if(geodir_is_page('login')) {
48
-        geodir_user_signup();
49
-    }
47
+	if(geodir_is_page('login')) {
48
+		geodir_user_signup();
49
+	}
50 50
 
51 51
 }
52 52
 
@@ -59,47 +59,47 @@  discard block
 block discarded – undo
59 59
  */
60 60
 function geodir_on_init()
61 61
 {
62
-    /**
63
-     * Called on the wp_init WP hook at the start of the geodir_on_init() function.
64
-     *
65
-     * @since 1.0.0
66
-     */
67
-    do_action('giodir_handle_request');
68
-    global $wpdb;
69
-
70
-
71
-
72
-
73
-    if (get_option('geodir_allow_wpadmin') == '0' && is_user_logged_in() && !current_user_can('manage_options') && !class_exists('BuddyPress')) {
74
-        show_admin_bar(false);
75
-    }
76
-
77
-
78
-    if (isset($_REQUEST['ptype']) && $_REQUEST['ptype'] == 'get_markers') {
79
-        /**
80
-         * Contains map marker functions.
81
-         *
82
-         * @since 1.0.0
83
-         * @package GeoDirectory
84
-         */
85
-        include_once(geodir_plugin_path() . '/geodirectory-functions/map-functions/get_markers.php');
86
-        die;
87
-    }
88
-
89
-    if (isset($_REQUEST['ptype']) && $_REQUEST['ptype'] == 'ga') {
90
-        if (isset($_REQUEST['ga_start'])) {
91
-            $ga_start = $_REQUEST['ga_start'];
92
-        } else {
93
-            $ga_start = '';
94
-        }
95
-        if (isset($_REQUEST['ga_end'])) {
96
-            $ga_end = $_REQUEST['ga_end'];
97
-        } else {
98
-            $ga_end = '';
99
-        }
100
-        geodir_getGoogleAnalytics($_REQUEST['ga_page'], $ga_start, $ga_end);
101
-        die;
102
-    }
62
+	/**
63
+	 * Called on the wp_init WP hook at the start of the geodir_on_init() function.
64
+	 *
65
+	 * @since 1.0.0
66
+	 */
67
+	do_action('giodir_handle_request');
68
+	global $wpdb;
69
+
70
+
71
+
72
+
73
+	if (get_option('geodir_allow_wpadmin') == '0' && is_user_logged_in() && !current_user_can('manage_options') && !class_exists('BuddyPress')) {
74
+		show_admin_bar(false);
75
+	}
76
+
77
+
78
+	if (isset($_REQUEST['ptype']) && $_REQUEST['ptype'] == 'get_markers') {
79
+		/**
80
+		 * Contains map marker functions.
81
+		 *
82
+		 * @since 1.0.0
83
+		 * @package GeoDirectory
84
+		 */
85
+		include_once(geodir_plugin_path() . '/geodirectory-functions/map-functions/get_markers.php');
86
+		die;
87
+	}
88
+
89
+	if (isset($_REQUEST['ptype']) && $_REQUEST['ptype'] == 'ga') {
90
+		if (isset($_REQUEST['ga_start'])) {
91
+			$ga_start = $_REQUEST['ga_start'];
92
+		} else {
93
+			$ga_start = '';
94
+		}
95
+		if (isset($_REQUEST['ga_end'])) {
96
+			$ga_end = $_REQUEST['ga_end'];
97
+		} else {
98
+			$ga_end = '';
99
+		}
100
+		geodir_getGoogleAnalytics($_REQUEST['ga_page'], $ga_start, $ga_end);
101
+		die;
102
+	}
103 103
 
104 104
 
105 105
 }
@@ -118,265 +118,265 @@  discard block
 block discarded – undo
118 118
  * @todo check if nonce is required here and if so add one.
119 119
  */
120 120
 function geodir_ajax_handler() {
121
-    global $wpdb, $gd_session;
121
+	global $wpdb, $gd_session;
122 122
 
123
-    if (isset($_REQUEST['gd_listing_view']) && $_REQUEST['gd_listing_view'] != '') {
123
+	if (isset($_REQUEST['gd_listing_view']) && $_REQUEST['gd_listing_view'] != '') {
124 124
 		$gd_session->set('gd_listing_view', $_REQUEST['gd_listing_view']);
125
-        echo '1';
126
-    }
127
-
128
-    if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'category_ajax') {
129
-        if (isset($_REQUEST['main_catid']) && isset($_REQUEST['cat_tax']) && isset($_REQUEST['exclude']))
130
-            geodir_addpost_categories_html($_REQUEST['cat_tax'], $_REQUEST['main_catid'], '', '', '', $_REQUEST['exclude']);
131
-        else if (isset($_REQUEST['catpid']) && isset($_REQUEST['cat_tax']))
132
-            geodir_editpost_categories_html($_REQUEST['cat_tax'], $_REQUEST['catpid']);
133
-    }
134
-
135
-    if ((isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'admin_ajax') || isset($_REQUEST['create_field']) || isset($_REQUEST['sort_create_field'])) {
136
-        if (current_user_can('manage_options')) {
137
-            /**
138
-             * Contains admin ajax handling functions.
139
-             *
140
-             * @since 1.0.0
141
-             * @package GeoDirectory
142
-             */
143
-            include_once(geodir_plugin_path() . '/geodirectory-admin/geodir_admin_ajax.php');
144
-        } else {
145
-            wp_redirect(geodir_login_url());
146
-            gd_die();
147
-        }
148
-    }
149
-
150
-    if (isset($_REQUEST['geodir_autofill']) && $_REQUEST['geodir_autofill'] != '' && isset($_REQUEST['_wpnonce'])) {
151
-        if (current_user_can('manage_options')) {
152
-            switch ($_REQUEST['geodir_autofill']):
153
-                case "geodir_dummy_delete" :
154
-                    if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'geodir_dummy_posts_delete_noncename'))
155
-                        return;
156
-
157
-                    if (isset($_REQUEST['posttype']))
158
-                        /**
159
-                         * Used to delete the dummy post data per post type.
160
-                         *
161
-                         * Uses dynamic hook, geodir_delete_dummy_posts_$_REQUEST['posttype'].
162
-                         *
163
-                         * @since 1.0.0
164
-                         */
165
-                        do_action('geodir_delete_dummy_posts_' . $_REQUEST['posttype']);
166
-                    break;
167
-                case "geodir_dummy_insert" :
168
-                    if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'geodir_dummy_posts_insert_noncename'))
169
-                        return;
170
-
171
-                    global $dummy_post_index, $city_bound_lat1, $city_bound_lng1, $city_bound_lat2, $city_bound_lng2;
172
-                    $dummy_post_index = $_REQUEST['insert_dummy_post_index'];
173
-                    $city_bound_lat1 = $_REQUEST['city_bound_lat1'];
174
-                    $city_bound_lng1 = $_REQUEST['city_bound_lng1'];
175
-                    $city_bound_lat2 = $_REQUEST['city_bound_lat2'];
176
-                    $city_bound_lng2 = $_REQUEST['city_bound_lng2'];
177
-
178
-                    if (isset($_REQUEST['posttype']))
179
-                        /**
180
-                         * Used to insert the dummy post data per post type.
181
-                         *
182
-                         * Uses dynamic hook, geodir_insert_dummy_posts_$_REQUEST['posttype'].
183
-                         *
184
-                         * @since 1.0.0
185
-                         */
186
-                        do_action('geodir_insert_dummy_posts_' . $_REQUEST['posttype']);
187
-
188
-                    break;
189
-            endswitch;
190
-        } else {
191
-            wp_redirect(geodir_login_url());
192
-            exit();
193
-        }
194
-    }
195
-
196
-    if (isset($_REQUEST['popuptype']) && $_REQUEST['popuptype'] != '' && isset($_REQUEST['post_id']) && $_REQUEST['post_id'] != '') {
197
-
198
-        if ($_REQUEST['popuptype'] == 'b_send_inquiry' || $_REQUEST['popuptype'] == 'b_sendtofriend') {
199
-            $template = locate_template(array("geodirectory/popup-forms.php"));
200
-            if (!$template) {
201
-                $template = geodir_plugin_path() . '/geodirectory-templates/popup-forms.php';
202
-            }
203
-            require_once($template);
204
-        }
205
-
206
-        gd_die();
207
-    }
208
-
209
-    /*if(isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'filter_ajax'){
125
+		echo '1';
126
+	}
127
+
128
+	if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'category_ajax') {
129
+		if (isset($_REQUEST['main_catid']) && isset($_REQUEST['cat_tax']) && isset($_REQUEST['exclude']))
130
+			geodir_addpost_categories_html($_REQUEST['cat_tax'], $_REQUEST['main_catid'], '', '', '', $_REQUEST['exclude']);
131
+		else if (isset($_REQUEST['catpid']) && isset($_REQUEST['cat_tax']))
132
+			geodir_editpost_categories_html($_REQUEST['cat_tax'], $_REQUEST['catpid']);
133
+	}
134
+
135
+	if ((isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'admin_ajax') || isset($_REQUEST['create_field']) || isset($_REQUEST['sort_create_field'])) {
136
+		if (current_user_can('manage_options')) {
137
+			/**
138
+			 * Contains admin ajax handling functions.
139
+			 *
140
+			 * @since 1.0.0
141
+			 * @package GeoDirectory
142
+			 */
143
+			include_once(geodir_plugin_path() . '/geodirectory-admin/geodir_admin_ajax.php');
144
+		} else {
145
+			wp_redirect(geodir_login_url());
146
+			gd_die();
147
+		}
148
+	}
149
+
150
+	if (isset($_REQUEST['geodir_autofill']) && $_REQUEST['geodir_autofill'] != '' && isset($_REQUEST['_wpnonce'])) {
151
+		if (current_user_can('manage_options')) {
152
+			switch ($_REQUEST['geodir_autofill']):
153
+				case "geodir_dummy_delete" :
154
+					if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'geodir_dummy_posts_delete_noncename'))
155
+						return;
156
+
157
+					if (isset($_REQUEST['posttype']))
158
+						/**
159
+						 * Used to delete the dummy post data per post type.
160
+						 *
161
+						 * Uses dynamic hook, geodir_delete_dummy_posts_$_REQUEST['posttype'].
162
+						 *
163
+						 * @since 1.0.0
164
+						 */
165
+						do_action('geodir_delete_dummy_posts_' . $_REQUEST['posttype']);
166
+					break;
167
+				case "geodir_dummy_insert" :
168
+					if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'geodir_dummy_posts_insert_noncename'))
169
+						return;
170
+
171
+					global $dummy_post_index, $city_bound_lat1, $city_bound_lng1, $city_bound_lat2, $city_bound_lng2;
172
+					$dummy_post_index = $_REQUEST['insert_dummy_post_index'];
173
+					$city_bound_lat1 = $_REQUEST['city_bound_lat1'];
174
+					$city_bound_lng1 = $_REQUEST['city_bound_lng1'];
175
+					$city_bound_lat2 = $_REQUEST['city_bound_lat2'];
176
+					$city_bound_lng2 = $_REQUEST['city_bound_lng2'];
177
+
178
+					if (isset($_REQUEST['posttype']))
179
+						/**
180
+						 * Used to insert the dummy post data per post type.
181
+						 *
182
+						 * Uses dynamic hook, geodir_insert_dummy_posts_$_REQUEST['posttype'].
183
+						 *
184
+						 * @since 1.0.0
185
+						 */
186
+						do_action('geodir_insert_dummy_posts_' . $_REQUEST['posttype']);
187
+
188
+					break;
189
+			endswitch;
190
+		} else {
191
+			wp_redirect(geodir_login_url());
192
+			exit();
193
+		}
194
+	}
195
+
196
+	if (isset($_REQUEST['popuptype']) && $_REQUEST['popuptype'] != '' && isset($_REQUEST['post_id']) && $_REQUEST['post_id'] != '') {
197
+
198
+		if ($_REQUEST['popuptype'] == 'b_send_inquiry' || $_REQUEST['popuptype'] == 'b_sendtofriend') {
199
+			$template = locate_template(array("geodirectory/popup-forms.php"));
200
+			if (!$template) {
201
+				$template = geodir_plugin_path() . '/geodirectory-templates/popup-forms.php';
202
+			}
203
+			require_once($template);
204
+		}
205
+
206
+		gd_die();
207
+	}
208
+
209
+	/*if(isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'filter_ajax'){
210 210
         include_once ( geodir_plugin_path() . '/geodirectory-templates/advance-search-form.php');
211 211
     }*/
212 212
 
213
-    if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'map_ajax') {
214
-        /**
215
-         * Contains map marker functions.
216
-         *
217
-         * @since 1.0.0
218
-         * @package GeoDirectory
219
-         */
220
-        include_once(geodir_plugin_path() . '/geodirectory-functions/map-functions/get_markers.php');
221
-    }
222
-
223
-    if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'favorite') {
224
-        if (is_user_logged_in()) {
225
-            switch ($_REQUEST['ajax_action']):
226
-                case "add" :
227
-                    geodir_add_to_favorite((int)$_REQUEST['pid']);
228
-                    break;
229
-                case "remove" :
230
-                    geodir_remove_from_favorite((int)$_REQUEST['pid']);
231
-                    break;
232
-            endswitch;
233
-        } else {
234
-            wp_redirect(geodir_login_url());
235
-            exit();
236
-        }
237
-    }
238
-
239
-    if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'add_listing') {
240
-
241
-        $is_current_user_owner = true;
242
-        if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
243
-            $is_current_user_owner = geodir_listing_belong_to_current_user((int)$_REQUEST['pid']);
244
-        }
245
-
246
-        $request = $gd_session->get('listing');
247
-
248
-        if (is_user_logged_in() && $is_current_user_owner) {
249
-
250
-            switch ($_REQUEST['ajax_action']):
251
-                case "add":
252
-                case "update":
253
-
254
-                    if (isset($request['geodir_spamblocker']) && $request['geodir_spamblocker'] == '64' && isset($request['geodir_filled_by_spam_bot']) && $request['geodir_filled_by_spam_bot'] == '') {
255
-                        $last_id = geodir_save_listing();
256
-
257
-                        if ($last_id) {
258
-                            //$redirect_to = get_permalink( $last_id );
259
-                            $redirect_to = geodir_getlink(get_permalink(geodir_success_page_id()), array('pid' => $last_id));
260
-
261
-                        } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
262
-                            $redirect_to = get_permalink(geodir_add_listing_page_id());
263
-                            $redirect_to = geodir_getlink($redirect_to, array('pid' => $post->pid), false);
264
-                        } else
265
-                            $redirect_to = get_permalink(geodir_add_listing_page_id());
266
-
267
-                        wp_redirect($redirect_to);
268
-                    } else {
269
-                        $gd_session->un_set('listing');
270
-                        wp_redirect(home_url());
271
-                    }
272
-
273
-                    break;
274
-                case "cancel" :
275
-
276
-                    $gd_session->un_set('listing');
277
-
278
-                    if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '' && get_permalink($_REQUEST['pid']))
279
-                        wp_redirect(get_permalink($_REQUEST['pid']));
280
-                    else {
281
-                        geodir_remove_temp_images();
282
-                        wp_redirect(geodir_getlink(get_permalink(geodir_add_listing_page_id()), array('listing_type' => $_REQUEST['listing_type'])));
283
-                    }
284
-
285
-                    break;
286
-
287
-                case "publish" :
288
-
289
-                    if (isset($request['geodir_spamblocker']) && $request['geodir_spamblocker'] == '64' && isset($request['geodir_filled_by_spam_bot']) && $request['geodir_filled_by_spam_bot'] == '') {
290
-
291
-                        if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
292
-                            $new_post = array();
293
-                            $new_post['ID'] = $_REQUEST['pid'];
294
-
295
-                            $lastid = wp_update_post($new_post);
296
-
297
-                            $gd_session->un_set('listing');
298
-                            wp_redirect(get_permalink($lastid));
299
-                        } else {
300
-                            $last_id = geodir_save_listing();
301
-
302
-                            if ($last_id) {
303
-                                //$redirect_to = get_permalink( $last_id );
304
-                                $redirect_to = geodir_getlink(get_permalink(geodir_success_page_id()), array('pid' => $last_id));
305
-                            } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
306
-                                $redirect_to = get_permalink(geodir_add_listing_page_id());
307
-                                $redirect_to = geodir_getlink($redirect_to, array('pid' => $post->pid), false);
308
-                            } else
309
-                                $redirect_to = get_permalink(geodir_add_listing_page_id());
310
-
311
-                            $gd_session->un_set('listing');
312
-                            wp_redirect($redirect_to);
313
-                        }
314
-                    } else {
315
-                        $gd_session->un_set('listing');
316
-                        wp_redirect(home_url());
317
-                    }
318
-
319
-                    break;
320
-                case "delete" :
321
-                    if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
322
-                        global $current_user;
323
-
324
-                        if (get_option('geodir_disable_perm_delete')) {
325
-                            $lastid = wp_trash_post($_REQUEST['pid']);
326
-                        } else {
327
-                            $lastid = wp_delete_post($_REQUEST['pid']);
328
-                        }
329
-
330
-                        if ($lastid && !is_wp_error($lastid))
331
-                            wp_redirect($_SERVER['HTTP_REFERER']);
332
-
333
-                        //wp_redirect( geodir_getlink(get_author_posts_url($current_user->ID),array('geodir_dashbord'=>'true','stype'=>$post_type ),false) );
334
-                    }
335
-                    break;
336
-            endswitch;
337
-
338
-            $gd_session->un_set('listing');
339
-        } else {
340
-            $gd_session->un_set('listing');
341
-            wp_redirect(geodir_login_url());
342
-            exit();
343
-        }
344
-    }
345
-
346
-    if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'user_login') {
347
-        /**
348
-         * Contains registration and login functions.
349
-         * @todo Fix the file path.
350
-         *
351
-         * @since 1.0.0
352
-         * @package GeoDirectory
353
-         */
354
-        include_once(geodir_plugin_path() . '/geodirectory-functions/geodirectory_reg.php');
355
-    }
356
-
357
-    if (isset($_REQUEST['ajax_action']) && $_REQUEST['ajax_action'] == 'geodir_get_term_list') {
358
-        $args = array('taxonomy' => sanitize_text_field($_REQUEST['term']));
359
-        if (!empty($_REQUEST['parent_only'])) {
360
-            $args['parent'] = 0;
361
-        }
362
-        $terms_o = get_terms($args);
213
+	if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'map_ajax') {
214
+		/**
215
+		 * Contains map marker functions.
216
+		 *
217
+		 * @since 1.0.0
218
+		 * @package GeoDirectory
219
+		 */
220
+		include_once(geodir_plugin_path() . '/geodirectory-functions/map-functions/get_markers.php');
221
+	}
222
+
223
+	if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'favorite') {
224
+		if (is_user_logged_in()) {
225
+			switch ($_REQUEST['ajax_action']):
226
+				case "add" :
227
+					geodir_add_to_favorite((int)$_REQUEST['pid']);
228
+					break;
229
+				case "remove" :
230
+					geodir_remove_from_favorite((int)$_REQUEST['pid']);
231
+					break;
232
+			endswitch;
233
+		} else {
234
+			wp_redirect(geodir_login_url());
235
+			exit();
236
+		}
237
+	}
238
+
239
+	if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'add_listing') {
240
+
241
+		$is_current_user_owner = true;
242
+		if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
243
+			$is_current_user_owner = geodir_listing_belong_to_current_user((int)$_REQUEST['pid']);
244
+		}
245
+
246
+		$request = $gd_session->get('listing');
247
+
248
+		if (is_user_logged_in() && $is_current_user_owner) {
249
+
250
+			switch ($_REQUEST['ajax_action']):
251
+				case "add":
252
+				case "update":
253
+
254
+					if (isset($request['geodir_spamblocker']) && $request['geodir_spamblocker'] == '64' && isset($request['geodir_filled_by_spam_bot']) && $request['geodir_filled_by_spam_bot'] == '') {
255
+						$last_id = geodir_save_listing();
256
+
257
+						if ($last_id) {
258
+							//$redirect_to = get_permalink( $last_id );
259
+							$redirect_to = geodir_getlink(get_permalink(geodir_success_page_id()), array('pid' => $last_id));
260
+
261
+						} elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
262
+							$redirect_to = get_permalink(geodir_add_listing_page_id());
263
+							$redirect_to = geodir_getlink($redirect_to, array('pid' => $post->pid), false);
264
+						} else
265
+							$redirect_to = get_permalink(geodir_add_listing_page_id());
266
+
267
+						wp_redirect($redirect_to);
268
+					} else {
269
+						$gd_session->un_set('listing');
270
+						wp_redirect(home_url());
271
+					}
272
+
273
+					break;
274
+				case "cancel" :
275
+
276
+					$gd_session->un_set('listing');
277
+
278
+					if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '' && get_permalink($_REQUEST['pid']))
279
+						wp_redirect(get_permalink($_REQUEST['pid']));
280
+					else {
281
+						geodir_remove_temp_images();
282
+						wp_redirect(geodir_getlink(get_permalink(geodir_add_listing_page_id()), array('listing_type' => $_REQUEST['listing_type'])));
283
+					}
284
+
285
+					break;
286
+
287
+				case "publish" :
288
+
289
+					if (isset($request['geodir_spamblocker']) && $request['geodir_spamblocker'] == '64' && isset($request['geodir_filled_by_spam_bot']) && $request['geodir_filled_by_spam_bot'] == '') {
290
+
291
+						if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
292
+							$new_post = array();
293
+							$new_post['ID'] = $_REQUEST['pid'];
294
+
295
+							$lastid = wp_update_post($new_post);
296
+
297
+							$gd_session->un_set('listing');
298
+							wp_redirect(get_permalink($lastid));
299
+						} else {
300
+							$last_id = geodir_save_listing();
301
+
302
+							if ($last_id) {
303
+								//$redirect_to = get_permalink( $last_id );
304
+								$redirect_to = geodir_getlink(get_permalink(geodir_success_page_id()), array('pid' => $last_id));
305
+							} elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
306
+								$redirect_to = get_permalink(geodir_add_listing_page_id());
307
+								$redirect_to = geodir_getlink($redirect_to, array('pid' => $post->pid), false);
308
+							} else
309
+								$redirect_to = get_permalink(geodir_add_listing_page_id());
310
+
311
+							$gd_session->un_set('listing');
312
+							wp_redirect($redirect_to);
313
+						}
314
+					} else {
315
+						$gd_session->un_set('listing');
316
+						wp_redirect(home_url());
317
+					}
318
+
319
+					break;
320
+				case "delete" :
321
+					if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
322
+						global $current_user;
323
+
324
+						if (get_option('geodir_disable_perm_delete')) {
325
+							$lastid = wp_trash_post($_REQUEST['pid']);
326
+						} else {
327
+							$lastid = wp_delete_post($_REQUEST['pid']);
328
+						}
329
+
330
+						if ($lastid && !is_wp_error($lastid))
331
+							wp_redirect($_SERVER['HTTP_REFERER']);
332
+
333
+						//wp_redirect( geodir_getlink(get_author_posts_url($current_user->ID),array('geodir_dashbord'=>'true','stype'=>$post_type ),false) );
334
+					}
335
+					break;
336
+			endswitch;
337
+
338
+			$gd_session->un_set('listing');
339
+		} else {
340
+			$gd_session->un_set('listing');
341
+			wp_redirect(geodir_login_url());
342
+			exit();
343
+		}
344
+	}
345
+
346
+	if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'user_login') {
347
+		/**
348
+		 * Contains registration and login functions.
349
+		 * @todo Fix the file path.
350
+		 *
351
+		 * @since 1.0.0
352
+		 * @package GeoDirectory
353
+		 */
354
+		include_once(geodir_plugin_path() . '/geodirectory-functions/geodirectory_reg.php');
355
+	}
356
+
357
+	if (isset($_REQUEST['ajax_action']) && $_REQUEST['ajax_action'] == 'geodir_get_term_list') {
358
+		$args = array('taxonomy' => sanitize_text_field($_REQUEST['term']));
359
+		if (!empty($_REQUEST['parent_only'])) {
360
+			$args['parent'] = 0;
361
+		}
362
+		$terms_o = get_terms($args);
363 363
         
364
-        // Skip terms which has no listing
365
-        if (!empty($terms_o)) {
366
-            $filter_terms = array();
364
+		// Skip terms which has no listing
365
+		if (!empty($terms_o)) {
366
+			$filter_terms = array();
367 367
             
368
-            foreach ($terms_o as $term) {
369
-                if (isset($term->count) && $term->count > 0) {
370
-                    $filter_terms[] = $term;
371
-                }
372
-            }
373
-            $terms_o = $filter_terms;
374
-        }
368
+			foreach ($terms_o as $term) {
369
+				if (isset($term->count) && $term->count > 0) {
370
+					$filter_terms[] = $term;
371
+				}
372
+			}
373
+			$terms_o = $filter_terms;
374
+		}
375 375
         
376
-        $terms = geodir_sort_terms($terms_o, 'count');
377
-        geodir_helper_cat_list_output($terms, intval($_REQUEST['limit']));
378
-        exit();
379
-    }
376
+		$terms = geodir_sort_terms($terms_o, 'count');
377
+		geodir_helper_cat_list_output($terms, intval($_REQUEST['limit']));
378
+		exit();
379
+	}
380 380
 
381
-    gd_die();
381
+	gd_die();
382 382
 }
Please login to merge, or discard this patch.
geodirectory-widgets/geodirectory_listing_slider_widget.php 3 patches
Indentation   +109 added lines, -109 removed lines patch added patch discarded remove patch
@@ -15,40 +15,40 @@  discard block
 block discarded – undo
15 15
 class geodir_listing_slider_widget extends WP_Widget
16 16
 {
17 17
 
18
-    /**
18
+	/**
19 19
 	 * Register the listing slider widget.
20 20
 	 *
21 21
 	 * @since 1.0.0
22
-     * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct.
22
+	 * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct.
23 23
 	 */
24
-    public function __construct() {
25
-        $widget_ops = array('classname' => 'geodir_listing_slider_view', 'description' => __('GD > Listing Slider', 'geodirectory'));
26
-        parent::__construct(
27
-            'listing_slider_view', // Base ID
28
-            __('GD > Listing Slider', 'geodirectory'), // Name
29
-            $widget_ops// Args
30
-        );
31
-    }
24
+	public function __construct() {
25
+		$widget_ops = array('classname' => 'geodir_listing_slider_view', 'description' => __('GD > Listing Slider', 'geodirectory'));
26
+		parent::__construct(
27
+			'listing_slider_view', // Base ID
28
+			__('GD > Listing Slider', 'geodirectory'), // Name
29
+			$widget_ops// Args
30
+		);
31
+	}
32 32
 	
33 33
 	/**
34 34
 	 * Front-end display content for listing slider widget.
35 35
 	 *
36 36
 	 * @since 1.0.0
37
-     * @since 1.5.1 Declare function public.
37
+	 * @since 1.5.1 Declare function public.
38 38
 	 *
39 39
 	 * @param array $args     Widget arguments.
40 40
 	 * @param array $instance Saved values from database.
41 41
 	 */
42
-    public function widget($args, $instance)
43
-    {
44
-        geodir_listing_slider_widget_output($args, $instance);
45
-    }
42
+	public function widget($args, $instance)
43
+	{
44
+		geodir_listing_slider_widget_output($args, $instance);
45
+	}
46 46
 
47 47
 	/**
48 48
 	 * Sanitize listing slider widget form values as they are saved.
49 49
 	 *
50 50
 	 * @since 1.0.0
51
-     * @since 1.5.1 Declare function public.
51
+	 * @since 1.5.1 Declare function public.
52 52
 	 *
53 53
 	 * @param array $new_instance Values just sent to be saved.
54 54
 	 * @param array $old_instance Previously saved values from database.
@@ -56,101 +56,101 @@  discard block
 block discarded – undo
56 56
 	 * @return array Updated safe values to be saved.
57 57
 	 */
58 58
 	public function update($new_instance, $old_instance)
59
-    {
60
-        //save the widget
61
-        $instance = $old_instance;
62
-        $instance['title'] = strip_tags($new_instance['title']);
63
-        $instance['post_type'] = strip_tags($new_instance['post_type']);
64
-        $instance['category'] = strip_tags($new_instance['category']);
65
-        $instance['post_number'] = strip_tags($new_instance['post_number']);
66
-        $instance['max_show'] = strip_tags($new_instance['max_show']);
67
-        $instance['slide_width'] = strip_tags($new_instance['slide_width']);
68
-        $instance['show_title'] = isset($new_instance['show_title']) ? $new_instance['show_title'] : '';
69
-        $instance['slideshow'] = isset($new_instance['slideshow']) ? $new_instance['slideshow'] : '';
70
-        $instance['animationLoop'] = isset($new_instance['animationLoop']) ? $new_instance['animationLoop'] : '';
71
-        $instance['directionNav'] = isset($new_instance['directionNav']) ? $new_instance['directionNav'] : '';
72
-        $instance['slideshowSpeed'] = $new_instance['slideshowSpeed'];
73
-        $instance['animationSpeed'] = $new_instance['animationSpeed'];
74
-        $instance['animation'] = $new_instance['animation'];
75
-        $instance['list_sort'] = isset($new_instance['list_sort']) ? $new_instance['list_sort'] : '';
76
-        $instance['show_featured_only'] = isset($new_instance['show_featured_only']) && $new_instance['show_featured_only'] ? 1 : 0;
77
-        if (isset($new_instance['add_location_filter']) && $new_instance['add_location_filter'] != '')
78
-            $instance['add_location_filter'] = strip_tags($new_instance['add_location_filter']);
79
-        else
80
-            $instance['add_location_filter'] = '0';
81
-
82
-        return $instance;
83
-    }
59
+	{
60
+		//save the widget
61
+		$instance = $old_instance;
62
+		$instance['title'] = strip_tags($new_instance['title']);
63
+		$instance['post_type'] = strip_tags($new_instance['post_type']);
64
+		$instance['category'] = strip_tags($new_instance['category']);
65
+		$instance['post_number'] = strip_tags($new_instance['post_number']);
66
+		$instance['max_show'] = strip_tags($new_instance['max_show']);
67
+		$instance['slide_width'] = strip_tags($new_instance['slide_width']);
68
+		$instance['show_title'] = isset($new_instance['show_title']) ? $new_instance['show_title'] : '';
69
+		$instance['slideshow'] = isset($new_instance['slideshow']) ? $new_instance['slideshow'] : '';
70
+		$instance['animationLoop'] = isset($new_instance['animationLoop']) ? $new_instance['animationLoop'] : '';
71
+		$instance['directionNav'] = isset($new_instance['directionNav']) ? $new_instance['directionNav'] : '';
72
+		$instance['slideshowSpeed'] = $new_instance['slideshowSpeed'];
73
+		$instance['animationSpeed'] = $new_instance['animationSpeed'];
74
+		$instance['animation'] = $new_instance['animation'];
75
+		$instance['list_sort'] = isset($new_instance['list_sort']) ? $new_instance['list_sort'] : '';
76
+		$instance['show_featured_only'] = isset($new_instance['show_featured_only']) && $new_instance['show_featured_only'] ? 1 : 0;
77
+		if (isset($new_instance['add_location_filter']) && $new_instance['add_location_filter'] != '')
78
+			$instance['add_location_filter'] = strip_tags($new_instance['add_location_filter']);
79
+		else
80
+			$instance['add_location_filter'] = '0';
81
+
82
+		return $instance;
83
+	}
84 84
 
85 85
 	/**
86 86
 	 * Back-end listing slider widget settings form.
87 87
 	 *
88 88
 	 * @since 1.0.0
89
-     * @since 1.5.1 Declare function public.
89
+	 * @since 1.5.1 Declare function public.
90 90
 	 *
91 91
 	 * @param array $instance Previously saved values from database.
92 92
 	 */
93 93
 	public function form($instance)
94
-    {
94
+	{
95 95
 
96
-        //widgetform in backend
97
-        $instance = wp_parse_args((array)$instance,
98
-            array('title' => '',
99
-                'post_type' => '',
100
-                'category' => '',
101
-                'post_number' => '5',
102
-                'max_show' => '1',
103
-                'slide_width' => '',
104
-                'show_title' => '',
105
-                'slideshow' => '',
106
-                'animationLoop' => '',
107
-                'directionNav' => '',
108
-                'slideshowSpeed' => 5000,
109
-                'animationSpeed' => 600,
110
-                'animation' => '',
111
-                'list_sort' => 'latest',
112
-                'show_featured_only' => '',
113
-                'add_location_filter' => '0',
114
-            )
115
-        );
96
+		//widgetform in backend
97
+		$instance = wp_parse_args((array)$instance,
98
+			array('title' => '',
99
+				'post_type' => '',
100
+				'category' => '',
101
+				'post_number' => '5',
102
+				'max_show' => '1',
103
+				'slide_width' => '',
104
+				'show_title' => '',
105
+				'slideshow' => '',
106
+				'animationLoop' => '',
107
+				'directionNav' => '',
108
+				'slideshowSpeed' => 5000,
109
+				'animationSpeed' => 600,
110
+				'animation' => '',
111
+				'list_sort' => 'latest',
112
+				'show_featured_only' => '',
113
+				'add_location_filter' => '0',
114
+			)
115
+		);
116 116
 
117
-        $title = strip_tags($instance['title']);
117
+		$title = strip_tags($instance['title']);
118 118
 
119
-        $post_type = strip_tags($instance['post_type']);
119
+		$post_type = strip_tags($instance['post_type']);
120 120
 
121
-        $category = strip_tags($instance['category']);
121
+		$category = strip_tags($instance['category']);
122 122
 
123
-        $post_number = strip_tags($instance['post_number']);
123
+		$post_number = strip_tags($instance['post_number']);
124 124
 
125
-        $max_show = strip_tags($instance['max_show']);
125
+		$max_show = strip_tags($instance['max_show']);
126 126
 
127
-        $slide_width = strip_tags($instance['slide_width']);
127
+		$slide_width = strip_tags($instance['slide_width']);
128 128
 
129
-        $show_title = $instance['show_title'];
129
+		$show_title = $instance['show_title'];
130 130
 
131
-        $slideshow = $instance['slideshow'];
131
+		$slideshow = $instance['slideshow'];
132 132
 
133
-        $animationLoop = $instance['animationLoop'];
133
+		$animationLoop = $instance['animationLoop'];
134 134
 
135
-        $directionNav = $instance['directionNav'];
135
+		$directionNav = $instance['directionNav'];
136 136
 
137
-        $slideshowSpeed = $instance['slideshowSpeed'];
137
+		$slideshowSpeed = $instance['slideshowSpeed'];
138 138
 
139
-        $animationSpeed = $instance['animationSpeed'];
139
+		$animationSpeed = $instance['animationSpeed'];
140 140
 
141
-        $add_location_filter = strip_tags($instance['add_location_filter']);
141
+		$add_location_filter = strip_tags($instance['add_location_filter']);
142 142
 
143
-        $animation = $instance['animation'];
144
-        $list_sort = $instance['list_sort'];
145
-        $show_featured_only = isset($instance['show_featured_only']) && $instance['show_featured_only'] ? true : false;
143
+		$animation = $instance['animation'];
144
+		$list_sort = $instance['list_sort'];
145
+		$show_featured_only = isset($instance['show_featured_only']) && $instance['show_featured_only'] ? true : false;
146 146
 
147
-        $sort_fields = array();
148
-        $sort_fields[] = array('field' => 'latest', 'label' => __('Latest', 'geodirectory'));
149
-        $sort_fields[] = array('field' => 'featured', 'label' => __('Featured', 'geodirectory'));
150
-        $sort_fields[] = array('field' => 'high_review', 'label' => __('Review', 'geodirectory'));
151
-        $sort_fields[] = array('field' => 'high_rating', 'label' => __('Rating', 'geodirectory'));
152
-        $sort_fields[] = array('field' => 'random', 'label' => __('Random', 'geodirectory'));
153
-        ?>
147
+		$sort_fields = array();
148
+		$sort_fields[] = array('field' => 'latest', 'label' => __('Latest', 'geodirectory'));
149
+		$sort_fields[] = array('field' => 'featured', 'label' => __('Featured', 'geodirectory'));
150
+		$sort_fields[] = array('field' => 'high_review', 'label' => __('Review', 'geodirectory'));
151
+		$sort_fields[] = array('field' => 'high_rating', 'label' => __('Rating', 'geodirectory'));
152
+		$sort_fields[] = array('field' => 'random', 'label' => __('Random', 'geodirectory'));
153
+		?>
154 154
 
155 155
         <p>
156 156
             <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'geodirectory');?>
@@ -174,9 +174,9 @@  discard block
 block discarded – undo
174 174
                     <?php foreach ($postypes as $postypes_obj) { ?>
175 175
 
176 176
                         <option <?php if ($post_type == $postypes_obj) {
177
-                            echo 'selected="selected"';
178
-                        } ?> value="<?php echo $postypes_obj; ?>"><?php $extvalue = explode('_', $postypes_obj);
179
-                            echo ucfirst($extvalue[1]); ?></option>
177
+							echo 'selected="selected"';
178
+						} ?> value="<?php echo $postypes_obj; ?>"><?php $extvalue = explode('_', $postypes_obj);
179
+							echo ucfirst($extvalue[1]); ?></option>
180 180
 
181 181
                     <?php } ?>
182 182
 
@@ -190,20 +190,20 @@  discard block
 block discarded – undo
190 190
                 for="<?php echo $this->get_field_id('category'); ?>"><?php _e('Post Category:', 'geodirectory');?>
191 191
 
192 192
                 <?php
193
-                $category_taxonomy = geodir_get_taxonomies('gd_place');
194
-                $categories = get_terms($category_taxonomy, array('orderby' => 'count', 'order' => 'DESC'));
195
-                ?>
193
+				$category_taxonomy = geodir_get_taxonomies('gd_place');
194
+				$categories = get_terms($category_taxonomy, array('orderby' => 'count', 'order' => 'DESC'));
195
+				?>
196 196
 
197 197
                 <select class="widefat" id="<?php echo $this->get_field_id('category'); ?>"
198 198
                         name="<?php echo $this->get_field_name('category'); ?>">
199 199
                     <option <?php if ($category == '0') {
200
-                        echo 'selected="selected"';
201
-                    } ?> value="0"><?php _e('All', 'geodirectory'); ?></option>
200
+						echo 'selected="selected"';
201
+					} ?> value="0"><?php _e('All', 'geodirectory'); ?></option>
202 202
                     <?php foreach ($categories as $category_obj) { ?>
203 203
 
204 204
                         <option <?php if ($category == $category_obj->term_id) {
205
-                            echo 'selected="selected"';
206
-                        } ?>
205
+							echo 'selected="selected"';
206
+						} ?>
207 207
                             value="<?php echo $category_obj->term_id; ?>"><?php echo ucfirst($category_obj->name); ?></option>
208 208
 
209 209
                     <?php } ?>
@@ -256,12 +256,12 @@  discard block
 block discarded – undo
256 256
                 <select class="widefat" id="<?php echo $this->get_field_id('animation'); ?>"
257 257
                         name="<?php echo $this->get_field_name('animation'); ?>">
258 258
                     <option <?php if ($animation == 'slide') {
259
-                        echo 'selected="selected"';
260
-                    } ?> value="slide">Slide
259
+						echo 'selected="selected"';
260
+					} ?> value="slide">Slide
261 261
                     </option>
262 262
                     <option <?php if ($animation == 'fade') {
263
-                        echo 'selected="selected"';
264
-                    } ?> value="fade">Fade
263
+						echo 'selected="selected"';
264
+					} ?> value="fade">Fade
265 265
                     </option>
266 266
                 </select>
267 267
             </label>
@@ -292,8 +292,8 @@  discard block
 block discarded – undo
292 292
                 for="<?php echo $this->get_field_id('slideshow'); ?>"><?php _e('SlideShow:', 'geodirectory');?>
293 293
 
294 294
                 <input type="checkbox" <?php if ($slideshow) {
295
-                    echo 'checked="checked"';
296
-                } ?> id="<?php echo $this->get_field_id('slideshow'); ?>" value="1"
295
+					echo 'checked="checked"';
296
+				} ?> id="<?php echo $this->get_field_id('slideshow'); ?>" value="1"
297 297
                        name="<?php echo $this->get_field_name('slideshow'); ?>"/>
298 298
 
299 299
             </label>
@@ -304,8 +304,8 @@  discard block
 block discarded – undo
304 304
                 for="<?php echo $this->get_field_id('animationLoop'); ?>"><?php _e('AnimationLoop:', 'geodirectory');?>
305 305
 
306 306
                 <input type="checkbox" <?php if ($animationLoop) {
307
-                    echo 'checked="checked"';
308
-                } ?> id="<?php echo $this->get_field_id('animationLoop'); ?>" value="1"
307
+					echo 'checked="checked"';
308
+				} ?> id="<?php echo $this->get_field_id('animationLoop'); ?>" value="1"
309 309
                        name="<?php echo $this->get_field_name('animationLoop'); ?>"/>
310 310
 
311 311
             </label>
@@ -316,8 +316,8 @@  discard block
 block discarded – undo
316 316
                 for="<?php echo $this->get_field_id('directionNav'); ?>"><?php _e('DirectionNav:', 'geodirectory');?>
317 317
 
318 318
                 <input type="checkbox" <?php if ($directionNav) {
319
-                    echo 'checked="checked"';
320
-                } ?> id="<?php echo $this->get_field_id('directionNav'); ?>" value="1"
319
+					echo 'checked="checked"';
320
+				} ?> id="<?php echo $this->get_field_id('directionNav'); ?>" value="1"
321 321
                        name="<?php echo $this->get_field_name('directionNav'); ?>"/>
322 322
 
323 323
             </label>
@@ -329,8 +329,8 @@  discard block
 block discarded – undo
329 329
                 for="<?php echo $this->get_field_id('show_title'); ?>"><?php _e('Show Title:', 'geodirectory');?>
330 330
 
331 331
                 <input type="checkbox" <?php if ($show_title) {
332
-                    echo 'checked="checked"';
333
-                } ?> id="<?php echo $this->get_field_id('show_title'); ?>" value="1"
332
+					echo 'checked="checked"';
333
+				} ?> id="<?php echo $this->get_field_id('show_title'); ?>" value="1"
334 334
                        name="<?php echo $this->get_field_name('show_title'); ?>"/>
335 335
 
336 336
             </label>
@@ -378,7 +378,7 @@  discard block
 block discarded – undo
378 378
 
379 379
 
380 380
     <?php
381
-    }
381
+	}
382 382
 } // class geodir_listing_slider_widget
383 383
 
384 384
 register_widget('geodir_listing_slider_widget');
385 385
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
     {
95 95
 
96 96
         //widgetform in backend
97
-        $instance = wp_parse_args((array)$instance,
97
+        $instance = wp_parse_args((array) $instance,
98 98
             array('title' => '',
99 99
                 'post_type' => '',
100 100
                 'category' => '',
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
         ?>
154 154
 
155 155
         <p>
156
-            <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'geodirectory');?>
156
+            <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'geodirectory'); ?>
157 157
 
158 158
                 <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>"
159 159
                        name="<?php echo $this->get_field_name('title'); ?>" type="text"
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 
164 164
         <p>
165 165
             <label
166
-                for="<?php echo $this->get_field_id('post_type'); ?>"><?php _e('Post Type:', 'geodirectory');?>
166
+                for="<?php echo $this->get_field_id('post_type'); ?>"><?php _e('Post Type:', 'geodirectory'); ?>
167 167
 
168 168
                 <?php $postypes = geodir_get_posttypes(); ?>
169 169
 
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 
188 188
         <p>
189 189
             <label
190
-                for="<?php echo $this->get_field_id('category'); ?>"><?php _e('Post Category:', 'geodirectory');?>
190
+                for="<?php echo $this->get_field_id('category'); ?>"><?php _e('Post Category:', 'geodirectory'); ?>
191 191
 
192 192
                 <?php
193 193
                 $category_taxonomy = geodir_get_taxonomies('gd_place');
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
         </p>
225 225
         <p>
226 226
             <label
227
-                for="<?php echo $this->get_field_id('post_number'); ?>"><?php _e('Number of posts(total):', 'geodirectory');?>
227
+                for="<?php echo $this->get_field_id('post_number'); ?>"><?php _e('Number of posts(total):', 'geodirectory'); ?>
228 228
                 <input class="widefat" id="<?php echo $this->get_field_id('post_number'); ?>"
229 229
                        name="<?php echo $this->get_field_name('post_number'); ?>" type="text"
230 230
                        value="<?php echo esc_attr($post_number); ?>"/>
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
 
234 234
         <p>
235 235
             <label
236
-                for="<?php echo $this->get_field_id('max_show'); ?>"><?php _e('Number of posts(shown at one time, requires a slide width to be set):', 'geodirectory');?>
236
+                for="<?php echo $this->get_field_id('max_show'); ?>"><?php _e('Number of posts(shown at one time, requires a slide width to be set):', 'geodirectory'); ?>
237 237
                 <input class="widefat" id="<?php echo $this->get_field_id('max_show'); ?>"
238 238
                        name="<?php echo $this->get_field_name('max_show'); ?>" type="text"
239 239
                        value="<?php echo esc_attr($max_show); ?>"/>
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
 
243 243
         <p>
244 244
             <label
245
-                for="<?php echo $this->get_field_id('slide_width'); ?>"><?php _e('Slide width(leave blank unless showing more than one slide at a time, ex: 210):', 'geodirectory');?>
245
+                for="<?php echo $this->get_field_id('slide_width'); ?>"><?php _e('Slide width(leave blank unless showing more than one slide at a time, ex: 210):', 'geodirectory'); ?>
246 246
                 <input class="widefat" id="<?php echo $this->get_field_id('slide_width'); ?>"
247 247
                        name="<?php echo $this->get_field_name('slide_width'); ?>" type="text"
248 248
                        value="<?php echo esc_attr($slide_width); ?>"/>
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
 
252 252
         <p>
253 253
             <label
254
-                for="<?php echo $this->get_field_id('animation'); ?>"><?php _e('Animation:', 'geodirectory');?>
254
+                for="<?php echo $this->get_field_id('animation'); ?>"><?php _e('Animation:', 'geodirectory'); ?>
255 255
 
256 256
                 <select class="widefat" id="<?php echo $this->get_field_id('animation'); ?>"
257 257
                         name="<?php echo $this->get_field_name('animation'); ?>">
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
 
270 270
         <p>
271 271
             <label
272
-                for="<?php echo $this->get_field_id('slideshowSpeed'); ?>"><?php _e('Slide Show Speed: (milliseconds)', 'geodirectory');?>
272
+                for="<?php echo $this->get_field_id('slideshowSpeed'); ?>"><?php _e('Slide Show Speed: (milliseconds)', 'geodirectory'); ?>
273 273
 
274 274
                 <input class="widefat" id="<?php echo $this->get_field_id('slideshowSpeed'); ?>"
275 275
                        name="<?php echo $this->get_field_name('slideshowSpeed'); ?>" type="text"
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 
280 280
         <p>
281 281
             <label
282
-                for="<?php echo $this->get_field_id('animationSpeed'); ?>"><?php _e('Animation Speed: (milliseconds)', 'geodirectory');?>
282
+                for="<?php echo $this->get_field_id('animationSpeed'); ?>"><?php _e('Animation Speed: (milliseconds)', 'geodirectory'); ?>
283 283
 
284 284
                 <input class="widefat" id="<?php echo $this->get_field_id('animationSpeed'); ?>"
285 285
                        name="<?php echo $this->get_field_name('animationSpeed'); ?>" type="text"
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
 
290 290
         <p>
291 291
             <label
292
-                for="<?php echo $this->get_field_id('slideshow'); ?>"><?php _e('SlideShow:', 'geodirectory');?>
292
+                for="<?php echo $this->get_field_id('slideshow'); ?>"><?php _e('SlideShow:', 'geodirectory'); ?>
293 293
 
294 294
                 <input type="checkbox" <?php if ($slideshow) {
295 295
                     echo 'checked="checked"';
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
 
302 302
         <p>
303 303
             <label
304
-                for="<?php echo $this->get_field_id('animationLoop'); ?>"><?php _e('AnimationLoop:', 'geodirectory');?>
304
+                for="<?php echo $this->get_field_id('animationLoop'); ?>"><?php _e('AnimationLoop:', 'geodirectory'); ?>
305 305
 
306 306
                 <input type="checkbox" <?php if ($animationLoop) {
307 307
                     echo 'checked="checked"';
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
 
314 314
         <p>
315 315
             <label
316
-                for="<?php echo $this->get_field_id('directionNav'); ?>"><?php _e('DirectionNav:', 'geodirectory');?>
316
+                for="<?php echo $this->get_field_id('directionNav'); ?>"><?php _e('DirectionNav:', 'geodirectory'); ?>
317 317
 
318 318
                 <input type="checkbox" <?php if ($directionNav) {
319 319
                     echo 'checked="checked"';
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
 
327 327
         <p>
328 328
             <label
329
-                for="<?php echo $this->get_field_id('show_title'); ?>"><?php _e('Show Title:', 'geodirectory');?>
329
+                for="<?php echo $this->get_field_id('show_title'); ?>"><?php _e('Show Title:', 'geodirectory'); ?>
330 330
 
331 331
                 <input type="checkbox" <?php if ($show_title) {
332 332
                     echo 'checked="checked"';
@@ -345,9 +345,9 @@  discard block
 block discarded – undo
345 345
         </p>
346 346
         <p>
347 347
             <label for="<?php echo $this->get_field_id('add_location_filter'); ?>">
348
-                <?php _e('Enable Location Filter:', 'geodirectory');?>
348
+                <?php _e('Enable Location Filter:', 'geodirectory'); ?>
349 349
                 <input type="checkbox" id="<?php echo $this->get_field_id('add_location_filter'); ?>"
350
-                       name="<?php echo $this->get_field_name('add_location_filter'); ?>" <?php if ($add_location_filter) echo 'checked="checked"';?>
350
+                       name="<?php echo $this->get_field_name('add_location_filter'); ?>" <?php if ($add_location_filter) echo 'checked="checked"'; ?>
351 351
                        value="1"/>
352 352
             </label>
353 353
         </p>
@@ -368,10 +368,10 @@  discard block
 block discarded – undo
368 368
 
369 369
             }
370 370
 
371
-            <?php if(is_active_widget( false, false, $this->id_base, true )){ ?>
371
+            <?php if (is_active_widget(false, false, $this->id_base, true)) { ?>
372 372
             var post_type = jQuery('#<?php echo $this->get_field_id('post_type'); ?>').val();
373 373
 
374
-            geodir_change_category_list(post_type, '<?php echo $category;?>');
374
+            geodir_change_category_list(post_type, '<?php echo $category; ?>');
375 375
             <?php } ?>
376 376
 
377 377
         </script>
Please login to merge, or discard this patch.
Braces   +13 added lines, -6 removed lines patch added patch discarded remove patch
@@ -74,10 +74,11 @@  discard block
 block discarded – undo
74 74
         $instance['animation'] = $new_instance['animation'];
75 75
         $instance['list_sort'] = isset($new_instance['list_sort']) ? $new_instance['list_sort'] : '';
76 76
         $instance['show_featured_only'] = isset($new_instance['show_featured_only']) && $new_instance['show_featured_only'] ? 1 : 0;
77
-        if (isset($new_instance['add_location_filter']) && $new_instance['add_location_filter'] != '')
78
-            $instance['add_location_filter'] = strip_tags($new_instance['add_location_filter']);
79
-        else
80
-            $instance['add_location_filter'] = '0';
77
+        if (isset($new_instance['add_location_filter']) && $new_instance['add_location_filter'] != '') {
78
+                    $instance['add_location_filter'] = strip_tags($new_instance['add_location_filter']);
79
+        } else {
80
+                    $instance['add_location_filter'] = '0';
81
+        }
81 82
 
82 83
         return $instance;
83 84
     }
@@ -339,7 +340,10 @@  discard block
 block discarded – undo
339 340
             <label
340 341
                 for="<?php echo $this->get_field_id('show_featured_only'); ?>"><?php _e('Show only featured listings:', 'geodirectory'); ?>
341 342
                 <input type="checkbox" id="<?php echo $this->get_field_id('show_featured_only'); ?>"
342
-                       name="<?php echo $this->get_field_name('show_featured_only'); ?>" <?php if ($show_featured_only) echo 'checked="checked"'; ?>
343
+                       name="<?php echo $this->get_field_name('show_featured_only'); ?>" <?php if ($show_featured_only) {
344
+	echo 'checked="checked"';
345
+}
346
+?>
343 347
                        value="1"/>
344 348
             </label>
345 349
         </p>
@@ -347,7 +351,10 @@  discard block
 block discarded – undo
347 351
             <label for="<?php echo $this->get_field_id('add_location_filter'); ?>">
348 352
                 <?php _e('Enable Location Filter:', 'geodirectory');?>
349 353
                 <input type="checkbox" id="<?php echo $this->get_field_id('add_location_filter'); ?>"
350
-                       name="<?php echo $this->get_field_name('add_location_filter'); ?>" <?php if ($add_location_filter) echo 'checked="checked"';?>
354
+                       name="<?php echo $this->get_field_name('add_location_filter'); ?>" <?php if ($add_location_filter) {
355
+	echo 'checked="checked"';
356
+}
357
+?>
351 358
                        value="1"/>
352 359
             </label>
353 360
         </p>
Please login to merge, or discard this patch.