@@ -22,8 +22,7 @@ discard block |
||
| 22 | 22 | function geodir_cf_checkbox($html,$location,$cf,$p=''){ |
| 23 | 23 | |
| 24 | 24 | // check we have the post value |
| 25 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 26 | - else{ global $post;} |
|
| 25 | + if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;} |
|
| 27 | 26 | |
| 28 | 27 | if(!is_array($cf) && $cf!=''){ |
| 29 | 28 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
@@ -77,8 +76,10 @@ discard block |
||
| 77 | 76 | |
| 78 | 77 | if ( $post->{$html_var} == '1' ): |
| 79 | 78 | $html_val = __( 'Yes', 'geodirectory' ); |
| 80 | - else: |
|
| 79 | + else { |
|
| 80 | + : |
|
| 81 | 81 | $html_val = __( 'No', 'geodirectory' ); |
| 82 | + } |
|
| 82 | 83 | endif; |
| 83 | 84 | |
| 84 | 85 | $field_icon = geodir_field_icon_proccess($cf); |
@@ -116,8 +117,7 @@ discard block |
||
| 116 | 117 | function geodir_cf_fieldset($html,$location,$cf,$p=''){ |
| 117 | 118 | |
| 118 | 119 | // check we have the post value |
| 119 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 120 | - else{ global $post;} |
|
| 120 | + if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;} |
|
| 121 | 121 | |
| 122 | 122 | if(!is_array($cf) && $cf!=''){ |
| 123 | 123 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
@@ -197,8 +197,7 @@ discard block |
||
| 197 | 197 | function geodir_cf_url($html,$location,$cf,$p=''){ |
| 198 | 198 | |
| 199 | 199 | // check we have the post value |
| 200 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 201 | - else{ global $post;} |
|
| 200 | + if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;} |
|
| 202 | 201 | |
| 203 | 202 | if(!is_array($cf) && $cf!=''){ |
| 204 | 203 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
@@ -313,8 +312,7 @@ discard block |
||
| 313 | 312 | function geodir_cf_phone($html,$location,$cf,$p=''){ |
| 314 | 313 | |
| 315 | 314 | // check we have the post value |
| 316 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 317 | - else{ global $post;} |
|
| 315 | + if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;} |
|
| 318 | 316 | |
| 319 | 317 | if(!is_array($cf) && $cf!=''){ |
| 320 | 318 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
@@ -403,8 +401,7 @@ discard block |
||
| 403 | 401 | function geodir_cf_time($html,$location,$cf,$p=''){ |
| 404 | 402 | |
| 405 | 403 | // check we have the post value |
| 406 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 407 | - else{ global $post;} |
|
| 404 | + if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;} |
|
| 408 | 405 | |
| 409 | 406 | if(!is_array($cf) && $cf!=''){ |
| 410 | 407 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
@@ -457,9 +454,10 @@ discard block |
||
| 457 | 454 | if ($post->{$cf['htmlvar_name']}): |
| 458 | 455 | |
| 459 | 456 | $value = ''; |
| 460 | - if ($post->{$cf['htmlvar_name']} != '') |
|
| 461 | - //$value = date('h:i',strtotime($post->{$cf['htmlvar_name']})); |
|
| 457 | + if ($post->{$cf['htmlvar_name']} != '') { |
|
| 458 | + //$value = date('h:i',strtotime($post->{$cf['htmlvar_name']})); |
|
| 462 | 459 | $value = date(get_option('time_format'), strtotime($post->{$cf['htmlvar_name']})); |
| 460 | + } |
|
| 463 | 461 | |
| 464 | 462 | $field_icon = geodir_field_icon_proccess($cf); |
| 465 | 463 | if (strpos($field_icon, 'http') !== false) { |
@@ -498,8 +496,7 @@ discard block |
||
| 498 | 496 | function geodir_cf_datepicker($html,$location,$cf,$p=''){ |
| 499 | 497 | global $preview; |
| 500 | 498 | // check we have the post value |
| 501 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 502 | - else{ global $post;} |
|
| 499 | + if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;} |
|
| 503 | 500 | |
| 504 | 501 | if(!is_array($cf) && $cf!=''){ |
| 505 | 502 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
@@ -566,7 +563,7 @@ discard block |
||
| 566 | 563 | $date_format = str_replace($search, $replace, $date_format); |
| 567 | 564 | |
| 568 | 565 | $post_htmlvar_value = ($date_format == 'd/m/Y' || $date_format == 'j/n/Y' ) ? str_replace('/', '-', $post->{$cf['htmlvar_name']}) : $post->{$cf['htmlvar_name']}; // PHP doesn't work well with dd/mm/yyyy format |
| 569 | - }else{ |
|
| 566 | + } else{ |
|
| 570 | 567 | $post_htmlvar_value = $post->{$cf['htmlvar_name']}; |
| 571 | 568 | } |
| 572 | 569 | |
@@ -575,7 +572,7 @@ discard block |
||
| 575 | 572 | $value = geodir_date($post_htmlvar_value, $date_format, $date_format_from); // save as sql format Y-m-d |
| 576 | 573 | //$post_htmlvar_value = strpos($post_htmlvar_value, '/') !== false ? str_replace('/', '-', $post_htmlvar_value) : $post_htmlvar_value; |
| 577 | 574 | //$value = date_i18n($date_format, strtotime($post_htmlvar_value)); |
| 578 | - }else{ |
|
| 575 | + } else{ |
|
| 579 | 576 | return ''; |
| 580 | 577 | } |
| 581 | 578 | |
@@ -618,8 +615,7 @@ discard block |
||
| 618 | 615 | function geodir_cf_text($html,$location,$cf,$p=''){ |
| 619 | 616 | |
| 620 | 617 | // check we have the post value |
| 621 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 622 | - else{ global $post;} |
|
| 618 | + if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;} |
|
| 623 | 619 | |
| 624 | 620 | if(!is_array($cf) && $cf!=''){ |
| 625 | 621 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
@@ -725,8 +721,7 @@ discard block |
||
| 725 | 721 | function geodir_cf_radio($html,$location,$cf,$p=''){ |
| 726 | 722 | |
| 727 | 723 | // check we have the post value |
| 728 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 729 | - else{ global $post;} |
|
| 724 | + if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;} |
|
| 730 | 725 | |
| 731 | 726 | if(!is_array($cf) && $cf!=''){ |
| 732 | 727 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
@@ -834,8 +829,7 @@ discard block |
||
| 834 | 829 | function geodir_cf_select($html,$location,$cf,$p=''){ |
| 835 | 830 | |
| 836 | 831 | // check we have the post value |
| 837 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 838 | - else{ global $post;} |
|
| 832 | + if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;} |
|
| 839 | 833 | |
| 840 | 834 | if(!is_array($cf) && $cf!=''){ |
| 841 | 835 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
@@ -936,8 +930,7 @@ discard block |
||
| 936 | 930 | function geodir_cf_multiselect($html,$location,$cf,$p=''){ |
| 937 | 931 | |
| 938 | 932 | // check we have the post value |
| 939 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 940 | - else{ global $post;} |
|
| 933 | + if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;} |
|
| 941 | 934 | |
| 942 | 935 | if(!is_array($cf) && $cf!=''){ |
| 943 | 936 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
@@ -1063,8 +1056,7 @@ discard block |
||
| 1063 | 1056 | function geodir_cf_email($html,$location,$cf,$p=''){ |
| 1064 | 1057 | |
| 1065 | 1058 | // check we have the post value |
| 1066 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 1067 | - else{ global $post;} |
|
| 1059 | + if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;} |
|
| 1068 | 1060 | |
| 1069 | 1061 | if(!is_array($cf) && $cf!=''){ |
| 1070 | 1062 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
@@ -1201,11 +1193,11 @@ discard block |
||
| 1201 | 1193 | $email_name = apply_filters('geodir_email_field_name_output',$email,$cf); |
| 1202 | 1194 | if($location=='mapbubble'){ |
| 1203 | 1195 | $html .= "<a href=\"mailto:$email\">$email_name</a>"; |
| 1204 | - }else{ |
|
| 1196 | + } else{ |
|
| 1205 | 1197 | $html .= "<script>document.write('<a href=\"mailto:'+'$e_split[0]' + '@' + '$e_split[1]'+'\">$email_name</a>')</script>"; |
| 1206 | 1198 | } |
| 1207 | 1199 | |
| 1208 | - }else{ |
|
| 1200 | + } else{ |
|
| 1209 | 1201 | $html .= $email; |
| 1210 | 1202 | } |
| 1211 | 1203 | $html .= '</span></div>'; |
@@ -1233,8 +1225,7 @@ discard block |
||
| 1233 | 1225 | function geodir_cf_file($html,$location,$cf,$p=''){ |
| 1234 | 1226 | |
| 1235 | 1227 | // check we have the post value |
| 1236 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 1237 | - else{ global $post;} |
|
| 1228 | + if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;} |
|
| 1238 | 1229 | |
| 1239 | 1230 | if(!is_array($cf) && $cf!=''){ |
| 1240 | 1231 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
@@ -1327,7 +1318,7 @@ discard block |
||
| 1327 | 1318 | $file_paths .= '</a>'; |
| 1328 | 1319 | //$file_paths .= '<img src="'.$file.'" />'; |
| 1329 | 1320 | $file_paths .= '</div>'; |
| 1330 | - }elseif (in_array($uploaded_file_type, $audio_file_types)) {// if audio |
|
| 1321 | + } elseif (in_array($uploaded_file_type, $audio_file_types)) {// if audio |
|
| 1331 | 1322 | $ext_path = '_' . $html_var . '_'; |
| 1332 | 1323 | $filename = explode($ext_path, $filename); |
| 1333 | 1324 | $file_paths .= '<span class="gd-audio-name">'.$filename[count($filename) - 1].'</span>'; |
@@ -1380,8 +1371,7 @@ discard block |
||
| 1380 | 1371 | function geodir_cf_textarea($html,$location,$cf,$p=''){ |
| 1381 | 1372 | |
| 1382 | 1373 | // check we have the post value |
| 1383 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 1384 | - else{ global $post;} |
|
| 1374 | + if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;} |
|
| 1385 | 1375 | |
| 1386 | 1376 | if(!is_array($cf) && $cf!=''){ |
| 1387 | 1377 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
@@ -1471,8 +1461,7 @@ discard block |
||
| 1471 | 1461 | function geodir_cf_html($html,$location,$cf,$p=''){ |
| 1472 | 1462 | |
| 1473 | 1463 | // check we have the post value |
| 1474 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 1475 | - else{ global $post;} |
|
| 1464 | + if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;} |
|
| 1476 | 1465 | |
| 1477 | 1466 | if(!is_array($cf) && $cf!=''){ |
| 1478 | 1467 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
@@ -1561,8 +1550,7 @@ discard block |
||
| 1561 | 1550 | function geodir_cf_taxonomy($html,$location,$cf,$p=''){ |
| 1562 | 1551 | |
| 1563 | 1552 | // check we have the post value |
| 1564 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 1565 | - else{ global $post;} |
|
| 1553 | + if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;} |
|
| 1566 | 1554 | |
| 1567 | 1555 | if(!is_array($cf) && $cf!=''){ |
| 1568 | 1556 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
@@ -1685,8 +1673,7 @@ discard block |
||
| 1685 | 1673 | function geodir_cf_address($html,$location,$cf,$p=''){ |
| 1686 | 1674 | |
| 1687 | 1675 | // check we have the post value |
| 1688 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 1689 | - else{ global $post;} |
|
| 1676 | + if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;} |
|
| 1690 | 1677 | |
| 1691 | 1678 | if(!is_array($cf) && $cf!=''){ |
| 1692 | 1679 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |