Test Failed
Pull Request — master (#274)
by Viruthagiri
10:39
created
upgrade.php 3 patches
Spacing   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 
10 10
 global $wpdb;
11 11
 
12
-if (get_option('geodirectory' . '_db_version') != GEODIRECTORY_VERSION) {
12
+if (get_option('geodirectory'.'_db_version') != GEODIRECTORY_VERSION) {
13 13
     /**
14 14
      * Include custom database table related functions.
15 15
      *
@@ -51,9 +51,9 @@  discard block
 block discarded – undo
51 51
     }
52 52
 
53 53
 
54
-    add_action('init', 'gd_fix_cpt_rewrite_slug', 11);// this needs to be kept for a few versions
54
+    add_action('init', 'gd_fix_cpt_rewrite_slug', 11); // this needs to be kept for a few versions
55 55
 
56
-    update_option('geodirectory' . '_db_version', GEODIRECTORY_VERSION);
56
+    update_option('geodirectory'.'_db_version', GEODIRECTORY_VERSION);
57 57
 
58 58
 }
59 59
 
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
  * @since 1.0.0
89 89
  * @package GeoDirectory
90 90
  */
91
-function geodir_upgrade_146(){
91
+function geodir_upgrade_146() {
92 92
     gd_convert_virtual_pages();
93 93
 }
94 94
 
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
  * @since 1.5.0
99 99
  * @package GeoDirectory
100 100
  */
101
-function geodir_upgrade_150(){
101
+function geodir_upgrade_150() {
102 102
     gd_fix_cpt_rewrite_slug();
103 103
 }
104 104
 
@@ -110,12 +110,12 @@  discard block
 block discarded – undo
110 110
  * @since 1.4.8
111 111
  * @package GeoDirectory
112 112
  */
113
-function geodir_upgrade_148(){
113
+function geodir_upgrade_148() {
114 114
     /*
115 115
      * Blank the users google password if present as we now use oAuth 2.0
116 116
      */
117
-    update_option('geodir_ga_pass','');
118
-    update_option('geodir_ga_user','');
117
+    update_option('geodir_ga_pass', '');
118
+    update_option('geodir_ga_user', '');
119 119
 
120 120
 }
121 121
 
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
  * @since 1.5.3
127 127
  * @package GeoDirectory
128 128
  */
129
-function geodir_upgrade_153(){
129
+function geodir_upgrade_153() {
130 130
     geodir_create_page(esc_sql(_x('gd-info', 'page_slug', 'geodirectory')), 'geodir_info_page', __('Info', 'geodirectory'), '');
131 131
     geodir_create_page(esc_sql(_x('gd-login', 'page_slug', 'geodirectory')), 'geodir_login_page', __('Login', 'geodirectory'), '');
132 132
 }
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
  * @since 1.5.3
138 138
  * @package GeoDirectory
139 139
  */
140
-function geodir_upgrade_154(){
140
+function geodir_upgrade_154() {
141 141
     geodir_create_page(esc_sql(_x('gd-home', 'page_slug', 'geodirectory')), 'geodir_home_page', __('GD Home page', 'geodirectory'), '');
142 142
 }
143 143
 
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
  * @since 1.5.2
148 148
  * @package GeoDirectory
149 149
  */
150
-function geodir_upgrade_152(){
150
+function geodir_upgrade_152() {
151 151
     gd_fix_address_detail_table_limit();
152 152
 }
153 153
 
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
  * @since 1.6.6
158 158
  * @package GeoDirectory
159 159
  */
160
-function geodir_upgrade_166(){
160
+function geodir_upgrade_166() {
161 161
     gd_convert_custom_field_display();
162 162
 }
163 163
 
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
 function geodir_fix_review_date()
192 192
 {
193 193
     global $wpdb;
194
-    $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.post_date = c.comment_date WHERE gdr.post_date='0000-00-00 00:00:00'");
194
+    $wpdb->query("UPDATE ".GEODIR_REVIEW_TABLE." gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.post_date = c.comment_date WHERE gdr.post_date='0000-00-00 00:00:00'");
195 195
 }
196 196
 
197 197
 /**
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 function geodir_fix_review_post_status()
205 205
 {
206 206
     global $wpdb;
207
-    $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->posts p ON gdr.post_id=p.ID SET gdr.post_status = 1 WHERE gdr.post_status IS NULL AND p.post_status='publish'");
207
+    $wpdb->query("UPDATE ".GEODIR_REVIEW_TABLE." gdr JOIN $wpdb->posts p ON gdr.post_id=p.ID SET gdr.post_status = 1 WHERE gdr.post_status IS NULL AND p.post_status='publish'");
208 208
 }
209 209
 
210 210
 /**
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
 function geodir_fix_review_content()
219 219
 {
220 220
     global $wpdb;
221
-    if ($wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.comment_content = c.comment_content WHERE gdr.comment_content IS NULL")) {
221
+    if ($wpdb->query("UPDATE ".GEODIR_REVIEW_TABLE." gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.comment_content = c.comment_content WHERE gdr.comment_content IS NULL")) {
222 222
         return true;
223 223
     } else {
224 224
         return false;
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
         foreach ($all_postypes as $key) {
244 244
             // update each GD CTP
245 245
 
246
-            $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN " . $wpdb->prefix . "geodir_" . $key . "_detail d ON gdr.post_id=d.post_id SET gdr.post_latitude = d.post_latitude, gdr.post_longitude = d.post_longitude, gdr.post_city = d.post_city,  gdr.post_region=d.post_region, gdr.post_country=d.post_country WHERE gdr.post_latitude IS NULL OR gdr.post_city IS NULL");
246
+            $wpdb->query("UPDATE ".GEODIR_REVIEW_TABLE." gdr JOIN ".$wpdb->prefix."geodir_".$key."_detail d ON gdr.post_id=d.post_id SET gdr.post_latitude = d.post_latitude, gdr.post_longitude = d.post_longitude, gdr.post_city = d.post_city,  gdr.post_region=d.post_region, gdr.post_country=d.post_country WHERE gdr.post_latitude IS NULL OR gdr.post_city IS NULL");
247 247
 
248 248
         }
249 249
         return true;
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
     if (!empty($all_postypes)) {
268 268
         foreach ($all_postypes as $key) {
269 269
             // update each GD CTP
270
-            $reviews = $wpdb->get_results("SELECT post_id FROM " . $wpdb->prefix . "geodir_" . $key . "_detail d");
270
+            $reviews = $wpdb->get_results("SELECT post_id FROM ".$wpdb->prefix."geodir_".$key."_detail d");
271 271
 
272 272
             if (!empty($reviews)) {
273 273
                 foreach ($reviews as $post_id) {
@@ -282,49 +282,49 @@  discard block
 block discarded – undo
282 282
 }
283 283
 
284 284
 
285
-function gd_convert_custom_field_display(){
285
+function gd_convert_custom_field_display() {
286 286
     global $wpdb;
287 287
 
288
-    $field_info = $wpdb->get_results("select * from " . GEODIR_CUSTOM_FIELDS_TABLE);
288
+    $field_info = $wpdb->get_results("select * from ".GEODIR_CUSTOM_FIELDS_TABLE);
289 289
 
290 290
     $has_run = get_option('gd_convert_custom_field_display');
291
-    if($has_run){return;}
291
+    if ($has_run) {return; }
292 292
 
293 293
 
294 294
 
295
-    if(is_array( $field_info)){
295
+    if (is_array($field_info)) {
296 296
 
297
-        foreach( $field_info as $cf){
297
+        foreach ($field_info as $cf) {
298 298
 
299 299
             $id = $cf->id;
300 300
 
301
-            if(!property_exists($cf,'show_in') || !$id){return;}
301
+            if (!property_exists($cf, 'show_in') || !$id) {return; }
302 302
 
303 303
             $show_in_arr = array();
304 304
 
305
-            if($cf->is_default){
305
+            if ($cf->is_default) {
306 306
                 $show_in_arr[] = "[detail]";
307 307
             }
308 308
 
309
-            if($cf->show_on_detail){
309
+            if ($cf->show_on_detail) {
310 310
                 $show_in_arr[] = "[moreinfo]";
311 311
             }
312 312
 
313
-            if($cf->show_on_listing){
313
+            if ($cf->show_on_listing) {
314 314
                 $show_in_arr[] = "[listing]";
315 315
             }
316 316
 
317
-            if($cf->show_as_tab || $cf->htmlvar_name=='geodir_video' || $cf->htmlvar_name=='geodir_special_offers'){
317
+            if ($cf->show_as_tab || $cf->htmlvar_name == 'geodir_video' || $cf->htmlvar_name == 'geodir_special_offers') {
318 318
                 $show_in_arr[] = "[owntab]";
319 319
             }
320 320
 
321
-            if($cf->htmlvar_name=='post' || $cf->htmlvar_name=='geodir_contact' || $cf->htmlvar_name=='geodir_timing'){
321
+            if ($cf->htmlvar_name == 'post' || $cf->htmlvar_name == 'geodir_contact' || $cf->htmlvar_name == 'geodir_timing') {
322 322
                 $show_in_arr[] = "[mapbubble]";
323 323
             }
324 324
 
325
-            if(!empty($show_in_arr )){
326
-                $show_in_arr = implode(',',$show_in_arr);
327
-            }else{
325
+            if (!empty($show_in_arr)) {
326
+                $show_in_arr = implode(',', $show_in_arr);
327
+            } else {
328 328
                 $show_in_arr = '';
329 329
             }
330 330
 
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
 
333 333
         }
334 334
 
335
-        update_option('gd_convert_custom_field_display',1);
335
+        update_option('gd_convert_custom_field_display', 1);
336 336
     }
337 337
 }
338 338
 
@@ -709,7 +709,7 @@  discard block
 block discarded – undo
709 709
 
710 710
     update_option('gd_theme_compats', $theme_compat);
711 711
 
712
-    gd_set_theme_compat();// set the compat pack if avail
712
+    gd_set_theme_compat(); // set the compat pack if avail
713 713
 }
714 714
 
715 715
 
@@ -720,61 +720,61 @@  discard block
 block discarded – undo
720 720
  * @package GeoDirectory
721 721
  * @global object $wpdb WordPress Database object.
722 722
  */
723
-function gd_convert_virtual_pages(){
723
+function gd_convert_virtual_pages() {
724 724
     global $wpdb;
725 725
 
726 726
     // Update the add listing page settings
727 727
     $add_listing_page = $wpdb->get_var(
728 728
         $wpdb->prepare(
729
-            "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
729
+            "SELECT ID FROM ".$wpdb->posts." WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
730 730
             array('add-listing')
731 731
         )
732 732
     );
733 733
 
734
-    if($add_listing_page){
735
-        wp_update_post( array('ID' => $add_listing_page, 'post_status' => 'publish') );
736
-        update_option( 'geodir_add_listing_page', $add_listing_page);
734
+    if ($add_listing_page) {
735
+        wp_update_post(array('ID' => $add_listing_page, 'post_status' => 'publish'));
736
+        update_option('geodir_add_listing_page', $add_listing_page);
737 737
     }
738 738
 
739 739
     // Update the listing preview page settings
740 740
     $listing_preview_page = $wpdb->get_var(
741 741
         $wpdb->prepare(
742
-            "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
742
+            "SELECT ID FROM ".$wpdb->posts." WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
743 743
             array('listing-preview')
744 744
         )
745 745
     );
746 746
 
747
-    if($listing_preview_page){
748
-        wp_update_post( array('ID' => $listing_preview_page, 'post_status' => 'publish') );
749
-        update_option( 'geodir_preview_page', $listing_preview_page);
747
+    if ($listing_preview_page) {
748
+        wp_update_post(array('ID' => $listing_preview_page, 'post_status' => 'publish'));
749
+        update_option('geodir_preview_page', $listing_preview_page);
750 750
     }
751 751
 
752 752
     // Update the listing success page settings
753 753
     $listing_success_page = $wpdb->get_var(
754 754
         $wpdb->prepare(
755
-            "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
755
+            "SELECT ID FROM ".$wpdb->posts." WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
756 756
             array('listing-success')
757 757
         )
758 758
     );
759 759
 
760
-    if($listing_success_page){
761
-        wp_update_post( array('ID' => $listing_success_page, 'post_status' => 'publish') );
762
-        update_option( 'geodir_success_page', $listing_success_page);
760
+    if ($listing_success_page) {
761
+        wp_update_post(array('ID' => $listing_success_page, 'post_status' => 'publish'));
762
+        update_option('geodir_success_page', $listing_success_page);
763 763
     }
764 764
 
765 765
     // Update the listing success page settings
766 766
     $location_page = $wpdb->get_var(
767 767
         $wpdb->prepare(
768
-            "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
768
+            "SELECT ID FROM ".$wpdb->posts." WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
769 769
             array('location')
770 770
         )
771 771
     );
772 772
 
773
-    if($location_page){
773
+    if ($location_page) {
774 774
         $location_slug = get_option('geodir_location_prefix');
775
-        if(!$location_slug ){$location_slug  = 'location';}
776
-        wp_update_post( array('ID' => $location_page, 'post_status' => 'publish','post_name' => $location_slug) );
777
-        update_option( 'geodir_location_page', $location_page);
775
+        if (!$location_slug) {$location_slug = 'location'; }
776
+        wp_update_post(array('ID' => $location_page, 'post_status' => 'publish', 'post_name' => $location_slug));
777
+        update_option('geodir_location_page', $location_page);
778 778
     }
779 779
 
780 780
 }
@@ -793,13 +793,13 @@  discard block
 block discarded – undo
793 793
     $post_types = get_option('geodir_post_types');
794 794
 
795 795
 
796
-    if (is_array($post_types)){
796
+    if (is_array($post_types)) {
797 797
 
798 798
         foreach ($post_types as $post_type => $args) {
799 799
 
800 800
 
801
-            if(isset($args['rewrite']['slug'])){
802
-                $args['rewrite']['slug'] = str_replace("/%gd_taxonomy%","",$args['rewrite']['slug']);
801
+            if (isset($args['rewrite']['slug'])) {
802
+                $args['rewrite']['slug'] = str_replace("/%gd_taxonomy%", "", $args['rewrite']['slug']);
803 803
             }
804 804
 
805 805
                 $alt_post_types[$post_type] = $args;
@@ -807,8 +807,8 @@  discard block
 block discarded – undo
807 807
         }
808 808
     }
809 809
 
810
-    if(!empty($alt_post_types)) {
811
-        update_option('geodir_post_types',$alt_post_types);
810
+    if (!empty($alt_post_types)) {
811
+        update_option('geodir_post_types', $alt_post_types);
812 812
         }
813 813
 
814 814
 
@@ -834,9 +834,9 @@  discard block
 block discarded – undo
834 834
         foreach ($all_postypes as $key) {
835 835
             // update each GD CTP
836 836
             try {
837
-                $wpdb->query("ALTER TABLE " . $wpdb->prefix . "geodir_" . $key . "_detail MODIFY post_city VARCHAR( 50 ) NULL,MODIFY post_region VARCHAR( 50 ) NULL,MODIFY post_country VARCHAR( 50 ) NULL");
838
-            } catch(Exception $e) {
839
-                error_log( 'Error: ' . $e->getMessage() );
837
+                $wpdb->query("ALTER TABLE ".$wpdb->prefix."geodir_".$key."_detail MODIFY post_city VARCHAR( 50 ) NULL,MODIFY post_region VARCHAR( 50 ) NULL,MODIFY post_country VARCHAR( 50 ) NULL");
838
+            } catch (Exception $e) {
839
+                error_log('Error: '.$e->getMessage());
840 840
             }
841 841
         }
842 842
     }
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -324,7 +324,7 @@
 block discarded – undo
324 324
 
325 325
             if(!empty($show_in_arr )){
326 326
                 $show_in_arr = implode(',',$show_in_arr);
327
-            }else{
327
+            } else{
328 328
                 $show_in_arr = '';
329 329
             }
330 330
 
Please login to merge, or discard this patch.
Indentation   +544 added lines, -544 removed lines patch added patch discarded remove patch
@@ -10,50 +10,50 @@  discard block
 block discarded – undo
10 10
 global $wpdb;
11 11
 
12 12
 if (get_option('geodirectory' . '_db_version') != GEODIRECTORY_VERSION) {
13
-    /**
14
-     * Include custom database table related functions.
15
-     *
16
-     * @since 1.0.0
17
-     * @package GeoDirectory
18
-     */
19
-    include_once('geodirectory-admin/admin_db_install.php');
20
-    add_action('plugins_loaded', 'geodirectory_upgrade_all', 10);
21
-    if (GEODIRECTORY_VERSION <= '1.3.6') {
22
-        add_action('plugins_loaded', 'geodir_upgrade_136', 11);
23
-    }
13
+	/**
14
+	 * Include custom database table related functions.
15
+	 *
16
+	 * @since 1.0.0
17
+	 * @package GeoDirectory
18
+	 */
19
+	include_once('geodirectory-admin/admin_db_install.php');
20
+	add_action('plugins_loaded', 'geodirectory_upgrade_all', 10);
21
+	if (GEODIRECTORY_VERSION <= '1.3.6') {
22
+		add_action('plugins_loaded', 'geodir_upgrade_136', 11);
23
+	}
24 24
 
25
-    if (GEODIRECTORY_VERSION <= '1.4.6') {
26
-        add_action('init', 'geodir_upgrade_146', 11);
27
-    }
25
+	if (GEODIRECTORY_VERSION <= '1.4.6') {
26
+		add_action('init', 'geodir_upgrade_146', 11);
27
+	}
28 28
 
29
-    if (GEODIRECTORY_VERSION <= '1.4.8') {
30
-        add_action('init', 'geodir_upgrade_148', 11);
31
-    }
29
+	if (GEODIRECTORY_VERSION <= '1.4.8') {
30
+		add_action('init', 'geodir_upgrade_148', 11);
31
+	}
32 32
 
33
-    if (GEODIRECTORY_VERSION <= '1.5.0') {
34
-        add_action('init', 'geodir_upgrade_150', 11);
35
-    }
33
+	if (GEODIRECTORY_VERSION <= '1.5.0') {
34
+		add_action('init', 'geodir_upgrade_150', 11);
35
+	}
36 36
 
37
-    if (GEODIRECTORY_VERSION <= '1.5.2') {
38
-        add_action('init', 'geodir_upgrade_152', 11);
39
-    }
37
+	if (GEODIRECTORY_VERSION <= '1.5.2') {
38
+		add_action('init', 'geodir_upgrade_152', 11);
39
+	}
40 40
 
41
-    if (GEODIRECTORY_VERSION <= '1.5.3') {
42
-        add_action('init', 'geodir_upgrade_153', 11);
43
-    }
41
+	if (GEODIRECTORY_VERSION <= '1.5.3') {
42
+		add_action('init', 'geodir_upgrade_153', 11);
43
+	}
44 44
 
45
-    if (GEODIRECTORY_VERSION <= '1.5.4') {
46
-        add_action('init', 'geodir_upgrade_154', 11);
47
-    }
45
+	if (GEODIRECTORY_VERSION <= '1.5.4') {
46
+		add_action('init', 'geodir_upgrade_154', 11);
47
+	}
48 48
 
49
-    if (GEODIRECTORY_VERSION <= '1.6.6') {
50
-        add_action('init', 'geodir_upgrade_166', 11);
51
-    }
49
+	if (GEODIRECTORY_VERSION <= '1.6.6') {
50
+		add_action('init', 'geodir_upgrade_166', 11);
51
+	}
52 52
 
53 53
 
54
-    add_action('init', 'gd_fix_cpt_rewrite_slug', 11);// this needs to be kept for a few versions
54
+	add_action('init', 'gd_fix_cpt_rewrite_slug', 11);// this needs to be kept for a few versions
55 55
 
56
-    update_option('geodirectory' . '_db_version', GEODIRECTORY_VERSION);
56
+	update_option('geodirectory' . '_db_version', GEODIRECTORY_VERSION);
57 57
 
58 58
 }
59 59
 
@@ -66,9 +66,9 @@  discard block
 block discarded – undo
66 66
  */
67 67
 function geodirectory_upgrade_all()
68 68
 {
69
-    geodir_create_tables();
70
-    geodir_update_review_db();
71
-    gd_install_theme_compat();
69
+	geodir_create_tables();
70
+	geodir_update_review_db();
71
+	gd_install_theme_compat();
72 72
 }
73 73
 
74 74
 /**
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
  */
80 80
 function geodir_upgrade_136()
81 81
 {
82
-    geodir_fix_review_overall_rating();
82
+	geodir_fix_review_overall_rating();
83 83
 }
84 84
 
85 85
 /**
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
  * @package GeoDirectory
90 90
  */
91 91
 function geodir_upgrade_146(){
92
-    gd_convert_virtual_pages();
92
+	gd_convert_virtual_pages();
93 93
 }
94 94
 
95 95
 /**
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
  * @package GeoDirectory
100 100
  */
101 101
 function geodir_upgrade_150(){
102
-    gd_fix_cpt_rewrite_slug();
102
+	gd_fix_cpt_rewrite_slug();
103 103
 }
104 104
 
105 105
 
@@ -111,11 +111,11 @@  discard block
 block discarded – undo
111 111
  * @package GeoDirectory
112 112
  */
113 113
 function geodir_upgrade_148(){
114
-    /*
114
+	/*
115 115
      * Blank the users google password if present as we now use oAuth 2.0
116 116
      */
117
-    update_option('geodir_ga_pass','');
118
-    update_option('geodir_ga_user','');
117
+	update_option('geodir_ga_pass','');
118
+	update_option('geodir_ga_user','');
119 119
 
120 120
 }
121 121
 
@@ -127,8 +127,8 @@  discard block
 block discarded – undo
127 127
  * @package GeoDirectory
128 128
  */
129 129
 function geodir_upgrade_153(){
130
-    geodir_create_page(esc_sql(_x('gd-info', 'page_slug', 'geodirectory')), 'geodir_info_page', __('Info', 'geodirectory'), '');
131
-    geodir_create_page(esc_sql(_x('gd-login', 'page_slug', 'geodirectory')), 'geodir_login_page', __('Login', 'geodirectory'), '');
130
+	geodir_create_page(esc_sql(_x('gd-info', 'page_slug', 'geodirectory')), 'geodir_info_page', __('Info', 'geodirectory'), '');
131
+	geodir_create_page(esc_sql(_x('gd-login', 'page_slug', 'geodirectory')), 'geodir_login_page', __('Login', 'geodirectory'), '');
132 132
 }
133 133
 
134 134
 /**
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
  * @package GeoDirectory
139 139
  */
140 140
 function geodir_upgrade_154(){
141
-    geodir_create_page(esc_sql(_x('gd-home', 'page_slug', 'geodirectory')), 'geodir_home_page', __('GD Home page', 'geodirectory'), '');
141
+	geodir_create_page(esc_sql(_x('gd-home', 'page_slug', 'geodirectory')), 'geodir_home_page', __('GD Home page', 'geodirectory'), '');
142 142
 }
143 143
 
144 144
 /**
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
  * @package GeoDirectory
149 149
  */
150 150
 function geodir_upgrade_152(){
151
-    gd_fix_address_detail_table_limit();
151
+	gd_fix_address_detail_table_limit();
152 152
 }
153 153
 
154 154
 /**
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
  * @package GeoDirectory
159 159
  */
160 160
 function geodir_upgrade_166(){
161
-    gd_convert_custom_field_display();
161
+	gd_convert_custom_field_display();
162 162
 }
163 163
 
164 164
 
@@ -172,12 +172,12 @@  discard block
 block discarded – undo
172 172
  */
173 173
 function geodir_update_review_db()
174 174
 {
175
-    global $wpdb, $plugin_prefix;
175
+	global $wpdb, $plugin_prefix;
176 176
 
177
-    geodir_fix_review_date();
178
-    geodir_fix_review_post_status();
179
-    geodir_fix_review_content();
180
-    geodir_fix_review_location();
177
+	geodir_fix_review_date();
178
+	geodir_fix_review_post_status();
179
+	geodir_fix_review_content();
180
+	geodir_fix_review_location();
181 181
 
182 182
 }
183 183
 
@@ -190,8 +190,8 @@  discard block
 block discarded – undo
190 190
  */
191 191
 function geodir_fix_review_date()
192 192
 {
193
-    global $wpdb;
194
-    $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.post_date = c.comment_date WHERE gdr.post_date='0000-00-00 00:00:00'");
193
+	global $wpdb;
194
+	$wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.post_date = c.comment_date WHERE gdr.post_date='0000-00-00 00:00:00'");
195 195
 }
196 196
 
197 197
 /**
@@ -203,8 +203,8 @@  discard block
 block discarded – undo
203 203
  */
204 204
 function geodir_fix_review_post_status()
205 205
 {
206
-    global $wpdb;
207
-    $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->posts p ON gdr.post_id=p.ID SET gdr.post_status = 1 WHERE gdr.post_status IS NULL AND p.post_status='publish'");
206
+	global $wpdb;
207
+	$wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->posts p ON gdr.post_id=p.ID SET gdr.post_status = 1 WHERE gdr.post_status IS NULL AND p.post_status='publish'");
208 208
 }
209 209
 
210 210
 /**
@@ -217,12 +217,12 @@  discard block
 block discarded – undo
217 217
  */
218 218
 function geodir_fix_review_content()
219 219
 {
220
-    global $wpdb;
221
-    if ($wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.comment_content = c.comment_content WHERE gdr.comment_content IS NULL")) {
222
-        return true;
223
-    } else {
224
-        return false;
225
-    }
220
+	global $wpdb;
221
+	if ($wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.comment_content = c.comment_content WHERE gdr.comment_content IS NULL")) {
222
+		return true;
223
+	} else {
224
+		return false;
225
+	}
226 226
 }
227 227
 
228 228
 /**
@@ -235,20 +235,20 @@  discard block
 block discarded – undo
235 235
  */
236 236
 function geodir_fix_review_location()
237 237
 {
238
-    global $wpdb;
238
+	global $wpdb;
239 239
 
240
-    $all_postypes = geodir_get_posttypes();
240
+	$all_postypes = geodir_get_posttypes();
241 241
 
242
-    if (!empty($all_postypes)) {
243
-        foreach ($all_postypes as $key) {
244
-            // update each GD CTP
242
+	if (!empty($all_postypes)) {
243
+		foreach ($all_postypes as $key) {
244
+			// update each GD CTP
245 245
 
246
-            $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN " . $wpdb->prefix . "geodir_" . $key . "_detail d ON gdr.post_id=d.post_id SET gdr.post_latitude = d.post_latitude, gdr.post_longitude = d.post_longitude, gdr.post_city = d.post_city,  gdr.post_region=d.post_region, gdr.post_country=d.post_country WHERE gdr.post_latitude IS NULL OR gdr.post_city IS NULL");
246
+			$wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN " . $wpdb->prefix . "geodir_" . $key . "_detail d ON gdr.post_id=d.post_id SET gdr.post_latitude = d.post_latitude, gdr.post_longitude = d.post_longitude, gdr.post_city = d.post_city,  gdr.post_region=d.post_region, gdr.post_country=d.post_country WHERE gdr.post_latitude IS NULL OR gdr.post_city IS NULL");
247 247
 
248
-        }
249
-        return true;
250
-    }
251
-    return false;
248
+		}
249
+		return true;
250
+	}
251
+	return false;
252 252
 }
253 253
 
254 254
 /**
@@ -260,82 +260,82 @@  discard block
 block discarded – undo
260 260
  */
261 261
 function geodir_fix_review_overall_rating()
262 262
 {
263
-    global $wpdb;
263
+	global $wpdb;
264 264
 
265
-    $all_postypes = geodir_get_posttypes();
265
+	$all_postypes = geodir_get_posttypes();
266 266
 
267
-    if (!empty($all_postypes)) {
268
-        foreach ($all_postypes as $key) {
269
-            // update each GD CTP
270
-            $reviews = $wpdb->get_results("SELECT post_id FROM " . $wpdb->prefix . "geodir_" . $key . "_detail d");
267
+	if (!empty($all_postypes)) {
268
+		foreach ($all_postypes as $key) {
269
+			// update each GD CTP
270
+			$reviews = $wpdb->get_results("SELECT post_id FROM " . $wpdb->prefix . "geodir_" . $key . "_detail d");
271 271
 
272
-            if (!empty($reviews)) {
273
-                foreach ($reviews as $post_id) {
274
-                    geodir_update_postrating($post_id->post_id, $key);
275
-                }
272
+			if (!empty($reviews)) {
273
+				foreach ($reviews as $post_id) {
274
+					geodir_update_postrating($post_id->post_id, $key);
275
+				}
276 276
 
277
-            }
277
+			}
278 278
 
279
-        }
279
+		}
280 280
 
281
-    }
281
+	}
282 282
 }
283 283
 
284 284
 
285 285
 function gd_convert_custom_field_display(){
286
-    global $wpdb;
286
+	global $wpdb;
287 287
 
288
-    $field_info = $wpdb->get_results("select * from " . GEODIR_CUSTOM_FIELDS_TABLE);
288
+	$field_info = $wpdb->get_results("select * from " . GEODIR_CUSTOM_FIELDS_TABLE);
289 289
 
290
-    $has_run = get_option('gd_convert_custom_field_display');
291
-    if($has_run){return;}
290
+	$has_run = get_option('gd_convert_custom_field_display');
291
+	if($has_run){return;}
292 292
 
293
-    // set the field_type_key for standard fields
294
-    $wpdb->query("UPDATE ".GEODIR_CUSTOM_FIELDS_TABLE." SET field_type_key = field_type");
293
+	// set the field_type_key for standard fields
294
+	$wpdb->query("UPDATE ".GEODIR_CUSTOM_FIELDS_TABLE." SET field_type_key = field_type");
295 295
 
296 296
 
297
-    if(is_array( $field_info)){
297
+	if(is_array( $field_info)){
298 298
 
299
-        foreach( $field_info as $cf){
299
+		foreach( $field_info as $cf){
300 300
 
301
-            $id = $cf->id;
301
+			$id = $cf->id;
302 302
 
303
-            if(!property_exists($cf,'show_in') || !$id){return;}
303
+			if(!property_exists($cf,'show_in') || !$id){return;}
304 304
 
305
-            $show_in_arr = array();
305
+			$show_in_arr = array();
306 306
 
307
-            if($cf->is_default){
308
-                $show_in_arr[] = "[detail]";
309
-            }
307
+			if($cf->is_default){
308
+				$show_in_arr[] = "[detail]";
309
+			}
310 310
 
311
-            if($cf->show_on_detail){
312
-                $show_in_arr[] = "[moreinfo]";
313
-            }
311
+			if($cf->show_on_detail){
312
+				$show_in_arr[] = "[moreinfo]";
313
+			}
314 314
 
315
-            if($cf->show_on_listing){
316
-                $show_in_arr[] = "[listing]";
317
-            }
315
+			if($cf->show_on_listing){
316
+				$show_in_arr[] = "[listing]";
317
+			}
318 318
 
319
-            if($cf->show_as_tab || $cf->htmlvar_name=='geodir_video' || $cf->htmlvar_name=='geodir_special_offers'){
320
-                $show_in_arr[] = "[owntab]";
321
-            }
319
+			if($cf->show_as_tab || $cf->htmlvar_name=='geodir_video' || $cf->htmlvar_name=='geodir_special_offers'){
320
+				$show_in_arr[] = "[owntab]";
321
+			}
322 322
 
323
-            if($cf->htmlvar_name=='post' || $cf->htmlvar_name=='geodir_contact' || $cf->htmlvar_name=='geodir_timing'){
324
-                $show_in_arr[] = "[mapbubble]";
325
-            }
323
+			if($cf->htmlvar_name=='post' || $cf->htmlvar_name=='geodir_contact' || $cf->htmlvar_name=='geodir_timing'){
324
+				$show_in_arr[] = "[mapbubble]";
325
+			}
326 326
 
327
-            if(!empty($show_in_arr )){
328
-                $show_in_arr = implode(',',$show_in_arr);
329
-            }else{
330
-                $show_in_arr = '';
331
-            }
327
+			if(!empty($show_in_arr )){
328
+				$show_in_arr = implode(',',$show_in_arr);
329
+			}else{
330
+				$show_in_arr = '';
331
+			}
332 332
 
333
-            $wpdb->query("UPDATE ".GEODIR_CUSTOM_FIELDS_TABLE." SET show_in='$show_in_arr' WHERE id=$id");
333
+			$wpdb->query("UPDATE ".GEODIR_CUSTOM_FIELDS_TABLE." SET show_in='$show_in_arr' WHERE id=$id");
334 334
 
335
-        }
335
+		}
336 336
 
337
-        update_option('gd_convert_custom_field_display',1);
338
-    }
337
+		update_option('gd_convert_custom_field_display',1);
338
+	}
339 339
 }
340 340
 
341 341
 ############################################
@@ -351,367 +351,367 @@  discard block
 block discarded – undo
351 351
  */
352 352
 function gd_install_theme_compat()
353 353
 {
354
-    global $wpdb;
354
+	global $wpdb;
355 355
 
356
-    $theme_compat = array();
357
-    $theme_compat = get_option('gd_theme_compats');
356
+	$theme_compat = array();
357
+	$theme_compat = get_option('gd_theme_compats');
358 358
 //GDF
359
-    $theme_compat['GeoDirectory_Framework'] = array(
360
-        'geodir_wrapper_open_id' => 'geodir_wrapper',
361
-        'geodir_wrapper_open_class' => '',
362
-        'geodir_wrapper_open_replace' => '',
363
-        'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->',
364
-        'geodir_wrapper_content_open_id' => 'geodir_content',
365
-        'geodir_wrapper_content_open_class' => '',
366
-        'geodir_wrapper_content_open_replace' => '',
367
-        'geodir_wrapper_content_close_replace' => '',
368
-        'geodir_article_open_id' => '',
369
-        'geodir_article_open_class' => '',
370
-        'geodir_article_open_replace' => '',
371
-        'geodir_article_close_replace' => '',
372
-        'geodir_sidebar_right_open_id' => '',
373
-        'geodir_sidebar_right_open_class' => '',
374
-        'geodir_sidebar_right_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
375
-        'geodir_sidebar_right_close_replace' => '',
376
-        'geodir_sidebar_left_open_id' => '',
377
-        'geodir_sidebar_left_open_class' => '',
378
-        'geodir_sidebar_left_open_replace' => '<aside  id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
379
-        'geodir_sidebar_left_close_replace' => '',
380
-        'geodir_main_content_open_id' => '',
381
-        'geodir_main_content_open_class' => '',
382
-        'geodir_main_content_open_replace' => '<!-- removed -->',
383
-        'geodir_main_content_close_replace' => '<!-- removed -->',
384
-        'geodir_top_content_add' => '',
385
-        'geodir_before_main_content_add' => '<div class="clearfix geodir-common">',
386
-        'geodir_before_widget_filter' => '',
387
-        'geodir_after_widget_filter' => '',
388
-        'geodir_theme_compat_css' => '',
389
-        'geodir_theme_compat_js' => '',
390
-        'geodir_theme_compat_default_options' => '',
391
-        'geodir_theme_compat_code' => ''
392
-    );
359
+	$theme_compat['GeoDirectory_Framework'] = array(
360
+		'geodir_wrapper_open_id' => 'geodir_wrapper',
361
+		'geodir_wrapper_open_class' => '',
362
+		'geodir_wrapper_open_replace' => '',
363
+		'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->',
364
+		'geodir_wrapper_content_open_id' => 'geodir_content',
365
+		'geodir_wrapper_content_open_class' => '',
366
+		'geodir_wrapper_content_open_replace' => '',
367
+		'geodir_wrapper_content_close_replace' => '',
368
+		'geodir_article_open_id' => '',
369
+		'geodir_article_open_class' => '',
370
+		'geodir_article_open_replace' => '',
371
+		'geodir_article_close_replace' => '',
372
+		'geodir_sidebar_right_open_id' => '',
373
+		'geodir_sidebar_right_open_class' => '',
374
+		'geodir_sidebar_right_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
375
+		'geodir_sidebar_right_close_replace' => '',
376
+		'geodir_sidebar_left_open_id' => '',
377
+		'geodir_sidebar_left_open_class' => '',
378
+		'geodir_sidebar_left_open_replace' => '<aside  id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
379
+		'geodir_sidebar_left_close_replace' => '',
380
+		'geodir_main_content_open_id' => '',
381
+		'geodir_main_content_open_class' => '',
382
+		'geodir_main_content_open_replace' => '<!-- removed -->',
383
+		'geodir_main_content_close_replace' => '<!-- removed -->',
384
+		'geodir_top_content_add' => '',
385
+		'geodir_before_main_content_add' => '<div class="clearfix geodir-common">',
386
+		'geodir_before_widget_filter' => '',
387
+		'geodir_after_widget_filter' => '',
388
+		'geodir_theme_compat_css' => '',
389
+		'geodir_theme_compat_js' => '',
390
+		'geodir_theme_compat_default_options' => '',
391
+		'geodir_theme_compat_code' => ''
392
+	);
393 393
 
394 394
 //Directory Theme
395
-    $theme_compat['Directory_Starter'] = array(
396
-        'geodir_wrapper_open_id' => 'geodir_wrapper',
397
-        'geodir_wrapper_open_class' => '',
398
-        'geodir_wrapper_open_replace' => '',
399
-        'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->',
400
-        'geodir_wrapper_content_open_id' => 'geodir_content',
401
-        'geodir_wrapper_content_open_class' => '',
402
-        'geodir_wrapper_content_open_replace' => '',
403
-        'geodir_wrapper_content_close_replace' => '',
404
-        'geodir_article_open_id' => '',
405
-        'geodir_article_open_class' => '',
406
-        'geodir_article_open_replace' => '',
407
-        'geodir_article_close_replace' => '',
408
-        'geodir_sidebar_right_open_id' => '',
409
-        'geodir_sidebar_right_open_class' => '',
410
-        'geodir_sidebar_right_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
411
-        'geodir_sidebar_right_close_replace' => '',
412
-        'geodir_sidebar_left_open_id' => '',
413
-        'geodir_sidebar_left_open_class' => '',
414
-        'geodir_sidebar_left_open_replace' => '<aside  id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
415
-        'geodir_sidebar_left_close_replace' => '',
416
-        'geodir_main_content_open_id' => '',
417
-        'geodir_main_content_open_class' => '',
418
-        'geodir_main_content_open_replace' => '<!-- removed -->',
419
-        'geodir_main_content_close_replace' => '<!-- removed -->',
420
-        'geodir_top_content_add' => '',
421
-        'geodir_before_main_content_add' => '<div class="clearfix geodir-common">',
422
-        'geodir_before_widget_filter' => '',
423
-        'geodir_after_widget_filter' => '',
424
-        'geodir_theme_compat_css' => '',
425
-        'geodir_theme_compat_js' => '',
426
-        'geodir_theme_compat_default_options' => '',
427
-        'geodir_theme_compat_code' => ''
428
-    );
395
+	$theme_compat['Directory_Starter'] = array(
396
+		'geodir_wrapper_open_id' => 'geodir_wrapper',
397
+		'geodir_wrapper_open_class' => '',
398
+		'geodir_wrapper_open_replace' => '',
399
+		'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->',
400
+		'geodir_wrapper_content_open_id' => 'geodir_content',
401
+		'geodir_wrapper_content_open_class' => '',
402
+		'geodir_wrapper_content_open_replace' => '',
403
+		'geodir_wrapper_content_close_replace' => '',
404
+		'geodir_article_open_id' => '',
405
+		'geodir_article_open_class' => '',
406
+		'geodir_article_open_replace' => '',
407
+		'geodir_article_close_replace' => '',
408
+		'geodir_sidebar_right_open_id' => '',
409
+		'geodir_sidebar_right_open_class' => '',
410
+		'geodir_sidebar_right_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
411
+		'geodir_sidebar_right_close_replace' => '',
412
+		'geodir_sidebar_left_open_id' => '',
413
+		'geodir_sidebar_left_open_class' => '',
414
+		'geodir_sidebar_left_open_replace' => '<aside  id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
415
+		'geodir_sidebar_left_close_replace' => '',
416
+		'geodir_main_content_open_id' => '',
417
+		'geodir_main_content_open_class' => '',
418
+		'geodir_main_content_open_replace' => '<!-- removed -->',
419
+		'geodir_main_content_close_replace' => '<!-- removed -->',
420
+		'geodir_top_content_add' => '',
421
+		'geodir_before_main_content_add' => '<div class="clearfix geodir-common">',
422
+		'geodir_before_widget_filter' => '',
423
+		'geodir_after_widget_filter' => '',
424
+		'geodir_theme_compat_css' => '',
425
+		'geodir_theme_compat_js' => '',
426
+		'geodir_theme_compat_default_options' => '',
427
+		'geodir_theme_compat_code' => ''
428
+	);
429 429
 
430 430
 //Jobby
431
-    $theme_compat['Jobby'] = $theme_compat['Directory_Starter'];
431
+	$theme_compat['Jobby'] = $theme_compat['Directory_Starter'];
432 432
 
433 433
 //GeoProperty
434
-    $theme_compat['GeoProperty'] = $theme_compat['Directory_Starter'];
434
+	$theme_compat['GeoProperty'] = $theme_compat['Directory_Starter'];
435 435
 
436 436
 //Avada
437
-    $theme_compat['Avada'] = array(
438
-        'geodir_wrapper_open_id' => '',
439
-        'geodir_wrapper_open_class' => '',
440
-        'geodir_wrapper_open_replace' => '<!-- removed -->',
441
-        'geodir_wrapper_close_replace' => '<!-- removed -->',
442
-        'geodir_wrapper_content_open_id' => 'content',
443
-        'geodir_wrapper_content_open_class' => '',
444
-        'geodir_wrapper_content_open_replace' => '',
445
-        'geodir_wrapper_content_close_replace' => '',
446
-        'geodir_article_open_id' => '',
447
-        'geodir_article_open_class' => '',
448
-        'geodir_article_open_replace' => '',
449
-        'geodir_article_close_replace' => '',
450
-        'geodir_sidebar_right_open_id' => '',
451
-        'geodir_sidebar_right_open_class' => '',
452
-        'geodir_sidebar_right_open_replace' => '<div id="sidebar" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
453
-        'geodir_sidebar_right_close_replace' => '</div><!-- end sidebar -->',
454
-        'geodir_sidebar_left_open_id' => '',
455
-        'geodir_sidebar_left_open_class' => '',
456
-        'geodir_sidebar_left_open_replace' => '<div id="sidebar" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
457
-        'geodir_sidebar_left_close_replace' => '</div><!-- end sidebar -->',
458
-        'geodir_main_content_open_id' => '',
459
-        'geodir_main_content_open_class' => '',
460
-        'geodir_main_content_open_replace' => '<!-- removed -->',
461
-        'geodir_main_content_close_replace' => '<!-- removed -->',
462
-        'geodir_top_content_add' => '',
463
-        'geodir_before_main_content_add' => '',
464
-        'geodir_before_widget_filter' => '',
465
-        'geodir_after_widget_filter' => '',
466
-        'geodir_theme_compat_css' => stripslashes('.geodir-sidebar-left{float:left}select,textarea{border-style:solid;border-width:1px}.top-menu li > div{visibility:visible}.geodir-chosen-container-single .chosen-single{height:auto}ul li#menu-item-gd-location-switcher ul{width:222px}ul li#menu-item-gd-location-switcher ul li{padding-right:0!important}#mobile-nav li#mobile-menu-item-gd-location-switcher li a{padding-left:10px;padding-right:10px}#menu-item-gd-location-switcher dd,#mobile-menu-item-gd-location-switcher{margin-left:0}#menu-item-gd-location-switcher dd a{display:block}.geodir-chosen-container .chosen-results li.highlighted{background-color:#eee;background-image:none;color:#444}#mobile-nav li.mobile-nav-item li a:before{content:\'\';margin:0}#mobile-nav li.mobile-nav-item li a{padding:10px;width:auto}.geodir-listing-search{text-align:center}.geodir-search{float:none;margin:0}.geodir-search select,.geodir-search .search_by_post,.geodir-search input[type="text"],.geodir-search button[type="button"], .geodir-search input[type="button"],.geodir-search input[type="submit"]{display:inline-block;float:none}.geodir-cat-list ul li,.map_category ul li{list-style-type:none}.wpgeo-avada .page-title ul li:after{content:\'\'}.top_banner_section{margin-bottom:0}.geodir-category-list-in{margin:0;padding:15px}.geodir_full_page .geodir-cat-list .widget-title{margin-top:0}.geodir_full_page .geodir-cat-list ul li{padding-left:0}.geodir-loc-bar{border:none;margin:0;padding:0}.geodir-loc-bar-in{padding:15px 0}.geodir_full_page section.widget{margin-bottom:20px}.sidebar .geodir-loginbox-list li{margin-bottom:10px;padding-bottom:10px}.sidebar .geodir-loginbox-list li a{display:block}.sidebar .geodir-chosen-container .chosen-results li{margin:0;padding:5px 6px}.sidebar .geodir-chosen-container .chosen-results li.highlighted{background:#eee;background-image:none;color:#000}.sidebar .geodir_category_list_view li.geodir-gridview{display:inline-block;margin-bottom:15px}.wpgeo-avada.double-sidebars #main #sidebar{margin-left:3%}.wpgeo-avada.double-sidebars #main #sidebar-2{margin-left:-100%}.wpgeo-avada.double-sidebars #content{float:left;margin-left:0}.geodir_full_page section.widget{margin-bottom: 0px;} .sidebar .widget .geodir-hide {display: none;}li.fusion-mobile-nav-item .geodir_location_tab_container a:before{content: "" !important; margin-right: auto !important;}li.fusion-mobile-nav-item .geodir_location_tab_container a{padding-left:5px !important;}'),
467
-        'geodir_theme_compat_js' => '',
468
-        'geodir_theme_compat_default_options' => '',
469
-        'geodir_theme_compat_code' => 'Avada'
470
-    );
437
+	$theme_compat['Avada'] = array(
438
+		'geodir_wrapper_open_id' => '',
439
+		'geodir_wrapper_open_class' => '',
440
+		'geodir_wrapper_open_replace' => '<!-- removed -->',
441
+		'geodir_wrapper_close_replace' => '<!-- removed -->',
442
+		'geodir_wrapper_content_open_id' => 'content',
443
+		'geodir_wrapper_content_open_class' => '',
444
+		'geodir_wrapper_content_open_replace' => '',
445
+		'geodir_wrapper_content_close_replace' => '',
446
+		'geodir_article_open_id' => '',
447
+		'geodir_article_open_class' => '',
448
+		'geodir_article_open_replace' => '',
449
+		'geodir_article_close_replace' => '',
450
+		'geodir_sidebar_right_open_id' => '',
451
+		'geodir_sidebar_right_open_class' => '',
452
+		'geodir_sidebar_right_open_replace' => '<div id="sidebar" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
453
+		'geodir_sidebar_right_close_replace' => '</div><!-- end sidebar -->',
454
+		'geodir_sidebar_left_open_id' => '',
455
+		'geodir_sidebar_left_open_class' => '',
456
+		'geodir_sidebar_left_open_replace' => '<div id="sidebar" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>',
457
+		'geodir_sidebar_left_close_replace' => '</div><!-- end sidebar -->',
458
+		'geodir_main_content_open_id' => '',
459
+		'geodir_main_content_open_class' => '',
460
+		'geodir_main_content_open_replace' => '<!-- removed -->',
461
+		'geodir_main_content_close_replace' => '<!-- removed -->',
462
+		'geodir_top_content_add' => '',
463
+		'geodir_before_main_content_add' => '',
464
+		'geodir_before_widget_filter' => '',
465
+		'geodir_after_widget_filter' => '',
466
+		'geodir_theme_compat_css' => stripslashes('.geodir-sidebar-left{float:left}select,textarea{border-style:solid;border-width:1px}.top-menu li > div{visibility:visible}.geodir-chosen-container-single .chosen-single{height:auto}ul li#menu-item-gd-location-switcher ul{width:222px}ul li#menu-item-gd-location-switcher ul li{padding-right:0!important}#mobile-nav li#mobile-menu-item-gd-location-switcher li a{padding-left:10px;padding-right:10px}#menu-item-gd-location-switcher dd,#mobile-menu-item-gd-location-switcher{margin-left:0}#menu-item-gd-location-switcher dd a{display:block}.geodir-chosen-container .chosen-results li.highlighted{background-color:#eee;background-image:none;color:#444}#mobile-nav li.mobile-nav-item li a:before{content:\'\';margin:0}#mobile-nav li.mobile-nav-item li a{padding:10px;width:auto}.geodir-listing-search{text-align:center}.geodir-search{float:none;margin:0}.geodir-search select,.geodir-search .search_by_post,.geodir-search input[type="text"],.geodir-search button[type="button"], .geodir-search input[type="button"],.geodir-search input[type="submit"]{display:inline-block;float:none}.geodir-cat-list ul li,.map_category ul li{list-style-type:none}.wpgeo-avada .page-title ul li:after{content:\'\'}.top_banner_section{margin-bottom:0}.geodir-category-list-in{margin:0;padding:15px}.geodir_full_page .geodir-cat-list .widget-title{margin-top:0}.geodir_full_page .geodir-cat-list ul li{padding-left:0}.geodir-loc-bar{border:none;margin:0;padding:0}.geodir-loc-bar-in{padding:15px 0}.geodir_full_page section.widget{margin-bottom:20px}.sidebar .geodir-loginbox-list li{margin-bottom:10px;padding-bottom:10px}.sidebar .geodir-loginbox-list li a{display:block}.sidebar .geodir-chosen-container .chosen-results li{margin:0;padding:5px 6px}.sidebar .geodir-chosen-container .chosen-results li.highlighted{background:#eee;background-image:none;color:#000}.sidebar .geodir_category_list_view li.geodir-gridview{display:inline-block;margin-bottom:15px}.wpgeo-avada.double-sidebars #main #sidebar{margin-left:3%}.wpgeo-avada.double-sidebars #main #sidebar-2{margin-left:-100%}.wpgeo-avada.double-sidebars #content{float:left;margin-left:0}.geodir_full_page section.widget{margin-bottom: 0px;} .sidebar .widget .geodir-hide {display: none;}li.fusion-mobile-nav-item .geodir_location_tab_container a:before{content: "" !important; margin-right: auto !important;}li.fusion-mobile-nav-item .geodir_location_tab_container a{padding-left:5px !important;}'),
467
+		'geodir_theme_compat_js' => '',
468
+		'geodir_theme_compat_default_options' => '',
469
+		'geodir_theme_compat_code' => 'Avada'
470
+	);
471 471
 
472 472
 //Enfold
473
-    $theme_compat['Enfold'] = array(
474
-        'geodir_wrapper_open_id' => '',
475
-        'geodir_wrapper_open_class' => '',
476
-        'geodir_wrapper_open_replace' => '',
477
-        'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->',
478
-        'geodir_wrapper_content_open_id' => '',
479
-        'geodir_wrapper_content_open_class' => '',
480
-        'geodir_wrapper_content_open_replace' => '',
481
-        'geodir_wrapper_content_close_replace' => '</div></main>',
482
-        'geodir_article_open_id' => '',
483
-        'geodir_article_open_class' => '',
484
-        'geodir_article_open_replace' => '',
485
-        'geodir_article_close_replace' => '',
486
-        'geodir_sidebar_right_open_id' => '',
487
-        'geodir_sidebar_right_open_class' => '',
488
-        'geodir_sidebar_right_open_replace' => '',
489
-        'geodir_sidebar_right_close_replace' => '</div></aside><!-- sidebar ends here-->',
490
-        'geodir_sidebar_left_open_id' => '',
491
-        'geodir_sidebar_left_open_class' => '',
492
-        'geodir_sidebar_left_open_replace' => '',
493
-        'geodir_sidebar_left_close_replace' => '</div></aside><!-- sidebar ends here-->',
494
-        'geodir_main_content_open_id' => '',
495
-        'geodir_main_content_open_class' => '',
496
-        'geodir_main_content_open_replace' => '',
497
-        'geodir_main_content_close_replace' => '',
498
-        'geodir_top_content_add' => '',
499
-        'geodir_before_main_content_add' => '',
500
-        'geodir_before_widget_filter' => '',
501
-        'geodir_after_widget_filter' => '',
502
-        'geodir_theme_compat_css' => stripslashes('.geodir_full_page .top_banner_section{margin-bottom:0}.widget .geodir-cat-list ul li{clear:none}.wpgeo-enfold .av-main-nav ul{width:222px}.geodir-listing-search .geodir-loc-bar{border-top:none;padding:0}#main .geodir-listing-search,.geodir-listing-search .geodir-loc-bar{margin-bottom:0}#main .geodir-loc-bar-in,#main .geodir-category-list-in{background-color:#fcfcfc;margin:20px 0;padding:20px}#main .geodir_full_page .geodir-loc-bar-in,#main .geodir_full_page .geodir-loc-bar,#main .geodir_full_page .geodir-category-list-in{margin-top:0;margin-bottom:0}#main .geodir-loc-bar-in{padding:20px}#main .geodir-search{margin:0;width:100%}#main .geodir-search select{margin:0 3% 0 0;padding:8px 10px;width:13%}#main .geodir-search input[type="text"]{margin:0 3% 0 0;padding:10px;width:32.4%}#main .geodir-search input[type="button"],#main .geodir-search input[type="submit"]{font-size:inherit;line-height:2.25;margin:0;padding:7px;width:13%}.enfold-home-top section.widget{margin:0;padding:0}.enfold-home-top .top_banner_section{margin-bottom:0}.enfold-home-top .geodir-loc-bar{background:#fcfcfc;border:none;margin:0;padding:0}#main .enfold-home-top .geodir-loc-bar-in{background:none;border:none;margin:0 auto;padding:20px 0}#main .geodir-breadcrumb{border-bottom-style:solid;border-bottom-width:1px}#gd-tabs dt{clear:none}#geodir_slider ul li{list-style-type:none;margin:0;padding:0}#respond{clear:both}#comments .comments-title span{display:inline;font-size:inherit;font-weight:700}#reviewsTab .comments-area .bypostauthor cite span{display:inline}#top #comments .commentlist .comment,#top #comments .commentlist .comment > div{min-height:0}.commentlist .commenttext{padding-top:15px}#comment_imagesdropbox{margin-bottom:20px}.wpgeo-enfold .geodir_category_list_view li{margin-left:0;padding:0}.widget ul.geodir-loginbox-list{overflow:visible}.geodir_category_list_view li .geodir-post-img{display:block}.wpgeo-enfold .geodir_event_listing_calendar tr.title{background:#ccc}@media only screen and (max-width:480px){.geodir_category_list_view li .geodir-content,.geodir_category_list_view li .geodir-post-img,.geodir_category_list_view li .geodir-addinfo{float:none;width:100%;margin:10px 0}#main .geodir-search input[type="text"],#main .geodir-search input[type="button"],#main .geodir-search input[type="submit"],#main .geodir-search select{margin:10px 0;width:100%}}#main .geodir_full_page section:last-child .geodir-loc-bar{margin-bottom: -1px;border-bottom: none;}'),
503
-        'geodir_theme_compat_js' => '',
504
-        'geodir_theme_compat_default_options' => '',
505
-        'geodir_theme_compat_code' => 'Enfold'
506
-    );
473
+	$theme_compat['Enfold'] = array(
474
+		'geodir_wrapper_open_id' => '',
475
+		'geodir_wrapper_open_class' => '',
476
+		'geodir_wrapper_open_replace' => '',
477
+		'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->',
478
+		'geodir_wrapper_content_open_id' => '',
479
+		'geodir_wrapper_content_open_class' => '',
480
+		'geodir_wrapper_content_open_replace' => '',
481
+		'geodir_wrapper_content_close_replace' => '</div></main>',
482
+		'geodir_article_open_id' => '',
483
+		'geodir_article_open_class' => '',
484
+		'geodir_article_open_replace' => '',
485
+		'geodir_article_close_replace' => '',
486
+		'geodir_sidebar_right_open_id' => '',
487
+		'geodir_sidebar_right_open_class' => '',
488
+		'geodir_sidebar_right_open_replace' => '',
489
+		'geodir_sidebar_right_close_replace' => '</div></aside><!-- sidebar ends here-->',
490
+		'geodir_sidebar_left_open_id' => '',
491
+		'geodir_sidebar_left_open_class' => '',
492
+		'geodir_sidebar_left_open_replace' => '',
493
+		'geodir_sidebar_left_close_replace' => '</div></aside><!-- sidebar ends here-->',
494
+		'geodir_main_content_open_id' => '',
495
+		'geodir_main_content_open_class' => '',
496
+		'geodir_main_content_open_replace' => '',
497
+		'geodir_main_content_close_replace' => '',
498
+		'geodir_top_content_add' => '',
499
+		'geodir_before_main_content_add' => '',
500
+		'geodir_before_widget_filter' => '',
501
+		'geodir_after_widget_filter' => '',
502
+		'geodir_theme_compat_css' => stripslashes('.geodir_full_page .top_banner_section{margin-bottom:0}.widget .geodir-cat-list ul li{clear:none}.wpgeo-enfold .av-main-nav ul{width:222px}.geodir-listing-search .geodir-loc-bar{border-top:none;padding:0}#main .geodir-listing-search,.geodir-listing-search .geodir-loc-bar{margin-bottom:0}#main .geodir-loc-bar-in,#main .geodir-category-list-in{background-color:#fcfcfc;margin:20px 0;padding:20px}#main .geodir_full_page .geodir-loc-bar-in,#main .geodir_full_page .geodir-loc-bar,#main .geodir_full_page .geodir-category-list-in{margin-top:0;margin-bottom:0}#main .geodir-loc-bar-in{padding:20px}#main .geodir-search{margin:0;width:100%}#main .geodir-search select{margin:0 3% 0 0;padding:8px 10px;width:13%}#main .geodir-search input[type="text"]{margin:0 3% 0 0;padding:10px;width:32.4%}#main .geodir-search input[type="button"],#main .geodir-search input[type="submit"]{font-size:inherit;line-height:2.25;margin:0;padding:7px;width:13%}.enfold-home-top section.widget{margin:0;padding:0}.enfold-home-top .top_banner_section{margin-bottom:0}.enfold-home-top .geodir-loc-bar{background:#fcfcfc;border:none;margin:0;padding:0}#main .enfold-home-top .geodir-loc-bar-in{background:none;border:none;margin:0 auto;padding:20px 0}#main .geodir-breadcrumb{border-bottom-style:solid;border-bottom-width:1px}#gd-tabs dt{clear:none}#geodir_slider ul li{list-style-type:none;margin:0;padding:0}#respond{clear:both}#comments .comments-title span{display:inline;font-size:inherit;font-weight:700}#reviewsTab .comments-area .bypostauthor cite span{display:inline}#top #comments .commentlist .comment,#top #comments .commentlist .comment > div{min-height:0}.commentlist .commenttext{padding-top:15px}#comment_imagesdropbox{margin-bottom:20px}.wpgeo-enfold .geodir_category_list_view li{margin-left:0;padding:0}.widget ul.geodir-loginbox-list{overflow:visible}.geodir_category_list_view li .geodir-post-img{display:block}.wpgeo-enfold .geodir_event_listing_calendar tr.title{background:#ccc}@media only screen and (max-width:480px){.geodir_category_list_view li .geodir-content,.geodir_category_list_view li .geodir-post-img,.geodir_category_list_view li .geodir-addinfo{float:none;width:100%;margin:10px 0}#main .geodir-search input[type="text"],#main .geodir-search input[type="button"],#main .geodir-search input[type="submit"],#main .geodir-search select{margin:10px 0;width:100%}}#main .geodir_full_page section:last-child .geodir-loc-bar{margin-bottom: -1px;border-bottom: none;}'),
503
+		'geodir_theme_compat_js' => '',
504
+		'geodir_theme_compat_default_options' => '',
505
+		'geodir_theme_compat_code' => 'Enfold'
506
+	);
507 507
 
508 508
 // X
509
-    $theme_compat['X'] = array(
510
-        'geodir_wrapper_open_id' => '',
511
-        'geodir_wrapper_open_class' => '',
512
-        'geodir_wrapper_open_replace' => '',
513
-        'geodir_wrapper_close_replace' => '',
514
-        'geodir_wrapper_content_open_id' => '',
515
-        'geodir_wrapper_content_open_class' => '',
516
-        'geodir_wrapper_content_open_replace' => '',
517
-        'geodir_wrapper_content_close_replace' => '',
518
-        'geodir_article_open_id' => '',
519
-        'geodir_article_open_class' => '',
520
-        'geodir_article_open_replace' => '',
521
-        'geodir_article_close_replace' => '',
522
-        'geodir_sidebar_right_open_id' => '',
523
-        'geodir_sidebar_right_open_class' => '',
524
-        'geodir_sidebar_right_open_replace' => '',
525
-        'geodir_sidebar_right_close_replace' => '',
526
-        'geodir_sidebar_left_open_id' => '',
527
-        'geodir_sidebar_left_open_class' => '',
528
-        'geodir_sidebar_left_open_replace' => '',
529
-        'geodir_sidebar_left_close_replace' => '',
530
-        'geodir_main_content_open_id' => '',
531
-        'geodir_main_content_open_class' => '',
532
-        'geodir_main_content_open_replace' => '',
533
-        'geodir_main_content_close_replace' => '',
534
-        'geodir_top_content_add' => '',
535
-        'geodir_before_main_content_add' => '',
536
-        'geodir_before_widget_filter' => '',
537
-        'geodir_after_widget_filter' => '',
538
-        'geodir_theme_compat_css' => stripslashes('.x-colophon.bottom{clear:both}#geodir-main-content,.geodir_flex-container{margin-top:16px}.geodir-x ul{list-style:none}.widget ul.geodir_category_list_view{border:none}.geodir_category_list_view li.geodir-gridview:last-child{border-bottom:1px solid #e1e1e1}.home .x-header-landmark{display:none}.geodir-x .x-main .geodir_advance_search_widget{margin:0}.geodir-x .top_banner_section{margin-bottom:0}.geodir-loc-bar{background:rgba(0,0,0,0.05);margin:0;padding:0}.geodir-loc-bar-in{background:none;border:none;padding:10px}.geodir-search{margin:0;width:100%}.widget .geodir-search select,.geodir-search input[type="text"],.geodir-search input[type="button"],.geodir-search input[type="submit"]{border:1px solid #ccc;box-shadow:none;height:auto;line-height:21px;margin:0 1% 0 0;padding:5px 10px}.widget .geodir-search select,.geodir-search input[type="text"]{width:28%}.geodir-search input[type="submit"],.geodir-search input[type="button"]{line-height:19px;margin-right:0;width:11%}.geodir-search input:hover[type="submit"],.geodir-search input:hover[type="button"]{background:#333;color:#fff}.geodir-cat-list .widget-title{margin-top:0}.geodir-x .geodir-category-list-in{background:rgba(0,0,0,0.05);border:none}.widget .geodir-cat-list ul.geodir-popular-cat-list{border:none;border-radius:0;box-shadow:none}.geodir_full_page .geodir-cat-list ul li{border:none}.geodir_full_page .geodir-cat-list ul li a{border:none}.post-type-archive .geodir-loc-bar{border:none;margin-top:20px}#menu-item-gd-location-switcher dd{margin-left:0}.geodir-chosen-container-single .chosen-single{height:auto}.widget ul.geodir-loginbox-list{overflow:visible}.geodir_full_page section.widget{clear:both}.x-ethos .entry-title{margin-bottom:20px}.x-ethos .geodir-chosen-container-single .chosen-single{padding:0 0 0 8px}.x-ethos .widget ul li a,.x-ethos .geodir_category_list_view li{color:#333}@media only screen and (max-width:767px){.widget .geodir-search select,.geodir-search input[type="text"],.geodir-search input[type="button"],.geodir-search input[type="submit"]{margin:0 0 10px;width:100%}}.geodir_full_page .geodir-loc-bar-in,.geodir_full_page .geodir-loc-bar,.geodir_full_page .geodir-category-list-in{margin-top:0;margin-bottom:0}.geodir_full_page .geodir-loc-bar-in,.geodir_full_page .geodir-category-list-in{border-bottom:1px solid rgba(0,0,0,0.1)}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}'),
539
-        'geodir_theme_compat_js' => '',
540
-        'geodir_theme_compat_default_options' => '',
541
-        'geodir_theme_compat_code' => 'X'
542
-    );
509
+	$theme_compat['X'] = array(
510
+		'geodir_wrapper_open_id' => '',
511
+		'geodir_wrapper_open_class' => '',
512
+		'geodir_wrapper_open_replace' => '',
513
+		'geodir_wrapper_close_replace' => '',
514
+		'geodir_wrapper_content_open_id' => '',
515
+		'geodir_wrapper_content_open_class' => '',
516
+		'geodir_wrapper_content_open_replace' => '',
517
+		'geodir_wrapper_content_close_replace' => '',
518
+		'geodir_article_open_id' => '',
519
+		'geodir_article_open_class' => '',
520
+		'geodir_article_open_replace' => '',
521
+		'geodir_article_close_replace' => '',
522
+		'geodir_sidebar_right_open_id' => '',
523
+		'geodir_sidebar_right_open_class' => '',
524
+		'geodir_sidebar_right_open_replace' => '',
525
+		'geodir_sidebar_right_close_replace' => '',
526
+		'geodir_sidebar_left_open_id' => '',
527
+		'geodir_sidebar_left_open_class' => '',
528
+		'geodir_sidebar_left_open_replace' => '',
529
+		'geodir_sidebar_left_close_replace' => '',
530
+		'geodir_main_content_open_id' => '',
531
+		'geodir_main_content_open_class' => '',
532
+		'geodir_main_content_open_replace' => '',
533
+		'geodir_main_content_close_replace' => '',
534
+		'geodir_top_content_add' => '',
535
+		'geodir_before_main_content_add' => '',
536
+		'geodir_before_widget_filter' => '',
537
+		'geodir_after_widget_filter' => '',
538
+		'geodir_theme_compat_css' => stripslashes('.x-colophon.bottom{clear:both}#geodir-main-content,.geodir_flex-container{margin-top:16px}.geodir-x ul{list-style:none}.widget ul.geodir_category_list_view{border:none}.geodir_category_list_view li.geodir-gridview:last-child{border-bottom:1px solid #e1e1e1}.home .x-header-landmark{display:none}.geodir-x .x-main .geodir_advance_search_widget{margin:0}.geodir-x .top_banner_section{margin-bottom:0}.geodir-loc-bar{background:rgba(0,0,0,0.05);margin:0;padding:0}.geodir-loc-bar-in{background:none;border:none;padding:10px}.geodir-search{margin:0;width:100%}.widget .geodir-search select,.geodir-search input[type="text"],.geodir-search input[type="button"],.geodir-search input[type="submit"]{border:1px solid #ccc;box-shadow:none;height:auto;line-height:21px;margin:0 1% 0 0;padding:5px 10px}.widget .geodir-search select,.geodir-search input[type="text"]{width:28%}.geodir-search input[type="submit"],.geodir-search input[type="button"]{line-height:19px;margin-right:0;width:11%}.geodir-search input:hover[type="submit"],.geodir-search input:hover[type="button"]{background:#333;color:#fff}.geodir-cat-list .widget-title{margin-top:0}.geodir-x .geodir-category-list-in{background:rgba(0,0,0,0.05);border:none}.widget .geodir-cat-list ul.geodir-popular-cat-list{border:none;border-radius:0;box-shadow:none}.geodir_full_page .geodir-cat-list ul li{border:none}.geodir_full_page .geodir-cat-list ul li a{border:none}.post-type-archive .geodir-loc-bar{border:none;margin-top:20px}#menu-item-gd-location-switcher dd{margin-left:0}.geodir-chosen-container-single .chosen-single{height:auto}.widget ul.geodir-loginbox-list{overflow:visible}.geodir_full_page section.widget{clear:both}.x-ethos .entry-title{margin-bottom:20px}.x-ethos .geodir-chosen-container-single .chosen-single{padding:0 0 0 8px}.x-ethos .widget ul li a,.x-ethos .geodir_category_list_view li{color:#333}@media only screen and (max-width:767px){.widget .geodir-search select,.geodir-search input[type="text"],.geodir-search input[type="button"],.geodir-search input[type="submit"]{margin:0 0 10px;width:100%}}.geodir_full_page .geodir-loc-bar-in,.geodir_full_page .geodir-loc-bar,.geodir_full_page .geodir-category-list-in{margin-top:0;margin-bottom:0}.geodir_full_page .geodir-loc-bar-in,.geodir_full_page .geodir-category-list-in{border-bottom:1px solid rgba(0,0,0,0.1)}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}'),
539
+		'geodir_theme_compat_js' => '',
540
+		'geodir_theme_compat_default_options' => '',
541
+		'geodir_theme_compat_code' => 'X'
542
+	);
543 543
 
544 544
 // Divi
545
-    $theme_compat['Divi'] = array(
546
-        'geodir_wrapper_open_id' => 'main-content',
547
-        'geodir_wrapper_open_class' => '',
548
-        'geodir_wrapper_open_replace' => '',
549
-        'geodir_wrapper_close_replace' => '',
550
-        'geodir_wrapper_content_open_id' => 'left-area',
551
-        'geodir_wrapper_content_open_class' => '',
552
-        'geodir_wrapper_content_open_replace' => '<div class="container"><div id="content-area" class="clearfix"><div id="[id]" class="[class]" role="main" >',
553
-        'geodir_wrapper_content_close_replace' => '',
554
-        'geodir_article_open_id' => '',
555
-        'geodir_article_open_class' => '',
556
-        'geodir_article_open_replace' => '',
557
-        'geodir_article_close_replace' => '',
558
-        'geodir_sidebar_right_open_id' => 'sidebar',
559
-        'geodir_sidebar_right_open_class' => '',
560
-        'geodir_sidebar_right_open_replace' => '<aside  id="[id]" class="" role="complementary" itemscope itemtype="[itemtype]" >',
561
-        'geodir_sidebar_right_close_replace' => '</aside><!-- sidebar ends here--></div></div>',
562
-        'geodir_sidebar_left_open_id' => 'sidebar',
563
-        'geodir_sidebar_left_open_class' => '',
564
-        'geodir_sidebar_left_open_replace' => '<aside  id="[id]" class="" role="complementary" itemscope itemtype="[itemtype]" >',
565
-        'geodir_sidebar_left_close_replace' => '</aside><!-- sidebar ends here--></div></div>',
566
-        'geodir_main_content_open_id' => '',
567
-        'geodir_main_content_open_class' => '',
568
-        'geodir_main_content_open_replace' => '',
569
-        'geodir_main_content_close_replace' => '',
570
-        'geodir_top_content_add' => '',
571
-        'geodir_before_main_content_add' => '',
572
-        'geodir_before_widget_filter' => '',
573
-        'geodir_after_widget_filter' => '',
574
-        'geodir_theme_compat_css' => stripslashes('#left-area ul.geodir-direction-nav{list-style-type:none}#sidebar .geodir-company_info{margin-left:30px}#sidebar .geodir-widget{float:none;margin:0 0 30px 30px}.geodir_full_page .geodir-loc-bar{padding:0;margin:0;border:none}.geodir_full_page .geodir-category-list-in{margin-top:0}.geodir_full_page .top_banner_section{margin-bottom:0}.archive .entry-header,.geodir-breadcrumb{border-bottom:1px solid #e2e2e2}.archive .entry-header h1,ul#breadcrumbs{margin:0 auto;width:1080px}#left-area ul.geodir_category_list_view{padding:10px 0}.nav li#menu-item-gd-location-switcher ul{width:222px}#menu-item-gd-location-switcher li.gd-location-switcher-menu-item{padding-right:0}#menu-item-gd-location-switcher dd{margin-left:0}#menu-item-gd-location-switcher .geodir_location_tab_container dd a{padding:5px;width:auto}@media only screen and ( max-width: 980px ){.geodir-loc-bar-in,.geodir-cat-list,ul#breadcrumbs{width:690px}}@media only screen and ( max-width: 767px ){.geodir-loc-bar-in,.geodir-cat-list,ul#breadcrumbs{width:400px}}@media only screen and ( max-width: 479px ){.geodir-loc-bar-in,.geodir-cat-list,ul#breadcrumbs{width:280px}}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}'),
575
-        'geodir_theme_compat_js' => '',
576
-        'geodir_theme_compat_default_options' => '',
577
-        'geodir_theme_compat_code' => 'Divi'
578
-    );
545
+	$theme_compat['Divi'] = array(
546
+		'geodir_wrapper_open_id' => 'main-content',
547
+		'geodir_wrapper_open_class' => '',
548
+		'geodir_wrapper_open_replace' => '',
549
+		'geodir_wrapper_close_replace' => '',
550
+		'geodir_wrapper_content_open_id' => 'left-area',
551
+		'geodir_wrapper_content_open_class' => '',
552
+		'geodir_wrapper_content_open_replace' => '<div class="container"><div id="content-area" class="clearfix"><div id="[id]" class="[class]" role="main" >',
553
+		'geodir_wrapper_content_close_replace' => '',
554
+		'geodir_article_open_id' => '',
555
+		'geodir_article_open_class' => '',
556
+		'geodir_article_open_replace' => '',
557
+		'geodir_article_close_replace' => '',
558
+		'geodir_sidebar_right_open_id' => 'sidebar',
559
+		'geodir_sidebar_right_open_class' => '',
560
+		'geodir_sidebar_right_open_replace' => '<aside  id="[id]" class="" role="complementary" itemscope itemtype="[itemtype]" >',
561
+		'geodir_sidebar_right_close_replace' => '</aside><!-- sidebar ends here--></div></div>',
562
+		'geodir_sidebar_left_open_id' => 'sidebar',
563
+		'geodir_sidebar_left_open_class' => '',
564
+		'geodir_sidebar_left_open_replace' => '<aside  id="[id]" class="" role="complementary" itemscope itemtype="[itemtype]" >',
565
+		'geodir_sidebar_left_close_replace' => '</aside><!-- sidebar ends here--></div></div>',
566
+		'geodir_main_content_open_id' => '',
567
+		'geodir_main_content_open_class' => '',
568
+		'geodir_main_content_open_replace' => '',
569
+		'geodir_main_content_close_replace' => '',
570
+		'geodir_top_content_add' => '',
571
+		'geodir_before_main_content_add' => '',
572
+		'geodir_before_widget_filter' => '',
573
+		'geodir_after_widget_filter' => '',
574
+		'geodir_theme_compat_css' => stripslashes('#left-area ul.geodir-direction-nav{list-style-type:none}#sidebar .geodir-company_info{margin-left:30px}#sidebar .geodir-widget{float:none;margin:0 0 30px 30px}.geodir_full_page .geodir-loc-bar{padding:0;margin:0;border:none}.geodir_full_page .geodir-category-list-in{margin-top:0}.geodir_full_page .top_banner_section{margin-bottom:0}.archive .entry-header,.geodir-breadcrumb{border-bottom:1px solid #e2e2e2}.archive .entry-header h1,ul#breadcrumbs{margin:0 auto;width:1080px}#left-area ul.geodir_category_list_view{padding:10px 0}.nav li#menu-item-gd-location-switcher ul{width:222px}#menu-item-gd-location-switcher li.gd-location-switcher-menu-item{padding-right:0}#menu-item-gd-location-switcher dd{margin-left:0}#menu-item-gd-location-switcher .geodir_location_tab_container dd a{padding:5px;width:auto}@media only screen and ( max-width: 980px ){.geodir-loc-bar-in,.geodir-cat-list,ul#breadcrumbs{width:690px}}@media only screen and ( max-width: 767px ){.geodir-loc-bar-in,.geodir-cat-list,ul#breadcrumbs{width:400px}}@media only screen and ( max-width: 479px ){.geodir-loc-bar-in,.geodir-cat-list,ul#breadcrumbs{width:280px}}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}'),
575
+		'geodir_theme_compat_js' => '',
576
+		'geodir_theme_compat_default_options' => '',
577
+		'geodir_theme_compat_code' => 'Divi'
578
+	);
579 579
 
580 580
 // Genesis
581
-    $theme_compat['Genesis'] = array(
582
-        'geodir_wrapper_open_id' => '',
583
-        'geodir_wrapper_open_class' => 'content-sidebar-wrap',
584
-        'geodir_wrapper_open_replace' => '',
585
-        'geodir_wrapper_close_replace' => '',
586
-        'geodir_wrapper_content_open_id' => '',
587
-        'geodir_wrapper_content_open_class' => 'content',
588
-        'geodir_wrapper_content_open_replace' => '<div class="[class]" role="main" >',
589
-        'geodir_wrapper_content_close_replace' => '',
590
-        'geodir_article_open_id' => '',
591
-        'geodir_article_open_class' => '',
592
-        'geodir_article_open_replace' => '',
593
-        'geodir_article_close_replace' => '',
594
-        'geodir_sidebar_right_open_id' => '',
595
-        'geodir_sidebar_right_open_class' => 'sidebar sidebar-primary widget-area',
596
-        'geodir_sidebar_right_open_replace' => '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]">',
597
-        'geodir_sidebar_right_close_replace' => '',
598
-        'geodir_sidebar_left_open_id' => '',
599
-        'geodir_sidebar_left_open_class' => 'sidebar sidebar-secondary widget-area',
600
-        'geodir_sidebar_left_open_replace' => '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]">',
601
-        'geodir_sidebar_left_close_replace' => '',
602
-        'geodir_main_content_open_id' => '',
603
-        'geodir_main_content_open_class' => '',
604
-        'geodir_main_content_open_replace' => '<main  id="[id]" class="entry [class]"  role="main">',
605
-        'geodir_main_content_close_replace' => '',
606
-        'geodir_top_content_add' => '',
607
-        'geodir_before_main_content_add' => '',
608
-        'geodir_before_widget_filter' => '',
609
-        'geodir_after_widget_filter' => '',
610
-        'geodir_location_switcher_menu_li_class_filter' => 'menu-item menu-item-gd-location-switcher menu-item-has-children gd-location-switcher',
611
-        'geodir_theme_compat_css' => stripslashes('.full-width-content #geodir-wrapper-content{width:100%}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}.content{float:left}.sidebar-content .content,.sidebar-content #geodir-wrapper-content{float:right}.sidebar .geodir-company_info{background-color:#fff;border:none}.geodir_full_page .geodir-loc-bar{padding:0;margin:0;border:none}.geodir_full_page .geodir-category-list-in{margin-top:0}.geodir_full_page .top_banner_section{margin-bottom:0}.geodir-breadcrumb-bar{margin-bottom:-35px} .search-page .entry-title,.listings-page .entry-title{font-size: 20px;}.site-inner .geodir-breadcrumb-bar{margin-bottom:0px}'),
612
-        'geodir_theme_compat_js' => '',
613
-        'geodir_theme_compat_default_options' => '',
614
-        'geodir_theme_compat_code' => 'Genesis'
615
-    );
581
+	$theme_compat['Genesis'] = array(
582
+		'geodir_wrapper_open_id' => '',
583
+		'geodir_wrapper_open_class' => 'content-sidebar-wrap',
584
+		'geodir_wrapper_open_replace' => '',
585
+		'geodir_wrapper_close_replace' => '',
586
+		'geodir_wrapper_content_open_id' => '',
587
+		'geodir_wrapper_content_open_class' => 'content',
588
+		'geodir_wrapper_content_open_replace' => '<div class="[class]" role="main" >',
589
+		'geodir_wrapper_content_close_replace' => '',
590
+		'geodir_article_open_id' => '',
591
+		'geodir_article_open_class' => '',
592
+		'geodir_article_open_replace' => '',
593
+		'geodir_article_close_replace' => '',
594
+		'geodir_sidebar_right_open_id' => '',
595
+		'geodir_sidebar_right_open_class' => 'sidebar sidebar-primary widget-area',
596
+		'geodir_sidebar_right_open_replace' => '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]">',
597
+		'geodir_sidebar_right_close_replace' => '',
598
+		'geodir_sidebar_left_open_id' => '',
599
+		'geodir_sidebar_left_open_class' => 'sidebar sidebar-secondary widget-area',
600
+		'geodir_sidebar_left_open_replace' => '<aside  id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]">',
601
+		'geodir_sidebar_left_close_replace' => '',
602
+		'geodir_main_content_open_id' => '',
603
+		'geodir_main_content_open_class' => '',
604
+		'geodir_main_content_open_replace' => '<main  id="[id]" class="entry [class]"  role="main">',
605
+		'geodir_main_content_close_replace' => '',
606
+		'geodir_top_content_add' => '',
607
+		'geodir_before_main_content_add' => '',
608
+		'geodir_before_widget_filter' => '',
609
+		'geodir_after_widget_filter' => '',
610
+		'geodir_location_switcher_menu_li_class_filter' => 'menu-item menu-item-gd-location-switcher menu-item-has-children gd-location-switcher',
611
+		'geodir_theme_compat_css' => stripslashes('.full-width-content #geodir-wrapper-content{width:100%}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}.content{float:left}.sidebar-content .content,.sidebar-content #geodir-wrapper-content{float:right}.sidebar .geodir-company_info{background-color:#fff;border:none}.geodir_full_page .geodir-loc-bar{padding:0;margin:0;border:none}.geodir_full_page .geodir-category-list-in{margin-top:0}.geodir_full_page .top_banner_section{margin-bottom:0}.geodir-breadcrumb-bar{margin-bottom:-35px} .search-page .entry-title,.listings-page .entry-title{font-size: 20px;}.site-inner .geodir-breadcrumb-bar{margin-bottom:0px}'),
612
+		'geodir_theme_compat_js' => '',
613
+		'geodir_theme_compat_default_options' => '',
614
+		'geodir_theme_compat_code' => 'Genesis'
615
+	);
616 616
 
617 617
 // Jupiter
618
-    $theme_compat['Jupiter'] = array(
619
-        'geodir_wrapper_open_id' => '',
620
-        'geodir_wrapper_open_class' => '',
621
-        'geodir_wrapper_open_replace' => '<div id="theme-page"><div class="mk-main-wrapper-holder"><div  class="theme-page-wrapper mk-main-wrapper  mk-grid vc_row-fluid">',
622
-        'geodir_wrapper_close_replace' => '</div></div></div>',
623
-        'geodir_wrapper_content_open_id' => '',
624
-        'geodir_wrapper_content_open_class' => '',
625
-        'geodir_wrapper_content_open_replace' => '',
626
-        'geodir_wrapper_content_close_replace' => '',
627
-        'geodir_article_open_id' => '',
628
-        'geodir_article_open_class' => '',
629
-        'geodir_article_open_replace' => '',
630
-        'geodir_article_close_replace' => '',
631
-        'geodir_sidebar_right_open_id' => 'mk-sidebar',
632
-        'geodir_sidebar_right_open_class' => 'mk-builtin geodir-sidebar-right geodir-listings-sidebar-right',
633
-        'geodir_sidebar_right_open_replace' => '',
634
-        'geodir_sidebar_right_close_replace' => '',
635
-        'geodir_sidebar_left_open_id' => 'mk-sidebar',
636
-        'geodir_sidebar_left_open_class' => 'mk-builtin geodir-sidebar-right geodir-listings-sidebar-right',
637
-        'geodir_sidebar_left_open_replace' => '',
638
-        'geodir_sidebar_left_close_replace' => '',
639
-        'geodir_main_content_open_id' => '',
640
-        'geodir_main_content_open_class' => '',
641
-        'geodir_main_content_open_replace' => '',
642
-        'geodir_main_content_close_replace' => '',
643
-        'geodir_top_content_add' => '',
644
-        'geodir_before_main_content_add' => '',
645
-        'geodir_before_widget_filter' => '',
646
-        'geodir_after_widget_filter' => '',
647
-        'geodir_before_title_filter' => '<h3 class="widgettitle geodir-widget-title">',
648
-        'geodir_after_title_filter' => '',
649
-        'geodir_menu_li_class_filter' => 'menu-item menu-item-has-children no-mega-menu',
650
-        'geodir_sub_menu_ul_class_filter' => '',
651
-        'geodir_sub_menu_li_class_filter' => '',
652
-        'geodir_menu_a_class_filter' => 'menu-item-link',
653
-        'geodir_sub_menu_a_class_filter' => 'menu-item-link one-page-nav-item',
654
-        'geodir_location_switcher_menu_li_class_filter' => 'menu-item menu-item-type-social menu-item-type-social gd-location-switcher menu-item-has-children no-mega-menu',
655
-        'geodir_location_switcher_menu_a_class_filter' => 'menu-item-link',
656
-        'geodir_location_switcher_menu_sub_ul_class_filter' => '',
657
-        'geodir_location_switcher_menu_sub_li_class_filter' => '',
658
-        'geodir_theme_compat_css' => stripslashes('.geodir-widget li,.geodir_category_list_view li{margin:0}#theme-page h3.geodir-entry-title{font-size:14px}#menu-item-gd-location-switcher dd{line-height:44px}#menu-item-gd-location-switcher .geodir_location_sugestion{line-height:20px}.geodir_loginbox{overflow:visible}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}'),
659
-        'geodir_theme_compat_js' => '',
660
-        'geodir_theme_compat_default_options' => '',
661
-        'geodir_theme_compat_code' => 'Jupiter'
662
-    );
618
+	$theme_compat['Jupiter'] = array(
619
+		'geodir_wrapper_open_id' => '',
620
+		'geodir_wrapper_open_class' => '',
621
+		'geodir_wrapper_open_replace' => '<div id="theme-page"><div class="mk-main-wrapper-holder"><div  class="theme-page-wrapper mk-main-wrapper  mk-grid vc_row-fluid">',
622
+		'geodir_wrapper_close_replace' => '</div></div></div>',
623
+		'geodir_wrapper_content_open_id' => '',
624
+		'geodir_wrapper_content_open_class' => '',
625
+		'geodir_wrapper_content_open_replace' => '',
626
+		'geodir_wrapper_content_close_replace' => '',
627
+		'geodir_article_open_id' => '',
628
+		'geodir_article_open_class' => '',
629
+		'geodir_article_open_replace' => '',
630
+		'geodir_article_close_replace' => '',
631
+		'geodir_sidebar_right_open_id' => 'mk-sidebar',
632
+		'geodir_sidebar_right_open_class' => 'mk-builtin geodir-sidebar-right geodir-listings-sidebar-right',
633
+		'geodir_sidebar_right_open_replace' => '',
634
+		'geodir_sidebar_right_close_replace' => '',
635
+		'geodir_sidebar_left_open_id' => 'mk-sidebar',
636
+		'geodir_sidebar_left_open_class' => 'mk-builtin geodir-sidebar-right geodir-listings-sidebar-right',
637
+		'geodir_sidebar_left_open_replace' => '',
638
+		'geodir_sidebar_left_close_replace' => '',
639
+		'geodir_main_content_open_id' => '',
640
+		'geodir_main_content_open_class' => '',
641
+		'geodir_main_content_open_replace' => '',
642
+		'geodir_main_content_close_replace' => '',
643
+		'geodir_top_content_add' => '',
644
+		'geodir_before_main_content_add' => '',
645
+		'geodir_before_widget_filter' => '',
646
+		'geodir_after_widget_filter' => '',
647
+		'geodir_before_title_filter' => '<h3 class="widgettitle geodir-widget-title">',
648
+		'geodir_after_title_filter' => '',
649
+		'geodir_menu_li_class_filter' => 'menu-item menu-item-has-children no-mega-menu',
650
+		'geodir_sub_menu_ul_class_filter' => '',
651
+		'geodir_sub_menu_li_class_filter' => '',
652
+		'geodir_menu_a_class_filter' => 'menu-item-link',
653
+		'geodir_sub_menu_a_class_filter' => 'menu-item-link one-page-nav-item',
654
+		'geodir_location_switcher_menu_li_class_filter' => 'menu-item menu-item-type-social menu-item-type-social gd-location-switcher menu-item-has-children no-mega-menu',
655
+		'geodir_location_switcher_menu_a_class_filter' => 'menu-item-link',
656
+		'geodir_location_switcher_menu_sub_ul_class_filter' => '',
657
+		'geodir_location_switcher_menu_sub_li_class_filter' => '',
658
+		'geodir_theme_compat_css' => stripslashes('.geodir-widget li,.geodir_category_list_view li{margin:0}#theme-page h3.geodir-entry-title{font-size:14px}#menu-item-gd-location-switcher dd{line-height:44px}#menu-item-gd-location-switcher .geodir_location_sugestion{line-height:20px}.geodir_loginbox{overflow:visible}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}'),
659
+		'geodir_theme_compat_js' => '',
660
+		'geodir_theme_compat_default_options' => '',
661
+		'geodir_theme_compat_code' => 'Jupiter'
662
+	);
663 663
 
664 664
 // Multi News
665
-    $theme_compat['Multi_News'] = array(
666
-        'geodir_wrapper_open_id' => '',
667
-        'geodir_wrapper_open_class' => 'main-container clearfix',
668
-        'geodir_wrapper_open_replace' => '',
669
-        'geodir_wrapper_close_replace' => '',
670
-        'geodir_wrapper_content_open_id' => '',
671
-        'geodir_wrapper_content_open_class' => '',
672
-        'geodir_wrapper_content_open_replace' => '<div class="main-left" ><div class="main-content  "><div class="site-content page-wrap">',
673
-        'geodir_wrapper_content_close_replace' => '</div></div></div>',
674
-        'geodir_article_open_id' => '',
675
-        'geodir_article_open_class' => '',
676
-        'geodir_article_open_replace' => '',
677
-        'geodir_article_close_replace' => '',
678
-        'geodir_sidebar_right_open_id' => '',
679
-        'geodir_sidebar_right_open_class' => '',
680
-        'geodir_sidebar_right_open_replace' => '<aside  class="sidebar" role="complementary" itemscope itemtype="[itemtype]" >',
681
-        'geodir_sidebar_right_close_replace' => '',
682
-        'geodir_sidebar_left_open_id' => '',
683
-        'geodir_sidebar_left_open_class' => '',
684
-        'geodir_sidebar_left_open_replace' => '<aside  class="secondary-sidebar" role="complementary" itemscope itemtype="[itemtype]" >',
685
-        'geodir_sidebar_left_close_replace' => '',
686
-        'geodir_main_content_open_id' => '',
687
-        'geodir_main_content_open_class' => '',
688
-        'geodir_main_content_open_replace' => '<div class="site-content page-wrap">',
689
-        'geodir_main_content_close_replace' => '</div>',
690
-        'geodir_top_content_add' => '',
691
-        'geodir_before_main_content_add' => '',
692
-        'geodir_full_page_class_filter' => 'section full-width-section',
693
-        'geodir_before_widget_filter' => '',
694
-        'geodir_after_widget_filter' => '',
695
-        'geodir_before_title_filter' => '<div class="widget-title"><h2>',
696
-        'geodir_after_title_filter' => '</h2></div>',
697
-        'geodir_menu_li_class_filter' => '',
698
-        'geodir_sub_menu_ul_class_filter' => '',
699
-        'geodir_sub_menu_li_class_filter' => '',
700
-        'geodir_menu_a_class_filter' => '',
701
-        'geodir_sub_menu_a_class_filter' => '',
702
-        'geodir_location_switcher_menu_li_class_filter' => '',
703
-        'geodir_location_switcher_menu_a_class_filter' => '',
704
-        'geodir_location_switcher_menu_sub_ul_class_filter' => '',
705
-        'geodir_location_switcher_menu_sub_li_class_filter' => '',
706
-        'geodir_theme_compat_css' => stripslashes('.full-width-section .geodir-search{margin:0;width:100%}.geodir_full_page .geodir-search{margin:0 auto;float:none}.geodir-search input[type=button],.geodir-search input[type=submit]{width:13%}.geodir-search input[type=text]{border:1px solid #ddd;border-radius:0;padding:0 8px}.geodir-category-list-in,.geodir-loc-bar-in{background:#f2f2f2;border-color:#dbdbdb}.geodir-category-list-in{margin-top:0}.geodir-cat-list .widget-title h2{margin:-13px -13px 13px}.widget .geodir-cat-list ul li.geodir-pcat-show a:before{display:none!important}.widget .geodir-cat-list ul li.geodir-pcat-show i{margin-right:5px}.container .geodir-search select{margin:0 3% 0 0;padding:8px 10px;width:13%}#geodir_carousel,#geodir_slider{border-radius:0;-webkit-border-radius:0;-moz-border-radius:0;margin-bottom:20px!important;border:1px solid #e1e1e1;box-shadow:none}#geodir_carousel{padding:10px}.geodir-tabs-content ol.commentlist{margin:40px 0;padding:0}li#post_mapTab{min-height:400px}#reviewsTab ol.commentlist li{border-bottom:none}#reviewsTab ol.commentlist li article.comment{border-bottom:1px solid #e1e1e1;padding-bottom:10px}.comment-content .rating{display:none}.comment-respond .gd_rating{margin-bottom:20px}div.geodir-rating{width:85px!important}.comment-respond .comment-notes{margin-bottom:10px}.average-review span,.comment-form label,.dtreviewed,.geodir-details-sidebar-user-links a,.geodir-viewall,.geodir_more_info span,.reviewer,dl.geodir-tab-head dd a{font-family:"Archivo Narrow",sans-serif}section.comment-content{margin:0 0 0 12%}#reviewsTab .comments-area .comment-content{width:auto}section.comment-content .description,section.comment-content p{margin:15px 0}dl.geodir-tab-head dd a{background:#f3f3f3;margin-top:-1px;font-size:14px;padding:0 15px}dl.geodir-tab-head dd.geodir-tab-active a{padding-bottom:1px}.geodir-widget .geodir_list_heading,.geodir-widget h3.widget-title{padding:0 15px;background:#e9e9e9;border:1px solid #dbdbdb;height:38px;line-height:38px;color:#2d2d2d}.geodir-widget .geodir_list_heading h3{background:0 0;border:none}.geodir-widget .geodir_list_heading{margin:-13px -14px 13px}.geodir-map-listing-page{border-width:1px 0 0;border-style:solid;border-color:#dbdbdb}.geodir-sidebar-wrap .geodir-company_info{margin:15px}.geodir-details-sidebar-social-sharing iframe{float:left}.geodir-details-sidebar-rating{overflow:hidden}.geodir-details-sidebar-rating .gd_rating_show,.geodir-details-sidebar-rating .geodir-rating{float:left;margin-right:15px}.geodir-details-sidebar-rating span.item{float:left;margin-top:5px}.geodir-details-sidebar-rating .average-review{top:-4px;position:relative}.geodir-details-sidebar-rating span.item img{margin-top:5px}.geodir_full_page{background:#fff;border:1px solid #e1e1e1;-webkit-box-shadow:0 1px 0 #e5e5e5;box-shadow:0 1px 0 #e5e5e5;padding:15px;margin-bottom:20px;clear:both}.geodir_map_container .main_list img{margin:0 5px}.geodir_category_list_view li.geodir-gridview .geodir-post-img .geodir_thumbnail{margin-bottom:10px}.geodir-addinfo .geodir-pinpoint,.geodir-addinfo a i{margin-right:5px}.geodir_category_list_view li.geodir-gridview h3{font-size:18px;margin-bottom:10px}#related_listingTab ul.geodir_category_list_view{padding:0!important}#reviewsTab #comments .gd_rating{margin-top:5px}.widget .geodir_category_list_view li .geodir-entry-content,.widget .geodir_category_list_view li a:before{display:none!important}.geodir_category_list_view li .geodir-entry-title{margin-bottom:10px}.widget ul.geodir_category_list_view{padding:15px}.sidebar .widget .geodir_category_list_view li{width:calc(100% - 25px)}.widget .geodir-loginbox-list li{overflow:visible!important}.widget ul.chosen-results{margin:0!important}.main_list_selecter{margin-right:5px}.geodir-viewall{float:right;width:auto!important}.widget-title h2{padding:0 15px;background:#e9e9e9;border:1px solid #dbdbdb;height:38px;line-height:38px}.widget:first-child .geodir_list_heading .widget-title{margin-top:0}.geodir_list_heading .widget-title{float:left;width:80%;margin-top:0}.geodir_list_heading .widget-title h2{padding:0 px;background:0 0;border:none;height:auto;line-height:auto}.chosen-default:before{content:none;display:none;position:absolute;margin-left:-1000000px;float:left}#geodir-wrapper .entry-crumbs{margin-bottom:20px}.geodir-search .mom-select{float:left;width:150px;margin:5px;border:1px solid #ddd;height:40px}.iprelative .gm-style .gm-style-iw{width:100%!important}'),
707
-        'geodir_theme_compat_js' => 'jQuery(document).ready(function(e){e(".geodir_full_page").length&&""===e.trim(e(".geodir_full_page").html())&&e(".geodir_full_page").css({display:"none"})});',
708
-        'geodir_theme_compat_default_options' => '',
709
-        'geodir_theme_compat_code' => 'Multi_News'
710
-    );
711
-
712
-    update_option('gd_theme_compats', $theme_compat);
713
-
714
-    gd_set_theme_compat();// set the compat pack if avail
665
+	$theme_compat['Multi_News'] = array(
666
+		'geodir_wrapper_open_id' => '',
667
+		'geodir_wrapper_open_class' => 'main-container clearfix',
668
+		'geodir_wrapper_open_replace' => '',
669
+		'geodir_wrapper_close_replace' => '',
670
+		'geodir_wrapper_content_open_id' => '',
671
+		'geodir_wrapper_content_open_class' => '',
672
+		'geodir_wrapper_content_open_replace' => '<div class="main-left" ><div class="main-content  "><div class="site-content page-wrap">',
673
+		'geodir_wrapper_content_close_replace' => '</div></div></div>',
674
+		'geodir_article_open_id' => '',
675
+		'geodir_article_open_class' => '',
676
+		'geodir_article_open_replace' => '',
677
+		'geodir_article_close_replace' => '',
678
+		'geodir_sidebar_right_open_id' => '',
679
+		'geodir_sidebar_right_open_class' => '',
680
+		'geodir_sidebar_right_open_replace' => '<aside  class="sidebar" role="complementary" itemscope itemtype="[itemtype]" >',
681
+		'geodir_sidebar_right_close_replace' => '',
682
+		'geodir_sidebar_left_open_id' => '',
683
+		'geodir_sidebar_left_open_class' => '',
684
+		'geodir_sidebar_left_open_replace' => '<aside  class="secondary-sidebar" role="complementary" itemscope itemtype="[itemtype]" >',
685
+		'geodir_sidebar_left_close_replace' => '',
686
+		'geodir_main_content_open_id' => '',
687
+		'geodir_main_content_open_class' => '',
688
+		'geodir_main_content_open_replace' => '<div class="site-content page-wrap">',
689
+		'geodir_main_content_close_replace' => '</div>',
690
+		'geodir_top_content_add' => '',
691
+		'geodir_before_main_content_add' => '',
692
+		'geodir_full_page_class_filter' => 'section full-width-section',
693
+		'geodir_before_widget_filter' => '',
694
+		'geodir_after_widget_filter' => '',
695
+		'geodir_before_title_filter' => '<div class="widget-title"><h2>',
696
+		'geodir_after_title_filter' => '</h2></div>',
697
+		'geodir_menu_li_class_filter' => '',
698
+		'geodir_sub_menu_ul_class_filter' => '',
699
+		'geodir_sub_menu_li_class_filter' => '',
700
+		'geodir_menu_a_class_filter' => '',
701
+		'geodir_sub_menu_a_class_filter' => '',
702
+		'geodir_location_switcher_menu_li_class_filter' => '',
703
+		'geodir_location_switcher_menu_a_class_filter' => '',
704
+		'geodir_location_switcher_menu_sub_ul_class_filter' => '',
705
+		'geodir_location_switcher_menu_sub_li_class_filter' => '',
706
+		'geodir_theme_compat_css' => stripslashes('.full-width-section .geodir-search{margin:0;width:100%}.geodir_full_page .geodir-search{margin:0 auto;float:none}.geodir-search input[type=button],.geodir-search input[type=submit]{width:13%}.geodir-search input[type=text]{border:1px solid #ddd;border-radius:0;padding:0 8px}.geodir-category-list-in,.geodir-loc-bar-in{background:#f2f2f2;border-color:#dbdbdb}.geodir-category-list-in{margin-top:0}.geodir-cat-list .widget-title h2{margin:-13px -13px 13px}.widget .geodir-cat-list ul li.geodir-pcat-show a:before{display:none!important}.widget .geodir-cat-list ul li.geodir-pcat-show i{margin-right:5px}.container .geodir-search select{margin:0 3% 0 0;padding:8px 10px;width:13%}#geodir_carousel,#geodir_slider{border-radius:0;-webkit-border-radius:0;-moz-border-radius:0;margin-bottom:20px!important;border:1px solid #e1e1e1;box-shadow:none}#geodir_carousel{padding:10px}.geodir-tabs-content ol.commentlist{margin:40px 0;padding:0}li#post_mapTab{min-height:400px}#reviewsTab ol.commentlist li{border-bottom:none}#reviewsTab ol.commentlist li article.comment{border-bottom:1px solid #e1e1e1;padding-bottom:10px}.comment-content .rating{display:none}.comment-respond .gd_rating{margin-bottom:20px}div.geodir-rating{width:85px!important}.comment-respond .comment-notes{margin-bottom:10px}.average-review span,.comment-form label,.dtreviewed,.geodir-details-sidebar-user-links a,.geodir-viewall,.geodir_more_info span,.reviewer,dl.geodir-tab-head dd a{font-family:"Archivo Narrow",sans-serif}section.comment-content{margin:0 0 0 12%}#reviewsTab .comments-area .comment-content{width:auto}section.comment-content .description,section.comment-content p{margin:15px 0}dl.geodir-tab-head dd a{background:#f3f3f3;margin-top:-1px;font-size:14px;padding:0 15px}dl.geodir-tab-head dd.geodir-tab-active a{padding-bottom:1px}.geodir-widget .geodir_list_heading,.geodir-widget h3.widget-title{padding:0 15px;background:#e9e9e9;border:1px solid #dbdbdb;height:38px;line-height:38px;color:#2d2d2d}.geodir-widget .geodir_list_heading h3{background:0 0;border:none}.geodir-widget .geodir_list_heading{margin:-13px -14px 13px}.geodir-map-listing-page{border-width:1px 0 0;border-style:solid;border-color:#dbdbdb}.geodir-sidebar-wrap .geodir-company_info{margin:15px}.geodir-details-sidebar-social-sharing iframe{float:left}.geodir-details-sidebar-rating{overflow:hidden}.geodir-details-sidebar-rating .gd_rating_show,.geodir-details-sidebar-rating .geodir-rating{float:left;margin-right:15px}.geodir-details-sidebar-rating span.item{float:left;margin-top:5px}.geodir-details-sidebar-rating .average-review{top:-4px;position:relative}.geodir-details-sidebar-rating span.item img{margin-top:5px}.geodir_full_page{background:#fff;border:1px solid #e1e1e1;-webkit-box-shadow:0 1px 0 #e5e5e5;box-shadow:0 1px 0 #e5e5e5;padding:15px;margin-bottom:20px;clear:both}.geodir_map_container .main_list img{margin:0 5px}.geodir_category_list_view li.geodir-gridview .geodir-post-img .geodir_thumbnail{margin-bottom:10px}.geodir-addinfo .geodir-pinpoint,.geodir-addinfo a i{margin-right:5px}.geodir_category_list_view li.geodir-gridview h3{font-size:18px;margin-bottom:10px}#related_listingTab ul.geodir_category_list_view{padding:0!important}#reviewsTab #comments .gd_rating{margin-top:5px}.widget .geodir_category_list_view li .geodir-entry-content,.widget .geodir_category_list_view li a:before{display:none!important}.geodir_category_list_view li .geodir-entry-title{margin-bottom:10px}.widget ul.geodir_category_list_view{padding:15px}.sidebar .widget .geodir_category_list_view li{width:calc(100% - 25px)}.widget .geodir-loginbox-list li{overflow:visible!important}.widget ul.chosen-results{margin:0!important}.main_list_selecter{margin-right:5px}.geodir-viewall{float:right;width:auto!important}.widget-title h2{padding:0 15px;background:#e9e9e9;border:1px solid #dbdbdb;height:38px;line-height:38px}.widget:first-child .geodir_list_heading .widget-title{margin-top:0}.geodir_list_heading .widget-title{float:left;width:80%;margin-top:0}.geodir_list_heading .widget-title h2{padding:0 px;background:0 0;border:none;height:auto;line-height:auto}.chosen-default:before{content:none;display:none;position:absolute;margin-left:-1000000px;float:left}#geodir-wrapper .entry-crumbs{margin-bottom:20px}.geodir-search .mom-select{float:left;width:150px;margin:5px;border:1px solid #ddd;height:40px}.iprelative .gm-style .gm-style-iw{width:100%!important}'),
707
+		'geodir_theme_compat_js' => 'jQuery(document).ready(function(e){e(".geodir_full_page").length&&""===e.trim(e(".geodir_full_page").html())&&e(".geodir_full_page").css({display:"none"})});',
708
+		'geodir_theme_compat_default_options' => '',
709
+		'geodir_theme_compat_code' => 'Multi_News'
710
+	);
711
+
712
+	update_option('gd_theme_compats', $theme_compat);
713
+
714
+	gd_set_theme_compat();// set the compat pack if avail
715 715
 }
716 716
 
717 717
 
@@ -723,61 +723,61 @@  discard block
 block discarded – undo
723 723
  * @global object $wpdb WordPress Database object.
724 724
  */
725 725
 function gd_convert_virtual_pages(){
726
-    global $wpdb;
727
-
728
-    // Update the add listing page settings
729
-    $add_listing_page = $wpdb->get_var(
730
-        $wpdb->prepare(
731
-            "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
732
-            array('add-listing')
733
-        )
734
-    );
735
-
736
-    if($add_listing_page){
737
-        wp_update_post( array('ID' => $add_listing_page, 'post_status' => 'publish') );
738
-        update_option( 'geodir_add_listing_page', $add_listing_page);
739
-    }
740
-
741
-    // Update the listing preview page settings
742
-    $listing_preview_page = $wpdb->get_var(
743
-        $wpdb->prepare(
744
-            "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
745
-            array('listing-preview')
746
-        )
747
-    );
748
-
749
-    if($listing_preview_page){
750
-        wp_update_post( array('ID' => $listing_preview_page, 'post_status' => 'publish') );
751
-        update_option( 'geodir_preview_page', $listing_preview_page);
752
-    }
753
-
754
-    // Update the listing success page settings
755
-    $listing_success_page = $wpdb->get_var(
756
-        $wpdb->prepare(
757
-            "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
758
-            array('listing-success')
759
-        )
760
-    );
761
-
762
-    if($listing_success_page){
763
-        wp_update_post( array('ID' => $listing_success_page, 'post_status' => 'publish') );
764
-        update_option( 'geodir_success_page', $listing_success_page);
765
-    }
766
-
767
-    // Update the listing success page settings
768
-    $location_page = $wpdb->get_var(
769
-        $wpdb->prepare(
770
-            "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
771
-            array('location')
772
-        )
773
-    );
774
-
775
-    if($location_page){
776
-        $location_slug = get_option('geodir_location_prefix');
777
-        if(!$location_slug ){$location_slug  = 'location';}
778
-        wp_update_post( array('ID' => $location_page, 'post_status' => 'publish','post_name' => $location_slug) );
779
-        update_option( 'geodir_location_page', $location_page);
780
-    }
726
+	global $wpdb;
727
+
728
+	// Update the add listing page settings
729
+	$add_listing_page = $wpdb->get_var(
730
+		$wpdb->prepare(
731
+			"SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
732
+			array('add-listing')
733
+		)
734
+	);
735
+
736
+	if($add_listing_page){
737
+		wp_update_post( array('ID' => $add_listing_page, 'post_status' => 'publish') );
738
+		update_option( 'geodir_add_listing_page', $add_listing_page);
739
+	}
740
+
741
+	// Update the listing preview page settings
742
+	$listing_preview_page = $wpdb->get_var(
743
+		$wpdb->prepare(
744
+			"SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
745
+			array('listing-preview')
746
+		)
747
+	);
748
+
749
+	if($listing_preview_page){
750
+		wp_update_post( array('ID' => $listing_preview_page, 'post_status' => 'publish') );
751
+		update_option( 'geodir_preview_page', $listing_preview_page);
752
+	}
753
+
754
+	// Update the listing success page settings
755
+	$listing_success_page = $wpdb->get_var(
756
+		$wpdb->prepare(
757
+			"SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
758
+			array('listing-success')
759
+		)
760
+	);
761
+
762
+	if($listing_success_page){
763
+		wp_update_post( array('ID' => $listing_success_page, 'post_status' => 'publish') );
764
+		update_option( 'geodir_success_page', $listing_success_page);
765
+	}
766
+
767
+	// Update the listing success page settings
768
+	$location_page = $wpdb->get_var(
769
+		$wpdb->prepare(
770
+			"SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;",
771
+			array('location')
772
+		)
773
+	);
774
+
775
+	if($location_page){
776
+		$location_slug = get_option('geodir_location_prefix');
777
+		if(!$location_slug ){$location_slug  = 'location';}
778
+		wp_update_post( array('ID' => $location_page, 'post_status' => 'publish','post_name' => $location_slug) );
779
+		update_option( 'geodir_location_page', $location_page);
780
+	}
781 781
 
782 782
 }
783 783
 
@@ -791,31 +791,31 @@  discard block
 block discarded – undo
791 791
 function gd_fix_cpt_rewrite_slug()
792 792
 {
793 793
 
794
-    $alt_post_types = array();
795
-    $post_types = get_option('geodir_post_types');
794
+	$alt_post_types = array();
795
+	$post_types = get_option('geodir_post_types');
796 796
 
797 797
 
798
-    if (is_array($post_types)){
798
+	if (is_array($post_types)){
799 799
 
800
-        foreach ($post_types as $post_type => $args) {
800
+		foreach ($post_types as $post_type => $args) {
801 801
 
802 802
 
803
-            if(isset($args['rewrite']['slug'])){
804
-                $args['rewrite']['slug'] = str_replace("/%gd_taxonomy%","",$args['rewrite']['slug']);
805
-            }
803
+			if(isset($args['rewrite']['slug'])){
804
+				$args['rewrite']['slug'] = str_replace("/%gd_taxonomy%","",$args['rewrite']['slug']);
805
+			}
806 806
 
807
-                $alt_post_types[$post_type] = $args;
807
+				$alt_post_types[$post_type] = $args;
808 808
 
809
-        }
810
-    }
809
+		}
810
+	}
811 811
 
812
-    if(!empty($alt_post_types)) {
813
-        update_option('geodir_post_types',$alt_post_types);
814
-        }
812
+	if(!empty($alt_post_types)) {
813
+		update_option('geodir_post_types',$alt_post_types);
814
+		}
815 815
 
816 816
 
817
-    // flush the rewrite rules
818
-    flush_rewrite_rules();
817
+	// flush the rewrite rules
818
+	flush_rewrite_rules();
819 819
 }
820 820
 
821 821
 
@@ -828,18 +828,18 @@  discard block
 block discarded – undo
828 828
  */
829 829
 function gd_fix_address_detail_table_limit()
830 830
 {
831
-    global $wpdb;
832
-
833
-    $all_postypes = geodir_get_posttypes();
834
-
835
-    if (!empty($all_postypes)) {
836
-        foreach ($all_postypes as $key) {
837
-            // update each GD CTP
838
-            try {
839
-                $wpdb->query("ALTER TABLE " . $wpdb->prefix . "geodir_" . $key . "_detail MODIFY post_city VARCHAR( 50 ) NULL,MODIFY post_region VARCHAR( 50 ) NULL,MODIFY post_country VARCHAR( 50 ) NULL");
840
-            } catch(Exception $e) {
841
-                error_log( 'Error: ' . $e->getMessage() );
842
-            }
843
-        }
844
-    }
831
+	global $wpdb;
832
+
833
+	$all_postypes = geodir_get_posttypes();
834
+
835
+	if (!empty($all_postypes)) {
836
+		foreach ($all_postypes as $key) {
837
+			// update each GD CTP
838
+			try {
839
+				$wpdb->query("ALTER TABLE " . $wpdb->prefix . "geodir_" . $key . "_detail MODIFY post_city VARCHAR( 50 ) NULL,MODIFY post_region VARCHAR( 50 ) NULL,MODIFY post_country VARCHAR( 50 ) NULL");
840
+			} catch(Exception $e) {
841
+				error_log( 'Error: ' . $e->getMessage() );
842
+			}
843
+		}
844
+	}
845 845
 }
Please login to merge, or discard this patch.
geodirectory-functions/custom_fields_output_functions.php 3 patches
Braces   +25 added lines, -38 removed lines patch added patch discarded remove patch
@@ -22,8 +22,7 @@  discard block
 block discarded – undo
22 22
 function geodir_cf_checkbox($html,$location,$cf,$p=''){
23 23
 
24 24
     // check we have the post value
25
-    if(is_int($p)){$post = geodir_get_post_info($p);}
26
-    else{ global $post;}
25
+    if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;}
27 26
 
28 27
     if(!is_array($cf) && $cf!=''){
29 28
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
@@ -76,8 +75,10 @@  discard block
 block discarded – undo
76 75
 
77 76
             if ( $post->{$html_var} == '1' ):
78 77
                 $html_val = __( 'Yes', 'geodirectory' );
79
-            else:
78
+            else {
79
+            	:
80 80
                 $html_val = __( 'No', 'geodirectory' );
81
+            }
81 82
             endif;
82 83
 
83 84
             $field_icon = geodir_field_icon_proccess($cf);
@@ -115,8 +116,7 @@  discard block
 block discarded – undo
115 116
 function geodir_cf_fieldset($html,$location,$cf,$p=''){
116 117
 
117 118
     // check we have the post value
118
-    if(is_int($p)){$post = geodir_get_post_info($p);}
119
-    else{ global $post;}
119
+    if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;}
120 120
 
121 121
     if(!is_array($cf) && $cf!=''){
122 122
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
@@ -195,8 +195,7 @@  discard block
 block discarded – undo
195 195
 function geodir_cf_url($html,$location,$cf,$p=''){
196 196
 
197 197
     // check we have the post value
198
-    if(is_int($p)){$post = geodir_get_post_info($p);}
199
-    else{ global $post;}
198
+    if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;}
200 199
 
201 200
     if(!is_array($cf) && $cf!=''){
202 201
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
@@ -310,8 +309,7 @@  discard block
 block discarded – undo
310 309
 function geodir_cf_phone($html,$location,$cf,$p=''){
311 310
 
312 311
     // check we have the post value
313
-    if(is_int($p)){$post = geodir_get_post_info($p);}
314
-    else{ global $post;}
312
+    if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;}
315 313
 
316 314
     if(!is_array($cf) && $cf!=''){
317 315
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
@@ -399,8 +397,7 @@  discard block
 block discarded – undo
399 397
 function geodir_cf_time($html,$location,$cf,$p=''){
400 398
 
401 399
     // check we have the post value
402
-    if(is_int($p)){$post = geodir_get_post_info($p);}
403
-    else{ global $post;}
400
+    if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;}
404 401
 
405 402
     if(!is_array($cf) && $cf!=''){
406 403
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
@@ -452,9 +449,10 @@  discard block
 block discarded – undo
452 449
         if ($post->{$cf['htmlvar_name']}):
453 450
 
454 451
             $value = '';
455
-            if ($post->{$cf['htmlvar_name']} != '')
456
-                //$value = date('h:i',strtotime($post->{$cf['htmlvar_name']}));
452
+            if ($post->{$cf['htmlvar_name']} != '') {
453
+                            //$value = date('h:i',strtotime($post->{$cf['htmlvar_name']}));
457 454
                 $value = date(get_option('time_format'), strtotime($post->{$cf['htmlvar_name']}));
455
+            }
458 456
 
459 457
             $field_icon = geodir_field_icon_proccess($cf);
460 458
             if (strpos($field_icon, 'http') !== false) {
@@ -493,8 +491,7 @@  discard block
 block discarded – undo
493 491
 function geodir_cf_datepicker($html,$location,$cf,$p=''){
494 492
 
495 493
     // check we have the post value
496
-    if(is_int($p)){$post = geodir_get_post_info($p);}
497
-    else{ global $post;}
494
+    if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;}
498 495
 
499 496
     if(!is_array($cf) && $cf!=''){
500 497
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
@@ -560,13 +557,13 @@  discard block
 block discarded – undo
560 557
                 $date_format = str_replace($search, $replace, $date_format);
561 558
 
562 559
                 $post_htmlvar_value = ($date_format == 'd/m/Y' || $date_format == 'j/n/Y' ) ? str_replace('/', '-', $post->{$cf['htmlvar_name']}) : $post->{$cf['htmlvar_name']}; // PHP doesn't work well with dd/mm/yyyy format
563
-            }else{
560
+            } else{
564 561
                 $post_htmlvar_value = $post->{$cf['htmlvar_name']};
565 562
             }
566 563
 
567 564
             if ($post->{$cf['htmlvar_name']} != '' && $post->{$cf['htmlvar_name']}!="0000-00-00") {
568 565
                 $value = date_i18n($date_format, strtotime($post_htmlvar_value));
569
-            }else{
566
+            } else{
570 567
                 return '';
571 568
             }
572 569
 
@@ -609,8 +606,7 @@  discard block
 block discarded – undo
609 606
 function geodir_cf_text($html,$location,$cf,$p=''){
610 607
 
611 608
     // check we have the post value
612
-    if(is_int($p)){$post = geodir_get_post_info($p);}
613
-    else{ global $post;}
609
+    if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;}
614 610
 
615 611
     if(!is_array($cf) && $cf!=''){
616 612
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
@@ -700,8 +696,7 @@  discard block
 block discarded – undo
700 696
 function geodir_cf_radio($html,$location,$cf,$p=''){
701 697
 
702 698
     // check we have the post value
703
-    if(is_int($p)){$post = geodir_get_post_info($p);}
704
-    else{ global $post;}
699
+    if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;}
705 700
 
706 701
     if(!is_array($cf) && $cf!=''){
707 702
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
@@ -807,8 +802,7 @@  discard block
 block discarded – undo
807 802
 function geodir_cf_select($html,$location,$cf,$p=''){
808 803
 
809 804
     // check we have the post value
810
-    if(is_int($p)){$post = geodir_get_post_info($p);}
811
-    else{ global $post;}
805
+    if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;}
812 806
 
813 807
     if(!is_array($cf) && $cf!=''){
814 808
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
@@ -908,8 +902,7 @@  discard block
 block discarded – undo
908 902
 function geodir_cf_multiselect($html,$location,$cf,$p=''){
909 903
 
910 904
     // check we have the post value
911
-    if(is_int($p)){$post = geodir_get_post_info($p);}
912
-    else{ global $post;}
905
+    if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;}
913 906
 
914 907
     if(!is_array($cf) && $cf!=''){
915 908
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
@@ -1030,8 +1023,7 @@  discard block
 block discarded – undo
1030 1023
 function geodir_cf_email($html,$location,$cf,$p=''){
1031 1024
 
1032 1025
     // check we have the post value
1033
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1034
-    else{ global $post;}
1026
+    if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;}
1035 1027
 
1036 1028
     if(!is_array($cf) && $cf!=''){
1037 1029
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
@@ -1162,7 +1154,7 @@  discard block
 block discarded – undo
1162 1154
                      */
1163 1155
                     $email_name = apply_filters('geodir_email_field_name_output',$email,$cf);
1164 1156
                     $html .=  "<script>document.write('<a href=\"mailto:'+'$e_split[0]' + '@' + '$e_split[1]'+'\">$email_name</a>')</script>";
1165
-                }else{
1157
+                } else{
1166 1158
                     $html .=  $email;
1167 1159
                 }
1168 1160
                 $html .= '</span></div>';
@@ -1190,8 +1182,7 @@  discard block
 block discarded – undo
1190 1182
 function geodir_cf_file($html,$location,$cf,$p=''){
1191 1183
 
1192 1184
     // check we have the post value
1193
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1194
-    else{ global $post;}
1185
+    if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;}
1195 1186
 
1196 1187
     if(!is_array($cf) && $cf!=''){
1197 1188
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
@@ -1330,8 +1321,7 @@  discard block
 block discarded – undo
1330 1321
 function geodir_cf_textarea($html,$location,$cf,$p=''){
1331 1322
 
1332 1323
     // check we have the post value
1333
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1334
-    else{ global $post;}
1324
+    if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;}
1335 1325
 
1336 1326
     if(!is_array($cf) && $cf!=''){
1337 1327
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
@@ -1420,8 +1410,7 @@  discard block
 block discarded – undo
1420 1410
 function geodir_cf_html($html,$location,$cf,$p=''){
1421 1411
 
1422 1412
     // check we have the post value
1423
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1424
-    else{ global $post;}
1413
+    if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;}
1425 1414
 
1426 1415
     if(!is_array($cf) && $cf!=''){
1427 1416
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
@@ -1509,8 +1498,7 @@  discard block
 block discarded – undo
1509 1498
 function geodir_cf_taxonomy($html,$location,$cf,$p=''){
1510 1499
 
1511 1500
     // check we have the post value
1512
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1513
-    else{ global $post;}
1501
+    if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;}
1514 1502
 
1515 1503
     if(!is_array($cf) && $cf!=''){
1516 1504
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
@@ -1631,8 +1619,7 @@  discard block
 block discarded – undo
1631 1619
 function geodir_cf_address($html,$location,$cf,$p=''){
1632 1620
 
1633 1621
     // check we have the post value
1634
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1635
-    else{ global $post;}
1622
+    if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;}
1636 1623
 
1637 1624
     if(!is_array($cf) && $cf!=''){
1638 1625
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
Please login to merge, or discard this patch.
Indentation   +1522 added lines, -1522 removed lines patch added patch discarded remove patch
@@ -21,84 +21,84 @@  discard block
 block discarded – undo
21 21
  */
22 22
 function geodir_cf_checkbox($html,$location,$cf,$p=''){
23 23
 
24
-    // check we have the post value
25
-    if(is_int($p)){$post = geodir_get_post_info($p);}
26
-    else{ global $post;}
27
-
28
-    if(!is_array($cf) && $cf!=''){
29
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
30
-        if(!$cf){return NULL;}
31
-    }
32
-
33
-    $html_var = $cf['htmlvar_name'];
34
-
35
-    // Check if there is a location specific filter.
36
-    if(has_filter("geodir_custom_field_output_checkbox_loc_{$location}")){
37
-        /**
38
-         * Filter the checkbox html by location.
39
-         *
40
-         * @param string $html The html to filter.
41
-         * @param array $cf The custom field array.
42
-         * @since 1.6.6
43
-         */
44
-        $html = apply_filters("geodir_custom_field_output_checkbox_loc_{$location}",$html,$cf);
45
-    }
46
-
47
-    // Check if there is a custom field specific filter.
48
-    if(has_filter("geodir_custom_field_output_checkbox_var_{$html_var}")){
49
-        /**
50
-         * Filter the checkbox html by individual custom field.
51
-         *
52
-         * @param string $html The html to filter.
53
-         * @param string $location The location to output the html.
54
-         * @param array $cf The custom field array.
55
-         * @since 1.6.6
56
-         */
57
-        $html = apply_filters("geodir_custom_field_output_checkbox_var_{$html_var}",$html,$location,$cf);
58
-    }
59
-
60
-    // Check if there is a custom field key specific filter.
61
-    if(has_filter("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}")){
62
-        /**
63
-         * Filter the checkbox html by field type key.
64
-         *
65
-         * @param string $html The html to filter.
66
-         * @param string $location The location to output the html.
67
-         * @param array $cf The custom field array.
68
-         * @since 1.6.6
69
-         */
70
-        $html = apply_filters("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}",$html,$location,$cf);
71
-    }
72
-
73
-    // If not html then we run the standard output.
74
-    if(empty($html)){
75
-
76
-        if ( (int) $post->{$html_var} == 1 ):
77
-
78
-            if ( $post->{$html_var} == '1' ):
79
-                $html_val = __( 'Yes', 'geodirectory' );
80
-            else:
81
-                $html_val = __( 'No', 'geodirectory' );
82
-            endif;
83
-
84
-            $field_icon = geodir_field_icon_proccess($cf);
85
-            if (strpos($field_icon, 'http') !== false) {
86
-                $field_icon_af = '';
87
-            } elseif ($field_icon == '') {
88
-                $field_icon_af = '';
89
-            } else {
90
-                $field_icon_af = $field_icon;
91
-                $field_icon = '';
92
-            }
93
-
94
-            $html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-checkbox" style="' . $field_icon . '">' . $field_icon_af;
95
-            $html .= ( trim( $cf['site_title'] ) ) ? __( $cf['site_title'], 'geodirectory' ) . ': ' : '';
96
-            $html .= '</span>' . $html_val . '</div>';
97
-        endif;
98
-
99
-    }
100
-
101
-    return $html;
24
+	// check we have the post value
25
+	if(is_int($p)){$post = geodir_get_post_info($p);}
26
+	else{ global $post;}
27
+
28
+	if(!is_array($cf) && $cf!=''){
29
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
30
+		if(!$cf){return NULL;}
31
+	}
32
+
33
+	$html_var = $cf['htmlvar_name'];
34
+
35
+	// Check if there is a location specific filter.
36
+	if(has_filter("geodir_custom_field_output_checkbox_loc_{$location}")){
37
+		/**
38
+		 * Filter the checkbox html by location.
39
+		 *
40
+		 * @param string $html The html to filter.
41
+		 * @param array $cf The custom field array.
42
+		 * @since 1.6.6
43
+		 */
44
+		$html = apply_filters("geodir_custom_field_output_checkbox_loc_{$location}",$html,$cf);
45
+	}
46
+
47
+	// Check if there is a custom field specific filter.
48
+	if(has_filter("geodir_custom_field_output_checkbox_var_{$html_var}")){
49
+		/**
50
+		 * Filter the checkbox html by individual custom field.
51
+		 *
52
+		 * @param string $html The html to filter.
53
+		 * @param string $location The location to output the html.
54
+		 * @param array $cf The custom field array.
55
+		 * @since 1.6.6
56
+		 */
57
+		$html = apply_filters("geodir_custom_field_output_checkbox_var_{$html_var}",$html,$location,$cf);
58
+	}
59
+
60
+	// Check if there is a custom field key specific filter.
61
+	if(has_filter("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}")){
62
+		/**
63
+		 * Filter the checkbox html by field type key.
64
+		 *
65
+		 * @param string $html The html to filter.
66
+		 * @param string $location The location to output the html.
67
+		 * @param array $cf The custom field array.
68
+		 * @since 1.6.6
69
+		 */
70
+		$html = apply_filters("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}",$html,$location,$cf);
71
+	}
72
+
73
+	// If not html then we run the standard output.
74
+	if(empty($html)){
75
+
76
+		if ( (int) $post->{$html_var} == 1 ):
77
+
78
+			if ( $post->{$html_var} == '1' ):
79
+				$html_val = __( 'Yes', 'geodirectory' );
80
+			else:
81
+				$html_val = __( 'No', 'geodirectory' );
82
+			endif;
83
+
84
+			$field_icon = geodir_field_icon_proccess($cf);
85
+			if (strpos($field_icon, 'http') !== false) {
86
+				$field_icon_af = '';
87
+			} elseif ($field_icon == '') {
88
+				$field_icon_af = '';
89
+			} else {
90
+				$field_icon_af = $field_icon;
91
+				$field_icon = '';
92
+			}
93
+
94
+			$html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-checkbox" style="' . $field_icon . '">' . $field_icon_af;
95
+			$html .= ( trim( $cf['site_title'] ) ) ? __( $cf['site_title'], 'geodirectory' ) . ': ' : '';
96
+			$html .= '</span>' . $html_val . '</div>';
97
+		endif;
98
+
99
+	}
100
+
101
+	return $html;
102 102
 }
103 103
 add_filter('geodir_custom_field_output_checkbox','geodir_cf_checkbox',10,3);
104 104
 
@@ -115,71 +115,71 @@  discard block
 block discarded – undo
115 115
  */
116 116
 function geodir_cf_fieldset($html,$location,$cf,$p=''){
117 117
 
118
-    // check we have the post value
119
-    if(is_int($p)){$post = geodir_get_post_info($p);}
120
-    else{ global $post;}
121
-
122
-    if(!is_array($cf) && $cf!=''){
123
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
124
-        if(!$cf){return NULL;}
125
-    }
126
-
127
-    $html_var = $cf['htmlvar_name'];
128
-
129
-    // Check if there is a location specific filter.
130
-    if(has_filter("geodir_custom_field_output_fieldset_loc_{$location}")){
131
-        /**
132
-         * Filter the fieldset html by location.
133
-         *
134
-         * @param string $html The html to filter.
135
-         * @param array $cf The custom field array.
136
-         * @since 1.6.6
137
-         */
138
-        $html = apply_filters("geodir_custom_field_output_fieldset_loc_{$location}",$html,$cf);
139
-    }
140
-
141
-    // Check if there is a custom field specific filter.
142
-    if(has_filter("geodir_custom_field_output_fieldset_var_{$html_var}")){
143
-        /**
144
-         * Filter the fieldset html by individual custom field.
145
-         *
146
-         * @param string $html The html to filter.
147
-         * @param string $location The location to output the html.
148
-         * @param array $cf The custom field array.
149
-         * @since 1.6.6
150
-         */
151
-        $html = apply_filters("geodir_custom_field_output_fieldset_var_{$html_var}",$html,$location,$cf);
152
-    }
153
-
154
-    // Check if there is a custom field key specific filter.
155
-    if(has_filter("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}")){
156
-        /**
157
-         * Filter the fieldset html by field type key.
158
-         *
159
-         * @param string $html The html to filter.
160
-         * @param string $location The location to output the html.
161
-         * @param array $cf The custom field array.
162
-         * @since 1.6.6
163
-         */
164
-        $html = apply_filters("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}",$html,$location,$cf);
165
-    }
166
-
167
-    // If not html then we run the standard output.
168
-    if(empty($html)){
169
-
170
-        global $field_set_start;
171
-        $fieldset_class = 'fieldset-'.sanitize_title_with_dashes($cf['site_title']);
172
-
173
-        if ($field_set_start == 1) {
174
-            echo '</div><div class="geodir-company_info field-group ' . $cf['htmlvar_name'] . '"><h2 class="'.$fieldset_class.'">' . __($cf['site_title'], 'geodirectory') . '</h2>';
175
-        } else {
176
-            echo '<h2 class="'.$fieldset_class.'">' . __($cf['site_title'], 'geodirectory') . '</h2>';
177
-            $field_set_start = 1;
178
-        }
179
-
180
-    }
181
-
182
-    return $html;
118
+	// check we have the post value
119
+	if(is_int($p)){$post = geodir_get_post_info($p);}
120
+	else{ global $post;}
121
+
122
+	if(!is_array($cf) && $cf!=''){
123
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
124
+		if(!$cf){return NULL;}
125
+	}
126
+
127
+	$html_var = $cf['htmlvar_name'];
128
+
129
+	// Check if there is a location specific filter.
130
+	if(has_filter("geodir_custom_field_output_fieldset_loc_{$location}")){
131
+		/**
132
+		 * Filter the fieldset html by location.
133
+		 *
134
+		 * @param string $html The html to filter.
135
+		 * @param array $cf The custom field array.
136
+		 * @since 1.6.6
137
+		 */
138
+		$html = apply_filters("geodir_custom_field_output_fieldset_loc_{$location}",$html,$cf);
139
+	}
140
+
141
+	// Check if there is a custom field specific filter.
142
+	if(has_filter("geodir_custom_field_output_fieldset_var_{$html_var}")){
143
+		/**
144
+		 * Filter the fieldset html by individual custom field.
145
+		 *
146
+		 * @param string $html The html to filter.
147
+		 * @param string $location The location to output the html.
148
+		 * @param array $cf The custom field array.
149
+		 * @since 1.6.6
150
+		 */
151
+		$html = apply_filters("geodir_custom_field_output_fieldset_var_{$html_var}",$html,$location,$cf);
152
+	}
153
+
154
+	// Check if there is a custom field key specific filter.
155
+	if(has_filter("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}")){
156
+		/**
157
+		 * Filter the fieldset html by field type key.
158
+		 *
159
+		 * @param string $html The html to filter.
160
+		 * @param string $location The location to output the html.
161
+		 * @param array $cf The custom field array.
162
+		 * @since 1.6.6
163
+		 */
164
+		$html = apply_filters("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}",$html,$location,$cf);
165
+	}
166
+
167
+	// If not html then we run the standard output.
168
+	if(empty($html)){
169
+
170
+		global $field_set_start;
171
+		$fieldset_class = 'fieldset-'.sanitize_title_with_dashes($cf['site_title']);
172
+
173
+		if ($field_set_start == 1) {
174
+			echo '</div><div class="geodir-company_info field-group ' . $cf['htmlvar_name'] . '"><h2 class="'.$fieldset_class.'">' . __($cf['site_title'], 'geodirectory') . '</h2>';
175
+		} else {
176
+			echo '<h2 class="'.$fieldset_class.'">' . __($cf['site_title'], 'geodirectory') . '</h2>';
177
+			$field_set_start = 1;
178
+		}
179
+
180
+	}
181
+
182
+	return $html;
183 183
 }
184 184
 add_filter('geodir_custom_field_output_fieldset','geodir_cf_fieldset',10,3);
185 185
 
@@ -196,106 +196,106 @@  discard block
 block discarded – undo
196 196
  */
197 197
 function geodir_cf_url($html,$location,$cf,$p=''){
198 198
 
199
-    // check we have the post value
200
-    if(is_int($p)){$post = geodir_get_post_info($p);}
201
-    else{ global $post;}
202
-
203
-    if(!is_array($cf) && $cf!=''){
204
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
205
-        if(!$cf){return NULL;}
206
-    }
207
-
208
-    $html_var = $cf['htmlvar_name'];
209
-
210
-    // Check if there is a location specific filter.
211
-    if(has_filter("geodir_custom_field_output_url_loc_{$location}")){
212
-        /**
213
-         * Filter the url html by location.
214
-         *
215
-         * @param string $html The html to filter.
216
-         * @param array $cf The custom field array.
217
-         * @since 1.6.6
218
-         */
219
-        $html = apply_filters("geodir_custom_field_output_url_loc_{$location}",$html,$cf);
220
-    }
221
-
222
-    // Check if there is a custom field specific filter.
223
-    if(has_filter("geodir_custom_field_output_url_var_{$html_var}")){
224
-        /**
225
-         * Filter the url html by individual custom field.
226
-         *
227
-         * @param string $html The html to filter.
228
-         * @param string $location The location to output the html.
229
-         * @param array $cf The custom field array.
230
-         * @since 1.6.6
231
-         */
232
-        $html = apply_filters("geodir_custom_field_output_url_var_{$html_var}",$html,$location,$cf);
233
-    }
234
-
235
-    // Check if there is a custom field key specific filter.
236
-    if(has_filter("geodir_custom_field_output_url_key_{$cf['field_type_key']}")){
237
-        /**
238
-         * Filter the url html by field type key.
239
-         *
240
-         * @param string $html The html to filter.
241
-         * @param string $location The location to output the html.
242
-         * @param array $cf The custom field array.
243
-         * @since 1.6.6
244
-         */
245
-        $html = apply_filters("geodir_custom_field_output_url_key_{$cf['field_type_key']}",$html,$location,$cf);
246
-    }
247
-
248
-    // If not html then we run the standard output.
249
-    if(empty($html)){
250
-
251
-        if ($post->{$cf['htmlvar_name']}):
252
-
253
-            $field_icon = geodir_field_icon_proccess($cf);
254
-            if (strpos($field_icon, 'http') !== false) {
255
-                $field_icon_af = '';
256
-            } elseif ($field_icon == '') {
257
-
258
-                if ($cf['name'] == 'geodir_facebook') {
259
-                    $field_icon_af = '<i class="fa fa-facebook-square"></i>';
260
-                } elseif ($cf['name'] == 'geodir_twitter') {
261
-                    $field_icon_af = '<i class="fa fa-twitter-square"></i>';
262
-                } else {
263
-                    $field_icon_af = '<i class="fa fa-link"></i>';
264
-                }
265
-
266
-            } else {
267
-                $field_icon_af = $field_icon;
268
-                $field_icon = '';
269
-            }
270
-
271
-            $a_url = geodir_parse_custom_field_url($post->{$cf['htmlvar_name']});
272
-
273
-
274
-            $website = !empty($a_url['url']) ? $a_url['url'] : '';
275
-            $title = !empty($a_url['label']) ? $a_url['label'] : $cf['site_title'];
276
-            if(!empty($cf['default_value'])){$title = $cf['default_value'];}
277
-            $title = $title != '' ? __(stripslashes($title), 'geodirectory') : '';
278
-
279
-
280
-
281
-            // all search engines that use the nofollow value exclude links that use it from their ranking calculation
282
-            $rel = strpos($website, get_site_url()) !== false ? '' : 'rel="nofollow"';
283
-            /**
284
-             * Filter custom field website name.
285
-             *
286
-             * @since 1.0.0
287
-             *
288
-             * @param string $title Website Title.
289
-             * @param string $website Website URL.
290
-             * @param int $post->ID Post ID.
291
-             */
292
-            $html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '"><span class="geodir-i-website" style="' . $field_icon . '">' . $field_icon_af . '<a href="' . $website . '" target="_blank" ' . $rel . ' ><strong>' . apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID) . '</strong></a></span></div>';
293
-
294
-        endif;
295
-
296
-    }
297
-
298
-    return $html;
199
+	// check we have the post value
200
+	if(is_int($p)){$post = geodir_get_post_info($p);}
201
+	else{ global $post;}
202
+
203
+	if(!is_array($cf) && $cf!=''){
204
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
205
+		if(!$cf){return NULL;}
206
+	}
207
+
208
+	$html_var = $cf['htmlvar_name'];
209
+
210
+	// Check if there is a location specific filter.
211
+	if(has_filter("geodir_custom_field_output_url_loc_{$location}")){
212
+		/**
213
+		 * Filter the url html by location.
214
+		 *
215
+		 * @param string $html The html to filter.
216
+		 * @param array $cf The custom field array.
217
+		 * @since 1.6.6
218
+		 */
219
+		$html = apply_filters("geodir_custom_field_output_url_loc_{$location}",$html,$cf);
220
+	}
221
+
222
+	// Check if there is a custom field specific filter.
223
+	if(has_filter("geodir_custom_field_output_url_var_{$html_var}")){
224
+		/**
225
+		 * Filter the url html by individual custom field.
226
+		 *
227
+		 * @param string $html The html to filter.
228
+		 * @param string $location The location to output the html.
229
+		 * @param array $cf The custom field array.
230
+		 * @since 1.6.6
231
+		 */
232
+		$html = apply_filters("geodir_custom_field_output_url_var_{$html_var}",$html,$location,$cf);
233
+	}
234
+
235
+	// Check if there is a custom field key specific filter.
236
+	if(has_filter("geodir_custom_field_output_url_key_{$cf['field_type_key']}")){
237
+		/**
238
+		 * Filter the url html by field type key.
239
+		 *
240
+		 * @param string $html The html to filter.
241
+		 * @param string $location The location to output the html.
242
+		 * @param array $cf The custom field array.
243
+		 * @since 1.6.6
244
+		 */
245
+		$html = apply_filters("geodir_custom_field_output_url_key_{$cf['field_type_key']}",$html,$location,$cf);
246
+	}
247
+
248
+	// If not html then we run the standard output.
249
+	if(empty($html)){
250
+
251
+		if ($post->{$cf['htmlvar_name']}):
252
+
253
+			$field_icon = geodir_field_icon_proccess($cf);
254
+			if (strpos($field_icon, 'http') !== false) {
255
+				$field_icon_af = '';
256
+			} elseif ($field_icon == '') {
257
+
258
+				if ($cf['name'] == 'geodir_facebook') {
259
+					$field_icon_af = '<i class="fa fa-facebook-square"></i>';
260
+				} elseif ($cf['name'] == 'geodir_twitter') {
261
+					$field_icon_af = '<i class="fa fa-twitter-square"></i>';
262
+				} else {
263
+					$field_icon_af = '<i class="fa fa-link"></i>';
264
+				}
265
+
266
+			} else {
267
+				$field_icon_af = $field_icon;
268
+				$field_icon = '';
269
+			}
270
+
271
+			$a_url = geodir_parse_custom_field_url($post->{$cf['htmlvar_name']});
272
+
273
+
274
+			$website = !empty($a_url['url']) ? $a_url['url'] : '';
275
+			$title = !empty($a_url['label']) ? $a_url['label'] : $cf['site_title'];
276
+			if(!empty($cf['default_value'])){$title = $cf['default_value'];}
277
+			$title = $title != '' ? __(stripslashes($title), 'geodirectory') : '';
278
+
279
+
280
+
281
+			// all search engines that use the nofollow value exclude links that use it from their ranking calculation
282
+			$rel = strpos($website, get_site_url()) !== false ? '' : 'rel="nofollow"';
283
+			/**
284
+			 * Filter custom field website name.
285
+			 *
286
+			 * @since 1.0.0
287
+			 *
288
+			 * @param string $title Website Title.
289
+			 * @param string $website Website URL.
290
+			 * @param int $post->ID Post ID.
291
+			 */
292
+			$html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '"><span class="geodir-i-website" style="' . $field_icon . '">' . $field_icon_af . '<a href="' . $website . '" target="_blank" ' . $rel . ' ><strong>' . apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID) . '</strong></a></span></div>';
293
+
294
+		endif;
295
+
296
+	}
297
+
298
+	return $html;
299 299
 }
300 300
 add_filter('geodir_custom_field_output_url','geodir_cf_url',10,3);
301 301
 
@@ -312,80 +312,80 @@  discard block
 block discarded – undo
312 312
  */
313 313
 function geodir_cf_phone($html,$location,$cf,$p=''){
314 314
 
315
-    // check we have the post value
316
-    if(is_int($p)){$post = geodir_get_post_info($p);}
317
-    else{ global $post;}
318
-
319
-    if(!is_array($cf) && $cf!=''){
320
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
321
-        if(!$cf){return NULL;}
322
-    }
323
-
324
-    $html_var = $cf['htmlvar_name'];
325
-
326
-    // Check if there is a location specific filter.
327
-    if(has_filter("geodir_custom_field_output_phone_loc_{$location}")){
328
-        /**
329
-         * Filter the phone html by location.
330
-         *
331
-         * @param string $html The html to filter.
332
-         * @param array $cf The custom field array.
333
-         * @since 1.6.6
334
-         */
335
-        $html = apply_filters("geodir_custom_field_output_phone_loc_{$location}",$html,$cf);
336
-    }
337
-
338
-    // Check if there is a custom field specific filter.
339
-    if(has_filter("geodir_custom_field_output_phone_var_{$html_var}")){
340
-        /**
341
-         * Filter the phone html by individual custom field.
342
-         *
343
-         * @param string $html The html to filter.
344
-         * @param string $location The location to output the html.
345
-         * @param array $cf The custom field array.
346
-         * @since 1.6.6
347
-         */
348
-        $html = apply_filters("geodir_custom_field_output_phone_var_{$html_var}",$html,$location,$cf);
349
-    }
350
-
351
-    // Check if there is a custom field key specific filter.
352
-    if(has_filter("geodir_custom_field_output_phone_key_{$cf['field_type_key']}")){
353
-        /**
354
-         * Filter the phone html by field type key.
355
-         *
356
-         * @param string $html The html to filter.
357
-         * @param string $location The location to output the html.
358
-         * @param array $cf The custom field array.
359
-         * @since 1.6.6
360
-         */
361
-        $html = apply_filters("geodir_custom_field_output_phone_key_{$cf['field_type_key']}",$html,$location,$cf);
362
-    }
363
-
364
-    // If not html then we run the standard output.
365
-    if(empty($html)){
366
-
367
-        if ($post->{$cf['htmlvar_name']}):
368
-
369
-            $field_icon = geodir_field_icon_proccess($cf);
370
-            if (strpos($field_icon, 'http') !== false) {
371
-                $field_icon_af = '';
372
-            } elseif ($field_icon == '') {
373
-                $field_icon_af = '<i class="fa fa-phone"></i>';
374
-            } else {
375
-                $field_icon_af = $field_icon;
376
-                $field_icon = '';
377
-            }
378
-
379
-
380
-            $html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-contact" style="' . $field_icon . '">' . $field_icon_af .
381
-                    $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '&nbsp;';
382
-            $html .= '</span><a href="tel:' . preg_replace('/[^0-9+]/', '', $post->{$cf['htmlvar_name']}) . '">' . $post->{$cf['htmlvar_name']} . '</a></div>';
383
-
384
-        endif;
385
-
386
-    }
387
-
388
-    return $html;
315
+	// check we have the post value
316
+	if(is_int($p)){$post = geodir_get_post_info($p);}
317
+	else{ global $post;}
318
+
319
+	if(!is_array($cf) && $cf!=''){
320
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
321
+		if(!$cf){return NULL;}
322
+	}
323
+
324
+	$html_var = $cf['htmlvar_name'];
325
+
326
+	// Check if there is a location specific filter.
327
+	if(has_filter("geodir_custom_field_output_phone_loc_{$location}")){
328
+		/**
329
+		 * Filter the phone html by location.
330
+		 *
331
+		 * @param string $html The html to filter.
332
+		 * @param array $cf The custom field array.
333
+		 * @since 1.6.6
334
+		 */
335
+		$html = apply_filters("geodir_custom_field_output_phone_loc_{$location}",$html,$cf);
336
+	}
337
+
338
+	// Check if there is a custom field specific filter.
339
+	if(has_filter("geodir_custom_field_output_phone_var_{$html_var}")){
340
+		/**
341
+		 * Filter the phone html by individual custom field.
342
+		 *
343
+		 * @param string $html The html to filter.
344
+		 * @param string $location The location to output the html.
345
+		 * @param array $cf The custom field array.
346
+		 * @since 1.6.6
347
+		 */
348
+		$html = apply_filters("geodir_custom_field_output_phone_var_{$html_var}",$html,$location,$cf);
349
+	}
350
+
351
+	// Check if there is a custom field key specific filter.
352
+	if(has_filter("geodir_custom_field_output_phone_key_{$cf['field_type_key']}")){
353
+		/**
354
+		 * Filter the phone html by field type key.
355
+		 *
356
+		 * @param string $html The html to filter.
357
+		 * @param string $location The location to output the html.
358
+		 * @param array $cf The custom field array.
359
+		 * @since 1.6.6
360
+		 */
361
+		$html = apply_filters("geodir_custom_field_output_phone_key_{$cf['field_type_key']}",$html,$location,$cf);
362
+	}
363
+
364
+	// If not html then we run the standard output.
365
+	if(empty($html)){
366
+
367
+		if ($post->{$cf['htmlvar_name']}):
368
+
369
+			$field_icon = geodir_field_icon_proccess($cf);
370
+			if (strpos($field_icon, 'http') !== false) {
371
+				$field_icon_af = '';
372
+			} elseif ($field_icon == '') {
373
+				$field_icon_af = '<i class="fa fa-phone"></i>';
374
+			} else {
375
+				$field_icon_af = $field_icon;
376
+				$field_icon = '';
377
+			}
378
+
379
+
380
+			$html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-contact" style="' . $field_icon . '">' . $field_icon_af .
381
+					$html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '&nbsp;';
382
+			$html .= '</span><a href="tel:' . preg_replace('/[^0-9+]/', '', $post->{$cf['htmlvar_name']}) . '">' . $post->{$cf['htmlvar_name']} . '</a></div>';
383
+
384
+		endif;
385
+
386
+	}
387
+
388
+	return $html;
389 389
 }
390 390
 add_filter('geodir_custom_field_output_phone','geodir_cf_phone',10,3);
391 391
 
@@ -402,85 +402,85 @@  discard block
 block discarded – undo
402 402
  */
403 403
 function geodir_cf_time($html,$location,$cf,$p=''){
404 404
 
405
-    // check we have the post value
406
-    if(is_int($p)){$post = geodir_get_post_info($p);}
407
-    else{ global $post;}
408
-
409
-    if(!is_array($cf) && $cf!=''){
410
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
411
-        if(!$cf){return NULL;}
412
-    }
413
-
414
-    $html_var = $cf['htmlvar_name'];
415
-
416
-    // Check if there is a location specific filter.
417
-    if(has_filter("geodir_custom_field_output_time_loc_{$location}")){
418
-        /**
419
-         * Filter the time html by location.
420
-         *
421
-         * @param string $html The html to filter.
422
-         * @param array $cf The custom field array.
423
-         * @since 1.6.6
424
-         */
425
-        $html = apply_filters("geodir_custom_field_output_time_loc_{$location}",$html,$cf);
426
-    }
427
-
428
-    // Check if there is a custom field specific filter.
429
-    if(has_filter("geodir_custom_field_output_time_var_{$html_var}")){
430
-        /**
431
-         * Filter the time html by individual custom field.
432
-         *
433
-         * @param string $html The html to filter.
434
-         * @param string $location The location to output the html.
435
-         * @param array $cf The custom field array.
436
-         * @since 1.6.6
437
-         */
438
-        $html = apply_filters("geodir_custom_field_output_time_var_{$html_var}",$html,$location,$cf);
439
-    }
440
-
441
-    // Check if there is a custom field key specific filter.
442
-    if(has_filter("geodir_custom_field_output_time_key_{$cf['field_type_key']}")){
443
-        /**
444
-         * Filter the time html by field type key.
445
-         *
446
-         * @param string $html The html to filter.
447
-         * @param string $location The location to output the html.
448
-         * @param array $cf The custom field array.
449
-         * @since 1.6.6
450
-         */
451
-        $html = apply_filters("geodir_custom_field_output_time_key_{$cf['field_type_key']}",$html,$location,$cf);
452
-    }
453
-
454
-    // If not html then we run the standard output.
455
-    if(empty($html)){
456
-
457
-        if ($post->{$cf['htmlvar_name']}):
458
-
459
-            $value = '';
460
-            if ($post->{$cf['htmlvar_name']} != '')
461
-                //$value = date('h:i',strtotime($post->{$cf['htmlvar_name']}));
462
-                $value = date(get_option('time_format'), strtotime($post->{$cf['htmlvar_name']}));
463
-
464
-            $field_icon = geodir_field_icon_proccess($cf);
465
-            if (strpos($field_icon, 'http') !== false) {
466
-                $field_icon_af = '';
467
-            } elseif ($field_icon == '') {
468
-                $field_icon_af = '<i class="fa fa-clock-o"></i>';
469
-            } else {
470
-                $field_icon_af = $field_icon;
471
-                $field_icon = '';
472
-            }
473
-
474
-
475
-            $html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-time" style="' . $field_icon . '">' . $field_icon_af;
476
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '&nbsp;';
477
-            $html .= '</span>' . $value . '</div>';
478
-
479
-        endif;
480
-
481
-    }
482
-
483
-    return $html;
405
+	// check we have the post value
406
+	if(is_int($p)){$post = geodir_get_post_info($p);}
407
+	else{ global $post;}
408
+
409
+	if(!is_array($cf) && $cf!=''){
410
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
411
+		if(!$cf){return NULL;}
412
+	}
413
+
414
+	$html_var = $cf['htmlvar_name'];
415
+
416
+	// Check if there is a location specific filter.
417
+	if(has_filter("geodir_custom_field_output_time_loc_{$location}")){
418
+		/**
419
+		 * Filter the time html by location.
420
+		 *
421
+		 * @param string $html The html to filter.
422
+		 * @param array $cf The custom field array.
423
+		 * @since 1.6.6
424
+		 */
425
+		$html = apply_filters("geodir_custom_field_output_time_loc_{$location}",$html,$cf);
426
+	}
427
+
428
+	// Check if there is a custom field specific filter.
429
+	if(has_filter("geodir_custom_field_output_time_var_{$html_var}")){
430
+		/**
431
+		 * Filter the time html by individual custom field.
432
+		 *
433
+		 * @param string $html The html to filter.
434
+		 * @param string $location The location to output the html.
435
+		 * @param array $cf The custom field array.
436
+		 * @since 1.6.6
437
+		 */
438
+		$html = apply_filters("geodir_custom_field_output_time_var_{$html_var}",$html,$location,$cf);
439
+	}
440
+
441
+	// Check if there is a custom field key specific filter.
442
+	if(has_filter("geodir_custom_field_output_time_key_{$cf['field_type_key']}")){
443
+		/**
444
+		 * Filter the time html by field type key.
445
+		 *
446
+		 * @param string $html The html to filter.
447
+		 * @param string $location The location to output the html.
448
+		 * @param array $cf The custom field array.
449
+		 * @since 1.6.6
450
+		 */
451
+		$html = apply_filters("geodir_custom_field_output_time_key_{$cf['field_type_key']}",$html,$location,$cf);
452
+	}
453
+
454
+	// If not html then we run the standard output.
455
+	if(empty($html)){
456
+
457
+		if ($post->{$cf['htmlvar_name']}):
458
+
459
+			$value = '';
460
+			if ($post->{$cf['htmlvar_name']} != '')
461
+				//$value = date('h:i',strtotime($post->{$cf['htmlvar_name']}));
462
+				$value = date(get_option('time_format'), strtotime($post->{$cf['htmlvar_name']}));
463
+
464
+			$field_icon = geodir_field_icon_proccess($cf);
465
+			if (strpos($field_icon, 'http') !== false) {
466
+				$field_icon_af = '';
467
+			} elseif ($field_icon == '') {
468
+				$field_icon_af = '<i class="fa fa-clock-o"></i>';
469
+			} else {
470
+				$field_icon_af = $field_icon;
471
+				$field_icon = '';
472
+			}
473
+
474
+
475
+			$html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-time" style="' . $field_icon . '">' . $field_icon_af;
476
+			$html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '&nbsp;';
477
+			$html .= '</span>' . $value . '</div>';
478
+
479
+		endif;
480
+
481
+	}
482
+
483
+	return $html;
484 484
 }
485 485
 add_filter('geodir_custom_field_output_time','geodir_cf_time',10,3);
486 486
 
@@ -497,107 +497,107 @@  discard block
 block discarded – undo
497 497
  */
498 498
 function geodir_cf_datepicker($html,$location,$cf,$p=''){
499 499
 
500
-    // check we have the post value
501
-    if(is_int($p)){$post = geodir_get_post_info($p);}
502
-    else{ global $post;}
503
-
504
-    if(!is_array($cf) && $cf!=''){
505
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
506
-        if(!$cf){return NULL;}
507
-    }
508
-
509
-    $html_var = $cf['htmlvar_name'];
510
-
511
-    // Check if there is a location specific filter.
512
-    if(has_filter("geodir_custom_field_output_datepicker_loc_{$location}")){
513
-        /**
514
-         * Filter the datepicker html by location.
515
-         *
516
-         * @param string $html The html to filter.
517
-         * @param array $cf The custom field array.
518
-         * @since 1.6.6
519
-         */
520
-        $html = apply_filters("geodir_custom_field_output_datepicker_loc_{$location}",$html,$cf);
521
-    }
522
-
523
-    // Check if there is a custom field specific filter.
524
-    if(has_filter("geodir_custom_field_output_datepicker_var_{$html_var}")){
525
-        /**
526
-         * Filter the datepicker html by individual custom field.
527
-         *
528
-         * @param string $html The html to filter.
529
-         * @param string $location The location to output the html.
530
-         * @param array $cf The custom field array.
531
-         * @since 1.6.6
532
-         */
533
-        $html = apply_filters("geodir_custom_field_output_datepicker_var_{$html_var}",$html,$location,$cf);
534
-    }
535
-
536
-    // Check if there is a custom field key specific filter.
537
-    if(has_filter("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}")){
538
-        /**
539
-         * Filter the datepicker html by field type key.
540
-         *
541
-         * @param string $html The html to filter.
542
-         * @param string $location The location to output the html.
543
-         * @param array $cf The custom field array.
544
-         * @since 1.6.6
545
-         */
546
-        $html = apply_filters("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}",$html,$location,$cf);
547
-    }
548
-
549
-    // If not html then we run the standard output.
550
-    if(empty($html)){
551
-
552
-        if ($post->{$cf['htmlvar_name']}):
553
-
554
-            $date_format = geodir_default_date_format();
555
-            if ($cf['extra_fields'] != '') {
556
-                $date_format = unserialize($cf['extra_fields']);
557
-                $date_format = $date_format['date_format'];
558
-            }
559
-            // check if we need to change the format or not
560
-            $date_format_len = strlen(str_replace(' ', '', $date_format));
561
-            if($date_format_len>5){// if greater then 4 then it's the old style format.
562
-
563
-                $search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format
564
-                $replace = array('d','j','l','m','n','F','Y');//PHP date format
565
-
566
-                $date_format = str_replace($search, $replace, $date_format);
567
-
568
-                $post_htmlvar_value = ($date_format == 'd/m/Y' || $date_format == 'j/n/Y' ) ? str_replace('/', '-', $post->{$cf['htmlvar_name']}) : $post->{$cf['htmlvar_name']}; // PHP doesn't work well with dd/mm/yyyy format
569
-            }else{
570
-                $post_htmlvar_value = $post->{$cf['htmlvar_name']};
571
-            }
572
-
573
-            if ($post->{$cf['htmlvar_name']} != '' && $post->{$cf['htmlvar_name']}!="0000-00-00") {
574
-                $value = date_i18n($date_format, strtotime($post_htmlvar_value));
575
-            }else{
576
-                return '';
577
-            }
578
-
579
-            $field_icon = geodir_field_icon_proccess($cf);
580
-
581
-            if (strpos($field_icon, 'http') !== false) {
582
-                $field_icon_af = '';
583
-            } elseif ($field_icon == '') {
584
-                $field_icon_af = '<i class="fa fa-calendar"></i>';
585
-            } else {
586
-                $field_icon_af = $field_icon;
587
-                $field_icon = '';
588
-            }
589
-
590
-
591
-
592
-            $html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-datepicker" style="' . $field_icon . '">' . $field_icon_af;
593
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
594
-            $html .= '</span>' . $value . '</div>';
595
-
596
-        endif;
597
-
598
-    }
599
-
600
-    return $html;
500
+	// check we have the post value
501
+	if(is_int($p)){$post = geodir_get_post_info($p);}
502
+	else{ global $post;}
503
+
504
+	if(!is_array($cf) && $cf!=''){
505
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
506
+		if(!$cf){return NULL;}
507
+	}
508
+
509
+	$html_var = $cf['htmlvar_name'];
510
+
511
+	// Check if there is a location specific filter.
512
+	if(has_filter("geodir_custom_field_output_datepicker_loc_{$location}")){
513
+		/**
514
+		 * Filter the datepicker html by location.
515
+		 *
516
+		 * @param string $html The html to filter.
517
+		 * @param array $cf The custom field array.
518
+		 * @since 1.6.6
519
+		 */
520
+		$html = apply_filters("geodir_custom_field_output_datepicker_loc_{$location}",$html,$cf);
521
+	}
522
+
523
+	// Check if there is a custom field specific filter.
524
+	if(has_filter("geodir_custom_field_output_datepicker_var_{$html_var}")){
525
+		/**
526
+		 * Filter the datepicker html by individual custom field.
527
+		 *
528
+		 * @param string $html The html to filter.
529
+		 * @param string $location The location to output the html.
530
+		 * @param array $cf The custom field array.
531
+		 * @since 1.6.6
532
+		 */
533
+		$html = apply_filters("geodir_custom_field_output_datepicker_var_{$html_var}",$html,$location,$cf);
534
+	}
535
+
536
+	// Check if there is a custom field key specific filter.
537
+	if(has_filter("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}")){
538
+		/**
539
+		 * Filter the datepicker html by field type key.
540
+		 *
541
+		 * @param string $html The html to filter.
542
+		 * @param string $location The location to output the html.
543
+		 * @param array $cf The custom field array.
544
+		 * @since 1.6.6
545
+		 */
546
+		$html = apply_filters("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}",$html,$location,$cf);
547
+	}
548
+
549
+	// If not html then we run the standard output.
550
+	if(empty($html)){
551
+
552
+		if ($post->{$cf['htmlvar_name']}):
553
+
554
+			$date_format = geodir_default_date_format();
555
+			if ($cf['extra_fields'] != '') {
556
+				$date_format = unserialize($cf['extra_fields']);
557
+				$date_format = $date_format['date_format'];
558
+			}
559
+			// check if we need to change the format or not
560
+			$date_format_len = strlen(str_replace(' ', '', $date_format));
561
+			if($date_format_len>5){// if greater then 4 then it's the old style format.
562
+
563
+				$search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format
564
+				$replace = array('d','j','l','m','n','F','Y');//PHP date format
565
+
566
+				$date_format = str_replace($search, $replace, $date_format);
567
+
568
+				$post_htmlvar_value = ($date_format == 'd/m/Y' || $date_format == 'j/n/Y' ) ? str_replace('/', '-', $post->{$cf['htmlvar_name']}) : $post->{$cf['htmlvar_name']}; // PHP doesn't work well with dd/mm/yyyy format
569
+			}else{
570
+				$post_htmlvar_value = $post->{$cf['htmlvar_name']};
571
+			}
572
+
573
+			if ($post->{$cf['htmlvar_name']} != '' && $post->{$cf['htmlvar_name']}!="0000-00-00") {
574
+				$value = date_i18n($date_format, strtotime($post_htmlvar_value));
575
+			}else{
576
+				return '';
577
+			}
578
+
579
+			$field_icon = geodir_field_icon_proccess($cf);
580
+
581
+			if (strpos($field_icon, 'http') !== false) {
582
+				$field_icon_af = '';
583
+			} elseif ($field_icon == '') {
584
+				$field_icon_af = '<i class="fa fa-calendar"></i>';
585
+			} else {
586
+				$field_icon_af = $field_icon;
587
+				$field_icon = '';
588
+			}
589
+
590
+
591
+
592
+			$html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-datepicker" style="' . $field_icon . '">' . $field_icon_af;
593
+			$html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
594
+			$html .= '</span>' . $value . '</div>';
595
+
596
+		endif;
597
+
598
+	}
599
+
600
+	return $html;
601 601
 }
602 602
 add_filter('geodir_custom_field_output_datepicker','geodir_cf_datepicker',10,3);
603 603
 
@@ -614,84 +614,84 @@  discard block
 block discarded – undo
614 614
  */
615 615
 function geodir_cf_text($html,$location,$cf,$p=''){
616 616
 
617
-    // check we have the post value
618
-    if(is_int($p)){$post = geodir_get_post_info($p);}
619
-    else{ global $post;}
620
-
621
-    if(!is_array($cf) && $cf!=''){
622
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
623
-        if(!$cf){return NULL;}
624
-    }
625
-
626
-    $html_var = $cf['htmlvar_name'];
627
-
628
-    // Check if there is a location specific filter.
629
-    if(has_filter("geodir_custom_field_output_text_loc_{$location}")){
630
-        /**
631
-         * Filter the text html by location.
632
-         *
633
-         * @param string $html The html to filter.
634
-         * @param array $cf The custom field array.
635
-         * @since 1.6.6
636
-         */
637
-        $html = apply_filters("geodir_custom_field_output_text_loc_{$location}",$html,$cf);
638
-    }
639
-
640
-    // Check if there is a custom field specific filter.
641
-    if(has_filter("geodir_custom_field_output_text_var_{$html_var}")){
642
-        /**
643
-         * Filter the text html by individual custom field.
644
-         *
645
-         * @param string $html The html to filter.
646
-         * @param string $location The location to output the html.
647
-         * @param array $cf The custom field array.
648
-         * @since 1.6.6
649
-         */
650
-        $html = apply_filters("geodir_custom_field_output_text_var_{$html_var}",$html,$location,$cf);
651
-    }
652
-
653
-    // Check if there is a custom field key specific filter.
654
-    if(has_filter("geodir_custom_field_output_text_key_{$cf['field_type_key']}")){
655
-        /**
656
-         * Filter the text html by field type key.
657
-         *
658
-         * @param string $html The html to filter.
659
-         * @param string $location The location to output the html.
660
-         * @param array $cf The custom field array.
661
-         * @since 1.6.6
662
-         */
663
-        $html = apply_filters("geodir_custom_field_output_text_key_{$cf['field_type_key']}",$html,$location,$cf);
664
-    }
617
+	// check we have the post value
618
+	if(is_int($p)){$post = geodir_get_post_info($p);}
619
+	else{ global $post;}
620
+
621
+	if(!is_array($cf) && $cf!=''){
622
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
623
+		if(!$cf){return NULL;}
624
+	}
625
+
626
+	$html_var = $cf['htmlvar_name'];
627
+
628
+	// Check if there is a location specific filter.
629
+	if(has_filter("geodir_custom_field_output_text_loc_{$location}")){
630
+		/**
631
+		 * Filter the text html by location.
632
+		 *
633
+		 * @param string $html The html to filter.
634
+		 * @param array $cf The custom field array.
635
+		 * @since 1.6.6
636
+		 */
637
+		$html = apply_filters("geodir_custom_field_output_text_loc_{$location}",$html,$cf);
638
+	}
639
+
640
+	// Check if there is a custom field specific filter.
641
+	if(has_filter("geodir_custom_field_output_text_var_{$html_var}")){
642
+		/**
643
+		 * Filter the text html by individual custom field.
644
+		 *
645
+		 * @param string $html The html to filter.
646
+		 * @param string $location The location to output the html.
647
+		 * @param array $cf The custom field array.
648
+		 * @since 1.6.6
649
+		 */
650
+		$html = apply_filters("geodir_custom_field_output_text_var_{$html_var}",$html,$location,$cf);
651
+	}
652
+
653
+	// Check if there is a custom field key specific filter.
654
+	if(has_filter("geodir_custom_field_output_text_key_{$cf['field_type_key']}")){
655
+		/**
656
+		 * Filter the text html by field type key.
657
+		 *
658
+		 * @param string $html The html to filter.
659
+		 * @param string $location The location to output the html.
660
+		 * @param array $cf The custom field array.
661
+		 * @since 1.6.6
662
+		 */
663
+		$html = apply_filters("geodir_custom_field_output_text_key_{$cf['field_type_key']}",$html,$location,$cf);
664
+	}
665 665
 
666 666
     
667 667
 
668
-    // If not html then we run the standard output.
669
-    if(empty($html)){
668
+	// If not html then we run the standard output.
669
+	if(empty($html)){
670 670
 
671
-        if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != '' ):
671
+		if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != '' ):
672 672
 
673
-            $class = ($cf['htmlvar_name'] == 'geodir_timing') ? "geodir-i-time" : "geodir-i-text";
673
+			$class = ($cf['htmlvar_name'] == 'geodir_timing') ? "geodir-i-time" : "geodir-i-text";
674 674
 
675
-            $field_icon = geodir_field_icon_proccess($cf);
676
-            if (strpos($field_icon, 'http') !== false) {
677
-                $field_icon_af = '';
678
-            } elseif ($field_icon == '') {
679
-                $field_icon_af = ($cf['htmlvar_name'] == 'geodir_timing') ? '<i class="fa fa-clock-o"></i>' : "";
680
-            } else {
681
-                $field_icon_af = $field_icon;
682
-                $field_icon = '';
683
-            }
675
+			$field_icon = geodir_field_icon_proccess($cf);
676
+			if (strpos($field_icon, 'http') !== false) {
677
+				$field_icon_af = '';
678
+			} elseif ($field_icon == '') {
679
+				$field_icon_af = ($cf['htmlvar_name'] == 'geodir_timing') ? '<i class="fa fa-clock-o"></i>' : "";
680
+			} else {
681
+				$field_icon_af = $field_icon;
682
+				$field_icon = '';
683
+			}
684 684
 
685 685
 
686
-            $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="'.$class.'" style="' . $field_icon . '">' . $field_icon_af;
687
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
688
-            $html .= '</span>' . $post->{$cf['htmlvar_name']} . '</div>';
686
+			$html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="'.$class.'" style="' . $field_icon . '">' . $field_icon_af;
687
+			$html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
688
+			$html .= '</span>' . $post->{$cf['htmlvar_name']} . '</div>';
689 689
 
690
-        endif;
690
+		endif;
691 691
 
692
-    }
692
+	}
693 693
 
694
-    return $html;
694
+	return $html;
695 695
 }
696 696
 add_filter('geodir_custom_field_output_text','geodir_cf_text',10,3);
697 697
 
@@ -708,98 +708,98 @@  discard block
 block discarded – undo
708 708
  */
709 709
 function geodir_cf_radio($html,$location,$cf,$p=''){
710 710
 
711
-    // check we have the post value
712
-    if(is_int($p)){$post = geodir_get_post_info($p);}
713
-    else{ global $post;}
714
-
715
-    if(!is_array($cf) && $cf!=''){
716
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
717
-        if(!$cf){return NULL;}
718
-    }
719
-
720
-    $html_var = $cf['htmlvar_name'];
721
-
722
-    // Check if there is a location specific filter.
723
-    if(has_filter("geodir_custom_field_output_radio_loc_{$location}")){
724
-        /**
725
-         * Filter the radio html by location.
726
-         *
727
-         * @param string $html The html to filter.
728
-         * @param array $cf The custom field array.
729
-         * @since 1.6.6
730
-         */
731
-        $html = apply_filters("geodir_custom_field_output_radio_loc_{$location}",$html,$cf);
732
-    }
733
-
734
-    // Check if there is a custom field specific filter.
735
-    if(has_filter("geodir_custom_field_output_radio_var_{$html_var}")){
736
-        /**
737
-         * Filter the radio html by individual custom field.
738
-         *
739
-         * @param string $html The html to filter.
740
-         * @param string $location The location to output the html.
741
-         * @param array $cf The custom field array.
742
-         * @since 1.6.6
743
-         */
744
-        $html = apply_filters("geodir_custom_field_output_radio_var_{$html_var}",$html,$location,$cf);
745
-    }
746
-
747
-    // Check if there is a custom field key specific filter.
748
-    if(has_filter("geodir_custom_field_output_radio_key_{$cf['field_type_key']}")){
749
-        /**
750
-         * Filter the radio html by field type key.
751
-         *
752
-         * @param string $html The html to filter.
753
-         * @param string $location The location to output the html.
754
-         * @param array $cf The custom field array.
755
-         * @since 1.6.6
756
-         */
757
-        $html = apply_filters("geodir_custom_field_output_radio_key_{$cf['field_type_key']}",$html,$location,$cf);
758
-    }
759
-
760
-    // If not html then we run the standard output.
761
-    if(empty($html)){
762
-
763
-        $html_val = __($post->{$cf['htmlvar_name']}, 'geodirectory');
764
-        if ($post->{$cf['htmlvar_name']} != ''):
765
-
766
-            if ($post->{$cf['htmlvar_name']} == 'f' || $post->{$cf['htmlvar_name']} == '0') {
767
-                $html_val = __('No', 'geodirectory');
768
-            } else if ($post->{$cf['htmlvar_name']} == 't' || $post->{$cf['htmlvar_name']} == '1') {
769
-                $html_val = __('Yes', 'geodirectory');
770
-            } else {
771
-                if (!empty($cf['option_values'])) {
772
-                    $cf_option_values = geodir_string_values_to_options(stripslashes_deep($cf['option_values']), true);
773
-
774
-                    if (!empty($cf_option_values)) {
775
-                        foreach ($cf_option_values as $cf_option_value) {
776
-                            if (isset($cf_option_value['value']) && $cf_option_value['value'] == $post->{$cf['htmlvar_name']}) {
777
-                                $html_val = $cf_option_value['label'];
778
-                            }
779
-                        }
780
-                    }
781
-                }
782
-            }
783
-
784
-            $field_icon = geodir_field_icon_proccess($cf);
785
-            if (strpos($field_icon, 'http') !== false) {
786
-                $field_icon_af = '';
787
-            } elseif ($field_icon == '') {
788
-                $field_icon_af = '';
789
-            } else {
790
-                $field_icon_af = $field_icon;
791
-                $field_icon = '';
792
-            }
793
-
794
-
795
-            $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-radio" style="' . $field_icon . '">' . $field_icon_af;
796
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
797
-            $html .= '</span>' . $html_val . '</div>';
798
-        endif;
799
-
800
-    }
801
-
802
-    return $html;
711
+	// check we have the post value
712
+	if(is_int($p)){$post = geodir_get_post_info($p);}
713
+	else{ global $post;}
714
+
715
+	if(!is_array($cf) && $cf!=''){
716
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
717
+		if(!$cf){return NULL;}
718
+	}
719
+
720
+	$html_var = $cf['htmlvar_name'];
721
+
722
+	// Check if there is a location specific filter.
723
+	if(has_filter("geodir_custom_field_output_radio_loc_{$location}")){
724
+		/**
725
+		 * Filter the radio html by location.
726
+		 *
727
+		 * @param string $html The html to filter.
728
+		 * @param array $cf The custom field array.
729
+		 * @since 1.6.6
730
+		 */
731
+		$html = apply_filters("geodir_custom_field_output_radio_loc_{$location}",$html,$cf);
732
+	}
733
+
734
+	// Check if there is a custom field specific filter.
735
+	if(has_filter("geodir_custom_field_output_radio_var_{$html_var}")){
736
+		/**
737
+		 * Filter the radio html by individual custom field.
738
+		 *
739
+		 * @param string $html The html to filter.
740
+		 * @param string $location The location to output the html.
741
+		 * @param array $cf The custom field array.
742
+		 * @since 1.6.6
743
+		 */
744
+		$html = apply_filters("geodir_custom_field_output_radio_var_{$html_var}",$html,$location,$cf);
745
+	}
746
+
747
+	// Check if there is a custom field key specific filter.
748
+	if(has_filter("geodir_custom_field_output_radio_key_{$cf['field_type_key']}")){
749
+		/**
750
+		 * Filter the radio html by field type key.
751
+		 *
752
+		 * @param string $html The html to filter.
753
+		 * @param string $location The location to output the html.
754
+		 * @param array $cf The custom field array.
755
+		 * @since 1.6.6
756
+		 */
757
+		$html = apply_filters("geodir_custom_field_output_radio_key_{$cf['field_type_key']}",$html,$location,$cf);
758
+	}
759
+
760
+	// If not html then we run the standard output.
761
+	if(empty($html)){
762
+
763
+		$html_val = __($post->{$cf['htmlvar_name']}, 'geodirectory');
764
+		if ($post->{$cf['htmlvar_name']} != ''):
765
+
766
+			if ($post->{$cf['htmlvar_name']} == 'f' || $post->{$cf['htmlvar_name']} == '0') {
767
+				$html_val = __('No', 'geodirectory');
768
+			} else if ($post->{$cf['htmlvar_name']} == 't' || $post->{$cf['htmlvar_name']} == '1') {
769
+				$html_val = __('Yes', 'geodirectory');
770
+			} else {
771
+				if (!empty($cf['option_values'])) {
772
+					$cf_option_values = geodir_string_values_to_options(stripslashes_deep($cf['option_values']), true);
773
+
774
+					if (!empty($cf_option_values)) {
775
+						foreach ($cf_option_values as $cf_option_value) {
776
+							if (isset($cf_option_value['value']) && $cf_option_value['value'] == $post->{$cf['htmlvar_name']}) {
777
+								$html_val = $cf_option_value['label'];
778
+							}
779
+						}
780
+					}
781
+				}
782
+			}
783
+
784
+			$field_icon = geodir_field_icon_proccess($cf);
785
+			if (strpos($field_icon, 'http') !== false) {
786
+				$field_icon_af = '';
787
+			} elseif ($field_icon == '') {
788
+				$field_icon_af = '';
789
+			} else {
790
+				$field_icon_af = $field_icon;
791
+				$field_icon = '';
792
+			}
793
+
794
+
795
+			$html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-radio" style="' . $field_icon . '">' . $field_icon_af;
796
+			$html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
797
+			$html .= '</span>' . $html_val . '</div>';
798
+		endif;
799
+
800
+	}
801
+
802
+	return $html;
803 803
 }
804 804
 add_filter('geodir_custom_field_output_radio','geodir_cf_radio',10,3);
805 805
 
@@ -816,92 +816,92 @@  discard block
 block discarded – undo
816 816
  */
817 817
 function geodir_cf_select($html,$location,$cf,$p=''){
818 818
 
819
-    // check we have the post value
820
-    if(is_int($p)){$post = geodir_get_post_info($p);}
821
-    else{ global $post;}
822
-
823
-    if(!is_array($cf) && $cf!=''){
824
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
825
-        if(!$cf){return NULL;}
826
-    }
827
-
828
-    $html_var = $cf['htmlvar_name'];
829
-
830
-    // Check if there is a location specific filter.
831
-    if(has_filter("geodir_custom_field_output_select_loc_{$location}")){
832
-        /**
833
-         * Filter the select html by location.
834
-         *
835
-         * @param string $html The html to filter.
836
-         * @param array $cf The custom field array.
837
-         * @since 1.6.6
838
-         */
839
-        $html = apply_filters("geodir_custom_field_output_select_loc_{$location}",$html,$cf);
840
-    }
841
-
842
-    // Check if there is a custom field specific filter.
843
-    if(has_filter("geodir_custom_field_output_select_var_{$html_var}")){
844
-        /**
845
-         * Filter the select html by individual custom field.
846
-         *
847
-         * @param string $html The html to filter.
848
-         * @param string $location The location to output the html.
849
-         * @param array $cf The custom field array.
850
-         * @since 1.6.6
851
-         */
852
-        $html = apply_filters("geodir_custom_field_output_select_var_{$html_var}",$html,$location,$cf);
853
-    }
854
-
855
-    // Check if there is a custom field key specific filter.
856
-    if(has_filter("geodir_custom_field_output_select_key_{$cf['field_type_key']}")){
857
-        /**
858
-         * Filter the select html by field type key.
859
-         *
860
-         * @param string $html The html to filter.
861
-         * @param string $location The location to output the html.
862
-         * @param array $cf The custom field array.
863
-         * @since 1.6.6
864
-         */
865
-        $html = apply_filters("geodir_custom_field_output_select_key_{$cf['field_type_key']}",$html,$location,$cf);
866
-    }
867
-
868
-    // If not html then we run the standard output.
869
-    if(empty($html)){
870
-
871
-        if ($post->{$cf['htmlvar_name']}):
872
-            $field_value = __($post->{$cf['htmlvar_name']}, 'geodirectory');
873
-
874
-            if (!empty($cf['option_values'])) {
875
-                $cf_option_values = geodir_string_values_to_options(stripslashes_deep($cf['option_values']), true);
876
-
877
-                if (!empty($cf_option_values)) {
878
-                    foreach ($cf_option_values as $cf_option_value) {
879
-                        if (isset($cf_option_value['value']) && $cf_option_value['value'] == $post->{$cf['htmlvar_name']}) {
880
-                            //$field_value = $cf_option_value['label']; // no longer needed here.
881
-                        }
882
-                    }
883
-                }
884
-            }
885
-
886
-            $field_icon = geodir_field_icon_proccess($cf);
887
-            if (strpos($field_icon, 'http') !== false) {
888
-                $field_icon_af = '';
889
-            } elseif ($field_icon == '') {
890
-                $field_icon_af = '';
891
-            } else {
892
-                $field_icon_af = $field_icon;
893
-                $field_icon = '';
894
-            }
895
-
896
-
897
-            $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
898
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
899
-            $html .= '</span>' . $field_value . '</div>';
900
-        endif;
901
-
902
-    }
903
-
904
-    return $html;
819
+	// check we have the post value
820
+	if(is_int($p)){$post = geodir_get_post_info($p);}
821
+	else{ global $post;}
822
+
823
+	if(!is_array($cf) && $cf!=''){
824
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
825
+		if(!$cf){return NULL;}
826
+	}
827
+
828
+	$html_var = $cf['htmlvar_name'];
829
+
830
+	// Check if there is a location specific filter.
831
+	if(has_filter("geodir_custom_field_output_select_loc_{$location}")){
832
+		/**
833
+		 * Filter the select html by location.
834
+		 *
835
+		 * @param string $html The html to filter.
836
+		 * @param array $cf The custom field array.
837
+		 * @since 1.6.6
838
+		 */
839
+		$html = apply_filters("geodir_custom_field_output_select_loc_{$location}",$html,$cf);
840
+	}
841
+
842
+	// Check if there is a custom field specific filter.
843
+	if(has_filter("geodir_custom_field_output_select_var_{$html_var}")){
844
+		/**
845
+		 * Filter the select html by individual custom field.
846
+		 *
847
+		 * @param string $html The html to filter.
848
+		 * @param string $location The location to output the html.
849
+		 * @param array $cf The custom field array.
850
+		 * @since 1.6.6
851
+		 */
852
+		$html = apply_filters("geodir_custom_field_output_select_var_{$html_var}",$html,$location,$cf);
853
+	}
854
+
855
+	// Check if there is a custom field key specific filter.
856
+	if(has_filter("geodir_custom_field_output_select_key_{$cf['field_type_key']}")){
857
+		/**
858
+		 * Filter the select html by field type key.
859
+		 *
860
+		 * @param string $html The html to filter.
861
+		 * @param string $location The location to output the html.
862
+		 * @param array $cf The custom field array.
863
+		 * @since 1.6.6
864
+		 */
865
+		$html = apply_filters("geodir_custom_field_output_select_key_{$cf['field_type_key']}",$html,$location,$cf);
866
+	}
867
+
868
+	// If not html then we run the standard output.
869
+	if(empty($html)){
870
+
871
+		if ($post->{$cf['htmlvar_name']}):
872
+			$field_value = __($post->{$cf['htmlvar_name']}, 'geodirectory');
873
+
874
+			if (!empty($cf['option_values'])) {
875
+				$cf_option_values = geodir_string_values_to_options(stripslashes_deep($cf['option_values']), true);
876
+
877
+				if (!empty($cf_option_values)) {
878
+					foreach ($cf_option_values as $cf_option_value) {
879
+						if (isset($cf_option_value['value']) && $cf_option_value['value'] == $post->{$cf['htmlvar_name']}) {
880
+							//$field_value = $cf_option_value['label']; // no longer needed here.
881
+						}
882
+					}
883
+				}
884
+			}
885
+
886
+			$field_icon = geodir_field_icon_proccess($cf);
887
+			if (strpos($field_icon, 'http') !== false) {
888
+				$field_icon_af = '';
889
+			} elseif ($field_icon == '') {
890
+				$field_icon_af = '';
891
+			} else {
892
+				$field_icon_af = $field_icon;
893
+				$field_icon = '';
894
+			}
895
+
896
+
897
+			$html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
898
+			$html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
899
+			$html .= '</span>' . $field_value . '</div>';
900
+		endif;
901
+
902
+	}
903
+
904
+	return $html;
905 905
 }
906 906
 add_filter('geodir_custom_field_output_select','geodir_cf_select',10,3);
907 907
 
@@ -918,113 +918,113 @@  discard block
 block discarded – undo
918 918
  */
919 919
 function geodir_cf_multiselect($html,$location,$cf,$p=''){
920 920
 
921
-    // check we have the post value
922
-    if(is_int($p)){$post = geodir_get_post_info($p);}
923
-    else{ global $post;}
924
-
925
-    if(!is_array($cf) && $cf!=''){
926
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
927
-        if(!$cf){return NULL;}
928
-    }
929
-
930
-    $html_var = $cf['htmlvar_name'];
931
-
932
-    // Check if there is a location specific filter.
933
-    if(has_filter("geodir_custom_field_output_multiselect_loc_{$location}")){
934
-        /**
935
-         * Filter the multiselect html by location.
936
-         *
937
-         * @param string $html The html to filter.
938
-         * @param array $cf The custom field array.
939
-         * @since 1.6.6
940
-         */
941
-        $html = apply_filters("geodir_custom_field_output_multiselect_loc_{$location}",$html,$cf);
942
-    }
943
-
944
-    // Check if there is a custom field specific filter.
945
-    if(has_filter("geodir_custom_field_output_multiselect_var_{$html_var}")){
946
-        /**
947
-         * Filter the multiselect html by individual custom field.
948
-         *
949
-         * @param string $html The html to filter.
950
-         * @param string $location The location to output the html.
951
-         * @param array $cf The custom field array.
952
-         * @since 1.6.6
953
-         */
954
-        $html = apply_filters("geodir_custom_field_output_multiselect_var_{$html_var}",$html,$location,$cf);
955
-    }
956
-
957
-    // Check if there is a custom field key specific filter.
958
-    if(has_filter("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}")){
959
-        /**
960
-         * Filter the multiselect html by field type key.
961
-         *
962
-         * @param string $html The html to filter.
963
-         * @param string $location The location to output the html.
964
-         * @param array $cf The custom field array.
965
-         * @since 1.6.6
966
-         */
967
-        $html = apply_filters("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}",$html,$location,$cf);
968
-    }
969
-
970
-    // If not html then we run the standard output.
971
-    if(empty($html)){
972
-
973
-
974
-        if (!empty($post->{$cf['htmlvar_name']})):
975
-
976
-            if (is_array($post->{$cf['htmlvar_name']})) {
977
-                $post->{$cf['htmlvar_name']} = implode(', ', $post->{$cf['htmlvar_name']});
978
-            }
979
-
980
-            $field_icon = geodir_field_icon_proccess($cf);
981
-            if (strpos($field_icon, 'http') !== false) {
982
-                $field_icon_af = '';
983
-            } elseif ($field_icon == '') {
984
-                $field_icon_af = '';
985
-            } else {
986
-                $field_icon_af = $field_icon;
987
-                $field_icon = '';
988
-            }
989
-
990
-            $field_values = explode(',', trim($post->{$cf['htmlvar_name']}, ","));
991
-
992
-            $option_values = array();
993
-            if (!empty($cf['option_values'])) {
994
-                $cf_option_values = geodir_string_values_to_options(stripslashes_deep($cf['option_values']), true);
995
-
996
-                if (!empty($cf_option_values)) {
997
-                    foreach ($cf_option_values as $cf_option_value) {
998
-                        if (isset($cf_option_value['value']) && in_array($cf_option_value['value'], $field_values)) {
999
-                            $option_values[] = $cf_option_value['label'];
1000
-                        }
1001
-                    }
1002
-                }
1003
-            }
1004
-
1005
-
1006
-            $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
1007
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1008
-            $html .= '</span>';
1009
-
1010
-            if (count($option_values) > 1) {
1011
-                $html .= '<ul>';
1012
-
1013
-                foreach ($option_values as $val) {
1014
-                    $html .= '<li>' . $val . '</li>';
1015
-                }
1016
-
1017
-                $html .= '</ul>';
1018
-            } else {
1019
-                $html .= $post->{$cf['htmlvar_name']};
1020
-            }
1021
-
1022
-            $html .= '</div>';
1023
-        endif;
1024
-
1025
-    }
1026
-
1027
-    return $html;
921
+	// check we have the post value
922
+	if(is_int($p)){$post = geodir_get_post_info($p);}
923
+	else{ global $post;}
924
+
925
+	if(!is_array($cf) && $cf!=''){
926
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
927
+		if(!$cf){return NULL;}
928
+	}
929
+
930
+	$html_var = $cf['htmlvar_name'];
931
+
932
+	// Check if there is a location specific filter.
933
+	if(has_filter("geodir_custom_field_output_multiselect_loc_{$location}")){
934
+		/**
935
+		 * Filter the multiselect html by location.
936
+		 *
937
+		 * @param string $html The html to filter.
938
+		 * @param array $cf The custom field array.
939
+		 * @since 1.6.6
940
+		 */
941
+		$html = apply_filters("geodir_custom_field_output_multiselect_loc_{$location}",$html,$cf);
942
+	}
943
+
944
+	// Check if there is a custom field specific filter.
945
+	if(has_filter("geodir_custom_field_output_multiselect_var_{$html_var}")){
946
+		/**
947
+		 * Filter the multiselect html by individual custom field.
948
+		 *
949
+		 * @param string $html The html to filter.
950
+		 * @param string $location The location to output the html.
951
+		 * @param array $cf The custom field array.
952
+		 * @since 1.6.6
953
+		 */
954
+		$html = apply_filters("geodir_custom_field_output_multiselect_var_{$html_var}",$html,$location,$cf);
955
+	}
956
+
957
+	// Check if there is a custom field key specific filter.
958
+	if(has_filter("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}")){
959
+		/**
960
+		 * Filter the multiselect html by field type key.
961
+		 *
962
+		 * @param string $html The html to filter.
963
+		 * @param string $location The location to output the html.
964
+		 * @param array $cf The custom field array.
965
+		 * @since 1.6.6
966
+		 */
967
+		$html = apply_filters("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}",$html,$location,$cf);
968
+	}
969
+
970
+	// If not html then we run the standard output.
971
+	if(empty($html)){
972
+
973
+
974
+		if (!empty($post->{$cf['htmlvar_name']})):
975
+
976
+			if (is_array($post->{$cf['htmlvar_name']})) {
977
+				$post->{$cf['htmlvar_name']} = implode(', ', $post->{$cf['htmlvar_name']});
978
+			}
979
+
980
+			$field_icon = geodir_field_icon_proccess($cf);
981
+			if (strpos($field_icon, 'http') !== false) {
982
+				$field_icon_af = '';
983
+			} elseif ($field_icon == '') {
984
+				$field_icon_af = '';
985
+			} else {
986
+				$field_icon_af = $field_icon;
987
+				$field_icon = '';
988
+			}
989
+
990
+			$field_values = explode(',', trim($post->{$cf['htmlvar_name']}, ","));
991
+
992
+			$option_values = array();
993
+			if (!empty($cf['option_values'])) {
994
+				$cf_option_values = geodir_string_values_to_options(stripslashes_deep($cf['option_values']), true);
995
+
996
+				if (!empty($cf_option_values)) {
997
+					foreach ($cf_option_values as $cf_option_value) {
998
+						if (isset($cf_option_value['value']) && in_array($cf_option_value['value'], $field_values)) {
999
+							$option_values[] = $cf_option_value['label'];
1000
+						}
1001
+					}
1002
+				}
1003
+			}
1004
+
1005
+
1006
+			$html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
1007
+			$html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1008
+			$html .= '</span>';
1009
+
1010
+			if (count($option_values) > 1) {
1011
+				$html .= '<ul>';
1012
+
1013
+				foreach ($option_values as $val) {
1014
+					$html .= '<li>' . $val . '</li>';
1015
+				}
1016
+
1017
+				$html .= '</ul>';
1018
+			} else {
1019
+				$html .= $post->{$cf['htmlvar_name']};
1020
+			}
1021
+
1022
+			$html .= '</div>';
1023
+		endif;
1024
+
1025
+	}
1026
+
1027
+	return $html;
1028 1028
 }
1029 1029
 add_filter('geodir_custom_field_output_multiselect','geodir_cf_multiselect',10,3);
1030 1030
 
@@ -1041,153 +1041,153 @@  discard block
 block discarded – undo
1041 1041
  */
1042 1042
 function geodir_cf_email($html,$location,$cf,$p=''){
1043 1043
 
1044
-    // check we have the post value
1045
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1046
-    else{ global $post;}
1047
-
1048
-    if(!is_array($cf) && $cf!=''){
1049
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1050
-        if(!$cf){return NULL;}
1051
-    }
1052
-
1053
-    $html_var = $cf['htmlvar_name'];
1054
-
1055
-    // Check if there is a location specific filter.
1056
-    if(has_filter("geodir_custom_field_output_email_loc_{$location}")){
1057
-        /**
1058
-         * Filter the email html by location.
1059
-         *
1060
-         * @param string $html The html to filter.
1061
-         * @param array $cf The custom field array.
1062
-         * @since 1.6.6
1063
-         */
1064
-        $html = apply_filters("geodir_custom_field_output_email_loc_{$location}",$html,$cf);
1065
-    }
1066
-
1067
-    // Check if there is a custom field specific filter.
1068
-    if(has_filter("geodir_custom_field_output_email_var_{$html_var}")){
1069
-        /**
1070
-         * Filter the email html by individual custom field.
1071
-         *
1072
-         * @param string $html The html to filter.
1073
-         * @param string $location The location to output the html.
1074
-         * @param array $cf The custom field array.
1075
-         * @since 1.6.6
1076
-         */
1077
-        $html = apply_filters("geodir_custom_field_output_email_var_{$html_var}",$html,$location,$cf);
1078
-    }
1079
-
1080
-    // Check if there is a custom field key specific filter.
1081
-    if(has_filter("geodir_custom_field_output_email_key_{$cf['field_type_key']}")){
1082
-        /**
1083
-         * Filter the email html by field type key.
1084
-         *
1085
-         * @param string $html The html to filter.
1086
-         * @param string $location The location to output the html.
1087
-         * @param array $cf The custom field array.
1088
-         * @since 1.6.6
1089
-         */
1090
-        $html = apply_filters("geodir_custom_field_output_email_key_{$cf['field_type_key']}",$html,$location,$cf);
1091
-    }
1092
-
1093
-    // If not html then we run the standard output.
1094
-    if(empty($html)){
1095
-
1096
-        global $preview;
1097
-        if ($cf['htmlvar_name'] == 'geodir_email' && !(geodir_is_page('detail') || geodir_is_page('preview'))) {
1098
-            return ''; // Remove Send Enquiry | Send To Friend from listings page
1099
-        }
1100
-
1101
-        $package_info = (array)geodir_post_package_info(array(), $post, $post->post_type);
1102
-
1103
-        if ($cf['htmlvar_name'] == 'geodir_email' && ((isset($package_info->sendtofriend) && $package_info->sendtofriend) || $post->{$cf['htmlvar_name']})) {
1104
-            $send_to_friend = true;
1105
-            $b_send_inquiry = '';
1106
-            $b_sendtofriend = '';
1107
-
1108
-            $html = '';
1109
-            if (!$preview) {
1110
-                $b_send_inquiry = 'b_send_inquiry';
1111
-                $b_sendtofriend = 'b_sendtofriend';
1112
-                $html = '<input type="hidden" name="geodir_popup_post_id" value="' . $post->ID . '" /><div class="geodir_display_popup_forms"></div>';
1113
-            }
1114
-
1115
-            $field_icon = geodir_field_icon_proccess($cf);
1116
-            if (strpos($field_icon, 'http') !== false) {
1117
-                $field_icon_af = '';
1118
-            } elseif ($field_icon == '') {
1119
-                $field_icon_af = '<i class="fa fa-envelope"></i>';
1120
-            } else {
1121
-                $field_icon_af = $field_icon;
1122
-                $field_icon = '';
1123
-            }
1124
-
1125
-
1126
-            $html .= '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af;
1127
-            $seperator = '';
1128
-            if ($post->{$cf['htmlvar_name']}) {
1129
-                $html .= '<a href="javascript:void(0);" class="' . $b_send_inquiry . '" >' . SEND_INQUIRY . '</a>';
1130
-                $seperator = ' | ';
1131
-            }
1132
-
1133
-            if (isset($package_info->sendtofriend) && $package_info->sendtofriend) {
1134
-                $html .= $seperator . '<a href="javascript:void(0);" class="' . $b_sendtofriend . '">' . SEND_TO_FRIEND . '</a>';
1135
-            }
1136
-
1137
-            $html .= '</span></div>';
1138
-
1139
-
1140
-            if (isset($_REQUEST['send_inquiry']) && $_REQUEST['send_inquiry'] == 'success') {
1141
-                $html .= '<p class="sucess_msg">' . SEND_INQUIRY_SUCCESS . '</p>';
1142
-            } elseif (isset($_REQUEST['sendtofrnd']) && $_REQUEST['sendtofrnd'] == 'success') {
1143
-                $html .= '<p class="sucess_msg">' . SEND_FRIEND_SUCCESS . '</p>';
1144
-            } elseif (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 'captch') {
1145
-                $html .= '<p class="error_msg_fix">' . WRONG_CAPTCH_MSG . '</p>';
1146
-            }
1147
-
1148
-            /*if(!$preview){require_once (geodir_plugin_path().'/geodirectory-templates/popup-forms.php');}*/
1149
-
1150
-        } else {
1151
-
1152
-            if ($post->{$cf['htmlvar_name']}) {
1153
-
1154
-                $field_icon = geodir_field_icon_proccess($cf);
1155
-                if (strpos($field_icon, 'http') !== false) {
1156
-                    $field_icon_af = '';
1157
-                } elseif ($field_icon == '') {
1158
-                    $field_icon_af = '<i class="fa fa-envelope"></i>';
1159
-                } else {
1160
-                    $field_icon_af = $field_icon;
1161
-                    $field_icon = '';
1162
-                }
1163
-
1164
-
1165
-                $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af;
1166
-                $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1167
-                $html .= '</span><span class="geodir-email-address-output">';
1168
-                $email = $post->{$cf['htmlvar_name']} ;
1169
-                if($e_split = explode('@',$email)){
1170
-                    /**
1171
-                     * Filter email custom field name output.
1172
-                     *
1173
-                     * @since 1.5.3
1174
-                     *
1175
-                     * @param string $email The email string being output.
1176
-                     * @param array $cf Custom field variables array.
1177
-                     */
1178
-                    $email_name = apply_filters('geodir_email_field_name_output',$email,$cf);
1179
-                    $html .=  "<script>document.write('<a href=\"mailto:'+'$e_split[0]' + '@' + '$e_split[1]'+'\">$email_name</a>')</script>";
1180
-                }else{
1181
-                    $html .=  $email;
1182
-                }
1183
-                $html .= '</span></div>';
1184
-            }
1185
-
1186
-        }
1187
-
1188
-    }
1189
-
1190
-    return $html;
1044
+	// check we have the post value
1045
+	if(is_int($p)){$post = geodir_get_post_info($p);}
1046
+	else{ global $post;}
1047
+
1048
+	if(!is_array($cf) && $cf!=''){
1049
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1050
+		if(!$cf){return NULL;}
1051
+	}
1052
+
1053
+	$html_var = $cf['htmlvar_name'];
1054
+
1055
+	// Check if there is a location specific filter.
1056
+	if(has_filter("geodir_custom_field_output_email_loc_{$location}")){
1057
+		/**
1058
+		 * Filter the email html by location.
1059
+		 *
1060
+		 * @param string $html The html to filter.
1061
+		 * @param array $cf The custom field array.
1062
+		 * @since 1.6.6
1063
+		 */
1064
+		$html = apply_filters("geodir_custom_field_output_email_loc_{$location}",$html,$cf);
1065
+	}
1066
+
1067
+	// Check if there is a custom field specific filter.
1068
+	if(has_filter("geodir_custom_field_output_email_var_{$html_var}")){
1069
+		/**
1070
+		 * Filter the email html by individual custom field.
1071
+		 *
1072
+		 * @param string $html The html to filter.
1073
+		 * @param string $location The location to output the html.
1074
+		 * @param array $cf The custom field array.
1075
+		 * @since 1.6.6
1076
+		 */
1077
+		$html = apply_filters("geodir_custom_field_output_email_var_{$html_var}",$html,$location,$cf);
1078
+	}
1079
+
1080
+	// Check if there is a custom field key specific filter.
1081
+	if(has_filter("geodir_custom_field_output_email_key_{$cf['field_type_key']}")){
1082
+		/**
1083
+		 * Filter the email html by field type key.
1084
+		 *
1085
+		 * @param string $html The html to filter.
1086
+		 * @param string $location The location to output the html.
1087
+		 * @param array $cf The custom field array.
1088
+		 * @since 1.6.6
1089
+		 */
1090
+		$html = apply_filters("geodir_custom_field_output_email_key_{$cf['field_type_key']}",$html,$location,$cf);
1091
+	}
1092
+
1093
+	// If not html then we run the standard output.
1094
+	if(empty($html)){
1095
+
1096
+		global $preview;
1097
+		if ($cf['htmlvar_name'] == 'geodir_email' && !(geodir_is_page('detail') || geodir_is_page('preview'))) {
1098
+			return ''; // Remove Send Enquiry | Send To Friend from listings page
1099
+		}
1100
+
1101
+		$package_info = (array)geodir_post_package_info(array(), $post, $post->post_type);
1102
+
1103
+		if ($cf['htmlvar_name'] == 'geodir_email' && ((isset($package_info->sendtofriend) && $package_info->sendtofriend) || $post->{$cf['htmlvar_name']})) {
1104
+			$send_to_friend = true;
1105
+			$b_send_inquiry = '';
1106
+			$b_sendtofriend = '';
1107
+
1108
+			$html = '';
1109
+			if (!$preview) {
1110
+				$b_send_inquiry = 'b_send_inquiry';
1111
+				$b_sendtofriend = 'b_sendtofriend';
1112
+				$html = '<input type="hidden" name="geodir_popup_post_id" value="' . $post->ID . '" /><div class="geodir_display_popup_forms"></div>';
1113
+			}
1114
+
1115
+			$field_icon = geodir_field_icon_proccess($cf);
1116
+			if (strpos($field_icon, 'http') !== false) {
1117
+				$field_icon_af = '';
1118
+			} elseif ($field_icon == '') {
1119
+				$field_icon_af = '<i class="fa fa-envelope"></i>';
1120
+			} else {
1121
+				$field_icon_af = $field_icon;
1122
+				$field_icon = '';
1123
+			}
1124
+
1125
+
1126
+			$html .= '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af;
1127
+			$seperator = '';
1128
+			if ($post->{$cf['htmlvar_name']}) {
1129
+				$html .= '<a href="javascript:void(0);" class="' . $b_send_inquiry . '" >' . SEND_INQUIRY . '</a>';
1130
+				$seperator = ' | ';
1131
+			}
1132
+
1133
+			if (isset($package_info->sendtofriend) && $package_info->sendtofriend) {
1134
+				$html .= $seperator . '<a href="javascript:void(0);" class="' . $b_sendtofriend . '">' . SEND_TO_FRIEND . '</a>';
1135
+			}
1136
+
1137
+			$html .= '</span></div>';
1138
+
1139
+
1140
+			if (isset($_REQUEST['send_inquiry']) && $_REQUEST['send_inquiry'] == 'success') {
1141
+				$html .= '<p class="sucess_msg">' . SEND_INQUIRY_SUCCESS . '</p>';
1142
+			} elseif (isset($_REQUEST['sendtofrnd']) && $_REQUEST['sendtofrnd'] == 'success') {
1143
+				$html .= '<p class="sucess_msg">' . SEND_FRIEND_SUCCESS . '</p>';
1144
+			} elseif (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 'captch') {
1145
+				$html .= '<p class="error_msg_fix">' . WRONG_CAPTCH_MSG . '</p>';
1146
+			}
1147
+
1148
+			/*if(!$preview){require_once (geodir_plugin_path().'/geodirectory-templates/popup-forms.php');}*/
1149
+
1150
+		} else {
1151
+
1152
+			if ($post->{$cf['htmlvar_name']}) {
1153
+
1154
+				$field_icon = geodir_field_icon_proccess($cf);
1155
+				if (strpos($field_icon, 'http') !== false) {
1156
+					$field_icon_af = '';
1157
+				} elseif ($field_icon == '') {
1158
+					$field_icon_af = '<i class="fa fa-envelope"></i>';
1159
+				} else {
1160
+					$field_icon_af = $field_icon;
1161
+					$field_icon = '';
1162
+				}
1163
+
1164
+
1165
+				$html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af;
1166
+				$html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1167
+				$html .= '</span><span class="geodir-email-address-output">';
1168
+				$email = $post->{$cf['htmlvar_name']} ;
1169
+				if($e_split = explode('@',$email)){
1170
+					/**
1171
+					 * Filter email custom field name output.
1172
+					 *
1173
+					 * @since 1.5.3
1174
+					 *
1175
+					 * @param string $email The email string being output.
1176
+					 * @param array $cf Custom field variables array.
1177
+					 */
1178
+					$email_name = apply_filters('geodir_email_field_name_output',$email,$cf);
1179
+					$html .=  "<script>document.write('<a href=\"mailto:'+'$e_split[0]' + '@' + '$e_split[1]'+'\">$email_name</a>')</script>";
1180
+				}else{
1181
+					$html .=  $email;
1182
+				}
1183
+				$html .= '</span></div>';
1184
+			}
1185
+
1186
+		}
1187
+
1188
+	}
1189
+
1190
+	return $html;
1191 1191
 }
1192 1192
 add_filter('geodir_custom_field_output_email','geodir_cf_email',10,3);
1193 1193
 
@@ -1204,130 +1204,130 @@  discard block
 block discarded – undo
1204 1204
  */
1205 1205
 function geodir_cf_file($html,$location,$cf,$p=''){
1206 1206
 
1207
-    // check we have the post value
1208
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1209
-    else{ global $post;}
1210
-
1211
-    if(!is_array($cf) && $cf!=''){
1212
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1213
-        if(!$cf){return NULL;}
1214
-    }
1215
-
1216
-    $html_var = $cf['htmlvar_name'];
1217
-
1218
-    // Check if there is a location specific filter.
1219
-    if(has_filter("geodir_custom_field_output_file_loc_{$location}")){
1220
-        /**
1221
-         * Filter the file html by location.
1222
-         *
1223
-         * @param string $html The html to filter.
1224
-         * @param array $cf The custom field array.
1225
-         * @since 1.6.6
1226
-         */
1227
-        $html = apply_filters("geodir_custom_field_output_file_loc_{$location}",$html,$cf);
1228
-    }
1229
-
1230
-    // Check if there is a custom field specific filter.
1231
-    if(has_filter("geodir_custom_field_output_file_var_{$html_var}")){
1232
-        /**
1233
-         * Filter the file html by individual custom field.
1234
-         *
1235
-         * @param string $html The html to filter.
1236
-         * @param string $location The location to output the html.
1237
-         * @param array $cf The custom field array.
1238
-         * @since 1.6.6
1239
-         */
1240
-        $html = apply_filters("geodir_custom_field_output_file_var_{$html_var}",$html,$location,$cf);
1241
-    }
1242
-
1243
-    // Check if there is a custom field key specific filter.
1244
-    if(has_filter("geodir_custom_field_output_file_key_{$cf['field_type_key']}")){
1245
-        /**
1246
-         * Filter the file html by field type key.
1247
-         *
1248
-         * @param string $html The html to filter.
1249
-         * @param string $location The location to output the html.
1250
-         * @param array $cf The custom field array.
1251
-         * @since 1.6.6
1252
-         */
1253
-        $html = apply_filters("geodir_custom_field_output_file_key_{$cf['field_type_key']}",$html,$location,$cf);
1254
-    }
1255
-
1256
-    // If not html then we run the standard output.
1257
-    if(empty($html)){
1258
-
1259
-        if (!empty($post->{$cf['htmlvar_name']})):
1260
-
1261
-            $files = explode(",", $post->{$cf['htmlvar_name']});
1262
-            if (!empty($files)):
1263
-
1264
-                $extra_fields = !empty($cf['extra_fields']) ? maybe_unserialize($cf['extra_fields']) : NULL;
1265
-                $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'] : '';
1266
-
1267
-                $file_paths = '';
1268
-                foreach ($files as $file) {
1269
-                    if (!empty($file)) {
1270
-
1271
-                        // $filetype = wp_check_filetype($file);
1272
-
1273
-                        $image_name_arr = explode('/', $file);
1274
-                        $curr_img_dir = $image_name_arr[count($image_name_arr) - 2];
1275
-                        $filename = end($image_name_arr);
1276
-                        $img_name_arr = explode('.', $filename);
1277
-
1278
-                        $arr_file_type = wp_check_filetype($filename);
1279
-                        if (empty($arr_file_type['ext']) || empty($arr_file_type['type'])) {
1280
-                            continue;
1281
-                        }
1282
-
1283
-                        $uploaded_file_type = $arr_file_type['type'];
1284
-                        $uploaded_file_ext = $arr_file_type['ext'];
1285
-
1286
-                        if (!empty($allowed_file_types) && !in_array($uploaded_file_ext, $allowed_file_types)) {
1287
-                            continue; // Invalid file type.
1288
-                        }
1289
-
1290
-                        //$allowed_file_types = array('application/pdf', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'text/csv', 'text/plain');
1291
-                        $image_file_types = array('image/jpg', 'image/jpeg', 'image/gif', 'image/png', 'image/bmp', 'image/x-icon');
1292
-
1293
-                        // If the uploaded file is image
1294
-                        if (in_array($uploaded_file_type, $image_file_types)) {
1295
-                            $file_paths .= '<div class="geodir-custom-post-gallery" class="clearfix">';
1296
-                            $file_paths .= '<a href="'.$file.'">';
1297
-                            $file_paths .= geodir_show_image(array('src' => $file), 'thumbnail', false, false);
1298
-                            $file_paths .= '</a>';
1299
-                            //$file_paths .= '<img src="'.$file.'"  />';	
1300
-                            $file_paths .= '</div>';
1301
-                        } else {
1302
-                            $ext_path = '_' . $html_var . '_';
1303
-                            $filename = explode($ext_path, $filename);
1304
-                            $file_paths .= '<a href="' . $file . '" target="_blank">' . $filename[count($filename) - 1] . '</a>';
1305
-                        }
1306
-                    }
1307
-                }
1308
-
1309
-                $field_icon = geodir_field_icon_proccess($cf);
1310
-                if (strpos($field_icon, 'http') !== false) {
1311
-                    $field_icon_af = '';
1312
-                } elseif ($field_icon == '') {
1313
-                    $field_icon_af = '';
1314
-                } else {
1315
-                    $field_icon_af = $field_icon;
1316
-                    $field_icon = '';
1317
-                }
1318
-
1319
-                $html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' geodir-custom-file-box ' . $cf['htmlvar_name'] . '"><div class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
1320
-                $html .= '<span style="display: inline-block; vertical-align: top; padding-right: 14px;">';
1321
-                $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1322
-                $html .= '</span>';
1323
-                $html .= $file_paths . '</div></div>';
1324
-
1325
-            endif;
1326
-        endif;
1327
-
1328
-    }
1329
-
1330
-    return $html;
1207
+	// check we have the post value
1208
+	if(is_int($p)){$post = geodir_get_post_info($p);}
1209
+	else{ global $post;}
1210
+
1211
+	if(!is_array($cf) && $cf!=''){
1212
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1213
+		if(!$cf){return NULL;}
1214
+	}
1215
+
1216
+	$html_var = $cf['htmlvar_name'];
1217
+
1218
+	// Check if there is a location specific filter.
1219
+	if(has_filter("geodir_custom_field_output_file_loc_{$location}")){
1220
+		/**
1221
+		 * Filter the file html by location.
1222
+		 *
1223
+		 * @param string $html The html to filter.
1224
+		 * @param array $cf The custom field array.
1225
+		 * @since 1.6.6
1226
+		 */
1227
+		$html = apply_filters("geodir_custom_field_output_file_loc_{$location}",$html,$cf);
1228
+	}
1229
+
1230
+	// Check if there is a custom field specific filter.
1231
+	if(has_filter("geodir_custom_field_output_file_var_{$html_var}")){
1232
+		/**
1233
+		 * Filter the file html by individual custom field.
1234
+		 *
1235
+		 * @param string $html The html to filter.
1236
+		 * @param string $location The location to output the html.
1237
+		 * @param array $cf The custom field array.
1238
+		 * @since 1.6.6
1239
+		 */
1240
+		$html = apply_filters("geodir_custom_field_output_file_var_{$html_var}",$html,$location,$cf);
1241
+	}
1242
+
1243
+	// Check if there is a custom field key specific filter.
1244
+	if(has_filter("geodir_custom_field_output_file_key_{$cf['field_type_key']}")){
1245
+		/**
1246
+		 * Filter the file html by field type key.
1247
+		 *
1248
+		 * @param string $html The html to filter.
1249
+		 * @param string $location The location to output the html.
1250
+		 * @param array $cf The custom field array.
1251
+		 * @since 1.6.6
1252
+		 */
1253
+		$html = apply_filters("geodir_custom_field_output_file_key_{$cf['field_type_key']}",$html,$location,$cf);
1254
+	}
1255
+
1256
+	// If not html then we run the standard output.
1257
+	if(empty($html)){
1258
+
1259
+		if (!empty($post->{$cf['htmlvar_name']})):
1260
+
1261
+			$files = explode(",", $post->{$cf['htmlvar_name']});
1262
+			if (!empty($files)):
1263
+
1264
+				$extra_fields = !empty($cf['extra_fields']) ? maybe_unserialize($cf['extra_fields']) : NULL;
1265
+				$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'] : '';
1266
+
1267
+				$file_paths = '';
1268
+				foreach ($files as $file) {
1269
+					if (!empty($file)) {
1270
+
1271
+						// $filetype = wp_check_filetype($file);
1272
+
1273
+						$image_name_arr = explode('/', $file);
1274
+						$curr_img_dir = $image_name_arr[count($image_name_arr) - 2];
1275
+						$filename = end($image_name_arr);
1276
+						$img_name_arr = explode('.', $filename);
1277
+
1278
+						$arr_file_type = wp_check_filetype($filename);
1279
+						if (empty($arr_file_type['ext']) || empty($arr_file_type['type'])) {
1280
+							continue;
1281
+						}
1282
+
1283
+						$uploaded_file_type = $arr_file_type['type'];
1284
+						$uploaded_file_ext = $arr_file_type['ext'];
1285
+
1286
+						if (!empty($allowed_file_types) && !in_array($uploaded_file_ext, $allowed_file_types)) {
1287
+							continue; // Invalid file type.
1288
+						}
1289
+
1290
+						//$allowed_file_types = array('application/pdf', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'text/csv', 'text/plain');
1291
+						$image_file_types = array('image/jpg', 'image/jpeg', 'image/gif', 'image/png', 'image/bmp', 'image/x-icon');
1292
+
1293
+						// If the uploaded file is image
1294
+						if (in_array($uploaded_file_type, $image_file_types)) {
1295
+							$file_paths .= '<div class="geodir-custom-post-gallery" class="clearfix">';
1296
+							$file_paths .= '<a href="'.$file.'">';
1297
+							$file_paths .= geodir_show_image(array('src' => $file), 'thumbnail', false, false);
1298
+							$file_paths .= '</a>';
1299
+							//$file_paths .= '<img src="'.$file.'"  />';	
1300
+							$file_paths .= '</div>';
1301
+						} else {
1302
+							$ext_path = '_' . $html_var . '_';
1303
+							$filename = explode($ext_path, $filename);
1304
+							$file_paths .= '<a href="' . $file . '" target="_blank">' . $filename[count($filename) - 1] . '</a>';
1305
+						}
1306
+					}
1307
+				}
1308
+
1309
+				$field_icon = geodir_field_icon_proccess($cf);
1310
+				if (strpos($field_icon, 'http') !== false) {
1311
+					$field_icon_af = '';
1312
+				} elseif ($field_icon == '') {
1313
+					$field_icon_af = '';
1314
+				} else {
1315
+					$field_icon_af = $field_icon;
1316
+					$field_icon = '';
1317
+				}
1318
+
1319
+				$html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' geodir-custom-file-box ' . $cf['htmlvar_name'] . '"><div class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
1320
+				$html .= '<span style="display: inline-block; vertical-align: top; padding-right: 14px;">';
1321
+				$html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1322
+				$html .= '</span>';
1323
+				$html .= $file_paths . '</div></div>';
1324
+
1325
+			endif;
1326
+		endif;
1327
+
1328
+	}
1329
+
1330
+	return $html;
1331 1331
 }
1332 1332
 add_filter('geodir_custom_field_output_file','geodir_cf_file',10,3);
1333 1333
 
@@ -1345,80 +1345,80 @@  discard block
 block discarded – undo
1345 1345
  */
1346 1346
 function geodir_cf_textarea($html,$location,$cf,$p=''){
1347 1347
 
1348
-    // check we have the post value
1349
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1350
-    else{ global $post;}
1351
-
1352
-    if(!is_array($cf) && $cf!=''){
1353
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1354
-        if(!$cf){return NULL;}
1355
-    }
1356
-
1357
-    $html_var = $cf['htmlvar_name'];
1358
-
1359
-    // Check if there is a location specific filter.
1360
-    if(has_filter("geodir_custom_field_output_textarea_loc_{$location}")){
1361
-        /**
1362
-         * Filter the textarea html by location.
1363
-         *
1364
-         * @param string $html The html to filter.
1365
-         * @param array $cf The custom field array.
1366
-         * @since 1.6.6
1367
-         */
1368
-        $html = apply_filters("geodir_custom_field_output_textarea_loc_{$location}",$html,$cf);
1369
-    }
1370
-
1371
-    // Check if there is a custom field specific filter.
1372
-    if(has_filter("geodir_custom_field_output_textarea_var_{$html_var}")){
1373
-        /**
1374
-         * Filter the textarea html by individual custom field.
1375
-         *
1376
-         * @param string $html The html to filter.
1377
-         * @param string $location The location to output the html.
1378
-         * @param array $cf The custom field array.
1379
-         * @since 1.6.6
1380
-         */
1381
-        $html = apply_filters("geodir_custom_field_output_textarea_var_{$html_var}",$html,$location,$cf);
1382
-    }
1383
-
1384
-    // Check if there is a custom field key specific filter.
1385
-    if(has_filter("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}")){
1386
-        /**
1387
-         * Filter the textarea html by field type key.
1388
-         *
1389
-         * @param string $html The html to filter.
1390
-         * @param string $location The location to output the html.
1391
-         * @param array $cf The custom field array.
1392
-         * @since 1.6.6
1393
-         */
1394
-        $html = apply_filters("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}",$html,$location,$cf);
1395
-    }
1396
-
1397
-    // If not html then we run the standard output.
1398
-    if(empty($html)){
1399
-
1400
-        if (!empty($post->{$cf['htmlvar_name']})) {
1401
-
1402
-            $field_icon = geodir_field_icon_proccess($cf);
1403
-            if (strpos($field_icon, 'http') !== false) {
1404
-                $field_icon_af = '';
1405
-            } elseif ($field_icon == '') {
1406
-                $field_icon_af = '';
1407
-            } else {
1408
-                $field_icon_af = $field_icon;
1409
-                $field_icon = '';
1410
-            }
1411
-
1412
-
1413
-            $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
1414
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1415
-            $html .= '</span>' . wpautop($post->{$cf['htmlvar_name']}) . '</div>';
1416
-
1417
-        }
1418
-
1419
-    }
1420
-
1421
-    return $html;
1348
+	// check we have the post value
1349
+	if(is_int($p)){$post = geodir_get_post_info($p);}
1350
+	else{ global $post;}
1351
+
1352
+	if(!is_array($cf) && $cf!=''){
1353
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1354
+		if(!$cf){return NULL;}
1355
+	}
1356
+
1357
+	$html_var = $cf['htmlvar_name'];
1358
+
1359
+	// Check if there is a location specific filter.
1360
+	if(has_filter("geodir_custom_field_output_textarea_loc_{$location}")){
1361
+		/**
1362
+		 * Filter the textarea html by location.
1363
+		 *
1364
+		 * @param string $html The html to filter.
1365
+		 * @param array $cf The custom field array.
1366
+		 * @since 1.6.6
1367
+		 */
1368
+		$html = apply_filters("geodir_custom_field_output_textarea_loc_{$location}",$html,$cf);
1369
+	}
1370
+
1371
+	// Check if there is a custom field specific filter.
1372
+	if(has_filter("geodir_custom_field_output_textarea_var_{$html_var}")){
1373
+		/**
1374
+		 * Filter the textarea html by individual custom field.
1375
+		 *
1376
+		 * @param string $html The html to filter.
1377
+		 * @param string $location The location to output the html.
1378
+		 * @param array $cf The custom field array.
1379
+		 * @since 1.6.6
1380
+		 */
1381
+		$html = apply_filters("geodir_custom_field_output_textarea_var_{$html_var}",$html,$location,$cf);
1382
+	}
1383
+
1384
+	// Check if there is a custom field key specific filter.
1385
+	if(has_filter("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}")){
1386
+		/**
1387
+		 * Filter the textarea html by field type key.
1388
+		 *
1389
+		 * @param string $html The html to filter.
1390
+		 * @param string $location The location to output the html.
1391
+		 * @param array $cf The custom field array.
1392
+		 * @since 1.6.6
1393
+		 */
1394
+		$html = apply_filters("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}",$html,$location,$cf);
1395
+	}
1396
+
1397
+	// If not html then we run the standard output.
1398
+	if(empty($html)){
1399
+
1400
+		if (!empty($post->{$cf['htmlvar_name']})) {
1401
+
1402
+			$field_icon = geodir_field_icon_proccess($cf);
1403
+			if (strpos($field_icon, 'http') !== false) {
1404
+				$field_icon_af = '';
1405
+			} elseif ($field_icon == '') {
1406
+				$field_icon_af = '';
1407
+			} else {
1408
+				$field_icon_af = $field_icon;
1409
+				$field_icon = '';
1410
+			}
1411
+
1412
+
1413
+			$html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
1414
+			$html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1415
+			$html .= '</span>' . wpautop($post->{$cf['htmlvar_name']}) . '</div>';
1416
+
1417
+		}
1418
+
1419
+	}
1420
+
1421
+	return $html;
1422 1422
 }
1423 1423
 add_filter('geodir_custom_field_output_textarea','geodir_cf_textarea',10,3);
1424 1424
 
@@ -1436,79 +1436,79 @@  discard block
 block discarded – undo
1436 1436
  */
1437 1437
 function geodir_cf_html($html,$location,$cf,$p=''){
1438 1438
 
1439
-    // check we have the post value
1440
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1441
-    else{ global $post;}
1442
-
1443
-    if(!is_array($cf) && $cf!=''){
1444
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1445
-        if(!$cf){return NULL;}
1446
-    }
1447
-
1448
-    $html_var = $cf['htmlvar_name'];
1449
-
1450
-    // Check if there is a location specific filter.
1451
-    if(has_filter("geodir_custom_field_output_html_loc_{$location}")){
1452
-        /**
1453
-         * Filter the html html by location.
1454
-         *
1455
-         * @param string $html The html to filter.
1456
-         * @param array $cf The custom field array.
1457
-         * @since 1.6.6
1458
-         */
1459
-        $html = apply_filters("geodir_custom_field_output_html_loc_{$location}",$html,$cf);
1460
-    }
1461
-
1462
-    // Check if there is a custom field specific filter.
1463
-    if(has_filter("geodir_custom_field_output_html_var_{$html_var}")){
1464
-        /**
1465
-         * Filter the html html by individual custom field.
1466
-         *
1467
-         * @param string $html The html to filter.
1468
-         * @param string $location The location to output the html.
1469
-         * @param array $cf The custom field array.
1470
-         * @since 1.6.6
1471
-         */
1472
-        $html = apply_filters("geodir_custom_field_output_html_var_{$html_var}",$html,$location,$cf);
1473
-    }
1474
-
1475
-    // Check if there is a custom field key specific filter.
1476
-    if(has_filter("geodir_custom_field_output_html_key_{$cf['field_type_key']}")){
1477
-        /**
1478
-         * Filter the html html by field type key.
1479
-         *
1480
-         * @param string $html The html to filter.
1481
-         * @param string $location The location to output the html.
1482
-         * @param array $cf The custom field array.
1483
-         * @since 1.6.6
1484
-         */
1485
-        $html = apply_filters("geodir_custom_field_output_html_key_{$cf['field_type_key']}",$html,$location,$cf);
1486
-    }
1487
-
1488
-    // If not html then we run the standard output.
1489
-    if(empty($html)){
1490
-
1491
-        if (!empty($post->{$cf['htmlvar_name']})) {
1492
-
1493
-            $field_icon = geodir_field_icon_proccess($cf);
1494
-            if (strpos($field_icon, 'http') !== false) {
1495
-                $field_icon_af = '';
1496
-            } elseif ($field_icon == '') {
1497
-                $field_icon_af = '';
1498
-            } else {
1499
-                $field_icon_af = $field_icon;
1500
-                $field_icon = '';
1501
-            }
1502
-
1503
-            $html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
1504
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1505
-            $html .= '</span>' . wpautop($post->{$cf['htmlvar_name']}) . '</div>';
1506
-
1507
-        }
1508
-
1509
-    }
1510
-
1511
-    return $html;
1439
+	// check we have the post value
1440
+	if(is_int($p)){$post = geodir_get_post_info($p);}
1441
+	else{ global $post;}
1442
+
1443
+	if(!is_array($cf) && $cf!=''){
1444
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1445
+		if(!$cf){return NULL;}
1446
+	}
1447
+
1448
+	$html_var = $cf['htmlvar_name'];
1449
+
1450
+	// Check if there is a location specific filter.
1451
+	if(has_filter("geodir_custom_field_output_html_loc_{$location}")){
1452
+		/**
1453
+		 * Filter the html html by location.
1454
+		 *
1455
+		 * @param string $html The html to filter.
1456
+		 * @param array $cf The custom field array.
1457
+		 * @since 1.6.6
1458
+		 */
1459
+		$html = apply_filters("geodir_custom_field_output_html_loc_{$location}",$html,$cf);
1460
+	}
1461
+
1462
+	// Check if there is a custom field specific filter.
1463
+	if(has_filter("geodir_custom_field_output_html_var_{$html_var}")){
1464
+		/**
1465
+		 * Filter the html html by individual custom field.
1466
+		 *
1467
+		 * @param string $html The html to filter.
1468
+		 * @param string $location The location to output the html.
1469
+		 * @param array $cf The custom field array.
1470
+		 * @since 1.6.6
1471
+		 */
1472
+		$html = apply_filters("geodir_custom_field_output_html_var_{$html_var}",$html,$location,$cf);
1473
+	}
1474
+
1475
+	// Check if there is a custom field key specific filter.
1476
+	if(has_filter("geodir_custom_field_output_html_key_{$cf['field_type_key']}")){
1477
+		/**
1478
+		 * Filter the html html by field type key.
1479
+		 *
1480
+		 * @param string $html The html to filter.
1481
+		 * @param string $location The location to output the html.
1482
+		 * @param array $cf The custom field array.
1483
+		 * @since 1.6.6
1484
+		 */
1485
+		$html = apply_filters("geodir_custom_field_output_html_key_{$cf['field_type_key']}",$html,$location,$cf);
1486
+	}
1487
+
1488
+	// If not html then we run the standard output.
1489
+	if(empty($html)){
1490
+
1491
+		if (!empty($post->{$cf['htmlvar_name']})) {
1492
+
1493
+			$field_icon = geodir_field_icon_proccess($cf);
1494
+			if (strpos($field_icon, 'http') !== false) {
1495
+				$field_icon_af = '';
1496
+			} elseif ($field_icon == '') {
1497
+				$field_icon_af = '';
1498
+			} else {
1499
+				$field_icon_af = $field_icon;
1500
+				$field_icon = '';
1501
+			}
1502
+
1503
+			$html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
1504
+			$html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1505
+			$html .= '</span>' . wpautop($post->{$cf['htmlvar_name']}) . '</div>';
1506
+
1507
+		}
1508
+
1509
+	}
1510
+
1511
+	return $html;
1512 1512
 }
1513 1513
 add_filter('geodir_custom_field_output_html','geodir_cf_html',10,3);
1514 1514
 
@@ -1526,113 +1526,113 @@  discard block
 block discarded – undo
1526 1526
  */
1527 1527
 function geodir_cf_taxonomy($html,$location,$cf,$p=''){
1528 1528
 
1529
-    // check we have the post value
1530
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1531
-    else{ global $post;}
1532
-
1533
-    if(!is_array($cf) && $cf!=''){
1534
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1535
-        if(!$cf){return NULL;}
1536
-    }
1537
-
1538
-    $html_var = $cf['htmlvar_name'];
1539
-
1540
-    // Check if there is a location specific filter.
1541
-    if(has_filter("geodir_custom_field_output_taxonomy_loc_{$location}")){
1542
-        /**
1543
-         * Filter the taxonomy html by location.
1544
-         *
1545
-         * @param string $html The html to filter.
1546
-         * @param array $cf The custom field array.
1547
-         * @since 1.6.6
1548
-         */
1549
-        $html = apply_filters("geodir_custom_field_output_taxonomy_loc_{$location}",$html,$cf);
1550
-    }
1551
-
1552
-    // Check if there is a custom field specific filter.
1553
-    if(has_filter("geodir_custom_field_output_taxonomy_var_{$html_var}")){
1554
-        /**
1555
-         * Filter the taxonomy html by individual custom field.
1556
-         *
1557
-         * @param string $html The html to filter.
1558
-         * @param string $location The location to output the html.
1559
-         * @param array $cf The custom field array.
1560
-         * @since 1.6.6
1561
-         */
1562
-        $html = apply_filters("geodir_custom_field_output_taxonomy_var_{$html_var}",$html,$location,$cf);
1563
-    }
1564
-
1565
-    // Check if there is a custom field key specific filter.
1566
-    if(has_filter("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}")){
1567
-        /**
1568
-         * Filter the taxonomy html by field type key.
1569
-         *
1570
-         * @param string $html The html to filter.
1571
-         * @param string $location The location to output the html.
1572
-         * @param array $cf The custom field array.
1573
-         * @since 1.6.6
1574
-         */
1575
-        $html = apply_filters("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}",$html,$location,$cf);
1576
-    }
1577
-
1578
-    // If not html then we run the standard output.
1579
-    if(empty($html)){
1580
-
1581
-        if ($html_var == $post->post_type . 'category' && !empty($post->{$html_var})) {
1582
-            $post_taxonomy = $post->post_type . 'category';
1583
-            $field_value = $post->{$html_var};
1584
-            $links = array();
1585
-            $terms = array();
1586
-            $termsOrdered = array();
1587
-            if (!is_array($field_value)) {
1588
-                $field_value = explode(",", trim($field_value, ","));
1589
-            }
1590
-
1591
-            $field_value = array_unique($field_value);
1592
-
1593
-            if (!empty($field_value)) {
1594
-                foreach ($field_value as $term) {
1595
-                    $term = trim($term);
1596
-
1597
-                    if ($term != '') {
1598
-                        $term = get_term_by('id', $term, $html_var);
1599
-                        if (is_object($term)) {
1600
-                            $links[] = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>" . $term->name . "</a>";
1601
-                            $terms[] = $term;
1602
-                        }
1603
-                    }
1604
-                }
1605
-                if (!empty($links)) {
1606
-                    // order alphabetically
1607
-                    asort($links);
1608
-                    foreach (array_keys($links) as $key) {
1609
-                        $termsOrdered[$key] = $terms[$key];
1610
-                    }
1611
-                    $terms = $termsOrdered;
1612
-                }
1613
-            }
1614
-            $html_value = !empty($links) && !empty($terms) ? wp_sprintf('%l', $links, (object)$terms) : '';
1615
-
1616
-            if ($html_value != '') {
1617
-                $field_icon = geodir_field_icon_proccess($cf);
1618
-                if (strpos($field_icon, 'http') !== false) {
1619
-                    $field_icon_af = '';
1620
-                } else if ($field_icon == '') {
1621
-                    $field_icon_af = '';
1622
-                } else {
1623
-                    $field_icon_af = $field_icon;
1624
-                    $field_icon = '';
1625
-                }
1626
-
1627
-                $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $html_var . '" style="clear:both;"><span class="geodir-i-taxonomy geodir-i-category" style="' . $field_icon . '">' . $field_icon_af;
1628
-                $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1629
-                $html .= '</span> ' . $html_value . '</div>';
1630
-            }
1631
-        }
1632
-
1633
-    }
1634
-
1635
-    return $html;
1529
+	// check we have the post value
1530
+	if(is_int($p)){$post = geodir_get_post_info($p);}
1531
+	else{ global $post;}
1532
+
1533
+	if(!is_array($cf) && $cf!=''){
1534
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1535
+		if(!$cf){return NULL;}
1536
+	}
1537
+
1538
+	$html_var = $cf['htmlvar_name'];
1539
+
1540
+	// Check if there is a location specific filter.
1541
+	if(has_filter("geodir_custom_field_output_taxonomy_loc_{$location}")){
1542
+		/**
1543
+		 * Filter the taxonomy html by location.
1544
+		 *
1545
+		 * @param string $html The html to filter.
1546
+		 * @param array $cf The custom field array.
1547
+		 * @since 1.6.6
1548
+		 */
1549
+		$html = apply_filters("geodir_custom_field_output_taxonomy_loc_{$location}",$html,$cf);
1550
+	}
1551
+
1552
+	// Check if there is a custom field specific filter.
1553
+	if(has_filter("geodir_custom_field_output_taxonomy_var_{$html_var}")){
1554
+		/**
1555
+		 * Filter the taxonomy html by individual custom field.
1556
+		 *
1557
+		 * @param string $html The html to filter.
1558
+		 * @param string $location The location to output the html.
1559
+		 * @param array $cf The custom field array.
1560
+		 * @since 1.6.6
1561
+		 */
1562
+		$html = apply_filters("geodir_custom_field_output_taxonomy_var_{$html_var}",$html,$location,$cf);
1563
+	}
1564
+
1565
+	// Check if there is a custom field key specific filter.
1566
+	if(has_filter("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}")){
1567
+		/**
1568
+		 * Filter the taxonomy html by field type key.
1569
+		 *
1570
+		 * @param string $html The html to filter.
1571
+		 * @param string $location The location to output the html.
1572
+		 * @param array $cf The custom field array.
1573
+		 * @since 1.6.6
1574
+		 */
1575
+		$html = apply_filters("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}",$html,$location,$cf);
1576
+	}
1577
+
1578
+	// If not html then we run the standard output.
1579
+	if(empty($html)){
1580
+
1581
+		if ($html_var == $post->post_type . 'category' && !empty($post->{$html_var})) {
1582
+			$post_taxonomy = $post->post_type . 'category';
1583
+			$field_value = $post->{$html_var};
1584
+			$links = array();
1585
+			$terms = array();
1586
+			$termsOrdered = array();
1587
+			if (!is_array($field_value)) {
1588
+				$field_value = explode(",", trim($field_value, ","));
1589
+			}
1590
+
1591
+			$field_value = array_unique($field_value);
1592
+
1593
+			if (!empty($field_value)) {
1594
+				foreach ($field_value as $term) {
1595
+					$term = trim($term);
1596
+
1597
+					if ($term != '') {
1598
+						$term = get_term_by('id', $term, $html_var);
1599
+						if (is_object($term)) {
1600
+							$links[] = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>" . $term->name . "</a>";
1601
+							$terms[] = $term;
1602
+						}
1603
+					}
1604
+				}
1605
+				if (!empty($links)) {
1606
+					// order alphabetically
1607
+					asort($links);
1608
+					foreach (array_keys($links) as $key) {
1609
+						$termsOrdered[$key] = $terms[$key];
1610
+					}
1611
+					$terms = $termsOrdered;
1612
+				}
1613
+			}
1614
+			$html_value = !empty($links) && !empty($terms) ? wp_sprintf('%l', $links, (object)$terms) : '';
1615
+
1616
+			if ($html_value != '') {
1617
+				$field_icon = geodir_field_icon_proccess($cf);
1618
+				if (strpos($field_icon, 'http') !== false) {
1619
+					$field_icon_af = '';
1620
+				} else if ($field_icon == '') {
1621
+					$field_icon_af = '';
1622
+				} else {
1623
+					$field_icon_af = $field_icon;
1624
+					$field_icon = '';
1625
+				}
1626
+
1627
+				$html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $html_var . '" style="clear:both;"><span class="geodir-i-taxonomy geodir-i-category" style="' . $field_icon . '">' . $field_icon_af;
1628
+				$html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1629
+				$html .= '</span> ' . $html_value . '</div>';
1630
+			}
1631
+		}
1632
+
1633
+	}
1634
+
1635
+	return $html;
1636 1636
 }
1637 1637
 add_filter('geodir_custom_field_output_taxonomy','geodir_cf_taxonomy',10,3);
1638 1638
 
@@ -1649,162 +1649,162 @@  discard block
 block discarded – undo
1649 1649
  */
1650 1650
 function geodir_cf_address($html,$location,$cf,$p=''){
1651 1651
 
1652
-    // check we have the post value
1653
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1654
-    else{ global $post;}
1655
-
1656
-    if(!is_array($cf) && $cf!=''){
1657
-        $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1658
-        if(!$cf){return NULL;}
1659
-    }
1660
-
1661
-    $html_var = $cf['htmlvar_name'];
1662
-
1663
-    // Check if there is a location specific filter.
1664
-    if(has_filter("geodir_custom_field_output_address_loc_{$location}")){
1665
-        /**
1666
-         * Filter the address html by location.
1667
-         *
1668
-         * @param string $html The html to filter.
1669
-         * @param array $cf The custom field array.
1670
-         * @since 1.6.6
1671
-         */
1672
-        $html = apply_filters("geodir_custom_field_output_address_loc_{$location}",$html,$cf);
1673
-    }
1674
-
1675
-    // Check if there is a custom field specific filter.
1676
-    if(has_filter("geodir_custom_field_output_address_var_{$html_var}")){
1677
-        /**
1678
-         * Filter the address html by individual custom field.
1679
-         *
1680
-         * @param string $html The html to filter.
1681
-         * @param string $location The location to output the html.
1682
-         * @param array $cf The custom field array.
1683
-         * @since 1.6.6
1684
-         */
1685
-        $html = apply_filters("geodir_custom_field_output_address_var_{$html_var}",$html,$location,$cf);
1686
-    }
1687
-
1688
-    // Check if there is a custom field key specific filter.
1689
-    if(has_filter("geodir_custom_field_output_address_key_{$cf['field_type_key']}")){
1690
-        /**
1691
-         * Filter the address html by field type key.
1692
-         *
1693
-         * @param string $html The html to filter.
1694
-         * @param string $location The location to output the html.
1695
-         * @param array $cf The custom field array.
1696
-         * @since 1.6.6
1697
-         */
1698
-        $html = apply_filters("geodir_custom_field_output_address_key_{$cf['field_type_key']}",$html,$location,$cf);
1699
-    }
1700
-
1701
-    // If not html then we run the standard output.
1702
-    if(empty($html)){
1703
-
1704
-        global $preview;
1705
-        $html_var = $cf['htmlvar_name'] . '_address';
1706
-
1707
-        if ($cf['extra_fields']) {
1708
-
1709
-            $extra_fields = unserialize($cf['extra_fields']);
1710
-
1711
-            $addition_fields = '';
1712
-
1713
-            if (!empty($extra_fields)) {
1714
-
1715
-                $show_city_in_address = false;
1716
-                if (isset($extra_fields['show_city']) && $extra_fields['show_city']) {
1717
-                    $show_city_in_address = true;
1718
-                }
1719
-                /**
1720
-                 * Filter "show city in address" value.
1721
-                 *
1722
-                 * @since 1.0.0
1723
-                 */
1724
-                $show_city_in_address = apply_filters('geodir_show_city_in_address', $show_city_in_address);
1725
-
1726
-
1727
-                $show_region_in_address = false;
1728
-                if (isset($extra_fields['show_region']) && $extra_fields['show_region']) {
1729
-                    $show_region_in_address = true;
1730
-                }
1731
-                /**
1732
-                 * Filter "show region in address" value.
1733
-                 *
1734
-                 * @since 1.6.6
1735
-                 */
1736
-                $show_region_in_address = apply_filters('geodir_show_region_in_address', $show_region_in_address);
1737
-
1738
-                $show_country_in_address = false;
1739
-                if (isset($extra_fields['show_country']) && $extra_fields['show_country']) {
1740
-                    $show_country_in_address = true;
1741
-                }
1742
-                /**
1743
-                 * Filter "show country in address" value.
1744
-                 *
1745
-                 * @since 1.6.6
1746
-                 */
1747
-                $show_country_in_address = apply_filters('geodir_show_country_in_address', $show_country_in_address);
1748
-
1749
-                $show_zip_in_address = false;
1750
-                if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) {
1751
-                    $show_zip_in_address = true;
1752
-                }
1753
-                /**
1754
-                 * Filter "show zip in address" value.
1755
-                 *
1756
-                 * @since 1.6.6
1757
-                 */
1758
-                $show_zip_in_address = apply_filters('geodir_show_zip_in_address', $show_zip_in_address);
1759
-
1760
-
1761
-            }
1762
-
1763
-        }
1764
-
1765
-
1766
-        if ($post->{$html_var}) {
1767
-
1768
-            $field_icon = geodir_field_icon_proccess( $cf );
1769
-            if ( strpos( $field_icon, 'http' ) !== false ) {
1770
-                $field_icon_af = '';
1771
-            } elseif ( $field_icon == '' ) {
1772
-                $field_icon_af = '<i class="fa fa-home"></i>';
1773
-            } else {
1774
-                $field_icon_af = $field_icon;
1775
-                $field_icon    = '';
1776
-            }
1652
+	// check we have the post value
1653
+	if(is_int($p)){$post = geodir_get_post_info($p);}
1654
+	else{ global $post;}
1655
+
1656
+	if(!is_array($cf) && $cf!=''){
1657
+		$cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1658
+		if(!$cf){return NULL;}
1659
+	}
1660
+
1661
+	$html_var = $cf['htmlvar_name'];
1662
+
1663
+	// Check if there is a location specific filter.
1664
+	if(has_filter("geodir_custom_field_output_address_loc_{$location}")){
1665
+		/**
1666
+		 * Filter the address html by location.
1667
+		 *
1668
+		 * @param string $html The html to filter.
1669
+		 * @param array $cf The custom field array.
1670
+		 * @since 1.6.6
1671
+		 */
1672
+		$html = apply_filters("geodir_custom_field_output_address_loc_{$location}",$html,$cf);
1673
+	}
1674
+
1675
+	// Check if there is a custom field specific filter.
1676
+	if(has_filter("geodir_custom_field_output_address_var_{$html_var}")){
1677
+		/**
1678
+		 * Filter the address html by individual custom field.
1679
+		 *
1680
+		 * @param string $html The html to filter.
1681
+		 * @param string $location The location to output the html.
1682
+		 * @param array $cf The custom field array.
1683
+		 * @since 1.6.6
1684
+		 */
1685
+		$html = apply_filters("geodir_custom_field_output_address_var_{$html_var}",$html,$location,$cf);
1686
+	}
1687
+
1688
+	// Check if there is a custom field key specific filter.
1689
+	if(has_filter("geodir_custom_field_output_address_key_{$cf['field_type_key']}")){
1690
+		/**
1691
+		 * Filter the address html by field type key.
1692
+		 *
1693
+		 * @param string $html The html to filter.
1694
+		 * @param string $location The location to output the html.
1695
+		 * @param array $cf The custom field array.
1696
+		 * @since 1.6.6
1697
+		 */
1698
+		$html = apply_filters("geodir_custom_field_output_address_key_{$cf['field_type_key']}",$html,$location,$cf);
1699
+	}
1700
+
1701
+	// If not html then we run the standard output.
1702
+	if(empty($html)){
1703
+
1704
+		global $preview;
1705
+		$html_var = $cf['htmlvar_name'] . '_address';
1706
+
1707
+		if ($cf['extra_fields']) {
1708
+
1709
+			$extra_fields = unserialize($cf['extra_fields']);
1710
+
1711
+			$addition_fields = '';
1712
+
1713
+			if (!empty($extra_fields)) {
1714
+
1715
+				$show_city_in_address = false;
1716
+				if (isset($extra_fields['show_city']) && $extra_fields['show_city']) {
1717
+					$show_city_in_address = true;
1718
+				}
1719
+				/**
1720
+				 * Filter "show city in address" value.
1721
+				 *
1722
+				 * @since 1.0.0
1723
+				 */
1724
+				$show_city_in_address = apply_filters('geodir_show_city_in_address', $show_city_in_address);
1725
+
1726
+
1727
+				$show_region_in_address = false;
1728
+				if (isset($extra_fields['show_region']) && $extra_fields['show_region']) {
1729
+					$show_region_in_address = true;
1730
+				}
1731
+				/**
1732
+				 * Filter "show region in address" value.
1733
+				 *
1734
+				 * @since 1.6.6
1735
+				 */
1736
+				$show_region_in_address = apply_filters('geodir_show_region_in_address', $show_region_in_address);
1737
+
1738
+				$show_country_in_address = false;
1739
+				if (isset($extra_fields['show_country']) && $extra_fields['show_country']) {
1740
+					$show_country_in_address = true;
1741
+				}
1742
+				/**
1743
+				 * Filter "show country in address" value.
1744
+				 *
1745
+				 * @since 1.6.6
1746
+				 */
1747
+				$show_country_in_address = apply_filters('geodir_show_country_in_address', $show_country_in_address);
1748
+
1749
+				$show_zip_in_address = false;
1750
+				if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) {
1751
+					$show_zip_in_address = true;
1752
+				}
1753
+				/**
1754
+				 * Filter "show zip in address" value.
1755
+				 *
1756
+				 * @since 1.6.6
1757
+				 */
1758
+				$show_zip_in_address = apply_filters('geodir_show_zip_in_address', $show_zip_in_address);
1759
+
1760
+
1761
+			}
1762
+
1763
+		}
1764
+
1765
+
1766
+		if ($post->{$html_var}) {
1767
+
1768
+			$field_icon = geodir_field_icon_proccess( $cf );
1769
+			if ( strpos( $field_icon, 'http' ) !== false ) {
1770
+				$field_icon_af = '';
1771
+			} elseif ( $field_icon == '' ) {
1772
+				$field_icon_af = '<i class="fa fa-home"></i>';
1773
+			} else {
1774
+				$field_icon_af = $field_icon;
1775
+				$field_icon    = '';
1776
+			}
1777 1777
             
1778 1778
 
1779 1779
 
1780
-            $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"  itemscope itemtype="http://schema.org/PostalAddress">';
1781
-            $html .= '<span class="geodir-i-location" style="' . $field_icon . '">' . $field_icon_af;
1782
-            $html .= ( trim( $cf['site_title'] ) ) ? __( $cf['site_title'], 'geodirectory' ) . ': ' : '&nbsp;';
1783
-            $html .= '</span>';
1780
+			$html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"  itemscope itemtype="http://schema.org/PostalAddress">';
1781
+			$html .= '<span class="geodir-i-location" style="' . $field_icon . '">' . $field_icon_af;
1782
+			$html .= ( trim( $cf['site_title'] ) ) ? __( $cf['site_title'], 'geodirectory' ) . ': ' : '&nbsp;';
1783
+			$html .= '</span>';
1784 1784
 
1785 1785
 
1786
-            if ( $post->post_address ) {
1787
-                $html .= '<span itemprop="streetAddress">' . $post->post_address . '</span><br>';
1788
-            }
1789
-            if ($show_city_in_address && $post->post_city ) {
1790
-                $html .= '<span itemprop="addressLocality">' . $post->post_city . '</span><br>';
1791
-            }
1792
-            if ($show_region_in_address && $post->post_region ) {
1793
-                $html .= '<span itemprop="addressRegion">' . $post->post_region . '</span><br>';
1794
-            }
1795
-            if ($show_zip_in_address && $post->post_zip ) {
1796
-                $html .= '<span itemprop="postalCode">' . $post->post_zip . '</span><br>';
1797
-            }
1798
-            if ($show_country_in_address && $post->post_country ) {
1799
-                $html .= '<span itemprop="addressCountry">' . __( $post->post_country, 'geodirectory' ) . '</span><br>';
1800
-            }
1801
-            $html .= '</div>';
1786
+			if ( $post->post_address ) {
1787
+				$html .= '<span itemprop="streetAddress">' . $post->post_address . '</span><br>';
1788
+			}
1789
+			if ($show_city_in_address && $post->post_city ) {
1790
+				$html .= '<span itemprop="addressLocality">' . $post->post_city . '</span><br>';
1791
+			}
1792
+			if ($show_region_in_address && $post->post_region ) {
1793
+				$html .= '<span itemprop="addressRegion">' . $post->post_region . '</span><br>';
1794
+			}
1795
+			if ($show_zip_in_address && $post->post_zip ) {
1796
+				$html .= '<span itemprop="postalCode">' . $post->post_zip . '</span><br>';
1797
+			}
1798
+			if ($show_country_in_address && $post->post_country ) {
1799
+				$html .= '<span itemprop="addressCountry">' . __( $post->post_country, 'geodirectory' ) . '</span><br>';
1800
+			}
1801
+			$html .= '</div>';
1802 1802
 
1803
-        }
1803
+		}
1804 1804
 
1805
-    }
1805
+	}
1806 1806
 
1807 1807
 
1808
-    return $html;
1808
+	return $html;
1809 1809
 }
1810 1810
 add_filter('geodir_custom_field_output_address','geodir_cf_address',10,3);
1811 1811
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +299 added lines, -299 removed lines patch added patch discarded remove patch
@@ -19,21 +19,21 @@  discard block
 block discarded – undo
19 19
  *
20 20
  * @return string The html to output for the custom field.
21 21
  */
22
-function geodir_cf_checkbox($html,$location,$cf,$p=''){
22
+function geodir_cf_checkbox($html, $location, $cf, $p = '') {
23 23
 
24 24
     // check we have the post value
25
-    if(is_int($p)){$post = geodir_get_post_info($p);}
26
-    else{ global $post;}
25
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
26
+    else { global $post; }
27 27
 
28
-    if(!is_array($cf) && $cf!=''){
28
+    if (!is_array($cf) && $cf != '') {
29 29
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
30
-        if(!$cf){return NULL;}
30
+        if (!$cf) {return NULL; }
31 31
     }
32 32
 
33 33
     $html_var = $cf['htmlvar_name'];
34 34
 
35 35
     // Check if there is a location specific filter.
36
-    if(has_filter("geodir_custom_field_output_checkbox_loc_{$location}")){
36
+    if (has_filter("geodir_custom_field_output_checkbox_loc_{$location}")) {
37 37
         /**
38 38
          * Filter the checkbox html by location.
39 39
          *
@@ -41,11 +41,11 @@  discard block
 block discarded – undo
41 41
          * @param array $cf The custom field array.
42 42
          * @since 1.6.6
43 43
          */
44
-        $html = apply_filters("geodir_custom_field_output_checkbox_loc_{$location}",$html,$cf);
44
+        $html = apply_filters("geodir_custom_field_output_checkbox_loc_{$location}", $html, $cf);
45 45
     }
46 46
 
47 47
     // Check if there is a custom field specific filter.
48
-    if(has_filter("geodir_custom_field_output_checkbox_var_{$html_var}")){
48
+    if (has_filter("geodir_custom_field_output_checkbox_var_{$html_var}")) {
49 49
         /**
50 50
          * Filter the checkbox html by individual custom field.
51 51
          *
@@ -54,11 +54,11 @@  discard block
 block discarded – undo
54 54
          * @param array $cf The custom field array.
55 55
          * @since 1.6.6
56 56
          */
57
-        $html = apply_filters("geodir_custom_field_output_checkbox_var_{$html_var}",$html,$location,$cf);
57
+        $html = apply_filters("geodir_custom_field_output_checkbox_var_{$html_var}", $html, $location, $cf);
58 58
     }
59 59
 
60 60
     // Check if there is a custom field key specific filter.
61
-    if(has_filter("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}")){
61
+    if (has_filter("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}")) {
62 62
         /**
63 63
          * Filter the checkbox html by field type key.
64 64
          *
@@ -67,18 +67,18 @@  discard block
 block discarded – undo
67 67
          * @param array $cf The custom field array.
68 68
          * @since 1.6.6
69 69
          */
70
-        $html = apply_filters("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}",$html,$location,$cf);
70
+        $html = apply_filters("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}", $html, $location, $cf);
71 71
     }
72 72
 
73 73
     // If not html then we run the standard output.
74
-    if(empty($html)){
74
+    if (empty($html)) {
75 75
 
76
-        if ( (int) $post->{$html_var} == 1 ):
76
+        if ((int) $post->{$html_var} == 1):
77 77
 
78
-            if ( $post->{$html_var} == '1' ):
79
-                $html_val = __( 'Yes', 'geodirectory' );
78
+            if ($post->{$html_var} == '1'):
79
+                $html_val = __('Yes', 'geodirectory');
80 80
             else:
81
-                $html_val = __( 'No', 'geodirectory' );
81
+                $html_val = __('No', 'geodirectory');
82 82
             endif;
83 83
 
84 84
             $field_icon = geodir_field_icon_proccess($cf);
@@ -91,16 +91,16 @@  discard block
 block discarded – undo
91 91
                 $field_icon = '';
92 92
             }
93 93
 
94
-            $html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-checkbox" style="' . $field_icon . '">' . $field_icon_af;
95
-            $html .= ( trim( $cf['site_title'] ) ) ? __( $cf['site_title'], 'geodirectory' ) . ': ' : '';
96
-            $html .= '</span>' . $html_val . '</div>';
94
+            $html = '<div class="geodir_more_info  '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-checkbox" style="'.$field_icon.'">'.$field_icon_af;
95
+            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : '';
96
+            $html .= '</span>'.$html_val.'</div>';
97 97
         endif;
98 98
 
99 99
     }
100 100
 
101 101
     return $html;
102 102
 }
103
-add_filter('geodir_custom_field_output_checkbox','geodir_cf_checkbox',10,3);
103
+add_filter('geodir_custom_field_output_checkbox', 'geodir_cf_checkbox', 10, 3);
104 104
 
105 105
 
106 106
 /**
@@ -113,21 +113,21 @@  discard block
 block discarded – undo
113 113
  *
114 114
  * @return string The html to output for the custom field.
115 115
  */
116
-function geodir_cf_fieldset($html,$location,$cf,$p=''){
116
+function geodir_cf_fieldset($html, $location, $cf, $p = '') {
117 117
 
118 118
     // check we have the post value
119
-    if(is_int($p)){$post = geodir_get_post_info($p);}
120
-    else{ global $post;}
119
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
120
+    else { global $post; }
121 121
 
122
-    if(!is_array($cf) && $cf!=''){
122
+    if (!is_array($cf) && $cf != '') {
123 123
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
124
-        if(!$cf){return NULL;}
124
+        if (!$cf) {return NULL; }
125 125
     }
126 126
 
127 127
     $html_var = $cf['htmlvar_name'];
128 128
 
129 129
     // Check if there is a location specific filter.
130
-    if(has_filter("geodir_custom_field_output_fieldset_loc_{$location}")){
130
+    if (has_filter("geodir_custom_field_output_fieldset_loc_{$location}")) {
131 131
         /**
132 132
          * Filter the fieldset html by location.
133 133
          *
@@ -135,11 +135,11 @@  discard block
 block discarded – undo
135 135
          * @param array $cf The custom field array.
136 136
          * @since 1.6.6
137 137
          */
138
-        $html = apply_filters("geodir_custom_field_output_fieldset_loc_{$location}",$html,$cf);
138
+        $html = apply_filters("geodir_custom_field_output_fieldset_loc_{$location}", $html, $cf);
139 139
     }
140 140
 
141 141
     // Check if there is a custom field specific filter.
142
-    if(has_filter("geodir_custom_field_output_fieldset_var_{$html_var}")){
142
+    if (has_filter("geodir_custom_field_output_fieldset_var_{$html_var}")) {
143 143
         /**
144 144
          * Filter the fieldset html by individual custom field.
145 145
          *
@@ -148,11 +148,11 @@  discard block
 block discarded – undo
148 148
          * @param array $cf The custom field array.
149 149
          * @since 1.6.6
150 150
          */
151
-        $html = apply_filters("geodir_custom_field_output_fieldset_var_{$html_var}",$html,$location,$cf);
151
+        $html = apply_filters("geodir_custom_field_output_fieldset_var_{$html_var}", $html, $location, $cf);
152 152
     }
153 153
 
154 154
     // Check if there is a custom field key specific filter.
155
-    if(has_filter("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}")){
155
+    if (has_filter("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}")) {
156 156
         /**
157 157
          * Filter the fieldset html by field type key.
158 158
          *
@@ -161,19 +161,19 @@  discard block
 block discarded – undo
161 161
          * @param array $cf The custom field array.
162 162
          * @since 1.6.6
163 163
          */
164
-        $html = apply_filters("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}",$html,$location,$cf);
164
+        $html = apply_filters("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}", $html, $location, $cf);
165 165
     }
166 166
 
167 167
     // If not html then we run the standard output.
168
-    if(empty($html)){
168
+    if (empty($html)) {
169 169
 
170 170
         global $field_set_start;
171 171
         $fieldset_class = 'fieldset-'.sanitize_title_with_dashes($cf['site_title']);
172 172
 
173 173
         if ($field_set_start == 1) {
174
-            echo '</div><div class="geodir-company_info field-group ' . $cf['htmlvar_name'] . '"><h2 class="'.$fieldset_class.'">' . __($cf['site_title'], 'geodirectory') . '</h2>';
174
+            echo '</div><div class="geodir-company_info field-group '.$cf['htmlvar_name'].'"><h2 class="'.$fieldset_class.'">'.__($cf['site_title'], 'geodirectory').'</h2>';
175 175
         } else {
176
-            echo '<h2 class="'.$fieldset_class.'">' . __($cf['site_title'], 'geodirectory') . '</h2>';
176
+            echo '<h2 class="'.$fieldset_class.'">'.__($cf['site_title'], 'geodirectory').'</h2>';
177 177
             $field_set_start = 1;
178 178
         }
179 179
 
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 
182 182
     return $html;
183 183
 }
184
-add_filter('geodir_custom_field_output_fieldset','geodir_cf_fieldset',10,3);
184
+add_filter('geodir_custom_field_output_fieldset', 'geodir_cf_fieldset', 10, 3);
185 185
 
186 186
 
187 187
 /**
@@ -194,21 +194,21 @@  discard block
 block discarded – undo
194 194
  *
195 195
  * @return string The html to output for the custom field.
196 196
  */
197
-function geodir_cf_url($html,$location,$cf,$p=''){
197
+function geodir_cf_url($html, $location, $cf, $p = '') {
198 198
 
199 199
     // check we have the post value
200
-    if(is_int($p)){$post = geodir_get_post_info($p);}
201
-    else{ global $post;}
200
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
201
+    else { global $post; }
202 202
 
203
-    if(!is_array($cf) && $cf!=''){
203
+    if (!is_array($cf) && $cf != '') {
204 204
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
205
-        if(!$cf){return NULL;}
205
+        if (!$cf) {return NULL; }
206 206
     }
207 207
 
208 208
     $html_var = $cf['htmlvar_name'];
209 209
 
210 210
     // Check if there is a location specific filter.
211
-    if(has_filter("geodir_custom_field_output_url_loc_{$location}")){
211
+    if (has_filter("geodir_custom_field_output_url_loc_{$location}")) {
212 212
         /**
213 213
          * Filter the url html by location.
214 214
          *
@@ -216,11 +216,11 @@  discard block
 block discarded – undo
216 216
          * @param array $cf The custom field array.
217 217
          * @since 1.6.6
218 218
          */
219
-        $html = apply_filters("geodir_custom_field_output_url_loc_{$location}",$html,$cf);
219
+        $html = apply_filters("geodir_custom_field_output_url_loc_{$location}", $html, $cf);
220 220
     }
221 221
 
222 222
     // Check if there is a custom field specific filter.
223
-    if(has_filter("geodir_custom_field_output_url_var_{$html_var}")){
223
+    if (has_filter("geodir_custom_field_output_url_var_{$html_var}")) {
224 224
         /**
225 225
          * Filter the url html by individual custom field.
226 226
          *
@@ -229,11 +229,11 @@  discard block
 block discarded – undo
229 229
          * @param array $cf The custom field array.
230 230
          * @since 1.6.6
231 231
          */
232
-        $html = apply_filters("geodir_custom_field_output_url_var_{$html_var}",$html,$location,$cf);
232
+        $html = apply_filters("geodir_custom_field_output_url_var_{$html_var}", $html, $location, $cf);
233 233
     }
234 234
 
235 235
     // Check if there is a custom field key specific filter.
236
-    if(has_filter("geodir_custom_field_output_url_key_{$cf['field_type_key']}")){
236
+    if (has_filter("geodir_custom_field_output_url_key_{$cf['field_type_key']}")) {
237 237
         /**
238 238
          * Filter the url html by field type key.
239 239
          *
@@ -242,11 +242,11 @@  discard block
 block discarded – undo
242 242
          * @param array $cf The custom field array.
243 243
          * @since 1.6.6
244 244
          */
245
-        $html = apply_filters("geodir_custom_field_output_url_key_{$cf['field_type_key']}",$html,$location,$cf);
245
+        $html = apply_filters("geodir_custom_field_output_url_key_{$cf['field_type_key']}", $html, $location, $cf);
246 246
     }
247 247
 
248 248
     // If not html then we run the standard output.
249
-    if(empty($html)){
249
+    if (empty($html)) {
250 250
 
251 251
         if ($post->{$cf['htmlvar_name']}):
252 252
 
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
 
274 274
             $website = !empty($a_url['url']) ? $a_url['url'] : '';
275 275
             $title = !empty($a_url['label']) ? $a_url['label'] : $cf['site_title'];
276
-            if(!empty($cf['default_value'])){$title = $cf['default_value'];}
276
+            if (!empty($cf['default_value'])) {$title = $cf['default_value']; }
277 277
             $title = $title != '' ? __(stripslashes($title), 'geodirectory') : '';
278 278
 
279 279
 
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
              * @param string $website Website URL.
290 290
              * @param int $post->ID Post ID.
291 291
              */
292
-            $html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '"><span class="geodir-i-website" style="' . $field_icon . '">' . $field_icon_af . '<a href="' . $website . '" target="_blank" ' . $rel . ' ><strong>' . apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID) . '</strong></a></span></div>';
292
+            $html = '<div class="geodir_more_info  '.$cf['css_class'].' '.$cf['htmlvar_name'].'"><span class="geodir-i-website" style="'.$field_icon.'">'.$field_icon_af.'<a href="'.$website.'" target="_blank" '.$rel.' ><strong>'.apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID).'</strong></a></span></div>';
293 293
 
294 294
         endif;
295 295
 
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
 
298 298
     return $html;
299 299
 }
300
-add_filter('geodir_custom_field_output_url','geodir_cf_url',10,3);
300
+add_filter('geodir_custom_field_output_url', 'geodir_cf_url', 10, 3);
301 301
 
302 302
 
303 303
 /**
@@ -310,21 +310,21 @@  discard block
 block discarded – undo
310 310
  *
311 311
  * @return string The html to output for the custom field.
312 312
  */
313
-function geodir_cf_phone($html,$location,$cf,$p=''){
313
+function geodir_cf_phone($html, $location, $cf, $p = '') {
314 314
 
315 315
     // check we have the post value
316
-    if(is_int($p)){$post = geodir_get_post_info($p);}
317
-    else{ global $post;}
316
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
317
+    else { global $post; }
318 318
 
319
-    if(!is_array($cf) && $cf!=''){
319
+    if (!is_array($cf) && $cf != '') {
320 320
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
321
-        if(!$cf){return NULL;}
321
+        if (!$cf) {return NULL; }
322 322
     }
323 323
 
324 324
     $html_var = $cf['htmlvar_name'];
325 325
 
326 326
     // Check if there is a location specific filter.
327
-    if(has_filter("geodir_custom_field_output_phone_loc_{$location}")){
327
+    if (has_filter("geodir_custom_field_output_phone_loc_{$location}")) {
328 328
         /**
329 329
          * Filter the phone html by location.
330 330
          *
@@ -332,11 +332,11 @@  discard block
 block discarded – undo
332 332
          * @param array $cf The custom field array.
333 333
          * @since 1.6.6
334 334
          */
335
-        $html = apply_filters("geodir_custom_field_output_phone_loc_{$location}",$html,$cf);
335
+        $html = apply_filters("geodir_custom_field_output_phone_loc_{$location}", $html, $cf);
336 336
     }
337 337
 
338 338
     // Check if there is a custom field specific filter.
339
-    if(has_filter("geodir_custom_field_output_phone_var_{$html_var}")){
339
+    if (has_filter("geodir_custom_field_output_phone_var_{$html_var}")) {
340 340
         /**
341 341
          * Filter the phone html by individual custom field.
342 342
          *
@@ -345,11 +345,11 @@  discard block
 block discarded – undo
345 345
          * @param array $cf The custom field array.
346 346
          * @since 1.6.6
347 347
          */
348
-        $html = apply_filters("geodir_custom_field_output_phone_var_{$html_var}",$html,$location,$cf);
348
+        $html = apply_filters("geodir_custom_field_output_phone_var_{$html_var}", $html, $location, $cf);
349 349
     }
350 350
 
351 351
     // Check if there is a custom field key specific filter.
352
-    if(has_filter("geodir_custom_field_output_phone_key_{$cf['field_type_key']}")){
352
+    if (has_filter("geodir_custom_field_output_phone_key_{$cf['field_type_key']}")) {
353 353
         /**
354 354
          * Filter the phone html by field type key.
355 355
          *
@@ -358,11 +358,11 @@  discard block
 block discarded – undo
358 358
          * @param array $cf The custom field array.
359 359
          * @since 1.6.6
360 360
          */
361
-        $html = apply_filters("geodir_custom_field_output_phone_key_{$cf['field_type_key']}",$html,$location,$cf);
361
+        $html = apply_filters("geodir_custom_field_output_phone_key_{$cf['field_type_key']}", $html, $location, $cf);
362 362
     }
363 363
 
364 364
     // If not html then we run the standard output.
365
-    if(empty($html)){
365
+    if (empty($html)) {
366 366
 
367 367
         if ($post->{$cf['htmlvar_name']}):
368 368
 
@@ -377,9 +377,9 @@  discard block
 block discarded – undo
377 377
             }
378 378
 
379 379
 
380
-            $html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-contact" style="' . $field_icon . '">' . $field_icon_af .
381
-                    $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '&nbsp;';
382
-            $html .= '</span><a href="tel:' . preg_replace('/[^0-9+]/', '', $post->{$cf['htmlvar_name']}) . '">' . $post->{$cf['htmlvar_name']} . '</a></div>';
380
+            $html = '<div class="geodir_more_info  '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-contact" style="'.$field_icon.'">'.$field_icon_af.
381
+                    $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : '&nbsp;';
382
+            $html .= '</span><a href="tel:'.preg_replace('/[^0-9+]/', '', $post->{$cf['htmlvar_name']}).'">'.$post->{$cf['htmlvar_name']}.'</a></div>';
383 383
 
384 384
         endif;
385 385
 
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
 
388 388
     return $html;
389 389
 }
390
-add_filter('geodir_custom_field_output_phone','geodir_cf_phone',10,3);
390
+add_filter('geodir_custom_field_output_phone', 'geodir_cf_phone', 10, 3);
391 391
 
392 392
 
393 393
 /**
@@ -400,21 +400,21 @@  discard block
 block discarded – undo
400 400
  *
401 401
  * @return string The html to output for the custom field.
402 402
  */
403
-function geodir_cf_time($html,$location,$cf,$p=''){
403
+function geodir_cf_time($html, $location, $cf, $p = '') {
404 404
 
405 405
     // check we have the post value
406
-    if(is_int($p)){$post = geodir_get_post_info($p);}
407
-    else{ global $post;}
406
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
407
+    else { global $post; }
408 408
 
409
-    if(!is_array($cf) && $cf!=''){
409
+    if (!is_array($cf) && $cf != '') {
410 410
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
411
-        if(!$cf){return NULL;}
411
+        if (!$cf) {return NULL; }
412 412
     }
413 413
 
414 414
     $html_var = $cf['htmlvar_name'];
415 415
 
416 416
     // Check if there is a location specific filter.
417
-    if(has_filter("geodir_custom_field_output_time_loc_{$location}")){
417
+    if (has_filter("geodir_custom_field_output_time_loc_{$location}")) {
418 418
         /**
419 419
          * Filter the time html by location.
420 420
          *
@@ -422,11 +422,11 @@  discard block
 block discarded – undo
422 422
          * @param array $cf The custom field array.
423 423
          * @since 1.6.6
424 424
          */
425
-        $html = apply_filters("geodir_custom_field_output_time_loc_{$location}",$html,$cf);
425
+        $html = apply_filters("geodir_custom_field_output_time_loc_{$location}", $html, $cf);
426 426
     }
427 427
 
428 428
     // Check if there is a custom field specific filter.
429
-    if(has_filter("geodir_custom_field_output_time_var_{$html_var}")){
429
+    if (has_filter("geodir_custom_field_output_time_var_{$html_var}")) {
430 430
         /**
431 431
          * Filter the time html by individual custom field.
432 432
          *
@@ -435,11 +435,11 @@  discard block
 block discarded – undo
435 435
          * @param array $cf The custom field array.
436 436
          * @since 1.6.6
437 437
          */
438
-        $html = apply_filters("geodir_custom_field_output_time_var_{$html_var}",$html,$location,$cf);
438
+        $html = apply_filters("geodir_custom_field_output_time_var_{$html_var}", $html, $location, $cf);
439 439
     }
440 440
 
441 441
     // Check if there is a custom field key specific filter.
442
-    if(has_filter("geodir_custom_field_output_time_key_{$cf['field_type_key']}")){
442
+    if (has_filter("geodir_custom_field_output_time_key_{$cf['field_type_key']}")) {
443 443
         /**
444 444
          * Filter the time html by field type key.
445 445
          *
@@ -448,11 +448,11 @@  discard block
 block discarded – undo
448 448
          * @param array $cf The custom field array.
449 449
          * @since 1.6.6
450 450
          */
451
-        $html = apply_filters("geodir_custom_field_output_time_key_{$cf['field_type_key']}",$html,$location,$cf);
451
+        $html = apply_filters("geodir_custom_field_output_time_key_{$cf['field_type_key']}", $html, $location, $cf);
452 452
     }
453 453
 
454 454
     // If not html then we run the standard output.
455
-    if(empty($html)){
455
+    if (empty($html)) {
456 456
 
457 457
         if ($post->{$cf['htmlvar_name']}):
458 458
 
@@ -472,9 +472,9 @@  discard block
 block discarded – undo
472 472
             }
473 473
 
474 474
 
475
-            $html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-time" style="' . $field_icon . '">' . $field_icon_af;
476
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '&nbsp;';
477
-            $html .= '</span>' . $value . '</div>';
475
+            $html = '<div class="geodir_more_info  '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-time" style="'.$field_icon.'">'.$field_icon_af;
476
+            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : '&nbsp;';
477
+            $html .= '</span>'.$value.'</div>';
478 478
 
479 479
         endif;
480 480
 
@@ -482,7 +482,7 @@  discard block
 block discarded – undo
482 482
 
483 483
     return $html;
484 484
 }
485
-add_filter('geodir_custom_field_output_time','geodir_cf_time',10,3);
485
+add_filter('geodir_custom_field_output_time', 'geodir_cf_time', 10, 3);
486 486
 
487 487
 
488 488
 /**
@@ -495,21 +495,21 @@  discard block
 block discarded – undo
495 495
  *
496 496
  * @return string The html to output for the custom field.
497 497
  */
498
-function geodir_cf_datepicker($html,$location,$cf,$p=''){
498
+function geodir_cf_datepicker($html, $location, $cf, $p = '') {
499 499
 
500 500
     // check we have the post value
501
-    if(is_int($p)){$post = geodir_get_post_info($p);}
502
-    else{ global $post;}
501
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
502
+    else { global $post; }
503 503
 
504
-    if(!is_array($cf) && $cf!=''){
504
+    if (!is_array($cf) && $cf != '') {
505 505
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
506
-        if(!$cf){return NULL;}
506
+        if (!$cf) {return NULL; }
507 507
     }
508 508
 
509 509
     $html_var = $cf['htmlvar_name'];
510 510
 
511 511
     // Check if there is a location specific filter.
512
-    if(has_filter("geodir_custom_field_output_datepicker_loc_{$location}")){
512
+    if (has_filter("geodir_custom_field_output_datepicker_loc_{$location}")) {
513 513
         /**
514 514
          * Filter the datepicker html by location.
515 515
          *
@@ -517,11 +517,11 @@  discard block
 block discarded – undo
517 517
          * @param array $cf The custom field array.
518 518
          * @since 1.6.6
519 519
          */
520
-        $html = apply_filters("geodir_custom_field_output_datepicker_loc_{$location}",$html,$cf);
520
+        $html = apply_filters("geodir_custom_field_output_datepicker_loc_{$location}", $html, $cf);
521 521
     }
522 522
 
523 523
     // Check if there is a custom field specific filter.
524
-    if(has_filter("geodir_custom_field_output_datepicker_var_{$html_var}")){
524
+    if (has_filter("geodir_custom_field_output_datepicker_var_{$html_var}")) {
525 525
         /**
526 526
          * Filter the datepicker html by individual custom field.
527 527
          *
@@ -530,11 +530,11 @@  discard block
 block discarded – undo
530 530
          * @param array $cf The custom field array.
531 531
          * @since 1.6.6
532 532
          */
533
-        $html = apply_filters("geodir_custom_field_output_datepicker_var_{$html_var}",$html,$location,$cf);
533
+        $html = apply_filters("geodir_custom_field_output_datepicker_var_{$html_var}", $html, $location, $cf);
534 534
     }
535 535
 
536 536
     // Check if there is a custom field key specific filter.
537
-    if(has_filter("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}")){
537
+    if (has_filter("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}")) {
538 538
         /**
539 539
          * Filter the datepicker html by field type key.
540 540
          *
@@ -543,11 +543,11 @@  discard block
 block discarded – undo
543 543
          * @param array $cf The custom field array.
544 544
          * @since 1.6.6
545 545
          */
546
-        $html = apply_filters("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}",$html,$location,$cf);
546
+        $html = apply_filters("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}", $html, $location, $cf);
547 547
     }
548 548
 
549 549
     // If not html then we run the standard output.
550
-    if(empty($html)){
550
+    if (empty($html)) {
551 551
 
552 552
         if ($post->{$cf['htmlvar_name']}):
553 553
 
@@ -558,21 +558,21 @@  discard block
 block discarded – undo
558 558
             }
559 559
             // check if we need to change the format or not
560 560
             $date_format_len = strlen(str_replace(' ', '', $date_format));
561
-            if($date_format_len>5){// if greater then 4 then it's the old style format.
561
+            if ($date_format_len > 5) {// if greater then 4 then it's the old style format.
562 562
 
563
-                $search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format
564
-                $replace = array('d','j','l','m','n','F','Y');//PHP date format
563
+                $search = array('dd', 'd', 'DD', 'mm', 'm', 'MM', 'yy'); //jQuery UI datepicker format
564
+                $replace = array('d', 'j', 'l', 'm', 'n', 'F', 'Y'); //PHP date format
565 565
 
566 566
                 $date_format = str_replace($search, $replace, $date_format);
567 567
 
568
-                $post_htmlvar_value = ($date_format == 'd/m/Y' || $date_format == 'j/n/Y' ) ? str_replace('/', '-', $post->{$cf['htmlvar_name']}) : $post->{$cf['htmlvar_name']}; // PHP doesn't work well with dd/mm/yyyy format
569
-            }else{
568
+                $post_htmlvar_value = ($date_format == 'd/m/Y' || $date_format == 'j/n/Y') ? str_replace('/', '-', $post->{$cf['htmlvar_name']}) : $post->{$cf['htmlvar_name']}; // PHP doesn't work well with dd/mm/yyyy format
569
+            } else {
570 570
                 $post_htmlvar_value = $post->{$cf['htmlvar_name']};
571 571
             }
572 572
 
573
-            if ($post->{$cf['htmlvar_name']} != '' && $post->{$cf['htmlvar_name']}!="0000-00-00") {
573
+            if ($post->{$cf['htmlvar_name']} != '' && $post->{$cf['htmlvar_name']} != "0000-00-00") {
574 574
                 $value = date_i18n($date_format, strtotime($post_htmlvar_value));
575
-            }else{
575
+            } else {
576 576
                 return '';
577 577
             }
578 578
 
@@ -589,9 +589,9 @@  discard block
 block discarded – undo
589 589
 
590 590
 
591 591
 
592
-            $html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-datepicker" style="' . $field_icon . '">' . $field_icon_af;
593
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
594
-            $html .= '</span>' . $value . '</div>';
592
+            $html = '<div class="geodir_more_info  '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-datepicker" style="'.$field_icon.'">'.$field_icon_af;
593
+            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : '';
594
+            $html .= '</span>'.$value.'</div>';
595 595
 
596 596
         endif;
597 597
 
@@ -599,7 +599,7 @@  discard block
 block discarded – undo
599 599
 
600 600
     return $html;
601 601
 }
602
-add_filter('geodir_custom_field_output_datepicker','geodir_cf_datepicker',10,3);
602
+add_filter('geodir_custom_field_output_datepicker', 'geodir_cf_datepicker', 10, 3);
603 603
 
604 604
 
605 605
 /**
@@ -612,21 +612,21 @@  discard block
 block discarded – undo
612 612
  *
613 613
  * @return string The html to output for the custom field.
614 614
  */
615
-function geodir_cf_text($html,$location,$cf,$p=''){
615
+function geodir_cf_text($html, $location, $cf, $p = '') {
616 616
 
617 617
     // check we have the post value
618
-    if(is_int($p)){$post = geodir_get_post_info($p);}
619
-    else{ global $post;}
618
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
619
+    else { global $post; }
620 620
 
621
-    if(!is_array($cf) && $cf!=''){
621
+    if (!is_array($cf) && $cf != '') {
622 622
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
623
-        if(!$cf){return NULL;}
623
+        if (!$cf) {return NULL; }
624 624
     }
625 625
 
626 626
     $html_var = $cf['htmlvar_name'];
627 627
 
628 628
     // Check if there is a location specific filter.
629
-    if(has_filter("geodir_custom_field_output_text_loc_{$location}")){
629
+    if (has_filter("geodir_custom_field_output_text_loc_{$location}")) {
630 630
         /**
631 631
          * Filter the text html by location.
632 632
          *
@@ -634,11 +634,11 @@  discard block
 block discarded – undo
634 634
          * @param array $cf The custom field array.
635 635
          * @since 1.6.6
636 636
          */
637
-        $html = apply_filters("geodir_custom_field_output_text_loc_{$location}",$html,$cf);
637
+        $html = apply_filters("geodir_custom_field_output_text_loc_{$location}", $html, $cf);
638 638
     }
639 639
 
640 640
     // Check if there is a custom field specific filter.
641
-    if(has_filter("geodir_custom_field_output_text_var_{$html_var}")){
641
+    if (has_filter("geodir_custom_field_output_text_var_{$html_var}")) {
642 642
         /**
643 643
          * Filter the text html by individual custom field.
644 644
          *
@@ -647,11 +647,11 @@  discard block
 block discarded – undo
647 647
          * @param array $cf The custom field array.
648 648
          * @since 1.6.6
649 649
          */
650
-        $html = apply_filters("geodir_custom_field_output_text_var_{$html_var}",$html,$location,$cf);
650
+        $html = apply_filters("geodir_custom_field_output_text_var_{$html_var}", $html, $location, $cf);
651 651
     }
652 652
 
653 653
     // Check if there is a custom field key specific filter.
654
-    if(has_filter("geodir_custom_field_output_text_key_{$cf['field_type_key']}")){
654
+    if (has_filter("geodir_custom_field_output_text_key_{$cf['field_type_key']}")) {
655 655
         /**
656 656
          * Filter the text html by field type key.
657 657
          *
@@ -660,15 +660,15 @@  discard block
 block discarded – undo
660 660
          * @param array $cf The custom field array.
661 661
          * @since 1.6.6
662 662
          */
663
-        $html = apply_filters("geodir_custom_field_output_text_key_{$cf['field_type_key']}",$html,$location,$cf);
663
+        $html = apply_filters("geodir_custom_field_output_text_key_{$cf['field_type_key']}", $html, $location, $cf);
664 664
     }
665 665
 
666 666
     
667 667
 
668 668
     // If not html then we run the standard output.
669
-    if(empty($html)){
669
+    if (empty($html)) {
670 670
 
671
-        if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != '' ):
671
+        if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != ''):
672 672
 
673 673
             $class = ($cf['htmlvar_name'] == 'geodir_timing') ? "geodir-i-time" : "geodir-i-text";
674 674
 
@@ -683,9 +683,9 @@  discard block
 block discarded – undo
683 683
             }
684 684
 
685 685
 
686
-            $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="'.$class.'" style="' . $field_icon . '">' . $field_icon_af;
687
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
688
-            $html .= '</span>' . $post->{$cf['htmlvar_name']} . '</div>';
686
+            $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="'.$class.'" style="'.$field_icon.'">'.$field_icon_af;
687
+            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : '';
688
+            $html .= '</span>'.$post->{$cf['htmlvar_name']}.'</div>';
689 689
 
690 690
         endif;
691 691
 
@@ -693,7 +693,7 @@  discard block
 block discarded – undo
693 693
 
694 694
     return $html;
695 695
 }
696
-add_filter('geodir_custom_field_output_text','geodir_cf_text',10,3);
696
+add_filter('geodir_custom_field_output_text', 'geodir_cf_text', 10, 3);
697 697
 
698 698
 
699 699
 /**
@@ -706,21 +706,21 @@  discard block
 block discarded – undo
706 706
  *
707 707
  * @return string The html to output for the custom field.
708 708
  */
709
-function geodir_cf_radio($html,$location,$cf,$p=''){
709
+function geodir_cf_radio($html, $location, $cf, $p = '') {
710 710
 
711 711
     // check we have the post value
712
-    if(is_int($p)){$post = geodir_get_post_info($p);}
713
-    else{ global $post;}
712
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
713
+    else { global $post; }
714 714
 
715
-    if(!is_array($cf) && $cf!=''){
715
+    if (!is_array($cf) && $cf != '') {
716 716
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
717
-        if(!$cf){return NULL;}
717
+        if (!$cf) {return NULL; }
718 718
     }
719 719
 
720 720
     $html_var = $cf['htmlvar_name'];
721 721
 
722 722
     // Check if there is a location specific filter.
723
-    if(has_filter("geodir_custom_field_output_radio_loc_{$location}")){
723
+    if (has_filter("geodir_custom_field_output_radio_loc_{$location}")) {
724 724
         /**
725 725
          * Filter the radio html by location.
726 726
          *
@@ -728,11 +728,11 @@  discard block
 block discarded – undo
728 728
          * @param array $cf The custom field array.
729 729
          * @since 1.6.6
730 730
          */
731
-        $html = apply_filters("geodir_custom_field_output_radio_loc_{$location}",$html,$cf);
731
+        $html = apply_filters("geodir_custom_field_output_radio_loc_{$location}", $html, $cf);
732 732
     }
733 733
 
734 734
     // Check if there is a custom field specific filter.
735
-    if(has_filter("geodir_custom_field_output_radio_var_{$html_var}")){
735
+    if (has_filter("geodir_custom_field_output_radio_var_{$html_var}")) {
736 736
         /**
737 737
          * Filter the radio html by individual custom field.
738 738
          *
@@ -741,11 +741,11 @@  discard block
 block discarded – undo
741 741
          * @param array $cf The custom field array.
742 742
          * @since 1.6.6
743 743
          */
744
-        $html = apply_filters("geodir_custom_field_output_radio_var_{$html_var}",$html,$location,$cf);
744
+        $html = apply_filters("geodir_custom_field_output_radio_var_{$html_var}", $html, $location, $cf);
745 745
     }
746 746
 
747 747
     // Check if there is a custom field key specific filter.
748
-    if(has_filter("geodir_custom_field_output_radio_key_{$cf['field_type_key']}")){
748
+    if (has_filter("geodir_custom_field_output_radio_key_{$cf['field_type_key']}")) {
749 749
         /**
750 750
          * Filter the radio html by field type key.
751 751
          *
@@ -754,11 +754,11 @@  discard block
 block discarded – undo
754 754
          * @param array $cf The custom field array.
755 755
          * @since 1.6.6
756 756
          */
757
-        $html = apply_filters("geodir_custom_field_output_radio_key_{$cf['field_type_key']}",$html,$location,$cf);
757
+        $html = apply_filters("geodir_custom_field_output_radio_key_{$cf['field_type_key']}", $html, $location, $cf);
758 758
     }
759 759
 
760 760
     // If not html then we run the standard output.
761
-    if(empty($html)){
761
+    if (empty($html)) {
762 762
 
763 763
         $html_val = __($post->{$cf['htmlvar_name']}, 'geodirectory');
764 764
         if ($post->{$cf['htmlvar_name']} != ''):
@@ -792,16 +792,16 @@  discard block
 block discarded – undo
792 792
             }
793 793
 
794 794
 
795
-            $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-radio" style="' . $field_icon . '">' . $field_icon_af;
796
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
797
-            $html .= '</span>' . $html_val . '</div>';
795
+            $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-radio" style="'.$field_icon.'">'.$field_icon_af;
796
+            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : '';
797
+            $html .= '</span>'.$html_val.'</div>';
798 798
         endif;
799 799
 
800 800
     }
801 801
 
802 802
     return $html;
803 803
 }
804
-add_filter('geodir_custom_field_output_radio','geodir_cf_radio',10,3);
804
+add_filter('geodir_custom_field_output_radio', 'geodir_cf_radio', 10, 3);
805 805
 
806 806
 
807 807
 /**
@@ -814,21 +814,21 @@  discard block
 block discarded – undo
814 814
  *
815 815
  * @return string The html to output for the custom field.
816 816
  */
817
-function geodir_cf_select($html,$location,$cf,$p=''){
817
+function geodir_cf_select($html, $location, $cf, $p = '') {
818 818
 
819 819
     // check we have the post value
820
-    if(is_int($p)){$post = geodir_get_post_info($p);}
821
-    else{ global $post;}
820
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
821
+    else { global $post; }
822 822
 
823
-    if(!is_array($cf) && $cf!=''){
823
+    if (!is_array($cf) && $cf != '') {
824 824
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
825
-        if(!$cf){return NULL;}
825
+        if (!$cf) {return NULL; }
826 826
     }
827 827
 
828 828
     $html_var = $cf['htmlvar_name'];
829 829
 
830 830
     // Check if there is a location specific filter.
831
-    if(has_filter("geodir_custom_field_output_select_loc_{$location}")){
831
+    if (has_filter("geodir_custom_field_output_select_loc_{$location}")) {
832 832
         /**
833 833
          * Filter the select html by location.
834 834
          *
@@ -836,11 +836,11 @@  discard block
 block discarded – undo
836 836
          * @param array $cf The custom field array.
837 837
          * @since 1.6.6
838 838
          */
839
-        $html = apply_filters("geodir_custom_field_output_select_loc_{$location}",$html,$cf);
839
+        $html = apply_filters("geodir_custom_field_output_select_loc_{$location}", $html, $cf);
840 840
     }
841 841
 
842 842
     // Check if there is a custom field specific filter.
843
-    if(has_filter("geodir_custom_field_output_select_var_{$html_var}")){
843
+    if (has_filter("geodir_custom_field_output_select_var_{$html_var}")) {
844 844
         /**
845 845
          * Filter the select html by individual custom field.
846 846
          *
@@ -849,11 +849,11 @@  discard block
 block discarded – undo
849 849
          * @param array $cf The custom field array.
850 850
          * @since 1.6.6
851 851
          */
852
-        $html = apply_filters("geodir_custom_field_output_select_var_{$html_var}",$html,$location,$cf);
852
+        $html = apply_filters("geodir_custom_field_output_select_var_{$html_var}", $html, $location, $cf);
853 853
     }
854 854
 
855 855
     // Check if there is a custom field key specific filter.
856
-    if(has_filter("geodir_custom_field_output_select_key_{$cf['field_type_key']}")){
856
+    if (has_filter("geodir_custom_field_output_select_key_{$cf['field_type_key']}")) {
857 857
         /**
858 858
          * Filter the select html by field type key.
859 859
          *
@@ -862,11 +862,11 @@  discard block
 block discarded – undo
862 862
          * @param array $cf The custom field array.
863 863
          * @since 1.6.6
864 864
          */
865
-        $html = apply_filters("geodir_custom_field_output_select_key_{$cf['field_type_key']}",$html,$location,$cf);
865
+        $html = apply_filters("geodir_custom_field_output_select_key_{$cf['field_type_key']}", $html, $location, $cf);
866 866
     }
867 867
 
868 868
     // If not html then we run the standard output.
869
-    if(empty($html)){
869
+    if (empty($html)) {
870 870
 
871 871
         if ($post->{$cf['htmlvar_name']}):
872 872
             $field_value = __($post->{$cf['htmlvar_name']}, 'geodirectory');
@@ -894,16 +894,16 @@  discard block
 block discarded – undo
894 894
             }
895 895
 
896 896
 
897
-            $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
898
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
899
-            $html .= '</span>' . $field_value . '</div>';
897
+            $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-select" style="'.$field_icon.'">'.$field_icon_af;
898
+            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : '';
899
+            $html .= '</span>'.$field_value.'</div>';
900 900
         endif;
901 901
 
902 902
     }
903 903
 
904 904
     return $html;
905 905
 }
906
-add_filter('geodir_custom_field_output_select','geodir_cf_select',10,3);
906
+add_filter('geodir_custom_field_output_select', 'geodir_cf_select', 10, 3);
907 907
 
908 908
 
909 909
 /**
@@ -916,21 +916,21 @@  discard block
 block discarded – undo
916 916
  *
917 917
  * @return string The html to output for the custom field.
918 918
  */
919
-function geodir_cf_multiselect($html,$location,$cf,$p=''){
919
+function geodir_cf_multiselect($html, $location, $cf, $p = '') {
920 920
 
921 921
     // check we have the post value
922
-    if(is_int($p)){$post = geodir_get_post_info($p);}
923
-    else{ global $post;}
922
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
923
+    else { global $post; }
924 924
 
925
-    if(!is_array($cf) && $cf!=''){
925
+    if (!is_array($cf) && $cf != '') {
926 926
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
927
-        if(!$cf){return NULL;}
927
+        if (!$cf) {return NULL; }
928 928
     }
929 929
 
930 930
     $html_var = $cf['htmlvar_name'];
931 931
 
932 932
     // Check if there is a location specific filter.
933
-    if(has_filter("geodir_custom_field_output_multiselect_loc_{$location}")){
933
+    if (has_filter("geodir_custom_field_output_multiselect_loc_{$location}")) {
934 934
         /**
935 935
          * Filter the multiselect html by location.
936 936
          *
@@ -938,11 +938,11 @@  discard block
 block discarded – undo
938 938
          * @param array $cf The custom field array.
939 939
          * @since 1.6.6
940 940
          */
941
-        $html = apply_filters("geodir_custom_field_output_multiselect_loc_{$location}",$html,$cf);
941
+        $html = apply_filters("geodir_custom_field_output_multiselect_loc_{$location}", $html, $cf);
942 942
     }
943 943
 
944 944
     // Check if there is a custom field specific filter.
945
-    if(has_filter("geodir_custom_field_output_multiselect_var_{$html_var}")){
945
+    if (has_filter("geodir_custom_field_output_multiselect_var_{$html_var}")) {
946 946
         /**
947 947
          * Filter the multiselect html by individual custom field.
948 948
          *
@@ -951,11 +951,11 @@  discard block
 block discarded – undo
951 951
          * @param array $cf The custom field array.
952 952
          * @since 1.6.6
953 953
          */
954
-        $html = apply_filters("geodir_custom_field_output_multiselect_var_{$html_var}",$html,$location,$cf);
954
+        $html = apply_filters("geodir_custom_field_output_multiselect_var_{$html_var}", $html, $location, $cf);
955 955
     }
956 956
 
957 957
     // Check if there is a custom field key specific filter.
958
-    if(has_filter("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}")){
958
+    if (has_filter("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}")) {
959 959
         /**
960 960
          * Filter the multiselect html by field type key.
961 961
          *
@@ -964,11 +964,11 @@  discard block
 block discarded – undo
964 964
          * @param array $cf The custom field array.
965 965
          * @since 1.6.6
966 966
          */
967
-        $html = apply_filters("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}",$html,$location,$cf);
967
+        $html = apply_filters("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}", $html, $location, $cf);
968 968
     }
969 969
 
970 970
     // If not html then we run the standard output.
971
-    if(empty($html)){
971
+    if (empty($html)) {
972 972
 
973 973
 
974 974
         if (!empty($post->{$cf['htmlvar_name']})):
@@ -1003,15 +1003,15 @@  discard block
 block discarded – undo
1003 1003
             }
1004 1004
 
1005 1005
 
1006
-            $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
1007
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1006
+            $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-select" style="'.$field_icon.'">'.$field_icon_af;
1007
+            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : '';
1008 1008
             $html .= '</span>';
1009 1009
 
1010 1010
             if (count($option_values) > 1) {
1011 1011
                 $html .= '<ul>';
1012 1012
 
1013 1013
                 foreach ($option_values as $val) {
1014
-                    $html .= '<li>' . $val . '</li>';
1014
+                    $html .= '<li>'.$val.'</li>';
1015 1015
                 }
1016 1016
 
1017 1017
                 $html .= '</ul>';
@@ -1026,7 +1026,7 @@  discard block
 block discarded – undo
1026 1026
 
1027 1027
     return $html;
1028 1028
 }
1029
-add_filter('geodir_custom_field_output_multiselect','geodir_cf_multiselect',10,3);
1029
+add_filter('geodir_custom_field_output_multiselect', 'geodir_cf_multiselect', 10, 3);
1030 1030
 
1031 1031
 
1032 1032
 /**
@@ -1039,21 +1039,21 @@  discard block
 block discarded – undo
1039 1039
  *
1040 1040
  * @return string The html to output for the custom field.
1041 1041
  */
1042
-function geodir_cf_email($html,$location,$cf,$p=''){
1042
+function geodir_cf_email($html, $location, $cf, $p = '') {
1043 1043
 
1044 1044
     // check we have the post value
1045
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1046
-    else{ global $post;}
1045
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
1046
+    else { global $post; }
1047 1047
 
1048
-    if(!is_array($cf) && $cf!=''){
1048
+    if (!is_array($cf) && $cf != '') {
1049 1049
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1050
-        if(!$cf){return NULL;}
1050
+        if (!$cf) {return NULL; }
1051 1051
     }
1052 1052
 
1053 1053
     $html_var = $cf['htmlvar_name'];
1054 1054
 
1055 1055
     // Check if there is a location specific filter.
1056
-    if(has_filter("geodir_custom_field_output_email_loc_{$location}")){
1056
+    if (has_filter("geodir_custom_field_output_email_loc_{$location}")) {
1057 1057
         /**
1058 1058
          * Filter the email html by location.
1059 1059
          *
@@ -1061,11 +1061,11 @@  discard block
 block discarded – undo
1061 1061
          * @param array $cf The custom field array.
1062 1062
          * @since 1.6.6
1063 1063
          */
1064
-        $html = apply_filters("geodir_custom_field_output_email_loc_{$location}",$html,$cf);
1064
+        $html = apply_filters("geodir_custom_field_output_email_loc_{$location}", $html, $cf);
1065 1065
     }
1066 1066
 
1067 1067
     // Check if there is a custom field specific filter.
1068
-    if(has_filter("geodir_custom_field_output_email_var_{$html_var}")){
1068
+    if (has_filter("geodir_custom_field_output_email_var_{$html_var}")) {
1069 1069
         /**
1070 1070
          * Filter the email html by individual custom field.
1071 1071
          *
@@ -1074,11 +1074,11 @@  discard block
 block discarded – undo
1074 1074
          * @param array $cf The custom field array.
1075 1075
          * @since 1.6.6
1076 1076
          */
1077
-        $html = apply_filters("geodir_custom_field_output_email_var_{$html_var}",$html,$location,$cf);
1077
+        $html = apply_filters("geodir_custom_field_output_email_var_{$html_var}", $html, $location, $cf);
1078 1078
     }
1079 1079
 
1080 1080
     // Check if there is a custom field key specific filter.
1081
-    if(has_filter("geodir_custom_field_output_email_key_{$cf['field_type_key']}")){
1081
+    if (has_filter("geodir_custom_field_output_email_key_{$cf['field_type_key']}")) {
1082 1082
         /**
1083 1083
          * Filter the email html by field type key.
1084 1084
          *
@@ -1087,18 +1087,18 @@  discard block
 block discarded – undo
1087 1087
          * @param array $cf The custom field array.
1088 1088
          * @since 1.6.6
1089 1089
          */
1090
-        $html = apply_filters("geodir_custom_field_output_email_key_{$cf['field_type_key']}",$html,$location,$cf);
1090
+        $html = apply_filters("geodir_custom_field_output_email_key_{$cf['field_type_key']}", $html, $location, $cf);
1091 1091
     }
1092 1092
 
1093 1093
     // If not html then we run the standard output.
1094
-    if(empty($html)){
1094
+    if (empty($html)) {
1095 1095
 
1096 1096
         global $preview;
1097 1097
         if ($cf['htmlvar_name'] == 'geodir_email' && !(geodir_is_page('detail') || geodir_is_page('preview'))) {
1098 1098
             return ''; // Remove Send Enquiry | Send To Friend from listings page
1099 1099
         }
1100 1100
 
1101
-        $package_info = (array)geodir_post_package_info(array(), $post, $post->post_type);
1101
+        $package_info = (array) geodir_post_package_info(array(), $post, $post->post_type);
1102 1102
 
1103 1103
         if ($cf['htmlvar_name'] == 'geodir_email' && ((isset($package_info->sendtofriend) && $package_info->sendtofriend) || $post->{$cf['htmlvar_name']})) {
1104 1104
             $send_to_friend = true;
@@ -1109,7 +1109,7 @@  discard block
 block discarded – undo
1109 1109
             if (!$preview) {
1110 1110
                 $b_send_inquiry = 'b_send_inquiry';
1111 1111
                 $b_sendtofriend = 'b_sendtofriend';
1112
-                $html = '<input type="hidden" name="geodir_popup_post_id" value="' . $post->ID . '" /><div class="geodir_display_popup_forms"></div>';
1112
+                $html = '<input type="hidden" name="geodir_popup_post_id" value="'.$post->ID.'" /><div class="geodir_display_popup_forms"></div>';
1113 1113
             }
1114 1114
 
1115 1115
             $field_icon = geodir_field_icon_proccess($cf);
@@ -1123,26 +1123,26 @@  discard block
 block discarded – undo
1123 1123
             }
1124 1124
 
1125 1125
 
1126
-            $html .= '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af;
1126
+            $html .= '<div class="geodir_more_info  '.$cf['css_class'].' '.$cf['htmlvar_name'].'"><span class="geodir-i-email" style="'.$field_icon.'">'.$field_icon_af;
1127 1127
             $seperator = '';
1128 1128
             if ($post->{$cf['htmlvar_name']}) {
1129
-                $html .= '<a href="javascript:void(0);" class="' . $b_send_inquiry . '" >' . SEND_INQUIRY . '</a>';
1129
+                $html .= '<a href="javascript:void(0);" class="'.$b_send_inquiry.'" >'.SEND_INQUIRY.'</a>';
1130 1130
                 $seperator = ' | ';
1131 1131
             }
1132 1132
 
1133 1133
             if (isset($package_info->sendtofriend) && $package_info->sendtofriend) {
1134
-                $html .= $seperator . '<a href="javascript:void(0);" class="' . $b_sendtofriend . '">' . SEND_TO_FRIEND . '</a>';
1134
+                $html .= $seperator.'<a href="javascript:void(0);" class="'.$b_sendtofriend.'">'.SEND_TO_FRIEND.'</a>';
1135 1135
             }
1136 1136
 
1137 1137
             $html .= '</span></div>';
1138 1138
 
1139 1139
 
1140 1140
             if (isset($_REQUEST['send_inquiry']) && $_REQUEST['send_inquiry'] == 'success') {
1141
-                $html .= '<p class="sucess_msg">' . SEND_INQUIRY_SUCCESS . '</p>';
1141
+                $html .= '<p class="sucess_msg">'.SEND_INQUIRY_SUCCESS.'</p>';
1142 1142
             } elseif (isset($_REQUEST['sendtofrnd']) && $_REQUEST['sendtofrnd'] == 'success') {
1143
-                $html .= '<p class="sucess_msg">' . SEND_FRIEND_SUCCESS . '</p>';
1143
+                $html .= '<p class="sucess_msg">'.SEND_FRIEND_SUCCESS.'</p>';
1144 1144
             } elseif (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 'captch') {
1145
-                $html .= '<p class="error_msg_fix">' . WRONG_CAPTCH_MSG . '</p>';
1145
+                $html .= '<p class="error_msg_fix">'.WRONG_CAPTCH_MSG.'</p>';
1146 1146
             }
1147 1147
 
1148 1148
             /*if(!$preview){require_once (geodir_plugin_path().'/geodirectory-templates/popup-forms.php');}*/
@@ -1162,11 +1162,11 @@  discard block
 block discarded – undo
1162 1162
                 }
1163 1163
 
1164 1164
 
1165
-                $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af;
1166
-                $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1165
+                $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-email" style="'.$field_icon.'">'.$field_icon_af;
1166
+                $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : '';
1167 1167
                 $html .= '</span><span class="geodir-email-address-output">';
1168 1168
                 $email = $post->{$cf['htmlvar_name']} ;
1169
-                if($e_split = explode('@',$email)){
1169
+                if ($e_split = explode('@', $email)) {
1170 1170
                     /**
1171 1171
                      * Filter email custom field name output.
1172 1172
                      *
@@ -1175,10 +1175,10 @@  discard block
 block discarded – undo
1175 1175
                      * @param string $email The email string being output.
1176 1176
                      * @param array $cf Custom field variables array.
1177 1177
                      */
1178
-                    $email_name = apply_filters('geodir_email_field_name_output',$email,$cf);
1179
-                    $html .=  "<script>document.write('<a href=\"mailto:'+'$e_split[0]' + '@' + '$e_split[1]'+'\">$email_name</a>')</script>";
1180
-                }else{
1181
-                    $html .=  $email;
1178
+                    $email_name = apply_filters('geodir_email_field_name_output', $email, $cf);
1179
+                    $html .= "<script>document.write('<a href=\"mailto:'+'$e_split[0]' + '@' + '$e_split[1]'+'\">$email_name</a>')</script>";
1180
+                } else {
1181
+                    $html .= $email;
1182 1182
                 }
1183 1183
                 $html .= '</span></div>';
1184 1184
             }
@@ -1189,7 +1189,7 @@  discard block
 block discarded – undo
1189 1189
 
1190 1190
     return $html;
1191 1191
 }
1192
-add_filter('geodir_custom_field_output_email','geodir_cf_email',10,3);
1192
+add_filter('geodir_custom_field_output_email', 'geodir_cf_email', 10, 3);
1193 1193
 
1194 1194
 
1195 1195
 /**
@@ -1202,21 +1202,21 @@  discard block
 block discarded – undo
1202 1202
  *
1203 1203
  * @return string The html to output for the custom field.
1204 1204
  */
1205
-function geodir_cf_file($html,$location,$cf,$p=''){
1205
+function geodir_cf_file($html, $location, $cf, $p = '') {
1206 1206
 
1207 1207
     // check we have the post value
1208
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1209
-    else{ global $post;}
1208
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
1209
+    else { global $post; }
1210 1210
 
1211
-    if(!is_array($cf) && $cf!=''){
1211
+    if (!is_array($cf) && $cf != '') {
1212 1212
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1213
-        if(!$cf){return NULL;}
1213
+        if (!$cf) {return NULL; }
1214 1214
     }
1215 1215
 
1216 1216
     $html_var = $cf['htmlvar_name'];
1217 1217
 
1218 1218
     // Check if there is a location specific filter.
1219
-    if(has_filter("geodir_custom_field_output_file_loc_{$location}")){
1219
+    if (has_filter("geodir_custom_field_output_file_loc_{$location}")) {
1220 1220
         /**
1221 1221
          * Filter the file html by location.
1222 1222
          *
@@ -1224,11 +1224,11 @@  discard block
 block discarded – undo
1224 1224
          * @param array $cf The custom field array.
1225 1225
          * @since 1.6.6
1226 1226
          */
1227
-        $html = apply_filters("geodir_custom_field_output_file_loc_{$location}",$html,$cf);
1227
+        $html = apply_filters("geodir_custom_field_output_file_loc_{$location}", $html, $cf);
1228 1228
     }
1229 1229
 
1230 1230
     // Check if there is a custom field specific filter.
1231
-    if(has_filter("geodir_custom_field_output_file_var_{$html_var}")){
1231
+    if (has_filter("geodir_custom_field_output_file_var_{$html_var}")) {
1232 1232
         /**
1233 1233
          * Filter the file html by individual custom field.
1234 1234
          *
@@ -1237,11 +1237,11 @@  discard block
 block discarded – undo
1237 1237
          * @param array $cf The custom field array.
1238 1238
          * @since 1.6.6
1239 1239
          */
1240
-        $html = apply_filters("geodir_custom_field_output_file_var_{$html_var}",$html,$location,$cf);
1240
+        $html = apply_filters("geodir_custom_field_output_file_var_{$html_var}", $html, $location, $cf);
1241 1241
     }
1242 1242
 
1243 1243
     // Check if there is a custom field key specific filter.
1244
-    if(has_filter("geodir_custom_field_output_file_key_{$cf['field_type_key']}")){
1244
+    if (has_filter("geodir_custom_field_output_file_key_{$cf['field_type_key']}")) {
1245 1245
         /**
1246 1246
          * Filter the file html by field type key.
1247 1247
          *
@@ -1250,11 +1250,11 @@  discard block
 block discarded – undo
1250 1250
          * @param array $cf The custom field array.
1251 1251
          * @since 1.6.6
1252 1252
          */
1253
-        $html = apply_filters("geodir_custom_field_output_file_key_{$cf['field_type_key']}",$html,$location,$cf);
1253
+        $html = apply_filters("geodir_custom_field_output_file_key_{$cf['field_type_key']}", $html, $location, $cf);
1254 1254
     }
1255 1255
 
1256 1256
     // If not html then we run the standard output.
1257
-    if(empty($html)){
1257
+    if (empty($html)) {
1258 1258
 
1259 1259
         if (!empty($post->{$cf['htmlvar_name']})):
1260 1260
 
@@ -1262,7 +1262,7 @@  discard block
 block discarded – undo
1262 1262
             if (!empty($files)):
1263 1263
 
1264 1264
                 $extra_fields = !empty($cf['extra_fields']) ? maybe_unserialize($cf['extra_fields']) : NULL;
1265
-                $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'] : '';
1265
+                $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'] : '';
1266 1266
 
1267 1267
                 $file_paths = '';
1268 1268
                 foreach ($files as $file) {
@@ -1299,9 +1299,9 @@  discard block
 block discarded – undo
1299 1299
                             //$file_paths .= '<img src="'.$file.'"  />';	
1300 1300
                             $file_paths .= '</div>';
1301 1301
                         } else {
1302
-                            $ext_path = '_' . $html_var . '_';
1302
+                            $ext_path = '_'.$html_var.'_';
1303 1303
                             $filename = explode($ext_path, $filename);
1304
-                            $file_paths .= '<a href="' . $file . '" target="_blank">' . $filename[count($filename) - 1] . '</a>';
1304
+                            $file_paths .= '<a href="'.$file.'" target="_blank">'.$filename[count($filename) - 1].'</a>';
1305 1305
                         }
1306 1306
                     }
1307 1307
                 }
@@ -1316,11 +1316,11 @@  discard block
 block discarded – undo
1316 1316
                     $field_icon = '';
1317 1317
                 }
1318 1318
 
1319
-                $html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' geodir-custom-file-box ' . $cf['htmlvar_name'] . '"><div class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af;
1319
+                $html = '<div class="geodir_more_info  '.$cf['css_class'].' geodir-custom-file-box '.$cf['htmlvar_name'].'"><div class="geodir-i-select" style="'.$field_icon.'">'.$field_icon_af;
1320 1320
                 $html .= '<span style="display: inline-block; vertical-align: top; padding-right: 14px;">';
1321
-                $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1321
+                $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : '';
1322 1322
                 $html .= '</span>';
1323
-                $html .= $file_paths . '</div></div>';
1323
+                $html .= $file_paths.'</div></div>';
1324 1324
 
1325 1325
             endif;
1326 1326
         endif;
@@ -1329,7 +1329,7 @@  discard block
 block discarded – undo
1329 1329
 
1330 1330
     return $html;
1331 1331
 }
1332
-add_filter('geodir_custom_field_output_file','geodir_cf_file',10,3);
1332
+add_filter('geodir_custom_field_output_file', 'geodir_cf_file', 10, 3);
1333 1333
 
1334 1334
 
1335 1335
 
@@ -1343,21 +1343,21 @@  discard block
 block discarded – undo
1343 1343
  *
1344 1344
  * @return string The html to output for the custom field.
1345 1345
  */
1346
-function geodir_cf_textarea($html,$location,$cf,$p=''){
1346
+function geodir_cf_textarea($html, $location, $cf, $p = '') {
1347 1347
 
1348 1348
     // check we have the post value
1349
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1350
-    else{ global $post;}
1349
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
1350
+    else { global $post; }
1351 1351
 
1352
-    if(!is_array($cf) && $cf!=''){
1352
+    if (!is_array($cf) && $cf != '') {
1353 1353
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1354
-        if(!$cf){return NULL;}
1354
+        if (!$cf) {return NULL; }
1355 1355
     }
1356 1356
 
1357 1357
     $html_var = $cf['htmlvar_name'];
1358 1358
 
1359 1359
     // Check if there is a location specific filter.
1360
-    if(has_filter("geodir_custom_field_output_textarea_loc_{$location}")){
1360
+    if (has_filter("geodir_custom_field_output_textarea_loc_{$location}")) {
1361 1361
         /**
1362 1362
          * Filter the textarea html by location.
1363 1363
          *
@@ -1365,11 +1365,11 @@  discard block
 block discarded – undo
1365 1365
          * @param array $cf The custom field array.
1366 1366
          * @since 1.6.6
1367 1367
          */
1368
-        $html = apply_filters("geodir_custom_field_output_textarea_loc_{$location}",$html,$cf);
1368
+        $html = apply_filters("geodir_custom_field_output_textarea_loc_{$location}", $html, $cf);
1369 1369
     }
1370 1370
 
1371 1371
     // Check if there is a custom field specific filter.
1372
-    if(has_filter("geodir_custom_field_output_textarea_var_{$html_var}")){
1372
+    if (has_filter("geodir_custom_field_output_textarea_var_{$html_var}")) {
1373 1373
         /**
1374 1374
          * Filter the textarea html by individual custom field.
1375 1375
          *
@@ -1378,11 +1378,11 @@  discard block
 block discarded – undo
1378 1378
          * @param array $cf The custom field array.
1379 1379
          * @since 1.6.6
1380 1380
          */
1381
-        $html = apply_filters("geodir_custom_field_output_textarea_var_{$html_var}",$html,$location,$cf);
1381
+        $html = apply_filters("geodir_custom_field_output_textarea_var_{$html_var}", $html, $location, $cf);
1382 1382
     }
1383 1383
 
1384 1384
     // Check if there is a custom field key specific filter.
1385
-    if(has_filter("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}")){
1385
+    if (has_filter("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}")) {
1386 1386
         /**
1387 1387
          * Filter the textarea html by field type key.
1388 1388
          *
@@ -1391,11 +1391,11 @@  discard block
 block discarded – undo
1391 1391
          * @param array $cf The custom field array.
1392 1392
          * @since 1.6.6
1393 1393
          */
1394
-        $html = apply_filters("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}",$html,$location,$cf);
1394
+        $html = apply_filters("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}", $html, $location, $cf);
1395 1395
     }
1396 1396
 
1397 1397
     // If not html then we run the standard output.
1398
-    if(empty($html)){
1398
+    if (empty($html)) {
1399 1399
 
1400 1400
         if (!empty($post->{$cf['htmlvar_name']})) {
1401 1401
 
@@ -1410,9 +1410,9 @@  discard block
 block discarded – undo
1410 1410
             }
1411 1411
 
1412 1412
 
1413
-            $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
1414
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1415
-            $html .= '</span>' . wpautop($post->{$cf['htmlvar_name']}) . '</div>';
1413
+            $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-text" style="'.$field_icon.'">'.$field_icon_af;
1414
+            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : '';
1415
+            $html .= '</span>'.wpautop($post->{$cf['htmlvar_name']}).'</div>';
1416 1416
 
1417 1417
         }
1418 1418
 
@@ -1420,7 +1420,7 @@  discard block
 block discarded – undo
1420 1420
 
1421 1421
     return $html;
1422 1422
 }
1423
-add_filter('geodir_custom_field_output_textarea','geodir_cf_textarea',10,3);
1423
+add_filter('geodir_custom_field_output_textarea', 'geodir_cf_textarea', 10, 3);
1424 1424
 
1425 1425
 
1426 1426
 
@@ -1434,21 +1434,21 @@  discard block
 block discarded – undo
1434 1434
  *
1435 1435
  * @return string The html to output for the custom field.
1436 1436
  */
1437
-function geodir_cf_html($html,$location,$cf,$p=''){
1437
+function geodir_cf_html($html, $location, $cf, $p = '') {
1438 1438
 
1439 1439
     // check we have the post value
1440
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1441
-    else{ global $post;}
1440
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
1441
+    else { global $post; }
1442 1442
 
1443
-    if(!is_array($cf) && $cf!=''){
1443
+    if (!is_array($cf) && $cf != '') {
1444 1444
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1445
-        if(!$cf){return NULL;}
1445
+        if (!$cf) {return NULL; }
1446 1446
     }
1447 1447
 
1448 1448
     $html_var = $cf['htmlvar_name'];
1449 1449
 
1450 1450
     // Check if there is a location specific filter.
1451
-    if(has_filter("geodir_custom_field_output_html_loc_{$location}")){
1451
+    if (has_filter("geodir_custom_field_output_html_loc_{$location}")) {
1452 1452
         /**
1453 1453
          * Filter the html html by location.
1454 1454
          *
@@ -1456,11 +1456,11 @@  discard block
 block discarded – undo
1456 1456
          * @param array $cf The custom field array.
1457 1457
          * @since 1.6.6
1458 1458
          */
1459
-        $html = apply_filters("geodir_custom_field_output_html_loc_{$location}",$html,$cf);
1459
+        $html = apply_filters("geodir_custom_field_output_html_loc_{$location}", $html, $cf);
1460 1460
     }
1461 1461
 
1462 1462
     // Check if there is a custom field specific filter.
1463
-    if(has_filter("geodir_custom_field_output_html_var_{$html_var}")){
1463
+    if (has_filter("geodir_custom_field_output_html_var_{$html_var}")) {
1464 1464
         /**
1465 1465
          * Filter the html html by individual custom field.
1466 1466
          *
@@ -1469,11 +1469,11 @@  discard block
 block discarded – undo
1469 1469
          * @param array $cf The custom field array.
1470 1470
          * @since 1.6.6
1471 1471
          */
1472
-        $html = apply_filters("geodir_custom_field_output_html_var_{$html_var}",$html,$location,$cf);
1472
+        $html = apply_filters("geodir_custom_field_output_html_var_{$html_var}", $html, $location, $cf);
1473 1473
     }
1474 1474
 
1475 1475
     // Check if there is a custom field key specific filter.
1476
-    if(has_filter("geodir_custom_field_output_html_key_{$cf['field_type_key']}")){
1476
+    if (has_filter("geodir_custom_field_output_html_key_{$cf['field_type_key']}")) {
1477 1477
         /**
1478 1478
          * Filter the html html by field type key.
1479 1479
          *
@@ -1482,11 +1482,11 @@  discard block
 block discarded – undo
1482 1482
          * @param array $cf The custom field array.
1483 1483
          * @since 1.6.6
1484 1484
          */
1485
-        $html = apply_filters("geodir_custom_field_output_html_key_{$cf['field_type_key']}",$html,$location,$cf);
1485
+        $html = apply_filters("geodir_custom_field_output_html_key_{$cf['field_type_key']}", $html, $location, $cf);
1486 1486
     }
1487 1487
 
1488 1488
     // If not html then we run the standard output.
1489
-    if(empty($html)){
1489
+    if (empty($html)) {
1490 1490
 
1491 1491
         if (!empty($post->{$cf['htmlvar_name']})) {
1492 1492
 
@@ -1500,9 +1500,9 @@  discard block
 block discarded – undo
1500 1500
                 $field_icon = '';
1501 1501
             }
1502 1502
 
1503
-            $html = '<div class="geodir_more_info  ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af;
1504
-            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1505
-            $html .= '</span>' . wpautop($post->{$cf['htmlvar_name']}) . '</div>';
1503
+            $html = '<div class="geodir_more_info  '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-text" style="'.$field_icon.'">'.$field_icon_af;
1504
+            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : '';
1505
+            $html .= '</span>'.wpautop($post->{$cf['htmlvar_name']}).'</div>';
1506 1506
 
1507 1507
         }
1508 1508
 
@@ -1510,7 +1510,7 @@  discard block
 block discarded – undo
1510 1510
 
1511 1511
     return $html;
1512 1512
 }
1513
-add_filter('geodir_custom_field_output_html','geodir_cf_html',10,3);
1513
+add_filter('geodir_custom_field_output_html', 'geodir_cf_html', 10, 3);
1514 1514
 
1515 1515
 
1516 1516
 
@@ -1524,21 +1524,21 @@  discard block
 block discarded – undo
1524 1524
  *
1525 1525
  * @return string The html to output for the custom field.
1526 1526
  */
1527
-function geodir_cf_taxonomy($html,$location,$cf,$p=''){
1527
+function geodir_cf_taxonomy($html, $location, $cf, $p = '') {
1528 1528
 
1529 1529
     // check we have the post value
1530
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1531
-    else{ global $post;}
1530
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
1531
+    else { global $post; }
1532 1532
 
1533
-    if(!is_array($cf) && $cf!=''){
1533
+    if (!is_array($cf) && $cf != '') {
1534 1534
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1535
-        if(!$cf){return NULL;}
1535
+        if (!$cf) {return NULL; }
1536 1536
     }
1537 1537
 
1538 1538
     $html_var = $cf['htmlvar_name'];
1539 1539
 
1540 1540
     // Check if there is a location specific filter.
1541
-    if(has_filter("geodir_custom_field_output_taxonomy_loc_{$location}")){
1541
+    if (has_filter("geodir_custom_field_output_taxonomy_loc_{$location}")) {
1542 1542
         /**
1543 1543
          * Filter the taxonomy html by location.
1544 1544
          *
@@ -1546,11 +1546,11 @@  discard block
 block discarded – undo
1546 1546
          * @param array $cf The custom field array.
1547 1547
          * @since 1.6.6
1548 1548
          */
1549
-        $html = apply_filters("geodir_custom_field_output_taxonomy_loc_{$location}",$html,$cf);
1549
+        $html = apply_filters("geodir_custom_field_output_taxonomy_loc_{$location}", $html, $cf);
1550 1550
     }
1551 1551
 
1552 1552
     // Check if there is a custom field specific filter.
1553
-    if(has_filter("geodir_custom_field_output_taxonomy_var_{$html_var}")){
1553
+    if (has_filter("geodir_custom_field_output_taxonomy_var_{$html_var}")) {
1554 1554
         /**
1555 1555
          * Filter the taxonomy html by individual custom field.
1556 1556
          *
@@ -1559,11 +1559,11 @@  discard block
 block discarded – undo
1559 1559
          * @param array $cf The custom field array.
1560 1560
          * @since 1.6.6
1561 1561
          */
1562
-        $html = apply_filters("geodir_custom_field_output_taxonomy_var_{$html_var}",$html,$location,$cf);
1562
+        $html = apply_filters("geodir_custom_field_output_taxonomy_var_{$html_var}", $html, $location, $cf);
1563 1563
     }
1564 1564
 
1565 1565
     // Check if there is a custom field key specific filter.
1566
-    if(has_filter("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}")){
1566
+    if (has_filter("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}")) {
1567 1567
         /**
1568 1568
          * Filter the taxonomy html by field type key.
1569 1569
          *
@@ -1572,14 +1572,14 @@  discard block
 block discarded – undo
1572 1572
          * @param array $cf The custom field array.
1573 1573
          * @since 1.6.6
1574 1574
          */
1575
-        $html = apply_filters("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}",$html,$location,$cf);
1575
+        $html = apply_filters("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}", $html, $location, $cf);
1576 1576
     }
1577 1577
 
1578 1578
     // If not html then we run the standard output.
1579
-    if(empty($html)){
1579
+    if (empty($html)) {
1580 1580
 
1581
-        if ($html_var == $post->post_type . 'category' && !empty($post->{$html_var})) {
1582
-            $post_taxonomy = $post->post_type . 'category';
1581
+        if ($html_var == $post->post_type.'category' && !empty($post->{$html_var})) {
1582
+            $post_taxonomy = $post->post_type.'category';
1583 1583
             $field_value = $post->{$html_var};
1584 1584
             $links = array();
1585 1585
             $terms = array();
@@ -1597,7 +1597,7 @@  discard block
 block discarded – undo
1597 1597
                     if ($term != '') {
1598 1598
                         $term = get_term_by('id', $term, $html_var);
1599 1599
                         if (is_object($term)) {
1600
-                            $links[] = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>" . $term->name . "</a>";
1600
+                            $links[] = "<a href='".esc_attr(get_term_link($term, $post_taxonomy))."'>".$term->name."</a>";
1601 1601
                             $terms[] = $term;
1602 1602
                         }
1603 1603
                     }
@@ -1611,7 +1611,7 @@  discard block
 block discarded – undo
1611 1611
                     $terms = $termsOrdered;
1612 1612
                 }
1613 1613
             }
1614
-            $html_value = !empty($links) && !empty($terms) ? wp_sprintf('%l', $links, (object)$terms) : '';
1614
+            $html_value = !empty($links) && !empty($terms) ? wp_sprintf('%l', $links, (object) $terms) : '';
1615 1615
 
1616 1616
             if ($html_value != '') {
1617 1617
                 $field_icon = geodir_field_icon_proccess($cf);
@@ -1624,9 +1624,9 @@  discard block
 block discarded – undo
1624 1624
                     $field_icon = '';
1625 1625
                 }
1626 1626
 
1627
-                $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $html_var . '" style="clear:both;"><span class="geodir-i-taxonomy geodir-i-category" style="' . $field_icon . '">' . $field_icon_af;
1628
-                $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : '';
1629
-                $html .= '</span> ' . $html_value . '</div>';
1627
+                $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$html_var.'" style="clear:both;"><span class="geodir-i-taxonomy geodir-i-category" style="'.$field_icon.'">'.$field_icon_af;
1628
+                $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : '';
1629
+                $html .= '</span> '.$html_value.'</div>';
1630 1630
             }
1631 1631
         }
1632 1632
 
@@ -1634,7 +1634,7 @@  discard block
 block discarded – undo
1634 1634
 
1635 1635
     return $html;
1636 1636
 }
1637
-add_filter('geodir_custom_field_output_taxonomy','geodir_cf_taxonomy',10,3);
1637
+add_filter('geodir_custom_field_output_taxonomy', 'geodir_cf_taxonomy', 10, 3);
1638 1638
 
1639 1639
 
1640 1640
 /**
@@ -1647,21 +1647,21 @@  discard block
 block discarded – undo
1647 1647
  *
1648 1648
  * @return string The html to output for the custom field.
1649 1649
  */
1650
-function geodir_cf_address($html,$location,$cf,$p=''){
1650
+function geodir_cf_address($html, $location, $cf, $p = '') {
1651 1651
 
1652 1652
     // check we have the post value
1653
-    if(is_int($p)){$post = geodir_get_post_info($p);}
1654
-    else{ global $post;}
1653
+    if (is_int($p)) {$post = geodir_get_post_info($p); }
1654
+    else { global $post; }
1655 1655
 
1656
-    if(!is_array($cf) && $cf!=''){
1656
+    if (!is_array($cf) && $cf != '') {
1657 1657
         $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type);
1658
-        if(!$cf){return NULL;}
1658
+        if (!$cf) {return NULL; }
1659 1659
     }
1660 1660
 
1661 1661
     $html_var = $cf['htmlvar_name'];
1662 1662
 
1663 1663
     // Check if there is a location specific filter.
1664
-    if(has_filter("geodir_custom_field_output_address_loc_{$location}")){
1664
+    if (has_filter("geodir_custom_field_output_address_loc_{$location}")) {
1665 1665
         /**
1666 1666
          * Filter the address html by location.
1667 1667
          *
@@ -1669,11 +1669,11 @@  discard block
 block discarded – undo
1669 1669
          * @param array $cf The custom field array.
1670 1670
          * @since 1.6.6
1671 1671
          */
1672
-        $html = apply_filters("geodir_custom_field_output_address_loc_{$location}",$html,$cf);
1672
+        $html = apply_filters("geodir_custom_field_output_address_loc_{$location}", $html, $cf);
1673 1673
     }
1674 1674
 
1675 1675
     // Check if there is a custom field specific filter.
1676
-    if(has_filter("geodir_custom_field_output_address_var_{$html_var}")){
1676
+    if (has_filter("geodir_custom_field_output_address_var_{$html_var}")) {
1677 1677
         /**
1678 1678
          * Filter the address html by individual custom field.
1679 1679
          *
@@ -1682,11 +1682,11 @@  discard block
 block discarded – undo
1682 1682
          * @param array $cf The custom field array.
1683 1683
          * @since 1.6.6
1684 1684
          */
1685
-        $html = apply_filters("geodir_custom_field_output_address_var_{$html_var}",$html,$location,$cf);
1685
+        $html = apply_filters("geodir_custom_field_output_address_var_{$html_var}", $html, $location, $cf);
1686 1686
     }
1687 1687
 
1688 1688
     // Check if there is a custom field key specific filter.
1689
-    if(has_filter("geodir_custom_field_output_address_key_{$cf['field_type_key']}")){
1689
+    if (has_filter("geodir_custom_field_output_address_key_{$cf['field_type_key']}")) {
1690 1690
         /**
1691 1691
          * Filter the address html by field type key.
1692 1692
          *
@@ -1695,14 +1695,14 @@  discard block
 block discarded – undo
1695 1695
          * @param array $cf The custom field array.
1696 1696
          * @since 1.6.6
1697 1697
          */
1698
-        $html = apply_filters("geodir_custom_field_output_address_key_{$cf['field_type_key']}",$html,$location,$cf);
1698
+        $html = apply_filters("geodir_custom_field_output_address_key_{$cf['field_type_key']}", $html, $location, $cf);
1699 1699
     }
1700 1700
 
1701 1701
     // If not html then we run the standard output.
1702
-    if(empty($html)){
1702
+    if (empty($html)) {
1703 1703
 
1704 1704
         global $preview;
1705
-        $html_var = $cf['htmlvar_name'] . '_address';
1705
+        $html_var = $cf['htmlvar_name'].'_address';
1706 1706
 
1707 1707
         if ($cf['extra_fields']) {
1708 1708
 
@@ -1765,10 +1765,10 @@  discard block
 block discarded – undo
1765 1765
 
1766 1766
         if ($post->{$html_var}) {
1767 1767
 
1768
-            $field_icon = geodir_field_icon_proccess( $cf );
1769
-            if ( strpos( $field_icon, 'http' ) !== false ) {
1768
+            $field_icon = geodir_field_icon_proccess($cf);
1769
+            if (strpos($field_icon, 'http') !== false) {
1770 1770
                 $field_icon_af = '';
1771
-            } elseif ( $field_icon == '' ) {
1771
+            } elseif ($field_icon == '') {
1772 1772
                 $field_icon_af = '<i class="fa fa-home"></i>';
1773 1773
             } else {
1774 1774
                 $field_icon_af = $field_icon;
@@ -1777,26 +1777,26 @@  discard block
 block discarded – undo
1777 1777
             
1778 1778
 
1779 1779
 
1780
-            $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"  itemscope itemtype="http://schema.org/PostalAddress">';
1781
-            $html .= '<span class="geodir-i-location" style="' . $field_icon . '">' . $field_icon_af;
1782
-            $html .= ( trim( $cf['site_title'] ) ) ? __( $cf['site_title'], 'geodirectory' ) . ': ' : '&nbsp;';
1780
+            $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"  itemscope itemtype="http://schema.org/PostalAddress">';
1781
+            $html .= '<span class="geodir-i-location" style="'.$field_icon.'">'.$field_icon_af;
1782
+            $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : '&nbsp;';
1783 1783
             $html .= '</span>';
1784 1784
 
1785 1785
 
1786
-            if ( $post->post_address ) {
1787
-                $html .= '<span itemprop="streetAddress">' . $post->post_address . '</span><br>';
1786
+            if ($post->post_address) {
1787
+                $html .= '<span itemprop="streetAddress">'.$post->post_address.'</span><br>';
1788 1788
             }
1789
-            if ($show_city_in_address && $post->post_city ) {
1790
-                $html .= '<span itemprop="addressLocality">' . $post->post_city . '</span><br>';
1789
+            if ($show_city_in_address && $post->post_city) {
1790
+                $html .= '<span itemprop="addressLocality">'.$post->post_city.'</span><br>';
1791 1791
             }
1792
-            if ($show_region_in_address && $post->post_region ) {
1793
-                $html .= '<span itemprop="addressRegion">' . $post->post_region . '</span><br>';
1792
+            if ($show_region_in_address && $post->post_region) {
1793
+                $html .= '<span itemprop="addressRegion">'.$post->post_region.'</span><br>';
1794 1794
             }
1795
-            if ($show_zip_in_address && $post->post_zip ) {
1796
-                $html .= '<span itemprop="postalCode">' . $post->post_zip . '</span><br>';
1795
+            if ($show_zip_in_address && $post->post_zip) {
1796
+                $html .= '<span itemprop="postalCode">'.$post->post_zip.'</span><br>';
1797 1797
             }
1798
-            if ($show_country_in_address && $post->post_country ) {
1799
-                $html .= '<span itemprop="addressCountry">' . __( $post->post_country, 'geodirectory' ) . '</span><br>';
1798
+            if ($show_country_in_address && $post->post_country) {
1799
+                $html .= '<span itemprop="addressCountry">'.__($post->post_country, 'geodirectory').'</span><br>';
1800 1800
             }
1801 1801
             $html .= '</div>';
1802 1802
 
@@ -1807,4 +1807,4 @@  discard block
 block discarded – undo
1807 1807
 
1808 1808
     return $html;
1809 1809
 }
1810
-add_filter('geodir_custom_field_output_address','geodir_cf_address',10,3);
1811 1810
\ No newline at end of file
1811
+add_filter('geodir_custom_field_output_address', 'geodir_cf_address', 10, 3);
1812 1812
\ No newline at end of file
Please login to merge, or discard this patch.
geodirectory-functions/custom_fields_input_functions.php 3 patches
Indentation   +703 added lines, -703 removed lines patch added patch discarded remove patch
@@ -19,35 +19,35 @@  discard block
 block discarded – undo
19 19
  */
20 20
 function geodir_cfi_fieldset($html,$cf){
21 21
 
22
-    $html_var = $cf['htmlvar_name'];
23
-
24
-    // Check if there is a custom field specific filter.
25
-    if(has_filter("geodir_custom_field_input_fieldset_{$html_var}")){
26
-        /**
27
-         * Filter the fieldset html by individual custom field.
28
-         *
29
-         * @param string $html The html to filter.
30
-         * @param array $cf The custom field array.
31
-         * @since 1.6.6
32
-         */
33
-        $html = apply_filters("geodir_custom_field_input_fieldset_{$html_var}",$html,$cf);
34
-    }
35
-
36
-    // If no html then we run the standard output.
37
-    if(empty($html)) {
38
-
39
-        ob_start(); // Start  buffering;
40
-        ?>
22
+	$html_var = $cf['htmlvar_name'];
23
+
24
+	// Check if there is a custom field specific filter.
25
+	if(has_filter("geodir_custom_field_input_fieldset_{$html_var}")){
26
+		/**
27
+		 * Filter the fieldset html by individual custom field.
28
+		 *
29
+		 * @param string $html The html to filter.
30
+		 * @param array $cf The custom field array.
31
+		 * @since 1.6.6
32
+		 */
33
+		$html = apply_filters("geodir_custom_field_input_fieldset_{$html_var}",$html,$cf);
34
+	}
35
+
36
+	// If no html then we run the standard output.
37
+	if(empty($html)) {
38
+
39
+		ob_start(); // Start  buffering;
40
+		?>
41 41
         <h5 id="geodir_fieldset_<?php echo (int) $cf['id']; ?>" class="geodir-fieldset-row"
42 42
             gd-fieldset="<?php echo (int) $cf['id']; ?>"><?php echo $cf['site_title']; ?>
43 43
             <?php if ( $cf['desc'] != '' ) {
44
-                echo '<small>( ' . $cf['desc'] . ' )</small>';
45
-            } ?></h5>
44
+				echo '<small>( ' . $cf['desc'] . ' )</small>';
45
+			} ?></h5>
46 46
         <?php
47
-        $html = ob_get_clean();
48
-    }
47
+		$html = ob_get_clean();
48
+	}
49 49
 
50
-    return $html;
50
+	return $html;
51 51
 }
52 52
 add_filter('geodir_custom_field_input_fieldset','geodir_cfi_fieldset',10,2);
53 53
 
@@ -64,47 +64,47 @@  discard block
 block discarded – undo
64 64
  */
65 65
 function geodir_cfi_text($html,$cf){
66 66
 
67
-    $html_var = $cf['htmlvar_name'];
68
-
69
-    // Check if there is a custom field specific filter.
70
-    if(has_filter("geodir_custom_field_input_text_{$html_var}")){
71
-        /**
72
-         * Filter the text html by individual custom field.
73
-         *
74
-         * @param string $html The html to filter.
75
-         * @param array $cf The custom field array.
76
-         * @since 1.6.6
77
-         */
78
-        $html = apply_filters("geodir_custom_field_input_text_{$html_var}",$html,$cf);
79
-    }
80
-
81
-    // If no html then we run the standard output.
82
-    if(empty($html)) {
83
-
84
-        ob_start(); // Start  buffering;
85
-
86
-        $value = geodir_get_cf_value($cf);
87
-        $type = $cf['type'];
88
-        //number and float validation $validation_pattern
89
-        if(isset($cf['data_type']) && $cf['data_type']=='INT'){$type = 'number';}
90
-        elseif(isset($cf['data_type']) && $cf['data_type']=='FLOAT'){$type = 'float';}
91
-
92
-        //validation
93
-        if(isset($cf['validation_pattern']) && $cf['validation_pattern']){
94
-            $validation = 'pattern="'.$cf['validation_pattern'].'"';
95
-        }else{$validation='';}
96
-
97
-        // validation message
98
-        if(isset($cf['validation_msg']) && $cf['validation_msg']){
99
-            $validation_msg = 'title="'.$cf['validation_msg'].'"';
100
-        }else{$validation_msg='';}
101
-        ?>
67
+	$html_var = $cf['htmlvar_name'];
68
+
69
+	// Check if there is a custom field specific filter.
70
+	if(has_filter("geodir_custom_field_input_text_{$html_var}")){
71
+		/**
72
+		 * Filter the text html by individual custom field.
73
+		 *
74
+		 * @param string $html The html to filter.
75
+		 * @param array $cf The custom field array.
76
+		 * @since 1.6.6
77
+		 */
78
+		$html = apply_filters("geodir_custom_field_input_text_{$html_var}",$html,$cf);
79
+	}
80
+
81
+	// If no html then we run the standard output.
82
+	if(empty($html)) {
83
+
84
+		ob_start(); // Start  buffering;
85
+
86
+		$value = geodir_get_cf_value($cf);
87
+		$type = $cf['type'];
88
+		//number and float validation $validation_pattern
89
+		if(isset($cf['data_type']) && $cf['data_type']=='INT'){$type = 'number';}
90
+		elseif(isset($cf['data_type']) && $cf['data_type']=='FLOAT'){$type = 'float';}
91
+
92
+		//validation
93
+		if(isset($cf['validation_pattern']) && $cf['validation_pattern']){
94
+			$validation = 'pattern="'.$cf['validation_pattern'].'"';
95
+		}else{$validation='';}
96
+
97
+		// validation message
98
+		if(isset($cf['validation_msg']) && $cf['validation_msg']){
99
+			$validation_msg = 'title="'.$cf['validation_msg'].'"';
100
+		}else{$validation_msg='';}
101
+		?>
102 102
 
103 103
         <div id="<?php echo $cf['name'];?>_row"
104 104
              class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
105 105
             <label>
106 106
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
107
-                echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
107
+				echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
108 108
                 <?php if ($cf['is_required']) echo '<span>*</span>';?>
109 109
             </label>
110 110
             <input field_type="<?php echo $type;?>" name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>"
@@ -116,10 +116,10 @@  discard block
 block discarded – undo
116 116
         </div>
117 117
 
118 118
         <?php
119
-        $html = ob_get_clean();
120
-    }
119
+		$html = ob_get_clean();
120
+	}
121 121
 
122
-    return $html;
122
+	return $html;
123 123
 }
124 124
 add_filter('geodir_custom_field_input_text','geodir_cfi_text',10,2);
125 125
 
@@ -135,35 +135,35 @@  discard block
 block discarded – undo
135 135
  */
136 136
 function geodir_cfi_email($html,$cf){
137 137
 
138
-    $html_var = $cf['htmlvar_name'];
138
+	$html_var = $cf['htmlvar_name'];
139 139
 
140
-    // Check if there is a custom field specific filter.
141
-    if(has_filter("geodir_custom_field_input_email_{$html_var}")){
142
-        /**
143
-         * Filter the email html by individual custom field.
144
-         *
145
-         * @param string $html The html to filter.
146
-         * @param array $cf The custom field array.
147
-         * @since 1.6.6
148
-         */
149
-        $html = apply_filters("geodir_custom_field_input_email_{$html_var}",$html,$cf);
150
-    }
140
+	// Check if there is a custom field specific filter.
141
+	if(has_filter("geodir_custom_field_input_email_{$html_var}")){
142
+		/**
143
+		 * Filter the email html by individual custom field.
144
+		 *
145
+		 * @param string $html The html to filter.
146
+		 * @param array $cf The custom field array.
147
+		 * @since 1.6.6
148
+		 */
149
+		$html = apply_filters("geodir_custom_field_input_email_{$html_var}",$html,$cf);
150
+	}
151 151
 
152
-    // If no html then we run the standard output.
153
-    if(empty($html)) {
152
+	// If no html then we run the standard output.
153
+	if(empty($html)) {
154 154
 
155
-        ob_start(); // Start  buffering;
156
-        $value = geodir_get_cf_value($cf);
155
+		ob_start(); // Start  buffering;
156
+		$value = geodir_get_cf_value($cf);
157 157
 
158
-        if ($value == $cf['default']) {
159
-            $value = '';
160
-        }?>
158
+		if ($value == $cf['default']) {
159
+			$value = '';
160
+		}?>
161 161
 
162 162
         <div id="<?php echo $cf['name'];?>_row"
163 163
              class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
164 164
             <label>
165 165
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
166
-                echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
166
+				echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
167 167
                 <?php if ($cf['is_required']) echo '<span>*</span>';?>
168 168
             </label>
169 169
             <input field_type="<?php echo $cf['type'];?>" name="<?php  $cf['name'];?>" id="<?php echo $cf['name'];?>"
@@ -175,10 +175,10 @@  discard block
 block discarded – undo
175 175
         </div>
176 176
 
177 177
         <?php
178
-        $html = ob_get_clean();
179
-    }
178
+		$html = ob_get_clean();
179
+	}
180 180
 
181
-    return $html;
181
+	return $html;
182 182
 }
183 183
 add_filter('geodir_custom_field_input_email','geodir_cfi_email',10,2);
184 184
 
@@ -195,35 +195,35 @@  discard block
 block discarded – undo
195 195
  */
196 196
 function geodir_cfi_phone($html,$cf){
197 197
 
198
-    $html_var = $cf['htmlvar_name'];
198
+	$html_var = $cf['htmlvar_name'];
199 199
 
200
-    // Check if there is a custom field specific filter.
201
-    if(has_filter("geodir_custom_field_input_phone_{$html_var}")){
202
-        /**
203
-         * Filter the phone html by individual custom field.
204
-         *
205
-         * @param string $html The html to filter.
206
-         * @param array $cf The custom field array.
207
-         * @since 1.6.6
208
-         */
209
-        $html = apply_filters("geodir_custom_field_input_phone_{$html_var}",$html,$cf);
210
-    }
200
+	// Check if there is a custom field specific filter.
201
+	if(has_filter("geodir_custom_field_input_phone_{$html_var}")){
202
+		/**
203
+		 * Filter the phone html by individual custom field.
204
+		 *
205
+		 * @param string $html The html to filter.
206
+		 * @param array $cf The custom field array.
207
+		 * @since 1.6.6
208
+		 */
209
+		$html = apply_filters("geodir_custom_field_input_phone_{$html_var}",$html,$cf);
210
+	}
211 211
 
212
-    // If no html then we run the standard output.
213
-    if(empty($html)) {
212
+	// If no html then we run the standard output.
213
+	if(empty($html)) {
214 214
 
215
-        ob_start(); // Start  buffering;
216
-        $value = geodir_get_cf_value($cf);
215
+		ob_start(); // Start  buffering;
216
+		$value = geodir_get_cf_value($cf);
217 217
 
218
-        if ($value == $cf['default']) {
219
-            $value = '';
220
-        }?>
218
+		if ($value == $cf['default']) {
219
+			$value = '';
220
+		}?>
221 221
 
222 222
         <div id="<?php echo $cf['name'];?>_row"
223 223
              class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
224 224
             <label>
225 225
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
226
-                echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
226
+				echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
227 227
                 <?php if ($cf['is_required']) echo '<span>*</span>';?>
228 228
             </label>
229 229
             <input field_type="<?php echo $cf['type'];?>" name="<?php  $cf['name'];?>" id="<?php echo $cf['name'];?>"
@@ -235,10 +235,10 @@  discard block
 block discarded – undo
235 235
         </div>
236 236
 
237 237
         <?php
238
-        $html = ob_get_clean();
239
-    }
238
+		$html = ob_get_clean();
239
+	}
240 240
 
241
-    return $html;
241
+	return $html;
242 242
 }
243 243
 add_filter('geodir_custom_field_input_phone','geodir_cfi_phone',10,2);
244 244
 
@@ -255,35 +255,35 @@  discard block
 block discarded – undo
255 255
  */
256 256
 function geodir_cfi_url($html,$cf){
257 257
 
258
-    $html_var = $cf['htmlvar_name'];
258
+	$html_var = $cf['htmlvar_name'];
259 259
 
260
-    // Check if there is a custom field specific filter.
261
-    if(has_filter("geodir_custom_field_input_url_{$html_var}")){
262
-        /**
263
-         * Filter the url html by individual custom field.
264
-         *
265
-         * @param string $html The html to filter.
266
-         * @param array $cf The custom field array.
267
-         * @since 1.6.6
268
-         */
269
-        $html = apply_filters("geodir_custom_field_input_url_{$html_var}",$html,$cf);
270
-    }
260
+	// Check if there is a custom field specific filter.
261
+	if(has_filter("geodir_custom_field_input_url_{$html_var}")){
262
+		/**
263
+		 * Filter the url html by individual custom field.
264
+		 *
265
+		 * @param string $html The html to filter.
266
+		 * @param array $cf The custom field array.
267
+		 * @since 1.6.6
268
+		 */
269
+		$html = apply_filters("geodir_custom_field_input_url_{$html_var}",$html,$cf);
270
+	}
271 271
 
272
-    // If no html then we run the standard output.
273
-    if(empty($html)) {
272
+	// If no html then we run the standard output.
273
+	if(empty($html)) {
274 274
 
275
-        ob_start(); // Start  buffering;
276
-        $value = geodir_get_cf_value($cf);
275
+		ob_start(); // Start  buffering;
276
+		$value = geodir_get_cf_value($cf);
277 277
 
278
-        if ($value == $cf['default']) {
279
-            $value = '';
280
-        }?>
278
+		if ($value == $cf['default']) {
279
+			$value = '';
280
+		}?>
281 281
 
282 282
         <div id="<?php echo $cf['name'];?>_row"
283 283
              class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
284 284
             <label>
285 285
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
286
-                echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
286
+				echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
287 287
                 <?php if ($cf['is_required']) echo '<span>*</span>';?>
288 288
             </label>
289 289
             <input field_type="<?php echo $cf['type'];?>" name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>"
@@ -298,10 +298,10 @@  discard block
 block discarded – undo
298 298
         </div>
299 299
 
300 300
         <?php
301
-        $html = ob_get_clean();
302
-    }
301
+		$html = ob_get_clean();
302
+	}
303 303
 
304
-    return $html;
304
+	return $html;
305 305
 }
306 306
 add_filter('geodir_custom_field_input_url','geodir_cfi_url',10,2);
307 307
 
@@ -317,48 +317,48 @@  discard block
 block discarded – undo
317 317
  */
318 318
 function geodir_cfi_radio($html,$cf){
319 319
 
320
-    $html_var = $cf['htmlvar_name'];
320
+	$html_var = $cf['htmlvar_name'];
321 321
 
322
-    // Check if there is a custom field specific filter.
323
-    if(has_filter("geodir_custom_field_input_radio_{$html_var}")){
324
-        /**
325
-         * Filter the radio html by individual custom field.
326
-         *
327
-         * @param string $html The html to filter.
328
-         * @param array $cf The custom field array.
329
-         * @since 1.6.6
330
-         */
331
-        $html = apply_filters("geodir_custom_field_input_radio_{$html_var}",$html,$cf);
332
-    }
322
+	// Check if there is a custom field specific filter.
323
+	if(has_filter("geodir_custom_field_input_radio_{$html_var}")){
324
+		/**
325
+		 * Filter the radio html by individual custom field.
326
+		 *
327
+		 * @param string $html The html to filter.
328
+		 * @param array $cf The custom field array.
329
+		 * @since 1.6.6
330
+		 */
331
+		$html = apply_filters("geodir_custom_field_input_radio_{$html_var}",$html,$cf);
332
+	}
333 333
 
334
-    // If no html then we run the standard output.
335
-    if(empty($html)) {
334
+	// If no html then we run the standard output.
335
+	if(empty($html)) {
336 336
 
337
-        ob_start(); // Start  buffering;
338
-        $value = geodir_get_cf_value($cf);
337
+		ob_start(); // Start  buffering;
338
+		$value = geodir_get_cf_value($cf);
339 339
 
340
-        ?>
340
+		?>
341 341
         <div id="<?php echo $cf['name'];?>_row"
342 342
              class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
343 343
             <label>
344 344
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
345
-                echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
345
+				echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
346 346
                 <?php if ($cf['is_required']) echo '<span>*</span>';?>
347 347
             </label>
348 348
             <?php if ($cf['option_values']) {
349
-                $option_values = geodir_string_values_to_options($cf['option_values'], true);
349
+				$option_values = geodir_string_values_to_options($cf['option_values'], true);
350 350
 
351
-                if (!empty($option_values)) {
352
-                    foreach ($option_values as $option_value) {
353
-                        if (empty($option_value['optgroup'])) {
354
-                            ?>
351
+				if (!empty($option_values)) {
352
+					foreach ($option_values as $option_value) {
353
+						if (empty($option_value['optgroup'])) {
354
+							?>
355 355
                             <span class="gd-radios"><input name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>" <?php checked($value, $option_value['value']);?> value="<?php echo esc_attr($option_value['value']); ?>" class="gd-checkbox" field_type="<?php echo $cf['type'];?>" type="radio" /><?php echo $option_value['label']; ?></span>
356 356
                             <?php
357
-                        }
358
-                    }
359
-                }
360
-            }
361
-            ?>
357
+						}
358
+					}
359
+				}
360
+			}
361
+			?>
362 362
             <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
363 363
             <?php if ($cf['is_required']) { ?>
364 364
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
@@ -366,10 +366,10 @@  discard block
 block discarded – undo
366 366
         </div>
367 367
 
368 368
         <?php
369
-        $html = ob_get_clean();
370
-    }
369
+		$html = ob_get_clean();
370
+	}
371 371
 
372
-    return $html;
372
+	return $html;
373 373
 }
374 374
 add_filter('geodir_custom_field_input_radio','geodir_cfi_radio',10,2);
375 375
 
@@ -385,44 +385,44 @@  discard block
 block discarded – undo
385 385
  */
386 386
 function geodir_cfi_checkbox($html,$cf){
387 387
 
388
-    $html_var = $cf['htmlvar_name'];
388
+	$html_var = $cf['htmlvar_name'];
389 389
 
390
-    // Check if there is a custom field specific filter.
391
-    if(has_filter("geodir_custom_field_input_checkbox_{$html_var}")){
392
-        /**
393
-         * Filter the checkbox html by individual custom field.
394
-         *
395
-         * @param string $html The html to filter.
396
-         * @param array $cf The custom field array.
397
-         * @since 1.6.6
398
-         */
399
-        $html = apply_filters("geodir_custom_field_input_checkbox_{$html_var}",$html,$cf);
400
-    }
390
+	// Check if there is a custom field specific filter.
391
+	if(has_filter("geodir_custom_field_input_checkbox_{$html_var}")){
392
+		/**
393
+		 * Filter the checkbox html by individual custom field.
394
+		 *
395
+		 * @param string $html The html to filter.
396
+		 * @param array $cf The custom field array.
397
+		 * @since 1.6.6
398
+		 */
399
+		$html = apply_filters("geodir_custom_field_input_checkbox_{$html_var}",$html,$cf);
400
+	}
401 401
 
402
-    // If no html then we run the standard output.
403
-    if(empty($html)) {
402
+	// If no html then we run the standard output.
403
+	if(empty($html)) {
404 404
 
405
-        ob_start(); // Start  buffering;
406
-        $value = geodir_get_cf_value($cf);
405
+		ob_start(); // Start  buffering;
406
+		$value = geodir_get_cf_value($cf);
407 407
 
408
-        if ($value == $cf['default']) {
409
-            $value = '';
410
-        }?>
408
+		if ($value == $cf['default']) {
409
+			$value = '';
410
+		}?>
411 411
 
412 412
         <div id="<?php echo $cf['name'];?>_row"
413 413
              class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
414 414
             <label>
415 415
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
416
-                echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
416
+				echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
417 417
                 <?php if ($cf['is_required']) echo '<span>*</span>';?>
418 418
             </label>
419 419
             <?php if ($value != '1') {
420
-                $value = '0';
421
-            }?>
420
+				$value = '0';
421
+			}?>
422 422
             <input type="hidden" name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>" value="<?php echo esc_attr($value);?>"/>
423 423
             <input  <?php if ($value == '1') {
424
-                echo 'checked="checked"';
425
-            }?>  value="1" class="gd-checkbox" field_type="<?php echo $cf['type'];?>" type="checkbox"
424
+				echo 'checked="checked"';
425
+			}?>  value="1" class="gd-checkbox" field_type="<?php echo $cf['type'];?>" type="checkbox"
426 426
                  onchange="if(this.checked){jQuery('#<?php echo $cf['name'];?>').val('1');} else{ jQuery('#<?php echo $cf['name'];?>').val('0');}"/>
427 427
             <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
428 428
             <?php if ($cf['is_required']) { ?>
@@ -431,10 +431,10 @@  discard block
 block discarded – undo
431 431
         </div>
432 432
 
433 433
         <?php
434
-        $html = ob_get_clean();
435
-    }
434
+		$html = ob_get_clean();
435
+	}
436 436
 
437
-    return $html;
437
+	return $html;
438 438
 }
439 439
 add_filter('geodir_custom_field_input_checkbox','geodir_cfi_checkbox',10,2);
440 440
 
@@ -450,52 +450,52 @@  discard block
 block discarded – undo
450 450
  */
451 451
 function geodir_cfi_textarea($html,$cf){
452 452
 
453
-    $html_var = $cf['htmlvar_name'];
453
+	$html_var = $cf['htmlvar_name'];
454 454
 
455
-    // Check if there is a custom field specific filter.
456
-    if(has_filter("geodir_custom_field_input_textarea_{$html_var}")){
457
-        /**
458
-         * Filter the textarea html by individual custom field.
459
-         *
460
-         * @param string $html The html to filter.
461
-         * @param array $cf The custom field array.
462
-         * @since 1.6.6
463
-         */
464
-        $html = apply_filters("geodir_custom_field_input_textarea_{$html_var}",$html,$cf);
465
-    }
455
+	// Check if there is a custom field specific filter.
456
+	if(has_filter("geodir_custom_field_input_textarea_{$html_var}")){
457
+		/**
458
+		 * Filter the textarea html by individual custom field.
459
+		 *
460
+		 * @param string $html The html to filter.
461
+		 * @param array $cf The custom field array.
462
+		 * @since 1.6.6
463
+		 */
464
+		$html = apply_filters("geodir_custom_field_input_textarea_{$html_var}",$html,$cf);
465
+	}
466 466
 
467
-    // If no html then we run the standard output.
468
-    if(empty($html)) {
467
+	// If no html then we run the standard output.
468
+	if(empty($html)) {
469 469
 
470
-        ob_start(); // Start  buffering;
471
-        $value = geodir_get_cf_value($cf);
470
+		ob_start(); // Start  buffering;
471
+		$value = geodir_get_cf_value($cf);
472 472
 
473
-        $extra_fields = unserialize($cf['extra_fields']);
474
-        ?>
473
+		$extra_fields = unserialize($cf['extra_fields']);
474
+		?>
475 475
 
476 476
         <div id="<?php echo $cf['name'];?>_row"
477 477
              class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
478 478
             <label>
479 479
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
480
-                echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
480
+				echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
481 481
                 <?php if ($cf['is_required']) echo '<span>*</span>';?>
482 482
             </label><?php
483 483
 
484 484
 
485
-            if (is_array($extra_fields) && in_array('1', $extra_fields)) {
485
+			if (is_array($extra_fields) && in_array('1', $extra_fields)) {
486 486
 
487
-                $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);?>
487
+				$editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);?>
488 488
 
489 489
             <div class="editor" field_id="<?php echo $cf['name'];?>" field_type="editor">
490 490
                 <?php wp_editor(stripslashes($value), $cf['name'], $editor_settings); ?>
491 491
                 </div><?php
492 492
 
493
-            } else {
493
+			} else {
494 494
 
495
-                ?><textarea field_type="<?php echo $cf['type'];?>" class="geodir_textarea" name="<?php echo $cf['name'];?>"
495
+				?><textarea field_type="<?php echo $cf['type'];?>" class="geodir_textarea" name="<?php echo $cf['name'];?>"
496 496
                             id="<?php echo $cf['name'];?>"><?php echo stripslashes($value);?></textarea><?php
497 497
 
498
-            }?>
498
+			}?>
499 499
 
500 500
 
501 501
             <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
@@ -505,10 +505,10 @@  discard block
 block discarded – undo
505 505
         </div>
506 506
 
507 507
         <?php
508
-        $html = ob_get_clean();
509
-    }
508
+		$html = ob_get_clean();
509
+	}
510 510
 
511
-    return $html;
511
+	return $html;
512 512
 }
513 513
 add_filter('geodir_custom_field_input_textarea','geodir_cfi_textarea',10,2);
514 514
 
@@ -524,53 +524,53 @@  discard block
 block discarded – undo
524 524
  */
525 525
 function geodir_cfi_select($html,$cf){
526 526
 
527
-    $html_var = $cf['htmlvar_name'];
527
+	$html_var = $cf['htmlvar_name'];
528 528
 
529
-    // Check if there is a custom field specific filter.
530
-    if(has_filter("geodir_custom_field_input_select_{$html_var}")){
531
-        /**
532
-         * Filter the select html by individual custom field.
533
-         *
534
-         * @param string $html The html to filter.
535
-         * @param array $cf The custom field array.
536
-         * @since 1.6.6
537
-         */
538
-        $html = apply_filters("geodir_custom_field_input_select_{$html_var}",$html,$cf);
539
-    }
529
+	// Check if there is a custom field specific filter.
530
+	if(has_filter("geodir_custom_field_input_select_{$html_var}")){
531
+		/**
532
+		 * Filter the select html by individual custom field.
533
+		 *
534
+		 * @param string $html The html to filter.
535
+		 * @param array $cf The custom field array.
536
+		 * @since 1.6.6
537
+		 */
538
+		$html = apply_filters("geodir_custom_field_input_select_{$html_var}",$html,$cf);
539
+	}
540 540
 
541
-    // If no html then we run the standard output.
542
-    if(empty($html)) {
541
+	// If no html then we run the standard output.
542
+	if(empty($html)) {
543 543
 
544
-        ob_start(); // Start  buffering;
545
-        $value = geodir_get_cf_value($cf);
544
+		ob_start(); // Start  buffering;
545
+		$value = geodir_get_cf_value($cf);
546 546
 
547
-        ?>
547
+		?>
548 548
         <div id="<?php echo $cf['name'];?>_row"
549 549
              class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row geodir_custom_fields clearfix gd-fieldset-details">
550 550
             <label>
551 551
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
552
-                echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
552
+				echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
553 553
                 <?php if ($cf['is_required']) echo '<span>*</span>';?>
554 554
             </label>
555 555
             <?php
556
-            $option_values_arr = geodir_string_values_to_options($cf['option_values'], true);
557
-            $select_options = '';
558
-            if (!empty($option_values_arr)) {
559
-                foreach ($option_values_arr as $option_row) {
560
-                    if (isset($option_row['optgroup']) && ($option_row['optgroup'] == 'start' || $option_row['optgroup'] == 'end')) {
561
-                        $option_label = isset($option_row['label']) ? $option_row['label'] : '';
562
-
563
-                        $select_options .= $option_row['optgroup'] == 'start' ? '<optgroup label="' . esc_attr($option_label) . '">' : '</optgroup>';
564
-                    } else {
565
-                        $option_label = isset($option_row['label']) ? $option_row['label'] : '';
566
-                        $option_value = isset($option_row['value']) ? $option_row['value'] : '';
567
-                        $selected = $option_value == $value ? 'selected="selected"' : '';
568
-
569
-                        $select_options .= '<option value="' . esc_attr($option_value) . '" ' . $selected . '>' . $option_label . '</option>';
570
-                    }
571
-                }
572
-            }
573
-            ?>
556
+			$option_values_arr = geodir_string_values_to_options($cf['option_values'], true);
557
+			$select_options = '';
558
+			if (!empty($option_values_arr)) {
559
+				foreach ($option_values_arr as $option_row) {
560
+					if (isset($option_row['optgroup']) && ($option_row['optgroup'] == 'start' || $option_row['optgroup'] == 'end')) {
561
+						$option_label = isset($option_row['label']) ? $option_row['label'] : '';
562
+
563
+						$select_options .= $option_row['optgroup'] == 'start' ? '<optgroup label="' . esc_attr($option_label) . '">' : '</optgroup>';
564
+					} else {
565
+						$option_label = isset($option_row['label']) ? $option_row['label'] : '';
566
+						$option_value = isset($option_row['value']) ? $option_row['value'] : '';
567
+						$selected = $option_value == $value ? 'selected="selected"' : '';
568
+
569
+						$select_options .= '<option value="' . esc_attr($option_value) . '" ' . $selected . '>' . $option_label . '</option>';
570
+					}
571
+				}
572
+			}
573
+			?>
574 574
             <select field_type="<?php echo $cf['type'];?>" name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>"
575 575
                     class="geodir_textfield textfield_x chosen_select"
576 576
                     data-placeholder="<?php echo __('Choose', 'geodirectory') . ' ' . $site_title . '&hellip;';?>"
@@ -582,10 +582,10 @@  discard block
 block discarded – undo
582 582
         </div>
583 583
 
584 584
         <?php
585
-        $html = ob_get_clean();
586
-    }
585
+		$html = ob_get_clean();
586
+	}
587 587
 
588
-    return $html;
588
+	return $html;
589 589
 }
590 590
 add_filter('geodir_custom_field_input_select','geodir_cfi_select',10,2);
591 591
 
@@ -601,36 +601,36 @@  discard block
 block discarded – undo
601 601
  */
602 602
 function geodir_cfi_multiselect($html,$cf){
603 603
 
604
-    $html_var = $cf['htmlvar_name'];
605
-
606
-    // Check if there is a custom field specific filter.
607
-    if(has_filter("geodir_custom_field_input_multiselect_{$html_var}")){
608
-        /**
609
-         * Filter the multiselect html by individual custom field.
610
-         *
611
-         * @param string $html The html to filter.
612
-         * @param array $cf The custom field array.
613
-         * @since 1.6.6
614
-         */
615
-        $html = apply_filters("geodir_custom_field_input_multiselect_{$html_var}",$html,$cf);
616
-    }
617
-
618
-    // If no html then we run the standard output.
619
-    if(empty($html)) {
620
-
621
-        ob_start(); // Start  buffering;
622
-        $value = geodir_get_cf_value($cf);
623
-
624
-        $multi_display = 'select';
625
-        if (!empty($val['extra_fields'])) {
626
-            $multi_display = unserialize($val['extra_fields']);
627
-        }
628
-        ?>
604
+	$html_var = $cf['htmlvar_name'];
605
+
606
+	// Check if there is a custom field specific filter.
607
+	if(has_filter("geodir_custom_field_input_multiselect_{$html_var}")){
608
+		/**
609
+		 * Filter the multiselect html by individual custom field.
610
+		 *
611
+		 * @param string $html The html to filter.
612
+		 * @param array $cf The custom field array.
613
+		 * @since 1.6.6
614
+		 */
615
+		$html = apply_filters("geodir_custom_field_input_multiselect_{$html_var}",$html,$cf);
616
+	}
617
+
618
+	// If no html then we run the standard output.
619
+	if(empty($html)) {
620
+
621
+		ob_start(); // Start  buffering;
622
+		$value = geodir_get_cf_value($cf);
623
+
624
+		$multi_display = 'select';
625
+		if (!empty($val['extra_fields'])) {
626
+			$multi_display = unserialize($val['extra_fields']);
627
+		}
628
+		?>
629 629
         <div id="<?php echo $cf['name']; ?>_row"
630 630
              class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
631 631
             <label>
632 632
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
633
-                echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
633
+				echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
634 634
                 <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
635 635
             </label>
636 636
             <input type="hidden" name="gd_field_<?php echo $cf['name']; ?>" value="1"/>
@@ -641,55 +641,55 @@  discard block
 block discarded – undo
641 641
                         data-placeholder="<?php _e('Select', 'geodirectory'); ?>"
642 642
                         option-ajaxchosen="false">
643 643
                     <?php
644
-                    } else {
645
-                        echo '<ul class="gd_multi_choice">';
646
-                    }
647
-
648
-                    $option_values_arr = geodir_string_values_to_options($cf['option_values'], true);
649
-                    $select_options = '';
650
-                    if (!empty($option_values_arr)) {
651
-                        foreach ($option_values_arr as $option_row) {
652
-                            if (isset($option_row['optgroup']) && ($option_row['optgroup'] == 'start' || $option_row['optgroup'] == 'end')) {
653
-                                $option_label = isset($option_row['label']) ? $option_row['label'] : '';
654
-
655
-                                if ($multi_display == 'select') {
656
-                                    $select_options .= $option_row['optgroup'] == 'start' ? '<optgroup label="' . esc_attr($option_label) . '">' : '</optgroup>';
657
-                                } else {
658
-                                    $select_options .= $option_row['optgroup'] == 'start' ? '<li>' . $option_label . '</li>' : '';
659
-                                }
660
-                            } else {
661
-                                $option_label = isset($option_row['label']) ? $option_row['label'] : '';
662
-                                $option_value = isset($option_row['value']) ? $option_row['value'] : '';
663
-                                $selected = $option_value == $value ? 'selected="selected"' : '';
664
-                                $selected = '';
665
-                                $checked = '';
666
-
667
-                                if ((!is_array($value) && trim($value) != '') || (is_array($value) && !empty($value))) {
668
-                                    if (!is_array($value)) {
669
-                                        $value_array = explode(',', $value);
670
-                                    } else {
671
-                                        $value_array = $value;
672
-                                    }
673
-
674
-                                    if (is_array($value_array)) {
675
-                                        if (in_array($option_value, $value_array)) {
676
-                                            $selected = 'selected="selected"';
677
-                                            $checked = 'checked="checked"';
678
-                                        }
679
-                                    }
680
-                                }
681
-
682
-                                if ($multi_display == 'select') {
683
-                                    $select_options .= '<option value="' . esc_attr($option_value) . '" ' . $selected . '>' . $option_label . '</option>';
684
-                                } else {
685
-                                    $select_options .= '<li><input name="' . $cf['name'] . '[]" ' . $checked . ' value="' . esc_attr($option_value) . '" class="gd-' . $multi_display . '" field_type="' . $multi_display . '" type="' . $multi_display . '" />&nbsp;' . $option_label . ' </li>';
686
-                                }
687
-                            }
688
-                        }
689
-                    }
690
-                    echo $select_options;
691
-
692
-                    if ($multi_display == 'select') { ?></select></div>
644
+					} else {
645
+						echo '<ul class="gd_multi_choice">';
646
+					}
647
+
648
+					$option_values_arr = geodir_string_values_to_options($cf['option_values'], true);
649
+					$select_options = '';
650
+					if (!empty($option_values_arr)) {
651
+						foreach ($option_values_arr as $option_row) {
652
+							if (isset($option_row['optgroup']) && ($option_row['optgroup'] == 'start' || $option_row['optgroup'] == 'end')) {
653
+								$option_label = isset($option_row['label']) ? $option_row['label'] : '';
654
+
655
+								if ($multi_display == 'select') {
656
+									$select_options .= $option_row['optgroup'] == 'start' ? '<optgroup label="' . esc_attr($option_label) . '">' : '</optgroup>';
657
+								} else {
658
+									$select_options .= $option_row['optgroup'] == 'start' ? '<li>' . $option_label . '</li>' : '';
659
+								}
660
+							} else {
661
+								$option_label = isset($option_row['label']) ? $option_row['label'] : '';
662
+								$option_value = isset($option_row['value']) ? $option_row['value'] : '';
663
+								$selected = $option_value == $value ? 'selected="selected"' : '';
664
+								$selected = '';
665
+								$checked = '';
666
+
667
+								if ((!is_array($value) && trim($value) != '') || (is_array($value) && !empty($value))) {
668
+									if (!is_array($value)) {
669
+										$value_array = explode(',', $value);
670
+									} else {
671
+										$value_array = $value;
672
+									}
673
+
674
+									if (is_array($value_array)) {
675
+										if (in_array($option_value, $value_array)) {
676
+											$selected = 'selected="selected"';
677
+											$checked = 'checked="checked"';
678
+										}
679
+									}
680
+								}
681
+
682
+								if ($multi_display == 'select') {
683
+									$select_options .= '<option value="' . esc_attr($option_value) . '" ' . $selected . '>' . $option_label . '</option>';
684
+								} else {
685
+									$select_options .= '<li><input name="' . $cf['name'] . '[]" ' . $checked . ' value="' . esc_attr($option_value) . '" class="gd-' . $multi_display . '" field_type="' . $multi_display . '" type="' . $multi_display . '" />&nbsp;' . $option_label . ' </li>';
686
+								}
687
+							}
688
+						}
689
+					}
690
+					echo $select_options;
691
+
692
+					if ($multi_display == 'select') { ?></select></div>
693 693
         <?php } else { ?></ul><?php } ?>
694 694
             <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
695 695
             <?php if ($cf['is_required']) { ?>
@@ -697,10 +697,10 @@  discard block
 block discarded – undo
697 697
             <?php } ?>
698 698
         </div>
699 699
         <?php
700
-        $html = ob_get_clean();
701
-    }
700
+		$html = ob_get_clean();
701
+	}
702 702
 
703
-    return $html;
703
+	return $html;
704 704
 }
705 705
 add_filter('geodir_custom_field_input_multiselect','geodir_cfi_multiselect',10,2);
706 706
 
@@ -716,32 +716,32 @@  discard block
 block discarded – undo
716 716
  */
717 717
 function geodir_cfi_html($html,$cf){
718 718
 
719
-    $html_var = $cf['htmlvar_name'];
719
+	$html_var = $cf['htmlvar_name'];
720 720
 
721
-    // Check if there is a custom field specific filter.
722
-    if(has_filter("geodir_custom_field_input_html_{$html_var}")){
723
-        /**
724
-         * Filter the html html by individual custom field.
725
-         *
726
-         * @param string $html The html to filter.
727
-         * @param array $cf The custom field array.
728
-         * @since 1.6.6
729
-         */
730
-        $html = apply_filters("geodir_custom_field_input_html_{$html_var}",$html,$cf);
731
-    }
721
+	// Check if there is a custom field specific filter.
722
+	if(has_filter("geodir_custom_field_input_html_{$html_var}")){
723
+		/**
724
+		 * Filter the html html by individual custom field.
725
+		 *
726
+		 * @param string $html The html to filter.
727
+		 * @param array $cf The custom field array.
728
+		 * @since 1.6.6
729
+		 */
730
+		$html = apply_filters("geodir_custom_field_input_html_{$html_var}",$html,$cf);
731
+	}
732 732
 
733
-    // If no html then we run the standard output.
734
-    if(empty($html)) {
733
+	// If no html then we run the standard output.
734
+	if(empty($html)) {
735 735
 
736
-        ob_start(); // Start  buffering;
737
-        $value = geodir_get_cf_value($cf);
738
-        ?>
736
+		ob_start(); // Start  buffering;
737
+		$value = geodir_get_cf_value($cf);
738
+		?>
739 739
 
740 740
         <div id="<?php echo $cf['name']; ?>_row"
741 741
              class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
742 742
             <label>
743 743
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
744
-                echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
744
+				echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
745 745
                 <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
746 746
             </label>
747 747
 
@@ -759,10 +759,10 @@  discard block
 block discarded – undo
759 759
         </div>
760 760
 
761 761
         <?php
762
-        $html = ob_get_clean();
763
-    }
762
+		$html = ob_get_clean();
763
+	}
764 764
 
765
-    return $html;
765
+	return $html;
766 766
 }
767 767
 add_filter('geodir_custom_field_input_html','geodir_cfi_html',10,2);
768 768
 
@@ -779,67 +779,67 @@  discard block
 block discarded – undo
779 779
  */
780 780
 function geodir_cfi_datepicker($html,$cf){
781 781
 
782
-    $html_var = $cf['htmlvar_name'];
782
+	$html_var = $cf['htmlvar_name'];
783 783
 
784
-    // Check if there is a custom field specific filter.
785
-    if(has_filter("geodir_custom_field_input_datepicker_{$html_var}")){
786
-        /**
787
-         * Filter the datepicker html by individual custom field.
788
-         *
789
-         * @param string $html The html to filter.
790
-         * @param array $cf The custom field array.
791
-         * @since 1.6.6
792
-         */
793
-        $html = apply_filters("geodir_custom_field_input_datepicker_{$html_var}",$html,$cf);
794
-    }
784
+	// Check if there is a custom field specific filter.
785
+	if(has_filter("geodir_custom_field_input_datepicker_{$html_var}")){
786
+		/**
787
+		 * Filter the datepicker html by individual custom field.
788
+		 *
789
+		 * @param string $html The html to filter.
790
+		 * @param array $cf The custom field array.
791
+		 * @since 1.6.6
792
+		 */
793
+		$html = apply_filters("geodir_custom_field_input_datepicker_{$html_var}",$html,$cf);
794
+	}
795 795
 
796
-    // If no html then we run the standard output.
797
-    if(empty($html)) {
796
+	// If no html then we run the standard output.
797
+	if(empty($html)) {
798 798
 
799
-        ob_start(); // Start  buffering;
800
-        $value = geodir_get_cf_value($cf);
799
+		ob_start(); // Start  buffering;
800
+		$value = geodir_get_cf_value($cf);
801 801
 
802
-        $extra_fields = unserialize($cf['extra_fields']);
803
-        $name = $cf['name'];
802
+		$extra_fields = unserialize($cf['extra_fields']);
803
+		$name = $cf['name'];
804 804
 
805
-        if ($extra_fields['date_format'] == '')
806
-            $extra_fields['date_format'] = 'yy-mm-dd';
805
+		if ($extra_fields['date_format'] == '')
806
+			$extra_fields['date_format'] = 'yy-mm-dd';
807 807
 
808
-        $date_format = $extra_fields['date_format'];
809
-        $jquery_date_format  = $date_format;
808
+		$date_format = $extra_fields['date_format'];
809
+		$jquery_date_format  = $date_format;
810 810
 
811 811
 
812
-        // check if we need to change the format or not
813
-        $date_format_len = strlen(str_replace(' ', '', $date_format));
814
-        if($date_format_len>5){// if greater then 5 then it's the old style format.
812
+		// check if we need to change the format or not
813
+		$date_format_len = strlen(str_replace(' ', '', $date_format));
814
+		if($date_format_len>5){// if greater then 5 then it's the old style format.
815 815
 
816
-            $search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format
817
-            $replace = array('d','j','l','m','n','F','Y');//PHP date format
816
+			$search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format
817
+			$replace = array('d','j','l','m','n','F','Y');//PHP date format
818 818
 
819
-            $date_format = str_replace($search, $replace, $date_format);
820
-        }else{
821
-            $jquery_date_format = geodir_date_format_php_to_jqueryui( $jquery_date_format );
822
-        }
819
+			$date_format = str_replace($search, $replace, $date_format);
820
+		}else{
821
+			$jquery_date_format = geodir_date_format_php_to_jqueryui( $jquery_date_format );
822
+		}
823 823
 
824
-        if($value=='0000-00-00'){$value='';}//if date not set, then mark it empty
825
-        if($value && !isset($_REQUEST['backandedit'])) {
826
-            $time = strtotime($value);
827
-            $value = date_i18n($date_format, $time);
828
-        }
824
+		if($value=='0000-00-00'){$value='';}//if date not set, then mark it empty
825
+		if($value && !isset($_REQUEST['backandedit'])) {
826
+			$time = strtotime($value);
827
+			$value = date_i18n($date_format, $time);
828
+		}
829 829
 
830
-        ?>
830
+		?>
831 831
         <script type="text/javascript">
832 832
 
833 833
             jQuery(function () {
834 834
 
835 835
                 jQuery("#<?php echo $cf['name'];?>").datepicker({changeMonth: true, changeYear: true <?php
836
-                    /**
837
-                     * Used to add extra option to datepicker per custom field.
838
-                     *
839
-                     * @since 1.5.7
840
-                     * @param string $name The custom field name.
841
-                     */
842
-                    echo apply_filters("gd_datepicker_extra_{$name}",'');?>});
836
+					/**
837
+					 * Used to add extra option to datepicker per custom field.
838
+					 *
839
+					 * @since 1.5.7
840
+					 * @param string $name The custom field name.
841
+					 */
842
+					echo apply_filters("gd_datepicker_extra_{$name}",'');?>});
843 843
 
844 844
                 jQuery("#<?php echo $name;?>").datepicker("option", "dateFormat", '<?php echo $jquery_date_format;?>');
845 845
 
@@ -855,7 +855,7 @@  discard block
 block discarded – undo
855 855
             <label>
856 856
 
857 857
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
858
-                echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
858
+				echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
859 859
                 <?php if ($cf['is_required']) echo '<span>*</span>';?>
860 860
             </label>
861 861
 
@@ -869,10 +869,10 @@  discard block
 block discarded – undo
869 869
         </div>
870 870
 
871 871
         <?php
872
-        $html = ob_get_clean();
873
-    }
872
+		$html = ob_get_clean();
873
+	}
874 874
 
875
-    return $html;
875
+	return $html;
876 876
 }
877 877
 add_filter('geodir_custom_field_input_datepicker','geodir_cfi_datepicker',10,2);
878 878
 
@@ -888,31 +888,31 @@  discard block
 block discarded – undo
888 888
  */
889 889
 function geodir_cfi_time($html,$cf){
890 890
 
891
-    $html_var = $cf['htmlvar_name'];
891
+	$html_var = $cf['htmlvar_name'];
892 892
 
893
-    // Check if there is a custom field specific filter.
894
-    if(has_filter("geodir_custom_field_input_time_{$html_var}")){
895
-        /**
896
-         * Filter the time html by individual custom field.
897
-         *
898
-         * @param string $html The html to filter.
899
-         * @param array $cf The custom field array.
900
-         * @since 1.6.6
901
-         */
902
-        $html = apply_filters("geodir_custom_field_input_time_{$html_var}",$html,$cf);
903
-    }
893
+	// Check if there is a custom field specific filter.
894
+	if(has_filter("geodir_custom_field_input_time_{$html_var}")){
895
+		/**
896
+		 * Filter the time html by individual custom field.
897
+		 *
898
+		 * @param string $html The html to filter.
899
+		 * @param array $cf The custom field array.
900
+		 * @since 1.6.6
901
+		 */
902
+		$html = apply_filters("geodir_custom_field_input_time_{$html_var}",$html,$cf);
903
+	}
904 904
 
905
-    // If no html then we run the standard output.
906
-    if(empty($html)) {
905
+	// If no html then we run the standard output.
906
+	if(empty($html)) {
907 907
 
908
-        ob_start(); // Start  buffering;
909
-        $value = geodir_get_cf_value($cf);
908
+		ob_start(); // Start  buffering;
909
+		$value = geodir_get_cf_value($cf);
910 910
 
911
-        $name = $cf['name'];
911
+		$name = $cf['name'];
912 912
 
913
-        if ($value != '')
914
-            $value = date('H:i', strtotime($value));
915
-        ?>
913
+		if ($value != '')
914
+			$value = date('H:i', strtotime($value));
915
+		?>
916 916
         <script type="text/javascript">
917 917
             jQuery(document).ready(function () {
918 918
 
@@ -928,7 +928,7 @@  discard block
 block discarded – undo
928 928
             <label>
929 929
 
930 930
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
931
-                echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
931
+				echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
932 932
                 <?php if ($cf['is_required']) echo '<span>*</span>';?>
933 933
             </label>
934 934
             <input readonly="readonly" field_type="<?php echo $cf['type'];?>" name="<?php echo $name;?>"
@@ -940,10 +940,10 @@  discard block
 block discarded – undo
940 940
             <?php } ?>
941 941
         </div>
942 942
         <?php
943
-        $html = ob_get_clean();
944
-    }
943
+		$html = ob_get_clean();
944
+	}
945 945
 
946
-    return $html;
946
+	return $html;
947 947
 }
948 948
 add_filter('geodir_custom_field_input_time','geodir_cfi_time',10,2);
949 949
 
@@ -959,100 +959,100 @@  discard block
 block discarded – undo
959 959
  */
960 960
 function geodir_cfi_address($html,$cf){
961 961
 
962
-    $html_var = $cf['htmlvar_name'];
963
-
964
-    // Check if there is a custom field specific filter.
965
-    if(has_filter("geodir_custom_field_input_address_{$html_var}")){
966
-        /**
967
-         * Filter the address html by individual custom field.
968
-         *
969
-         * @param string $html The html to filter.
970
-         * @param array $cf The custom field array.
971
-         * @since 1.6.6
972
-         */
973
-        $html = apply_filters("geodir_custom_field_input_address_{$html_var}",$html,$cf);
974
-    }
975
-
976
-    // If no html then we run the standard output.
977
-    if(empty($html)) {
978
-
979
-        global $gd_session;
980
-        ob_start(); // Start  buffering;
981
-        $value = geodir_get_cf_value($cf);
982
-        $name = $cf['name'];
983
-        $type = $cf['type'];
984
-        $admin_desc = $cf['desc'];
985
-        $is_required = $cf['is_required'];
986
-        $required_msg = $cf['required_msg'];
987
-        $site_title = $cf['site_title'];
988
-        $is_admin = $cf['is_admin'];
989
-        $extra_fields = unserialize($cf['extra_fields']);
990
-        $prefix = $name . '_';
991
-
992
-        ($site_title != '') ? $address_title = $site_title : $address_title = geodir_ucwords($prefix . ' address');
993
-        ($extra_fields['zip_lable'] != '') ? $zip_title = $extra_fields['zip_lable'] : $zip_title = geodir_ucwords($prefix . ' zip/post code ');
994
-        ($extra_fields['map_lable'] != '') ? $map_title = $extra_fields['map_lable'] : $map_title = geodir_ucwords('set address on map');
995
-        ($extra_fields['mapview_lable'] != '') ? $mapview_title = $extra_fields['mapview_lable'] : $mapview_title = geodir_ucwords($prefix . ' mapview');
996
-
997
-        $address = '';
998
-        $zip = '';
999
-        $mapview = '';
1000
-        $mapzoom = '';
1001
-        $lat = '';
1002
-        $lng = '';
1003
-
1004
-        if (isset($_REQUEST['backandedit']) && $_REQUEST['backandedit'] && $gd_ses_listing = $gd_session->get('listing')) {
1005
-            $post = $gd_ses_listing;
1006
-            $address = $post[$prefix . 'address'];
1007
-            $zip = isset($post[$prefix . 'zip']) ? $post[$prefix . 'zip'] : '';
1008
-            $lat = isset($post[$prefix . 'latitude']) ? $post[$prefix . 'latitude'] : '';
1009
-            $lng = isset($post[$prefix . 'longitude']) ? $post[$prefix . 'longitude'] : '';
1010
-            $mapview = isset($post[$prefix . 'mapview']) ? $post[$prefix . 'mapview'] : '';
1011
-            $mapzoom = isset($post[$prefix . 'mapzoom']) ? $post[$prefix . 'mapzoom'] : '';
1012
-        } else if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '' && $post_info = geodir_get_post_info($_REQUEST['pid'])) {
1013
-            $post_info = (array)$post_info;
1014
-
1015
-            $address = $post_info[$prefix . 'address'];
1016
-            $zip = isset($post_info[$prefix . 'zip']) ? $post_info[$prefix . 'zip'] : '';
1017
-            $lat = isset($post_info[$prefix . 'latitude']) ? $post_info[$prefix . 'latitude'] : '';
1018
-            $lng = isset($post_info[$prefix . 'longitude']) ? $post_info[$prefix . 'longitude'] : '';
1019
-            $mapview = isset($post_info[$prefix . 'mapview']) ? $post_info[$prefix . 'mapview'] : '';
1020
-            $mapzoom = isset($post_info[$prefix . 'mapzoom']) ? $post_info[$prefix . 'mapzoom'] : '';
1021
-        }
1022
-
1023
-        $location = geodir_get_default_location();
1024
-        if (empty($city)) $city = isset($location->city) ? $location->city : '';
1025
-        if (empty($region)) $region = isset($location->region) ? $location->region : '';
1026
-        if (empty($country)) $country = isset($location->country) ? $location->country : '';
1027
-
1028
-        $lat_lng_blank = false;
1029
-        if (empty($lat) && empty($lng)) {
1030
-            $lat_lng_blank = true;
1031
-        }
1032
-
1033
-        if (empty($lat)) $lat = isset($location->city_latitude) ? $location->city_latitude : '';
1034
-        if (empty($lng)) $lng = isset($location->city_longitude) ? $location->city_longitude : '';
1035
-
1036
-        /**
1037
-         * Filter the default latitude.
1038
-         *
1039
-         * @since 1.0.0
1040
-         *
1041
-         * @param float $lat Default latitude.
1042
-         * @param bool $is_admin For admin use only?.
1043
-         */
1044
-        $lat = apply_filters('geodir_default_latitude', $lat, $is_admin);
1045
-        /**
1046
-         * Filter the default longitude.
1047
-         *
1048
-         * @since 1.0.0
1049
-         *
1050
-         * @param float $lat Default longitude.
1051
-         * @param bool $is_admin For admin use only?.
1052
-         */
1053
-        $lng = apply_filters('geodir_default_longitude', $lng, $is_admin);
1054
-
1055
-        ?>
962
+	$html_var = $cf['htmlvar_name'];
963
+
964
+	// Check if there is a custom field specific filter.
965
+	if(has_filter("geodir_custom_field_input_address_{$html_var}")){
966
+		/**
967
+		 * Filter the address html by individual custom field.
968
+		 *
969
+		 * @param string $html The html to filter.
970
+		 * @param array $cf The custom field array.
971
+		 * @since 1.6.6
972
+		 */
973
+		$html = apply_filters("geodir_custom_field_input_address_{$html_var}",$html,$cf);
974
+	}
975
+
976
+	// If no html then we run the standard output.
977
+	if(empty($html)) {
978
+
979
+		global $gd_session;
980
+		ob_start(); // Start  buffering;
981
+		$value = geodir_get_cf_value($cf);
982
+		$name = $cf['name'];
983
+		$type = $cf['type'];
984
+		$admin_desc = $cf['desc'];
985
+		$is_required = $cf['is_required'];
986
+		$required_msg = $cf['required_msg'];
987
+		$site_title = $cf['site_title'];
988
+		$is_admin = $cf['is_admin'];
989
+		$extra_fields = unserialize($cf['extra_fields']);
990
+		$prefix = $name . '_';
991
+
992
+		($site_title != '') ? $address_title = $site_title : $address_title = geodir_ucwords($prefix . ' address');
993
+		($extra_fields['zip_lable'] != '') ? $zip_title = $extra_fields['zip_lable'] : $zip_title = geodir_ucwords($prefix . ' zip/post code ');
994
+		($extra_fields['map_lable'] != '') ? $map_title = $extra_fields['map_lable'] : $map_title = geodir_ucwords('set address on map');
995
+		($extra_fields['mapview_lable'] != '') ? $mapview_title = $extra_fields['mapview_lable'] : $mapview_title = geodir_ucwords($prefix . ' mapview');
996
+
997
+		$address = '';
998
+		$zip = '';
999
+		$mapview = '';
1000
+		$mapzoom = '';
1001
+		$lat = '';
1002
+		$lng = '';
1003
+
1004
+		if (isset($_REQUEST['backandedit']) && $_REQUEST['backandedit'] && $gd_ses_listing = $gd_session->get('listing')) {
1005
+			$post = $gd_ses_listing;
1006
+			$address = $post[$prefix . 'address'];
1007
+			$zip = isset($post[$prefix . 'zip']) ? $post[$prefix . 'zip'] : '';
1008
+			$lat = isset($post[$prefix . 'latitude']) ? $post[$prefix . 'latitude'] : '';
1009
+			$lng = isset($post[$prefix . 'longitude']) ? $post[$prefix . 'longitude'] : '';
1010
+			$mapview = isset($post[$prefix . 'mapview']) ? $post[$prefix . 'mapview'] : '';
1011
+			$mapzoom = isset($post[$prefix . 'mapzoom']) ? $post[$prefix . 'mapzoom'] : '';
1012
+		} else if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '' && $post_info = geodir_get_post_info($_REQUEST['pid'])) {
1013
+			$post_info = (array)$post_info;
1014
+
1015
+			$address = $post_info[$prefix . 'address'];
1016
+			$zip = isset($post_info[$prefix . 'zip']) ? $post_info[$prefix . 'zip'] : '';
1017
+			$lat = isset($post_info[$prefix . 'latitude']) ? $post_info[$prefix . 'latitude'] : '';
1018
+			$lng = isset($post_info[$prefix . 'longitude']) ? $post_info[$prefix . 'longitude'] : '';
1019
+			$mapview = isset($post_info[$prefix . 'mapview']) ? $post_info[$prefix . 'mapview'] : '';
1020
+			$mapzoom = isset($post_info[$prefix . 'mapzoom']) ? $post_info[$prefix . 'mapzoom'] : '';
1021
+		}
1022
+
1023
+		$location = geodir_get_default_location();
1024
+		if (empty($city)) $city = isset($location->city) ? $location->city : '';
1025
+		if (empty($region)) $region = isset($location->region) ? $location->region : '';
1026
+		if (empty($country)) $country = isset($location->country) ? $location->country : '';
1027
+
1028
+		$lat_lng_blank = false;
1029
+		if (empty($lat) && empty($lng)) {
1030
+			$lat_lng_blank = true;
1031
+		}
1032
+
1033
+		if (empty($lat)) $lat = isset($location->city_latitude) ? $location->city_latitude : '';
1034
+		if (empty($lng)) $lng = isset($location->city_longitude) ? $location->city_longitude : '';
1035
+
1036
+		/**
1037
+		 * Filter the default latitude.
1038
+		 *
1039
+		 * @since 1.0.0
1040
+		 *
1041
+		 * @param float $lat Default latitude.
1042
+		 * @param bool $is_admin For admin use only?.
1043
+		 */
1044
+		$lat = apply_filters('geodir_default_latitude', $lat, $is_admin);
1045
+		/**
1046
+		 * Filter the default longitude.
1047
+		 *
1048
+		 * @since 1.0.0
1049
+		 *
1050
+		 * @param float $lat Default longitude.
1051
+		 * @param bool $is_admin For admin use only?.
1052
+		 */
1053
+		$lng = apply_filters('geodir_default_longitude', $lng, $is_admin);
1054
+
1055
+		?>
1056 1056
 
1057 1057
         <div id="geodir_<?php echo $prefix . 'address';?>_row"
1058 1058
              class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
@@ -1071,17 +1071,17 @@  discard block
 block discarded – undo
1071 1071
 
1072 1072
 
1073 1073
         <?php
1074
-        /**
1075
-         * Called after the address input on the add listings.
1076
-         *
1077
-         * This is used by the location manage to add further locations info etc.
1078
-         *
1079
-         * @since 1.0.0
1080
-         * @param array $cf The array of setting for the custom field. {@see geodir_custom_field_save()}.
1081
-         */
1082
-        do_action('geodir_address_extra_listing_fields', $cf);
1083
-
1084
-        if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) { ?>
1074
+		/**
1075
+		 * Called after the address input on the add listings.
1076
+		 *
1077
+		 * This is used by the location manage to add further locations info etc.
1078
+		 *
1079
+		 * @since 1.0.0
1080
+		 * @param array $cf The array of setting for the custom field. {@see geodir_custom_field_save()}.
1081
+		 */
1082
+		do_action('geodir_address_extra_listing_fields', $cf);
1083
+
1084
+		if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) { ?>
1085 1085
 
1086 1086
             <div id="geodir_<?php echo $prefix . 'zip'; ?>_row"
1087 1087
                  class="<?php /*if($is_required) echo 'required_field';*/ ?> geodir_form_row clearfix gd-fieldset-details">
@@ -1102,22 +1102,22 @@  discard block
 block discarded – undo
1102 1102
 
1103 1103
             <div id="geodir_<?php echo $prefix . 'map'; ?>_row" class="geodir_form_row clearfix gd-fieldset-details">
1104 1104
                 <?php
1105
-                /**
1106
-                 * Contains add listing page map functions.
1107
-                 *
1108
-                 * @since 1.0.0
1109
-                 */
1110
-                include(geodir_plugin_path() . "/geodirectory-functions/map-functions/map_on_add_listing_page.php");
1111
-                if ($lat_lng_blank) {
1112
-                    $lat = '';
1113
-                    $lng = '';
1114
-                }
1115
-                ?>
1105
+				/**
1106
+				 * Contains add listing page map functions.
1107
+				 *
1108
+				 * @since 1.0.0
1109
+				 */
1110
+				include(geodir_plugin_path() . "/geodirectory-functions/map-functions/map_on_add_listing_page.php");
1111
+				if ($lat_lng_blank) {
1112
+					$lat = '';
1113
+					$lng = '';
1114
+				}
1115
+				?>
1116 1116
                 <span class="geodir_message_note"><?php echo GET_MAP_MSG; ?></span>
1117 1117
             </div>
1118 1118
             <?php
1119
-            /* show lat lng */
1120
-            $style_latlng = ((isset($extra_fields['show_latlng']) && $extra_fields['show_latlng']) || is_admin()) ? '' : 'style="display:none"'; ?>
1119
+			/* show lat lng */
1120
+			$style_latlng = ((isset($extra_fields['show_latlng']) && $extra_fields['show_latlng']) || is_admin()) ? '' : 'style="display:none"'; ?>
1121 1121
             <div id="geodir_<?php echo $prefix . 'latitude'; ?>_row"
1122 1122
                  class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details" <?php echo $style_latlng; ?>>
1123 1123
                 <label>
@@ -1158,27 +1158,27 @@  discard block
 block discarded – undo
1158 1158
                                                             class="gd-checkbox"
1159 1159
                                                             name="<?php echo $prefix . 'mapview'; ?>"
1160 1160
                                                             id="<?php echo $prefix . 'mapview'; ?>" <?php if ($mapview == 'ROADMAP' || $mapview == '') {
1161
-                            echo 'checked="checked"';
1162
-                        } ?>  value="ROADMAP" size="25"/> <?php _e('Default Map', 'geodirectory'); ?></span>
1161
+							echo 'checked="checked"';
1162
+						} ?>  value="ROADMAP" size="25"/> <?php _e('Default Map', 'geodirectory'); ?></span>
1163 1163
                     <span class="geodir_user_define"> <input field_type="<?php echo $type; ?>" type="radio"
1164 1164
                                                              class="gd-checkbox"
1165 1165
                                                              name="<?php echo $prefix . 'mapview'; ?>"
1166 1166
                                                              id="map_view1" <?php if ($mapview == 'SATELLITE') {
1167
-                            echo 'checked="checked"';
1168
-                        } ?> value="SATELLITE" size="25"/> <?php _e('Satellite Map', 'geodirectory'); ?></span>
1167
+							echo 'checked="checked"';
1168
+						} ?> value="SATELLITE" size="25"/> <?php _e('Satellite Map', 'geodirectory'); ?></span>
1169 1169
 
1170 1170
                     <span class="geodir_user_define"><input field_type="<?php echo $type; ?>" type="radio"
1171 1171
                                                             class="gd-checkbox"
1172 1172
                                                             name="<?php echo $prefix . 'mapview'; ?>"
1173 1173
                                                             id="map_view2" <?php if ($mapview == 'HYBRID') {
1174
-                            echo 'checked="checked"';
1175
-                        } ?>  value="HYBRID" size="25"/> <?php _e('Hybrid Map', 'geodirectory'); ?></span>
1174
+							echo 'checked="checked"';
1175
+						} ?>  value="HYBRID" size="25"/> <?php _e('Hybrid Map', 'geodirectory'); ?></span>
1176 1176
 					<span class="geodir_user_define"><input field_type="<?php echo $type; ?>" type="radio"
1177 1177
                                                             class="gd-checkbox"
1178 1178
                                                             name="<?php echo $prefix . 'mapview'; ?>"
1179 1179
                                                             id="map_view3" <?php if ($mapview == 'TERRAIN') {
1180
-                            echo 'checked="checked"';
1181
-                        } ?>  value="TERRAIN" size="25"/> <?php _e('Terrain Map', 'geodirectory'); ?></span>
1180
+							echo 'checked="checked"';
1181
+						} ?>  value="TERRAIN" size="25"/> <?php _e('Terrain Map', 'geodirectory'); ?></span>
1182 1182
 
1183 1183
 
1184 1184
             </div>
@@ -1186,14 +1186,14 @@  discard block
 block discarded – undo
1186 1186
 
1187 1187
         <?php if (isset($extra_fields['show_mapzoom']) && $extra_fields['show_mapzoom']) { ?>
1188 1188
             <input type="hidden" value="<?php if (isset($mapzoom)) {
1189
-                echo esc_attr($mapzoom);
1190
-            } ?>" name="<?php echo $prefix . 'mapzoom'; ?>" id="<?php echo $prefix . 'mapzoom'; ?>"/>
1189
+				echo esc_attr($mapzoom);
1190
+			} ?>" name="<?php echo $prefix . 'mapzoom'; ?>" id="<?php echo $prefix . 'mapzoom'; ?>"/>
1191 1191
         <?php }
1192 1192
 
1193
-        $html = ob_get_clean();
1194
-    }
1193
+		$html = ob_get_clean();
1194
+	}
1195 1195
 
1196
-    return $html;
1196
+	return $html;
1197 1197
 }
1198 1198
 add_filter('geodir_custom_field_input_address','geodir_cfi_address',10,2);
1199 1199
 
@@ -1210,137 +1210,137 @@  discard block
 block discarded – undo
1210 1210
  */
1211 1211
 function geodir_cfi_taxonomy($html,$cf){
1212 1212
 
1213
-    $html_var = $cf['htmlvar_name'];
1214
-
1215
-    // Check if there is a custom field specific filter.
1216
-    if(has_filter("geodir_custom_field_input_taxonomy_{$html_var}")){
1217
-        /**
1218
-         * Filter the taxonomy html by individual custom field.
1219
-         *
1220
-         * @param string $html The html to filter.
1221
-         * @param array $cf The custom field array.
1222
-         * @since 1.6.6
1223
-         */
1224
-        $html = apply_filters("geodir_custom_field_input_taxonomy_{$html_var}",$html,$cf);
1225
-    }
1226
-
1227
-    // If no html then we run the standard output.
1228
-    if(empty($html)) {
1229
-
1230
-        ob_start(); // Start  buffering;
1231
-        $value = geodir_get_cf_value($cf);
1232
-
1233
-        $name = $cf['name'];
1234
-        $site_title = $cf['site_title'];
1235
-        $admin_desc = $cf['desc'];
1236
-        $is_required = $cf['is_required'];
1237
-        $is_admin = $cf['is_admin'];
1238
-        $required_msg = $cf['required_msg'];
1239
-
1240
-        if ($value == $cf['default']) {
1241
-            $value = '';
1242
-        } ?>
1213
+	$html_var = $cf['htmlvar_name'];
1214
+
1215
+	// Check if there is a custom field specific filter.
1216
+	if(has_filter("geodir_custom_field_input_taxonomy_{$html_var}")){
1217
+		/**
1218
+		 * Filter the taxonomy html by individual custom field.
1219
+		 *
1220
+		 * @param string $html The html to filter.
1221
+		 * @param array $cf The custom field array.
1222
+		 * @since 1.6.6
1223
+		 */
1224
+		$html = apply_filters("geodir_custom_field_input_taxonomy_{$html_var}",$html,$cf);
1225
+	}
1226
+
1227
+	// If no html then we run the standard output.
1228
+	if(empty($html)) {
1229
+
1230
+		ob_start(); // Start  buffering;
1231
+		$value = geodir_get_cf_value($cf);
1232
+
1233
+		$name = $cf['name'];
1234
+		$site_title = $cf['site_title'];
1235
+		$admin_desc = $cf['desc'];
1236
+		$is_required = $cf['is_required'];
1237
+		$is_admin = $cf['is_admin'];
1238
+		$required_msg = $cf['required_msg'];
1239
+
1240
+		if ($value == $cf['default']) {
1241
+			$value = '';
1242
+		} ?>
1243 1243
         <div id="<?php echo $name;?>_row"
1244 1244
              class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
1245 1245
             <label>
1246 1246
                 <?php $site_title = __($site_title, 'geodirectory');
1247
-                echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
1247
+				echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
1248 1248
                 <?php if ($is_required) echo '<span>*</span>';?>
1249 1249
             </label>
1250 1250
 
1251 1251
             <div id="<?php echo $name;?>" class="geodir_taxonomy_field" style="float:left; width:70%;">
1252 1252
                 <?php
1253
-                global $wpdb, $post, $cat_display, $post_cat, $package_id, $exclude_cats;
1253
+				global $wpdb, $post, $cat_display, $post_cat, $package_id, $exclude_cats;
1254 1254
 
1255
-                $exclude_cats = array();
1255
+				$exclude_cats = array();
1256 1256
 
1257
-                if ($is_admin == '1') {
1257
+				if ($is_admin == '1') {
1258 1258
 
1259
-                    $post_type = get_post_type();
1259
+					$post_type = get_post_type();
1260 1260
 
1261
-                    $package_info = array();
1261
+					$package_info = array();
1262 1262
 
1263
-                    $package_info = (array)geodir_post_package_info($package_info, $post, $post_type);
1263
+					$package_info = (array)geodir_post_package_info($package_info, $post, $post_type);
1264 1264
 
1265
-                    if (!empty($package_info)) {
1265
+					if (!empty($package_info)) {
1266 1266
 
1267
-                        if (isset($package_info['cat']) && $package_info['cat'] != '') {
1267
+						if (isset($package_info['cat']) && $package_info['cat'] != '') {
1268 1268
 
1269
-                            $exclude_cats = explode(',', $package_info['cat']);
1269
+							$exclude_cats = explode(',', $package_info['cat']);
1270 1270
 
1271
-                        }
1272
-                    }
1273
-                }
1271
+						}
1272
+					}
1273
+				}
1274 1274
 
1275
-                $cat_display = unserialize($cf['extra_fields']);
1275
+				$cat_display = unserialize($cf['extra_fields']);
1276 1276
 
1277
-                if (isset($_REQUEST['backandedit']) && (is_array($post_cat[$name]) && !empty($post_cat[$name]))) {
1277
+				if (isset($_REQUEST['backandedit']) && (is_array($post_cat[$name]) && !empty($post_cat[$name]))) {
1278 1278
 
1279
-                    $post_cat = implode(",", $post_cat[$name]);
1279
+					$post_cat = implode(",", $post_cat[$name]);
1280 1280
 
1281
-                } else {
1282
-                    if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '')
1283
-                        $post_cat = geodir_get_post_meta($_REQUEST['pid'], $name, true);
1284
-                }
1281
+				} else {
1282
+					if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '')
1283
+						$post_cat = geodir_get_post_meta($_REQUEST['pid'], $name, true);
1284
+				}
1285 1285
 
1286 1286
 
1287
-                global $geodir_addon_list;
1288
-                if (!empty($geodir_addon_list) && array_key_exists('geodir_payment_manager', $geodir_addon_list) && $geodir_addon_list['geodir_payment_manager'] == 'yes') {
1287
+				global $geodir_addon_list;
1288
+				if (!empty($geodir_addon_list) && array_key_exists('geodir_payment_manager', $geodir_addon_list) && $geodir_addon_list['geodir_payment_manager'] == 'yes') {
1289 1289
 
1290
-                    $catadd_limit = $wpdb->get_var(
1291
-                        $wpdb->prepare(
1292
-                            "SELECT cat_limit FROM " . GEODIR_PRICE_TABLE . " WHERE pid = %d",
1293
-                            array($package_id)
1294
-                        )
1295
-                    );
1290
+					$catadd_limit = $wpdb->get_var(
1291
+						$wpdb->prepare(
1292
+							"SELECT cat_limit FROM " . GEODIR_PRICE_TABLE . " WHERE pid = %d",
1293
+							array($package_id)
1294
+						)
1295
+					);
1296 1296
 
1297 1297
 
1298
-                } else {
1299
-                    $catadd_limit = 0;
1300
-                }
1298
+				} else {
1299
+					$catadd_limit = 0;
1300
+				}
1301 1301
 
1302 1302
 
1303
-                if ($cat_display != '' && $cat_display != 'ajax_chained') {
1303
+				if ($cat_display != '' && $cat_display != 'ajax_chained') {
1304 1304
 
1305
-                    $required_limit_msg = '';
1306
-                    if ($catadd_limit > 0 && $cat_display != 'select' && $cat_display != 'radio') {
1305
+					$required_limit_msg = '';
1306
+					if ($catadd_limit > 0 && $cat_display != 'select' && $cat_display != 'radio') {
1307 1307
 
1308
-                        $required_limit_msg = __('Only select', 'geodirectory') . ' ' . $catadd_limit . __(' categories for this package.', 'geodirectory');
1308
+						$required_limit_msg = __('Only select', 'geodirectory') . ' ' . $catadd_limit . __(' categories for this package.', 'geodirectory');
1309 1309
 
1310
-                    } else {
1311
-                        $required_limit_msg = $required_msg;
1312
-                    }
1310
+					} else {
1311
+						$required_limit_msg = $required_msg;
1312
+					}
1313 1313
 
1314
-                    echo '<input type="hidden" cat_limit="' . $catadd_limit . '" id="cat_limit" value="' . esc_attr($required_limit_msg) . '" name="cat_limit[' . $name . ']"  />';
1314
+					echo '<input type="hidden" cat_limit="' . $catadd_limit . '" id="cat_limit" value="' . esc_attr($required_limit_msg) . '" name="cat_limit[' . $name . ']"  />';
1315 1315
 
1316 1316
 
1317
-                    if ($cat_display == 'select' || $cat_display == 'multiselect') {
1317
+					if ($cat_display == 'select' || $cat_display == 'multiselect') {
1318 1318
 
1319
-                        $cat_display == '';
1320
-                        $multiple = '';
1321
-                        if ($cat_display == 'multiselect')
1322
-                            $multiple = 'multiple="multiple"';
1319
+						$cat_display == '';
1320
+						$multiple = '';
1321
+						if ($cat_display == 'multiselect')
1322
+							$multiple = 'multiple="multiple"';
1323 1323
 
1324
-                        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') . '">';
1324
+						echo '<select id="' . $name . '" ' . $multiple . ' type="' . $name . '" name="post_category[' . $name . '][]" alt="' . $name . '" field_type="' . $cat_display . '" class="geodir_textfield textfield_x chosen_select" data-placeholder="' . __('Select Category', 'geodirectory') . '">';
1325 1325
 
1326 1326
 
1327
-                        if ($cat_display == 'select')
1328
-                            echo '<option value="">' . __('Select Category', 'geodirectory') . '</option>';
1327
+						if ($cat_display == 'select')
1328
+							echo '<option value="">' . __('Select Category', 'geodirectory') . '</option>';
1329 1329
 
1330
-                    }
1330
+					}
1331 1331
 
1332
-                    echo geodir_custom_taxonomy_walker($name, $catadd_limit = 0);
1332
+					echo geodir_custom_taxonomy_walker($name, $catadd_limit = 0);
1333 1333
 
1334
-                    if ($cat_display == 'select' || $cat_display == 'multiselect')
1335
-                        echo '</select>';
1334
+					if ($cat_display == 'select' || $cat_display == 'multiselect')
1335
+						echo '</select>';
1336 1336
 
1337
-                } else {
1337
+				} else {
1338 1338
 
1339
-                    echo geodir_custom_taxonomy_walker2($name, $catadd_limit);
1339
+					echo geodir_custom_taxonomy_walker2($name, $catadd_limit);
1340 1340
 
1341
-                }
1341
+				}
1342 1342
 
1343
-                ?>
1343
+				?>
1344 1344
             </div>
1345 1345
 
1346 1346
             <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory');?></span>
@@ -1350,10 +1350,10 @@  discard block
 block discarded – undo
1350 1350
         </div>
1351 1351
 
1352 1352
         <?php
1353
-        $html = ob_get_clean();
1354
-    }
1353
+		$html = ob_get_clean();
1354
+	}
1355 1355
 
1356
-    return $html;
1356
+	return $html;
1357 1357
 }
1358 1358
 add_filter('geodir_custom_field_input_taxonomy','geodir_cfi_taxonomy',10,2);
1359 1359
 
@@ -1369,74 +1369,74 @@  discard block
 block discarded – undo
1369 1369
  */
1370 1370
 function geodir_cfi_file($html,$cf){
1371 1371
 
1372
-    $html_var = $cf['htmlvar_name'];
1372
+	$html_var = $cf['htmlvar_name'];
1373 1373
 
1374
-    // Check if there is a custom field specific filter.
1375
-    if(has_filter("geodir_custom_field_input_file_{$html_var}")){
1376
-        /**
1377
-         * Filter the file html by individual custom field.
1378
-         *
1379
-         * @param string $html The html to filter.
1380
-         * @param array $cf The custom field array.
1381
-         * @since 1.6.6
1382
-         */
1383
-        $html = apply_filters("geodir_custom_field_input_file_{$html_var}",$html,$cf);
1384
-    }
1374
+	// Check if there is a custom field specific filter.
1375
+	if(has_filter("geodir_custom_field_input_file_{$html_var}")){
1376
+		/**
1377
+		 * Filter the file html by individual custom field.
1378
+		 *
1379
+		 * @param string $html The html to filter.
1380
+		 * @param array $cf The custom field array.
1381
+		 * @since 1.6.6
1382
+		 */
1383
+		$html = apply_filters("geodir_custom_field_input_file_{$html_var}",$html,$cf);
1384
+	}
1385 1385
 
1386
-    // If no html then we run the standard output.
1387
-    if(empty($html)) {
1386
+	// If no html then we run the standard output.
1387
+	if(empty($html)) {
1388 1388
 
1389
-        ob_start(); // Start  buffering;
1390
-        $value = geodir_get_cf_value($cf);
1389
+		ob_start(); // Start  buffering;
1390
+		$value = geodir_get_cf_value($cf);
1391 1391
 
1392
-        $name = $cf['name'];
1393
-        $site_title = $cf['site_title'];
1394
-        $admin_desc = $cf['desc'];
1395
-        $is_required = $cf['is_required'];
1396
-        $required_msg = $cf['required_msg'];
1397
-        $extra_fields = unserialize($cf['extra_fields']);
1392
+		$name = $cf['name'];
1393
+		$site_title = $cf['site_title'];
1394
+		$admin_desc = $cf['desc'];
1395
+		$is_required = $cf['is_required'];
1396
+		$required_msg = $cf['required_msg'];
1397
+		$extra_fields = unserialize($cf['extra_fields']);
1398 1398
 
1399 1399
 
1400
-        // adjust values here
1401
-        $file_id = $name; // this will be the name of form field. Image url(s) will be submitted in $_POST using this key. So if $id == �img1� then $_POST[�img1�] will have all the image urls
1400
+		// adjust values here
1401
+		$file_id = $name; // this will be the name of form field. Image url(s) will be submitted in $_POST using this key. So if $id == �img1� then $_POST[�img1�] will have all the image urls
1402 1402
 
1403
-        if ($value != '') {
1403
+		if ($value != '') {
1404 1404
 
1405
-            $file_value = trim($value, ","); // this will be initial value of the above form field. Image urls.
1405
+			$file_value = trim($value, ","); // this will be initial value of the above form field. Image urls.
1406 1406
 
1407
-        } else
1408
-            $file_value = '';
1407
+		} else
1408
+			$file_value = '';
1409 1409
 
1410
-        if (isset($extra_fields['file_multiple']) && $extra_fields['file_multiple'])
1411
-            $file_multiple = true; // allow multiple files upload
1412
-        else
1413
-            $file_multiple = false;
1410
+		if (isset($extra_fields['file_multiple']) && $extra_fields['file_multiple'])
1411
+			$file_multiple = true; // allow multiple files upload
1412
+		else
1413
+			$file_multiple = false;
1414 1414
 
1415
-        if (isset($extra_fields['image_limit']) && $extra_fields['image_limit'])
1416
-            $file_image_limit = $extra_fields['image_limit'];
1417
-        else
1418
-            $file_image_limit = 1;
1415
+		if (isset($extra_fields['image_limit']) && $extra_fields['image_limit'])
1416
+			$file_image_limit = $extra_fields['image_limit'];
1417
+		else
1418
+			$file_image_limit = 1;
1419 1419
 
1420
-        $file_width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels)
1420
+		$file_width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels)
1421 1421
 
1422
-        $file_height = geodir_media_image_large_height(); // If you want to automatically resize all uploaded images then provide height here (in pixels)
1422
+		$file_height = geodir_media_image_large_height(); // If you want to automatically resize all uploaded images then provide height here (in pixels)
1423 1423
 
1424
-        if (!empty($file_value)) {
1425
-            $curImages = explode(',', $file_value);
1426
-            if (!empty($curImages))
1427
-                $file_totImg = count($curImages);
1428
-        }
1424
+		if (!empty($file_value)) {
1425
+			$curImages = explode(',', $file_value);
1426
+			if (!empty($curImages))
1427
+				$file_totImg = count($curImages);
1428
+		}
1429 1429
 
1430
-        $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']) : '';
1431
-        $display_file_types = $allowed_file_types != '' ? '.' . implode(", .", $extra_fields['gd_file_types']) : '';
1430
+		$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']) : '';
1431
+		$display_file_types = $allowed_file_types != '' ? '.' . implode(", .", $extra_fields['gd_file_types']) : '';
1432 1432
 
1433
-        ?>
1433
+		?>
1434 1434
         <?php /*?> <h5 class="geodir-form_title"> <?php echo $site_title; ?>
1435 1435
 				 <?php if($file_image_limit!=0 && $file_image_limit==1 ){echo '<br /><small>('.__('You can upload').' '.$file_image_limit.' '.__('image with this package').')</small>';} ?>
1436 1436
 				 <?php if($file_image_limit!=0 && $file_image_limit>1 ){echo '<br /><small>('.__('You can upload').' '.$file_image_limit.' '.__('images with this package').')</small>';} ?>
1437 1437
 				 <?php if($file_image_limit==0){echo '<br /><small>('.__('You can upload unlimited images with this package').')</small>';} ?>
1438 1438
 			</h5>   <?php */
1439
-        ?>
1439
+		?>
1440 1440
 
1441 1441
         <div id="<?php echo $name;?>_row"
1442 1442
              class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
@@ -1444,7 +1444,7 @@  discard block
 block discarded – undo
1444 1444
             <div id="<?php echo $file_id; ?>dropbox" style="text-align:center;">
1445 1445
                 <label
1446 1446
                     style="text-align:left; padding-top:10px;"><?php $site_title = __($site_title, 'geodirectory');
1447
-                    echo $site_title; ?><?php if ($is_required) echo '<span>*</span>';?></label>
1447
+					echo $site_title; ?><?php if ($is_required) echo '<span>*</span>';?></label>
1448 1448
                 <input class="geodir-custom-file-upload" field_type="file" type="hidden"
1449 1449
                        name="<?php echo $file_id; ?>" id="<?php echo $file_id; ?>"
1450 1450
                        value="<?php echo esc_attr($file_value); ?>"/>
@@ -1456,17 +1456,17 @@  discard block
 block discarded – undo
1456 1456
                 <?php } ?>
1457 1457
                 <input type="hidden" name="<?php echo $file_id; ?>totImg" id="<?php echo $file_id; ?>totImg"
1458 1458
                        value="<?php if (isset($file_totImg)) {
1459
-                           echo esc_attr($file_totImg);
1460
-                       } else {
1461
-                           echo '0';
1462
-                       } ?>"/>
1459
+						   echo esc_attr($file_totImg);
1460
+					   } else {
1461
+						   echo '0';
1462
+					   } ?>"/>
1463 1463
 
1464 1464
                 <div style="float:left; width:55%;">
1465 1465
                     <div
1466 1466
                         class="plupload-upload-uic hide-if-no-js <?php if ($file_multiple): ?>plupload-upload-uic-multiple<?php endif; ?>"
1467 1467
                         id="<?php echo $file_id; ?>plupload-upload-ui" style="float:left; width:30%;">
1468 1468
                         <?php /*?><h4><?php _e('Drop files to upload');?></h4><br/><?php */
1469
-                        ?>
1469
+						?>
1470 1470
                         <input id="<?php echo $file_id; ?>plupload-browse-button" type="button"
1471 1471
                                value="<?php ($file_image_limit > 1 ? esc_attr_e('Select Files', 'geodirectory') : esc_attr_e('Select File', 'geodirectory') ); ?>"
1472 1472
                                class="geodir_button" style="margin-top:10px;"/>
@@ -1485,7 +1485,7 @@  discard block
 block discarded – undo
1485 1485
                         style=" clear:inherit; margin-top:0; margin-left:15px; padding-top:10px; float:left; width:50%;">
1486 1486
                     </div>
1487 1487
                     <?php /*?><span id="upload-msg" ><?php _e('Please drag &amp; drop the images to rearrange the order');?></span><?php */
1488
-                    ?>
1488
+					?>
1489 1489
 
1490 1490
                     <span id="<?php echo $file_id; ?>upload-error" style="display:none"></span>
1491 1491
 
@@ -1499,9 +1499,9 @@  discard block
 block discarded – undo
1499 1499
 
1500 1500
 
1501 1501
         <?php
1502
-        $html = ob_get_clean();
1503
-    }
1502
+		$html = ob_get_clean();
1503
+	}
1504 1504
 
1505
-    return $html;
1505
+	return $html;
1506 1506
 }
1507 1507
 add_filter('geodir_custom_field_input_file','geodir_cfi_file',10,2);
1508 1508
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +191 added lines, -68 removed lines patch added patch discarded remove patch
@@ -86,26 +86,31 @@  discard block
 block discarded – undo
86 86
         $value = geodir_get_cf_value($cf);
87 87
         $type = $cf['type'];
88 88
         //number and float validation $validation_pattern
89
-        if(isset($cf['data_type']) && $cf['data_type']=='INT'){$type = 'number';}
90
-        elseif(isset($cf['data_type']) && $cf['data_type']=='FLOAT'){$type = 'float';}
89
+        if(isset($cf['data_type']) && $cf['data_type']=='INT'){$type = 'number';} elseif(isset($cf['data_type']) && $cf['data_type']=='FLOAT'){$type = 'float';}
91 90
 
92 91
         //validation
93 92
         if(isset($cf['validation_pattern']) && $cf['validation_pattern']){
94 93
             $validation = 'pattern="'.$cf['validation_pattern'].'"';
95
-        }else{$validation='';}
94
+        } else{$validation='';}
96 95
 
97 96
         // validation message
98 97
         if(isset($cf['validation_msg']) && $cf['validation_msg']){
99 98
             $validation_msg = 'title="'.$cf['validation_msg'].'"';
100
-        }else{$validation_msg='';}
99
+        } else{$validation_msg='';}
101 100
         ?>
102 101
 
103 102
         <div id="<?php echo $cf['name'];?>_row"
104
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
103
+             class="<?php if ($cf['is_required']) {
104
+	echo 'required_field';
105
+}
106
+?> geodir_form_row clearfix gd-fieldset-details">
105 107
             <label>
106 108
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
107 109
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
108
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
110
+                <?php if ($cf['is_required']) {
111
+	echo '<span>*</span>';
112
+}
113
+?>
109 114
             </label>
110 115
             <input field_type="<?php echo $type;?>" name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>"
111 116
                    value="<?php echo esc_attr(stripslashes($value));?>" type="<?php echo $type;?>" class="geodir_textfield" <?php echo $validation;echo $validation_msg;?> />
@@ -160,11 +165,17 @@  discard block
 block discarded – undo
160 165
         }?>
161 166
 
162 167
         <div id="<?php echo $cf['name'];?>_row"
163
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
168
+             class="<?php if ($cf['is_required']) {
169
+	echo 'required_field';
170
+}
171
+?> geodir_form_row clearfix gd-fieldset-details">
164 172
             <label>
165 173
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
166 174
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
167
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
175
+                <?php if ($cf['is_required']) {
176
+	echo '<span>*</span>';
177
+}
178
+?>
168 179
             </label>
169 180
             <input field_type="<?php echo $cf['type'];?>" name="<?php  $cf['name'];?>" id="<?php echo $cf['name'];?>"
170 181
                    value="<?php echo esc_attr(stripslashes($value));?>" type="email" class="geodir_textfield"/>
@@ -220,11 +231,17 @@  discard block
 block discarded – undo
220 231
         }?>
221 232
 
222 233
         <div id="<?php echo $cf['name'];?>_row"
223
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
234
+             class="<?php if ($cf['is_required']) {
235
+	echo 'required_field';
236
+}
237
+?> geodir_form_row clearfix gd-fieldset-details">
224 238
             <label>
225 239
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
226 240
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
227
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
241
+                <?php if ($cf['is_required']) {
242
+	echo '<span>*</span>';
243
+}
244
+?>
228 245
             </label>
229 246
             <input field_type="<?php echo $cf['type'];?>" name="<?php  $cf['name'];?>" id="<?php echo $cf['name'];?>"
230 247
                    value="<?php echo esc_attr(stripslashes($value));?>" type="tel" class="geodir_textfield"/>
@@ -280,11 +297,17 @@  discard block
 block discarded – undo
280 297
         }?>
281 298
 
282 299
         <div id="<?php echo $cf['name'];?>_row"
283
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
300
+             class="<?php if ($cf['is_required']) {
301
+	echo 'required_field';
302
+}
303
+?> geodir_form_row clearfix gd-fieldset-details">
284 304
             <label>
285 305
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
286 306
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
287
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
307
+                <?php if ($cf['is_required']) {
308
+	echo '<span>*</span>';
309
+}
310
+?>
288 311
             </label>
289 312
             <input field_type="<?php echo $cf['type'];?>" name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>"
290 313
                    value="<?php echo esc_attr(stripslashes($value));?>" type="url" class="geodir_textfield"
@@ -339,11 +362,17 @@  discard block
 block discarded – undo
339 362
 
340 363
         ?>
341 364
         <div id="<?php echo $cf['name'];?>_row"
342
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
365
+             class="<?php if ($cf['is_required']) {
366
+	echo 'required_field';
367
+}
368
+?> geodir_form_row clearfix gd-fieldset-details">
343 369
             <label>
344 370
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
345 371
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
346
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
372
+                <?php if ($cf['is_required']) {
373
+	echo '<span>*</span>';
374
+}
375
+?>
347 376
             </label>
348 377
             <?php if ($cf['option_values']) {
349 378
                 $option_values = geodir_string_values_to_options($cf['option_values'], true);
@@ -410,11 +439,17 @@  discard block
 block discarded – undo
410 439
         }?>
411 440
 
412 441
         <div id="<?php echo $cf['name'];?>_row"
413
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
442
+             class="<?php if ($cf['is_required']) {
443
+	echo 'required_field';
444
+}
445
+?> geodir_form_row clearfix gd-fieldset-details">
414 446
             <label>
415 447
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
416 448
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
417
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
449
+                <?php if ($cf['is_required']) {
450
+	echo '<span>*</span>';
451
+}
452
+?>
418 453
             </label>
419 454
             <?php if ($value != '1') {
420 455
                 $value = '0';
@@ -474,11 +509,17 @@  discard block
 block discarded – undo
474 509
         ?>
475 510
 
476 511
         <div id="<?php echo $cf['name'];?>_row"
477
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
512
+             class="<?php if ($cf['is_required']) {
513
+	echo 'required_field';
514
+}
515
+?> geodir_form_row clearfix gd-fieldset-details">
478 516
             <label>
479 517
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
480 518
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
481
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
519
+                <?php if ($cf['is_required']) {
520
+	echo '<span>*</span>';
521
+}
522
+?>
482 523
             </label><?php
483 524
 
484 525
 
@@ -546,11 +587,17 @@  discard block
 block discarded – undo
546 587
 
547 588
         ?>
548 589
         <div id="<?php echo $cf['name'];?>_row"
549
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row geodir_custom_fields clearfix gd-fieldset-details">
590
+             class="<?php if ($cf['is_required']) {
591
+	echo 'required_field';
592
+}
593
+?> geodir_form_row geodir_custom_fields clearfix gd-fieldset-details">
550 594
             <label>
551 595
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
552 596
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
553
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
597
+                <?php if ($cf['is_required']) {
598
+	echo '<span>*</span>';
599
+}
600
+?>
554 601
             </label>
555 602
             <?php
556 603
             $option_values_arr = geodir_string_values_to_options($cf['option_values'], true);
@@ -627,11 +674,17 @@  discard block
 block discarded – undo
627 674
         }
628 675
         ?>
629 676
         <div id="<?php echo $cf['name']; ?>_row"
630
-             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
677
+             class="<?php if ($cf['is_required']) {
678
+	echo 'required_field';
679
+}
680
+?> geodir_form_row clearfix gd-fieldset-details">
631 681
             <label>
632 682
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
633 683
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
634
-                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
684
+                <?php if ($cf['is_required']) {
685
+	echo '<span>*</span>';
686
+}
687
+?>
635 688
             </label>
636 689
             <input type="hidden" name="gd_field_<?php echo $cf['name']; ?>" value="1"/>
637 690
             <?php if ($multi_display == 'select') { ?>
@@ -738,11 +791,17 @@  discard block
 block discarded – undo
738 791
         ?>
739 792
 
740 793
         <div id="<?php echo $cf['name']; ?>_row"
741
-             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
794
+             class="<?php if ($cf['is_required']) {
795
+	echo 'required_field';
796
+}
797
+?> geodir_form_row clearfix gd-fieldset-details">
742 798
             <label>
743 799
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
744 800
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
745
-                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
801
+                <?php if ($cf['is_required']) {
802
+	echo '<span>*</span>';
803
+}
804
+?>
746 805
             </label>
747 806
 
748 807
             <?php $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10); ?>
@@ -802,8 +861,9 @@  discard block
 block discarded – undo
802 861
         $extra_fields = unserialize($cf['extra_fields']);
803 862
         $name = $cf['name'];
804 863
 
805
-        if ($extra_fields['date_format'] == '')
806
-            $extra_fields['date_format'] = 'yy-mm-dd';
864
+        if ($extra_fields['date_format'] == '') {
865
+                    $extra_fields['date_format'] = 'yy-mm-dd';
866
+        }
807 867
 
808 868
         $date_format = $extra_fields['date_format'];
809 869
         $jquery_date_format  = $date_format;
@@ -817,7 +877,7 @@  discard block
 block discarded – undo
817 877
             $replace = array('d','j','l','m','n','F','Y');//PHP date format
818 878
 
819 879
             $date_format = str_replace($search, $replace, $date_format);
820
-        }else{
880
+        } else{
821 881
             $jquery_date_format = geodir_date_format_php_to_jqueryui( $jquery_date_format );
822 882
         }
823 883
 
@@ -851,12 +911,18 @@  discard block
 block discarded – undo
851 911
 
852 912
         </script>
853 913
         <div id="<?php echo $name;?>_row"
854
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
914
+             class="<?php if ($cf['is_required']) {
915
+	echo 'required_field';
916
+}
917
+?> geodir_form_row clearfix gd-fieldset-details">
855 918
             <label>
856 919
 
857 920
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
858 921
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
859
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
922
+                <?php if ($cf['is_required']) {
923
+	echo '<span>*</span>';
924
+}
925
+?>
860 926
             </label>
861 927
 
862 928
             <input field_type="<?php echo $cf['type'];?>" name="<?php echo $name;?>" id="<?php echo $name;?>"
@@ -910,8 +976,9 @@  discard block
 block discarded – undo
910 976
 
911 977
         $name = $cf['name'];
912 978
 
913
-        if ($value != '')
914
-            $value = date('H:i', strtotime($value));
979
+        if ($value != '') {
980
+                    $value = date('H:i', strtotime($value));
981
+        }
915 982
         ?>
916 983
         <script type="text/javascript">
917 984
             jQuery(document).ready(function () {
@@ -924,12 +991,18 @@  discard block
 block discarded – undo
924 991
             });
925 992
         </script>
926 993
         <div id="<?php echo $name;?>_row"
927
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
994
+             class="<?php if ($cf['is_required']) {
995
+	echo 'required_field';
996
+}
997
+?> geodir_form_row clearfix gd-fieldset-details">
928 998
             <label>
929 999
 
930 1000
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
931 1001
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
932
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
1002
+                <?php if ($cf['is_required']) {
1003
+	echo '<span>*</span>';
1004
+}
1005
+?>
933 1006
             </label>
934 1007
             <input readonly="readonly" field_type="<?php echo $cf['type'];?>" name="<?php echo $name;?>"
935 1008
                    id="<?php echo $name;?>" value="<?php echo esc_attr($value);?>" type="text" class="geodir_textfield"/>
@@ -1021,17 +1094,27 @@  discard block
 block discarded – undo
1021 1094
         }
1022 1095
 
1023 1096
         $location = geodir_get_default_location();
1024
-        if (empty($city)) $city = isset($location->city) ? $location->city : '';
1025
-        if (empty($region)) $region = isset($location->region) ? $location->region : '';
1026
-        if (empty($country)) $country = isset($location->country) ? $location->country : '';
1097
+        if (empty($city)) {
1098
+        	$city = isset($location->city) ? $location->city : '';
1099
+        }
1100
+        if (empty($region)) {
1101
+        	$region = isset($location->region) ? $location->region : '';
1102
+        }
1103
+        if (empty($country)) {
1104
+        	$country = isset($location->country) ? $location->country : '';
1105
+        }
1027 1106
 
1028 1107
         $lat_lng_blank = false;
1029 1108
         if (empty($lat) && empty($lng)) {
1030 1109
             $lat_lng_blank = true;
1031 1110
         }
1032 1111
 
1033
-        if (empty($lat)) $lat = isset($location->city_latitude) ? $location->city_latitude : '';
1034
-        if (empty($lng)) $lng = isset($location->city_longitude) ? $location->city_longitude : '';
1112
+        if (empty($lat)) {
1113
+        	$lat = isset($location->city_latitude) ? $location->city_latitude : '';
1114
+        }
1115
+        if (empty($lng)) {
1116
+        	$lng = isset($location->city_longitude) ? $location->city_longitude : '';
1117
+        }
1035 1118
 
1036 1119
         /**
1037 1120
          * Filter the default latitude.
@@ -1055,10 +1138,16 @@  discard block
 block discarded – undo
1055 1138
         ?>
1056 1139
 
1057 1140
         <div id="geodir_<?php echo $prefix . 'address';?>_row"
1058
-             class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
1141
+             class="<?php if ($is_required) {
1142
+	echo 'required_field';
1143
+}
1144
+?> geodir_form_row clearfix gd-fieldset-details">
1059 1145
             <label>
1060 1146
                 <?php _e($address_title, 'geodirectory'); ?>
1061
-                <?php if ($is_required) echo '<span>*</span>';?>
1147
+                <?php if ($is_required) {
1148
+	echo '<span>*</span>';
1149
+}
1150
+?>
1062 1151
             </label>
1063 1152
             <input type="text" field_type="<?php echo $type;?>" name="<?php echo $prefix . 'address';?>"
1064 1153
                    id="<?php echo $prefix . 'address';?>" class="geodir_textfield"
@@ -1119,10 +1208,16 @@  discard block
 block discarded – undo
1119 1208
             /* show lat lng */
1120 1209
             $style_latlng = ((isset($extra_fields['show_latlng']) && $extra_fields['show_latlng']) || is_admin()) ? '' : 'style="display:none"'; ?>
1121 1210
             <div id="geodir_<?php echo $prefix . 'latitude'; ?>_row"
1122
-                 class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details" <?php echo $style_latlng; ?>>
1211
+                 class="<?php if ($is_required) {
1212
+	echo 'required_field';
1213
+}
1214
+?> geodir_form_row clearfix gd-fieldset-details" <?php echo $style_latlng; ?>>
1123 1215
                 <label>
1124 1216
                     <?php echo PLACE_ADDRESS_LAT; ?>
1125
-                    <?php if ($is_required) echo '<span>*</span>'; ?>
1217
+                    <?php if ($is_required) {
1218
+	echo '<span>*</span>';
1219
+}
1220
+?>
1126 1221
                 </label>
1127 1222
                 <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix . 'latitude'; ?>"
1128 1223
                        id="<?php echo $prefix . 'latitude'; ?>" class="geodir_textfield"
@@ -1134,10 +1229,16 @@  discard block
 block discarded – undo
1134 1229
             </div>
1135 1230
 
1136 1231
             <div id="geodir_<?php echo $prefix . 'longitude'; ?>_row"
1137
-                 class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details" <?php echo $style_latlng; ?>>
1232
+                 class="<?php if ($is_required) {
1233
+	echo 'required_field';
1234
+}
1235
+?> geodir_form_row clearfix gd-fieldset-details" <?php echo $style_latlng; ?>>
1138 1236
                 <label>
1139 1237
                     <?php echo PLACE_ADDRESS_LNG; ?>
1140
-                    <?php if ($is_required) echo '<span>*</span>'; ?>
1238
+                    <?php if ($is_required) {
1239
+	echo '<span>*</span>';
1240
+}
1241
+?>
1141 1242
                 </label>
1142 1243
                 <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix . 'longitude'; ?>"
1143 1244
                        id="<?php echo $prefix . 'longitude'; ?>" class="geodir_textfield"
@@ -1241,11 +1342,17 @@  discard block
 block discarded – undo
1241 1342
             $value = '';
1242 1343
         } ?>
1243 1344
         <div id="<?php echo $name;?>_row"
1244
-             class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
1345
+             class="<?php if ($is_required) {
1346
+	echo 'required_field';
1347
+}
1348
+?> geodir_form_row clearfix gd-fieldset-details">
1245 1349
             <label>
1246 1350
                 <?php $site_title = __($site_title, 'geodirectory');
1247 1351
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
1248
-                <?php if ($is_required) echo '<span>*</span>';?>
1352
+                <?php if ($is_required) {
1353
+	echo '<span>*</span>';
1354
+}
1355
+?>
1249 1356
             </label>
1250 1357
 
1251 1358
             <div id="<?php echo $name;?>" class="geodir_taxonomy_field" style="float:left; width:70%;">
@@ -1279,8 +1386,9 @@  discard block
 block discarded – undo
1279 1386
                     $post_cat = implode(",", $post_cat[$name]);
1280 1387
 
1281 1388
                 } else {
1282
-                    if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '')
1283
-                        $post_cat = geodir_get_post_meta($_REQUEST['pid'], $name, true);
1389
+                    if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
1390
+                                            $post_cat = geodir_get_post_meta($_REQUEST['pid'], $name, true);
1391
+                    }
1284 1392
                 }
1285 1393
 
1286 1394
 
@@ -1318,21 +1426,24 @@  discard block
 block discarded – undo
1318 1426
 
1319 1427
                         $cat_display == '';
1320 1428
                         $multiple = '';
1321
-                        if ($cat_display == 'multiselect')
1322
-                            $multiple = 'multiple="multiple"';
1429
+                        if ($cat_display == 'multiselect') {
1430
+                                                    $multiple = 'multiple="multiple"';
1431
+                        }
1323 1432
 
1324 1433
                         echo '<select id="' . $name . '" ' . $multiple . ' type="' . $name . '" name="post_category[' . $name . '][]" alt="' . $name . '" field_type="' . $cat_display . '" class="geodir_textfield textfield_x chosen_select" data-placeholder="' . __('Select Category', 'geodirectory') . '">';
1325 1434
 
1326 1435
 
1327
-                        if ($cat_display == 'select')
1328
-                            echo '<option value="">' . __('Select Category', 'geodirectory') . '</option>';
1436
+                        if ($cat_display == 'select') {
1437
+                                                    echo '<option value="">' . __('Select Category', 'geodirectory') . '</option>';
1438
+                        }
1329 1439
 
1330 1440
                     }
1331 1441
 
1332 1442
                     echo geodir_custom_taxonomy_walker($name, $catadd_limit = 0);
1333 1443
 
1334
-                    if ($cat_display == 'select' || $cat_display == 'multiselect')
1335
-                        echo '</select>';
1444
+                    if ($cat_display == 'select' || $cat_display == 'multiselect') {
1445
+                                            echo '</select>';
1446
+                    }
1336 1447
 
1337 1448
                 } else {
1338 1449
 
@@ -1404,18 +1515,23 @@  discard block
 block discarded – undo
1404 1515
 
1405 1516
             $file_value = trim($value, ","); // this will be initial value of the above form field. Image urls.
1406 1517
 
1407
-        } else
1408
-            $file_value = '';
1518
+        } else {
1519
+                    $file_value = '';
1520
+        }
1409 1521
 
1410
-        if (isset($extra_fields['file_multiple']) && $extra_fields['file_multiple'])
1411
-            $file_multiple = true; // allow multiple files upload
1412
-        else
1413
-            $file_multiple = false;
1522
+        if (isset($extra_fields['file_multiple']) && $extra_fields['file_multiple']) {
1523
+                    $file_multiple = true;
1524
+        }
1525
+        // allow multiple files upload
1526
+        else {
1527
+                    $file_multiple = false;
1528
+        }
1414 1529
 
1415
-        if (isset($extra_fields['image_limit']) && $extra_fields['image_limit'])
1416
-            $file_image_limit = $extra_fields['image_limit'];
1417
-        else
1418
-            $file_image_limit = 1;
1530
+        if (isset($extra_fields['image_limit']) && $extra_fields['image_limit']) {
1531
+                    $file_image_limit = $extra_fields['image_limit'];
1532
+        } else {
1533
+                    $file_image_limit = 1;
1534
+        }
1419 1535
 
1420 1536
         $file_width = geodir_media_image_large_width(); // If you want to automatically resize all uploaded images then provide width here (in pixels)
1421 1537
 
@@ -1423,8 +1539,9 @@  discard block
 block discarded – undo
1423 1539
 
1424 1540
         if (!empty($file_value)) {
1425 1541
             $curImages = explode(',', $file_value);
1426
-            if (!empty($curImages))
1427
-                $file_totImg = count($curImages);
1542
+            if (!empty($curImages)) {
1543
+                            $file_totImg = count($curImages);
1544
+            }
1428 1545
         }
1429 1546
 
1430 1547
         $allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types'] ) ? implode(",", $extra_fields['gd_file_types']) : '';
@@ -1439,12 +1556,18 @@  discard block
 block discarded – undo
1439 1556
         ?>
1440 1557
 
1441 1558
         <div id="<?php echo $name;?>_row"
1442
-             class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
1559
+             class="<?php if ($is_required) {
1560
+	echo 'required_field';
1561
+}
1562
+?> geodir_form_row clearfix gd-fieldset-details">
1443 1563
 
1444 1564
             <div id="<?php echo $file_id; ?>dropbox" style="text-align:center;">
1445 1565
                 <label
1446 1566
                     style="text-align:left; padding-top:10px;"><?php $site_title = __($site_title, 'geodirectory');
1447
-                    echo $site_title; ?><?php if ($is_required) echo '<span>*</span>';?></label>
1567
+                    echo $site_title; ?><?php if ($is_required) {
1568
+                    	echo '<span>*</span>';
1569
+                    }
1570
+                    ?></label>
1448 1571
                 <input class="geodir-custom-file-upload" field_type="file" type="hidden"
1449 1572
                        name="<?php echo $file_id; ?>" id="<?php echo $file_id; ?>"
1450 1573
                        value="<?php echo esc_attr($file_value); ?>"/>
Please login to merge, or discard this patch.
Spacing   +233 added lines, -233 removed lines patch added patch discarded remove patch
@@ -17,12 +17,12 @@  discard block
 block discarded – undo
17 17
  *
18 18
  * @return string The html to output for the custom field.
19 19
  */
20
-function geodir_cfi_fieldset($html,$cf){
20
+function geodir_cfi_fieldset($html, $cf) {
21 21
 
22 22
     $html_var = $cf['htmlvar_name'];
23 23
 
24 24
     // Check if there is a custom field specific filter.
25
-    if(has_filter("geodir_custom_field_input_fieldset_{$html_var}")){
25
+    if (has_filter("geodir_custom_field_input_fieldset_{$html_var}")) {
26 26
         /**
27 27
          * Filter the fieldset html by individual custom field.
28 28
          *
@@ -30,18 +30,18 @@  discard block
 block discarded – undo
30 30
          * @param array $cf The custom field array.
31 31
          * @since 1.6.6
32 32
          */
33
-        $html = apply_filters("geodir_custom_field_input_fieldset_{$html_var}",$html,$cf);
33
+        $html = apply_filters("geodir_custom_field_input_fieldset_{$html_var}", $html, $cf);
34 34
     }
35 35
 
36 36
     // If no html then we run the standard output.
37
-    if(empty($html)) {
37
+    if (empty($html)) {
38 38
 
39 39
         ob_start(); // Start  buffering;
40 40
         ?>
41 41
         <h5 id="geodir_fieldset_<?php echo (int) $cf['id']; ?>" class="geodir-fieldset-row"
42 42
             gd-fieldset="<?php echo (int) $cf['id']; ?>"><?php echo $cf['site_title']; ?>
43
-            <?php if ( $cf['desc'] != '' ) {
44
-                echo '<small>( ' . $cf['desc'] . ' )</small>';
43
+            <?php if ($cf['desc'] != '') {
44
+                echo '<small>( '.$cf['desc'].' )</small>';
45 45
             } ?></h5>
46 46
         <?php
47 47
         $html = ob_get_clean();
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 
50 50
     return $html;
51 51
 }
52
-add_filter('geodir_custom_field_input_fieldset','geodir_cfi_fieldset',10,2);
52
+add_filter('geodir_custom_field_input_fieldset', 'geodir_cfi_fieldset', 10, 2);
53 53
 
54 54
 
55 55
 
@@ -62,12 +62,12 @@  discard block
 block discarded – undo
62 62
  *
63 63
  * @return string The html to output for the custom field.
64 64
  */
65
-function geodir_cfi_text($html,$cf){
65
+function geodir_cfi_text($html, $cf) {
66 66
 
67 67
     $html_var = $cf['htmlvar_name'];
68 68
 
69 69
     // Check if there is a custom field specific filter.
70
-    if(has_filter("geodir_custom_field_input_text_{$html_var}")){
70
+    if (has_filter("geodir_custom_field_input_text_{$html_var}")) {
71 71
         /**
72 72
          * Filter the text html by individual custom field.
73 73
          *
@@ -75,41 +75,41 @@  discard block
 block discarded – undo
75 75
          * @param array $cf The custom field array.
76 76
          * @since 1.6.6
77 77
          */
78
-        $html = apply_filters("geodir_custom_field_input_text_{$html_var}",$html,$cf);
78
+        $html = apply_filters("geodir_custom_field_input_text_{$html_var}", $html, $cf);
79 79
     }
80 80
 
81 81
     // If no html then we run the standard output.
82
-    if(empty($html)) {
82
+    if (empty($html)) {
83 83
 
84 84
         ob_start(); // Start  buffering;
85 85
 
86 86
         $value = geodir_get_cf_value($cf);
87 87
         $type = $cf['type'];
88 88
         //number and float validation $validation_pattern
89
-        if(isset($cf['data_type']) && $cf['data_type']=='INT'){$type = 'number';}
90
-        elseif(isset($cf['data_type']) && $cf['data_type']=='FLOAT'){$type = 'float';}
89
+        if (isset($cf['data_type']) && $cf['data_type'] == 'INT') {$type = 'number'; }
90
+        elseif (isset($cf['data_type']) && $cf['data_type'] == 'FLOAT') {$type = 'float'; }
91 91
 
92 92
         //validation
93
-        if(isset($cf['validation_pattern']) && $cf['validation_pattern']){
93
+        if (isset($cf['validation_pattern']) && $cf['validation_pattern']) {
94 94
             $validation = 'pattern="'.$cf['validation_pattern'].'"';
95
-        }else{$validation='';}
95
+        } else {$validation = ''; }
96 96
 
97 97
         // validation message
98
-        if(isset($cf['validation_msg']) && $cf['validation_msg']){
98
+        if (isset($cf['validation_msg']) && $cf['validation_msg']) {
99 99
             $validation_msg = 'title="'.$cf['validation_msg'].'"';
100
-        }else{$validation_msg='';}
100
+        } else {$validation_msg = ''; }
101 101
         ?>
102 102
 
103
-        <div id="<?php echo $cf['name'];?>_row"
104
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
103
+        <div id="<?php echo $cf['name']; ?>_row"
104
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
105 105
             <label>
106 106
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
107 107
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
108
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
108
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
109 109
             </label>
110
-            <input field_type="<?php echo $type;?>" name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>"
111
-                   value="<?php echo esc_attr(stripslashes($value));?>" type="<?php echo $type;?>" class="geodir_textfield" <?php echo $validation;echo $validation_msg;?> />
112
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
110
+            <input field_type="<?php echo $type; ?>" name="<?php echo $cf['name']; ?>" id="<?php echo $cf['name']; ?>"
111
+                   value="<?php echo esc_attr(stripslashes($value)); ?>" type="<?php echo $type; ?>" class="geodir_textfield" <?php echo $validation; echo $validation_msg; ?> />
112
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
113 113
             <?php if ($cf['is_required']) { ?>
114 114
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
115 115
             <?php } ?>
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 
122 122
     return $html;
123 123
 }
124
-add_filter('geodir_custom_field_input_text','geodir_cfi_text',10,2);
124
+add_filter('geodir_custom_field_input_text', 'geodir_cfi_text', 10, 2);
125 125
 
126 126
 
127 127
 /**
@@ -133,12 +133,12 @@  discard block
 block discarded – undo
133 133
  *
134 134
  * @return string The html to output for the custom field.
135 135
  */
136
-function geodir_cfi_email($html,$cf){
136
+function geodir_cfi_email($html, $cf) {
137 137
 
138 138
     $html_var = $cf['htmlvar_name'];
139 139
 
140 140
     // Check if there is a custom field specific filter.
141
-    if(has_filter("geodir_custom_field_input_email_{$html_var}")){
141
+    if (has_filter("geodir_custom_field_input_email_{$html_var}")) {
142 142
         /**
143 143
          * Filter the email html by individual custom field.
144 144
          *
@@ -146,11 +146,11 @@  discard block
 block discarded – undo
146 146
          * @param array $cf The custom field array.
147 147
          * @since 1.6.6
148 148
          */
149
-        $html = apply_filters("geodir_custom_field_input_email_{$html_var}",$html,$cf);
149
+        $html = apply_filters("geodir_custom_field_input_email_{$html_var}", $html, $cf);
150 150
     }
151 151
 
152 152
     // If no html then we run the standard output.
153
-    if(empty($html)) {
153
+    if (empty($html)) {
154 154
 
155 155
         ob_start(); // Start  buffering;
156 156
         $value = geodir_get_cf_value($cf);
@@ -159,16 +159,16 @@  discard block
 block discarded – undo
159 159
             $value = '';
160 160
         }?>
161 161
 
162
-        <div id="<?php echo $cf['name'];?>_row"
163
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
162
+        <div id="<?php echo $cf['name']; ?>_row"
163
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
164 164
             <label>
165 165
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
166 166
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
167
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
167
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
168 168
             </label>
169
-            <input field_type="<?php echo $cf['type'];?>" name="<?php  echo $cf['name'];?>" id="<?php echo $cf['name'];?>"
170
-                   value="<?php echo esc_attr(stripslashes($value));?>" type="email" class="geodir_textfield"/>
171
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
169
+            <input field_type="<?php echo $cf['type']; ?>" name="<?php  echo $cf['name']; ?>" id="<?php echo $cf['name']; ?>"
170
+                   value="<?php echo esc_attr(stripslashes($value)); ?>" type="email" class="geodir_textfield"/>
171
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
172 172
             <?php if ($cf['is_required']) { ?>
173 173
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
174 174
             <?php } ?>
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 
181 181
     return $html;
182 182
 }
183
-add_filter('geodir_custom_field_input_email','geodir_cfi_email',10,2);
183
+add_filter('geodir_custom_field_input_email', 'geodir_cfi_email', 10, 2);
184 184
 
185 185
 
186 186
 
@@ -193,12 +193,12 @@  discard block
 block discarded – undo
193 193
  *
194 194
  * @return string The html to output for the custom field.
195 195
  */
196
-function geodir_cfi_phone($html,$cf){
196
+function geodir_cfi_phone($html, $cf) {
197 197
 
198 198
     $html_var = $cf['htmlvar_name'];
199 199
 
200 200
     // Check if there is a custom field specific filter.
201
-    if(has_filter("geodir_custom_field_input_phone_{$html_var}")){
201
+    if (has_filter("geodir_custom_field_input_phone_{$html_var}")) {
202 202
         /**
203 203
          * Filter the phone html by individual custom field.
204 204
          *
@@ -206,11 +206,11 @@  discard block
 block discarded – undo
206 206
          * @param array $cf The custom field array.
207 207
          * @since 1.6.6
208 208
          */
209
-        $html = apply_filters("geodir_custom_field_input_phone_{$html_var}",$html,$cf);
209
+        $html = apply_filters("geodir_custom_field_input_phone_{$html_var}", $html, $cf);
210 210
     }
211 211
 
212 212
     // If no html then we run the standard output.
213
-    if(empty($html)) {
213
+    if (empty($html)) {
214 214
 
215 215
         ob_start(); // Start  buffering;
216 216
         $value = geodir_get_cf_value($cf);
@@ -219,16 +219,16 @@  discard block
 block discarded – undo
219 219
             $value = '';
220 220
         }?>
221 221
 
222
-        <div id="<?php echo $cf['name'];?>_row"
223
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
222
+        <div id="<?php echo $cf['name']; ?>_row"
223
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
224 224
             <label>
225 225
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
226 226
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
227
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
227
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
228 228
             </label>
229
-            <input field_type="<?php echo $cf['type'];?>" name="<?php  echo $cf['name'];?>" id="<?php echo $cf['name'];?>"
230
-                   value="<?php echo esc_attr(stripslashes($value));?>" type="tel" class="geodir_textfield"/>
231
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
229
+            <input field_type="<?php echo $cf['type']; ?>" name="<?php  echo $cf['name']; ?>" id="<?php echo $cf['name']; ?>"
230
+                   value="<?php echo esc_attr(stripslashes($value)); ?>" type="tel" class="geodir_textfield"/>
231
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
232 232
             <?php if ($cf['is_required']) { ?>
233 233
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
234 234
             <?php } ?>
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
 
241 241
     return $html;
242 242
 }
243
-add_filter('geodir_custom_field_input_phone','geodir_cfi_phone',10,2);
243
+add_filter('geodir_custom_field_input_phone', 'geodir_cfi_phone', 10, 2);
244 244
 
245 245
 
246 246
 
@@ -253,12 +253,12 @@  discard block
 block discarded – undo
253 253
  *
254 254
  * @return string The html to output for the custom field.
255 255
  */
256
-function geodir_cfi_url($html,$cf){
256
+function geodir_cfi_url($html, $cf) {
257 257
 
258 258
     $html_var = $cf['htmlvar_name'];
259 259
 
260 260
     // Check if there is a custom field specific filter.
261
-    if(has_filter("geodir_custom_field_input_url_{$html_var}")){
261
+    if (has_filter("geodir_custom_field_input_url_{$html_var}")) {
262 262
         /**
263 263
          * Filter the url html by individual custom field.
264 264
          *
@@ -266,11 +266,11 @@  discard block
 block discarded – undo
266 266
          * @param array $cf The custom field array.
267 267
          * @since 1.6.6
268 268
          */
269
-        $html = apply_filters("geodir_custom_field_input_url_{$html_var}",$html,$cf);
269
+        $html = apply_filters("geodir_custom_field_input_url_{$html_var}", $html, $cf);
270 270
     }
271 271
 
272 272
     // If no html then we run the standard output.
273
-    if(empty($html)) {
273
+    if (empty($html)) {
274 274
 
275 275
         ob_start(); // Start  buffering;
276 276
         $value = geodir_get_cf_value($cf);
@@ -279,19 +279,19 @@  discard block
 block discarded – undo
279 279
             $value = '';
280 280
         }?>
281 281
 
282
-        <div id="<?php echo $cf['name'];?>_row"
283
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
282
+        <div id="<?php echo $cf['name']; ?>_row"
283
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
284 284
             <label>
285 285
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
286 286
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
287
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
287
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
288 288
             </label>
289
-            <input field_type="<?php echo $cf['type'];?>" name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>"
290
-                   value="<?php echo esc_attr(stripslashes($value));?>" type="url" class="geodir_textfield"
289
+            <input field_type="<?php echo $cf['type']; ?>" name="<?php echo $cf['name']; ?>" id="<?php echo $cf['name']; ?>"
290
+                   value="<?php echo esc_attr(stripslashes($value)); ?>" type="url" class="geodir_textfield"
291 291
                    oninvalid="setCustomValidity('<?php _e('Please enter a valid URL including http://', 'geodirectory'); ?>')"
292 292
                    onchange="try{setCustomValidity('')}catch(e){}"
293 293
             />
294
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
294
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
295 295
             <?php if ($cf['is_required']) { ?>
296 296
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
297 297
             <?php } ?>
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
 
304 304
     return $html;
305 305
 }
306
-add_filter('geodir_custom_field_input_url','geodir_cfi_url',10,2);
306
+add_filter('geodir_custom_field_input_url', 'geodir_cfi_url', 10, 2);
307 307
 
308 308
 
309 309
 /**
@@ -315,12 +315,12 @@  discard block
 block discarded – undo
315 315
  *
316 316
  * @return string The html to output for the custom field.
317 317
  */
318
-function geodir_cfi_radio($html,$cf){
318
+function geodir_cfi_radio($html, $cf) {
319 319
 
320 320
     $html_var = $cf['htmlvar_name'];
321 321
 
322 322
     // Check if there is a custom field specific filter.
323
-    if(has_filter("geodir_custom_field_input_radio_{$html_var}")){
323
+    if (has_filter("geodir_custom_field_input_radio_{$html_var}")) {
324 324
         /**
325 325
          * Filter the radio html by individual custom field.
326 326
          *
@@ -328,22 +328,22 @@  discard block
 block discarded – undo
328 328
          * @param array $cf The custom field array.
329 329
          * @since 1.6.6
330 330
          */
331
-        $html = apply_filters("geodir_custom_field_input_radio_{$html_var}",$html,$cf);
331
+        $html = apply_filters("geodir_custom_field_input_radio_{$html_var}", $html, $cf);
332 332
     }
333 333
 
334 334
     // If no html then we run the standard output.
335
-    if(empty($html)) {
335
+    if (empty($html)) {
336 336
 
337 337
         ob_start(); // Start  buffering;
338 338
         $value = geodir_get_cf_value($cf);
339 339
 
340 340
         ?>
341
-        <div id="<?php echo $cf['name'];?>_row"
342
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
341
+        <div id="<?php echo $cf['name']; ?>_row"
342
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
343 343
             <label>
344 344
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
345 345
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
346
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
346
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
347 347
             </label>
348 348
             <?php if ($cf['option_values']) {
349 349
                 $option_values = geodir_string_values_to_options($cf['option_values'], true);
@@ -352,14 +352,14 @@  discard block
 block discarded – undo
352 352
                     foreach ($option_values as $option_value) {
353 353
                         if (empty($option_value['optgroup'])) {
354 354
                             ?>
355
-                            <span class="gd-radios"><input name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>" <?php checked($value, $option_value['value']);?> value="<?php echo esc_attr($option_value['value']); ?>" class="gd-checkbox" field_type="<?php echo $cf['type'];?>" type="radio" /><?php echo $option_value['label']; ?></span>
355
+                            <span class="gd-radios"><input name="<?php echo $cf['name']; ?>" id="<?php echo $cf['name']; ?>" <?php checked($value, $option_value['value']); ?> value="<?php echo esc_attr($option_value['value']); ?>" class="gd-checkbox" field_type="<?php echo $cf['type']; ?>" type="radio" /><?php echo $option_value['label']; ?></span>
356 356
                             <?php
357 357
                         }
358 358
                     }
359 359
                 }
360 360
             }
361 361
             ?>
362
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
362
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
363 363
             <?php if ($cf['is_required']) { ?>
364 364
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
365 365
             <?php } ?>
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
 
372 372
     return $html;
373 373
 }
374
-add_filter('geodir_custom_field_input_radio','geodir_cfi_radio',10,2);
374
+add_filter('geodir_custom_field_input_radio', 'geodir_cfi_radio', 10, 2);
375 375
 
376 376
 
377 377
 /**
@@ -383,12 +383,12 @@  discard block
 block discarded – undo
383 383
  *
384 384
  * @return string The html to output for the custom field.
385 385
  */
386
-function geodir_cfi_checkbox($html,$cf){
386
+function geodir_cfi_checkbox($html, $cf) {
387 387
 
388 388
     $html_var = $cf['htmlvar_name'];
389 389
 
390 390
     // Check if there is a custom field specific filter.
391
-    if(has_filter("geodir_custom_field_input_checkbox_{$html_var}")){
391
+    if (has_filter("geodir_custom_field_input_checkbox_{$html_var}")) {
392 392
         /**
393 393
          * Filter the checkbox html by individual custom field.
394 394
          *
@@ -396,11 +396,11 @@  discard block
 block discarded – undo
396 396
          * @param array $cf The custom field array.
397 397
          * @since 1.6.6
398 398
          */
399
-        $html = apply_filters("geodir_custom_field_input_checkbox_{$html_var}",$html,$cf);
399
+        $html = apply_filters("geodir_custom_field_input_checkbox_{$html_var}", $html, $cf);
400 400
     }
401 401
 
402 402
     // If no html then we run the standard output.
403
-    if(empty($html)) {
403
+    if (empty($html)) {
404 404
 
405 405
         ob_start(); // Start  buffering;
406 406
         $value = geodir_get_cf_value($cf);
@@ -409,22 +409,22 @@  discard block
 block discarded – undo
409 409
             $value = '';
410 410
         }?>
411 411
 
412
-        <div id="<?php echo $cf['name'];?>_row"
413
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
412
+        <div id="<?php echo $cf['name']; ?>_row"
413
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
414 414
             <label>
415 415
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
416 416
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
417
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
417
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
418 418
             </label>
419 419
             <?php if ($value != '1') {
420 420
                 $value = '0';
421 421
             }?>
422
-            <input type="hidden" name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>" value="<?php echo esc_attr($value);?>"/>
422
+            <input type="hidden" name="<?php echo $cf['name']; ?>" id="<?php echo $cf['name']; ?>" value="<?php echo esc_attr($value); ?>"/>
423 423
             <input  <?php if ($value == '1') {
424 424
                 echo 'checked="checked"';
425
-            }?>  value="1" class="gd-checkbox" field_type="<?php echo $cf['type'];?>" type="checkbox"
426
-                 onchange="if(this.checked){jQuery('#<?php echo $cf['name'];?>').val('1');} else{ jQuery('#<?php echo $cf['name'];?>').val('0');}"/>
427
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
425
+            }?>  value="1" class="gd-checkbox" field_type="<?php echo $cf['type']; ?>" type="checkbox"
426
+                 onchange="if(this.checked){jQuery('#<?php echo $cf['name']; ?>').val('1');} else{ jQuery('#<?php echo $cf['name']; ?>').val('0');}"/>
427
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
428 428
             <?php if ($cf['is_required']) { ?>
429 429
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
430 430
             <?php } ?>
@@ -436,7 +436,7 @@  discard block
 block discarded – undo
436 436
 
437 437
     return $html;
438 438
 }
439
-add_filter('geodir_custom_field_input_checkbox','geodir_cfi_checkbox',10,2);
439
+add_filter('geodir_custom_field_input_checkbox', 'geodir_cfi_checkbox', 10, 2);
440 440
 
441 441
 
442 442
 /**
@@ -448,12 +448,12 @@  discard block
 block discarded – undo
448 448
  *
449 449
  * @return string The html to output for the custom field.
450 450
  */
451
-function geodir_cfi_textarea($html,$cf){
451
+function geodir_cfi_textarea($html, $cf) {
452 452
 
453 453
     $html_var = $cf['htmlvar_name'];
454 454
 
455 455
     // Check if there is a custom field specific filter.
456
-    if(has_filter("geodir_custom_field_input_textarea_{$html_var}")){
456
+    if (has_filter("geodir_custom_field_input_textarea_{$html_var}")) {
457 457
         /**
458 458
          * Filter the textarea html by individual custom field.
459 459
          *
@@ -461,11 +461,11 @@  discard block
 block discarded – undo
461 461
          * @param array $cf The custom field array.
462 462
          * @since 1.6.6
463 463
          */
464
-        $html = apply_filters("geodir_custom_field_input_textarea_{$html_var}",$html,$cf);
464
+        $html = apply_filters("geodir_custom_field_input_textarea_{$html_var}", $html, $cf);
465 465
     }
466 466
 
467 467
     // If no html then we run the standard output.
468
-    if(empty($html)) {
468
+    if (empty($html)) {
469 469
 
470 470
         ob_start(); // Start  buffering;
471 471
         $value = geodir_get_cf_value($cf);
@@ -473,32 +473,32 @@  discard block
 block discarded – undo
473 473
         $extra_fields = unserialize($cf['extra_fields']);
474 474
         ?>
475 475
 
476
-        <div id="<?php echo $cf['name'];?>_row"
477
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
476
+        <div id="<?php echo $cf['name']; ?>_row"
477
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
478 478
             <label>
479 479
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
480 480
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
481
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
481
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
482 482
             </label><?php
483 483
 
484 484
 
485 485
             if (is_array($extra_fields) && in_array('1', $extra_fields)) {
486 486
 
487
-                $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);?>
487
+                $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10); ?>
488 488
 
489
-            <div class="editor" field_id="<?php echo $cf['name'];?>" field_type="editor">
489
+            <div class="editor" field_id="<?php echo $cf['name']; ?>" field_type="editor">
490 490
                 <?php wp_editor(stripslashes($value), $cf['name'], $editor_settings); ?>
491 491
                 </div><?php
492 492
 
493 493
             } else {
494 494
 
495
-                ?><textarea field_type="<?php echo $cf['type'];?>" class="geodir_textarea" name="<?php echo $cf['name'];?>"
496
-                            id="<?php echo $cf['name'];?>"><?php echo stripslashes($value);?></textarea><?php
495
+                ?><textarea field_type="<?php echo $cf['type']; ?>" class="geodir_textarea" name="<?php echo $cf['name']; ?>"
496
+                            id="<?php echo $cf['name']; ?>"><?php echo stripslashes($value); ?></textarea><?php
497 497
 
498 498
             }?>
499 499
 
500 500
 
501
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
501
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
502 502
             <?php if ($cf['is_required']) { ?>
503 503
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
504 504
             <?php } ?>
@@ -510,7 +510,7 @@  discard block
 block discarded – undo
510 510
 
511 511
     return $html;
512 512
 }
513
-add_filter('geodir_custom_field_input_textarea','geodir_cfi_textarea',10,2);
513
+add_filter('geodir_custom_field_input_textarea', 'geodir_cfi_textarea', 10, 2);
514 514
 
515 515
 
516 516
 /**
@@ -522,12 +522,12 @@  discard block
 block discarded – undo
522 522
  *
523 523
  * @return string The html to output for the custom field.
524 524
  */
525
-function geodir_cfi_select($html,$cf){
525
+function geodir_cfi_select($html, $cf) {
526 526
 
527 527
     $html_var = $cf['htmlvar_name'];
528 528
 
529 529
     // Check if there is a custom field specific filter.
530
-    if(has_filter("geodir_custom_field_input_select_{$html_var}")){
530
+    if (has_filter("geodir_custom_field_input_select_{$html_var}")) {
531 531
         /**
532 532
          * Filter the select html by individual custom field.
533 533
          *
@@ -535,22 +535,22 @@  discard block
 block discarded – undo
535 535
          * @param array $cf The custom field array.
536 536
          * @since 1.6.6
537 537
          */
538
-        $html = apply_filters("geodir_custom_field_input_select_{$html_var}",$html,$cf);
538
+        $html = apply_filters("geodir_custom_field_input_select_{$html_var}", $html, $cf);
539 539
     }
540 540
 
541 541
     // If no html then we run the standard output.
542
-    if(empty($html)) {
542
+    if (empty($html)) {
543 543
 
544 544
         ob_start(); // Start  buffering;
545 545
         $value = geodir_get_cf_value($cf);
546 546
 
547 547
         ?>
548
-        <div id="<?php echo $cf['name'];?>_row"
549
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row geodir_custom_fields clearfix gd-fieldset-details">
548
+        <div id="<?php echo $cf['name']; ?>_row"
549
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row geodir_custom_fields clearfix gd-fieldset-details">
550 550
             <label>
551 551
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
552 552
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
553
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
553
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
554 554
             </label>
555 555
             <?php
556 556
             $option_values_arr = geodir_string_values_to_options($cf['option_values'], true);
@@ -560,22 +560,22 @@  discard block
 block discarded – undo
560 560
                     if (isset($option_row['optgroup']) && ($option_row['optgroup'] == 'start' || $option_row['optgroup'] == 'end')) {
561 561
                         $option_label = isset($option_row['label']) ? $option_row['label'] : '';
562 562
 
563
-                        $select_options .= $option_row['optgroup'] == 'start' ? '<optgroup label="' . esc_attr($option_label) . '">' : '</optgroup>';
563
+                        $select_options .= $option_row['optgroup'] == 'start' ? '<optgroup label="'.esc_attr($option_label).'">' : '</optgroup>';
564 564
                     } else {
565 565
                         $option_label = isset($option_row['label']) ? $option_row['label'] : '';
566 566
                         $option_value = isset($option_row['value']) ? $option_row['value'] : '';
567 567
                         $selected = $option_value == $value ? 'selected="selected"' : '';
568 568
 
569
-                        $select_options .= '<option value="' . esc_attr($option_value) . '" ' . $selected . '>' . $option_label . '</option>';
569
+                        $select_options .= '<option value="'.esc_attr($option_value).'" '.$selected.'>'.$option_label.'</option>';
570 570
                     }
571 571
                 }
572 572
             }
573 573
             ?>
574
-            <select field_type="<?php echo $cf['type'];?>" name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>"
574
+            <select field_type="<?php echo $cf['type']; ?>" name="<?php echo $cf['name']; ?>" id="<?php echo $cf['name']; ?>"
575 575
                     class="geodir_textfield textfield_x chosen_select"
576
-                    data-placeholder="<?php echo __('Choose', 'geodirectory') . ' ' . $site_title . '&hellip;';?>"
577
-                    option-ajaxchosen="false"><?php echo $select_options;?></select>
578
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
576
+                    data-placeholder="<?php echo __('Choose', 'geodirectory').' '.$site_title.'&hellip;'; ?>"
577
+                    option-ajaxchosen="false"><?php echo $select_options; ?></select>
578
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
579 579
             <?php if ($cf['is_required']) { ?>
580 580
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
581 581
             <?php } ?>
@@ -587,7 +587,7 @@  discard block
 block discarded – undo
587 587
 
588 588
     return $html;
589 589
 }
590
-add_filter('geodir_custom_field_input_select','geodir_cfi_select',10,2);
590
+add_filter('geodir_custom_field_input_select', 'geodir_cfi_select', 10, 2);
591 591
 
592 592
 
593 593
 /**
@@ -599,12 +599,12 @@  discard block
 block discarded – undo
599 599
  *
600 600
  * @return string The html to output for the custom field.
601 601
  */
602
-function geodir_cfi_multiselect($html,$cf){
602
+function geodir_cfi_multiselect($html, $cf) {
603 603
 
604 604
     $html_var = $cf['htmlvar_name'];
605 605
 
606 606
     // Check if there is a custom field specific filter.
607
-    if(has_filter("geodir_custom_field_input_multiselect_{$html_var}")){
607
+    if (has_filter("geodir_custom_field_input_multiselect_{$html_var}")) {
608 608
         /**
609 609
          * Filter the multiselect html by individual custom field.
610 610
          *
@@ -612,11 +612,11 @@  discard block
 block discarded – undo
612 612
          * @param array $cf The custom field array.
613 613
          * @since 1.6.6
614 614
          */
615
-        $html = apply_filters("geodir_custom_field_input_multiselect_{$html_var}",$html,$cf);
615
+        $html = apply_filters("geodir_custom_field_input_multiselect_{$html_var}", $html, $cf);
616 616
     }
617 617
 
618 618
     // If no html then we run the standard output.
619
-    if(empty($html)) {
619
+    if (empty($html)) {
620 620
 
621 621
         ob_start(); // Start  buffering;
622 622
         $value = geodir_get_cf_value($cf);
@@ -653,9 +653,9 @@  discard block
 block discarded – undo
653 653
                                 $option_label = isset($option_row['label']) ? $option_row['label'] : '';
654 654
 
655 655
                                 if ($multi_display == 'select') {
656
-                                    $select_options .= $option_row['optgroup'] == 'start' ? '<optgroup label="' . esc_attr($option_label) . '">' : '</optgroup>';
656
+                                    $select_options .= $option_row['optgroup'] == 'start' ? '<optgroup label="'.esc_attr($option_label).'">' : '</optgroup>';
657 657
                                 } else {
658
-                                    $select_options .= $option_row['optgroup'] == 'start' ? '<li>' . $option_label . '</li>' : '';
658
+                                    $select_options .= $option_row['optgroup'] == 'start' ? '<li>'.$option_label.'</li>' : '';
659 659
                                 }
660 660
                             } else {
661 661
                                 $option_label = isset($option_row['label']) ? $option_row['label'] : '';
@@ -680,9 +680,9 @@  discard block
 block discarded – undo
680 680
                                 }
681 681
 
682 682
                                 if ($multi_display == 'select') {
683
-                                    $select_options .= '<option value="' . esc_attr($option_value) . '" ' . $selected . '>' . $option_label . '</option>';
683
+                                    $select_options .= '<option value="'.esc_attr($option_value).'" '.$selected.'>'.$option_label.'</option>';
684 684
                                 } else {
685
-                                    $select_options .= '<li><input name="' . $cf['name'] . '[]" ' . $checked . ' value="' . esc_attr($option_value) . '" class="gd-' . $multi_display . '" field_type="' . $multi_display . '" type="' . $multi_display . '" />&nbsp;' . $option_label . ' </li>';
685
+                                    $select_options .= '<li><input name="'.$cf['name'].'[]" '.$checked.' value="'.esc_attr($option_value).'" class="gd-'.$multi_display.'" field_type="'.$multi_display.'" type="'.$multi_display.'" />&nbsp;'.$option_label.' </li>';
686 686
                                 }
687 687
                             }
688 688
                         }
@@ -702,7 +702,7 @@  discard block
 block discarded – undo
702 702
 
703 703
     return $html;
704 704
 }
705
-add_filter('geodir_custom_field_input_multiselect','geodir_cfi_multiselect',10,2);
705
+add_filter('geodir_custom_field_input_multiselect', 'geodir_cfi_multiselect', 10, 2);
706 706
 
707 707
 
708 708
 /**
@@ -714,12 +714,12 @@  discard block
 block discarded – undo
714 714
  *
715 715
  * @return string The html to output for the custom field.
716 716
  */
717
-function geodir_cfi_html($html,$cf){
717
+function geodir_cfi_html($html, $cf) {
718 718
 
719 719
     $html_var = $cf['htmlvar_name'];
720 720
 
721 721
     // Check if there is a custom field specific filter.
722
-    if(has_filter("geodir_custom_field_input_html_{$html_var}")){
722
+    if (has_filter("geodir_custom_field_input_html_{$html_var}")) {
723 723
         /**
724 724
          * Filter the html html by individual custom field.
725 725
          *
@@ -727,11 +727,11 @@  discard block
 block discarded – undo
727 727
          * @param array $cf The custom field array.
728 728
          * @since 1.6.6
729 729
          */
730
-        $html = apply_filters("geodir_custom_field_input_html_{$html_var}",$html,$cf);
730
+        $html = apply_filters("geodir_custom_field_input_html_{$html_var}", $html, $cf);
731 731
     }
732 732
 
733 733
     // If no html then we run the standard output.
734
-    if(empty($html)) {
734
+    if (empty($html)) {
735 735
 
736 736
         ob_start(); // Start  buffering;
737 737
         $value = geodir_get_cf_value($cf);
@@ -764,7 +764,7 @@  discard block
 block discarded – undo
764 764
 
765 765
     return $html;
766 766
 }
767
-add_filter('geodir_custom_field_input_html','geodir_cfi_html',10,2);
767
+add_filter('geodir_custom_field_input_html', 'geodir_cfi_html', 10, 2);
768 768
 
769 769
 
770 770
 
@@ -777,12 +777,12 @@  discard block
 block discarded – undo
777 777
  *
778 778
  * @return string The html to output for the custom field.
779 779
  */
780
-function geodir_cfi_datepicker($html,$cf){
780
+function geodir_cfi_datepicker($html, $cf) {
781 781
 
782 782
     $html_var = $cf['htmlvar_name'];
783 783
 
784 784
     // Check if there is a custom field specific filter.
785
-    if(has_filter("geodir_custom_field_input_datepicker_{$html_var}")){
785
+    if (has_filter("geodir_custom_field_input_datepicker_{$html_var}")) {
786 786
         /**
787 787
          * Filter the datepicker html by individual custom field.
788 788
          *
@@ -790,11 +790,11 @@  discard block
 block discarded – undo
790 790
          * @param array $cf The custom field array.
791 791
          * @since 1.6.6
792 792
          */
793
-        $html = apply_filters("geodir_custom_field_input_datepicker_{$html_var}",$html,$cf);
793
+        $html = apply_filters("geodir_custom_field_input_datepicker_{$html_var}", $html, $cf);
794 794
     }
795 795
 
796 796
     // If no html then we run the standard output.
797
-    if(empty($html)) {
797
+    if (empty($html)) {
798 798
 
799 799
         ob_start(); // Start  buffering;
800 800
         $value = geodir_get_cf_value($cf);
@@ -806,23 +806,23 @@  discard block
 block discarded – undo
806 806
             $extra_fields['date_format'] = 'yy-mm-dd';
807 807
 
808 808
         $date_format = $extra_fields['date_format'];
809
-        $jquery_date_format  = $date_format;
809
+        $jquery_date_format = $date_format;
810 810
 
811 811
 
812 812
         // check if we need to change the format or not
813 813
         $date_format_len = strlen(str_replace(' ', '', $date_format));
814
-        if($date_format_len>5){// if greater then 5 then it's the old style format.
814
+        if ($date_format_len > 5) {// if greater then 5 then it's the old style format.
815 815
 
816
-            $search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format
817
-            $replace = array('d','j','l','m','n','F','Y');//PHP date format
816
+            $search = array('dd', 'd', 'DD', 'mm', 'm', 'MM', 'yy'); //jQuery UI datepicker format
817
+            $replace = array('d', 'j', 'l', 'm', 'n', 'F', 'Y'); //PHP date format
818 818
 
819 819
             $date_format = str_replace($search, $replace, $date_format);
820
-        }else{
821
-            $jquery_date_format = geodir_date_format_php_to_jqueryui( $jquery_date_format );
820
+        } else {
821
+            $jquery_date_format = geodir_date_format_php_to_jqueryui($jquery_date_format);
822 822
         }
823 823
 
824
-        if($value=='0000-00-00'){$value='';}//if date not set, then mark it empty
825
-        if($value && !isset($_REQUEST['backandedit'])) {
824
+        if ($value == '0000-00-00') {$value = ''; }//if date not set, then mark it empty
825
+        if ($value && !isset($_REQUEST['backandedit'])) {
826 826
             $time = strtotime($value);
827 827
             $value = date_i18n($date_format, $time);
828 828
         }
@@ -832,37 +832,37 @@  discard block
 block discarded – undo
832 832
 
833 833
             jQuery(function () {
834 834
 
835
-                jQuery("#<?php echo $cf['name'];?>").datepicker({changeMonth: true, changeYear: true <?php
835
+                jQuery("#<?php echo $cf['name']; ?>").datepicker({changeMonth: true, changeYear: true <?php
836 836
                     /**
837 837
                      * Used to add extra option to datepicker per custom field.
838 838
                      *
839 839
                      * @since 1.5.7
840 840
                      * @param string $name The custom field name.
841 841
                      */
842
-                    echo apply_filters("gd_datepicker_extra_{$name}",'');?>});
842
+                    echo apply_filters("gd_datepicker_extra_{$name}", ''); ?>});
843 843
 
844
-                jQuery("#<?php echo $name;?>").datepicker("option", "dateFormat", '<?php echo $jquery_date_format;?>');
844
+                jQuery("#<?php echo $name; ?>").datepicker("option", "dateFormat", '<?php echo $jquery_date_format; ?>');
845 845
 
846
-                <?php if(!empty($value)){?>
847
-                jQuery("#<?php echo $name;?>").datepicker("setDate", "<?php echo $value;?>");
846
+                <?php if (!empty($value)) {?>
847
+                jQuery("#<?php echo $name; ?>").datepicker("setDate", "<?php echo $value; ?>");
848 848
                 <?php } ?>
849 849
 
850 850
             });
851 851
 
852 852
         </script>
853
-        <div id="<?php echo $name;?>_row"
854
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
853
+        <div id="<?php echo $name; ?>_row"
854
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
855 855
             <label>
856 856
 
857 857
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
858 858
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
859
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
859
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
860 860
             </label>
861 861
 
862
-            <input field_type="<?php echo $cf['type'];?>" name="<?php echo $name;?>" id="<?php echo $name;?>"
863
-                   value="<?php echo esc_attr($value);?>" type="text" class="geodir_textfield"/>
862
+            <input field_type="<?php echo $cf['type']; ?>" name="<?php echo $name; ?>" id="<?php echo $name; ?>"
863
+                   value="<?php echo esc_attr($value); ?>" type="text" class="geodir_textfield"/>
864 864
 
865
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
865
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
866 866
             <?php if ($cf['is_required']) { ?>
867 867
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
868 868
             <?php } ?>
@@ -874,7 +874,7 @@  discard block
 block discarded – undo
874 874
 
875 875
     return $html;
876 876
 }
877
-add_filter('geodir_custom_field_input_datepicker','geodir_cfi_datepicker',10,2);
877
+add_filter('geodir_custom_field_input_datepicker', 'geodir_cfi_datepicker', 10, 2);
878 878
 
879 879
 
880 880
 /**
@@ -886,12 +886,12 @@  discard block
 block discarded – undo
886 886
  *
887 887
  * @return string The html to output for the custom field.
888 888
  */
889
-function geodir_cfi_time($html,$cf){
889
+function geodir_cfi_time($html, $cf) {
890 890
 
891 891
     $html_var = $cf['htmlvar_name'];
892 892
 
893 893
     // Check if there is a custom field specific filter.
894
-    if(has_filter("geodir_custom_field_input_time_{$html_var}")){
894
+    if (has_filter("geodir_custom_field_input_time_{$html_var}")) {
895 895
         /**
896 896
          * Filter the time html by individual custom field.
897 897
          *
@@ -899,11 +899,11 @@  discard block
 block discarded – undo
899 899
          * @param array $cf The custom field array.
900 900
          * @since 1.6.6
901 901
          */
902
-        $html = apply_filters("geodir_custom_field_input_time_{$html_var}",$html,$cf);
902
+        $html = apply_filters("geodir_custom_field_input_time_{$html_var}", $html, $cf);
903 903
     }
904 904
 
905 905
     // If no html then we run the standard output.
906
-    if(empty($html)) {
906
+    if (empty($html)) {
907 907
 
908 908
         ob_start(); // Start  buffering;
909 909
         $value = geodir_get_cf_value($cf);
@@ -916,25 +916,25 @@  discard block
 block discarded – undo
916 916
         <script type="text/javascript">
917 917
             jQuery(document).ready(function () {
918 918
 
919
-                jQuery('#<?php echo $name;?>').timepicker({
919
+                jQuery('#<?php echo $name; ?>').timepicker({
920 920
                     showPeriod: true,
921 921
                     showLeadingZero: true,
922 922
                     showPeriod: true,
923 923
                 });
924 924
             });
925 925
         </script>
926
-        <div id="<?php echo $name;?>_row"
927
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
926
+        <div id="<?php echo $name; ?>_row"
927
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
928 928
             <label>
929 929
 
930 930
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
931 931
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
932
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
932
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
933 933
             </label>
934
-            <input readonly="readonly" field_type="<?php echo $cf['type'];?>" name="<?php echo $name;?>"
935
-                   id="<?php echo $name;?>" value="<?php echo esc_attr($value);?>" type="text" class="geodir_textfield"/>
934
+            <input readonly="readonly" field_type="<?php echo $cf['type']; ?>" name="<?php echo $name; ?>"
935
+                   id="<?php echo $name; ?>" value="<?php echo esc_attr($value); ?>" type="text" class="geodir_textfield"/>
936 936
 
937
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
937
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
938 938
             <?php if ($cf['is_required']) { ?>
939 939
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
940 940
             <?php } ?>
@@ -945,7 +945,7 @@  discard block
 block discarded – undo
945 945
 
946 946
     return $html;
947 947
 }
948
-add_filter('geodir_custom_field_input_time','geodir_cfi_time',10,2);
948
+add_filter('geodir_custom_field_input_time', 'geodir_cfi_time', 10, 2);
949 949
 
950 950
 
951 951
 /**
@@ -957,12 +957,12 @@  discard block
 block discarded – undo
957 957
  *
958 958
  * @return string The html to output for the custom field.
959 959
  */
960
-function geodir_cfi_address($html,$cf){
960
+function geodir_cfi_address($html, $cf) {
961 961
 
962 962
     $html_var = $cf['htmlvar_name'];
963 963
 
964 964
     // Check if there is a custom field specific filter.
965
-    if(has_filter("geodir_custom_field_input_address_{$html_var}")){
965
+    if (has_filter("geodir_custom_field_input_address_{$html_var}")) {
966 966
         /**
967 967
          * Filter the address html by individual custom field.
968 968
          *
@@ -970,11 +970,11 @@  discard block
 block discarded – undo
970 970
          * @param array $cf The custom field array.
971 971
          * @since 1.6.6
972 972
          */
973
-        $html = apply_filters("geodir_custom_field_input_address_{$html_var}",$html,$cf);
973
+        $html = apply_filters("geodir_custom_field_input_address_{$html_var}", $html, $cf);
974 974
     }
975 975
 
976 976
     // If no html then we run the standard output.
977
-    if(empty($html)) {
977
+    if (empty($html)) {
978 978
 
979 979
         global $gd_session;
980 980
         ob_start(); // Start  buffering;
@@ -987,12 +987,12 @@  discard block
 block discarded – undo
987 987
         $site_title = $cf['site_title'];
988 988
         $is_admin = $cf['is_admin'];
989 989
         $extra_fields = unserialize($cf['extra_fields']);
990
-        $prefix = $name . '_';
990
+        $prefix = $name.'_';
991 991
 
992
-        ($site_title != '') ? $address_title = $site_title : $address_title = geodir_ucwords($prefix . ' address');
993
-        ($extra_fields['zip_lable'] != '') ? $zip_title = $extra_fields['zip_lable'] : $zip_title = geodir_ucwords($prefix . ' zip/post code ');
992
+        ($site_title != '') ? $address_title = $site_title : $address_title = geodir_ucwords($prefix.' address');
993
+        ($extra_fields['zip_lable'] != '') ? $zip_title = $extra_fields['zip_lable'] : $zip_title = geodir_ucwords($prefix.' zip/post code ');
994 994
         ($extra_fields['map_lable'] != '') ? $map_title = $extra_fields['map_lable'] : $map_title = geodir_ucwords('set address on map');
995
-        ($extra_fields['mapview_lable'] != '') ? $mapview_title = $extra_fields['mapview_lable'] : $mapview_title = geodir_ucwords($prefix . ' mapview');
995
+        ($extra_fields['mapview_lable'] != '') ? $mapview_title = $extra_fields['mapview_lable'] : $mapview_title = geodir_ucwords($prefix.' mapview');
996 996
 
997 997
         $address = '';
998 998
         $zip = '';
@@ -1003,21 +1003,21 @@  discard block
 block discarded – undo
1003 1003
 
1004 1004
         if (isset($_REQUEST['backandedit']) && $_REQUEST['backandedit'] && $gd_ses_listing = $gd_session->get('listing')) {
1005 1005
             $post = $gd_ses_listing;
1006
-            $address = $post[$prefix . 'address'];
1007
-            $zip = isset($post[$prefix . 'zip']) ? $post[$prefix . 'zip'] : '';
1008
-            $lat = isset($post[$prefix . 'latitude']) ? $post[$prefix . 'latitude'] : '';
1009
-            $lng = isset($post[$prefix . 'longitude']) ? $post[$prefix . 'longitude'] : '';
1010
-            $mapview = isset($post[$prefix . 'mapview']) ? $post[$prefix . 'mapview'] : '';
1011
-            $mapzoom = isset($post[$prefix . 'mapzoom']) ? $post[$prefix . 'mapzoom'] : '';
1006
+            $address = $post[$prefix.'address'];
1007
+            $zip = isset($post[$prefix.'zip']) ? $post[$prefix.'zip'] : '';
1008
+            $lat = isset($post[$prefix.'latitude']) ? $post[$prefix.'latitude'] : '';
1009
+            $lng = isset($post[$prefix.'longitude']) ? $post[$prefix.'longitude'] : '';
1010
+            $mapview = isset($post[$prefix.'mapview']) ? $post[$prefix.'mapview'] : '';
1011
+            $mapzoom = isset($post[$prefix.'mapzoom']) ? $post[$prefix.'mapzoom'] : '';
1012 1012
         } else if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '' && $post_info = geodir_get_post_info($_REQUEST['pid'])) {
1013
-            $post_info = (array)$post_info;
1014
-
1015
-            $address = $post_info[$prefix . 'address'];
1016
-            $zip = isset($post_info[$prefix . 'zip']) ? $post_info[$prefix . 'zip'] : '';
1017
-            $lat = isset($post_info[$prefix . 'latitude']) ? $post_info[$prefix . 'latitude'] : '';
1018
-            $lng = isset($post_info[$prefix . 'longitude']) ? $post_info[$prefix . 'longitude'] : '';
1019
-            $mapview = isset($post_info[$prefix . 'mapview']) ? $post_info[$prefix . 'mapview'] : '';
1020
-            $mapzoom = isset($post_info[$prefix . 'mapzoom']) ? $post_info[$prefix . 'mapzoom'] : '';
1013
+            $post_info = (array) $post_info;
1014
+
1015
+            $address = $post_info[$prefix.'address'];
1016
+            $zip = isset($post_info[$prefix.'zip']) ? $post_info[$prefix.'zip'] : '';
1017
+            $lat = isset($post_info[$prefix.'latitude']) ? $post_info[$prefix.'latitude'] : '';
1018
+            $lng = isset($post_info[$prefix.'longitude']) ? $post_info[$prefix.'longitude'] : '';
1019
+            $mapview = isset($post_info[$prefix.'mapview']) ? $post_info[$prefix.'mapview'] : '';
1020
+            $mapzoom = isset($post_info[$prefix.'mapzoom']) ? $post_info[$prefix.'mapzoom'] : '';
1021 1021
         }
1022 1022
 
1023 1023
         $location = geodir_get_default_location();
@@ -1054,16 +1054,16 @@  discard block
 block discarded – undo
1054 1054
 
1055 1055
         ?>
1056 1056
 
1057
-        <div id="geodir_<?php echo $prefix . 'address';?>_row"
1058
-             class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
1057
+        <div id="geodir_<?php echo $prefix.'address'; ?>_row"
1058
+             class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
1059 1059
             <label>
1060 1060
                 <?php _e($address_title, 'geodirectory'); ?>
1061
-                <?php if ($is_required) echo '<span>*</span>';?>
1061
+                <?php if ($is_required) echo '<span>*</span>'; ?>
1062 1062
             </label>
1063
-            <input type="text" field_type="<?php echo $type;?>" name="<?php echo $prefix . 'address';?>"
1064
-                   id="<?php echo $prefix . 'address';?>" class="geodir_textfield"
1063
+            <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix.'address'; ?>"
1064
+                   id="<?php echo $prefix.'address'; ?>" class="geodir_textfield"
1065 1065
                    value="<?php echo esc_attr(stripslashes($address)); ?>"/>
1066
-            <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory');?></span>
1066
+            <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory'); ?></span>
1067 1067
             <?php if ($is_required) { ?>
1068 1068
                 <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span>
1069 1069
             <?php } ?>
@@ -1083,14 +1083,14 @@  discard block
 block discarded – undo
1083 1083
 
1084 1084
         if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) { ?>
1085 1085
 
1086
-            <div id="geodir_<?php echo $prefix . 'zip'; ?>_row"
1086
+            <div id="geodir_<?php echo $prefix.'zip'; ?>_row"
1087 1087
                  class="<?php /*if($is_required) echo 'required_field';*/ ?> geodir_form_row clearfix gd-fieldset-details">
1088 1088
                 <label>
1089 1089
                     <?php _e($zip_title, 'geodirectory'); ?>
1090 1090
                     <?php /*if($is_required) echo '<span>*</span>';*/ ?>
1091 1091
                 </label>
1092
-                <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix . 'zip'; ?>"
1093
-                       id="<?php echo $prefix . 'zip'; ?>" class="geodir_textfield autofill"
1092
+                <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix.'zip'; ?>"
1093
+                       id="<?php echo $prefix.'zip'; ?>" class="geodir_textfield autofill"
1094 1094
                        value="<?php echo esc_attr(stripslashes($zip)); ?>"/>
1095 1095
                 <?php /*if($is_required) {?>
1096 1096
 					<span class="geodir_message_error"><?php echo _e($required_msg,'geodirectory');?></span>
@@ -1100,14 +1100,14 @@  discard block
 block discarded – undo
1100 1100
 
1101 1101
         <?php if (isset($extra_fields['show_map']) && $extra_fields['show_map']) { ?>
1102 1102
 
1103
-            <div id="geodir_<?php echo $prefix . 'map'; ?>_row" class="geodir_form_row clearfix gd-fieldset-details">
1103
+            <div id="geodir_<?php echo $prefix.'map'; ?>_row" class="geodir_form_row clearfix gd-fieldset-details">
1104 1104
                 <?php
1105 1105
                 /**
1106 1106
                  * Contains add listing page map functions.
1107 1107
                  *
1108 1108
                  * @since 1.0.0
1109 1109
                  */
1110
-                include(geodir_plugin_path() . "/geodirectory-functions/map-functions/map_on_add_listing_page.php");
1110
+                include(geodir_plugin_path()."/geodirectory-functions/map-functions/map_on_add_listing_page.php");
1111 1111
                 if ($lat_lng_blank) {
1112 1112
                     $lat = '';
1113 1113
                     $lng = '';
@@ -1118,14 +1118,14 @@  discard block
 block discarded – undo
1118 1118
             <?php
1119 1119
             /* show lat lng */
1120 1120
             $style_latlng = ((isset($extra_fields['show_latlng']) && $extra_fields['show_latlng']) || is_admin()) ? '' : 'style="display:none"'; ?>
1121
-            <div id="geodir_<?php echo $prefix . 'latitude'; ?>_row"
1121
+            <div id="geodir_<?php echo $prefix.'latitude'; ?>_row"
1122 1122
                  class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details" <?php echo $style_latlng; ?>>
1123 1123
                 <label>
1124 1124
                     <?php echo PLACE_ADDRESS_LAT; ?>
1125 1125
                     <?php if ($is_required) echo '<span>*</span>'; ?>
1126 1126
                 </label>
1127
-                <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix . 'latitude'; ?>"
1128
-                       id="<?php echo $prefix . 'latitude'; ?>" class="geodir_textfield"
1127
+                <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix.'latitude'; ?>"
1128
+                       id="<?php echo $prefix.'latitude'; ?>" class="geodir_textfield"
1129 1129
                        value="<?php echo esc_attr(stripslashes($lat)); ?>" size="25"/>
1130 1130
                 <span class="geodir_message_note"><?php echo GET_LATITUDE_MSG; ?></span>
1131 1131
                 <?php if ($is_required) { ?>
@@ -1133,14 +1133,14 @@  discard block
 block discarded – undo
1133 1133
                 <?php } ?>
1134 1134
             </div>
1135 1135
 
1136
-            <div id="geodir_<?php echo $prefix . 'longitude'; ?>_row"
1136
+            <div id="geodir_<?php echo $prefix.'longitude'; ?>_row"
1137 1137
                  class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details" <?php echo $style_latlng; ?>>
1138 1138
                 <label>
1139 1139
                     <?php echo PLACE_ADDRESS_LNG; ?>
1140 1140
                     <?php if ($is_required) echo '<span>*</span>'; ?>
1141 1141
                 </label>
1142
-                <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix . 'longitude'; ?>"
1143
-                       id="<?php echo $prefix . 'longitude'; ?>" class="geodir_textfield"
1142
+                <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix.'longitude'; ?>"
1143
+                       id="<?php echo $prefix.'longitude'; ?>" class="geodir_textfield"
1144 1144
                        value="<?php echo esc_attr(stripslashes($lng)); ?>" size="25"/>
1145 1145
                 <span class="geodir_message_note"><?php echo GET_LOGNGITUDE_MSG; ?></span>
1146 1146
                 <?php if ($is_required) { ?>
@@ -1150,32 +1150,32 @@  discard block
 block discarded – undo
1150 1150
         <?php } ?>
1151 1151
 
1152 1152
         <?php if (isset($extra_fields['show_mapview']) && $extra_fields['show_mapview']) { ?>
1153
-            <div id="geodir_<?php echo $prefix . 'mapview'; ?>_row" class="geodir_form_row clearfix gd-fieldset-details">
1153
+            <div id="geodir_<?php echo $prefix.'mapview'; ?>_row" class="geodir_form_row clearfix gd-fieldset-details">
1154 1154
                 <label><?php _e($mapview_title, 'geodirectory'); ?></label>
1155 1155
 
1156 1156
 
1157 1157
                     <span class="geodir_user_define"><input field_type="<?php echo $type; ?>" type="radio"
1158 1158
                                                             class="gd-checkbox"
1159
-                                                            name="<?php echo $prefix . 'mapview'; ?>"
1160
-                                                            id="<?php echo $prefix . 'mapview'; ?>" <?php if ($mapview == 'ROADMAP' || $mapview == '') {
1159
+                                                            name="<?php echo $prefix.'mapview'; ?>"
1160
+                                                            id="<?php echo $prefix.'mapview'; ?>" <?php if ($mapview == 'ROADMAP' || $mapview == '') {
1161 1161
                             echo 'checked="checked"';
1162 1162
                         } ?>  value="ROADMAP" size="25"/> <?php _e('Default Map', 'geodirectory'); ?></span>
1163 1163
                     <span class="geodir_user_define"> <input field_type="<?php echo $type; ?>" type="radio"
1164 1164
                                                              class="gd-checkbox"
1165
-                                                             name="<?php echo $prefix . 'mapview'; ?>"
1165
+                                                             name="<?php echo $prefix.'mapview'; ?>"
1166 1166
                                                              id="map_view1" <?php if ($mapview == 'SATELLITE') {
1167 1167
                             echo 'checked="checked"';
1168 1168
                         } ?> value="SATELLITE" size="25"/> <?php _e('Satellite Map', 'geodirectory'); ?></span>
1169 1169
 
1170 1170
                     <span class="geodir_user_define"><input field_type="<?php echo $type; ?>" type="radio"
1171 1171
                                                             class="gd-checkbox"
1172
-                                                            name="<?php echo $prefix . 'mapview'; ?>"
1172
+                                                            name="<?php echo $prefix.'mapview'; ?>"
1173 1173
                                                             id="map_view2" <?php if ($mapview == 'HYBRID') {
1174 1174
                             echo 'checked="checked"';
1175 1175
                         } ?>  value="HYBRID" size="25"/> <?php _e('Hybrid Map', 'geodirectory'); ?></span>
1176 1176
 					<span class="geodir_user_define"><input field_type="<?php echo $type; ?>" type="radio"
1177 1177
                                                             class="gd-checkbox"
1178
-                                                            name="<?php echo $prefix . 'mapview'; ?>"
1178
+                                                            name="<?php echo $prefix.'mapview'; ?>"
1179 1179
                                                             id="map_view3" <?php if ($mapview == 'TERRAIN') {
1180 1180
                             echo 'checked="checked"';
1181 1181
                         } ?>  value="TERRAIN" size="25"/> <?php _e('Terrain Map', 'geodirectory'); ?></span>
@@ -1187,7 +1187,7 @@  discard block
 block discarded – undo
1187 1187
         <?php if (isset($extra_fields['show_mapzoom']) && $extra_fields['show_mapzoom']) { ?>
1188 1188
             <input type="hidden" value="<?php if (isset($mapzoom)) {
1189 1189
                 echo esc_attr($mapzoom);
1190
-            } ?>" name="<?php echo $prefix . 'mapzoom'; ?>" id="<?php echo $prefix . 'mapzoom'; ?>"/>
1190
+            } ?>" name="<?php echo $prefix.'mapzoom'; ?>" id="<?php echo $prefix.'mapzoom'; ?>"/>
1191 1191
         <?php }
1192 1192
 
1193 1193
         $html = ob_get_clean();
@@ -1195,7 +1195,7 @@  discard block
 block discarded – undo
1195 1195
 
1196 1196
     return $html;
1197 1197
 }
1198
-add_filter('geodir_custom_field_input_address','geodir_cfi_address',10,2);
1198
+add_filter('geodir_custom_field_input_address', 'geodir_cfi_address', 10, 2);
1199 1199
 
1200 1200
 
1201 1201
 
@@ -1208,12 +1208,12 @@  discard block
 block discarded – undo
1208 1208
  *
1209 1209
  * @return string The html to output for the custom field.
1210 1210
  */
1211
-function geodir_cfi_taxonomy($html,$cf){
1211
+function geodir_cfi_taxonomy($html, $cf) {
1212 1212
 
1213 1213
     $html_var = $cf['htmlvar_name'];
1214 1214
 
1215 1215
     // Check if there is a custom field specific filter.
1216
-    if(has_filter("geodir_custom_field_input_taxonomy_{$html_var}")){
1216
+    if (has_filter("geodir_custom_field_input_taxonomy_{$html_var}")) {
1217 1217
         /**
1218 1218
          * Filter the taxonomy html by individual custom field.
1219 1219
          *
@@ -1221,11 +1221,11 @@  discard block
 block discarded – undo
1221 1221
          * @param array $cf The custom field array.
1222 1222
          * @since 1.6.6
1223 1223
          */
1224
-        $html = apply_filters("geodir_custom_field_input_taxonomy_{$html_var}",$html,$cf);
1224
+        $html = apply_filters("geodir_custom_field_input_taxonomy_{$html_var}", $html, $cf);
1225 1225
     }
1226 1226
 
1227 1227
     // If no html then we run the standard output.
1228
-    if(empty($html)) {
1228
+    if (empty($html)) {
1229 1229
 
1230 1230
         ob_start(); // Start  buffering;
1231 1231
         $value = geodir_get_cf_value($cf);
@@ -1240,15 +1240,15 @@  discard block
 block discarded – undo
1240 1240
         if ($value == $cf['default']) {
1241 1241
             $value = '';
1242 1242
         } ?>
1243
-        <div id="<?php echo $name;?>_row"
1244
-             class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
1243
+        <div id="<?php echo $name; ?>_row"
1244
+             class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
1245 1245
             <label>
1246 1246
                 <?php $site_title = __($site_title, 'geodirectory');
1247 1247
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
1248
-                <?php if ($is_required) echo '<span>*</span>';?>
1248
+                <?php if ($is_required) echo '<span>*</span>'; ?>
1249 1249
             </label>
1250 1250
 
1251
-            <div id="<?php echo $name;?>" class="geodir_taxonomy_field" style="float:left; width:70%;">
1251
+            <div id="<?php echo $name; ?>" class="geodir_taxonomy_field" style="float:left; width:70%;">
1252 1252
                 <?php
1253 1253
                 global $wpdb, $post, $cat_display, $post_cat, $package_id, $exclude_cats;
1254 1254
 
@@ -1260,7 +1260,7 @@  discard block
 block discarded – undo
1260 1260
 
1261 1261
                     $package_info = array();
1262 1262
 
1263
-                    $package_info = (array)geodir_post_package_info($package_info, $post, $post_type);
1263
+                    $package_info = (array) geodir_post_package_info($package_info, $post, $post_type);
1264 1264
 
1265 1265
                     if (!empty($package_info)) {
1266 1266
 
@@ -1289,7 +1289,7 @@  discard block
 block discarded – undo
1289 1289
 
1290 1290
                     $catadd_limit = $wpdb->get_var(
1291 1291
                         $wpdb->prepare(
1292
-                            "SELECT cat_limit FROM " . GEODIR_PRICE_TABLE . " WHERE pid = %d",
1292
+                            "SELECT cat_limit FROM ".GEODIR_PRICE_TABLE." WHERE pid = %d",
1293 1293
                             array($package_id)
1294 1294
                         )
1295 1295
                     );
@@ -1305,13 +1305,13 @@  discard block
 block discarded – undo
1305 1305
                     $required_limit_msg = '';
1306 1306
                     if ($catadd_limit > 0 && $cat_display != 'select' && $cat_display != 'radio') {
1307 1307
 
1308
-                        $required_limit_msg = __('Only select', 'geodirectory') . ' ' . $catadd_limit . __(' categories for this package.', 'geodirectory');
1308
+                        $required_limit_msg = __('Only select', 'geodirectory').' '.$catadd_limit.__(' categories for this package.', 'geodirectory');
1309 1309
 
1310 1310
                     } else {
1311 1311
                         $required_limit_msg = $required_msg;
1312 1312
                     }
1313 1313
 
1314
-                    echo '<input type="hidden" cat_limit="' . $catadd_limit . '" id="cat_limit" value="' . esc_attr($required_limit_msg) . '" name="cat_limit[' . $name . ']"  />';
1314
+                    echo '<input type="hidden" cat_limit="'.$catadd_limit.'" id="cat_limit" value="'.esc_attr($required_limit_msg).'" name="cat_limit['.$name.']"  />';
1315 1315
 
1316 1316
 
1317 1317
                     if ($cat_display == 'select' || $cat_display == 'multiselect') {
@@ -1321,11 +1321,11 @@  discard block
 block discarded – undo
1321 1321
                         if ($cat_display == 'multiselect')
1322 1322
                             $multiple = 'multiple="multiple"';
1323 1323
 
1324
-                        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') . '">';
1324
+                        echo '<select id="'.$name.'" '.$multiple.' type="'.$name.'" name="post_category['.$name.'][]" alt="'.$name.'" field_type="'.$cat_display.'" class="geodir_textfield textfield_x chosen_select" data-placeholder="'.__('Select Category', 'geodirectory').'">';
1325 1325
 
1326 1326
 
1327 1327
                         if ($cat_display == 'select')
1328
-                            echo '<option value="">' . __('Select Category', 'geodirectory') . '</option>';
1328
+                            echo '<option value="">'.__('Select Category', 'geodirectory').'</option>';
1329 1329
 
1330 1330
                     }
1331 1331
 
@@ -1343,7 +1343,7 @@  discard block
 block discarded – undo
1343 1343
                 ?>
1344 1344
             </div>
1345 1345
 
1346
-            <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory');?></span>
1346
+            <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory'); ?></span>
1347 1347
             <?php if ($is_required) { ?>
1348 1348
                 <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span>
1349 1349
             <?php } ?>
@@ -1355,7 +1355,7 @@  discard block
 block discarded – undo
1355 1355
 
1356 1356
     return $html;
1357 1357
 }
1358
-add_filter('geodir_custom_field_input_taxonomy','geodir_cfi_taxonomy',10,2);
1358
+add_filter('geodir_custom_field_input_taxonomy', 'geodir_cfi_taxonomy', 10, 2);
1359 1359
 
1360 1360
 
1361 1361
 /**
@@ -1367,12 +1367,12 @@  discard block
 block discarded – undo
1367 1367
  *
1368 1368
  * @return string The html to output for the custom field.
1369 1369
  */
1370
-function geodir_cfi_file($html,$cf){
1370
+function geodir_cfi_file($html, $cf) {
1371 1371
 
1372 1372
     $html_var = $cf['htmlvar_name'];
1373 1373
 
1374 1374
     // Check if there is a custom field specific filter.
1375
-    if(has_filter("geodir_custom_field_input_file_{$html_var}")){
1375
+    if (has_filter("geodir_custom_field_input_file_{$html_var}")) {
1376 1376
         /**
1377 1377
          * Filter the file html by individual custom field.
1378 1378
          *
@@ -1380,11 +1380,11 @@  discard block
 block discarded – undo
1380 1380
          * @param array $cf The custom field array.
1381 1381
          * @since 1.6.6
1382 1382
          */
1383
-        $html = apply_filters("geodir_custom_field_input_file_{$html_var}",$html,$cf);
1383
+        $html = apply_filters("geodir_custom_field_input_file_{$html_var}", $html, $cf);
1384 1384
     }
1385 1385
 
1386 1386
     // If no html then we run the standard output.
1387
-    if(empty($html)) {
1387
+    if (empty($html)) {
1388 1388
 
1389 1389
         ob_start(); // Start  buffering;
1390 1390
         $value = geodir_get_cf_value($cf);
@@ -1427,8 +1427,8 @@  discard block
 block discarded – undo
1427 1427
                 $file_totImg = count($curImages);
1428 1428
         }
1429 1429
 
1430
-        $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']) : '';
1431
-        $display_file_types = $allowed_file_types != '' ? '.' . implode(", .", $extra_fields['gd_file_types']) : '';
1430
+        $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']) : '';
1431
+        $display_file_types = $allowed_file_types != '' ? '.'.implode(", .", $extra_fields['gd_file_types']) : '';
1432 1432
 
1433 1433
         ?>
1434 1434
         <?php /*?> <h5 class="geodir-form_title"> <?php echo $site_title; ?>
@@ -1438,13 +1438,13 @@  discard block
 block discarded – undo
1438 1438
 			</h5>   <?php */
1439 1439
         ?>
1440 1440
 
1441
-        <div id="<?php echo $name;?>_row"
1442
-             class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
1441
+        <div id="<?php echo $name; ?>_row"
1442
+             class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
1443 1443
 
1444 1444
             <div id="<?php echo $file_id; ?>dropbox" style="text-align:center;">
1445 1445
                 <label
1446 1446
                     style="text-align:left; padding-top:10px;"><?php $site_title = __($site_title, 'geodirectory');
1447
-                    echo $site_title; ?><?php if ($is_required) echo '<span>*</span>';?></label>
1447
+                    echo $site_title; ?><?php if ($is_required) echo '<span>*</span>'; ?></label>
1448 1448
                 <input class="geodir-custom-file-upload" field_type="file" type="hidden"
1449 1449
                        name="<?php echo $file_id; ?>" id="<?php echo $file_id; ?>"
1450 1450
                        value="<?php echo esc_attr($file_value); ?>"/>
@@ -1452,7 +1452,7 @@  discard block
 block discarded – undo
1452 1452
                        id="<?php echo $file_id; ?>image_limit" value="<?php echo $file_image_limit; ?>"/>
1453 1453
                 <?php if ($allowed_file_types != '') { ?>
1454 1454
                     <input type="hidden" name="<?php echo $file_id; ?>_allowed_types"
1455
-                           id="<?php echo $file_id; ?>_allowed_types" value="<?php echo esc_attr($allowed_file_types); ?>" data-exts="<?php echo esc_attr($display_file_types);?>"/>
1455
+                           id="<?php echo $file_id; ?>_allowed_types" value="<?php echo esc_attr($allowed_file_types); ?>" data-exts="<?php echo esc_attr($display_file_types); ?>"/>
1456 1456
                 <?php } ?>
1457 1457
                 <input type="hidden" name="<?php echo $file_id; ?>totImg" id="<?php echo $file_id; ?>totImg"
1458 1458
                        value="<?php if (isset($file_totImg)) {
@@ -1468,10 +1468,10 @@  discard block
 block discarded – undo
1468 1468
                         <?php /*?><h4><?php _e('Drop files to upload');?></h4><br/><?php */
1469 1469
                         ?>
1470 1470
                         <input id="<?php echo $file_id; ?>plupload-browse-button" type="button"
1471
-                               value="<?php ($file_image_limit > 1 ? esc_attr_e('Select Files', 'geodirectory') : esc_attr_e('Select File', 'geodirectory') ); ?>"
1471
+                               value="<?php ($file_image_limit > 1 ? esc_attr_e('Select Files', 'geodirectory') : esc_attr_e('Select File', 'geodirectory')); ?>"
1472 1472
                                class="geodir_button" style="margin-top:10px;"/>
1473 1473
                             <span class="ajaxnonceplu"
1474
-                                  id="ajaxnonceplu<?php echo wp_create_nonce($file_id . 'pluploadan'); ?>"></span>
1474
+                                  id="ajaxnonceplu<?php echo wp_create_nonce($file_id.'pluploadan'); ?>"></span>
1475 1475
                         <?php if ($file_width && $file_height): ?>
1476 1476
                             <span class="plupload-resize"></span>
1477 1477
                             <span class="plupload-width" id="plupload-width<?php echo $file_width; ?>"></span>
@@ -1491,7 +1491,7 @@  discard block
 block discarded – undo
1491 1491
 
1492 1492
                 </div>
1493 1493
             </div>
1494
-            <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory');?> <?php echo ( $display_file_types != '' ? __('Allowed file types:', 'geodirectory') . ' ' . $display_file_types : '' );?></span>
1494
+            <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory'); ?> <?php echo ($display_file_types != '' ? __('Allowed file types:', 'geodirectory').' '.$display_file_types : ''); ?></span>
1495 1495
             <?php if ($is_required) { ?>
1496 1496
                 <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span>
1497 1497
             <?php } ?>
@@ -1504,4 +1504,4 @@  discard block
 block discarded – undo
1504 1504
 
1505 1505
     return $html;
1506 1506
 }
1507
-add_filter('geodir_custom_field_input_file','geodir_cfi_file',10,2);
1508 1507
\ No newline at end of file
1508
+add_filter('geodir_custom_field_input_file', 'geodir_cfi_file', 10, 2);
1509 1509
\ No newline at end of file
Please login to merge, or discard this patch.
geodirectory-functions/custom_field_html.php 3 patches
Braces   +42 added lines, -37 removed lines patch added patch discarded remove patch
@@ -19,8 +19,9 @@  discard block
 block discarded – undo
19 19
 
20 20
 if (!isset($field_info->post_type)) {
21 21
     $post_type = sanitize_text_field($_REQUEST['listing_type']);
22
-} else
23
-    $post_type = $field_info->post_type;
22
+} else {
23
+    $post_type = $field_info->post_type;
24
+}
24 25
 
25 26
 $cf_arr = geodir_custom_fields($post_type);
26 27
 $cf = (isset($cf_arr[$field_type_key])) ? $cf_arr[$field_type_key] : '';
@@ -30,8 +31,9 @@  discard block
 block discarded – undo
30 31
 $nonce = wp_create_nonce('custom_fields_' . $result_str);
31 32
 
32 33
 $field_admin_title = '';
33
-if (isset($field_info->admin_title))
34
-    $field_admin_title = $field_info->admin_title;
34
+if (isset($field_info->admin_title)) {
35
+    $field_admin_title = $field_info->admin_title;
36
+}
35 37
 
36 38
 $default = isset($field_info->is_admin) ? $field_info->is_admin : '';
37 39
 
@@ -52,9 +54,9 @@  discard block
 block discarded – undo
52 54
 
53 55
 if (isset($cf['icon']) && strpos($cf['icon'], 'fa fa-') !== false) {
54 56
     $field_icon = '<i class="'.$cf['icon'].'" aria-hidden="true"></i>';
55
-}elseif(isset($cf['icon']) && $cf['icon']){
57
+} elseif(isset($cf['icon']) && $cf['icon']){
56 58
     $field_icon = '<b style="background-image: url("'.$cf['icon'].'")"></b>';
57
-}else{
59
+} else{
58 60
     $field_icon = '<i class="fa fa-cog" aria-hidden="true"></i>';
59 61
 }
60 62
 
@@ -70,8 +72,11 @@  discard block
 block discarded – undo
70 72
 
71 73
         <?php if ($default): ?>
72 74
             <div title="<?php _e('Default field, should not be removed.', 'geodirectory'); ?>" class="handlediv move gd-default-remove"><i class="fa fa-times" aria-hidden="true"></i></div>
73
-        <?php else: ?>
74
-            <div title="<?php _e('Click to remove field', 'geodirectory'); ?>"
75
+        <?php else {
76
+	: ?>
77
+            <div title="<?php _e('Click to remove field', 'geodirectory');
78
+}
79
+?>"
75 80
                  onclick="delete_field('<?php echo $result_str; ?>', '<?php echo $nonce; ?>')"
76 81
                  class="handlediv close"><i class="fa fa-times" aria-hidden="true"></i></div>
77 82
         <?php endif;
@@ -122,11 +127,11 @@  discard block
 block discarded – undo
122 127
 
123 128
                 echo apply_filters("geodir_cfa_data_type_{$field_type}",'',$result_str,$cf,$field_info);
124 129
 
125
-            }else{
130
+            } else{
126 131
                 $value = '';
127 132
                 if (isset($field_info->data_type)) {
128 133
                     $value = esc_attr($field_info->data_type);
129
-                }elseif(isset($cf['defaults']['data_type']) && $cf['defaults']['data_type']){
134
+                } elseif(isset($cf['defaults']['data_type']) && $cf['defaults']['data_type']){
130 135
                     $value = $cf['defaults']['data_type'];
131 136
                 }
132 137
                 ?>
@@ -140,11 +145,11 @@  discard block
 block discarded – undo
140 145
 
141 146
                 echo apply_filters("geodir_cfa_admin_title_{$field_type}",'',$result_str,$cf,$field_info);
142 147
 
143
-            }else{
148
+            } else{
144 149
                 $value = '';
145 150
                 if (isset($field_info->admin_title)) {
146 151
                     $value = esc_attr($field_info->admin_title);
147
-                }elseif(isset($cf['defaults']['admin_title']) && $cf['defaults']['admin_title']){
152
+                } elseif(isset($cf['defaults']['admin_title']) && $cf['defaults']['admin_title']){
148 153
                     $value = $cf['defaults']['admin_title'];
149 154
                 }
150 155
                 ?>
@@ -169,11 +174,11 @@  discard block
 block discarded – undo
169 174
 
170 175
                 echo apply_filters("geodir_cfa_site_title_{$field_type}",'',$result_str,$cf,$field_info);
171 176
 
172
-            }else{
177
+            } else{
173 178
                 $value = '';
174 179
                 if (isset($field_info->site_title)) {
175 180
                     $value = esc_attr($field_info->site_title);
176
-                }elseif(isset($cf['defaults']['site_title']) && $cf['defaults']['site_title']){
181
+                } elseif(isset($cf['defaults']['site_title']) && $cf['defaults']['site_title']){
177 182
                     $value = $cf['defaults']['site_title'];
178 183
                 }
179 184
                 ?>
@@ -197,11 +202,11 @@  discard block
 block discarded – undo
197 202
 
198 203
                 echo apply_filters("geodir_cfa_admin_desc_{$field_type}",'',$result_str,$cf,$field_info);
199 204
 
200
-            }else{
205
+            } else{
201 206
                 $value = '';
202 207
                 if (isset($field_info->admin_desc)) {
203 208
                     $value = esc_attr($field_info->admin_desc);
204
-                }elseif(isset($cf['defaults']['admin_desc']) && $cf['defaults']['admin_desc']){
209
+                } elseif(isset($cf['defaults']['admin_desc']) && $cf['defaults']['admin_desc']){
205 210
                     $value = $cf['defaults']['admin_desc'];
206 211
                 }
207 212
                 ?>
@@ -225,11 +230,11 @@  discard block
 block discarded – undo
225 230
 
226 231
                 echo apply_filters("geodir_cfa_htmlvar_name_{$field_type}",'',$result_str,$cf,$field_info);
227 232
 
228
-            }else{
233
+            } else{
229 234
                 $value = '';
230 235
                 if (isset($field_info->htmlvar_name)) {
231 236
                     $value = esc_attr($field_info->htmlvar_name);
232
-                }elseif(isset($cf['defaults']['htmlvar_name']) && $cf['defaults']['htmlvar_name']){
237
+                } elseif(isset($cf['defaults']['htmlvar_name']) && $cf['defaults']['htmlvar_name']){
233 238
                     $value = $cf['defaults']['htmlvar_name'];
234 239
                 }
235 240
                 ?>
@@ -257,11 +262,11 @@  discard block
 block discarded – undo
257 262
 
258 263
                 echo apply_filters("geodir_cfa_is_active_{$field_type}",'',$result_str,$cf,$field_info);
259 264
 
260
-            }else{
265
+            } else{
261 266
                 $value = '';
262 267
                 if (isset($field_info->is_active)) {
263 268
                     $value = esc_attr($field_info->is_active);
264
-                }elseif(isset($cf['defaults']['is_active']) && $cf['defaults']['is_active']){
269
+                } elseif(isset($cf['defaults']['is_active']) && $cf['defaults']['is_active']){
265 270
                     $value = $cf['defaults']['is_active'];
266 271
                 }
267 272
                 ?>
@@ -296,11 +301,11 @@  discard block
 block discarded – undo
296 301
 
297 302
                 echo apply_filters("geodir_cfa_for_admin_use_{$field_type}",'',$result_str,$cf,$field_info);
298 303
 
299
-            }else{
304
+            } else{
300 305
                 $value = '';
301 306
                 if (isset($field_info->for_admin_use)) {
302 307
                     $value = esc_attr($field_info->for_admin_use);
303
-                }elseif(isset($cf['defaults']['for_admin_use']) && $cf['defaults']['for_admin_use']){
308
+                } elseif(isset($cf['defaults']['for_admin_use']) && $cf['defaults']['for_admin_use']){
304 309
                     $value = $cf['defaults']['for_admin_use'];
305 310
                 }
306 311
                 ?>
@@ -335,11 +340,11 @@  discard block
 block discarded – undo
335 340
 
336 341
                 echo apply_filters("geodir_cfa_default_value_{$field_type}",'',$result_str,$cf,$field_info);
337 342
 
338
-            }else{
343
+            } else{
339 344
                 $value = '';
340 345
                 if (isset($field_info->default_value)) {
341 346
                     $value = esc_attr($field_info->default_value);
342
-                }elseif(isset($cf['defaults']['default_value']) && $cf['defaults']['default_value']){
347
+                } elseif(isset($cf['defaults']['default_value']) && $cf['defaults']['default_value']){
343 348
                     $value = $cf['defaults']['default_value'];
344 349
                 }
345 350
                 ?>
@@ -379,11 +384,11 @@  discard block
 block discarded – undo
379 384
 
380 385
                 echo apply_filters("geodir_cfa_show_in_{$field_type}",'',$result_str,$cf,$field_info);
381 386
 
382
-            }else{
387
+            } else{
383 388
                 $value = '';
384 389
                 if (isset($field_info->show_in)) {
385 390
                     $value = esc_attr($field_info->show_in);
386
-                }elseif(isset($cf['defaults']['show_in']) && $cf['defaults']['show_in']){
391
+                } elseif(isset($cf['defaults']['show_in']) && $cf['defaults']['show_in']){
387 392
                     $value = esc_attr($cf['defaults']['show_in']);
388 393
                 }
389 394
                 ?>
@@ -424,7 +429,7 @@  discard block
 block discarded – undo
424 429
                         // don't show new tab option for some types
425 430
 
426 431
                         if (in_array($field_type, array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file'))) {
427
-                        }else{
432
+                        } else{
428 433
                             unset($show_in_locations['[owntab]']);
429 434
                         }
430 435
 
@@ -537,11 +542,11 @@  discard block
 block discarded – undo
537 542
 
538 543
                 echo apply_filters("geodir_cfa_is_required_{$field_type}",'',$result_str,$cf,$field_info);
539 544
 
540
-            }else{
545
+            } else{
541 546
                 $value = '';
542 547
                 if (isset($field_info->is_required)) {
543 548
                     $value = esc_attr($field_info->is_required);
544
-                }elseif(isset($cf['defaults']['is_required']) && $cf['defaults']['is_required']){
549
+                } elseif(isset($cf['defaults']['is_required']) && $cf['defaults']['is_required']){
545 550
                     $value = $cf['defaults']['is_required'];
546 551
                 }
547 552
                 ?>
@@ -578,11 +583,11 @@  discard block
 block discarded – undo
578 583
 
579 584
                 echo apply_filters("geodir_cfa_required_msg_{$field_type}",'',$result_str,$cf,$field_info);
580 585
 
581
-            }else{
586
+            } else{
582 587
                 $value = '';
583 588
                 if (isset($field_info->required_msg)) {
584 589
                     $value = esc_attr($field_info->required_msg);
585
-                }elseif(isset($cf['defaults']['required_msg']) && $cf['defaults']['required_msg']){
590
+                } elseif(isset($cf['defaults']['required_msg']) && $cf['defaults']['required_msg']){
586 591
                     $value = $cf['defaults']['required_msg'];
587 592
                 }
588 593
                 ?>
@@ -623,11 +628,11 @@  discard block
 block discarded – undo
623 628
 
624 629
                 echo apply_filters("geodir_cfa_field_icon_{$field_type}",'',$result_str,$cf,$field_info);
625 630
 
626
-            }else{
631
+            } else{
627 632
                 $value = '';
628 633
                 if (isset($field_info->field_icon)) {
629 634
                     $value = esc_attr($field_info->field_icon);
630
-                }elseif(isset($cf['defaults']['field_icon']) && $cf['defaults']['field_icon']){
635
+                } elseif(isset($cf['defaults']['field_icon']) && $cf['defaults']['field_icon']){
631 636
                     $value = $cf['defaults']['field_icon'];
632 637
                 }
633 638
                 ?>
@@ -656,11 +661,11 @@  discard block
 block discarded – undo
656 661
 
657 662
                 echo apply_filters("geodir_cfa_css_class_{$field_type}",'',$result_str,$cf,$field_info);
658 663
 
659
-            }else{
664
+            } else{
660 665
                 $value = '';
661 666
                 if (isset($field_info->css_class)) {
662 667
                     $value = esc_attr($field_info->css_class);
663
-                }elseif(isset($cf['defaults']['css_class']) && $cf['defaults']['css_class']){
668
+                } elseif(isset($cf['defaults']['css_class']) && $cf['defaults']['css_class']){
664 669
                     $value = $cf['defaults']['css_class'];
665 670
                 }
666 671
                 ?>
@@ -688,12 +693,12 @@  discard block
 block discarded – undo
688 693
 
689 694
                 echo apply_filters("geodir_cfa_cat_sort_{$field_type}",'',$result_str,$cf,$field_info);
690 695
 
691
-            }else{
696
+            } else{
692 697
                 $value = '';
693 698
                 $hide_cat_sort  ='';
694 699
                 if (isset($field_info->cat_sort)) {
695 700
                     $value = esc_attr($field_info->cat_sort);
696
-                }elseif(isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']){
701
+                } elseif(isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']){
697 702
                     $value = $cf['defaults']['cat_sort'];
698 703
                     $hide_cat_sort = ($value===false) ? "style='display:none;'" : '';
699 704
                 }
Please login to merge, or discard this patch.
Indentation   +326 added lines, -326 removed lines patch added patch discarded remove patch
@@ -18,9 +18,9 @@  discard block
 block discarded – undo
18 18
 global $post_type;
19 19
 
20 20
 if (!isset($field_info->post_type)) {
21
-    $post_type = sanitize_text_field($_REQUEST['listing_type']);
21
+	$post_type = sanitize_text_field($_REQUEST['listing_type']);
22 22
 } else
23
-    $post_type = $field_info->post_type;
23
+	$post_type = $field_info->post_type;
24 24
 
25 25
 $cf_arr = geodir_custom_fields($post_type);
26 26
 $cf = (isset($cf_arr[$field_type_key])) ? $cf_arr[$field_type_key] : '';
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 
32 32
 $field_admin_title = '';
33 33
 if (isset($field_info->admin_title))
34
-    $field_admin_title = $field_info->admin_title;
34
+	$field_admin_title = $field_info->admin_title;
35 35
 
36 36
 $default = isset($field_info->is_admin) ? $field_info->is_admin : '';
37 37
 
@@ -51,11 +51,11 @@  discard block
 block discarded – undo
51 51
 //print_r($field_info);
52 52
 
53 53
 if (isset($cf['icon']) && strpos($cf['icon'], 'fa fa-') !== false) {
54
-    $field_icon = '<i class="'.$cf['icon'].'" aria-hidden="true"></i>';
54
+	$field_icon = '<i class="'.$cf['icon'].'" aria-hidden="true"></i>';
55 55
 }elseif(isset($cf['icon']) && $cf['icon']){
56
-    $field_icon = '<b style="background-image: url("'.$cf['icon'].'")"></b>';
56
+	$field_icon = '<b style="background-image: url("'.$cf['icon'].'")"></b>';
57 57
 }else{
58
-    $field_icon = '<i class="fa fa-cog" aria-hidden="true"></i>';
58
+	$field_icon = '<i class="fa fa-cog" aria-hidden="true"></i>';
59 59
 }
60 60
 
61 61
 ?>
@@ -65,8 +65,8 @@  discard block
 block discarded – undo
65 65
          ondblclick="show_hide('field_frm<?php echo $result_str; ?>')">
66 66
         <?php
67 67
 
68
-        $nonce = wp_create_nonce('custom_fields_' . $result_str);
69
-        ?>
68
+		$nonce = wp_create_nonce('custom_fields_' . $result_str);
69
+		?>
70 70
 
71 71
         <?php if ($default): ?>
72 72
             <div title="<?php _e('Default field, should not be removed.', 'geodirectory'); ?>" class="handlediv move gd-default-remove"><i class="fa fa-times" aria-hidden="true"></i></div>
@@ -75,37 +75,37 @@  discard block
 block discarded – undo
75 75
                  onclick="delete_field('<?php echo $result_str; ?>', '<?php echo $nonce; ?>')"
76 76
                  class="handlediv close"><i class="fa fa-times" aria-hidden="true"></i></div>
77 77
         <?php endif;
78
-        if ($field_type == 'fieldset') {
79
-            ?>
78
+		if ($field_type == 'fieldset') {
79
+			?>
80 80
             <i class="fa fa-long-arrow-left " aria-hidden="true"></i>
81 81
             <i class="fa fa-long-arrow-right " aria-hidden="true"></i>
82 82
             <b style="cursor:pointer;"
83 83
                onclick="show_hide('field_frm<?php echo $result_str;?>')"><?php echo geodir_ucwords(__('Fieldset:', 'geodirectory') . ' ' . $field_admin_title);?></b>
84 84
         <?php
85
-        } else {echo $field_icon;
86
-            ?>
85
+		} else {echo $field_icon;
86
+			?>
87 87
             <b style="cursor:pointer;"
88 88
                onclick="show_hide('field_frm<?php echo $result_str;?>')"><?php echo geodir_ucwords(' ' . $field_admin_title . ' (' . $field_type . ')');?></b>
89 89
         <?php
90
-        }
91
-        ?>
90
+		}
91
+		?>
92 92
     </div>
93 93
 
94 94
     <form><!-- we need to wrap in a fom so we can use radio buttons with same name -->
95 95
     <div id="field_frm<?php echo $result_str; ?>" class="field_frm"
96 96
          style="display:<?php if ($field_ins_upd == 'submit') {
97
-             echo 'block;';
98
-         } else {
99
-             echo 'none;';
100
-         } ?>">
97
+			 echo 'block;';
98
+		 } else {
99
+			 echo 'none;';
100
+		 } ?>">
101 101
         <input type="hidden" name="_wpnonce" value="<?php echo esc_attr($nonce); ?>"/>
102 102
         <input type="hidden" name="listing_type" id="listing_type" value="<?php echo $post_type; ?>"/>
103 103
         <input type="hidden" name="field_type" id="field_type" value="<?php echo $field_type; ?>"/>
104 104
         <input type="hidden" name="field_type_key" id="field_type_key" value="<?php echo $field_type_key; ?>"/>
105 105
         <input type="hidden" name="field_id" id="field_id" value="<?php echo esc_attr($result_str); ?>"/>
106 106
         <input type="hidden" name="data_type" id="data_type" value="<?php if (isset($field_info->data_type)) {
107
-            echo $field_info->data_type;
108
-        } ?>"/>
107
+			echo $field_info->data_type;
108
+		} ?>"/>
109 109
         <input type="hidden" name="is_active" id="is_active" value="1"/>
110 110
 
111 111
         <input type="hidden" name="is_default" value="<?php echo $field_info->is_default;?>" /><?php // show in sidebar value?>
@@ -117,37 +117,37 @@  discard block
 block discarded – undo
117 117
 
118 118
             <?php
119 119
 
120
-            // data_type
121
-            if(has_filter("geodir_cfa_data_type_{$field_type}")){
120
+			// data_type
121
+			if(has_filter("geodir_cfa_data_type_{$field_type}")){
122 122
 
123
-                echo apply_filters("geodir_cfa_data_type_{$field_type}",'',$result_str,$cf,$field_info);
123
+				echo apply_filters("geodir_cfa_data_type_{$field_type}",'',$result_str,$cf,$field_info);
124 124
 
125
-            }else{
126
-                $value = '';
127
-                if (isset($field_info->data_type)) {
128
-                    $value = esc_attr($field_info->data_type);
129
-                }elseif(isset($cf['defaults']['data_type']) && $cf['defaults']['data_type']){
130
-                    $value = $cf['defaults']['data_type'];
131
-                }
132
-                ?>
125
+			}else{
126
+				$value = '';
127
+				if (isset($field_info->data_type)) {
128
+					$value = esc_attr($field_info->data_type);
129
+				}elseif(isset($cf['defaults']['data_type']) && $cf['defaults']['data_type']){
130
+					$value = $cf['defaults']['data_type'];
131
+				}
132
+				?>
133 133
                 <input type="hidden" name="data_type" id="data_type" value="<?php echo $value;?>"/>
134 134
             <?php
135
-            }
135
+			}
136 136
 
137 137
 
138
-            // admin_title
139
-            if(has_filter("geodir_cfa_admin_title_{$field_type}")){
138
+			// admin_title
139
+			if(has_filter("geodir_cfa_admin_title_{$field_type}")){
140 140
 
141
-                echo apply_filters("geodir_cfa_admin_title_{$field_type}",'',$result_str,$cf,$field_info);
141
+				echo apply_filters("geodir_cfa_admin_title_{$field_type}",'',$result_str,$cf,$field_info);
142 142
 
143
-            }else{
144
-                $value = '';
145
-                if (isset($field_info->admin_title)) {
146
-                    $value = esc_attr($field_info->admin_title);
147
-                }elseif(isset($cf['defaults']['admin_title']) && $cf['defaults']['admin_title']){
148
-                    $value = $cf['defaults']['admin_title'];
149
-                }
150
-                ?>
143
+			}else{
144
+				$value = '';
145
+				if (isset($field_info->admin_title)) {
146
+					$value = esc_attr($field_info->admin_title);
147
+				}elseif(isset($cf['defaults']['admin_title']) && $cf['defaults']['admin_title']){
148
+					$value = $cf['defaults']['admin_title'];
149
+				}
150
+				?>
151 151
                 <li>
152 152
                     <label for="admin_title" class="gd-cf-tooltip-wrap">
153 153
                         <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Admin title :', 'geodirectory'); ?>
@@ -161,22 +161,22 @@  discard block
 block discarded – undo
161 161
                     </div>
162 162
                 </li>
163 163
                 <?php
164
-            }
164
+			}
165 165
 
166 166
 
167
-            // site_title
168
-            if(has_filter("geodir_cfa_site_title_{$field_type}")){
167
+			// site_title
168
+			if(has_filter("geodir_cfa_site_title_{$field_type}")){
169 169
 
170
-                echo apply_filters("geodir_cfa_site_title_{$field_type}",'',$result_str,$cf,$field_info);
170
+				echo apply_filters("geodir_cfa_site_title_{$field_type}",'',$result_str,$cf,$field_info);
171 171
 
172
-            }else{
173
-                $value = '';
174
-                if (isset($field_info->site_title)) {
175
-                    $value = esc_attr($field_info->site_title);
176
-                }elseif(isset($cf['defaults']['site_title']) && $cf['defaults']['site_title']){
177
-                    $value = $cf['defaults']['site_title'];
178
-                }
179
-                ?>
172
+			}else{
173
+				$value = '';
174
+				if (isset($field_info->site_title)) {
175
+					$value = esc_attr($field_info->site_title);
176
+				}elseif(isset($cf['defaults']['site_title']) && $cf['defaults']['site_title']){
177
+					$value = $cf['defaults']['site_title'];
178
+				}
179
+				?>
180 180
                 <li>
181 181
                     <label for="site_title" class="gd-cf-tooltip-wrap"> <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Frontend title :', 'geodirectory'); ?>
182 182
                         <div class="gdcf-tooltip">
@@ -189,22 +189,22 @@  discard block
 block discarded – undo
189 189
                     </div>
190 190
                 </li>
191 191
                 <?php
192
-            }
192
+			}
193 193
 
194 194
 
195
-            // admin_desc
196
-            if(has_filter("geodir_cfa_admin_desc_{$field_type}")){
195
+			// admin_desc
196
+			if(has_filter("geodir_cfa_admin_desc_{$field_type}")){
197 197
 
198
-                echo apply_filters("geodir_cfa_admin_desc_{$field_type}",'',$result_str,$cf,$field_info);
198
+				echo apply_filters("geodir_cfa_admin_desc_{$field_type}",'',$result_str,$cf,$field_info);
199 199
 
200
-            }else{
201
-                $value = '';
202
-                if (isset($field_info->admin_desc)) {
203
-                    $value = esc_attr($field_info->admin_desc);
204
-                }elseif(isset($cf['defaults']['admin_desc']) && $cf['defaults']['admin_desc']){
205
-                    $value = $cf['defaults']['admin_desc'];
206
-                }
207
-                ?>
200
+			}else{
201
+				$value = '';
202
+				if (isset($field_info->admin_desc)) {
203
+					$value = esc_attr($field_info->admin_desc);
204
+				}elseif(isset($cf['defaults']['admin_desc']) && $cf['defaults']['admin_desc']){
205
+					$value = $cf['defaults']['admin_desc'];
206
+				}
207
+				?>
208 208
                 <li>
209 209
                     <label for="admin_desc" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Frontend description :', 'geodirectory'); ?>
210 210
                         <div class="gdcf-tooltip">
@@ -216,23 +216,23 @@  discard block
 block discarded – undo
216 216
                     </div>
217 217
                 </li>
218 218
                 <?php
219
-            }
219
+			}
220 220
 
221 221
 
222 222
 
223
-            // htmlvar_name
224
-            if(has_filter("geodir_cfa_htmlvar_name_{$field_type}")){
223
+			// htmlvar_name
224
+			if(has_filter("geodir_cfa_htmlvar_name_{$field_type}")){
225 225
 
226
-                echo apply_filters("geodir_cfa_htmlvar_name_{$field_type}",'',$result_str,$cf,$field_info);
226
+				echo apply_filters("geodir_cfa_htmlvar_name_{$field_type}",'',$result_str,$cf,$field_info);
227 227
 
228
-            }else{
229
-                $value = '';
230
-                if (isset($field_info->htmlvar_name)) {
231
-                    $value = esc_attr($field_info->htmlvar_name);
232
-                }elseif(isset($cf['defaults']['htmlvar_name']) && $cf['defaults']['htmlvar_name']){
233
-                    $value = $cf['defaults']['htmlvar_name'];
234
-                }
235
-                ?>
228
+			}else{
229
+				$value = '';
230
+				if (isset($field_info->htmlvar_name)) {
231
+					$value = esc_attr($field_info->htmlvar_name);
232
+				}elseif(isset($cf['defaults']['htmlvar_name']) && $cf['defaults']['htmlvar_name']){
233
+					$value = $cf['defaults']['htmlvar_name'];
234
+				}
235
+				?>
236 236
                 <li>
237 237
                     <label for="htmlvar_name" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('HTML variable name :', 'geodirectory');?>
238 238
                         <div class="gdcf-tooltip">
@@ -242,29 +242,29 @@  discard block
 block discarded – undo
242 242
                     <div class="gd-cf-input-wrap">
243 243
                         <input type="text" name="htmlvar_name" id="htmlvar_name" pattern="[a-zA-Z0-9]+" title="<?php _e('Must not contain spaces or special characters', 'geodirectory');?>"
244 244
                                value="<?php if ($value) {
245
-                                   echo preg_replace('/geodir_/', '', $value, 1);
246
-                               }?>" <?php if ($default) {
247
-                            echo 'readonly="readonly"';
248
-                        }?> />
245
+								   echo preg_replace('/geodir_/', '', $value, 1);
246
+							   }?>" <?php if ($default) {
247
+							echo 'readonly="readonly"';
248
+						}?> />
249 249
                     </div>
250 250
                 </li>
251 251
                 <?php
252
-            }
252
+			}
253 253
 
254 254
 
255
-            // is_active
256
-            if(has_filter("geodir_cfa_is_active_{$field_type}")){
255
+			// is_active
256
+			if(has_filter("geodir_cfa_is_active_{$field_type}")){
257 257
 
258
-                echo apply_filters("geodir_cfa_is_active_{$field_type}",'',$result_str,$cf,$field_info);
258
+				echo apply_filters("geodir_cfa_is_active_{$field_type}",'',$result_str,$cf,$field_info);
259 259
 
260
-            }else{
261
-                $value = '';
262
-                if (isset($field_info->is_active)) {
263
-                    $value = esc_attr($field_info->is_active);
264
-                }elseif(isset($cf['defaults']['is_active']) && $cf['defaults']['is_active']){
265
-                    $value = $cf['defaults']['is_active'];
266
-                }
267
-                ?>
260
+			}else{
261
+				$value = '';
262
+				if (isset($field_info->is_active)) {
263
+					$value = esc_attr($field_info->is_active);
264
+				}elseif(isset($cf['defaults']['is_active']) && $cf['defaults']['is_active']){
265
+					$value = $cf['defaults']['is_active'];
266
+				}
267
+				?>
268 268
                 <li <?php echo $field_display; ?>>
269 269
                     <label for="is_active" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Is active :', 'geodirectory'); ?>
270 270
                         <div class="gdcf-tooltip">
@@ -275,35 +275,35 @@  discard block
 block discarded – undo
275 275
 
276 276
                         <input type="radio" id="is_active_yes<?php echo $radio_id;?>" name="is_active" class="gdri-enabled"  value="1"
277 277
                             <?php if ($value == '1') {
278
-                                echo 'checked';
279
-                            } ?>/>
278
+								echo 'checked';
279
+							} ?>/>
280 280
                         <label for="is_active_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
281 281
 
282 282
                         <input type="radio" id="is_active_no<?php echo $radio_id;?>" name="is_active" class="gdri-disabled" value="0"
283 283
                             <?php if ($value == '0' || !$value) {
284
-                                echo 'checked';
285
-                            } ?>/>
284
+								echo 'checked';
285
+							} ?>/>
286 286
                         <label for="is_active_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
287 287
 
288 288
                     </div>
289 289
                 </li>
290 290
                 <?php
291
-            }
291
+			}
292 292
 
293 293
 
294
-            // for_admin_use
295
-            if(has_filter("geodir_cfa_for_admin_use_{$field_type}")){
294
+			// for_admin_use
295
+			if(has_filter("geodir_cfa_for_admin_use_{$field_type}")){
296 296
 
297
-                echo apply_filters("geodir_cfa_for_admin_use_{$field_type}",'',$result_str,$cf,$field_info);
297
+				echo apply_filters("geodir_cfa_for_admin_use_{$field_type}",'',$result_str,$cf,$field_info);
298 298
 
299
-            }else{
300
-                $value = '';
301
-                if (isset($field_info->for_admin_use)) {
302
-                    $value = esc_attr($field_info->for_admin_use);
303
-                }elseif(isset($cf['defaults']['for_admin_use']) && $cf['defaults']['for_admin_use']){
304
-                    $value = $cf['defaults']['for_admin_use'];
305
-                }
306
-                ?>
299
+			}else{
300
+				$value = '';
301
+				if (isset($field_info->for_admin_use)) {
302
+					$value = esc_attr($field_info->for_admin_use);
303
+				}elseif(isset($cf['defaults']['for_admin_use']) && $cf['defaults']['for_admin_use']){
304
+					$value = $cf['defaults']['for_admin_use'];
305
+				}
306
+				?>
307 307
                 <li>
308 308
                     <label for="for_admin_use" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('For admin use only? :', 'geodirectory'); ?>
309 309
                         <div class="gdcf-tooltip">
@@ -314,47 +314,47 @@  discard block
 block discarded – undo
314 314
 
315 315
                         <input type="radio" id="for_admin_use_yes<?php echo $radio_id;?>" name="for_admin_use" class="gdri-enabled"  value="1"
316 316
                             <?php if ($value == '1') {
317
-                                echo 'checked';
318
-                            } ?>/>
317
+								echo 'checked';
318
+							} ?>/>
319 319
                         <label for="for_admin_use_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
320 320
 
321 321
                         <input type="radio" id="for_admin_use_no<?php echo $radio_id;?>" name="for_admin_use" class="gdri-disabled" value="0"
322 322
                             <?php if ($value == '0' || !$value) {
323
-                                echo 'checked';
324
-                            } ?>/>
323
+								echo 'checked';
324
+							} ?>/>
325 325
                         <label for="for_admin_use_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
326 326
 
327 327
                     </div>
328 328
                 </li>
329 329
                 <?php
330
-            }
330
+			}
331 331
 
332 332
 
333
-            // default_value
334
-            if(has_filter("geodir_cfa_default_value_{$field_type}")){
333
+			// default_value
334
+			if(has_filter("geodir_cfa_default_value_{$field_type}")){
335 335
 
336
-                echo apply_filters("geodir_cfa_default_value_{$field_type}",'',$result_str,$cf,$field_info);
336
+				echo apply_filters("geodir_cfa_default_value_{$field_type}",'',$result_str,$cf,$field_info);
337 337
 
338
-            }else{
339
-                $value = '';
340
-                if (isset($field_info->default_value)) {
341
-                    $value = esc_attr($field_info->default_value);
342
-                }elseif(isset($cf['defaults']['default_value']) && $cf['defaults']['default_value']){
343
-                    $value = $cf['defaults']['default_value'];
344
-                }
345
-                ?>
338
+			}else{
339
+				$value = '';
340
+				if (isset($field_info->default_value)) {
341
+					$value = esc_attr($field_info->default_value);
342
+				}elseif(isset($cf['defaults']['default_value']) && $cf['defaults']['default_value']){
343
+					$value = $cf['defaults']['default_value'];
344
+				}
345
+				?>
346 346
                 <li>
347 347
                     <label for="default_value" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Default value :', 'geodirectory');?>
348 348
                         <div class="gdcf-tooltip">
349 349
                             <?php
350
-                            if ($field_type == 'checkbox') {
351
-                                _e('Should the checkbox be checked by default?', 'geodirectory');
352
-                            } else if ($field_type == 'email') {
353
-                                _e('A default value for the field, usually blank. Ex: [email protected]', 'geodirectory');
354
-                            } else {
355
-                                _e('A default value for the field, usually blank. (for "link" this will be used as the link text)', 'geodirectory');
356
-                            }
357
-                            ?>
350
+							if ($field_type == 'checkbox') {
351
+								_e('Should the checkbox be checked by default?', 'geodirectory');
352
+							} else if ($field_type == 'email') {
353
+								_e('A default value for the field, usually blank. Ex: [email protected]', 'geodirectory');
354
+							} else {
355
+								_e('A default value for the field, usually blank. (for "link" this will be used as the link text)', 'geodirectory');
356
+							}
357
+							?>
358 358
                         </div>
359 359
                     </label>
360 360
                     <div class="gd-cf-input-wrap">
@@ -371,22 +371,22 @@  discard block
 block discarded – undo
371 371
                     </div>
372 372
                 </li>
373 373
                 <?php
374
-            }
374
+			}
375 375
 
376 376
 
377
-            // show_in
378
-            if(has_filter("geodir_cfa_show_in_{$field_type}")){
377
+			// show_in
378
+			if(has_filter("geodir_cfa_show_in_{$field_type}")){
379 379
 
380
-                echo apply_filters("geodir_cfa_show_in_{$field_type}",'',$result_str,$cf,$field_info);
380
+				echo apply_filters("geodir_cfa_show_in_{$field_type}",'',$result_str,$cf,$field_info);
381 381
 
382
-            }else{
383
-                $value = '';
384
-                if (isset($field_info->show_in)) {
385
-                    $value = esc_attr($field_info->show_in);
386
-                }elseif(isset($cf['defaults']['show_in']) && $cf['defaults']['show_in']){
387
-                    $value = esc_attr($cf['defaults']['show_in']);
388
-                }
389
-                ?>
382
+			}else{
383
+				$value = '';
384
+				if (isset($field_info->show_in)) {
385
+					$value = esc_attr($field_info->show_in);
386
+				}elseif(isset($cf['defaults']['show_in']) && $cf['defaults']['show_in']){
387
+					$value = esc_attr($cf['defaults']['show_in']);
388
+				}
389
+				?>
390 390
                 <li>
391 391
                     <label for="show_in" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Show in what locations?:', 'geodirectory'); ?>
392 392
                         <div class="gdcf-tooltip">
@@ -397,42 +397,42 @@  discard block
 block discarded – undo
397 397
 
398 398
                         <?php
399 399
 
400
-                        /*
400
+						/*
401 401
 						 * We wrap the key values in [] so we can search the DB easier with a LIKE query.
402 402
 						 */
403
-                        $show_in_locations = array(
404
-                            "[detail]" => __("Details page sidebar", 'geodirectory'),
405
-                            "[moreinfo]" => __("More info tab", 'geodirectory'),
406
-                            "[listing]" => __("Listings page", 'geodirectory'),
407
-                            "[owntab]" => __("Details page own tab", 'geodirectory'),
408
-                            "[mapbubble]" => __("Map bubble", 'geodirectory'),
409
-                        );
410
-
411
-                        /**
412
-                         * Filter the locations array for where to display custom fields.
413
-                         *
414
-                         * @since 1.6.6
415
-                         * @param array $show_in_locations The array of locations and descriptions.
416
-                         * @param object $field_info The field being displayed info.
417
-                         * @param string $field_info The type of field.
418
-                         */
419
-                        $show_in_locations = apply_filters('geodir_show_in_locations',$show_in_locations,$field_info,$field_type);
403
+						$show_in_locations = array(
404
+							"[detail]" => __("Details page sidebar", 'geodirectory'),
405
+							"[moreinfo]" => __("More info tab", 'geodirectory'),
406
+							"[listing]" => __("Listings page", 'geodirectory'),
407
+							"[owntab]" => __("Details page own tab", 'geodirectory'),
408
+							"[mapbubble]" => __("Map bubble", 'geodirectory'),
409
+						);
410
+
411
+						/**
412
+						 * Filter the locations array for where to display custom fields.
413
+						 *
414
+						 * @since 1.6.6
415
+						 * @param array $show_in_locations The array of locations and descriptions.
416
+						 * @param object $field_info The field being displayed info.
417
+						 * @param string $field_info The type of field.
418
+						 */
419
+						$show_in_locations = apply_filters('geodir_show_in_locations',$show_in_locations,$field_info,$field_type);
420 420
 
421 421
 
422
-                        // remove some locations for some field types
422
+						// remove some locations for some field types
423 423
 
424
-                        // don't show new tab option for some types
424
+						// don't show new tab option for some types
425 425
 
426
-                        if (in_array($field_type, array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file'))) {
427
-                        }else{
428
-                            unset($show_in_locations['[owntab]']);
429
-                        }
426
+						if (in_array($field_type, array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file'))) {
427
+						}else{
428
+							unset($show_in_locations['[owntab]']);
429
+						}
430 430
 
431
-                        if(!$display_on_listing){
432
-                            unset($show_in_locations['[listings]']);
433
-                        }
431
+						if(!$display_on_listing){
432
+							unset($show_in_locations['[listings]']);
433
+						}
434 434
 
435
-                        ?>
435
+						?>
436 436
 
437 437
                         <select multiple="multiple" name="show_in[]"
438 438
                                 id="show_in"
@@ -442,38 +442,38 @@  discard block
 block discarded – undo
442 442
                                 option-ajaxchosen="false">
443 443
                             <?php
444 444
 
445
-                            $show_in_values = explode(',',$value);
445
+							$show_in_values = explode(',',$value);
446 446
 
447
-                            foreach( $show_in_locations as $key => $val){
448
-                                $selected = '';
447
+							foreach( $show_in_locations as $key => $val){
448
+								$selected = '';
449 449
 
450
-                                if(is_array($show_in_values) && in_array($key,$show_in_values ) ){
451
-                                    $selected = 'selected';
452
-                                }
450
+								if(is_array($show_in_values) && in_array($key,$show_in_values ) ){
451
+									$selected = 'selected';
452
+								}
453 453
 
454
-                                ?>
454
+								?>
455 455
                                 <option  value="<?php echo $key;?>" <?php echo $selected;?>><?php echo $val;?></option>
456 456
                                 <?php
457
-                            }
458
-                            ?>
457
+							}
458
+							?>
459 459
                         </select>
460 460
                     </div>
461 461
                 </li>
462 462
                 <?php
463
-            }
463
+			}
464 464
 
465 465
 
466
-            // advanced_editor
467
-            if(has_filter("geodir_cfa_advanced_editor_{$field_type}")){
466
+			// advanced_editor
467
+			if(has_filter("geodir_cfa_advanced_editor_{$field_type}")){
468 468
 
469
-                echo apply_filters("geodir_cfa_advanced_editor_{$field_type}",'',$result_str,$cf,$field_info);
469
+				echo apply_filters("geodir_cfa_advanced_editor_{$field_type}",'',$result_str,$cf,$field_info);
470 470
 
471
-            }
471
+			}
472 472
 
473 473
 
474 474
 
475 475
 
476
-            ?>
476
+			?>
477 477
 
478 478
 
479 479
             <?php // @todo this does not seem to be used for anything, it can be removed or replaced ?>
@@ -486,38 +486,38 @@  discard block
 block discarded – undo
486 486
 
487 487
             <?php
488 488
 
489
-            $pricearr = array();
490
-            if (isset($field_info->packages) && $field_info->packages != '') {
491
-                $pricearr = explode(',', trim($field_info->packages, ','));
492
-            } else {
493
-                $package_info = array();
489
+			$pricearr = array();
490
+			if (isset($field_info->packages) && $field_info->packages != '') {
491
+				$pricearr = explode(',', trim($field_info->packages, ','));
492
+			} else {
493
+				$package_info = array();
494 494
 
495
-                $package_info = geodir_post_package_info($package_info, '', $post_type);
496
-                $pricearr[] = $package_info->pid;
497
-            }
495
+				$package_info = geodir_post_package_info($package_info, '', $post_type);
496
+				$pricearr[] = $package_info->pid;
497
+			}
498 498
 
499
-            ob_start()
500
-            ?>
499
+			ob_start()
500
+			?>
501 501
 
502 502
             <select style="display:none" name="show_on_pkg[]" id="show_on_pkg" multiple="multiple">
503 503
                 <?php
504
-                if (!empty($pricearr)) {
505
-                    foreach ($pricearr as $val) {
506
-                        ?>
504
+				if (!empty($pricearr)) {
505
+					foreach ($pricearr as $val) {
506
+						?>
507 507
                         <option selected="selected" value="<?php echo esc_attr($val); ?>" ><?php echo $val; ?></option><?php
508
-                    }
509
-                }
510
-                ?>
508
+					}
509
+				}
510
+				?>
511 511
             </select>
512 512
 
513 513
             <?php
514
-            $html = ob_get_clean();
514
+			$html = ob_get_clean();
515 515
 
516 516
 			/**
517 517
 			 * Filter the price packages list.
518 518
 			 *
519 519
 			 * Filter the price packages list in custom field form in admin
520
-             * custom fields settings.
520
+			 * custom fields settings.
521 521
 			 *
522 522
 			 * @since 1.0.0
523 523
 			 *
@@ -526,25 +526,25 @@  discard block
 block discarded – undo
526 526
 			 */
527 527
 			echo $html = apply_filters('geodir_packages_list_on_custom_fields', $html, $field_info);
528 528
 
529
-            ?>
529
+			?>
530 530
 
531 531
 
532 532
 
533 533
             <?php
534 534
 
535
-            // is_required
536
-            if(has_filter("geodir_cfa_is_required_{$field_type}")){
535
+			// is_required
536
+			if(has_filter("geodir_cfa_is_required_{$field_type}")){
537 537
 
538
-                echo apply_filters("geodir_cfa_is_required_{$field_type}",'',$result_str,$cf,$field_info);
538
+				echo apply_filters("geodir_cfa_is_required_{$field_type}",'',$result_str,$cf,$field_info);
539 539
 
540
-            }else{
541
-                $value = '';
542
-                if (isset($field_info->is_required)) {
543
-                    $value = esc_attr($field_info->is_required);
544
-                }elseif(isset($cf['defaults']['is_required']) && $cf['defaults']['is_required']){
545
-                    $value = $cf['defaults']['is_required'];
546
-                }
547
-                ?>
540
+			}else{
541
+				$value = '';
542
+				if (isset($field_info->is_required)) {
543
+					$value = esc_attr($field_info->is_required);
544
+				}elseif(isset($cf['defaults']['is_required']) && $cf['defaults']['is_required']){
545
+					$value = $cf['defaults']['is_required'];
546
+				}
547
+				?>
548 548
                 <li>
549 549
                     <label for="is_required" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Is required :', 'geodirectory'); ?>
550 550
                         <div class="gdcf-tooltip">
@@ -556,14 +556,14 @@  discard block
 block discarded – undo
556 556
 
557 557
                         <input type="radio" id="is_required_yes<?php echo $radio_id;?>" name="is_required" class="gdri-enabled"  value="1"
558 558
                             <?php if ($value == '1') {
559
-                                echo 'checked';
560
-                            } ?>/>
559
+								echo 'checked';
560
+							} ?>/>
561 561
                         <label onclick="show_hide_radio(this,'show','cf-is-required-msg');" for="is_required_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
562 562
 
563 563
                         <input type="radio" id="is_required_no<?php echo $radio_id;?>" name="is_required" class="gdri-disabled" value="0"
564 564
                             <?php if ($value == '0' || !$value) {
565
-                                echo 'checked';
566
-                            } ?>/>
565
+								echo 'checked';
566
+							} ?>/>
567 567
                         <label onclick="show_hide_radio(this,'hide','cf-is-required-msg');" for="is_required_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
568 568
 
569 569
                     </div>
@@ -571,21 +571,21 @@  discard block
 block discarded – undo
571 571
                 </li>
572 572
 
573 573
                 <?php
574
-            }
574
+			}
575 575
 
576
-            // required_msg
577
-            if(has_filter("geodir_cfa_required_msg_{$field_type}")){
576
+			// required_msg
577
+			if(has_filter("geodir_cfa_required_msg_{$field_type}")){
578 578
 
579
-                echo apply_filters("geodir_cfa_required_msg_{$field_type}",'',$result_str,$cf,$field_info);
579
+				echo apply_filters("geodir_cfa_required_msg_{$field_type}",'',$result_str,$cf,$field_info);
580 580
 
581
-            }else{
582
-                $value = '';
583
-                if (isset($field_info->required_msg)) {
584
-                    $value = esc_attr($field_info->required_msg);
585
-                }elseif(isset($cf['defaults']['required_msg']) && $cf['defaults']['required_msg']){
586
-                    $value = $cf['defaults']['required_msg'];
587
-                }
588
-                ?>
581
+			}else{
582
+				$value = '';
583
+				if (isset($field_info->required_msg)) {
584
+					$value = esc_attr($field_info->required_msg);
585
+				}elseif(isset($cf['defaults']['required_msg']) && $cf['defaults']['required_msg']){
586
+					$value = $cf['defaults']['required_msg'];
587
+				}
588
+				?>
589 589
                 <li class="cf-is-required-msg" <?php if ((isset($field_info->is_required) && $field_info->is_required == '0') || !isset($field_info->is_required)) {echo "style='display:none;'";}?>>
590 590
                     <label for="required_msg" class="gd-cf-tooltip-wrap">
591 591
                         <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Required message:', 'geodirectory'); ?>
@@ -599,38 +599,38 @@  discard block
 block discarded – undo
599 599
                     </div>
600 600
                 </li>
601 601
                 <?php
602
-            }
602
+			}
603 603
 
604 604
 
605
-            // required_msg
606
-            if(has_filter("geodir_cfa_validation_pattern_{$field_type}")){
605
+			// required_msg
606
+			if(has_filter("geodir_cfa_validation_pattern_{$field_type}")){
607 607
 
608
-                echo apply_filters("geodir_cfa_validation_pattern_{$field_type}",'',$result_str,$cf,$field_info);
608
+				echo apply_filters("geodir_cfa_validation_pattern_{$field_type}",'',$result_str,$cf,$field_info);
609 609
 
610
-            }
610
+			}
611 611
 
612 612
 
613
-            // extra_fields
614
-            if(has_filter("geodir_cfa_extra_fields_{$field_type}")){
613
+			// extra_fields
614
+			if(has_filter("geodir_cfa_extra_fields_{$field_type}")){
615 615
 
616
-                echo apply_filters("geodir_cfa_extra_fields_{$field_type}",'',$result_str,$cf,$field_info);
616
+				echo apply_filters("geodir_cfa_extra_fields_{$field_type}",'',$result_str,$cf,$field_info);
617 617
 
618
-            }
618
+			}
619 619
 
620 620
 
621
-            // field_icon
622
-            if(has_filter("geodir_cfa_field_icon_{$field_type}")){
621
+			// field_icon
622
+			if(has_filter("geodir_cfa_field_icon_{$field_type}")){
623 623
 
624
-                echo apply_filters("geodir_cfa_field_icon_{$field_type}",'',$result_str,$cf,$field_info);
624
+				echo apply_filters("geodir_cfa_field_icon_{$field_type}",'',$result_str,$cf,$field_info);
625 625
 
626
-            }else{
627
-                $value = '';
628
-                if (isset($field_info->field_icon)) {
629
-                    $value = esc_attr($field_info->field_icon);
630
-                }elseif(isset($cf['defaults']['field_icon']) && $cf['defaults']['field_icon']){
631
-                    $value = $cf['defaults']['field_icon'];
632
-                }
633
-                ?>
626
+			}else{
627
+				$value = '';
628
+				if (isset($field_info->field_icon)) {
629
+					$value = esc_attr($field_info->field_icon);
630
+				}elseif(isset($cf['defaults']['field_icon']) && $cf['defaults']['field_icon']){
631
+					$value = $cf['defaults']['field_icon'];
632
+				}
633
+				?>
634 634
                 <li>
635 635
                     <h3><?php echo __('Custom css', 'geodirectory'); ?></h3>
636 636
 
@@ -648,22 +648,22 @@  discard block
 block discarded – undo
648 648
 
649 649
                 </li>
650 650
                 <?php
651
-            }
651
+			}
652 652
 
653 653
 
654
-            // css_class
655
-            if(has_filter("geodir_cfa_css_class_{$field_type}")){
654
+			// css_class
655
+			if(has_filter("geodir_cfa_css_class_{$field_type}")){
656 656
 
657
-                echo apply_filters("geodir_cfa_css_class_{$field_type}",'',$result_str,$cf,$field_info);
657
+				echo apply_filters("geodir_cfa_css_class_{$field_type}",'',$result_str,$cf,$field_info);
658 658
 
659
-            }else{
660
-                $value = '';
661
-                if (isset($field_info->css_class)) {
662
-                    $value = esc_attr($field_info->css_class);
663
-                }elseif(isset($cf['defaults']['css_class']) && $cf['defaults']['css_class']){
664
-                    $value = $cf['defaults']['css_class'];
665
-                }
666
-                ?>
659
+			}else{
660
+				$value = '';
661
+				if (isset($field_info->css_class)) {
662
+					$value = esc_attr($field_info->css_class);
663
+				}elseif(isset($cf['defaults']['css_class']) && $cf['defaults']['css_class']){
664
+					$value = $cf['defaults']['css_class'];
665
+				}
666
+				?>
667 667
                 <li>
668 668
 
669 669
                     <label for="css_class" class="gd-cf-tooltip-wrap">
@@ -675,47 +675,47 @@  discard block
 block discarded – undo
675 675
                     <div class="gd-cf-input-wrap">
676 676
                         <input type="text" name="css_class" id="css_class"
677 677
                                value="<?php if (isset($field_info->css_class)) {
678
-                                   echo esc_attr($field_info->css_class);
679
-                               }?>"/>
678
+								   echo esc_attr($field_info->css_class);
679
+							   }?>"/>
680 680
                     </div>
681 681
                 </li>
682 682
                 <?php
683
-            }
683
+			}
684 684
 
685 685
 
686
-            // cat_sort
687
-            if(has_filter("geodir_cfa_cat_sort_{$field_type}")){
686
+			// cat_sort
687
+			if(has_filter("geodir_cfa_cat_sort_{$field_type}")){
688 688
 
689
-                echo apply_filters("geodir_cfa_cat_sort_{$field_type}",'',$result_str,$cf,$field_info);
689
+				echo apply_filters("geodir_cfa_cat_sort_{$field_type}",'',$result_str,$cf,$field_info);
690 690
 
691
-            }else{
692
-                $value = '';
693
-                $hide_cat_sort  ='';
694
-                if (isset($field_info->cat_sort)) {
695
-                    $value = esc_attr($field_info->cat_sort);
696
-                }elseif(isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']){
697
-                    $value = $cf['defaults']['cat_sort'];
698
-                    $hide_cat_sort = ($value===false) ? "style='display:none;'" : '';
699
-                }
691
+			}else{
692
+				$value = '';
693
+				$hide_cat_sort  ='';
694
+				if (isset($field_info->cat_sort)) {
695
+					$value = esc_attr($field_info->cat_sort);
696
+				}elseif(isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']){
697
+					$value = $cf['defaults']['cat_sort'];
698
+					$hide_cat_sort = ($value===false) ? "style='display:none;'" : '';
699
+				}
700 700
 
701
-                $hide_cat_sort = (isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']===false) ? "style='display:none;'" : '';
702
-                ?>
701
+				$hide_cat_sort = (isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']===false) ? "style='display:none;'" : '';
702
+				?>
703 703
                 <li <?php echo $hide_cat_sort ;?>>
704 704
                     <h3><?php
705
-                        /**
706
-                         * Filter the section title.
707
-                         *
708
-                         * Filter the section title in custom field form in admin
709
-                         * custom fields settings.
710
-                         *
711
-                         * @since 1.0.0
712
-                         *
713
-                         * @param string $title Title of the section.
714
-                         * @param string $field_type Current field type.
715
-                         */
716
-                        echo apply_filters('geodir_advance_custom_fields_heading', __('Posts sort options', 'geodirectory'), $field_type);
717
-
718
-                        ?></h3>
705
+						/**
706
+						 * Filter the section title.
707
+						 *
708
+						 * Filter the section title in custom field form in admin
709
+						 * custom fields settings.
710
+						 *
711
+						 * @since 1.0.0
712
+						 *
713
+						 * @param string $title Title of the section.
714
+						 * @param string $field_type Current field type.
715
+						 */
716
+						echo apply_filters('geodir_advance_custom_fields_heading', __('Posts sort options', 'geodirectory'), $field_type);
717
+
718
+						?></h3>
719 719
                     <label for="cat_sort" class="gd-cf-tooltip-wrap">
720 720
                         <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Include this field in sorting options :', 'geodirectory'); ?>
721 721
                         <div class="gdcf-tooltip">
@@ -727,42 +727,42 @@  discard block
 block discarded – undo
727 727
 
728 728
                         <input type="radio" id="cat_sort_yes<?php echo $radio_id;?>" name="cat_sort" class="gdri-enabled"  value="1"
729 729
                             <?php if ($value == '1') {
730
-                                echo 'checked';
731
-                            } ?>/>
730
+								echo 'checked';
731
+							} ?>/>
732 732
                         <label for="cat_sort_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
733 733
 
734 734
                         <input type="radio" id="cat_sort_no<?php echo $radio_id;?>" name="cat_sort" class="gdri-disabled" value="0"
735 735
                             <?php if (!$value) {
736
-                                echo 'checked';
737
-                            } ?>/>
736
+								echo 'checked';
737
+							} ?>/>
738 738
                         <label for="cat_sort_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
739 739
 
740 740
                     </div>
741 741
                 </li>
742 742
                 <?php
743
-            }
744
-
745
-
746
-
747
-            switch ($field_type):
748
-                case 'html':
749
-                case 'file':
750
-                case 'url':
751
-                case 'fieldset':
752
-                    break;
753
-                default:
754
-
755
-                    /**
756
-                     * Called at the end of the advanced custom fields settings page loop.
757
-                     *
758
-                     * Can be used to add or deal with different settings types.
759
-                     *
760
-                     * @since 1.0.0
761
-                     * @since 1.6.6 $cf param added.
762
-                     * @param object $field_info The current fields info.
763
-                     * @param array $cf The custom field settings
764
-                     */
765
-                    do_action('geodir_advance_custom_fields', $field_info,$cf);?>
743
+			}
744
+
745
+
746
+
747
+			switch ($field_type):
748
+				case 'html':
749
+				case 'file':
750
+				case 'url':
751
+				case 'fieldset':
752
+					break;
753
+				default:
754
+
755
+					/**
756
+					 * Called at the end of the advanced custom fields settings page loop.
757
+					 *
758
+					 * Can be used to add or deal with different settings types.
759
+					 *
760
+					 * @since 1.0.0
761
+					 * @since 1.6.6 $cf param added.
762
+					 * @param object $field_info The current fields info.
763
+					 * @param array $cf The custom field settings
764
+					 */
765
+					do_action('geodir_advance_custom_fields', $field_info,$cf);?>
766 766
 
767 767
 
768 768
                 <?php endswitch; ?>
Please login to merge, or discard this patch.
Spacing   +118 added lines, -118 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 
28 28
 $field_info = stripslashes_deep($field_info); // strip slashes from labels
29 29
 
30
-$nonce = wp_create_nonce('custom_fields_' . $result_str);
30
+$nonce = wp_create_nonce('custom_fields_'.$result_str);
31 31
 
32 32
 $field_admin_title = '';
33 33
 if (isset($field_info->admin_title))
@@ -52,9 +52,9 @@  discard block
 block discarded – undo
52 52
 
53 53
 if (isset($cf['icon']) && strpos($cf['icon'], 'fa fa-') !== false) {
54 54
     $field_icon = '<i class="'.$cf['icon'].'" aria-hidden="true"></i>';
55
-}elseif(isset($cf['icon']) && $cf['icon']){
55
+}elseif (isset($cf['icon']) && $cf['icon']) {
56 56
     $field_icon = '<b style="background-image: url("'.$cf['icon'].'")"></b>';
57
-}else{
57
+} else {
58 58
     $field_icon = '<i class="fa fa-cog" aria-hidden="true"></i>';
59 59
 }
60 60
 
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
          ondblclick="show_hide('field_frm<?php echo $result_str; ?>')">
66 66
         <?php
67 67
 
68
-        $nonce = wp_create_nonce('custom_fields_' . $result_str);
68
+        $nonce = wp_create_nonce('custom_fields_'.$result_str);
69 69
         ?>
70 70
 
71 71
         <?php if ($default): ?>
@@ -80,12 +80,12 @@  discard block
 block discarded – undo
80 80
             <i class="fa fa-long-arrow-left " aria-hidden="true"></i>
81 81
             <i class="fa fa-long-arrow-right " aria-hidden="true"></i>
82 82
             <b style="cursor:pointer;"
83
-               onclick="show_hide('field_frm<?php echo $result_str;?>')"><?php echo geodir_ucwords(__('Fieldset:', 'geodirectory') . ' ' . $field_admin_title);?></b>
83
+               onclick="show_hide('field_frm<?php echo $result_str; ?>')"><?php echo geodir_ucwords(__('Fieldset:', 'geodirectory').' '.$field_admin_title); ?></b>
84 84
         <?php
85 85
         } else {echo $field_icon;
86 86
             ?>
87 87
             <b style="cursor:pointer;"
88
-               onclick="show_hide('field_frm<?php echo $result_str;?>')"><?php echo geodir_ucwords(' ' . $field_admin_title . ' (' . $field_type . ')');?></b>
88
+               onclick="show_hide('field_frm<?php echo $result_str; ?>')"><?php echo geodir_ucwords(' '.$field_admin_title.' ('.$field_type.')'); ?></b>
89 89
         <?php
90 90
         }
91 91
         ?>
@@ -108,43 +108,43 @@  discard block
 block discarded – undo
108 108
         } ?>"/>
109 109
         <input type="hidden" name="is_active" id="is_active" value="1"/>
110 110
 
111
-        <input type="hidden" name="is_default" value="<?php echo $field_info->is_default;?>" /><?php // show in sidebar value?>
112
-        <input type="hidden" name="show_on_listing" value="<?php echo $field_info->show_on_listing;?>" />
113
-        <input type="hidden" name="show_on_detail" value="<?php echo $field_info->show_on_listing;?>" />
114
-        <input type="hidden" name="show_as_tab" value="<?php echo $field_info->show_as_tab;?>" />
111
+        <input type="hidden" name="is_default" value="<?php echo $field_info->is_default; ?>" /><?php // show in sidebar value?>
112
+        <input type="hidden" name="show_on_listing" value="<?php echo $field_info->show_on_listing; ?>" />
113
+        <input type="hidden" name="show_on_detail" value="<?php echo $field_info->show_on_listing; ?>" />
114
+        <input type="hidden" name="show_as_tab" value="<?php echo $field_info->show_as_tab; ?>" />
115 115
 
116 116
         <ul class="widefat post fixed" border="0" style="width:100%;">
117 117
 
118 118
             <?php
119 119
 
120 120
             // data_type
121
-            if(has_filter("geodir_cfa_data_type_{$field_type}")){
121
+            if (has_filter("geodir_cfa_data_type_{$field_type}")) {
122 122
 
123
-                echo apply_filters("geodir_cfa_data_type_{$field_type}",'',$result_str,$cf,$field_info);
123
+                echo apply_filters("geodir_cfa_data_type_{$field_type}", '', $result_str, $cf, $field_info);
124 124
 
125
-            }else{
125
+            } else {
126 126
                 $value = '';
127 127
                 if (isset($field_info->data_type)) {
128 128
                     $value = esc_attr($field_info->data_type);
129
-                }elseif(isset($cf['defaults']['data_type']) && $cf['defaults']['data_type']){
129
+                }elseif (isset($cf['defaults']['data_type']) && $cf['defaults']['data_type']) {
130 130
                     $value = $cf['defaults']['data_type'];
131 131
                 }
132 132
                 ?>
133
-                <input type="hidden" name="data_type" id="data_type" value="<?php echo $value;?>"/>
133
+                <input type="hidden" name="data_type" id="data_type" value="<?php echo $value; ?>"/>
134 134
             <?php
135 135
             }
136 136
 
137 137
 
138 138
             // admin_title
139
-            if(has_filter("geodir_cfa_admin_title_{$field_type}")){
139
+            if (has_filter("geodir_cfa_admin_title_{$field_type}")) {
140 140
 
141
-                echo apply_filters("geodir_cfa_admin_title_{$field_type}",'',$result_str,$cf,$field_info);
141
+                echo apply_filters("geodir_cfa_admin_title_{$field_type}", '', $result_str, $cf, $field_info);
142 142
 
143
-            }else{
143
+            } else {
144 144
                 $value = '';
145 145
                 if (isset($field_info->admin_title)) {
146 146
                     $value = esc_attr($field_info->admin_title);
147
-                }elseif(isset($cf['defaults']['admin_title']) && $cf['defaults']['admin_title']){
147
+                }elseif (isset($cf['defaults']['admin_title']) && $cf['defaults']['admin_title']) {
148 148
                     $value = $cf['defaults']['admin_title'];
149 149
                 }
150 150
                 ?>
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
                     </label>
158 158
                     <div class="gd-cf-input-wrap">
159 159
                         <input type="text" name="admin_title" id="admin_title"
160
-                               value="<?php echo $value;?>"/>
160
+                               value="<?php echo $value; ?>"/>
161 161
                     </div>
162 162
                 </li>
163 163
                 <?php
@@ -165,15 +165,15 @@  discard block
 block discarded – undo
165 165
 
166 166
 
167 167
             // site_title
168
-            if(has_filter("geodir_cfa_site_title_{$field_type}")){
168
+            if (has_filter("geodir_cfa_site_title_{$field_type}")) {
169 169
 
170
-                echo apply_filters("geodir_cfa_site_title_{$field_type}",'',$result_str,$cf,$field_info);
170
+                echo apply_filters("geodir_cfa_site_title_{$field_type}", '', $result_str, $cf, $field_info);
171 171
 
172
-            }else{
172
+            } else {
173 173
                 $value = '';
174 174
                 if (isset($field_info->site_title)) {
175 175
                     $value = esc_attr($field_info->site_title);
176
-                }elseif(isset($cf['defaults']['site_title']) && $cf['defaults']['site_title']){
176
+                }elseif (isset($cf['defaults']['site_title']) && $cf['defaults']['site_title']) {
177 177
                     $value = $cf['defaults']['site_title'];
178 178
                 }
179 179
                 ?>
@@ -193,15 +193,15 @@  discard block
 block discarded – undo
193 193
 
194 194
 
195 195
             // admin_desc
196
-            if(has_filter("geodir_cfa_admin_desc_{$field_type}")){
196
+            if (has_filter("geodir_cfa_admin_desc_{$field_type}")) {
197 197
 
198
-                echo apply_filters("geodir_cfa_admin_desc_{$field_type}",'',$result_str,$cf,$field_info);
198
+                echo apply_filters("geodir_cfa_admin_desc_{$field_type}", '', $result_str, $cf, $field_info);
199 199
 
200
-            }else{
200
+            } else {
201 201
                 $value = '';
202 202
                 if (isset($field_info->admin_desc)) {
203 203
                     $value = esc_attr($field_info->admin_desc);
204
-                }elseif(isset($cf['defaults']['admin_desc']) && $cf['defaults']['admin_desc']){
204
+                }elseif (isset($cf['defaults']['admin_desc']) && $cf['defaults']['admin_desc']) {
205 205
                     $value = $cf['defaults']['admin_desc'];
206 206
                 }
207 207
                 ?>
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
                         </div>
213 213
                     </label>
214 214
                     <div class="gd-cf-input-wrap">
215
-                        <input type="text" name="admin_desc" id="admin_desc" value="<?php echo $value;?>"/>
215
+                        <input type="text" name="admin_desc" id="admin_desc" value="<?php echo $value; ?>"/>
216 216
                     </div>
217 217
                 </li>
218 218
                 <?php
@@ -221,26 +221,26 @@  discard block
 block discarded – undo
221 221
 
222 222
 
223 223
             // htmlvar_name
224
-            if(has_filter("geodir_cfa_htmlvar_name_{$field_type}")){
224
+            if (has_filter("geodir_cfa_htmlvar_name_{$field_type}")) {
225 225
 
226
-                echo apply_filters("geodir_cfa_htmlvar_name_{$field_type}",'',$result_str,$cf,$field_info);
226
+                echo apply_filters("geodir_cfa_htmlvar_name_{$field_type}", '', $result_str, $cf, $field_info);
227 227
 
228
-            }else{
228
+            } else {
229 229
                 $value = '';
230 230
                 if (isset($field_info->htmlvar_name)) {
231 231
                     $value = esc_attr($field_info->htmlvar_name);
232
-                }elseif(isset($cf['defaults']['htmlvar_name']) && $cf['defaults']['htmlvar_name']){
232
+                }elseif (isset($cf['defaults']['htmlvar_name']) && $cf['defaults']['htmlvar_name']) {
233 233
                     $value = $cf['defaults']['htmlvar_name'];
234 234
                 }
235 235
                 ?>
236 236
                 <li>
237
-                    <label for="htmlvar_name" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('HTML variable name :', 'geodirectory');?>
237
+                    <label for="htmlvar_name" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('HTML variable name :', 'geodirectory'); ?>
238 238
                         <div class="gdcf-tooltip">
239 239
                             <?php _e('This is a unique identifier used in the HTML, it MUST NOT contain spaces or special characters.', 'geodirectory'); ?>
240 240
                         </div>
241 241
                     </label>
242 242
                     <div class="gd-cf-input-wrap">
243
-                        <input type="text" name="htmlvar_name" id="htmlvar_name" pattern="[a-zA-Z0-9]+" title="<?php _e('Must not contain spaces or special characters', 'geodirectory');?>"
243
+                        <input type="text" name="htmlvar_name" id="htmlvar_name" pattern="[a-zA-Z0-9]+" title="<?php _e('Must not contain spaces or special characters', 'geodirectory'); ?>"
244 244
                                value="<?php if ($value) {
245 245
                                    echo preg_replace('/geodir_/', '', $value, 1);
246 246
                                }?>" <?php if ($default) {
@@ -253,15 +253,15 @@  discard block
 block discarded – undo
253 253
 
254 254
 
255 255
             // is_active
256
-            if(has_filter("geodir_cfa_is_active_{$field_type}")){
256
+            if (has_filter("geodir_cfa_is_active_{$field_type}")) {
257 257
 
258
-                echo apply_filters("geodir_cfa_is_active_{$field_type}",'',$result_str,$cf,$field_info);
258
+                echo apply_filters("geodir_cfa_is_active_{$field_type}", '', $result_str, $cf, $field_info);
259 259
 
260
-            }else{
260
+            } else {
261 261
                 $value = '';
262 262
                 if (isset($field_info->is_active)) {
263 263
                     $value = esc_attr($field_info->is_active);
264
-                }elseif(isset($cf['defaults']['is_active']) && $cf['defaults']['is_active']){
264
+                }elseif (isset($cf['defaults']['is_active']) && $cf['defaults']['is_active']) {
265 265
                     $value = $cf['defaults']['is_active'];
266 266
                 }
267 267
                 ?>
@@ -273,17 +273,17 @@  discard block
 block discarded – undo
273 273
                     </label>
274 274
                     <div class="gd-cf-input-wrap gd-switch">
275 275
 
276
-                        <input type="radio" id="is_active_yes<?php echo $radio_id;?>" name="is_active" class="gdri-enabled"  value="1"
276
+                        <input type="radio" id="is_active_yes<?php echo $radio_id; ?>" name="is_active" class="gdri-enabled"  value="1"
277 277
                             <?php if ($value == '1') {
278 278
                                 echo 'checked';
279 279
                             } ?>/>
280
-                        <label for="is_active_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
280
+                        <label for="is_active_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
281 281
 
282
-                        <input type="radio" id="is_active_no<?php echo $radio_id;?>" name="is_active" class="gdri-disabled" value="0"
282
+                        <input type="radio" id="is_active_no<?php echo $radio_id; ?>" name="is_active" class="gdri-disabled" value="0"
283 283
                             <?php if ($value == '0' || !$value) {
284 284
                                 echo 'checked';
285 285
                             } ?>/>
286
-                        <label for="is_active_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
286
+                        <label for="is_active_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
287 287
 
288 288
                     </div>
289 289
                 </li>
@@ -292,15 +292,15 @@  discard block
 block discarded – undo
292 292
 
293 293
 
294 294
             // for_admin_use
295
-            if(has_filter("geodir_cfa_for_admin_use_{$field_type}")){
295
+            if (has_filter("geodir_cfa_for_admin_use_{$field_type}")) {
296 296
 
297
-                echo apply_filters("geodir_cfa_for_admin_use_{$field_type}",'',$result_str,$cf,$field_info);
297
+                echo apply_filters("geodir_cfa_for_admin_use_{$field_type}", '', $result_str, $cf, $field_info);
298 298
 
299
-            }else{
299
+            } else {
300 300
                 $value = '';
301 301
                 if (isset($field_info->for_admin_use)) {
302 302
                     $value = esc_attr($field_info->for_admin_use);
303
-                }elseif(isset($cf['defaults']['for_admin_use']) && $cf['defaults']['for_admin_use']){
303
+                }elseif (isset($cf['defaults']['for_admin_use']) && $cf['defaults']['for_admin_use']) {
304 304
                     $value = $cf['defaults']['for_admin_use'];
305 305
                 }
306 306
                 ?>
@@ -312,17 +312,17 @@  discard block
 block discarded – undo
312 312
                     </label>
313 313
                     <div class="gd-cf-input-wrap gd-switch">
314 314
 
315
-                        <input type="radio" id="for_admin_use_yes<?php echo $radio_id;?>" name="for_admin_use" class="gdri-enabled"  value="1"
315
+                        <input type="radio" id="for_admin_use_yes<?php echo $radio_id; ?>" name="for_admin_use" class="gdri-enabled"  value="1"
316 316
                             <?php if ($value == '1') {
317 317
                                 echo 'checked';
318 318
                             } ?>/>
319
-                        <label for="for_admin_use_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
319
+                        <label for="for_admin_use_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
320 320
 
321
-                        <input type="radio" id="for_admin_use_no<?php echo $radio_id;?>" name="for_admin_use" class="gdri-disabled" value="0"
321
+                        <input type="radio" id="for_admin_use_no<?php echo $radio_id; ?>" name="for_admin_use" class="gdri-disabled" value="0"
322 322
                             <?php if ($value == '0' || !$value) {
323 323
                                 echo 'checked';
324 324
                             } ?>/>
325
-                        <label for="for_admin_use_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
325
+                        <label for="for_admin_use_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
326 326
 
327 327
                     </div>
328 328
                 </li>
@@ -331,20 +331,20 @@  discard block
 block discarded – undo
331 331
 
332 332
 
333 333
             // default_value
334
-            if(has_filter("geodir_cfa_default_value_{$field_type}")){
334
+            if (has_filter("geodir_cfa_default_value_{$field_type}")) {
335 335
 
336
-                echo apply_filters("geodir_cfa_default_value_{$field_type}",'',$result_str,$cf,$field_info);
336
+                echo apply_filters("geodir_cfa_default_value_{$field_type}", '', $result_str, $cf, $field_info);
337 337
 
338
-            }else{
338
+            } else {
339 339
                 $value = '';
340 340
                 if (isset($field_info->default_value)) {
341 341
                     $value = esc_attr($field_info->default_value);
342
-                }elseif(isset($cf['defaults']['default_value']) && $cf['defaults']['default_value']){
342
+                }elseif (isset($cf['defaults']['default_value']) && $cf['defaults']['default_value']) {
343 343
                     $value = $cf['defaults']['default_value'];
344 344
                 }
345 345
                 ?>
346 346
                 <li>
347
-                    <label for="default_value" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Default value :', 'geodirectory');?>
347
+                    <label for="default_value" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Default value :', 'geodirectory'); ?>
348 348
                         <div class="gdcf-tooltip">
349 349
                             <?php
350 350
                             if ($field_type == 'checkbox') {
@@ -361,12 +361,12 @@  discard block
 block discarded – undo
361 361
                         <?php if ($field_type == 'checkbox') { ?>
362 362
                             <select name="default_value" id="default_value">
363 363
                                 <option value=""><?php _e('Unchecked', 'geodirectory'); ?></option>
364
-                                <option value="1" <?php selected(true, (int)$value === 1);?>><?php _e('Checked', 'geodirectory'); ?></option>
364
+                                <option value="1" <?php selected(true, (int) $value === 1); ?>><?php _e('Checked', 'geodirectory'); ?></option>
365 365
                             </select>
366 366
                         <?php } else if ($field_type == 'email') { ?>
367
-                            <input type="email" name="default_value" placeholder="<?php _e('[email protected]', 'geodirectory') ;?>" id="default_value" value="<?php echo esc_attr($value);?>" /><br/>
367
+                            <input type="email" name="default_value" placeholder="<?php _e('[email protected]', 'geodirectory'); ?>" id="default_value" value="<?php echo esc_attr($value); ?>" /><br/>
368 368
                         <?php } else { ?>
369
-                            <input type="text" name="default_value" id="default_value" value="<?php echo esc_attr($value);?>" /><br/>
369
+                            <input type="text" name="default_value" id="default_value" value="<?php echo esc_attr($value); ?>" /><br/>
370 370
                         <?php } ?>
371 371
                     </div>
372 372
                 </li>
@@ -375,15 +375,15 @@  discard block
 block discarded – undo
375 375
 
376 376
 
377 377
             // show_in
378
-            if(has_filter("geodir_cfa_show_in_{$field_type}")){
378
+            if (has_filter("geodir_cfa_show_in_{$field_type}")) {
379 379
 
380
-                echo apply_filters("geodir_cfa_show_in_{$field_type}",'',$result_str,$cf,$field_info);
380
+                echo apply_filters("geodir_cfa_show_in_{$field_type}", '', $result_str, $cf, $field_info);
381 381
 
382
-            }else{
382
+            } else {
383 383
                 $value = '';
384 384
                 if (isset($field_info->show_in)) {
385 385
                     $value = esc_attr($field_info->show_in);
386
-                }elseif(isset($cf['defaults']['show_in']) && $cf['defaults']['show_in']){
386
+                }elseif (isset($cf['defaults']['show_in']) && $cf['defaults']['show_in']) {
387 387
                     $value = esc_attr($cf['defaults']['show_in']);
388 388
                 }
389 389
                 ?>
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
                          * @param object $field_info The field being displayed info.
417 417
                          * @param string $field_info The type of field.
418 418
                          */
419
-                        $show_in_locations = apply_filters('geodir_show_in_locations',$show_in_locations,$field_info,$field_type);
419
+                        $show_in_locations = apply_filters('geodir_show_in_locations', $show_in_locations, $field_info, $field_type);
420 420
 
421 421
 
422 422
                         // remove some locations for some field types
@@ -424,11 +424,11 @@  discard block
 block discarded – undo
424 424
                         // don't show new tab option for some types
425 425
 
426 426
                         if (in_array($field_type, array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file'))) {
427
-                        }else{
427
+                        } else {
428 428
                             unset($show_in_locations['[owntab]']);
429 429
                         }
430 430
 
431
-                        if(!$display_on_listing){
431
+                        if (!$display_on_listing) {
432 432
                             unset($show_in_locations['[listings]']);
433 433
                         }
434 434
 
@@ -442,17 +442,17 @@  discard block
 block discarded – undo
442 442
                                 option-ajaxchosen="false">
443 443
                             <?php
444 444
 
445
-                            $show_in_values = explode(',',$value);
445
+                            $show_in_values = explode(',', $value);
446 446
 
447
-                            foreach( $show_in_locations as $key => $val){
447
+                            foreach ($show_in_locations as $key => $val) {
448 448
                                 $selected = '';
449 449
 
450
-                                if(is_array($show_in_values) && in_array($key,$show_in_values ) ){
450
+                                if (is_array($show_in_values) && in_array($key, $show_in_values)) {
451 451
                                     $selected = 'selected';
452 452
                                 }
453 453
 
454 454
                                 ?>
455
-                                <option  value="<?php echo $key;?>" <?php echo $selected;?>><?php echo $val;?></option>
455
+                                <option  value="<?php echo $key; ?>" <?php echo $selected; ?>><?php echo $val; ?></option>
456 456
                                 <?php
457 457
                             }
458 458
                             ?>
@@ -464,9 +464,9 @@  discard block
 block discarded – undo
464 464
 
465 465
 
466 466
             // advanced_editor
467
-            if(has_filter("geodir_cfa_advanced_editor_{$field_type}")){
467
+            if (has_filter("geodir_cfa_advanced_editor_{$field_type}")) {
468 468
 
469
-                echo apply_filters("geodir_cfa_advanced_editor_{$field_type}",'',$result_str,$cf,$field_info);
469
+                echo apply_filters("geodir_cfa_advanced_editor_{$field_type}", '', $result_str, $cf, $field_info);
470 470
 
471 471
             }
472 472
 
@@ -477,10 +477,10 @@  discard block
 block discarded – undo
477 477
 
478 478
 
479 479
             <?php // @todo this does not seem to be used for anything, it can be removed or replaced ?>
480
-            <input type="hidden" name="clabels" id="clabels" value="<?php if (isset($field_info->clabels)) { echo esc_attr($field_info->clabels);} ?>"/>
480
+            <input type="hidden" name="clabels" id="clabels" value="<?php if (isset($field_info->clabels)) { echo esc_attr($field_info->clabels); } ?>"/>
481 481
 
482 482
             <?php // we dont need to show the sort order ?>
483
-            <input type="hidden" readonly="readonly" name="sort_order" id="sort_order" value="<?php if (isset($field_info->sort_order)) { echo esc_attr($field_info->sort_order);} ?>"/>
483
+            <input type="hidden" readonly="readonly" name="sort_order" id="sort_order" value="<?php if (isset($field_info->sort_order)) { echo esc_attr($field_info->sort_order); } ?>"/>
484 484
 
485 485
 
486 486
 
@@ -533,15 +533,15 @@  discard block
 block discarded – undo
533 533
             <?php
534 534
 
535 535
             // is_required
536
-            if(has_filter("geodir_cfa_is_required_{$field_type}")){
536
+            if (has_filter("geodir_cfa_is_required_{$field_type}")) {
537 537
 
538
-                echo apply_filters("geodir_cfa_is_required_{$field_type}",'',$result_str,$cf,$field_info);
538
+                echo apply_filters("geodir_cfa_is_required_{$field_type}", '', $result_str, $cf, $field_info);
539 539
 
540
-            }else{
540
+            } else {
541 541
                 $value = '';
542 542
                 if (isset($field_info->is_required)) {
543 543
                     $value = esc_attr($field_info->is_required);
544
-                }elseif(isset($cf['defaults']['is_required']) && $cf['defaults']['is_required']){
544
+                }elseif (isset($cf['defaults']['is_required']) && $cf['defaults']['is_required']) {
545 545
                     $value = $cf['defaults']['is_required'];
546 546
                 }
547 547
                 ?>
@@ -554,17 +554,17 @@  discard block
 block discarded – undo
554 554
 
555 555
                     <div class="gd-cf-input-wrap gd-switch">
556 556
 
557
-                        <input type="radio" id="is_required_yes<?php echo $radio_id;?>" name="is_required" class="gdri-enabled"  value="1"
557
+                        <input type="radio" id="is_required_yes<?php echo $radio_id; ?>" name="is_required" class="gdri-enabled"  value="1"
558 558
                             <?php if ($value == '1') {
559 559
                                 echo 'checked';
560 560
                             } ?>/>
561
-                        <label onclick="show_hide_radio(this,'show','cf-is-required-msg');" for="is_required_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
561
+                        <label onclick="show_hide_radio(this,'show','cf-is-required-msg');" for="is_required_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
562 562
 
563
-                        <input type="radio" id="is_required_no<?php echo $radio_id;?>" name="is_required" class="gdri-disabled" value="0"
563
+                        <input type="radio" id="is_required_no<?php echo $radio_id; ?>" name="is_required" class="gdri-disabled" value="0"
564 564
                             <?php if ($value == '0' || !$value) {
565 565
                                 echo 'checked';
566 566
                             } ?>/>
567
-                        <label onclick="show_hide_radio(this,'hide','cf-is-required-msg');" for="is_required_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
567
+                        <label onclick="show_hide_radio(this,'hide','cf-is-required-msg');" for="is_required_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
568 568
 
569 569
                     </div>
570 570
 
@@ -574,19 +574,19 @@  discard block
 block discarded – undo
574 574
             }
575 575
 
576 576
             // required_msg
577
-            if(has_filter("geodir_cfa_required_msg_{$field_type}")){
577
+            if (has_filter("geodir_cfa_required_msg_{$field_type}")) {
578 578
 
579
-                echo apply_filters("geodir_cfa_required_msg_{$field_type}",'',$result_str,$cf,$field_info);
579
+                echo apply_filters("geodir_cfa_required_msg_{$field_type}", '', $result_str, $cf, $field_info);
580 580
 
581
-            }else{
581
+            } else {
582 582
                 $value = '';
583 583
                 if (isset($field_info->required_msg)) {
584 584
                     $value = esc_attr($field_info->required_msg);
585
-                }elseif(isset($cf['defaults']['required_msg']) && $cf['defaults']['required_msg']){
585
+                }elseif (isset($cf['defaults']['required_msg']) && $cf['defaults']['required_msg']) {
586 586
                     $value = $cf['defaults']['required_msg'];
587 587
                 }
588 588
                 ?>
589
-                <li class="cf-is-required-msg" <?php if ((isset($field_info->is_required) && $field_info->is_required == '0') || !isset($field_info->is_required)) {echo "style='display:none;'";}?>>
589
+                <li class="cf-is-required-msg" <?php if ((isset($field_info->is_required) && $field_info->is_required == '0') || !isset($field_info->is_required)) {echo "style='display:none;'"; }?>>
590 590
                     <label for="required_msg" class="gd-cf-tooltip-wrap">
591 591
                         <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Required message:', 'geodirectory'); ?>
592 592
                         <div class="gdcf-tooltip">
@@ -603,31 +603,31 @@  discard block
 block discarded – undo
603 603
 
604 604
 
605 605
             // required_msg
606
-            if(has_filter("geodir_cfa_validation_pattern_{$field_type}")){
606
+            if (has_filter("geodir_cfa_validation_pattern_{$field_type}")) {
607 607
 
608
-                echo apply_filters("geodir_cfa_validation_pattern_{$field_type}",'',$result_str,$cf,$field_info);
608
+                echo apply_filters("geodir_cfa_validation_pattern_{$field_type}", '', $result_str, $cf, $field_info);
609 609
 
610 610
             }
611 611
 
612 612
 
613 613
             // extra_fields
614
-            if(has_filter("geodir_cfa_extra_fields_{$field_type}")){
614
+            if (has_filter("geodir_cfa_extra_fields_{$field_type}")) {
615 615
 
616
-                echo apply_filters("geodir_cfa_extra_fields_{$field_type}",'',$result_str,$cf,$field_info);
616
+                echo apply_filters("geodir_cfa_extra_fields_{$field_type}", '', $result_str, $cf, $field_info);
617 617
 
618 618
             }
619 619
 
620 620
 
621 621
             // field_icon
622
-            if(has_filter("geodir_cfa_field_icon_{$field_type}")){
622
+            if (has_filter("geodir_cfa_field_icon_{$field_type}")) {
623 623
 
624
-                echo apply_filters("geodir_cfa_field_icon_{$field_type}",'',$result_str,$cf,$field_info);
624
+                echo apply_filters("geodir_cfa_field_icon_{$field_type}", '', $result_str, $cf, $field_info);
625 625
 
626
-            }else{
626
+            } else {
627 627
                 $value = '';
628 628
                 if (isset($field_info->field_icon)) {
629 629
                     $value = esc_attr($field_info->field_icon);
630
-                }elseif(isset($cf['defaults']['field_icon']) && $cf['defaults']['field_icon']){
630
+                }elseif (isset($cf['defaults']['field_icon']) && $cf['defaults']['field_icon']) {
631 631
                     $value = $cf['defaults']['field_icon'];
632 632
                 }
633 633
                 ?>
@@ -638,12 +638,12 @@  discard block
 block discarded – undo
638 638
                     <label for="field_icon" class="gd-cf-tooltip-wrap">
639 639
                         <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Upload icon :', 'geodirectory'); ?>
640 640
                         <div class="gdcf-tooltip">
641
-                            <?php _e('Upload icon using media and enter its url path, or enter <a href="http://fortawesome.github.io/Font-Awesome/icons/" target="_blank" >font awesome </a>class eg:"fa fa-home"', 'geodirectory');?>
641
+                            <?php _e('Upload icon using media and enter its url path, or enter <a href="http://fortawesome.github.io/Font-Awesome/icons/" target="_blank" >font awesome </a>class eg:"fa fa-home"', 'geodirectory'); ?>
642 642
                         </div>
643 643
                     </label>
644 644
                     <div class="gd-cf-input-wrap">
645 645
                         <input type="text" name="field_icon" id="field_icon"
646
-                               value="<?php echo $value;?>"/>
646
+                               value="<?php echo $value; ?>"/>
647 647
                     </div>
648 648
 
649 649
                 </li>
@@ -652,15 +652,15 @@  discard block
 block discarded – undo
652 652
 
653 653
 
654 654
             // css_class
655
-            if(has_filter("geodir_cfa_css_class_{$field_type}")){
655
+            if (has_filter("geodir_cfa_css_class_{$field_type}")) {
656 656
 
657
-                echo apply_filters("geodir_cfa_css_class_{$field_type}",'',$result_str,$cf,$field_info);
657
+                echo apply_filters("geodir_cfa_css_class_{$field_type}", '', $result_str, $cf, $field_info);
658 658
 
659
-            }else{
659
+            } else {
660 660
                 $value = '';
661 661
                 if (isset($field_info->css_class)) {
662 662
                     $value = esc_attr($field_info->css_class);
663
-                }elseif(isset($cf['defaults']['css_class']) && $cf['defaults']['css_class']){
663
+                }elseif (isset($cf['defaults']['css_class']) && $cf['defaults']['css_class']) {
664 664
                     $value = $cf['defaults']['css_class'];
665 665
                 }
666 666
                 ?>
@@ -669,7 +669,7 @@  discard block
 block discarded – undo
669 669
                     <label for="css_class" class="gd-cf-tooltip-wrap">
670 670
                         <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Css class :', 'geodirectory'); ?>
671 671
                         <div class="gdcf-tooltip">
672
-                            <?php _e('Enter custom css class for field custom style.', 'geodirectory');?>
672
+                            <?php _e('Enter custom css class for field custom style.', 'geodirectory'); ?>
673 673
                         </div>
674 674
                     </label>
675 675
                     <div class="gd-cf-input-wrap">
@@ -684,23 +684,23 @@  discard block
 block discarded – undo
684 684
 
685 685
 
686 686
             // cat_sort
687
-            if(has_filter("geodir_cfa_cat_sort_{$field_type}")){
687
+            if (has_filter("geodir_cfa_cat_sort_{$field_type}")) {
688 688
 
689
-                echo apply_filters("geodir_cfa_cat_sort_{$field_type}",'',$result_str,$cf,$field_info);
689
+                echo apply_filters("geodir_cfa_cat_sort_{$field_type}", '', $result_str, $cf, $field_info);
690 690
 
691
-            }else{
691
+            } else {
692 692
                 $value = '';
693
-                $hide_cat_sort  ='';
693
+                $hide_cat_sort = '';
694 694
                 if (isset($field_info->cat_sort)) {
695 695
                     $value = esc_attr($field_info->cat_sort);
696
-                }elseif(isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']){
696
+                }elseif (isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']) {
697 697
                     $value = $cf['defaults']['cat_sort'];
698
-                    $hide_cat_sort = ($value===false) ? "style='display:none;'" : '';
698
+                    $hide_cat_sort = ($value === false) ? "style='display:none;'" : '';
699 699
                 }
700 700
 
701
-                $hide_cat_sort = (isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']===false) ? "style='display:none;'" : '';
701
+                $hide_cat_sort = (isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort'] === false) ? "style='display:none;'" : '';
702 702
                 ?>
703
-                <li <?php echo $hide_cat_sort ;?>>
703
+                <li <?php echo $hide_cat_sort; ?>>
704 704
                     <h3><?php
705 705
                         /**
706 706
                          * Filter the section title.
@@ -719,23 +719,23 @@  discard block
 block discarded – undo
719 719
                     <label for="cat_sort" class="gd-cf-tooltip-wrap">
720 720
                         <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Include this field in sorting options :', 'geodirectory'); ?>
721 721
                         <div class="gdcf-tooltip">
722
-                            <?php _e('Lets you use this filed as a sorting option, set from sorting options above.', 'geodirectory');?>
722
+                            <?php _e('Lets you use this filed as a sorting option, set from sorting options above.', 'geodirectory'); ?>
723 723
                         </div>
724 724
                     </label>
725 725
 
726 726
                     <div class="gd-cf-input-wrap gd-switch">
727 727
 
728
-                        <input type="radio" id="cat_sort_yes<?php echo $radio_id;?>" name="cat_sort" class="gdri-enabled"  value="1"
728
+                        <input type="radio" id="cat_sort_yes<?php echo $radio_id; ?>" name="cat_sort" class="gdri-enabled"  value="1"
729 729
                             <?php if ($value == '1') {
730 730
                                 echo 'checked';
731 731
                             } ?>/>
732
-                        <label for="cat_sort_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
732
+                        <label for="cat_sort_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
733 733
 
734
-                        <input type="radio" id="cat_sort_no<?php echo $radio_id;?>" name="cat_sort" class="gdri-disabled" value="0"
734
+                        <input type="radio" id="cat_sort_no<?php echo $radio_id; ?>" name="cat_sort" class="gdri-disabled" value="0"
735 735
                             <?php if (!$value) {
736 736
                                 echo 'checked';
737 737
                             } ?>/>
738
-                        <label for="cat_sort_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
738
+                        <label for="cat_sort_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
739 739
 
740 740
                     </div>
741 741
                 </li>
@@ -762,7 +762,7 @@  discard block
 block discarded – undo
762 762
                      * @param object $field_info The current fields info.
763 763
                      * @param array $cf The custom field settings
764 764
                      */
765
-                    do_action('geodir_advance_custom_fields', $field_info,$cf);?>
765
+                    do_action('geodir_advance_custom_fields', $field_info, $cf); ?>
766 766
 
767 767
 
768 768
                 <?php endswitch; ?>
@@ -774,10 +774,10 @@  discard block
 block discarded – undo
774 774
                     <h3></h3>
775 775
                 </label>
776 776
                 <div class="gd-cf-input-wrap">
777
-                    <input type="button" class="button button-primary" name="save" id="save" value="<?php echo esc_attr(__('Save','geodirectory'));?>"
777
+                    <input type="button" class="button button-primary" name="save" id="save" value="<?php echo esc_attr(__('Save', 'geodirectory')); ?>"
778 778
                            onclick="save_field('<?php echo esc_attr($result_str); ?>')"/>
779 779
                     <?php if (!$default): ?>
780
-                        <a href="javascript:void(0)"><input type="button" name="delete" value="<?php echo esc_attr(__('Delete','geodirectory'));?>"
780
+                        <a href="javascript:void(0)"><input type="button" name="delete" value="<?php echo esc_attr(__('Delete', 'geodirectory')); ?>"
781 781
                                                             onclick="delete_field('<?php echo esc_attr($result_str); ?>', '<?php echo $nonce; ?>')"
782 782
                                                             class="button"/></a>
783 783
                     <?php endif; ?>
Please login to merge, or discard this patch.
geodirectory-functions/custom_fields_functions.php 4 patches
Doc Comments   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1345,6 +1345,9 @@  discard block
 block discarded – undo
1345 1345
 }
1346 1346
 
1347 1347
 
1348
+/**
1349
+ * @return string
1350
+ */
1348 1351
 function geodir_field_icon_proccess($cf){
1349 1352
 
1350 1353
 
@@ -1738,7 +1741,7 @@  discard block
 block discarded – undo
1738 1741
  * @global object $wpdb WordPress Database object.
1739 1742
  * @global string $plugin_prefix Geodirectory plugin table prefix.
1740 1743
  * @param int $post_id The post ID.
1741
- * @return mixed Returns video.
1744
+ * @return string Returns video.
1742 1745
  */
1743 1746
 function geodir_get_video($post_id)
1744 1747
 {
@@ -1764,7 +1767,7 @@  discard block
 block discarded – undo
1764 1767
  * @global object $wpdb WordPress Database object.
1765 1768
  * @global string $plugin_prefix Geodirectory plugin table prefix.
1766 1769
  * @param int $post_id The post ID.
1767
- * @return mixed Returns special offers.
1770
+ * @return string Returns special offers.
1768 1771
  */
1769 1772
 function geodir_get_special_offers($post_id)
1770 1773
 {
@@ -1788,7 +1791,7 @@  discard block
 block discarded – undo
1788 1791
      *
1789 1792
      * @since 1.0.0
1790 1793
      * @package GeoDirectory
1791
-     * @return mixed|void Returns max upload file size.
1794
+     * @return string|null Returns max upload file size.
1792 1795
      */
1793 1796
     function geodir_max_upload_size()
1794 1797
     {
@@ -2157,7 +2160,6 @@  discard block
 block discarded – undo
2157 2160
      * @param string $field_type The form field type.
2158 2161
      * @param object|int $result_str The custom field results object or row id.
2159 2162
      * @param string $field_ins_upd When set to "submit" displays form.
2160
-     * @param bool $default when set to true field will be for admin use only.
2161 2163
      */
2162 2164
     function geodir_custom_sort_field_adminhtml($field_type, $result_str, $field_ins_upd = '', $field_type_key='')
2163 2165
     {
Please login to merge, or discard this patch.
Indentation   +1976 added lines, -1976 removed lines patch added patch discarded remove patch
@@ -10,52 +10,52 @@  discard block
 block discarded – undo
10 10
 global $wpdb, $table_prefix;
11 11
 
12 12
 if (!function_exists('geodir_column_exist')) {
13
-    /**
14
-     * Check table column exist or not.
15
-     *
16
-     * @since 1.0.0
17
-     * @package GeoDirectory
18
-     * @global object $wpdb WordPress Database object.
19
-     * @param string $db The table name.
20
-     * @param string $column The column name.
21
-     * @return bool If column exists returns true. Otherwise false.
22
-     */
23
-    function geodir_column_exist($db, $column)
24
-    {
25
-        global $wpdb;
26
-        $exists = false;
27
-        $columns = $wpdb->get_col("show columns from $db");
28
-        foreach ($columns as $c) {
29
-            if ($c == $column) {
30
-                $exists = true;
31
-                break;
32
-            }
33
-        }
34
-        return $exists;
35
-    }
13
+	/**
14
+	 * Check table column exist or not.
15
+	 *
16
+	 * @since 1.0.0
17
+	 * @package GeoDirectory
18
+	 * @global object $wpdb WordPress Database object.
19
+	 * @param string $db The table name.
20
+	 * @param string $column The column name.
21
+	 * @return bool If column exists returns true. Otherwise false.
22
+	 */
23
+	function geodir_column_exist($db, $column)
24
+	{
25
+		global $wpdb;
26
+		$exists = false;
27
+		$columns = $wpdb->get_col("show columns from $db");
28
+		foreach ($columns as $c) {
29
+			if ($c == $column) {
30
+				$exists = true;
31
+				break;
32
+			}
33
+		}
34
+		return $exists;
35
+	}
36 36
 }
37 37
 
38 38
 if (!function_exists('geodir_add_column_if_not_exist')) {
39
-    /**
40
-     * Add column if table column not exist.
41
-     *
42
-     * @since 1.0.0
43
-     * @package GeoDirectory
44
-     * @global object $wpdb WordPress Database object.
45
-     * @param string $db The table name.
46
-     * @param string $column The column name.
47
-     * @param string $column_attr The column attributes.
48
-     */
49
-    function geodir_add_column_if_not_exist($db, $column, $column_attr = "VARCHAR( 255 ) NOT NULL")
50
-    {
51
-        global $wpdb;
52
-        $result = 0;// no rows affected
53
-        if (!geodir_column_exist($db, $column)) {
54
-            if (!empty($db) && !empty($column))
55
-                $result = $wpdb->query("ALTER TABLE `$db` ADD `$column`  $column_attr");
56
-        }
57
-        return $result;
58
-    }
39
+	/**
40
+	 * Add column if table column not exist.
41
+	 *
42
+	 * @since 1.0.0
43
+	 * @package GeoDirectory
44
+	 * @global object $wpdb WordPress Database object.
45
+	 * @param string $db The table name.
46
+	 * @param string $column The column name.
47
+	 * @param string $column_attr The column attributes.
48
+	 */
49
+	function geodir_add_column_if_not_exist($db, $column, $column_attr = "VARCHAR( 255 ) NOT NULL")
50
+	{
51
+		global $wpdb;
52
+		$result = 0;// no rows affected
53
+		if (!geodir_column_exist($db, $column)) {
54
+			if (!empty($db) && !empty($column))
55
+				$result = $wpdb->query("ALTER TABLE `$db` ADD `$column`  $column_attr");
56
+		}
57
+		return $result;
58
+	}
59 59
 }
60 60
 
61 61
 /**
@@ -72,705 +72,705 @@  discard block
 block discarded – undo
72 72
  */
73 73
 function geodir_post_custom_fields($package_id = '', $default = 'all', $post_type = 'gd_place', $fields_location = 'none')
74 74
 {
75
-    global $wpdb, $geodir_post_custom_fields_cache;
76
-
77
-    $cache_stored = $post_type . '_' . $package_id . '_' . $default . '_' . $fields_location;
78
-
79
-    if (array_key_exists($cache_stored, $geodir_post_custom_fields_cache)) {
80
-        return $geodir_post_custom_fields_cache[$cache_stored];
81
-    }
82
-
83
-    $default_query = '';
84
-
85
-    if ($default == 'default')
86
-        $default_query .= " and is_admin IN ('1') ";
87
-    elseif ($default == 'custom')
88
-        $default_query .= " and is_admin = '0' ";
89
-
90
-    if ($fields_location == 'none') {
91
-    } else{
92
-        $fields_location = esc_sql( $fields_location );
93
-        $default_query .= " and show_in LIKE '%%[$fields_location]%%' ";
94
-    }
95
-
96
-    $post_meta_info = $wpdb->get_results(
97
-        $wpdb->prepare(
98
-            "select * from " . GEODIR_CUSTOM_FIELDS_TABLE . " where is_active = '1' and post_type = %s {$default_query} order by sort_order asc,admin_title asc",
99
-            array($post_type)
100
-        )
101
-    );
102
-
103
-
104
-    $return_arr = array();
105
-    if ($post_meta_info) {
106
-
107
-        foreach ($post_meta_info as $post_meta_info_obj) {
108
-
109
-            $custom_fields = array(
110
-                "name" => $post_meta_info_obj->htmlvar_name,
111
-                "label" => $post_meta_info_obj->clabels,
112
-                "default" => $post_meta_info_obj->default_value,
113
-                "type" => $post_meta_info_obj->field_type,
114
-                "desc" => $post_meta_info_obj->admin_desc);
115
-
116
-            if ($post_meta_info_obj->field_type) {
117
-                $options = explode(',', $post_meta_info_obj->option_values);
118
-                $custom_fields["options"] = $options;
119
-            }
120
-
121
-            foreach ($post_meta_info_obj as $key => $val) {
122
-                $custom_fields[$key] = $val;
123
-            }
124
-
125
-            $pricearr = array();
126
-            $pricearr = explode(',', $post_meta_info_obj->packages);
127
-
128
-            if ($package_id != '' && in_array($package_id, $pricearr)) {
129
-                $return_arr[$post_meta_info_obj->sort_order] = $custom_fields;
130
-            } elseif ($package_id == '') {
131
-                $return_arr[$post_meta_info_obj->sort_order] = $custom_fields;
132
-            }
133
-        }
134
-    }
135
-    $geodir_post_custom_fields_cache[$cache_stored] = $return_arr;
136
-
137
-    if (has_filter('geodir_filter_geodir_post_custom_fields')) {
138
-        /**
139
-         * Filter the post custom fields array.
140
-         *
141
-         * @since 1.0.0
142
-         *
143
-         * @param array $return_arr Post custom fields array.
144
-         * @param int|string $package_id The package ID.
145
-         * @param string $post_type Optional. The wordpress post type.
146
-         * @param string $fields_location Optional. Where exactly are you going to place this custom fields?.
147
-         */
148
-        $return_arr = apply_filters('geodir_filter_geodir_post_custom_fields', $return_arr, $package_id, $post_type, $fields_location);
149
-    }
150
-
151
-    return $return_arr;
75
+	global $wpdb, $geodir_post_custom_fields_cache;
76
+
77
+	$cache_stored = $post_type . '_' . $package_id . '_' . $default . '_' . $fields_location;
78
+
79
+	if (array_key_exists($cache_stored, $geodir_post_custom_fields_cache)) {
80
+		return $geodir_post_custom_fields_cache[$cache_stored];
81
+	}
82
+
83
+	$default_query = '';
84
+
85
+	if ($default == 'default')
86
+		$default_query .= " and is_admin IN ('1') ";
87
+	elseif ($default == 'custom')
88
+		$default_query .= " and is_admin = '0' ";
89
+
90
+	if ($fields_location == 'none') {
91
+	} else{
92
+		$fields_location = esc_sql( $fields_location );
93
+		$default_query .= " and show_in LIKE '%%[$fields_location]%%' ";
94
+	}
95
+
96
+	$post_meta_info = $wpdb->get_results(
97
+		$wpdb->prepare(
98
+			"select * from " . GEODIR_CUSTOM_FIELDS_TABLE . " where is_active = '1' and post_type = %s {$default_query} order by sort_order asc,admin_title asc",
99
+			array($post_type)
100
+		)
101
+	);
102
+
103
+
104
+	$return_arr = array();
105
+	if ($post_meta_info) {
106
+
107
+		foreach ($post_meta_info as $post_meta_info_obj) {
108
+
109
+			$custom_fields = array(
110
+				"name" => $post_meta_info_obj->htmlvar_name,
111
+				"label" => $post_meta_info_obj->clabels,
112
+				"default" => $post_meta_info_obj->default_value,
113
+				"type" => $post_meta_info_obj->field_type,
114
+				"desc" => $post_meta_info_obj->admin_desc);
115
+
116
+			if ($post_meta_info_obj->field_type) {
117
+				$options = explode(',', $post_meta_info_obj->option_values);
118
+				$custom_fields["options"] = $options;
119
+			}
120
+
121
+			foreach ($post_meta_info_obj as $key => $val) {
122
+				$custom_fields[$key] = $val;
123
+			}
124
+
125
+			$pricearr = array();
126
+			$pricearr = explode(',', $post_meta_info_obj->packages);
127
+
128
+			if ($package_id != '' && in_array($package_id, $pricearr)) {
129
+				$return_arr[$post_meta_info_obj->sort_order] = $custom_fields;
130
+			} elseif ($package_id == '') {
131
+				$return_arr[$post_meta_info_obj->sort_order] = $custom_fields;
132
+			}
133
+		}
134
+	}
135
+	$geodir_post_custom_fields_cache[$cache_stored] = $return_arr;
136
+
137
+	if (has_filter('geodir_filter_geodir_post_custom_fields')) {
138
+		/**
139
+		 * Filter the post custom fields array.
140
+		 *
141
+		 * @since 1.0.0
142
+		 *
143
+		 * @param array $return_arr Post custom fields array.
144
+		 * @param int|string $package_id The package ID.
145
+		 * @param string $post_type Optional. The wordpress post type.
146
+		 * @param string $fields_location Optional. Where exactly are you going to place this custom fields?.
147
+		 */
148
+		$return_arr = apply_filters('geodir_filter_geodir_post_custom_fields', $return_arr, $package_id, $post_type, $fields_location);
149
+	}
150
+
151
+	return $return_arr;
152 152
 }
153 153
 
154
-    /**
155
-     * Adds admin html for custom fields.
156
-     *
157
-     * @since 1.0.0
158
-     * @package GeoDirectory
159
-     * @global object $wpdb WordPress Database object.
160
-     * @param string $field_type The form field type.
161
-     * @param object|int $result_str The custom field results object or row id.
162
-     * @param string $field_ins_upd When set to "submit" displays form.
163
-     * @param string $field_type_key The key of the custom field.
164
-     */
165
-    function geodir_custom_field_adminhtml($field_type, $result_str, $field_ins_upd = '', $field_type_key ='')
166
-    {
167
-        global $wpdb;
168
-        $cf = $result_str;
169
-        if (!is_object($cf)) {
170
-
171
-            $field_info = $wpdb->get_row($wpdb->prepare("select * from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id= %d", array($cf)));
172
-
173
-        } else {
174
-            $field_info = $cf;
175
-            $result_str = $cf->id;
176
-        }
177
-        /**
178
-         * Contains custom field html.
179
-         *
180
-         * @since 1.0.0
181
-         */
182
-        include('custom_field_html.php');
183
-
184
-    }
154
+	/**
155
+	 * Adds admin html for custom fields.
156
+	 *
157
+	 * @since 1.0.0
158
+	 * @package GeoDirectory
159
+	 * @global object $wpdb WordPress Database object.
160
+	 * @param string $field_type The form field type.
161
+	 * @param object|int $result_str The custom field results object or row id.
162
+	 * @param string $field_ins_upd When set to "submit" displays form.
163
+	 * @param string $field_type_key The key of the custom field.
164
+	 */
165
+	function geodir_custom_field_adminhtml($field_type, $result_str, $field_ins_upd = '', $field_type_key ='')
166
+	{
167
+		global $wpdb;
168
+		$cf = $result_str;
169
+		if (!is_object($cf)) {
170
+
171
+			$field_info = $wpdb->get_row($wpdb->prepare("select * from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id= %d", array($cf)));
172
+
173
+		} else {
174
+			$field_info = $cf;
175
+			$result_str = $cf->id;
176
+		}
177
+		/**
178
+		 * Contains custom field html.
179
+		 *
180
+		 * @since 1.0.0
181
+		 */
182
+		include('custom_field_html.php');
183
+
184
+	}
185 185
 
186 186
 
187 187
 if (!function_exists('geodir_custom_field_delete')) {
188
-    /**
189
-     * Delete custom field using field id.
190
-     *
191
-     * @since 1.0.0
192
-     * @since 1.5.7 Delete field from sorting fields table when custom field deleted.
193
-     * @package GeoDirectory
194
-     * @global object $wpdb WordPress Database object.
195
-     * @global string $plugin_prefix Geodirectory plugin table prefix.
196
-     * @param string $field_id The custom field ID.
197
-     * @return int|string If field deleted successfully, returns field id. Otherwise returns 0.
198
-     */
199
-    function geodir_custom_field_delete($field_id = '') {
200
-        global $wpdb, $plugin_prefix;
201
-
202
-        if ($field_id != '') {
203
-            $cf = trim($field_id, '_');
204
-
205
-            if ($field = $wpdb->get_row($wpdb->prepare("select htmlvar_name,post_type,field_type from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id= %d", array($cf)))) {
206
-                $wpdb->query($wpdb->prepare("delete from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id= %d ", array($cf)));
207
-
208
-                $post_type = $field->post_type;
209
-                $htmlvar_name = $field->htmlvar_name;
210
-
211
-                if ($post_type != '' && $htmlvar_name != '') {
212
-                    $wpdb->query($wpdb->prepare("DELETE FROM " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " WHERE htmlvar_name=%s AND post_type=%s LIMIT 1", array($htmlvar_name, $post_type)));
213
-                }
214
-
215
-                /**
216
-                 * Called after a custom field is deleted.
217
-                 *
218
-                 * @since 1.0.0
219
-                 * @param string $cf The fields ID.
220
-                 * @param string $field->htmlvar_name The html variable name for the field.
221
-                 * @param string $post_type The post type the field belongs to.
222
-                 */
223
-                do_action('geodir_after_custom_field_deleted', $cf, $field->htmlvar_name, $post_type);
224
-
225
-                if ($field->field_type == 'address') {
226
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_address`");
227
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_city`");
228
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_region`");
229
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_country`");
230
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_zip`");
231
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_latitude`");
232
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_longitude`");
233
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_mapview`");
234
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_mapzoom`");
235
-                } else {
236
-                    if ($field->field_type != 'fieldset') {
237
-                        $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "`");
238
-                    }
239
-                }
240
-
241
-                return $field_id;
242
-            } else
243
-                return 0;
244
-        } else
245
-            return 0;
246
-    }
188
+	/**
189
+	 * Delete custom field using field id.
190
+	 *
191
+	 * @since 1.0.0
192
+	 * @since 1.5.7 Delete field from sorting fields table when custom field deleted.
193
+	 * @package GeoDirectory
194
+	 * @global object $wpdb WordPress Database object.
195
+	 * @global string $plugin_prefix Geodirectory plugin table prefix.
196
+	 * @param string $field_id The custom field ID.
197
+	 * @return int|string If field deleted successfully, returns field id. Otherwise returns 0.
198
+	 */
199
+	function geodir_custom_field_delete($field_id = '') {
200
+		global $wpdb, $plugin_prefix;
201
+
202
+		if ($field_id != '') {
203
+			$cf = trim($field_id, '_');
204
+
205
+			if ($field = $wpdb->get_row($wpdb->prepare("select htmlvar_name,post_type,field_type from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id= %d", array($cf)))) {
206
+				$wpdb->query($wpdb->prepare("delete from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id= %d ", array($cf)));
207
+
208
+				$post_type = $field->post_type;
209
+				$htmlvar_name = $field->htmlvar_name;
210
+
211
+				if ($post_type != '' && $htmlvar_name != '') {
212
+					$wpdb->query($wpdb->prepare("DELETE FROM " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " WHERE htmlvar_name=%s AND post_type=%s LIMIT 1", array($htmlvar_name, $post_type)));
213
+				}
214
+
215
+				/**
216
+				 * Called after a custom field is deleted.
217
+				 *
218
+				 * @since 1.0.0
219
+				 * @param string $cf The fields ID.
220
+				 * @param string $field->htmlvar_name The html variable name for the field.
221
+				 * @param string $post_type The post type the field belongs to.
222
+				 */
223
+				do_action('geodir_after_custom_field_deleted', $cf, $field->htmlvar_name, $post_type);
224
+
225
+				if ($field->field_type == 'address') {
226
+					$wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_address`");
227
+					$wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_city`");
228
+					$wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_region`");
229
+					$wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_country`");
230
+					$wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_zip`");
231
+					$wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_latitude`");
232
+					$wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_longitude`");
233
+					$wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_mapview`");
234
+					$wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_mapzoom`");
235
+				} else {
236
+					if ($field->field_type != 'fieldset') {
237
+						$wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "`");
238
+					}
239
+				}
240
+
241
+				return $field_id;
242
+			} else
243
+				return 0;
244
+		} else
245
+			return 0;
246
+	}
247 247
 }
248 248
 
249 249
 if (!function_exists('geodir_custom_field_save')) {
250
-    /**
251
-     * Save or Update custom fields into the database.
252
-     *
253
-     * @since 1.0.0
254
-     * @since 1.5.6 Fix for saving multiselect custom field "Display Type" on first attempt.
255
-     * @package GeoDirectory
256
-     * @global object $wpdb WordPress Database object.
257
-     * @global string $plugin_prefix Geodirectory plugin table prefix.
258
-     * @param array $request_field {
259
-     *    Attributes of the request field array.
260
-     *
261
-     *    @type string $action Ajax Action name. Default "geodir_ajax_action".
262
-     *    @type string $manage_field_type Field type Default "custom_fields".
263
-     *    @type string $create_field Create field Default "true".
264
-     *    @type string $field_ins_upd Field ins upd Default "submit".
265
-     *    @type string $_wpnonce WP nonce value.
266
-     *    @type string $listing_type Listing type Example "gd_place".
267
-     *    @type string $field_type Field type Example "radio".
268
-     *    @type string $field_id Field id Example "12".
269
-     *    @type string $data_type Data type Example "VARCHAR".
270
-     *    @type string $is_active Either "1" or "0". If "0" is used then the field will not be displayed anywhere.
271
-     *    @type array $show_on_pkg Package list to display this field.
272
-     *    @type string $admin_title Personal comment, it would not be displayed anywhere except in custom field settings.
273
-     *    @type string $site_title Section title which you wish to display in frontend.
274
-     *    @type string $admin_desc Section description which will appear in frontend.
275
-     *    @type string $htmlvar_name Html variable name. This should be a unique name.
276
-     *    @type string $clabels Section Title which will appear in backend.
277
-     *    @type string $default_value The default value (for "link" this will be used as the link text).
278
-     *    @type string $sort_order The display order of this field in backend. e.g. 5.
279
-     *    @type string $is_default Either "1" or "0". If "0" is used then the field will be displayed as main form field or additional field.
280
-     *    @type string $for_admin_use Either "1" or "0". If "0" is used then only site admin can edit this field.
281
-     *    @type string $is_required Use "1" to set field as required.
282
-     *    @type string $required_msg Enter text for error message if field required and have not full fill requirment.
283
-     *    @type string $show_on_listing Want to show this on listing page?.
284
-     *    @type string $show_in What locations to show the custom field in.
285
-     *    @type string $show_on_detail Want to show this in More Info tab on detail page?.
286
-     *    @type string $show_as_tab Want to display this as a tab on detail page? If "1" then "Show on detail page?" must be Yes.
287
-     *    @type string $option_values Option Values should be separated by comma.
288
-     *    @type string $field_icon Upload icon using media and enter its url path, or enter font awesome class.
289
-     *    @type string $css_class Enter custom css class for field custom style.
290
-     *
291
-     * }
292
-     * @param bool $default Not yet implemented.
293
-     * @return int|string If field is unique returns inserted row id. Otherwise returns error string.
294
-     */
295
-    function geodir_custom_field_save($request_field = array(), $default = false)
296
-    {
297
-
298
-        global $wpdb, $plugin_prefix;
299
-
300
-        $old_html_variable = '';
301
-
302
-        $data_type = trim($request_field['data_type']);
303
-
304
-        $result_str = isset($request_field['field_id']) ? trim($request_field['field_id']) : '';
305
-
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'){
308
-            $request_field['data_type'] = 'VARCHAR';
309
-        }
310
-
311
-        $cf = trim($result_str, '_');
312
-
313
-
314
-        /*-------- check dublicate validation --------*/
315
-
316
-        $cehhtmlvar_name = isset($request_field['htmlvar_name']) ? $request_field['htmlvar_name'] : '';
317
-        $post_type = $request_field['listing_type'];
318
-
319
-        if ($request_field['field_type'] != 'address' && $request_field['field_type'] != 'taxonomy' && $request_field['field_type'] != 'fieldset') {
320
-            $cehhtmlvar_name = 'geodir_' . $cehhtmlvar_name;
321
-        }
322
-
323
-        $check_html_variable = $wpdb->get_var(
324
-            $wpdb->prepare(
325
-                "select htmlvar_name from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id <> %d and htmlvar_name = %s and post_type = %s ",
326
-                array($cf, $cehhtmlvar_name, $post_type)
327
-            )
328
-        );
329
-
330
-
331
-        if (!$check_html_variable || $request_field['field_type'] == 'fieldset') {
332
-
333
-            if ($cf != '') {
334
-
335
-                $post_meta_info = $wpdb->get_row(
336
-                    $wpdb->prepare(
337
-                        "select * from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id = %d",
338
-                        array($cf)
339
-                    )
340
-                );
341
-
342
-            }
343
-
344
-            if (!empty($post_meta_info)) {
345
-                $post_val = $post_meta_info;
346
-                $old_html_variable = $post_val->htmlvar_name;
347
-
348
-            }
349
-
350
-
351
-
352
-            if ($post_type == '') $post_type = 'gd_place';
353
-
354
-
355
-            $detail_table = $plugin_prefix . $post_type . '_detail';
356
-
357
-            $admin_title = $request_field['admin_title'];
358
-            $site_title = $request_field['site_title'];
359
-            $data_type = $request_field['data_type'];
360
-            $field_type = $request_field['field_type'];
361
-            $field_type_key = $request_field['field_type_key'];
362
-            $htmlvar_name = isset($request_field['htmlvar_name']) ? $request_field['htmlvar_name'] : '';
363
-            $admin_desc = $request_field['admin_desc'];
364
-            $clabels = $request_field['clabels'];
365
-            $default_value = isset($request_field['default_value']) ? $request_field['default_value'] : '';
366
-            $sort_order = isset($request_field['sort_order']) ? $request_field['sort_order'] : '';
367
-            $is_active = isset($request_field['is_active']) ? $request_field['is_active'] : '';
368
-            $is_required = isset($request_field['is_required']) ? $request_field['is_required'] : '';
369
-            $required_msg = isset($request_field['required_msg']) ? $request_field['required_msg'] : '';
370
-            $css_class = isset($request_field['css_class']) ? $request_field['css_class'] : '';
371
-            $field_icon = isset($request_field['field_icon']) ? $request_field['field_icon'] : '';
372
-            $show_on_listing = isset($request_field['show_on_listing']) ? $request_field['show_on_listing'] : '';
373
-            $show_in = isset($request_field['show_in']) ? $request_field['show_in'] : '';
374
-            $show_on_detail = isset($request_field['show_on_detail']) ? $request_field['show_on_detail'] : '';
375
-            $show_as_tab = isset($request_field['show_as_tab']) ? $request_field['show_as_tab'] : '';
376
-            $decimal_point = isset($request_field['decimal_point']) ? trim($request_field['decimal_point']) : ''; // decimal point for DECIMAL data type
377
-            $decimal_point = $decimal_point > 0 ? ($decimal_point > 10 ? 10 : $decimal_point) : '';
378
-            $validation_pattern = isset($request_field['validation_pattern']) ? $request_field['validation_pattern'] : '';
379
-            $validation_msg = isset($request_field['validation_msg']) ? $request_field['validation_msg'] : '';
380
-            $for_admin_use = isset($request_field['for_admin_use']) ? $request_field['for_admin_use'] : '';
250
+	/**
251
+	 * Save or Update custom fields into the database.
252
+	 *
253
+	 * @since 1.0.0
254
+	 * @since 1.5.6 Fix for saving multiselect custom field "Display Type" on first attempt.
255
+	 * @package GeoDirectory
256
+	 * @global object $wpdb WordPress Database object.
257
+	 * @global string $plugin_prefix Geodirectory plugin table prefix.
258
+	 * @param array $request_field {
259
+	 *    Attributes of the request field array.
260
+	 *
261
+	 *    @type string $action Ajax Action name. Default "geodir_ajax_action".
262
+	 *    @type string $manage_field_type Field type Default "custom_fields".
263
+	 *    @type string $create_field Create field Default "true".
264
+	 *    @type string $field_ins_upd Field ins upd Default "submit".
265
+	 *    @type string $_wpnonce WP nonce value.
266
+	 *    @type string $listing_type Listing type Example "gd_place".
267
+	 *    @type string $field_type Field type Example "radio".
268
+	 *    @type string $field_id Field id Example "12".
269
+	 *    @type string $data_type Data type Example "VARCHAR".
270
+	 *    @type string $is_active Either "1" or "0". If "0" is used then the field will not be displayed anywhere.
271
+	 *    @type array $show_on_pkg Package list to display this field.
272
+	 *    @type string $admin_title Personal comment, it would not be displayed anywhere except in custom field settings.
273
+	 *    @type string $site_title Section title which you wish to display in frontend.
274
+	 *    @type string $admin_desc Section description which will appear in frontend.
275
+	 *    @type string $htmlvar_name Html variable name. This should be a unique name.
276
+	 *    @type string $clabels Section Title which will appear in backend.
277
+	 *    @type string $default_value The default value (for "link" this will be used as the link text).
278
+	 *    @type string $sort_order The display order of this field in backend. e.g. 5.
279
+	 *    @type string $is_default Either "1" or "0". If "0" is used then the field will be displayed as main form field or additional field.
280
+	 *    @type string $for_admin_use Either "1" or "0". If "0" is used then only site admin can edit this field.
281
+	 *    @type string $is_required Use "1" to set field as required.
282
+	 *    @type string $required_msg Enter text for error message if field required and have not full fill requirment.
283
+	 *    @type string $show_on_listing Want to show this on listing page?.
284
+	 *    @type string $show_in What locations to show the custom field in.
285
+	 *    @type string $show_on_detail Want to show this in More Info tab on detail page?.
286
+	 *    @type string $show_as_tab Want to display this as a tab on detail page? If "1" then "Show on detail page?" must be Yes.
287
+	 *    @type string $option_values Option Values should be separated by comma.
288
+	 *    @type string $field_icon Upload icon using media and enter its url path, or enter font awesome class.
289
+	 *    @type string $css_class Enter custom css class for field custom style.
290
+	 *
291
+	 * }
292
+	 * @param bool $default Not yet implemented.
293
+	 * @return int|string If field is unique returns inserted row id. Otherwise returns error string.
294
+	 */
295
+	function geodir_custom_field_save($request_field = array(), $default = false)
296
+	{
297
+
298
+		global $wpdb, $plugin_prefix;
299
+
300
+		$old_html_variable = '';
301
+
302
+		$data_type = trim($request_field['data_type']);
303
+
304
+		$result_str = isset($request_field['field_id']) ? trim($request_field['field_id']) : '';
305
+
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'){
308
+			$request_field['data_type'] = 'VARCHAR';
309
+		}
310
+
311
+		$cf = trim($result_str, '_');
312
+
313
+
314
+		/*-------- check dublicate validation --------*/
315
+
316
+		$cehhtmlvar_name = isset($request_field['htmlvar_name']) ? $request_field['htmlvar_name'] : '';
317
+		$post_type = $request_field['listing_type'];
318
+
319
+		if ($request_field['field_type'] != 'address' && $request_field['field_type'] != 'taxonomy' && $request_field['field_type'] != 'fieldset') {
320
+			$cehhtmlvar_name = 'geodir_' . $cehhtmlvar_name;
321
+		}
322
+
323
+		$check_html_variable = $wpdb->get_var(
324
+			$wpdb->prepare(
325
+				"select htmlvar_name from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id <> %d and htmlvar_name = %s and post_type = %s ",
326
+				array($cf, $cehhtmlvar_name, $post_type)
327
+			)
328
+		);
329
+
330
+
331
+		if (!$check_html_variable || $request_field['field_type'] == 'fieldset') {
332
+
333
+			if ($cf != '') {
334
+
335
+				$post_meta_info = $wpdb->get_row(
336
+					$wpdb->prepare(
337
+						"select * from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id = %d",
338
+						array($cf)
339
+					)
340
+				);
341
+
342
+			}
343
+
344
+			if (!empty($post_meta_info)) {
345
+				$post_val = $post_meta_info;
346
+				$old_html_variable = $post_val->htmlvar_name;
347
+
348
+			}
349
+
350
+
351
+
352
+			if ($post_type == '') $post_type = 'gd_place';
353
+
354
+
355
+			$detail_table = $plugin_prefix . $post_type . '_detail';
356
+
357
+			$admin_title = $request_field['admin_title'];
358
+			$site_title = $request_field['site_title'];
359
+			$data_type = $request_field['data_type'];
360
+			$field_type = $request_field['field_type'];
361
+			$field_type_key = $request_field['field_type_key'];
362
+			$htmlvar_name = isset($request_field['htmlvar_name']) ? $request_field['htmlvar_name'] : '';
363
+			$admin_desc = $request_field['admin_desc'];
364
+			$clabels = $request_field['clabels'];
365
+			$default_value = isset($request_field['default_value']) ? $request_field['default_value'] : '';
366
+			$sort_order = isset($request_field['sort_order']) ? $request_field['sort_order'] : '';
367
+			$is_active = isset($request_field['is_active']) ? $request_field['is_active'] : '';
368
+			$is_required = isset($request_field['is_required']) ? $request_field['is_required'] : '';
369
+			$required_msg = isset($request_field['required_msg']) ? $request_field['required_msg'] : '';
370
+			$css_class = isset($request_field['css_class']) ? $request_field['css_class'] : '';
371
+			$field_icon = isset($request_field['field_icon']) ? $request_field['field_icon'] : '';
372
+			$show_on_listing = isset($request_field['show_on_listing']) ? $request_field['show_on_listing'] : '';
373
+			$show_in = isset($request_field['show_in']) ? $request_field['show_in'] : '';
374
+			$show_on_detail = isset($request_field['show_on_detail']) ? $request_field['show_on_detail'] : '';
375
+			$show_as_tab = isset($request_field['show_as_tab']) ? $request_field['show_as_tab'] : '';
376
+			$decimal_point = isset($request_field['decimal_point']) ? trim($request_field['decimal_point']) : ''; // decimal point for DECIMAL data type
377
+			$decimal_point = $decimal_point > 0 ? ($decimal_point > 10 ? 10 : $decimal_point) : '';
378
+			$validation_pattern = isset($request_field['validation_pattern']) ? $request_field['validation_pattern'] : '';
379
+			$validation_msg = isset($request_field['validation_msg']) ? $request_field['validation_msg'] : '';
380
+			$for_admin_use = isset($request_field['for_admin_use']) ? $request_field['for_admin_use'] : '';
381 381
 
382 382
             
383
-            if(is_array($show_in)){
384
-                $show_in = implode(",", $request_field['show_in']);
385
-            }
383
+			if(is_array($show_in)){
384
+				$show_in = implode(",", $request_field['show_in']);
385
+			}
386 386
             
387
-            if ($field_type != 'address' && $field_type != 'taxonomy' && $field_type != 'fieldset') {
388
-                $htmlvar_name = 'geodir_' . $htmlvar_name;
389
-            }
387
+			if ($field_type != 'address' && $field_type != 'taxonomy' && $field_type != 'fieldset') {
388
+				$htmlvar_name = 'geodir_' . $htmlvar_name;
389
+			}
390 390
 
391
-            $option_values = '';
392
-            if (isset($request_field['option_values']))
393
-                $option_values = $request_field['option_values'];
391
+			$option_values = '';
392
+			if (isset($request_field['option_values']))
393
+				$option_values = $request_field['option_values'];
394 394
 
395
-            $cat_sort = isset($request_field['cat_sort']) ? $request_field['cat_sort'] : '0';
395
+			$cat_sort = isset($request_field['cat_sort']) ? $request_field['cat_sort'] : '0';
396 396
 
397
-            $cat_filter = isset($request_field['cat_filter']) ? $request_field['cat_filter'] : '0';
397
+			$cat_filter = isset($request_field['cat_filter']) ? $request_field['cat_filter'] : '0';
398 398
 
399
-            if (isset($request_field['show_on_pkg']) && !empty($request_field['show_on_pkg']))
400
-                $price_pkg = implode(",", $request_field['show_on_pkg']);
401
-            else {
402
-                $package_info = array();
399
+			if (isset($request_field['show_on_pkg']) && !empty($request_field['show_on_pkg']))
400
+				$price_pkg = implode(",", $request_field['show_on_pkg']);
401
+			else {
402
+				$package_info = array();
403 403
 
404
-                $package_info = geodir_post_package_info($package_info, '', $post_type);
405
-                $price_pkg = $package_info->pid;
406
-            }
404
+				$package_info = geodir_post_package_info($package_info, '', $post_type);
405
+				$price_pkg = $package_info->pid;
406
+			}
407 407
 
408 408
 
409
-            if (isset($request_field['extra']) && !empty($request_field['extra']))
410
-                $extra_fields = $request_field['extra'];
409
+			if (isset($request_field['extra']) && !empty($request_field['extra']))
410
+				$extra_fields = $request_field['extra'];
411 411
 
412
-            if (isset($request_field['is_default']) && $request_field['is_default'] != '')
413
-                $is_default = $request_field['is_default'];
414
-            else
415
-                $is_default = '0';
412
+			if (isset($request_field['is_default']) && $request_field['is_default'] != '')
413
+				$is_default = $request_field['is_default'];
414
+			else
415
+				$is_default = '0';
416 416
 
417
-            if (isset($request_field['is_admin']) && $request_field['is_admin'] != '')
418
-                $is_admin = $request_field['is_admin'];
419
-            else
420
-                $is_admin = '0';
417
+			if (isset($request_field['is_admin']) && $request_field['is_admin'] != '')
418
+				$is_admin = $request_field['is_admin'];
419
+			else
420
+				$is_admin = '0';
421 421
 
422 422
 
423
-            if ($is_active == '') $is_active = 1;
424
-            if ($is_required == '') $is_required = 0;
423
+			if ($is_active == '') $is_active = 1;
424
+			if ($is_required == '') $is_required = 0;
425 425
 
426 426
 
427
-            if ($sort_order == '') {
427
+			if ($sort_order == '') {
428 428
 
429
-                $last_order = $wpdb->get_var("SELECT MAX(sort_order) as last_order FROM " . GEODIR_CUSTOM_FIELDS_TABLE);
429
+				$last_order = $wpdb->get_var("SELECT MAX(sort_order) as last_order FROM " . GEODIR_CUSTOM_FIELDS_TABLE);
430 430
 
431
-                $sort_order = (int)$last_order + 1;
432
-            }
431
+				$sort_order = (int)$last_order + 1;
432
+			}
433 433
 
434
-            $default_value_add = '';
434
+			$default_value_add = '';
435 435
 
436 436
 
437
-            if (!empty($post_meta_info)) {
438
-                switch ($field_type):
437
+			if (!empty($post_meta_info)) {
438
+				switch ($field_type):
439 439
 
440
-                    case 'address':
440
+					case 'address':
441 441
 
442
-                        if ($htmlvar_name != '') {
443
-                            $prefix = $htmlvar_name . '_';
444
-                        }
445
-                        $old_prefix = $old_html_variable . '_';
442
+						if ($htmlvar_name != '') {
443
+							$prefix = $htmlvar_name . '_';
444
+						}
445
+						$old_prefix = $old_html_variable . '_';
446 446
 
447 447
 
448
-                        $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "address` `" . $prefix . "address` VARCHAR( 254 ) NULL";
448
+						$meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "address` `" . $prefix . "address` VARCHAR( 254 ) NULL";
449 449
 
450
-                        if ($default_value != '') {
451
-                            $meta_field_add .= " DEFAULT '" . $default_value . "'";
452
-                        }
450
+						if ($default_value != '') {
451
+							$meta_field_add .= " DEFAULT '" . $default_value . "'";
452
+						}
453 453
 
454
-                        $wpdb->query($meta_field_add);
454
+						$wpdb->query($meta_field_add);
455 455
 
456
-                        if ($extra_fields != '') {
456
+						if ($extra_fields != '') {
457 457
 
458
-                            if (isset($extra_fields['show_city']) && $extra_fields['show_city']) {
458
+							if (isset($extra_fields['show_city']) && $extra_fields['show_city']) {
459 459
 
460
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "city'");
461
-                                if ($is_column) {
462
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "city` `" . $prefix . "city` VARCHAR( 50 ) NULL";
460
+								$is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "city'");
461
+								if ($is_column) {
462
+									$meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "city` `" . $prefix . "city` VARCHAR( 50 ) NULL";
463 463
 
464
-                                    if ($default_value != '') {
465
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
466
-                                    }
464
+									if ($default_value != '') {
465
+										$meta_field_add .= " DEFAULT '" . $default_value . "'";
466
+									}
467 467
 
468
-                                    $wpdb->query($meta_field_add);
469
-                                } else {
468
+									$wpdb->query($meta_field_add);
469
+								} else {
470 470
 
471
-                                    $meta_field_add = "VARCHAR( 50 ) NULL";
472
-                                    if ($default_value != '') {
473
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
474
-                                    }
475
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "city", $meta_field_add);
471
+									$meta_field_add = "VARCHAR( 50 ) NULL";
472
+									if ($default_value != '') {
473
+										$meta_field_add .= " DEFAULT '" . $default_value . "'";
474
+									}
475
+									geodir_add_column_if_not_exist($detail_table, $prefix . "city", $meta_field_add);
476 476
 
477
-                                }
477
+								}
478 478
 
479 479
 
480
-                            }
480
+							}
481 481
 
482 482
 
483
-                            if (isset($extra_fields['show_region']) && $extra_fields['show_region']) {
483
+							if (isset($extra_fields['show_region']) && $extra_fields['show_region']) {
484 484
 
485
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "region'");
485
+								$is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "region'");
486 486
 
487
-                                if ($is_column) {
488
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "region` `" . $prefix . "region` VARCHAR( 50 ) NULL";
487
+								if ($is_column) {
488
+									$meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "region` `" . $prefix . "region` VARCHAR( 50 ) NULL";
489 489
 
490
-                                    if ($default_value != '') {
491
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
492
-                                    }
490
+									if ($default_value != '') {
491
+										$meta_field_add .= " DEFAULT '" . $default_value . "'";
492
+									}
493 493
 
494
-                                    $wpdb->query($meta_field_add);
495
-                                } else {
496
-                                    $meta_field_add = "VARCHAR( 50 ) NULL";
497
-                                    if ($default_value != '') {
498
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
499
-                                    }
494
+									$wpdb->query($meta_field_add);
495
+								} else {
496
+									$meta_field_add = "VARCHAR( 50 ) NULL";
497
+									if ($default_value != '') {
498
+										$meta_field_add .= " DEFAULT '" . $default_value . "'";
499
+									}
500 500
 
501
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "region", $meta_field_add);
502
-                                }
501
+									geodir_add_column_if_not_exist($detail_table, $prefix . "region", $meta_field_add);
502
+								}
503 503
 
504
-                            }
505
-                            if (isset($extra_fields['show_country']) && $extra_fields['show_country']) {
504
+							}
505
+							if (isset($extra_fields['show_country']) && $extra_fields['show_country']) {
506 506
 
507
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "country'");
507
+								$is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "country'");
508 508
 
509
-                                if ($is_column) {
509
+								if ($is_column) {
510 510
 
511
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "country` `" . $prefix . "country` VARCHAR( 50 ) NULL";
511
+									$meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "country` `" . $prefix . "country` VARCHAR( 50 ) NULL";
512 512
 
513
-                                    if ($default_value != '') {
514
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
515
-                                    }
513
+									if ($default_value != '') {
514
+										$meta_field_add .= " DEFAULT '" . $default_value . "'";
515
+									}
516 516
 
517
-                                    $wpdb->query($meta_field_add);
518
-                                } else {
517
+									$wpdb->query($meta_field_add);
518
+								} else {
519 519
 
520
-                                    $meta_field_add = "VARCHAR( 50 ) NULL";
521
-                                    if ($default_value != '') {
522
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
523
-                                    }
520
+									$meta_field_add = "VARCHAR( 50 ) NULL";
521
+									if ($default_value != '') {
522
+										$meta_field_add .= " DEFAULT '" . $default_value . "'";
523
+									}
524 524
 
525
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "country", $meta_field_add);
525
+									geodir_add_column_if_not_exist($detail_table, $prefix . "country", $meta_field_add);
526 526
 
527
-                                }
527
+								}
528 528
 
529
-                            }
530
-                            if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) {
529
+							}
530
+							if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) {
531 531
 
532
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "zip'");
532
+								$is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "zip'");
533 533
 
534
-                                if ($is_column) {
534
+								if ($is_column) {
535 535
 
536
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "zip` `" . $prefix . "zip` VARCHAR( 50 ) NULL";
536
+									$meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "zip` `" . $prefix . "zip` VARCHAR( 50 ) NULL";
537 537
 
538
-                                    if ($default_value != '') {
539
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
540
-                                    }
538
+									if ($default_value != '') {
539
+										$meta_field_add .= " DEFAULT '" . $default_value . "'";
540
+									}
541 541
 
542
-                                    $wpdb->query($meta_field_add);
543
-                                } else {
542
+									$wpdb->query($meta_field_add);
543
+								} else {
544 544
 
545
-                                    $meta_field_add = "VARCHAR( 50 ) NULL";
546
-                                    if ($default_value != '') {
547
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
548
-                                    }
545
+									$meta_field_add = "VARCHAR( 50 ) NULL";
546
+									if ($default_value != '') {
547
+										$meta_field_add .= " DEFAULT '" . $default_value . "'";
548
+									}
549 549
 
550
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "zip", $meta_field_add);
550
+									geodir_add_column_if_not_exist($detail_table, $prefix . "zip", $meta_field_add);
551 551
 
552
-                                }
552
+								}
553 553
 
554
-                            }
555
-                            if (isset($extra_fields['show_map']) && $extra_fields['show_map']) {
554
+							}
555
+							if (isset($extra_fields['show_map']) && $extra_fields['show_map']) {
556 556
 
557
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "latitude'");
558
-                                if ($is_column) {
557
+								$is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "latitude'");
558
+								if ($is_column) {
559 559
 
560
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "latitude` `" . $prefix . "latitude` VARCHAR( 20 ) NULL";
560
+									$meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "latitude` `" . $prefix . "latitude` VARCHAR( 20 ) NULL";
561 561
 
562
-                                    if ($default_value != '') {
563
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
564
-                                    }
562
+									if ($default_value != '') {
563
+										$meta_field_add .= " DEFAULT '" . $default_value . "'";
564
+									}
565 565
 
566
-                                    $wpdb->query($meta_field_add);
567
-                                } else {
566
+									$wpdb->query($meta_field_add);
567
+								} else {
568 568
 
569
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "latitude` VARCHAR( 20 ) NULL";
570
-                                    $meta_field_add = "VARCHAR( 20 ) NULL";
571
-                                    if ($default_value != '') {
572
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
573
-                                    }
569
+									$meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "latitude` VARCHAR( 20 ) NULL";
570
+									$meta_field_add = "VARCHAR( 20 ) NULL";
571
+									if ($default_value != '') {
572
+										$meta_field_add .= " DEFAULT '" . $default_value . "'";
573
+									}
574 574
 
575
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "latitude", $meta_field_add);
575
+									geodir_add_column_if_not_exist($detail_table, $prefix . "latitude", $meta_field_add);
576 576
 
577
-                                }
577
+								}
578 578
 
579 579
 
580
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "longitude'");
580
+								$is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "longitude'");
581 581
 
582
-                                if ($is_column) {
583
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "longitude` `" . $prefix . "longitude` VARCHAR( 20 ) NULL";
582
+								if ($is_column) {
583
+									$meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "longitude` `" . $prefix . "longitude` VARCHAR( 20 ) NULL";
584 584
 
585
-                                    if ($default_value != '') {
586
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
587
-                                    }
585
+									if ($default_value != '') {
586
+										$meta_field_add .= " DEFAULT '" . $default_value . "'";
587
+									}
588 588
 
589
-                                    $wpdb->query($meta_field_add);
590
-                                } else {
589
+									$wpdb->query($meta_field_add);
590
+								} else {
591 591
 
592
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "longitude` VARCHAR( 20 ) NULL";
593
-                                    $meta_field_add = "VARCHAR( 20 ) NULL";
594
-                                    if ($default_value != '') {
595
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
596
-                                    }
592
+									$meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "longitude` VARCHAR( 20 ) NULL";
593
+									$meta_field_add = "VARCHAR( 20 ) NULL";
594
+									if ($default_value != '') {
595
+										$meta_field_add .= " DEFAULT '" . $default_value . "'";
596
+									}
597 597
 
598
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "longitude", $meta_field_add);
599
-                                }
598
+									geodir_add_column_if_not_exist($detail_table, $prefix . "longitude", $meta_field_add);
599
+								}
600 600
 
601
-                            }
602
-                            if (isset($extra_fields['show_mapview']) && $extra_fields['show_mapview']) {
601
+							}
602
+							if (isset($extra_fields['show_mapview']) && $extra_fields['show_mapview']) {
603 603
 
604
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "mapview'");
604
+								$is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "mapview'");
605 605
 
606
-                                if ($is_column) {
607
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "mapview` `" . $prefix . "mapview` VARCHAR( 15 ) NULL";
606
+								if ($is_column) {
607
+									$meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "mapview` `" . $prefix . "mapview` VARCHAR( 15 ) NULL";
608 608
 
609
-                                    if ($default_value != '') {
610
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
611
-                                    }
609
+									if ($default_value != '') {
610
+										$meta_field_add .= " DEFAULT '" . $default_value . "'";
611
+									}
612 612
 
613
-                                    $wpdb->query($meta_field_add);
614
-                                } else {
613
+									$wpdb->query($meta_field_add);
614
+								} else {
615 615
 
616
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "mapview` VARCHAR( 15 ) NULL";
616
+									$meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "mapview` VARCHAR( 15 ) NULL";
617 617
 
618
-                                    $meta_field_add = "VARCHAR( 15 ) NULL";
619
-                                    if ($default_value != '') {
620
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
621
-                                    }
618
+									$meta_field_add = "VARCHAR( 15 ) NULL";
619
+									if ($default_value != '') {
620
+										$meta_field_add .= " DEFAULT '" . $default_value . "'";
621
+									}
622 622
 
623
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "mapview", $meta_field_add);
624
-                                }
623
+									geodir_add_column_if_not_exist($detail_table, $prefix . "mapview", $meta_field_add);
624
+								}
625 625
 
626 626
 
627
-                            }
628
-                            if (isset($extra_fields['show_mapzoom']) && $extra_fields['show_mapzoom']) {
627
+							}
628
+							if (isset($extra_fields['show_mapzoom']) && $extra_fields['show_mapzoom']) {
629 629
 
630
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "mapzoom'");
631
-                                if ($is_column) {
632
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "mapzoom` `" . $prefix . "mapzoom` VARCHAR( 3 ) NULL";
630
+								$is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "mapzoom'");
631
+								if ($is_column) {
632
+									$meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "mapzoom` `" . $prefix . "mapzoom` VARCHAR( 3 ) NULL";
633 633
 
634
-                                    if ($default_value != '') {
635
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
636
-                                    }
634
+									if ($default_value != '') {
635
+										$meta_field_add .= " DEFAULT '" . $default_value . "'";
636
+									}
637 637
 
638
-                                    $wpdb->query($meta_field_add);
638
+									$wpdb->query($meta_field_add);
639 639
 
640
-                                } else {
640
+								} else {
641 641
 
642
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "mapzoom` VARCHAR( 3 ) NULL";
642
+									$meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "mapzoom` VARCHAR( 3 ) NULL";
643 643
 
644
-                                    $meta_field_add = "VARCHAR( 3 ) NULL";
645
-                                    if ($default_value != '') {
646
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
647
-                                    }
644
+									$meta_field_add = "VARCHAR( 3 ) NULL";
645
+									if ($default_value != '') {
646
+										$meta_field_add .= " DEFAULT '" . $default_value . "'";
647
+									}
648 648
 
649
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "mapzoom", $meta_field_add);
650
-                                }
649
+									geodir_add_column_if_not_exist($detail_table, $prefix . "mapzoom", $meta_field_add);
650
+								}
651 651
 
652
-                            }
653
-                            // show lat lng
654
-                            if (isset($extra_fields['show_latlng']) && $extra_fields['show_latlng']) {
655
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "latlng'");
652
+							}
653
+							// show lat lng
654
+							if (isset($extra_fields['show_latlng']) && $extra_fields['show_latlng']) {
655
+								$is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "latlng'");
656 656
 
657
-                                if ($is_column) {
658
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "latlng` `" . $prefix . "latlng` VARCHAR( 3 ) NULL";
659
-                                    $meta_field_add .= " DEFAULT '1'";
657
+								if ($is_column) {
658
+									$meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "latlng` `" . $prefix . "latlng` VARCHAR( 3 ) NULL";
659
+									$meta_field_add .= " DEFAULT '1'";
660 660
 
661
-                                    $wpdb->query($meta_field_add);
662
-                                } else {
663
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "latlng` VARCHAR( 3 ) NULL";
661
+									$wpdb->query($meta_field_add);
662
+								} else {
663
+									$meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "latlng` VARCHAR( 3 ) NULL";
664 664
 
665
-                                    $meta_field_add = "VARCHAR( 3 ) NULL";
666
-                                    $meta_field_add .= " DEFAULT '1'";
665
+									$meta_field_add = "VARCHAR( 3 ) NULL";
666
+									$meta_field_add .= " DEFAULT '1'";
667 667
 
668
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "latlng", $meta_field_add);
669
-                                }
668
+									geodir_add_column_if_not_exist($detail_table, $prefix . "latlng", $meta_field_add);
669
+								}
670 670
 
671
-                            }
672
-                        }// end extra
671
+							}
672
+						}// end extra
673 673
 
674
-                        break;
674
+						break;
675 675
 
676
-                    case 'checkbox':
677
-                    case 'multiselect':
678
-                    case 'select':
679
-                    case 'taxonomy':
676
+					case 'checkbox':
677
+					case 'multiselect':
678
+					case 'select':
679
+					case 'taxonomy':
680 680
 
681
-                        $op_size = '500';
681
+						$op_size = '500';
682 682
 
683
-                        // only make the field as big as it needs to be.
684
-                        if(isset($option_values) && $option_values && $field_type=='select'){
685
-                            $option_values_arr = explode(',',$option_values);
686
-                            if(is_array($option_values_arr)){
687
-                                $op_max = 0;
688
-                                foreach($option_values_arr as $op_val){
689
-                                    if(strlen($op_val) && strlen($op_val)>$op_max){$op_max = strlen($op_val);}
690
-                                }
691
-                                if($op_max){$op_size =$op_max; }
692
-                            }
693
-                        }elseif(isset($option_values) && $option_values && $field_type=='multiselect'){
694
-                            if(strlen($option_values)){
695
-                                $op_size =  strlen($option_values);
696
-                            }
697
-                        }
683
+						// only make the field as big as it needs to be.
684
+						if(isset($option_values) && $option_values && $field_type=='select'){
685
+							$option_values_arr = explode(',',$option_values);
686
+							if(is_array($option_values_arr)){
687
+								$op_max = 0;
688
+								foreach($option_values_arr as $op_val){
689
+									if(strlen($op_val) && strlen($op_val)>$op_max){$op_max = strlen($op_val);}
690
+								}
691
+								if($op_max){$op_size =$op_max; }
692
+							}
693
+						}elseif(isset($option_values) && $option_values && $field_type=='multiselect'){
694
+							if(strlen($option_values)){
695
+								$op_size =  strlen($option_values);
696
+							}
697
+						}
698 698
 
699
-                        $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "`VARCHAR( $op_size ) NULL";
699
+						$meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "`VARCHAR( $op_size ) NULL";
700 700
 
701
-                        if ($default_value != '') {
702
-                            $meta_field_add .= " DEFAULT '" . $default_value . "'";
703
-                        }
701
+						if ($default_value != '') {
702
+							$meta_field_add .= " DEFAULT '" . $default_value . "'";
703
+						}
704 704
 
705
-                        $alter_result = $wpdb->query($meta_field_add);
706
-                        if($alter_result===false){
707
-                            return __('Column change failed, you may have too many columns.','geodirectory');
708
-                        }
705
+						$alter_result = $wpdb->query($meta_field_add);
706
+						if($alter_result===false){
707
+							return __('Column change failed, you may have too many columns.','geodirectory');
708
+						}
709 709
 
710
-                        if (isset($request_field['cat_display_type']))
711
-                            $extra_fields = $request_field['cat_display_type'];
710
+						if (isset($request_field['cat_display_type']))
711
+							$extra_fields = $request_field['cat_display_type'];
712 712
 
713
-                        if (isset($request_field['multi_display_type']))
714
-                            $extra_fields = $request_field['multi_display_type'];
713
+						if (isset($request_field['multi_display_type']))
714
+							$extra_fields = $request_field['multi_display_type'];
715 715
 
716 716
 
717
-                        break;
717
+						break;
718 718
 
719
-                    case 'textarea':
720
-                    case 'html':
721
-                    case 'url':
722
-                    case 'file':
719
+					case 'textarea':
720
+					case 'html':
721
+					case 'url':
722
+					case 'file':
723 723
 
724
-                        $alter_result = $wpdb->query("ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "` TEXT NULL");
725
-                        if($alter_result===false){
726
-                            return __('Column change failed, you may have too many columns.','geodirectory');
727
-                        }
728
-                        if (isset($request_field['advanced_editor']))
729
-                            $extra_fields = $request_field['advanced_editor'];
730
-
731
-                        break;
724
+						$alter_result = $wpdb->query("ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "` TEXT NULL");
725
+						if($alter_result===false){
726
+							return __('Column change failed, you may have too many columns.','geodirectory');
727
+						}
728
+						if (isset($request_field['advanced_editor']))
729
+							$extra_fields = $request_field['advanced_editor'];
730
+
731
+						break;
732 732
 
733
-                    case 'fieldset':
734
-                        // Nothig happend for fieldset
735
-                        break;
733
+					case 'fieldset':
734
+						// Nothig happend for fieldset
735
+						break;
736 736
 
737
-                    default:
738
-                        if ($data_type != 'VARCHAR' && $data_type != '') {
739
-                            if ($data_type == 'FLOAT' && $decimal_point > 0) {
740
-                                $default_value_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "` DECIMAL(11, " . (int)$decimal_point . ") NULL";
741
-                            } else {
742
-                                $default_value_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "` " . $data_type . " NULL";
743
-                            }
744
-
745
-                            if (is_numeric($default_value) && $default_value != '') {
746
-                                $default_value_add .= " DEFAULT '" . $default_value . "'";
747
-                            }
748
-                        } else {
749
-                            $default_value_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "` VARCHAR( 254 ) NULL";
750
-                            if ($default_value != '') {
751
-                                $default_value_add .= " DEFAULT '" . $default_value . "'";
752
-                            }
753
-                        }
754
-
755
-                        $alter_result = $wpdb->query($default_value_add);
756
-                        if($alter_result===false){
757
-                            return __('Column change failed, you may have too many columns.','geodirectory');
758
-                        }
759
-                        break;
760
-                endswitch;
761
-
762
-                $extra_field_query = '';
763
-                if (!empty($extra_fields)) {
764
-                    $extra_field_query = serialize($extra_fields);
765
-                }
766
-
767
-                $decimal_point = $field_type == 'text' && $data_type == 'FLOAT' ? $decimal_point : '';
768
-
769
-                $wpdb->query(
770
-
771
-                    $wpdb->prepare(
772
-
773
-                        "update " . GEODIR_CUSTOM_FIELDS_TABLE . " set 
737
+					default:
738
+						if ($data_type != 'VARCHAR' && $data_type != '') {
739
+							if ($data_type == 'FLOAT' && $decimal_point > 0) {
740
+								$default_value_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "` DECIMAL(11, " . (int)$decimal_point . ") NULL";
741
+							} else {
742
+								$default_value_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "` " . $data_type . " NULL";
743
+							}
744
+
745
+							if (is_numeric($default_value) && $default_value != '') {
746
+								$default_value_add .= " DEFAULT '" . $default_value . "'";
747
+							}
748
+						} else {
749
+							$default_value_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "` VARCHAR( 254 ) NULL";
750
+							if ($default_value != '') {
751
+								$default_value_add .= " DEFAULT '" . $default_value . "'";
752
+							}
753
+						}
754
+
755
+						$alter_result = $wpdb->query($default_value_add);
756
+						if($alter_result===false){
757
+							return __('Column change failed, you may have too many columns.','geodirectory');
758
+						}
759
+						break;
760
+				endswitch;
761
+
762
+				$extra_field_query = '';
763
+				if (!empty($extra_fields)) {
764
+					$extra_field_query = serialize($extra_fields);
765
+				}
766
+
767
+				$decimal_point = $field_type == 'text' && $data_type == 'FLOAT' ? $decimal_point : '';
768
+
769
+				$wpdb->query(
770
+
771
+					$wpdb->prepare(
772
+
773
+						"update " . GEODIR_CUSTOM_FIELDS_TABLE . " set 
774 774
 					post_type = %s,
775 775
 					admin_title = %s,
776 776
 					site_title = %s,
@@ -804,308 +804,308 @@  discard block
 block discarded – undo
804 804
 					for_admin_use = %s
805 805
 					where id = %d",
806 806
 
807
-                        array($post_type, $admin_title, $site_title, $field_type, $field_type_key, $htmlvar_name, $admin_desc, $clabels, $default_value, $sort_order, $is_active, $is_default, $is_required, $required_msg, $css_class, $field_icon, $field_icon, $show_on_listing, $show_in, $show_on_detail, $show_as_tab, $option_values, $price_pkg, $cat_sort, $cat_filter, $data_type, $extra_field_query, $decimal_point,$validation_pattern,$validation_msg, $for_admin_use, $cf)
808
-                    )
807
+						array($post_type, $admin_title, $site_title, $field_type, $field_type_key, $htmlvar_name, $admin_desc, $clabels, $default_value, $sort_order, $is_active, $is_default, $is_required, $required_msg, $css_class, $field_icon, $field_icon, $show_on_listing, $show_in, $show_on_detail, $show_as_tab, $option_values, $price_pkg, $cat_sort, $cat_filter, $data_type, $extra_field_query, $decimal_point,$validation_pattern,$validation_msg, $for_admin_use, $cf)
808
+					)
809 809
 
810
-                );
810
+				);
811 811
 
812
-                $lastid = trim($cf);
812
+				$lastid = trim($cf);
813 813
 
814 814
 
815
-                $wpdb->query(
816
-                    $wpdb->prepare(
817
-                        "update " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set 
815
+				$wpdb->query(
816
+					$wpdb->prepare(
817
+						"update " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set 
818 818
 					 	site_title=%s
819 819
 					where post_type = %s and htmlvar_name = %s",
820
-                        array($site_title, $post_type, $htmlvar_name)
821
-                    )
822
-                );
823
-
824
-
825
-                if ($cat_sort == '')
826
-                    $wpdb->query($wpdb->prepare("delete from " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " where post_type = %s and htmlvar_name = %s", array($post_type, $htmlvar_name)));
827
-
828
-
829
-                /**
830
-                 * Called after all custom fields are saved for a post.
831
-                 *
832
-                 * @since 1.0.0
833
-                 * @param int $lastid The post ID.
834
-                 */
835
-                do_action('geodir_after_custom_fields_updated', $lastid);
836
-
837
-            } else {
838
-
839
-                switch ($field_type):
840
-
841
-                    case 'address':
842
-
843
-                        $data_type = '';
844
-
845
-                        if ($htmlvar_name != '') {
846
-                            $prefix = $htmlvar_name . '_';
847
-                        }
848
-                        $old_prefix = $old_html_variable;
849
-
850
-                        //$meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."address` VARCHAR( 254 ) NULL";
851
-
852
-                        $meta_field_add = "VARCHAR( 254 ) NULL";
853
-                        if ($default_value != '') {
854
-                            $meta_field_add .= " DEFAULT '" . $default_value . "'";
855
-                        }
856
-
857
-                        geodir_add_column_if_not_exist($detail_table, $prefix . "address", $meta_field_add);
858
-                        //$wpdb->query($meta_field_add);
859
-
860
-
861
-                        if (!empty($extra_fields)) {
820
+						array($site_title, $post_type, $htmlvar_name)
821
+					)
822
+				);
823
+
824
+
825
+				if ($cat_sort == '')
826
+					$wpdb->query($wpdb->prepare("delete from " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " where post_type = %s and htmlvar_name = %s", array($post_type, $htmlvar_name)));
827
+
828
+
829
+				/**
830
+				 * Called after all custom fields are saved for a post.
831
+				 *
832
+				 * @since 1.0.0
833
+				 * @param int $lastid The post ID.
834
+				 */
835
+				do_action('geodir_after_custom_fields_updated', $lastid);
836
+
837
+			} else {
838
+
839
+				switch ($field_type):
840
+
841
+					case 'address':
842
+
843
+						$data_type = '';
844
+
845
+						if ($htmlvar_name != '') {
846
+							$prefix = $htmlvar_name . '_';
847
+						}
848
+						$old_prefix = $old_html_variable;
849
+
850
+						//$meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."address` VARCHAR( 254 ) NULL";
851
+
852
+						$meta_field_add = "VARCHAR( 254 ) NULL";
853
+						if ($default_value != '') {
854
+							$meta_field_add .= " DEFAULT '" . $default_value . "'";
855
+						}
856
+
857
+						geodir_add_column_if_not_exist($detail_table, $prefix . "address", $meta_field_add);
858
+						//$wpdb->query($meta_field_add);
859
+
860
+
861
+						if (!empty($extra_fields)) {
862 862
 
863
-                            if (isset($extra_fields['show_city']) && $extra_fields['show_city']) {
864
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "city` VARCHAR( 30 ) NULL";
865
-                                $meta_field_add = "VARCHAR( 30 ) NULL";
866
-                                if ($default_value != '') {
867
-                                    $meta_field_add .= " DEFAULT '" . $default_value . "'";
868
-                                }
869
-
870
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "city", $meta_field_add);
871
-                                //$wpdb->query($meta_field_add);
872
-                            }
873
-                            if (isset($extra_fields['show_region']) && $extra_fields['show_region']) {
874
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "region` VARCHAR( 30 ) NULL";
875
-                                $meta_field_add = "VARCHAR( 30 ) NULL";
876
-                                if ($default_value != '') {
877
-                                    $meta_field_add .= " DEFAULT '" . $default_value . "'";
878
-                                }
879
-
880
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "region", $meta_field_add);
881
-                                //$wpdb->query($meta_field_add);
882
-                            }
883
-                            if (isset($extra_fields['show_country']) && $extra_fields['show_country']) {
884
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "country` VARCHAR( 30 ) NULL";
885
-
886
-                                $meta_field_add = "VARCHAR( 30 ) NULL";
887
-                                if ($default_value != '') {
888
-                                    $meta_field_add .= " DEFAULT '" . $default_value . "'";
889
-                                }
890
-
891
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "country", $meta_field_add);
892
-                                //$wpdb->query($meta_field_add);
893
-                            }
894
-                            if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) {
895
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "zip` VARCHAR( 15 ) NULL";
896
-                                $meta_field_add = "VARCHAR( 15 ) NULL";
897
-                                if ($default_value != '') {
898
-                                    $meta_field_add .= " DEFAULT '" . $default_value . "'";
899
-                                }
900
-
901
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "zip", $meta_field_add);
902
-                                //$wpdb->query($meta_field_add);
903
-                            }
904
-                            if (isset($extra_fields['show_map']) && $extra_fields['show_map']) {
905
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "latitude` VARCHAR( 20 ) NULL";
906
-                                $meta_field_add = "VARCHAR( 20 ) NULL";
907
-                                if ($default_value != '') {
908
-                                    $meta_field_add .= " DEFAULT '" . $default_value . "'";
909
-                                }
910
-
911
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "latitude", $meta_field_add);
912
-                                //$wpdb->query($meta_field_add);
913
-
914
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "longitude` VARCHAR( 20 ) NULL";
915
-
916
-                                $meta_field_add = "VARCHAR( 20 ) NULL";
917
-                                if ($default_value != '') {
918
-                                    $meta_field_add .= " DEFAULT '" . $default_value . "'";
919
-                                }
920
-
921
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "longitude", $meta_field_add);
922
-
923
-                                //$wpdb->query($meta_field_add);
924
-                            }
925
-                            if (isset($extra_fields['show_mapview']) && $extra_fields['show_mapview']) {
926
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "mapview` VARCHAR( 15 ) NULL";
927
-
928
-                                $meta_field_add = "VARCHAR( 15 ) NULL";
929
-                                if ($default_value != '') {
930
-                                    $meta_field_add .= " DEFAULT '" . $default_value . "'";
931
-                                }
932
-
933
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "mapview", $meta_field_add);
934
-
935
-                                //$wpdb->query($meta_field_add);
936
-                            }
937
-                            if (isset($extra_fields['show_mapzoom']) && $extra_fields['show_mapzoom']) {
938
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "mapzoom` VARCHAR( 3 ) NULL";
939
-
940
-                                $meta_field_add = "VARCHAR( 3 ) NULL";
941
-                                if ($default_value != '') {
942
-                                    $meta_field_add .= " DEFAULT '" . $default_value . "'";
943
-                                }
944
-
945
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "mapzoom", $meta_field_add);
946
-
947
-                                //$wpdb->query($meta_field_add);
948
-                            }
949
-                            // show lat lng
950
-                            if (isset($extra_fields['show_latlng']) && $extra_fields['show_latlng']) {
951
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "latlng` VARCHAR( 3 ) NULL";
952
-
953
-                                $meta_field_add = "VARCHAR( 3 ) NULL";
954
-                                $meta_field_add .= " DEFAULT '1'";
955
-
956
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "latlng", $meta_field_add);
957
-                                //$wpdb->query($meta_field_add);
958
-                            }
959
-                        }
960
-
961
-                        break;
962
-
963
-                    case 'checkbox':
964
-                        $data_type = 'TINYINT';
965
-
966
-                        $meta_field_add = $data_type . "( 1 ) NOT NULL ";
967
-                        if ((int)$default_value === 1) {
968
-                            $meta_field_add .= " DEFAULT '1'";
969
-                        }
970
-
971
-                        $add_result = geodir_add_column_if_not_exist($detail_table, $htmlvar_name, $meta_field_add);
972
-                        if ($add_result === false) {
973
-                            return __('Column creation failed, you may have too many columns or the default value does not match with field data type.', 'geodirectory');
974
-                        }
975
-                        break;
976
-                    case 'multiselect':
977
-                    case 'select':
978
-                        $data_type = 'VARCHAR';
979
-                        $op_size = '500';
980
-
981
-                        // only make the field as big as it needs to be.
982
-                        if (isset($option_values) && $option_values && $field_type == 'select') {
983
-                            $option_values_arr = explode(',', $option_values);
984
-
985
-                            if (is_array($option_values_arr)) {
986
-                                $op_max = 0;
987
-
988
-                                foreach ($option_values_arr as $op_val) {
989
-                                    if (strlen($op_val) && strlen($op_val) > $op_max) {
990
-                                        $op_max = strlen($op_val);
991
-                                    }
992
-                                }
993
-
994
-                                if ($op_max) {
995
-                                    $op_size = $op_max;
996
-                                }
997
-                            }
998
-                        } elseif (isset($option_values) && $option_values && $field_type == 'multiselect') {
999
-                            if (strlen($option_values)) {
1000
-                                $op_size =  strlen($option_values);
1001
-                            }
1002
-
1003
-                            if (isset($request_field['multi_display_type'])) {
1004
-                                $extra_fields = $request_field['multi_display_type'];
1005
-                            }
1006
-                        }
1007
-
1008
-                        $meta_field_add = $data_type . "( $op_size ) NULL ";
1009
-                        if ($default_value != '') {
1010
-                            $meta_field_add .= " DEFAULT '" . $default_value . "'";
1011
-                        }
1012
-
1013
-                        $add_result = geodir_add_column_if_not_exist($detail_table, $htmlvar_name, $meta_field_add);
1014
-                        if ($add_result === false) {
1015
-                            return __('Column creation failed, you may have too many columns or the default value does not match with field data type.', 'geodirectory');
1016
-                        }
1017
-                        break;
1018
-                    case 'textarea':
1019
-                    case 'html':
1020
-                    case 'url':
1021
-                    case 'file':
1022
-
1023
-                        $data_type = 'TEXT';
1024
-
1025
-                        $default_value_add = " `" . $htmlvar_name . "` " . $data_type . " NULL ";
1026
-
1027
-                        $meta_field_add = $data_type . " NULL ";
1028
-                        /*if($default_value != '')
863
+							if (isset($extra_fields['show_city']) && $extra_fields['show_city']) {
864
+								$meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "city` VARCHAR( 30 ) NULL";
865
+								$meta_field_add = "VARCHAR( 30 ) NULL";
866
+								if ($default_value != '') {
867
+									$meta_field_add .= " DEFAULT '" . $default_value . "'";
868
+								}
869
+
870
+								geodir_add_column_if_not_exist($detail_table, $prefix . "city", $meta_field_add);
871
+								//$wpdb->query($meta_field_add);
872
+							}
873
+							if (isset($extra_fields['show_region']) && $extra_fields['show_region']) {
874
+								$meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "region` VARCHAR( 30 ) NULL";
875
+								$meta_field_add = "VARCHAR( 30 ) NULL";
876
+								if ($default_value != '') {
877
+									$meta_field_add .= " DEFAULT '" . $default_value . "'";
878
+								}
879
+
880
+								geodir_add_column_if_not_exist($detail_table, $prefix . "region", $meta_field_add);
881
+								//$wpdb->query($meta_field_add);
882
+							}
883
+							if (isset($extra_fields['show_country']) && $extra_fields['show_country']) {
884
+								$meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "country` VARCHAR( 30 ) NULL";
885
+
886
+								$meta_field_add = "VARCHAR( 30 ) NULL";
887
+								if ($default_value != '') {
888
+									$meta_field_add .= " DEFAULT '" . $default_value . "'";
889
+								}
890
+
891
+								geodir_add_column_if_not_exist($detail_table, $prefix . "country", $meta_field_add);
892
+								//$wpdb->query($meta_field_add);
893
+							}
894
+							if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) {
895
+								$meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "zip` VARCHAR( 15 ) NULL";
896
+								$meta_field_add = "VARCHAR( 15 ) NULL";
897
+								if ($default_value != '') {
898
+									$meta_field_add .= " DEFAULT '" . $default_value . "'";
899
+								}
900
+
901
+								geodir_add_column_if_not_exist($detail_table, $prefix . "zip", $meta_field_add);
902
+								//$wpdb->query($meta_field_add);
903
+							}
904
+							if (isset($extra_fields['show_map']) && $extra_fields['show_map']) {
905
+								$meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "latitude` VARCHAR( 20 ) NULL";
906
+								$meta_field_add = "VARCHAR( 20 ) NULL";
907
+								if ($default_value != '') {
908
+									$meta_field_add .= " DEFAULT '" . $default_value . "'";
909
+								}
910
+
911
+								geodir_add_column_if_not_exist($detail_table, $prefix . "latitude", $meta_field_add);
912
+								//$wpdb->query($meta_field_add);
913
+
914
+								$meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "longitude` VARCHAR( 20 ) NULL";
915
+
916
+								$meta_field_add = "VARCHAR( 20 ) NULL";
917
+								if ($default_value != '') {
918
+									$meta_field_add .= " DEFAULT '" . $default_value . "'";
919
+								}
920
+
921
+								geodir_add_column_if_not_exist($detail_table, $prefix . "longitude", $meta_field_add);
922
+
923
+								//$wpdb->query($meta_field_add);
924
+							}
925
+							if (isset($extra_fields['show_mapview']) && $extra_fields['show_mapview']) {
926
+								$meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "mapview` VARCHAR( 15 ) NULL";
927
+
928
+								$meta_field_add = "VARCHAR( 15 ) NULL";
929
+								if ($default_value != '') {
930
+									$meta_field_add .= " DEFAULT '" . $default_value . "'";
931
+								}
932
+
933
+								geodir_add_column_if_not_exist($detail_table, $prefix . "mapview", $meta_field_add);
934
+
935
+								//$wpdb->query($meta_field_add);
936
+							}
937
+							if (isset($extra_fields['show_mapzoom']) && $extra_fields['show_mapzoom']) {
938
+								$meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "mapzoom` VARCHAR( 3 ) NULL";
939
+
940
+								$meta_field_add = "VARCHAR( 3 ) NULL";
941
+								if ($default_value != '') {
942
+									$meta_field_add .= " DEFAULT '" . $default_value . "'";
943
+								}
944
+
945
+								geodir_add_column_if_not_exist($detail_table, $prefix . "mapzoom", $meta_field_add);
946
+
947
+								//$wpdb->query($meta_field_add);
948
+							}
949
+							// show lat lng
950
+							if (isset($extra_fields['show_latlng']) && $extra_fields['show_latlng']) {
951
+								$meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "latlng` VARCHAR( 3 ) NULL";
952
+
953
+								$meta_field_add = "VARCHAR( 3 ) NULL";
954
+								$meta_field_add .= " DEFAULT '1'";
955
+
956
+								geodir_add_column_if_not_exist($detail_table, $prefix . "latlng", $meta_field_add);
957
+								//$wpdb->query($meta_field_add);
958
+							}
959
+						}
960
+
961
+						break;
962
+
963
+					case 'checkbox':
964
+						$data_type = 'TINYINT';
965
+
966
+						$meta_field_add = $data_type . "( 1 ) NOT NULL ";
967
+						if ((int)$default_value === 1) {
968
+							$meta_field_add .= " DEFAULT '1'";
969
+						}
970
+
971
+						$add_result = geodir_add_column_if_not_exist($detail_table, $htmlvar_name, $meta_field_add);
972
+						if ($add_result === false) {
973
+							return __('Column creation failed, you may have too many columns or the default value does not match with field data type.', 'geodirectory');
974
+						}
975
+						break;
976
+					case 'multiselect':
977
+					case 'select':
978
+						$data_type = 'VARCHAR';
979
+						$op_size = '500';
980
+
981
+						// only make the field as big as it needs to be.
982
+						if (isset($option_values) && $option_values && $field_type == 'select') {
983
+							$option_values_arr = explode(',', $option_values);
984
+
985
+							if (is_array($option_values_arr)) {
986
+								$op_max = 0;
987
+
988
+								foreach ($option_values_arr as $op_val) {
989
+									if (strlen($op_val) && strlen($op_val) > $op_max) {
990
+										$op_max = strlen($op_val);
991
+									}
992
+								}
993
+
994
+								if ($op_max) {
995
+									$op_size = $op_max;
996
+								}
997
+							}
998
+						} elseif (isset($option_values) && $option_values && $field_type == 'multiselect') {
999
+							if (strlen($option_values)) {
1000
+								$op_size =  strlen($option_values);
1001
+							}
1002
+
1003
+							if (isset($request_field['multi_display_type'])) {
1004
+								$extra_fields = $request_field['multi_display_type'];
1005
+							}
1006
+						}
1007
+
1008
+						$meta_field_add = $data_type . "( $op_size ) NULL ";
1009
+						if ($default_value != '') {
1010
+							$meta_field_add .= " DEFAULT '" . $default_value . "'";
1011
+						}
1012
+
1013
+						$add_result = geodir_add_column_if_not_exist($detail_table, $htmlvar_name, $meta_field_add);
1014
+						if ($add_result === false) {
1015
+							return __('Column creation failed, you may have too many columns or the default value does not match with field data type.', 'geodirectory');
1016
+						}
1017
+						break;
1018
+					case 'textarea':
1019
+					case 'html':
1020
+					case 'url':
1021
+					case 'file':
1022
+
1023
+						$data_type = 'TEXT';
1024
+
1025
+						$default_value_add = " `" . $htmlvar_name . "` " . $data_type . " NULL ";
1026
+
1027
+						$meta_field_add = $data_type . " NULL ";
1028
+						/*if($default_value != '')
1029 1029
 					{ $meta_field_add .= " DEFAULT '".$default_value."'"; }*/
1030 1030
 
1031
-                        $add_result = geodir_add_column_if_not_exist($detail_table, $htmlvar_name, $meta_field_add);
1032
-                        if ($add_result === false) {
1033
-                            return __('Column creation failed, you may have too many columns or the default value does not match with field data type.', 'geodirectory');
1034
-                        }
1031
+						$add_result = geodir_add_column_if_not_exist($detail_table, $htmlvar_name, $meta_field_add);
1032
+						if ($add_result === false) {
1033
+							return __('Column creation failed, you may have too many columns or the default value does not match with field data type.', 'geodirectory');
1034
+						}
1035 1035
 
1036
-                        break;
1036
+						break;
1037 1037
 
1038
-                    case 'datepicker':
1038
+					case 'datepicker':
1039 1039
 
1040
-                        $data_type = 'DATE';
1040
+						$data_type = 'DATE';
1041 1041
 
1042
-                        $default_value_add = " `" . $htmlvar_name . "` " . $data_type . " NULL ";
1042
+						$default_value_add = " `" . $htmlvar_name . "` " . $data_type . " NULL ";
1043 1043
 
1044
-                        $meta_field_add = $data_type . " NULL ";
1044
+						$meta_field_add = $data_type . " NULL ";
1045 1045
 
1046
-                        $add_result = geodir_add_column_if_not_exist($detail_table, $htmlvar_name, $meta_field_add);
1047
-                        if ($add_result === false) {
1048
-                            return __('Column creation failed, you may have too many columns or the default value must have in valid date format.', 'geodirectory');
1049
-                        }
1046
+						$add_result = geodir_add_column_if_not_exist($detail_table, $htmlvar_name, $meta_field_add);
1047
+						if ($add_result === false) {
1048
+							return __('Column creation failed, you may have too many columns or the default value must have in valid date format.', 'geodirectory');
1049
+						}
1050 1050
 
1051
-                        break;
1051
+						break;
1052 1052
 
1053
-                    case 'time':
1053
+					case 'time':
1054 1054
 
1055
-                        $data_type = 'TIME';
1055
+						$data_type = 'TIME';
1056 1056
 
1057
-                        $default_value_add = " `" . $htmlvar_name . "` " . $data_type . " NULL ";
1057
+						$default_value_add = " `" . $htmlvar_name . "` " . $data_type . " NULL ";
1058 1058
 
1059
-                        $meta_field_add = $data_type . " NULL ";
1059
+						$meta_field_add = $data_type . " NULL ";
1060 1060
 
1061
-                        $add_result = geodir_add_column_if_not_exist($detail_table, $htmlvar_name, $meta_field_add);
1062
-                        if ($add_result === false) {
1063
-                            return __('Column creation failed, you may have too many columns or the default value must have in valid time format.', 'geodirectory');
1064
-                        }
1061
+						$add_result = geodir_add_column_if_not_exist($detail_table, $htmlvar_name, $meta_field_add);
1062
+						if ($add_result === false) {
1063
+							return __('Column creation failed, you may have too many columns or the default value must have in valid time format.', 'geodirectory');
1064
+						}
1065 1065
 
1066
-                        break;
1066
+						break;
1067 1067
 
1068
-                    default:
1068
+					default:
1069 1069
 
1070
-                        if ($data_type != 'VARCHAR' && $data_type != '') {
1071
-                            $meta_field_add = $data_type . " NULL ";
1070
+						if ($data_type != 'VARCHAR' && $data_type != '') {
1071
+							$meta_field_add = $data_type . " NULL ";
1072 1072
 
1073
-                            if ($data_type == 'FLOAT' && $decimal_point > 0) {
1074
-                                $meta_field_add = "DECIMAL(11, " . (int)$decimal_point . ") NULL ";
1075
-                            }
1073
+							if ($data_type == 'FLOAT' && $decimal_point > 0) {
1074
+								$meta_field_add = "DECIMAL(11, " . (int)$decimal_point . ") NULL ";
1075
+							}
1076 1076
 
1077
-                            if (is_numeric($default_value) && $default_value != '') {
1078
-                                $default_value_add .= " DEFAULT '" . $default_value . "'";
1079
-                                $meta_field_add .= " DEFAULT '" . $default_value . "'";
1080
-                            }
1081
-                        } else {
1082
-                            $meta_field_add = " VARCHAR( 254 ) NULL ";
1077
+							if (is_numeric($default_value) && $default_value != '') {
1078
+								$default_value_add .= " DEFAULT '" . $default_value . "'";
1079
+								$meta_field_add .= " DEFAULT '" . $default_value . "'";
1080
+							}
1081
+						} else {
1082
+							$meta_field_add = " VARCHAR( 254 ) NULL ";
1083 1083
 
1084
-                            if ($default_value != '') {
1085
-                                $default_value_add .= " DEFAULT '" . $default_value . "'";
1086
-                                $meta_field_add .= " DEFAULT '" . $default_value . "'";
1087
-                            }
1088
-                        }
1084
+							if ($default_value != '') {
1085
+								$default_value_add .= " DEFAULT '" . $default_value . "'";
1086
+								$meta_field_add .= " DEFAULT '" . $default_value . "'";
1087
+							}
1088
+						}
1089 1089
 
1090
-                        $add_result = geodir_add_column_if_not_exist($detail_table, $htmlvar_name, $meta_field_add);
1091
-                        if ($add_result === false) {
1092
-                            return __('Column creation failed, you may have too many columns or the default value does not match with field data type.', 'geodirectory');
1093
-                        }
1094
-                        break;
1095
-                endswitch;
1090
+						$add_result = geodir_add_column_if_not_exist($detail_table, $htmlvar_name, $meta_field_add);
1091
+						if ($add_result === false) {
1092
+							return __('Column creation failed, you may have too many columns or the default value does not match with field data type.', 'geodirectory');
1093
+						}
1094
+						break;
1095
+				endswitch;
1096 1096
 
1097
-                $extra_field_query = '';
1098
-                if (!empty($extra_fields)) {
1099
-                    $extra_field_query = serialize($extra_fields);
1100
-                }
1097
+				$extra_field_query = '';
1098
+				if (!empty($extra_fields)) {
1099
+					$extra_field_query = serialize($extra_fields);
1100
+				}
1101 1101
 
1102
-                $decimal_point = $field_type == 'text' && $data_type == 'FLOAT' ? $decimal_point : '';
1102
+				$decimal_point = $field_type == 'text' && $data_type == 'FLOAT' ? $decimal_point : '';
1103 1103
 
1104
-                $wpdb->query(
1104
+				$wpdb->query(
1105 1105
 
1106
-                    $wpdb->prepare(
1106
+					$wpdb->prepare(
1107 1107
 
1108
-                        "insert into " . GEODIR_CUSTOM_FIELDS_TABLE . " set 
1108
+						"insert into " . GEODIR_CUSTOM_FIELDS_TABLE . " set 
1109 1109
 					post_type = %s,
1110 1110
 					admin_title = %s,
1111 1111
 					site_title = %s,
@@ -1138,26 +1138,26 @@  discard block
 block discarded – undo
1138 1138
 					validation_msg = %s,
1139 1139
 					for_admin_use = %s ",
1140 1140
 
1141
-                        array($post_type, $admin_title, $site_title, $field_type, $field_type_key, $htmlvar_name, $admin_desc, $clabels, $default_value, $sort_order, $is_active, $is_default, $is_admin, $is_required, $required_msg, $css_class, $field_icon, $show_on_listing,$show_in, $show_on_detail, $show_as_tab, $option_values, $price_pkg, $cat_sort, $cat_filter, $data_type, $extra_field_query, $decimal_point,$validation_pattern,$validation_msg, $for_admin_use)
1141
+						array($post_type, $admin_title, $site_title, $field_type, $field_type_key, $htmlvar_name, $admin_desc, $clabels, $default_value, $sort_order, $is_active, $is_default, $is_admin, $is_required, $required_msg, $css_class, $field_icon, $show_on_listing,$show_in, $show_on_detail, $show_as_tab, $option_values, $price_pkg, $cat_sort, $cat_filter, $data_type, $extra_field_query, $decimal_point,$validation_pattern,$validation_msg, $for_admin_use)
1142 1142
 
1143
-                    )
1143
+					)
1144 1144
 
1145
-                );
1145
+				);
1146 1146
 
1147
-                $lastid = $wpdb->insert_id;
1147
+				$lastid = $wpdb->insert_id;
1148 1148
 
1149
-                $lastid = trim($lastid);
1149
+				$lastid = trim($lastid);
1150 1150
 
1151
-            }
1151
+			}
1152 1152
 
1153
-            return (int)$lastid;
1153
+			return (int)$lastid;
1154 1154
 
1155 1155
 
1156
-        } else {
1157
-            return 'HTML Variable Name should be a unique name';
1158
-        }
1156
+		} else {
1157
+			return 'HTML Variable Name should be a unique name';
1158
+		}
1159 1159
 
1160
-    }
1160
+	}
1161 1161
 }
1162 1162
 
1163 1163
 /**
@@ -1172,54 +1172,54 @@  discard block
 block discarded – undo
1172 1172
 function godir_set_field_order($field_ids = array())
1173 1173
 {
1174 1174
 
1175
-    global $wpdb;
1175
+	global $wpdb;
1176 1176
 
1177
-    $count = 0;
1178
-    if (!empty($field_ids)):
1179
-        $post_meta_info = false;
1180
-        foreach ($field_ids as $id) {
1177
+	$count = 0;
1178
+	if (!empty($field_ids)):
1179
+		$post_meta_info = false;
1180
+		foreach ($field_ids as $id) {
1181 1181
 
1182
-            $cf = trim($id, '_');
1182
+			$cf = trim($id, '_');
1183 1183
 
1184
-            $post_meta_info = $wpdb->query(
1185
-                $wpdb->prepare(
1186
-                    "update " . GEODIR_CUSTOM_FIELDS_TABLE . " set 
1184
+			$post_meta_info = $wpdb->query(
1185
+				$wpdb->prepare(
1186
+					"update " . GEODIR_CUSTOM_FIELDS_TABLE . " set 
1187 1187
 															sort_order=%d 
1188 1188
 															where id= %d",
1189
-                    array($count, $cf)
1190
-                )
1191
-            );
1192
-            $count++;
1193
-        }
1194
-
1195
-        return $post_meta_info;
1196
-    else:
1197
-        return false;
1198
-    endif;
1189
+					array($count, $cf)
1190
+				)
1191
+			);
1192
+			$count++;
1193
+		}
1194
+
1195
+		return $post_meta_info;
1196
+	else:
1197
+		return false;
1198
+	endif;
1199 1199
 }
1200 1200
 
1201 1201
 
1202 1202
 function geodir_get_cf_value($cf){
1203
-    global $gd_session;
1204
-    $value = '';
1205
-    if (is_admin()) {
1206
-        global $post,$gd_session;
1207
-
1208
-        if (isset($_REQUEST['post']))
1209
-            $_REQUEST['pid'] = $_REQUEST['post'];
1210
-    }
1211
-
1212
-    if (isset($_REQUEST['backandedit']) && $_REQUEST['backandedit'] && $gd_ses_listing = $gd_session->get('listing')) {
1213
-        $post = $gd_ses_listing;
1214
-        $value = isset($post[$cf['name']]) ? $post[$cf['name']] : '';
1215
-    } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
1216
-        $value = geodir_get_post_meta($_REQUEST['pid'], $cf['name'], true);
1217
-    } else {
1218
-        if ($value == '') {
1219
-            $value = $cf['default'];
1220
-        }
1221
-    }
1222
-    return $value;
1203
+	global $gd_session;
1204
+	$value = '';
1205
+	if (is_admin()) {
1206
+		global $post,$gd_session;
1207
+
1208
+		if (isset($_REQUEST['post']))
1209
+			$_REQUEST['pid'] = $_REQUEST['post'];
1210
+	}
1211
+
1212
+	if (isset($_REQUEST['backandedit']) && $_REQUEST['backandedit'] && $gd_ses_listing = $gd_session->get('listing')) {
1213
+		$post = $gd_ses_listing;
1214
+		$value = isset($post[$cf['name']]) ? $post[$cf['name']] : '';
1215
+	} elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
1216
+		$value = geodir_get_post_meta($_REQUEST['pid'], $cf['name'], true);
1217
+	} else {
1218
+		if ($value == '') {
1219
+			$value = $cf['default'];
1220
+		}
1221
+	}
1222
+	return $value;
1223 1223
 }
1224 1224
 
1225 1225
 /**
@@ -1238,412 +1238,412 @@  discard block
 block discarded – undo
1238 1238
  * @param string $post_type Optional. The wordpress post type.
1239 1239
  */
1240 1240
 function geodir_get_custom_fields_html($package_id = '', $default = 'custom', $post_type = 'gd_place') {
1241
-    global $is_default, $mapzoom, $gd_session;
1241
+	global $is_default, $mapzoom, $gd_session;
1242 1242
 
1243
-    $listing_type = $post_type;
1243
+	$listing_type = $post_type;
1244 1244
 
1245
-    $custom_fields = geodir_post_custom_fields($package_id, $default, $post_type);
1245
+	$custom_fields = geodir_post_custom_fields($package_id, $default, $post_type);
1246 1246
 
1247
-    foreach ($custom_fields as $key => $val) {
1248
-        $val = stripslashes_deep($val); // strip slashes from labels
1249
-        $name = $val['name'];
1250
-        $type = $val['type'];
1251
-        $is_default = $val['is_default'];
1247
+	foreach ($custom_fields as $key => $val) {
1248
+		$val = stripslashes_deep($val); // strip slashes from labels
1249
+		$name = $val['name'];
1250
+		$type = $val['type'];
1251
+		$is_default = $val['is_default'];
1252 1252
 
1253
-        /* field available to site admin only for edit */
1254
-        $for_admin_use = isset($val['for_admin_use']) && (int)$val['for_admin_use'] == 1 ? true : false;
1255
-        if ($for_admin_use && !is_super_admin()) {
1256
-            continue;
1257
-        }
1253
+		/* field available to site admin only for edit */
1254
+		$for_admin_use = isset($val['for_admin_use']) && (int)$val['for_admin_use'] == 1 ? true : false;
1255
+		if ($for_admin_use && !is_super_admin()) {
1256
+			continue;
1257
+		}
1258 1258
 
1259
-        if (is_admin()) {
1260
-            global $post;
1259
+		if (is_admin()) {
1260
+			global $post;
1261 1261
 
1262
-            if (isset($_REQUEST['post']))
1263
-                $_REQUEST['pid'] = $_REQUEST['post'];
1264
-        }
1262
+			if (isset($_REQUEST['post']))
1263
+				$_REQUEST['pid'] = $_REQUEST['post'];
1264
+		}
1265 1265
 
1266 1266
         
1267 1267
 
1268
-        /**
1269
-         * Called before the custom fields info is output for submitting a post.
1270
-         *
1271
-         * Used dynamic hook type geodir_before_custom_form_field_$name.
1272
-         *
1273
-         * @since 1.0.0
1274
-         * @param string $listing_type The post post type.
1275
-         * @param int $package_id The price package ID for the post.
1276
-         * @param array $val The settings array for the field. {@see geodir_custom_field_save()}.
1277
-         * @see 'geodir_after_custom_form_field_$name'
1278
-         */
1279
-        do_action('geodir_before_custom_form_field_' . $name, $listing_type, $package_id, $val);
1280
-
1281
-
1282
-        $custom_field = $val;
1283
-        $html ='';
1284
-        /**
1285
-         * Filter the output for custom fields.
1286
-         *
1287
-         * Here we can remove or add new functions depending on the field type.
1288
-         *
1289
-         * @param string $html The html to be filtered (blank).
1290
-         * @param array $custom_field The custom field array values.
1291
-         */
1292
-        echo apply_filters("geodir_custom_field_input_{$type}",$html,$custom_field);
1293
-
1294
-
1295
-
1296
-        /**
1297
-         * Called after the custom fields info is output for submitting a post.
1298
-         *
1299
-         * Used dynamic hook type geodir_after_custom_form_field_$name.
1300
-         *
1301
-         * @since 1.0.0
1302
-         * @param string $listing_type The post post type.
1303
-         * @param int $package_id The price package ID for the post.
1304
-         * @param array $val The settings array for the field. {@see geodir_custom_field_save()}.
1305
-         * @see 'geodir_before_custom_form_field_$name'
1306
-         */
1307
-        do_action('geodir_after_custom_form_field_' . $name, $listing_type, $package_id, $val);
1308
-
1309
-    }
1268
+		/**
1269
+		 * Called before the custom fields info is output for submitting a post.
1270
+		 *
1271
+		 * Used dynamic hook type geodir_before_custom_form_field_$name.
1272
+		 *
1273
+		 * @since 1.0.0
1274
+		 * @param string $listing_type The post post type.
1275
+		 * @param int $package_id The price package ID for the post.
1276
+		 * @param array $val The settings array for the field. {@see geodir_custom_field_save()}.
1277
+		 * @see 'geodir_after_custom_form_field_$name'
1278
+		 */
1279
+		do_action('geodir_before_custom_form_field_' . $name, $listing_type, $package_id, $val);
1280
+
1281
+
1282
+		$custom_field = $val;
1283
+		$html ='';
1284
+		/**
1285
+		 * Filter the output for custom fields.
1286
+		 *
1287
+		 * Here we can remove or add new functions depending on the field type.
1288
+		 *
1289
+		 * @param string $html The html to be filtered (blank).
1290
+		 * @param array $custom_field The custom field array values.
1291
+		 */
1292
+		echo apply_filters("geodir_custom_field_input_{$type}",$html,$custom_field);
1293
+
1294
+
1295
+
1296
+		/**
1297
+		 * Called after the custom fields info is output for submitting a post.
1298
+		 *
1299
+		 * Used dynamic hook type geodir_after_custom_form_field_$name.
1300
+		 *
1301
+		 * @since 1.0.0
1302
+		 * @param string $listing_type The post post type.
1303
+		 * @param int $package_id The price package ID for the post.
1304
+		 * @param array $val The settings array for the field. {@see geodir_custom_field_save()}.
1305
+		 * @see 'geodir_before_custom_form_field_$name'
1306
+		 */
1307
+		do_action('geodir_after_custom_form_field_' . $name, $listing_type, $package_id, $val);
1308
+
1309
+	}
1310 1310
 
1311 1311
 }
1312 1312
 
1313 1313
 
1314 1314
 if (!function_exists('geodir_get_field_infoby')) {
1315
-    /**
1316
-     * Get custom field using key and value.
1317
-     *
1318
-     * @since 1.0.0
1319
-     * @package GeoDirectory
1320
-     * @global object $wpdb WordPress Database object.
1321
-     * @param string $key The key you want to look for.
1322
-     * @param string $value The value of the key you want to look for.
1323
-     * @param string $geodir_post_type The post type.
1324
-     * @return bool|mixed Returns field info when available. otherwise returns false.
1325
-     */
1326
-    function geodir_get_field_infoby($key = '', $value = '', $geodir_post_type = '')
1327
-    {
1328
-
1329
-        global $wpdb;
1330
-
1331
-        $filter = $wpdb->get_row(
1332
-            $wpdb->prepare(
1333
-                "SELECT * FROM " . GEODIR_CUSTOM_FIELDS_TABLE . " WHERE post_type=%s AND " . $key . "='" . $value . "'",
1334
-                array($geodir_post_type)
1335
-            )
1336
-        );
1337
-
1338
-        if ($filter) {
1339
-            return $filter;
1340
-        } else {
1341
-            return false;
1342
-        }
1343
-
1344
-    }
1315
+	/**
1316
+	 * Get custom field using key and value.
1317
+	 *
1318
+	 * @since 1.0.0
1319
+	 * @package GeoDirectory
1320
+	 * @global object $wpdb WordPress Database object.
1321
+	 * @param string $key The key you want to look for.
1322
+	 * @param string $value The value of the key you want to look for.
1323
+	 * @param string $geodir_post_type The post type.
1324
+	 * @return bool|mixed Returns field info when available. otherwise returns false.
1325
+	 */
1326
+	function geodir_get_field_infoby($key = '', $value = '', $geodir_post_type = '')
1327
+	{
1328
+
1329
+		global $wpdb;
1330
+
1331
+		$filter = $wpdb->get_row(
1332
+			$wpdb->prepare(
1333
+				"SELECT * FROM " . GEODIR_CUSTOM_FIELDS_TABLE . " WHERE post_type=%s AND " . $key . "='" . $value . "'",
1334
+				array($geodir_post_type)
1335
+			)
1336
+		);
1337
+
1338
+		if ($filter) {
1339
+			return $filter;
1340
+		} else {
1341
+			return false;
1342
+		}
1343
+
1344
+	}
1345 1345
 }
1346 1346
 
1347 1347
 
1348 1348
 function geodir_field_icon_proccess($cf){
1349 1349
 
1350 1350
 
1351
-    if (strpos($cf['field_icon'], 'http') !== false) {
1352
-        $field_icon = ' background: url(' . $cf['field_icon'] . ') no-repeat left center;background-size:18px 18px;padding-left: 21px;';
1353
-    } elseif (strpos($cf['field_icon'], 'fa fa-') !== false) {
1354
-        $field_icon = '<i class="' . $cf['field_icon'] . '"></i>';
1355
-    }else{
1356
-        $field_icon = $cf['field_icon'];
1357
-    }
1351
+	if (strpos($cf['field_icon'], 'http') !== false) {
1352
+		$field_icon = ' background: url(' . $cf['field_icon'] . ') no-repeat left center;background-size:18px 18px;padding-left: 21px;';
1353
+	} elseif (strpos($cf['field_icon'], 'fa fa-') !== false) {
1354
+		$field_icon = '<i class="' . $cf['field_icon'] . '"></i>';
1355
+	}else{
1356
+		$field_icon = $cf['field_icon'];
1357
+	}
1358 1358
 
1359
-    return $field_icon;
1359
+	return $field_icon;
1360 1360
 }
1361 1361
 
1362 1362
 if (!function_exists('geodir_show_listing_info')) {
1363
-    /**
1364
-     * Show listing info depending on field location.
1365
-     *
1366
-     * @since 1.0.0
1367
-     * @since 1.5.7 Custom fields option values added to db translation.
1368
-     *              Changes to display url fields title.
1369
-     * @package GeoDirectory
1370
-     * @global object $wpdb WordPress Database object.
1371
-     * @global object $post The current post object.
1372
-     * @global bool $send_to_friend True if send to friend link already rendered. Otherwise false.
1373
-     *
1374
-     * @param string $fields_location In which page you are going to place this custom fields?. Ex: listing, detail etc.
1375
-     * @return string Returns listing info html.
1376
-     */
1377
-    function geodir_show_listing_info($fields_location = '') {
1378
-        global $post, $preview, $wpdb, $send_to_friend;
1379
-
1380
-        $payment_info = array();
1381
-        $package_info = array();
1382
-
1383
-        $package_info = geodir_post_package_info($package_info, $post);
1384
-        $post_package_id = $package_info->pid;
1385
-        $p_type = !empty($post->post_type) ? $post->post_type : geodir_get_current_posttype();
1386
-        $send_to_friend = false;
1387
-
1388
-        ob_start();
1389
-        $fields_info = geodir_post_custom_fields($post_package_id, 'all', $p_type, $fields_location);
1390
-
1391
-        if (!empty($fields_info)) {
1392
-            $post = stripslashes_deep($post); // strip slashes
1363
+	/**
1364
+	 * Show listing info depending on field location.
1365
+	 *
1366
+	 * @since 1.0.0
1367
+	 * @since 1.5.7 Custom fields option values added to db translation.
1368
+	 *              Changes to display url fields title.
1369
+	 * @package GeoDirectory
1370
+	 * @global object $wpdb WordPress Database object.
1371
+	 * @global object $post The current post object.
1372
+	 * @global bool $send_to_friend True if send to friend link already rendered. Otherwise false.
1373
+	 *
1374
+	 * @param string $fields_location In which page you are going to place this custom fields?. Ex: listing, detail etc.
1375
+	 * @return string Returns listing info html.
1376
+	 */
1377
+	function geodir_show_listing_info($fields_location = '') {
1378
+		global $post, $preview, $wpdb, $send_to_friend;
1379
+
1380
+		$payment_info = array();
1381
+		$package_info = array();
1382
+
1383
+		$package_info = geodir_post_package_info($package_info, $post);
1384
+		$post_package_id = $package_info->pid;
1385
+		$p_type = !empty($post->post_type) ? $post->post_type : geodir_get_current_posttype();
1386
+		$send_to_friend = false;
1387
+
1388
+		ob_start();
1389
+		$fields_info = geodir_post_custom_fields($post_package_id, 'all', $p_type, $fields_location);
1390
+
1391
+		if (!empty($fields_info)) {
1392
+			$post = stripslashes_deep($post); // strip slashes
1393 1393
             
1394
-            //echo '<div class="geodir-company_info field-group">';
1395
-            global $field_set_start;
1396
-            $field_set_start = 0;
1397
-
1398
-
1399
-
1400
-            foreach ($fields_info as $type) {
1401
-                $type = stripslashes_deep($type); // strip slashes
1402
-                $html = '';
1403
-                $html_var = '';
1404
-                $field_icon = geodir_field_icon_proccess($type);
1405
-                $filed_type = $type['type'];
1406
-
1407
-                /**
1408
-                 * Filter the output for custom fields.
1409
-                 *
1410
-                 * Here we can remove or add new functions depending on the field type.
1411
-                 *
1412
-                 * @param string $html The html to be filtered (blank).
1413
-                 * @param string $fields_location The location the field is to be show.
1414
-                 * @param array $type The array of field values.
1415
-                 */
1416
-                $html = apply_filters("geodir_custom_field_output_{$filed_type}",$html,$fields_location,$type);
1417
-
1418
-                $variables_array = array();
1419
-
1420
-                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'))) {
1421
-                    continue;
1422
-                }
1423
-
1424
-                if ($type['type'] != 'fieldset'):
1425
-                    $variables_array['post_id'] = $post->ID;
1426
-                    $variables_array['label'] = __($type['site_title'], 'geodirectory');
1427
-                    $variables_array['value'] = '';
1428
-                    if (isset($post->{$type['htmlvar_name']}))
1429
-                        $variables_array['value'] = $post->{$type['htmlvar_name']};
1430
-                endif;
1431
-
1432
-
1433
-
1434
-                if ($html):
1435
-
1436
-                    /**
1437
-                     * Called before a custom fields is output on the frontend.
1438
-                     *
1439
-                     * @since 1.0.0
1440
-                     * @param string $html_var The HTML variable name for the field.
1441
-                     */
1442
-                    do_action("geodir_before_show_{$html_var}");
1443
-                    /**
1444
-                     * Filter custom field output.
1445
-                     *
1446
-                     * @since 1.0.0
1447
-                     *
1448
-                     * @param string $html_var The HTML variable name for the field.
1449
-                     * @param string $html Custom field unfiltered HTML.
1450
-                     * @param array $variables_array Custom field variables array.
1451
-                     */
1452
-                    if ($html) echo apply_filters("geodir_show_{$html_var}", $html, $variables_array);
1453
-
1454
-                    /**
1455
-                     * Called after a custom fields is output on the frontend.
1456
-                     *
1457
-                     * @since 1.0.0
1458
-                     * @param string $html_var The HTML variable name for the field.
1459
-                     */
1460
-                    do_action("geodir_after_show_{$html_var}");
1461
-
1462
-                endif;
1463
-
1464
-            }
1465
-
1466
-            //echo '</div>';
1467
-
1468
-        }
1469
-
1470
-
1471
-        return $html = ob_get_clean();
1472
-
1473
-    }
1394
+			//echo '<div class="geodir-company_info field-group">';
1395
+			global $field_set_start;
1396
+			$field_set_start = 0;
1397
+
1398
+
1399
+
1400
+			foreach ($fields_info as $type) {
1401
+				$type = stripslashes_deep($type); // strip slashes
1402
+				$html = '';
1403
+				$html_var = '';
1404
+				$field_icon = geodir_field_icon_proccess($type);
1405
+				$filed_type = $type['type'];
1406
+
1407
+				/**
1408
+				 * Filter the output for custom fields.
1409
+				 *
1410
+				 * Here we can remove or add new functions depending on the field type.
1411
+				 *
1412
+				 * @param string $html The html to be filtered (blank).
1413
+				 * @param string $fields_location The location the field is to be show.
1414
+				 * @param array $type The array of field values.
1415
+				 */
1416
+				$html = apply_filters("geodir_custom_field_output_{$filed_type}",$html,$fields_location,$type);
1417
+
1418
+				$variables_array = array();
1419
+
1420
+				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'))) {
1421
+					continue;
1422
+				}
1423
+
1424
+				if ($type['type'] != 'fieldset'):
1425
+					$variables_array['post_id'] = $post->ID;
1426
+					$variables_array['label'] = __($type['site_title'], 'geodirectory');
1427
+					$variables_array['value'] = '';
1428
+					if (isset($post->{$type['htmlvar_name']}))
1429
+						$variables_array['value'] = $post->{$type['htmlvar_name']};
1430
+				endif;
1431
+
1432
+
1433
+
1434
+				if ($html):
1435
+
1436
+					/**
1437
+					 * Called before a custom fields is output on the frontend.
1438
+					 *
1439
+					 * @since 1.0.0
1440
+					 * @param string $html_var The HTML variable name for the field.
1441
+					 */
1442
+					do_action("geodir_before_show_{$html_var}");
1443
+					/**
1444
+					 * Filter custom field output.
1445
+					 *
1446
+					 * @since 1.0.0
1447
+					 *
1448
+					 * @param string $html_var The HTML variable name for the field.
1449
+					 * @param string $html Custom field unfiltered HTML.
1450
+					 * @param array $variables_array Custom field variables array.
1451
+					 */
1452
+					if ($html) echo apply_filters("geodir_show_{$html_var}", $html, $variables_array);
1453
+
1454
+					/**
1455
+					 * Called after a custom fields is output on the frontend.
1456
+					 *
1457
+					 * @since 1.0.0
1458
+					 * @param string $html_var The HTML variable name for the field.
1459
+					 */
1460
+					do_action("geodir_after_show_{$html_var}");
1461
+
1462
+				endif;
1463
+
1464
+			}
1465
+
1466
+			//echo '</div>';
1467
+
1468
+		}
1469
+
1470
+
1471
+		return $html = ob_get_clean();
1472
+
1473
+	}
1474 1474
 }
1475 1475
 
1476 1476
 if (!function_exists('geodir_default_date_format')) {
1477
-    /**
1478
-     * Returns default date format.
1479
-     *
1480
-     * @since 1.0.0
1481
-     * @package GeoDirectory
1482
-     * @return mixed|string|void Returns default date format.
1483
-     */
1484
-    function geodir_default_date_format()
1485
-    {
1486
-        if ($format = get_option('date_format'))
1487
-            return $format;
1488
-        else
1489
-            return 'dd-mm-yy';
1490
-    }
1477
+	/**
1478
+	 * Returns default date format.
1479
+	 *
1480
+	 * @since 1.0.0
1481
+	 * @package GeoDirectory
1482
+	 * @return mixed|string|void Returns default date format.
1483
+	 */
1484
+	function geodir_default_date_format()
1485
+	{
1486
+		if ($format = get_option('date_format'))
1487
+			return $format;
1488
+		else
1489
+			return 'dd-mm-yy';
1490
+	}
1491 1491
 }
1492 1492
 
1493 1493
 if (!function_exists('geodir_get_formated_date')) {
1494
-    /**
1495
-     * Returns formatted date.
1496
-     *
1497
-     * @since 1.0.0
1498
-     * @package GeoDirectory
1499
-     * @param string $date Date string to convert.
1500
-     * @return bool|int|string Returns formatted date.
1501
-     */
1502
-    function geodir_get_formated_date($date)
1503
-    {
1504
-        return mysql2date(get_option('date_format'), $date);
1505
-    }
1494
+	/**
1495
+	 * Returns formatted date.
1496
+	 *
1497
+	 * @since 1.0.0
1498
+	 * @package GeoDirectory
1499
+	 * @param string $date Date string to convert.
1500
+	 * @return bool|int|string Returns formatted date.
1501
+	 */
1502
+	function geodir_get_formated_date($date)
1503
+	{
1504
+		return mysql2date(get_option('date_format'), $date);
1505
+	}
1506 1506
 }
1507 1507
 
1508 1508
 if (!function_exists('geodir_get_formated_time')) {
1509
-    /**
1510
-     * Returns formatted time.
1511
-     *
1512
-     * @since 1.0.0
1513
-     * @package GeoDirectory
1514
-     * @param string $time Time string to convert.
1515
-     * @return bool|int|string Returns formatted time.
1516
-     */
1517
-    function geodir_get_formated_time($time)
1518
-    {
1519
-        return mysql2date(get_option('time_format'), $time, $translate = true);
1520
-    }
1509
+	/**
1510
+	 * Returns formatted time.
1511
+	 *
1512
+	 * @since 1.0.0
1513
+	 * @package GeoDirectory
1514
+	 * @param string $time Time string to convert.
1515
+	 * @return bool|int|string Returns formatted time.
1516
+	 */
1517
+	function geodir_get_formated_time($time)
1518
+	{
1519
+		return mysql2date(get_option('time_format'), $time, $translate = true);
1520
+	}
1521 1521
 }
1522 1522
 
1523 1523
 
1524 1524
 if (!function_exists('geodir_save_post_file_fields')) {
1525
-    /**
1526
-     * Save post file fields
1527
-     *
1528
-     * @since 1.0.0
1529
-     * @since 1.4.7 Added `$extra_fields` parameter.
1530
-     * @package GeoDirectory
1531
-     * @global object $wpdb WordPress Database object.
1532
-     * @global string $plugin_prefix Geodirectory plugin table prefix.
1533
-     * @global object $current_user Current user object.
1534
-     * @param int $post_id
1535
-     * @param string $field_id
1536
-     * @param array $post_image
1537
-     * @param array $extra_fields Array of extra fields.
1538
-     */
1539
-    function geodir_save_post_file_fields($post_id = 0, $field_id = '', $post_image = array(), $extra_fields = array())
1540
-    {
1525
+	/**
1526
+	 * Save post file fields
1527
+	 *
1528
+	 * @since 1.0.0
1529
+	 * @since 1.4.7 Added `$extra_fields` parameter.
1530
+	 * @package GeoDirectory
1531
+	 * @global object $wpdb WordPress Database object.
1532
+	 * @global string $plugin_prefix Geodirectory plugin table prefix.
1533
+	 * @global object $current_user Current user object.
1534
+	 * @param int $post_id
1535
+	 * @param string $field_id
1536
+	 * @param array $post_image
1537
+	 * @param array $extra_fields Array of extra fields.
1538
+	 */
1539
+	function geodir_save_post_file_fields($post_id = 0, $field_id = '', $post_image = array(), $extra_fields = array())
1540
+	{
1541 1541
 
1542
-        global $wpdb, $plugin_prefix, $current_user;
1542
+		global $wpdb, $plugin_prefix, $current_user;
1543 1543
 
1544
-        $post_type = get_post_type($post_id);
1545
-        //echo $field_id; exit;
1546
-        $table = $plugin_prefix . $post_type . '_detail';
1544
+		$post_type = get_post_type($post_id);
1545
+		//echo $field_id; exit;
1546
+		$table = $plugin_prefix . $post_type . '_detail';
1547 1547
 
1548
-        $postcurr_images = array();
1549
-        $postcurr_images = geodir_get_post_meta($post_id, $field_id, true);
1550
-        $file_urls = '';
1548
+		$postcurr_images = array();
1549
+		$postcurr_images = geodir_get_post_meta($post_id, $field_id, true);
1550
+		$file_urls = '';
1551 1551
 
1552
-        if (!empty($post_image)) {
1552
+		if (!empty($post_image)) {
1553 1553
 
1554
-            $invalid_files = array();
1554
+			$invalid_files = array();
1555 1555
 
1556
-            //Get and remove all old images of post from database to set by new order
1557
-            $geodir_uploaddir = '';
1558
-            $uploads = wp_upload_dir();
1559
-            $uploads_dir = $uploads['path'];
1556
+			//Get and remove all old images of post from database to set by new order
1557
+			$geodir_uploaddir = '';
1558
+			$uploads = wp_upload_dir();
1559
+			$uploads_dir = $uploads['path'];
1560 1560
 
1561
-            $geodir_uploadpath = $uploads['path'];
1562
-            $geodir_uploadurl = $uploads['url'];
1563
-            $sub_dir = $uploads['subdir'];
1561
+			$geodir_uploadpath = $uploads['path'];
1562
+			$geodir_uploadurl = $uploads['url'];
1563
+			$sub_dir = $uploads['subdir'];
1564 1564
 
1565
-            $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'] : '';
1565
+			$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'] : '';
1566 1566
 
1567
-            for ($m = 0; $m < count($post_image); $m++) {
1567
+			for ($m = 0; $m < count($post_image); $m++) {
1568 1568
 
1569
-                /* --------- start ------- */
1569
+				/* --------- start ------- */
1570 1570
 
1571
-                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)))) {
1571
+				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)))) {
1572 1572
 
1573 1573
 
1574
-                    $curr_img_url = $post_image[$m];
1575
-                    $image_name_arr = explode('/', $curr_img_url);
1576
-                    $curr_img_dir = $image_name_arr[count($image_name_arr) - 2];
1577
-                    $filename = end($image_name_arr);
1578
-                    $img_name_arr = explode('.', $filename);
1574
+					$curr_img_url = $post_image[$m];
1575
+					$image_name_arr = explode('/', $curr_img_url);
1576
+					$curr_img_dir = $image_name_arr[count($image_name_arr) - 2];
1577
+					$filename = end($image_name_arr);
1578
+					$img_name_arr = explode('.', $filename);
1579 1579
 
1580
-                    $arr_file_type = wp_check_filetype($filename);
1580
+					$arr_file_type = wp_check_filetype($filename);
1581 1581
 
1582
-                    if (empty($arr_file_type['ext']) || empty($arr_file_type['type'])) {
1583
-                        continue;
1584
-                    }
1582
+					if (empty($arr_file_type['ext']) || empty($arr_file_type['type'])) {
1583
+						continue;
1584
+					}
1585 1585
 
1586
-                    $uploaded_file_type = $arr_file_type['type'];
1587
-                    $uploaded_file_ext = $arr_file_type['ext'];
1586
+					$uploaded_file_type = $arr_file_type['type'];
1587
+					$uploaded_file_ext = $arr_file_type['ext'];
1588 1588
 
1589
-                    if (!empty($allowed_file_types) && !in_array($uploaded_file_ext, $allowed_file_types)) {
1590
-                        continue; // Invalid file type.
1591
-                    }
1589
+					if (!empty($allowed_file_types) && !in_array($uploaded_file_ext, $allowed_file_types)) {
1590
+						continue; // Invalid file type.
1591
+					}
1592 1592
 
1593
-                    // Set an array containing a list of acceptable formats
1594
-                    //$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');
1593
+					// Set an array containing a list of acceptable formats
1594
+					//$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');
1595 1595
 
1596
-                    if (!function_exists('wp_handle_upload'))
1597
-                        require_once(ABSPATH . 'wp-admin/includes/file.php');
1596
+					if (!function_exists('wp_handle_upload'))
1597
+						require_once(ABSPATH . 'wp-admin/includes/file.php');
1598 1598
 
1599
-                    if (!is_dir($geodir_uploadpath))
1600
-                        mkdir($geodir_uploadpath);
1599
+					if (!is_dir($geodir_uploadpath))
1600
+						mkdir($geodir_uploadpath);
1601 1601
 
1602
-                    $new_name = $post_id . '_' . $field_id . '_' . $img_name_arr[0] . '.' . $img_name_arr[1];
1603
-                    $explode_sub_dir = explode("/", $sub_dir);
1604
-                    if ($curr_img_dir == end($explode_sub_dir)) {
1605
-                        $img_path = $geodir_uploadpath . '/' . $filename;
1606
-                        $img_url = $geodir_uploadurl . '/' . $filename;
1607
-                    } else {
1608
-                        $img_path = $uploads_dir . '/temp_' . $current_user->data->ID . '/' . $filename;
1609
-                        $img_url = $uploads['url'] . '/temp_' . $current_user->data->ID . '/' . $filename;
1610
-                    }
1602
+					$new_name = $post_id . '_' . $field_id . '_' . $img_name_arr[0] . '.' . $img_name_arr[1];
1603
+					$explode_sub_dir = explode("/", $sub_dir);
1604
+					if ($curr_img_dir == end($explode_sub_dir)) {
1605
+						$img_path = $geodir_uploadpath . '/' . $filename;
1606
+						$img_url = $geodir_uploadurl . '/' . $filename;
1607
+					} else {
1608
+						$img_path = $uploads_dir . '/temp_' . $current_user->data->ID . '/' . $filename;
1609
+						$img_url = $uploads['url'] . '/temp_' . $current_user->data->ID . '/' . $filename;
1610
+					}
1611 1611
 
1612
-                    $uploaded_file = '';
1613
-                    if (file_exists($img_path))
1614
-                        $uploaded_file = copy($img_path, $geodir_uploadpath . '/' . $new_name);
1612
+					$uploaded_file = '';
1613
+					if (file_exists($img_path))
1614
+						$uploaded_file = copy($img_path, $geodir_uploadpath . '/' . $new_name);
1615 1615
 
1616
-                    if ($curr_img_dir != $geodir_uploaddir) {
1617
-                        if (file_exists($img_path))
1618
-                            unlink($img_path);
1619
-                    }
1616
+					if ($curr_img_dir != $geodir_uploaddir) {
1617
+						if (file_exists($img_path))
1618
+							unlink($img_path);
1619
+					}
1620 1620
 
1621
-                    if (!empty($uploaded_file))
1622
-                        $file_urls = $geodir_uploadurl . '/' . $new_name;
1621
+					if (!empty($uploaded_file))
1622
+						$file_urls = $geodir_uploadurl . '/' . $new_name;
1623 1623
 
1624
-                } else {
1625
-                    $file_urls = $post_image[$m];
1626
-                }
1627
-            }
1624
+				} else {
1625
+					$file_urls = $post_image[$m];
1626
+				}
1627
+			}
1628 1628
 
1629 1629
 
1630
-        }
1630
+		}
1631 1631
 
1632
-        //Remove all old attachments and temp images
1633
-        if (!empty($postcurr_images)) {
1632
+		//Remove all old attachments and temp images
1633
+		if (!empty($postcurr_images)) {
1634 1634
 
1635
-            if ($file_urls != $postcurr_images) {
1636
-                $invalid_files[] = (object)array('src' => $postcurr_images);
1637
-                $invalid_files = (object)$invalid_files;
1638
-            }
1639
-        }
1635
+			if ($file_urls != $postcurr_images) {
1636
+				$invalid_files[] = (object)array('src' => $postcurr_images);
1637
+				$invalid_files = (object)$invalid_files;
1638
+			}
1639
+		}
1640 1640
 
1641
-        geodir_save_post_meta($post_id, $field_id, $file_urls);
1641
+		geodir_save_post_meta($post_id, $field_id, $file_urls);
1642 1642
 
1643
-        if (!empty($invalid_files))
1644
-            geodir_remove_attachments($invalid_files);
1643
+		if (!empty($invalid_files))
1644
+			geodir_remove_attachments($invalid_files);
1645 1645
 
1646
-    }
1646
+	}
1647 1647
 }
1648 1648
 
1649 1649
 
@@ -1658,76 +1658,76 @@  discard block
 block discarded – undo
1658 1658
  */
1659 1659
 function geodir_custom_upload_mimes($existing_mimes = array())
1660 1660
 {
1661
-    $existing_mimes['wif'] = 'text/plain';
1662
-    $existing_mimes['jpg|jpeg'] = 'image/jpeg';
1663
-    $existing_mimes['gif'] = 'image/gif';
1664
-    $existing_mimes['png'] = 'image/png';
1665
-    $existing_mimes['pdf'] = 'application/pdf';
1666
-    $existing_mimes['txt'] = 'text/text';
1667
-    $existing_mimes['csv'] = 'application/octet-stream';
1668
-    $existing_mimes['doc'] = 'application/msword';
1669
-    $existing_mimes['xla|xls|xlt|xlw'] = 'application/vnd.ms-excel';
1670
-    $existing_mimes['docx'] = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
1671
-    $existing_mimes['xlsx'] = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
1672
-    return $existing_mimes;
1661
+	$existing_mimes['wif'] = 'text/plain';
1662
+	$existing_mimes['jpg|jpeg'] = 'image/jpeg';
1663
+	$existing_mimes['gif'] = 'image/gif';
1664
+	$existing_mimes['png'] = 'image/png';
1665
+	$existing_mimes['pdf'] = 'application/pdf';
1666
+	$existing_mimes['txt'] = 'text/text';
1667
+	$existing_mimes['csv'] = 'application/octet-stream';
1668
+	$existing_mimes['doc'] = 'application/msword';
1669
+	$existing_mimes['xla|xls|xlt|xlw'] = 'application/vnd.ms-excel';
1670
+	$existing_mimes['docx'] = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
1671
+	$existing_mimes['xlsx'] = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
1672
+	return $existing_mimes;
1673 1673
 }
1674 1674
 
1675 1675
 if (!function_exists('geodir_plupload_action')) {
1676 1676
 
1677
-    /**
1678
-     * Get upload directory path details
1679
-     *
1680
-     * @since 1.0.0
1681
-     * @package GeoDirectory
1682
-     * @global object $current_user Current user object.
1683
-     * @param array $upload Array of upload directory data with keys of 'path','url', 'subdir, 'basedir', and 'error'.
1684
-     * @return mixed Returns upload directory details as an array.
1685
-     */
1686
-    function geodir_upload_dir($upload)
1687
-    {
1688
-        global $current_user;
1689
-        $upload['subdir'] = $upload['subdir'] . '/temp_' . $current_user->data->ID;
1690
-        $upload['path'] = $upload['basedir'] . $upload['subdir'];
1691
-        $upload['url'] = $upload['baseurl'] . $upload['subdir'];
1692
-        return $upload;
1693
-    }
1694
-
1695
-    /**
1696
-     * Handles place file and image upload.
1697
-     *
1698
-     * @since 1.0.0
1699
-     * @package GeoDirectory
1700
-     */
1701
-    function geodir_plupload_action()
1702
-    {
1703
-        // check ajax noonce
1704
-        $imgid = $_POST["imgid"];
1705
-
1706
-        check_ajax_referer($imgid . 'pluploadan');
1707
-
1708
-        // handle custom file uploaddir
1709
-        add_filter('upload_dir', 'geodir_upload_dir');
1710
-
1711
-        // change file orinetation if needed
1712
-        $fixed_file = geodir_exif($_FILES[$imgid . 'async-upload']);
1713
-
1714
-        // handle file upload
1715
-        $status = wp_handle_upload($fixed_file, array('test_form' => true, 'action' => 'plupload_action'));
1716
-        // remove handle custom file uploaddir
1717
-        remove_filter('upload_dir', 'geodir_upload_dir');
1718
-
1719
-        if(!isset($status['url']) && isset($status['error'])){
1720
-            print_r($status);
1721
-        }
1722
-
1723
-        // send the uploaded file url in response
1724
-        if (isset($status['url'])) {
1725
-            echo $status['url'];
1726
-        } else {
1727
-            echo 'x';
1728
-        }
1729
-        exit;
1730
-    }
1677
+	/**
1678
+	 * Get upload directory path details
1679
+	 *
1680
+	 * @since 1.0.0
1681
+	 * @package GeoDirectory
1682
+	 * @global object $current_user Current user object.
1683
+	 * @param array $upload Array of upload directory data with keys of 'path','url', 'subdir, 'basedir', and 'error'.
1684
+	 * @return mixed Returns upload directory details as an array.
1685
+	 */
1686
+	function geodir_upload_dir($upload)
1687
+	{
1688
+		global $current_user;
1689
+		$upload['subdir'] = $upload['subdir'] . '/temp_' . $current_user->data->ID;
1690
+		$upload['path'] = $upload['basedir'] . $upload['subdir'];
1691
+		$upload['url'] = $upload['baseurl'] . $upload['subdir'];
1692
+		return $upload;
1693
+	}
1694
+
1695
+	/**
1696
+	 * Handles place file and image upload.
1697
+	 *
1698
+	 * @since 1.0.0
1699
+	 * @package GeoDirectory
1700
+	 */
1701
+	function geodir_plupload_action()
1702
+	{
1703
+		// check ajax noonce
1704
+		$imgid = $_POST["imgid"];
1705
+
1706
+		check_ajax_referer($imgid . 'pluploadan');
1707
+
1708
+		// handle custom file uploaddir
1709
+		add_filter('upload_dir', 'geodir_upload_dir');
1710
+
1711
+		// change file orinetation if needed
1712
+		$fixed_file = geodir_exif($_FILES[$imgid . 'async-upload']);
1713
+
1714
+		// handle file upload
1715
+		$status = wp_handle_upload($fixed_file, array('test_form' => true, 'action' => 'plupload_action'));
1716
+		// remove handle custom file uploaddir
1717
+		remove_filter('upload_dir', 'geodir_upload_dir');
1718
+
1719
+		if(!isset($status['url']) && isset($status['error'])){
1720
+			print_r($status);
1721
+		}
1722
+
1723
+		// send the uploaded file url in response
1724
+		if (isset($status['url'])) {
1725
+			echo $status['url'];
1726
+		} else {
1727
+			echo 'x';
1728
+		}
1729
+		exit;
1730
+	}
1731 1731
 }
1732 1732
 
1733 1733
 /**
@@ -1742,17 +1742,17 @@  discard block
 block discarded – undo
1742 1742
  */
1743 1743
 function geodir_get_video($post_id)
1744 1744
 {
1745
-    global $wpdb, $plugin_prefix;
1745
+	global $wpdb, $plugin_prefix;
1746 1746
 
1747
-    $post_type = get_post_type($post_id);
1747
+	$post_type = get_post_type($post_id);
1748 1748
 
1749
-    $table = $plugin_prefix . $post_type . '_detail';
1749
+	$table = $plugin_prefix . $post_type . '_detail';
1750 1750
 
1751
-    $results = $wpdb->get_results($wpdb->prepare("SELECT geodir_video FROM " . $table . " WHERE post_id=%d", array($post_id)));
1751
+	$results = $wpdb->get_results($wpdb->prepare("SELECT geodir_video FROM " . $table . " WHERE post_id=%d", array($post_id)));
1752 1752
 
1753
-    if ($results) {
1754
-        return $results[0]->geodir_video;
1755
-    }
1753
+	if ($results) {
1754
+		return $results[0]->geodir_video;
1755
+	}
1756 1756
 
1757 1757
 }
1758 1758
 
@@ -1768,40 +1768,40 @@  discard block
 block discarded – undo
1768 1768
  */
1769 1769
 function geodir_get_special_offers($post_id)
1770 1770
 {
1771
-    global $wpdb, $plugin_prefix;
1771
+	global $wpdb, $plugin_prefix;
1772 1772
 
1773
-    $post_type = get_post_type($post_id);
1773
+	$post_type = get_post_type($post_id);
1774 1774
 
1775
-    $table = $plugin_prefix . $post_type . '_detail';
1775
+	$table = $plugin_prefix . $post_type . '_detail';
1776 1776
 
1777
-    $results = $wpdb->get_results($wpdb->prepare("SELECT geodir_special_offers FROM " . $table . " WHERE post_id=%d", array($post_id)));
1777
+	$results = $wpdb->get_results($wpdb->prepare("SELECT geodir_special_offers FROM " . $table . " WHERE post_id=%d", array($post_id)));
1778 1778
 
1779
-    if ($results) {
1780
-        return $results[0]->geodir_special_offers;
1781
-    }
1779
+	if ($results) {
1780
+		return $results[0]->geodir_special_offers;
1781
+	}
1782 1782
 
1783 1783
 }
1784 1784
 
1785 1785
 if (!function_exists('geodir_max_upload_size')) {
1786
-    /**
1787
-     * Get max upload file size
1788
-     *
1789
-     * @since 1.0.0
1790
-     * @package GeoDirectory
1791
-     * @return mixed|void Returns max upload file size.
1792
-     */
1793
-    function geodir_max_upload_size()
1794
-    {
1795
-        $max_filesize = (float)get_option('geodir_upload_max_filesize', 2);
1796
-
1797
-        if ($max_filesize > 0 && $max_filesize < 1) {
1798
-            $max_filesize = (int)($max_filesize * 1024) . 'kb';
1799
-        } else {
1800
-            $max_filesize = $max_filesize > 0 ? $max_filesize . 'mb' : '2mb';
1801
-        }
1802
-        /** Filter documented in geodirectory-functions/general_functions.php **/
1803
-        return apply_filters('geodir_default_image_upload_size_limit', $max_filesize);
1804
-    }
1786
+	/**
1787
+	 * Get max upload file size
1788
+	 *
1789
+	 * @since 1.0.0
1790
+	 * @package GeoDirectory
1791
+	 * @return mixed|void Returns max upload file size.
1792
+	 */
1793
+	function geodir_max_upload_size()
1794
+	{
1795
+		$max_filesize = (float)get_option('geodir_upload_max_filesize', 2);
1796
+
1797
+		if ($max_filesize > 0 && $max_filesize < 1) {
1798
+			$max_filesize = (int)($max_filesize * 1024) . 'kb';
1799
+		} else {
1800
+			$max_filesize = $max_filesize > 0 ? $max_filesize . 'mb' : '2mb';
1801
+		}
1802
+		/** Filter documented in geodirectory-functions/general_functions.php **/
1803
+		return apply_filters('geodir_default_image_upload_size_limit', $max_filesize);
1804
+	}
1805 1805
 }
1806 1806
 
1807 1807
 
@@ -1819,33 +1819,33 @@  discard block
 block discarded – undo
1819 1819
  */
1820 1820
 function geodir_add_custom_sort_options($fields, $post_type)
1821 1821
 {
1822
-    global $wpdb;
1822
+	global $wpdb;
1823 1823
 
1824
-    if ($post_type != '') {
1824
+	if ($post_type != '') {
1825 1825
 
1826
-        $all_postypes = geodir_get_posttypes();
1826
+		$all_postypes = geodir_get_posttypes();
1827 1827
 
1828
-        if (in_array($post_type, $all_postypes)) {
1828
+		if (in_array($post_type, $all_postypes)) {
1829 1829
 
1830
-            $custom_fields = $wpdb->get_results(
1831
-                $wpdb->prepare(
1832
-                    "select post_type,data_type,field_type,site_title,htmlvar_name,field_icon from " . GEODIR_CUSTOM_FIELDS_TABLE . " where post_type = %s and is_active='1' and cat_sort='1' AND field_type != 'address' order by sort_order asc",
1833
-                    array($post_type)
1834
-                ), 'ARRAY_A'
1835
-            );
1830
+			$custom_fields = $wpdb->get_results(
1831
+				$wpdb->prepare(
1832
+					"select post_type,data_type,field_type,site_title,htmlvar_name,field_icon from " . GEODIR_CUSTOM_FIELDS_TABLE . " where post_type = %s and is_active='1' and cat_sort='1' AND field_type != 'address' order by sort_order asc",
1833
+					array($post_type)
1834
+				), 'ARRAY_A'
1835
+			);
1836 1836
 
1837
-            if (!empty($custom_fields)) {
1837
+			if (!empty($custom_fields)) {
1838 1838
 
1839
-                foreach ($custom_fields as $val) {
1840
-                    $fields[] = $val;
1841
-                }
1842
-            }
1839
+				foreach ($custom_fields as $val) {
1840
+					$fields[] = $val;
1841
+				}
1842
+			}
1843 1843
 
1844
-        }
1844
+		}
1845 1845
 
1846
-    }
1846
+	}
1847 1847
 
1848
-    return $fields;
1848
+	return $fields;
1849 1849
 }
1850 1850
 
1851 1851
 
@@ -1861,76 +1861,76 @@  discard block
 block discarded – undo
1861 1861
 function geodir_get_custom_sort_options($post_type = '')
1862 1862
 {
1863 1863
 
1864
-    global $wpdb;
1865
-
1866
-    if ($post_type != '') {
1867
-
1868
-        $all_postypes = geodir_get_posttypes();
1869
-
1870
-        if (!in_array($post_type, $all_postypes))
1871
-            return false;
1872
-
1873
-        $fields = array();
1874
-
1875
-        $fields[] = array(
1876
-            'post_type' => $post_type,
1877
-            'data_type' => '',
1878
-            'field_type' => 'random',
1879
-            'site_title' => 'Random',
1880
-            'htmlvar_name' => 'post_title',
1881
-            'field_icon' =>  'fa fa-random',
1882
-            'description' =>  __('Random sort (not recommended for large sites)', 'geodirectory')
1883
-        );
1884
-
1885
-        $fields[] = array(
1886
-            'post_type' => $post_type,
1887
-            'data_type' => '',
1888
-            'field_type' => 'datetime',
1889
-            'site_title' => __('Add date', 'geodirectory'),
1890
-            'htmlvar_name' => 'post_date',
1891
-            'field_icon' =>  'fa fa-calendar',
1892
-            'description' =>  __('Sort by date added', 'geodirectory')
1893
-        );
1894
-        $fields[] = array(
1895
-            'post_type' => $post_type,
1896
-            'data_type' => '',
1897
-            'field_type' => 'bigint',
1898
-            'site_title' => __('Review', 'geodirectory'),
1899
-            'htmlvar_name' => 'comment_count',
1900
-            'field_icon' =>  'fa fa-commenting-o',
1901
-            'description' =>  __('Sort by the number of reviews', 'geodirectory')
1902
-        );
1903
-        $fields[] = array(
1904
-            'post_type' => $post_type,
1905
-            'data_type' => '',
1906
-            'field_type' => 'float',
1907
-            'site_title' => __('Rating', 'geodirectory'),
1908
-            'htmlvar_name' => 'overall_rating',
1909
-            'field_icon' =>  'fa fa-star-o',
1910
-            'description' =>  __('Sort by the overall rating value', 'geodirectory')
1911
-        );
1912
-        $fields[] = array(
1913
-            'post_type' => $post_type,
1914
-            'data_type' => '',
1915
-            'field_type' => 'text',
1916
-            'site_title' => __('Title', 'geodirectory'),
1917
-            'htmlvar_name' => 'post_title',
1918
-            'field_icon' =>  'fa fa-sort-alpha-desc',
1919
-            'description' =>  __('Sort alphabetically by title', 'geodirectory')
1920
-        );
1921
-
1922
-        /**
1923
-         * Hook to add custom sort options.
1924
-         *
1925
-         * @since 1.0.0
1926
-         * @param array $fields Unmodified sort options array.
1927
-         * @param string $post_type Post type.
1928
-         */
1929
-        return $fields = apply_filters('geodir_add_custom_sort_options', $fields, $post_type);
1930
-
1931
-    }
1932
-
1933
-    return false;
1864
+	global $wpdb;
1865
+
1866
+	if ($post_type != '') {
1867
+
1868
+		$all_postypes = geodir_get_posttypes();
1869
+
1870
+		if (!in_array($post_type, $all_postypes))
1871
+			return false;
1872
+
1873
+		$fields = array();
1874
+
1875
+		$fields[] = array(
1876
+			'post_type' => $post_type,
1877
+			'data_type' => '',
1878
+			'field_type' => 'random',
1879
+			'site_title' => 'Random',
1880
+			'htmlvar_name' => 'post_title',
1881
+			'field_icon' =>  'fa fa-random',
1882
+			'description' =>  __('Random sort (not recommended for large sites)', 'geodirectory')
1883
+		);
1884
+
1885
+		$fields[] = array(
1886
+			'post_type' => $post_type,
1887
+			'data_type' => '',
1888
+			'field_type' => 'datetime',
1889
+			'site_title' => __('Add date', 'geodirectory'),
1890
+			'htmlvar_name' => 'post_date',
1891
+			'field_icon' =>  'fa fa-calendar',
1892
+			'description' =>  __('Sort by date added', 'geodirectory')
1893
+		);
1894
+		$fields[] = array(
1895
+			'post_type' => $post_type,
1896
+			'data_type' => '',
1897
+			'field_type' => 'bigint',
1898
+			'site_title' => __('Review', 'geodirectory'),
1899
+			'htmlvar_name' => 'comment_count',
1900
+			'field_icon' =>  'fa fa-commenting-o',
1901
+			'description' =>  __('Sort by the number of reviews', 'geodirectory')
1902
+		);
1903
+		$fields[] = array(
1904
+			'post_type' => $post_type,
1905
+			'data_type' => '',
1906
+			'field_type' => 'float',
1907
+			'site_title' => __('Rating', 'geodirectory'),
1908
+			'htmlvar_name' => 'overall_rating',
1909
+			'field_icon' =>  'fa fa-star-o',
1910
+			'description' =>  __('Sort by the overall rating value', 'geodirectory')
1911
+		);
1912
+		$fields[] = array(
1913
+			'post_type' => $post_type,
1914
+			'data_type' => '',
1915
+			'field_type' => 'text',
1916
+			'site_title' => __('Title', 'geodirectory'),
1917
+			'htmlvar_name' => 'post_title',
1918
+			'field_icon' =>  'fa fa-sort-alpha-desc',
1919
+			'description' =>  __('Sort alphabetically by title', 'geodirectory')
1920
+		);
1921
+
1922
+		/**
1923
+		 * Hook to add custom sort options.
1924
+		 *
1925
+		 * @since 1.0.0
1926
+		 * @param array $fields Unmodified sort options array.
1927
+		 * @param string $post_type Post type.
1928
+		 */
1929
+		return $fields = apply_filters('geodir_add_custom_sort_options', $fields, $post_type);
1930
+
1931
+	}
1932
+
1933
+	return false;
1934 1934
 }
1935 1935
 
1936 1936
 
@@ -1946,117 +1946,117 @@  discard block
 block discarded – undo
1946 1946
 function godir_set_sort_field_order($field_ids = array())
1947 1947
 {
1948 1948
 
1949
-    global $wpdb;
1949
+	global $wpdb;
1950 1950
 
1951
-    $count = 0;
1952
-    if (!empty($field_ids)):
1953
-        foreach ($field_ids as $id) {
1951
+	$count = 0;
1952
+	if (!empty($field_ids)):
1953
+		foreach ($field_ids as $id) {
1954 1954
 
1955
-            $cf = trim($id, '_');
1955
+			$cf = trim($id, '_');
1956 1956
 
1957
-            $post_meta_info = $wpdb->query(
1958
-                $wpdb->prepare(
1959
-                    "update " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set 
1957
+			$post_meta_info = $wpdb->query(
1958
+				$wpdb->prepare(
1959
+					"update " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set 
1960 1960
 															sort_order=%d 
1961 1961
 															where id= %d",
1962
-                    array($count, $cf)
1963
-                )
1964
-            );
1965
-            $count++;
1966
-        }
1967
-
1968
-        return $field_ids;
1969
-    else:
1970
-        return false;
1971
-    endif;
1962
+					array($count, $cf)
1963
+				)
1964
+			);
1965
+			$count++;
1966
+		}
1967
+
1968
+		return $field_ids;
1969
+	else:
1970
+		return false;
1971
+	endif;
1972 1972
 }
1973 1973
 
1974 1974
 
1975 1975
 if (!function_exists('geodir_custom_sort_field_save')) {
1976
-    /**
1977
-     * Save or Update custom sort fields into the database.
1978
-     *
1979
-     * @since 1.0.0
1980
-     * @package GeoDirectory
1981
-     * @global object $wpdb WordPress Database object.
1982
-     * @global string $plugin_prefix Geodirectory plugin table prefix.
1983
-     * @param array $request_field {
1984
-     *    Attributes of the Request field.
1985
-     *
1986
-     *    @type string $action Ajax action name.
1987
-     *    @type string $manage_field_type Manage field type Default "sorting_options".
1988
-     *    @type string $create_field Do you want to create this field?.
1989
-     *    @type string $field_ins_upd Field created or updated?.
1990
-     *    @type string $_wpnonce Nonce value.
1991
-     *    @type string $listing_type The Post type.
1992
-     *    @type string $field_type Field Type.
1993
-     *    @type string $field_id Field ID.
1994
-     *    @type string $data_type Data Type.
1995
-     *    @type string $htmlvar_name HTML variable name.
1996
-     *    @type string $site_title Section title which you wish to display in frontend.
1997
-     *    @type string $is_default Is this default sorting?.
1998
-     *    @type string $is_active If not active then the field will not be displayed anywhere.
1999
-     *    @type string $sort_order Sort Order.
2000
-     *
2001
-     * }
2002
-     * @param bool $default Not yet implemented.
2003
-     * @return int Returns the last affected db table row id.
2004
-     */
2005
-    function geodir_custom_sort_field_save($request_field = array(), $default = false)
2006
-    {
2007
-
2008
-        global $wpdb, $plugin_prefix;
2009
-
2010
-        $result_str = isset($request_field['field_id']) ? trim($request_field['field_id']) : '';
2011
-
2012
-        $cf = trim($result_str, '_');
2013
-
2014
-        /*-------- check dublicate validation --------*/
2015
-
2016
-        $field_type = isset($request_field['field_type']) ? $request_field['field_type'] : '';
2017
-        $cehhtmlvar_name = isset($request_field['htmlvar_name']) ? $request_field['htmlvar_name'] : '';
2018
-
2019
-        $post_type = $request_field['listing_type'];
2020
-        $data_type = isset($request_field['data_type']) ? $request_field['data_type'] : '';
2021
-        $field_type = isset($request_field['field_type']) ? $request_field['field_type'] : '';
2022
-        $site_title = isset($request_field['site_title']) ? $request_field['site_title'] : '';
2023
-        $htmlvar_name = isset($request_field['htmlvar_name']) ? $request_field['htmlvar_name'] : '';
2024
-        $sort_order = isset($request_field['sort_order']) ? $request_field['sort_order'] : 0;
2025
-        $is_active = isset($request_field['is_active']) ? $request_field['is_active'] : 0;
2026
-        $is_default = isset($request_field['is_default']) ? $request_field['is_default'] : '';
2027
-        $asc = isset($request_field['asc']) ? $request_field['asc'] : 0;
2028
-        $desc = isset($request_field['desc']) ? $request_field['desc'] : 0;
2029
-        $asc_title = isset($request_field['asc_title']) ? $request_field['asc_title'] : '';
2030
-        $desc_title = isset($request_field['desc_title']) ? $request_field['desc_title'] : '';
2031
-
2032
-        $default_order = '';
2033
-        if ($is_default != '') {
2034
-            $default_order = $is_default;
2035
-            $is_default = '1';
2036
-        }
2037
-
2038
-
2039
-        $check_html_variable = $wpdb->get_var(
2040
-            $wpdb->prepare(
2041
-                "select htmlvar_name from " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s and field_type=%s ",
2042
-                array($cehhtmlvar_name, $post_type, $field_type)
2043
-            )
2044
-        );
2045
-
2046
-        if ($is_default == 1) {
2047
-
2048
-            $wpdb->query($wpdb->prepare("update " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set is_default='0', default_order='' where post_type = %s", array($post_type)));
2049
-
2050
-        }
2051
-
2052
-
2053
-        if (!$check_html_variable) {
2054
-
2055
-            $wpdb->query(
2056
-
2057
-                $wpdb->prepare(
2058
-
2059
-                    "insert into " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set 
1976
+	/**
1977
+	 * Save or Update custom sort fields into the database.
1978
+	 *
1979
+	 * @since 1.0.0
1980
+	 * @package GeoDirectory
1981
+	 * @global object $wpdb WordPress Database object.
1982
+	 * @global string $plugin_prefix Geodirectory plugin table prefix.
1983
+	 * @param array $request_field {
1984
+	 *    Attributes of the Request field.
1985
+	 *
1986
+	 *    @type string $action Ajax action name.
1987
+	 *    @type string $manage_field_type Manage field type Default "sorting_options".
1988
+	 *    @type string $create_field Do you want to create this field?.
1989
+	 *    @type string $field_ins_upd Field created or updated?.
1990
+	 *    @type string $_wpnonce Nonce value.
1991
+	 *    @type string $listing_type The Post type.
1992
+	 *    @type string $field_type Field Type.
1993
+	 *    @type string $field_id Field ID.
1994
+	 *    @type string $data_type Data Type.
1995
+	 *    @type string $htmlvar_name HTML variable name.
1996
+	 *    @type string $site_title Section title which you wish to display in frontend.
1997
+	 *    @type string $is_default Is this default sorting?.
1998
+	 *    @type string $is_active If not active then the field will not be displayed anywhere.
1999
+	 *    @type string $sort_order Sort Order.
2000
+	 *
2001
+	 * }
2002
+	 * @param bool $default Not yet implemented.
2003
+	 * @return int Returns the last affected db table row id.
2004
+	 */
2005
+	function geodir_custom_sort_field_save($request_field = array(), $default = false)
2006
+	{
2007
+
2008
+		global $wpdb, $plugin_prefix;
2009
+
2010
+		$result_str = isset($request_field['field_id']) ? trim($request_field['field_id']) : '';
2011
+
2012
+		$cf = trim($result_str, '_');
2013
+
2014
+		/*-------- check dublicate validation --------*/
2015
+
2016
+		$field_type = isset($request_field['field_type']) ? $request_field['field_type'] : '';
2017
+		$cehhtmlvar_name = isset($request_field['htmlvar_name']) ? $request_field['htmlvar_name'] : '';
2018
+
2019
+		$post_type = $request_field['listing_type'];
2020
+		$data_type = isset($request_field['data_type']) ? $request_field['data_type'] : '';
2021
+		$field_type = isset($request_field['field_type']) ? $request_field['field_type'] : '';
2022
+		$site_title = isset($request_field['site_title']) ? $request_field['site_title'] : '';
2023
+		$htmlvar_name = isset($request_field['htmlvar_name']) ? $request_field['htmlvar_name'] : '';
2024
+		$sort_order = isset($request_field['sort_order']) ? $request_field['sort_order'] : 0;
2025
+		$is_active = isset($request_field['is_active']) ? $request_field['is_active'] : 0;
2026
+		$is_default = isset($request_field['is_default']) ? $request_field['is_default'] : '';
2027
+		$asc = isset($request_field['asc']) ? $request_field['asc'] : 0;
2028
+		$desc = isset($request_field['desc']) ? $request_field['desc'] : 0;
2029
+		$asc_title = isset($request_field['asc_title']) ? $request_field['asc_title'] : '';
2030
+		$desc_title = isset($request_field['desc_title']) ? $request_field['desc_title'] : '';
2031
+
2032
+		$default_order = '';
2033
+		if ($is_default != '') {
2034
+			$default_order = $is_default;
2035
+			$is_default = '1';
2036
+		}
2037
+
2038
+
2039
+		$check_html_variable = $wpdb->get_var(
2040
+			$wpdb->prepare(
2041
+				"select htmlvar_name from " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s and field_type=%s ",
2042
+				array($cehhtmlvar_name, $post_type, $field_type)
2043
+			)
2044
+		);
2045
+
2046
+		if ($is_default == 1) {
2047
+
2048
+			$wpdb->query($wpdb->prepare("update " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set is_default='0', default_order='' where post_type = %s", array($post_type)));
2049
+
2050
+		}
2051
+
2052
+
2053
+		if (!$check_html_variable) {
2054
+
2055
+			$wpdb->query(
2056
+
2057
+				$wpdb->prepare(
2058
+
2059
+					"insert into " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set 
2060 2060
 				post_type = %s,
2061 2061
 				data_type = %s,
2062 2062
 				field_type = %s,
@@ -2071,23 +2071,23 @@  discard block
 block discarded – undo
2071 2071
 				asc_title = %s,
2072 2072
 				desc_title = %s",
2073 2073
 
2074
-                    array($post_type, $data_type, $field_type, $site_title, $htmlvar_name, $sort_order, $is_active, $is_default, $default_order, $asc, $desc, $asc_title, $desc_title)
2075
-                )
2074
+					array($post_type, $data_type, $field_type, $site_title, $htmlvar_name, $sort_order, $is_active, $is_default, $default_order, $asc, $desc, $asc_title, $desc_title)
2075
+				)
2076 2076
 
2077
-            );
2077
+			);
2078 2078
 
2079 2079
 
2080
-            $lastid = $wpdb->insert_id;
2080
+			$lastid = $wpdb->insert_id;
2081 2081
 
2082
-            $lastid = trim($lastid);
2082
+			$lastid = trim($lastid);
2083 2083
 
2084
-        } else {
2084
+		} else {
2085 2085
 
2086
-            $wpdb->query(
2086
+			$wpdb->query(
2087 2087
 
2088
-                $wpdb->prepare(
2088
+				$wpdb->prepare(
2089 2089
 
2090
-                    "update " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set 
2090
+					"update " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set 
2091 2091
 				post_type = %s,
2092 2092
 				data_type = %s,
2093 2093
 				field_type = %s,
@@ -2103,123 +2103,123 @@  discard block
 block discarded – undo
2103 2103
 				desc_title = %s
2104 2104
 				where id = %d",
2105 2105
 
2106
-                    array($post_type, $data_type, $field_type, $site_title, $htmlvar_name, $sort_order, $is_active, $is_default, $default_order, $asc, $desc, $asc_title, $desc_title, $cf)
2107
-                )
2106
+					array($post_type, $data_type, $field_type, $site_title, $htmlvar_name, $sort_order, $is_active, $is_default, $default_order, $asc, $desc, $asc_title, $desc_title, $cf)
2107
+				)
2108 2108
 
2109
-            );
2109
+			);
2110 2110
 
2111
-            $lastid = trim($cf);
2111
+			$lastid = trim($cf);
2112 2112
 
2113
-        }
2113
+		}
2114 2114
 
2115 2115
 
2116
-        return (int)$lastid;
2116
+		return (int)$lastid;
2117 2117
 
2118
-    }
2118
+	}
2119 2119
 }
2120 2120
 
2121 2121
 
2122 2122
 if (!function_exists('geodir_custom_sort_field_delete')) {
2123
-    /**
2124
-     * Delete a custom sort field using field id.
2125
-     * @since 1.0.0
2126
-     * @package GeoDirectory
2127
-     * @global object $wpdb WordPress Database object.
2128
-     * @global string $plugin_prefix Geodirectory plugin table prefix.
2129
-     * @param string $field_id The field ID.
2130
-     * @return int|string Returns field id when successful deletion, else returns 0.
2131
-     */
2132
-    function geodir_custom_sort_field_delete($field_id = '')
2133
-    {
2134
-
2135
-        global $wpdb, $plugin_prefix;
2136
-        if ($field_id != '') {
2137
-            $cf = trim($field_id, '_');
2138
-
2139
-            $wpdb->query($wpdb->prepare("delete from " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " where id= %d ", array($cf)));
2140
-
2141
-            return $field_id;
2142
-
2143
-        } else
2144
-            return 0;
2145
-
2146
-    }
2123
+	/**
2124
+	 * Delete a custom sort field using field id.
2125
+	 * @since 1.0.0
2126
+	 * @package GeoDirectory
2127
+	 * @global object $wpdb WordPress Database object.
2128
+	 * @global string $plugin_prefix Geodirectory plugin table prefix.
2129
+	 * @param string $field_id The field ID.
2130
+	 * @return int|string Returns field id when successful deletion, else returns 0.
2131
+	 */
2132
+	function geodir_custom_sort_field_delete($field_id = '')
2133
+	{
2134
+
2135
+		global $wpdb, $plugin_prefix;
2136
+		if ($field_id != '') {
2137
+			$cf = trim($field_id, '_');
2138
+
2139
+			$wpdb->query($wpdb->prepare("delete from " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " where id= %d ", array($cf)));
2140
+
2141
+			return $field_id;
2142
+
2143
+		} else
2144
+			return 0;
2145
+
2146
+	}
2147 2147
 }
2148 2148
 
2149 2149
 
2150 2150
 if (!function_exists('geodir_custom_sort_field_adminhtml')) {
2151
-    /**
2152
-     * Custom sort field admin html.
2153
-     *
2154
-     * @since 1.0.0
2155
-     * @package GeoDirectory
2156
-     * @global object $wpdb WordPress Database object.
2157
-     * @param string $field_type The form field type.
2158
-     * @param object|int $result_str The custom field results object or row id.
2159
-     * @param string $field_ins_upd When set to "submit" displays form.
2160
-     * @param bool $default when set to true field will be for admin use only.
2161
-     */
2162
-    function geodir_custom_sort_field_adminhtml($field_type, $result_str, $field_ins_upd = '', $field_type_key='')
2163
-    {
2164
-        global $wpdb;
2165
-        $cf = $result_str;
2166
-        if (!is_object($cf)) {
2167
-            $field_info = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " WHERE id = %d", array($cf)));
2168
-        } else {
2169
-            $field_info = $cf;
2170
-            $result_str = $cf->id;
2171
-        }
2172
-
2173
-        $field_info = stripslashes_deep($field_info); // strip slashes
2174
-
2175
-        if (!isset($field_info->post_type)) {
2176
-            $post_type = sanitize_text_field($_REQUEST['listing_type']);
2177
-        } else {
2178
-            $post_type = $field_info->post_type;
2179
-        }
2180
-
2181
-
2182
-        $htmlvar_name = isset($field_type_key) ? $field_type_key : '';
2183
-
2184
-        $site_title = '';
2185
-        if ($site_title == '')
2186
-            $site_title = isset($field_info->site_title) ? $field_info->site_title : '';
2187
-
2188
-        if ($site_title == '') {
2189
-            $fields = geodir_get_custom_sort_options($post_type);
2190
-
2191
-            foreach ($fields as $val) {
2192
-                $val = stripslashes_deep($val); // strip slashes
2193
-
2194
-                if ($val['field_type'] == $field_type && $val['htmlvar_name'] == $htmlvar_name) {
2195
-                    $site_title = isset($val['site_title']) ? $val['site_title'] : '';
2196
-                }
2197
-            }
2198
-        }
2199
-
2200
-        if ($htmlvar_name == '')
2201
-            $htmlvar_name = isset($field_info->htmlvar_name) ? $field_info->htmlvar_name : '';
2202
-
2203
-        $nonce = wp_create_nonce('custom_fields_' . $result_str);
2204
-
2205
-        $field_icon = '<i class="fa fa-cog" aria-hidden="true"></i>';
2206
-        $cso_arr = geodir_get_custom_sort_options($post_type);
2207
-
2208
-        $cur_field_type = (isset($cf->field_type)) ? $cf->field_type : esc_html($_REQUEST['field_type']);
2209
-        foreach($cso_arr as $cso){
2210
-            if($cur_field_type==$cso['field_type']){
2211
-
2212
-                if (isset($cso['field_icon']) && strpos($cso['field_icon'], 'fa fa-') !== false) {
2213
-                    $field_icon = '<i class="'.$cso['field_icon'].'" aria-hidden="true"></i>';
2214
-                }elseif(isset($cso['field_icon']) && $cso['field_icon']){
2215
-                    $field_icon = '<b style="background-image: url("'.$cso['field_icon'].'")"></b>';
2216
-                }
2217
-
2218
-            }
2219
-        }
2220
-
2221
-        $radio_id = (isset($field_info->htmlvar_name)) ? $field_info->htmlvar_name : rand(5, 500);
2222
-        ?>
2151
+	/**
2152
+	 * Custom sort field admin html.
2153
+	 *
2154
+	 * @since 1.0.0
2155
+	 * @package GeoDirectory
2156
+	 * @global object $wpdb WordPress Database object.
2157
+	 * @param string $field_type The form field type.
2158
+	 * @param object|int $result_str The custom field results object or row id.
2159
+	 * @param string $field_ins_upd When set to "submit" displays form.
2160
+	 * @param bool $default when set to true field will be for admin use only.
2161
+	 */
2162
+	function geodir_custom_sort_field_adminhtml($field_type, $result_str, $field_ins_upd = '', $field_type_key='')
2163
+	{
2164
+		global $wpdb;
2165
+		$cf = $result_str;
2166
+		if (!is_object($cf)) {
2167
+			$field_info = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " WHERE id = %d", array($cf)));
2168
+		} else {
2169
+			$field_info = $cf;
2170
+			$result_str = $cf->id;
2171
+		}
2172
+
2173
+		$field_info = stripslashes_deep($field_info); // strip slashes
2174
+
2175
+		if (!isset($field_info->post_type)) {
2176
+			$post_type = sanitize_text_field($_REQUEST['listing_type']);
2177
+		} else {
2178
+			$post_type = $field_info->post_type;
2179
+		}
2180
+
2181
+
2182
+		$htmlvar_name = isset($field_type_key) ? $field_type_key : '';
2183
+
2184
+		$site_title = '';
2185
+		if ($site_title == '')
2186
+			$site_title = isset($field_info->site_title) ? $field_info->site_title : '';
2187
+
2188
+		if ($site_title == '') {
2189
+			$fields = geodir_get_custom_sort_options($post_type);
2190
+
2191
+			foreach ($fields as $val) {
2192
+				$val = stripslashes_deep($val); // strip slashes
2193
+
2194
+				if ($val['field_type'] == $field_type && $val['htmlvar_name'] == $htmlvar_name) {
2195
+					$site_title = isset($val['site_title']) ? $val['site_title'] : '';
2196
+				}
2197
+			}
2198
+		}
2199
+
2200
+		if ($htmlvar_name == '')
2201
+			$htmlvar_name = isset($field_info->htmlvar_name) ? $field_info->htmlvar_name : '';
2202
+
2203
+		$nonce = wp_create_nonce('custom_fields_' . $result_str);
2204
+
2205
+		$field_icon = '<i class="fa fa-cog" aria-hidden="true"></i>';
2206
+		$cso_arr = geodir_get_custom_sort_options($post_type);
2207
+
2208
+		$cur_field_type = (isset($cf->field_type)) ? $cf->field_type : esc_html($_REQUEST['field_type']);
2209
+		foreach($cso_arr as $cso){
2210
+			if($cur_field_type==$cso['field_type']){
2211
+
2212
+				if (isset($cso['field_icon']) && strpos($cso['field_icon'], 'fa fa-') !== false) {
2213
+					$field_icon = '<i class="'.$cso['field_icon'].'" aria-hidden="true"></i>';
2214
+				}elseif(isset($cso['field_icon']) && $cso['field_icon']){
2215
+					$field_icon = '<b style="background-image: url("'.$cso['field_icon'].'")"></b>';
2216
+				}
2217
+
2218
+			}
2219
+		}
2220
+
2221
+		$radio_id = (isset($field_info->htmlvar_name)) ? $field_info->htmlvar_name : rand(5, 500);
2222
+		?>
2223 2223
 
2224 2224
         <li class="text" id="licontainer_<?php echo $result_str;?>">
2225 2225
             <form><!-- we need to wrap in a fom so we can use radio buttons with same name -->
@@ -2228,7 +2228,7 @@  discard block
 block discarded – undo
2228 2228
                  ondblclick="show_hide('field_frm<?php echo $result_str;?>')">
2229 2229
                 <?php
2230 2230
 
2231
-                ?>
2231
+				?>
2232 2232
 
2233 2233
                 <div title="<?php _e('Click to remove field', 'geodirectory');?>"
2234 2234
                      onclick="delete_sort_field('<?php echo $result_str;?>', '<?php echo $nonce;?>', this)"
@@ -2243,17 +2243,17 @@  discard block
 block discarded – undo
2243 2243
 
2244 2244
             <div id="field_frm<?php echo $result_str;?>" class="field_frm"
2245 2245
                  style="display:<?php if ($field_ins_upd == 'submit') {
2246
-                     echo 'block;';
2247
-                 } else {
2248
-                     echo 'none;';
2249
-                 } ?>">
2246
+					 echo 'block;';
2247
+				 } else {
2248
+					 echo 'none;';
2249
+				 } ?>">
2250 2250
                 <input type="hidden" name="_wpnonce" value="<?php echo $nonce; ?>"/>
2251 2251
                 <input type="hidden" name="listing_type" id="listing_type" value="<?php echo $post_type;?>"/>
2252 2252
                 <input type="hidden" name="field_type" id="field_type" value="<?php echo $field_type;?>"/>
2253 2253
                 <input type="hidden" name="field_id" id="field_id" value="<?php echo $result_str;?>"/>
2254 2254
                 <input type="hidden" name="data_type" id="data_type" value="<?php if (isset($field_info->data_type)) {
2255
-                    echo $field_info->data_type;
2256
-                }?>"/>
2255
+					echo $field_info->data_type;
2256
+				}?>"/>
2257 2257
                 <input type="hidden" name="htmlvar_name" id="htmlvar_name" value="<?php echo $htmlvar_name;?>"/>
2258 2258
 
2259 2259
 
@@ -2276,14 +2276,14 @@  discard block
 block discarded – undo
2276 2276
 
2277 2277
                                 <input type="radio" id="asc_yes<?php echo $radio_id;?>" name="asc" class="gdri-enabled"  value="1"
2278 2278
                                     <?php if ($value == '1') {
2279
-                                        echo 'checked';
2280
-                                    } ?>/>
2279
+										echo 'checked';
2280
+									} ?>/>
2281 2281
                                 <label onclick="show_hide_radio(this,'show','cfs-asc-title');" for="asc_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
2282 2282
 
2283 2283
                                 <input type="radio" id="asc_no<?php echo $radio_id;?>" name="asc" class="gdri-disabled" value="0"
2284 2284
                                     <?php if ($value == '0' || !$value) {
2285
-                                        echo 'checked';
2286
-                                    } ?>/>
2285
+										echo 'checked';
2286
+									} ?>/>
2287 2287
                                 <label onclick="show_hide_radio(this,'hide','cfs-asc-title');" for="asc_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
2288 2288
 
2289 2289
                             </div>
@@ -2320,8 +2320,8 @@  discard block
 block discarded – undo
2320 2320
 
2321 2321
                                 <input type="radio" name="is_default"
2322 2322
                                        value="<?php echo $htmlvar_name; ?>_asc" <?php if (isset($field_info->default_order) && $field_info->default_order == $htmlvar_name . '_asc') {
2323
-                                    echo 'checked="checked"';
2324
-                                } ?>/>
2323
+									echo 'checked="checked"';
2324
+								} ?>/>
2325 2325
                             </div>
2326 2326
 
2327 2327
                         </li>
@@ -2341,14 +2341,14 @@  discard block
 block discarded – undo
2341 2341
 
2342 2342
                                 <input type="radio" id="desc_yes<?php echo $radio_id;?>" name="desc" class="gdri-enabled"  value="1"
2343 2343
                                     <?php if ($value == '1') {
2344
-                                        echo 'checked';
2345
-                                    } ?>/>
2344
+										echo 'checked';
2345
+									} ?>/>
2346 2346
                                 <label onclick="show_hide_radio(this,'show','cfs-desc-title');" for="desc_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
2347 2347
 
2348 2348
                                 <input type="radio" id="desc_no<?php echo $radio_id;?>" name="desc" class="gdri-disabled" value="0"
2349 2349
                                     <?php if ($value == '0' || !$value) {
2350
-                                        echo 'checked';
2351
-                                    } ?>/>
2350
+										echo 'checked';
2351
+									} ?>/>
2352 2352
                                 <label onclick="show_hide_radio(this,'hide','cfs-desc-title');" for="desc_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
2353 2353
 
2354 2354
                             </div>
@@ -2384,8 +2384,8 @@  discard block
 block discarded – undo
2384 2384
 
2385 2385
                                 <input type="radio" name="is_default"
2386 2386
                                        value="<?php echo $htmlvar_name; ?>_desc" <?php if (isset($field_info->default_order) && $field_info->default_order == $htmlvar_name . '_desc') {
2387
-                                    echo 'checked="checked"';
2388
-                                } ?>/>
2387
+									echo 'checked="checked"';
2388
+								} ?>/>
2389 2389
                             </div>
2390 2390
 
2391 2391
                         </li>
@@ -2427,8 +2427,8 @@  discard block
 block discarded – undo
2427 2427
 
2428 2428
                                 <input type="checkbox" name="is_default"
2429 2429
                                        value="<?php echo $field_type; ?>"  <?php if (isset($value) && $value == '1') {
2430
-                                    echo 'checked="checked"';
2431
-                                } ?>/>
2430
+									echo 'checked="checked"';
2431
+								} ?>/>
2432 2432
                             </div>
2433 2433
 
2434 2434
 
@@ -2451,14 +2451,14 @@  discard block
 block discarded – undo
2451 2451
 
2452 2452
                             <input type="radio" id="is_active_yes<?php echo $radio_id;?>" name="is_active" class="gdri-enabled"  value="1"
2453 2453
                                 <?php if ($value == '1') {
2454
-                                    echo 'checked';
2455
-                                } ?>/>
2454
+									echo 'checked';
2455
+								} ?>/>
2456 2456
                             <label for="is_active_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
2457 2457
 
2458 2458
                             <input type="radio" id="is_active_no<?php echo $radio_id;?>" name="is_active" class="gdri-disabled" value="0"
2459 2459
                                 <?php if ($value == '0' || !$value) {
2460
-                                    echo 'checked';
2461
-                                } ?>/>
2460
+									echo 'checked';
2461
+								} ?>/>
2462 2462
                             <label for="is_active_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
2463 2463
 
2464 2464
                         </div>
@@ -2468,8 +2468,8 @@  discard block
 block discarded – undo
2468 2468
 
2469 2469
                     <input type="hidden" readonly="readonly" name="sort_order" id="sort_order"
2470 2470
                                                 value="<?php if (isset($field_info->sort_order)) {
2471
-                                                    echo esc_attr($field_info->sort_order);
2472
-                                                }?>" size="50"/>
2471
+													echo esc_attr($field_info->sort_order);
2472
+												}?>" size="50"/>
2473 2473
 
2474 2474
 
2475 2475
 
@@ -2493,38 +2493,38 @@  discard block
 block discarded – undo
2493 2493
             </form>
2494 2494
         </li> <?php
2495 2495
 
2496
-    }
2496
+	}
2497 2497
 }
2498 2498
 
2499 2499
 if (!function_exists('check_field_visibility')) {
2500
-    /**
2501
-     * Check field visibility as per price package.
2502
-     *
2503
-     * @since 1.0.0
2504
-     * @package GeoDirectory
2505
-     * @global object $wpdb WordPress Database object.
2506
-     * @global array $geodir_addon_list List of active GeoDirectory extensions.
2507
-     * @param int|string $package_id The package ID.
2508
-     * @param string $field_name The field name.
2509
-     * @param string $post_type Optional. The wordpress post type.
2510
-     * @return bool Returns true when field visible, otherwise false.
2511
-     */
2512
-    function check_field_visibility($package_id, $field_name, $post_type)
2513
-    {
2514
-        global $wpdb, $geodir_addon_list;
2515
-        if (!(isset($geodir_addon_list['geodir_payment_manager']) && $geodir_addon_list['geodir_payment_manager'] == 'yes')) {
2516
-            return true;
2517
-        }
2518
-        if (!$package_id || !$field_name || !$post_type) {
2519
-            return true;
2520
-        }
2521
-        $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));
2522
-
2523
-        if ($wpdb->get_var($sql)) {
2524
-            return true;
2525
-        }
2526
-        return false;
2527
-    }
2500
+	/**
2501
+	 * Check field visibility as per price package.
2502
+	 *
2503
+	 * @since 1.0.0
2504
+	 * @package GeoDirectory
2505
+	 * @global object $wpdb WordPress Database object.
2506
+	 * @global array $geodir_addon_list List of active GeoDirectory extensions.
2507
+	 * @param int|string $package_id The package ID.
2508
+	 * @param string $field_name The field name.
2509
+	 * @param string $post_type Optional. The wordpress post type.
2510
+	 * @return bool Returns true when field visible, otherwise false.
2511
+	 */
2512
+	function check_field_visibility($package_id, $field_name, $post_type)
2513
+	{
2514
+		global $wpdb, $geodir_addon_list;
2515
+		if (!(isset($geodir_addon_list['geodir_payment_manager']) && $geodir_addon_list['geodir_payment_manager'] == 'yes')) {
2516
+			return true;
2517
+		}
2518
+		if (!$package_id || !$field_name || !$post_type) {
2519
+			return true;
2520
+		}
2521
+		$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));
2522
+
2523
+		if ($wpdb->get_var($sql)) {
2524
+			return true;
2525
+		}
2526
+		return false;
2527
+	}
2528 2528
 }
2529 2529
 
2530 2530
 /**
@@ -2539,43 +2539,43 @@  discard block
 block discarded – undo
2539 2539
  */
2540 2540
 function geodir_string_to_options($input = '', $translated = false)
2541 2541
 {
2542
-    $return = array();
2543
-    if ($input != '') {
2544
-        $input = trim($input);
2545
-        $input = rtrim($input, ",");
2546
-        $input = ltrim($input, ",");
2547
-        $input = trim($input);
2548
-    }
2549
-
2550
-    $input_arr = explode(',', $input);
2551
-
2552
-    if (!empty($input_arr)) {
2553
-        foreach ($input_arr as $input_str) {
2554
-            $input_str = trim($input_str);
2555
-
2556
-            if (strpos($input_str, "/") !== false) {
2557
-                $input_str = explode("/", $input_str, 2);
2558
-                $label = trim($input_str[0]);
2559
-                if ($translated && $label != '') {
2560
-                    $label = __($label, 'geodirectory');
2561
-                }
2562
-                $label = ucfirst($label);
2563
-                $value = trim($input_str[1]);
2564
-            } else {
2565
-                if ($translated && $input_str != '') {
2566
-                    $input_str = __($input_str, 'geodirectory');
2567
-                }
2568
-                $label = ucfirst($input_str);
2569
-                $value = $input_str;
2570
-            }
2571
-
2572
-            if ($label != '') {
2573
-                $return[] = array('label' => $label, 'value' => $value, 'optgroup' => NULL);
2574
-            }
2575
-        }
2576
-    }
2577
-
2578
-    return $return;
2542
+	$return = array();
2543
+	if ($input != '') {
2544
+		$input = trim($input);
2545
+		$input = rtrim($input, ",");
2546
+		$input = ltrim($input, ",");
2547
+		$input = trim($input);
2548
+	}
2549
+
2550
+	$input_arr = explode(',', $input);
2551
+
2552
+	if (!empty($input_arr)) {
2553
+		foreach ($input_arr as $input_str) {
2554
+			$input_str = trim($input_str);
2555
+
2556
+			if (strpos($input_str, "/") !== false) {
2557
+				$input_str = explode("/", $input_str, 2);
2558
+				$label = trim($input_str[0]);
2559
+				if ($translated && $label != '') {
2560
+					$label = __($label, 'geodirectory');
2561
+				}
2562
+				$label = ucfirst($label);
2563
+				$value = trim($input_str[1]);
2564
+			} else {
2565
+				if ($translated && $input_str != '') {
2566
+					$input_str = __($input_str, 'geodirectory');
2567
+				}
2568
+				$label = ucfirst($input_str);
2569
+				$value = $input_str;
2570
+			}
2571
+
2572
+			if ($label != '') {
2573
+				$return[] = array('label' => $label, 'value' => $value, 'optgroup' => NULL);
2574
+			}
2575
+		}
2576
+	}
2577
+
2578
+	return $return;
2579 2579
 }
2580 2580
 
2581 2581
 /**
@@ -2590,59 +2590,59 @@  discard block
 block discarded – undo
2590 2590
  */
2591 2591
 function geodir_string_values_to_options($option_values = '', $translated = false)
2592 2592
 {
2593
-    $options = array();
2594
-    if ($option_values == '') {
2595
-        return NULL;
2596
-    }
2597
-
2598
-    if (strpos($option_values, "{/optgroup}") !== false) {
2599
-        $option_values_arr = explode("{/optgroup}", $option_values);
2600
-
2601
-        foreach ($option_values_arr as $optgroup) {
2602
-            if (strpos($optgroup, "{optgroup}") !== false) {
2603
-                $optgroup_arr = explode("{optgroup}", $optgroup);
2604
-
2605
-                $count = 0;
2606
-                foreach ($optgroup_arr as $optgroup_str) {
2607
-                    $count++;
2608
-                    $optgroup_str = trim($optgroup_str);
2609
-
2610
-                    $optgroup_label = '';
2611
-                    if (strpos($optgroup_str, "|") !== false) {
2612
-                        $optgroup_str_arr = explode("|", $optgroup_str, 2);
2613
-                        $optgroup_label = trim($optgroup_str_arr[0]);
2614
-                        if ($translated && $optgroup_label != '') {
2615
-                            $optgroup_label = __($optgroup_label, 'geodirectory');
2616
-                        }
2617
-                        $optgroup_label = ucfirst($optgroup_label);
2618
-                        $optgroup_str = $optgroup_str_arr[1];
2619
-                    }
2620
-
2621
-                    $optgroup3 = geodir_string_to_options($optgroup_str, $translated);
2622
-
2623
-                    if ($count > 1 && $optgroup_label != '' && !empty($optgroup3)) {
2624
-                        $optgroup_start = array(array('label' => $optgroup_label, 'value' => NULL, 'optgroup' => 'start'));
2625
-                        $optgroup_end = array(array('label' => $optgroup_label, 'value' => NULL, 'optgroup' => 'end'));
2626
-                        $optgroup3 = array_merge($optgroup_start, $optgroup3, $optgroup_end);
2627
-                    }
2628
-                    $options = array_merge($options, $optgroup3);
2629
-                }
2630
-            } else {
2631
-                $optgroup1 = geodir_string_to_options($optgroup, $translated);
2632
-                $options = array_merge($options, $optgroup1);
2633
-            }
2634
-        }
2635
-    } else {
2636
-        $options = geodir_string_to_options($option_values, $translated);
2637
-    }
2638
-
2639
-    return $options;
2593
+	$options = array();
2594
+	if ($option_values == '') {
2595
+		return NULL;
2596
+	}
2597
+
2598
+	if (strpos($option_values, "{/optgroup}") !== false) {
2599
+		$option_values_arr = explode("{/optgroup}", $option_values);
2600
+
2601
+		foreach ($option_values_arr as $optgroup) {
2602
+			if (strpos($optgroup, "{optgroup}") !== false) {
2603
+				$optgroup_arr = explode("{optgroup}", $optgroup);
2604
+
2605
+				$count = 0;
2606
+				foreach ($optgroup_arr as $optgroup_str) {
2607
+					$count++;
2608
+					$optgroup_str = trim($optgroup_str);
2609
+
2610
+					$optgroup_label = '';
2611
+					if (strpos($optgroup_str, "|") !== false) {
2612
+						$optgroup_str_arr = explode("|", $optgroup_str, 2);
2613
+						$optgroup_label = trim($optgroup_str_arr[0]);
2614
+						if ($translated && $optgroup_label != '') {
2615
+							$optgroup_label = __($optgroup_label, 'geodirectory');
2616
+						}
2617
+						$optgroup_label = ucfirst($optgroup_label);
2618
+						$optgroup_str = $optgroup_str_arr[1];
2619
+					}
2620
+
2621
+					$optgroup3 = geodir_string_to_options($optgroup_str, $translated);
2622
+
2623
+					if ($count > 1 && $optgroup_label != '' && !empty($optgroup3)) {
2624
+						$optgroup_start = array(array('label' => $optgroup_label, 'value' => NULL, 'optgroup' => 'start'));
2625
+						$optgroup_end = array(array('label' => $optgroup_label, 'value' => NULL, 'optgroup' => 'end'));
2626
+						$optgroup3 = array_merge($optgroup_start, $optgroup3, $optgroup_end);
2627
+					}
2628
+					$options = array_merge($options, $optgroup3);
2629
+				}
2630
+			} else {
2631
+				$optgroup1 = geodir_string_to_options($optgroup, $translated);
2632
+				$options = array_merge($options, $optgroup1);
2633
+			}
2634
+		}
2635
+	} else {
2636
+		$options = geodir_string_to_options($option_values, $translated);
2637
+	}
2638
+
2639
+	return $options;
2640 2640
 }
2641 2641
 
2642 2642
 
2643 2643
 function geodir_cfa_data_type_text($output,$result_str,$cf,$field_info){
2644
-    ob_start();
2645
-    ?>
2644
+	ob_start();
2645
+	?>
2646 2646
     <li>
2647 2647
         <label for="data_type""><?php _e('Field Data Type ? :', 'geodirectory'); ?></label>
2648 2648
         <div class="gd-cf-input-wrap">
@@ -2651,16 +2651,16 @@  discard block
 block discarded – undo
2651 2651
                     onchange="javascript:gd_data_type_changed(this, '<?php echo $result_str; ?>');">
2652 2652
                 <option
2653 2653
                     value="XVARCHAR" <?php if (isset($field_info->data_type) && $field_info->data_type == 'VARCHAR') {
2654
-                    echo 'selected="selected"';
2655
-                } ?>><?php _e('CHARACTER', 'geodirectory'); ?></option>
2654
+					echo 'selected="selected"';
2655
+				} ?>><?php _e('CHARACTER', 'geodirectory'); ?></option>
2656 2656
                 <option
2657 2657
                     value="INT" <?php if (isset($field_info->data_type) && $field_info->data_type == 'INT') {
2658
-                    echo 'selected="selected"';
2659
-                } ?>><?php _e('NUMBER', 'geodirectory'); ?></option>
2658
+					echo 'selected="selected"';
2659
+				} ?>><?php _e('NUMBER', 'geodirectory'); ?></option>
2660 2660
                 <option
2661 2661
                     value="FLOAT" <?php if (isset($field_info->data_type) && $field_info->data_type == 'FLOAT') {
2662
-                    echo 'selected="selected"';
2663
-                } ?>><?php _e('DECIMAL', 'geodirectory'); ?></option>
2662
+					echo 'selected="selected"';
2663
+				} ?>><?php _e('DECIMAL', 'geodirectory'); ?></option>
2664 2664
             </select>
2665 2665
             <br/> <span><?php _e('Select Custom Field type', 'geodirectory'); ?></span>
2666 2666
 
@@ -2673,8 +2673,8 @@  discard block
 block discarded – undo
2673 2673
             <select name="decimal_point" id="decimal_point">
2674 2674
                 <option value=""><?php echo _e('Select', 'geodirectory'); ?></option>
2675 2675
                 <?php for ($i = 1; $i <= 10; $i++) {
2676
-                    $decimal_point = isset($field_info->decimal_point) ? $field_info->decimal_point : '';
2677
-                    $selected = $i == $decimal_point ? 'selected="selected"' : ''; ?>
2676
+					$decimal_point = isset($field_info->decimal_point) ? $field_info->decimal_point : '';
2677
+					$selected = $i == $decimal_point ? 'selected="selected"' : ''; ?>
2678 2678
                     <option value="<?php echo $i; ?>" <?php echo $selected; ?>><?php echo $i; ?></option>
2679 2679
                 <?php } ?>
2680 2680
             </select>
@@ -2683,8 +2683,8 @@  discard block
 block discarded – undo
2683 2683
     </li>
2684 2684
 <?php
2685 2685
 
2686
-    $output = ob_get_clean();
2687
-    return $output;
2686
+	$output = ob_get_clean();
2687
+	return $output;
2688 2688
 }
2689 2689
 add_filter('geodir_cfa_data_type_text','geodir_cfa_data_type_text',10,4);
2690 2690
 
@@ -2722,9 +2722,9 @@  discard block
 block discarded – undo
2722 2722
 
2723 2723
 
2724 2724
 function geodir_cfa_advanced_editor_geodir_special_offers($output,$result_str,$cf,$field_info){
2725
-    if($field_info->htmlvar_name != 'geodir_special_offers'){return '';}
2726
-    ob_start();
2727
-    ?>
2725
+	if($field_info->htmlvar_name != 'geodir_special_offers'){return '';}
2726
+	ob_start();
2727
+	?>
2728 2728
     <li>
2729 2729
         <label for="advanced_editor" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Show advanced editor :', 'geodirectory'); ?>
2730 2730
             <div class="gdcf-tooltip">
@@ -2735,13 +2735,13 @@  discard block
 block discarded – undo
2735 2735
         <div class="gd-cf-input-wrap">
2736 2736
 
2737 2737
             <?php
2738
-            $selected = '';
2739
-            if (isset($field_info->extra_fields))
2740
-                $advanced_editor = unserialize($field_info->extra_fields);
2738
+			$selected = '';
2739
+			if (isset($field_info->extra_fields))
2740
+				$advanced_editor = unserialize($field_info->extra_fields);
2741 2741
 
2742
-            if (!empty($advanced_editor) && is_array($advanced_editor) && in_array('1', $advanced_editor))
2743
-                $selected = 'checked="checked"';
2744
-            ?>
2742
+			if (!empty($advanced_editor) && is_array($advanced_editor) && in_array('1', $advanced_editor))
2743
+				$selected = 'checked="checked"';
2744
+			?>
2745 2745
 
2746 2746
             <input type="checkbox" name="advanced_editor[]" id="advanced_editor"
2747 2747
                    value="1" <?php echo $selected; ?>/>
@@ -2750,22 +2750,22 @@  discard block
 block discarded – undo
2750 2750
     </li>
2751 2751
     <?php
2752 2752
 
2753
-    $output = ob_get_clean();
2754
-    return $output;
2753
+	$output = ob_get_clean();
2754
+	return $output;
2755 2755
 }
2756 2756
 add_filter('geodir_cfa_advanced_editor_textarea','geodir_cfa_advanced_editor_geodir_special_offers',10,4);
2757 2757
 
2758 2758
 
2759 2759
 function geodir_cfa_validation_pattern_text($output,$result_str,$cf,$field_info){
2760
-    ob_start();
2761
-
2762
-    $value = '';
2763
-    if (isset($field_info->validation_pattern)) {
2764
-        $value = esc_attr($field_info->validation_pattern);
2765
-    }elseif(isset($cf['defaults']['validation_pattern']) && $cf['defaults']['validation_pattern']){
2766
-        $value = esc_attr($cf['defaults']['validation_pattern']);
2767
-    }
2768
-    ?>
2760
+	ob_start();
2761
+
2762
+	$value = '';
2763
+	if (isset($field_info->validation_pattern)) {
2764
+		$value = esc_attr($field_info->validation_pattern);
2765
+	}elseif(isset($cf['defaults']['validation_pattern']) && $cf['defaults']['validation_pattern']){
2766
+		$value = esc_attr($cf['defaults']['validation_pattern']);
2767
+	}
2768
+	?>
2769 2769
     <li>
2770 2770
         <label for="validation_pattern" class="gd-cf-tooltip-wrap">
2771 2771
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Validation Pattern:', 'geodirectory'); ?>
@@ -2779,13 +2779,13 @@  discard block
 block discarded – undo
2779 2779
         </div>
2780 2780
     </li>
2781 2781
     <?php
2782
-    $value = '';
2783
-    if (isset($field_info->validation_msg)) {
2784
-        $value = esc_attr($field_info->validation_msg);
2785
-    }elseif(isset($cf['defaults']['validation_msg']) && $cf['defaults']['validation_msg']){
2786
-        $value = esc_attr($cf['defaults']['validation_msg']);
2787
-    }
2788
-    ?>
2782
+	$value = '';
2783
+	if (isset($field_info->validation_msg)) {
2784
+		$value = esc_attr($field_info->validation_msg);
2785
+	}elseif(isset($cf['defaults']['validation_msg']) && $cf['defaults']['validation_msg']){
2786
+		$value = esc_attr($cf['defaults']['validation_msg']);
2787
+	}
2788
+	?>
2789 2789
     <li>
2790 2790
         <label for="validation_msg" class="gd-cf-tooltip-wrap">
2791 2791
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Validation Message:', 'geodirectory'); ?>
@@ -2800,21 +2800,21 @@  discard block
 block discarded – undo
2800 2800
     </li>
2801 2801
     <?php
2802 2802
 
2803
-    $output = ob_get_clean();
2804
-    return $output;
2803
+	$output = ob_get_clean();
2804
+	return $output;
2805 2805
 }
2806 2806
 add_filter('geodir_cfa_validation_pattern_text','geodir_cfa_validation_pattern_text',10,4);
2807 2807
 
2808 2808
 
2809 2809
 function geodir_cfa_htmlvar_name_taxonomy($output,$result_str,$cf,$field_info){
2810
-    ob_start();
2811
-    global $post_type;
2812
-
2813
-    if (!isset($field_info->post_type)) {
2814
-        $post_type = sanitize_text_field($_REQUEST['listing_type']);
2815
-    } else
2816
-        $post_type = $field_info->post_type;
2817
-    ?>
2810
+	ob_start();
2811
+	global $post_type;
2812
+
2813
+	if (!isset($field_info->post_type)) {
2814
+		$post_type = sanitize_text_field($_REQUEST['listing_type']);
2815
+	} else
2816
+		$post_type = $field_info->post_type;
2817
+	?>
2818 2818
     <li style="display: none;">
2819 2819
         <label for="htmlvar_name" class="gd-cf-tooltip-wrap">
2820 2820
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Select taxonomy:', 'geodirectory'); ?>
@@ -2825,15 +2825,15 @@  discard block
 block discarded – undo
2825 2825
         <div class="gd-cf-input-wrap">
2826 2826
             <select name="htmlvar_name" id="htmlvar_name">
2827 2827
                 <?php
2828
-                $gd_taxonomy = geodir_get_taxonomies($post_type);
2828
+				$gd_taxonomy = geodir_get_taxonomies($post_type);
2829 2829
 
2830
-                foreach ($gd_taxonomy as $gd_tax) {
2831
-                    ?>
2830
+				foreach ($gd_taxonomy as $gd_tax) {
2831
+					?>
2832 2832
                     <option <?php if (isset($field_info->htmlvar_name) && $field_info->htmlvar_name == $gd_tax) {
2833
-                        echo 'selected="selected"';
2834
-                    }?> id="<?php echo $gd_tax;?>"><?php echo $gd_tax;?></option><?php
2835
-                }
2836
-                ?>
2833
+						echo 'selected="selected"';
2834
+					}?> id="<?php echo $gd_tax;?>"><?php echo $gd_tax;?></option><?php
2835
+				}
2836
+				?>
2837 2837
             </select>
2838 2838
         </div>
2839 2839
     </li>
@@ -2849,47 +2849,47 @@  discard block
 block discarded – undo
2849 2849
 
2850 2850
             <select name="cat_display_type" id="cat_display_type">
2851 2851
                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'ajax_chained') {
2852
-                    echo 'selected="selected"';
2853
-                }?> value="ajax_chained"><?php _e('Ajax Chained', 'geodirectory');?></option>
2852
+					echo 'selected="selected"';
2853
+				}?> value="ajax_chained"><?php _e('Ajax Chained', 'geodirectory');?></option>
2854 2854
                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'select') {
2855
-                    echo 'selected="selected"';
2856
-                }?> value="select"><?php _e('Select', 'geodirectory');?></option>
2855
+					echo 'selected="selected"';
2856
+				}?> value="select"><?php _e('Select', 'geodirectory');?></option>
2857 2857
                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'multiselect') {
2858
-                    echo 'selected="selected"';
2859
-                }?> value="multiselect"><?php _e('Multiselect', 'geodirectory');?></option>
2858
+					echo 'selected="selected"';
2859
+				}?> value="multiselect"><?php _e('Multiselect', 'geodirectory');?></option>
2860 2860
                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'checkbox') {
2861
-                    echo 'selected="selected"';
2862
-                }?> value="checkbox"><?php _e('Checkbox', 'geodirectory');?></option>
2861
+					echo 'selected="selected"';
2862
+				}?> value="checkbox"><?php _e('Checkbox', 'geodirectory');?></option>
2863 2863
                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'radio') {
2864
-                    echo 'selected="selected"';
2865
-                }?> value="radio"><?php _e('Radio', 'geodirectory');?></option>
2864
+					echo 'selected="selected"';
2865
+				}?> value="radio"><?php _e('Radio', 'geodirectory');?></option>
2866 2866
             </select>
2867 2867
         </div>
2868 2868
     </li>
2869 2869
     <?php
2870 2870
 
2871
-    $output = ob_get_clean();
2872
-    return $output;
2871
+	$output = ob_get_clean();
2872
+	return $output;
2873 2873
 }
2874 2874
 add_filter('geodir_cfa_htmlvar_name_taxonomy','geodir_cfa_htmlvar_name_taxonomy',10,4);
2875 2875
 
2876 2876
 
2877 2877
 function geodir_cfa_extra_fields_address($output,$result_str,$cf,$field_info){
2878 2878
 
2879
-    ob_start();
2880
-    if (isset($field_info->extra_fields) && $field_info->extra_fields != '') {
2881
-        $address = unserialize($field_info->extra_fields);
2882
-    }
2883
-    ?>
2879
+	ob_start();
2880
+	if (isset($field_info->extra_fields) && $field_info->extra_fields != '') {
2881
+		$address = unserialize($field_info->extra_fields);
2882
+	}
2883
+	?>
2884 2884
     <?php
2885
-    /**
2886
-     * Called on the add custom fields settings page before the address field is output.
2887
-     *
2888
-     * @since 1.0.0
2889
-     * @param array $address The address settings array.
2890
-     * @param object $field_info Extra fields info.
2891
-     */
2892
-    do_action('geodir_address_extra_admin_fields', $address, $field_info); ?>
2885
+	/**
2886
+	 * Called on the add custom fields settings page before the address field is output.
2887
+	 *
2888
+	 * @since 1.0.0
2889
+	 * @param array $address The address settings array.
2890
+	 * @param object $field_info Extra fields info.
2891
+	 */
2892
+	do_action('geodir_address_extra_admin_fields', $address, $field_info); ?>
2893 2893
 
2894 2894
     <li>
2895 2895
         <label for="show_zip" class="gd-cf-tooltip-wrap">
@@ -2902,14 +2902,14 @@  discard block
 block discarded – undo
2902 2902
 
2903 2903
             <input type="radio" id="show_zip_yes<?php echo $radio_id;?>" name="extra[show_zip]" class="gdri-enabled"  value="1"
2904 2904
                 <?php if (isset($address['show_zip']) && $address['show_zip'] == '1') {
2905
-                    echo 'checked';
2906
-                } ?>/>
2905
+					echo 'checked';
2906
+				} ?>/>
2907 2907
             <label onclick="show_hide_radio(this,'show','cf-zip-lable');" for="show_zip_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
2908 2908
 
2909 2909
             <input type="radio" id="show_zip_no<?php echo $radio_id;?>" name="extra[show_zip]" class="gdri-disabled" value="0"
2910 2910
                 <?php if ((isset($address['show_zip']) && !$address['show_zip']) || !isset($address['show_zip'])) {
2911
-                    echo 'checked';
2912
-                } ?>/>
2911
+					echo 'checked';
2912
+				} ?>/>
2913 2913
             <label onclick="show_hide_radio(this,'hide','cf-zip-lable');" for="show_zip_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
2914 2914
 
2915 2915
 
@@ -2926,8 +2926,8 @@  discard block
 block discarded – undo
2926 2926
         <div class="gd-cf-input-wrap">
2927 2927
             <input type="text" name="extra[zip_lable]" id="zip_lable"
2928 2928
                    value="<?php if (isset($address['zip_lable'])) {
2929
-                       echo esc_attr($address['zip_lable']);
2930
-                   }?>"/>
2929
+					   echo esc_attr($address['zip_lable']);
2930
+				   }?>"/>
2931 2931
         </div>
2932 2932
     </li>
2933 2933
 
@@ -2944,8 +2944,8 @@  discard block
 block discarded – undo
2944 2944
         <div class="gd-cf-input-wrap">
2945 2945
             <input type="text" name="extra[map_lable]" id="map_lable"
2946 2946
                    value="<?php if (isset($address['map_lable'])) {
2947
-                       echo esc_attr($address['map_lable']);
2948
-                   }?>"/>
2947
+					   echo esc_attr($address['map_lable']);
2948
+				   }?>"/>
2949 2949
         </div>
2950 2950
     </li>
2951 2951
 
@@ -2960,14 +2960,14 @@  discard block
 block discarded – undo
2960 2960
 
2961 2961
             <input type="radio" id="show_mapzoom_yes<?php echo $radio_id;?>" name="extra[show_mapzoom]" class="gdri-enabled"  value="1"
2962 2962
                 <?php if (isset($address['show_mapzoom']) && $address['show_mapzoom'] == '1') {
2963
-                    echo 'checked';
2964
-                } ?>/>
2963
+					echo 'checked';
2964
+				} ?>/>
2965 2965
             <label for="show_mapzoom_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
2966 2966
 
2967 2967
             <input type="radio" id="show_mapzoom_no<?php echo $radio_id;?>" name="extra[show_mapzoom]" class="gdri-disabled" value="0"
2968 2968
                 <?php if ((isset($address['show_mapzoom']) && !$address['show_mapzoom']) || !isset($address['show_mapzoom'])) {
2969
-                    echo 'checked';
2970
-                } ?>/>
2969
+					echo 'checked';
2970
+				} ?>/>
2971 2971
             <label for="show_mapzoom_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
2972 2972
 
2973 2973
         </div>
@@ -2984,14 +2984,14 @@  discard block
 block discarded – undo
2984 2984
 
2985 2985
             <input type="radio" id="show_mapview_yes<?php echo $radio_id;?>" name="extra[show_mapview]" class="gdri-enabled"  value="1"
2986 2986
                 <?php if (isset($address['show_mapview']) && $address['show_mapview'] == '1') {
2987
-                    echo 'checked';
2988
-                } ?>/>
2987
+					echo 'checked';
2988
+				} ?>/>
2989 2989
             <label for="show_mapview_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
2990 2990
 
2991 2991
             <input type="radio" id="show_mapview_no<?php echo $radio_id;?>" name="extra[show_mapview]" class="gdri-disabled" value="0"
2992 2992
                 <?php if ((isset($address['show_mapview']) && !$address['show_mapview']) || !isset($address['show_mapview'])) {
2993
-                    echo 'checked';
2994
-                } ?>/>
2993
+					echo 'checked';
2994
+				} ?>/>
2995 2995
             <label for="show_mapview_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
2996 2996
 
2997 2997
         </div>
@@ -3008,8 +3008,8 @@  discard block
 block discarded – undo
3008 3008
         <div class="gd-cf-input-wrap">
3009 3009
             <input type="text" name="extra[mapview_lable]" id="mapview_lable"
3010 3010
                    value="<?php if (isset($address['mapview_lable'])) {
3011
-                       echo esc_attr($address['mapview_lable']);
3012
-                   }?>"/>
3011
+					   echo esc_attr($address['mapview_lable']);
3012
+				   }?>"/>
3013 3013
         </div>
3014 3014
     </li>
3015 3015
     <li>
@@ -3023,29 +3023,29 @@  discard block
 block discarded – undo
3023 3023
 
3024 3024
             <input type="radio" id="show_latlng_yes<?php echo $radio_id;?>" name="extra[show_latlng]" class="gdri-enabled"  value="1"
3025 3025
                 <?php if (isset($address['show_latlng']) && $address['show_latlng'] == '1') {
3026
-                    echo 'checked';
3027
-                } ?>/>
3026
+					echo 'checked';
3027
+				} ?>/>
3028 3028
             <label for="show_latlng_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
3029 3029
 
3030 3030
             <input type="radio" id="show_latlng_no<?php echo $radio_id;?>" name="extra[show_latlng]" class="gdri-disabled" value="0"
3031 3031
                 <?php if ((isset($address['show_latlng']) && !$address['show_latlng']) || !isset($address['show_latlng'])) {
3032
-                    echo 'checked';
3033
-                } ?>/>
3032
+					echo 'checked';
3033
+				} ?>/>
3034 3034
             <label for="show_latlng_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
3035 3035
 
3036 3036
         </div>
3037 3037
     </li>
3038 3038
     <?php
3039 3039
 
3040
-    $output = ob_get_clean();
3041
-    return $output;
3040
+	$output = ob_get_clean();
3041
+	return $output;
3042 3042
 }
3043 3043
 add_filter('geodir_cfa_extra_fields_address','geodir_cfa_extra_fields_address',10,4);
3044 3044
 
3045 3045
 
3046 3046
 function geodir_cfa_extra_fields_multiselect($output,$result_str,$cf,$field_info){
3047
-    ob_start();
3048
-    ?>
3047
+	ob_start();
3048
+	?>
3049 3049
     <li>
3050 3050
         <label for="multi_display_type" class="gd-cf-tooltip-wrap">
3051 3051
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Multiselect display type :', 'geodirectory'); ?>
@@ -3057,14 +3057,14 @@  discard block
 block discarded – undo
3057 3057
 
3058 3058
             <select name="multi_display_type" id="multi_display_type">
3059 3059
                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'select') {
3060
-                    echo 'selected="selected"';
3061
-                }?> value="select"><?php _e('Select', 'geodirectory');?></option>
3060
+					echo 'selected="selected"';
3061
+				}?> value="select"><?php _e('Select', 'geodirectory');?></option>
3062 3062
                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'checkbox') {
3063
-                    echo 'selected="selected"';
3064
-                }?> value="checkbox"><?php _e('Checkbox', 'geodirectory');?></option>
3063
+					echo 'selected="selected"';
3064
+				}?> value="checkbox"><?php _e('Checkbox', 'geodirectory');?></option>
3065 3065
                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'radio') {
3066
-                    echo 'selected="selected"';
3067
-                }?> value="radio"><?php _e('Radio', 'geodirectory');?></option>
3066
+					echo 'selected="selected"';
3067
+				}?> value="radio"><?php _e('Radio', 'geodirectory');?></option>
3068 3068
             </select>
3069 3069
 
3070 3070
             <br/>
@@ -3072,15 +3072,15 @@  discard block
 block discarded – undo
3072 3072
     </li>
3073 3073
     <?php
3074 3074
 
3075
-    $output = ob_get_clean();
3076
-    return $output;
3075
+	$output = ob_get_clean();
3076
+	return $output;
3077 3077
 }
3078 3078
 add_filter('geodir_cfa_extra_fields_multiselect','geodir_cfa_extra_fields_multiselect',10,4);
3079 3079
 
3080 3080
 
3081 3081
 function geodir_cfa_extra_fields_smr($output,$result_str,$cf,$field_info){
3082
-    ob_start();
3083
-    ?>
3082
+	ob_start();
3083
+	?>
3084 3084
     <li>
3085 3085
         <label for="option_values" class="gd-cf-tooltip-wrap">
3086 3086
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Option Values :', 'geodirectory'); ?>
@@ -3101,16 +3101,16 @@  discard block
 block discarded – undo
3101 3101
         <div class="gd-cf-input-wrap">
3102 3102
             <input type="text" name="option_values" id="option_values"
3103 3103
                    value="<?php if (isset($field_info->option_values)) {
3104
-                       echo esc_attr($field_info->option_values);
3105
-                   }?>"/>
3104
+					   echo esc_attr($field_info->option_values);
3105
+				   }?>"/>
3106 3106
             <br/>
3107 3107
 
3108 3108
         </div>
3109 3109
     </li>
3110 3110
     <?php
3111 3111
 
3112
-    $output = ob_get_clean();
3113
-    return $output;
3112
+	$output = ob_get_clean();
3113
+	return $output;
3114 3114
 }
3115 3115
 add_filter('geodir_cfa_extra_fields_multiselect','geodir_cfa_extra_fields_smr',10,4);
3116 3116
 add_filter('geodir_cfa_extra_fields_select','geodir_cfa_extra_fields_smr',10,4);
@@ -3118,11 +3118,11 @@  discard block
 block discarded – undo
3118 3118
 
3119 3119
 
3120 3120
 function geodir_cfa_extra_fields_datepicker($output,$result_str,$cf,$field_info){
3121
-    ob_start();
3122
-    if (isset($field_info->extra_fields) && $field_info->extra_fields != '') {
3123
-        $extra = unserialize($field_info->extra_fields);
3124
-    }
3125
-    ?>
3121
+	ob_start();
3122
+	if (isset($field_info->extra_fields) && $field_info->extra_fields != '') {
3123
+		$extra = unserialize($field_info->extra_fields);
3124
+	}
3125
+	?>
3126 3126
     <li>
3127 3127
         <label for="date_format" class="gd-cf-tooltip-wrap">
3128 3128
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Date Format :', 'geodirectory'); ?>
@@ -3132,52 +3132,52 @@  discard block
 block discarded – undo
3132 3132
         </label>
3133 3133
         <div class="gd-cf-input-wrap" style="overflow:inherit;">
3134 3134
             <?php
3135
-            $date_formats = array(
3136
-                'm/d/Y',
3137
-                'd/m/Y',
3138
-                'Y/m/d',
3139
-                'm-d-Y',
3140
-                'd-m-Y',
3141
-                'Y-m-d',
3142
-                'F j, Y',
3143
-            );
3144
-            /**
3145
-             * Filter the custom field date format options.
3146
-             *
3147
-             * @since 1.6.5
3148
-             * @param array $date_formats The PHP date format array.
3149
-             */
3150
-            $date_formats = apply_filters('geodir_date_formats',$date_formats);
3151
-            ?>
3135
+			$date_formats = array(
3136
+				'm/d/Y',
3137
+				'd/m/Y',
3138
+				'Y/m/d',
3139
+				'm-d-Y',
3140
+				'd-m-Y',
3141
+				'Y-m-d',
3142
+				'F j, Y',
3143
+			);
3144
+			/**
3145
+			 * Filter the custom field date format options.
3146
+			 *
3147
+			 * @since 1.6.5
3148
+			 * @param array $date_formats The PHP date format array.
3149
+			 */
3150
+			$date_formats = apply_filters('geodir_date_formats',$date_formats);
3151
+			?>
3152 3152
             <select name="extra[date_format]" id="date_format">
3153 3153
                 <?php
3154
-                foreach($date_formats as $format){
3155
-                    $selected = '';
3156
-                    if(esc_attr($extra['date_format'])==$format){
3157
-                        $selected = "selected='selected'";
3158
-                    }
3159
-                    echo "<option $selected value='$format'>$format       (".date_i18n( $format, time()).")</option>";
3160
-                }
3161
-                ?>
3154
+				foreach($date_formats as $format){
3155
+					$selected = '';
3156
+					if(esc_attr($extra['date_format'])==$format){
3157
+						$selected = "selected='selected'";
3158
+					}
3159
+					echo "<option $selected value='$format'>$format       (".date_i18n( $format, time()).")</option>";
3160
+				}
3161
+				?>
3162 3162
             </select>
3163 3163
 
3164 3164
         </div>
3165 3165
     </li>
3166 3166
     <?php
3167 3167
 
3168
-    $output = ob_get_clean();
3169
-    return $output;
3168
+	$output = ob_get_clean();
3169
+	return $output;
3170 3170
 }
3171 3171
 add_filter('geodir_cfa_extra_fields_datepicker','geodir_cfa_extra_fields_datepicker',10,4);
3172 3172
 
3173 3173
 
3174 3174
 function geodir_cfa_extra_fields_file($output,$result_str,$cf,$field_info){
3175
-    ob_start();
3176
-    $allowed_file_types = geodir_allowed_mime_types();
3175
+	ob_start();
3176
+	$allowed_file_types = geodir_allowed_mime_types();
3177 3177
 
3178
-    $extra_fields = isset($field_info->extra_fields) && $field_info->extra_fields != '' ? maybe_unserialize($field_info->extra_fields) : '';
3179
-    $gd_file_types = !empty($extra_fields) && !empty($extra_fields['gd_file_types']) ? $extra_fields['gd_file_types'] : array('*');
3180
-    ?>
3178
+	$extra_fields = isset($field_info->extra_fields) && $field_info->extra_fields != '' ? maybe_unserialize($field_info->extra_fields) : '';
3179
+	$gd_file_types = !empty($extra_fields) && !empty($extra_fields['gd_file_types']) ? $extra_fields['gd_file_types'] : array('*');
3180
+	?>
3181 3181
     <li>
3182 3182
         <label for="gd_file_types" class="gd-cf-tooltip-wrap">
3183 3183
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Allowed file types :', 'geodirectory'); ?>
@@ -3200,7 +3200,7 @@  discard block
 block discarded – undo
3200 3200
     </li>
3201 3201
     <?php
3202 3202
 
3203
-    $output = ob_get_clean();
3204
-    return $output;
3203
+	$output = ob_get_clean();
3204
+	return $output;
3205 3205
 }
3206 3206
 add_filter('geodir_cfa_extra_fields_file','geodir_cfa_extra_fields_file',10,4);
3207 3207
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +348 added lines, -348 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
     function geodir_add_column_if_not_exist($db, $column, $column_attr = "VARCHAR( 255 ) NOT NULL")
50 50
     {
51 51
         global $wpdb;
52
-        $result = 0;// no rows affected
52
+        $result = 0; // no rows affected
53 53
         if (!geodir_column_exist($db, $column)) {
54 54
             if (!empty($db) && !empty($column))
55 55
                 $result = $wpdb->query("ALTER TABLE `$db` ADD `$column`  $column_attr");
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 {
75 75
     global $wpdb, $geodir_post_custom_fields_cache;
76 76
 
77
-    $cache_stored = $post_type . '_' . $package_id . '_' . $default . '_' . $fields_location;
77
+    $cache_stored = $post_type.'_'.$package_id.'_'.$default.'_'.$fields_location;
78 78
 
79 79
     if (array_key_exists($cache_stored, $geodir_post_custom_fields_cache)) {
80 80
         return $geodir_post_custom_fields_cache[$cache_stored];
@@ -88,14 +88,14 @@  discard block
 block discarded – undo
88 88
         $default_query .= " and is_admin = '0' ";
89 89
 
90 90
     if ($fields_location == 'none') {
91
-    } else{
92
-        $fields_location = esc_sql( $fields_location );
91
+    } else {
92
+        $fields_location = esc_sql($fields_location);
93 93
         $default_query .= " and show_in LIKE '%%[$fields_location]%%' ";
94 94
     }
95 95
 
96 96
     $post_meta_info = $wpdb->get_results(
97 97
         $wpdb->prepare(
98
-            "select * from " . GEODIR_CUSTOM_FIELDS_TABLE . " where is_active = '1' and post_type = %s {$default_query} order by sort_order asc,admin_title asc",
98
+            "select * from ".GEODIR_CUSTOM_FIELDS_TABLE." where is_active = '1' and post_type = %s {$default_query} order by sort_order asc,admin_title asc",
99 99
             array($post_type)
100 100
         )
101 101
     );
@@ -162,13 +162,13 @@  discard block
 block discarded – undo
162 162
      * @param string $field_ins_upd When set to "submit" displays form.
163 163
      * @param string $field_type_key The key of the custom field.
164 164
      */
165
-    function geodir_custom_field_adminhtml($field_type, $result_str, $field_ins_upd = '', $field_type_key ='')
165
+    function geodir_custom_field_adminhtml($field_type, $result_str, $field_ins_upd = '', $field_type_key = '')
166 166
     {
167 167
         global $wpdb;
168 168
         $cf = $result_str;
169 169
         if (!is_object($cf)) {
170 170
 
171
-            $field_info = $wpdb->get_row($wpdb->prepare("select * from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id= %d", array($cf)));
171
+            $field_info = $wpdb->get_row($wpdb->prepare("select * from ".GEODIR_CUSTOM_FIELDS_TABLE." where id= %d", array($cf)));
172 172
 
173 173
         } else {
174 174
             $field_info = $cf;
@@ -202,14 +202,14 @@  discard block
 block discarded – undo
202 202
         if ($field_id != '') {
203 203
             $cf = trim($field_id, '_');
204 204
 
205
-            if ($field = $wpdb->get_row($wpdb->prepare("select htmlvar_name,post_type,field_type from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id= %d", array($cf)))) {
206
-                $wpdb->query($wpdb->prepare("delete from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id= %d ", array($cf)));
205
+            if ($field = $wpdb->get_row($wpdb->prepare("select htmlvar_name,post_type,field_type from ".GEODIR_CUSTOM_FIELDS_TABLE." where id= %d", array($cf)))) {
206
+                $wpdb->query($wpdb->prepare("delete from ".GEODIR_CUSTOM_FIELDS_TABLE." where id= %d ", array($cf)));
207 207
 
208 208
                 $post_type = $field->post_type;
209 209
                 $htmlvar_name = $field->htmlvar_name;
210 210
 
211 211
                 if ($post_type != '' && $htmlvar_name != '') {
212
-                    $wpdb->query($wpdb->prepare("DELETE FROM " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " WHERE htmlvar_name=%s AND post_type=%s LIMIT 1", array($htmlvar_name, $post_type)));
212
+                    $wpdb->query($wpdb->prepare("DELETE FROM ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." WHERE htmlvar_name=%s AND post_type=%s LIMIT 1", array($htmlvar_name, $post_type)));
213 213
                 }
214 214
 
215 215
                 /**
@@ -223,18 +223,18 @@  discard block
 block discarded – undo
223 223
                 do_action('geodir_after_custom_field_deleted', $cf, $field->htmlvar_name, $post_type);
224 224
 
225 225
                 if ($field->field_type == 'address') {
226
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_address`");
227
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_city`");
228
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_region`");
229
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_country`");
230
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_zip`");
231
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_latitude`");
232
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_longitude`");
233
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_mapview`");
234
-                    $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_mapzoom`");
226
+                    $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_address`");
227
+                    $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_city`");
228
+                    $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_region`");
229
+                    $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_country`");
230
+                    $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_zip`");
231
+                    $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_latitude`");
232
+                    $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_longitude`");
233
+                    $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_mapview`");
234
+                    $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_mapzoom`");
235 235
                 } else {
236 236
                     if ($field->field_type != 'fieldset') {
237
-                        $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "`");
237
+                        $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."`");
238 238
                     }
239 239
                 }
240 240
 
@@ -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'];
@@ -380,12 +380,12 @@  discard block
 block discarded – undo
380 380
             $for_admin_use = isset($request_field['for_admin_use']) ? $request_field['for_admin_use'] : '';
381 381
 
382 382
             
383
-            if(is_array($show_in)){
383
+            if (is_array($show_in)) {
384 384
                 $show_in = implode(",", $request_field['show_in']);
385 385
             }
386 386
             
387 387
             if ($field_type != 'address' && $field_type != 'taxonomy' && $field_type != 'fieldset') {
388
-                $htmlvar_name = 'geodir_' . $htmlvar_name;
388
+                $htmlvar_name = 'geodir_'.$htmlvar_name;
389 389
             }
390 390
 
391 391
             $option_values = '';
@@ -426,9 +426,9 @@  discard block
 block discarded – undo
426 426
 
427 427
             if ($sort_order == '') {
428 428
 
429
-                $last_order = $wpdb->get_var("SELECT MAX(sort_order) as last_order FROM " . GEODIR_CUSTOM_FIELDS_TABLE);
429
+                $last_order = $wpdb->get_var("SELECT MAX(sort_order) as last_order FROM ".GEODIR_CUSTOM_FIELDS_TABLE);
430 430
 
431
-                $sort_order = (int)$last_order + 1;
431
+                $sort_order = (int) $last_order + 1;
432 432
             }
433 433
 
434 434
             $default_value_add = '';
@@ -440,15 +440,15 @@  discard block
 block discarded – undo
440 440
                     case 'address':
441 441
 
442 442
                         if ($htmlvar_name != '') {
443
-                            $prefix = $htmlvar_name . '_';
443
+                            $prefix = $htmlvar_name.'_';
444 444
                         }
445
-                        $old_prefix = $old_html_variable . '_';
445
+                        $old_prefix = $old_html_variable.'_';
446 446
 
447 447
 
448
-                        $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "address` `" . $prefix . "address` VARCHAR( 254 ) NULL";
448
+                        $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."address` `".$prefix."address` VARCHAR( 254 ) NULL";
449 449
 
450 450
                         if ($default_value != '') {
451
-                            $meta_field_add .= " DEFAULT '" . $default_value . "'";
451
+                            $meta_field_add .= " DEFAULT '".$default_value."'";
452 452
                         }
453 453
 
454 454
                         $wpdb->query($meta_field_add);
@@ -457,12 +457,12 @@  discard block
 block discarded – undo
457 457
 
458 458
                             if (isset($extra_fields['show_city']) && $extra_fields['show_city']) {
459 459
 
460
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "city'");
460
+                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."city'");
461 461
                                 if ($is_column) {
462
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "city` `" . $prefix . "city` VARCHAR( 50 ) NULL";
462
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."city` `".$prefix."city` VARCHAR( 50 ) NULL";
463 463
 
464 464
                                     if ($default_value != '') {
465
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
465
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
466 466
                                     }
467 467
 
468 468
                                     $wpdb->query($meta_field_add);
@@ -470,9 +470,9 @@  discard block
 block discarded – undo
470 470
 
471 471
                                     $meta_field_add = "VARCHAR( 50 ) NULL";
472 472
                                     if ($default_value != '') {
473
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
473
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
474 474
                                     }
475
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "city", $meta_field_add);
475
+                                    geodir_add_column_if_not_exist($detail_table, $prefix."city", $meta_field_add);
476 476
 
477 477
                                 }
478 478
 
@@ -482,36 +482,36 @@  discard block
 block discarded – undo
482 482
 
483 483
                             if (isset($extra_fields['show_region']) && $extra_fields['show_region']) {
484 484
 
485
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "region'");
485
+                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."region'");
486 486
 
487 487
                                 if ($is_column) {
488
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "region` `" . $prefix . "region` VARCHAR( 50 ) NULL";
488
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."region` `".$prefix."region` VARCHAR( 50 ) NULL";
489 489
 
490 490
                                     if ($default_value != '') {
491
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
491
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
492 492
                                     }
493 493
 
494 494
                                     $wpdb->query($meta_field_add);
495 495
                                 } else {
496 496
                                     $meta_field_add = "VARCHAR( 50 ) NULL";
497 497
                                     if ($default_value != '') {
498
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
498
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
499 499
                                     }
500 500
 
501
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "region", $meta_field_add);
501
+                                    geodir_add_column_if_not_exist($detail_table, $prefix."region", $meta_field_add);
502 502
                                 }
503 503
 
504 504
                             }
505 505
                             if (isset($extra_fields['show_country']) && $extra_fields['show_country']) {
506 506
 
507
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "country'");
507
+                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."country'");
508 508
 
509 509
                                 if ($is_column) {
510 510
 
511
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "country` `" . $prefix . "country` VARCHAR( 50 ) NULL";
511
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."country` `".$prefix."country` VARCHAR( 50 ) NULL";
512 512
 
513 513
                                     if ($default_value != '') {
514
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
514
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
515 515
                                     }
516 516
 
517 517
                                     $wpdb->query($meta_field_add);
@@ -519,24 +519,24 @@  discard block
 block discarded – undo
519 519
 
520 520
                                     $meta_field_add = "VARCHAR( 50 ) NULL";
521 521
                                     if ($default_value != '') {
522
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
522
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
523 523
                                     }
524 524
 
525
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "country", $meta_field_add);
525
+                                    geodir_add_column_if_not_exist($detail_table, $prefix."country", $meta_field_add);
526 526
 
527 527
                                 }
528 528
 
529 529
                             }
530 530
                             if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) {
531 531
 
532
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "zip'");
532
+                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."zip'");
533 533
 
534 534
                                 if ($is_column) {
535 535
 
536
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "zip` `" . $prefix . "zip` VARCHAR( 50 ) NULL";
536
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."zip` `".$prefix."zip` VARCHAR( 50 ) NULL";
537 537
 
538 538
                                     if ($default_value != '') {
539
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
539
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
540 540
                                     }
541 541
 
542 542
                                     $wpdb->query($meta_field_add);
@@ -544,128 +544,128 @@  discard block
 block discarded – undo
544 544
 
545 545
                                     $meta_field_add = "VARCHAR( 50 ) NULL";
546 546
                                     if ($default_value != '') {
547
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
547
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
548 548
                                     }
549 549
 
550
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "zip", $meta_field_add);
550
+                                    geodir_add_column_if_not_exist($detail_table, $prefix."zip", $meta_field_add);
551 551
 
552 552
                                 }
553 553
 
554 554
                             }
555 555
                             if (isset($extra_fields['show_map']) && $extra_fields['show_map']) {
556 556
 
557
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "latitude'");
557
+                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."latitude'");
558 558
                                 if ($is_column) {
559 559
 
560
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "latitude` `" . $prefix . "latitude` VARCHAR( 20 ) NULL";
560
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."latitude` `".$prefix."latitude` VARCHAR( 20 ) NULL";
561 561
 
562 562
                                     if ($default_value != '') {
563
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
563
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
564 564
                                     }
565 565
 
566 566
                                     $wpdb->query($meta_field_add);
567 567
                                 } else {
568 568
 
569
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "latitude` VARCHAR( 20 ) NULL";
569
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."latitude` VARCHAR( 20 ) NULL";
570 570
                                     $meta_field_add = "VARCHAR( 20 ) NULL";
571 571
                                     if ($default_value != '') {
572
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
572
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
573 573
                                     }
574 574
 
575
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "latitude", $meta_field_add);
575
+                                    geodir_add_column_if_not_exist($detail_table, $prefix."latitude", $meta_field_add);
576 576
 
577 577
                                 }
578 578
 
579 579
 
580
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "longitude'");
580
+                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."longitude'");
581 581
 
582 582
                                 if ($is_column) {
583
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "longitude` `" . $prefix . "longitude` VARCHAR( 20 ) NULL";
583
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."longitude` `".$prefix."longitude` VARCHAR( 20 ) NULL";
584 584
 
585 585
                                     if ($default_value != '') {
586
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
586
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
587 587
                                     }
588 588
 
589 589
                                     $wpdb->query($meta_field_add);
590 590
                                 } else {
591 591
 
592
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "longitude` VARCHAR( 20 ) NULL";
592
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."longitude` VARCHAR( 20 ) NULL";
593 593
                                     $meta_field_add = "VARCHAR( 20 ) NULL";
594 594
                                     if ($default_value != '') {
595
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
595
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
596 596
                                     }
597 597
 
598
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "longitude", $meta_field_add);
598
+                                    geodir_add_column_if_not_exist($detail_table, $prefix."longitude", $meta_field_add);
599 599
                                 }
600 600
 
601 601
                             }
602 602
                             if (isset($extra_fields['show_mapview']) && $extra_fields['show_mapview']) {
603 603
 
604
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "mapview'");
604
+                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."mapview'");
605 605
 
606 606
                                 if ($is_column) {
607
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "mapview` `" . $prefix . "mapview` VARCHAR( 15 ) NULL";
607
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."mapview` `".$prefix."mapview` VARCHAR( 15 ) NULL";
608 608
 
609 609
                                     if ($default_value != '') {
610
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
610
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
611 611
                                     }
612 612
 
613 613
                                     $wpdb->query($meta_field_add);
614 614
                                 } else {
615 615
 
616
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "mapview` VARCHAR( 15 ) NULL";
616
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."mapview` VARCHAR( 15 ) NULL";
617 617
 
618 618
                                     $meta_field_add = "VARCHAR( 15 ) NULL";
619 619
                                     if ($default_value != '') {
620
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
620
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
621 621
                                     }
622 622
 
623
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "mapview", $meta_field_add);
623
+                                    geodir_add_column_if_not_exist($detail_table, $prefix."mapview", $meta_field_add);
624 624
                                 }
625 625
 
626 626
 
627 627
                             }
628 628
                             if (isset($extra_fields['show_mapzoom']) && $extra_fields['show_mapzoom']) {
629 629
 
630
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "mapzoom'");
630
+                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."mapzoom'");
631 631
                                 if ($is_column) {
632
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "mapzoom` `" . $prefix . "mapzoom` VARCHAR( 3 ) NULL";
632
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."mapzoom` `".$prefix."mapzoom` VARCHAR( 3 ) NULL";
633 633
 
634 634
                                     if ($default_value != '') {
635
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
635
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
636 636
                                     }
637 637
 
638 638
                                     $wpdb->query($meta_field_add);
639 639
 
640 640
                                 } else {
641 641
 
642
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "mapzoom` VARCHAR( 3 ) NULL";
642
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."mapzoom` VARCHAR( 3 ) NULL";
643 643
 
644 644
                                     $meta_field_add = "VARCHAR( 3 ) NULL";
645 645
                                     if ($default_value != '') {
646
-                                        $meta_field_add .= " DEFAULT '" . $default_value . "'";
646
+                                        $meta_field_add .= " DEFAULT '".$default_value."'";
647 647
                                     }
648 648
 
649
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "mapzoom", $meta_field_add);
649
+                                    geodir_add_column_if_not_exist($detail_table, $prefix."mapzoom", $meta_field_add);
650 650
                                 }
651 651
 
652 652
                             }
653 653
                             // show lat lng
654 654
                             if (isset($extra_fields['show_latlng']) && $extra_fields['show_latlng']) {
655
-                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "latlng'");
655
+                                $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."latlng'");
656 656
 
657 657
                                 if ($is_column) {
658
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "latlng` `" . $prefix . "latlng` VARCHAR( 3 ) NULL";
658
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."latlng` `".$prefix."latlng` VARCHAR( 3 ) NULL";
659 659
                                     $meta_field_add .= " DEFAULT '1'";
660 660
 
661 661
                                     $wpdb->query($meta_field_add);
662 662
                                 } else {
663
-                                    $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "latlng` VARCHAR( 3 ) NULL";
663
+                                    $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."latlng` VARCHAR( 3 ) NULL";
664 664
 
665 665
                                     $meta_field_add = "VARCHAR( 3 ) NULL";
666 666
                                     $meta_field_add .= " DEFAULT '1'";
667 667
 
668
-                                    geodir_add_column_if_not_exist($detail_table, $prefix . "latlng", $meta_field_add);
668
+                                    geodir_add_column_if_not_exist($detail_table, $prefix."latlng", $meta_field_add);
669 669
                                 }
670 670
 
671 671
                             }
@@ -681,30 +681,30 @@  discard block
 block discarded – undo
681 681
                         $op_size = '500';
682 682
 
683 683
                         // only make the field as big as it needs to be.
684
-                        if(isset($option_values) && $option_values && $field_type=='select'){
685
-                            $option_values_arr = explode(',',$option_values);
686
-                            if(is_array($option_values_arr)){
684
+                        if (isset($option_values) && $option_values && $field_type == 'select') {
685
+                            $option_values_arr = explode(',', $option_values);
686
+                            if (is_array($option_values_arr)) {
687 687
                                 $op_max = 0;
688
-                                foreach($option_values_arr as $op_val){
689
-                                    if(strlen($op_val) && strlen($op_val)>$op_max){$op_max = strlen($op_val);}
688
+                                foreach ($option_values_arr as $op_val) {
689
+                                    if (strlen($op_val) && strlen($op_val) > $op_max) {$op_max = strlen($op_val); }
690 690
                                 }
691
-                                if($op_max){$op_size =$op_max; }
691
+                                if ($op_max) {$op_size = $op_max; }
692 692
                             }
693
-                        }elseif(isset($option_values) && $option_values && $field_type=='multiselect'){
694
-                            if(strlen($option_values)){
695
-                                $op_size =  strlen($option_values);
693
+                        }elseif (isset($option_values) && $option_values && $field_type == 'multiselect') {
694
+                            if (strlen($option_values)) {
695
+                                $op_size = strlen($option_values);
696 696
                             }
697 697
                         }
698 698
 
699
-                        $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "`VARCHAR( $op_size ) NULL";
699
+                        $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_html_variable."` `".$htmlvar_name."`VARCHAR( $op_size ) NULL";
700 700
 
701 701
                         if ($default_value != '') {
702
-                            $meta_field_add .= " DEFAULT '" . $default_value . "'";
702
+                            $meta_field_add .= " DEFAULT '".$default_value."'";
703 703
                         }
704 704
 
705 705
                         $alter_result = $wpdb->query($meta_field_add);
706
-                        if($alter_result===false){
707
-                            return __('Column change failed, you may have too many columns.','geodirectory');
706
+                        if ($alter_result === false) {
707
+                            return __('Column change failed, you may have too many columns.', 'geodirectory');
708 708
                         }
709 709
 
710 710
                         if (isset($request_field['cat_display_type']))
@@ -721,9 +721,9 @@  discard block
 block discarded – undo
721 721
                     case 'url':
722 722
                     case 'file':
723 723
 
724
-                        $alter_result = $wpdb->query("ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "` TEXT NULL");
725
-                        if($alter_result===false){
726
-                            return __('Column change failed, you may have too many columns.','geodirectory');
724
+                        $alter_result = $wpdb->query("ALTER TABLE ".$detail_table." CHANGE `".$old_html_variable."` `".$htmlvar_name."` TEXT NULL");
725
+                        if ($alter_result === false) {
726
+                            return __('Column change failed, you may have too many columns.', 'geodirectory');
727 727
                         }
728 728
                         if (isset($request_field['advanced_editor']))
729 729
                             $extra_fields = $request_field['advanced_editor'];
@@ -737,24 +737,24 @@  discard block
 block discarded – undo
737 737
                     default:
738 738
                         if ($data_type != 'VARCHAR' && $data_type != '') {
739 739
                             if ($data_type == 'FLOAT' && $decimal_point > 0) {
740
-                                $default_value_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "` DECIMAL(11, " . (int)$decimal_point . ") NULL";
740
+                                $default_value_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_html_variable."` `".$htmlvar_name."` DECIMAL(11, ".(int) $decimal_point.") NULL";
741 741
                             } else {
742
-                                $default_value_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "` " . $data_type . " NULL";
742
+                                $default_value_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_html_variable."` `".$htmlvar_name."` ".$data_type." NULL";
743 743
                             }
744 744
 
745 745
                             if (is_numeric($default_value) && $default_value != '') {
746
-                                $default_value_add .= " DEFAULT '" . $default_value . "'";
746
+                                $default_value_add .= " DEFAULT '".$default_value."'";
747 747
                             }
748 748
                         } else {
749
-                            $default_value_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "` VARCHAR( 254 ) NULL";
749
+                            $default_value_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_html_variable."` `".$htmlvar_name."` VARCHAR( 254 ) NULL";
750 750
                             if ($default_value != '') {
751
-                                $default_value_add .= " DEFAULT '" . $default_value . "'";
751
+                                $default_value_add .= " DEFAULT '".$default_value."'";
752 752
                             }
753 753
                         }
754 754
 
755 755
                         $alter_result = $wpdb->query($default_value_add);
756
-                        if($alter_result===false){
757
-                            return __('Column change failed, you may have too many columns.','geodirectory');
756
+                        if ($alter_result === false) {
757
+                            return __('Column change failed, you may have too many columns.', 'geodirectory');
758 758
                         }
759 759
                         break;
760 760
                 endswitch;
@@ -770,7 +770,7 @@  discard block
 block discarded – undo
770 770
 
771 771
                     $wpdb->prepare(
772 772
 
773
-                        "update " . GEODIR_CUSTOM_FIELDS_TABLE . " set 
773
+                        "update ".GEODIR_CUSTOM_FIELDS_TABLE." set 
774 774
 					post_type = %s,
775 775
 					admin_title = %s,
776 776
 					site_title = %s,
@@ -804,7 +804,7 @@  discard block
 block discarded – undo
804 804
 					for_admin_use = %s
805 805
 					where id = %d",
806 806
 
807
-                        array($post_type, $admin_title, $site_title, $field_type, $field_type_key, $htmlvar_name, $admin_desc, $clabels, $default_value, $sort_order, $is_active, $is_default, $is_required, $required_msg, $css_class, $field_icon, $field_icon, $show_on_listing, $show_in, $show_on_detail, $show_as_tab, $option_values, $price_pkg, $cat_sort, $cat_filter, $data_type, $extra_field_query, $decimal_point,$validation_pattern,$validation_msg, $for_admin_use, $cf)
807
+                        array($post_type, $admin_title, $site_title, $field_type, $field_type_key, $htmlvar_name, $admin_desc, $clabels, $default_value, $sort_order, $is_active, $is_default, $is_required, $required_msg, $css_class, $field_icon, $field_icon, $show_on_listing, $show_in, $show_on_detail, $show_as_tab, $option_values, $price_pkg, $cat_sort, $cat_filter, $data_type, $extra_field_query, $decimal_point, $validation_pattern, $validation_msg, $for_admin_use, $cf)
808 808
                     )
809 809
 
810 810
                 );
@@ -814,7 +814,7 @@  discard block
 block discarded – undo
814 814
 
815 815
                 $wpdb->query(
816 816
                     $wpdb->prepare(
817
-                        "update " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set 
817
+                        "update ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." set 
818 818
 					 	site_title=%s
819 819
 					where post_type = %s and htmlvar_name = %s",
820 820
                         array($site_title, $post_type, $htmlvar_name)
@@ -823,7 +823,7 @@  discard block
 block discarded – undo
823 823
 
824 824
 
825 825
                 if ($cat_sort == '')
826
-                    $wpdb->query($wpdb->prepare("delete from " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " where post_type = %s and htmlvar_name = %s", array($post_type, $htmlvar_name)));
826
+                    $wpdb->query($wpdb->prepare("delete from ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." where post_type = %s and htmlvar_name = %s", array($post_type, $htmlvar_name)));
827 827
 
828 828
 
829 829
                 /**
@@ -843,7 +843,7 @@  discard block
 block discarded – undo
843 843
                         $data_type = '';
844 844
 
845 845
                         if ($htmlvar_name != '') {
846
-                            $prefix = $htmlvar_name . '_';
846
+                            $prefix = $htmlvar_name.'_';
847 847
                         }
848 848
                         $old_prefix = $old_html_variable;
849 849
 
@@ -851,109 +851,109 @@  discard block
 block discarded – undo
851 851
 
852 852
                         $meta_field_add = "VARCHAR( 254 ) NULL";
853 853
                         if ($default_value != '') {
854
-                            $meta_field_add .= " DEFAULT '" . $default_value . "'";
854
+                            $meta_field_add .= " DEFAULT '".$default_value."'";
855 855
                         }
856 856
 
857
-                        geodir_add_column_if_not_exist($detail_table, $prefix . "address", $meta_field_add);
857
+                        geodir_add_column_if_not_exist($detail_table, $prefix."address", $meta_field_add);
858 858
                         //$wpdb->query($meta_field_add);
859 859
 
860 860
 
861 861
                         if (!empty($extra_fields)) {
862 862
 
863 863
                             if (isset($extra_fields['show_city']) && $extra_fields['show_city']) {
864
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "city` VARCHAR( 30 ) NULL";
864
+                                $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."city` VARCHAR( 30 ) NULL";
865 865
                                 $meta_field_add = "VARCHAR( 30 ) NULL";
866 866
                                 if ($default_value != '') {
867
-                                    $meta_field_add .= " DEFAULT '" . $default_value . "'";
867
+                                    $meta_field_add .= " DEFAULT '".$default_value."'";
868 868
                                 }
869 869
 
870
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "city", $meta_field_add);
870
+                                geodir_add_column_if_not_exist($detail_table, $prefix."city", $meta_field_add);
871 871
                                 //$wpdb->query($meta_field_add);
872 872
                             }
873 873
                             if (isset($extra_fields['show_region']) && $extra_fields['show_region']) {
874
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "region` VARCHAR( 30 ) NULL";
874
+                                $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."region` VARCHAR( 30 ) NULL";
875 875
                                 $meta_field_add = "VARCHAR( 30 ) NULL";
876 876
                                 if ($default_value != '') {
877
-                                    $meta_field_add .= " DEFAULT '" . $default_value . "'";
877
+                                    $meta_field_add .= " DEFAULT '".$default_value."'";
878 878
                                 }
879 879
 
880
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "region", $meta_field_add);
880
+                                geodir_add_column_if_not_exist($detail_table, $prefix."region", $meta_field_add);
881 881
                                 //$wpdb->query($meta_field_add);
882 882
                             }
883 883
                             if (isset($extra_fields['show_country']) && $extra_fields['show_country']) {
884
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "country` VARCHAR( 30 ) NULL";
884
+                                $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."country` VARCHAR( 30 ) NULL";
885 885
 
886 886
                                 $meta_field_add = "VARCHAR( 30 ) NULL";
887 887
                                 if ($default_value != '') {
888
-                                    $meta_field_add .= " DEFAULT '" . $default_value . "'";
888
+                                    $meta_field_add .= " DEFAULT '".$default_value."'";
889 889
                                 }
890 890
 
891
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "country", $meta_field_add);
891
+                                geodir_add_column_if_not_exist($detail_table, $prefix."country", $meta_field_add);
892 892
                                 //$wpdb->query($meta_field_add);
893 893
                             }
894 894
                             if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) {
895
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "zip` VARCHAR( 15 ) NULL";
895
+                                $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."zip` VARCHAR( 15 ) NULL";
896 896
                                 $meta_field_add = "VARCHAR( 15 ) NULL";
897 897
                                 if ($default_value != '') {
898
-                                    $meta_field_add .= " DEFAULT '" . $default_value . "'";
898
+                                    $meta_field_add .= " DEFAULT '".$default_value."'";
899 899
                                 }
900 900
 
901
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "zip", $meta_field_add);
901
+                                geodir_add_column_if_not_exist($detail_table, $prefix."zip", $meta_field_add);
902 902
                                 //$wpdb->query($meta_field_add);
903 903
                             }
904 904
                             if (isset($extra_fields['show_map']) && $extra_fields['show_map']) {
905
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "latitude` VARCHAR( 20 ) NULL";
905
+                                $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."latitude` VARCHAR( 20 ) NULL";
906 906
                                 $meta_field_add = "VARCHAR( 20 ) NULL";
907 907
                                 if ($default_value != '') {
908
-                                    $meta_field_add .= " DEFAULT '" . $default_value . "'";
908
+                                    $meta_field_add .= " DEFAULT '".$default_value."'";
909 909
                                 }
910 910
 
911
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "latitude", $meta_field_add);
911
+                                geodir_add_column_if_not_exist($detail_table, $prefix."latitude", $meta_field_add);
912 912
                                 //$wpdb->query($meta_field_add);
913 913
 
914
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "longitude` VARCHAR( 20 ) NULL";
914
+                                $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."longitude` VARCHAR( 20 ) NULL";
915 915
 
916 916
                                 $meta_field_add = "VARCHAR( 20 ) NULL";
917 917
                                 if ($default_value != '') {
918
-                                    $meta_field_add .= " DEFAULT '" . $default_value . "'";
918
+                                    $meta_field_add .= " DEFAULT '".$default_value."'";
919 919
                                 }
920 920
 
921
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "longitude", $meta_field_add);
921
+                                geodir_add_column_if_not_exist($detail_table, $prefix."longitude", $meta_field_add);
922 922
 
923 923
                                 //$wpdb->query($meta_field_add);
924 924
                             }
925 925
                             if (isset($extra_fields['show_mapview']) && $extra_fields['show_mapview']) {
926
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "mapview` VARCHAR( 15 ) NULL";
926
+                                $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."mapview` VARCHAR( 15 ) NULL";
927 927
 
928 928
                                 $meta_field_add = "VARCHAR( 15 ) NULL";
929 929
                                 if ($default_value != '') {
930
-                                    $meta_field_add .= " DEFAULT '" . $default_value . "'";
930
+                                    $meta_field_add .= " DEFAULT '".$default_value."'";
931 931
                                 }
932 932
 
933
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "mapview", $meta_field_add);
933
+                                geodir_add_column_if_not_exist($detail_table, $prefix."mapview", $meta_field_add);
934 934
 
935 935
                                 //$wpdb->query($meta_field_add);
936 936
                             }
937 937
                             if (isset($extra_fields['show_mapzoom']) && $extra_fields['show_mapzoom']) {
938
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "mapzoom` VARCHAR( 3 ) NULL";
938
+                                $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."mapzoom` VARCHAR( 3 ) NULL";
939 939
 
940 940
                                 $meta_field_add = "VARCHAR( 3 ) NULL";
941 941
                                 if ($default_value != '') {
942
-                                    $meta_field_add .= " DEFAULT '" . $default_value . "'";
942
+                                    $meta_field_add .= " DEFAULT '".$default_value."'";
943 943
                                 }
944 944
 
945
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "mapzoom", $meta_field_add);
945
+                                geodir_add_column_if_not_exist($detail_table, $prefix."mapzoom", $meta_field_add);
946 946
 
947 947
                                 //$wpdb->query($meta_field_add);
948 948
                             }
949 949
                             // show lat lng
950 950
                             if (isset($extra_fields['show_latlng']) && $extra_fields['show_latlng']) {
951
-                                $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "latlng` VARCHAR( 3 ) NULL";
951
+                                $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."latlng` VARCHAR( 3 ) NULL";
952 952
 
953 953
                                 $meta_field_add = "VARCHAR( 3 ) NULL";
954 954
                                 $meta_field_add .= " DEFAULT '1'";
955 955
 
956
-                                geodir_add_column_if_not_exist($detail_table, $prefix . "latlng", $meta_field_add);
956
+                                geodir_add_column_if_not_exist($detail_table, $prefix."latlng", $meta_field_add);
957 957
                                 //$wpdb->query($meta_field_add);
958 958
                             }
959 959
                         }
@@ -963,8 +963,8 @@  discard block
 block discarded – undo
963 963
                     case 'checkbox':
964 964
                         $data_type = 'TINYINT';
965 965
 
966
-                        $meta_field_add = $data_type . "( 1 ) NOT NULL ";
967
-                        if ((int)$default_value === 1) {
966
+                        $meta_field_add = $data_type."( 1 ) NOT NULL ";
967
+                        if ((int) $default_value === 1) {
968 968
                             $meta_field_add .= " DEFAULT '1'";
969 969
                         }
970 970
 
@@ -997,7 +997,7 @@  discard block
 block discarded – undo
997 997
                             }
998 998
                         } elseif (isset($option_values) && $option_values && $field_type == 'multiselect') {
999 999
                             if (strlen($option_values)) {
1000
-                                $op_size =  strlen($option_values);
1000
+                                $op_size = strlen($option_values);
1001 1001
                             }
1002 1002
 
1003 1003
                             if (isset($request_field['multi_display_type'])) {
@@ -1005,9 +1005,9 @@  discard block
 block discarded – undo
1005 1005
                             }
1006 1006
                         }
1007 1007
 
1008
-                        $meta_field_add = $data_type . "( $op_size ) NULL ";
1008
+                        $meta_field_add = $data_type."( $op_size ) NULL ";
1009 1009
                         if ($default_value != '') {
1010
-                            $meta_field_add .= " DEFAULT '" . $default_value . "'";
1010
+                            $meta_field_add .= " DEFAULT '".$default_value."'";
1011 1011
                         }
1012 1012
 
1013 1013
                         $add_result = geodir_add_column_if_not_exist($detail_table, $htmlvar_name, $meta_field_add);
@@ -1022,9 +1022,9 @@  discard block
 block discarded – undo
1022 1022
 
1023 1023
                         $data_type = 'TEXT';
1024 1024
 
1025
-                        $default_value_add = " `" . $htmlvar_name . "` " . $data_type . " NULL ";
1025
+                        $default_value_add = " `".$htmlvar_name."` ".$data_type." NULL ";
1026 1026
 
1027
-                        $meta_field_add = $data_type . " NULL ";
1027
+                        $meta_field_add = $data_type." NULL ";
1028 1028
                         /*if($default_value != '')
1029 1029
 					{ $meta_field_add .= " DEFAULT '".$default_value."'"; }*/
1030 1030
 
@@ -1039,9 +1039,9 @@  discard block
 block discarded – undo
1039 1039
 
1040 1040
                         $data_type = 'DATE';
1041 1041
 
1042
-                        $default_value_add = " `" . $htmlvar_name . "` " . $data_type . " NULL ";
1042
+                        $default_value_add = " `".$htmlvar_name."` ".$data_type." NULL ";
1043 1043
 
1044
-                        $meta_field_add = $data_type . " NULL ";
1044
+                        $meta_field_add = $data_type." NULL ";
1045 1045
 
1046 1046
                         $add_result = geodir_add_column_if_not_exist($detail_table, $htmlvar_name, $meta_field_add);
1047 1047
                         if ($add_result === false) {
@@ -1054,9 +1054,9 @@  discard block
 block discarded – undo
1054 1054
 
1055 1055
                         $data_type = 'TIME';
1056 1056
 
1057
-                        $default_value_add = " `" . $htmlvar_name . "` " . $data_type . " NULL ";
1057
+                        $default_value_add = " `".$htmlvar_name."` ".$data_type." NULL ";
1058 1058
 
1059
-                        $meta_field_add = $data_type . " NULL ";
1059
+                        $meta_field_add = $data_type." NULL ";
1060 1060
 
1061 1061
                         $add_result = geodir_add_column_if_not_exist($detail_table, $htmlvar_name, $meta_field_add);
1062 1062
                         if ($add_result === false) {
@@ -1068,22 +1068,22 @@  discard block
 block discarded – undo
1068 1068
                     default:
1069 1069
 
1070 1070
                         if ($data_type != 'VARCHAR' && $data_type != '') {
1071
-                            $meta_field_add = $data_type . " NULL ";
1071
+                            $meta_field_add = $data_type." NULL ";
1072 1072
 
1073 1073
                             if ($data_type == 'FLOAT' && $decimal_point > 0) {
1074
-                                $meta_field_add = "DECIMAL(11, " . (int)$decimal_point . ") NULL ";
1074
+                                $meta_field_add = "DECIMAL(11, ".(int) $decimal_point.") NULL ";
1075 1075
                             }
1076 1076
 
1077 1077
                             if (is_numeric($default_value) && $default_value != '') {
1078
-                                $default_value_add .= " DEFAULT '" . $default_value . "'";
1079
-                                $meta_field_add .= " DEFAULT '" . $default_value . "'";
1078
+                                $default_value_add .= " DEFAULT '".$default_value."'";
1079
+                                $meta_field_add .= " DEFAULT '".$default_value."'";
1080 1080
                             }
1081 1081
                         } else {
1082 1082
                             $meta_field_add = " VARCHAR( 254 ) NULL ";
1083 1083
 
1084 1084
                             if ($default_value != '') {
1085
-                                $default_value_add .= " DEFAULT '" . $default_value . "'";
1086
-                                $meta_field_add .= " DEFAULT '" . $default_value . "'";
1085
+                                $default_value_add .= " DEFAULT '".$default_value."'";
1086
+                                $meta_field_add .= " DEFAULT '".$default_value."'";
1087 1087
                             }
1088 1088
                         }
1089 1089
 
@@ -1105,7 +1105,7 @@  discard block
 block discarded – undo
1105 1105
 
1106 1106
                     $wpdb->prepare(
1107 1107
 
1108
-                        "insert into " . GEODIR_CUSTOM_FIELDS_TABLE . " set 
1108
+                        "insert into ".GEODIR_CUSTOM_FIELDS_TABLE." set 
1109 1109
 					post_type = %s,
1110 1110
 					admin_title = %s,
1111 1111
 					site_title = %s,
@@ -1138,7 +1138,7 @@  discard block
 block discarded – undo
1138 1138
 					validation_msg = %s,
1139 1139
 					for_admin_use = %s ",
1140 1140
 
1141
-                        array($post_type, $admin_title, $site_title, $field_type, $field_type_key, $htmlvar_name, $admin_desc, $clabels, $default_value, $sort_order, $is_active, $is_default, $is_admin, $is_required, $required_msg, $css_class, $field_icon, $show_on_listing,$show_in, $show_on_detail, $show_as_tab, $option_values, $price_pkg, $cat_sort, $cat_filter, $data_type, $extra_field_query, $decimal_point,$validation_pattern,$validation_msg, $for_admin_use)
1141
+                        array($post_type, $admin_title, $site_title, $field_type, $field_type_key, $htmlvar_name, $admin_desc, $clabels, $default_value, $sort_order, $is_active, $is_default, $is_admin, $is_required, $required_msg, $css_class, $field_icon, $show_on_listing, $show_in, $show_on_detail, $show_as_tab, $option_values, $price_pkg, $cat_sort, $cat_filter, $data_type, $extra_field_query, $decimal_point, $validation_pattern, $validation_msg, $for_admin_use)
1142 1142
 
1143 1143
                     )
1144 1144
 
@@ -1150,7 +1150,7 @@  discard block
 block discarded – undo
1150 1150
 
1151 1151
             }
1152 1152
 
1153
-            return (int)$lastid;
1153
+            return (int) $lastid;
1154 1154
 
1155 1155
 
1156 1156
         } else {
@@ -1183,7 +1183,7 @@  discard block
 block discarded – undo
1183 1183
 
1184 1184
             $post_meta_info = $wpdb->query(
1185 1185
                 $wpdb->prepare(
1186
-                    "update " . GEODIR_CUSTOM_FIELDS_TABLE . " set 
1186
+                    "update ".GEODIR_CUSTOM_FIELDS_TABLE." set 
1187 1187
 															sort_order=%d 
1188 1188
 															where id= %d",
1189 1189
                     array($count, $cf)
@@ -1199,11 +1199,11 @@  discard block
 block discarded – undo
1199 1199
 }
1200 1200
 
1201 1201
 
1202
-function geodir_get_cf_value($cf){
1202
+function geodir_get_cf_value($cf) {
1203 1203
     global $gd_session;
1204 1204
     $value = '';
1205 1205
     if (is_admin()) {
1206
-        global $post,$gd_session;
1206
+        global $post, $gd_session;
1207 1207
 
1208 1208
         if (isset($_REQUEST['post']))
1209 1209
             $_REQUEST['pid'] = $_REQUEST['post'];
@@ -1251,7 +1251,7 @@  discard block
 block discarded – undo
1251 1251
         $is_default = $val['is_default'];
1252 1252
 
1253 1253
         /* field available to site admin only for edit */
1254
-        $for_admin_use = isset($val['for_admin_use']) && (int)$val['for_admin_use'] == 1 ? true : false;
1254
+        $for_admin_use = isset($val['for_admin_use']) && (int) $val['for_admin_use'] == 1 ? true : false;
1255 1255
         if ($for_admin_use && !is_super_admin()) {
1256 1256
             continue;
1257 1257
         }
@@ -1276,11 +1276,11 @@  discard block
 block discarded – undo
1276 1276
          * @param array $val The settings array for the field. {@see geodir_custom_field_save()}.
1277 1277
          * @see 'geodir_after_custom_form_field_$name'
1278 1278
          */
1279
-        do_action('geodir_before_custom_form_field_' . $name, $listing_type, $package_id, $val);
1279
+        do_action('geodir_before_custom_form_field_'.$name, $listing_type, $package_id, $val);
1280 1280
 
1281 1281
 
1282 1282
         $custom_field = $val;
1283
-        $html ='';
1283
+        $html = '';
1284 1284
         /**
1285 1285
          * Filter the output for custom fields.
1286 1286
          *
@@ -1289,7 +1289,7 @@  discard block
 block discarded – undo
1289 1289
          * @param string $html The html to be filtered (blank).
1290 1290
          * @param array $custom_field The custom field array values.
1291 1291
          */
1292
-        echo apply_filters("geodir_custom_field_input_{$type}",$html,$custom_field);
1292
+        echo apply_filters("geodir_custom_field_input_{$type}", $html, $custom_field);
1293 1293
 
1294 1294
 
1295 1295
 
@@ -1304,7 +1304,7 @@  discard block
 block discarded – undo
1304 1304
          * @param array $val The settings array for the field. {@see geodir_custom_field_save()}.
1305 1305
          * @see 'geodir_before_custom_form_field_$name'
1306 1306
          */
1307
-        do_action('geodir_after_custom_form_field_' . $name, $listing_type, $package_id, $val);
1307
+        do_action('geodir_after_custom_form_field_'.$name, $listing_type, $package_id, $val);
1308 1308
 
1309 1309
     }
1310 1310
 
@@ -1330,7 +1330,7 @@  discard block
 block discarded – undo
1330 1330
 
1331 1331
         $filter = $wpdb->get_row(
1332 1332
             $wpdb->prepare(
1333
-                "SELECT * FROM " . GEODIR_CUSTOM_FIELDS_TABLE . " WHERE post_type=%s AND " . $key . "='" . $value . "'",
1333
+                "SELECT * FROM ".GEODIR_CUSTOM_FIELDS_TABLE." WHERE post_type=%s AND ".$key."='".$value."'",
1334 1334
                 array($geodir_post_type)
1335 1335
             )
1336 1336
         );
@@ -1345,14 +1345,14 @@  discard block
 block discarded – undo
1345 1345
 }
1346 1346
 
1347 1347
 
1348
-function geodir_field_icon_proccess($cf){
1348
+function geodir_field_icon_proccess($cf) {
1349 1349
 
1350 1350
 
1351 1351
     if (strpos($cf['field_icon'], 'http') !== false) {
1352
-        $field_icon = ' background: url(' . $cf['field_icon'] . ') no-repeat left center;background-size:18px 18px;padding-left: 21px;';
1352
+        $field_icon = ' background: url('.$cf['field_icon'].') no-repeat left center;background-size:18px 18px;padding-left: 21px;';
1353 1353
     } elseif (strpos($cf['field_icon'], 'fa fa-') !== false) {
1354
-        $field_icon = '<i class="' . $cf['field_icon'] . '"></i>';
1355
-    }else{
1354
+        $field_icon = '<i class="'.$cf['field_icon'].'"></i>';
1355
+    } else {
1356 1356
         $field_icon = $cf['field_icon'];
1357 1357
     }
1358 1358
 
@@ -1413,11 +1413,11 @@  discard block
 block discarded – undo
1413 1413
                  * @param string $fields_location The location the field is to be show.
1414 1414
                  * @param array $type The array of field values.
1415 1415
                  */
1416
-                $html = apply_filters("geodir_custom_field_output_{$filed_type}",$html,$fields_location,$type);
1416
+                $html = apply_filters("geodir_custom_field_output_{$filed_type}", $html, $fields_location, $type);
1417 1417
 
1418 1418
                 $variables_array = array();
1419 1419
 
1420
-                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'))) {
1420
+                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'))) {
1421 1421
                     continue;
1422 1422
                 }
1423 1423
 
@@ -1543,7 +1543,7 @@  discard block
 block discarded – undo
1543 1543
 
1544 1544
         $post_type = get_post_type($post_id);
1545 1545
         //echo $field_id; exit;
1546
-        $table = $plugin_prefix . $post_type . '_detail';
1546
+        $table = $plugin_prefix.$post_type.'_detail';
1547 1547
 
1548 1548
         $postcurr_images = array();
1549 1549
         $postcurr_images = geodir_get_post_meta($post_id, $field_id, true);
@@ -1562,13 +1562,13 @@  discard block
 block discarded – undo
1562 1562
             $geodir_uploadurl = $uploads['url'];
1563 1563
             $sub_dir = $uploads['subdir'];
1564 1564
 
1565
-            $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'] : '';
1565
+            $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'] : '';
1566 1566
 
1567 1567
             for ($m = 0; $m < count($post_image); $m++) {
1568 1568
 
1569 1569
                 /* --------- start ------- */
1570 1570
 
1571
-                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)))) {
1571
+                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)))) {
1572 1572
 
1573 1573
 
1574 1574
                     $curr_img_url = $post_image[$m];
@@ -1594,24 +1594,24 @@  discard block
 block discarded – undo
1594 1594
                     //$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');
1595 1595
 
1596 1596
                     if (!function_exists('wp_handle_upload'))
1597
-                        require_once(ABSPATH . 'wp-admin/includes/file.php');
1597
+                        require_once(ABSPATH.'wp-admin/includes/file.php');
1598 1598
 
1599 1599
                     if (!is_dir($geodir_uploadpath))
1600 1600
                         mkdir($geodir_uploadpath);
1601 1601
 
1602
-                    $new_name = $post_id . '_' . $field_id . '_' . $img_name_arr[0] . '.' . $img_name_arr[1];
1602
+                    $new_name = $post_id.'_'.$field_id.'_'.$img_name_arr[0].'.'.$img_name_arr[1];
1603 1603
                     $explode_sub_dir = explode("/", $sub_dir);
1604 1604
                     if ($curr_img_dir == end($explode_sub_dir)) {
1605
-                        $img_path = $geodir_uploadpath . '/' . $filename;
1606
-                        $img_url = $geodir_uploadurl . '/' . $filename;
1605
+                        $img_path = $geodir_uploadpath.'/'.$filename;
1606
+                        $img_url = $geodir_uploadurl.'/'.$filename;
1607 1607
                     } else {
1608
-                        $img_path = $uploads_dir . '/temp_' . $current_user->data->ID . '/' . $filename;
1609
-                        $img_url = $uploads['url'] . '/temp_' . $current_user->data->ID . '/' . $filename;
1608
+                        $img_path = $uploads_dir.'/temp_'.$current_user->data->ID.'/'.$filename;
1609
+                        $img_url = $uploads['url'].'/temp_'.$current_user->data->ID.'/'.$filename;
1610 1610
                     }
1611 1611
 
1612 1612
                     $uploaded_file = '';
1613 1613
                     if (file_exists($img_path))
1614
-                        $uploaded_file = copy($img_path, $geodir_uploadpath . '/' . $new_name);
1614
+                        $uploaded_file = copy($img_path, $geodir_uploadpath.'/'.$new_name);
1615 1615
 
1616 1616
                     if ($curr_img_dir != $geodir_uploaddir) {
1617 1617
                         if (file_exists($img_path))
@@ -1619,7 +1619,7 @@  discard block
 block discarded – undo
1619 1619
                     }
1620 1620
 
1621 1621
                     if (!empty($uploaded_file))
1622
-                        $file_urls = $geodir_uploadurl . '/' . $new_name;
1622
+                        $file_urls = $geodir_uploadurl.'/'.$new_name;
1623 1623
 
1624 1624
                 } else {
1625 1625
                     $file_urls = $post_image[$m];
@@ -1633,8 +1633,8 @@  discard block
 block discarded – undo
1633 1633
         if (!empty($postcurr_images)) {
1634 1634
 
1635 1635
             if ($file_urls != $postcurr_images) {
1636
-                $invalid_files[] = (object)array('src' => $postcurr_images);
1637
-                $invalid_files = (object)$invalid_files;
1636
+                $invalid_files[] = (object) array('src' => $postcurr_images);
1637
+                $invalid_files = (object) $invalid_files;
1638 1638
             }
1639 1639
         }
1640 1640
 
@@ -1686,9 +1686,9 @@  discard block
 block discarded – undo
1686 1686
     function geodir_upload_dir($upload)
1687 1687
     {
1688 1688
         global $current_user;
1689
-        $upload['subdir'] = $upload['subdir'] . '/temp_' . $current_user->data->ID;
1690
-        $upload['path'] = $upload['basedir'] . $upload['subdir'];
1691
-        $upload['url'] = $upload['baseurl'] . $upload['subdir'];
1689
+        $upload['subdir'] = $upload['subdir'].'/temp_'.$current_user->data->ID;
1690
+        $upload['path'] = $upload['basedir'].$upload['subdir'];
1691
+        $upload['url'] = $upload['baseurl'].$upload['subdir'];
1692 1692
         return $upload;
1693 1693
     }
1694 1694
 
@@ -1703,20 +1703,20 @@  discard block
 block discarded – undo
1703 1703
         // check ajax noonce
1704 1704
         $imgid = $_POST["imgid"];
1705 1705
 
1706
-        check_ajax_referer($imgid . 'pluploadan');
1706
+        check_ajax_referer($imgid.'pluploadan');
1707 1707
 
1708 1708
         // handle custom file uploaddir
1709 1709
         add_filter('upload_dir', 'geodir_upload_dir');
1710 1710
 
1711 1711
         // change file orinetation if needed
1712
-        $fixed_file = geodir_exif($_FILES[$imgid . 'async-upload']);
1712
+        $fixed_file = geodir_exif($_FILES[$imgid.'async-upload']);
1713 1713
 
1714 1714
         // handle file upload
1715 1715
         $status = wp_handle_upload($fixed_file, array('test_form' => true, 'action' => 'plupload_action'));
1716 1716
         // remove handle custom file uploaddir
1717 1717
         remove_filter('upload_dir', 'geodir_upload_dir');
1718 1718
 
1719
-        if(!isset($status['url']) && isset($status['error'])){
1719
+        if (!isset($status['url']) && isset($status['error'])) {
1720 1720
             print_r($status);
1721 1721
         }
1722 1722
 
@@ -1746,9 +1746,9 @@  discard block
 block discarded – undo
1746 1746
 
1747 1747
     $post_type = get_post_type($post_id);
1748 1748
 
1749
-    $table = $plugin_prefix . $post_type . '_detail';
1749
+    $table = $plugin_prefix.$post_type.'_detail';
1750 1750
 
1751
-    $results = $wpdb->get_results($wpdb->prepare("SELECT geodir_video FROM " . $table . " WHERE post_id=%d", array($post_id)));
1751
+    $results = $wpdb->get_results($wpdb->prepare("SELECT geodir_video FROM ".$table." WHERE post_id=%d", array($post_id)));
1752 1752
 
1753 1753
     if ($results) {
1754 1754
         return $results[0]->geodir_video;
@@ -1772,9 +1772,9 @@  discard block
 block discarded – undo
1772 1772
 
1773 1773
     $post_type = get_post_type($post_id);
1774 1774
 
1775
-    $table = $plugin_prefix . $post_type . '_detail';
1775
+    $table = $plugin_prefix.$post_type.'_detail';
1776 1776
 
1777
-    $results = $wpdb->get_results($wpdb->prepare("SELECT geodir_special_offers FROM " . $table . " WHERE post_id=%d", array($post_id)));
1777
+    $results = $wpdb->get_results($wpdb->prepare("SELECT geodir_special_offers FROM ".$table." WHERE post_id=%d", array($post_id)));
1778 1778
 
1779 1779
     if ($results) {
1780 1780
         return $results[0]->geodir_special_offers;
@@ -1792,12 +1792,12 @@  discard block
 block discarded – undo
1792 1792
      */
1793 1793
     function geodir_max_upload_size()
1794 1794
     {
1795
-        $max_filesize = (float)get_option('geodir_upload_max_filesize', 2);
1795
+        $max_filesize = (float) get_option('geodir_upload_max_filesize', 2);
1796 1796
 
1797 1797
         if ($max_filesize > 0 && $max_filesize < 1) {
1798
-            $max_filesize = (int)($max_filesize * 1024) . 'kb';
1798
+            $max_filesize = (int) ($max_filesize * 1024).'kb';
1799 1799
         } else {
1800
-            $max_filesize = $max_filesize > 0 ? $max_filesize . 'mb' : '2mb';
1800
+            $max_filesize = $max_filesize > 0 ? $max_filesize.'mb' : '2mb';
1801 1801
         }
1802 1802
         /** Filter documented in geodirectory-functions/general_functions.php **/
1803 1803
         return apply_filters('geodir_default_image_upload_size_limit', $max_filesize);
@@ -1829,7 +1829,7 @@  discard block
 block discarded – undo
1829 1829
 
1830 1830
             $custom_fields = $wpdb->get_results(
1831 1831
                 $wpdb->prepare(
1832
-                    "select post_type,data_type,field_type,site_title,htmlvar_name,field_icon from " . GEODIR_CUSTOM_FIELDS_TABLE . " where post_type = %s and is_active='1' and cat_sort='1' AND field_type != 'address' order by sort_order asc",
1832
+                    "select post_type,data_type,field_type,site_title,htmlvar_name,field_icon from ".GEODIR_CUSTOM_FIELDS_TABLE." where post_type = %s and is_active='1' and cat_sort='1' AND field_type != 'address' order by sort_order asc",
1833 1833
                     array($post_type)
1834 1834
                 ), 'ARRAY_A'
1835 1835
             );
@@ -1956,7 +1956,7 @@  discard block
 block discarded – undo
1956 1956
 
1957 1957
             $post_meta_info = $wpdb->query(
1958 1958
                 $wpdb->prepare(
1959
-                    "update " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set 
1959
+                    "update ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." set 
1960 1960
 															sort_order=%d 
1961 1961
 															where id= %d",
1962 1962
                     array($count, $cf)
@@ -2038,14 +2038,14 @@  discard block
 block discarded – undo
2038 2038
 
2039 2039
         $check_html_variable = $wpdb->get_var(
2040 2040
             $wpdb->prepare(
2041
-                "select htmlvar_name from " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s and field_type=%s ",
2041
+                "select htmlvar_name from ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." where htmlvar_name = %s and post_type = %s and field_type=%s ",
2042 2042
                 array($cehhtmlvar_name, $post_type, $field_type)
2043 2043
             )
2044 2044
         );
2045 2045
 
2046 2046
         if ($is_default == 1) {
2047 2047
 
2048
-            $wpdb->query($wpdb->prepare("update " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set is_default='0', default_order='' where post_type = %s", array($post_type)));
2048
+            $wpdb->query($wpdb->prepare("update ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." set is_default='0', default_order='' where post_type = %s", array($post_type)));
2049 2049
 
2050 2050
         }
2051 2051
 
@@ -2056,7 +2056,7 @@  discard block
 block discarded – undo
2056 2056
 
2057 2057
                 $wpdb->prepare(
2058 2058
 
2059
-                    "insert into " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set 
2059
+                    "insert into ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." set 
2060 2060
 				post_type = %s,
2061 2061
 				data_type = %s,
2062 2062
 				field_type = %s,
@@ -2087,7 +2087,7 @@  discard block
 block discarded – undo
2087 2087
 
2088 2088
                 $wpdb->prepare(
2089 2089
 
2090
-                    "update " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set 
2090
+                    "update ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." set 
2091 2091
 				post_type = %s,
2092 2092
 				data_type = %s,
2093 2093
 				field_type = %s,
@@ -2113,7 +2113,7 @@  discard block
 block discarded – undo
2113 2113
         }
2114 2114
 
2115 2115
 
2116
-        return (int)$lastid;
2116
+        return (int) $lastid;
2117 2117
 
2118 2118
     }
2119 2119
 }
@@ -2136,7 +2136,7 @@  discard block
 block discarded – undo
2136 2136
         if ($field_id != '') {
2137 2137
             $cf = trim($field_id, '_');
2138 2138
 
2139
-            $wpdb->query($wpdb->prepare("delete from " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " where id= %d ", array($cf)));
2139
+            $wpdb->query($wpdb->prepare("delete from ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." where id= %d ", array($cf)));
2140 2140
 
2141 2141
             return $field_id;
2142 2142
 
@@ -2159,12 +2159,12 @@  discard block
 block discarded – undo
2159 2159
      * @param string $field_ins_upd When set to "submit" displays form.
2160 2160
      * @param bool $default when set to true field will be for admin use only.
2161 2161
      */
2162
-    function geodir_custom_sort_field_adminhtml($field_type, $result_str, $field_ins_upd = '', $field_type_key='')
2162
+    function geodir_custom_sort_field_adminhtml($field_type, $result_str, $field_ins_upd = '', $field_type_key = '')
2163 2163
     {
2164 2164
         global $wpdb;
2165 2165
         $cf = $result_str;
2166 2166
         if (!is_object($cf)) {
2167
-            $field_info = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " WHERE id = %d", array($cf)));
2167
+            $field_info = $wpdb->get_row($wpdb->prepare("SELECT * FROM ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." WHERE id = %d", array($cf)));
2168 2168
         } else {
2169 2169
             $field_info = $cf;
2170 2170
             $result_str = $cf->id;
@@ -2200,18 +2200,18 @@  discard block
 block discarded – undo
2200 2200
         if ($htmlvar_name == '')
2201 2201
             $htmlvar_name = isset($field_info->htmlvar_name) ? $field_info->htmlvar_name : '';
2202 2202
 
2203
-        $nonce = wp_create_nonce('custom_fields_' . $result_str);
2203
+        $nonce = wp_create_nonce('custom_fields_'.$result_str);
2204 2204
 
2205 2205
         $field_icon = '<i class="fa fa-cog" aria-hidden="true"></i>';
2206 2206
         $cso_arr = geodir_get_custom_sort_options($post_type);
2207 2207
 
2208 2208
         $cur_field_type = (isset($cf->field_type)) ? $cf->field_type : esc_html($_REQUEST['field_type']);
2209
-        foreach($cso_arr as $cso){
2210
-            if($cur_field_type==$cso['field_type']){
2209
+        foreach ($cso_arr as $cso) {
2210
+            if ($cur_field_type == $cso['field_type']) {
2211 2211
 
2212 2212
                 if (isset($cso['field_icon']) && strpos($cso['field_icon'], 'fa fa-') !== false) {
2213 2213
                     $field_icon = '<i class="'.$cso['field_icon'].'" aria-hidden="true"></i>';
2214
-                }elseif(isset($cso['field_icon']) && $cso['field_icon']){
2214
+                }elseif (isset($cso['field_icon']) && $cso['field_icon']) {
2215 2215
                     $field_icon = '<b style="background-image: url("'.$cso['field_icon'].'")"></b>';
2216 2216
                 }
2217 2217
 
@@ -2221,40 +2221,40 @@  discard block
 block discarded – undo
2221 2221
         $radio_id = (isset($field_info->htmlvar_name)) ? $field_info->htmlvar_name : rand(5, 500);
2222 2222
         ?>
2223 2223
 
2224
-        <li class="text" id="licontainer_<?php echo $result_str;?>">
2224
+        <li class="text" id="licontainer_<?php echo $result_str; ?>">
2225 2225
             <form><!-- we need to wrap in a fom so we can use radio buttons with same name -->
2226
-            <div class="title title<?php echo $result_str;?> gt-fieldset"
2227
-                 title="<?php _e('Double Click to toggle and drag-drop to sort', 'geodirectory');?>"
2228
-                 ondblclick="show_hide('field_frm<?php echo $result_str;?>')">
2226
+            <div class="title title<?php echo $result_str; ?> gt-fieldset"
2227
+                 title="<?php _e('Double Click to toggle and drag-drop to sort', 'geodirectory'); ?>"
2228
+                 ondblclick="show_hide('field_frm<?php echo $result_str; ?>')">
2229 2229
                 <?php
2230 2230
 
2231 2231
                 ?>
2232 2232
 
2233
-                <div title="<?php _e('Click to remove field', 'geodirectory');?>"
2234
-                     onclick="delete_sort_field('<?php echo $result_str;?>', '<?php echo $nonce;?>', this)"
2233
+                <div title="<?php _e('Click to remove field', 'geodirectory'); ?>"
2234
+                     onclick="delete_sort_field('<?php echo $result_str; ?>', '<?php echo $nonce; ?>', this)"
2235 2235
                      class="handlediv close"><i class="fa fa-times" aria-hidden="true"></i></div>
2236 2236
 
2237 2237
 
2238
-                <?php echo $field_icon;?>
2238
+                <?php echo $field_icon; ?>
2239 2239
                 <b style="cursor:pointer;"
2240
-                   onclick="show_hide('field_frm<?php echo $result_str;?>')"><?php echo geodir_ucwords(__('Field:', 'geodirectory') . ' (' . $site_title . ')');?></b>
2240
+                   onclick="show_hide('field_frm<?php echo $result_str; ?>')"><?php echo geodir_ucwords(__('Field:', 'geodirectory').' ('.$site_title.')'); ?></b>
2241 2241
 
2242 2242
             </div>
2243 2243
 
2244
-            <div id="field_frm<?php echo $result_str;?>" class="field_frm"
2244
+            <div id="field_frm<?php echo $result_str; ?>" class="field_frm"
2245 2245
                  style="display:<?php if ($field_ins_upd == 'submit') {
2246 2246
                      echo 'block;';
2247 2247
                  } else {
2248 2248
                      echo 'none;';
2249 2249
                  } ?>">
2250 2250
                 <input type="hidden" name="_wpnonce" value="<?php echo $nonce; ?>"/>
2251
-                <input type="hidden" name="listing_type" id="listing_type" value="<?php echo $post_type;?>"/>
2252
-                <input type="hidden" name="field_type" id="field_type" value="<?php echo $field_type;?>"/>
2253
-                <input type="hidden" name="field_id" id="field_id" value="<?php echo $result_str;?>"/>
2251
+                <input type="hidden" name="listing_type" id="listing_type" value="<?php echo $post_type; ?>"/>
2252
+                <input type="hidden" name="field_type" id="field_type" value="<?php echo $field_type; ?>"/>
2253
+                <input type="hidden" name="field_id" id="field_id" value="<?php echo $result_str; ?>"/>
2254 2254
                 <input type="hidden" name="data_type" id="data_type" value="<?php if (isset($field_info->data_type)) {
2255 2255
                     echo $field_info->data_type;
2256 2256
                 }?>"/>
2257
-                <input type="hidden" name="htmlvar_name" id="htmlvar_name" value="<?php echo $htmlvar_name;?>"/>
2257
+                <input type="hidden" name="htmlvar_name" id="htmlvar_name" value="<?php echo $htmlvar_name; ?>"/>
2258 2258
 
2259 2259
 
2260 2260
                 <ul class="widefat post fixed" border="0" style="width:100%;">
@@ -2264,7 +2264,7 @@  discard block
 block discarded – undo
2264 2264
                         <input type="hidden" name="site_title" id="site_title" value="<?php echo esc_attr($site_title); ?>"/>
2265 2265
 
2266 2266
                         <li>
2267
-                            <?php $value = (isset($field_info->sort_asc) && $field_info->sort_asc) ? $field_info->sort_asc : 0;?>
2267
+                            <?php $value = (isset($field_info->sort_asc) && $field_info->sort_asc) ? $field_info->sort_asc : 0; ?>
2268 2268
 
2269 2269
                             <label for="asc" class="gd-cf-tooltip-wrap">
2270 2270
                                 <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Show Ascending Sort (low to high)', 'geodirectory'); ?>
@@ -2274,24 +2274,24 @@  discard block
 block discarded – undo
2274 2274
                             </label>
2275 2275
                             <div class="gd-cf-input-wrap gd-switch">
2276 2276
 
2277
-                                <input type="radio" id="asc_yes<?php echo $radio_id;?>" name="asc" class="gdri-enabled"  value="1"
2277
+                                <input type="radio" id="asc_yes<?php echo $radio_id; ?>" name="asc" class="gdri-enabled"  value="1"
2278 2278
                                     <?php if ($value == '1') {
2279 2279
                                         echo 'checked';
2280 2280
                                     } ?>/>
2281
-                                <label onclick="show_hide_radio(this,'show','cfs-asc-title');" for="asc_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
2281
+                                <label onclick="show_hide_radio(this,'show','cfs-asc-title');" for="asc_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
2282 2282
 
2283
-                                <input type="radio" id="asc_no<?php echo $radio_id;?>" name="asc" class="gdri-disabled" value="0"
2283
+                                <input type="radio" id="asc_no<?php echo $radio_id; ?>" name="asc" class="gdri-disabled" value="0"
2284 2284
                                     <?php if ($value == '0' || !$value) {
2285 2285
                                         echo 'checked';
2286 2286
                                     } ?>/>
2287
-                                <label onclick="show_hide_radio(this,'hide','cfs-asc-title');" for="asc_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
2287
+                                <label onclick="show_hide_radio(this,'hide','cfs-asc-title');" for="asc_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
2288 2288
 
2289 2289
                             </div>
2290 2290
 
2291 2291
                         </li>
2292 2292
 
2293
-                        <li class="cfs-asc-title" <?php if ((isset($field_info->sort_asc) && $field_info->sort_asc == '0') || !isset($field_info->sort_asc)) {echo "style='display:none;'";}?>>
2294
-                            <?php $value = (isset($field_info->asc_title) && $field_info->asc_title) ? esc_attr($field_info->asc_title) : '';?>
2293
+                        <li class="cfs-asc-title" <?php if ((isset($field_info->sort_asc) && $field_info->sort_asc == '0') || !isset($field_info->sort_asc)) {echo "style='display:none;'"; }?>>
2294
+                            <?php $value = (isset($field_info->asc_title) && $field_info->asc_title) ? esc_attr($field_info->asc_title) : ''; ?>
2295 2295
 
2296 2296
                             <label for="asc_title" class="gd-cf-tooltip-wrap">
2297 2297
                                 <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Ascending title', 'geodirectory'); ?>
@@ -2301,14 +2301,14 @@  discard block
 block discarded – undo
2301 2301
                             </label>
2302 2302
                             <div class="gd-cf-input-wrap">
2303 2303
 
2304
-                                <input type="text" name="asc_title" id="asc_title" value="<?php echo $value;?>" />
2304
+                                <input type="text" name="asc_title" id="asc_title" value="<?php echo $value; ?>" />
2305 2305
                             </div>
2306 2306
 
2307 2307
 
2308 2308
                         </li>
2309 2309
 
2310 2310
 
2311
-                        <li class="cfs-asc-title" <?php if ((isset($field_info->sort_asc) && $field_info->sort_asc == '0') || !isset($field_info->sort_asc)) {echo "style='display:none;'";}?>>
2311
+                        <li class="cfs-asc-title" <?php if ((isset($field_info->sort_asc) && $field_info->sort_asc == '0') || !isset($field_info->sort_asc)) {echo "style='display:none;'"; }?>>
2312 2312
 
2313 2313
                             <label for="is_default" class="gd-cf-tooltip-wrap">
2314 2314
                                 <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Default sort?', 'geodirectory'); ?>
@@ -2319,7 +2319,7 @@  discard block
 block discarded – undo
2319 2319
                             <div class="gd-cf-input-wrap">
2320 2320
 
2321 2321
                                 <input type="radio" name="is_default"
2322
-                                       value="<?php echo $htmlvar_name; ?>_asc" <?php if (isset($field_info->default_order) && $field_info->default_order == $htmlvar_name . '_asc') {
2322
+                                       value="<?php echo $htmlvar_name; ?>_asc" <?php if (isset($field_info->default_order) && $field_info->default_order == $htmlvar_name.'_asc') {
2323 2323
                                     echo 'checked="checked"';
2324 2324
                                 } ?>/>
2325 2325
                             </div>
@@ -2329,7 +2329,7 @@  discard block
 block discarded – undo
2329 2329
 
2330 2330
 
2331 2331
                         <li>
2332
-                            <?php $value = (isset($field_info->sort_desc) && $field_info->sort_desc) ? $field_info->sort_desc : 0;?>
2332
+                            <?php $value = (isset($field_info->sort_desc) && $field_info->sort_desc) ? $field_info->sort_desc : 0; ?>
2333 2333
 
2334 2334
                             <label for="desc" class="gd-cf-tooltip-wrap">
2335 2335
                                 <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Show Descending Sort (high to low)', 'geodirectory'); ?>
@@ -2339,24 +2339,24 @@  discard block
 block discarded – undo
2339 2339
                             </label>
2340 2340
                             <div class="gd-cf-input-wrap gd-switch">
2341 2341
 
2342
-                                <input type="radio" id="desc_yes<?php echo $radio_id;?>" name="desc" class="gdri-enabled"  value="1"
2342
+                                <input type="radio" id="desc_yes<?php echo $radio_id; ?>" name="desc" class="gdri-enabled"  value="1"
2343 2343
                                     <?php if ($value == '1') {
2344 2344
                                         echo 'checked';
2345 2345
                                     } ?>/>
2346
-                                <label onclick="show_hide_radio(this,'show','cfs-desc-title');" for="desc_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
2346
+                                <label onclick="show_hide_radio(this,'show','cfs-desc-title');" for="desc_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
2347 2347
 
2348
-                                <input type="radio" id="desc_no<?php echo $radio_id;?>" name="desc" class="gdri-disabled" value="0"
2348
+                                <input type="radio" id="desc_no<?php echo $radio_id; ?>" name="desc" class="gdri-disabled" value="0"
2349 2349
                                     <?php if ($value == '0' || !$value) {
2350 2350
                                         echo 'checked';
2351 2351
                                     } ?>/>
2352
-                                <label onclick="show_hide_radio(this,'hide','cfs-desc-title');" for="desc_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
2352
+                                <label onclick="show_hide_radio(this,'hide','cfs-desc-title');" for="desc_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
2353 2353
 
2354 2354
                             </div>
2355 2355
 
2356 2356
                         </li>
2357 2357
 
2358
-                        <li class="cfs-desc-title" <?php if ((isset($field_info->sort_desc) && $field_info->sort_desc == '0') || !isset($field_info->sort_desc)) {echo "style='display:none;'";}?>>
2359
-                            <?php $value = (isset($field_info->desc_title) && $field_info->desc_title) ? esc_attr($field_info->desc_title) : '';?>
2358
+                        <li class="cfs-desc-title" <?php if ((isset($field_info->sort_desc) && $field_info->sort_desc == '0') || !isset($field_info->sort_desc)) {echo "style='display:none;'"; }?>>
2359
+                            <?php $value = (isset($field_info->desc_title) && $field_info->desc_title) ? esc_attr($field_info->desc_title) : ''; ?>
2360 2360
 
2361 2361
                             <label for="desc_title" class="gd-cf-tooltip-wrap">
2362 2362
                                 <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Descending title', 'geodirectory'); ?>
@@ -2366,13 +2366,13 @@  discard block
 block discarded – undo
2366 2366
                             </label>
2367 2367
                             <div class="gd-cf-input-wrap">
2368 2368
 
2369
-                                <input type="text" name="desc_title" id="desc_title" value="<?php echo $value;?>" />
2369
+                                <input type="text" name="desc_title" id="desc_title" value="<?php echo $value; ?>" />
2370 2370
                             </div>
2371 2371
 
2372 2372
 
2373 2373
                         </li>
2374 2374
 
2375
-                        <li class="cfs-desc-title" <?php if ((isset($field_info->sort_desc) && $field_info->sort_desc == '0') || !isset($field_info->sort_desc)) {echo "style='display:none;'";}?>>
2375
+                        <li class="cfs-desc-title" <?php if ((isset($field_info->sort_desc) && $field_info->sort_desc == '0') || !isset($field_info->sort_desc)) {echo "style='display:none;'"; }?>>
2376 2376
 
2377 2377
                             <label for="is_default" class="gd-cf-tooltip-wrap">
2378 2378
                                 <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Default sort?', 'geodirectory'); ?>
@@ -2383,7 +2383,7 @@  discard block
 block discarded – undo
2383 2383
                             <div class="gd-cf-input-wrap">
2384 2384
 
2385 2385
                                 <input type="radio" name="is_default"
2386
-                                       value="<?php echo $htmlvar_name; ?>_desc" <?php if (isset($field_info->default_order) && $field_info->default_order == $htmlvar_name . '_desc') {
2386
+                                       value="<?php echo $htmlvar_name; ?>_desc" <?php if (isset($field_info->default_order) && $field_info->default_order == $htmlvar_name.'_desc') {
2387 2387
                                     echo 'checked="checked"';
2388 2388
                                 } ?>/>
2389 2389
                             </div>
@@ -2408,14 +2408,14 @@  discard block
 block discarded – undo
2408 2408
                             </label>
2409 2409
                             <div class="gd-cf-input-wrap">
2410 2410
 
2411
-                                <input type="text" name="site_title" id="site_title" value="<?php echo $value;?>" />
2411
+                                <input type="text" name="site_title" id="site_title" value="<?php echo $value; ?>" />
2412 2412
                             </div>
2413 2413
 
2414 2414
 
2415 2415
                         </li>
2416 2416
 
2417 2417
                         <li>
2418
-                            <?php $value = (isset($field_info->is_default) && $field_info->is_default) ? esc_attr($field_info->is_default) : '';?>
2418
+                            <?php $value = (isset($field_info->is_default) && $field_info->is_default) ? esc_attr($field_info->is_default) : ''; ?>
2419 2419
 
2420 2420
                             <label for="is_default" class="gd-cf-tooltip-wrap">
2421 2421
                                 <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Default sort?', 'geodirectory'); ?>
@@ -2439,7 +2439,7 @@  discard block
 block discarded – undo
2439 2439
 
2440 2440
 
2441 2441
                     <li>
2442
-                        <?php $value = (isset($field_info->is_active) && $field_info->is_active) ? $field_info->is_active: 0;?>
2442
+                        <?php $value = (isset($field_info->is_active) && $field_info->is_active) ? $field_info->is_active : 0; ?>
2443 2443
 
2444 2444
                         <label for="is_active" class="gd-cf-tooltip-wrap">
2445 2445
                             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Is active', 'geodirectory'); ?>
@@ -2449,17 +2449,17 @@  discard block
 block discarded – undo
2449 2449
                         </label>
2450 2450
                         <div class="gd-cf-input-wrap gd-switch">
2451 2451
 
2452
-                            <input type="radio" id="is_active_yes<?php echo $radio_id;?>" name="is_active" class="gdri-enabled"  value="1"
2452
+                            <input type="radio" id="is_active_yes<?php echo $radio_id; ?>" name="is_active" class="gdri-enabled"  value="1"
2453 2453
                                 <?php if ($value == '1') {
2454 2454
                                     echo 'checked';
2455 2455
                                 } ?>/>
2456
-                            <label for="is_active_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
2456
+                            <label for="is_active_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
2457 2457
 
2458
-                            <input type="radio" id="is_active_no<?php echo $radio_id;?>" name="is_active" class="gdri-disabled" value="0"
2458
+                            <input type="radio" id="is_active_no<?php echo $radio_id; ?>" name="is_active" class="gdri-disabled" value="0"
2459 2459
                                 <?php if ($value == '0' || !$value) {
2460 2460
                                     echo 'checked';
2461 2461
                                 } ?>/>
2462
-                            <label for="is_active_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
2462
+                            <label for="is_active_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
2463 2463
 
2464 2464
                         </div>
2465 2465
 
@@ -2480,10 +2480,10 @@  discard block
 block discarded – undo
2480 2480
                             <h3></h3>
2481 2481
                         </label>
2482 2482
                         <div class="gd-cf-input-wrap">
2483
-                            <input type="button" class="button button-primary" name="save" id="save" value="<?php echo esc_attr(__('Save','geodirectory'));?>"
2483
+                            <input type="button" class="button button-primary" name="save" id="save" value="<?php echo esc_attr(__('Save', 'geodirectory')); ?>"
2484 2484
                                    onclick="save_sort_field('<?php echo esc_attr($result_str); ?>')"/>
2485
-                                <a href="javascript:void(0)"><input type="button" name="delete" value="<?php echo esc_attr(__('Delete','geodirectory'));?>"
2486
-                                                                    onclick="delete_sort_field('<?php echo $result_str;?>', '<?php echo $nonce;?>', this)"
2485
+                                <a href="javascript:void(0)"><input type="button" name="delete" value="<?php echo esc_attr(__('Delete', 'geodirectory')); ?>"
2486
+                                                                    onclick="delete_sort_field('<?php echo $result_str; ?>', '<?php echo $nonce; ?>', this)"
2487 2487
                                                                     class="button"/></a>
2488 2488
                         </div>
2489 2489
                     </li>
@@ -2518,7 +2518,7 @@  discard block
 block discarded – undo
2518 2518
         if (!$package_id || !$field_name || !$post_type) {
2519 2519
             return true;
2520 2520
         }
2521
-        $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));
2521
+        $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));
2522 2522
 
2523 2523
         if ($wpdb->get_var($sql)) {
2524 2524
             return true;
@@ -2640,7 +2640,7 @@  discard block
 block discarded – undo
2640 2640
 }
2641 2641
 
2642 2642
 
2643
-function geodir_cfa_data_type_text($output,$result_str,$cf,$field_info){
2643
+function geodir_cfa_data_type_text($output, $result_str, $cf, $field_info) {
2644 2644
     ob_start();
2645 2645
     ?>
2646 2646
     <li>
@@ -2686,43 +2686,43 @@  discard block
 block discarded – undo
2686 2686
     $output = ob_get_clean();
2687 2687
     return $output;
2688 2688
 }
2689
-add_filter('geodir_cfa_data_type_text','geodir_cfa_data_type_text',10,4);
2689
+add_filter('geodir_cfa_data_type_text', 'geodir_cfa_data_type_text', 10, 4);
2690 2690
 
2691 2691
 // htmlvar not needed for fieldset and taxonomy
2692
-add_filter('geodir_cfa_htmlvar_name_fieldset','__return_empty_string',10,4);
2693
-add_filter('geodir_cfa_htmlvar_name_taxonomy','__return_empty_string',10,4);
2692
+add_filter('geodir_cfa_htmlvar_name_fieldset', '__return_empty_string', 10, 4);
2693
+add_filter('geodir_cfa_htmlvar_name_taxonomy', '__return_empty_string', 10, 4);
2694 2694
 
2695 2695
 
2696 2696
 // default_value not needed for textarea, html, file, fieldset, taxonomy, address
2697
-add_filter('geodir_cfa_default_value_textarea','__return_empty_string',10,4);
2698
-add_filter('geodir_cfa_default_value_html','__return_empty_string',10,4);
2699
-add_filter('geodir_cfa_default_value_file','__return_empty_string',10,4);
2700
-add_filter('geodir_cfa_default_value_taxonomy','__return_empty_string',10,4);
2701
-add_filter('geodir_cfa_default_value_address','__return_empty_string',10,4);
2702
-add_filter('geodir_cfa_default_value_fieldset','__return_empty_string',10,4);
2697
+add_filter('geodir_cfa_default_value_textarea', '__return_empty_string', 10, 4);
2698
+add_filter('geodir_cfa_default_value_html', '__return_empty_string', 10, 4);
2699
+add_filter('geodir_cfa_default_value_file', '__return_empty_string', 10, 4);
2700
+add_filter('geodir_cfa_default_value_taxonomy', '__return_empty_string', 10, 4);
2701
+add_filter('geodir_cfa_default_value_address', '__return_empty_string', 10, 4);
2702
+add_filter('geodir_cfa_default_value_fieldset', '__return_empty_string', 10, 4);
2703 2703
 
2704 2704
 // is_required not needed for fieldset
2705
-add_filter('geodir_cfa_is_required_fieldset','__return_empty_string',10,4);
2706
-add_filter('geodir_cfa_required_msg_fieldset','__return_empty_string',10,4);
2705
+add_filter('geodir_cfa_is_required_fieldset', '__return_empty_string', 10, 4);
2706
+add_filter('geodir_cfa_required_msg_fieldset', '__return_empty_string', 10, 4);
2707 2707
 
2708 2708
 // field_icon not needed for fieldset
2709
-add_filter('geodir_cfa_field_icon_fieldset','__return_empty_string',10,4);
2710
-add_filter('geodir_cfa_css_class_fieldset','__return_empty_string',10,4);
2709
+add_filter('geodir_cfa_field_icon_fieldset', '__return_empty_string', 10, 4);
2710
+add_filter('geodir_cfa_css_class_fieldset', '__return_empty_string', 10, 4);
2711 2711
 
2712 2712
 // cat_sort not needed for some fields
2713
-add_filter('geodir_cfa_cat_sort_html','__return_empty_string',10,4);
2714
-add_filter('geodir_cfa_cat_sort_file','__return_empty_string',10,4);
2715
-add_filter('geodir_cfa_cat_sort_url','__return_empty_string',10,4);
2716
-add_filter('geodir_cfa_cat_sort_fieldset','__return_empty_string',10,4);
2717
-add_filter('geodir_cfa_cat_sort_multiselect','__return_empty_string',10,4);
2718
-add_filter('geodir_cfa_cat_sort_textarea','__return_empty_string',10,4);
2719
-add_filter('geodir_cfa_cat_sort_taxonomy','__return_empty_string',10,4);
2720
-add_filter('geodir_cfa_cat_sort_address','__return_empty_string',10,4);
2713
+add_filter('geodir_cfa_cat_sort_html', '__return_empty_string', 10, 4);
2714
+add_filter('geodir_cfa_cat_sort_file', '__return_empty_string', 10, 4);
2715
+add_filter('geodir_cfa_cat_sort_url', '__return_empty_string', 10, 4);
2716
+add_filter('geodir_cfa_cat_sort_fieldset', '__return_empty_string', 10, 4);
2717
+add_filter('geodir_cfa_cat_sort_multiselect', '__return_empty_string', 10, 4);
2718
+add_filter('geodir_cfa_cat_sort_textarea', '__return_empty_string', 10, 4);
2719
+add_filter('geodir_cfa_cat_sort_taxonomy', '__return_empty_string', 10, 4);
2720
+add_filter('geodir_cfa_cat_sort_address', '__return_empty_string', 10, 4);
2721 2721
 
2722 2722
 
2723 2723
 
2724
-function geodir_cfa_advanced_editor_geodir_special_offers($output,$result_str,$cf,$field_info){
2725
-    if($field_info->htmlvar_name != 'geodir_special_offers'){return '';}
2724
+function geodir_cfa_advanced_editor_geodir_special_offers($output, $result_str, $cf, $field_info) {
2725
+    if ($field_info->htmlvar_name != 'geodir_special_offers') {return ''; }
2726 2726
     ob_start();
2727 2727
     ?>
2728 2728
     <li>
@@ -2753,16 +2753,16 @@  discard block
 block discarded – undo
2753 2753
     $output = ob_get_clean();
2754 2754
     return $output;
2755 2755
 }
2756
-add_filter('geodir_cfa_advanced_editor_textarea','geodir_cfa_advanced_editor_geodir_special_offers',10,4);
2756
+add_filter('geodir_cfa_advanced_editor_textarea', 'geodir_cfa_advanced_editor_geodir_special_offers', 10, 4);
2757 2757
 
2758 2758
 
2759
-function geodir_cfa_validation_pattern_text($output,$result_str,$cf,$field_info){
2759
+function geodir_cfa_validation_pattern_text($output, $result_str, $cf, $field_info) {
2760 2760
     ob_start();
2761 2761
 
2762 2762
     $value = '';
2763 2763
     if (isset($field_info->validation_pattern)) {
2764 2764
         $value = esc_attr($field_info->validation_pattern);
2765
-    }elseif(isset($cf['defaults']['validation_pattern']) && $cf['defaults']['validation_pattern']){
2765
+    }elseif (isset($cf['defaults']['validation_pattern']) && $cf['defaults']['validation_pattern']) {
2766 2766
         $value = esc_attr($cf['defaults']['validation_pattern']);
2767 2767
     }
2768 2768
     ?>
@@ -2782,7 +2782,7 @@  discard block
 block discarded – undo
2782 2782
     $value = '';
2783 2783
     if (isset($field_info->validation_msg)) {
2784 2784
         $value = esc_attr($field_info->validation_msg);
2785
-    }elseif(isset($cf['defaults']['validation_msg']) && $cf['defaults']['validation_msg']){
2785
+    }elseif (isset($cf['defaults']['validation_msg']) && $cf['defaults']['validation_msg']) {
2786 2786
         $value = esc_attr($cf['defaults']['validation_msg']);
2787 2787
     }
2788 2788
     ?>
@@ -2803,10 +2803,10 @@  discard block
 block discarded – undo
2803 2803
     $output = ob_get_clean();
2804 2804
     return $output;
2805 2805
 }
2806
-add_filter('geodir_cfa_validation_pattern_text','geodir_cfa_validation_pattern_text',10,4);
2806
+add_filter('geodir_cfa_validation_pattern_text', 'geodir_cfa_validation_pattern_text', 10, 4);
2807 2807
 
2808 2808
 
2809
-function geodir_cfa_htmlvar_name_taxonomy($output,$result_str,$cf,$field_info){
2809
+function geodir_cfa_htmlvar_name_taxonomy($output, $result_str, $cf, $field_info) {
2810 2810
     ob_start();
2811 2811
     global $post_type;
2812 2812
 
@@ -2831,7 +2831,7 @@  discard block
 block discarded – undo
2831 2831
                     ?>
2832 2832
                     <option <?php if (isset($field_info->htmlvar_name) && $field_info->htmlvar_name == $gd_tax) {
2833 2833
                         echo 'selected="selected"';
2834
-                    }?> id="<?php echo $gd_tax;?>"><?php echo $gd_tax;?></option><?php
2834
+                    }?> id="<?php echo $gd_tax; ?>"><?php echo $gd_tax; ?></option><?php
2835 2835
                 }
2836 2836
                 ?>
2837 2837
             </select>
@@ -2842,7 +2842,7 @@  discard block
 block discarded – undo
2842 2842
         <label for="cat_display_type" class="gd-cf-tooltip-wrap">
2843 2843
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Category display type :', 'geodirectory'); ?>
2844 2844
             <div class="gdcf-tooltip">
2845
-                <?php _e('Show categories list as select, multiselect, checkbox or radio', 'geodirectory');?>
2845
+                <?php _e('Show categories list as select, multiselect, checkbox or radio', 'geodirectory'); ?>
2846 2846
             </div>
2847 2847
         </label>
2848 2848
         <div class="gd-cf-input-wrap">
@@ -2850,19 +2850,19 @@  discard block
 block discarded – undo
2850 2850
             <select name="cat_display_type" id="cat_display_type">
2851 2851
                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'ajax_chained') {
2852 2852
                     echo 'selected="selected"';
2853
-                }?> value="ajax_chained"><?php _e('Ajax Chained', 'geodirectory');?></option>
2853
+                }?> value="ajax_chained"><?php _e('Ajax Chained', 'geodirectory'); ?></option>
2854 2854
                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'select') {
2855 2855
                     echo 'selected="selected"';
2856
-                }?> value="select"><?php _e('Select', 'geodirectory');?></option>
2856
+                }?> value="select"><?php _e('Select', 'geodirectory'); ?></option>
2857 2857
                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'multiselect') {
2858 2858
                     echo 'selected="selected"';
2859
-                }?> value="multiselect"><?php _e('Multiselect', 'geodirectory');?></option>
2859
+                }?> value="multiselect"><?php _e('Multiselect', 'geodirectory'); ?></option>
2860 2860
                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'checkbox') {
2861 2861
                     echo 'selected="selected"';
2862
-                }?> value="checkbox"><?php _e('Checkbox', 'geodirectory');?></option>
2862
+                }?> value="checkbox"><?php _e('Checkbox', 'geodirectory'); ?></option>
2863 2863
                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'radio') {
2864 2864
                     echo 'selected="selected"';
2865
-                }?> value="radio"><?php _e('Radio', 'geodirectory');?></option>
2865
+                }?> value="radio"><?php _e('Radio', 'geodirectory'); ?></option>
2866 2866
             </select>
2867 2867
         </div>
2868 2868
     </li>
@@ -2871,10 +2871,10 @@  discard block
 block discarded – undo
2871 2871
     $output = ob_get_clean();
2872 2872
     return $output;
2873 2873
 }
2874
-add_filter('geodir_cfa_htmlvar_name_taxonomy','geodir_cfa_htmlvar_name_taxonomy',10,4);
2874
+add_filter('geodir_cfa_htmlvar_name_taxonomy', 'geodir_cfa_htmlvar_name_taxonomy', 10, 4);
2875 2875
 
2876 2876
 
2877
-function geodir_cfa_extra_fields_address($output,$result_str,$cf,$field_info){
2877
+function geodir_cfa_extra_fields_address($output, $result_str, $cf, $field_info) {
2878 2878
 
2879 2879
     ob_start();
2880 2880
     if (isset($field_info->extra_fields) && $field_info->extra_fields != '') {
@@ -2895,32 +2895,32 @@  discard block
 block discarded – undo
2895 2895
         <label for="show_zip" class="gd-cf-tooltip-wrap">
2896 2896
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Display zip/post code :', 'geodirectory'); ?>
2897 2897
             <div class="gdcf-tooltip">
2898
-                <?php _e('Select if you want to show zip/post code field in address section.', 'geodirectory');?>
2898
+                <?php _e('Select if you want to show zip/post code field in address section.', 'geodirectory'); ?>
2899 2899
             </div>
2900 2900
         </label>
2901 2901
         <div class="gd-cf-input-wrap gd-switch">
2902 2902
 
2903
-            <input type="radio" id="show_zip_yes<?php echo $radio_id;?>" name="extra[show_zip]" class="gdri-enabled"  value="1"
2903
+            <input type="radio" id="show_zip_yes<?php echo $radio_id; ?>" name="extra[show_zip]" class="gdri-enabled"  value="1"
2904 2904
                 <?php if (isset($address['show_zip']) && $address['show_zip'] == '1') {
2905 2905
                     echo 'checked';
2906 2906
                 } ?>/>
2907
-            <label onclick="show_hide_radio(this,'show','cf-zip-lable');" for="show_zip_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
2907
+            <label onclick="show_hide_radio(this,'show','cf-zip-lable');" for="show_zip_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
2908 2908
 
2909
-            <input type="radio" id="show_zip_no<?php echo $radio_id;?>" name="extra[show_zip]" class="gdri-disabled" value="0"
2909
+            <input type="radio" id="show_zip_no<?php echo $radio_id; ?>" name="extra[show_zip]" class="gdri-disabled" value="0"
2910 2910
                 <?php if ((isset($address['show_zip']) && !$address['show_zip']) || !isset($address['show_zip'])) {
2911 2911
                     echo 'checked';
2912 2912
                 } ?>/>
2913
-            <label onclick="show_hide_radio(this,'hide','cf-zip-lable');" for="show_zip_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
2913
+            <label onclick="show_hide_radio(this,'hide','cf-zip-lable');" for="show_zip_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
2914 2914
 
2915 2915
 
2916 2916
         </div>
2917 2917
     </li>
2918 2918
 
2919
-    <li class="cf-zip-lable"  <?php if ((isset($address['show_zip']) && !$address['show_zip']) || !isset($address['show_zip'])) {echo "style='display:none;'";}?> >
2919
+    <li class="cf-zip-lable"  <?php if ((isset($address['show_zip']) && !$address['show_zip']) || !isset($address['show_zip'])) {echo "style='display:none;'"; }?> >
2920 2920
         <label for="zip_lable" class="gd-cf-tooltip-wrap">
2921 2921
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Zip/Post code label :', 'geodirectory'); ?>
2922 2922
             <div class="gdcf-tooltip">
2923
-                <?php _e('Enter zip/post code field label in address section.', 'geodirectory');?>
2923
+                <?php _e('Enter zip/post code field label in address section.', 'geodirectory'); ?>
2924 2924
             </div>
2925 2925
         </label>
2926 2926
         <div class="gd-cf-input-wrap">
@@ -2938,7 +2938,7 @@  discard block
 block discarded – undo
2938 2938
         <label for="map_lable" class="gd-cf-tooltip-wrap">
2939 2939
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Map button label :', 'geodirectory'); ?>
2940 2940
             <div class="gdcf-tooltip">
2941
-                <?php _e('Enter text for `set address on map` button in address section.', 'geodirectory');?>
2941
+                <?php _e('Enter text for `set address on map` button in address section.', 'geodirectory'); ?>
2942 2942
             </div>
2943 2943
         </label>
2944 2944
         <div class="gd-cf-input-wrap">
@@ -2953,22 +2953,22 @@  discard block
 block discarded – undo
2953 2953
         <label for="show_mapzoom" class="gd-cf-tooltip-wrap">
2954 2954
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Use user zoom level:', 'geodirectory'); ?>
2955 2955
             <div class="gdcf-tooltip">
2956
-                <?php _e('Do you want to use the user defined map zoom level from the add listing page?', 'geodirectory');?>
2956
+                <?php _e('Do you want to use the user defined map zoom level from the add listing page?', 'geodirectory'); ?>
2957 2957
             </div>
2958 2958
         </label>
2959 2959
         <div class="gd-cf-input-wrap gd-switch">
2960 2960
 
2961
-            <input type="radio" id="show_mapzoom_yes<?php echo $radio_id;?>" name="extra[show_mapzoom]" class="gdri-enabled"  value="1"
2961
+            <input type="radio" id="show_mapzoom_yes<?php echo $radio_id; ?>" name="extra[show_mapzoom]" class="gdri-enabled"  value="1"
2962 2962
                 <?php if (isset($address['show_mapzoom']) && $address['show_mapzoom'] == '1') {
2963 2963
                     echo 'checked';
2964 2964
                 } ?>/>
2965
-            <label for="show_mapzoom_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
2965
+            <label for="show_mapzoom_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
2966 2966
 
2967
-            <input type="radio" id="show_mapzoom_no<?php echo $radio_id;?>" name="extra[show_mapzoom]" class="gdri-disabled" value="0"
2967
+            <input type="radio" id="show_mapzoom_no<?php echo $radio_id; ?>" name="extra[show_mapzoom]" class="gdri-disabled" value="0"
2968 2968
                 <?php if ((isset($address['show_mapzoom']) && !$address['show_mapzoom']) || !isset($address['show_mapzoom'])) {
2969 2969
                     echo 'checked';
2970 2970
                 } ?>/>
2971
-            <label for="show_mapzoom_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
2971
+            <label for="show_mapzoom_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
2972 2972
 
2973 2973
         </div>
2974 2974
     </li>
@@ -2977,22 +2977,22 @@  discard block
 block discarded – undo
2977 2977
         <label for="show_mapview" class="gd-cf-tooltip-wrap">
2978 2978
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Display map view:', 'geodirectory'); ?>
2979 2979
             <div class="gdcf-tooltip">
2980
-                <?php _e('Select if you want to `set default map` options in address section. ( Satellite Map, Hybrid Map, Terrain Map)', 'geodirectory');?>
2980
+                <?php _e('Select if you want to `set default map` options in address section. ( Satellite Map, Hybrid Map, Terrain Map)', 'geodirectory'); ?>
2981 2981
             </div>
2982 2982
         </label>
2983 2983
         <div class="gd-cf-input-wrap gd-switch">
2984 2984
 
2985
-            <input type="radio" id="show_mapview_yes<?php echo $radio_id;?>" name="extra[show_mapview]" class="gdri-enabled"  value="1"
2985
+            <input type="radio" id="show_mapview_yes<?php echo $radio_id; ?>" name="extra[show_mapview]" class="gdri-enabled"  value="1"
2986 2986
                 <?php if (isset($address['show_mapview']) && $address['show_mapview'] == '1') {
2987 2987
                     echo 'checked';
2988 2988
                 } ?>/>
2989
-            <label for="show_mapview_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
2989
+            <label for="show_mapview_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
2990 2990
 
2991
-            <input type="radio" id="show_mapview_no<?php echo $radio_id;?>" name="extra[show_mapview]" class="gdri-disabled" value="0"
2991
+            <input type="radio" id="show_mapview_no<?php echo $radio_id; ?>" name="extra[show_mapview]" class="gdri-disabled" value="0"
2992 2992
                 <?php if ((isset($address['show_mapview']) && !$address['show_mapview']) || !isset($address['show_mapview'])) {
2993 2993
                     echo 'checked';
2994 2994
                 } ?>/>
2995
-            <label for="show_mapview_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
2995
+            <label for="show_mapview_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
2996 2996
 
2997 2997
         </div>
2998 2998
     </li>
@@ -3002,7 +3002,7 @@  discard block
 block discarded – undo
3002 3002
         <label for="mapview_lable" class="gd-cf-tooltip-wrap">
3003 3003
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Map view label:', 'geodirectory'); ?>
3004 3004
             <div class="gdcf-tooltip">
3005
-                <?php _e('Enter mapview field label in address section.', 'geodirectory');?>
3005
+                <?php _e('Enter mapview field label in address section.', 'geodirectory'); ?>
3006 3006
             </div>
3007 3007
         </label>
3008 3008
         <div class="gd-cf-input-wrap">
@@ -3016,22 +3016,22 @@  discard block
 block discarded – undo
3016 3016
         <label for="show_latlng" class="gd-cf-tooltip-wrap">
3017 3017
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Show latitude and longitude', 'geodirectory'); ?>
3018 3018
             <div class="gdcf-tooltip">
3019
-                <?php _e('This will show/hide the longitude fields in the address section add listing form.', 'geodirectory');?>
3019
+                <?php _e('This will show/hide the longitude fields in the address section add listing form.', 'geodirectory'); ?>
3020 3020
             </div>
3021 3021
         </label>
3022 3022
         <div class="gd-cf-input-wrap gd-switch">
3023 3023
 
3024
-            <input type="radio" id="show_latlng_yes<?php echo $radio_id;?>" name="extra[show_latlng]" class="gdri-enabled"  value="1"
3024
+            <input type="radio" id="show_latlng_yes<?php echo $radio_id; ?>" name="extra[show_latlng]" class="gdri-enabled"  value="1"
3025 3025
                 <?php if (isset($address['show_latlng']) && $address['show_latlng'] == '1') {
3026 3026
                     echo 'checked';
3027 3027
                 } ?>/>
3028
-            <label for="show_latlng_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
3028
+            <label for="show_latlng_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
3029 3029
 
3030
-            <input type="radio" id="show_latlng_no<?php echo $radio_id;?>" name="extra[show_latlng]" class="gdri-disabled" value="0"
3030
+            <input type="radio" id="show_latlng_no<?php echo $radio_id; ?>" name="extra[show_latlng]" class="gdri-disabled" value="0"
3031 3031
                 <?php if ((isset($address['show_latlng']) && !$address['show_latlng']) || !isset($address['show_latlng'])) {
3032 3032
                     echo 'checked';
3033 3033
                 } ?>/>
3034
-            <label for="show_latlng_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
3034
+            <label for="show_latlng_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
3035 3035
 
3036 3036
         </div>
3037 3037
     </li>
@@ -3040,17 +3040,17 @@  discard block
 block discarded – undo
3040 3040
     $output = ob_get_clean();
3041 3041
     return $output;
3042 3042
 }
3043
-add_filter('geodir_cfa_extra_fields_address','geodir_cfa_extra_fields_address',10,4);
3043
+add_filter('geodir_cfa_extra_fields_address', 'geodir_cfa_extra_fields_address', 10, 4);
3044 3044
 
3045 3045
 
3046
-function geodir_cfa_extra_fields_multiselect($output,$result_str,$cf,$field_info){
3046
+function geodir_cfa_extra_fields_multiselect($output, $result_str, $cf, $field_info) {
3047 3047
     ob_start();
3048 3048
     ?>
3049 3049
     <li>
3050 3050
         <label for="multi_display_type" class="gd-cf-tooltip-wrap">
3051 3051
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Multiselect display type :', 'geodirectory'); ?>
3052 3052
             <div class="gdcf-tooltip">
3053
-                <?php _e('Show multiselect list as multiselect,checkbox or radio.', 'geodirectory');?>
3053
+                <?php _e('Show multiselect list as multiselect,checkbox or radio.', 'geodirectory'); ?>
3054 3054
             </div>
3055 3055
         </label>
3056 3056
         <div class="gd-cf-input-wrap">
@@ -3058,13 +3058,13 @@  discard block
 block discarded – undo
3058 3058
             <select name="multi_display_type" id="multi_display_type">
3059 3059
                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'select') {
3060 3060
                     echo 'selected="selected"';
3061
-                }?> value="select"><?php _e('Select', 'geodirectory');?></option>
3061
+                }?> value="select"><?php _e('Select', 'geodirectory'); ?></option>
3062 3062
                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'checkbox') {
3063 3063
                     echo 'selected="selected"';
3064
-                }?> value="checkbox"><?php _e('Checkbox', 'geodirectory');?></option>
3064
+                }?> value="checkbox"><?php _e('Checkbox', 'geodirectory'); ?></option>
3065 3065
                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'radio') {
3066 3066
                     echo 'selected="selected"';
3067
-                }?> value="radio"><?php _e('Radio', 'geodirectory');?></option>
3067
+                }?> value="radio"><?php _e('Radio', 'geodirectory'); ?></option>
3068 3068
             </select>
3069 3069
 
3070 3070
             <br/>
@@ -3075,21 +3075,21 @@  discard block
 block discarded – undo
3075 3075
     $output = ob_get_clean();
3076 3076
     return $output;
3077 3077
 }
3078
-add_filter('geodir_cfa_extra_fields_multiselect','geodir_cfa_extra_fields_multiselect',10,4);
3078
+add_filter('geodir_cfa_extra_fields_multiselect', 'geodir_cfa_extra_fields_multiselect', 10, 4);
3079 3079
 
3080 3080
 
3081
-function geodir_cfa_extra_fields_smr($output,$result_str,$cf,$field_info){
3081
+function geodir_cfa_extra_fields_smr($output, $result_str, $cf, $field_info) {
3082 3082
     ob_start();
3083 3083
     ?>
3084 3084
     <li>
3085 3085
         <label for="option_values" class="gd-cf-tooltip-wrap">
3086 3086
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Option Values :', 'geodirectory'); ?>
3087 3087
             <div class="gdcf-tooltip">
3088
-                <span><?php _e('Option Values should be separated by comma.', 'geodirectory');?></span>
3088
+                <span><?php _e('Option Values should be separated by comma.', 'geodirectory'); ?></span>
3089 3089
                 <br/>
3090
-                <small><span><?php _e('If using for a "tick filter" place a / and then either a 1 for true or 0 for false', 'geodirectory');?></span>
3090
+                <small><span><?php _e('If using for a "tick filter" place a / and then either a 1 for true or 0 for false', 'geodirectory'); ?></span>
3091 3091
                     <br/>
3092
-                    <span><?php _e('eg: "No Dogs Allowed/0,Dogs Allowed/1" (Select only, not multiselect)', 'geodirectory');?></span>
3092
+                    <span><?php _e('eg: "No Dogs Allowed/0,Dogs Allowed/1" (Select only, not multiselect)', 'geodirectory'); ?></span>
3093 3093
                     <?php if ($field_type == 'multiselect' || $field_type == 'select') { ?>
3094 3094
                         <br/>
3095 3095
                         <span><?php _e('- If using OPTGROUP tag to grouping options, use "{optgroup}OPTGROUP-LABEL|OPTION-1,OPTION-2{/optgroup}"', 'geodirectory'); ?></span>
@@ -3112,12 +3112,12 @@  discard block
 block discarded – undo
3112 3112
     $output = ob_get_clean();
3113 3113
     return $output;
3114 3114
 }
3115
-add_filter('geodir_cfa_extra_fields_multiselect','geodir_cfa_extra_fields_smr',10,4);
3116
-add_filter('geodir_cfa_extra_fields_select','geodir_cfa_extra_fields_smr',10,4);
3117
-add_filter('geodir_cfa_extra_fields_radio','geodir_cfa_extra_fields_smr',10,4);
3115
+add_filter('geodir_cfa_extra_fields_multiselect', 'geodir_cfa_extra_fields_smr', 10, 4);
3116
+add_filter('geodir_cfa_extra_fields_select', 'geodir_cfa_extra_fields_smr', 10, 4);
3117
+add_filter('geodir_cfa_extra_fields_radio', 'geodir_cfa_extra_fields_smr', 10, 4);
3118 3118
 
3119 3119
 
3120
-function geodir_cfa_extra_fields_datepicker($output,$result_str,$cf,$field_info){
3120
+function geodir_cfa_extra_fields_datepicker($output, $result_str, $cf, $field_info) {
3121 3121
     ob_start();
3122 3122
     if (isset($field_info->extra_fields) && $field_info->extra_fields != '') {
3123 3123
         $extra = unserialize($field_info->extra_fields);
@@ -3127,7 +3127,7 @@  discard block
 block discarded – undo
3127 3127
         <label for="date_format" class="gd-cf-tooltip-wrap">
3128 3128
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Date Format :', 'geodirectory'); ?>
3129 3129
             <div class="gdcf-tooltip">
3130
-                <?php _e('Select the date format.', 'geodirectory');?>
3130
+                <?php _e('Select the date format.', 'geodirectory'); ?>
3131 3131
             </div>
3132 3132
         </label>
3133 3133
         <div class="gd-cf-input-wrap" style="overflow:inherit;">
@@ -3147,16 +3147,16 @@  discard block
 block discarded – undo
3147 3147
              * @since 1.6.5
3148 3148
              * @param array $date_formats The PHP date format array.
3149 3149
              */
3150
-            $date_formats = apply_filters('geodir_date_formats',$date_formats);
3150
+            $date_formats = apply_filters('geodir_date_formats', $date_formats);
3151 3151
             ?>
3152 3152
             <select name="extra[date_format]" id="date_format">
3153 3153
                 <?php
3154
-                foreach($date_formats as $format){
3154
+                foreach ($date_formats as $format) {
3155 3155
                     $selected = '';
3156
-                    if(esc_attr($extra['date_format'])==$format){
3156
+                    if (esc_attr($extra['date_format']) == $format) {
3157 3157
                         $selected = "selected='selected'";
3158 3158
                     }
3159
-                    echo "<option $selected value='$format'>$format       (".date_i18n( $format, time()).")</option>";
3159
+                    echo "<option $selected value='$format'>$format       (".date_i18n($format, time()).")</option>";
3160 3160
                 }
3161 3161
                 ?>
3162 3162
             </select>
@@ -3168,10 +3168,10 @@  discard block
 block discarded – undo
3168 3168
     $output = ob_get_clean();
3169 3169
     return $output;
3170 3170
 }
3171
-add_filter('geodir_cfa_extra_fields_datepicker','geodir_cfa_extra_fields_datepicker',10,4);
3171
+add_filter('geodir_cfa_extra_fields_datepicker', 'geodir_cfa_extra_fields_datepicker', 10, 4);
3172 3172
 
3173 3173
 
3174
-function geodir_cfa_extra_fields_file($output,$result_str,$cf,$field_info){
3174
+function geodir_cfa_extra_fields_file($output, $result_str, $cf, $field_info) {
3175 3175
     ob_start();
3176 3176
     $allowed_file_types = geodir_allowed_mime_types();
3177 3177
 
@@ -3182,16 +3182,16 @@  discard block
 block discarded – undo
3182 3182
         <label for="gd_file_types" class="gd-cf-tooltip-wrap">
3183 3183
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Allowed file types :', 'geodirectory'); ?>
3184 3184
             <div class="gdcf-tooltip">
3185
-                <?php _e('Select file types to allowed for file uploading. (Select multiple file types by holding down "Ctrl" key.)', 'geodirectory');?>
3185
+                <?php _e('Select file types to allowed for file uploading. (Select multiple file types by holding down "Ctrl" key.)', 'geodirectory'); ?>
3186 3186
             </div>
3187 3187
         </label>
3188 3188
         <div class="gd-cf-input-wrap">
3189 3189
             <select name="extra[gd_file_types][]" id="gd_file_types" multiple="multiple" style="height:100px;width:90%;">
3190
-                <option value="*" <?php selected(true, in_array('*', $gd_file_types));?>><?php _e('All types', 'geodirectory') ;?></option>
3191
-                <?php foreach ( $allowed_file_types as $format => $types ) { ?>
3192
-                    <optgroup label="<?php echo esc_attr( wp_sprintf(__('%s formats', 'geodirectory'), __($format, 'geodirectory') ) ) ;?>">
3193
-                        <?php foreach ( $types as $ext => $type ) { ?>
3194
-                            <option value="<?php echo esc_attr($ext) ;?>" <?php selected(true, in_array($ext, $gd_file_types));?>><?php echo '.' . $ext ;?></option>
3190
+                <option value="*" <?php selected(true, in_array('*', $gd_file_types)); ?>><?php _e('All types', 'geodirectory'); ?></option>
3191
+                <?php foreach ($allowed_file_types as $format => $types) { ?>
3192
+                    <optgroup label="<?php echo esc_attr(wp_sprintf(__('%s formats', 'geodirectory'), __($format, 'geodirectory'))); ?>">
3193
+                        <?php foreach ($types as $ext => $type) { ?>
3194
+                            <option value="<?php echo esc_attr($ext); ?>" <?php selected(true, in_array($ext, $gd_file_types)); ?>><?php echo '.'.$ext; ?></option>
3195 3195
                         <?php } ?>
3196 3196
                     </optgroup>
3197 3197
                 <?php } ?>
@@ -3203,4 +3203,4 @@  discard block
 block discarded – undo
3203 3203
     $output = ob_get_clean();
3204 3204
     return $output;
3205 3205
 }
3206
-add_filter('geodir_cfa_extra_fields_file','geodir_cfa_extra_fields_file',10,4);
3207 3206
\ No newline at end of file
3207
+add_filter('geodir_cfa_extra_fields_file', 'geodir_cfa_extra_fields_file', 10, 4);
3208 3208
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +123 added lines, -82 removed lines patch added patch discarded remove patch
@@ -51,8 +51,9 @@  discard block
 block discarded – undo
51 51
         global $wpdb;
52 52
         $result = 0;// no rows affected
53 53
         if (!geodir_column_exist($db, $column)) {
54
-            if (!empty($db) && !empty($column))
55
-                $result = $wpdb->query("ALTER TABLE `$db` ADD `$column`  $column_attr");
54
+            if (!empty($db) && !empty($column)) {
55
+                            $result = $wpdb->query("ALTER TABLE `$db` ADD `$column`  $column_attr");
56
+            }
56 57
         }
57 58
         return $result;
58 59
     }
@@ -82,10 +83,11 @@  discard block
 block discarded – undo
82 83
 
83 84
     $default_query = '';
84 85
 
85
-    if ($default == 'default')
86
-        $default_query .= " and is_admin IN ('1') ";
87
-    elseif ($default == 'custom')
88
-        $default_query .= " and is_admin = '0' ";
86
+    if ($default == 'default') {
87
+            $default_query .= " and is_admin IN ('1') ";
88
+    } elseif ($default == 'custom') {
89
+            $default_query .= " and is_admin = '0' ";
90
+    }
89 91
 
90 92
     if ($fields_location == 'none') {
91 93
     } else{
@@ -239,10 +241,12 @@  discard block
 block discarded – undo
239 241
                 }
240 242
 
241 243
                 return $field_id;
242
-            } else
243
-                return 0;
244
-        } else
245
-            return 0;
244
+            } else {
245
+                            return 0;
246
+            }
247
+        } else {
248
+                    return 0;
249
+        }
246 250
     }
247 251
 }
248 252
 
@@ -349,7 +353,9 @@  discard block
 block discarded – undo
349 353
 
350 354
 
351 355
 
352
-            if ($post_type == '') $post_type = 'gd_place';
356
+            if ($post_type == '') {
357
+            	$post_type = 'gd_place';
358
+            }
353 359
 
354 360
 
355 361
             $detail_table = $plugin_prefix . $post_type . '_detail';
@@ -389,16 +395,17 @@  discard block
 block discarded – undo
389 395
             }
390 396
 
391 397
             $option_values = '';
392
-            if (isset($request_field['option_values']))
393
-                $option_values = $request_field['option_values'];
398
+            if (isset($request_field['option_values'])) {
399
+                            $option_values = $request_field['option_values'];
400
+            }
394 401
 
395 402
             $cat_sort = isset($request_field['cat_sort']) ? $request_field['cat_sort'] : '0';
396 403
 
397 404
             $cat_filter = isset($request_field['cat_filter']) ? $request_field['cat_filter'] : '0';
398 405
 
399
-            if (isset($request_field['show_on_pkg']) && !empty($request_field['show_on_pkg']))
400
-                $price_pkg = implode(",", $request_field['show_on_pkg']);
401
-            else {
406
+            if (isset($request_field['show_on_pkg']) && !empty($request_field['show_on_pkg'])) {
407
+                            $price_pkg = implode(",", $request_field['show_on_pkg']);
408
+            } else {
402 409
                 $package_info = array();
403 410
 
404 411
                 $package_info = geodir_post_package_info($package_info, '', $post_type);
@@ -406,22 +413,29 @@  discard block
 block discarded – undo
406 413
             }
407 414
 
408 415
 
409
-            if (isset($request_field['extra']) && !empty($request_field['extra']))
410
-                $extra_fields = $request_field['extra'];
416
+            if (isset($request_field['extra']) && !empty($request_field['extra'])) {
417
+                            $extra_fields = $request_field['extra'];
418
+            }
411 419
 
412
-            if (isset($request_field['is_default']) && $request_field['is_default'] != '')
413
-                $is_default = $request_field['is_default'];
414
-            else
415
-                $is_default = '0';
420
+            if (isset($request_field['is_default']) && $request_field['is_default'] != '') {
421
+                            $is_default = $request_field['is_default'];
422
+            } else {
423
+                            $is_default = '0';
424
+            }
416 425
 
417
-            if (isset($request_field['is_admin']) && $request_field['is_admin'] != '')
418
-                $is_admin = $request_field['is_admin'];
419
-            else
420
-                $is_admin = '0';
426
+            if (isset($request_field['is_admin']) && $request_field['is_admin'] != '') {
427
+                            $is_admin = $request_field['is_admin'];
428
+            } else {
429
+                            $is_admin = '0';
430
+            }
421 431
 
422 432
 
423
-            if ($is_active == '') $is_active = 1;
424
-            if ($is_required == '') $is_required = 0;
433
+            if ($is_active == '') {
434
+            	$is_active = 1;
435
+            }
436
+            if ($is_required == '') {
437
+            	$is_required = 0;
438
+            }
425 439
 
426 440
 
427 441
             if ($sort_order == '') {
@@ -690,7 +704,7 @@  discard block
 block discarded – undo
690 704
                                 }
691 705
                                 if($op_max){$op_size =$op_max; }
692 706
                             }
693
-                        }elseif(isset($option_values) && $option_values && $field_type=='multiselect'){
707
+                        } elseif(isset($option_values) && $option_values && $field_type=='multiselect'){
694 708
                             if(strlen($option_values)){
695 709
                                 $op_size =  strlen($option_values);
696 710
                             }
@@ -707,11 +721,13 @@  discard block
 block discarded – undo
707 721
                             return __('Column change failed, you may have too many columns.','geodirectory');
708 722
                         }
709 723
 
710
-                        if (isset($request_field['cat_display_type']))
711
-                            $extra_fields = $request_field['cat_display_type'];
724
+                        if (isset($request_field['cat_display_type'])) {
725
+                                                    $extra_fields = $request_field['cat_display_type'];
726
+                        }
712 727
 
713
-                        if (isset($request_field['multi_display_type']))
714
-                            $extra_fields = $request_field['multi_display_type'];
728
+                        if (isset($request_field['multi_display_type'])) {
729
+                                                    $extra_fields = $request_field['multi_display_type'];
730
+                        }
715 731
 
716 732
 
717 733
                         break;
@@ -725,8 +741,9 @@  discard block
 block discarded – undo
725 741
                         if($alter_result===false){
726 742
                             return __('Column change failed, you may have too many columns.','geodirectory');
727 743
                         }
728
-                        if (isset($request_field['advanced_editor']))
729
-                            $extra_fields = $request_field['advanced_editor'];
744
+                        if (isset($request_field['advanced_editor'])) {
745
+                                                    $extra_fields = $request_field['advanced_editor'];
746
+                        }
730 747
 
731 748
                         break;
732 749
 
@@ -822,8 +839,9 @@  discard block
 block discarded – undo
822 839
                 );
823 840
 
824 841
 
825
-                if ($cat_sort == '')
826
-                    $wpdb->query($wpdb->prepare("delete from " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " where post_type = %s and htmlvar_name = %s", array($post_type, $htmlvar_name)));
842
+                if ($cat_sort == '') {
843
+                                    $wpdb->query($wpdb->prepare("delete from " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " where post_type = %s and htmlvar_name = %s", array($post_type, $htmlvar_name)));
844
+                }
827 845
 
828 846
 
829 847
                 /**
@@ -1193,8 +1211,10 @@  discard block
 block discarded – undo
1193 1211
         }
1194 1212
 
1195 1213
         return $post_meta_info;
1196
-    else:
1197
-        return false;
1214
+    else {
1215
+    	:
1216
+        return false;
1217
+    }
1198 1218
     endif;
1199 1219
 }
1200 1220
 
@@ -1205,8 +1225,9 @@  discard block
 block discarded – undo
1205 1225
     if (is_admin()) {
1206 1226
         global $post,$gd_session;
1207 1227
 
1208
-        if (isset($_REQUEST['post']))
1209
-            $_REQUEST['pid'] = $_REQUEST['post'];
1228
+        if (isset($_REQUEST['post'])) {
1229
+                    $_REQUEST['pid'] = $_REQUEST['post'];
1230
+        }
1210 1231
     }
1211 1232
 
1212 1233
     if (isset($_REQUEST['backandedit']) && $_REQUEST['backandedit'] && $gd_ses_listing = $gd_session->get('listing')) {
@@ -1259,8 +1280,9 @@  discard block
 block discarded – undo
1259 1280
         if (is_admin()) {
1260 1281
             global $post;
1261 1282
 
1262
-            if (isset($_REQUEST['post']))
1263
-                $_REQUEST['pid'] = $_REQUEST['post'];
1283
+            if (isset($_REQUEST['post'])) {
1284
+                            $_REQUEST['pid'] = $_REQUEST['post'];
1285
+            }
1264 1286
         }
1265 1287
 
1266 1288
         
@@ -1352,7 +1374,7 @@  discard block
 block discarded – undo
1352 1374
         $field_icon = ' background: url(' . $cf['field_icon'] . ') no-repeat left center;background-size:18px 18px;padding-left: 21px;';
1353 1375
     } elseif (strpos($cf['field_icon'], 'fa fa-') !== false) {
1354 1376
         $field_icon = '<i class="' . $cf['field_icon'] . '"></i>';
1355
-    }else{
1377
+    } else{
1356 1378
         $field_icon = $cf['field_icon'];
1357 1379
     }
1358 1380
 
@@ -1425,8 +1447,9 @@  discard block
 block discarded – undo
1425 1447
                     $variables_array['post_id'] = $post->ID;
1426 1448
                     $variables_array['label'] = __($type['site_title'], 'geodirectory');
1427 1449
                     $variables_array['value'] = '';
1428
-                    if (isset($post->{$type['htmlvar_name']}))
1429
-                        $variables_array['value'] = $post->{$type['htmlvar_name']};
1450
+                    if (isset($post->{$type['htmlvar_name']})) {
1451
+                                            $variables_array['value'] = $post->{$type['htmlvar_name']};
1452
+                    }
1430 1453
                 endif;
1431 1454
 
1432 1455
 
@@ -1449,7 +1472,9 @@  discard block
 block discarded – undo
1449 1472
                      * @param string $html Custom field unfiltered HTML.
1450 1473
                      * @param array $variables_array Custom field variables array.
1451 1474
                      */
1452
-                    if ($html) echo apply_filters("geodir_show_{$html_var}", $html, $variables_array);
1475
+                    if ($html) {
1476
+                    	echo apply_filters("geodir_show_{$html_var}", $html, $variables_array);
1477
+                    }
1453 1478
 
1454 1479
                     /**
1455 1480
                      * Called after a custom fields is output on the frontend.
@@ -1483,10 +1508,11 @@  discard block
 block discarded – undo
1483 1508
      */
1484 1509
     function geodir_default_date_format()
1485 1510
     {
1486
-        if ($format = get_option('date_format'))
1487
-            return $format;
1488
-        else
1489
-            return 'dd-mm-yy';
1511
+        if ($format = get_option('date_format')) {
1512
+                    return $format;
1513
+        } else {
1514
+                    return 'dd-mm-yy';
1515
+        }
1490 1516
     }
1491 1517
 }
1492 1518
 
@@ -1593,11 +1619,13 @@  discard block
 block discarded – undo
1593 1619
                     // Set an array containing a list of acceptable formats
1594 1620
                     //$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');
1595 1621
 
1596
-                    if (!function_exists('wp_handle_upload'))
1597
-                        require_once(ABSPATH . 'wp-admin/includes/file.php');
1622
+                    if (!function_exists('wp_handle_upload')) {
1623
+                                            require_once(ABSPATH . 'wp-admin/includes/file.php');
1624
+                    }
1598 1625
 
1599
-                    if (!is_dir($geodir_uploadpath))
1600
-                        mkdir($geodir_uploadpath);
1626
+                    if (!is_dir($geodir_uploadpath)) {
1627
+                                            mkdir($geodir_uploadpath);
1628
+                    }
1601 1629
 
1602 1630
                     $new_name = $post_id . '_' . $field_id . '_' . $img_name_arr[0] . '.' . $img_name_arr[1];
1603 1631
                     $explode_sub_dir = explode("/", $sub_dir);
@@ -1610,16 +1638,19 @@  discard block
 block discarded – undo
1610 1638
                     }
1611 1639
 
1612 1640
                     $uploaded_file = '';
1613
-                    if (file_exists($img_path))
1614
-                        $uploaded_file = copy($img_path, $geodir_uploadpath . '/' . $new_name);
1641
+                    if (file_exists($img_path)) {
1642
+                                            $uploaded_file = copy($img_path, $geodir_uploadpath . '/' . $new_name);
1643
+                    }
1615 1644
 
1616 1645
                     if ($curr_img_dir != $geodir_uploaddir) {
1617
-                        if (file_exists($img_path))
1618
-                            unlink($img_path);
1646
+                        if (file_exists($img_path)) {
1647
+                                                    unlink($img_path);
1648
+                        }
1619 1649
                     }
1620 1650
 
1621
-                    if (!empty($uploaded_file))
1622
-                        $file_urls = $geodir_uploadurl . '/' . $new_name;
1651
+                    if (!empty($uploaded_file)) {
1652
+                                            $file_urls = $geodir_uploadurl . '/' . $new_name;
1653
+                    }
1623 1654
 
1624 1655
                 } else {
1625 1656
                     $file_urls = $post_image[$m];
@@ -1640,8 +1671,9 @@  discard block
 block discarded – undo
1640 1671
 
1641 1672
         geodir_save_post_meta($post_id, $field_id, $file_urls);
1642 1673
 
1643
-        if (!empty($invalid_files))
1644
-            geodir_remove_attachments($invalid_files);
1674
+        if (!empty($invalid_files)) {
1675
+                    geodir_remove_attachments($invalid_files);
1676
+        }
1645 1677
 
1646 1678
     }
1647 1679
 }
@@ -1867,8 +1899,9 @@  discard block
 block discarded – undo
1867 1899
 
1868 1900
         $all_postypes = geodir_get_posttypes();
1869 1901
 
1870
-        if (!in_array($post_type, $all_postypes))
1871
-            return false;
1902
+        if (!in_array($post_type, $all_postypes)) {
1903
+                    return false;
1904
+        }
1872 1905
 
1873 1906
         $fields = array();
1874 1907
 
@@ -1966,8 +1999,10 @@  discard block
 block discarded – undo
1966 1999
         }
1967 2000
 
1968 2001
         return $field_ids;
1969
-    else:
1970
-        return false;
2002
+    else {
2003
+    	:
2004
+        return false;
2005
+    }
1971 2006
     endif;
1972 2007
 }
1973 2008
 
@@ -2140,8 +2175,9 @@  discard block
 block discarded – undo
2140 2175
 
2141 2176
             return $field_id;
2142 2177
 
2143
-        } else
2144
-            return 0;
2178
+        } else {
2179
+                    return 0;
2180
+        }
2145 2181
 
2146 2182
     }
2147 2183
 }
@@ -2182,8 +2218,9 @@  discard block
 block discarded – undo
2182 2218
         $htmlvar_name = isset($field_type_key) ? $field_type_key : '';
2183 2219
 
2184 2220
         $site_title = '';
2185
-        if ($site_title == '')
2186
-            $site_title = isset($field_info->site_title) ? $field_info->site_title : '';
2221
+        if ($site_title == '') {
2222
+                    $site_title = isset($field_info->site_title) ? $field_info->site_title : '';
2223
+        }
2187 2224
 
2188 2225
         if ($site_title == '') {
2189 2226
             $fields = geodir_get_custom_sort_options($post_type);
@@ -2197,8 +2234,9 @@  discard block
 block discarded – undo
2197 2234
             }
2198 2235
         }
2199 2236
 
2200
-        if ($htmlvar_name == '')
2201
-            $htmlvar_name = isset($field_info->htmlvar_name) ? $field_info->htmlvar_name : '';
2237
+        if ($htmlvar_name == '') {
2238
+                    $htmlvar_name = isset($field_info->htmlvar_name) ? $field_info->htmlvar_name : '';
2239
+        }
2202 2240
 
2203 2241
         $nonce = wp_create_nonce('custom_fields_' . $result_str);
2204 2242
 
@@ -2211,7 +2249,7 @@  discard block
 block discarded – undo
2211 2249
 
2212 2250
                 if (isset($cso['field_icon']) && strpos($cso['field_icon'], 'fa fa-') !== false) {
2213 2251
                     $field_icon = '<i class="'.$cso['field_icon'].'" aria-hidden="true"></i>';
2214
-                }elseif(isset($cso['field_icon']) && $cso['field_icon']){
2252
+                } elseif(isset($cso['field_icon']) && $cso['field_icon']){
2215 2253
                     $field_icon = '<b style="background-image: url("'.$cso['field_icon'].'")"></b>';
2216 2254
                 }
2217 2255
 
@@ -2736,11 +2774,13 @@  discard block
 block discarded – undo
2736 2774
 
2737 2775
             <?php
2738 2776
             $selected = '';
2739
-            if (isset($field_info->extra_fields))
2740
-                $advanced_editor = unserialize($field_info->extra_fields);
2777
+            if (isset($field_info->extra_fields)) {
2778
+                            $advanced_editor = unserialize($field_info->extra_fields);
2779
+            }
2741 2780
 
2742
-            if (!empty($advanced_editor) && is_array($advanced_editor) && in_array('1', $advanced_editor))
2743
-                $selected = 'checked="checked"';
2781
+            if (!empty($advanced_editor) && is_array($advanced_editor) && in_array('1', $advanced_editor)) {
2782
+                            $selected = 'checked="checked"';
2783
+            }
2744 2784
             ?>
2745 2785
 
2746 2786
             <input type="checkbox" name="advanced_editor[]" id="advanced_editor"
@@ -2762,7 +2802,7 @@  discard block
 block discarded – undo
2762 2802
     $value = '';
2763 2803
     if (isset($field_info->validation_pattern)) {
2764 2804
         $value = esc_attr($field_info->validation_pattern);
2765
-    }elseif(isset($cf['defaults']['validation_pattern']) && $cf['defaults']['validation_pattern']){
2805
+    } elseif(isset($cf['defaults']['validation_pattern']) && $cf['defaults']['validation_pattern']){
2766 2806
         $value = esc_attr($cf['defaults']['validation_pattern']);
2767 2807
     }
2768 2808
     ?>
@@ -2782,7 +2822,7 @@  discard block
 block discarded – undo
2782 2822
     $value = '';
2783 2823
     if (isset($field_info->validation_msg)) {
2784 2824
         $value = esc_attr($field_info->validation_msg);
2785
-    }elseif(isset($cf['defaults']['validation_msg']) && $cf['defaults']['validation_msg']){
2825
+    } elseif(isset($cf['defaults']['validation_msg']) && $cf['defaults']['validation_msg']){
2786 2826
         $value = esc_attr($cf['defaults']['validation_msg']);
2787 2827
     }
2788 2828
     ?>
@@ -2812,8 +2852,9 @@  discard block
 block discarded – undo
2812 2852
 
2813 2853
     if (!isset($field_info->post_type)) {
2814 2854
         $post_type = sanitize_text_field($_REQUEST['listing_type']);
2815
-    } else
2816
-        $post_type = $field_info->post_type;
2855
+    } else {
2856
+            $post_type = $field_info->post_type;
2857
+    }
2817 2858
     ?>
2818 2859
     <li style="display: none;">
2819 2860
         <label for="htmlvar_name" class="gd-cf-tooltip-wrap">
Please login to merge, or discard this patch.
geodirectory-functions/ajax_handler_functions.php 3 patches
Indentation   +295 added lines, -295 removed lines patch added patch discarded remove patch
@@ -16,22 +16,22 @@  discard block
 block discarded – undo
16 16
  */
17 17
 function geodir_on_wp_loaded()
18 18
 {
19
-    /**
20
-     * Called on the wp_loaded WP hook and used to send the send inquiry and send to friend forms.
21
-     *
22
-     * @since 1.0.0
23
-     */
24
-    do_action('giodir_handle_request_plugins_loaded');
25
-    global $wpdb;
19
+	/**
20
+	 * Called on the wp_loaded WP hook and used to send the send inquiry and send to friend forms.
21
+	 *
22
+	 * @since 1.0.0
23
+	 */
24
+	do_action('giodir_handle_request_plugins_loaded');
25
+	global $wpdb;
26 26
 
27 27
 
28
-    if (isset($_POST['sendact']) && $_POST['sendact'] == 'send_inqury') {
29
-        geodir_send_inquiry($_REQUEST); // function in custom_functions.php
28
+	if (isset($_POST['sendact']) && $_POST['sendact'] == 'send_inqury') {
29
+		geodir_send_inquiry($_REQUEST); // function in custom_functions.php
30 30
 
31
-    } elseif (isset($_POST['sendact']) && $_POST['sendact'] == 'email_frnd') {
32
-        geodir_send_friend($_REQUEST); // function in custom_functions.php
31
+	} elseif (isset($_POST['sendact']) && $_POST['sendact'] == 'email_frnd') {
32
+		geodir_send_friend($_REQUEST); // function in custom_functions.php
33 33
 
34
-    }
34
+	}
35 35
 
36 36
 }
37 37
 
@@ -44,9 +44,9 @@  discard block
 block discarded – undo
44 44
  */
45 45
 function geodir_on_wp()
46 46
 {
47
-    if(geodir_is_page('login')) {
48
-        geodir_user_signup();
49
-    }
47
+	if(geodir_is_page('login')) {
48
+		geodir_user_signup();
49
+	}
50 50
 
51 51
 }
52 52
 
@@ -59,47 +59,47 @@  discard block
 block discarded – undo
59 59
  */
60 60
 function geodir_on_init()
61 61
 {
62
-    /**
63
-     * Called on the wp_init WP hook at the start of the geodir_on_init() function.
64
-     *
65
-     * @since 1.0.0
66
-     */
67
-    do_action('giodir_handle_request');
68
-    global $wpdb;
69
-
70
-
71
-
72
-
73
-    if (get_option('geodir_allow_wpadmin') == '0' && is_user_logged_in() && !current_user_can('manage_options') && !class_exists('BuddyPress')) {
74
-        show_admin_bar(false);
75
-    }
76
-
77
-
78
-    if (isset($_REQUEST['ptype']) && $_REQUEST['ptype'] == 'get_markers') {
79
-        /**
80
-         * Contains map marker functions.
81
-         *
82
-         * @since 1.0.0
83
-         * @package GeoDirectory
84
-         */
85
-        include_once(geodir_plugin_path() . '/geodirectory-functions/map-functions/get_markers.php');
86
-        die;
87
-    }
88
-
89
-    if (isset($_REQUEST['ptype']) && $_REQUEST['ptype'] == 'ga') {
90
-        if (isset($_REQUEST['ga_start'])) {
91
-            $ga_start = $_REQUEST['ga_start'];
92
-        } else {
93
-            $ga_start = '';
94
-        }
95
-        if (isset($_REQUEST['ga_end'])) {
96
-            $ga_end = $_REQUEST['ga_end'];
97
-        } else {
98
-            $ga_end = '';
99
-        }
100
-        geodir_getGoogleAnalytics($_REQUEST['ga_page'], $ga_start, $ga_end);
101
-        die;
102
-    }
62
+	/**
63
+	 * Called on the wp_init WP hook at the start of the geodir_on_init() function.
64
+	 *
65
+	 * @since 1.0.0
66
+	 */
67
+	do_action('giodir_handle_request');
68
+	global $wpdb;
69
+
70
+
71
+
72
+
73
+	if (get_option('geodir_allow_wpadmin') == '0' && is_user_logged_in() && !current_user_can('manage_options') && !class_exists('BuddyPress')) {
74
+		show_admin_bar(false);
75
+	}
76
+
77
+
78
+	if (isset($_REQUEST['ptype']) && $_REQUEST['ptype'] == 'get_markers') {
79
+		/**
80
+		 * Contains map marker functions.
81
+		 *
82
+		 * @since 1.0.0
83
+		 * @package GeoDirectory
84
+		 */
85
+		include_once(geodir_plugin_path() . '/geodirectory-functions/map-functions/get_markers.php');
86
+		die;
87
+	}
88
+
89
+	if (isset($_REQUEST['ptype']) && $_REQUEST['ptype'] == 'ga') {
90
+		if (isset($_REQUEST['ga_start'])) {
91
+			$ga_start = $_REQUEST['ga_start'];
92
+		} else {
93
+			$ga_start = '';
94
+		}
95
+		if (isset($_REQUEST['ga_end'])) {
96
+			$ga_end = $_REQUEST['ga_end'];
97
+		} else {
98
+			$ga_end = '';
99
+		}
100
+		geodir_getGoogleAnalytics($_REQUEST['ga_page'], $ga_start, $ga_end);
101
+		die;
102
+	}
103 103
 
104 104
 
105 105
 }
@@ -118,245 +118,245 @@  discard block
 block discarded – undo
118 118
  * @todo check if nonce is required here and if so add one.
119 119
  */
120 120
 function geodir_ajax_handler() {
121
-    global $wpdb, $gd_session;
121
+	global $wpdb, $gd_session;
122 122
 
123
-    if (isset($_REQUEST['gd_listing_view']) && $_REQUEST['gd_listing_view'] != '') {
123
+	if (isset($_REQUEST['gd_listing_view']) && $_REQUEST['gd_listing_view'] != '') {
124 124
 		$gd_session->set('gd_listing_view', $_REQUEST['gd_listing_view']);
125
-        echo '1';
126
-    }
127
-
128
-    if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'category_ajax') {
129
-        if (isset($_REQUEST['main_catid']) && isset($_REQUEST['cat_tax']) && isset($_REQUEST['exclude']))
130
-            geodir_addpost_categories_html($_REQUEST['cat_tax'], $_REQUEST['main_catid'], '', '', '', $_REQUEST['exclude']);
131
-        else if (isset($_REQUEST['catpid']) && isset($_REQUEST['cat_tax']))
132
-            geodir_editpost_categories_html($_REQUEST['cat_tax'], $_REQUEST['catpid']);
133
-    }
134
-
135
-    if ((isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'admin_ajax') || isset($_REQUEST['create_field']) || isset($_REQUEST['sort_create_field'])) {
136
-        if (current_user_can('manage_options')) {
137
-            /**
138
-             * Contains admin ajax handling functions.
139
-             *
140
-             * @since 1.0.0
141
-             * @package GeoDirectory
142
-             */
143
-            include_once(geodir_plugin_path() . '/geodirectory-admin/geodir_admin_ajax.php');
144
-        } else {
145
-            wp_redirect(geodir_login_url());
146
-            gd_die();
147
-        }
148
-    }
149
-
150
-    if (isset($_REQUEST['geodir_autofill']) && $_REQUEST['geodir_autofill'] != '' && isset($_REQUEST['_wpnonce'])) {
151
-        if (current_user_can('manage_options')) {
152
-            switch ($_REQUEST['geodir_autofill']):
153
-                case "geodir_dummy_delete" :
154
-                    if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'geodir_dummy_posts_delete_noncename'))
155
-                        return;
156
-
157
-                    if (isset($_REQUEST['posttype']))
158
-                        /**
159
-                         * Used to delete the dummy post data per post type.
160
-                         *
161
-                         * Uses dynamic hook, geodir_delete_dummy_posts_$_REQUEST['posttype'].
162
-                         *
163
-                         * @since 1.0.0
164
-                         */
165
-                        do_action('geodir_delete_dummy_posts_' . $_REQUEST['posttype']);
166
-                    break;
167
-                case "geodir_dummy_insert" :
168
-                    if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'geodir_dummy_posts_insert_noncename'))
169
-                        return;
170
-
171
-                    global $dummy_post_index, $city_bound_lat1, $city_bound_lng1, $city_bound_lat2, $city_bound_lng2;
172
-                    $dummy_post_index = $_REQUEST['insert_dummy_post_index'];
173
-                    $city_bound_lat1 = $_REQUEST['city_bound_lat1'];
174
-                    $city_bound_lng1 = $_REQUEST['city_bound_lng1'];
175
-                    $city_bound_lat2 = $_REQUEST['city_bound_lat2'];
176
-                    $city_bound_lng2 = $_REQUEST['city_bound_lng2'];
177
-
178
-                    if (isset($_REQUEST['posttype']))
179
-                        /**
180
-                         * Used to insert the dummy post data per post type.
181
-                         *
182
-                         * Uses dynamic hook, geodir_insert_dummy_posts_$_REQUEST['posttype'].
183
-                         *
184
-                         * @since 1.0.0
185
-                         */
186
-                        do_action('geodir_insert_dummy_posts_' . $_REQUEST['posttype']);
187
-
188
-                    break;
189
-            endswitch;
190
-        } else {
191
-            wp_redirect(geodir_login_url());
192
-            exit();
193
-        }
194
-    }
195
-
196
-    if (isset($_REQUEST['popuptype']) && $_REQUEST['popuptype'] != '' && isset($_REQUEST['post_id']) && $_REQUEST['post_id'] != '') {
197
-
198
-        if ($_REQUEST['popuptype'] == 'b_send_inquiry' || $_REQUEST['popuptype'] == 'b_sendtofriend') {
199
-            $template = locate_template(array("geodirectory/popup-forms.php"));
200
-            if (!$template) {
201
-                $template = geodir_plugin_path() . '/geodirectory-templates/popup-forms.php';
202
-            }
203
-            require_once($template);
204
-        }
205
-
206
-        gd_die();
207
-    }
208
-
209
-    /*if(isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'filter_ajax'){
125
+		echo '1';
126
+	}
127
+
128
+	if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'category_ajax') {
129
+		if (isset($_REQUEST['main_catid']) && isset($_REQUEST['cat_tax']) && isset($_REQUEST['exclude']))
130
+			geodir_addpost_categories_html($_REQUEST['cat_tax'], $_REQUEST['main_catid'], '', '', '', $_REQUEST['exclude']);
131
+		else if (isset($_REQUEST['catpid']) && isset($_REQUEST['cat_tax']))
132
+			geodir_editpost_categories_html($_REQUEST['cat_tax'], $_REQUEST['catpid']);
133
+	}
134
+
135
+	if ((isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'admin_ajax') || isset($_REQUEST['create_field']) || isset($_REQUEST['sort_create_field'])) {
136
+		if (current_user_can('manage_options')) {
137
+			/**
138
+			 * Contains admin ajax handling functions.
139
+			 *
140
+			 * @since 1.0.0
141
+			 * @package GeoDirectory
142
+			 */
143
+			include_once(geodir_plugin_path() . '/geodirectory-admin/geodir_admin_ajax.php');
144
+		} else {
145
+			wp_redirect(geodir_login_url());
146
+			gd_die();
147
+		}
148
+	}
149
+
150
+	if (isset($_REQUEST['geodir_autofill']) && $_REQUEST['geodir_autofill'] != '' && isset($_REQUEST['_wpnonce'])) {
151
+		if (current_user_can('manage_options')) {
152
+			switch ($_REQUEST['geodir_autofill']):
153
+				case "geodir_dummy_delete" :
154
+					if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'geodir_dummy_posts_delete_noncename'))
155
+						return;
156
+
157
+					if (isset($_REQUEST['posttype']))
158
+						/**
159
+						 * Used to delete the dummy post data per post type.
160
+						 *
161
+						 * Uses dynamic hook, geodir_delete_dummy_posts_$_REQUEST['posttype'].
162
+						 *
163
+						 * @since 1.0.0
164
+						 */
165
+						do_action('geodir_delete_dummy_posts_' . $_REQUEST['posttype']);
166
+					break;
167
+				case "geodir_dummy_insert" :
168
+					if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'geodir_dummy_posts_insert_noncename'))
169
+						return;
170
+
171
+					global $dummy_post_index, $city_bound_lat1, $city_bound_lng1, $city_bound_lat2, $city_bound_lng2;
172
+					$dummy_post_index = $_REQUEST['insert_dummy_post_index'];
173
+					$city_bound_lat1 = $_REQUEST['city_bound_lat1'];
174
+					$city_bound_lng1 = $_REQUEST['city_bound_lng1'];
175
+					$city_bound_lat2 = $_REQUEST['city_bound_lat2'];
176
+					$city_bound_lng2 = $_REQUEST['city_bound_lng2'];
177
+
178
+					if (isset($_REQUEST['posttype']))
179
+						/**
180
+						 * Used to insert the dummy post data per post type.
181
+						 *
182
+						 * Uses dynamic hook, geodir_insert_dummy_posts_$_REQUEST['posttype'].
183
+						 *
184
+						 * @since 1.0.0
185
+						 */
186
+						do_action('geodir_insert_dummy_posts_' . $_REQUEST['posttype']);
187
+
188
+					break;
189
+			endswitch;
190
+		} else {
191
+			wp_redirect(geodir_login_url());
192
+			exit();
193
+		}
194
+	}
195
+
196
+	if (isset($_REQUEST['popuptype']) && $_REQUEST['popuptype'] != '' && isset($_REQUEST['post_id']) && $_REQUEST['post_id'] != '') {
197
+
198
+		if ($_REQUEST['popuptype'] == 'b_send_inquiry' || $_REQUEST['popuptype'] == 'b_sendtofriend') {
199
+			$template = locate_template(array("geodirectory/popup-forms.php"));
200
+			if (!$template) {
201
+				$template = geodir_plugin_path() . '/geodirectory-templates/popup-forms.php';
202
+			}
203
+			require_once($template);
204
+		}
205
+
206
+		gd_die();
207
+	}
208
+
209
+	/*if(isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'filter_ajax'){
210 210
         include_once ( geodir_plugin_path() . '/geodirectory-templates/advance-search-form.php');
211 211
     }*/
212 212
 
213
-    if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'map_ajax') {
214
-        /**
215
-         * Contains map marker functions.
216
-         *
217
-         * @since 1.0.0
218
-         * @package GeoDirectory
219
-         */
220
-        include_once(geodir_plugin_path() . '/geodirectory-functions/map-functions/get_markers.php');
221
-    }
222
-
223
-    if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'favorite') {
224
-        if (is_user_logged_in()) {
225
-            switch ($_REQUEST['ajax_action']):
226
-                case "add" :
227
-                    geodir_add_to_favorite((int)$_REQUEST['pid']);
228
-                    break;
229
-                case "remove" :
230
-                    geodir_remove_from_favorite((int)$_REQUEST['pid']);
231
-                    break;
232
-            endswitch;
233
-        } else {
234
-            wp_redirect(geodir_login_url());
235
-            exit();
236
-        }
237
-    }
238
-
239
-    if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'add_listing') {
240
-
241
-        $is_current_user_owner = true;
242
-        if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
243
-            $is_current_user_owner = geodir_listing_belong_to_current_user((int)$_REQUEST['pid']);
244
-        }
245
-
246
-        $request = $gd_session->get('listing');
247
-
248
-        if (is_user_logged_in() && $is_current_user_owner) {
249
-
250
-            switch ($_REQUEST['ajax_action']):
251
-                case "add":
252
-                case "update":
253
-
254
-                    if (isset($request['geodir_spamblocker']) && $request['geodir_spamblocker'] == '64' && isset($request['geodir_filled_by_spam_bot']) && $request['geodir_filled_by_spam_bot'] == '') {
255
-                        $last_id = geodir_save_listing();
256
-
257
-                        if ($last_id) {
258
-                            //$redirect_to = get_permalink( $last_id );
259
-                            $redirect_to = geodir_getlink(get_permalink(geodir_success_page_id()), array('pid' => $last_id));
260
-
261
-                        } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
262
-                            $redirect_to = get_permalink(geodir_add_listing_page_id());
263
-                            $redirect_to = geodir_getlink($redirect_to, array('pid' => $post->pid), false);
264
-                        } else
265
-                            $redirect_to = get_permalink(geodir_add_listing_page_id());
266
-
267
-                        wp_redirect($redirect_to);
268
-                    } else {
269
-                        $gd_session->un_set('listing');
270
-                        wp_redirect(home_url());
271
-                    }
272
-
273
-                    break;
274
-                case "cancel" :
275
-
276
-                    $gd_session->un_set('listing');
277
-
278
-                    if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '' && get_permalink($_REQUEST['pid']))
279
-                        wp_redirect(get_permalink($_REQUEST['pid']));
280
-                    else {
281
-                        geodir_remove_temp_images();
282
-                        wp_redirect(geodir_getlink(get_permalink(geodir_add_listing_page_id()), array('listing_type' => $_REQUEST['listing_type'])));
283
-                    }
284
-
285
-                    break;
286
-
287
-                case "publish" :
288
-
289
-                    if (isset($request['geodir_spamblocker']) && $request['geodir_spamblocker'] == '64' && isset($request['geodir_filled_by_spam_bot']) && $request['geodir_filled_by_spam_bot'] == '') {
290
-
291
-                        if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
292
-                            $new_post = array();
293
-                            $new_post['ID'] = $_REQUEST['pid'];
294
-
295
-                            $lastid = wp_update_post($new_post);
296
-
297
-                            $gd_session->un_set('listing');
298
-                            wp_redirect(get_permalink($lastid));
299
-                        } else {
300
-                            $last_id = geodir_save_listing();
301
-
302
-                            if ($last_id) {
303
-                                //$redirect_to = get_permalink( $last_id );
304
-                                $redirect_to = geodir_getlink(get_permalink(geodir_success_page_id()), array('pid' => $last_id));
305
-                            } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
306
-                                $redirect_to = get_permalink(geodir_add_listing_page_id());
307
-                                $redirect_to = geodir_getlink($redirect_to, array('pid' => $post->pid), false);
308
-                            } else
309
-                                $redirect_to = get_permalink(geodir_add_listing_page_id());
310
-
311
-                            $gd_session->un_set('listing');
312
-                            wp_redirect($redirect_to);
313
-                        }
314
-                    } else {
315
-                        $gd_session->un_set('listing');
316
-                        wp_redirect(home_url());
317
-                    }
318
-
319
-                    break;
320
-                case "delete" :
321
-                    if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
322
-                        global $current_user;
323
-
324
-                        if (get_option('geodir_disable_perm_delete')) {
325
-                            $lastid = wp_trash_post($_REQUEST['pid']);
326
-                        } else {
327
-                            $lastid = wp_delete_post($_REQUEST['pid']);
328
-                        }
329
-
330
-                        if ($lastid && !is_wp_error($lastid))
331
-                            wp_redirect($_SERVER['HTTP_REFERER']);
332
-
333
-                        //wp_redirect( geodir_getlink(get_author_posts_url($current_user->ID),array('geodir_dashbord'=>'true','stype'=>$post_type ),false) );
334
-                    }
335
-                    break;
336
-            endswitch;
337
-
338
-            $gd_session->un_set('listing');
339
-        } else {
340
-            $gd_session->un_set('listing');
341
-            wp_redirect(geodir_login_url());
342
-            exit();
343
-        }
344
-    }
345
-
346
-    if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'user_login') {
347
-        /**
348
-         * Contains registration and login functions.
349
-         * @todo Fix the file path.
350
-         *
351
-         * @since 1.0.0
352
-         * @package GeoDirectory
353
-         */
354
-        include_once(geodir_plugin_path() . '/geodirectory-functions/geodirectory_reg.php');
355
-    }
356
-
357
-
358
-    if (isset($_REQUEST['ajax_action']) && $_REQUEST['ajax_action'] == 'geodir_get_term_list') {
359
-        $terms_o = get_terms(sanitize_text_field($_REQUEST['term']));
213
+	if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'map_ajax') {
214
+		/**
215
+		 * Contains map marker functions.
216
+		 *
217
+		 * @since 1.0.0
218
+		 * @package GeoDirectory
219
+		 */
220
+		include_once(geodir_plugin_path() . '/geodirectory-functions/map-functions/get_markers.php');
221
+	}
222
+
223
+	if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'favorite') {
224
+		if (is_user_logged_in()) {
225
+			switch ($_REQUEST['ajax_action']):
226
+				case "add" :
227
+					geodir_add_to_favorite((int)$_REQUEST['pid']);
228
+					break;
229
+				case "remove" :
230
+					geodir_remove_from_favorite((int)$_REQUEST['pid']);
231
+					break;
232
+			endswitch;
233
+		} else {
234
+			wp_redirect(geodir_login_url());
235
+			exit();
236
+		}
237
+	}
238
+
239
+	if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'add_listing') {
240
+
241
+		$is_current_user_owner = true;
242
+		if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
243
+			$is_current_user_owner = geodir_listing_belong_to_current_user((int)$_REQUEST['pid']);
244
+		}
245
+
246
+		$request = $gd_session->get('listing');
247
+
248
+		if (is_user_logged_in() && $is_current_user_owner) {
249
+
250
+			switch ($_REQUEST['ajax_action']):
251
+				case "add":
252
+				case "update":
253
+
254
+					if (isset($request['geodir_spamblocker']) && $request['geodir_spamblocker'] == '64' && isset($request['geodir_filled_by_spam_bot']) && $request['geodir_filled_by_spam_bot'] == '') {
255
+						$last_id = geodir_save_listing();
256
+
257
+						if ($last_id) {
258
+							//$redirect_to = get_permalink( $last_id );
259
+							$redirect_to = geodir_getlink(get_permalink(geodir_success_page_id()), array('pid' => $last_id));
260
+
261
+						} elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
262
+							$redirect_to = get_permalink(geodir_add_listing_page_id());
263
+							$redirect_to = geodir_getlink($redirect_to, array('pid' => $post->pid), false);
264
+						} else
265
+							$redirect_to = get_permalink(geodir_add_listing_page_id());
266
+
267
+						wp_redirect($redirect_to);
268
+					} else {
269
+						$gd_session->un_set('listing');
270
+						wp_redirect(home_url());
271
+					}
272
+
273
+					break;
274
+				case "cancel" :
275
+
276
+					$gd_session->un_set('listing');
277
+
278
+					if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '' && get_permalink($_REQUEST['pid']))
279
+						wp_redirect(get_permalink($_REQUEST['pid']));
280
+					else {
281
+						geodir_remove_temp_images();
282
+						wp_redirect(geodir_getlink(get_permalink(geodir_add_listing_page_id()), array('listing_type' => $_REQUEST['listing_type'])));
283
+					}
284
+
285
+					break;
286
+
287
+				case "publish" :
288
+
289
+					if (isset($request['geodir_spamblocker']) && $request['geodir_spamblocker'] == '64' && isset($request['geodir_filled_by_spam_bot']) && $request['geodir_filled_by_spam_bot'] == '') {
290
+
291
+						if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
292
+							$new_post = array();
293
+							$new_post['ID'] = $_REQUEST['pid'];
294
+
295
+							$lastid = wp_update_post($new_post);
296
+
297
+							$gd_session->un_set('listing');
298
+							wp_redirect(get_permalink($lastid));
299
+						} else {
300
+							$last_id = geodir_save_listing();
301
+
302
+							if ($last_id) {
303
+								//$redirect_to = get_permalink( $last_id );
304
+								$redirect_to = geodir_getlink(get_permalink(geodir_success_page_id()), array('pid' => $last_id));
305
+							} elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
306
+								$redirect_to = get_permalink(geodir_add_listing_page_id());
307
+								$redirect_to = geodir_getlink($redirect_to, array('pid' => $post->pid), false);
308
+							} else
309
+								$redirect_to = get_permalink(geodir_add_listing_page_id());
310
+
311
+							$gd_session->un_set('listing');
312
+							wp_redirect($redirect_to);
313
+						}
314
+					} else {
315
+						$gd_session->un_set('listing');
316
+						wp_redirect(home_url());
317
+					}
318
+
319
+					break;
320
+				case "delete" :
321
+					if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
322
+						global $current_user;
323
+
324
+						if (get_option('geodir_disable_perm_delete')) {
325
+							$lastid = wp_trash_post($_REQUEST['pid']);
326
+						} else {
327
+							$lastid = wp_delete_post($_REQUEST['pid']);
328
+						}
329
+
330
+						if ($lastid && !is_wp_error($lastid))
331
+							wp_redirect($_SERVER['HTTP_REFERER']);
332
+
333
+						//wp_redirect( geodir_getlink(get_author_posts_url($current_user->ID),array('geodir_dashbord'=>'true','stype'=>$post_type ),false) );
334
+					}
335
+					break;
336
+			endswitch;
337
+
338
+			$gd_session->un_set('listing');
339
+		} else {
340
+			$gd_session->un_set('listing');
341
+			wp_redirect(geodir_login_url());
342
+			exit();
343
+		}
344
+	}
345
+
346
+	if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'user_login') {
347
+		/**
348
+		 * Contains registration and login functions.
349
+		 * @todo Fix the file path.
350
+		 *
351
+		 * @since 1.0.0
352
+		 * @package GeoDirectory
353
+		 */
354
+		include_once(geodir_plugin_path() . '/geodirectory-functions/geodirectory_reg.php');
355
+	}
356
+
357
+
358
+	if (isset($_REQUEST['ajax_action']) && $_REQUEST['ajax_action'] == 'geodir_get_term_list') {
359
+		$terms_o = get_terms(sanitize_text_field($_REQUEST['term']));
360 360
 		
361 361
 		// Skip terms which has no listing
362 362
 		if (!empty($terms_o)) {
@@ -370,11 +370,11 @@  discard block
 block discarded – undo
370 370
 			$terms_o = $filter_terms;
371 371
 		}
372 372
 		
373
-        $terms = geodir_sort_terms($terms_o, 'count');
374
-        geodir_helper_cat_list_output($terms, intval($_REQUEST['limit']));
375
-        exit();
373
+		$terms = geodir_sort_terms($terms_o, 'count');
374
+		geodir_helper_cat_list_output($terms, intval($_REQUEST['limit']));
375
+		exit();
376 376
 
377
-    }
377
+	}
378 378
 
379
-    gd_die();
379
+	gd_die();
380 380
 }
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
  */
45 45
 function geodir_on_wp()
46 46
 {
47
-    if(geodir_is_page('login')) {
47
+    if (geodir_is_page('login')) {
48 48
         geodir_user_signup();
49 49
     }
50 50
 
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
          * @since 1.0.0
83 83
          * @package GeoDirectory
84 84
          */
85
-        include_once(geodir_plugin_path() . '/geodirectory-functions/map-functions/get_markers.php');
85
+        include_once(geodir_plugin_path().'/geodirectory-functions/map-functions/get_markers.php');
86 86
         die;
87 87
     }
88 88
 
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
              * @since 1.0.0
141 141
              * @package GeoDirectory
142 142
              */
143
-            include_once(geodir_plugin_path() . '/geodirectory-admin/geodir_admin_ajax.php');
143
+            include_once(geodir_plugin_path().'/geodirectory-admin/geodir_admin_ajax.php');
144 144
         } else {
145 145
             wp_redirect(geodir_login_url());
146 146
             gd_die();
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
                          *
163 163
                          * @since 1.0.0
164 164
                          */
165
-                        do_action('geodir_delete_dummy_posts_' . $_REQUEST['posttype']);
165
+                        do_action('geodir_delete_dummy_posts_'.$_REQUEST['posttype']);
166 166
                     break;
167 167
                 case "geodir_dummy_insert" :
168 168
                     if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'geodir_dummy_posts_insert_noncename'))
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
                          *
184 184
                          * @since 1.0.0
185 185
                          */
186
-                        do_action('geodir_insert_dummy_posts_' . $_REQUEST['posttype']);
186
+                        do_action('geodir_insert_dummy_posts_'.$_REQUEST['posttype']);
187 187
 
188 188
                     break;
189 189
             endswitch;
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
         if ($_REQUEST['popuptype'] == 'b_send_inquiry' || $_REQUEST['popuptype'] == 'b_sendtofriend') {
199 199
             $template = locate_template(array("geodirectory/popup-forms.php"));
200 200
             if (!$template) {
201
-                $template = geodir_plugin_path() . '/geodirectory-templates/popup-forms.php';
201
+                $template = geodir_plugin_path().'/geodirectory-templates/popup-forms.php';
202 202
             }
203 203
             require_once($template);
204 204
         }
@@ -217,17 +217,17 @@  discard block
 block discarded – undo
217 217
          * @since 1.0.0
218 218
          * @package GeoDirectory
219 219
          */
220
-        include_once(geodir_plugin_path() . '/geodirectory-functions/map-functions/get_markers.php');
220
+        include_once(geodir_plugin_path().'/geodirectory-functions/map-functions/get_markers.php');
221 221
     }
222 222
 
223 223
     if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'favorite') {
224 224
         if (is_user_logged_in()) {
225 225
             switch ($_REQUEST['ajax_action']):
226 226
                 case "add" :
227
-                    geodir_add_to_favorite((int)$_REQUEST['pid']);
227
+                    geodir_add_to_favorite((int) $_REQUEST['pid']);
228 228
                     break;
229 229
                 case "remove" :
230
-                    geodir_remove_from_favorite((int)$_REQUEST['pid']);
230
+                    geodir_remove_from_favorite((int) $_REQUEST['pid']);
231 231
                     break;
232 232
             endswitch;
233 233
         } else {
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
 
241 241
         $is_current_user_owner = true;
242 242
         if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
243
-            $is_current_user_owner = geodir_listing_belong_to_current_user((int)$_REQUEST['pid']);
243
+            $is_current_user_owner = geodir_listing_belong_to_current_user((int) $_REQUEST['pid']);
244 244
         }
245 245
 
246 246
         $request = $gd_session->get('listing');
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
          * @since 1.0.0
352 352
          * @package GeoDirectory
353 353
          */
354
-        include_once(geodir_plugin_path() . '/geodirectory-functions/geodirectory_reg.php');
354
+        include_once(geodir_plugin_path().'/geodirectory-functions/geodirectory_reg.php');
355 355
     }
356 356
 
357 357
 
Please login to merge, or discard this patch.
Braces   +31 added lines, -23 removed lines patch added patch discarded remove patch
@@ -126,10 +126,11 @@  discard block
 block discarded – undo
126 126
     }
127 127
 
128 128
     if (isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'category_ajax') {
129
-        if (isset($_REQUEST['main_catid']) && isset($_REQUEST['cat_tax']) && isset($_REQUEST['exclude']))
130
-            geodir_addpost_categories_html($_REQUEST['cat_tax'], $_REQUEST['main_catid'], '', '', '', $_REQUEST['exclude']);
131
-        else if (isset($_REQUEST['catpid']) && isset($_REQUEST['cat_tax']))
132
-            geodir_editpost_categories_html($_REQUEST['cat_tax'], $_REQUEST['catpid']);
129
+        if (isset($_REQUEST['main_catid']) && isset($_REQUEST['cat_tax']) && isset($_REQUEST['exclude'])) {
130
+                    geodir_addpost_categories_html($_REQUEST['cat_tax'], $_REQUEST['main_catid'], '', '', '', $_REQUEST['exclude']);
131
+        } else if (isset($_REQUEST['catpid']) && isset($_REQUEST['cat_tax'])) {
132
+                    geodir_editpost_categories_html($_REQUEST['cat_tax'], $_REQUEST['catpid']);
133
+        }
133 134
     }
134 135
 
135 136
     if ((isset($_REQUEST['geodir_ajax']) && $_REQUEST['geodir_ajax'] == 'admin_ajax') || isset($_REQUEST['create_field']) || isset($_REQUEST['sort_create_field'])) {
@@ -151,22 +152,25 @@  discard block
 block discarded – undo
151 152
         if (current_user_can('manage_options')) {
152 153
             switch ($_REQUEST['geodir_autofill']):
153 154
                 case "geodir_dummy_delete" :
154
-                    if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'geodir_dummy_posts_delete_noncename'))
155
-                        return;
155
+                    if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'geodir_dummy_posts_delete_noncename')) {
156
+                                            return;
157
+                    }
156 158
 
157
-                    if (isset($_REQUEST['posttype']))
158
-                        /**
159
+                    if (isset($_REQUEST['posttype'])) {
160
+                                            /**
159 161
                          * Used to delete the dummy post data per post type.
160 162
                          *
161 163
                          * Uses dynamic hook, geodir_delete_dummy_posts_$_REQUEST['posttype'].
162 164
                          *
163 165
                          * @since 1.0.0
164 166
                          */
165
-                        do_action('geodir_delete_dummy_posts_' . $_REQUEST['posttype']);
167
+                        do_action('geodir_delete_dummy_posts_' . $_REQUEST['posttype']);
168
+                    }
166 169
                     break;
167 170
                 case "geodir_dummy_insert" :
168
-                    if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'geodir_dummy_posts_insert_noncename'))
169
-                        return;
171
+                    if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'geodir_dummy_posts_insert_noncename')) {
172
+                                            return;
173
+                    }
170 174
 
171 175
                     global $dummy_post_index, $city_bound_lat1, $city_bound_lng1, $city_bound_lat2, $city_bound_lng2;
172 176
                     $dummy_post_index = $_REQUEST['insert_dummy_post_index'];
@@ -175,15 +179,16 @@  discard block
 block discarded – undo
175 179
                     $city_bound_lat2 = $_REQUEST['city_bound_lat2'];
176 180
                     $city_bound_lng2 = $_REQUEST['city_bound_lng2'];
177 181
 
178
-                    if (isset($_REQUEST['posttype']))
179
-                        /**
182
+                    if (isset($_REQUEST['posttype'])) {
183
+                                            /**
180 184
                          * Used to insert the dummy post data per post type.
181 185
                          *
182 186
                          * Uses dynamic hook, geodir_insert_dummy_posts_$_REQUEST['posttype'].
183 187
                          *
184 188
                          * @since 1.0.0
185 189
                          */
186
-                        do_action('geodir_insert_dummy_posts_' . $_REQUEST['posttype']);
190
+                        do_action('geodir_insert_dummy_posts_' . $_REQUEST['posttype']);
191
+                    }
187 192
 
188 193
                     break;
189 194
             endswitch;
@@ -261,8 +266,9 @@  discard block
 block discarded – undo
261 266
                         } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
262 267
                             $redirect_to = get_permalink(geodir_add_listing_page_id());
263 268
                             $redirect_to = geodir_getlink($redirect_to, array('pid' => $post->pid), false);
264
-                        } else
265
-                            $redirect_to = get_permalink(geodir_add_listing_page_id());
269
+                        } else {
270
+                                                    $redirect_to = get_permalink(geodir_add_listing_page_id());
271
+                        }
266 272
 
267 273
                         wp_redirect($redirect_to);
268 274
                     } else {
@@ -275,9 +281,9 @@  discard block
 block discarded – undo
275 281
 
276 282
                     $gd_session->un_set('listing');
277 283
 
278
-                    if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '' && get_permalink($_REQUEST['pid']))
279
-                        wp_redirect(get_permalink($_REQUEST['pid']));
280
-                    else {
284
+                    if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '' && get_permalink($_REQUEST['pid'])) {
285
+                                            wp_redirect(get_permalink($_REQUEST['pid']));
286
+                    } else {
281 287
                         geodir_remove_temp_images();
282 288
                         wp_redirect(geodir_getlink(get_permalink(geodir_add_listing_page_id()), array('listing_type' => $_REQUEST['listing_type'])));
283 289
                     }
@@ -305,8 +311,9 @@  discard block
 block discarded – undo
305 311
                             } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') {
306 312
                                 $redirect_to = get_permalink(geodir_add_listing_page_id());
307 313
                                 $redirect_to = geodir_getlink($redirect_to, array('pid' => $post->pid), false);
308
-                            } else
309
-                                $redirect_to = get_permalink(geodir_add_listing_page_id());
314
+                            } else {
315
+                                                            $redirect_to = get_permalink(geodir_add_listing_page_id());
316
+                            }
310 317
 
311 318
                             $gd_session->un_set('listing');
312 319
                             wp_redirect($redirect_to);
@@ -327,8 +334,9 @@  discard block
 block discarded – undo
327 334
                             $lastid = wp_delete_post($_REQUEST['pid']);
328 335
                         }
329 336
 
330
-                        if ($lastid && !is_wp_error($lastid))
331
-                            wp_redirect($_SERVER['HTTP_REFERER']);
337
+                        if ($lastid && !is_wp_error($lastid)) {
338
+                                                    wp_redirect($_SERVER['HTTP_REFERER']);
339
+                        }
332 340
 
333 341
                         //wp_redirect( geodir_getlink(get_author_posts_url($current_user->ID),array('geodir_dashbord'=>'true','stype'=>$post_type ),false) );
334 342
                     }
Please login to merge, or discard this patch.