Test Failed
Push — master ( c1df28...a05170 )
by Stiofan
15:12
created
geodirectory-functions/custom_fields_functions.php 1 patch
Spacing   +463 added lines, -463 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];
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
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
     );
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
         $cf = $result_str;
170 170
         if (!is_object($cf)) {
171 171
 
172
-            $field_info = $wpdb->get_row($wpdb->prepare("select * from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id= %d", array($cf)));
172
+            $field_info = $wpdb->get_row($wpdb->prepare("select * from ".GEODIR_CUSTOM_FIELDS_TABLE." where id= %d", array($cf)));
173 173
 
174 174
         } else {
175 175
             $field_info = $cf;
@@ -203,14 +203,14 @@  discard block
 block discarded – undo
203 203
         if ($field_id != '') {
204 204
             $cf = trim($field_id, '_');
205 205
 
206
-            if ($field = $wpdb->get_row($wpdb->prepare("select htmlvar_name,post_type,field_type from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id= %d", array($cf)))) {
207
-                $wpdb->query($wpdb->prepare("delete from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id= %d ", array($cf)));
206
+            if ($field = $wpdb->get_row($wpdb->prepare("select htmlvar_name,post_type,field_type from ".GEODIR_CUSTOM_FIELDS_TABLE." where id= %d", array($cf)))) {
207
+                $wpdb->query($wpdb->prepare("delete from ".GEODIR_CUSTOM_FIELDS_TABLE." where id= %d ", array($cf)));
208 208
 
209 209
                 $post_type = $field->post_type;
210 210
                 $htmlvar_name = $field->htmlvar_name;
211 211
 
212 212
                 if ($post_type != '' && $htmlvar_name != '') {
213
-                    $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
+                    $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)));
214 214
                 }
215 215
 
216 216
                 /**
@@ -224,18 +224,18 @@  discard block
 block discarded – undo
224 224
                 do_action('geodir_after_custom_field_deleted', $cf, $field->htmlvar_name, $post_type);
225 225
 
226 226
                 if ($field->field_type == 'address') {
227
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_address`");
228
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_city`");
229
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_region`");
230
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_country`");
231
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_zip`");
232
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_latitude`");
233
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_longitude`");
234
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_mapview`");
235
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_mapzoom`");
227
+                    $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_address`");
228
+                    $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_city`");
229
+                    $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_region`");
230
+                    $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_country`");
231
+                    $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_zip`");
232
+                    $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_latitude`");
233
+                    $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_longitude`");
234
+                    $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_mapview`");
235
+                    $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_mapzoom`");
236 236
                 } else {
237 237
                     if ($field->field_type != 'fieldset') {
238
-                        $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "`");
238
+                        $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."`");
239 239
                     }
240 240
                 }
241 241
 
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
         $result_str = isset($request_field['field_id']) ? trim($request_field['field_id']) : '';
305 305
 
306 306
         // some servers fail if a POST value is VARCHAR so we change it.
307
-        if(isset($request_field['data_type']) && $request_field['data_type']=='XVARCHAR'){
307
+        if (isset($request_field['data_type']) && $request_field['data_type'] == 'XVARCHAR') {
308 308
             $request_field['data_type'] = 'VARCHAR';
309 309
         }
310 310
 
@@ -317,12 +317,12 @@  discard block
 block discarded – undo
317 317
         $post_type = $request_field['listing_type'];
318 318
 
319 319
         if ($request_field['field_type'] != 'address' && $request_field['field_type'] != 'taxonomy' && $request_field['field_type'] != 'fieldset') {
320
-            $cehhtmlvar_name = 'geodir_' . $cehhtmlvar_name;
320
+            $cehhtmlvar_name = 'geodir_'.$cehhtmlvar_name;
321 321
         }
322 322
 
323 323
         $check_html_variable = $wpdb->get_var(
324 324
             $wpdb->prepare(
325
-                "select htmlvar_name from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id <> %d and htmlvar_name = %s and post_type = %s ",
325
+                "select htmlvar_name from ".GEODIR_CUSTOM_FIELDS_TABLE." where id <> %d and htmlvar_name = %s and post_type = %s ",
326 326
                 array($cf, $cehhtmlvar_name, $post_type)
327 327
             )
328 328
         );
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
 
335 335
                 $post_meta_info = $wpdb->get_row(
336 336
                     $wpdb->prepare(
337
-                        "select * from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id = %d",
337
+                        "select * from ".GEODIR_CUSTOM_FIELDS_TABLE." where id = %d",
338 338
                         array($cf)
339 339
                     )
340 340
                 );
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
             if ($post_type == '') $post_type = 'gd_place';
353 353
 
354 354
 
355
-            $detail_table = $plugin_prefix . $post_type . '_detail';
355
+            $detail_table = $plugin_prefix.$post_type.'_detail';
356 356
 
357 357
             $admin_title = $request_field['admin_title'];
358 358
             $site_title = $request_field['site_title'];
@@ -378,7 +378,7 @@  discard block
 block discarded – undo
378 378
             $for_admin_use = isset($request_field['for_admin_use']) ? $request_field['for_admin_use'] : '';
379 379
 
380 380
             if ($field_type != 'address' && $field_type != 'taxonomy' && $field_type != 'fieldset') {
381
-                $htmlvar_name = 'geodir_' . $htmlvar_name;
381
+                $htmlvar_name = 'geodir_'.$htmlvar_name;
382 382
             }
383 383
 
384 384
             $option_values = '';
@@ -423,9 +423,9 @@  discard block
 block discarded – undo
423 423
 
424 424
             if ($sort_order == '') {
425 425
 
426
-                $last_order = $wpdb->get_var("SELECT MAX(sort_order) as last_order FROM " . GEODIR_CUSTOM_FIELDS_TABLE);
426
+                $last_order = $wpdb->get_var("SELECT MAX(sort_order) as last_order FROM ".GEODIR_CUSTOM_FIELDS_TABLE);
427 427
 
428
-                $sort_order = (int)$last_order + 1;
428
+                $sort_order = (int) $last_order + 1;
429 429
             }
430 430
 
431 431
             $default_value_add = '';
@@ -436,15 +436,15 @@  discard block
 block discarded – undo
436 436
                     case 'address':
437 437
 
438 438
                         if ($htmlvar_name != '') {
439
-                            $prefix = $htmlvar_name . '_';
439
+                            $prefix = $htmlvar_name.'_';
440 440
                         }
441
-                        $old_prefix = $old_html_variable . '_';
441
+                        $old_prefix = $old_html_variable.'_';
442 442
 
443 443
 
444
-                        $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "address` `" . $prefix . "address` VARCHAR( 254 ) NULL";
444
+                        $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."address` `".$prefix."address` VARCHAR( 254 ) NULL";
445 445
 
446 446
                         if ($default_value != '') {
447
-                            $meta_field_add .= " DEFAULT '" . $default_value . "'";
447
+                            $meta_field_add .= " DEFAULT '".$default_value."'";
448 448
                         }
449 449
 
450 450
                         $wpdb->query($meta_field_add);
@@ -453,12 +453,12 @@  discard block
 block discarded – undo
453 453
 
454 454
                             if (isset($extra_fields['show_city']) && $extra_fields['show_city']) {
455 455
 
456
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "city'");
456
+                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."city'");
457 457
                                 if ($is_column) {
458
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "city` `" . $prefix . "city` VARCHAR( 50 ) NULL";
458
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."city` `".$prefix."city` VARCHAR( 50 ) NULL";
459 459
 
460 460
                                     if ($default_value != '') {
461
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
461
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
462 462
                                     }
463 463
 
464 464
                                     $wpdb->query($meta_field_add);
@@ -466,9 +466,9 @@  discard block
 block discarded – undo
466 466
 
467 467
                                     $meta_field_add = "VARCHAR( 50 ) NULL";
468 468
                                     if ($default_value != '') {
469
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
469
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
470 470
                                     }
471
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "city", $meta_field_add);
471
+                                    geodir_add_column_if_not_exist($detail_table, $prefix."city", $meta_field_add);
472 472
 
473 473
                                 }
474 474
 
@@ -478,36 +478,36 @@  discard block
 block discarded – undo
478 478
 
479 479
                             if (isset($extra_fields['show_region']) && $extra_fields['show_region']) {
480 480
 
481
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "region'");
481
+                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."region'");
482 482
 
483 483
                                 if ($is_column) {
484
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "region` `" . $prefix . "region` VARCHAR( 50 ) NULL";
484
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."region` `".$prefix."region` VARCHAR( 50 ) NULL";
485 485
 
486 486
                                     if ($default_value != '') {
487
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
487
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
488 488
                                     }
489 489
 
490 490
                                     $wpdb->query($meta_field_add);
491 491
                                 } else {
492 492
                                     $meta_field_add = "VARCHAR( 50 ) NULL";
493 493
                                     if ($default_value != '') {
494
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
494
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
495 495
                                     }
496 496
 
497
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "region", $meta_field_add);
497
+                                    geodir_add_column_if_not_exist($detail_table, $prefix."region", $meta_field_add);
498 498
                                 }
499 499
 
500 500
                             }
501 501
                             if (isset($extra_fields['show_country']) && $extra_fields['show_country']) {
502 502
 
503
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "country'");
503
+                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."country'");
504 504
 
505 505
                                 if ($is_column) {
506 506
 
507
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "country` `" . $prefix . "country` VARCHAR( 50 ) NULL";
507
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."country` `".$prefix."country` VARCHAR( 50 ) NULL";
508 508
 
509 509
                                     if ($default_value != '') {
510
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
510
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
511 511
                                     }
512 512
 
513 513
                                     $wpdb->query($meta_field_add);
@@ -515,24 +515,24 @@  discard block
 block discarded – undo
515 515
 
516 516
                                     $meta_field_add = "VARCHAR( 50 ) NULL";
517 517
                                     if ($default_value != '') {
518
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
518
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
519 519
                                     }
520 520
 
521
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "country", $meta_field_add);
521
+                                    geodir_add_column_if_not_exist($detail_table, $prefix."country", $meta_field_add);
522 522
 
523 523
                                 }
524 524
 
525 525
                             }
526 526
                             if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) {
527 527
 
528
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "zip'");
528
+                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."zip'");
529 529
 
530 530
                                 if ($is_column) {
531 531
 
532
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "zip` `" . $prefix . "zip` VARCHAR( 50 ) NULL";
532
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."zip` `".$prefix."zip` VARCHAR( 50 ) NULL";
533 533
 
534 534
                                     if ($default_value != '') {
535
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
535
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
536 536
                                     }
537 537
 
538 538
                                     $wpdb->query($meta_field_add);
@@ -540,128 +540,128 @@  discard block
 block discarded – undo
540 540
 
541 541
                                     $meta_field_add = "VARCHAR( 50 ) NULL";
542 542
                                     if ($default_value != '') {
543
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
543
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
544 544
                                     }
545 545
 
546
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "zip", $meta_field_add);
546
+                                    geodir_add_column_if_not_exist($detail_table, $prefix."zip", $meta_field_add);
547 547
 
548 548
                                 }
549 549
 
550 550
                             }
551 551
                             if (isset($extra_fields['show_map']) && $extra_fields['show_map']) {
552 552
 
553
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "latitude'");
553
+                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."latitude'");
554 554
                                 if ($is_column) {
555 555
 
556
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "latitude` `" . $prefix . "latitude` VARCHAR( 20 ) NULL";
556
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."latitude` `".$prefix."latitude` VARCHAR( 20 ) NULL";
557 557
 
558 558
                                     if ($default_value != '') {
559
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
559
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
560 560
                                     }
561 561
 
562 562
                                     $wpdb->query($meta_field_add);
563 563
                                 } else {
564 564
 
565
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "latitude` VARCHAR( 20 ) NULL";
565
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."latitude` VARCHAR( 20 ) NULL";
566 566
                                     $meta_field_add = "VARCHAR( 20 ) NULL";
567 567
                                     if ($default_value != '') {
568
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
568
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
569 569
                                     }
570 570
 
571
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "latitude", $meta_field_add);
571
+                                    geodir_add_column_if_not_exist($detail_table, $prefix."latitude", $meta_field_add);
572 572
 
573 573
                                 }
574 574
 
575 575
 
576
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "longitude'");
576
+                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."longitude'");
577 577
 
578 578
                                 if ($is_column) {
579
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "longitude` `" . $prefix . "longitude` VARCHAR( 20 ) NULL";
579
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."longitude` `".$prefix."longitude` VARCHAR( 20 ) NULL";
580 580
 
581 581
                                     if ($default_value != '') {
582
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
582
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
583 583
                                     }
584 584
 
585 585
                                     $wpdb->query($meta_field_add);
586 586
                                 } else {
587 587
 
588
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "longitude` VARCHAR( 20 ) NULL";
588
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."longitude` VARCHAR( 20 ) NULL";
589 589
                                     $meta_field_add = "VARCHAR( 20 ) NULL";
590 590
                                     if ($default_value != '') {
591
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
591
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
592 592
                                     }
593 593
 
594
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "longitude", $meta_field_add);
594
+                                    geodir_add_column_if_not_exist($detail_table, $prefix."longitude", $meta_field_add);
595 595
                                 }
596 596
 
597 597
                             }
598 598
                             if (isset($extra_fields['show_mapview']) && $extra_fields['show_mapview']) {
599 599
 
600
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "mapview'");
600
+                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."mapview'");
601 601
 
602 602
                                 if ($is_column) {
603
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "mapview` `" . $prefix . "mapview` VARCHAR( 15 ) NULL";
603
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."mapview` `".$prefix."mapview` VARCHAR( 15 ) NULL";
604 604
 
605 605
                                     if ($default_value != '') {
606
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
606
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
607 607
                                     }
608 608
 
609 609
                                     $wpdb->query($meta_field_add);
610 610
                                 } else {
611 611
 
612
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "mapview` VARCHAR( 15 ) NULL";
612
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."mapview` VARCHAR( 15 ) NULL";
613 613
 
614 614
                                     $meta_field_add = "VARCHAR( 15 ) NULL";
615 615
                                     if ($default_value != '') {
616
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
616
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
617 617
                                     }
618 618
 
619
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "mapview", $meta_field_add);
619
+                                    geodir_add_column_if_not_exist($detail_table, $prefix."mapview", $meta_field_add);
620 620
                                 }
621 621
 
622 622
 
623 623
                             }
624 624
                             if (isset($extra_fields['show_mapzoom']) && $extra_fields['show_mapzoom']) {
625 625
 
626
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "mapzoom'");
626
+                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."mapzoom'");
627 627
                                 if ($is_column) {
628
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "mapzoom` `" . $prefix . "mapzoom` VARCHAR( 3 ) NULL";
628
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."mapzoom` `".$prefix."mapzoom` VARCHAR( 3 ) NULL";
629 629
 
630 630
                                     if ($default_value != '') {
631
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
631
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
632 632
                                     }
633 633
 
634 634
                                     $wpdb->query($meta_field_add);
635 635
 
636 636
                                 } else {
637 637
 
638
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "mapzoom` VARCHAR( 3 ) NULL";
638
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."mapzoom` VARCHAR( 3 ) NULL";
639 639
 
640 640
                                     $meta_field_add = "VARCHAR( 3 ) NULL";
641 641
                                     if ($default_value != '') {
642
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
642
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
643 643
                                     }
644 644
 
645
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "mapzoom", $meta_field_add);
645
+                                    geodir_add_column_if_not_exist($detail_table, $prefix."mapzoom", $meta_field_add);
646 646
                                 }
647 647
 
648 648
                             }
649 649
                             // show lat lng
650 650
                             if (isset($extra_fields['show_latlng']) && $extra_fields['show_latlng']) {
651
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "latlng'");
651
+                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."latlng'");
652 652
 
653 653
                                 if ($is_column) {
654
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "latlng` `" . $prefix . "latlng` VARCHAR( 3 ) NULL";
654
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."latlng` `".$prefix."latlng` VARCHAR( 3 ) NULL";
655 655
                                     $meta_field_add .= " DEFAULT '1'";
656 656
 
657 657
                                     $wpdb->query($meta_field_add);
658 658
                                 } else {
659
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "latlng` VARCHAR( 3 ) NULL";
659
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."latlng` VARCHAR( 3 ) NULL";
660 660
 
661 661
                                     $meta_field_add = "VARCHAR( 3 ) NULL";
662 662
                                     $meta_field_add .= " DEFAULT '1'";
663 663
 
664
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "latlng", $meta_field_add);
664
+                                    geodir_add_column_if_not_exist($detail_table, $prefix."latlng", $meta_field_add);
665 665
                                 }
666 666
 
667 667
                             }
@@ -677,30 +677,30 @@  discard block
 block discarded – undo
677 677
                         $op_size = '500';
678 678
 
679 679
                         // only make the field as big as it needs to be.
680
-                        if(isset($option_values) && $option_values && $field_type=='select'){
681
-                            $option_values_arr = explode(',',$option_values);
682
-                            if(is_array($option_values_arr)){
680
+                        if (isset($option_values) && $option_values && $field_type == 'select') {
681
+                            $option_values_arr = explode(',', $option_values);
682
+                            if (is_array($option_values_arr)) {
683 683
                                 $op_max = 0;
684
-                                foreach($option_values_arr as $op_val){
685
-                                    if(strlen($op_val) && strlen($op_val)>$op_max){$op_max = strlen($op_val);}
684
+                                foreach ($option_values_arr as $op_val) {
685
+                                    if (strlen($op_val) && strlen($op_val) > $op_max) {$op_max = strlen($op_val); }
686 686
                                 }
687
-                                if($op_max){$op_size =$op_max; }
687
+                                if ($op_max) {$op_size = $op_max; }
688 688
                             }
689
-                        }elseif(isset($option_values) && $option_values && $field_type=='multiselect'){
690
-                            if(strlen($option_values)){
691
-                                $op_size =  strlen($option_values);
689
+                        }elseif (isset($option_values) && $option_values && $field_type == 'multiselect') {
690
+                            if (strlen($option_values)) {
691
+                                $op_size = strlen($option_values);
692 692
                             }
693 693
                         }
694 694
 
695
-                        $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "`VARCHAR( $op_size ) NULL";
695
+                        $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_html_variable."` `".$htmlvar_name."`VARCHAR( $op_size ) NULL";
696 696
 
697 697
                         if ($default_value != '') {
698
-                            $meta_field_add .= " DEFAULT '" . $default_value . "'";
698
+                            $meta_field_add .= " DEFAULT '".$default_value."'";
699 699
                         }
700 700
 
701 701
                         $alter_result = $wpdb->query($meta_field_add);
702
-                        if($alter_result===false){
703
-                            return __('Column change failed, you may have too many columns.','geodirectory');
702
+                        if ($alter_result === false) {
703
+                            return __('Column change failed, you may have too many columns.', 'geodirectory');
704 704
                         }
705 705
 
706 706
                         if (isset($request_field['cat_display_type']))
@@ -717,9 +717,9 @@  discard block
 block discarded – undo
717 717
                     case 'url':
718 718
                     case 'file':
719 719
 
720
-                        $alter_result = $wpdb->query("ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "` TEXT NULL");
721
-                        if($alter_result===false){
722
-                            return __('Column change failed, you may have too many columns.','geodirectory');
720
+                        $alter_result = $wpdb->query("ALTER TABLE ".$detail_table." CHANGE `".$old_html_variable."` `".$htmlvar_name."` TEXT NULL");
721
+                        if ($alter_result === false) {
722
+                            return __('Column change failed, you may have too many columns.', 'geodirectory');
723 723
                         }
724 724
                         if (isset($request_field['advanced_editor']))
725 725
                             $extra_fields = $request_field['advanced_editor'];
@@ -733,24 +733,24 @@  discard block
 block discarded – undo
733 733
                     default:
734 734
                         if ($data_type != 'VARCHAR' && $data_type != '') {
735 735
                             if ($data_type == 'FLOAT' && $decimal_point > 0) {
736
-                                $default_value_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "` DECIMAL(11, " . (int)$decimal_point . ") NULL";
736
+                                $default_value_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_html_variable."` `".$htmlvar_name."` DECIMAL(11, ".(int) $decimal_point.") NULL";
737 737
                             } else {
738
-                                $default_value_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "` " . $data_type . " NULL";
738
+                                $default_value_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_html_variable."` `".$htmlvar_name."` ".$data_type." NULL";
739 739
                             }
740 740
 
741 741
                             if (is_numeric($default_value) && $default_value != '') {
742
-                                $default_value_add .= " DEFAULT '" . $default_value . "'";
742
+                                $default_value_add .= " DEFAULT '".$default_value."'";
743 743
                             }
744 744
                         } else {
745
-                            $default_value_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "` VARCHAR( 254 ) NULL";
745
+                            $default_value_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_html_variable."` `".$htmlvar_name."` VARCHAR( 254 ) NULL";
746 746
                             if ($default_value != '') {
747
-                                $default_value_add .= " DEFAULT '" . $default_value . "'";
747
+                                $default_value_add .= " DEFAULT '".$default_value."'";
748 748
                             }
749 749
                         }
750 750
 
751 751
                         $alter_result = $wpdb->query($default_value_add);
752
-                        if($alter_result===false){
753
-                            return __('Column change failed, you may have too many columns.','geodirectory');
752
+                        if ($alter_result === false) {
753
+                            return __('Column change failed, you may have too many columns.', 'geodirectory');
754 754
                         }
755 755
                         break;
756 756
                 endswitch;
@@ -766,7 +766,7 @@  discard block
 block discarded – undo
766 766
 
767 767
                     $wpdb->prepare(
768 768
 
769
-                        "update " . GEODIR_CUSTOM_FIELDS_TABLE . " set 
769
+                        "update ".GEODIR_CUSTOM_FIELDS_TABLE." set 
770 770
 					post_type = %s,
771 771
 					admin_title = %s,
772 772
 					site_title = %s,
@@ -798,7 +798,7 @@  discard block
 block discarded – undo
798 798
 					for_admin_use = %s
799 799
 					where id = %d",
800 800
 
801
-                        array($post_type, $admin_title, $site_title, $field_type, $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_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)
801
+                        array($post_type, $admin_title, $site_title, $field_type, $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_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)
802 802
                     )
803 803
 
804 804
                 );
@@ -808,7 +808,7 @@  discard block
 block discarded – undo
808 808
 
809 809
                 $wpdb->query(
810 810
                     $wpdb->prepare(
811
-                        "update " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set 
811
+                        "update ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." set 
812 812
 					 	site_title=%s
813 813
 					where post_type = %s and htmlvar_name = %s",
814 814
                         array($site_title, $post_type, $htmlvar_name)
@@ -817,7 +817,7 @@  discard block
 block discarded – undo
817 817
 
818 818
 
819 819
                 if ($cat_sort == '')
820
-                    $wpdb->query($wpdb->prepare("delete from " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " where post_type = %s and htmlvar_name = %s", array($post_type, $htmlvar_name)));
820
+                    $wpdb->query($wpdb->prepare("delete from ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." where post_type = %s and htmlvar_name = %s", array($post_type, $htmlvar_name)));
821 821
 
822 822
 
823 823
                 /**
@@ -837,7 +837,7 @@  discard block
 block discarded – undo
837 837
                         $data_type = '';
838 838
 
839 839
                         if ($htmlvar_name != '') {
840
-                            $prefix = $htmlvar_name . '_';
840
+                            $prefix = $htmlvar_name.'_';
841 841
                         }
842 842
                         $old_prefix = $old_html_variable;
843 843
 
@@ -845,109 +845,109 @@  discard block
 block discarded – undo
845 845
 
846 846
                         $meta_field_add = "VARCHAR( 254 ) NULL";
847 847
                         if ($default_value != '') {
848
-                            $meta_field_add .= " DEFAULT '" . $default_value . "'";
848
+                            $meta_field_add .= " DEFAULT '".$default_value."'";
849 849
                         }
850 850
 
851
-                        geodir_add_column_if_not_exist($detail_table, $prefix . "address", $meta_field_add);
851
+                        geodir_add_column_if_not_exist($detail_table, $prefix."address", $meta_field_add);
852 852
                         //$wpdb->query($meta_field_add);
853 853
 
854 854
 
855 855
                         if (!empty($extra_fields)) {
856 856
 
857 857
                             if (isset($extra_fields['show_city']) && $extra_fields['show_city']) {
858
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "city` VARCHAR( 30 ) NULL";
858
+                                $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."city` VARCHAR( 30 ) NULL";
859 859
                                 $meta_field_add = "VARCHAR( 30 ) NULL";
860 860
                                 if ($default_value != '') {
861
-                                    $meta_field_add .= " DEFAULT '" . $default_value . "'";
861
+                                    $meta_field_add .= " DEFAULT '".$default_value."'";
862 862
                                 }
863 863
 
864
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "city", $meta_field_add);
864
+                                geodir_add_column_if_not_exist($detail_table, $prefix."city", $meta_field_add);
865 865
                                 //$wpdb->query($meta_field_add);
866 866
                             }
867 867
                             if (isset($extra_fields['show_region']) && $extra_fields['show_region']) {
868
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "region` VARCHAR( 30 ) NULL";
868
+                                $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."region` VARCHAR( 30 ) NULL";
869 869
                                 $meta_field_add = "VARCHAR( 30 ) NULL";
870 870
                                 if ($default_value != '') {
871
-                                    $meta_field_add .= " DEFAULT '" . $default_value . "'";
871
+                                    $meta_field_add .= " DEFAULT '".$default_value."'";
872 872
                                 }
873 873
 
874
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "region", $meta_field_add);
874
+                                geodir_add_column_if_not_exist($detail_table, $prefix."region", $meta_field_add);
875 875
                                 //$wpdb->query($meta_field_add);
876 876
                             }
877 877
                             if (isset($extra_fields['show_country']) && $extra_fields['show_country']) {
878
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "country` VARCHAR( 30 ) NULL";
878
+                                $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."country` VARCHAR( 30 ) NULL";
879 879
 
880 880
                                 $meta_field_add = "VARCHAR( 30 ) NULL";
881 881
                                 if ($default_value != '') {
882
-                                    $meta_field_add .= " DEFAULT '" . $default_value . "'";
882
+                                    $meta_field_add .= " DEFAULT '".$default_value."'";
883 883
                                 }
884 884
 
885
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "country", $meta_field_add);
885
+                                geodir_add_column_if_not_exist($detail_table, $prefix."country", $meta_field_add);
886 886
                                 //$wpdb->query($meta_field_add);
887 887
                             }
888 888
                             if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) {
889
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "zip` VARCHAR( 15 ) NULL";
889
+                                $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."zip` VARCHAR( 15 ) NULL";
890 890
                                 $meta_field_add = "VARCHAR( 15 ) NULL";
891 891
                                 if ($default_value != '') {
892
-                                    $meta_field_add .= " DEFAULT '" . $default_value . "'";
892
+                                    $meta_field_add .= " DEFAULT '".$default_value."'";
893 893
                                 }
894 894
 
895
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "zip", $meta_field_add);
895
+                                geodir_add_column_if_not_exist($detail_table, $prefix."zip", $meta_field_add);
896 896
                                 //$wpdb->query($meta_field_add);
897 897
                             }
898 898
                             if (isset($extra_fields['show_map']) && $extra_fields['show_map']) {
899
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "latitude` VARCHAR( 20 ) NULL";
899
+                                $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."latitude` VARCHAR( 20 ) NULL";
900 900
                                 $meta_field_add = "VARCHAR( 20 ) NULL";
901 901
                                 if ($default_value != '') {
902
-                                    $meta_field_add .= " DEFAULT '" . $default_value . "'";
902
+                                    $meta_field_add .= " DEFAULT '".$default_value."'";
903 903
                                 }
904 904
 
905
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "latitude", $meta_field_add);
905
+                                geodir_add_column_if_not_exist($detail_table, $prefix."latitude", $meta_field_add);
906 906
                                 //$wpdb->query($meta_field_add);
907 907
 
908
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "longitude` VARCHAR( 20 ) NULL";
908
+                                $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."longitude` VARCHAR( 20 ) NULL";
909 909
 
910 910
                                 $meta_field_add = "VARCHAR( 20 ) NULL";
911 911
                                 if ($default_value != '') {
912
-                                    $meta_field_add .= " DEFAULT '" . $default_value . "'";
912
+                                    $meta_field_add .= " DEFAULT '".$default_value."'";
913 913
                                 }
914 914
 
915
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "longitude", $meta_field_add);
915
+                                geodir_add_column_if_not_exist($detail_table, $prefix."longitude", $meta_field_add);
916 916
 
917 917
                                 //$wpdb->query($meta_field_add);
918 918
                             }
919 919
                             if (isset($extra_fields['show_mapview']) && $extra_fields['show_mapview']) {
920
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "mapview` VARCHAR( 15 ) NULL";
920
+                                $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."mapview` VARCHAR( 15 ) NULL";
921 921
 
922 922
                                 $meta_field_add = "VARCHAR( 15 ) NULL";
923 923
                                 if ($default_value != '') {
924
-                                    $meta_field_add .= " DEFAULT '" . $default_value . "'";
924
+                                    $meta_field_add .= " DEFAULT '".$default_value."'";
925 925
                                 }
926 926
 
927
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "mapview", $meta_field_add);
927
+                                geodir_add_column_if_not_exist($detail_table, $prefix."mapview", $meta_field_add);
928 928
 
929 929
                                 //$wpdb->query($meta_field_add);
930 930
                             }
931 931
                             if (isset($extra_fields['show_mapzoom']) && $extra_fields['show_mapzoom']) {
932
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "mapzoom` VARCHAR( 3 ) NULL";
932
+                                $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."mapzoom` VARCHAR( 3 ) NULL";
933 933
 
934 934
                                 $meta_field_add = "VARCHAR( 3 ) NULL";
935 935
                                 if ($default_value != '') {
936
-                                    $meta_field_add .= " DEFAULT '" . $default_value . "'";
936
+                                    $meta_field_add .= " DEFAULT '".$default_value."'";
937 937
                                 }
938 938
 
939
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "mapzoom", $meta_field_add);
939
+                                geodir_add_column_if_not_exist($detail_table, $prefix."mapzoom", $meta_field_add);
940 940
 
941 941
                                 //$wpdb->query($meta_field_add);
942 942
                             }
943 943
                             // show lat lng
944 944
                             if (isset($extra_fields['show_latlng']) && $extra_fields['show_latlng']) {
945
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "latlng` VARCHAR( 3 ) NULL";
945
+                                $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."latlng` VARCHAR( 3 ) NULL";
946 946
 
947 947
                                 $meta_field_add = "VARCHAR( 3 ) NULL";
948 948
                                 $meta_field_add .= " DEFAULT '1'";
949 949
 
950
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "latlng", $meta_field_add);
950
+                                geodir_add_column_if_not_exist($detail_table, $prefix."latlng", $meta_field_add);
951 951
                                 //$wpdb->query($meta_field_add);
952 952
                             }
953 953
                         }
@@ -957,8 +957,8 @@  discard block
 block discarded – undo
957 957
                     case 'checkbox':
958 958
                         $data_type = 'TINYINT';
959 959
 
960
-                        $meta_field_add = $data_type . "( 1 ) NOT NULL ";
961
-                        if ((int)$default_value === 1) {
960
+                        $meta_field_add = $data_type."( 1 ) NOT NULL ";
961
+                        if ((int) $default_value === 1) {
962 962
                             $meta_field_add .= " DEFAULT '1'";
963 963
                         }
964 964
 
@@ -991,7 +991,7 @@  discard block
 block discarded – undo
991 991
                             }
992 992
                         } elseif (isset($option_values) && $option_values && $field_type == 'multiselect') {
993 993
                             if (strlen($option_values)) {
994
-                                $op_size =  strlen($option_values);
994
+                                $op_size = strlen($option_values);
995 995
                             }
996 996
 
997 997
                             if (isset($request_field['multi_display_type'])) {
@@ -999,9 +999,9 @@  discard block
 block discarded – undo
999 999
                             }
1000 1000
                         }
1001 1001
 
1002
-                        $meta_field_add = $data_type . "( $op_size ) NULL ";
1002
+                        $meta_field_add = $data_type."( $op_size ) NULL ";
1003 1003
                         if ($default_value != '') {
1004
-                            $meta_field_add .= " DEFAULT '" . $default_value . "'";
1004
+                            $meta_field_add .= " DEFAULT '".$default_value."'";
1005 1005
                         }
1006 1006
 
1007 1007
                         $add_result = geodir_add_column_if_not_exist($detail_table, $htmlvar_name, $meta_field_add);
@@ -1016,9 +1016,9 @@  discard block
 block discarded – undo
1016 1016
 
1017 1017
                         $data_type = 'TEXT';
1018 1018
 
1019
-                        $default_value_add = " `" . $htmlvar_name . "` " . $data_type . " NULL ";
1019
+                        $default_value_add = " `".$htmlvar_name."` ".$data_type." NULL ";
1020 1020
 
1021
-                        $meta_field_add = $data_type . " NULL ";
1021
+                        $meta_field_add = $data_type." NULL ";
1022 1022
                         /*if($default_value != '')
1023 1023
 					{ $meta_field_add .= " DEFAULT '".$default_value."'"; }*/
1024 1024
 
@@ -1033,9 +1033,9 @@  discard block
 block discarded – undo
1033 1033
 
1034 1034
                         $data_type = 'DATE';
1035 1035
 
1036
-                        $default_value_add = " `" . $htmlvar_name . "` " . $data_type . " NULL ";
1036
+                        $default_value_add = " `".$htmlvar_name."` ".$data_type." NULL ";
1037 1037
 
1038
-                        $meta_field_add = $data_type . " NULL ";
1038
+                        $meta_field_add = $data_type." NULL ";
1039 1039
 
1040 1040
                         $add_result = geodir_add_column_if_not_exist($detail_table, $htmlvar_name, $meta_field_add);
1041 1041
                         if ($add_result === false) {
@@ -1048,9 +1048,9 @@  discard block
 block discarded – undo
1048 1048
 
1049 1049
                         $data_type = 'TIME';
1050 1050
 
1051
-                        $default_value_add = " `" . $htmlvar_name . "` " . $data_type . " NULL ";
1051
+                        $default_value_add = " `".$htmlvar_name."` ".$data_type." NULL ";
1052 1052
 
1053
-                        $meta_field_add = $data_type . " NULL ";
1053
+                        $meta_field_add = $data_type." NULL ";
1054 1054
 
1055 1055
                         $add_result = geodir_add_column_if_not_exist($detail_table, $htmlvar_name, $meta_field_add);
1056 1056
                         if ($add_result === false) {
@@ -1062,22 +1062,22 @@  discard block
 block discarded – undo
1062 1062
                     default:
1063 1063
 
1064 1064
                         if ($data_type != 'VARCHAR' && $data_type != '') {
1065
-                            $meta_field_add = $data_type . " NULL ";
1065
+                            $meta_field_add = $data_type." NULL ";
1066 1066
 
1067 1067
                             if ($data_type == 'FLOAT' && $decimal_point > 0) {
1068
-                                $meta_field_add = "DECIMAL(11, " . (int)$decimal_point . ") NULL ";
1068
+                                $meta_field_add = "DECIMAL(11, ".(int) $decimal_point.") NULL ";
1069 1069
                             }
1070 1070
 
1071 1071
                             if (is_numeric($default_value) && $default_value != '') {
1072
-                                $default_value_add .= " DEFAULT '" . $default_value . "'";
1073
-                                $meta_field_add .= " DEFAULT '" . $default_value . "'";
1072
+                                $default_value_add .= " DEFAULT '".$default_value."'";
1073
+                                $meta_field_add .= " DEFAULT '".$default_value."'";
1074 1074
                             }
1075 1075
                         } else {
1076 1076
                             $meta_field_add = " VARCHAR( 254 ) NULL ";
1077 1077
 
1078 1078
                             if ($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
                         }
1083 1083
 
@@ -1099,7 +1099,7 @@  discard block
 block discarded – undo
1099 1099
 
1100 1100
                     $wpdb->prepare(
1101 1101
 
1102
-                        "insert into " . GEODIR_CUSTOM_FIELDS_TABLE . " set 
1102
+                        "insert into ".GEODIR_CUSTOM_FIELDS_TABLE." set 
1103 1103
 					post_type = %s,
1104 1104
 					admin_title = %s,
1105 1105
 					site_title = %s,
@@ -1130,7 +1130,7 @@  discard block
 block discarded – undo
1130 1130
 					validation_msg = %s,
1131 1131
 					for_admin_use = %s ",
1132 1132
 
1133
-                        array($post_type, $admin_title, $site_title, $field_type, $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_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)
1133
+                        array($post_type, $admin_title, $site_title, $field_type, $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_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)
1134 1134
 
1135 1135
                     )
1136 1136
 
@@ -1142,7 +1142,7 @@  discard block
 block discarded – undo
1142 1142
 
1143 1143
             }
1144 1144
 
1145
-            return (int)$lastid;
1145
+            return (int) $lastid;
1146 1146
 
1147 1147
 
1148 1148
         } else {
@@ -1175,7 +1175,7 @@  discard block
 block discarded – undo
1175 1175
 
1176 1176
             $post_meta_info = $wpdb->query(
1177 1177
                 $wpdb->prepare(
1178
-                    "update " . GEODIR_CUSTOM_FIELDS_TABLE . " set 
1178
+                    "update ".GEODIR_CUSTOM_FIELDS_TABLE." set 
1179 1179
 															sort_order=%d 
1180 1180
 															where id= %d",
1181 1181
                     array($count, $cf)
@@ -1231,7 +1231,7 @@  discard block
 block discarded – undo
1231 1231
         $value = '';
1232 1232
 
1233 1233
         /* field available to site admin only for edit */
1234
-        $for_admin_use = isset($val['for_admin_use']) && (int)$val['for_admin_use'] == 1 ? true : false;
1234
+        $for_admin_use = isset($val['for_admin_use']) && (int) $val['for_admin_use'] == 1 ? true : false;
1235 1235
         if ($for_admin_use && !is_super_admin()) {
1236 1236
             continue;
1237 1237
         }
@@ -1265,22 +1265,22 @@  discard block
 block discarded – undo
1265 1265
          * @param array $val The settings array for the field. {@see geodir_custom_field_save()}.
1266 1266
          * @see 'geodir_after_custom_form_field_$name'
1267 1267
          */
1268
-        do_action('geodir_before_custom_form_field_' . $name, $listing_type, $package_id, $val);
1268
+        do_action('geodir_before_custom_form_field_'.$name, $listing_type, $package_id, $val);
1269 1269
 
1270 1270
         if ($type == 'fieldset') {
1271
-            $fieldset_id = (int)$val['id'];
1272
-            $fieldset_field_class = 'gd-fieldset-' . $fieldset_id;
1271
+            $fieldset_id = (int) $val['id'];
1272
+            $fieldset_field_class = 'gd-fieldset-'.$fieldset_id;
1273 1273
             ?>
1274
-            <h5 id="geodir_fieldset_<?php echo $fieldset_id;?>" class="geodir-fieldset-row" gd-fieldset="<?php echo $fieldset_id;?>"><?php echo $site_title;?>
1275
-                <?php if ($admin_desc != '') echo '<small>( ' . $admin_desc . ' )</small>';?></h5>
1274
+            <h5 id="geodir_fieldset_<?php echo $fieldset_id; ?>" class="geodir-fieldset-row" gd-fieldset="<?php echo $fieldset_id; ?>"><?php echo $site_title; ?>
1275
+                <?php if ($admin_desc != '') echo '<small>( '.$admin_desc.' )</small>'; ?></h5>
1276 1276
             <?php
1277 1277
         } else if ($type == 'address') {
1278
-            $prefix = $name . '_';
1278
+            $prefix = $name.'_';
1279 1279
 
1280
-            ($site_title != '') ? $address_title = $site_title : $address_title = geodir_ucwords($prefix . ' address');
1281
-            ($extra_fields['zip_lable'] != '') ? $zip_title = $extra_fields['zip_lable'] : $zip_title = geodir_ucwords($prefix . ' zip/post code ');
1280
+            ($site_title != '') ? $address_title = $site_title : $address_title = geodir_ucwords($prefix.' address');
1281
+            ($extra_fields['zip_lable'] != '') ? $zip_title = $extra_fields['zip_lable'] : $zip_title = geodir_ucwords($prefix.' zip/post code ');
1282 1282
             ($extra_fields['map_lable'] != '') ? $map_title = $extra_fields['map_lable'] : $map_title = geodir_ucwords('set address on map');
1283
-            ($extra_fields['mapview_lable'] != '') ? $mapview_title = $extra_fields['mapview_lable'] : $mapview_title = geodir_ucwords($prefix . ' mapview');
1283
+            ($extra_fields['mapview_lable'] != '') ? $mapview_title = $extra_fields['mapview_lable'] : $mapview_title = geodir_ucwords($prefix.' mapview');
1284 1284
 
1285 1285
             $address = '';
1286 1286
             $zip = '';
@@ -1291,21 +1291,21 @@  discard block
 block discarded – undo
1291 1291
 
1292 1292
             if (isset($_REQUEST['backandedit']) && $_REQUEST['backandedit'] && $gd_ses_listing = $gd_session->get('listing')) {
1293 1293
                 $post = $gd_ses_listing;
1294
-                $address = $post[$prefix . 'address'];
1295
-                $zip = isset($post[$prefix . 'zip']) ? $post[$prefix . 'zip'] : '';
1296
-                $lat = isset($post[$prefix . 'latitude']) ? $post[$prefix . 'latitude'] : '';
1297
-                $lng = isset($post[$prefix . 'longitude']) ? $post[$prefix . 'longitude'] : '';
1298
-                $mapview = isset($post[$prefix . 'mapview']) ? $post[$prefix . 'mapview'] : '';
1299
-                $mapzoom = isset($post[$prefix . 'mapzoom']) ? $post[$prefix . 'mapzoom'] : '';
1294
+                $address = $post[$prefix.'address'];
1295
+                $zip = isset($post[$prefix.'zip']) ? $post[$prefix.'zip'] : '';
1296
+                $lat = isset($post[$prefix.'latitude']) ? $post[$prefix.'latitude'] : '';
1297
+                $lng = isset($post[$prefix.'longitude']) ? $post[$prefix.'longitude'] : '';
1298
+                $mapview = isset($post[$prefix.'mapview']) ? $post[$prefix.'mapview'] : '';
1299
+                $mapzoom = isset($post[$prefix.'mapzoom']) ? $post[$prefix.'mapzoom'] : '';
1300 1300
             } else if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '' && $post_info = geodir_get_post_info($_REQUEST['pid'])) {
1301
-                $post_info = (array)$post_info;
1302
-
1303
-                $address = $post_info[$prefix . 'address'];
1304
-                $zip = isset($post_info[$prefix . 'zip']) ? $post_info[$prefix . 'zip'] : '';
1305
-                $lat = isset($post_info[$prefix . 'latitude']) ? $post_info[$prefix . 'latitude'] : '';
1306
-                $lng = isset($post_info[$prefix . 'longitude']) ? $post_info[$prefix . 'longitude'] : '';
1307
-                $mapview = isset($post_info[$prefix . 'mapview']) ? $post_info[$prefix . 'mapview'] : '';
1308
-                $mapzoom = isset($post_info[$prefix . 'mapzoom']) ? $post_info[$prefix . 'mapzoom'] : '';
1301
+                $post_info = (array) $post_info;
1302
+
1303
+                $address = $post_info[$prefix.'address'];
1304
+                $zip = isset($post_info[$prefix.'zip']) ? $post_info[$prefix.'zip'] : '';
1305
+                $lat = isset($post_info[$prefix.'latitude']) ? $post_info[$prefix.'latitude'] : '';
1306
+                $lng = isset($post_info[$prefix.'longitude']) ? $post_info[$prefix.'longitude'] : '';
1307
+                $mapview = isset($post_info[$prefix.'mapview']) ? $post_info[$prefix.'mapview'] : '';
1308
+                $mapzoom = isset($post_info[$prefix.'mapzoom']) ? $post_info[$prefix.'mapzoom'] : '';
1309 1309
             }
1310 1310
 
1311 1311
             $location = geodir_get_default_location();
@@ -1342,16 +1342,16 @@  discard block
 block discarded – undo
1342 1342
 
1343 1343
             ?>
1344 1344
 
1345
-            <div id="geodir_<?php echo $prefix . 'address';?>_row"
1346
-                 class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix <?php echo $fieldset_field_class;?>">
1345
+            <div id="geodir_<?php echo $prefix.'address'; ?>_row"
1346
+                 class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix <?php echo $fieldset_field_class; ?>">
1347 1347
                 <label>
1348 1348
                     <?php _e($address_title, 'geodirectory'); ?>
1349
-                    <?php if ($is_required) echo '<span>*</span>';?>
1349
+                    <?php if ($is_required) echo '<span>*</span>'; ?>
1350 1350
                 </label>
1351
-                <input type="text" field_type="<?php echo $type;?>" name="<?php echo $prefix . 'address';?>"
1352
-                       id="<?php echo $prefix . 'address';?>" class="geodir_textfield"
1351
+                <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix.'address'; ?>"
1352
+                       id="<?php echo $prefix.'address'; ?>" class="geodir_textfield"
1353 1353
                        value="<?php echo esc_attr(stripslashes($address)); ?>"/>
1354
-                <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory');?></span>
1354
+                <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory'); ?></span>
1355 1355
                 <?php if ($is_required) { ?>
1356 1356
                     <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span>
1357 1357
                 <?php } ?>
@@ -1371,14 +1371,14 @@  discard block
 block discarded – undo
1371 1371
 
1372 1372
             if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) { ?>
1373 1373
 
1374
-                <div id="geodir_<?php echo $prefix . 'zip'; ?>_row"
1375
-                     class="<?php /*if($is_required) echo 'required_field';*/ ?> geodir_form_row clearfix <?php echo $fieldset_field_class;?>">
1374
+                <div id="geodir_<?php echo $prefix.'zip'; ?>_row"
1375
+                     class="<?php /*if($is_required) echo 'required_field';*/ ?> geodir_form_row clearfix <?php echo $fieldset_field_class; ?>">
1376 1376
                     <label>
1377 1377
                         <?php _e($zip_title, 'geodirectory'); ?>
1378 1378
                         <?php /*if($is_required) echo '<span>*</span>';*/ ?>
1379 1379
                     </label>
1380
-                    <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix . 'zip'; ?>"
1381
-                           id="<?php echo $prefix . 'zip'; ?>" class="geodir_textfield autofill"
1380
+                    <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix.'zip'; ?>"
1381
+                           id="<?php echo $prefix.'zip'; ?>" class="geodir_textfield autofill"
1382 1382
                            value="<?php echo esc_attr(stripslashes($zip)); ?>"/>
1383 1383
                     <?php /*if($is_required) {?>
1384 1384
 					<span class="geodir_message_error"><?php echo _e($required_msg,'geodirectory');?></span>
@@ -1388,14 +1388,14 @@  discard block
 block discarded – undo
1388 1388
 
1389 1389
             <?php if (isset($extra_fields['show_map']) && $extra_fields['show_map']) { ?>
1390 1390
 
1391
-                <div id="geodir_<?php echo $prefix . 'map'; ?>_row" class="geodir_form_row clearfix <?php echo $fieldset_field_class;?>">
1391
+                <div id="geodir_<?php echo $prefix.'map'; ?>_row" class="geodir_form_row clearfix <?php echo $fieldset_field_class; ?>">
1392 1392
                     <?php
1393 1393
                     /**
1394 1394
                      * Contains add listing page map functions.
1395 1395
                      *
1396 1396
                      * @since 1.0.0
1397 1397
                      */
1398
-                    include(geodir_plugin_path() . "/geodirectory-functions/map-functions/map_on_add_listing_page.php");
1398
+                    include(geodir_plugin_path()."/geodirectory-functions/map-functions/map_on_add_listing_page.php");
1399 1399
                     if ($lat_lng_blank) {
1400 1400
                         $lat = '';
1401 1401
                         $lng = '';
@@ -1406,14 +1406,14 @@  discard block
 block discarded – undo
1406 1406
                 <?php
1407 1407
                 /* show lat lng */
1408 1408
                 $style_latlng = ((isset($extra_fields['show_latlng']) && $extra_fields['show_latlng']) || is_admin()) ? '' : 'style="display:none"'; ?>
1409
-                <div id="geodir_<?php echo $prefix . 'latitude'; ?>_row"
1410
-                     class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix <?php echo $fieldset_field_class;?>" <?php echo $style_latlng; ?>>
1409
+                <div id="geodir_<?php echo $prefix.'latitude'; ?>_row"
1410
+                     class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix <?php echo $fieldset_field_class; ?>" <?php echo $style_latlng; ?>>
1411 1411
                     <label>
1412 1412
                         <?php echo PLACE_ADDRESS_LAT; ?>
1413 1413
                         <?php if ($is_required) echo '<span>*</span>'; ?>
1414 1414
                     </label>
1415
-                    <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix . 'latitude'; ?>"
1416
-                           id="<?php echo $prefix . 'latitude'; ?>" class="geodir_textfield"
1415
+                    <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix.'latitude'; ?>"
1416
+                           id="<?php echo $prefix.'latitude'; ?>" class="geodir_textfield"
1417 1417
                            value="<?php echo esc_attr(stripslashes($lat)); ?>" size="25"/>
1418 1418
                     <span class="geodir_message_note"><?php echo GET_LATITUDE_MSG; ?></span>
1419 1419
                     <?php if ($is_required) { ?>
@@ -1421,14 +1421,14 @@  discard block
 block discarded – undo
1421 1421
                     <?php } ?>
1422 1422
                 </div>
1423 1423
 
1424
-                <div id="geodir_<?php echo $prefix . 'longitude'; ?>_row"
1425
-                     class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix <?php echo $fieldset_field_class;?>" <?php echo $style_latlng; ?>>
1424
+                <div id="geodir_<?php echo $prefix.'longitude'; ?>_row"
1425
+                     class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix <?php echo $fieldset_field_class; ?>" <?php echo $style_latlng; ?>>
1426 1426
                     <label>
1427 1427
                         <?php echo PLACE_ADDRESS_LNG; ?>
1428 1428
                         <?php if ($is_required) echo '<span>*</span>'; ?>
1429 1429
                     </label>
1430
-                    <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix . 'longitude'; ?>"
1431
-                           id="<?php echo $prefix . 'longitude'; ?>" class="geodir_textfield"
1430
+                    <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix.'longitude'; ?>"
1431
+                           id="<?php echo $prefix.'longitude'; ?>" class="geodir_textfield"
1432 1432
                            value="<?php echo esc_attr(stripslashes($lng)); ?>" size="25"/>
1433 1433
                     <span class="geodir_message_note"><?php echo GET_LOGNGITUDE_MSG; ?></span>
1434 1434
                     <?php if ($is_required) { ?>
@@ -1438,32 +1438,32 @@  discard block
 block discarded – undo
1438 1438
             <?php } ?>
1439 1439
 
1440 1440
             <?php if (isset($extra_fields['show_mapview']) && $extra_fields['show_mapview']) { ?>
1441
-                <div id="geodir_<?php echo $prefix . 'mapview'; ?>_row" class="geodir_form_row clearfix <?php echo $fieldset_field_class;?>">
1441
+                <div id="geodir_<?php echo $prefix.'mapview'; ?>_row" class="geodir_form_row clearfix <?php echo $fieldset_field_class; ?>">
1442 1442
                     <label><?php _e($mapview_title, 'geodirectory'); ?></label>
1443 1443
 
1444 1444
 
1445 1445
                     <span class="geodir_user_define"><input field_type="<?php echo $type; ?>" type="radio"
1446 1446
                                                             class="gd-checkbox"
1447
-                                                            name="<?php echo $prefix . 'mapview'; ?>"
1448
-                                                            id="<?php echo $prefix . 'mapview'; ?>" <?php if ($mapview == 'ROADMAP' || $mapview == '') {
1447
+                                                            name="<?php echo $prefix.'mapview'; ?>"
1448
+                                                            id="<?php echo $prefix.'mapview'; ?>" <?php if ($mapview == 'ROADMAP' || $mapview == '') {
1449 1449
                             echo 'checked="checked"';
1450 1450
                         } ?>  value="ROADMAP" size="25"/> <?php _e('Default Map', 'geodirectory'); ?></span>
1451 1451
                     <span class="geodir_user_define"> <input field_type="<?php echo $type; ?>" type="radio"
1452 1452
                                                              class="gd-checkbox"
1453
-                                                             name="<?php echo $prefix . 'mapview'; ?>"
1453
+                                                             name="<?php echo $prefix.'mapview'; ?>"
1454 1454
                                                              id="map_view1" <?php if ($mapview == 'SATELLITE') {
1455 1455
                             echo 'checked="checked"';
1456 1456
                         } ?> value="SATELLITE" size="25"/> <?php _e('Satellite Map', 'geodirectory'); ?></span>
1457 1457
 
1458 1458
                     <span class="geodir_user_define"><input field_type="<?php echo $type; ?>" type="radio"
1459 1459
                                                             class="gd-checkbox"
1460
-                                                            name="<?php echo $prefix . 'mapview'; ?>"
1460
+                                                            name="<?php echo $prefix.'mapview'; ?>"
1461 1461
                                                             id="map_view2" <?php if ($mapview == 'HYBRID') {
1462 1462
                             echo 'checked="checked"';
1463 1463
                         } ?>  value="HYBRID" size="25"/> <?php _e('Hybrid Map', 'geodirectory'); ?></span>
1464 1464
 					<span class="geodir_user_define"><input field_type="<?php echo $type; ?>" type="radio"
1465 1465
                                                             class="gd-checkbox"
1466
-                                                            name="<?php echo $prefix . 'mapview'; ?>"
1466
+                                                            name="<?php echo $prefix.'mapview'; ?>"
1467 1467
                                                             id="map_view3" <?php if ($mapview == 'TERRAIN') {
1468 1468
                             echo 'checked="checked"';
1469 1469
                         } ?>  value="TERRAIN" size="25"/> <?php _e('Terrain Map', 'geodirectory'); ?></span>
@@ -1475,35 +1475,35 @@  discard block
 block discarded – undo
1475 1475
             <?php if (isset($extra_fields['show_mapzoom']) && $extra_fields['show_mapzoom']) { ?>
1476 1476
                 <input type="hidden" value="<?php if (isset($mapzoom)) {
1477 1477
                     echo esc_attr($mapzoom);
1478
-                } ?>" name="<?php echo $prefix . 'mapzoom'; ?>" id="<?php echo $prefix . 'mapzoom'; ?>"/>
1478
+                } ?>" name="<?php echo $prefix.'mapzoom'; ?>" id="<?php echo $prefix.'mapzoom'; ?>"/>
1479 1479
             <?php }?>
1480 1480
         <?php } elseif ($type == 'text') {
1481 1481
 
1482 1482
             //number and float validation $validation_pattern
1483
-            if(isset($val['data_type']) && $val['data_type']=='INT'){$type = 'number';}
1484
-            elseif(isset($val['data_type']) && $val['data_type']=='FLOAT'){$type = 'float';}
1483
+            if (isset($val['data_type']) && $val['data_type'] == 'INT') {$type = 'number'; }
1484
+            elseif (isset($val['data_type']) && $val['data_type'] == 'FLOAT') {$type = 'float'; }
1485 1485
             //print_r($val);
1486 1486
             //validation
1487
-            if(isset($val['validation_pattern']) && $val['validation_pattern']){
1487
+            if (isset($val['validation_pattern']) && $val['validation_pattern']) {
1488 1488
                 $validation = 'pattern="'.$val['validation_pattern'].'"';
1489
-            }else{$validation='';}
1489
+            } else {$validation = ''; }
1490 1490
 
1491 1491
             // validation message
1492
-            if(isset($val['validation_msg']) && $val['validation_msg']){
1492
+            if (isset($val['validation_msg']) && $val['validation_msg']) {
1493 1493
                 $validation_msg = 'title="'.$val['validation_msg'].'"';
1494
-            }else{$validation_msg='';}
1494
+            } else {$validation_msg = ''; }
1495 1495
             ?>
1496 1496
 
1497
-            <div id="<?php echo $name;?>_row"
1498
-                 class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix <?php echo $fieldset_field_class;?>">
1497
+            <div id="<?php echo $name; ?>_row"
1498
+                 class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix <?php echo $fieldset_field_class; ?>">
1499 1499
                 <label>
1500 1500
                     <?php $site_title = __($site_title, 'geodirectory');
1501 1501
                     echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
1502
-                    <?php if ($is_required) echo '<span>*</span>';?>
1502
+                    <?php if ($is_required) echo '<span>*</span>'; ?>
1503 1503
                 </label>
1504
-                <input field_type="<?php echo $type;?>" name="<?php echo $name;?>" id="<?php echo $name;?>"
1505
-                       value="<?php echo esc_attr(stripslashes($value));?>" type="<?php echo $type;?>" class="geodir_textfield" <?php echo $validation;echo $validation_msg;?> />
1506
-                <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory');?></span>
1504
+                <input field_type="<?php echo $type; ?>" name="<?php echo $name; ?>" id="<?php echo $name; ?>"
1505
+                       value="<?php echo esc_attr(stripslashes($value)); ?>" type="<?php echo $type; ?>" class="geodir_textfield" <?php echo $validation; echo $validation_msg; ?> />
1506
+                <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory'); ?></span>
1507 1507
                 <?php if ($is_required) { ?>
1508 1508
                     <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span>
1509 1509
                 <?php } ?>
@@ -1514,16 +1514,16 @@  discard block
 block discarded – undo
1514 1514
                 $value = '';
1515 1515
             }?>
1516 1516
 
1517
-            <div id="<?php echo $name;?>_row"
1518
-                 class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix <?php echo $fieldset_field_class;?>">
1517
+            <div id="<?php echo $name; ?>_row"
1518
+                 class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix <?php echo $fieldset_field_class; ?>">
1519 1519
                 <label>
1520 1520
                     <?php $site_title = __($site_title, 'geodirectory');
1521 1521
                     echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
1522
-                    <?php if ($is_required) echo '<span>*</span>';?>
1522
+                    <?php if ($is_required) echo '<span>*</span>'; ?>
1523 1523
                 </label>
1524
-                <input field_type="<?php echo $type;?>" name="<?php echo $name;?>" id="<?php echo $name;?>"
1525
-                       value="<?php echo esc_attr(stripslashes($value));?>" type="email" class="geodir_textfield"/>
1526
-                <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory');?></span>
1524
+                <input field_type="<?php echo $type; ?>" name="<?php echo $name; ?>" id="<?php echo $name; ?>"
1525
+                       value="<?php echo esc_attr(stripslashes($value)); ?>" type="email" class="geodir_textfield"/>
1526
+                <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory'); ?></span>
1527 1527
                 <?php if ($is_required) { ?>
1528 1528
                     <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span>
1529 1529
                 <?php } ?>
@@ -1534,16 +1534,16 @@  discard block
 block discarded – undo
1534 1534
                 $value = '';
1535 1535
             } ?>
1536 1536
 
1537
-            <div id="<?php echo $name;?>_row"
1538
-                 class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix <?php echo $fieldset_field_class;?>">
1537
+            <div id="<?php echo $name; ?>_row"
1538
+                 class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix <?php echo $fieldset_field_class; ?>">
1539 1539
                 <label>
1540 1540
                     <?php $site_title = __($site_title, 'geodirectory');
1541 1541
                     echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
1542
-                    <?php if ($is_required) echo '<span>*</span>';?>
1542
+                    <?php if ($is_required) echo '<span>*</span>'; ?>
1543 1543
                 </label>
1544
-                <input field_type="<?php echo $type;?>" name="<?php echo $name;?>" id="<?php echo $name;?>"
1545
-                       value="<?php echo esc_attr(stripslashes($value));?>" type="tel" class="geodir_textfield"/>
1546
-                <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory');?></span>
1544
+                <input field_type="<?php echo $type; ?>" name="<?php echo $name; ?>" id="<?php echo $name; ?>"
1545
+                       value="<?php echo esc_attr(stripslashes($value)); ?>" type="tel" class="geodir_textfield"/>
1546
+                <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory'); ?></span>
1547 1547
                 <?php if ($is_required) { ?>
1548 1548
                     <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span>
1549 1549
                 <?php } ?>
@@ -1554,31 +1554,31 @@  discard block
 block discarded – undo
1554 1554
                 $value = '';
1555 1555
             }?>
1556 1556
 
1557
-            <div id="<?php echo $name;?>_row"
1558
-                 class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix <?php echo $fieldset_field_class;?>">
1557
+            <div id="<?php echo $name; ?>_row"
1558
+                 class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix <?php echo $fieldset_field_class; ?>">
1559 1559
                 <label>
1560 1560
                     <?php $site_title = __($site_title, 'geodirectory');
1561 1561
                     echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
1562
-                    <?php if ($is_required) echo '<span>*</span>';?>
1562
+                    <?php if ($is_required) echo '<span>*</span>'; ?>
1563 1563
                 </label>
1564
-                <input field_type="<?php echo $type;?>" name="<?php echo $name;?>" id="<?php echo $name;?>"
1565
-                       value="<?php echo esc_attr(stripslashes($value));?>" type="url" class="geodir_textfield"
1564
+                <input field_type="<?php echo $type; ?>" name="<?php echo $name; ?>" id="<?php echo $name; ?>"
1565
+                       value="<?php echo esc_attr(stripslashes($value)); ?>" type="url" class="geodir_textfield"
1566 1566
                        oninvalid="setCustomValidity('<?php _e('Please enter a valid URL including http://', 'geodirectory'); ?>')"
1567 1567
                        onchange="try{setCustomValidity('')}catch(e){}"
1568 1568
                 />
1569
-                <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory');?></span>
1569
+                <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory'); ?></span>
1570 1570
                 <?php if ($is_required) { ?>
1571 1571
                     <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span>
1572 1572
                 <?php } ?>
1573 1573
             </div>
1574 1574
 
1575 1575
         <?php } elseif ($type == 'radio') { ?>
1576
-            <div id="<?php echo $name;?>_row"
1577
-                 class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix <?php echo $fieldset_field_class;?>">
1576
+            <div id="<?php echo $name; ?>_row"
1577
+                 class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix <?php echo $fieldset_field_class; ?>">
1578 1578
                 <label>
1579 1579
                     <?php $site_title = __($site_title, 'geodirectory');
1580 1580
                     echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
1581
-                    <?php if ($is_required) echo '<span>*</span>';?>
1581
+                    <?php if ($is_required) echo '<span>*</span>'; ?>
1582 1582
                 </label>
1583 1583
                 <?php if ($option_values) {
1584 1584
                     $option_values = geodir_string_values_to_options($option_values, true);
@@ -1587,14 +1587,14 @@  discard block
 block discarded – undo
1587 1587
                         foreach ($option_values as $option_value) {
1588 1588
                             if (empty($option_value['optgroup'])) {
1589 1589
                                 ?>
1590
-                                <span class="gd-radios"><input name="<?php echo $name;?>" id="<?php echo $name;?>" <?php checked($value, $option_value['value']);?> value="<?php echo esc_attr($option_value['value']); ?>" class="gd-checkbox" field_type="<?php echo $type;?>" type="radio" /><?php echo $option_value['label']; ?></span>
1590
+                                <span class="gd-radios"><input name="<?php echo $name; ?>" id="<?php echo $name; ?>" <?php checked($value, $option_value['value']); ?> value="<?php echo esc_attr($option_value['value']); ?>" class="gd-checkbox" field_type="<?php echo $type; ?>" type="radio" /><?php echo $option_value['label']; ?></span>
1591 1591
                                 <?php
1592 1592
                             }
1593 1593
                         }
1594 1594
                     }
1595 1595
                 }
1596 1596
                 ?>
1597
-                <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory');?></span>
1597
+                <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory'); ?></span>
1598 1598
                 <?php if ($is_required) { ?>
1599 1599
                     <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span>
1600 1600
                 <?php } ?>
@@ -1602,22 +1602,22 @@  discard block
 block discarded – undo
1602 1602
 
1603 1603
         <?php } elseif ($type == 'checkbox') { ?>
1604 1604
 
1605
-            <div id="<?php echo $name;?>_row"
1606
-                 class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix <?php echo $fieldset_field_class;?>">
1605
+            <div id="<?php echo $name; ?>_row"
1606
+                 class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix <?php echo $fieldset_field_class; ?>">
1607 1607
                 <label>
1608 1608
                     <?php $site_title = __($site_title, 'geodirectory');
1609 1609
                     echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
1610
-                    <?php if ($is_required) echo '<span>*</span>';?>
1610
+                    <?php if ($is_required) echo '<span>*</span>'; ?>
1611 1611
                 </label>
1612 1612
                 <?php if ($value != '1') {
1613 1613
                     $value = '0';
1614 1614
                 }?>
1615
-                <input type="hidden" name="<?php echo $name;?>" id="<?php echo $name;?>" value="<?php echo esc_attr($value);?>"/>
1615
+                <input type="hidden" name="<?php echo $name; ?>" id="<?php echo $name; ?>" value="<?php echo esc_attr($value); ?>"/>
1616 1616
                 <input  <?php if ($value == '1') {
1617 1617
                     echo 'checked="checked"';
1618
-                }?>  value="1" class="gd-checkbox" field_type="<?php echo $type;?>" type="checkbox"
1619
-                     onchange="if(this.checked){jQuery('#<?php echo $name;?>').val('1');} else{ jQuery('#<?php echo $name;?>').val('0');}"/>
1620
-                <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory');?></span>
1618
+                }?>  value="1" class="gd-checkbox" field_type="<?php echo $type; ?>" type="checkbox"
1619
+                     onchange="if(this.checked){jQuery('#<?php echo $name; ?>').val('1');} else{ jQuery('#<?php echo $name; ?>').val('0');}"/>
1620
+                <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory'); ?></span>
1621 1621
                 <?php if ($is_required) { ?>
1622 1622
                     <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span>
1623 1623
                 <?php } ?>
@@ -1626,44 +1626,44 @@  discard block
 block discarded – undo
1626 1626
         <?php } elseif ($type == 'textarea') {
1627 1627
             ?>
1628 1628
 
1629
-            <div id="<?php echo $name;?>_row"
1630
-                 class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix <?php echo $fieldset_field_class;?>">
1629
+            <div id="<?php echo $name; ?>_row"
1630
+                 class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix <?php echo $fieldset_field_class; ?>">
1631 1631
                 <label>
1632 1632
                     <?php $site_title = __($site_title, 'geodirectory');
1633 1633
                     echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
1634
-                    <?php if ($is_required) echo '<span>*</span>';?>
1634
+                    <?php if ($is_required) echo '<span>*</span>'; ?>
1635 1635
                 </label><?php
1636 1636
 
1637 1637
 
1638 1638
                 if (is_array($extra_fields) && in_array('1', $extra_fields)) {
1639 1639
 
1640
-                    $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);?>
1640
+                    $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10); ?>
1641 1641
 
1642
-                <div class="editor" field_id="<?php echo $name;?>" field_type="editor">
1642
+                <div class="editor" field_id="<?php echo $name; ?>" field_type="editor">
1643 1643
                     <?php wp_editor(stripslashes($value), $name, $editor_settings); ?>
1644 1644
                     </div><?php
1645 1645
 
1646 1646
                 } else {
1647 1647
 
1648
-                    ?><textarea field_type="<?php echo $type;?>" class="geodir_textarea" name="<?php echo $name;?>"
1649
-                                id="<?php echo $name;?>"><?php echo stripslashes($value);?></textarea><?php
1648
+                    ?><textarea field_type="<?php echo $type; ?>" class="geodir_textarea" name="<?php echo $name; ?>"
1649
+                                id="<?php echo $name; ?>"><?php echo stripslashes($value); ?></textarea><?php
1650 1650
 
1651 1651
                 }?>
1652 1652
 
1653 1653
 
1654
-                <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory');?></span>
1654
+                <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory'); ?></span>
1655 1655
                 <?php if ($is_required) { ?>
1656 1656
                     <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span>
1657 1657
                 <?php } ?>
1658 1658
             </div>
1659 1659
 
1660 1660
         <?php } elseif ($type == 'select') { ?>
1661
-            <div id="<?php echo $name;?>_row"
1662
-                 class="<?php if ($is_required) echo 'required_field';?> geodir_form_row geodir_custom_fields clearfix <?php echo $fieldset_field_class;?>">
1661
+            <div id="<?php echo $name; ?>_row"
1662
+                 class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row geodir_custom_fields clearfix <?php echo $fieldset_field_class; ?>">
1663 1663
                 <label>
1664 1664
                     <?php $site_title = __($site_title, 'geodirectory');
1665 1665
                     echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
1666
-                    <?php if ($is_required) echo '<span>*</span>';?>
1666
+                    <?php if ($is_required) echo '<span>*</span>'; ?>
1667 1667
                 </label>
1668 1668
                 <?php
1669 1669
                 $option_values_arr = geodir_string_values_to_options($option_values, true);
@@ -1673,22 +1673,22 @@  discard block
 block discarded – undo
1673 1673
                         if (isset($option_row['optgroup']) && ($option_row['optgroup'] == 'start' || $option_row['optgroup'] == 'end')) {
1674 1674
                             $option_label = isset($option_row['label']) ? $option_row['label'] : '';
1675 1675
 
1676
-                            $select_options .= $option_row['optgroup'] == 'start' ? '<optgroup label="' . esc_attr($option_label) . '">' : '</optgroup>';
1676
+                            $select_options .= $option_row['optgroup'] == 'start' ? '<optgroup label="'.esc_attr($option_label).'">' : '</optgroup>';
1677 1677
                         } else {
1678 1678
                             $option_label = isset($option_row['label']) ? $option_row['label'] : '';
1679 1679
                             $option_value = isset($option_row['value']) ? $option_row['value'] : '';
1680 1680
                             $selected = $option_value == $value ? 'selected="selected"' : '';
1681 1681
 
1682
-                            $select_options .= '<option value="' . esc_attr($option_value) . '" ' . $selected . '>' . $option_label . '</option>';
1682
+                            $select_options .= '<option value="'.esc_attr($option_value).'" '.$selected.'>'.$option_label.'</option>';
1683 1683
                         }
1684 1684
                     }
1685 1685
                 }
1686 1686
                 ?>
1687
-                <select field_type="<?php echo $type;?>" name="<?php echo $name;?>" id="<?php echo $name;?>"
1687
+                <select field_type="<?php echo $type; ?>" name="<?php echo $name; ?>" id="<?php echo $name; ?>"
1688 1688
                         class="geodir_textfield textfield_x chosen_select"
1689
-                        data-placeholder="<?php echo __('Choose', 'geodirectory') . ' ' . $site_title . '&hellip;';?>"
1690
-                        option-ajaxchosen="false"><?php echo $select_options;?></select>
1691
-                <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory');?></span>
1689
+                        data-placeholder="<?php echo __('Choose', 'geodirectory').' '.$site_title.'&hellip;'; ?>"
1690
+                        option-ajaxchosen="false"><?php echo $select_options; ?></select>
1691
+                <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory'); ?></span>
1692 1692
                 <?php if ($is_required) { ?>
1693 1693
                     <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span>
1694 1694
                 <?php } ?>
@@ -1702,7 +1702,7 @@  discard block
 block discarded – undo
1702 1702
             }
1703 1703
             ?>
1704 1704
             <div id="<?php echo $name; ?>_row"
1705
-                 class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix <?php echo $fieldset_field_class;?>">
1705
+                 class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix <?php echo $fieldset_field_class; ?>">
1706 1706
                 <label>
1707 1707
                     <?php $site_title = __($site_title, 'geodirectory');
1708 1708
                     echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
@@ -1728,9 +1728,9 @@  discard block
 block discarded – undo
1728 1728
                                     $option_label = isset($option_row['label']) ? $option_row['label'] : '';
1729 1729
 
1730 1730
                                     if ($multi_display == 'select') {
1731
-                                        $select_options .= $option_row['optgroup'] == 'start' ? '<optgroup label="' . esc_attr($option_label) . '">' : '</optgroup>';
1731
+                                        $select_options .= $option_row['optgroup'] == 'start' ? '<optgroup label="'.esc_attr($option_label).'">' : '</optgroup>';
1732 1732
                                     } else {
1733
-                                        $select_options .= $option_row['optgroup'] == 'start' ? '<li>' . $option_label . '</li>' : '';
1733
+                                        $select_options .= $option_row['optgroup'] == 'start' ? '<li>'.$option_label.'</li>' : '';
1734 1734
                                     }
1735 1735
                                 } else {
1736 1736
                                     $option_label = isset($option_row['label']) ? $option_row['label'] : '';
@@ -1755,9 +1755,9 @@  discard block
 block discarded – undo
1755 1755
                                     }
1756 1756
 
1757 1757
                                     if ($multi_display == 'select') {
1758
-                                        $select_options .= '<option value="' . esc_attr($option_value) . '" ' . $selected . '>' . $option_label . '</option>';
1758
+                                        $select_options .= '<option value="'.esc_attr($option_value).'" '.$selected.'>'.$option_label.'</option>';
1759 1759
                                     } else {
1760
-                                        $select_options .= '<li><input name="' . $name . '[]" ' . $checked . ' value="' . esc_attr($option_value) . '" class="gd-' . $multi_display . '" field_type="' . $multi_display . '" type="' . $multi_display . '" />&nbsp;' . $option_label . ' </li>';
1760
+                                        $select_options .= '<li><input name="'.$name.'[]" '.$checked.' value="'.esc_attr($option_value).'" class="gd-'.$multi_display.'" field_type="'.$multi_display.'" type="'.$multi_display.'" />&nbsp;'.$option_label.' </li>';
1761 1761
                                     }
1762 1762
                                 }
1763 1763
                             }
@@ -1776,7 +1776,7 @@  discard block
 block discarded – undo
1776 1776
             ?>
1777 1777
 
1778 1778
             <div id="<?php echo $name; ?>_row"
1779
-                 class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix <?php echo $fieldset_field_class;?>">
1779
+                 class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix <?php echo $fieldset_field_class; ?>">
1780 1780
                 <label>
1781 1781
                     <?php $site_title = __($site_title, 'geodirectory');
1782 1782
                     echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
@@ -1806,8 +1806,8 @@  discard block
 block discarded – undo
1806 1806
 
1807 1807
             $date_format = str_replace($search, $replace, $extra_fields['date_format']);
1808 1808
 
1809
-            if($value=='0000-00-00'){$value='';}//if date not set, then mark it empty
1810
-            if($value && !isset($_REQUEST['backandedit'])) {
1809
+            if ($value == '0000-00-00') {$value = ''; }//if date not set, then mark it empty
1810
+            if ($value && !isset($_REQUEST['backandedit'])) {
1811 1811
                 $time = strtotime($value);
1812 1812
                 $value = date($date_format, $time);
1813 1813
             }
@@ -1817,37 +1817,37 @@  discard block
 block discarded – undo
1817 1817
 
1818 1818
                 jQuery(function () {
1819 1819
 
1820
-                    jQuery("#<?php echo $name;?>").datepicker({changeMonth: true, changeYear: true <?php
1820
+                    jQuery("#<?php echo $name; ?>").datepicker({changeMonth: true, changeYear: true <?php
1821 1821
                         /**
1822 1822
                          * Used to add extra option to datepicker per custom field.
1823 1823
                          *
1824 1824
                          * @since 1.5.7
1825 1825
                          * @param string $name The custom field name.
1826 1826
                          */
1827
-                        echo apply_filters("gd_datepicker_extra_{$name}",'');?>});
1827
+                        echo apply_filters("gd_datepicker_extra_{$name}", ''); ?>});
1828 1828
 
1829
-                    jQuery("#<?php echo $name;?>").datepicker("option", "dateFormat", '<?php echo $extra_fields['date_format'];?>');
1829
+                    jQuery("#<?php echo $name; ?>").datepicker("option", "dateFormat", '<?php echo $extra_fields['date_format']; ?>');
1830 1830
 
1831
-                    <?php if(!empty($value)){?>
1832
-                    jQuery("#<?php echo $name;?>").datepicker("setDate", "<?php echo $value;?>");
1831
+                    <?php if (!empty($value)) {?>
1832
+                    jQuery("#<?php echo $name; ?>").datepicker("setDate", "<?php echo $value; ?>");
1833 1833
                     <?php } ?>
1834 1834
 
1835 1835
                 });
1836 1836
 
1837 1837
             </script>
1838
-            <div id="<?php echo $name;?>_row"
1839
-                 class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix <?php echo $fieldset_field_class;?>">
1838
+            <div id="<?php echo $name; ?>_row"
1839
+                 class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix <?php echo $fieldset_field_class; ?>">
1840 1840
                 <label>
1841 1841
 
1842 1842
                     <?php $site_title = __($site_title, 'geodirectory');
1843 1843
                     echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
1844
-                    <?php if ($is_required) echo '<span>*</span>';?>
1844
+                    <?php if ($is_required) echo '<span>*</span>'; ?>
1845 1845
                 </label>
1846 1846
 
1847
-                <input field_type="<?php echo $type;?>" name="<?php echo $name;?>" id="<?php echo $name;?>"
1848
-                       value="<?php echo esc_attr($value);?>" type="text" class="geodir_textfield"/>
1847
+                <input field_type="<?php echo $type; ?>" name="<?php echo $name; ?>" id="<?php echo $name; ?>"
1848
+                       value="<?php echo esc_attr($value); ?>" type="text" class="geodir_textfield"/>
1849 1849
 
1850
-                <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory');?></span>
1850
+                <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory'); ?></span>
1851 1851
                 <?php if ($is_required) { ?>
1852 1852
                     <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span>
1853 1853
                 <?php } ?>
@@ -1861,25 +1861,25 @@  discard block
 block discarded – undo
1861 1861
             <script type="text/javascript">
1862 1862
                 jQuery(document).ready(function () {
1863 1863
 
1864
-                    jQuery('#<?php echo $name;?>').timepicker({
1864
+                    jQuery('#<?php echo $name; ?>').timepicker({
1865 1865
                         showPeriod: true,
1866 1866
                         showLeadingZero: true,
1867 1867
                         showPeriod: true,
1868 1868
                     });
1869 1869
                 });
1870 1870
             </script>
1871
-            <div id="<?php echo $name;?>_row"
1872
-                 class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix <?php echo $fieldset_field_class;?>">
1871
+            <div id="<?php echo $name; ?>_row"
1872
+                 class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix <?php echo $fieldset_field_class; ?>">
1873 1873
                 <label>
1874 1874
 
1875 1875
                     <?php $site_title = __($site_title, 'geodirectory');
1876 1876
                     echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
1877
-                    <?php if ($is_required) echo '<span>*</span>';?>
1877
+                    <?php if ($is_required) echo '<span>*</span>'; ?>
1878 1878
                 </label>
1879
-                <input readonly="readonly" field_type="<?php echo $type;?>" name="<?php echo $name;?>"
1880
-                       id="<?php echo $name;?>" value="<?php echo esc_attr($value);?>" type="text" class="geodir_textfield"/>
1879
+                <input readonly="readonly" field_type="<?php echo $type; ?>" name="<?php echo $name; ?>"
1880
+                       id="<?php echo $name; ?>" value="<?php echo esc_attr($value); ?>" type="text" class="geodir_textfield"/>
1881 1881
 
1882
-                <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory');?></span>
1882
+                <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory'); ?></span>
1883 1883
                 <?php if ($is_required) { ?>
1884 1884
                     <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span>
1885 1885
                 <?php } ?>
@@ -1889,15 +1889,15 @@  discard block
 block discarded – undo
1889 1889
             if ($value == $val['default']) {
1890 1890
                 $value = '';
1891 1891
             } ?>
1892
-            <div id="<?php echo $name;?>_row"
1893
-                 class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix <?php echo $fieldset_field_class;?>">
1892
+            <div id="<?php echo $name; ?>_row"
1893
+                 class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix <?php echo $fieldset_field_class; ?>">
1894 1894
                 <label>
1895 1895
                     <?php $site_title = __($site_title, 'geodirectory');
1896 1896
                     echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
1897
-                    <?php if ($is_required) echo '<span>*</span>';?>
1897
+                    <?php if ($is_required) echo '<span>*</span>'; ?>
1898 1898
                 </label>
1899 1899
 
1900
-                <div id="<?php echo $name;?>" class="geodir_taxonomy_field" style="float:left; width:70%;">
1900
+                <div id="<?php echo $name; ?>" class="geodir_taxonomy_field" style="float:left; width:70%;">
1901 1901
                     <?php
1902 1902
                     global $wpdb, $post, $cat_display, $post_cat, $package_id, $exclude_cats;
1903 1903
 
@@ -1909,7 +1909,7 @@  discard block
 block discarded – undo
1909 1909
 
1910 1910
                         $package_info = array();
1911 1911
 
1912
-                        $package_info = (array)geodir_post_package_info($package_info, $post, $post_type);
1912
+                        $package_info = (array) geodir_post_package_info($package_info, $post, $post_type);
1913 1913
 
1914 1914
                         if (!empty($package_info)) {
1915 1915
 
@@ -1938,7 +1938,7 @@  discard block
 block discarded – undo
1938 1938
 
1939 1939
                         $catadd_limit = $wpdb->get_var(
1940 1940
                             $wpdb->prepare(
1941
-                                "SELECT cat_limit FROM " . GEODIR_PRICE_TABLE . " WHERE pid = %d",
1941
+                                "SELECT cat_limit FROM ".GEODIR_PRICE_TABLE." WHERE pid = %d",
1942 1942
                                 array($package_id)
1943 1943
                             )
1944 1944
                         );
@@ -1954,13 +1954,13 @@  discard block
 block discarded – undo
1954 1954
                         $required_limit_msg = '';
1955 1955
                         if ($catadd_limit > 0 && $cat_display != 'select' && $cat_display != 'radio') {
1956 1956
 
1957
-                            $required_limit_msg = __('Only select', 'geodirectory') . ' ' . $catadd_limit . __(' categories for this package.', 'geodirectory');
1957
+                            $required_limit_msg = __('Only select', 'geodirectory').' '.$catadd_limit.__(' categories for this package.', 'geodirectory');
1958 1958
 
1959 1959
                         } else {
1960 1960
                             $required_limit_msg = $required_msg;
1961 1961
                         }
1962 1962
 
1963
-                        echo '<input type="hidden" cat_limit="' . $catadd_limit . '" id="cat_limit" value="' . esc_attr($required_limit_msg) . '" name="cat_limit[' . $name . ']"  />';
1963
+                        echo '<input type="hidden" cat_limit="'.$catadd_limit.'" id="cat_limit" value="'.esc_attr($required_limit_msg).'" name="cat_limit['.$name.']"  />';
1964 1964
 
1965 1965
 
1966 1966
                         if ($cat_display == 'select' || $cat_display == 'multiselect') {
@@ -1970,11 +1970,11 @@  discard block
 block discarded – undo
1970 1970
                             if ($cat_display == 'multiselect')
1971 1971
                                 $multiple = 'multiple="multiple"';
1972 1972
 
1973
-                            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') . '">';
1973
+                            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').'">';
1974 1974
 
1975 1975
 
1976 1976
                             if ($cat_display == 'select')
1977
-                                echo '<option value="">' . __('Select Category', 'geodirectory') . '</option>';
1977
+                                echo '<option value="">'.__('Select Category', 'geodirectory').'</option>';
1978 1978
 
1979 1979
                         }
1980 1980
 
@@ -1992,7 +1992,7 @@  discard block
 block discarded – undo
1992 1992
                     ?>
1993 1993
                 </div>
1994 1994
 
1995
-                <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory');?></span>
1995
+                <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory'); ?></span>
1996 1996
                 <?php if ($is_required) { ?>
1997 1997
                     <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span>
1998 1998
                 <?php } ?>
@@ -2034,8 +2034,8 @@  discard block
 block discarded – undo
2034 2034
                     $file_totImg = count($curImages);
2035 2035
             }
2036 2036
 
2037
-            $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']) : '';
2038
-            $display_file_types = $allowed_file_types != '' ? '.' . implode(", .", $extra_fields['gd_file_types']) : '';
2037
+            $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']) : '';
2038
+            $display_file_types = $allowed_file_types != '' ? '.'.implode(", .", $extra_fields['gd_file_types']) : '';
2039 2039
 
2040 2040
             ?>
2041 2041
             <?php /*?> <h5 class="geodir-form_title"> <?php echo $site_title; ?>
@@ -2045,13 +2045,13 @@  discard block
 block discarded – undo
2045 2045
 			</h5>   <?php */
2046 2046
             ?>
2047 2047
 
2048
-            <div id="<?php echo $name;?>_row"
2049
-                 class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix <?php echo $fieldset_field_class;?>">
2048
+            <div id="<?php echo $name; ?>_row"
2049
+                 class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix <?php echo $fieldset_field_class; ?>">
2050 2050
 
2051 2051
                 <div id="<?php echo $file_id; ?>dropbox" style="text-align:center;">
2052 2052
                     <label
2053 2053
                         style="text-align:left; padding-top:10px;"><?php $site_title = __($site_title, 'geodirectory');
2054
-                        echo $site_title; ?><?php if ($is_required) echo '<span>*</span>';?></label>
2054
+                        echo $site_title; ?><?php if ($is_required) echo '<span>*</span>'; ?></label>
2055 2055
                     <input class="geodir-custom-file-upload" field_type="file" type="hidden"
2056 2056
                            name="<?php echo $file_id; ?>" id="<?php echo $file_id; ?>"
2057 2057
                            value="<?php echo esc_attr($file_value); ?>"/>
@@ -2059,7 +2059,7 @@  discard block
 block discarded – undo
2059 2059
                            id="<?php echo $file_id; ?>image_limit" value="<?php echo $file_image_limit; ?>"/>
2060 2060
                     <?php if ($allowed_file_types != '') { ?>
2061 2061
                         <input type="hidden" name="<?php echo $file_id; ?>_allowed_types"
2062
-                               id="<?php echo $file_id; ?>_allowed_types" value="<?php echo esc_attr($allowed_file_types); ?>" data-exts="<?php echo esc_attr($display_file_types);?>"/>
2062
+                               id="<?php echo $file_id; ?>_allowed_types" value="<?php echo esc_attr($allowed_file_types); ?>" data-exts="<?php echo esc_attr($display_file_types); ?>"/>
2063 2063
                     <?php } ?>
2064 2064
                     <input type="hidden" name="<?php echo $file_id; ?>totImg" id="<?php echo $file_id; ?>totImg"
2065 2065
                            value="<?php if (isset($file_totImg)) {
@@ -2075,10 +2075,10 @@  discard block
 block discarded – undo
2075 2075
                             <?php /*?><h4><?php _e('Drop files to upload');?></h4><br/><?php */
2076 2076
                             ?>
2077 2077
                             <input id="<?php echo $file_id; ?>plupload-browse-button" type="button"
2078
-                                   value="<?php ($file_image_limit > 1 ? esc_attr_e('Select Files', 'geodirectory') : esc_attr_e('Select File', 'geodirectory') ); ?>"
2078
+                                   value="<?php ($file_image_limit > 1 ? esc_attr_e('Select Files', 'geodirectory') : esc_attr_e('Select File', 'geodirectory')); ?>"
2079 2079
                                    class="geodir_button" style="margin-top:10px;"/>
2080 2080
                             <span class="ajaxnonceplu"
2081
-                                  id="ajaxnonceplu<?php echo wp_create_nonce($file_id . 'pluploadan'); ?>"></span>
2081
+                                  id="ajaxnonceplu<?php echo wp_create_nonce($file_id.'pluploadan'); ?>"></span>
2082 2082
                             <?php if ($file_width && $file_height): ?>
2083 2083
                                 <span class="plupload-resize"></span>
2084 2084
                                 <span class="plupload-width" id="plupload-width<?php echo $file_width; ?>"></span>
@@ -2098,7 +2098,7 @@  discard block
 block discarded – undo
2098 2098
 
2099 2099
                     </div>
2100 2100
                 </div>
2101
-                <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory');?> <?php echo ( $display_file_types != '' ? __('Allowed file types:', 'geodirectory') . ' ' . $display_file_types : '' );?></span>
2101
+                <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory'); ?> <?php echo ($display_file_types != '' ? __('Allowed file types:', 'geodirectory').' '.$display_file_types : ''); ?></span>
2102 2102
                 <?php if ($is_required) { ?>
2103 2103
                     <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span>
2104 2104
                 <?php } ?>
@@ -2117,7 +2117,7 @@  discard block
 block discarded – undo
2117 2117
          * @param array $val The settings array for the field. {@see geodir_custom_field_save()}.
2118 2118
          * @see 'geodir_before_custom_form_field_$name'
2119 2119
          */
2120
-        do_action('geodir_after_custom_form_field_' . $name, $listing_type, $package_id, $val);
2120
+        do_action('geodir_after_custom_form_field_'.$name, $listing_type, $package_id, $val);
2121 2121
 
2122 2122
     }
2123 2123
 
@@ -2143,7 +2143,7 @@  discard block
 block discarded – undo
2143 2143
 
2144 2144
         $filter = $wpdb->get_row(
2145 2145
             $wpdb->prepare(
2146
-                "SELECT * FROM " . GEODIR_CUSTOM_FIELDS_TABLE . " WHERE post_type=%s AND " . $key . "='" . $value . "'",
2146
+                "SELECT * FROM ".GEODIR_CUSTOM_FIELDS_TABLE." WHERE post_type=%s AND ".$key."='".$value."'",
2147 2147
                 array($geodir_post_type)
2148 2148
             )
2149 2149
         );
@@ -2203,7 +2203,7 @@  discard block
 block discarded – undo
2203 2203
 
2204 2204
                 $variables_array = array();
2205 2205
 
2206
-                if ($fields_location == 'detail' && isset($type['show_as_tab']) && (int)$type['show_as_tab'] == 1 && in_array($type['type'], array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file'))) {
2206
+                if ($fields_location == 'detail' && isset($type['show_as_tab']) && (int) $type['show_as_tab'] == 1 && in_array($type['type'], array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file'))) {
2207 2207
                     continue;
2208 2208
                 }
2209 2209
 
@@ -2218,9 +2218,9 @@  discard block
 block discarded – undo
2218 2218
                 //if($type['field_icon'])
2219 2219
 
2220 2220
                 if (strpos($type['field_icon'], 'http') !== false) {
2221
-                    $field_icon = ' background: url(' . $type['field_icon'] . ') no-repeat left center;background-size:18px 18px;padding-left: 21px;';
2221
+                    $field_icon = ' background: url('.$type['field_icon'].') no-repeat left center;background-size:18px 18px;padding-left: 21px;';
2222 2222
                 } elseif (strpos($type['field_icon'], 'fa fa-') !== false) {
2223
-                    $field_icon = '<i class="' . $type['field_icon'] . '"></i>';
2223
+                    $field_icon = '<i class="'.$type['field_icon'].'"></i>';
2224 2224
                 }
2225 2225
                 //else{$field_icon = $type['field_icon'];}
2226 2226
 
@@ -2232,9 +2232,9 @@  discard block
 block discarded – undo
2232 2232
                         $fieldset_class = 'fieldset-'.sanitize_title_with_dashes($type['site_title']);
2233 2233
 
2234 2234
                         if ($field_set_start == 1) {
2235
-                            echo '</div><div class="geodir-company_info field-group ' . $type['htmlvar_name'] . '"><h2 class="'.$fieldset_class.'">' . __($type['site_title'], 'geodirectory') . '</h2>';
2235
+                            echo '</div><div class="geodir-company_info field-group '.$type['htmlvar_name'].'"><h2 class="'.$fieldset_class.'">'.__($type['site_title'], 'geodirectory').'</h2>';
2236 2236
                         } else {
2237
-                            echo '<h2 class="'.$fieldset_class.'">' . __($type['site_title'], 'geodirectory') . '</h2>';
2237
+                            echo '<h2 class="'.$fieldset_class.'">'.__($type['site_title'], 'geodirectory').'</h2>';
2238 2238
                             $field_set_start = 1;
2239 2239
                         }
2240 2240
 
@@ -2242,7 +2242,7 @@  discard block
 block discarded – undo
2242 2242
 
2243 2243
                     case 'address':
2244 2244
 
2245
-                        $html_var = $type['htmlvar_name'] . '_address';
2245
+                        $html_var = $type['htmlvar_name'].'_address';
2246 2246
 
2247 2247
                         if ($type['extra_fields']) {
2248 2248
 
@@ -2258,17 +2258,17 @@  discard block
 block discarded – undo
2258 2258
                                  */
2259 2259
                                 $show_city_in_address = apply_filters('geodir_show_city_in_address', false);
2260 2260
                                 if (isset($extra_fields['show_city']) && $extra_fields['show_city'] && $show_city_in_address) {
2261
-                                    $field = $type['htmlvar_name'] . '_city';
2261
+                                    $field = $type['htmlvar_name'].'_city';
2262 2262
                                     if ($post->{$field}) {
2263
-                                        $addition_fields .= ', ' . $post->{$field};
2263
+                                        $addition_fields .= ', '.$post->{$field};
2264 2264
                                     }
2265 2265
                                 }
2266 2266
 
2267 2267
 
2268 2268
                                 if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) {
2269
-                                    $field = $type['htmlvar_name'] . '_zip';
2269
+                                    $field = $type['htmlvar_name'].'_zip';
2270 2270
                                     if ($post->{$field}) {
2271
-                                        $addition_fields .= ', ' . $post->{$field};
2271
+                                        $addition_fields .= ', '.$post->{$field};
2272 2272
                                     }
2273 2273
                                 }
2274 2274
 
@@ -2345,28 +2345,28 @@  discard block
 block discarded – undo
2345 2345
                                 $i++;
2346 2346
                             }
2347 2347
 
2348
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"  itemscope itemtype="http://schema.org/PostalAddress">';
2349
-                            $html .= '<span class="geodir-i-location" style="' . $field_icon . '">' . $field_icon_af;
2350
-                            $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory') . ': ' : '&nbsp;';
2348
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"  itemscope itemtype="http://schema.org/PostalAddress">';
2349
+                            $html .= '<span class="geodir-i-location" style="'.$field_icon.'">'.$field_icon_af;
2350
+                            $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory').': ' : '&nbsp;';
2351 2351
                             $html .= '</span>';
2352 2352
 
2353 2353
                             if ($preview) {
2354
-                                $html .= stripslashes($post->{$html_var}) . $addition_fields . '</p></div>';
2354
+                                $html .= stripslashes($post->{$html_var}).$addition_fields.'</p></div>';
2355 2355
                             } else {
2356 2356
                                 if ($post->post_address) {
2357
-                                    $html .= '<span itemprop="streetAddress">' . $post->post_address . '</span><br>';
2357
+                                    $html .= '<span itemprop="streetAddress">'.$post->post_address.'</span><br>';
2358 2358
                                 }
2359 2359
                                 if ($post->post_city) {
2360
-                                    $html .= '<span itemprop="addressLocality">' . $post->post_city . '</span><br>';
2360
+                                    $html .= '<span itemprop="addressLocality">'.$post->post_city.'</span><br>';
2361 2361
                                 }
2362 2362
                                 if ($post->post_region) {
2363
-                                    $html .= '<span itemprop="addressRegion">' . $post->post_region . '</span><br>';
2363
+                                    $html .= '<span itemprop="addressRegion">'.$post->post_region.'</span><br>';
2364 2364
                                 }
2365 2365
                                 if ($post->post_zip) {
2366
-                                    $html .= '<span itemprop="postalCode">' . $post->post_zip . '</span><br>';
2366
+                                    $html .= '<span itemprop="postalCode">'.$post->post_zip.'</span><br>';
2367 2367
                                 }
2368 2368
                                 if ($post->post_country) {
2369
-                                    $html .= '<span itemprop="addressCountry">' . __($post->post_country, 'geodirectory') . '</span><br>';
2369
+                                    $html .= '<span itemprop="addressCountry">'.__($post->post_country, 'geodirectory').'</span><br>';
2370 2370
                                 }
2371 2371
                                 $html .= '</div>';
2372 2372
                             }
@@ -2406,7 +2406,7 @@  discard block
 block discarded – undo
2406 2406
 
2407 2407
                             $website = !empty($a_url['url']) ? $a_url['url'] : '';
2408 2408
                             $title = !empty($a_url['label']) ? $a_url['label'] : $type['site_title'];
2409
-                            if(!empty($type['default_value'])){$title = $type['default_value'];}
2409
+                            if (!empty($type['default_value'])) {$title = $type['default_value']; }
2410 2410
                             $title = $title != '' ? __(stripslashes($title), 'geodirectory') : '';
2411 2411
 
2412 2412
 
@@ -2432,7 +2432,7 @@  discard block
 block discarded – undo
2432 2432
                              * @param string $website Website URL.
2433 2433
                              * @param int $post->ID Post ID.
2434 2434
                              */
2435
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '"><span class="geodir-i-website" style="' . $field_icon . '">' . $field_icon_af . '<a href="' . $website . '" target="_blank" ' . $rel . ' ><strong>' . apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID) . '</strong></a></span></div>';
2435
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'"><span class="geodir-i-website" style="'.$field_icon.'">'.$field_icon_af.'<a href="'.$website.'" target="_blank" '.$rel.' ><strong>'.apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID).'</strong></a></span></div>';
2436 2436
 
2437 2437
                         endif;
2438 2438
 
@@ -2463,9 +2463,9 @@  discard block
 block discarded – undo
2463 2463
                                 $i++;
2464 2464
                             }
2465 2465
 
2466
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-contact" style="' . $field_icon . '">' . $field_icon_af .
2467
-                                $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory') . ': ' : '&nbsp;';
2468
-                            $html .= '</span><a href="tel:' . preg_replace('/[^0-9+]/', '', $post->{$type['htmlvar_name']}) . '">' . stripslashes($post->{$type['htmlvar_name']}) . '</a></div>';
2466
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-contact" style="'.$field_icon.'">'.$field_icon_af.
2467
+                                $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory').': ' : '&nbsp;';
2468
+                            $html .= '</span><a href="tel:'.preg_replace('/[^0-9+]/', '', $post->{$type['htmlvar_name']}).'">'.stripslashes($post->{$type['htmlvar_name']}).'</a></div>';
2469 2469
 
2470 2470
                         endif;
2471 2471
 
@@ -2501,9 +2501,9 @@  discard block
 block discarded – undo
2501 2501
                                 $i++;
2502 2502
                             }
2503 2503
 
2504
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-time" style="' . $field_icon . '">' . $field_icon_af;
2505
-                            $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory') . ': ' : '&nbsp;';
2506
-                            $html .= '</span>' . stripslashes($value) . '</div>';
2504
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-time" style="'.$field_icon.'">'.$field_icon_af;
2505
+                            $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory').': ' : '&nbsp;';
2506
+                            $html .= '</span>'.stripslashes($value).'</div>';
2507 2507
 
2508 2508
                         endif;
2509 2509
 
@@ -2519,17 +2519,17 @@  discard block
 block discarded – undo
2519 2519
                                 $date_format = $date_format['date_format'];
2520 2520
                             }
2521 2521
 
2522
-                            $search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format
2523
-                            $replace = array('d','j','l','m','n','F','Y');//PHP date format
2522
+                            $search = array('dd', 'd', 'DD', 'mm', 'm', 'MM', 'yy'); //jQuery UI datepicker format
2523
+                            $replace = array('d', 'j', 'l', 'm', 'n', 'F', 'Y'); //PHP date format
2524 2524
 
2525 2525
                             $date_format = str_replace($search, $replace, $date_format);
2526 2526
 
2527 2527
                             $post_htmlvar_value = $date_format == 'd/m/Y' ? str_replace('/', '-', $post->{$type['htmlvar_name']}) : $post->{$type['htmlvar_name']}; // PHP doesn't work well with dd/mm/yyyy format
2528 2528
 
2529 2529
                             $value = '';
2530
-                            if ($post->{$type['htmlvar_name']} != '' && $post->{$type['htmlvar_name']}!="0000-00-00") {
2530
+                            if ($post->{$type['htmlvar_name']} != '' && $post->{$type['htmlvar_name']} != "0000-00-00") {
2531 2531
                                 $value = date($date_format, strtotime($post_htmlvar_value));
2532
-                            }else{
2532
+                            } else {
2533 2533
                                 continue;
2534 2534
                             }
2535 2535
 
@@ -2552,9 +2552,9 @@  discard block
 block discarded – undo
2552 2552
                                 $i++;
2553 2553
                             }
2554 2554
 
2555
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-datepicker" style="' . $field_icon . '">' . $field_icon_af;
2556
-                            $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory') . ': ' : '';
2557
-                            $html .= '</span>' . $value . '</div>';
2555
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-datepicker" style="'.$field_icon.'">'.$field_icon_af;
2556
+                            $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory').': ' : '';
2557
+                            $html .= '</span>'.$value.'</div>';
2558 2558
 
2559 2559
                         endif;
2560 2560
 
@@ -2585,9 +2585,9 @@  discard block
 block discarded – undo
2585 2585
                                 $i++;
2586 2586
                             }
2587 2587
 
2588
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-time" style="' . $field_icon . '">' . $field_icon_af;
2589
-                            $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory') . ': ' : '&nbsp;';
2590
-                            $html .= '</span>' . stripslashes($post->{$type['htmlvar_name']}) . '</div>';
2588
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-time" style="'.$field_icon.'">'.$field_icon_af;
2589
+                            $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory').': ' : '&nbsp;';
2590
+                            $html .= '</span>'.stripslashes($post->{$type['htmlvar_name']}).'</div>';
2591 2591
 
2592 2592
                         elseif (isset($post->{$type['htmlvar_name']}) && $post->{$type['htmlvar_name']}):
2593 2593
 
@@ -2610,9 +2610,9 @@  discard block
 block discarded – undo
2610 2610
                                 $i++;
2611 2611
                             }
2612 2612
 
2613
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
2614
-                            $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory') . ': ' : '';
2615
-                            $html .= '</span>' . stripslashes($post->{$type['htmlvar_name']}) . '</div>';
2613
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-text" style="'.$field_icon.'">'.$field_icon_af;
2614
+                            $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory').': ' : '';
2615
+                            $html .= '</span>'.stripslashes($post->{$type['htmlvar_name']}).'</div>';
2616 2616
 
2617 2617
                         endif;
2618 2618
 
@@ -2621,7 +2621,7 @@  discard block
 block discarded – undo
2621 2621
                     case 'radio':
2622 2622
 
2623 2623
                         $html_var = $type['htmlvar_name'];
2624
-                        if(!isset($post->{$type['htmlvar_name']})){continue;}
2624
+                        if (!isset($post->{$type['htmlvar_name']})) {continue; }
2625 2625
                         $html_val = __($post->{$type['htmlvar_name']}, 'geodirectory');
2626 2626
                         if ($post->{$type['htmlvar_name']} != ''):
2627 2627
 
@@ -2662,9 +2662,9 @@  discard block
 block discarded – undo
2662 2662
                                 $i++;
2663 2663
                             }
2664 2664
 
2665
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-radio" style="' . $field_icon . '">' . $field_icon_af;
2666
-                            $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory') . ': ' : '';
2667
-                            $html .= '</span>' . $html_val . '</div>';
2665
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-radio" style="'.$field_icon.'">'.$field_icon_af;
2666
+                            $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory').': ' : '';
2667
+                            $html .= '</span>'.$html_val.'</div>';
2668 2668
                         endif;
2669 2669
 
2670 2670
                         break;
@@ -2673,7 +2673,7 @@  discard block
 block discarded – undo
2673 2673
 
2674 2674
                         $html_var = $type['htmlvar_name'];
2675 2675
 
2676
-                        if ((int)$post->{$html_var} == 1):
2676
+                        if ((int) $post->{$html_var} == 1):
2677 2677
 
2678 2678
                             if ($post->{$type['htmlvar_name']} == '1'):
2679 2679
                                 $html_val = __('Yes', 'geodirectory');
@@ -2700,9 +2700,9 @@  discard block
 block discarded – undo
2700 2700
                                 $i++;
2701 2701
                             }
2702 2702
 
2703
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-checkbox" style="' . $field_icon . '">' . $field_icon_af;
2704
-                            $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory') . ': ' : '';
2705
-                            $html .= '</span>' . $html_val . '</div>';
2703
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-checkbox" style="'.$field_icon.'">'.$field_icon_af;
2704
+                            $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory').': ' : '';
2705
+                            $html .= '</span>'.$html_val.'</div>';
2706 2706
                         endif;
2707 2707
 
2708 2708
                         break;
@@ -2710,7 +2710,7 @@  discard block
 block discarded – undo
2710 2710
                     case 'select':
2711 2711
 
2712 2712
                         $html_var = $type['htmlvar_name'];
2713
-                        if(!isset($post->{$type['htmlvar_name']})){continue;}
2713
+                        if (!isset($post->{$type['htmlvar_name']})) {continue; }
2714 2714
                         if ($post->{$type['htmlvar_name']}):
2715 2715
                             $field_value = __($post->{$type['htmlvar_name']}, 'geodirectory');
2716 2716
 
@@ -2745,9 +2745,9 @@  discard block
 block discarded – undo
2745 2745
                                 $i++;
2746 2746
                             }
2747 2747
 
2748
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
2749
-                            $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory') . ': ' : '';
2750
-                            $html .= '</span>' . $field_value . '</div>';
2748
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-select" style="'.$field_icon.'">'.$field_icon_af;
2749
+                            $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory').': ' : '';
2750
+                            $html .= '</span>'.$field_value.'</div>';
2751 2751
                         endif;
2752 2752
 
2753 2753
                         break;
@@ -2797,15 +2797,15 @@  discard block
 block discarded – undo
2797 2797
                                 $i++;
2798 2798
                             }
2799 2799
 
2800
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
2801
-                            $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory') . ': ' : '';
2800
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-select" style="'.$field_icon.'">'.$field_icon_af;
2801
+                            $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory').': ' : '';
2802 2802
                             $html .= '</span>';
2803 2803
 
2804 2804
                             if (count($option_values) > 1) {
2805 2805
                                 $html .= '<ul>';
2806 2806
 
2807 2807
                                 foreach ($option_values as $val) {
2808
-                                    $html .= '<li>' . $val . '</li>';
2808
+                                    $html .= '<li>'.$val.'</li>';
2809 2809
                                 }
2810 2810
 
2811 2811
                                 $html .= '</ul>';
@@ -2831,7 +2831,7 @@  discard block
 block discarded – undo
2831 2831
                             if (!$preview) {
2832 2832
                                 $b_send_inquiry = 'b_send_inquiry';
2833 2833
                                 $b_sendtofriend = 'b_sendtofriend';
2834
-                                $html = '<input type="hidden" name="geodir_popup_post_id" value="' . $post->ID . '" /><div class="geodir_display_popup_forms"></div>';
2834
+                                $html = '<input type="hidden" name="geodir_popup_post_id" value="'.$post->ID.'" /><div class="geodir_display_popup_forms"></div>';
2835 2835
                             }
2836 2836
 
2837 2837
                             if (strpos($field_icon, 'http') !== false) {
@@ -2853,26 +2853,26 @@  discard block
 block discarded – undo
2853 2853
                                 $i++;
2854 2854
                             }
2855 2855
 
2856
-                            $html .= '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af;
2856
+                            $html .= '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'"><span class="geodir-i-email" style="'.$field_icon.'">'.$field_icon_af;
2857 2857
                             $seperator = '';
2858 2858
                             if ($post->{$type['htmlvar_name']}) {
2859
-                                $html .= '<a href="javascript:void(0);" class="' . $b_send_inquiry . '" >' . SEND_INQUIRY . '</a>';
2859
+                                $html .= '<a href="javascript:void(0);" class="'.$b_send_inquiry.'" >'.SEND_INQUIRY.'</a>';
2860 2860
                                 $seperator = ' | ';
2861 2861
                             }
2862 2862
 
2863 2863
                             if (isset($package_info->sendtofriend) && $package_info->sendtofriend) {
2864
-                                $html .= $seperator . '<a href="javascript:void(0);" class="' . $b_sendtofriend . '">' . SEND_TO_FRIEND . '</a>';
2864
+                                $html .= $seperator.'<a href="javascript:void(0);" class="'.$b_sendtofriend.'">'.SEND_TO_FRIEND.'</a>';
2865 2865
                             }
2866 2866
 
2867 2867
                             $html .= '</span></div>';
2868 2868
 
2869 2869
 
2870 2870
                             if (isset($_REQUEST['send_inquiry']) && $_REQUEST['send_inquiry'] == 'success') {
2871
-                                $html .= '<p class="sucess_msg">' . SEND_INQUIRY_SUCCESS . '</p>';
2871
+                                $html .= '<p class="sucess_msg">'.SEND_INQUIRY_SUCCESS.'</p>';
2872 2872
                             } elseif (isset($_REQUEST['sendtofrnd']) && $_REQUEST['sendtofrnd'] == 'success') {
2873
-                                $html .= '<p class="sucess_msg">' . SEND_FRIEND_SUCCESS . '</p>';
2873
+                                $html .= '<p class="sucess_msg">'.SEND_FRIEND_SUCCESS.'</p>';
2874 2874
                             } elseif (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 'captch') {
2875
-                                $html .= '<p class="error_msg_fix">' . WRONG_CAPTCH_MSG . '</p>';
2875
+                                $html .= '<p class="error_msg_fix">'.WRONG_CAPTCH_MSG.'</p>';
2876 2876
                             }
2877 2877
 
2878 2878
                             /*if(!$preview){require_once (geodir_plugin_path().'/geodirectory-templates/popup-forms.php');}*/
@@ -2899,11 +2899,11 @@  discard block
 block discarded – undo
2899 2899
                                     $i++;
2900 2900
                                 }
2901 2901
 
2902
-                                $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af;
2903
-                                $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory') . ': ' : '';
2902
+                                $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-email" style="'.$field_icon.'">'.$field_icon_af;
2903
+                                $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory').': ' : '';
2904 2904
                                 $html .= '</span><span class="geodir-email-address-output">';
2905
-                                $email = stripslashes($post->{$type['htmlvar_name']}) ;
2906
-                                if($e_split = explode('@',$email)){
2905
+                                $email = stripslashes($post->{$type['htmlvar_name']});
2906
+                                if ($e_split = explode('@', $email)) {
2907 2907
                                     /**
2908 2908
                                      * Filter email custom field name output.
2909 2909
                                      *
@@ -2912,10 +2912,10 @@  discard block
 block discarded – undo
2912 2912
                                      * @param string $email The email string being output.
2913 2913
                                      * @param array $type Custom field variables array.
2914 2914
                                      */
2915
-                                    $email_name = apply_filters('geodir_email_field_name_output',$email,$type);
2916
-                                    $html .=  "<script>document.write('<a href=\"mailto:'+'$e_split[0]' + '@' + '$e_split[1]'+'\">$email_name</a>')</script>";
2917
-                                }else{
2918
-                                    $html .=  $email;
2915
+                                    $email_name = apply_filters('geodir_email_field_name_output', $email, $type);
2916
+                                    $html .= "<script>document.write('<a href=\"mailto:'+'$e_split[0]' + '@' + '$e_split[1]'+'\">$email_name</a>')</script>";
2917
+                                } else {
2918
+                                    $html .= $email;
2919 2919
                                 }
2920 2920
                                 $html .= '</span></div>';
2921 2921
                             }
@@ -2935,7 +2935,7 @@  discard block
 block discarded – undo
2935 2935
                             if (!empty($files)):
2936 2936
 
2937 2937
                                 $extra_fields = !empty($type['extra_fields']) ? maybe_unserialize($type['extra_fields']) : NULL;
2938
-                                $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'] : '';
2938
+                                $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'] : '';
2939 2939
 
2940 2940
                                 $file_paths = '';
2941 2941
                                 foreach ($files as $file) {
@@ -2972,9 +2972,9 @@  discard block
 block discarded – undo
2972 2972
                                             //$file_paths .= '<img src="'.$file.'"  />';	
2973 2973
                                             $file_paths .= '</div>';
2974 2974
                                         } else {
2975
-                                            $ext_path = '_' . $html_var . '_';
2975
+                                            $ext_path = '_'.$html_var.'_';
2976 2976
                                             $filename = explode($ext_path, $filename);
2977
-                                            $file_paths .= '<a href="' . $file . '" target="_blank">' . $filename[count($filename) - 1] . '</a>';
2977
+                                            $file_paths .= '<a href="'.$file.'" target="_blank">'.$filename[count($filename) - 1].'</a>';
2978 2978
                                         }
2979 2979
                                     }
2980 2980
                                 }
@@ -2998,11 +2998,11 @@  discard block
 block discarded – undo
2998 2998
                                     $i++;
2999 2999
                                 }
3000 3000
 
3001
-                                $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' geodir-custom-file-box ' . $type['htmlvar_name'] . '"><div class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
3001
+                                $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' geodir-custom-file-box '.$type['htmlvar_name'].'"><div class="geodir-i-select" style="'.$field_icon.'">'.$field_icon_af;
3002 3002
                                 $html .= '<span style="display: inline-block; vertical-align: top; padding-right: 14px;">';
3003
-                                $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory') . ': ' : '';
3003
+                                $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory').': ' : '';
3004 3004
                                 $html .= '</span>';
3005
-                                $html .= $file_paths . '</div></div>';
3005
+                                $html .= $file_paths.'</div></div>';
3006 3006
 
3007 3007
                             endif;
3008 3008
                         endif;
@@ -3033,9 +3033,9 @@  discard block
 block discarded – undo
3033 3033
                                 $i++;
3034 3034
                             }
3035 3035
 
3036
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
3037
-                            $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory') . ': ' : '';
3038
-                            $html .= '</span>' . wpautop(stripslashes($post->{$type['htmlvar_name']})) . '</div>';
3036
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-text" style="'.$field_icon.'">'.$field_icon_af;
3037
+                            $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory').': ' : '';
3038
+                            $html .= '</span>'.wpautop(stripslashes($post->{$type['htmlvar_name']})).'</div>';
3039 3039
 
3040 3040
                         }
3041 3041
                         break;
@@ -3062,16 +3062,16 @@  discard block
 block discarded – undo
3062 3062
                                 $i++;
3063 3063
                             }
3064 3064
 
3065
-                            $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
3066
-                            $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory') . ': ' : '';
3067
-                            $html .= '</span>' . wpautop(stripslashes($post->{$type['htmlvar_name']})) . '</div>';
3065
+                            $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-text" style="'.$field_icon.'">'.$field_icon_af;
3066
+                            $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory').': ' : '';
3067
+                            $html .= '</span>'.wpautop(stripslashes($post->{$type['htmlvar_name']})).'</div>';
3068 3068
 
3069 3069
                         }
3070 3070
                         break;
3071 3071
                     case 'taxonomy': {
3072 3072
                         $html_var = $type['htmlvar_name'];
3073
-                        if ($html_var == $post->post_type . 'category' && !empty($post->{$html_var})) {
3074
-                            $post_taxonomy = $post->post_type . 'category';
3073
+                        if ($html_var == $post->post_type.'category' && !empty($post->{$html_var})) {
3074
+                            $post_taxonomy = $post->post_type.'category';
3075 3075
                             $field_value = $post->{$html_var};
3076 3076
                             $links = array();
3077 3077
                             $terms = array();
@@ -3089,7 +3089,7 @@  discard block
 block discarded – undo
3089 3089
                                     if ($term != '') {
3090 3090
                                         $term = get_term_by('id', $term, $html_var);
3091 3091
                                         if (is_object($term)) {
3092
-                                            $links[] = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>" . $term->name . "</a>";
3092
+                                            $links[] = "<a href='".esc_attr(get_term_link($term, $post_taxonomy))."'>".$term->name."</a>";
3093 3093
                                             $terms[] = $term;
3094 3094
                                         }
3095 3095
                                     }
@@ -3103,7 +3103,7 @@  discard block
 block discarded – undo
3103 3103
                                     $terms = $termsOrdered;
3104 3104
                                 }
3105 3105
                             }
3106
-                            $html_value = !empty($links) && !empty($terms) ? wp_sprintf('%l', $links, (object)$terms) : '';
3106
+                            $html_value = !empty($links) && !empty($terms) ? wp_sprintf('%l', $links, (object) $terms) : '';
3107 3107
 
3108 3108
                             if ($html_value != '') {
3109 3109
                                 if (strpos($field_icon, 'http') !== false) {
@@ -3124,9 +3124,9 @@  discard block
 block discarded – undo
3124 3124
                                     $i++;
3125 3125
                                 }
3126 3126
 
3127
-                                $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $html_var . '" style="clear:both;"><span class="geodir-i-taxonomy geodir-i-category" style="' . $field_icon . '">' . $field_icon_af;
3128
-                                $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory') . ': ' : '';
3129
-                                $html .= '</span> ' . $html_value . '</div>';
3127
+                                $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$html_var.'" style="clear:both;"><span class="geodir-i-taxonomy geodir-i-category" style="'.$field_icon.'">'.$field_icon_af;
3128
+                                $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory').': ' : '';
3129
+                                $html .= '</span> '.$html_value.'</div>';
3130 3130
                             }
3131 3131
                         }
3132 3132
                     }
@@ -3246,7 +3246,7 @@  discard block
 block discarded – undo
3246 3246
 
3247 3247
         $post_type = get_post_type($post_id);
3248 3248
         //echo $field_id; exit;
3249
-        $table = $plugin_prefix . $post_type . '_detail';
3249
+        $table = $plugin_prefix.$post_type.'_detail';
3250 3250
 
3251 3251
         $postcurr_images = array();
3252 3252
         $postcurr_images = geodir_get_post_meta($post_id, $field_id, true);
@@ -3265,13 +3265,13 @@  discard block
 block discarded – undo
3265 3265
             $geodir_uploadurl = $uploads['url'];
3266 3266
             $sub_dir = $uploads['subdir'];
3267 3267
 
3268
-            $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'] : '';
3268
+            $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'] : '';
3269 3269
 
3270 3270
             for ($m = 0; $m < count($post_image); $m++) {
3271 3271
 
3272 3272
                 /* --------- start ------- */
3273 3273
 
3274
-                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)))) {
3274
+                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)))) {
3275 3275
 
3276 3276
 
3277 3277
                     $curr_img_url = $post_image[$m];
@@ -3297,24 +3297,24 @@  discard block
 block discarded – undo
3297 3297
                     //$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');
3298 3298
 
3299 3299
                     if (!function_exists('wp_handle_upload'))
3300
-                        require_once(ABSPATH . 'wp-admin/includes/file.php');
3300
+                        require_once(ABSPATH.'wp-admin/includes/file.php');
3301 3301
 
3302 3302
                     if (!is_dir($geodir_uploadpath))
3303 3303
                         mkdir($geodir_uploadpath);
3304 3304
 
3305
-                    $new_name = $post_id . '_' . $field_id . '_' . $img_name_arr[0] . '.' . $img_name_arr[1];
3305
+                    $new_name = $post_id.'_'.$field_id.'_'.$img_name_arr[0].'.'.$img_name_arr[1];
3306 3306
                     $explode_sub_dir = explode("/", $sub_dir);
3307 3307
                     if ($curr_img_dir == end($explode_sub_dir)) {
3308
-                        $img_path = $geodir_uploadpath . '/' . $filename;
3309
-                        $img_url = $geodir_uploadurl . '/' . $filename;
3308
+                        $img_path = $geodir_uploadpath.'/'.$filename;
3309
+                        $img_url = $geodir_uploadurl.'/'.$filename;
3310 3310
                     } else {
3311
-                        $img_path = $uploads_dir . '/temp_' . $current_user->data->ID . '/' . $filename;
3312
-                        $img_url = $uploads['url'] . '/temp_' . $current_user->data->ID . '/' . $filename;
3311
+                        $img_path = $uploads_dir.'/temp_'.$current_user->data->ID.'/'.$filename;
3312
+                        $img_url = $uploads['url'].'/temp_'.$current_user->data->ID.'/'.$filename;
3313 3313
                     }
3314 3314
 
3315 3315
                     $uploaded_file = '';
3316 3316
                     if (file_exists($img_path))
3317
-                        $uploaded_file = copy($img_path, $geodir_uploadpath . '/' . $new_name);
3317
+                        $uploaded_file = copy($img_path, $geodir_uploadpath.'/'.$new_name);
3318 3318
 
3319 3319
                     if ($curr_img_dir != $geodir_uploaddir) {
3320 3320
                         if (file_exists($img_path))
@@ -3322,7 +3322,7 @@  discard block
 block discarded – undo
3322 3322
                     }
3323 3323
 
3324 3324
                     if (!empty($uploaded_file))
3325
-                        $file_urls = $geodir_uploadurl . '/' . $new_name;
3325
+                        $file_urls = $geodir_uploadurl.'/'.$new_name;
3326 3326
 
3327 3327
                 } else {
3328 3328
                     $file_urls = $post_image[$m];
@@ -3336,8 +3336,8 @@  discard block
 block discarded – undo
3336 3336
         if (!empty($postcurr_images)) {
3337 3337
 
3338 3338
             if ($file_urls != $postcurr_images) {
3339
-                $invalid_files[] = (object)array('src' => $postcurr_images);
3340
-                $invalid_files = (object)$invalid_files;
3339
+                $invalid_files[] = (object) array('src' => $postcurr_images);
3340
+                $invalid_files = (object) $invalid_files;
3341 3341
             }
3342 3342
         }
3343 3343
 
@@ -3389,9 +3389,9 @@  discard block
 block discarded – undo
3389 3389
     function geodir_upload_dir($upload)
3390 3390
     {
3391 3391
         global $current_user;
3392
-        $upload['subdir'] = $upload['subdir'] . '/temp_' . $current_user->data->ID;
3393
-        $upload['path'] = $upload['basedir'] . $upload['subdir'];
3394
-        $upload['url'] = $upload['baseurl'] . $upload['subdir'];
3392
+        $upload['subdir'] = $upload['subdir'].'/temp_'.$current_user->data->ID;
3393
+        $upload['path'] = $upload['basedir'].$upload['subdir'];
3394
+        $upload['url'] = $upload['baseurl'].$upload['subdir'];
3395 3395
         return $upload;
3396 3396
     }
3397 3397
 
@@ -3406,20 +3406,20 @@  discard block
 block discarded – undo
3406 3406
         // check ajax noonce
3407 3407
         $imgid = $_POST["imgid"];
3408 3408
 
3409
-        check_ajax_referer($imgid . 'pluploadan');
3409
+        check_ajax_referer($imgid.'pluploadan');
3410 3410
 
3411 3411
         // handle custom file uploaddir
3412 3412
         add_filter('upload_dir', 'geodir_upload_dir');
3413 3413
 
3414 3414
         // change file orinetation if needed
3415
-        $fixed_file = geodir_exif($_FILES[$imgid . 'async-upload']);
3415
+        $fixed_file = geodir_exif($_FILES[$imgid.'async-upload']);
3416 3416
 
3417 3417
         // handle file upload
3418 3418
         $status = wp_handle_upload($fixed_file, array('test_form' => true, 'action' => 'plupload_action'));
3419 3419
         // remove handle custom file uploaddir
3420 3420
         remove_filter('upload_dir', 'geodir_upload_dir');
3421 3421
 
3422
-        if(!isset($status['url']) && isset($status['error'])){
3422
+        if (!isset($status['url']) && isset($status['error'])) {
3423 3423
             print_r($status);
3424 3424
         }
3425 3425
 
@@ -3449,9 +3449,9 @@  discard block
 block discarded – undo
3449 3449
 
3450 3450
     $post_type = get_post_type($post_id);
3451 3451
 
3452
-    $table = $plugin_prefix . $post_type . '_detail';
3452
+    $table = $plugin_prefix.$post_type.'_detail';
3453 3453
 
3454
-    $results = $wpdb->get_results($wpdb->prepare("SELECT geodir_video FROM " . $table . " WHERE post_id=%d", array($post_id)));
3454
+    $results = $wpdb->get_results($wpdb->prepare("SELECT geodir_video FROM ".$table." WHERE post_id=%d", array($post_id)));
3455 3455
 
3456 3456
     if ($results) {
3457 3457
         return $results[0]->geodir_video;
@@ -3475,9 +3475,9 @@  discard block
 block discarded – undo
3475 3475
 
3476 3476
     $post_type = get_post_type($post_id);
3477 3477
 
3478
-    $table = $plugin_prefix . $post_type . '_detail';
3478
+    $table = $plugin_prefix.$post_type.'_detail';
3479 3479
 
3480
-    $results = $wpdb->get_results($wpdb->prepare("SELECT geodir_special_offers FROM " . $table . " WHERE post_id=%d", array($post_id)));
3480
+    $results = $wpdb->get_results($wpdb->prepare("SELECT geodir_special_offers FROM ".$table." WHERE post_id=%d", array($post_id)));
3481 3481
 
3482 3482
     if ($results) {
3483 3483
         return $results[0]->geodir_special_offers;
@@ -3495,12 +3495,12 @@  discard block
 block discarded – undo
3495 3495
      */
3496 3496
     function geodir_max_upload_size()
3497 3497
     {
3498
-        $max_filesize = (float)get_option('geodir_upload_max_filesize', 2);
3498
+        $max_filesize = (float) get_option('geodir_upload_max_filesize', 2);
3499 3499
 
3500 3500
         if ($max_filesize > 0 && $max_filesize < 1) {
3501
-            $max_filesize = (int)($max_filesize * 1024) . 'kb';
3501
+            $max_filesize = (int) ($max_filesize * 1024).'kb';
3502 3502
         } else {
3503
-            $max_filesize = $max_filesize > 0 ? $max_filesize . 'mb' : '2mb';
3503
+            $max_filesize = $max_filesize > 0 ? $max_filesize.'mb' : '2mb';
3504 3504
         }
3505 3505
         /** Filter documented in geodirectory-functions/general_functions.php **/
3506 3506
         return apply_filters('geodir_default_image_upload_size_limit', $max_filesize);
@@ -3532,7 +3532,7 @@  discard block
 block discarded – undo
3532 3532
 
3533 3533
             $custom_fields = $wpdb->get_results(
3534 3534
                 $wpdb->prepare(
3535
-                    "select post_type,data_type,field_type,site_title,htmlvar_name 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",
3535
+                    "select post_type,data_type,field_type,site_title,htmlvar_name 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",
3536 3536
                     array($post_type)
3537 3537
                 ), 'ARRAY_A'
3538 3538
             );
@@ -3649,7 +3649,7 @@  discard block
 block discarded – undo
3649 3649
 
3650 3650
             $post_meta_info = $wpdb->query(
3651 3651
                 $wpdb->prepare(
3652
-                    "update " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set 
3652
+                    "update ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." set 
3653 3653
 															sort_order=%d 
3654 3654
 															where id= %d",
3655 3655
                     array($count, $cf)
@@ -3731,14 +3731,14 @@  discard block
 block discarded – undo
3731 3731
 
3732 3732
         $check_html_variable = $wpdb->get_var(
3733 3733
             $wpdb->prepare(
3734
-                "select htmlvar_name from " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s and field_type=%s ",
3734
+                "select htmlvar_name from ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." where htmlvar_name = %s and post_type = %s and field_type=%s ",
3735 3735
                 array($cehhtmlvar_name, $post_type, $field_type)
3736 3736
             )
3737 3737
         );
3738 3738
 
3739 3739
         if ($is_default == 1) {
3740 3740
 
3741
-            $wpdb->query($wpdb->prepare("update " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set is_default='0', default_order='' where post_type = %s", array($post_type)));
3741
+            $wpdb->query($wpdb->prepare("update ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." set is_default='0', default_order='' where post_type = %s", array($post_type)));
3742 3742
 
3743 3743
         }
3744 3744
 
@@ -3749,7 +3749,7 @@  discard block
 block discarded – undo
3749 3749
 
3750 3750
                 $wpdb->prepare(
3751 3751
 
3752
-                    "insert into " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set 
3752
+                    "insert into ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." set 
3753 3753
 				post_type = %s,
3754 3754
 				data_type = %s,
3755 3755
 				field_type = %s,
@@ -3780,7 +3780,7 @@  discard block
 block discarded – undo
3780 3780
 
3781 3781
                 $wpdb->prepare(
3782 3782
 
3783
-                    "update " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set 
3783
+                    "update ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." set 
3784 3784
 				post_type = %s,
3785 3785
 				data_type = %s,
3786 3786
 				field_type = %s,
@@ -3806,7 +3806,7 @@  discard block
 block discarded – undo
3806 3806
         }
3807 3807
 
3808 3808
 
3809
-        return (int)$lastid;
3809
+        return (int) $lastid;
3810 3810
 
3811 3811
     }
3812 3812
 }
@@ -3829,7 +3829,7 @@  discard block
 block discarded – undo
3829 3829
         if ($field_id != '') {
3830 3830
             $cf = trim($field_id, '_');
3831 3831
 
3832
-            $wpdb->query($wpdb->prepare("delete from " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " where id= %d ", array($cf)));
3832
+            $wpdb->query($wpdb->prepare("delete from ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." where id= %d ", array($cf)));
3833 3833
 
3834 3834
             return $field_id;
3835 3835
 
@@ -3857,7 +3857,7 @@  discard block
 block discarded – undo
3857 3857
         global $wpdb;
3858 3858
         $cf = $result_str;
3859 3859
         if (!is_object($cf)) {
3860
-            $field_info = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " WHERE id = %d", array($cf)));
3860
+            $field_info = $wpdb->get_row($wpdb->prepare("SELECT * FROM ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." WHERE id = %d", array($cf)));
3861 3861
         } else {
3862 3862
             $field_info = $cf;
3863 3863
             $result_str = $cf->id;
@@ -3894,41 +3894,41 @@  discard block
 block discarded – undo
3894 3894
         if ($htmlvar_name == '')
3895 3895
             $htmlvar_name = isset($field_info->htmlvar_name) ? $field_info->htmlvar_name : '';
3896 3896
 
3897
-        $nonce = wp_create_nonce('custom_fields_' . $result_str);
3897
+        $nonce = wp_create_nonce('custom_fields_'.$result_str);
3898 3898
 
3899 3899
         ?>
3900
-        <li class="text" id="licontainer_<?php echo $result_str;?>">
3901
-            <div class="title title<?php echo $result_str;?> gt-fieldset"
3902
-                 title="<?php _e('Double Click to toggle and drag-drop to sort', 'geodirectory');?>"
3903
-                 ondblclick="show_hide('field_frm<?php echo $result_str;?>')">
3900
+        <li class="text" id="licontainer_<?php echo $result_str; ?>">
3901
+            <div class="title title<?php echo $result_str; ?> gt-fieldset"
3902
+                 title="<?php _e('Double Click to toggle and drag-drop to sort', 'geodirectory'); ?>"
3903
+                 ondblclick="show_hide('field_frm<?php echo $result_str; ?>')">
3904 3904
                 <?php
3905 3905
 
3906
-                $nonce = wp_create_nonce('custom_fields_' . $result_str);
3906
+                $nonce = wp_create_nonce('custom_fields_'.$result_str);
3907 3907
                 ?>
3908 3908
 
3909
-                <div title="<?php _e('Click to remove field', 'geodirectory');?>"
3910
-                     onclick="delete_sort_field('<?php echo $result_str;?>', '<?php echo $nonce;?>', this)"
3909
+                <div title="<?php _e('Click to remove field', 'geodirectory'); ?>"
3910
+                     onclick="delete_sort_field('<?php echo $result_str; ?>', '<?php echo $nonce; ?>', this)"
3911 3911
                      class="handlediv close"></div>
3912 3912
 
3913 3913
                 <b style="cursor:pointer;"
3914
-                   onclick="show_hide('field_frm<?php echo $result_str;?>')"><?php echo geodir_ucwords(__('Field:', 'geodirectory') . ' (' . $site_title . ')');?></b>
3914
+                   onclick="show_hide('field_frm<?php echo $result_str; ?>')"><?php echo geodir_ucwords(__('Field:', 'geodirectory').' ('.$site_title.')'); ?></b>
3915 3915
 
3916 3916
             </div>
3917 3917
 
3918
-            <div id="field_frm<?php echo $result_str;?>" class="field_frm"
3918
+            <div id="field_frm<?php echo $result_str; ?>" class="field_frm"
3919 3919
                  style="display:<?php if ($field_ins_upd == 'submit') {
3920 3920
                      echo 'block;';
3921 3921
                  } else {
3922 3922
                      echo 'none;';
3923 3923
                  } ?>">
3924 3924
                 <input type="hidden" name="_wpnonce" value="<?php echo $nonce; ?>"/>
3925
-                <input type="hidden" name="listing_type" id="listing_type" value="<?php echo $post_type;?>"/>
3926
-                <input type="hidden" name="field_type" id="field_type" value="<?php echo $field_type;?>"/>
3927
-                <input type="hidden" name="field_id" id="field_id" value="<?php echo $result_str;?>"/>
3925
+                <input type="hidden" name="listing_type" id="listing_type" value="<?php echo $post_type; ?>"/>
3926
+                <input type="hidden" name="field_type" id="field_type" value="<?php echo $field_type; ?>"/>
3927
+                <input type="hidden" name="field_id" id="field_id" value="<?php echo $result_str; ?>"/>
3928 3928
                 <input type="hidden" name="data_type" id="data_type" value="<?php if (isset($field_info->data_type)) {
3929 3929
                     echo $field_info->data_type;
3930 3930
                 }?>"/>
3931
-                <input type="hidden" name="htmlvar_name" id="htmlvar_name" value="<?php echo $htmlvar_name;?>"/>
3931
+                <input type="hidden" name="htmlvar_name" id="htmlvar_name" value="<?php echo $htmlvar_name; ?>"/>
3932 3932
 
3933 3933
 
3934 3934
                 <table class="widefat post fixed" border="0" style="width:100%;">
@@ -3952,7 +3952,7 @@  discard block
 block discarded – undo
3952 3952
                                        } ?>" style="width:45%;"/>
3953 3953
 
3954 3954
                                 <input type="radio" name="is_default"
3955
-                                       value="<?php echo $htmlvar_name; ?>_asc" <?php if (isset($field_info->default_order) && $field_info->default_order == $htmlvar_name . '_asc') {
3955
+                                       value="<?php echo $htmlvar_name; ?>_asc" <?php if (isset($field_info->default_order) && $field_info->default_order == $htmlvar_name.'_asc') {
3956 3956
                                     echo 'checked="checked"';
3957 3957
                                 } ?>/><span><?php _e('Set as default sort.', 'geodirectory'); ?></span>
3958 3958
 
@@ -3975,7 +3975,7 @@  discard block
 block discarded – undo
3975 3975
                                            echo esc_attr($field_info->desc_title);
3976 3976
                                        } ?>" style="width:45%;"/>
3977 3977
                                 <input type="radio" name="is_default"
3978
-                                       value="<?php echo $htmlvar_name; ?>_desc" <?php if (isset($field_info->default_order) && $field_info->default_order == $htmlvar_name . '_desc') {
3978
+                                       value="<?php echo $htmlvar_name; ?>_desc" <?php if (isset($field_info->default_order) && $field_info->default_order == $htmlvar_name.'_desc') {
3979 3979
                                     echo 'checked="checked"';
3980 3980
                                 } ?>/><span><?php _e('Set as default sort.', 'geodirectory'); ?></span>
3981 3981
                                 <br/>
@@ -4010,42 +4010,42 @@  discard block
 block discarded – undo
4010 4010
                     <?php } ?>
4011 4011
 
4012 4012
                     <tr>
4013
-                        <td><strong><?php _e('Is active :', 'geodirectory');?></strong></td>
4013
+                        <td><strong><?php _e('Is active :', 'geodirectory'); ?></strong></td>
4014 4014
                         <td align="left">
4015 4015
                             <select name="is_active" id="is_active">
4016 4016
                                 <option
4017 4017
                                     value="1" <?php if (isset($field_info->is_active) && $field_info->is_active == '1') {
4018 4018
                                     echo 'selected="selected"';
4019
-                                }?>><?php _e('Yes', 'geodirectory');?></option>
4019
+                                }?>><?php _e('Yes', 'geodirectory'); ?></option>
4020 4020
                                 <option
4021 4021
                                     value="0" <?php if (isset($field_info->is_active) && $field_info->is_active == '0') {
4022 4022
                                     echo 'selected="selected"';
4023
-                                }?>><?php _e('No', 'geodirectory');?></option>
4023
+                                }?>><?php _e('No', 'geodirectory'); ?></option>
4024 4024
                             </select>
4025 4025
                             <br/>
4026
-                            <span><?php _e('Select yes or no. If no is selected then the field will not be displayed anywhere.', 'geodirectory');?></span>
4026
+                            <span><?php _e('Select yes or no. If no is selected then the field will not be displayed anywhere.', 'geodirectory'); ?></span>
4027 4027
                         </td>
4028 4028
                     </tr>
4029 4029
 
4030 4030
                     <tr>
4031
-                        <td><strong><?php _e('Display order :', 'geodirectory');?></strong></td>
4031
+                        <td><strong><?php _e('Display order :', 'geodirectory'); ?></strong></td>
4032 4032
                         <td align="left"><input type="text" readonly="readonly" name="sort_order" id="sort_order"
4033 4033
                                                 value="<?php if (isset($field_info->sort_order)) {
4034 4034
                                                     echo esc_attr($field_info->sort_order);
4035 4035
                                                 }?>" size="50"/>
4036 4036
                             <br/>
4037
-                            <span><?php _e('Enter the display order of this field in backend. e.g. 5', 'geodirectory');?></span>
4037
+                            <span><?php _e('Enter the display order of this field in backend. e.g. 5', 'geodirectory'); ?></span>
4038 4038
                         </td>
4039 4039
                     </tr>
4040 4040
 
4041 4041
                     <tr>
4042 4042
                         <td>&nbsp;</td>
4043 4043
                         <td align="left">
4044
-                            <input type="button" class="button" name="save" id="save" value="<?php esc_attr_e('Save', 'geodirectory');?>"
4045
-                                   onclick="save_sort_field('<?php echo $result_str;?>')"/>
4044
+                            <input type="button" class="button" name="save" id="save" value="<?php esc_attr_e('Save', 'geodirectory'); ?>"
4045
+                                   onclick="save_sort_field('<?php echo $result_str; ?>')"/>
4046 4046
 
4047
-                            <a href="javascript:void(0)"><input type="button" name="delete" value="<?php esc_attr_e('Delete', 'geodirectory');?>"
4048
-                                                                onclick="delete_sort_field('<?php echo $result_str;?>', '<?php echo $nonce;?>', this)"
4047
+                            <a href="javascript:void(0)"><input type="button" name="delete" value="<?php esc_attr_e('Delete', 'geodirectory'); ?>"
4048
+                                                                onclick="delete_sort_field('<?php echo $result_str; ?>', '<?php echo $nonce; ?>', this)"
4049 4049
                                                                 class="button_n"/></a>
4050 4050
 
4051 4051
                         </td>
@@ -4080,7 +4080,7 @@  discard block
 block discarded – undo
4080 4080
         if (!$package_id || !$field_name || !$post_type) {
4081 4081
             return true;
4082 4082
         }
4083
-        $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));
4083
+        $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));
4084 4084
 
4085 4085
         if ($wpdb->get_var($sql)) {
4086 4086
             return true;
Please login to merge, or discard this patch.
geodirectory-functions/compatibility/Avada.php 2 patches
Indentation   +105 added lines, -105 removed lines patch added patch discarded remove patch
@@ -18,10 +18,10 @@  discard block
 block discarded – undo
18 18
  */
19 19
 function gd_strip_breadcrumb_wrappers($breadcrumb)
20 20
 {
21
-    $breadcrumb = str_replace(array("<li>","</li>"), "", $breadcrumb);
22
-    $breadcrumb = str_replace('<div class="geodir-breadcrumb clearfix"><ul id="breadcrumbs">', '<ul class="fusion-breadcrumbs"><li>', $breadcrumb);
23
-    $breadcrumb = str_replace('</ul></div>', '</li></ul>', $breadcrumb);
24
-    return $breadcrumb;
21
+	$breadcrumb = str_replace(array("<li>","</li>"), "", $breadcrumb);
22
+	$breadcrumb = str_replace('<div class="geodir-breadcrumb clearfix"><ul id="breadcrumbs">', '<ul class="fusion-breadcrumbs"><li>', $breadcrumb);
23
+	$breadcrumb = str_replace('</ul></div>', '</li></ul>', $breadcrumb);
24
+	return $breadcrumb;
25 25
 }
26 26
 
27 27
 add_filter('geodir_breadcrumb_separator', 'gd_change_breadcrumb_separator');
@@ -35,8 +35,8 @@  discard block
 block discarded – undo
35 35
  */
36 36
 function gd_change_breadcrumb_separator($separator)
37 37
 {
38
-    $separator = ' / ';
39
-    return $separator;
38
+	$separator = ' / ';
39
+	return $separator;
40 40
 }
41 41
 
42 42
 add_action('avada_override_current_page_title_bar','gd_avada_current_page_title_bar_change');
@@ -49,11 +49,11 @@  discard block
 block discarded – undo
49 49
  */
50 50
 function gd_avada_current_page_title_bar_change($c_pageID)
51 51
 {
52
-    if (geodir_is_geodir_page()) {
53
-        gd_avada_current_page_title_bar();
54
-    }else{
55
-        avada_current_page_title_bar( $c_pageID );
56
-    }
52
+	if (geodir_is_geodir_page()) {
53
+		gd_avada_current_page_title_bar();
54
+	}else{
55
+		avada_current_page_title_bar( $c_pageID );
56
+	}
57 57
 
58 58
 }
59 59
 
@@ -65,46 +65,46 @@  discard block
 block discarded – undo
65 65
  */
66 66
 function gd_avada_current_page_title_bar()
67 67
 {
68
-    ob_start();
69
-    geodir_breadcrumb();
70
-    $secondary_content = ob_get_contents();
71
-    ob_get_clean();
72
-
73
-    $title = '';
74
-    $subtitle = '';
75
-
76
-    if (geodir_is_page('listing')) {
77
-        ob_start(); // Start buffering;
78
-        geodir_action_listings_title();
79
-        $title = ob_get_clean();
80
-        avada_page_title_bar($title, $subtitle, $secondary_content);
81
-    }
82
-
83
-    if (geodir_is_page('add-listing')) {
84
-        ob_start(); // Start buffering;
85
-        geodir_action_add_listing_page_title();
86
-        $title = ob_get_clean();
87
-        avada_page_title_bar($title, $subtitle, $secondary_content);
88
-    }
89
-
90
-    if (geodir_is_page('author')) {
91
-        ob_start(); // Start buffering;
92
-        geodir_action_author_page_title();
93
-        $title = ob_get_clean();
94
-        avada_page_title_bar($title, $subtitle, $secondary_content);
95
-    }
96
-
97
-    if (geodir_is_page('detail') || geodir_is_page('preview')) {
98
-        $title = get_the_title();
99
-        avada_page_title_bar($title, $subtitle, $secondary_content);
100
-    }
101
-
102
-    if (geodir_is_page('search')) {
103
-        ob_start(); // Start buffering;
104
-        geodir_action_search_page_title();
105
-        $title = ob_get_clean();
106
-        avada_page_title_bar($title, $subtitle, $secondary_content);
107
-    }
68
+	ob_start();
69
+	geodir_breadcrumb();
70
+	$secondary_content = ob_get_contents();
71
+	ob_get_clean();
72
+
73
+	$title = '';
74
+	$subtitle = '';
75
+
76
+	if (geodir_is_page('listing')) {
77
+		ob_start(); // Start buffering;
78
+		geodir_action_listings_title();
79
+		$title = ob_get_clean();
80
+		avada_page_title_bar($title, $subtitle, $secondary_content);
81
+	}
82
+
83
+	if (geodir_is_page('add-listing')) {
84
+		ob_start(); // Start buffering;
85
+		geodir_action_add_listing_page_title();
86
+		$title = ob_get_clean();
87
+		avada_page_title_bar($title, $subtitle, $secondary_content);
88
+	}
89
+
90
+	if (geodir_is_page('author')) {
91
+		ob_start(); // Start buffering;
92
+		geodir_action_author_page_title();
93
+		$title = ob_get_clean();
94
+		avada_page_title_bar($title, $subtitle, $secondary_content);
95
+	}
96
+
97
+	if (geodir_is_page('detail') || geodir_is_page('preview')) {
98
+		$title = get_the_title();
99
+		avada_page_title_bar($title, $subtitle, $secondary_content);
100
+	}
101
+
102
+	if (geodir_is_page('search')) {
103
+		ob_start(); // Start buffering;
104
+		geodir_action_search_page_title();
105
+		$title = ob_get_clean();
106
+		avada_page_title_bar($title, $subtitle, $secondary_content);
107
+	}
108 108
 }
109 109
 
110 110
 /**
@@ -115,34 +115,34 @@  discard block
 block discarded – undo
115 115
  */
116 116
 function gd_compat_php_avada()
117 117
 {
118
-    // change widget wrappers
119
-    //add_filter( 'geodir_before_widget', 'geodir_before_widget_compat',10,1 );
120
-    //add_filter( 'geodir_after_widget', 'geodir_after_widget_compat',10,1 );
121
-
122
-    // REMOVE BREADCRUMB
123
-    remove_action('geodir_detail_before_main_content', 'geodir_breadcrumb', 20);
124
-    remove_action('geodir_listings_before_main_content', 'geodir_breadcrumb', 20);
125
-    remove_action('geodir_author_before_main_content', 'geodir_breadcrumb', 20);
126
-    remove_action('geodir_search_before_main_content', 'geodir_breadcrumb', 20);
127
-    remove_action('geodir_home_before_main_content', 'geodir_breadcrumb', 20);
128
-    remove_action('geodir_location_before_main_content', 'geodir_breadcrumb', 20);
129
-
130
-    // REMOVE PAGE TITLES
131
-    remove_action('geodir_listings_page_title', 'geodir_action_listings_title', 10);
132
-    remove_action('geodir_add_listing_page_title', 'geodir_action_add_listing_page_title', 10);
133
-    remove_action('geodir_details_main_content', 'geodir_action_page_title', 20);
134
-    remove_action('geodir_search_page_title', 'geodir_action_search_page_title', 10);
135
-    remove_action('geodir_author_page_title', 'geodir_action_author_page_title', 10);
136
-
137
-    // make top section wide
138
-    remove_action('geodir_home_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10);
139
-    remove_action('geodir_location_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10);
140
-    remove_action('geodir_author_before_main_content', 'geodir_action_geodir_sidebar_author_top', 10);
141
-    remove_action('geodir_search_before_main_content', 'geodir_action_geodir_sidebar_search_top', 10);
142
-    remove_action('geodir_detail_before_main_content', 'geodir_action_geodir_sidebar_detail_top', 10);
143
-    remove_action('geodir_listings_before_main_content', 'geodir_action_geodir_sidebar_listings_top', 10);
144
-
145
-    //gd_compat_add_top_section_back();
118
+	// change widget wrappers
119
+	//add_filter( 'geodir_before_widget', 'geodir_before_widget_compat',10,1 );
120
+	//add_filter( 'geodir_after_widget', 'geodir_after_widget_compat',10,1 );
121
+
122
+	// REMOVE BREADCRUMB
123
+	remove_action('geodir_detail_before_main_content', 'geodir_breadcrumb', 20);
124
+	remove_action('geodir_listings_before_main_content', 'geodir_breadcrumb', 20);
125
+	remove_action('geodir_author_before_main_content', 'geodir_breadcrumb', 20);
126
+	remove_action('geodir_search_before_main_content', 'geodir_breadcrumb', 20);
127
+	remove_action('geodir_home_before_main_content', 'geodir_breadcrumb', 20);
128
+	remove_action('geodir_location_before_main_content', 'geodir_breadcrumb', 20);
129
+
130
+	// REMOVE PAGE TITLES
131
+	remove_action('geodir_listings_page_title', 'geodir_action_listings_title', 10);
132
+	remove_action('geodir_add_listing_page_title', 'geodir_action_add_listing_page_title', 10);
133
+	remove_action('geodir_details_main_content', 'geodir_action_page_title', 20);
134
+	remove_action('geodir_search_page_title', 'geodir_action_search_page_title', 10);
135
+	remove_action('geodir_author_page_title', 'geodir_action_author_page_title', 10);
136
+
137
+	// make top section wide
138
+	remove_action('geodir_home_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10);
139
+	remove_action('geodir_location_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10);
140
+	remove_action('geodir_author_before_main_content', 'geodir_action_geodir_sidebar_author_top', 10);
141
+	remove_action('geodir_search_before_main_content', 'geodir_action_geodir_sidebar_search_top', 10);
142
+	remove_action('geodir_detail_before_main_content', 'geodir_action_geodir_sidebar_detail_top', 10);
143
+	remove_action('geodir_listings_before_main_content', 'geodir_action_geodir_sidebar_listings_top', 10);
144
+
145
+	//gd_compat_add_top_section_back();
146 146
 
147 147
 }
148 148
 
@@ -156,17 +156,17 @@  discard block
 block discarded – undo
156 156
 function gd_compat_add_top_section_back()
157 157
 {
158 158
 
159
-    if (is_page_geodir_home() || geodir_is_page('location')) {
160
-        geodir_action_geodir_sidebar_home_top();
161
-    } elseif (geodir_is_page('listing')) {
162
-        geodir_action_geodir_sidebar_listings_top();
163
-    } elseif (geodir_is_page('detail')) {
164
-        geodir_action_geodir_sidebar_detail_top();
165
-    } elseif (geodir_is_page('search')) {
166
-        geodir_action_geodir_sidebar_search_top();
167
-    } elseif (geodir_is_page('author')) {
168
-        geodir_action_geodir_sidebar_author_top();
169
-    }
159
+	if (is_page_geodir_home() || geodir_is_page('location')) {
160
+		geodir_action_geodir_sidebar_home_top();
161
+	} elseif (geodir_is_page('listing')) {
162
+		geodir_action_geodir_sidebar_listings_top();
163
+	} elseif (geodir_is_page('detail')) {
164
+		geodir_action_geodir_sidebar_detail_top();
165
+	} elseif (geodir_is_page('search')) {
166
+		geodir_action_geodir_sidebar_search_top();
167
+	} elseif (geodir_is_page('author')) {
168
+		geodir_action_geodir_sidebar_author_top();
169
+	}
170 170
 
171 171
 
172 172
 }
@@ -183,12 +183,12 @@  discard block
 block discarded – undo
183 183
  */
184 184
 function gd_compat_body_class($classes)
185 185
 {
186
-    if (geodir_is_geodir_page()) {
187
-        $classes[] = 'wpgeo-avada';
188
-    } else {
189
-        $classes[] = '';
190
-    }
191
-    return $classes;
186
+	if (geodir_is_geodir_page()) {
187
+		$classes[] = 'wpgeo-avada';
188
+	} else {
189
+		$classes[] = '';
190
+	}
191
+	return $classes;
192 192
 }
193 193
 
194 194
 
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
  */
203 203
 function geodir_before_widget_compat($var)
204 204
 {
205
-    return '<div id="%1$s" class="geodir-widget %2$s">';
205
+	return '<div id="%1$s" class="geodir-widget %2$s">';
206 206
 }
207 207
 
208 208
 /**
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
  */
216 216
 function geodir_after_widget_compat($var)
217 217
 {
218
-    return '</div>';
218
+	return '</div>';
219 219
 }
220 220
 
221 221
 add_filter('geodir_search_form_class', 'geodir_search_form_class_avada');
@@ -229,8 +229,8 @@  discard block
 block discarded – undo
229 229
  */
230 230
 function geodir_search_form_class_avada($class)
231 231
 {
232
-    $class .= ' search';
233
-    return $class;
232
+	$class .= ' search';
233
+	return $class;
234 234
 }
235 235
 
236 236
 
@@ -239,11 +239,11 @@  discard block
 block discarded – undo
239 239
 
240 240
 // Avada sets the search page to use wither post or page, we need it to be 'any'
241 241
 function gd_avada_search_filter( $query ) {
242
-    if ( geodir_is_page('search') && is_search() && $query->is_search) {
243
-            $query->set('post_type', 'any');
244
-    }
245
-    return $query;
242
+	if ( geodir_is_page('search') && is_search() && $query->is_search) {
243
+			$query->set('post_type', 'any');
244
+	}
245
+	return $query;
246 246
 }
247 247
 if ( ! is_admin() ) {
248
-    add_filter( 'pre_get_posts', 'gd_avada_search_filter',11 );
248
+	add_filter( 'pre_get_posts', 'gd_avada_search_filter',11 );
249 249
 }
250 250
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
  */
19 19
 function gd_strip_breadcrumb_wrappers($breadcrumb)
20 20
 {
21
-    $breadcrumb = str_replace(array("<li>","</li>"), "", $breadcrumb);
21
+    $breadcrumb = str_replace(array("<li>", "</li>"), "", $breadcrumb);
22 22
     $breadcrumb = str_replace('<div class="geodir-breadcrumb clearfix"><ul id="breadcrumbs">', '<ul class="fusion-breadcrumbs"><li>', $breadcrumb);
23 23
     $breadcrumb = str_replace('</ul></div>', '</li></ul>', $breadcrumb);
24 24
     return $breadcrumb;
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
     return $separator;
40 40
 }
41 41
 
42
-add_action('avada_override_current_page_title_bar','gd_avada_current_page_title_bar_change');
42
+add_action('avada_override_current_page_title_bar', 'gd_avada_current_page_title_bar_change');
43 43
 /**
44 44
  * new title bar functions for gd pages.
45 45
  *
@@ -51,8 +51,8 @@  discard block
 block discarded – undo
51 51
 {
52 52
     if (geodir_is_geodir_page()) {
53 53
         gd_avada_current_page_title_bar();
54
-    }else{
55
-        avada_current_page_title_bar( $c_pageID );
54
+    } else {
55
+        avada_current_page_title_bar($c_pageID);
56 56
     }
57 57
 
58 58
 }
@@ -238,12 +238,12 @@  discard block
 block discarded – undo
238 238
 gd_compat_php_avada();
239 239
 
240 240
 // Avada sets the search page to use wither post or page, we need it to be 'any'
241
-function gd_avada_search_filter( $query ) {
242
-    if ( geodir_is_page('search') && is_search() && $query->is_search) {
241
+function gd_avada_search_filter($query) {
242
+    if (geodir_is_page('search') && is_search() && $query->is_search) {
243 243
             $query->set('post_type', 'any');
244 244
     }
245 245
     return $query;
246 246
 }
247
-if ( ! is_admin() ) {
248
-    add_filter( 'pre_get_posts', 'gd_avada_search_filter',11 );
247
+if (!is_admin()) {
248
+    add_filter('pre_get_posts', 'gd_avada_search_filter', 11);
249 249
 }
250 250
\ No newline at end of file
Please login to merge, or discard this patch.
geodirectory_template_tags.php 1 patch
Indentation   +343 added lines, -343 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
  */
23 23
 function geodir_core_dequeue_script()
24 24
 {
25
-    wp_dequeue_script('flexslider');
25
+	wp_dequeue_script('flexslider');
26 26
 }
27 27
 
28 28
 add_action('wp_print_scripts', 'geodir_core_dequeue_script', 100);
@@ -35,158 +35,158 @@  discard block
 block discarded – undo
35 35
  */
36 36
 function geodir_templates_scripts()
37 37
 {
38
-    $is_detail_page = false;
39
-    $geodir_map_name = geodir_map_name();
40
-
41
-    if((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview') )) {
42
-        $is_detail_page = true;
43
-    }
44
-
45
-    wp_enqueue_script('jquery');
46
-
47
-    wp_register_script('geodirectory-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory.min.js#asyncload', array(), GEODIRECTORY_VERSION);
48
-    wp_enqueue_script('geodirectory-script');
49
-
50
-    $geodir_vars_data = array(
51
-        'siteurl' => get_option('siteurl'),
52
-        'geodir_plugin_url' => geodir_plugin_url(),
53
-        'geodir_ajax_url' => geodir_get_ajax_url(),
54
-        'geodir_gd_modal' => (int)get_option('geodir_disable_gb_modal'),
55
-        'is_rtl' => is_rtl() ? 1 : 0 // fix rtl issue
56
-    );
57
-
58
-    /**
59
-     * Filter the `geodir_var` data array that outputs the  wp_localize_script() translations and variables.
60
-     *
61
-     * This is used by addons to add JS translatable variables.
62
-     *
63
-     * @since 1.4.4
64
-     * @param array $geodir_vars_data {
65
-     *    geodir var data used by addons to add JS translatable variables.
66
-     *
67
-     *    @type string $siteurl Site url.
68
-     *    @type string $geodir_plugin_url Geodirectory core plugin url.
69
-     *    @type string $geodir_ajax_url Geodirectory plugin ajax url.
70
-     *    @type int $geodir_gd_modal Disable GD modal that displays slideshow images in popup?.
71
-     *    @type int $is_rtl Checks if current locale is RTL.
72
-     *
73
-     * }
74
-     */
75
-    $geodir_vars_data = apply_filters('geodir_vars_data',$geodir_vars_data);
76
-
77
-    wp_localize_script('geodirectory-script', 'geodir_var', $geodir_vars_data);
78
-
79
-    wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION,true);
80
-    if($is_detail_page){wp_enqueue_script('geodirectory-jquery-flexslider-js');}
81
-
82
-    wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url() . '/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION,true);
83
-    wp_enqueue_script('geodirectory-lightbox-jquery');
84
-
85
-    wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url() . '/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION,true);
86
-    if ($is_detail_page) {
87
-        wp_enqueue_script('geodirectory-jquery-simplemodal');
88
-    }
89
-
90
-    if (in_array($geodir_map_name, array('auto', 'google'))) {
91
-        $map_lang = "&language=" . geodir_get_map_default_language();
92
-        /**
93
-         * Filter the variables that are added to the end of the google maps script call.
94
-         *
95
-         * This i used to change things like google maps language etc.
96
-         *
97
-         * @since 1.0.0
98
-         * @param string $var The string to filter, default is empty string.
99
-         */
100
-        $map_extra = apply_filters('geodir_googlemap_script_extra', '');
101
-        wp_enqueue_script('geodirectory-googlemap-script', '//maps.google.com/maps/api/js?' . $map_lang . $map_extra, '', NULL);
102
-    }
38
+	$is_detail_page = false;
39
+	$geodir_map_name = geodir_map_name();
40
+
41
+	if((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview') )) {
42
+		$is_detail_page = true;
43
+	}
44
+
45
+	wp_enqueue_script('jquery');
46
+
47
+	wp_register_script('geodirectory-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory.min.js#asyncload', array(), GEODIRECTORY_VERSION);
48
+	wp_enqueue_script('geodirectory-script');
49
+
50
+	$geodir_vars_data = array(
51
+		'siteurl' => get_option('siteurl'),
52
+		'geodir_plugin_url' => geodir_plugin_url(),
53
+		'geodir_ajax_url' => geodir_get_ajax_url(),
54
+		'geodir_gd_modal' => (int)get_option('geodir_disable_gb_modal'),
55
+		'is_rtl' => is_rtl() ? 1 : 0 // fix rtl issue
56
+	);
57
+
58
+	/**
59
+	 * Filter the `geodir_var` data array that outputs the  wp_localize_script() translations and variables.
60
+	 *
61
+	 * This is used by addons to add JS translatable variables.
62
+	 *
63
+	 * @since 1.4.4
64
+	 * @param array $geodir_vars_data {
65
+	 *    geodir var data used by addons to add JS translatable variables.
66
+	 *
67
+	 *    @type string $siteurl Site url.
68
+	 *    @type string $geodir_plugin_url Geodirectory core plugin url.
69
+	 *    @type string $geodir_ajax_url Geodirectory plugin ajax url.
70
+	 *    @type int $geodir_gd_modal Disable GD modal that displays slideshow images in popup?.
71
+	 *    @type int $is_rtl Checks if current locale is RTL.
72
+	 *
73
+	 * }
74
+	 */
75
+	$geodir_vars_data = apply_filters('geodir_vars_data',$geodir_vars_data);
76
+
77
+	wp_localize_script('geodirectory-script', 'geodir_var', $geodir_vars_data);
78
+
79
+	wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION,true);
80
+	if($is_detail_page){wp_enqueue_script('geodirectory-jquery-flexslider-js');}
81
+
82
+	wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url() . '/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION,true);
83
+	wp_enqueue_script('geodirectory-lightbox-jquery');
84
+
85
+	wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url() . '/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION,true);
86
+	if ($is_detail_page) {
87
+		wp_enqueue_script('geodirectory-jquery-simplemodal');
88
+	}
89
+
90
+	if (in_array($geodir_map_name, array('auto', 'google'))) {
91
+		$map_lang = "&language=" . geodir_get_map_default_language();
92
+		/**
93
+		 * Filter the variables that are added to the end of the google maps script call.
94
+		 *
95
+		 * This i used to change things like google maps language etc.
96
+		 *
97
+		 * @since 1.0.0
98
+		 * @param string $var The string to filter, default is empty string.
99
+		 */
100
+		$map_extra = apply_filters('geodir_googlemap_script_extra', '');
101
+		wp_enqueue_script('geodirectory-googlemap-script', '//maps.google.com/maps/api/js?' . $map_lang . $map_extra, '', NULL);
102
+	}
103 103
     
104
-    if ($geodir_map_name == 'osm') {
105
-        // Leaflet OpenStreetMap
106
-        wp_register_style('geodirectory-leaflet-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
107
-        wp_enqueue_style('geodirectory-leaflet-style');
104
+	if ($geodir_map_name == 'osm') {
105
+		// Leaflet OpenStreetMap
106
+		wp_register_style('geodirectory-leaflet-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
107
+		wp_enqueue_style('geodirectory-leaflet-style');
108 108
             
109
-        wp_register_script('geodirectory-leaflet-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION);
110
-        wp_enqueue_script('geodirectory-leaflet-script');
109
+		wp_register_script('geodirectory-leaflet-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION);
110
+		wp_enqueue_script('geodirectory-leaflet-script');
111 111
         
112
-        wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/osm.geocode.js', array(), GEODIRECTORY_VERSION);
113
-        wp_enqueue_script('geodirectory-leaflet-geo-script');
114
-    }
115
-    wp_enqueue_script( 'jquery-ui-autocomplete' );
112
+		wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/osm.geocode.js', array(), GEODIRECTORY_VERSION);
113
+		wp_enqueue_script('geodirectory-leaflet-geo-script');
114
+	}
115
+	wp_enqueue_script( 'jquery-ui-autocomplete' );
116 116
     
117
-    wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION,true);
118
-    wp_enqueue_script('geodirectory-goMap-script');
119
-
120
-
121
-    wp_register_script('chosen', geodir_plugin_url() . '/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
122
-    wp_enqueue_script('chosen');
123
-
124
-    wp_register_script('geodirectory-choose-ajax', geodir_plugin_url() . '/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION);
125
-    wp_enqueue_script('geodirectory-choose-ajax');
126
-
127
-    wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.ui.timepicker.min.js#asyncload', array('jquery-ui-datepicker', 'jquery-ui-slider', 'jquery-effects-core', 'jquery-effects-slide'), '', true);
128
-
129
-    if (is_page() && geodir_is_page('add-listing')) {
130
-        // SCRIPT FOR UPLOAD
131
-        wp_enqueue_script('plupload-all');
132
-        wp_enqueue_script('jquery-ui-sortable');
133
-
134
-        wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION,true);
135
-        wp_enqueue_script('geodirectory-plupload-script');
136
-        // SCRIPT FOR UPLOAD END
137
-
138
-        // check_ajax_referer function is used to make sure no files are uplaoded remotly but it will fail if used between https and non https so we do the check below of the urls
139
-        if (str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
140
-            $ajax_url = admin_url('admin-ajax.php');
141
-        } elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
142
-            $ajax_url = admin_url('admin-ajax.php');
143
-        } elseif (str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
144
-            $ajax_url = str_replace("https", "http", admin_url('admin-ajax.php'));
145
-        } elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
146
-            $ajax_url = str_replace("http", "https", admin_url('admin-ajax.php'));
147
-        } else {
148
-            $ajax_url = admin_url('admin-ajax.php');
149
-        }
117
+	wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION,true);
118
+	wp_enqueue_script('geodirectory-goMap-script');
119
+
120
+
121
+	wp_register_script('chosen', geodir_plugin_url() . '/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
122
+	wp_enqueue_script('chosen');
123
+
124
+	wp_register_script('geodirectory-choose-ajax', geodir_plugin_url() . '/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION);
125
+	wp_enqueue_script('geodirectory-choose-ajax');
126
+
127
+	wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.ui.timepicker.min.js#asyncload', array('jquery-ui-datepicker', 'jquery-ui-slider', 'jquery-effects-core', 'jquery-effects-slide'), '', true);
128
+
129
+	if (is_page() && geodir_is_page('add-listing')) {
130
+		// SCRIPT FOR UPLOAD
131
+		wp_enqueue_script('plupload-all');
132
+		wp_enqueue_script('jquery-ui-sortable');
133
+
134
+		wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION,true);
135
+		wp_enqueue_script('geodirectory-plupload-script');
136
+		// SCRIPT FOR UPLOAD END
137
+
138
+		// check_ajax_referer function is used to make sure no files are uplaoded remotly but it will fail if used between https and non https so we do the check below of the urls
139
+		if (str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
140
+			$ajax_url = admin_url('admin-ajax.php');
141
+		} elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
142
+			$ajax_url = admin_url('admin-ajax.php');
143
+		} elseif (str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
144
+			$ajax_url = str_replace("https", "http", admin_url('admin-ajax.php'));
145
+		} elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
146
+			$ajax_url = str_replace("http", "https", admin_url('admin-ajax.php'));
147
+		} else {
148
+			$ajax_url = admin_url('admin-ajax.php');
149
+		}
150 150
 
151
-        // place js config array for plupload
152
-        $plupload_init = array(
153
-            'runtimes' => 'html5,silverlight,flash,browserplus,gears,html4',
154
-            'browse_button' => 'plupload-browse-button', // will be adjusted per uploader
155
-            'container' => 'plupload-upload-ui', // will be adjusted per uploader
156
-            'drop_element' => 'dropbox', // will be adjusted per uploader
157
-            'file_data_name' => 'async-upload', // will be adjusted per uploader
158
-            'multiple_queues' => true,
159
-            'max_file_size' => geodir_max_upload_size(),
160
-            'url' => $ajax_url,
161
-            'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'),
162
-            'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'),
163
-            'filters' => array(array('title' => __('Allowed Files', 'geodirectory'), 'extensions' => '*')),
164
-            'multipart' => true,
165
-            'urlstream_upload' => true,
166
-            'multi_selection' => false, // will be added per uploader
167
-            // additional post data to send to our ajax hook
168
-            'multipart_params' => array(
169
-                '_ajax_nonce' => "", // will be added per uploader
170
-                'action' => 'plupload_action', // the ajax action name
171
-                'imgid' => 0 // will be added per uploader
172
-            )
173
-        );
174
-        $base_plupload_config = json_encode($plupload_init);
175
-
176
-        $gd_plupload_init = array('base_plupload_config' => $base_plupload_config,
177
-            'upload_img_size' => geodir_max_upload_size());
178
-
179
-        wp_localize_script('geodirectory-plupload-script', 'gd_plupload', $gd_plupload_init);
180
-
181
-        wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url() . '/geodirectory-assets/js/listing_validation.min.js#asyncload');
182
-    } // End if for add place page
183
-
184
-    wp_register_script('geodirectory-post-custom-js', geodir_plugin_url() . '/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
185
-    if ($is_detail_page) {
151
+		// place js config array for plupload
152
+		$plupload_init = array(
153
+			'runtimes' => 'html5,silverlight,flash,browserplus,gears,html4',
154
+			'browse_button' => 'plupload-browse-button', // will be adjusted per uploader
155
+			'container' => 'plupload-upload-ui', // will be adjusted per uploader
156
+			'drop_element' => 'dropbox', // will be adjusted per uploader
157
+			'file_data_name' => 'async-upload', // will be adjusted per uploader
158
+			'multiple_queues' => true,
159
+			'max_file_size' => geodir_max_upload_size(),
160
+			'url' => $ajax_url,
161
+			'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'),
162
+			'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'),
163
+			'filters' => array(array('title' => __('Allowed Files', 'geodirectory'), 'extensions' => '*')),
164
+			'multipart' => true,
165
+			'urlstream_upload' => true,
166
+			'multi_selection' => false, // will be added per uploader
167
+			// additional post data to send to our ajax hook
168
+			'multipart_params' => array(
169
+				'_ajax_nonce' => "", // will be added per uploader
170
+				'action' => 'plupload_action', // the ajax action name
171
+				'imgid' => 0 // will be added per uploader
172
+			)
173
+		);
174
+		$base_plupload_config = json_encode($plupload_init);
175
+
176
+		$gd_plupload_init = array('base_plupload_config' => $base_plupload_config,
177
+			'upload_img_size' => geodir_max_upload_size());
178
+
179
+		wp_localize_script('geodirectory-plupload-script', 'gd_plupload', $gd_plupload_init);
180
+
181
+		wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url() . '/geodirectory-assets/js/listing_validation.min.js#asyncload');
182
+	} // End if for add place page
183
+
184
+	wp_register_script('geodirectory-post-custom-js', geodir_plugin_url() . '/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
185
+	if ($is_detail_page) {
186 186
 		wp_enqueue_script('geodirectory-post-custom-js');
187 187
 	}
188 188
 
189
-    // font awesome rating script
189
+	// font awesome rating script
190 190
 	if (get_option('geodir_reviewrating_enable_font_awesome')) {
191 191
 		wp_register_script('geodir-barrating-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION, true);
192 192
 		wp_enqueue_script('geodir-barrating-js');
@@ -195,11 +195,11 @@  discard block
 block discarded – undo
195 195
 		wp_enqueue_script('geodir-jRating-js');
196 196
 	}
197 197
 
198
-    wp_register_script('geodir-on-document-load', geodir_plugin_url() . '/geodirectory-assets/js/on_document_load.js#asyncload', array(), GEODIRECTORY_VERSION, true);
199
-    wp_enqueue_script('geodir-on-document-load');
198
+	wp_register_script('geodir-on-document-load', geodir_plugin_url() . '/geodirectory-assets/js/on_document_load.js#asyncload', array(), GEODIRECTORY_VERSION, true);
199
+	wp_enqueue_script('geodir-on-document-load');
200 200
 
201
-    wp_register_script('google-geometa', geodir_plugin_url() . '/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
202
-    wp_enqueue_script('google-geometa');
201
+	wp_register_script('google-geometa', geodir_plugin_url() . '/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
202
+	wp_enqueue_script('google-geometa');
203 203
 }
204 204
 
205 205
 /**
@@ -213,8 +213,8 @@  discard block
 block discarded – undo
213 213
  */
214 214
 function geodir_header_scripts()
215 215
 {
216
-    echo '<style>' . stripslashes(get_option('geodir_coustem_css')) . '</style>';
217
-    echo stripslashes(get_option('geodir_header_scripts'));
216
+	echo '<style>' . stripslashes(get_option('geodir_coustem_css')) . '</style>';
217
+	echo stripslashes(get_option('geodir_header_scripts'));
218 218
 }
219 219
 
220 220
 
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
 function geodir_footer_scripts()
231 231
 {	
232 232
 	echo stripslashes(get_option('geodir_ga_tracking_code'));
233
-    echo stripslashes(get_option('geodir_footer_scripts'));
233
+	echo stripslashes(get_option('geodir_footer_scripts'));
234 234
 }
235 235
 
236 236
 
@@ -244,12 +244,12 @@  discard block
 block discarded – undo
244 244
  */
245 245
 function geodir_add_async_forscript($url)
246 246
 {
247
-    if (strpos($url, '#asyncload')===false)
248
-        return $url;
249
-    else if (is_admin())
250
-        return str_replace('#asyncload', '', $url);
251
-    else
252
-        return str_replace('#asyncload', '', $url)."' async='async";
247
+	if (strpos($url, '#asyncload')===false)
248
+		return $url;
249
+	else if (is_admin())
250
+		return str_replace('#asyncload', '', $url);
251
+	else
252
+		return str_replace('#asyncload', '', $url)."' async='async";
253 253
 }
254 254
 add_filter('clean_url', 'geodir_add_async_forscript', 11, 1);
255 255
 
@@ -263,55 +263,55 @@  discard block
 block discarded – undo
263 263
 {
264 264
 
265 265
 
266
-    if(get_option('geodir_scss_core')) {
266
+	if(get_option('geodir_scss_core')) {
267 267
 
268 268
 
269
-        wp_register_style('geodirectory-frontend-style', geodir_plugin_url() . '/geodirectory-assets/css/style.css', array(), GEODIRECTORY_VERSION);
270
-        wp_enqueue_style('geodirectory-frontend-style');
269
+		wp_register_style('geodirectory-frontend-style', geodir_plugin_url() . '/geodirectory-assets/css/style.css', array(), GEODIRECTORY_VERSION);
270
+		wp_enqueue_style('geodirectory-frontend-style');
271 271
 
272
-        wp_register_style('geodirectory-media-style', geodir_plugin_url() . '/geodirectory-assets/css/media.css', array(), GEODIRECTORY_VERSION);
273
-        wp_enqueue_style('geodirectory-media-style');
272
+		wp_register_style('geodirectory-media-style', geodir_plugin_url() . '/geodirectory-assets/css/media.css', array(), GEODIRECTORY_VERSION);
273
+		wp_enqueue_style('geodirectory-media-style');
274 274
 
275 275
 
276
-        wp_register_style('geodirectory-jquery-ui-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery-ui.css', array(), GEODIRECTORY_VERSION);
277
-        wp_enqueue_style('geodirectory-jquery-ui-css');
276
+		wp_register_style('geodirectory-jquery-ui-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery-ui.css', array(), GEODIRECTORY_VERSION);
277
+		wp_enqueue_style('geodirectory-jquery-ui-css');
278 278
 
279
-        wp_register_style('geodirectory-jquery-ui-timepicker-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery.ui.timepicker.css', array(), GEODIRECTORY_VERSION);
280
-        wp_enqueue_style('geodirectory-jquery-ui-timepicker-css');
279
+		wp_register_style('geodirectory-jquery-ui-timepicker-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery.ui.timepicker.css', array(), GEODIRECTORY_VERSION);
280
+		wp_enqueue_style('geodirectory-jquery-ui-timepicker-css');
281 281
 
282
-        wp_register_style('geodirectory-flexslider-css', geodir_plugin_url() . '/geodirectory-assets/css/flexslider.css', array(), GEODIRECTORY_VERSION);
283
-        wp_enqueue_style('geodirectory-flexslider-css');
282
+		wp_register_style('geodirectory-flexslider-css', geodir_plugin_url() . '/geodirectory-assets/css/flexslider.css', array(), GEODIRECTORY_VERSION);
283
+		wp_enqueue_style('geodirectory-flexslider-css');
284 284
 
285
-        wp_register_style('geodirectory-thic-box-css', geodir_plugin_url() . '/geodirectory-assets/css/thic-box.css', array(), GEODIRECTORY_VERSION);
286
-        wp_enqueue_style('geodirectory-thic-box-css');
285
+		wp_register_style('geodirectory-thic-box-css', geodir_plugin_url() . '/geodirectory-assets/css/thic-box.css', array(), GEODIRECTORY_VERSION);
286
+		wp_enqueue_style('geodirectory-thic-box-css');
287 287
 
288
-        wp_register_style('geodirectory-pluplodar-css', geodir_plugin_url() . '/geodirectory-assets/css/pluploader.css', array(), GEODIRECTORY_VERSION);
289
-        wp_enqueue_style('geodirectory-pluplodar-css');
288
+		wp_register_style('geodirectory-pluplodar-css', geodir_plugin_url() . '/geodirectory-assets/css/pluploader.css', array(), GEODIRECTORY_VERSION);
289
+		wp_enqueue_style('geodirectory-pluplodar-css');
290 290
 
291
-        wp_register_style('geodirectory-lightbox-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery.lightbox-0.5.css', array(), GEODIRECTORY_VERSION);
292
-        wp_enqueue_style('geodirectory-lightbox-css');
291
+		wp_register_style('geodirectory-lightbox-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery.lightbox-0.5.css', array(), GEODIRECTORY_VERSION);
292
+		wp_enqueue_style('geodirectory-lightbox-css');
293 293
 
294
-        wp_register_style('geodir-rating-style', geodir_plugin_url() . '/geodirectory-assets/css/jRating.jquery.css', array(), GEODIRECTORY_VERSION);
295
-        wp_enqueue_style('geodir-rating-style');
294
+		wp_register_style('geodir-rating-style', geodir_plugin_url() . '/geodirectory-assets/css/jRating.jquery.css', array(), GEODIRECTORY_VERSION);
295
+		wp_enqueue_style('geodir-rating-style');
296 296
 
297
-        wp_register_style('geodir-chosen-style', geodir_plugin_url() . '/geodirectory-assets/css/chosen.css', array(), GEODIRECTORY_VERSION);
298
-        wp_enqueue_style('geodir-chosen-style');
297
+		wp_register_style('geodir-chosen-style', geodir_plugin_url() . '/geodirectory-assets/css/chosen.css', array(), GEODIRECTORY_VERSION);
298
+		wp_enqueue_style('geodir-chosen-style');
299 299
 
300
-    }else{
301
-        wp_register_style('geodir-core-scss', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
302
-        wp_enqueue_style('geodir-core-scss');
300
+	}else{
301
+		wp_register_style('geodir-core-scss', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
302
+		wp_enqueue_style('geodir-core-scss');
303 303
 
304
-        wp_register_style('geodir-core-scss-footer', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION);
304
+		wp_register_style('geodir-core-scss-footer', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION);
305 305
 
306
-    }
306
+	}
307 307
 
308
-    if(is_rtl()){
309
-    wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url() . '/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION);
310
-    wp_enqueue_style('geodirectory-frontend-rtl-style');
311
-    }
308
+	if(is_rtl()){
309
+	wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url() . '/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION);
310
+	wp_enqueue_style('geodirectory-frontend-rtl-style');
311
+	}
312 312
 
313
-    wp_register_style('geodirectory-font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css', array(), GEODIRECTORY_VERSION);
314
-    wp_enqueue_style('geodirectory-font-awesome');
313
+	wp_register_style('geodirectory-font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css', array(), GEODIRECTORY_VERSION);
314
+	wp_enqueue_style('geodirectory-font-awesome');
315 315
 
316 316
 
317 317
 }
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
  */
326 326
 function geodir_get_sidebar()
327 327
 {
328
-    get_sidebar('geodirectory');
328
+	get_sidebar('geodirectory');
329 329
 }
330 330
 
331 331
 /**
@@ -344,122 +344,122 @@  discard block
 block discarded – undo
344 344
  * @param bool $always_show Do you want to show the pagination always? Default: false.
345 345
  */
346 346
 function geodir_pagination($before = '', $after = '', $prelabel = '', $nxtlabel = '', $pages_to_show = 5, $always_show = false) {
347
-    global $wp_query, $posts_per_page, $wpdb, $paged, $blog_id;
347
+	global $wp_query, $posts_per_page, $wpdb, $paged, $blog_id;
348 348
 
349
-    if (empty($prelabel)) {
350
-        $prelabel = '<strong>&laquo;</strong>';
351
-    }
349
+	if (empty($prelabel)) {
350
+		$prelabel = '<strong>&laquo;</strong>';
351
+	}
352 352
 
353
-    if (empty($nxtlabel)) {
354
-        $nxtlabel = '<strong>&raquo;</strong>';
355
-    }
353
+	if (empty($nxtlabel)) {
354
+		$nxtlabel = '<strong>&raquo;</strong>';
355
+	}
356 356
 
357
-    $half_pages_to_show = round($pages_to_show / 2);
357
+	$half_pages_to_show = round($pages_to_show / 2);
358 358
 
359
-    if (geodir_is_page('home') || (get_option('geodir_set_as_home') && is_home())) // dont apply default  pagination for geodirectory home page.
360
-        return;
359
+	if (geodir_is_page('home') || (get_option('geodir_set_as_home') && is_home())) // dont apply default  pagination for geodirectory home page.
360
+		return;
361 361
 
362
-    if (!is_single()) {
363
-        if (function_exists('geodir_location_geo_home_link')) {
364
-            remove_filter('home_url', 'geodir_location_geo_home_link', 100000);
365
-        }
366
-        $numposts = $wp_query->found_posts;
362
+	if (!is_single()) {
363
+		if (function_exists('geodir_location_geo_home_link')) {
364
+			remove_filter('home_url', 'geodir_location_geo_home_link', 100000);
365
+		}
366
+		$numposts = $wp_query->found_posts;
367 367
 
368
-        $max_page = ceil($numposts / $posts_per_page);
368
+		$max_page = ceil($numposts / $posts_per_page);
369 369
 
370
-        if (empty($paged)) {
371
-            $paged = 1;
372
-        }
370
+		if (empty($paged)) {
371
+			$paged = 1;
372
+		}
373 373
         
374
-        $post_type = geodir_get_current_posttype();
375
-        $listing_type_name = get_post_type_plural_label($post_type);
376
-        if (geodir_is_page('listing') || geodir_is_page('search')) {            
377
-            $term = array();
374
+		$post_type = geodir_get_current_posttype();
375
+		$listing_type_name = get_post_type_plural_label($post_type);
376
+		if (geodir_is_page('listing') || geodir_is_page('search')) {            
377
+			$term = array();
378 378
             
379
-            if (is_tax()) {
380
-                $term_id = get_queried_object_id();
381
-                $taxonomy = get_query_var('taxonomy');
379
+			if (is_tax()) {
380
+				$term_id = get_queried_object_id();
381
+				$taxonomy = get_query_var('taxonomy');
382 382
 
383
-                if ($term_id && $post_type && get_query_var('taxonomy') == $post_type . 'category' ) {
384
-                    $term = get_term($term_id, $post_type . 'category');
385
-                }
386
-            }
383
+				if ($term_id && $post_type && get_query_var('taxonomy') == $post_type . 'category' ) {
384
+					$term = get_term($term_id, $post_type . 'category');
385
+				}
386
+			}
387 387
             
388
-            if (geodir_is_page('search') && !empty($_REQUEST['s' . $post_type . 'category'])) {
389
-                $taxonomy_search = $_REQUEST['s' . $post_type . 'category'];
388
+			if (geodir_is_page('search') && !empty($_REQUEST['s' . $post_type . 'category'])) {
389
+				$taxonomy_search = $_REQUEST['s' . $post_type . 'category'];
390 390
                 
391
-                if (!is_array($taxonomy_search)) {
392
-                    $term = get_term((int)$taxonomy_search, $post_type . 'category');
393
-                } else if(is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search
394
-                    $term = get_term((int)$taxonomy_search[0], $post_type . 'category');
395
-                }
396
-            }
391
+				if (!is_array($taxonomy_search)) {
392
+					$term = get_term((int)$taxonomy_search, $post_type . 'category');
393
+				} else if(is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search
394
+					$term = get_term((int)$taxonomy_search[0], $post_type . 'category');
395
+				}
396
+			}
397 397
             
398
-            if (!empty($term) && !is_wp_error($term)) {
399
-                $listing_type_name = $term->name;
400
-            }
401
-        }
398
+			if (!empty($term) && !is_wp_error($term)) {
399
+				$listing_type_name = $term->name;
400
+			}
401
+		}
402 402
 
403
-        if ($max_page > 1 || $always_show) {            
404
-            // Extra pagination info
405
-            $geodir_pagination_more_info = get_option('geodir_pagination_advance_info');
406
-            $start_no = ( $paged - 1 ) * $posts_per_page + 1;
407
-            $end_no = min($paged * $posts_per_page, $numposts);
403
+		if ($max_page > 1 || $always_show) {            
404
+			// Extra pagination info
405
+			$geodir_pagination_more_info = get_option('geodir_pagination_advance_info');
406
+			$start_no = ( $paged - 1 ) * $posts_per_page + 1;
407
+			$end_no = min($paged * $posts_per_page, $numposts);
408 408
 
409
-            if ($geodir_pagination_more_info != '') {
410
-                if ($listing_type_name) {
411
-                    $listing_type_name = __($listing_type_name, 'geodirectory');
412
-                    $pegination_desc = wp_sprintf(__('Showing %s %d-%d of %d', 'geodirectory'), $listing_type_name, $start_no, $end_no, $numposts);
413
-                } else {
414
-                    $pegination_desc = wp_sprintf(__('Showing listings %d-%d of %d', 'geodirectory'), $start_no, $end_no, $numposts);
415
-                }
416
-                $pagination_info = '<div class="gd-pagination-details">' . $pegination_desc . '</div>';
417
-                /**
418
-                 * Adds an extra pagination info above/under pagination.
419
-                 *
420
-                 * @since 1.5.9
421
-                 *
422
-                 * @param string $pagination_info Extra pagination info content.
423
-                 * @param string $listing_type_name Listing results type.
424
-                 * @param string $start_no First result number.
425
-                 * @param string $end_no Last result number.
426
-                 * @param string $numposts Total number of listings.
427
-                 * @param string $post_type The post type.
428
-                 */
429
-                $pagination_info = apply_filters('geodir_pagination_advance_info', $pagination_info, $listing_type_name, $start_no, $end_no, $numposts, $post_type);
409
+			if ($geodir_pagination_more_info != '') {
410
+				if ($listing_type_name) {
411
+					$listing_type_name = __($listing_type_name, 'geodirectory');
412
+					$pegination_desc = wp_sprintf(__('Showing %s %d-%d of %d', 'geodirectory'), $listing_type_name, $start_no, $end_no, $numposts);
413
+				} else {
414
+					$pegination_desc = wp_sprintf(__('Showing listings %d-%d of %d', 'geodirectory'), $start_no, $end_no, $numposts);
415
+				}
416
+				$pagination_info = '<div class="gd-pagination-details">' . $pegination_desc . '</div>';
417
+				/**
418
+				 * Adds an extra pagination info above/under pagination.
419
+				 *
420
+				 * @since 1.5.9
421
+				 *
422
+				 * @param string $pagination_info Extra pagination info content.
423
+				 * @param string $listing_type_name Listing results type.
424
+				 * @param string $start_no First result number.
425
+				 * @param string $end_no Last result number.
426
+				 * @param string $numposts Total number of listings.
427
+				 * @param string $post_type The post type.
428
+				 */
429
+				$pagination_info = apply_filters('geodir_pagination_advance_info', $pagination_info, $listing_type_name, $start_no, $end_no, $numposts, $post_type);
430 430
                 
431
-                if ($geodir_pagination_more_info == 'before') {
432
-                    $before = $before . $pagination_info;
433
-                } else if ($geodir_pagination_more_info == 'after') {
434
-                    $after = $pagination_info . $after;
435
-                }
436
-            }
431
+				if ($geodir_pagination_more_info == 'before') {
432
+					$before = $before . $pagination_info;
433
+				} else if ($geodir_pagination_more_info == 'after') {
434
+					$after = $pagination_info . $after;
435
+				}
436
+			}
437 437
             
438
-            echo "$before <div class='Navi gd-navi'>";
439
-            if ($paged >= ($pages_to_show - 1)) {
440
-                echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link()) . '">&laquo;</a>';
441
-            }
442
-            previous_posts_link($prelabel);
443
-            for ($i = $paged - $half_pages_to_show; $i <= $paged + $half_pages_to_show; $i++) {
444
-                if ($i >= 1 && $i <= $max_page) {
445
-                    if ($i == $paged) {
446
-                        echo "<strong class='on'>$i</strong>";
447
-                    } else {
448
-                        echo ' <a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($i)) . '">' . $i . '</a> ';
449
-                    }
450
-                }
451
-            }
452
-            next_posts_link($nxtlabel, $max_page);
453
-            if (($paged + $half_pages_to_show) < ($max_page)) {
454
-                echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($max_page)) . '">&raquo;</a>';
455
-            }
456
-            echo "</div> $after";
457
-        }
438
+			echo "$before <div class='Navi gd-navi'>";
439
+			if ($paged >= ($pages_to_show - 1)) {
440
+				echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link()) . '">&laquo;</a>';
441
+			}
442
+			previous_posts_link($prelabel);
443
+			for ($i = $paged - $half_pages_to_show; $i <= $paged + $half_pages_to_show; $i++) {
444
+				if ($i >= 1 && $i <= $max_page) {
445
+					if ($i == $paged) {
446
+						echo "<strong class='on'>$i</strong>";
447
+					} else {
448
+						echo ' <a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($i)) . '">' . $i . '</a> ';
449
+					}
450
+				}
451
+			}
452
+			next_posts_link($nxtlabel, $max_page);
453
+			if (($paged + $half_pages_to_show) < ($max_page)) {
454
+				echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($max_page)) . '">&raquo;</a>';
455
+			}
456
+			echo "</div> $after";
457
+		}
458 458
         
459
-        if (function_exists('geodir_location_geo_home_link')) {
460
-            add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2);
461
-        }
462
-    }
459
+		if (function_exists('geodir_location_geo_home_link')) {
460
+			add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2);
461
+		}
462
+	}
463 463
 }
464 464
 
465 465
 /**
@@ -470,20 +470,20 @@  discard block
 block discarded – undo
470 470
  */
471 471
 function geodir_listingsearch_scripts()
472 472
 {
473
-    if (get_option('gd_search_dist') != '') {
474
-        $dist = get_option('gd_search_dist');
475
-    } else {
476
-        $dist = 500;
477
-    }
478
-    $dist_dif = 1000;
479
-
480
-    if ($dist <= 5000) $dist_dif = 500;
481
-    if ($dist <= 1000) $dist_dif = 100;
482
-    if ($dist <= 500) $dist_dif = 50;
483
-    if ($dist <= 100) $dist_dif = 10;
484
-    if ($dist <= 50) $dist_dif = 5;
485
-
486
-    ?>
473
+	if (get_option('gd_search_dist') != '') {
474
+		$dist = get_option('gd_search_dist');
475
+	} else {
476
+		$dist = 500;
477
+	}
478
+	$dist_dif = 1000;
479
+
480
+	if ($dist <= 5000) $dist_dif = 500;
481
+	if ($dist <= 1000) $dist_dif = 100;
482
+	if ($dist <= 500) $dist_dif = 50;
483
+	if ($dist <= 100) $dist_dif = 10;
484
+	if ($dist <= 50) $dist_dif = 5;
485
+
486
+	?>
487 487
     <script type="text/javascript">
488 488
 
489 489
         jQuery(function ($) {
@@ -542,15 +542,15 @@  discard block
 block discarded – undo
542 542
 function geodir_add_sharelocation_scripts()
543 543
 {
544 544
 
545
-    $default_search_for_text = SEARCH_FOR_TEXT;
546
-    if (get_option('geodir_search_field_default_text'))
547
-        $default_search_for_text = __(get_option('geodir_search_field_default_text'), 'geodirectory');
545
+	$default_search_for_text = SEARCH_FOR_TEXT;
546
+	if (get_option('geodir_search_field_default_text'))
547
+		$default_search_for_text = __(get_option('geodir_search_field_default_text'), 'geodirectory');
548 548
 
549
-    $default_near_text = NEAR_TEXT;
550
-    if (get_option('geodir_near_field_default_text'))
551
-        $default_near_text = __(get_option('geodir_near_field_default_text'), 'geodirectory');
549
+	$default_near_text = NEAR_TEXT;
550
+	if (get_option('geodir_near_field_default_text'))
551
+		$default_near_text = __(get_option('geodir_near_field_default_text'), 'geodirectory');
552 552
 
553
-    ?>
553
+	?>
554 554
 
555 555
 
556 556
     <script type="text/javascript">
@@ -631,14 +631,14 @@  discard block
 block discarded – undo
631 631
                     initialise2();
632 632
                 } else {
633 633
                     <?php
634
-                    $near_add = get_option('geodir_search_near_addition');
635
-                    /**
636
-                     * Adds any extra info to the near search box query when trying to geolocate it via google api.
637
-                     *
638
-                     * @since 1.0.0
639
-                     */
640
-                    $near_add2 = apply_filters('geodir_search_near_addition', '');
641
-                    ?>
634
+					$near_add = get_option('geodir_search_near_addition');
635
+					/**
636
+					 * Adds any extra info to the near search box query when trying to geolocate it via google api.
637
+					 *
638
+					 * @since 1.0.0
639
+					 */
640
+					$near_add2 = apply_filters('geodir_search_near_addition', '');
641
+					?>
642 642
                     if (window.gdMaps === 'google') {
643 643
                         Sgeocoder.geocode({'address': address<?php echo ($near_add ? '+", ' . $near_add . '"' : '') . $near_add2;?>},
644 644
                             function (results, status) {
@@ -741,30 +741,30 @@  discard block
 block discarded – undo
741 741
  */
742 742
 function geodir_show_badges_on_image($which, $post, $link)
743 743
 {
744
-    $return = '';
745
-    switch ($which) {
746
-        case 'featured':
747
-            /**
748
-             * Filter the featured image badge html that appears in the listings pages over the thumbnail.
749
-             *
750
-             * @since 1.0.0
751
-             * @param object $post The post object.
752
-             * @param string $link The link to the post.
753
-             */
754
-            $return = apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img">&nbsp;</span></a>',$post,$link);
755
-            break;
756
-        case 'new' :
757
-            /**
758
-             * Filter the new image badge html that appears in the listings pages over the thumbnail.
759
-             *
760
-             * @since 1.0.0
761
-             * @param object $post The post object.
762
-             * @param string $link The link to the post.
763
-             */
764
-            $return = apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing">&nbsp;</span></a>',$post,$link);
765
-            break;
766
-
767
-    }
744
+	$return = '';
745
+	switch ($which) {
746
+		case 'featured':
747
+			/**
748
+			 * Filter the featured image badge html that appears in the listings pages over the thumbnail.
749
+			 *
750
+			 * @since 1.0.0
751
+			 * @param object $post The post object.
752
+			 * @param string $link The link to the post.
753
+			 */
754
+			$return = apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img">&nbsp;</span></a>',$post,$link);
755
+			break;
756
+		case 'new' :
757
+			/**
758
+			 * Filter the new image badge html that appears in the listings pages over the thumbnail.
759
+			 *
760
+			 * @since 1.0.0
761
+			 * @param object $post The post object.
762
+			 * @param string $link The link to the post.
763
+			 */
764
+			$return = apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing">&nbsp;</span></a>',$post,$link);
765
+			break;
766
+
767
+	}
768 768
     
769
-    return $return;
769
+	return $return;
770 770
 }
Please login to merge, or discard this patch.