@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | function geodir_kelo_title_translation( $args) { |
| 13 | 13 | if(function_exists('geodir_is_geodir_page') && geodir_is_page('preview') ){ |
| 14 | 14 | $args['title'] = __(stripslashes_deep(esc_html($_POST['post_title'])),'geodirectory'); |
| 15 | - }elseif(function_exists('geodir_is_geodir_page')){ |
|
| 15 | + } elseif(function_exists('geodir_is_geodir_page')){ |
|
| 16 | 16 | $args['title'] = __($args['title'],'geodirectory'); |
| 17 | 17 | } |
| 18 | 18 | |
@@ -56,38 +56,30 @@ discard block |
||
| 56 | 56 | $output = ''; |
| 57 | 57 | if (is_tag()) { |
| 58 | 58 | $output = __('Tag Archive for:','kleo_framework')." ".single_tag_title('',false); |
| 59 | - } |
|
| 60 | - elseif(is_tax()) { |
|
| 59 | + } elseif(is_tax()) { |
|
| 61 | 60 | $term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy')); |
| 62 | 61 | $output = $term->name; |
| 63 | - } |
|
| 64 | - elseif ( is_category() ) { |
|
| 62 | + } elseif ( is_category() ) { |
|
| 65 | 63 | $output = __('Archive for category:', 'kleo_framework') . " " . single_cat_title('', false); |
| 66 | - } |
|
| 67 | - elseif (is_day()) |
|
| 64 | + } elseif (is_day()) |
|
| 68 | 65 | { |
| 69 | 66 | $output = __('Archive for date:','kleo_framework')." ".get_the_time('F jS, Y'); |
| 70 | - } |
|
| 71 | - elseif (is_month()) |
|
| 67 | + } elseif (is_month()) |
|
| 72 | 68 | { |
| 73 | 69 | $output = __('Archive for month:','kleo_framework')." ".get_the_time('F, Y'); |
| 74 | - } |
|
| 75 | - elseif (is_year()) |
|
| 70 | + } elseif (is_year()) |
|
| 76 | 71 | { |
| 77 | 72 | $output = __('Archive for year:','kleo_framework')." ".get_the_time('Y'); |
| 78 | - } |
|
| 79 | - elseif (is_author()) { |
|
| 73 | + } elseif (is_author()) { |
|
| 80 | 74 | $curauth = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author')); |
| 81 | 75 | $output = __('Author Archive','kleo_framework')." "; |
| 82 | 76 | |
| 83 | 77 | if( isset( $curauth->nickname ) ) { |
| 84 | 78 | $output .= __('for:','kleo_framework')." ".$curauth->nickname; |
| 85 | 79 | } |
| 86 | - } |
|
| 87 | - elseif ( is_archive() ) { |
|
| 80 | + } elseif ( is_archive() ) { |
|
| 88 | 81 | $output = post_type_archive_title( '', false ); |
| 89 | - } |
|
| 90 | - elseif (is_search()) |
|
| 82 | + } elseif (is_search()) |
|
| 91 | 83 | { |
| 92 | 84 | global $wp_query; |
| 93 | 85 | if(!empty($wp_query->found_posts)) |
@@ -95,26 +87,22 @@ discard block |
||
| 95 | 87 | if($wp_query->found_posts > 1) |
| 96 | 88 | { |
| 97 | 89 | $output = $wp_query->found_posts ." ". __('search results for:','kleo_framework')." ".esc_attr( get_search_query() ); |
| 98 | - } |
|
| 99 | - else |
|
| 90 | + } else |
|
| 100 | 91 | { |
| 101 | 92 | $output = $wp_query->found_posts ." ". __('search result for:','kleo_framework')." ".esc_attr( get_search_query() ); |
| 102 | 93 | } |
| 103 | - } |
|
| 104 | - else |
|
| 94 | + } else |
|
| 105 | 95 | { |
| 106 | 96 | if(!empty($_GET['s'])) |
| 107 | 97 | { |
| 108 | 98 | $output = __('Search results for:','kleo_framework')." ".esc_attr( get_search_query() ); |
| 109 | - } |
|
| 110 | - else |
|
| 99 | + } else |
|
| 111 | 100 | { |
| 112 | 101 | $output = __('To search the site please enter a valid term','kleo_framework'); |
| 113 | 102 | } |
| 114 | 103 | } |
| 115 | 104 | |
| 116 | - } |
|
| 117 | - elseif ( is_front_page() && !is_home() ) { |
|
| 105 | + } elseif ( is_front_page() && !is_home() ) { |
|
| 118 | 106 | $output = get_the_title(get_option('page_on_front')); |
| 119 | 107 | |
| 120 | 108 | } elseif ( is_home() ) { |
@@ -126,8 +114,7 @@ discard block |
||
| 126 | 114 | |
| 127 | 115 | } elseif ( is_404() ) { |
| 128 | 116 | $output = __('Error 404 - Page not found','kleo_framework'); |
| 129 | - } |
|
| 130 | - else { |
|
| 117 | + } else { |
|
| 131 | 118 | $output = get_the_title(); |
| 132 | 119 | } |
| 133 | 120 | |
@@ -141,8 +128,7 @@ discard block |
||
| 141 | 128 | if(geodir_is_page('pt')){ |
| 142 | 129 | $gd_page = 'pt'; |
| 143 | 130 | $output = (get_option('geodir_page_title_pt')) ? get_option('geodir_page_title_pt') : ''; |
| 144 | - } |
|
| 145 | - elseif(geodir_is_page('listing')){ |
|
| 131 | + } elseif(geodir_is_page('listing')){ |
|
| 146 | 132 | $gd_page = 'listing'; |
| 147 | 133 | $output = (get_option('geodir_page_title_cat-listing')) ? get_option('geodir_page_title_cat-listing') : ''; |
| 148 | 134 | } |
@@ -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); |
@@ -1200,7 +1192,7 @@ discard block |
||
| 1200 | 1192 | */ |
| 1201 | 1193 | $email_name = apply_filters('geodir_email_field_name_output',$email,$cf); |
| 1202 | 1194 | $html .= "<script>document.write('<a href=\"mailto:'+'$e_split[0]' + '@' + '$e_split[1]'+'\">$email_name</a>')</script>"; |
| 1203 | - }else{ |
|
| 1195 | + } else{ |
|
| 1204 | 1196 | $html .= $email; |
| 1205 | 1197 | } |
| 1206 | 1198 | $html .= '</span></div>'; |
@@ -1228,8 +1220,7 @@ discard block |
||
| 1228 | 1220 | function geodir_cf_file($html,$location,$cf,$p=''){ |
| 1229 | 1221 | |
| 1230 | 1222 | // check we have the post value |
| 1231 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 1232 | - else{ global $post;} |
|
| 1223 | + if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;} |
|
| 1233 | 1224 | |
| 1234 | 1225 | if(!is_array($cf) && $cf!=''){ |
| 1235 | 1226 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
@@ -1322,7 +1313,7 @@ discard block |
||
| 1322 | 1313 | $file_paths .= '</a>'; |
| 1323 | 1314 | //$file_paths .= '<img src="'.$file.'" />'; |
| 1324 | 1315 | $file_paths .= '</div>'; |
| 1325 | - }elseif (in_array($uploaded_file_type, $audio_file_types)) {// if audio |
|
| 1316 | + } elseif (in_array($uploaded_file_type, $audio_file_types)) {// if audio |
|
| 1326 | 1317 | $ext_path = '_' . $html_var . '_'; |
| 1327 | 1318 | $filename = explode($ext_path, $filename); |
| 1328 | 1319 | $file_paths .= '<span class="gd-audio-name">'.$filename[count($filename) - 1].'</span>'; |
@@ -1375,8 +1366,7 @@ discard block |
||
| 1375 | 1366 | function geodir_cf_textarea($html,$location,$cf,$p=''){ |
| 1376 | 1367 | |
| 1377 | 1368 | // check we have the post value |
| 1378 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 1379 | - else{ global $post;} |
|
| 1369 | + if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;} |
|
| 1380 | 1370 | |
| 1381 | 1371 | if(!is_array($cf) && $cf!=''){ |
| 1382 | 1372 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
@@ -1466,8 +1456,7 @@ discard block |
||
| 1466 | 1456 | function geodir_cf_html($html,$location,$cf,$p=''){ |
| 1467 | 1457 | |
| 1468 | 1458 | // check we have the post value |
| 1469 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 1470 | - else{ global $post;} |
|
| 1459 | + if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;} |
|
| 1471 | 1460 | |
| 1472 | 1461 | if(!is_array($cf) && $cf!=''){ |
| 1473 | 1462 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
@@ -1556,8 +1545,7 @@ discard block |
||
| 1556 | 1545 | function geodir_cf_taxonomy($html,$location,$cf,$p=''){ |
| 1557 | 1546 | |
| 1558 | 1547 | // check we have the post value |
| 1559 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 1560 | - else{ global $post;} |
|
| 1548 | + if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;} |
|
| 1561 | 1549 | |
| 1562 | 1550 | if(!is_array($cf) && $cf!=''){ |
| 1563 | 1551 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
@@ -1679,8 +1667,7 @@ discard block |
||
| 1679 | 1667 | function geodir_cf_address($html,$location,$cf,$p=''){ |
| 1680 | 1668 | |
| 1681 | 1669 | // check we have the post value |
| 1682 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
| 1683 | - else{ global $post;} |
|
| 1670 | + if(is_int($p)){$post = geodir_get_post_info($p);} else{ global $post;} |
|
| 1684 | 1671 | |
| 1685 | 1672 | if(!is_array($cf) && $cf!=''){ |
| 1686 | 1673 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |