Test Failed
Push — master ( f48a23...7b3a74 )
by Stiofan
66:46
created
geodirectory-functions/custom_fields_input_functions.php 1 patch
Spacing   +233 added lines, -233 removed lines patch added patch discarded remove patch
@@ -17,12 +17,12 @@  discard block
 block discarded – undo
17 17
  *
18 18
  * @return string The html to output for the custom field.
19 19
  */
20
-function geodir_cfi_fieldset($html,$cf){
20
+function geodir_cfi_fieldset($html, $cf) {
21 21
 
22 22
     $html_var = $cf['htmlvar_name'];
23 23
 
24 24
     // Check if there is a custom field specific filter.
25
-    if(has_filter("geodir_custom_field_input_fieldset_{$html_var}")){
25
+    if (has_filter("geodir_custom_field_input_fieldset_{$html_var}")) {
26 26
         /**
27 27
          * Filter the fieldset html by individual custom field.
28 28
          *
@@ -30,18 +30,18 @@  discard block
 block discarded – undo
30 30
          * @param array $cf The custom field array.
31 31
          * @since 1.6.6
32 32
          */
33
-        $html = apply_filters("geodir_custom_field_input_fieldset_{$html_var}",$html,$cf);
33
+        $html = apply_filters("geodir_custom_field_input_fieldset_{$html_var}", $html, $cf);
34 34
     }
35 35
 
36 36
     // If no html then we run the standard output.
37
-    if(empty($html)) {
37
+    if (empty($html)) {
38 38
 
39 39
         ob_start(); // Start  buffering;
40 40
         ?>
41 41
         <h5 id="geodir_fieldset_<?php echo (int) $cf['id']; ?>" class="geodir-fieldset-row"
42 42
             gd-fieldset="<?php echo (int) $cf['id']; ?>"><?php echo $cf['site_title']; ?>
43
-            <?php if ( $cf['desc'] != '' ) {
44
-                echo '<small>( ' . $cf['desc'] . ' )</small>';
43
+            <?php if ($cf['desc'] != '') {
44
+                echo '<small>( '.$cf['desc'].' )</small>';
45 45
             } ?></h5>
46 46
         <?php
47 47
         $html = ob_get_clean();
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 
50 50
     return $html;
51 51
 }
52
-add_filter('geodir_custom_field_input_fieldset','geodir_cfi_fieldset',10,2);
52
+add_filter('geodir_custom_field_input_fieldset', 'geodir_cfi_fieldset', 10, 2);
53 53
 
54 54
 
55 55
 
@@ -62,12 +62,12 @@  discard block
 block discarded – undo
62 62
  *
63 63
  * @return string The html to output for the custom field.
64 64
  */
65
-function geodir_cfi_text($html,$cf){
65
+function geodir_cfi_text($html, $cf) {
66 66
 
67 67
     $html_var = $cf['htmlvar_name'];
68 68
 
69 69
     // Check if there is a custom field specific filter.
70
-    if(has_filter("geodir_custom_field_input_text_{$html_var}")){
70
+    if (has_filter("geodir_custom_field_input_text_{$html_var}")) {
71 71
         /**
72 72
          * Filter the text html by individual custom field.
73 73
          *
@@ -75,41 +75,41 @@  discard block
 block discarded – undo
75 75
          * @param array $cf The custom field array.
76 76
          * @since 1.6.6
77 77
          */
78
-        $html = apply_filters("geodir_custom_field_input_text_{$html_var}",$html,$cf);
78
+        $html = apply_filters("geodir_custom_field_input_text_{$html_var}", $html, $cf);
79 79
     }
80 80
 
81 81
     // If no html then we run the standard output.
82
-    if(empty($html)) {
82
+    if (empty($html)) {
83 83
 
84 84
         ob_start(); // Start  buffering;
85 85
 
86 86
         $value = geodir_get_cf_value($cf);
87 87
         $type = $cf['type'];
88 88
         //number and float validation $validation_pattern
89
-        if(isset($cf['data_type']) && $cf['data_type']=='INT'){$type = 'number';}
90
-        elseif(isset($cf['data_type']) && $cf['data_type']=='FLOAT'){$type = 'float';}
89
+        if (isset($cf['data_type']) && $cf['data_type'] == 'INT') {$type = 'number'; }
90
+        elseif (isset($cf['data_type']) && $cf['data_type'] == 'FLOAT') {$type = 'float'; }
91 91
 
92 92
         //validation
93
-        if(isset($cf['validation_pattern']) && $cf['validation_pattern']){
93
+        if (isset($cf['validation_pattern']) && $cf['validation_pattern']) {
94 94
             $validation = 'pattern="'.$cf['validation_pattern'].'"';
95
-        }else{$validation='';}
95
+        } else {$validation = ''; }
96 96
 
97 97
         // validation message
98
-        if(isset($cf['validation_msg']) && $cf['validation_msg']){
98
+        if (isset($cf['validation_msg']) && $cf['validation_msg']) {
99 99
             $validation_msg = 'title="'.$cf['validation_msg'].'"';
100
-        }else{$validation_msg='';}
100
+        } else {$validation_msg = ''; }
101 101
         ?>
102 102
 
103
-        <div id="<?php echo $cf['name'];?>_row"
104
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
103
+        <div id="<?php echo $cf['name']; ?>_row"
104
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
105 105
             <label>
106 106
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
107 107
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
108
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
108
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
109 109
             </label>
110
-            <input field_type="<?php echo $type;?>" name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>"
111
-                   value="<?php echo esc_attr(stripslashes($value));?>" type="<?php echo $type;?>" class="geodir_textfield" <?php echo $validation;echo $validation_msg;?> />
112
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
110
+            <input field_type="<?php echo $type; ?>" name="<?php echo $cf['name']; ?>" id="<?php echo $cf['name']; ?>"
111
+                   value="<?php echo esc_attr(stripslashes($value)); ?>" type="<?php echo $type; ?>" class="geodir_textfield" <?php echo $validation; echo $validation_msg; ?> />
112
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
113 113
             <?php if ($cf['is_required']) { ?>
114 114
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
115 115
             <?php } ?>
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 
122 122
     return $html;
123 123
 }
124
-add_filter('geodir_custom_field_input_text','geodir_cfi_text',10,2);
124
+add_filter('geodir_custom_field_input_text', 'geodir_cfi_text', 10, 2);
125 125
 
126 126
 
127 127
 /**
@@ -133,12 +133,12 @@  discard block
 block discarded – undo
133 133
  *
134 134
  * @return string The html to output for the custom field.
135 135
  */
136
-function geodir_cfi_email($html,$cf){
136
+function geodir_cfi_email($html, $cf) {
137 137
 
138 138
     $html_var = $cf['htmlvar_name'];
139 139
 
140 140
     // Check if there is a custom field specific filter.
141
-    if(has_filter("geodir_custom_field_input_email_{$html_var}")){
141
+    if (has_filter("geodir_custom_field_input_email_{$html_var}")) {
142 142
         /**
143 143
          * Filter the email html by individual custom field.
144 144
          *
@@ -146,11 +146,11 @@  discard block
 block discarded – undo
146 146
          * @param array $cf The custom field array.
147 147
          * @since 1.6.6
148 148
          */
149
-        $html = apply_filters("geodir_custom_field_input_email_{$html_var}",$html,$cf);
149
+        $html = apply_filters("geodir_custom_field_input_email_{$html_var}", $html, $cf);
150 150
     }
151 151
 
152 152
     // If no html then we run the standard output.
153
-    if(empty($html)) {
153
+    if (empty($html)) {
154 154
 
155 155
         ob_start(); // Start  buffering;
156 156
         $value = geodir_get_cf_value($cf);
@@ -159,16 +159,16 @@  discard block
 block discarded – undo
159 159
             $value = '';
160 160
         }?>
161 161
 
162
-        <div id="<?php echo $cf['name'];?>_row"
163
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
162
+        <div id="<?php echo $cf['name']; ?>_row"
163
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
164 164
             <label>
165 165
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
166 166
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
167
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
167
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
168 168
             </label>
169
-            <input field_type="<?php echo $cf['type'];?>" name="<?php  echo $cf['name'];?>" id="<?php echo $cf['name'];?>"
170
-                   value="<?php echo esc_attr(stripslashes($value));?>" type="email" class="geodir_textfield"/>
171
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
169
+            <input field_type="<?php echo $cf['type']; ?>" name="<?php  echo $cf['name']; ?>" id="<?php echo $cf['name']; ?>"
170
+                   value="<?php echo esc_attr(stripslashes($value)); ?>" type="email" class="geodir_textfield"/>
171
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
172 172
             <?php if ($cf['is_required']) { ?>
173 173
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
174 174
             <?php } ?>
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 
181 181
     return $html;
182 182
 }
183
-add_filter('geodir_custom_field_input_email','geodir_cfi_email',10,2);
183
+add_filter('geodir_custom_field_input_email', 'geodir_cfi_email', 10, 2);
184 184
 
185 185
 
186 186
 
@@ -193,12 +193,12 @@  discard block
 block discarded – undo
193 193
  *
194 194
  * @return string The html to output for the custom field.
195 195
  */
196
-function geodir_cfi_phone($html,$cf){
196
+function geodir_cfi_phone($html, $cf) {
197 197
 
198 198
     $html_var = $cf['htmlvar_name'];
199 199
 
200 200
     // Check if there is a custom field specific filter.
201
-    if(has_filter("geodir_custom_field_input_phone_{$html_var}")){
201
+    if (has_filter("geodir_custom_field_input_phone_{$html_var}")) {
202 202
         /**
203 203
          * Filter the phone html by individual custom field.
204 204
          *
@@ -206,11 +206,11 @@  discard block
 block discarded – undo
206 206
          * @param array $cf The custom field array.
207 207
          * @since 1.6.6
208 208
          */
209
-        $html = apply_filters("geodir_custom_field_input_phone_{$html_var}",$html,$cf);
209
+        $html = apply_filters("geodir_custom_field_input_phone_{$html_var}", $html, $cf);
210 210
     }
211 211
 
212 212
     // If no html then we run the standard output.
213
-    if(empty($html)) {
213
+    if (empty($html)) {
214 214
 
215 215
         ob_start(); // Start  buffering;
216 216
         $value = geodir_get_cf_value($cf);
@@ -219,16 +219,16 @@  discard block
 block discarded – undo
219 219
             $value = '';
220 220
         }?>
221 221
 
222
-        <div id="<?php echo $cf['name'];?>_row"
223
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
222
+        <div id="<?php echo $cf['name']; ?>_row"
223
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
224 224
             <label>
225 225
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
226 226
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
227
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
227
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
228 228
             </label>
229
-            <input field_type="<?php echo $cf['type'];?>" name="<?php  echo $cf['name'];?>" id="<?php echo $cf['name'];?>"
230
-                   value="<?php echo esc_attr(stripslashes($value));?>" type="tel" class="geodir_textfield"/>
231
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
229
+            <input field_type="<?php echo $cf['type']; ?>" name="<?php  echo $cf['name']; ?>" id="<?php echo $cf['name']; ?>"
230
+                   value="<?php echo esc_attr(stripslashes($value)); ?>" type="tel" class="geodir_textfield"/>
231
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
232 232
             <?php if ($cf['is_required']) { ?>
233 233
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
234 234
             <?php } ?>
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
 
241 241
     return $html;
242 242
 }
243
-add_filter('geodir_custom_field_input_phone','geodir_cfi_phone',10,2);
243
+add_filter('geodir_custom_field_input_phone', 'geodir_cfi_phone', 10, 2);
244 244
 
245 245
 
246 246
 
@@ -253,12 +253,12 @@  discard block
 block discarded – undo
253 253
  *
254 254
  * @return string The html to output for the custom field.
255 255
  */
256
-function geodir_cfi_url($html,$cf){
256
+function geodir_cfi_url($html, $cf) {
257 257
 
258 258
     $html_var = $cf['htmlvar_name'];
259 259
 
260 260
     // Check if there is a custom field specific filter.
261
-    if(has_filter("geodir_custom_field_input_url_{$html_var}")){
261
+    if (has_filter("geodir_custom_field_input_url_{$html_var}")) {
262 262
         /**
263 263
          * Filter the url html by individual custom field.
264 264
          *
@@ -266,11 +266,11 @@  discard block
 block discarded – undo
266 266
          * @param array $cf The custom field array.
267 267
          * @since 1.6.6
268 268
          */
269
-        $html = apply_filters("geodir_custom_field_input_url_{$html_var}",$html,$cf);
269
+        $html = apply_filters("geodir_custom_field_input_url_{$html_var}", $html, $cf);
270 270
     }
271 271
 
272 272
     // If no html then we run the standard output.
273
-    if(empty($html)) {
273
+    if (empty($html)) {
274 274
 
275 275
         ob_start(); // Start  buffering;
276 276
         $value = geodir_get_cf_value($cf);
@@ -279,19 +279,19 @@  discard block
 block discarded – undo
279 279
             $value = '';
280 280
         }?>
281 281
 
282
-        <div id="<?php echo $cf['name'];?>_row"
283
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
282
+        <div id="<?php echo $cf['name']; ?>_row"
283
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
284 284
             <label>
285 285
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
286 286
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
287
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
287
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
288 288
             </label>
289
-            <input field_type="<?php echo $cf['type'];?>" name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>"
290
-                   value="<?php echo esc_attr(stripslashes($value));?>" type="url" class="geodir_textfield"
289
+            <input field_type="<?php echo $cf['type']; ?>" name="<?php echo $cf['name']; ?>" id="<?php echo $cf['name']; ?>"
290
+                   value="<?php echo esc_attr(stripslashes($value)); ?>" type="url" class="geodir_textfield"
291 291
                    oninvalid="setCustomValidity('<?php _e('Please enter a valid URL including http://', 'geodirectory'); ?>')"
292 292
                    onchange="try{setCustomValidity('')}catch(e){}"
293 293
             />
294
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
294
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
295 295
             <?php if ($cf['is_required']) { ?>
296 296
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
297 297
             <?php } ?>
@@ -303,7 +303,7 @@  discard block
 block discarded – undo
303 303
 
304 304
     return $html;
305 305
 }
306
-add_filter('geodir_custom_field_input_url','geodir_cfi_url',10,2);
306
+add_filter('geodir_custom_field_input_url', 'geodir_cfi_url', 10, 2);
307 307
 
308 308
 
309 309
 /**
@@ -315,12 +315,12 @@  discard block
 block discarded – undo
315 315
  *
316 316
  * @return string The html to output for the custom field.
317 317
  */
318
-function geodir_cfi_radio($html,$cf){
318
+function geodir_cfi_radio($html, $cf) {
319 319
 
320 320
     $html_var = $cf['htmlvar_name'];
321 321
 
322 322
     // Check if there is a custom field specific filter.
323
-    if(has_filter("geodir_custom_field_input_radio_{$html_var}")){
323
+    if (has_filter("geodir_custom_field_input_radio_{$html_var}")) {
324 324
         /**
325 325
          * Filter the radio html by individual custom field.
326 326
          *
@@ -328,22 +328,22 @@  discard block
 block discarded – undo
328 328
          * @param array $cf The custom field array.
329 329
          * @since 1.6.6
330 330
          */
331
-        $html = apply_filters("geodir_custom_field_input_radio_{$html_var}",$html,$cf);
331
+        $html = apply_filters("geodir_custom_field_input_radio_{$html_var}", $html, $cf);
332 332
     }
333 333
 
334 334
     // If no html then we run the standard output.
335
-    if(empty($html)) {
335
+    if (empty($html)) {
336 336
 
337 337
         ob_start(); // Start  buffering;
338 338
         $value = geodir_get_cf_value($cf);
339 339
 
340 340
         ?>
341
-        <div id="<?php echo $cf['name'];?>_row"
342
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
341
+        <div id="<?php echo $cf['name']; ?>_row"
342
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
343 343
             <label>
344 344
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
345 345
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
346
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
346
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
347 347
             </label>
348 348
             <?php if ($cf['option_values']) {
349 349
                 $option_values = geodir_string_values_to_options($cf['option_values'], true);
@@ -352,14 +352,14 @@  discard block
 block discarded – undo
352 352
                     foreach ($option_values as $option_value) {
353 353
                         if (empty($option_value['optgroup'])) {
354 354
                             ?>
355
-                            <span class="gd-radios"><input name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>" <?php checked($value, $option_value['value']);?> value="<?php echo esc_attr($option_value['value']); ?>" class="gd-checkbox" field_type="<?php echo $cf['type'];?>" type="radio" /><?php echo $option_value['label']; ?></span>
355
+                            <span class="gd-radios"><input name="<?php echo $cf['name']; ?>" id="<?php echo $cf['name']; ?>" <?php checked($value, $option_value['value']); ?> value="<?php echo esc_attr($option_value['value']); ?>" class="gd-checkbox" field_type="<?php echo $cf['type']; ?>" type="radio" /><?php echo $option_value['label']; ?></span>
356 356
                             <?php
357 357
                         }
358 358
                     }
359 359
                 }
360 360
             }
361 361
             ?>
362
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
362
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
363 363
             <?php if ($cf['is_required']) { ?>
364 364
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
365 365
             <?php } ?>
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
 
372 372
     return $html;
373 373
 }
374
-add_filter('geodir_custom_field_input_radio','geodir_cfi_radio',10,2);
374
+add_filter('geodir_custom_field_input_radio', 'geodir_cfi_radio', 10, 2);
375 375
 
376 376
 
377 377
 /**
@@ -383,12 +383,12 @@  discard block
 block discarded – undo
383 383
  *
384 384
  * @return string The html to output for the custom field.
385 385
  */
386
-function geodir_cfi_checkbox($html,$cf){
386
+function geodir_cfi_checkbox($html, $cf) {
387 387
 
388 388
     $html_var = $cf['htmlvar_name'];
389 389
 
390 390
     // Check if there is a custom field specific filter.
391
-    if(has_filter("geodir_custom_field_input_checkbox_{$html_var}")){
391
+    if (has_filter("geodir_custom_field_input_checkbox_{$html_var}")) {
392 392
         /**
393 393
          * Filter the checkbox html by individual custom field.
394 394
          *
@@ -396,11 +396,11 @@  discard block
 block discarded – undo
396 396
          * @param array $cf The custom field array.
397 397
          * @since 1.6.6
398 398
          */
399
-        $html = apply_filters("geodir_custom_field_input_checkbox_{$html_var}",$html,$cf);
399
+        $html = apply_filters("geodir_custom_field_input_checkbox_{$html_var}", $html, $cf);
400 400
     }
401 401
 
402 402
     // If no html then we run the standard output.
403
-    if(empty($html)) {
403
+    if (empty($html)) {
404 404
 
405 405
         ob_start(); // Start  buffering;
406 406
         $value = geodir_get_cf_value($cf);
@@ -409,22 +409,22 @@  discard block
 block discarded – undo
409 409
             $value = '';
410 410
         }?>
411 411
 
412
-        <div id="<?php echo $cf['name'];?>_row"
413
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
412
+        <div id="<?php echo $cf['name']; ?>_row"
413
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
414 414
             <label>
415 415
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
416 416
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
417
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
417
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
418 418
             </label>
419 419
             <?php if ($value != '1') {
420 420
                 $value = '0';
421 421
             }?>
422
-            <input type="hidden" name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>" value="<?php echo esc_attr($value);?>"/>
422
+            <input type="hidden" name="<?php echo $cf['name']; ?>" id="<?php echo $cf['name']; ?>" value="<?php echo esc_attr($value); ?>"/>
423 423
             <input  <?php if ($value == '1') {
424 424
                 echo 'checked="checked"';
425
-            }?>  value="1" class="gd-checkbox" field_type="<?php echo $cf['type'];?>" type="checkbox"
426
-                 onchange="if(this.checked){jQuery('#<?php echo $cf['name'];?>').val('1');} else{ jQuery('#<?php echo $cf['name'];?>').val('0');}"/>
427
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
425
+            }?>  value="1" class="gd-checkbox" field_type="<?php echo $cf['type']; ?>" type="checkbox"
426
+                 onchange="if(this.checked){jQuery('#<?php echo $cf['name']; ?>').val('1');} else{ jQuery('#<?php echo $cf['name']; ?>').val('0');}"/>
427
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
428 428
             <?php if ($cf['is_required']) { ?>
429 429
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
430 430
             <?php } ?>
@@ -436,7 +436,7 @@  discard block
 block discarded – undo
436 436
 
437 437
     return $html;
438 438
 }
439
-add_filter('geodir_custom_field_input_checkbox','geodir_cfi_checkbox',10,2);
439
+add_filter('geodir_custom_field_input_checkbox', 'geodir_cfi_checkbox', 10, 2);
440 440
 
441 441
 
442 442
 /**
@@ -448,12 +448,12 @@  discard block
 block discarded – undo
448 448
  *
449 449
  * @return string The html to output for the custom field.
450 450
  */
451
-function geodir_cfi_textarea($html,$cf){
451
+function geodir_cfi_textarea($html, $cf) {
452 452
 
453 453
     $html_var = $cf['htmlvar_name'];
454 454
 
455 455
     // Check if there is a custom field specific filter.
456
-    if(has_filter("geodir_custom_field_input_textarea_{$html_var}")){
456
+    if (has_filter("geodir_custom_field_input_textarea_{$html_var}")) {
457 457
         /**
458 458
          * Filter the textarea html by individual custom field.
459 459
          *
@@ -461,11 +461,11 @@  discard block
 block discarded – undo
461 461
          * @param array $cf The custom field array.
462 462
          * @since 1.6.6
463 463
          */
464
-        $html = apply_filters("geodir_custom_field_input_textarea_{$html_var}",$html,$cf);
464
+        $html = apply_filters("geodir_custom_field_input_textarea_{$html_var}", $html, $cf);
465 465
     }
466 466
 
467 467
     // If no html then we run the standard output.
468
-    if(empty($html)) {
468
+    if (empty($html)) {
469 469
 
470 470
         ob_start(); // Start  buffering;
471 471
         $value = geodir_get_cf_value($cf);
@@ -473,32 +473,32 @@  discard block
 block discarded – undo
473 473
         $extra_fields = unserialize($cf['extra_fields']);
474 474
         ?>
475 475
 
476
-        <div id="<?php echo $cf['name'];?>_row"
477
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
476
+        <div id="<?php echo $cf['name']; ?>_row"
477
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
478 478
             <label>
479 479
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
480 480
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
481
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
481
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
482 482
             </label><?php
483 483
 
484 484
 
485 485
             if (is_array($extra_fields) && in_array('1', $extra_fields)) {
486 486
 
487
-                $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);?>
487
+                $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10); ?>
488 488
 
489
-            <div class="editor" field_id="<?php echo $cf['name'];?>" field_type="editor">
489
+            <div class="editor" field_id="<?php echo $cf['name']; ?>" field_type="editor">
490 490
                 <?php wp_editor(stripslashes($value), $cf['name'], $editor_settings); ?>
491 491
                 </div><?php
492 492
 
493 493
             } else {
494 494
 
495
-                ?><textarea field_type="<?php echo $cf['type'];?>" class="geodir_textarea" name="<?php echo $cf['name'];?>"
496
-                            id="<?php echo $cf['name'];?>"><?php echo stripslashes($value);?></textarea><?php
495
+                ?><textarea field_type="<?php echo $cf['type']; ?>" class="geodir_textarea" name="<?php echo $cf['name']; ?>"
496
+                            id="<?php echo $cf['name']; ?>"><?php echo stripslashes($value); ?></textarea><?php
497 497
 
498 498
             }?>
499 499
 
500 500
 
501
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
501
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
502 502
             <?php if ($cf['is_required']) { ?>
503 503
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
504 504
             <?php } ?>
@@ -510,7 +510,7 @@  discard block
 block discarded – undo
510 510
 
511 511
     return $html;
512 512
 }
513
-add_filter('geodir_custom_field_input_textarea','geodir_cfi_textarea',10,2);
513
+add_filter('geodir_custom_field_input_textarea', 'geodir_cfi_textarea', 10, 2);
514 514
 
515 515
 
516 516
 /**
@@ -522,12 +522,12 @@  discard block
 block discarded – undo
522 522
  *
523 523
  * @return string The html to output for the custom field.
524 524
  */
525
-function geodir_cfi_select($html,$cf){
525
+function geodir_cfi_select($html, $cf) {
526 526
 
527 527
     $html_var = $cf['htmlvar_name'];
528 528
 
529 529
     // Check if there is a custom field specific filter.
530
-    if(has_filter("geodir_custom_field_input_select_{$html_var}")){
530
+    if (has_filter("geodir_custom_field_input_select_{$html_var}")) {
531 531
         /**
532 532
          * Filter the select html by individual custom field.
533 533
          *
@@ -535,22 +535,22 @@  discard block
 block discarded – undo
535 535
          * @param array $cf The custom field array.
536 536
          * @since 1.6.6
537 537
          */
538
-        $html = apply_filters("geodir_custom_field_input_select_{$html_var}",$html,$cf);
538
+        $html = apply_filters("geodir_custom_field_input_select_{$html_var}", $html, $cf);
539 539
     }
540 540
 
541 541
     // If no html then we run the standard output.
542
-    if(empty($html)) {
542
+    if (empty($html)) {
543 543
 
544 544
         ob_start(); // Start  buffering;
545 545
         $value = geodir_get_cf_value($cf);
546 546
 
547 547
         ?>
548
-        <div id="<?php echo $cf['name'];?>_row"
549
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row geodir_custom_fields clearfix gd-fieldset-details">
548
+        <div id="<?php echo $cf['name']; ?>_row"
549
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row geodir_custom_fields clearfix gd-fieldset-details">
550 550
             <label>
551 551
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
552 552
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
553
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
553
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
554 554
             </label>
555 555
             <?php
556 556
             $option_values_arr = geodir_string_values_to_options($cf['option_values'], true);
@@ -560,22 +560,22 @@  discard block
 block discarded – undo
560 560
                     if (isset($option_row['optgroup']) && ($option_row['optgroup'] == 'start' || $option_row['optgroup'] == 'end')) {
561 561
                         $option_label = isset($option_row['label']) ? $option_row['label'] : '';
562 562
 
563
-                        $select_options .= $option_row['optgroup'] == 'start' ? '<optgroup label="' . esc_attr($option_label) . '">' : '</optgroup>';
563
+                        $select_options .= $option_row['optgroup'] == 'start' ? '<optgroup label="'.esc_attr($option_label).'">' : '</optgroup>';
564 564
                     } else {
565 565
                         $option_label = isset($option_row['label']) ? $option_row['label'] : '';
566 566
                         $option_value = isset($option_row['value']) ? $option_row['value'] : '';
567 567
                         $selected = $option_value == $value ? 'selected="selected"' : '';
568 568
 
569
-                        $select_options .= '<option value="' . esc_attr($option_value) . '" ' . $selected . '>' . $option_label . '</option>';
569
+                        $select_options .= '<option value="'.esc_attr($option_value).'" '.$selected.'>'.$option_label.'</option>';
570 570
                     }
571 571
                 }
572 572
             }
573 573
             ?>
574
-            <select field_type="<?php echo $cf['type'];?>" name="<?php echo $cf['name'];?>" id="<?php echo $cf['name'];?>"
574
+            <select field_type="<?php echo $cf['type']; ?>" name="<?php echo $cf['name']; ?>" id="<?php echo $cf['name']; ?>"
575 575
                     class="geodir_textfield textfield_x chosen_select"
576
-                    data-placeholder="<?php echo __('Choose', 'geodirectory') . ' ' . $site_title . '&hellip;';?>"
577
-                    option-ajaxchosen="false"><?php echo $select_options;?></select>
578
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
576
+                    data-placeholder="<?php echo __('Choose', 'geodirectory').' '.$site_title.'&hellip;'; ?>"
577
+                    option-ajaxchosen="false"><?php echo $select_options; ?></select>
578
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
579 579
             <?php if ($cf['is_required']) { ?>
580 580
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
581 581
             <?php } ?>
@@ -587,7 +587,7 @@  discard block
 block discarded – undo
587 587
 
588 588
     return $html;
589 589
 }
590
-add_filter('geodir_custom_field_input_select','geodir_cfi_select',10,2);
590
+add_filter('geodir_custom_field_input_select', 'geodir_cfi_select', 10, 2);
591 591
 
592 592
 
593 593
 /**
@@ -599,12 +599,12 @@  discard block
 block discarded – undo
599 599
  *
600 600
  * @return string The html to output for the custom field.
601 601
  */
602
-function geodir_cfi_multiselect($html,$cf){
602
+function geodir_cfi_multiselect($html, $cf) {
603 603
 
604 604
     $html_var = $cf['htmlvar_name'];
605 605
 
606 606
     // Check if there is a custom field specific filter.
607
-    if(has_filter("geodir_custom_field_input_multiselect_{$html_var}")){
607
+    if (has_filter("geodir_custom_field_input_multiselect_{$html_var}")) {
608 608
         /**
609 609
          * Filter the multiselect html by individual custom field.
610 610
          *
@@ -612,11 +612,11 @@  discard block
 block discarded – undo
612 612
          * @param array $cf The custom field array.
613 613
          * @since 1.6.6
614 614
          */
615
-        $html = apply_filters("geodir_custom_field_input_multiselect_{$html_var}",$html,$cf);
615
+        $html = apply_filters("geodir_custom_field_input_multiselect_{$html_var}", $html, $cf);
616 616
     }
617 617
 
618 618
     // If no html then we run the standard output.
619
-    if(empty($html)) {
619
+    if (empty($html)) {
620 620
 
621 621
         ob_start(); // Start  buffering;
622 622
         $value = geodir_get_cf_value($cf);
@@ -653,9 +653,9 @@  discard block
 block discarded – undo
653 653
                                 $option_label = isset($option_row['label']) ? $option_row['label'] : '';
654 654
 
655 655
                                 if ($multi_display == 'select') {
656
-                                    $select_options .= $option_row['optgroup'] == 'start' ? '<optgroup label="' . esc_attr($option_label) . '">' : '</optgroup>';
656
+                                    $select_options .= $option_row['optgroup'] == 'start' ? '<optgroup label="'.esc_attr($option_label).'">' : '</optgroup>';
657 657
                                 } else {
658
-                                    $select_options .= $option_row['optgroup'] == 'start' ? '<li>' . $option_label . '</li>' : '';
658
+                                    $select_options .= $option_row['optgroup'] == 'start' ? '<li>'.$option_label.'</li>' : '';
659 659
                                 }
660 660
                             } else {
661 661
                                 $option_label = isset($option_row['label']) ? $option_row['label'] : '';
@@ -680,9 +680,9 @@  discard block
 block discarded – undo
680 680
                                 }
681 681
 
682 682
                                 if ($multi_display == 'select') {
683
-                                    $select_options .= '<option value="' . esc_attr($option_value) . '" ' . $selected . '>' . $option_label . '</option>';
683
+                                    $select_options .= '<option value="'.esc_attr($option_value).'" '.$selected.'>'.$option_label.'</option>';
684 684
                                 } else {
685
-                                    $select_options .= '<li><input name="' . $cf['name'] . '[]" ' . $checked . ' value="' . esc_attr($option_value) . '" class="gd-' . $multi_display . '" field_type="' . $multi_display . '" type="' . $multi_display . '" />&nbsp;' . $option_label . ' </li>';
685
+                                    $select_options .= '<li><input name="'.$cf['name'].'[]" '.$checked.' value="'.esc_attr($option_value).'" class="gd-'.$multi_display.'" field_type="'.$multi_display.'" type="'.$multi_display.'" />&nbsp;'.$option_label.' </li>';
686 686
                                 }
687 687
                             }
688 688
                         }
@@ -702,7 +702,7 @@  discard block
 block discarded – undo
702 702
 
703 703
     return $html;
704 704
 }
705
-add_filter('geodir_custom_field_input_multiselect','geodir_cfi_multiselect',10,2);
705
+add_filter('geodir_custom_field_input_multiselect', 'geodir_cfi_multiselect', 10, 2);
706 706
 
707 707
 
708 708
 /**
@@ -714,12 +714,12 @@  discard block
 block discarded – undo
714 714
  *
715 715
  * @return string The html to output for the custom field.
716 716
  */
717
-function geodir_cfi_html($html,$cf){
717
+function geodir_cfi_html($html, $cf) {
718 718
 
719 719
     $html_var = $cf['htmlvar_name'];
720 720
 
721 721
     // Check if there is a custom field specific filter.
722
-    if(has_filter("geodir_custom_field_input_html_{$html_var}")){
722
+    if (has_filter("geodir_custom_field_input_html_{$html_var}")) {
723 723
         /**
724 724
          * Filter the html html by individual custom field.
725 725
          *
@@ -727,11 +727,11 @@  discard block
 block discarded – undo
727 727
          * @param array $cf The custom field array.
728 728
          * @since 1.6.6
729 729
          */
730
-        $html = apply_filters("geodir_custom_field_input_html_{$html_var}",$html,$cf);
730
+        $html = apply_filters("geodir_custom_field_input_html_{$html_var}", $html, $cf);
731 731
     }
732 732
 
733 733
     // If no html then we run the standard output.
734
-    if(empty($html)) {
734
+    if (empty($html)) {
735 735
 
736 736
         ob_start(); // Start  buffering;
737 737
         $value = geodir_get_cf_value($cf);
@@ -764,7 +764,7 @@  discard block
 block discarded – undo
764 764
 
765 765
     return $html;
766 766
 }
767
-add_filter('geodir_custom_field_input_html','geodir_cfi_html',10,2);
767
+add_filter('geodir_custom_field_input_html', 'geodir_cfi_html', 10, 2);
768 768
 
769 769
 
770 770
 
@@ -777,12 +777,12 @@  discard block
 block discarded – undo
777 777
  *
778 778
  * @return string The html to output for the custom field.
779 779
  */
780
-function geodir_cfi_datepicker($html,$cf){
780
+function geodir_cfi_datepicker($html, $cf) {
781 781
 
782 782
     $html_var = $cf['htmlvar_name'];
783 783
 
784 784
     // Check if there is a custom field specific filter.
785
-    if(has_filter("geodir_custom_field_input_datepicker_{$html_var}")){
785
+    if (has_filter("geodir_custom_field_input_datepicker_{$html_var}")) {
786 786
         /**
787 787
          * Filter the datepicker html by individual custom field.
788 788
          *
@@ -790,11 +790,11 @@  discard block
 block discarded – undo
790 790
          * @param array $cf The custom field array.
791 791
          * @since 1.6.6
792 792
          */
793
-        $html = apply_filters("geodir_custom_field_input_datepicker_{$html_var}",$html,$cf);
793
+        $html = apply_filters("geodir_custom_field_input_datepicker_{$html_var}", $html, $cf);
794 794
     }
795 795
 
796 796
     // If no html then we run the standard output.
797
-    if(empty($html)) {
797
+    if (empty($html)) {
798 798
 
799 799
         ob_start(); // Start  buffering;
800 800
         $value = geodir_get_cf_value($cf);
@@ -806,23 +806,23 @@  discard block
 block discarded – undo
806 806
             $extra_fields['date_format'] = 'yy-mm-dd';
807 807
 
808 808
         $date_format = $extra_fields['date_format'];
809
-        $jquery_date_format  = $date_format;
809
+        $jquery_date_format = $date_format;
810 810
 
811 811
 
812 812
         // check if we need to change the format or not
813 813
         $date_format_len = strlen(str_replace(' ', '', $date_format));
814
-        if($date_format_len>5){// if greater then 5 then it's the old style format.
814
+        if ($date_format_len > 5) {// if greater then 5 then it's the old style format.
815 815
 
816
-            $search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format
817
-            $replace = array('d','j','l','m','n','F','Y');//PHP date format
816
+            $search = array('dd', 'd', 'DD', 'mm', 'm', 'MM', 'yy'); //jQuery UI datepicker format
817
+            $replace = array('d', 'j', 'l', 'm', 'n', 'F', 'Y'); //PHP date format
818 818
 
819 819
             $date_format = str_replace($search, $replace, $date_format);
820
-        }else{
821
-            $jquery_date_format = geodir_date_format_php_to_jqueryui( $jquery_date_format );
820
+        } else {
821
+            $jquery_date_format = geodir_date_format_php_to_jqueryui($jquery_date_format);
822 822
         }
823 823
 
824
-        if($value=='0000-00-00'){$value='';}//if date not set, then mark it empty
825
-        if($value && !isset($_REQUEST['backandedit'])) {
824
+        if ($value == '0000-00-00') {$value = ''; }//if date not set, then mark it empty
825
+        if ($value && !isset($_REQUEST['backandedit'])) {
826 826
             //$time = strtotime($value);
827 827
             //$value = date_i18n($date_format, $time);
828 828
         }
@@ -833,37 +833,37 @@  discard block
 block discarded – undo
833 833
 
834 834
             jQuery(function () {
835 835
 
836
-                jQuery("#<?php echo $cf['name'];?>").datepicker({changeMonth: true, changeYear: true <?php
836
+                jQuery("#<?php echo $cf['name']; ?>").datepicker({changeMonth: true, changeYear: true <?php
837 837
                     /**
838 838
                      * Used to add extra option to datepicker per custom field.
839 839
                      *
840 840
                      * @since 1.5.7
841 841
                      * @param string $name The custom field name.
842 842
                      */
843
-                    echo apply_filters("gd_datepicker_extra_{$name}",'');?>});
843
+                    echo apply_filters("gd_datepicker_extra_{$name}", ''); ?>});
844 844
 
845
-                jQuery("#<?php echo $name;?>").datepicker("option", "dateFormat", '<?php echo $jquery_date_format;?>');
845
+                jQuery("#<?php echo $name; ?>").datepicker("option", "dateFormat", '<?php echo $jquery_date_format; ?>');
846 846
 
847
-                <?php if(!empty($value)){?>
848
-                jQuery("#<?php echo $name;?>").datepicker("setDate", '<?php echo $value;?>');
847
+                <?php if (!empty($value)) {?>
848
+                jQuery("#<?php echo $name; ?>").datepicker("setDate", '<?php echo $value; ?>');
849 849
                 <?php } ?>
850 850
 
851 851
             });
852 852
 
853 853
         </script>
854
-        <div id="<?php echo $name;?>_row"
855
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
854
+        <div id="<?php echo $name; ?>_row"
855
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
856 856
             <label>
857 857
 
858 858
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
859 859
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
860
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
860
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
861 861
             </label>
862 862
 
863
-            <input field_type="<?php echo $cf['type'];?>" name="<?php echo $name;?>" id="<?php echo $name;?>"
864
-                   value="<?php echo esc_attr($value);?>" type="text" class="geodir_textfield"/>
863
+            <input field_type="<?php echo $cf['type']; ?>" name="<?php echo $name; ?>" id="<?php echo $name; ?>"
864
+                   value="<?php echo esc_attr($value); ?>" type="text" class="geodir_textfield"/>
865 865
 
866
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
866
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
867 867
             <?php if ($cf['is_required']) { ?>
868 868
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
869 869
             <?php } ?>
@@ -875,7 +875,7 @@  discard block
 block discarded – undo
875 875
 
876 876
     return $html;
877 877
 }
878
-add_filter('geodir_custom_field_input_datepicker','geodir_cfi_datepicker',10,2);
878
+add_filter('geodir_custom_field_input_datepicker', 'geodir_cfi_datepicker', 10, 2);
879 879
 
880 880
 
881 881
 /**
@@ -887,12 +887,12 @@  discard block
 block discarded – undo
887 887
  *
888 888
  * @return string The html to output for the custom field.
889 889
  */
890
-function geodir_cfi_time($html,$cf){
890
+function geodir_cfi_time($html, $cf) {
891 891
 
892 892
     $html_var = $cf['htmlvar_name'];
893 893
 
894 894
     // Check if there is a custom field specific filter.
895
-    if(has_filter("geodir_custom_field_input_time_{$html_var}")){
895
+    if (has_filter("geodir_custom_field_input_time_{$html_var}")) {
896 896
         /**
897 897
          * Filter the time html by individual custom field.
898 898
          *
@@ -900,11 +900,11 @@  discard block
 block discarded – undo
900 900
          * @param array $cf The custom field array.
901 901
          * @since 1.6.6
902 902
          */
903
-        $html = apply_filters("geodir_custom_field_input_time_{$html_var}",$html,$cf);
903
+        $html = apply_filters("geodir_custom_field_input_time_{$html_var}", $html, $cf);
904 904
     }
905 905
 
906 906
     // If no html then we run the standard output.
907
-    if(empty($html)) {
907
+    if (empty($html)) {
908 908
 
909 909
         ob_start(); // Start  buffering;
910 910
         $value = geodir_get_cf_value($cf);
@@ -917,25 +917,25 @@  discard block
 block discarded – undo
917 917
         <script type="text/javascript">
918 918
             jQuery(document).ready(function () {
919 919
 
920
-                jQuery('#<?php echo $name;?>').timepicker({
920
+                jQuery('#<?php echo $name; ?>').timepicker({
921 921
                     showPeriod: true,
922 922
                     showLeadingZero: true,
923 923
                     showPeriod: true,
924 924
                 });
925 925
             });
926 926
         </script>
927
-        <div id="<?php echo $name;?>_row"
928
-             class="<?php if ($cf['is_required']) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
927
+        <div id="<?php echo $name; ?>_row"
928
+             class="<?php if ($cf['is_required']) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
929 929
             <label>
930 930
 
931 931
                 <?php $site_title = __($cf['site_title'], 'geodirectory');
932 932
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
933
-                <?php if ($cf['is_required']) echo '<span>*</span>';?>
933
+                <?php if ($cf['is_required']) echo '<span>*</span>'; ?>
934 934
             </label>
935
-            <input readonly="readonly" field_type="<?php echo $cf['type'];?>" name="<?php echo $name;?>"
936
-                   id="<?php echo $name;?>" value="<?php echo esc_attr($value);?>" type="text" class="geodir_textfield"/>
935
+            <input readonly="readonly" field_type="<?php echo $cf['type']; ?>" name="<?php echo $name; ?>"
936
+                   id="<?php echo $name; ?>" value="<?php echo esc_attr($value); ?>" type="text" class="geodir_textfield"/>
937 937
 
938
-            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory');?></span>
938
+            <span class="geodir_message_note"><?php _e($cf['desc'], 'geodirectory'); ?></span>
939 939
             <?php if ($cf['is_required']) { ?>
940 940
                 <span class="geodir_message_error"><?php _e($cf['required_msg'], 'geodirectory'); ?></span>
941 941
             <?php } ?>
@@ -946,7 +946,7 @@  discard block
 block discarded – undo
946 946
 
947 947
     return $html;
948 948
 }
949
-add_filter('geodir_custom_field_input_time','geodir_cfi_time',10,2);
949
+add_filter('geodir_custom_field_input_time', 'geodir_cfi_time', 10, 2);
950 950
 
951 951
 
952 952
 /**
@@ -958,12 +958,12 @@  discard block
 block discarded – undo
958 958
  *
959 959
  * @return string The html to output for the custom field.
960 960
  */
961
-function geodir_cfi_address($html,$cf){
961
+function geodir_cfi_address($html, $cf) {
962 962
 
963 963
     $html_var = $cf['htmlvar_name'];
964 964
 
965 965
     // Check if there is a custom field specific filter.
966
-    if(has_filter("geodir_custom_field_input_address_{$html_var}")){
966
+    if (has_filter("geodir_custom_field_input_address_{$html_var}")) {
967 967
         /**
968 968
          * Filter the address html by individual custom field.
969 969
          *
@@ -971,11 +971,11 @@  discard block
 block discarded – undo
971 971
          * @param array $cf The custom field array.
972 972
          * @since 1.6.6
973 973
          */
974
-        $html = apply_filters("geodir_custom_field_input_address_{$html_var}",$html,$cf);
974
+        $html = apply_filters("geodir_custom_field_input_address_{$html_var}", $html, $cf);
975 975
     }
976 976
 
977 977
     // If no html then we run the standard output.
978
-    if(empty($html)) {
978
+    if (empty($html)) {
979 979
 
980 980
         global $gd_session;
981 981
         ob_start(); // Start  buffering;
@@ -988,12 +988,12 @@  discard block
 block discarded – undo
988 988
         $site_title = $cf['site_title'];
989 989
         $is_admin = $cf['is_admin'];
990 990
         $extra_fields = unserialize($cf['extra_fields']);
991
-        $prefix = $name . '_';
991
+        $prefix = $name.'_';
992 992
 
993
-        ($site_title != '') ? $address_title = $site_title : $address_title = geodir_ucwords($prefix . ' address');
994
-        ($extra_fields['zip_lable'] != '') ? $zip_title = $extra_fields['zip_lable'] : $zip_title = geodir_ucwords($prefix . ' zip/post code ');
993
+        ($site_title != '') ? $address_title = $site_title : $address_title = geodir_ucwords($prefix.' address');
994
+        ($extra_fields['zip_lable'] != '') ? $zip_title = $extra_fields['zip_lable'] : $zip_title = geodir_ucwords($prefix.' zip/post code ');
995 995
         ($extra_fields['map_lable'] != '') ? $map_title = $extra_fields['map_lable'] : $map_title = geodir_ucwords('set address on map');
996
-        ($extra_fields['mapview_lable'] != '') ? $mapview_title = $extra_fields['mapview_lable'] : $mapview_title = geodir_ucwords($prefix . ' mapview');
996
+        ($extra_fields['mapview_lable'] != '') ? $mapview_title = $extra_fields['mapview_lable'] : $mapview_title = geodir_ucwords($prefix.' mapview');
997 997
 
998 998
         $address = '';
999 999
         $zip = '';
@@ -1004,21 +1004,21 @@  discard block
 block discarded – undo
1004 1004
 
1005 1005
         if (isset($_REQUEST['backandedit']) && $_REQUEST['backandedit'] && $gd_ses_listing = $gd_session->get('listing')) {
1006 1006
             $post = $gd_ses_listing;
1007
-            $address = $post[$prefix . 'address'];
1008
-            $zip = isset($post[$prefix . 'zip']) ? $post[$prefix . 'zip'] : '';
1009
-            $lat = isset($post[$prefix . 'latitude']) ? $post[$prefix . 'latitude'] : '';
1010
-            $lng = isset($post[$prefix . 'longitude']) ? $post[$prefix . 'longitude'] : '';
1011
-            $mapview = isset($post[$prefix . 'mapview']) ? $post[$prefix . 'mapview'] : '';
1012
-            $mapzoom = isset($post[$prefix . 'mapzoom']) ? $post[$prefix . 'mapzoom'] : '';
1007
+            $address = $post[$prefix.'address'];
1008
+            $zip = isset($post[$prefix.'zip']) ? $post[$prefix.'zip'] : '';
1009
+            $lat = isset($post[$prefix.'latitude']) ? $post[$prefix.'latitude'] : '';
1010
+            $lng = isset($post[$prefix.'longitude']) ? $post[$prefix.'longitude'] : '';
1011
+            $mapview = isset($post[$prefix.'mapview']) ? $post[$prefix.'mapview'] : '';
1012
+            $mapzoom = isset($post[$prefix.'mapzoom']) ? $post[$prefix.'mapzoom'] : '';
1013 1013
         } else if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '' && $post_info = geodir_get_post_info($_REQUEST['pid'])) {
1014
-            $post_info = (array)$post_info;
1015
-
1016
-            $address = $post_info[$prefix . 'address'];
1017
-            $zip = isset($post_info[$prefix . 'zip']) ? $post_info[$prefix . 'zip'] : '';
1018
-            $lat = isset($post_info[$prefix . 'latitude']) ? $post_info[$prefix . 'latitude'] : '';
1019
-            $lng = isset($post_info[$prefix . 'longitude']) ? $post_info[$prefix . 'longitude'] : '';
1020
-            $mapview = isset($post_info[$prefix . 'mapview']) ? $post_info[$prefix . 'mapview'] : '';
1021
-            $mapzoom = isset($post_info[$prefix . 'mapzoom']) ? $post_info[$prefix . 'mapzoom'] : '';
1014
+            $post_info = (array) $post_info;
1015
+
1016
+            $address = $post_info[$prefix.'address'];
1017
+            $zip = isset($post_info[$prefix.'zip']) ? $post_info[$prefix.'zip'] : '';
1018
+            $lat = isset($post_info[$prefix.'latitude']) ? $post_info[$prefix.'latitude'] : '';
1019
+            $lng = isset($post_info[$prefix.'longitude']) ? $post_info[$prefix.'longitude'] : '';
1020
+            $mapview = isset($post_info[$prefix.'mapview']) ? $post_info[$prefix.'mapview'] : '';
1021
+            $mapzoom = isset($post_info[$prefix.'mapzoom']) ? $post_info[$prefix.'mapzoom'] : '';
1022 1022
         }
1023 1023
 
1024 1024
         $location = geodir_get_default_location();
@@ -1055,16 +1055,16 @@  discard block
 block discarded – undo
1055 1055
 
1056 1056
         ?>
1057 1057
 
1058
-        <div id="geodir_<?php echo $prefix . 'address';?>_row"
1059
-             class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
1058
+        <div id="geodir_<?php echo $prefix.'address'; ?>_row"
1059
+             class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
1060 1060
             <label>
1061 1061
                 <?php _e($address_title, 'geodirectory'); ?>
1062
-                <?php if ($is_required) echo '<span>*</span>';?>
1062
+                <?php if ($is_required) echo '<span>*</span>'; ?>
1063 1063
             </label>
1064
-            <input type="text" field_type="<?php echo $type;?>" name="<?php echo $prefix . 'address';?>"
1065
-                   id="<?php echo $prefix . 'address';?>" class="geodir_textfield"
1064
+            <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix.'address'; ?>"
1065
+                   id="<?php echo $prefix.'address'; ?>" class="geodir_textfield"
1066 1066
                    value="<?php echo esc_attr(stripslashes($address)); ?>"/>
1067
-            <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory');?></span>
1067
+            <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory'); ?></span>
1068 1068
             <?php if ($is_required) { ?>
1069 1069
                 <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span>
1070 1070
             <?php } ?>
@@ -1084,14 +1084,14 @@  discard block
 block discarded – undo
1084 1084
 
1085 1085
         if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) { ?>
1086 1086
 
1087
-            <div id="geodir_<?php echo $prefix . 'zip'; ?>_row"
1087
+            <div id="geodir_<?php echo $prefix.'zip'; ?>_row"
1088 1088
                  class="<?php /*if($is_required) echo 'required_field';*/ ?> geodir_form_row clearfix gd-fieldset-details">
1089 1089
                 <label>
1090 1090
                     <?php _e($zip_title, 'geodirectory'); ?>
1091 1091
                     <?php /*if($is_required) echo '<span>*</span>';*/ ?>
1092 1092
                 </label>
1093
-                <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix . 'zip'; ?>"
1094
-                       id="<?php echo $prefix . 'zip'; ?>" class="geodir_textfield autofill"
1093
+                <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix.'zip'; ?>"
1094
+                       id="<?php echo $prefix.'zip'; ?>" class="geodir_textfield autofill"
1095 1095
                        value="<?php echo esc_attr(stripslashes($zip)); ?>"/>
1096 1096
                 <?php /*if($is_required) {?>
1097 1097
 					<span class="geodir_message_error"><?php echo _e($required_msg,'geodirectory');?></span>
@@ -1101,14 +1101,14 @@  discard block
 block discarded – undo
1101 1101
 
1102 1102
         <?php if (isset($extra_fields['show_map']) && $extra_fields['show_map']) { ?>
1103 1103
 
1104
-            <div id="geodir_<?php echo $prefix . 'map'; ?>_row" class="geodir_form_row clearfix gd-fieldset-details">
1104
+            <div id="geodir_<?php echo $prefix.'map'; ?>_row" class="geodir_form_row clearfix gd-fieldset-details">
1105 1105
                 <?php
1106 1106
                 /**
1107 1107
                  * Contains add listing page map functions.
1108 1108
                  *
1109 1109
                  * @since 1.0.0
1110 1110
                  */
1111
-                include(geodir_plugin_path() . "/geodirectory-functions/map-functions/map_on_add_listing_page.php");
1111
+                include(geodir_plugin_path()."/geodirectory-functions/map-functions/map_on_add_listing_page.php");
1112 1112
                 if ($lat_lng_blank) {
1113 1113
                     $lat = '';
1114 1114
                     $lng = '';
@@ -1119,14 +1119,14 @@  discard block
 block discarded – undo
1119 1119
             <?php
1120 1120
             /* show lat lng */
1121 1121
             $style_latlng = ((isset($extra_fields['show_latlng']) && $extra_fields['show_latlng']) || is_admin()) ? '' : 'style="display:none"'; ?>
1122
-            <div id="geodir_<?php echo $prefix . 'latitude'; ?>_row"
1122
+            <div id="geodir_<?php echo $prefix.'latitude'; ?>_row"
1123 1123
                  class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details" <?php echo $style_latlng; ?>>
1124 1124
                 <label>
1125 1125
                     <?php echo PLACE_ADDRESS_LAT; ?>
1126 1126
                     <?php if ($is_required) echo '<span>*</span>'; ?>
1127 1127
                 </label>
1128
-                <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix . 'latitude'; ?>"
1129
-                       id="<?php echo $prefix . 'latitude'; ?>" class="geodir_textfield"
1128
+                <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix.'latitude'; ?>"
1129
+                       id="<?php echo $prefix.'latitude'; ?>" class="geodir_textfield"
1130 1130
                        value="<?php echo esc_attr(stripslashes($lat)); ?>" size="25"/>
1131 1131
                 <span class="geodir_message_note"><?php echo GET_LATITUDE_MSG; ?></span>
1132 1132
                 <?php if ($is_required) { ?>
@@ -1134,14 +1134,14 @@  discard block
 block discarded – undo
1134 1134
                 <?php } ?>
1135 1135
             </div>
1136 1136
 
1137
-            <div id="geodir_<?php echo $prefix . 'longitude'; ?>_row"
1137
+            <div id="geodir_<?php echo $prefix.'longitude'; ?>_row"
1138 1138
                  class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details" <?php echo $style_latlng; ?>>
1139 1139
                 <label>
1140 1140
                     <?php echo PLACE_ADDRESS_LNG; ?>
1141 1141
                     <?php if ($is_required) echo '<span>*</span>'; ?>
1142 1142
                 </label>
1143
-                <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix . 'longitude'; ?>"
1144
-                       id="<?php echo $prefix . 'longitude'; ?>" class="geodir_textfield"
1143
+                <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix.'longitude'; ?>"
1144
+                       id="<?php echo $prefix.'longitude'; ?>" class="geodir_textfield"
1145 1145
                        value="<?php echo esc_attr(stripslashes($lng)); ?>" size="25"/>
1146 1146
                 <span class="geodir_message_note"><?php echo GET_LOGNGITUDE_MSG; ?></span>
1147 1147
                 <?php if ($is_required) { ?>
@@ -1151,32 +1151,32 @@  discard block
 block discarded – undo
1151 1151
         <?php } ?>
1152 1152
 
1153 1153
         <?php if (isset($extra_fields['show_mapview']) && $extra_fields['show_mapview']) { ?>
1154
-            <div id="geodir_<?php echo $prefix . 'mapview'; ?>_row" class="geodir_form_row clearfix gd-fieldset-details">
1154
+            <div id="geodir_<?php echo $prefix.'mapview'; ?>_row" class="geodir_form_row clearfix gd-fieldset-details">
1155 1155
                 <label><?php _e($mapview_title, 'geodirectory'); ?></label>
1156 1156
 
1157 1157
 
1158 1158
                     <span class="geodir_user_define"><input field_type="<?php echo $type; ?>" type="radio"
1159 1159
                                                             class="gd-checkbox"
1160
-                                                            name="<?php echo $prefix . 'mapview'; ?>"
1161
-                                                            id="<?php echo $prefix . 'mapview'; ?>" <?php if ($mapview == 'ROADMAP' || $mapview == '') {
1160
+                                                            name="<?php echo $prefix.'mapview'; ?>"
1161
+                                                            id="<?php echo $prefix.'mapview'; ?>" <?php if ($mapview == 'ROADMAP' || $mapview == '') {
1162 1162
                             echo 'checked="checked"';
1163 1163
                         } ?>  value="ROADMAP" size="25"/> <?php _e('Default Map', 'geodirectory'); ?></span>
1164 1164
                     <span class="geodir_user_define"> <input field_type="<?php echo $type; ?>" type="radio"
1165 1165
                                                              class="gd-checkbox"
1166
-                                                             name="<?php echo $prefix . 'mapview'; ?>"
1166
+                                                             name="<?php echo $prefix.'mapview'; ?>"
1167 1167
                                                              id="map_view1" <?php if ($mapview == 'SATELLITE') {
1168 1168
                             echo 'checked="checked"';
1169 1169
                         } ?> value="SATELLITE" size="25"/> <?php _e('Satellite Map', 'geodirectory'); ?></span>
1170 1170
 
1171 1171
                     <span class="geodir_user_define"><input field_type="<?php echo $type; ?>" type="radio"
1172 1172
                                                             class="gd-checkbox"
1173
-                                                            name="<?php echo $prefix . 'mapview'; ?>"
1173
+                                                            name="<?php echo $prefix.'mapview'; ?>"
1174 1174
                                                             id="map_view2" <?php if ($mapview == 'HYBRID') {
1175 1175
                             echo 'checked="checked"';
1176 1176
                         } ?>  value="HYBRID" size="25"/> <?php _e('Hybrid Map', 'geodirectory'); ?></span>
1177 1177
 					<span class="geodir_user_define"><input field_type="<?php echo $type; ?>" type="radio"
1178 1178
                                                             class="gd-checkbox"
1179
-                                                            name="<?php echo $prefix . 'mapview'; ?>"
1179
+                                                            name="<?php echo $prefix.'mapview'; ?>"
1180 1180
                                                             id="map_view3" <?php if ($mapview == 'TERRAIN') {
1181 1181
                             echo 'checked="checked"';
1182 1182
                         } ?>  value="TERRAIN" size="25"/> <?php _e('Terrain Map', 'geodirectory'); ?></span>
@@ -1188,7 +1188,7 @@  discard block
 block discarded – undo
1188 1188
         <?php if (isset($extra_fields['show_mapzoom']) && $extra_fields['show_mapzoom']) { ?>
1189 1189
             <input type="hidden" value="<?php if (isset($mapzoom)) {
1190 1190
                 echo esc_attr($mapzoom);
1191
-            } ?>" name="<?php echo $prefix . 'mapzoom'; ?>" id="<?php echo $prefix . 'mapzoom'; ?>"/>
1191
+            } ?>" name="<?php echo $prefix.'mapzoom'; ?>" id="<?php echo $prefix.'mapzoom'; ?>"/>
1192 1192
         <?php }
1193 1193
 
1194 1194
         $html = ob_get_clean();
@@ -1196,7 +1196,7 @@  discard block
 block discarded – undo
1196 1196
 
1197 1197
     return $html;
1198 1198
 }
1199
-add_filter('geodir_custom_field_input_address','geodir_cfi_address',10,2);
1199
+add_filter('geodir_custom_field_input_address', 'geodir_cfi_address', 10, 2);
1200 1200
 
1201 1201
 
1202 1202
 
@@ -1209,12 +1209,12 @@  discard block
 block discarded – undo
1209 1209
  *
1210 1210
  * @return string The html to output for the custom field.
1211 1211
  */
1212
-function geodir_cfi_taxonomy($html,$cf){
1212
+function geodir_cfi_taxonomy($html, $cf) {
1213 1213
 
1214 1214
     $html_var = $cf['htmlvar_name'];
1215 1215
 
1216 1216
     // Check if there is a custom field specific filter.
1217
-    if(has_filter("geodir_custom_field_input_taxonomy_{$html_var}")){
1217
+    if (has_filter("geodir_custom_field_input_taxonomy_{$html_var}")) {
1218 1218
         /**
1219 1219
          * Filter the taxonomy html by individual custom field.
1220 1220
          *
@@ -1222,11 +1222,11 @@  discard block
 block discarded – undo
1222 1222
          * @param array $cf The custom field array.
1223 1223
          * @since 1.6.6
1224 1224
          */
1225
-        $html = apply_filters("geodir_custom_field_input_taxonomy_{$html_var}",$html,$cf);
1225
+        $html = apply_filters("geodir_custom_field_input_taxonomy_{$html_var}", $html, $cf);
1226 1226
     }
1227 1227
 
1228 1228
     // If no html then we run the standard output.
1229
-    if(empty($html)) {
1229
+    if (empty($html)) {
1230 1230
 
1231 1231
         ob_start(); // Start  buffering;
1232 1232
         $value = geodir_get_cf_value($cf);
@@ -1241,15 +1241,15 @@  discard block
 block discarded – undo
1241 1241
         if ($value == $cf['default']) {
1242 1242
             $value = '';
1243 1243
         } ?>
1244
-        <div id="<?php echo $name;?>_row"
1245
-             class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
1244
+        <div id="<?php echo $name; ?>_row"
1245
+             class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
1246 1246
             <label>
1247 1247
                 <?php $site_title = __($site_title, 'geodirectory');
1248 1248
                 echo (trim($site_title)) ? $site_title : '&nbsp;'; ?>
1249
-                <?php if ($is_required) echo '<span>*</span>';?>
1249
+                <?php if ($is_required) echo '<span>*</span>'; ?>
1250 1250
             </label>
1251 1251
 
1252
-            <div id="<?php echo $name;?>" class="geodir_taxonomy_field" style="float:left; width:70%;">
1252
+            <div id="<?php echo $name; ?>" class="geodir_taxonomy_field" style="float:left; width:70%;">
1253 1253
                 <?php
1254 1254
                 global $wpdb, $post, $cat_display, $post_cat, $package_id, $exclude_cats;
1255 1255
 
@@ -1261,7 +1261,7 @@  discard block
 block discarded – undo
1261 1261
 
1262 1262
                     $package_info = array();
1263 1263
 
1264
-                    $package_info = (array)geodir_post_package_info($package_info, $post, $post_type);
1264
+                    $package_info = (array) geodir_post_package_info($package_info, $post, $post_type);
1265 1265
 
1266 1266
                     if (!empty($package_info)) {
1267 1267
 
@@ -1290,7 +1290,7 @@  discard block
 block discarded – undo
1290 1290
 
1291 1291
                     $catadd_limit = $wpdb->get_var(
1292 1292
                         $wpdb->prepare(
1293
-                            "SELECT cat_limit FROM " . GEODIR_PRICE_TABLE . " WHERE pid = %d",
1293
+                            "SELECT cat_limit FROM ".GEODIR_PRICE_TABLE." WHERE pid = %d",
1294 1294
                             array($package_id)
1295 1295
                         )
1296 1296
                     );
@@ -1306,13 +1306,13 @@  discard block
 block discarded – undo
1306 1306
                     $required_limit_msg = '';
1307 1307
                     if ($catadd_limit > 0 && $cat_display != 'select' && $cat_display != 'radio') {
1308 1308
 
1309
-                        $required_limit_msg = __('Only select', 'geodirectory') . ' ' . $catadd_limit . __(' categories for this package.', 'geodirectory');
1309
+                        $required_limit_msg = __('Only select', 'geodirectory').' '.$catadd_limit.__(' categories for this package.', 'geodirectory');
1310 1310
 
1311 1311
                     } else {
1312 1312
                         $required_limit_msg = $required_msg;
1313 1313
                     }
1314 1314
 
1315
-                    echo '<input type="hidden" cat_limit="' . $catadd_limit . '" id="cat_limit" value="' . esc_attr($required_limit_msg) . '" name="cat_limit[' . $name . ']"  />';
1315
+                    echo '<input type="hidden" cat_limit="'.$catadd_limit.'" id="cat_limit" value="'.esc_attr($required_limit_msg).'" name="cat_limit['.$name.']"  />';
1316 1316
 
1317 1317
 
1318 1318
                     if ($cat_display == 'select' || $cat_display == 'multiselect') {
@@ -1322,11 +1322,11 @@  discard block
 block discarded – undo
1322 1322
                         if ($cat_display == 'multiselect')
1323 1323
                             $multiple = 'multiple="multiple"';
1324 1324
 
1325
-                        echo '<select id="' . $name . '" ' . $multiple . ' type="' . $name . '" name="post_category[' . $name . '][]" alt="' . $name . '" field_type="' . $cat_display . '" class="geodir_textfield textfield_x chosen_select" data-placeholder="' . __('Select Category', 'geodirectory') . '">';
1325
+                        echo '<select id="'.$name.'" '.$multiple.' type="'.$name.'" name="post_category['.$name.'][]" alt="'.$name.'" field_type="'.$cat_display.'" class="geodir_textfield textfield_x chosen_select" data-placeholder="'.__('Select Category', 'geodirectory').'">';
1326 1326
 
1327 1327
 
1328 1328
                         if ($cat_display == 'select')
1329
-                            echo '<option value="">' . __('Select Category', 'geodirectory') . '</option>';
1329
+                            echo '<option value="">'.__('Select Category', 'geodirectory').'</option>';
1330 1330
 
1331 1331
                     }
1332 1332
 
@@ -1344,7 +1344,7 @@  discard block
 block discarded – undo
1344 1344
                 ?>
1345 1345
             </div>
1346 1346
 
1347
-            <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory');?></span>
1347
+            <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory'); ?></span>
1348 1348
             <?php if ($is_required) { ?>
1349 1349
                 <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span>
1350 1350
             <?php } ?>
@@ -1356,7 +1356,7 @@  discard block
 block discarded – undo
1356 1356
 
1357 1357
     return $html;
1358 1358
 }
1359
-add_filter('geodir_custom_field_input_taxonomy','geodir_cfi_taxonomy',10,2);
1359
+add_filter('geodir_custom_field_input_taxonomy', 'geodir_cfi_taxonomy', 10, 2);
1360 1360
 
1361 1361
 
1362 1362
 /**
@@ -1368,12 +1368,12 @@  discard block
 block discarded – undo
1368 1368
  *
1369 1369
  * @return string The html to output for the custom field.
1370 1370
  */
1371
-function geodir_cfi_file($html,$cf){
1371
+function geodir_cfi_file($html, $cf) {
1372 1372
 
1373 1373
     $html_var = $cf['htmlvar_name'];
1374 1374
 
1375 1375
     // Check if there is a custom field specific filter.
1376
-    if(has_filter("geodir_custom_field_input_file_{$html_var}")){
1376
+    if (has_filter("geodir_custom_field_input_file_{$html_var}")) {
1377 1377
         /**
1378 1378
          * Filter the file html by individual custom field.
1379 1379
          *
@@ -1381,11 +1381,11 @@  discard block
 block discarded – undo
1381 1381
          * @param array $cf The custom field array.
1382 1382
          * @since 1.6.6
1383 1383
          */
1384
-        $html = apply_filters("geodir_custom_field_input_file_{$html_var}",$html,$cf);
1384
+        $html = apply_filters("geodir_custom_field_input_file_{$html_var}", $html, $cf);
1385 1385
     }
1386 1386
 
1387 1387
     // If no html then we run the standard output.
1388
-    if(empty($html)) {
1388
+    if (empty($html)) {
1389 1389
 
1390 1390
         ob_start(); // Start  buffering;
1391 1391
         $value = geodir_get_cf_value($cf);
@@ -1428,8 +1428,8 @@  discard block
 block discarded – undo
1428 1428
                 $file_totImg = count($curImages);
1429 1429
         }
1430 1430
 
1431
-        $allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types'] ) ? implode(",", $extra_fields['gd_file_types']) : '';
1432
-        $display_file_types = $allowed_file_types != '' ? '.' . implode(", .", $extra_fields['gd_file_types']) : '';
1431
+        $allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types']) ? implode(",", $extra_fields['gd_file_types']) : '';
1432
+        $display_file_types = $allowed_file_types != '' ? '.'.implode(", .", $extra_fields['gd_file_types']) : '';
1433 1433
 
1434 1434
         ?>
1435 1435
         <?php /*?> <h5 class="geodir-form_title"> <?php echo $site_title; ?>
@@ -1439,13 +1439,13 @@  discard block
 block discarded – undo
1439 1439
 			</h5>   <?php */
1440 1440
         ?>
1441 1441
 
1442
-        <div id="<?php echo $name;?>_row"
1443
-             class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix gd-fieldset-details">
1442
+        <div id="<?php echo $name; ?>_row"
1443
+             class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix gd-fieldset-details">
1444 1444
 
1445 1445
             <div id="<?php echo $file_id; ?>dropbox" style="text-align:center;">
1446 1446
                 <label
1447 1447
                     style="text-align:left; padding-top:10px;"><?php $site_title = __($site_title, 'geodirectory');
1448
-                    echo $site_title; ?><?php if ($is_required) echo '<span>*</span>';?></label>
1448
+                    echo $site_title; ?><?php if ($is_required) echo '<span>*</span>'; ?></label>
1449 1449
                 <input class="geodir-custom-file-upload" field_type="file" type="hidden"
1450 1450
                        name="<?php echo $file_id; ?>" id="<?php echo $file_id; ?>"
1451 1451
                        value="<?php echo esc_attr($file_value); ?>"/>
@@ -1453,7 +1453,7 @@  discard block
 block discarded – undo
1453 1453
                        id="<?php echo $file_id; ?>image_limit" value="<?php echo $file_image_limit; ?>"/>
1454 1454
                 <?php if ($allowed_file_types != '') { ?>
1455 1455
                     <input type="hidden" name="<?php echo $file_id; ?>_allowed_types"
1456
-                           id="<?php echo $file_id; ?>_allowed_types" value="<?php echo esc_attr($allowed_file_types); ?>" data-exts="<?php echo esc_attr($display_file_types);?>"/>
1456
+                           id="<?php echo $file_id; ?>_allowed_types" value="<?php echo esc_attr($allowed_file_types); ?>" data-exts="<?php echo esc_attr($display_file_types); ?>"/>
1457 1457
                 <?php } ?>
1458 1458
                 <input type="hidden" name="<?php echo $file_id; ?>totImg" id="<?php echo $file_id; ?>totImg"
1459 1459
                        value="<?php if (isset($file_totImg)) {
@@ -1469,10 +1469,10 @@  discard block
 block discarded – undo
1469 1469
                         <?php /*?><h4><?php _e('Drop files to upload');?></h4><br/><?php */
1470 1470
                         ?>
1471 1471
                         <input id="<?php echo $file_id; ?>plupload-browse-button" type="button"
1472
-                               value="<?php ($file_image_limit > 1 ? esc_attr_e('Select Files', 'geodirectory') : esc_attr_e('Select File', 'geodirectory') ); ?>"
1472
+                               value="<?php ($file_image_limit > 1 ? esc_attr_e('Select Files', 'geodirectory') : esc_attr_e('Select File', 'geodirectory')); ?>"
1473 1473
                                class="geodir_button" style="margin-top:10px;"/>
1474 1474
                             <span class="ajaxnonceplu"
1475
-                                  id="ajaxnonceplu<?php echo wp_create_nonce($file_id . 'pluploadan'); ?>"></span>
1475
+                                  id="ajaxnonceplu<?php echo wp_create_nonce($file_id.'pluploadan'); ?>"></span>
1476 1476
                         <?php if ($file_width && $file_height): ?>
1477 1477
                             <span class="plupload-resize"></span>
1478 1478
                             <span class="plupload-width" id="plupload-width<?php echo $file_width; ?>"></span>
@@ -1492,7 +1492,7 @@  discard block
 block discarded – undo
1492 1492
 
1493 1493
                 </div>
1494 1494
             </div>
1495
-            <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory');?> <?php echo ( $display_file_types != '' ? __('Allowed file types:', 'geodirectory') . ' ' . $display_file_types : '' );?></span>
1495
+            <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory'); ?> <?php echo ($display_file_types != '' ? __('Allowed file types:', 'geodirectory').' '.$display_file_types : ''); ?></span>
1496 1496
             <?php if ($is_required) { ?>
1497 1497
                 <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span>
1498 1498
             <?php } ?>
@@ -1505,4 +1505,4 @@  discard block
 block discarded – undo
1505 1505
 
1506 1506
     return $html;
1507 1507
 }
1508
-add_filter('geodir_custom_field_input_file','geodir_cfi_file',10,2);
1509 1508
\ No newline at end of file
1509
+add_filter('geodir_custom_field_input_file', 'geodir_cfi_file', 10, 2);
1510 1510
\ No newline at end of file
Please login to merge, or discard this patch.
geodirectory-functions/post_functions.php 1 patch
Spacing   +204 added lines, -204 removed lines patch added patch discarded remove patch
@@ -26,11 +26,11 @@  discard block
 block discarded – undo
26 26
 
27 27
     if (!isset($default_cat) || empty($default_cat)) {
28 28
         $default_cat = isset($post_cat_array[0]) ? $post_cat_array[0] : '';
29
-    }else{
30
-        if(!is_int($default_cat)){
29
+    } else {
30
+        if (!is_int($default_cat)) {
31 31
             $category = get_term_by('name', $default_cat, $taxonomy);
32
-            if(isset($category->term_id)){
33
-                $default_cat =  $category->term_id;
32
+            if (isset($category->term_id)) {
33
+                $default_cat = $category->term_id;
34 34
             }
35 35
         }
36 36
 
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 
59 59
     if ($default_pos === false) {
60 60
 
61
-        $change_cat_str = str_replace($default_cat . ',y:', $default_cat . ',y,d:', $change_cat_str);
61
+        $change_cat_str = str_replace($default_cat.',y:', $default_cat.',y,d:', $change_cat_str);
62 62
 
63 63
     }
64 64
 
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
         $send_post_submit_mail = false;
228 228
 
229 229
         // unhook this function so it doesn't loop infinitely
230
-        remove_action('save_post', 'geodir_post_information_save',10,2);
230
+        remove_action('save_post', 'geodir_post_information_save', 10, 2);
231 231
 
232 232
         if (isset($request_info['pid']) && $request_info['pid'] != '') {
233 233
             $post['ID'] = $request_info['pid'];
@@ -251,13 +251,13 @@  discard block
 block discarded – undo
251 251
         }
252 252
 
253 253
         // re-hook this function
254
-        add_action('save_post', 'geodir_post_information_save',10,2);
254
+        add_action('save_post', 'geodir_post_information_save', 10, 2);
255 255
 
256 256
         $post_tags = '';
257 257
         if (!isset($request_info['post_tags'])) {
258 258
 
259 259
             $post_type = $request_info['listing_type'];
260
-            $post_tags = implode(",", wp_get_object_terms($last_post_id, $post_type . '_tags', array('fields' => 'names')));
260
+            $post_tags = implode(",", wp_get_object_terms($last_post_id, $post_type.'_tags', array('fields' => 'names')));
261 261
 
262 262
         }
263 263
 
@@ -275,13 +275,13 @@  discard block
 block discarded – undo
275 275
         $payment_info = array();
276 276
         $package_info = array();
277 277
 
278
-        $package_info = (array)geodir_post_package_info($package_info, $post);
278
+        $package_info = (array) geodir_post_package_info($package_info, $post);
279 279
 
280 280
         $post_package_id = geodir_get_post_meta($last_post_id, 'package_id');
281 281
 
282 282
         if (!empty($package_info) && !$post_package_id) {
283 283
             if (isset($package_info['days']) && $package_info['days'] != 0) {
284
-                $payment_info['expire_date'] = date('Y-m-d', strtotime("+" . $package_info['days'] . " days"));
284
+                $payment_info['expire_date'] = date('Y-m-d', strtotime("+".$package_info['days']." days"));
285 285
             } else {
286 286
                 $payment_info['expire_date'] = 'Never';
287 287
             }
@@ -302,8 +302,8 @@  discard block
 block discarded – undo
302 302
             $extrafields = $val['extra_fields'];
303 303
 
304 304
             if (trim($type) == 'address') {
305
-                $prefix = $name . '_';
306
-                $address = $prefix . 'address';
305
+                $prefix = $name.'_';
306
+                $address = $prefix.'address';
307 307
 
308 308
                 if (isset($request_info[$address]) && $request_info[$address] != '') {
309 309
                     $gd_post_info[$address] = wp_slash($request_info[$address]);
@@ -313,59 +313,59 @@  discard block
 block discarded – undo
313 313
                     $extrafields = unserialize($extrafields);
314 314
 
315 315
 
316
-                    if (!isset($request_info[$prefix . 'city']) || $request_info[$prefix . 'city'] == '') {
316
+                    if (!isset($request_info[$prefix.'city']) || $request_info[$prefix.'city'] == '') {
317 317
 
318 318
                         $location_result = geodir_get_default_location();
319 319
 
320
-                        $gd_post_info[$prefix . 'city'] = $location_result->city;
321
-                        $gd_post_info[$prefix . 'region'] = $location_result->region;
322
-                        $gd_post_info[$prefix . 'country'] = $location_result->country;
320
+                        $gd_post_info[$prefix.'city'] = $location_result->city;
321
+                        $gd_post_info[$prefix.'region'] = $location_result->region;
322
+                        $gd_post_info[$prefix.'country'] = $location_result->country;
323 323
 
324
-                        $gd_post_info['post_locations'] = '[' . $location_result->city_slug . '],[' . $location_result->region_slug . '],[' . $location_result->country_slug . ']'; // set all overall post location
324
+                        $gd_post_info['post_locations'] = '['.$location_result->city_slug.'],['.$location_result->region_slug.'],['.$location_result->country_slug.']'; // set all overall post location
325 325
 
326 326
                     } else {
327 327
 
328
-                        $gd_post_info[$prefix . 'city'] = $request_info[$prefix . 'city'];
329
-                        $gd_post_info[$prefix . 'region'] = $request_info[$prefix . 'region'];
330
-                        $gd_post_info[$prefix . 'country'] = $request_info[$prefix . 'country'];
328
+                        $gd_post_info[$prefix.'city'] = $request_info[$prefix.'city'];
329
+                        $gd_post_info[$prefix.'region'] = $request_info[$prefix.'region'];
330
+                        $gd_post_info[$prefix.'country'] = $request_info[$prefix.'country'];
331 331
 
332 332
                         //----------set post locations when import dummy data-------
333 333
                         $location_result = geodir_get_default_location();
334 334
 
335
-                        $gd_post_info['post_locations'] = '[' . $location_result->city_slug . '],[' . $location_result->region_slug . '],[' . $location_result->country_slug . ']'; // set all overall post location
335
+                        $gd_post_info['post_locations'] = '['.$location_result->city_slug.'],['.$location_result->region_slug.'],['.$location_result->country_slug.']'; // set all overall post location
336 336
                         //-----------------------------------------------------------------
337 337
 
338 338
                     }
339 339
 
340 340
 
341
-                    if (isset($extrafields['show_zip']) && $extrafields['show_zip'] && isset($request_info[$prefix . 'zip'])) {
342
-                        $gd_post_info[$prefix . 'zip'] = $request_info[$prefix . 'zip'];
341
+                    if (isset($extrafields['show_zip']) && $extrafields['show_zip'] && isset($request_info[$prefix.'zip'])) {
342
+                        $gd_post_info[$prefix.'zip'] = $request_info[$prefix.'zip'];
343 343
                     }
344 344
 
345 345
 
346 346
                     if (isset($extrafields['show_map']) && $extrafields['show_map']) {
347 347
 
348
-                        if (isset($request_info[$prefix . 'latitude']) && $request_info[$prefix . 'latitude'] != '') {
349
-                            $gd_post_info[$prefix . 'latitude'] = $request_info[$prefix . 'latitude'];
348
+                        if (isset($request_info[$prefix.'latitude']) && $request_info[$prefix.'latitude'] != '') {
349
+                            $gd_post_info[$prefix.'latitude'] = $request_info[$prefix.'latitude'];
350 350
                         }
351 351
 
352
-                        if (isset($request_info[$prefix . 'longitude']) && $request_info[$prefix . 'longitude'] != '') {
353
-                            $gd_post_info[$prefix . 'longitude'] = $request_info[$prefix . 'longitude'];
352
+                        if (isset($request_info[$prefix.'longitude']) && $request_info[$prefix.'longitude'] != '') {
353
+                            $gd_post_info[$prefix.'longitude'] = $request_info[$prefix.'longitude'];
354 354
                         }
355 355
 
356
-                        if (isset($request_info[$prefix . 'mapview']) && $request_info[$prefix . 'mapview'] != '') {
357
-                            $gd_post_info[$prefix . 'mapview'] = $request_info[$prefix . 'mapview'];
356
+                        if (isset($request_info[$prefix.'mapview']) && $request_info[$prefix.'mapview'] != '') {
357
+                            $gd_post_info[$prefix.'mapview'] = $request_info[$prefix.'mapview'];
358 358
                         }
359 359
 
360
-                        if (isset($request_info[$prefix . 'mapzoom']) && $request_info[$prefix . 'mapzoom'] != '') {
361
-                            $gd_post_info[$prefix . 'mapzoom'] = $request_info[$prefix . 'mapzoom'];
360
+                        if (isset($request_info[$prefix.'mapzoom']) && $request_info[$prefix.'mapzoom'] != '') {
361
+                            $gd_post_info[$prefix.'mapzoom'] = $request_info[$prefix.'mapzoom'];
362 362
                         }
363 363
 
364 364
                     }
365 365
 
366 366
                     // show lat lng
367
-                    if (isset($extrafields['show_latlng']) && $extrafields['show_latlng'] && isset($request_info[$prefix . 'latlng'])) {
368
-                        $gd_post_info[$prefix . 'latlng'] = $request_info[$prefix . 'latlng'];
367
+                    if (isset($extrafields['show_latlng']) && $extrafields['show_latlng'] && isset($request_info[$prefix.'latlng'])) {
368
+                        $gd_post_info[$prefix.'latlng'] = $request_info[$prefix.'latlng'];
369 369
                     }
370 370
                 }
371 371
 
@@ -390,16 +390,16 @@  discard block
 block discarded – undo
390 390
 
391 391
                     // check if we need to change the format or not
392 392
                     $date_format_len = strlen(str_replace(' ', '', $date_format));
393
-                    if($date_format_len>5){// if greater then 5 then it's the old style format.
393
+                    if ($date_format_len > 5) {// if greater then 5 then it's the old style format.
394 394
 
395
-                        $search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format
396
-                        $replace = array('d','j','l','m','n','F','Y');//PHP date format
395
+                        $search = array('dd', 'd', 'DD', 'mm', 'm', 'MM', 'yy'); //jQuery UI datepicker format
396
+                        $replace = array('d', 'j', 'l', 'm', 'n', 'F', 'Y'); //PHP date format
397 397
 
398 398
                         $date_format = str_replace($search, $replace, $date_format);
399 399
 
400 400
                         $post_htmlvar_value = $date_format == 'd/m/Y' ? str_replace('/', '-', $request_info[$name]) : $request_info[$name];
401 401
 
402
-                    }else{
402
+                    } else {
403 403
                         $post_htmlvar_value = $request_info[$name];
404 404
                     }
405 405
 
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
                 if (isset($request_info[$name])) {
415 415
                     $gd_post_info[$name] = $request_info[$name];
416 416
                 } else {
417
-                    if (isset($request_info['gd_field_' . $name])) {
417
+                    if (isset($request_info['gd_field_'.$name])) {
418 418
                         $gd_post_info[$name] = ''; /* fix de-select for multiselect */
419 419
                     }
420 420
                 }
@@ -474,7 +474,7 @@  discard block
 block discarded – undo
474 474
         }
475 475
 
476 476
         if (is_array($post_tags)) {
477
-            $taxonomy = $request_info['listing_type'] . '_tags';
477
+            $taxonomy = $request_info['listing_type'].'_tags';
478 478
             wp_set_object_terms($last_post_id, $post_tags, $taxonomy);
479 479
         }
480 480
 
@@ -486,7 +486,7 @@  discard block
 block discarded – undo
486 486
                 $tmpimgArr = trim($request_info['post_images'], ",");
487 487
                 $tmpimgArr = explode(",", $tmpimgArr);
488 488
                 geodir_save_post_images($last_post_id, $tmpimgArr, $dummy);
489
-            } else{
489
+            } else {
490 490
                 geodir_save_post_images($last_post_id, $request_info['post_images'], $dummy);
491 491
             }
492 492
 
@@ -567,7 +567,7 @@  discard block
 block discarded – undo
567 567
     if (!in_array($post_type, $all_postypes))
568 568
         return false;
569 569
 
570
-    $table = $plugin_prefix . $post_type . '_detail';
570
+    $table = $plugin_prefix.$post_type.'_detail';
571 571
 
572 572
     /**
573 573
      * Apply Filter to change Post info
@@ -577,7 +577,7 @@  discard block
 block discarded – undo
577 577
      * @since 1.0.0
578 578
      * @package GeoDirectory
579 579
      */
580
-    $query = apply_filters('geodir_post_info_query', "SELECT p.*,pd.* FROM " . $wpdb->posts . " p," . $table . " pd
580
+    $query = apply_filters('geodir_post_info_query', "SELECT p.*,pd.* FROM ".$wpdb->posts." p,".$table." pd
581 581
 			  WHERE p.ID = pd.post_id
582 582
 			  AND post_id = " . $post_id);
583 583
 
@@ -640,7 +640,7 @@  discard block
 block discarded – undo
640 640
 
641 641
         $post_type = get_post_type($post_id);
642 642
 
643
-        $table = $plugin_prefix . $post_type . '_detail';
643
+        $table = $plugin_prefix.$post_type.'_detail';
644 644
 
645 645
         /**
646 646
          * Filter to change Post info
@@ -663,13 +663,13 @@  discard block
 block discarded – undo
663 663
                         $mval = implode(",", $mval);
664 664
                     }
665 665
 
666
-                    $post_meta_set_query .= $mkey . " = '" . $mval . "', ";
666
+                    $post_meta_set_query .= $mkey." = '".$mval."', ";
667 667
                 }
668 668
             }
669 669
 
670 670
             $post_meta_set_query = trim($post_meta_set_query, ", ");
671 671
 
672
-            $post_meta_set_query = str_replace('%', '%%', $post_meta_set_query);// escape %
672
+            $post_meta_set_query = str_replace('%', '%%', $post_meta_set_query); // escape %
673 673
 
674 674
             /**
675 675
              * Called before saving the listing info.
@@ -681,11 +681,11 @@  discard block
 block discarded – undo
681 681
              */
682 682
             do_action('geodir_before_save_listinginfo', $postinfo_array, $post_id);
683 683
 
684
-            if ($wpdb->get_var($wpdb->prepare("SELECT post_id from " . $table . " where post_id = %d", array($post_id)))) {
684
+            if ($wpdb->get_var($wpdb->prepare("SELECT post_id from ".$table." where post_id = %d", array($post_id)))) {
685 685
 
686 686
                 $wpdb->query(
687 687
                     $wpdb->prepare(
688
-                        "UPDATE " . $table . " SET " . $post_meta_set_query . " where post_id =%d",
688
+                        "UPDATE ".$table." SET ".$post_meta_set_query." where post_id =%d",
689 689
                         array($post_id)
690 690
                     )
691 691
                 );
@@ -695,7 +695,7 @@  discard block
 block discarded – undo
695 695
 
696 696
                 $wpdb->query(
697 697
                     $wpdb->prepare(
698
-                        "INSERT INTO " . $table . " SET post_id = %d," . $post_meta_set_query,
698
+                        "INSERT INTO ".$table." SET post_id = %d,".$post_meta_set_query,
699 699
                         array($post_id)
700 700
                     )
701 701
                 );
@@ -741,7 +741,7 @@  discard block
 block discarded – undo
741 741
 
742 742
         $post_type = get_post_type($post_id);
743 743
 
744
-        $table = $plugin_prefix . $post_type . '_detail';
744
+        $table = $plugin_prefix.$post_type.'_detail';
745 745
 
746 746
         if ($postmeta != '' && geodir_column_exist($table, $postmeta) && $post_id) {
747 747
 
@@ -749,11 +749,11 @@  discard block
 block discarded – undo
749 749
                 $meta_value = implode(",", $meta_value);
750 750
             }
751 751
 
752
-            if ($wpdb->get_var($wpdb->prepare("SELECT post_id from " . $table . " where post_id = %d", array($post_id)))) {
752
+            if ($wpdb->get_var($wpdb->prepare("SELECT post_id from ".$table." where post_id = %d", array($post_id)))) {
753 753
 
754 754
                 $wpdb->query(
755 755
                     $wpdb->prepare(
756
-                        "UPDATE " . $table . " SET " . $postmeta . " = '" . $meta_value . "' where post_id =%d",
756
+                        "UPDATE ".$table." SET ".$postmeta." = '".$meta_value."' where post_id =%d",
757 757
                         array($post_id)
758 758
                     )
759 759
                 );
@@ -762,7 +762,7 @@  discard block
 block discarded – undo
762 762
 
763 763
                 $wpdb->query(
764 764
                     $wpdb->prepare(
765
-                        "INSERT INTO " . $table . " SET post_id = %d, " . $postmeta . " = '" . $meta_value . "'",
765
+                        "INSERT INTO ".$table." SET post_id = %d, ".$postmeta." = '".$meta_value."'",
766 766
                         array($post_id)
767 767
                     )
768 768
                 );
@@ -795,23 +795,23 @@  discard block
 block discarded – undo
795 795
 
796 796
         $post_type = get_post_type($post_id);
797 797
 
798
-        $table = $plugin_prefix . $post_type . '_detail';
798
+        $table = $plugin_prefix.$post_type.'_detail';
799 799
 
800 800
         if (is_array($postmeta) && !empty($postmeta) && $post_id) {
801 801
             $post_meta_set_query = '';
802 802
 
803 803
             foreach ($postmeta as $mkey) {
804 804
                 if ($mval != '')
805
-                    $post_meta_set_query .= $mkey . " = '', ";
805
+                    $post_meta_set_query .= $mkey." = '', ";
806 806
             }
807 807
 
808 808
             $post_meta_set_query = trim($post_meta_set_query, ", ");
809 809
 
810
-            if ($wpdb->get_var("SHOW COLUMNS FROM " . $table . " WHERE field = '" . $postmeta . "'") != '') {
810
+            if ($wpdb->get_var("SHOW COLUMNS FROM ".$table." WHERE field = '".$postmeta."'") != '') {
811 811
 
812 812
                 $wpdb->query(
813 813
                     $wpdb->prepare(
814
-                        "UPDATE " . $table . " SET " . $post_meta_set_query . " where post_id = %d",
814
+                        "UPDATE ".$table." SET ".$post_meta_set_query." where post_id = %d",
815 815
                         array($post_id)
816 816
                     )
817 817
                 );
@@ -820,11 +820,11 @@  discard block
 block discarded – undo
820 820
             }
821 821
 
822 822
         } elseif ($postmeta != '' && $post_id) {
823
-            if ($wpdb->get_var("SHOW COLUMNS FROM " . $table . " WHERE field = '" . $postmeta . "'") != '') {
823
+            if ($wpdb->get_var("SHOW COLUMNS FROM ".$table." WHERE field = '".$postmeta."'") != '') {
824 824
 
825 825
                 $wpdb->query(
826 826
                     $wpdb->prepare(
827
-                        "UPDATE " . $table . " SET " . $postmeta . "= '' where post_id = %d",
827
+                        "UPDATE ".$table." SET ".$postmeta."= '' where post_id = %d",
828 828
                         array($post_id)
829 829
                     )
830 830
                 );
@@ -866,10 +866,10 @@  discard block
 block discarded – undo
866 866
         if (!in_array($post_type, $all_postypes))
867 867
             return false;
868 868
 
869
-        $table = $plugin_prefix . $post_type . '_detail';
869
+        $table = $plugin_prefix.$post_type.'_detail';
870 870
 
871
-        if ($wpdb->get_var("SHOW COLUMNS FROM " . $table . " WHERE field = '" . $meta_key . "'") != '') {
872
-            $meta_value = $wpdb->get_var($wpdb->prepare("SELECT " . $meta_key . " from " . $table . " where post_id = %d", array($post_id)));
871
+        if ($wpdb->get_var("SHOW COLUMNS FROM ".$table." WHERE field = '".$meta_key."'") != '') {
872
+            $meta_value = $wpdb->get_var($wpdb->prepare("SELECT ".$meta_key." from ".$table." where post_id = %d", array($post_id)));
873 873
             
874 874
             if ($meta_value && $meta_value !== '') {
875 875
                 return maybe_serialize($meta_value);
@@ -903,13 +903,13 @@  discard block
 block discarded – undo
903 903
 
904 904
         $post_type = get_post_type($post_id);
905 905
 
906
-        $table = $plugin_prefix . $post_type . '_detail';
906
+        $table = $plugin_prefix.$post_type.'_detail';
907 907
 
908 908
         $post_images = geodir_get_images($post_id);
909 909
 
910 910
         $wpdb->query(
911 911
             $wpdb->prepare(
912
-                "UPDATE " . $table . " SET featured_image = '' where post_id =%d",
912
+                "UPDATE ".$table." SET featured_image = '' where post_id =%d",
913 913
                 array($post_id)
914 914
             )
915 915
         );
@@ -939,12 +939,12 @@  discard block
 block discarded – undo
939 939
                 $file_path = '';
940 940
                 /* --------- start ------- */
941 941
 
942
-                $split_img_path = explode(str_replace(array('http://','https://'),'',$uploads['baseurl']), str_replace(array('http://','https://'),'',$post_image[$m]));
942
+                $split_img_path = explode(str_replace(array('http://', 'https://'), '', $uploads['baseurl']), str_replace(array('http://', 'https://'), '', $post_image[$m]));
943 943
 
944 944
                 $split_img_file_path = isset($split_img_path[1]) ? $split_img_path[1] : '';
945 945
 
946 946
 
947
-                if (!$find_image = $wpdb->get_var($wpdb->prepare("SELECT ID FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE file=%s AND post_id = %d", array($split_img_file_path, $post_id)))) {
947
+                if (!$find_image = $wpdb->get_var($wpdb->prepare("SELECT ID FROM ".GEODIR_ATTACHMENT_TABLE." WHERE file=%s AND post_id = %d", array($split_img_file_path, $post_id)))) {
948 948
 
949 949
                     /* --------- end ------- */
950 950
                     $curr_img_url = $post_image[$m];
@@ -988,7 +988,7 @@  discard block
 block discarded – undo
988 988
                     // If the uploaded file is the right format
989 989
                     if (in_array($uploaded_file_type, $allowed_file_types)) {
990 990
                         if (!function_exists('wp_handle_upload')) {
991
-                            require_once(ABSPATH . 'wp-admin/includes/file.php');
991
+                            require_once(ABSPATH.'wp-admin/includes/file.php');
992 992
                         }
993 993
 
994 994
                         if (!is_dir($geodir_uploadpath)) {
@@ -996,41 +996,41 @@  discard block
 block discarded – undo
996 996
                         }
997 997
 
998 998
                         $external_img = false;
999
-                        if (strpos(str_replace(array('http://','https://'),'',$curr_img_url), str_replace(array('http://','https://'),'',$uploads['baseurl'])) !== false) {
999
+                        if (strpos(str_replace(array('http://', 'https://'), '', $curr_img_url), str_replace(array('http://', 'https://'), '', $uploads['baseurl'])) !== false) {
1000 1000
                         } else {
1001 1001
                             $external_img = true;
1002 1002
                         }
1003 1003
 
1004 1004
                         if ($dummy || $external_img) {
1005 1005
                             $uploaded_file = array();
1006
-                            $uploaded = (array)fetch_remote_file($curr_img_url);
1006
+                            $uploaded = (array) fetch_remote_file($curr_img_url);
1007 1007
 
1008 1008
                             if (isset($uploaded['error']) && empty($uploaded['error'])) {
1009 1009
                                 $new_name = basename($uploaded['file']);
1010 1010
                                 $uploaded_file = $uploaded;
1011
-                            }else{
1012
-                                print_r($uploaded);exit;
1011
+                            } else {
1012
+                                print_r($uploaded); exit;
1013 1013
                             }
1014 1014
                             $external_img = false;
1015 1015
                         } else {
1016
-                            $new_name = $post_id . '_' . $file_name;
1016
+                            $new_name = $post_id.'_'.$file_name;
1017 1017
 
1018 1018
                             if ($curr_img_dir == $sub_dir) {
1019
-                                $img_path = $geodir_uploadpath . '/' . $filename;
1020
-                                $img_url = $geodir_uploadurl . '/' . $filename;
1019
+                                $img_path = $geodir_uploadpath.'/'.$filename;
1020
+                                $img_url = $geodir_uploadurl.'/'.$filename;
1021 1021
                             } else {
1022
-                                $img_path = $uploads_dir . '/temp_' . $current_user->data->ID . '/' . $filename;
1023
-                                $img_url = $uploads['url'] . '/temp_' . $current_user->data->ID . '/' . $filename;
1022
+                                $img_path = $uploads_dir.'/temp_'.$current_user->data->ID.'/'.$filename;
1023
+                                $img_url = $uploads['url'].'/temp_'.$current_user->data->ID.'/'.$filename;
1024 1024
                             }
1025 1025
 
1026 1026
                             $uploaded_file = '';
1027 1027
 
1028 1028
                             if (file_exists($img_path)) {
1029
-                                $uploaded_file = copy($img_path, $geodir_uploadpath . '/' . $new_name);
1029
+                                $uploaded_file = copy($img_path, $geodir_uploadpath.'/'.$new_name);
1030 1030
                                 $file_path = '';
1031
-                            } else if (file_exists($uploads['basedir'] . $curr_img_dir . $filename)) {
1031
+                            } else if (file_exists($uploads['basedir'].$curr_img_dir.$filename)) {
1032 1032
                                 $uploaded_file = true;
1033
-                                $file_path = $curr_img_dir . '/' . $filename;
1033
+                                $file_path = $curr_img_dir.'/'.$filename;
1034 1034
                             }
1035 1035
 
1036 1036
                             if ($curr_img_dir != $geodir_uploaddir && file_exists($img_path))
@@ -1039,14 +1039,14 @@  discard block
 block discarded – undo
1039 1039
 
1040 1040
                         if (!empty($uploaded_file)) {
1041 1041
                             if (!isset($file_path) || !$file_path) {
1042
-                                $file_path = $sub_dir . '/' . $new_name;
1042
+                                $file_path = $sub_dir.'/'.$new_name;
1043 1043
                             }
1044 1044
 
1045
-                            $postcurr_images[] = str_replace(array('http://','https://'),'',$uploads['baseurl'] . $file_path);
1045
+                            $postcurr_images[] = str_replace(array('http://', 'https://'), '', $uploads['baseurl'].$file_path);
1046 1046
 
1047 1047
                             if ($menu_order == 1) {
1048 1048
 
1049
-                                $wpdb->query($wpdb->prepare("UPDATE " . $table . " SET featured_image = %s where post_id =%d", array($file_path, $post_id)));
1049
+                                $wpdb->query($wpdb->prepare("UPDATE ".$table." SET featured_image = %s where post_id =%d", array($file_path, $post_id)));
1050 1050
 
1051 1051
                             }
1052 1052
 
@@ -1064,12 +1064,12 @@  discard block
 block discarded – undo
1064 1064
 
1065 1065
                             foreach ($attachment as $key => $val) {
1066 1066
                                 if ($val != '')
1067
-                                    $attachment_set .= $key . " = '" . $val . "', ";
1067
+                                    $attachment_set .= $key." = '".$val."', ";
1068 1068
                             }
1069 1069
 
1070 1070
                             $attachment_set = trim($attachment_set, ", ");
1071 1071
 
1072
-                            $wpdb->query("INSERT INTO " . GEODIR_ATTACHMENT_TABLE . " SET " . $attachment_set);
1072
+                            $wpdb->query("INSERT INTO ".GEODIR_ATTACHMENT_TABLE." SET ".$attachment_set);
1073 1073
 
1074 1074
                             $valid_file_ids[] = $wpdb->insert_id;
1075 1075
                         }
@@ -1080,17 +1080,17 @@  discard block
 block discarded – undo
1080 1080
                 } else {
1081 1081
                     $valid_file_ids[] = $find_image;
1082 1082
 
1083
-                    $postcurr_images[] = str_replace(array('http://','https://'),'',$post_image[$m]);
1083
+                    $postcurr_images[] = str_replace(array('http://', 'https://'), '', $post_image[$m]);
1084 1084
 
1085 1085
                     $wpdb->query(
1086 1086
                         $wpdb->prepare(
1087
-                            "UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order = %d where file =%s AND post_id =%d",
1087
+                            "UPDATE ".GEODIR_ATTACHMENT_TABLE." SET menu_order = %d where file =%s AND post_id =%d",
1088 1088
                             array($menu_order, $split_img_path[1], $post_id)
1089 1089
                         )
1090 1090
                     );
1091 1091
 
1092 1092
                     if ($menu_order == 1)
1093
-                        $wpdb->query($wpdb->prepare("UPDATE " . $table . " SET featured_image = %s where post_id =%d", array($split_img_path[1], $post_id)));
1093
+                        $wpdb->query($wpdb->prepare("UPDATE ".$table." SET featured_image = %s where post_id =%d", array($split_img_path[1], $post_id)));
1094 1094
 
1095 1095
                 }
1096 1096
 
@@ -1114,9 +1114,9 @@  discard block
 block discarded – undo
1114 1114
 
1115 1115
                 foreach ($post_images as $img) {
1116 1116
 
1117
-                    if (!in_array(str_replace(array('http://','https://'),'',$img->src), $postcurr_images)) {
1117
+                    if (!in_array(str_replace(array('http://', 'https://'), '', $img->src), $postcurr_images)) {
1118 1118
 
1119
-                        $invalid_files[] = (object)array('src' => $img->src);
1119
+                        $invalid_files[] = (object) array('src' => $img->src);
1120 1120
 
1121 1121
                     }
1122 1122
 
@@ -1124,12 +1124,12 @@  discard block
 block discarded – undo
1124 1124
 
1125 1125
             }
1126 1126
 
1127
-            $invalid_files = (object)$invalid_files;
1127
+            $invalid_files = (object) $invalid_files;
1128 1128
         }
1129 1129
 
1130 1130
         $remove_files[] = $post_id;
1131 1131
 
1132
-        $wpdb->query($wpdb->prepare("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE " . $valid_files_condition . " post_id = %d", $remove_files));
1132
+        $wpdb->query($wpdb->prepare("DELETE FROM ".GEODIR_ATTACHMENT_TABLE." WHERE ".$valid_files_condition." post_id = %d", $remove_files));
1133 1133
 
1134 1134
         if (!empty($invalid_files))
1135 1135
             geodir_remove_attachments($invalid_files);
@@ -1169,7 +1169,7 @@  discard block
 block discarded – undo
1169 1169
 			rmdir($dirPath);
1170 1170
 	}	*/
1171 1171
 
1172
-    $dirname = $uploads_dir . '/temp_' . $current_user->ID;
1172
+    $dirname = $uploads_dir.'/temp_'.$current_user->ID;
1173 1173
     geodir_delete_directory($dirname);
1174 1174
 }
1175 1175
 
@@ -1191,10 +1191,10 @@  discard block
 block discarded – undo
1191 1191
         return false;
1192 1192
     while ($file = readdir($dir_handle)) {
1193 1193
         if ($file != "." && $file != "..") {
1194
-            if (!is_dir($dirname . "/" . $file))
1195
-                unlink($dirname . "/" . $file);
1194
+            if (!is_dir($dirname."/".$file))
1195
+                unlink($dirname."/".$file);
1196 1196
             else
1197
-                geodir_delete_directory($dirname . '/' . $file);
1197
+                geodir_delete_directory($dirname.'/'.$file);
1198 1198
         }
1199 1199
     }
1200 1200
     closedir($dir_handle);
@@ -1223,8 +1223,8 @@  discard block
 block discarded – undo
1223 1223
             foreach ($postcurr_images as $postimg) {
1224 1224
                 $image_name_arr = explode('/', $postimg->src);
1225 1225
                 $filename = end($image_name_arr);
1226
-                if (file_exists($uploads_dir . '/' . $filename))
1227
-                    unlink($uploads_dir . '/' . $filename);
1226
+                if (file_exists($uploads_dir.'/'.$filename))
1227
+                    unlink($uploads_dir.'/'.$filename);
1228 1228
             }
1229 1229
 
1230 1230
         } // endif
@@ -1265,16 +1265,16 @@  discard block
 block discarded – undo
1265 1265
         }
1266 1266
 
1267 1267
         if (!in_array($post_type, geodir_get_posttypes())) {
1268
-            return false;// if not a GD CPT return;
1268
+            return false; // if not a GD CPT return;
1269 1269
         }
1270 1270
 
1271
-        $table = $plugin_prefix . $post_type . '_detail';
1271
+        $table = $plugin_prefix.$post_type.'_detail';
1272 1272
 
1273 1273
         if (!$file) {
1274 1274
             if (isset($post->featured_image)) {
1275 1275
                 $file = $post->featured_image;
1276 1276
             } else {
1277
-                $file = $wpdb->get_var($wpdb->prepare("SELECT featured_image FROM " . $table . " WHERE post_id = %d", array($post_id)));
1277
+                $file = $wpdb->get_var($wpdb->prepare("SELECT featured_image FROM ".$table." WHERE post_id = %d", array($post_id)));
1278 1278
             }
1279 1279
         }
1280 1280
 
@@ -1292,7 +1292,7 @@  discard block
 block discarded – undo
1292 1292
 
1293 1293
             $file_name = $file_info['basename'];
1294 1294
 
1295
-            $uploads_url = $uploads_baseurl . $sub_dir;
1295
+            $uploads_url = $uploads_baseurl.$sub_dir;
1296 1296
             /*
1297 1297
              * Allows the filter of image src for such things as CDN change.
1298 1298
              *
@@ -1302,8 +1302,8 @@  discard block
 block discarded – undo
1302 1302
              * @param string $uploads_url The server upload directory url.
1303 1303
              * @param string $uploads_baseurl The uploads dir base url.
1304 1304
              */
1305
-            $img_arr['src'] = apply_filters('geodir_get_featured_image_src',$uploads_url . '/' . $file_name,$file_name,$uploads_url,$uploads_baseurl);
1306
-            $img_arr['path'] = $uploads_path . '/' . $file_name;
1305
+            $img_arr['src'] = apply_filters('geodir_get_featured_image_src', $uploads_url.'/'.$file_name, $file_name, $uploads_url, $uploads_baseurl);
1306
+            $img_arr['path'] = $uploads_path.'/'.$file_name;
1307 1307
             $width = 0;
1308 1308
             $height = 0;
1309 1309
             if (is_file($img_arr['path']) && file_exists($img_arr['path'])) {
@@ -1346,7 +1346,7 @@  discard block
 block discarded – undo
1346 1346
                 $file_name = $file_info['basename'];
1347 1347
 
1348 1348
                 $img_arr['src'] = $default_img;
1349
-                $img_arr['path'] = $uploads_path . '/' . $file_name;
1349
+                $img_arr['path'] = $uploads_path.'/'.$file_name;
1350 1350
 
1351 1351
                 $width = 0;
1352 1352
                 $height = 0;
@@ -1363,7 +1363,7 @@  discard block
 block discarded – undo
1363 1363
         }
1364 1364
 
1365 1365
         if (!empty($img_arr))
1366
-            return (object)$img_arr;//return (object)array( 'src' => $file_url, 'path' => $file_path );
1366
+            return (object) $img_arr; //return (object)array( 'src' => $file_url, 'path' => $file_path );
1367 1367
         else
1368 1368
             return false;
1369 1369
     }
@@ -1426,7 +1426,7 @@  discard block
 block discarded – undo
1426 1426
 
1427 1427
         $arrImages = $wpdb->get_results(
1428 1428
             $wpdb->prepare(
1429
-                "SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE mime_type like %s AND post_id = %d" . $not_featured . " ORDER BY menu_order ASC, ID DESC $limit_q ",
1429
+                "SELECT * FROM ".GEODIR_ATTACHMENT_TABLE." WHERE mime_type like %s AND post_id = %d".$not_featured." ORDER BY menu_order ASC, ID DESC $limit_q ",
1430 1430
                 array('%image%', $post_id)
1431 1431
             )
1432 1432
         );
@@ -1452,7 +1452,7 @@  discard block
 block discarded – undo
1452 1452
 
1453 1453
                 $file_name = $file_info['basename'];
1454 1454
 
1455
-                $uploads_url = $uploads_baseurl . $sub_dir;
1455
+                $uploads_url = $uploads_baseurl.$sub_dir;
1456 1456
                 /*
1457 1457
                 * Allows the filter of image src for such things as CDN change.
1458 1458
                 *
@@ -1462,8 +1462,8 @@  discard block
 block discarded – undo
1462 1462
                 * @param string $uploads_url The server upload directory url.
1463 1463
                 * @param string $uploads_baseurl The uploads dir base url.
1464 1464
                 */
1465
-                $img_arr['src'] = apply_filters('geodir_get_images_src',$uploads_url . '/' . $file_name,$file_name,$uploads_url,$uploads_baseurl);
1466
-                $img_arr['path'] = $uploads_path . '/' . $file_name;
1465
+                $img_arr['src'] = apply_filters('geodir_get_images_src', $uploads_url.'/'.$file_name, $file_name, $uploads_url, $uploads_baseurl);
1466
+                $img_arr['path'] = $uploads_path.'/'.$file_name;
1467 1467
                 $width = 0;
1468 1468
                 $height = 0;
1469 1469
                 if (is_file($img_arr['path']) && file_exists($img_arr['path'])) {
@@ -1480,11 +1480,11 @@  discard block
 block discarded – undo
1480 1480
                 $img_arr['content'] = $attechment->content; // add the description to the array
1481 1481
                 $img_arr['is_approved'] = isset($attechment->is_approved) ? $attechment->is_approved : ''; // used for user image moderation. For backward compatibility Default value is 1.
1482 1482
 
1483
-                $return_arr[] = (object)$img_arr;
1483
+                $return_arr[] = (object) $img_arr;
1484 1484
 
1485 1485
                 $counter++;
1486 1486
             }
1487
-            return (object)$return_arr;
1487
+            return (object) $return_arr;
1488 1488
         } else if ($no_images) {
1489 1489
             $default_img = '';
1490 1490
             $default_cat = geodir_get_post_meta($post_id, 'default_category', true);
@@ -1523,7 +1523,7 @@  discard block
 block discarded – undo
1523 1523
                 $img_arr['title'] = $file_info['filename']; // add the title to the array
1524 1524
                 $img_arr['content'] = $file_info['filename']; // add the description to the array
1525 1525
 
1526
-                $return_arr[] = (object)$img_arr;
1526
+                $return_arr[] = (object) $img_arr;
1527 1527
 
1528 1528
                 return $return_arr;
1529 1529
             } else
@@ -1550,8 +1550,8 @@  discard block
 block discarded – undo
1550 1550
 
1551 1551
         $html = '';
1552 1552
         if (!empty($request)) {
1553
-            if (!is_object($request)){
1554
-                $request = (object)$request;
1553
+            if (!is_object($request)) {
1554
+                $request = (object) $request;
1555 1555
             }
1556 1556
 
1557 1557
             if (isset($request->src) && !isset($request->path)) {
@@ -1565,7 +1565,7 @@  discard block
 block discarded – undo
1565 1565
             $img_no_http = str_replace(array("http://", "https://"), "", $request->path);
1566 1566
             $upload_no_http = str_replace(array("http://", "https://"), "", $upload_dir['baseurl']);
1567 1567
             if (strpos($img_no_http, $upload_no_http) !== false) {
1568
-                $request->path = str_replace( $img_no_http,$upload_dir['basedir'], $request->path);
1568
+                $request->path = str_replace($img_no_http, $upload_dir['basedir'], $request->path);
1569 1569
             }
1570 1570
             
1571 1571
             $width = 0;
@@ -1580,7 +1580,7 @@  discard block
 block discarded – undo
1580 1580
             $image->width = $width;
1581 1581
             $image->height = $height;
1582 1582
 
1583
-            $max_size = (object)geodir_get_imagesize($size);
1583
+            $max_size = (object) geodir_get_imagesize($size);
1584 1584
 
1585 1585
             if (!is_wp_error($max_size)) {
1586 1586
                 if ($image->width) {
@@ -1592,15 +1592,15 @@  discard block
 block discarded – undo
1592 1592
                         $width_per = 100;
1593 1593
                 }
1594 1594
 
1595
-                if (is_admin() && !isset($_REQUEST['geodir_ajax'])){
1596
-                    $html = '<div class="geodir_thumbnail"><img style="max-height:' . $max_size->h . 'px;" alt="place image" src="' . $image->src . '"  /></div>';
1595
+                if (is_admin() && !isset($_REQUEST['geodir_ajax'])) {
1596
+                    $html = '<div class="geodir_thumbnail"><img style="max-height:'.$max_size->h.'px;" alt="place image" src="'.$image->src.'"  /></div>';
1597 1597
                 } else {
1598
-                    if($size=='widget-thumb' || !get_option('geodir_lazy_load',1)){
1599
-                        $html = '<div class="geodir_thumbnail" style="background-image:url(\'' . $image->src . '\');"></div>';
1600
-                    }else{
1598
+                    if ($size == 'widget-thumb' || !get_option('geodir_lazy_load', 1)) {
1599
+                        $html = '<div class="geodir_thumbnail" style="background-image:url(\''.$image->src.'\');"></div>';
1600
+                    } else {
1601 1601
                         //$html = '<div class="geodir_thumbnail" style="background-image:url(\'' . $image->src . '\');"></div>';
1602 1602
                         //$html = '<div data-src="'.$image->src.'" class="geodir_thumbnail" ></div>';
1603
-                        $html = '<div data-src="'.str_replace(' ','%20',$image->src).'" class="geodir_thumbnail geodir_lazy_load_thumbnail" ></div>';
1603
+                        $html = '<div data-src="'.str_replace(' ', '%20', $image->src).'" class="geodir_thumbnail geodir_lazy_load_thumbnail" ></div>';
1604 1604
 
1605 1605
                     }
1606 1606
 
@@ -1636,15 +1636,15 @@  discard block
 block discarded – undo
1636 1636
 
1637 1637
         $post_type = get_post_type($post_id);
1638 1638
 
1639
-        $table = $plugin_prefix . $post_type . '_detail';
1639
+        $table = $plugin_prefix.$post_type.'_detail';
1640 1640
 
1641 1641
         if (in_array($post_type, geodir_get_posttypes()) && !wp_is_post_revision($post_id)) {
1642 1642
 
1643
-            if ($taxonomy == $post_type . '_tags') {
1643
+            if ($taxonomy == $post_type.'_tags') {
1644 1644
                 if (isset($_POST['action']) && $_POST['action'] == 'inline-save') {
1645 1645
                     geodir_save_post_meta($post_id, 'post_tags', $terms);
1646 1646
                 }
1647
-            } elseif ($taxonomy == $post_type . 'category') {
1647
+            } elseif ($taxonomy == $post_type.'category') {
1648 1648
                 $srcharr = array('"', '\\');
1649 1649
                 $replarr = array("&quot;", '');
1650 1650
 
@@ -1666,7 +1666,7 @@  discard block
 block discarded – undo
1666 1666
 
1667 1667
                     $wpdb->get_var(
1668 1668
                         $wpdb->prepare(
1669
-                            "DELETE from " . GEODIR_ICON_TABLE . " WHERE cat_id NOT IN ($format) AND post_id = %d ",
1669
+                            "DELETE from ".GEODIR_ICON_TABLE." WHERE cat_id NOT IN ($format) AND post_id = %d ",
1670 1670
                             $cat_ids_array_del
1671 1671
                         )
1672 1672
                     );
@@ -1674,7 +1674,7 @@  discard block
 block discarded – undo
1674 1674
 
1675 1675
                     $post_term = $wpdb->get_col(
1676 1676
                         $wpdb->prepare(
1677
-                            "SELECT term_id FROM " . $wpdb->term_taxonomy . " WHERE term_taxonomy_id IN($format) GROUP BY term_id",
1677
+                            "SELECT term_id FROM ".$wpdb->term_taxonomy." WHERE term_taxonomy_id IN($format) GROUP BY term_id",
1678 1678
                             $cat_ids_array
1679 1679
                         )
1680 1680
                     );
@@ -1696,16 +1696,16 @@  discard block
 block discarded – undo
1696 1696
                         $lat = geodir_get_post_meta($post_id, 'post_latitude', true);
1697 1697
                         $lng = geodir_get_post_meta($post_id, 'post_longitude', true);
1698 1698
 
1699
-                        $timing = ' - ' . date('D M j, Y', strtotime(geodir_get_post_meta($post_id, 'st_date', true)));
1700
-                        $timing .= ' - ' . geodir_get_post_meta($post_id, 'st_time', true);
1699
+                        $timing = ' - '.date('D M j, Y', strtotime(geodir_get_post_meta($post_id, 'st_date', true)));
1700
+                        $timing .= ' - '.geodir_get_post_meta($post_id, 'st_time', true);
1701 1701
 
1702 1702
                         $json = '{';
1703
-                        $json .= '"id":"' . $post_id . '",';
1704
-                        $json .= '"lat_pos": "' . $lat . '",';
1705
-                        $json .= '"long_pos": "' . $lng . '",';
1706
-                        $json .= '"marker_id":"' . $post_id . '_' . $cat_id . '",';
1707
-                        $json .= '"icon":"' . $term_icon . '",';
1708
-                        $json .= '"group":"catgroup' . $cat_id . '"';
1703
+                        $json .= '"id":"'.$post_id.'",';
1704
+                        $json .= '"lat_pos": "'.$lat.'",';
1705
+                        $json .= '"long_pos": "'.$lng.'",';
1706
+                        $json .= '"marker_id":"'.$post_id.'_'.$cat_id.'",';
1707
+                        $json .= '"icon":"'.$term_icon.'",';
1708
+                        $json .= '"group":"catgroup'.$cat_id.'"';
1709 1709
                         $json .= '}';
1710 1710
 
1711 1711
 
@@ -1713,9 +1713,9 @@  discard block
 block discarded – undo
1713 1713
                             $post_marker_json = $json;
1714 1714
 
1715 1715
 
1716
-                        if ($wpdb->get_var($wpdb->prepare("SELECT post_id from " . GEODIR_ICON_TABLE . " WHERE post_id = %d AND cat_id = %d", array($post_id, $cat_id)))) {
1716
+                        if ($wpdb->get_var($wpdb->prepare("SELECT post_id from ".GEODIR_ICON_TABLE." WHERE post_id = %d AND cat_id = %d", array($post_id, $cat_id)))) {
1717 1717
 
1718
-                            $json_query = $wpdb->prepare("UPDATE " . GEODIR_ICON_TABLE . " SET
1718
+                            $json_query = $wpdb->prepare("UPDATE ".GEODIR_ICON_TABLE." SET
1719 1719
 										post_title = %s,
1720 1720
 										json = %s
1721 1721
 										WHERE post_id = %d AND cat_id = %d ",
@@ -1723,7 +1723,7 @@  discard block
 block discarded – undo
1723 1723
 
1724 1724
                         } else {
1725 1725
 
1726
-                            $json_query = $wpdb->prepare("INSERT INTO " . GEODIR_ICON_TABLE . " SET
1726
+                            $json_query = $wpdb->prepare("INSERT INTO ".GEODIR_ICON_TABLE." SET
1727 1727
 										post_id = %d,
1728 1728
 										post_title = %s,
1729 1729
 										cat_id = %d,
@@ -1741,17 +1741,17 @@  discard block
 block discarded – undo
1741 1741
                 if (!empty($post_term) && is_array($post_term)) {
1742 1742
                     $categories = implode(',', $post_term);
1743 1743
 
1744
-                    if ($categories != '' && $categories != 0) $categories = ',' . $categories . ',';
1744
+                    if ($categories != '' && $categories != 0) $categories = ','.$categories.',';
1745 1745
 
1746 1746
                     if (empty($post_marker_json))
1747 1747
                         $post_marker_json = isset($json) ? $json : '';
1748 1748
 
1749
-                    if ($wpdb->get_var($wpdb->prepare("SELECT post_id from " . $table . " where post_id = %d", array($post_id)))) {
1749
+                    if ($wpdb->get_var($wpdb->prepare("SELECT post_id from ".$table." where post_id = %d", array($post_id)))) {
1750 1750
 
1751 1751
                         $wpdb->query(
1752 1752
                             $wpdb->prepare(
1753
-                                "UPDATE " . $table . " SET
1754
-								" . $taxonomy . " = %s,
1753
+                                "UPDATE ".$table." SET
1754
+								" . $taxonomy." = %s,
1755 1755
 								marker_json = %s
1756 1756
 								where post_id = %d",
1757 1757
                                 array($categories, $post_marker_json, $post_id)
@@ -1772,7 +1772,7 @@  discard block
 block discarded – undo
1772 1772
 
1773 1773
                                     $wpdb->query(
1774 1774
                                         $wpdb->prepare(
1775
-                                            "UPDATE " . $table . " SET
1775
+                                            "UPDATE ".$table." SET
1776 1776
 											default_category = %s
1777 1777
 											where post_id = %d",
1778 1778
                                             array($categories[0], $post_id)
@@ -1797,9 +1797,9 @@  discard block
 block discarded – undo
1797 1797
 
1798 1798
                         $wpdb->query(
1799 1799
                             $wpdb->prepare(
1800
-                                "INSERT INTO " . $table . " SET
1800
+                                "INSERT INTO ".$table." SET
1801 1801
 								post_id = %d,
1802
-								" . $taxonomy . " = %s,
1802
+								" . $taxonomy." = %s,
1803 1803
 								marker_json = %s ",
1804 1804
 
1805 1805
                                 array($post_id, $categories, $post_marker_json)
@@ -1922,7 +1922,7 @@  discard block
 block discarded – undo
1922 1922
                                     } ?>"><img alt="bubble image" style="max-height:50px;"
1923 1923
                                                src="<?php echo $post_images[0]; ?>"/></a></div>
1924 1924
                             <?php
1925
-                            }else{
1925
+                            } else {
1926 1926
                                 echo '<div class="geodir-bubble_image"></div>';
1927 1927
                             }
1928 1928
                         } else {
@@ -1930,7 +1930,7 @@  discard block
 block discarded – undo
1930 1930
                                 ?>
1931 1931
                                 <div class="geodir-bubble_image"><a href="<?php echo $plink; ?>"><?php echo $image; ?></a></div>
1932 1932
                             <?php
1933
-                            }else{
1933
+                            } else {
1934 1934
                                 echo '<div class="geodir-bubble_image"></div>';
1935 1935
                             }
1936 1936
                         }
@@ -1963,7 +1963,7 @@  discard block
 block discarded – undo
1963 1963
                              * @param object $postinfo_obj The posts info as an object.
1964 1964
                              * @param bool|string $post_preview True if currently in post preview page. Empty string if not.                           *
1965 1965
                              */
1966
-                            do_action('geodir_infowindow_meta_after',$postinfo_obj,$post_preview );
1966
+                            do_action('geodir_infowindow_meta_after', $postinfo_obj, $post_preview);
1967 1967
                             ?>
1968 1968
                         </div>
1969 1969
                         <?php
@@ -1975,10 +1975,10 @@  discard block
 block discarded – undo
1975 1975
                             <div class="geodir-bubble-meta-fade"></div>
1976 1976
 
1977 1977
                             <div class="geodir-bubble-meta-bottom">
1978
-                                <span class="geodir-bubble-rating"><?php echo $rating_star;?></span>
1978
+                                <span class="geodir-bubble-rating"><?php echo $rating_star; ?></span>
1979 1979
 
1980 1980
                                 <span
1981
-                                    class="geodir-bubble-fav"><?php echo geodir_favourite_html($post_author, $ID);?></span>
1981
+                                    class="geodir-bubble-fav"><?php echo geodir_favourite_html($post_author, $ID); ?></span>
1982 1982
                   <span class="geodir-bubble-reviews"><a href="<?php echo get_comments_link($ID); ?>"
1983 1983
                                                          class="geodir-pcomments"><i class="fa fa-comments"></i>
1984 1984
                           <?php echo get_comments_number($ID); ?>
@@ -2043,11 +2043,11 @@  discard block
 block discarded – undo
2043 2043
 
2044 2044
         $post_type = get_post_type($post_id);
2045 2045
 
2046
-        $table = $plugin_prefix . $post_type . '_detail';
2046
+        $table = $plugin_prefix.$post_type.'_detail';
2047 2047
 
2048 2048
         $wpdb->query(
2049 2049
             $wpdb->prepare(
2050
-                "UPDATE " . $table . " SET post_status=%s WHERE post_id=%d",
2050
+                "UPDATE ".$table." SET post_status=%s WHERE post_id=%d",
2051 2051
                 array($status, $post_id)
2052 2052
             )
2053 2053
         );
@@ -2119,18 +2119,18 @@  discard block
 block discarded – undo
2119 2119
 
2120 2120
         $post_type = get_post_type($post_id);
2121 2121
 
2122
-        $table = $plugin_prefix . $post_type . '_detail';
2122
+        $table = $plugin_prefix.$post_type.'_detail';
2123 2123
 
2124 2124
         $wpdb->query(
2125 2125
             $wpdb->prepare(
2126
-                "UPDATE " . $table . " SET `post_id` = %d WHERE `post_id` = %d",
2126
+                "UPDATE ".$table." SET `post_id` = %d WHERE `post_id` = %d",
2127 2127
                 array($updatingpost, $temppost)
2128 2128
             )
2129 2129
         );
2130 2130
 
2131 2131
         $wpdb->query(
2132 2132
             $wpdb->prepare(
2133
-                "UPDATE " . GEODIR_ICON_TABLE . " SET `post_id` = %d WHERE `post_id` = %d",
2133
+                "UPDATE ".GEODIR_ICON_TABLE." SET `post_id` = %d WHERE `post_id` = %d",
2134 2134
                 array($updatingpost, $temppost)
2135 2135
             )
2136 2136
         );
@@ -2139,7 +2139,7 @@  discard block
 block discarded – undo
2139 2139
 
2140 2140
         $wpdb->query(
2141 2141
             $wpdb->prepare(
2142
-                "UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET `post_id` = %d WHERE `post_id` = %d",
2142
+                "UPDATE ".GEODIR_ATTACHMENT_TABLE." SET `post_id` = %d WHERE `post_id` = %d",
2143 2143
                 array($updatingpost, $temppost)
2144 2144
             )
2145 2145
         );
@@ -2177,12 +2177,12 @@  discard block
 block discarded – undo
2177 2177
         if (!in_array($post_type, $all_postypes))
2178 2178
             return false;
2179 2179
 
2180
-        $table = $plugin_prefix . $post_type . '_detail';
2180
+        $table = $plugin_prefix.$post_type.'_detail';
2181 2181
 
2182 2182
         /* Delete custom post meta*/
2183 2183
         $wpdb->query(
2184 2184
             $wpdb->prepare(
2185
-                "DELETE FROM " . $table . " WHERE `post_id` = %d",
2185
+                "DELETE FROM ".$table." WHERE `post_id` = %d",
2186 2186
                 array($deleted_postid)
2187 2187
             )
2188 2188
         );
@@ -2191,7 +2191,7 @@  discard block
 block discarded – undo
2191 2191
 
2192 2192
         $wpdb->query(
2193 2193
             $wpdb->prepare(
2194
-                "DELETE FROM " . GEODIR_ICON_TABLE . " WHERE `post_id` = %d",
2194
+                "DELETE FROM ".GEODIR_ICON_TABLE." WHERE `post_id` = %d",
2195 2195
                 array($deleted_postid)
2196 2196
             )
2197 2197
         );
@@ -2201,7 +2201,7 @@  discard block
 block discarded – undo
2201 2201
 
2202 2202
         $wpdb->query(
2203 2203
             $wpdb->prepare(
2204
-                "DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE `post_id` = %d",
2204
+                "DELETE FROM ".GEODIR_ATTACHMENT_TABLE." WHERE `post_id` = %d",
2205 2205
                 array($deleted_postid)
2206 2206
             )
2207 2207
         );
@@ -2273,7 +2273,7 @@  discard block
 block discarded – undo
2273 2273
          */
2274 2274
         do_action('geodir_before_add_from_favorite', $post_id);
2275 2275
 
2276
-        echo '<a href="javascript:void(0);" title="' . $remove_favourite_text . '" class="geodir-removetofav-icon" onclick="javascript:addToFavourite(\'' . $post_id . '\',\'remove\');"><i class="'. $favourite_icon .'"></i> ' . $unfavourite_text . '</a>';
2276
+        echo '<a href="javascript:void(0);" title="'.$remove_favourite_text.'" class="geodir-removetofav-icon" onclick="javascript:addToFavourite(\''.$post_id.'\',\'remove\');"><i class="'.$favourite_icon.'"></i> '.$unfavourite_text.'</a>';
2277 2277
 
2278 2278
         /**
2279 2279
          * Called after adding the post from favourites.
@@ -2352,7 +2352,7 @@  discard block
 block discarded – undo
2352 2352
          */
2353 2353
         do_action('geodir_before_remove_from_favorite', $post_id);
2354 2354
 
2355
-        echo '<a href="javascript:void(0);"  title="' . $add_favourite_text . '" class="geodir-addtofav-icon" onclick="javascript:addToFavourite(\'' . $post_id . '\',\'add\');"><i class="'. $favourite_icon .'"></i> ' . $favourite_text . '</a>';
2355
+        echo '<a href="javascript:void(0);"  title="'.$add_favourite_text.'" class="geodir-addtofav-icon" onclick="javascript:addToFavourite(\''.$post_id.'\',\'add\');"><i class="'.$favourite_icon.'"></i> '.$favourite_text.'</a>';
2356 2356
 
2357 2357
         /**
2358 2358
          * Called after removing the post from favourites.
@@ -2447,24 +2447,24 @@  discard block
 block discarded – undo
2447 2447
             $user_meta_data = get_user_meta($current_user->data->ID, 'gd_user_favourite_post', true);
2448 2448
 
2449 2449
         if (!empty($user_meta_data) && in_array($post_id, $user_meta_data)) {
2450
-            ?><span class="geodir-addtofav favorite_property_<?php echo $post_id;?>"  ><a
2450
+            ?><span class="geodir-addtofav favorite_property_<?php echo $post_id; ?>"  ><a
2451 2451
                 class="geodir-removetofav-icon" href="javascript:void(0);"
2452
-                onclick="javascript:addToFavourite(<?php echo $post_id;?>,'remove');"
2453
-                title="<?php echo $remove_favourite_text;?>"><i class="<?php echo $unfavourite_icon; ?>"></i> <?php echo $unfavourite_text;?>
2452
+                onclick="javascript:addToFavourite(<?php echo $post_id; ?>,'remove');"
2453
+                title="<?php echo $remove_favourite_text; ?>"><i class="<?php echo $unfavourite_icon; ?>"></i> <?php echo $unfavourite_text; ?>
2454 2454
             </a>   </span><?php
2455 2455
 
2456 2456
         } else {
2457 2457
 
2458 2458
             if (!isset($current_user->data->ID) || $current_user->data->ID == '') {
2459
-                $script_text = 'javascript:window.location.href=\'' . geodir_login_url() . '\'';
2459
+                $script_text = 'javascript:window.location.href=\''.geodir_login_url().'\'';
2460 2460
             } else
2461
-                $script_text = 'javascript:addToFavourite(' . $post_id . ',\'add\')';
2461
+                $script_text = 'javascript:addToFavourite('.$post_id.',\'add\')';
2462 2462
 
2463
-            ?><span class="geodir-addtofav favorite_property_<?php echo $post_id;?>"><a class="geodir-addtofav-icon"
2463
+            ?><span class="geodir-addtofav favorite_property_<?php echo $post_id; ?>"><a class="geodir-addtofav-icon"
2464 2464
                                                                                         href="javascript:void(0);"
2465
-                                                                                        onclick="<?php echo $script_text;?>"
2466
-                                                                                        title="<?php echo $add_favourite_text;?>"><i
2467
-                    class="<?php echo $favourite_icon; ?>"></i> <?php echo $favourite_text;?></a></span>
2465
+                                                                                        onclick="<?php echo $script_text; ?>"
2466
+                                                                                        title="<?php echo $add_favourite_text; ?>"><i
2467
+                    class="<?php echo $favourite_icon; ?>"></i> <?php echo $favourite_text; ?></a></span>
2468 2468
         <?php }
2469 2469
     }
2470 2470
 }
@@ -2494,7 +2494,7 @@  discard block
 block discarded – undo
2494 2494
 
2495 2495
             $post_type = $taxonomy_obj->object_type[0];
2496 2496
 
2497
-            $table = $plugin_prefix . $post_type . '_detail';
2497
+            $table = $plugin_prefix.$post_type.'_detail';
2498 2498
 
2499 2499
             /**
2500 2500
              * Filter to modify the 'join' query
@@ -2517,8 +2517,8 @@  discard block
 block discarded – undo
2517 2517
             $where = apply_filters('geodir_cat_post_count_where', $where, $term);
2518 2518
 
2519 2519
             $count_query = "SELECT count(post_id) FROM
2520
-							" . $table . " as pd " . $join . "
2521
-							WHERE pd.post_status='publish' AND FIND_IN_SET('" . $term->term_id . "'," . $term->taxonomy . ") " . $where;
2520
+							" . $table." as pd ".$join."
2521
+							WHERE pd.post_status='publish' AND FIND_IN_SET('" . $term->term_id."',".$term->taxonomy.") ".$where;
2522 2522
 
2523 2523
             $cat_post_count = $wpdb->get_var($count_query);
2524 2524
             if (empty($cat_post_count) || is_wp_error($cat_post_count))
@@ -2601,7 +2601,7 @@  discard block
 block discarded – undo
2601 2601
     global $post;
2602 2602
     $all_postypes = geodir_get_posttypes();
2603 2603
     if (is_array($all_postypes) && in_array($post->post_type, $all_postypes)) {
2604
-        return ' <a href="' . get_permalink($post->ID) . '">' . READ_MORE_TXT . '</a>';
2604
+        return ' <a href="'.get_permalink($post->ID).'">'.READ_MORE_TXT.'</a>';
2605 2605
     }
2606 2606
 
2607 2607
     return $more;
@@ -2628,14 +2628,14 @@  discard block
 block discarded – undo
2628 2628
     if (is_array($gd_taxonomies) && in_array($taxonomy, $gd_taxonomies)) {
2629 2629
 
2630 2630
         $geodir_post_type = geodir_get_taxonomy_posttype($taxonomy);
2631
-        $table = $plugin_prefix . $geodir_post_type . '_detail';
2631
+        $table = $plugin_prefix.$geodir_post_type.'_detail';
2632 2632
 
2633 2633
         $path_parts = pathinfo($_REQUEST['ct_cat_icon']['src']);
2634
-        $term_icon = $path_parts['dirname'] . '/cat_icon_' . $term_id . '.png';
2634
+        $term_icon = $path_parts['dirname'].'/cat_icon_'.$term_id.'.png';
2635 2635
 
2636 2636
         $posts = $wpdb->get_results(
2637 2637
             $wpdb->prepare(
2638
-                "SELECT post_id,post_title,post_latitude,post_longitude,default_category FROM " . $table . " WHERE FIND_IN_SET(%s,%1\$s ) ",
2638
+                "SELECT post_id,post_title,post_latitude,post_longitude,default_category FROM ".$table." WHERE FIND_IN_SET(%s,%1\$s ) ",
2639 2639
                 array($term_id, $taxonomy)
2640 2640
             )
2641 2641
         );
@@ -2647,19 +2647,19 @@  discard block
 block discarded – undo
2647 2647
                 $lng = $post_obj->post_longitude;
2648 2648
 
2649 2649
                 $json = '{';
2650
-                $json .= '"id":"' . $post_obj->post_id . '",';
2651
-                $json .= '"lat_pos": "' . $lat . '",';
2652
-                $json .= '"long_pos": "' . $lng . '",';
2653
-                $json .= '"marker_id":"' . $post_obj->post_id . '_' . $term_id . '",';
2654
-                $json .= '"icon":"' . $term_icon . '",';
2655
-                $json .= '"group":"catgroup' . $term_id . '"';
2650
+                $json .= '"id":"'.$post_obj->post_id.'",';
2651
+                $json .= '"lat_pos": "'.$lat.'",';
2652
+                $json .= '"long_pos": "'.$lng.'",';
2653
+                $json .= '"marker_id":"'.$post_obj->post_id.'_'.$term_id.'",';
2654
+                $json .= '"icon":"'.$term_icon.'",';
2655
+                $json .= '"group":"catgroup'.$term_id.'"';
2656 2656
                 $json .= '}';
2657 2657
 
2658 2658
                 if ($post_obj->default_category == $term_id) {
2659 2659
 
2660 2660
                     $wpdb->query(
2661 2661
                         $wpdb->prepare(
2662
-                            "UPDATE " . $table . " SET marker_json = %s where post_id = %d",
2662
+                            "UPDATE ".$table." SET marker_json = %s where post_id = %d",
2663 2663
                             array($json, $post_obj->post_id)
2664 2664
                         )
2665 2665
                     );
@@ -2667,7 +2667,7 @@  discard block
 block discarded – undo
2667 2667
 
2668 2668
                 $wpdb->query(
2669 2669
                     $wpdb->prepare(
2670
-                        "UPDATE " . GEODIR_ICON_TABLE . " SET json = %s WHERE post_id = %d AND cat_id = %d",
2670
+                        "UPDATE ".GEODIR_ICON_TABLE." SET json = %s WHERE post_id = %d AND cat_id = %d",
2671 2671
                         array($json, $post_obj->post_id, $term_id)
2672 2672
                     )
2673 2673
                 );
@@ -2791,7 +2791,7 @@  discard block
 block discarded – undo
2791 2791
 //	print_r($uploads ) ;
2792 2792
     $post_first_image = $wpdb->get_results(
2793 2793
         $wpdb->prepare(
2794
-            "SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id = %d and menu_order = 1  ", array($post_id)
2794
+            "SELECT * FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id = %d and menu_order = 1  ", array($post_id)
2795 2795
         )
2796 2796
     );
2797 2797
 
@@ -2812,9 +2812,9 @@  discard block
 block discarded – undo
2812 2812
 
2813 2813
         $post_type = get_post_type($post_id);
2814 2814
 
2815
-        $table_name = $plugin_prefix . $post_type . '_detail';
2815
+        $table_name = $plugin_prefix.$post_type.'_detail';
2816 2816
 
2817
-        $wpdb->query("UPDATE " . $table_name . " SET featured_image='" . $post_first_image[0]->file . "' WHERE post_id =" . $post_id);
2817
+        $wpdb->query("UPDATE ".$table_name." SET featured_image='".$post_first_image[0]->file."' WHERE post_id =".$post_id);
2818 2818
 
2819 2819
         $new_attachment_name = basename($post_first_image[0]->file);
2820 2820
 
@@ -2827,11 +2827,11 @@  discard block
 block discarded – undo
2827 2827
                 wp_delete_attachment($post_thumbnail_id);
2828 2828
 
2829 2829
             }
2830
-            $filename = $uploads['basedir'] . $post_first_image[0]->file;
2830
+            $filename = $uploads['basedir'].$post_first_image[0]->file;
2831 2831
 
2832 2832
             $attachment = array(
2833 2833
                 'post_mime_type' => $post_first_image[0]->mime_type,
2834
-                'guid' => $uploads['baseurl'] . $post_first_image[0]->file,
2834
+                'guid' => $uploads['baseurl'].$post_first_image[0]->file,
2835 2835
                 'post_parent' => $post_id,
2836 2836
                 'post_title' => preg_replace('/\.[^.]+$/', '', $post_first_image[0]->title),
2837 2837
                 'post_content' => ''
@@ -2844,7 +2844,7 @@  discard block
 block discarded – undo
2844 2844
 
2845 2845
                 set_post_thumbnail($post_id, $id);
2846 2846
 
2847
-                require_once(ABSPATH . 'wp-admin/includes/image.php');
2847
+                require_once(ABSPATH.'wp-admin/includes/image.php');
2848 2848
                 wp_update_attachment_metadata($id, wp_generate_attachment_metadata($id, $filename));
2849 2849
 
2850 2850
             }
@@ -2877,35 +2877,35 @@  discard block
 block discarded – undo
2877 2877
         $post_id = absint($_POST['post_id']);
2878 2878
         $upload_dir = wp_upload_dir();
2879 2879
         $post_type = get_post_type($_POST['post_id']);
2880
-        $table = $plugin_prefix . $post_type . '_detail';
2880
+        $table = $plugin_prefix.$post_type.'_detail';
2881 2881
 
2882 2882
         $post_arr = $wpdb->get_results($wpdb->prepare(
2883
-            "SELECT * FROM $wpdb->posts p JOIN " . $table . " gd ON gd.post_id=p.ID WHERE p.ID=%d LIMIT 1",
2883
+            "SELECT * FROM $wpdb->posts p JOIN ".$table." gd ON gd.post_id=p.ID WHERE p.ID=%d LIMIT 1",
2884 2884
             array($post_id)
2885 2885
         )
2886 2886
             , ARRAY_A);
2887 2887
 
2888 2888
         $arrImages = $wpdb->get_results(
2889 2889
             $wpdb->prepare(
2890
-                "SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE mime_type like %s AND post_id = %d ORDER BY menu_order ASC, ID DESC ",
2890
+                "SELECT * FROM ".GEODIR_ATTACHMENT_TABLE." WHERE mime_type like %s AND post_id = %d ORDER BY menu_order ASC, ID DESC ",
2891 2891
                 array('%image%', $post_id)
2892 2892
             )
2893 2893
         );
2894 2894
         if ($arrImages) {
2895 2895
             $image_arr = array();
2896 2896
             foreach ($arrImages as $img) {
2897
-                $image_arr[] = $upload_dir['baseurl'] . $img->file;
2897
+                $image_arr[] = $upload_dir['baseurl'].$img->file;
2898 2898
             }
2899 2899
             $comma_separated = implode(",", $image_arr);
2900 2900
             $post_arr[0]['post_images'] = $comma_separated;
2901 2901
         }
2902 2902
 
2903 2903
 
2904
-        $cats = $post_arr[0][$post_arr[0]['post_type'] . 'category'];
2904
+        $cats = $post_arr[0][$post_arr[0]['post_type'].'category'];
2905 2905
         $cat_arr = array_filter(explode(",", $cats));
2906 2906
         $trans_cat = array();
2907 2907
         foreach ($cat_arr as $cat) {
2908
-            $trans_cat[] = icl_object_id($cat, $post_arr[0]['post_type'] . 'category', false);
2908
+            $trans_cat[] = icl_object_id($cat, $post_arr[0]['post_type'].'category', false);
2909 2909
         }
2910 2910
 
2911 2911
 
@@ -2947,7 +2947,7 @@  discard block
 block discarded – undo
2947 2947
 
2948 2948
     $get_data = $wpdb->get_results(
2949 2949
         $wpdb->prepare(
2950
-            "SELECT htmlvar_name, field_type, extra_fields FROM " . GEODIR_CUSTOM_FIELDS_TABLE . " WHERE post_type=%s AND is_active='1'",
2950
+            "SELECT htmlvar_name, field_type, extra_fields FROM ".GEODIR_CUSTOM_FIELDS_TABLE." WHERE post_type=%s AND is_active='1'",
2951 2951
             array($listing_type)
2952 2952
         )
2953 2953
     );
@@ -2960,12 +2960,12 @@  discard block
 block discarded – undo
2960 2960
 
2961 2961
                 $extra_fields = unserialize($data->extra_fields);
2962 2962
 
2963
-                $prefix = $data->htmlvar_name . '_';
2963
+                $prefix = $data->htmlvar_name.'_';
2964 2964
 
2965
-                $fields_info[$prefix . 'address'] = $data->field_type;
2965
+                $fields_info[$prefix.'address'] = $data->field_type;
2966 2966
 
2967 2967
                 if (isset($extra_fields['show_zip']) && $extra_fields['show_zip'])
2968
-                    $fields_info[$prefix . 'zip'] = $data->field_type;
2968
+                    $fields_info[$prefix.'zip'] = $data->field_type;
2969 2969
 
2970 2970
             } else {
2971 2971
 
@@ -3063,13 +3063,13 @@  discard block
 block discarded – undo
3063 3063
  * @since 1.4.9
3064 3064
  * @package GeoDirectory
3065 3065
  */
3066
-function geodir_fb_like_thumbnail(){
3066
+function geodir_fb_like_thumbnail() {
3067 3067
 
3068 3068
     // return if not a single post
3069
-    if(!is_single()){return;}
3069
+    if (!is_single()) {return; }
3070 3070
 
3071 3071
     global $post;
3072
-    if(isset($post->featured_image) && $post->featured_image){
3072
+    if (isset($post->featured_image) && $post->featured_image) {
3073 3073
         $upload_dir = wp_upload_dir();
3074 3074
         $thumb = $upload_dir['baseurl'].$post->featured_image;
3075 3075
         echo "\n\n<!-- GD Facebook Like Thumbnail -->\n<link rel=\"image_src\" href=\"$thumb\" />\n<!-- End GD Facebook Like Thumbnail -->\n\n";
Please login to merge, or discard this patch.
geodirectory-functions/custom_fields_functions.php 1 patch
Spacing   +351 added lines, -351 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
 
@@ -1402,7 +1402,7 @@  discard block
 block discarded – undo
1402 1402
                 $field_icon = geodir_field_icon_proccess($type);
1403 1403
                 $filed_type = $type['type'];
1404 1404
                 $html_var = isset($type['htmlvar_name']) ? $type['htmlvar_name'] : '';
1405
-                if($html_var=='post'){$html_var='post_address';}
1405
+                if ($html_var == 'post') {$html_var = 'post_address'; }
1406 1406
 
1407 1407
                 /**
1408 1408
                  * Filter the output for custom fields.
@@ -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
 
@@ -1542,7 +1542,7 @@  discard block
 block discarded – undo
1542 1542
 
1543 1543
         $post_type = get_post_type($post_id);
1544 1544
         //echo $field_id; exit;
1545
-        $table = $plugin_prefix . $post_type . '_detail';
1545
+        $table = $plugin_prefix.$post_type.'_detail';
1546 1546
 
1547 1547
         $postcurr_images = array();
1548 1548
         $postcurr_images = geodir_get_post_meta($post_id, $field_id, true);
@@ -1561,13 +1561,13 @@  discard block
 block discarded – undo
1561 1561
             $geodir_uploadurl = $uploads['url'];
1562 1562
             $sub_dir = $uploads['subdir'];
1563 1563
 
1564
-            $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'] : '';
1564
+            $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 1565
 
1566 1566
             for ($m = 0; $m < count($post_image); $m++) {
1567 1567
 
1568 1568
                 /* --------- start ------- */
1569 1569
 
1570
-                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)))) {
1570
+                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 1571
 
1572 1572
 
1573 1573
                     $curr_img_url = $post_image[$m];
@@ -1593,24 +1593,24 @@  discard block
 block discarded – undo
1593 1593
                     //$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');
1594 1594
 
1595 1595
                     if (!function_exists('wp_handle_upload'))
1596
-                        require_once(ABSPATH . 'wp-admin/includes/file.php');
1596
+                        require_once(ABSPATH.'wp-admin/includes/file.php');
1597 1597
 
1598 1598
                     if (!is_dir($geodir_uploadpath))
1599 1599
                         mkdir($geodir_uploadpath);
1600 1600
 
1601
-                    $new_name = $post_id . '_' . $field_id . '_' . $img_name_arr[0] . '.' . $img_name_arr[1];
1601
+                    $new_name = $post_id.'_'.$field_id.'_'.$img_name_arr[0].'.'.$img_name_arr[1];
1602 1602
                     $explode_sub_dir = explode("/", $sub_dir);
1603 1603
                     if ($curr_img_dir == end($explode_sub_dir)) {
1604
-                        $img_path = $geodir_uploadpath . '/' . $filename;
1605
-                        $img_url = $geodir_uploadurl . '/' . $filename;
1604
+                        $img_path = $geodir_uploadpath.'/'.$filename;
1605
+                        $img_url = $geodir_uploadurl.'/'.$filename;
1606 1606
                     } else {
1607
-                        $img_path = $uploads_dir . '/temp_' . $current_user->data->ID . '/' . $filename;
1608
-                        $img_url = $uploads['url'] . '/temp_' . $current_user->data->ID . '/' . $filename;
1607
+                        $img_path = $uploads_dir.'/temp_'.$current_user->data->ID.'/'.$filename;
1608
+                        $img_url = $uploads['url'].'/temp_'.$current_user->data->ID.'/'.$filename;
1609 1609
                     }
1610 1610
 
1611 1611
                     $uploaded_file = '';
1612 1612
                     if (file_exists($img_path))
1613
-                        $uploaded_file = copy($img_path, $geodir_uploadpath . '/' . $new_name);
1613
+                        $uploaded_file = copy($img_path, $geodir_uploadpath.'/'.$new_name);
1614 1614
 
1615 1615
                     if ($curr_img_dir != $geodir_uploaddir) {
1616 1616
                         if (file_exists($img_path))
@@ -1618,7 +1618,7 @@  discard block
 block discarded – undo
1618 1618
                     }
1619 1619
 
1620 1620
                     if (!empty($uploaded_file))
1621
-                        $file_urls = $geodir_uploadurl . '/' . $new_name;
1621
+                        $file_urls = $geodir_uploadurl.'/'.$new_name;
1622 1622
 
1623 1623
                 } else {
1624 1624
                     $file_urls = $post_image[$m];
@@ -1632,8 +1632,8 @@  discard block
 block discarded – undo
1632 1632
         if (!empty($postcurr_images)) {
1633 1633
 
1634 1634
             if ($file_urls != $postcurr_images) {
1635
-                $invalid_files[] = (object)array('src' => $postcurr_images);
1636
-                $invalid_files = (object)$invalid_files;
1635
+                $invalid_files[] = (object) array('src' => $postcurr_images);
1636
+                $invalid_files = (object) $invalid_files;
1637 1637
             }
1638 1638
         }
1639 1639
 
@@ -1685,9 +1685,9 @@  discard block
 block discarded – undo
1685 1685
     function geodir_upload_dir($upload)
1686 1686
     {
1687 1687
         global $current_user;
1688
-        $upload['subdir'] = $upload['subdir'] . '/temp_' . $current_user->data->ID;
1689
-        $upload['path'] = $upload['basedir'] . $upload['subdir'];
1690
-        $upload['url'] = $upload['baseurl'] . $upload['subdir'];
1688
+        $upload['subdir'] = $upload['subdir'].'/temp_'.$current_user->data->ID;
1689
+        $upload['path'] = $upload['basedir'].$upload['subdir'];
1690
+        $upload['url'] = $upload['baseurl'].$upload['subdir'];
1691 1691
         return $upload;
1692 1692
     }
1693 1693
 
@@ -1702,20 +1702,20 @@  discard block
 block discarded – undo
1702 1702
         // check ajax noonce
1703 1703
         $imgid = $_POST["imgid"];
1704 1704
 
1705
-        check_ajax_referer($imgid . 'pluploadan');
1705
+        check_ajax_referer($imgid.'pluploadan');
1706 1706
 
1707 1707
         // handle custom file uploaddir
1708 1708
         add_filter('upload_dir', 'geodir_upload_dir');
1709 1709
 
1710 1710
         // change file orinetation if needed
1711
-        $fixed_file = geodir_exif($_FILES[$imgid . 'async-upload']);
1711
+        $fixed_file = geodir_exif($_FILES[$imgid.'async-upload']);
1712 1712
 
1713 1713
         // handle file upload
1714 1714
         $status = wp_handle_upload($fixed_file, array('test_form' => true, 'action' => 'plupload_action'));
1715 1715
         // remove handle custom file uploaddir
1716 1716
         remove_filter('upload_dir', 'geodir_upload_dir');
1717 1717
 
1718
-        if(!isset($status['url']) && isset($status['error'])){
1718
+        if (!isset($status['url']) && isset($status['error'])) {
1719 1719
             print_r($status);
1720 1720
         }
1721 1721
 
@@ -1745,9 +1745,9 @@  discard block
 block discarded – undo
1745 1745
 
1746 1746
     $post_type = get_post_type($post_id);
1747 1747
 
1748
-    $table = $plugin_prefix . $post_type . '_detail';
1748
+    $table = $plugin_prefix.$post_type.'_detail';
1749 1749
 
1750
-    $results = $wpdb->get_results($wpdb->prepare("SELECT geodir_video FROM " . $table . " WHERE post_id=%d", array($post_id)));
1750
+    $results = $wpdb->get_results($wpdb->prepare("SELECT geodir_video FROM ".$table." WHERE post_id=%d", array($post_id)));
1751 1751
 
1752 1752
     if ($results) {
1753 1753
         return $results[0]->geodir_video;
@@ -1771,9 +1771,9 @@  discard block
 block discarded – undo
1771 1771
 
1772 1772
     $post_type = get_post_type($post_id);
1773 1773
 
1774
-    $table = $plugin_prefix . $post_type . '_detail';
1774
+    $table = $plugin_prefix.$post_type.'_detail';
1775 1775
 
1776
-    $results = $wpdb->get_results($wpdb->prepare("SELECT geodir_special_offers FROM " . $table . " WHERE post_id=%d", array($post_id)));
1776
+    $results = $wpdb->get_results($wpdb->prepare("SELECT geodir_special_offers FROM ".$table." WHERE post_id=%d", array($post_id)));
1777 1777
 
1778 1778
     if ($results) {
1779 1779
         return $results[0]->geodir_special_offers;
@@ -1791,12 +1791,12 @@  discard block
 block discarded – undo
1791 1791
      */
1792 1792
     function geodir_max_upload_size()
1793 1793
     {
1794
-        $max_filesize = (float)get_option('geodir_upload_max_filesize', 2);
1794
+        $max_filesize = (float) get_option('geodir_upload_max_filesize', 2);
1795 1795
 
1796 1796
         if ($max_filesize > 0 && $max_filesize < 1) {
1797
-            $max_filesize = (int)($max_filesize * 1024) . 'kb';
1797
+            $max_filesize = (int) ($max_filesize * 1024).'kb';
1798 1798
         } else {
1799
-            $max_filesize = $max_filesize > 0 ? $max_filesize . 'mb' : '2mb';
1799
+            $max_filesize = $max_filesize > 0 ? $max_filesize.'mb' : '2mb';
1800 1800
         }
1801 1801
         /** Filter documented in geodirectory-functions/general_functions.php **/
1802 1802
         return apply_filters('geodir_default_image_upload_size_limit', $max_filesize);
@@ -1828,7 +1828,7 @@  discard block
 block discarded – undo
1828 1828
 
1829 1829
             $custom_fields = $wpdb->get_results(
1830 1830
                 $wpdb->prepare(
1831
-                    "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",
1831
+                    "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 1832
                     array($post_type)
1833 1833
                 ), 'ARRAY_A'
1834 1834
             );
@@ -1955,7 +1955,7 @@  discard block
 block discarded – undo
1955 1955
 
1956 1956
             $post_meta_info = $wpdb->query(
1957 1957
                 $wpdb->prepare(
1958
-                    "update " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set 
1958
+                    "update ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." set 
1959 1959
 															sort_order=%d 
1960 1960
 															where id= %d",
1961 1961
                     array($count, $cf)
@@ -2037,14 +2037,14 @@  discard block
 block discarded – undo
2037 2037
 
2038 2038
         $check_html_variable = $wpdb->get_var(
2039 2039
             $wpdb->prepare(
2040
-                "select htmlvar_name from " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s and field_type=%s ",
2040
+                "select htmlvar_name from ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." where htmlvar_name = %s and post_type = %s and field_type=%s ",
2041 2041
                 array($cehhtmlvar_name, $post_type, $field_type)
2042 2042
             )
2043 2043
         );
2044 2044
 
2045 2045
         if ($is_default == 1) {
2046 2046
 
2047
-            $wpdb->query($wpdb->prepare("update " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set is_default='0', default_order='' where post_type = %s", array($post_type)));
2047
+            $wpdb->query($wpdb->prepare("update ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." set is_default='0', default_order='' where post_type = %s", array($post_type)));
2048 2048
 
2049 2049
         }
2050 2050
 
@@ -2055,7 +2055,7 @@  discard block
 block discarded – undo
2055 2055
 
2056 2056
                 $wpdb->prepare(
2057 2057
 
2058
-                    "insert into " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set 
2058
+                    "insert into ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." set 
2059 2059
 				post_type = %s,
2060 2060
 				data_type = %s,
2061 2061
 				field_type = %s,
@@ -2086,7 +2086,7 @@  discard block
 block discarded – undo
2086 2086
 
2087 2087
                 $wpdb->prepare(
2088 2088
 
2089
-                    "update " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set 
2089
+                    "update ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." set 
2090 2090
 				post_type = %s,
2091 2091
 				data_type = %s,
2092 2092
 				field_type = %s,
@@ -2112,7 +2112,7 @@  discard block
 block discarded – undo
2112 2112
         }
2113 2113
 
2114 2114
 
2115
-        return (int)$lastid;
2115
+        return (int) $lastid;
2116 2116
 
2117 2117
     }
2118 2118
 }
@@ -2135,7 +2135,7 @@  discard block
 block discarded – undo
2135 2135
         if ($field_id != '') {
2136 2136
             $cf = trim($field_id, '_');
2137 2137
 
2138
-            $wpdb->query($wpdb->prepare("delete from " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " where id= %d ", array($cf)));
2138
+            $wpdb->query($wpdb->prepare("delete from ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." where id= %d ", array($cf)));
2139 2139
 
2140 2140
             return $field_id;
2141 2141
 
@@ -2158,12 +2158,12 @@  discard block
 block discarded – undo
2158 2158
      * @param string $field_ins_upd When set to "submit" displays form.
2159 2159
      * @param bool $default when set to true field will be for admin use only.
2160 2160
      */
2161
-    function geodir_custom_sort_field_adminhtml($field_type, $result_str, $field_ins_upd = '', $field_type_key='')
2161
+    function geodir_custom_sort_field_adminhtml($field_type, $result_str, $field_ins_upd = '', $field_type_key = '')
2162 2162
     {
2163 2163
         global $wpdb;
2164 2164
         $cf = $result_str;
2165 2165
         if (!is_object($cf)) {
2166
-            $field_info = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " WHERE id = %d", array($cf)));
2166
+            $field_info = $wpdb->get_row($wpdb->prepare("SELECT * FROM ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." WHERE id = %d", array($cf)));
2167 2167
         } else {
2168 2168
             $field_info = $cf;
2169 2169
             $result_str = $cf->id;
@@ -2199,18 +2199,18 @@  discard block
 block discarded – undo
2199 2199
         if ($htmlvar_name == '')
2200 2200
             $htmlvar_name = isset($field_info->htmlvar_name) ? $field_info->htmlvar_name : '';
2201 2201
 
2202
-        $nonce = wp_create_nonce('custom_fields_' . $result_str);
2202
+        $nonce = wp_create_nonce('custom_fields_'.$result_str);
2203 2203
 
2204 2204
         $field_icon = '<i class="fa fa-cog" aria-hidden="true"></i>';
2205 2205
         $cso_arr = geodir_get_custom_sort_options($post_type);
2206 2206
 
2207 2207
         $cur_field_type = (isset($cf->field_type)) ? $cf->field_type : esc_html($_REQUEST['field_type']);
2208
-        foreach($cso_arr as $cso){
2209
-            if($cur_field_type==$cso['field_type']){
2208
+        foreach ($cso_arr as $cso) {
2209
+            if ($cur_field_type == $cso['field_type']) {
2210 2210
 
2211 2211
                 if (isset($cso['field_icon']) && strpos($cso['field_icon'], 'fa fa-') !== false) {
2212 2212
                     $field_icon = '<i class="'.$cso['field_icon'].'" aria-hidden="true"></i>';
2213
-                }elseif(isset($cso['field_icon']) && $cso['field_icon']){
2213
+                }elseif (isset($cso['field_icon']) && $cso['field_icon']) {
2214 2214
                     $field_icon = '<b style="background-image: url("'.$cso['field_icon'].'")"></b>';
2215 2215
                 }
2216 2216
 
@@ -2220,40 +2220,40 @@  discard block
 block discarded – undo
2220 2220
         $radio_id = (isset($field_info->htmlvar_name)) ? $field_info->htmlvar_name.$field_type : rand(5, 500);
2221 2221
         ?>
2222 2222
 
2223
-        <li class="text" id="licontainer_<?php echo $result_str;?>">
2223
+        <li class="text" id="licontainer_<?php echo $result_str; ?>">
2224 2224
             <form><!-- we need to wrap in a fom so we can use radio buttons with same name -->
2225
-            <div class="title title<?php echo $result_str;?> gt-fieldset"
2226
-                 title="<?php _e('Double Click to toggle and drag-drop to sort', 'geodirectory');?>"
2227
-                 ondblclick="show_hide('field_frm<?php echo $result_str;?>')">
2225
+            <div class="title title<?php echo $result_str; ?> gt-fieldset"
2226
+                 title="<?php _e('Double Click to toggle and drag-drop to sort', 'geodirectory'); ?>"
2227
+                 ondblclick="show_hide('field_frm<?php echo $result_str; ?>')">
2228 2228
                 <?php
2229 2229
 
2230 2230
                 ?>
2231 2231
 
2232
-                <div title="<?php _e('Click to remove field', 'geodirectory');?>"
2233
-                     onclick="delete_sort_field('<?php echo $result_str;?>', '<?php echo $nonce;?>', this)"
2232
+                <div title="<?php _e('Click to remove field', 'geodirectory'); ?>"
2233
+                     onclick="delete_sort_field('<?php echo $result_str; ?>', '<?php echo $nonce; ?>', this)"
2234 2234
                      class="handlediv close"><i class="fa fa-times" aria-hidden="true"></i></div>
2235 2235
 
2236 2236
 
2237
-                <?php echo $field_icon;?>
2237
+                <?php echo $field_icon; ?>
2238 2238
                 <b style="cursor:pointer;"
2239
-                   onclick="show_hide('field_frm<?php echo $result_str;?>')"><?php echo geodir_ucwords(__('Field:', 'geodirectory') . ' (' . $site_title . ')');?></b>
2239
+                   onclick="show_hide('field_frm<?php echo $result_str; ?>')"><?php echo geodir_ucwords(__('Field:', 'geodirectory').' ('.$site_title.')'); ?></b>
2240 2240
 
2241 2241
             </div>
2242 2242
 
2243
-            <div id="field_frm<?php echo $result_str;?>" class="field_frm"
2243
+            <div id="field_frm<?php echo $result_str; ?>" class="field_frm"
2244 2244
                  style="display:<?php if ($field_ins_upd == 'submit') {
2245 2245
                      echo 'block;';
2246 2246
                  } else {
2247 2247
                      echo 'none;';
2248 2248
                  } ?>">
2249 2249
                 <input type="hidden" name="_wpnonce" value="<?php echo $nonce; ?>"/>
2250
-                <input type="hidden" name="listing_type" id="listing_type" value="<?php echo $post_type;?>"/>
2251
-                <input type="hidden" name="field_type" id="field_type" value="<?php echo $field_type;?>"/>
2252
-                <input type="hidden" name="field_id" id="field_id" value="<?php echo $result_str;?>"/>
2250
+                <input type="hidden" name="listing_type" id="listing_type" value="<?php echo $post_type; ?>"/>
2251
+                <input type="hidden" name="field_type" id="field_type" value="<?php echo $field_type; ?>"/>
2252
+                <input type="hidden" name="field_id" id="field_id" value="<?php echo $result_str; ?>"/>
2253 2253
                 <input type="hidden" name="data_type" id="data_type" value="<?php if (isset($field_info->data_type)) {
2254 2254
                     echo $field_info->data_type;
2255 2255
                 }?>"/>
2256
-                <input type="hidden" name="htmlvar_name" id="htmlvar_name" value="<?php echo $htmlvar_name;?>"/>
2256
+                <input type="hidden" name="htmlvar_name" id="htmlvar_name" value="<?php echo $htmlvar_name; ?>"/>
2257 2257
 
2258 2258
 
2259 2259
                 <ul class="widefat post fixed" border="0" style="width:100%;">
@@ -2263,7 +2263,7 @@  discard block
 block discarded – undo
2263 2263
                         <input type="hidden" name="site_title" id="site_title" value="<?php echo esc_attr($site_title); ?>"/>
2264 2264
 
2265 2265
                         <li>
2266
-                            <?php $value = (isset($field_info->sort_asc) && $field_info->sort_asc) ? $field_info->sort_asc : 0;?>
2266
+                            <?php $value = (isset($field_info->sort_asc) && $field_info->sort_asc) ? $field_info->sort_asc : 0; ?>
2267 2267
 
2268 2268
                             <label for="asc" class="gd-cf-tooltip-wrap">
2269 2269
                                 <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Show Ascending Sort (low to high)', 'geodirectory'); ?>
@@ -2273,24 +2273,24 @@  discard block
 block discarded – undo
2273 2273
                             </label>
2274 2274
                             <div class="gd-cf-input-wrap gd-switch">
2275 2275
 
2276
-                                <input type="radio" id="asc_yes<?php echo $radio_id;?>" name="asc" class="gdri-enabled"  value="1"
2276
+                                <input type="radio" id="asc_yes<?php echo $radio_id; ?>" name="asc" class="gdri-enabled"  value="1"
2277 2277
                                     <?php if ($value == '1') {
2278 2278
                                         echo 'checked';
2279 2279
                                     } ?>/>
2280
-                                <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>
2280
+                                <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 2281
 
2282
-                                <input type="radio" id="asc_no<?php echo $radio_id;?>" name="asc" class="gdri-disabled" value="0"
2282
+                                <input type="radio" id="asc_no<?php echo $radio_id; ?>" name="asc" class="gdri-disabled" value="0"
2283 2283
                                     <?php if ($value == '0' || !$value) {
2284 2284
                                         echo 'checked';
2285 2285
                                     } ?>/>
2286
-                                <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>
2286
+                                <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 2287
 
2288 2288
                             </div>
2289 2289
 
2290 2290
                         </li>
2291 2291
 
2292
-                        <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;'";}?>>
2293
-                            <?php $value = (isset($field_info->asc_title) && $field_info->asc_title) ? esc_attr($field_info->asc_title) : '';?>
2292
+                        <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;'"; }?>>
2293
+                            <?php $value = (isset($field_info->asc_title) && $field_info->asc_title) ? esc_attr($field_info->asc_title) : ''; ?>
2294 2294
 
2295 2295
                             <label for="asc_title" class="gd-cf-tooltip-wrap">
2296 2296
                                 <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Ascending title', 'geodirectory'); ?>
@@ -2300,14 +2300,14 @@  discard block
 block discarded – undo
2300 2300
                             </label>
2301 2301
                             <div class="gd-cf-input-wrap">
2302 2302
 
2303
-                                <input type="text" name="asc_title" id="asc_title" value="<?php echo $value;?>" />
2303
+                                <input type="text" name="asc_title" id="asc_title" value="<?php echo $value; ?>" />
2304 2304
                             </div>
2305 2305
 
2306 2306
 
2307 2307
                         </li>
2308 2308
 
2309 2309
 
2310
-                        <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;'";}?>>
2310
+                        <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 2311
 
2312 2312
                             <label for="is_default" class="gd-cf-tooltip-wrap">
2313 2313
                                 <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Default sort?', 'geodirectory'); ?>
@@ -2318,7 +2318,7 @@  discard block
 block discarded – undo
2318 2318
                             <div class="gd-cf-input-wrap">
2319 2319
 
2320 2320
                                 <input type="radio" name="is_default"
2321
-                                       value="<?php echo $htmlvar_name; ?>_asc" <?php if (isset($field_info->default_order) && $field_info->default_order == $htmlvar_name . '_asc') {
2321
+                                       value="<?php echo $htmlvar_name; ?>_asc" <?php if (isset($field_info->default_order) && $field_info->default_order == $htmlvar_name.'_asc') {
2322 2322
                                     echo 'checked="checked"';
2323 2323
                                 } ?>/>
2324 2324
                             </div>
@@ -2328,7 +2328,7 @@  discard block
 block discarded – undo
2328 2328
 
2329 2329
 
2330 2330
                         <li>
2331
-                            <?php $value = (isset($field_info->sort_desc) && $field_info->sort_desc) ? $field_info->sort_desc : 0;?>
2331
+                            <?php $value = (isset($field_info->sort_desc) && $field_info->sort_desc) ? $field_info->sort_desc : 0; ?>
2332 2332
 
2333 2333
                             <label for="desc" class="gd-cf-tooltip-wrap">
2334 2334
                                 <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Show Descending Sort (high to low)', 'geodirectory'); ?>
@@ -2338,24 +2338,24 @@  discard block
 block discarded – undo
2338 2338
                             </label>
2339 2339
                             <div class="gd-cf-input-wrap gd-switch">
2340 2340
 
2341
-                                <input type="radio" id="desc_yes<?php echo $radio_id;?>" name="desc" class="gdri-enabled"  value="1"
2341
+                                <input type="radio" id="desc_yes<?php echo $radio_id; ?>" name="desc" class="gdri-enabled"  value="1"
2342 2342
                                     <?php if ($value == '1') {
2343 2343
                                         echo 'checked';
2344 2344
                                     } ?>/>
2345
-                                <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>
2345
+                                <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 2346
 
2347
-                                <input type="radio" id="desc_no<?php echo $radio_id;?>" name="desc" class="gdri-disabled" value="0"
2347
+                                <input type="radio" id="desc_no<?php echo $radio_id; ?>" name="desc" class="gdri-disabled" value="0"
2348 2348
                                     <?php if ($value == '0' || !$value) {
2349 2349
                                         echo 'checked';
2350 2350
                                     } ?>/>
2351
-                                <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>
2351
+                                <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 2352
 
2353 2353
                             </div>
2354 2354
 
2355 2355
                         </li>
2356 2356
 
2357
-                        <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;'";}?>>
2358
-                            <?php $value = (isset($field_info->desc_title) && $field_info->desc_title) ? esc_attr($field_info->desc_title) : '';?>
2357
+                        <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;'"; }?>>
2358
+                            <?php $value = (isset($field_info->desc_title) && $field_info->desc_title) ? esc_attr($field_info->desc_title) : ''; ?>
2359 2359
 
2360 2360
                             <label for="desc_title" class="gd-cf-tooltip-wrap">
2361 2361
                                 <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Descending title', 'geodirectory'); ?>
@@ -2365,13 +2365,13 @@  discard block
 block discarded – undo
2365 2365
                             </label>
2366 2366
                             <div class="gd-cf-input-wrap">
2367 2367
 
2368
-                                <input type="text" name="desc_title" id="desc_title" value="<?php echo $value;?>" />
2368
+                                <input type="text" name="desc_title" id="desc_title" value="<?php echo $value; ?>" />
2369 2369
                             </div>
2370 2370
 
2371 2371
 
2372 2372
                         </li>
2373 2373
 
2374
-                        <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;'";}?>>
2374
+                        <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 2375
 
2376 2376
                             <label for="is_default" class="gd-cf-tooltip-wrap">
2377 2377
                                 <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Default sort?', 'geodirectory'); ?>
@@ -2382,7 +2382,7 @@  discard block
 block discarded – undo
2382 2382
                             <div class="gd-cf-input-wrap">
2383 2383
 
2384 2384
                                 <input type="radio" name="is_default"
2385
-                                       value="<?php echo $htmlvar_name; ?>_desc" <?php if (isset($field_info->default_order) && $field_info->default_order == $htmlvar_name . '_desc') {
2385
+                                       value="<?php echo $htmlvar_name; ?>_desc" <?php if (isset($field_info->default_order) && $field_info->default_order == $htmlvar_name.'_desc') {
2386 2386
                                     echo 'checked="checked"';
2387 2387
                                 } ?>/>
2388 2388
                             </div>
@@ -2407,14 +2407,14 @@  discard block
 block discarded – undo
2407 2407
                             </label>
2408 2408
                             <div class="gd-cf-input-wrap">
2409 2409
 
2410
-                                <input type="text" name="site_title" id="site_title" value="<?php echo $value;?>" />
2410
+                                <input type="text" name="site_title" id="site_title" value="<?php echo $value; ?>" />
2411 2411
                             </div>
2412 2412
 
2413 2413
 
2414 2414
                         </li>
2415 2415
 
2416 2416
                         <li>
2417
-                            <?php $value = (isset($field_info->is_default) && $field_info->is_default) ? esc_attr($field_info->is_default) : '';?>
2417
+                            <?php $value = (isset($field_info->is_default) && $field_info->is_default) ? esc_attr($field_info->is_default) : ''; ?>
2418 2418
 
2419 2419
                             <label for="is_default" class="gd-cf-tooltip-wrap">
2420 2420
                                 <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Default sort?', 'geodirectory'); ?>
@@ -2438,7 +2438,7 @@  discard block
 block discarded – undo
2438 2438
 
2439 2439
 
2440 2440
                     <li>
2441
-                        <?php $value = (isset($field_info->is_active) && $field_info->is_active) ? $field_info->is_active: 0;?>
2441
+                        <?php $value = (isset($field_info->is_active) && $field_info->is_active) ? $field_info->is_active : 0; ?>
2442 2442
 
2443 2443
                         <label for="is_active" class="gd-cf-tooltip-wrap">
2444 2444
                             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Is active', 'geodirectory'); ?>
@@ -2448,17 +2448,17 @@  discard block
 block discarded – undo
2448 2448
                         </label>
2449 2449
                         <div class="gd-cf-input-wrap gd-switch">
2450 2450
 
2451
-                            <input type="radio" id="is_active_yes<?php echo $radio_id;?>" name="is_active" class="gdri-enabled"  value="1"
2451
+                            <input type="radio" id="is_active_yes<?php echo $radio_id; ?>" name="is_active" class="gdri-enabled"  value="1"
2452 2452
                                 <?php if ($value == '1') {
2453 2453
                                     echo 'checked';
2454 2454
                                 } ?>/>
2455
-                            <label for="is_active_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
2455
+                            <label for="is_active_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
2456 2456
 
2457
-                            <input type="radio" id="is_active_no<?php echo $radio_id;?>" name="is_active" class="gdri-disabled" value="0"
2457
+                            <input type="radio" id="is_active_no<?php echo $radio_id; ?>" name="is_active" class="gdri-disabled" value="0"
2458 2458
                                 <?php if ($value == '0' || !$value) {
2459 2459
                                     echo 'checked';
2460 2460
                                 } ?>/>
2461
-                            <label for="is_active_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
2461
+                            <label for="is_active_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
2462 2462
 
2463 2463
                         </div>
2464 2464
 
@@ -2479,10 +2479,10 @@  discard block
 block discarded – undo
2479 2479
                             <h3></h3>
2480 2480
                         </label>
2481 2481
                         <div class="gd-cf-input-wrap">
2482
-                            <input type="button" class="button button-primary" name="save" id="save" value="<?php echo esc_attr(__('Save','geodirectory'));?>"
2482
+                            <input type="button" class="button button-primary" name="save" id="save" value="<?php echo esc_attr(__('Save', 'geodirectory')); ?>"
2483 2483
                                    onclick="save_sort_field('<?php echo esc_attr($result_str); ?>')"/>
2484
-                                <a href="javascript:void(0)"><input type="button" name="delete" value="<?php echo esc_attr(__('Delete','geodirectory'));?>"
2485
-                                                                    onclick="delete_sort_field('<?php echo $result_str;?>', '<?php echo $nonce;?>', this)"
2484
+                                <a href="javascript:void(0)"><input type="button" name="delete" value="<?php echo esc_attr(__('Delete', 'geodirectory')); ?>"
2485
+                                                                    onclick="delete_sort_field('<?php echo $result_str; ?>', '<?php echo $nonce; ?>', this)"
2486 2486
                                                                     class="button"/></a>
2487 2487
                         </div>
2488 2488
                     </li>
@@ -2517,7 +2517,7 @@  discard block
 block discarded – undo
2517 2517
         if (!$package_id || !$field_name || !$post_type) {
2518 2518
             return true;
2519 2519
         }
2520
-        $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));
2520
+        $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 2521
 
2522 2522
         if ($wpdb->get_var($sql)) {
2523 2523
             return true;
@@ -2639,7 +2639,7 @@  discard block
 block discarded – undo
2639 2639
 }
2640 2640
 
2641 2641
 
2642
-function geodir_cfa_data_type_text($output,$result_str,$cf,$field_info){
2642
+function geodir_cfa_data_type_text($output, $result_str, $cf, $field_info) {
2643 2643
     ob_start();
2644 2644
     ?>
2645 2645
     <li>
@@ -2685,43 +2685,43 @@  discard block
 block discarded – undo
2685 2685
     $output = ob_get_clean();
2686 2686
     return $output;
2687 2687
 }
2688
-add_filter('geodir_cfa_data_type_text','geodir_cfa_data_type_text',10,4);
2688
+add_filter('geodir_cfa_data_type_text', 'geodir_cfa_data_type_text', 10, 4);
2689 2689
 
2690 2690
 // htmlvar not needed for fieldset and taxonomy
2691
-add_filter('geodir_cfa_htmlvar_name_fieldset','__return_empty_string',10,4);
2692
-add_filter('geodir_cfa_htmlvar_name_taxonomy','__return_empty_string',10,4);
2691
+add_filter('geodir_cfa_htmlvar_name_fieldset', '__return_empty_string', 10, 4);
2692
+add_filter('geodir_cfa_htmlvar_name_taxonomy', '__return_empty_string', 10, 4);
2693 2693
 
2694 2694
 
2695 2695
 // default_value not needed for textarea, html, file, fieldset, taxonomy, address
2696
-add_filter('geodir_cfa_default_value_textarea','__return_empty_string',10,4);
2697
-add_filter('geodir_cfa_default_value_html','__return_empty_string',10,4);
2698
-add_filter('geodir_cfa_default_value_file','__return_empty_string',10,4);
2699
-add_filter('geodir_cfa_default_value_taxonomy','__return_empty_string',10,4);
2700
-add_filter('geodir_cfa_default_value_address','__return_empty_string',10,4);
2701
-add_filter('geodir_cfa_default_value_fieldset','__return_empty_string',10,4);
2696
+add_filter('geodir_cfa_default_value_textarea', '__return_empty_string', 10, 4);
2697
+add_filter('geodir_cfa_default_value_html', '__return_empty_string', 10, 4);
2698
+add_filter('geodir_cfa_default_value_file', '__return_empty_string', 10, 4);
2699
+add_filter('geodir_cfa_default_value_taxonomy', '__return_empty_string', 10, 4);
2700
+add_filter('geodir_cfa_default_value_address', '__return_empty_string', 10, 4);
2701
+add_filter('geodir_cfa_default_value_fieldset', '__return_empty_string', 10, 4);
2702 2702
 
2703 2703
 // is_required not needed for fieldset
2704
-add_filter('geodir_cfa_is_required_fieldset','__return_empty_string',10,4);
2705
-add_filter('geodir_cfa_required_msg_fieldset','__return_empty_string',10,4);
2704
+add_filter('geodir_cfa_is_required_fieldset', '__return_empty_string', 10, 4);
2705
+add_filter('geodir_cfa_required_msg_fieldset', '__return_empty_string', 10, 4);
2706 2706
 
2707 2707
 // field_icon not needed for fieldset
2708
-add_filter('geodir_cfa_field_icon_fieldset','__return_empty_string',10,4);
2709
-add_filter('geodir_cfa_css_class_fieldset','__return_empty_string',10,4);
2708
+add_filter('geodir_cfa_field_icon_fieldset', '__return_empty_string', 10, 4);
2709
+add_filter('geodir_cfa_css_class_fieldset', '__return_empty_string', 10, 4);
2710 2710
 
2711 2711
 // cat_sort not needed for some fields
2712
-add_filter('geodir_cfa_cat_sort_html','__return_empty_string',10,4);
2713
-add_filter('geodir_cfa_cat_sort_file','__return_empty_string',10,4);
2714
-add_filter('geodir_cfa_cat_sort_url','__return_empty_string',10,4);
2715
-add_filter('geodir_cfa_cat_sort_fieldset','__return_empty_string',10,4);
2716
-add_filter('geodir_cfa_cat_sort_multiselect','__return_empty_string',10,4);
2717
-add_filter('geodir_cfa_cat_sort_textarea','__return_empty_string',10,4);
2718
-add_filter('geodir_cfa_cat_sort_taxonomy','__return_empty_string',10,4);
2719
-add_filter('geodir_cfa_cat_sort_address','__return_empty_string',10,4);
2712
+add_filter('geodir_cfa_cat_sort_html', '__return_empty_string', 10, 4);
2713
+add_filter('geodir_cfa_cat_sort_file', '__return_empty_string', 10, 4);
2714
+add_filter('geodir_cfa_cat_sort_url', '__return_empty_string', 10, 4);
2715
+add_filter('geodir_cfa_cat_sort_fieldset', '__return_empty_string', 10, 4);
2716
+add_filter('geodir_cfa_cat_sort_multiselect', '__return_empty_string', 10, 4);
2717
+add_filter('geodir_cfa_cat_sort_textarea', '__return_empty_string', 10, 4);
2718
+add_filter('geodir_cfa_cat_sort_taxonomy', '__return_empty_string', 10, 4);
2719
+add_filter('geodir_cfa_cat_sort_address', '__return_empty_string', 10, 4);
2720 2720
 
2721 2721
 
2722 2722
 
2723
-function geodir_cfa_advanced_editor_geodir_special_offers($output,$result_str,$cf,$field_info){
2724
-    if($field_info->htmlvar_name != 'geodir_special_offers'){return '';}
2723
+function geodir_cfa_advanced_editor_geodir_special_offers($output, $result_str, $cf, $field_info) {
2724
+    if ($field_info->htmlvar_name != 'geodir_special_offers') {return ''; }
2725 2725
     ob_start();
2726 2726
     ?>
2727 2727
     <li>
@@ -2752,16 +2752,16 @@  discard block
 block discarded – undo
2752 2752
     $output = ob_get_clean();
2753 2753
     return $output;
2754 2754
 }
2755
-add_filter('geodir_cfa_advanced_editor_textarea','geodir_cfa_advanced_editor_geodir_special_offers',10,4);
2755
+add_filter('geodir_cfa_advanced_editor_textarea', 'geodir_cfa_advanced_editor_geodir_special_offers', 10, 4);
2756 2756
 
2757 2757
 
2758
-function geodir_cfa_validation_pattern_text($output,$result_str,$cf,$field_info){
2758
+function geodir_cfa_validation_pattern_text($output, $result_str, $cf, $field_info) {
2759 2759
     ob_start();
2760 2760
 
2761 2761
     $value = '';
2762 2762
     if (isset($field_info->validation_pattern)) {
2763 2763
         $value = esc_attr($field_info->validation_pattern);
2764
-    }elseif(isset($cf['defaults']['validation_pattern']) && $cf['defaults']['validation_pattern']){
2764
+    }elseif (isset($cf['defaults']['validation_pattern']) && $cf['defaults']['validation_pattern']) {
2765 2765
         $value = esc_attr($cf['defaults']['validation_pattern']);
2766 2766
     }
2767 2767
     ?>
@@ -2781,7 +2781,7 @@  discard block
 block discarded – undo
2781 2781
     $value = '';
2782 2782
     if (isset($field_info->validation_msg)) {
2783 2783
         $value = esc_attr($field_info->validation_msg);
2784
-    }elseif(isset($cf['defaults']['validation_msg']) && $cf['defaults']['validation_msg']){
2784
+    }elseif (isset($cf['defaults']['validation_msg']) && $cf['defaults']['validation_msg']) {
2785 2785
         $value = esc_attr($cf['defaults']['validation_msg']);
2786 2786
     }
2787 2787
     ?>
@@ -2802,10 +2802,10 @@  discard block
 block discarded – undo
2802 2802
     $output = ob_get_clean();
2803 2803
     return $output;
2804 2804
 }
2805
-add_filter('geodir_cfa_validation_pattern_text','geodir_cfa_validation_pattern_text',10,4);
2805
+add_filter('geodir_cfa_validation_pattern_text', 'geodir_cfa_validation_pattern_text', 10, 4);
2806 2806
 
2807 2807
 
2808
-function geodir_cfa_htmlvar_name_taxonomy($output,$result_str,$cf,$field_info){
2808
+function geodir_cfa_htmlvar_name_taxonomy($output, $result_str, $cf, $field_info) {
2809 2809
     ob_start();
2810 2810
     global $post_type;
2811 2811
 
@@ -2830,7 +2830,7 @@  discard block
 block discarded – undo
2830 2830
                     ?>
2831 2831
                     <option <?php if (isset($field_info->htmlvar_name) && $field_info->htmlvar_name == $gd_tax) {
2832 2832
                         echo 'selected="selected"';
2833
-                    }?> id="<?php echo $gd_tax;?>"><?php echo $gd_tax;?></option><?php
2833
+                    }?> id="<?php echo $gd_tax; ?>"><?php echo $gd_tax; ?></option><?php
2834 2834
                 }
2835 2835
                 ?>
2836 2836
             </select>
@@ -2841,7 +2841,7 @@  discard block
 block discarded – undo
2841 2841
         <label for="cat_display_type" class="gd-cf-tooltip-wrap">
2842 2842
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Category display type :', 'geodirectory'); ?>
2843 2843
             <div class="gdcf-tooltip">
2844
-                <?php _e('Show categories list as select, multiselect, checkbox or radio', 'geodirectory');?>
2844
+                <?php _e('Show categories list as select, multiselect, checkbox or radio', 'geodirectory'); ?>
2845 2845
             </div>
2846 2846
         </label>
2847 2847
         <div class="gd-cf-input-wrap">
@@ -2849,19 +2849,19 @@  discard block
 block discarded – undo
2849 2849
             <select name="cat_display_type" id="cat_display_type">
2850 2850
                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'ajax_chained') {
2851 2851
                     echo 'selected="selected"';
2852
-                }?> value="ajax_chained"><?php _e('Ajax Chained', 'geodirectory');?></option>
2852
+                }?> value="ajax_chained"><?php _e('Ajax Chained', 'geodirectory'); ?></option>
2853 2853
                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'select') {
2854 2854
                     echo 'selected="selected"';
2855
-                }?> value="select"><?php _e('Select', 'geodirectory');?></option>
2855
+                }?> value="select"><?php _e('Select', 'geodirectory'); ?></option>
2856 2856
                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'multiselect') {
2857 2857
                     echo 'selected="selected"';
2858
-                }?> value="multiselect"><?php _e('Multiselect', 'geodirectory');?></option>
2858
+                }?> value="multiselect"><?php _e('Multiselect', 'geodirectory'); ?></option>
2859 2859
                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'checkbox') {
2860 2860
                     echo 'selected="selected"';
2861
-                }?> value="checkbox"><?php _e('Checkbox', 'geodirectory');?></option>
2861
+                }?> value="checkbox"><?php _e('Checkbox', 'geodirectory'); ?></option>
2862 2862
                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'radio') {
2863 2863
                     echo 'selected="selected"';
2864
-                }?> value="radio"><?php _e('Radio', 'geodirectory');?></option>
2864
+                }?> value="radio"><?php _e('Radio', 'geodirectory'); ?></option>
2865 2865
             </select>
2866 2866
         </div>
2867 2867
     </li>
@@ -2870,10 +2870,10 @@  discard block
 block discarded – undo
2870 2870
     $output = ob_get_clean();
2871 2871
     return $output;
2872 2872
 }
2873
-add_filter('geodir_cfa_htmlvar_name_taxonomy','geodir_cfa_htmlvar_name_taxonomy',10,4);
2873
+add_filter('geodir_cfa_htmlvar_name_taxonomy', 'geodir_cfa_htmlvar_name_taxonomy', 10, 4);
2874 2874
 
2875 2875
 
2876
-function geodir_cfa_extra_fields_address($output,$result_str,$cf,$field_info){
2876
+function geodir_cfa_extra_fields_address($output, $result_str, $cf, $field_info) {
2877 2877
 
2878 2878
     ob_start();
2879 2879
     if (isset($field_info->extra_fields) && $field_info->extra_fields != '') {
@@ -2896,32 +2896,32 @@  discard block
 block discarded – undo
2896 2896
         <label for="show_zip" class="gd-cf-tooltip-wrap">
2897 2897
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Display zip/post code :', 'geodirectory'); ?>
2898 2898
             <div class="gdcf-tooltip">
2899
-                <?php _e('Select if you want to show zip/post code field in address section.', 'geodirectory');?>
2899
+                <?php _e('Select if you want to show zip/post code field in address section.', 'geodirectory'); ?>
2900 2900
             </div>
2901 2901
         </label>
2902 2902
         <div class="gd-cf-input-wrap gd-switch">
2903 2903
 
2904
-            <input type="radio" id="show_zip_yes<?php echo $radio_id;?>" name="extra[show_zip]" class="gdri-enabled"  value="1"
2904
+            <input type="radio" id="show_zip_yes<?php echo $radio_id; ?>" name="extra[show_zip]" class="gdri-enabled"  value="1"
2905 2905
                 <?php if (isset($address['show_zip']) && $address['show_zip'] == '1') {
2906 2906
                     echo 'checked';
2907 2907
                 } ?>/>
2908
-            <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
+            <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>
2909 2909
 
2910
-            <input type="radio" id="show_zip_no<?php echo $radio_id;?>" name="extra[show_zip]" class="gdri-disabled" value="0"
2910
+            <input type="radio" id="show_zip_no<?php echo $radio_id; ?>" name="extra[show_zip]" class="gdri-disabled" value="0"
2911 2911
                 <?php if ((isset($address['show_zip']) && !$address['show_zip']) || !isset($address['show_zip'])) {
2912 2912
                     echo 'checked';
2913 2913
                 } ?>/>
2914
-            <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
+            <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>
2915 2915
 
2916 2916
 
2917 2917
         </div>
2918 2918
     </li>
2919 2919
 
2920
-    <li class="cf-zip-lable"  <?php if ((isset($address['show_zip']) && !$address['show_zip']) || !isset($address['show_zip'])) {echo "style='display:none;'";}?> >
2920
+    <li class="cf-zip-lable"  <?php if ((isset($address['show_zip']) && !$address['show_zip']) || !isset($address['show_zip'])) {echo "style='display:none;'"; }?> >
2921 2921
         <label for="zip_lable" class="gd-cf-tooltip-wrap">
2922 2922
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Zip/Post code label :', 'geodirectory'); ?>
2923 2923
             <div class="gdcf-tooltip">
2924
-                <?php _e('Enter zip/post code field label in address section.', 'geodirectory');?>
2924
+                <?php _e('Enter zip/post code field label in address section.', 'geodirectory'); ?>
2925 2925
             </div>
2926 2926
         </label>
2927 2927
         <div class="gd-cf-input-wrap">
@@ -2939,7 +2939,7 @@  discard block
 block discarded – undo
2939 2939
         <label for="map_lable" class="gd-cf-tooltip-wrap">
2940 2940
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Map button label :', 'geodirectory'); ?>
2941 2941
             <div class="gdcf-tooltip">
2942
-                <?php _e('Enter text for `set address on map` button in address section.', 'geodirectory');?>
2942
+                <?php _e('Enter text for `set address on map` button in address section.', 'geodirectory'); ?>
2943 2943
             </div>
2944 2944
         </label>
2945 2945
         <div class="gd-cf-input-wrap">
@@ -2954,22 +2954,22 @@  discard block
 block discarded – undo
2954 2954
         <label for="show_mapzoom" class="gd-cf-tooltip-wrap">
2955 2955
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Use user zoom level:', 'geodirectory'); ?>
2956 2956
             <div class="gdcf-tooltip">
2957
-                <?php _e('Do you want to use the user defined map zoom level from the add listing page?', 'geodirectory');?>
2957
+                <?php _e('Do you want to use the user defined map zoom level from the add listing page?', 'geodirectory'); ?>
2958 2958
             </div>
2959 2959
         </label>
2960 2960
         <div class="gd-cf-input-wrap gd-switch">
2961 2961
 
2962
-            <input type="radio" id="show_mapzoom_yes<?php echo $radio_id;?>" name="extra[show_mapzoom]" class="gdri-enabled"  value="1"
2962
+            <input type="radio" id="show_mapzoom_yes<?php echo $radio_id; ?>" name="extra[show_mapzoom]" class="gdri-enabled"  value="1"
2963 2963
                 <?php if (isset($address['show_mapzoom']) && $address['show_mapzoom'] == '1') {
2964 2964
                     echo 'checked';
2965 2965
                 } ?>/>
2966
-            <label for="show_mapzoom_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
2966
+            <label for="show_mapzoom_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
2967 2967
 
2968
-            <input type="radio" id="show_mapzoom_no<?php echo $radio_id;?>" name="extra[show_mapzoom]" class="gdri-disabled" value="0"
2968
+            <input type="radio" id="show_mapzoom_no<?php echo $radio_id; ?>" name="extra[show_mapzoom]" class="gdri-disabled" value="0"
2969 2969
                 <?php if ((isset($address['show_mapzoom']) && !$address['show_mapzoom']) || !isset($address['show_mapzoom'])) {
2970 2970
                     echo 'checked';
2971 2971
                 } ?>/>
2972
-            <label for="show_mapzoom_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
2972
+            <label for="show_mapzoom_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
2973 2973
 
2974 2974
         </div>
2975 2975
     </li>
@@ -2978,22 +2978,22 @@  discard block
 block discarded – undo
2978 2978
         <label for="show_mapview" class="gd-cf-tooltip-wrap">
2979 2979
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Display map view:', 'geodirectory'); ?>
2980 2980
             <div class="gdcf-tooltip">
2981
-                <?php _e('Select if you want to `set default map` options in address section. ( Satellite Map, Hybrid Map, Terrain Map)', 'geodirectory');?>
2981
+                <?php _e('Select if you want to `set default map` options in address section. ( Satellite Map, Hybrid Map, Terrain Map)', 'geodirectory'); ?>
2982 2982
             </div>
2983 2983
         </label>
2984 2984
         <div class="gd-cf-input-wrap gd-switch">
2985 2985
 
2986
-            <input type="radio" id="show_mapview_yes<?php echo $radio_id;?>" name="extra[show_mapview]" class="gdri-enabled"  value="1"
2986
+            <input type="radio" id="show_mapview_yes<?php echo $radio_id; ?>" name="extra[show_mapview]" class="gdri-enabled"  value="1"
2987 2987
                 <?php if (isset($address['show_mapview']) && $address['show_mapview'] == '1') {
2988 2988
                     echo 'checked';
2989 2989
                 } ?>/>
2990
-            <label for="show_mapview_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
2990
+            <label for="show_mapview_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
2991 2991
 
2992
-            <input type="radio" id="show_mapview_no<?php echo $radio_id;?>" name="extra[show_mapview]" class="gdri-disabled" value="0"
2992
+            <input type="radio" id="show_mapview_no<?php echo $radio_id; ?>" name="extra[show_mapview]" class="gdri-disabled" value="0"
2993 2993
                 <?php if ((isset($address['show_mapview']) && !$address['show_mapview']) || !isset($address['show_mapview'])) {
2994 2994
                     echo 'checked';
2995 2995
                 } ?>/>
2996
-            <label for="show_mapview_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
2996
+            <label for="show_mapview_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
2997 2997
 
2998 2998
         </div>
2999 2999
     </li>
@@ -3003,7 +3003,7 @@  discard block
 block discarded – undo
3003 3003
         <label for="mapview_lable" class="gd-cf-tooltip-wrap">
3004 3004
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Map view label:', 'geodirectory'); ?>
3005 3005
             <div class="gdcf-tooltip">
3006
-                <?php _e('Enter mapview field label in address section.', 'geodirectory');?>
3006
+                <?php _e('Enter mapview field label in address section.', 'geodirectory'); ?>
3007 3007
             </div>
3008 3008
         </label>
3009 3009
         <div class="gd-cf-input-wrap">
@@ -3017,22 +3017,22 @@  discard block
 block discarded – undo
3017 3017
         <label for="show_latlng" class="gd-cf-tooltip-wrap">
3018 3018
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Show latitude and longitude', 'geodirectory'); ?>
3019 3019
             <div class="gdcf-tooltip">
3020
-                <?php _e('This will show/hide the longitude fields in the address section add listing form.', 'geodirectory');?>
3020
+                <?php _e('This will show/hide the longitude fields in the address section add listing form.', 'geodirectory'); ?>
3021 3021
             </div>
3022 3022
         </label>
3023 3023
         <div class="gd-cf-input-wrap gd-switch">
3024 3024
 
3025
-            <input type="radio" id="show_latlng_yes<?php echo $radio_id;?>" name="extra[show_latlng]" class="gdri-enabled"  value="1"
3025
+            <input type="radio" id="show_latlng_yes<?php echo $radio_id; ?>" name="extra[show_latlng]" class="gdri-enabled"  value="1"
3026 3026
                 <?php if (isset($address['show_latlng']) && $address['show_latlng'] == '1') {
3027 3027
                     echo 'checked';
3028 3028
                 } ?>/>
3029
-            <label for="show_latlng_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
3029
+            <label for="show_latlng_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label>
3030 3030
 
3031
-            <input type="radio" id="show_latlng_no<?php echo $radio_id;?>" name="extra[show_latlng]" class="gdri-disabled" value="0"
3031
+            <input type="radio" id="show_latlng_no<?php echo $radio_id; ?>" name="extra[show_latlng]" class="gdri-disabled" value="0"
3032 3032
                 <?php if ((isset($address['show_latlng']) && !$address['show_latlng']) || !isset($address['show_latlng'])) {
3033 3033
                     echo 'checked';
3034 3034
                 } ?>/>
3035
-            <label for="show_latlng_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
3035
+            <label for="show_latlng_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label>
3036 3036
 
3037 3037
         </div>
3038 3038
     </li>
@@ -3041,17 +3041,17 @@  discard block
 block discarded – undo
3041 3041
     $output = ob_get_clean();
3042 3042
     return $output;
3043 3043
 }
3044
-add_filter('geodir_cfa_extra_fields_address','geodir_cfa_extra_fields_address',10,4);
3044
+add_filter('geodir_cfa_extra_fields_address', 'geodir_cfa_extra_fields_address', 10, 4);
3045 3045
 
3046 3046
 
3047
-function geodir_cfa_extra_fields_multiselect($output,$result_str,$cf,$field_info){
3047
+function geodir_cfa_extra_fields_multiselect($output, $result_str, $cf, $field_info) {
3048 3048
     ob_start();
3049 3049
     ?>
3050 3050
     <li>
3051 3051
         <label for="multi_display_type" class="gd-cf-tooltip-wrap">
3052 3052
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Multiselect display type :', 'geodirectory'); ?>
3053 3053
             <div class="gdcf-tooltip">
3054
-                <?php _e('Show multiselect list as multiselect,checkbox or radio.', 'geodirectory');?>
3054
+                <?php _e('Show multiselect list as multiselect,checkbox or radio.', 'geodirectory'); ?>
3055 3055
             </div>
3056 3056
         </label>
3057 3057
         <div class="gd-cf-input-wrap">
@@ -3059,13 +3059,13 @@  discard block
 block discarded – undo
3059 3059
             <select name="multi_display_type" id="multi_display_type">
3060 3060
                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'select') {
3061 3061
                     echo 'selected="selected"';
3062
-                }?> value="select"><?php _e('Select', 'geodirectory');?></option>
3062
+                }?> value="select"><?php _e('Select', 'geodirectory'); ?></option>
3063 3063
                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'checkbox') {
3064 3064
                     echo 'selected="selected"';
3065
-                }?> value="checkbox"><?php _e('Checkbox', 'geodirectory');?></option>
3065
+                }?> value="checkbox"><?php _e('Checkbox', 'geodirectory'); ?></option>
3066 3066
                 <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'radio') {
3067 3067
                     echo 'selected="selected"';
3068
-                }?> value="radio"><?php _e('Radio', 'geodirectory');?></option>
3068
+                }?> value="radio"><?php _e('Radio', 'geodirectory'); ?></option>
3069 3069
             </select>
3070 3070
 
3071 3071
             <br/>
@@ -3076,10 +3076,10 @@  discard block
 block discarded – undo
3076 3076
     $output = ob_get_clean();
3077 3077
     return $output;
3078 3078
 }
3079
-add_filter('geodir_cfa_extra_fields_multiselect','geodir_cfa_extra_fields_multiselect',10,4);
3079
+add_filter('geodir_cfa_extra_fields_multiselect', 'geodir_cfa_extra_fields_multiselect', 10, 4);
3080 3080
 
3081 3081
 
3082
-function geodir_cfa_extra_fields_smr($output,$result_str,$cf,$field_info){
3082
+function geodir_cfa_extra_fields_smr($output, $result_str, $cf, $field_info) {
3083 3083
 
3084 3084
     ob_start();
3085 3085
     $field_type = isset($field_info->field_type) ? $field_info->field_type : '';
@@ -3088,11 +3088,11 @@  discard block
 block discarded – undo
3088 3088
         <label for="option_values" class="gd-cf-tooltip-wrap">
3089 3089
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Option Values :', 'geodirectory'); ?>
3090 3090
             <div class="gdcf-tooltip">
3091
-                <span><?php _e('Option Values should be separated by comma.', 'geodirectory');?></span>
3091
+                <span><?php _e('Option Values should be separated by comma.', 'geodirectory'); ?></span>
3092 3092
                 <br/>
3093
-                <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>
3093
+                <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>
3094 3094
                     <br/>
3095
-                    <span><?php _e('eg: "No Dogs Allowed/0,Dogs Allowed/1" (Select only, not multiselect)', 'geodirectory');?></span>
3095
+                    <span><?php _e('eg: "No Dogs Allowed/0,Dogs Allowed/1" (Select only, not multiselect)', 'geodirectory'); ?></span>
3096 3096
                     <?php if ($field_type == 'multiselect' || $field_type == 'select') { ?>
3097 3097
                         <br/>
3098 3098
                         <span><?php _e('- If using OPTGROUP tag to grouping options, use "{optgroup}OPTGROUP-LABEL|OPTION-1,OPTION-2{/optgroup}"', 'geodirectory'); ?></span>
@@ -3115,12 +3115,12 @@  discard block
 block discarded – undo
3115 3115
     $output = ob_get_clean();
3116 3116
     return $output;
3117 3117
 }
3118
-add_filter('geodir_cfa_extra_fields_multiselect','geodir_cfa_extra_fields_smr',10,4);
3119
-add_filter('geodir_cfa_extra_fields_select','geodir_cfa_extra_fields_smr',10,4);
3120
-add_filter('geodir_cfa_extra_fields_radio','geodir_cfa_extra_fields_smr',10,4);
3118
+add_filter('geodir_cfa_extra_fields_multiselect', 'geodir_cfa_extra_fields_smr', 10, 4);
3119
+add_filter('geodir_cfa_extra_fields_select', 'geodir_cfa_extra_fields_smr', 10, 4);
3120
+add_filter('geodir_cfa_extra_fields_radio', 'geodir_cfa_extra_fields_smr', 10, 4);
3121 3121
 
3122 3122
 
3123
-function geodir_cfa_extra_fields_datepicker($output,$result_str,$cf,$field_info){
3123
+function geodir_cfa_extra_fields_datepicker($output, $result_str, $cf, $field_info) {
3124 3124
     ob_start();
3125 3125
     $extra = array();
3126 3126
     if (isset($field_info->extra_fields) && $field_info->extra_fields != '') {
@@ -3131,7 +3131,7 @@  discard block
 block discarded – undo
3131 3131
         <label for="date_format" class="gd-cf-tooltip-wrap">
3132 3132
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Date Format :', 'geodirectory'); ?>
3133 3133
             <div class="gdcf-tooltip">
3134
-                <?php _e('Select the date format.', 'geodirectory');?>
3134
+                <?php _e('Select the date format.', 'geodirectory'); ?>
3135 3135
             </div>
3136 3136
         </label>
3137 3137
         <div class="gd-cf-input-wrap" style="overflow:inherit;">
@@ -3151,16 +3151,16 @@  discard block
 block discarded – undo
3151 3151
              * @since 1.6.5
3152 3152
              * @param array $date_formats The PHP date format array.
3153 3153
              */
3154
-            $date_formats = apply_filters('geodir_date_formats',$date_formats);
3154
+            $date_formats = apply_filters('geodir_date_formats', $date_formats);
3155 3155
             ?>
3156 3156
             <select name="extra[date_format]" id="date_format">
3157 3157
                 <?php
3158
-                foreach($date_formats as $format){
3158
+                foreach ($date_formats as $format) {
3159 3159
                     $selected = '';
3160
-                    if(!empty($extra) && esc_attr($extra['date_format'])==$format){
3160
+                    if (!empty($extra) && esc_attr($extra['date_format']) == $format) {
3161 3161
                         $selected = "selected='selected'";
3162 3162
                     }
3163
-                    echo "<option $selected value='$format'>$format       (".date_i18n( $format, time()).")</option>";
3163
+                    echo "<option $selected value='$format'>$format       (".date_i18n($format, time()).")</option>";
3164 3164
                 }
3165 3165
                 ?>
3166 3166
             </select>
@@ -3172,10 +3172,10 @@  discard block
 block discarded – undo
3172 3172
     $output = ob_get_clean();
3173 3173
     return $output;
3174 3174
 }
3175
-add_filter('geodir_cfa_extra_fields_datepicker','geodir_cfa_extra_fields_datepicker',10,4);
3175
+add_filter('geodir_cfa_extra_fields_datepicker', 'geodir_cfa_extra_fields_datepicker', 10, 4);
3176 3176
 
3177 3177
 
3178
-function geodir_cfa_extra_fields_file($output,$result_str,$cf,$field_info){
3178
+function geodir_cfa_extra_fields_file($output, $result_str, $cf, $field_info) {
3179 3179
     ob_start();
3180 3180
     $allowed_file_types = geodir_allowed_mime_types();
3181 3181
 
@@ -3186,16 +3186,16 @@  discard block
 block discarded – undo
3186 3186
         <label for="gd_file_types" class="gd-cf-tooltip-wrap">
3187 3187
             <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Allowed file types :', 'geodirectory'); ?>
3188 3188
             <div class="gdcf-tooltip">
3189
-                <?php _e('Select file types to allowed for file uploading. (Select multiple file types by holding down "Ctrl" key.)', 'geodirectory');?>
3189
+                <?php _e('Select file types to allowed for file uploading. (Select multiple file types by holding down "Ctrl" key.)', 'geodirectory'); ?>
3190 3190
             </div>
3191 3191
         </label>
3192 3192
         <div class="gd-cf-input-wrap">
3193 3193
             <select name="extra[gd_file_types][]" id="gd_file_types" multiple="multiple" style="height:100px;width:90%;">
3194
-                <option value="*" <?php selected(true, in_array('*', $gd_file_types));?>><?php _e('All types', 'geodirectory') ;?></option>
3195
-                <?php foreach ( $allowed_file_types as $format => $types ) { ?>
3196
-                    <optgroup label="<?php echo esc_attr( wp_sprintf(__('%s formats', 'geodirectory'), __($format, 'geodirectory') ) ) ;?>">
3197
-                        <?php foreach ( $types as $ext => $type ) { ?>
3198
-                            <option value="<?php echo esc_attr($ext) ;?>" <?php selected(true, in_array($ext, $gd_file_types));?>><?php echo '.' . $ext ;?></option>
3194
+                <option value="*" <?php selected(true, in_array('*', $gd_file_types)); ?>><?php _e('All types', 'geodirectory'); ?></option>
3195
+                <?php foreach ($allowed_file_types as $format => $types) { ?>
3196
+                    <optgroup label="<?php echo esc_attr(wp_sprintf(__('%s formats', 'geodirectory'), __($format, 'geodirectory'))); ?>">
3197
+                        <?php foreach ($types as $ext => $type) { ?>
3198
+                            <option value="<?php echo esc_attr($ext); ?>" <?php selected(true, in_array($ext, $gd_file_types)); ?>><?php echo '.'.$ext; ?></option>
3199 3199
                         <?php } ?>
3200 3200
                     </optgroup>
3201 3201
                 <?php } ?>
@@ -3207,11 +3207,11 @@  discard block
 block discarded – undo
3207 3207
     $output = ob_get_clean();
3208 3208
     return $output;
3209 3209
 }
3210
-add_filter('geodir_cfa_extra_fields_file','geodir_cfa_extra_fields_file',10,4);
3210
+add_filter('geodir_cfa_extra_fields_file', 'geodir_cfa_extra_fields_file', 10, 4);
3211 3211
 
3212
-function geodir_default_custom_fields($post_type='gd_place',$package_id=''){
3212
+function geodir_default_custom_fields($post_type = 'gd_place', $package_id = '') {
3213 3213
     $fields = array();
3214
-    $package = ($package_id=='') ? '' : array($package_id);
3214
+    $package = ($package_id == '') ? '' : array($package_id);
3215 3215
 
3216 3216
     $fields[] = array('listing_type' => $post_type,
3217 3217
                       'data_type' => 'VARCHAR',
Please login to merge, or discard this patch.