@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | /* ON TEMPLATE INCLUDE */ |
137 | 137 | ///////////////////////// |
138 | 138 | |
139 | -add_filter('template_include', 'geodir_template_loader',9); |
|
139 | +add_filter('template_include', 'geodir_template_loader', 9); |
|
140 | 140 | |
141 | 141 | ///////////////////////// |
142 | 142 | /* CATEGORY / TAXONOMY / CUSTOM POST ACTIONS */ |
@@ -176,9 +176,9 @@ discard block |
||
176 | 176 | /* WP REVIEW COUNT ACTIONS */ |
177 | 177 | //////////////////////// |
178 | 178 | |
179 | -add_action('geodir_update_postrating', 'geodir_term_review_count_force_update_single_post', 100,1); |
|
179 | +add_action('geodir_update_postrating', 'geodir_term_review_count_force_update_single_post', 100, 1); |
|
180 | 180 | //add_action('geodir_update_postrating', 'geodir_term_review_count_force_update', 100); |
181 | -add_action('transition_post_status', 'geodir_term_review_count_force_update', 100,3); |
|
181 | +add_action('transition_post_status', 'geodir_term_review_count_force_update', 100, 3); |
|
182 | 182 | //add_action('created_term', 'geodir_term_review_count_force_update', 100); |
183 | 183 | add_action('edited_term', 'geodir_term_review_count_force_update', 100); |
184 | 184 | add_action('delete_term', 'geodir_term_review_count_force_update', 100); |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | */ |
223 | 223 | function geodir_unset_prev_theme_nav_location($newname) |
224 | 224 | { |
225 | - $geodir_theme_location = get_option('geodir_theme_location_nav_' . $newname); |
|
225 | + $geodir_theme_location = get_option('geodir_theme_location_nav_'.$newname); |
|
226 | 226 | if ($geodir_theme_location) { |
227 | 227 | update_option('geodir_theme_location_nav', $geodir_theme_location); |
228 | 228 | } else { |
@@ -320,8 +320,8 @@ discard block |
||
320 | 320 | |
321 | 321 | /////// GEO DIRECOTORY CUSTOM HOOKS /// |
322 | 322 | |
323 | -add_action('geodir_before_tab_content', 'geodir_before_tab_content');// this function is in custom_functions.php and it is used to wrap detail page tab content |
|
324 | -add_action('geodir_after_tab_content', 'geodir_after_tab_content');// this function is in custom_functions.php and it is used to wrap detail page tab content |
|
323 | +add_action('geodir_before_tab_content', 'geodir_before_tab_content'); // this function is in custom_functions.php and it is used to wrap detail page tab content |
|
324 | +add_action('geodir_after_tab_content', 'geodir_after_tab_content'); // this function is in custom_functions.php and it is used to wrap detail page tab content |
|
325 | 325 | |
326 | 326 | // Detail page sidebar content |
327 | 327 | add_action('geodir_detail_page_sidebar', 'geodir_detail_page_sidebar_content_sorting', 1); |
@@ -422,8 +422,8 @@ discard block |
||
422 | 422 | do_action('geodir_after_social_sharing_buttons'); |
423 | 423 | $content_html = ob_get_clean(); |
424 | 424 | if (trim($content_html) != '') |
425 | - $content_html = '<div class="geodir-company_info geodir-details-sidebar-social-sharing">' . $content_html . '</div>'; |
|
426 | - if ((int)get_option('geodir_disable_tfg_buttons_section') != 1) { |
|
425 | + $content_html = '<div class="geodir-company_info geodir-details-sidebar-social-sharing">'.$content_html.'</div>'; |
|
426 | + if ((int) get_option('geodir_disable_tfg_buttons_section') != 1) { |
|
427 | 427 | /** |
428 | 428 | * Filter the geodir_social_sharing_buttons() function content. |
429 | 429 | * |
@@ -469,8 +469,8 @@ discard block |
||
469 | 469 | do_action('geodir_after_share_this_button'); |
470 | 470 | $content_html = ob_get_clean(); |
471 | 471 | if (trim($content_html) != '') |
472 | - $content_html = '<div class="geodir-company_info geodir-details-sidebar-sharethis">' . $content_html . '</div>'; |
|
473 | - if ((int)get_option('geodir_disable_sharethis_button_section') != 1) { |
|
472 | + $content_html = '<div class="geodir-company_info geodir-details-sidebar-sharethis">'.$content_html.'</div>'; |
|
473 | + if ((int) get_option('geodir_disable_sharethis_button_section') != 1) { |
|
474 | 474 | /** |
475 | 475 | * Filter the geodir_share_this_button() function content. |
476 | 476 | * |
@@ -509,12 +509,12 @@ discard block |
||
509 | 509 | $post_id = $post->ID; |
510 | 510 | |
511 | 511 | if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') { |
512 | - $post_id = (int)$_REQUEST['pid']; |
|
512 | + $post_id = (int) $_REQUEST['pid']; |
|
513 | 513 | } |
514 | 514 | |
515 | 515 | $postlink = get_permalink(geodir_add_listing_page_id()); |
516 | 516 | $editlink = geodir_getlink($postlink, array('pid' => $post_id), false); |
517 | - echo ' <p class="edit_link"><i class="fa fa-pencil"></i> <a href="' . esc_url($editlink) . '">' . __('Edit this Post', 'geodirectory') . '</a></p>'; |
|
517 | + echo ' <p class="edit_link"><i class="fa fa-pencil"></i> <a href="'.esc_url($editlink).'">'.__('Edit this Post', 'geodirectory').'</a></p>'; |
|
518 | 518 | } |
519 | 519 | }// end of if, if its a preview or not |
520 | 520 | /** |
@@ -525,8 +525,8 @@ discard block |
||
525 | 525 | do_action('geodir_after_edit_post_link'); |
526 | 526 | $content_html = ob_get_clean(); |
527 | 527 | if (trim($content_html) != '') |
528 | - $content_html = '<div class="geodir-company_info geodir-details-sidebar-user-links">' . $content_html . '</div>'; |
|
529 | - if ((int)get_option('geodir_disable_user_links_section') != 1) { |
|
528 | + $content_html = '<div class="geodir-company_info geodir-details-sidebar-user-links">'.$content_html.'</div>'; |
|
529 | + if ((int) get_option('geodir_disable_user_links_section') != 1) { |
|
530 | 530 | /** |
531 | 531 | * Filter the geodir_edit_post_link() function content. |
532 | 532 | * |
@@ -579,14 +579,14 @@ discard block |
||
579 | 579 | $hide_refresh = get_option('geodir_ga_auto_refresh'); |
580 | 580 | |
581 | 581 | $auto_refresh = $hide_refresh && $refresh_time && $refresh_time > 0 ? 1 : 0; |
582 | - if (get_option('geodir_ga_stats') && is_user_logged_in() && (isset($package_info->google_analytics) && $package_info->google_analytics == '1') && (get_current_user_id()==$post->post_author || current_user_can( 'manage_options' )) ) { |
|
582 | + if (get_option('geodir_ga_stats') && is_user_logged_in() && (isset($package_info->google_analytics) && $package_info->google_analytics == '1') && (get_current_user_id() == $post->post_author || current_user_can('manage_options'))) { |
|
583 | 583 | $page_url = urlencode($_SERVER['REQUEST_URI']); |
584 | 584 | ?> |
585 | 585 | <script type="text/javascript"> |
586 | 586 | var gd_gaTimeOut; |
587 | - var gd_gaTime = parseInt('<?php echo $refresh_time;?>'); |
|
588 | - var gd_gaHideRefresh = <?php echo (int)$hide_refresh;?>; |
|
589 | - var gd_gaAutoRefresh = <?php echo $auto_refresh;?>; |
|
587 | + var gd_gaTime = parseInt('<?php echo $refresh_time; ?>'); |
|
588 | + var gd_gaHideRefresh = <?php echo (int) $hide_refresh; ?>; |
|
589 | + var gd_gaAutoRefresh = <?php echo $auto_refresh; ?>; |
|
590 | 590 | ga_data1 = false; |
591 | 591 | ga_data2 = false; |
592 | 592 | ga_data3 = false; |
@@ -727,7 +727,7 @@ discard block |
||
727 | 727 | } |
728 | 728 | |
729 | 729 | function gdga_noResults() { |
730 | - jQuery('#gdga-chart-container').html('<?php _e('No results available','geodirectory');?>'); |
|
730 | + jQuery('#gdga-chart-container').html('<?php _e('No results available', 'geodirectory'); ?>'); |
|
731 | 731 | jQuery('#gdga-legend-container').html(''); |
732 | 732 | } |
733 | 733 | |
@@ -759,18 +759,18 @@ discard block |
||
759 | 759 | var data2 = results[1].rows.map(function(row) { return +row[2]; }); |
760 | 760 | //var labelsN = results[0].rows.map(function(row) { return +row[1]; }); |
761 | 761 | |
762 | - var labels = ['<?php _e('Jan', 'geodirectory');?>', |
|
763 | - '<?php _e('Feb', 'geodirectory');?>', |
|
764 | - '<?php _e('Mar', 'geodirectory');?>', |
|
765 | - '<?php _e('Apr', 'geodirectory');?>', |
|
766 | - '<?php _e('May', 'geodirectory');?>', |
|
767 | - '<?php _e('Jun', 'geodirectory');?>', |
|
768 | - '<?php _e('Jul', 'geodirectory');?>', |
|
769 | - '<?php _e('Aug', 'geodirectory');?>', |
|
770 | - '<?php _e('Sep', 'geodirectory');?>', |
|
771 | - '<?php _e('Oct', 'geodirectory');?>', |
|
772 | - '<?php _e('Nov', 'geodirectory');?>', |
|
773 | - '<?php _e('Dec', 'geodirectory');?>']; |
|
762 | + var labels = ['<?php _e('Jan', 'geodirectory'); ?>', |
|
763 | + '<?php _e('Feb', 'geodirectory'); ?>', |
|
764 | + '<?php _e('Mar', 'geodirectory'); ?>', |
|
765 | + '<?php _e('Apr', 'geodirectory'); ?>', |
|
766 | + '<?php _e('May', 'geodirectory'); ?>', |
|
767 | + '<?php _e('Jun', 'geodirectory'); ?>', |
|
768 | + '<?php _e('Jul', 'geodirectory'); ?>', |
|
769 | + '<?php _e('Aug', 'geodirectory'); ?>', |
|
770 | + '<?php _e('Sep', 'geodirectory'); ?>', |
|
771 | + '<?php _e('Oct', 'geodirectory'); ?>', |
|
772 | + '<?php _e('Nov', 'geodirectory'); ?>', |
|
773 | + '<?php _e('Dec', 'geodirectory'); ?>']; |
|
774 | 774 | |
775 | 775 | // Ensure the data arrays are at least as long as the labels array. |
776 | 776 | // Chart.js bar charts don't (yet) accept sparse datasets. |
@@ -783,13 +783,13 @@ discard block |
||
783 | 783 | labels : labels, |
784 | 784 | datasets : [ |
785 | 785 | { |
786 | - label: '<?php _e('Last Year', 'geodirectory');?>', |
|
786 | + label: '<?php _e('Last Year', 'geodirectory'); ?>', |
|
787 | 787 | fillColor : "rgba(220,220,220,0.5)", |
788 | 788 | strokeColor : "rgba(220,220,220,1)", |
789 | 789 | data : data2 |
790 | 790 | }, |
791 | 791 | { |
792 | - label: '<?php _e('This Year', 'geodirectory');?>', |
|
792 | + label: '<?php _e('This Year', 'geodirectory'); ?>', |
|
793 | 793 | fillColor : "rgba(151,187,205,0.5)", |
794 | 794 | strokeColor : "rgba(151,187,205,1)", |
795 | 795 | data : data1 |
@@ -834,30 +834,30 @@ discard block |
||
834 | 834 | |
835 | 835 | <?php |
836 | 836 | // Here we list the shorthand days of the week so it can be used in translation. |
837 | - __("Mon",'geodirectory'); |
|
838 | - __("Tue",'geodirectory'); |
|
839 | - __("Wed",'geodirectory'); |
|
840 | - __("Thu",'geodirectory'); |
|
841 | - __("Fri",'geodirectory'); |
|
842 | - __("Sat",'geodirectory'); |
|
843 | - __("Sun",'geodirectory'); |
|
837 | + __("Mon", 'geodirectory'); |
|
838 | + __("Tue", 'geodirectory'); |
|
839 | + __("Wed", 'geodirectory'); |
|
840 | + __("Thu", 'geodirectory'); |
|
841 | + __("Fri", 'geodirectory'); |
|
842 | + __("Sat", 'geodirectory'); |
|
843 | + __("Sun", 'geodirectory'); |
|
844 | 844 | ?> |
845 | 845 | |
846 | 846 | labels = [ |
847 | - "<?php _e(date('D', strtotime("+1 day")),'geodirectory'); ?>", |
|
848 | - "<?php _e(date('D', strtotime("+2 day")),'geodirectory'); ?>", |
|
849 | - "<?php _e(date('D', strtotime("+3 day")),'geodirectory'); ?>", |
|
850 | - "<?php _e(date('D', strtotime("+4 day")),'geodirectory'); ?>", |
|
851 | - "<?php _e(date('D', strtotime("+5 day")),'geodirectory'); ?>", |
|
852 | - "<?php _e(date('D', strtotime("+6 day")),'geodirectory'); ?>", |
|
853 | - "<?php _e(date('D', strtotime("+7 day")),'geodirectory'); ?>" |
|
847 | + "<?php _e(date('D', strtotime("+1 day")), 'geodirectory'); ?>", |
|
848 | + "<?php _e(date('D', strtotime("+2 day")), 'geodirectory'); ?>", |
|
849 | + "<?php _e(date('D', strtotime("+3 day")), 'geodirectory'); ?>", |
|
850 | + "<?php _e(date('D', strtotime("+4 day")), 'geodirectory'); ?>", |
|
851 | + "<?php _e(date('D', strtotime("+5 day")), 'geodirectory'); ?>", |
|
852 | + "<?php _e(date('D', strtotime("+6 day")), 'geodirectory'); ?>", |
|
853 | + "<?php _e(date('D', strtotime("+7 day")), 'geodirectory'); ?>" |
|
854 | 854 | ]; |
855 | 855 | |
856 | 856 | var data = { |
857 | 857 | labels : labels, |
858 | 858 | datasets : [ |
859 | 859 | { |
860 | - label: '<?php _e('Last Week', 'geodirectory');?>', |
|
860 | + label: '<?php _e('Last Week', 'geodirectory'); ?>', |
|
861 | 861 | fillColor : "rgba(220,220,220,0.5)", |
862 | 862 | strokeColor : "rgba(220,220,220,1)", |
863 | 863 | pointColor : "rgba(220,220,220,1)", |
@@ -865,7 +865,7 @@ discard block |
||
865 | 865 | data : data2 |
866 | 866 | }, |
867 | 867 | { |
868 | - label: '<?php _e('This Week', 'geodirectory');?>', |
|
868 | + label: '<?php _e('This Week', 'geodirectory'); ?>', |
|
869 | 869 | fillColor : "rgba(151,187,205,0.5)", |
870 | 870 | strokeColor : "rgba(151,187,205,1)", |
871 | 871 | pointColor : "rgba(151,187,205,1)", |
@@ -1072,18 +1072,18 @@ discard block |
||
1072 | 1072 | </style> |
1073 | 1073 | <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.2/Chart.min.js"></script> |
1074 | 1074 | <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.2/moment.min.js"></script> |
1075 | - <button type="button" class="gdga-show-analytics"><?php _e('Show Google Analytics', 'geodirectory');?></button> |
|
1075 | + <button type="button" class="gdga-show-analytics"><?php _e('Show Google Analytics', 'geodirectory'); ?></button> |
|
1076 | 1076 | <span id="ga_stats" class="gdga-analytics-box" style="display:none"> |
1077 | - <div id="ga-analytics-title"><?php _e("Analytics", 'geodirectory');?></div> |
|
1077 | + <div id="ga-analytics-title"><?php _e("Analytics", 'geodirectory'); ?></div> |
|
1078 | 1078 | <div id="gd-active-users-container"> |
1079 | - <div class="gd-ActiveUsers"><i id="gdga-loader-icon" class="fa fa-refresh fa-spin" title="<?php esc_attr_e("Refresh", 'geodirectory');?>"></i><?php _e("Active Users:", 'geodirectory');?> |
|
1079 | + <div class="gd-ActiveUsers"><i id="gdga-loader-icon" class="fa fa-refresh fa-spin" title="<?php esc_attr_e("Refresh", 'geodirectory'); ?>"></i><?php _e("Active Users:", 'geodirectory'); ?> |
|
1080 | 1080 | <b class="gd-ActiveUsers-value">0</b> |
1081 | 1081 | </div> |
1082 | 1082 | </div> |
1083 | 1083 | <select id="gdga-select-analytic" onchange="gdga_select_option();" style="display: none;"> |
1084 | - <option value="weeks"><?php _e("Last Week vs This Week", 'geodirectory');?></option> |
|
1085 | - <option value="years"><?php _e("This Year vs Last Year", 'geodirectory');?></option> |
|
1086 | - <option value="country"><?php _e("Top Countries", 'geodirectory');?></option> |
|
1084 | + <option value="weeks"><?php _e("Last Week vs This Week", 'geodirectory'); ?></option> |
|
1085 | + <option value="years"><?php _e("This Year vs Last Year", 'geodirectory'); ?></option> |
|
1086 | + <option value="country"><?php _e("Top Countries", 'geodirectory'); ?></option> |
|
1087 | 1087 | </select> |
1088 | 1088 | <div class="Chartjs-figure" id="gdga-chart-container"></div> |
1089 | 1089 | <ol class="Chartjs-legend" id="gdga-legend-container"></ol> |
@@ -1099,8 +1099,8 @@ discard block |
||
1099 | 1099 | do_action('geodir_after_google_analytics'); |
1100 | 1100 | $content_html = ob_get_clean(); |
1101 | 1101 | if (trim($content_html) != '') |
1102 | - $content_html = '<div class="geodir-company_info geodir-details-sidebar-google-analytics">' . $content_html . '</div>'; |
|
1103 | - if ((int)get_option('geodir_disable_google_analytics_section') != 1) { |
|
1102 | + $content_html = '<div class="geodir-company_info geodir-details-sidebar-google-analytics">'.$content_html.'</div>'; |
|
1103 | + if ((int) get_option('geodir_disable_google_analytics_section') != 1) { |
|
1104 | 1104 | /** |
1105 | 1105 | * Filter the geodir_edit_post_link() function content. |
1106 | 1106 | * |
@@ -1156,10 +1156,10 @@ discard block |
||
1156 | 1156 | |
1157 | 1157 | $reviews_text = $comment_count > 1 ? __("reviews", 'geodirectory') : __("review", 'geodirectory'); |
1158 | 1158 | |
1159 | - $html .= '<span itemprop="rating" itemscope itemtype="http://data-vocabulary.org/Rating"><span class="rating" itemprop="average" content="' . $post_avgratings . '">' . $post_avgratings . '</span> / <span itemprop="best" content="5">5</span> ' . __("based on", 'geodirectory') . ' </span><span class="count" itemprop="count" content="' . $comment_count . '">' . $comment_count . ' ' . $reviews_text . '</span><br />'; |
|
1159 | + $html .= '<span itemprop="rating" itemscope itemtype="http://data-vocabulary.org/Rating"><span class="rating" itemprop="average" content="'.$post_avgratings.'">'.$post_avgratings.'</span> / <span itemprop="best" content="5">5</span> '.__("based on", 'geodirectory').' </span><span class="count" itemprop="count" content="'.$comment_count.'">'.$comment_count.' '.$reviews_text.'</span><br />'; |
|
1160 | 1160 | |
1161 | 1161 | $html .= '<span class="item">'; |
1162 | - $html .= '<span class="fn" itemprop="itemreviewed">' . $post->post_title . '</span>'; |
|
1162 | + $html .= '<span class="fn" itemprop="itemreviewed">'.$post->post_title.'</span>'; |
|
1163 | 1163 | |
1164 | 1164 | if ($post_images) { |
1165 | 1165 | foreach ($post_images as $img) { |
@@ -1169,7 +1169,7 @@ discard block |
||
1169 | 1169 | } |
1170 | 1170 | |
1171 | 1171 | if (isset($post_img) && $post_img) { |
1172 | - $html .= '<br /><img src="' . $post_img . '" class="photo" alt="' . esc_attr($post->post_title) . '" itemprop="photo" content="' . $post_img . '" class="photo" />'; |
|
1172 | + $html .= '<br /><img src="'.$post_img.'" class="photo" alt="'.esc_attr($post->post_title).'" itemprop="photo" content="'.$post_img.'" class="photo" />'; |
|
1173 | 1173 | } |
1174 | 1174 | |
1175 | 1175 | $html .= '</span>'; |
@@ -1196,9 +1196,9 @@ discard block |
||
1196 | 1196 | do_action('geodir_after_detail_page_review_rating'); |
1197 | 1197 | $content_html = ob_get_clean(); |
1198 | 1198 | if (trim($content_html) != '') { |
1199 | - $content_html = '<div class="geodir-company_info geodir-details-sidebar-rating">' . $content_html . '</div>'; |
|
1199 | + $content_html = '<div class="geodir-company_info geodir-details-sidebar-rating">'.$content_html.'</div>'; |
|
1200 | 1200 | } |
1201 | - if ((int)get_option('geodir_disable_rating_info_section') != 1) { |
|
1201 | + if ((int) get_option('geodir_disable_rating_info_section') != 1) { |
|
1202 | 1202 | /** |
1203 | 1203 | * Filter the geodir_detail_page_review_rating() function content. |
1204 | 1204 | * |
@@ -1237,8 +1237,8 @@ discard block |
||
1237 | 1237 | |
1238 | 1238 | $content_html = ob_get_clean(); |
1239 | 1239 | if (trim($content_html) != '') |
1240 | - $content_html = '<div class="geodir-company_info geodir-details-sidebar-listing-info">' . $content_html . '</div>'; |
|
1241 | - if ((int)get_option('geodir_disable_listing_info_section') != 1) { |
|
1240 | + $content_html = '<div class="geodir-company_info geodir-details-sidebar-listing-info">'.$content_html.'</div>'; |
|
1241 | + if ((int) get_option('geodir_disable_listing_info_section') != 1) { |
|
1242 | 1242 | /** |
1243 | 1243 | * Filter the output html for function geodir_detail_page_more_info(). |
1244 | 1244 | * |
@@ -1337,7 +1337,7 @@ discard block |
||
1337 | 1337 | 'gd_allowed_img_types' => !empty($allowed_img_types) ? implode(',', $allowed_img_types) : '', |
1338 | 1338 | 'geodir_txt_form_wait' => __('Wait...', 'geodirectory'), |
1339 | 1339 | 'geodir_txt_form_searching' => __('Searching...', 'geodirectory'), |
1340 | - 'fa_rating' => (int)get_option('geodir_reviewrating_enable_font_awesome') == 1 ? 1 : '', |
|
1340 | + 'fa_rating' => (int) get_option('geodir_reviewrating_enable_font_awesome') == 1 ? 1 : '', |
|
1341 | 1341 | 'reviewrating' => defined('GEODIRREVIEWRATING_VERSION') ? 1 : '', |
1342 | 1342 | 'geodir_map_name' => geodir_map_name(), |
1343 | 1343 | ); |
@@ -1355,10 +1355,10 @@ discard block |
||
1355 | 1355 | foreach ($arr_alert_msg as $key => $value) { |
1356 | 1356 | if (!is_scalar($value)) |
1357 | 1357 | continue; |
1358 | - $arr_alert_msg[$key] = html_entity_decode((string)$value, ENT_QUOTES, 'UTF-8'); |
|
1358 | + $arr_alert_msg[$key] = html_entity_decode((string) $value, ENT_QUOTES, 'UTF-8'); |
|
1359 | 1359 | } |
1360 | 1360 | |
1361 | - $script = "var geodir_all_js_msg = " . json_encode($arr_alert_msg) . ';'; |
|
1361 | + $script = "var geodir_all_js_msg = ".json_encode($arr_alert_msg).';'; |
|
1362 | 1362 | echo '<script>'; |
1363 | 1363 | echo $script; |
1364 | 1364 | echo '</script>'; |
@@ -1448,7 +1448,7 @@ discard block |
||
1448 | 1448 | $geodir_old_sidebars = get_option('geodir_sidebars'); |
1449 | 1449 | if (is_array($geodir_old_sidebars)) { |
1450 | 1450 | foreach ($geodir_old_sidebars as $key => $val) { |
1451 | - if(0 === strpos($key, 'geodir_'))// if gd widget |
|
1451 | + if (0 === strpos($key, 'geodir_'))// if gd widget |
|
1452 | 1452 | { |
1453 | 1453 | $sidebars_widgets[$key] = $geodir_old_sidebars[$key]; |
1454 | 1454 | } |
@@ -1527,7 +1527,7 @@ discard block |
||
1527 | 1527 | global $post; |
1528 | 1528 | $term_condition = ''; |
1529 | 1529 | if (isset($_REQUEST['backandedit'])) { |
1530 | - $post = (object)$gd_session->get('listing'); |
|
1530 | + $post = (object) $gd_session->get('listing'); |
|
1531 | 1531 | $term_condition = isset($post->geodir_accept_term_condition) ? $post->geodir_accept_term_condition : ''; |
1532 | 1532 | } |
1533 | 1533 | |
@@ -1541,7 +1541,7 @@ discard block |
||
1541 | 1541 | echo 'checked="checked"'; |
1542 | 1542 | } ?> field_type="checkbox" name="geodir_accept_term_condition" id="geodir_accept_term_condition" |
1543 | 1543 | class="geodir_textfield" value="1" |
1544 | - style="display:inline-block"/><a href="<?php $terms_page = get_option('geodir_term_condition_page'); if($terms_page){ echo get_permalink($terms_page);}?>" target="_blank"><?php _e('Please accept our terms and conditions', 'geodirectory'); ?></a> |
|
1544 | + style="display:inline-block"/><a href="<?php $terms_page = get_option('geodir_term_condition_page'); if ($terms_page) { echo get_permalink($terms_page); }?>" target="_blank"><?php _e('Please accept our terms and conditions', 'geodirectory'); ?></a> |
|
1545 | 1545 | </span> |
1546 | 1546 | </div> |
1547 | 1547 | <span class="geodir_message_error"><?php if (isset($required_msg)) { |
@@ -1581,7 +1581,7 @@ discard block |
||
1581 | 1581 | /** This action is documented in geodirectory_template_actions.php */ |
1582 | 1582 | $desc_limit = apply_filters('geodir_description_field_desc_limit', ''); |
1583 | 1583 | |
1584 | - if (!($desc_limit === '' || (int)$desc_limit > 0)) { |
|
1584 | + if (!($desc_limit === '' || (int) $desc_limit > 0)) { |
|
1585 | 1585 | $is_display = false; |
1586 | 1586 | } |
1587 | 1587 | } |
@@ -1629,16 +1629,16 @@ discard block |
||
1629 | 1629 | global $wpdb, $plugin_prefix; |
1630 | 1630 | |
1631 | 1631 | // Remove unused virtual page |
1632 | - $listings_page_id = (int)get_option('geodir_listing_page'); |
|
1632 | + $listings_page_id = (int) get_option('geodir_listing_page'); |
|
1633 | 1633 | if ($listings_page_id) { |
1634 | - $wpdb->query($wpdb->prepare("DELETE FROM " . $wpdb->posts . " WHERE ID=%d AND post_name = %s AND post_type=%s", array($listings_page_id, 'listings', 'page'))); |
|
1634 | + $wpdb->query($wpdb->prepare("DELETE FROM ".$wpdb->posts." WHERE ID=%d AND post_name = %s AND post_type=%s", array($listings_page_id, 'listings', 'page'))); |
|
1635 | 1635 | delete_option('geodir_listing_page'); |
1636 | 1636 | } |
1637 | 1637 | |
1638 | 1638 | if (!get_option('geodir_changes_in_custom_fields_table')) { |
1639 | 1639 | $wpdb->query( |
1640 | 1640 | $wpdb->prepare( |
1641 | - "UPDATE " . GEODIR_CUSTOM_FIELDS_TABLE . " SET is_default=%s, is_admin=%s WHERE is_default=%s", |
|
1641 | + "UPDATE ".GEODIR_CUSTOM_FIELDS_TABLE." SET is_default=%s, is_admin=%s WHERE is_default=%s", |
|
1642 | 1642 | array('1', '1', 'admin') |
1643 | 1643 | ) |
1644 | 1644 | ); |
@@ -1646,9 +1646,9 @@ discard block |
||
1646 | 1646 | |
1647 | 1647 | /* --- terms meta value set --- */ |
1648 | 1648 | |
1649 | - update_option('geodir_default_marker_icon', geodir_plugin_url() . '/geodirectory-functions/map-functions/icons/pin.png'); |
|
1649 | + update_option('geodir_default_marker_icon', geodir_plugin_url().'/geodirectory-functions/map-functions/icons/pin.png'); |
|
1650 | 1650 | |
1651 | - $options_data = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "options WHERE option_name LIKE %s", array('%tax_meta_%'))); |
|
1651 | + $options_data = $wpdb->get_results($wpdb->prepare("SELECT * FROM ".$wpdb->prefix."options WHERE option_name LIKE %s", array('%tax_meta_%'))); |
|
1652 | 1652 | |
1653 | 1653 | if (!empty($options_data)) { |
1654 | 1654 | |
@@ -1656,7 +1656,7 @@ discard block |
||
1656 | 1656 | |
1657 | 1657 | $option_val = str_replace('tax_meta_', '', $optobj->option_name); |
1658 | 1658 | |
1659 | - $taxonomies_data = $wpdb->get_results($wpdb->prepare("SELECT taxonomy FROM " . $wpdb->prefix . "term_taxonomy WHERE taxonomy LIKE %s AND term_id=%d", array('%category%', $option_val))); |
|
1659 | + $taxonomies_data = $wpdb->get_results($wpdb->prepare("SELECT taxonomy FROM ".$wpdb->prefix."term_taxonomy WHERE taxonomy LIKE %s AND term_id=%d", array('%category%', $option_val))); |
|
1660 | 1660 | |
1661 | 1661 | if (!empty($taxonomies_data)) { |
1662 | 1662 | |
@@ -1665,17 +1665,17 @@ discard block |
||
1665 | 1665 | $taxObject = get_taxonomy($taxobj->taxonomy); |
1666 | 1666 | $post_type = $taxObject->object_type[0]; |
1667 | 1667 | |
1668 | - $opt_value = 'tax_meta_' . $post_type . '_' . $option_val; |
|
1668 | + $opt_value = 'tax_meta_'.$post_type.'_'.$option_val; |
|
1669 | 1669 | |
1670 | - $duplicate_data = $wpdb->get_var($wpdb->prepare("SELECT option_id FROM " . $wpdb->prefix . "options WHERE option_name=%s", array('tax_meta_' . $option_val))); |
|
1670 | + $duplicate_data = $wpdb->get_var($wpdb->prepare("SELECT option_id FROM ".$wpdb->prefix."options WHERE option_name=%s", array('tax_meta_'.$option_val))); |
|
1671 | 1671 | |
1672 | 1672 | if ($duplicate_data) { |
1673 | 1673 | |
1674 | - $wpdb->query($wpdb->prepare("UPDATE " . $wpdb->prefix . "options SET option_name=%s WHERE option_id=%d", array($opt_value, $optobj->option_id))); |
|
1674 | + $wpdb->query($wpdb->prepare("UPDATE ".$wpdb->prefix."options SET option_name=%s WHERE option_id=%d", array($opt_value, $optobj->option_id))); |
|
1675 | 1675 | |
1676 | 1676 | } else { |
1677 | 1677 | |
1678 | - $wpdb->query($wpdb->prepare("INSERT INTO " . $wpdb->prefix . "options (option_name,option_value,autoload) VALUES (%s, %s, %s)", array($opt_value, $optobj->option_value, $optobj->autoload))); |
|
1678 | + $wpdb->query($wpdb->prepare("INSERT INTO ".$wpdb->prefix."options (option_name,option_value,autoload) VALUES (%s, %s, %s)", array($opt_value, $optobj->option_value, $optobj->autoload))); |
|
1679 | 1679 | |
1680 | 1680 | } |
1681 | 1681 | |
@@ -1709,14 +1709,14 @@ discard block |
||
1709 | 1709 | |
1710 | 1710 | global $wpdb, $table_prefix; |
1711 | 1711 | |
1712 | - $slug_exists = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($slug))); |
|
1712 | + $slug_exists = $wpdb->get_var($wpdb->prepare("SELECT slug FROM ".$table_prefix."terms WHERE slug=%s", array($slug))); |
|
1713 | 1713 | |
1714 | 1714 | if ($slug_exists) { |
1715 | 1715 | |
1716 | 1716 | $suffix = 1; |
1717 | 1717 | do { |
1718 | - $alt_location_name = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix"; |
|
1719 | - $location_slug_check = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($alt_location_name))); |
|
1718 | + $alt_location_name = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1))."-$suffix"; |
|
1719 | + $location_slug_check = $wpdb->get_var($wpdb->prepare("SELECT slug FROM ".$table_prefix."terms WHERE slug=%s", array($alt_location_name))); |
|
1720 | 1720 | $suffix++; |
1721 | 1721 | } while ($location_slug_check && $suffix < 100); |
1722 | 1722 | |
@@ -1770,7 +1770,7 @@ discard block |
||
1770 | 1770 | |
1771 | 1771 | $suffix = 1; |
1772 | 1772 | do { |
1773 | - $new_slug = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix"; |
|
1773 | + $new_slug = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1))."-$suffix"; |
|
1774 | 1774 | |
1775 | 1775 | /** This action is documented in geodirectory_hooks_actions.php */ |
1776 | 1776 | $term_slug_check = apply_filters('geodir_term_slug_is_exists', false, $new_slug, $term_id); |
@@ -1782,7 +1782,7 @@ discard block |
||
1782 | 1782 | |
1783 | 1783 | //wp_update_term( $term_id, $taxonomy, array('slug' => $slug) ); |
1784 | 1784 | |
1785 | - $wpdb->query($wpdb->prepare("UPDATE " . $table_prefix . "terms SET slug=%s WHERE term_id=%d", array($slug, $term_id))); |
|
1785 | + $wpdb->query($wpdb->prepare("UPDATE ".$table_prefix."terms SET slug=%s WHERE term_id=%d", array($slug, $term_id))); |
|
1786 | 1786 | |
1787 | 1787 | } |
1788 | 1788 | |
@@ -1791,18 +1791,18 @@ discard block |
||
1791 | 1791 | $post_type = !empty($taxonomy_obj) ? $taxonomy_obj->object_type[0] : NULL; |
1792 | 1792 | |
1793 | 1793 | $post_types = geodir_get_posttypes(); |
1794 | - if ($post_type && in_array($post_type, $post_types) && $post_type . '_tags' == $taxonomy) { |
|
1795 | - $posts_obj = $wpdb->get_results($wpdb->prepare("SELECT object_id FROM " . $wpdb->term_relationships . " WHERE term_taxonomy_id = %d", array($tt_id))); |
|
1794 | + if ($post_type && in_array($post_type, $post_types) && $post_type.'_tags' == $taxonomy) { |
|
1795 | + $posts_obj = $wpdb->get_results($wpdb->prepare("SELECT object_id FROM ".$wpdb->term_relationships." WHERE term_taxonomy_id = %d", array($tt_id))); |
|
1796 | 1796 | |
1797 | 1797 | if (!empty($posts_obj)) { |
1798 | 1798 | foreach ($posts_obj as $post_obj) { |
1799 | 1799 | $post_id = $post_obj->object_id; |
1800 | 1800 | |
1801 | - $raw_tags = wp_get_object_terms($post_id, $post_type . '_tags', array('fields' => 'names')); |
|
1801 | + $raw_tags = wp_get_object_terms($post_id, $post_type.'_tags', array('fields' => 'names')); |
|
1802 | 1802 | $post_tags = !empty($raw_tags) ? implode(',', $raw_tags) : ''; |
1803 | 1803 | |
1804 | - $listing_table = $plugin_prefix . $post_type . '_detail'; |
|
1805 | - $wpdb->query($wpdb->prepare("UPDATE " . $listing_table . " SET post_tags=%s WHERE post_id =%d", array($post_tags, $post_id))); |
|
1804 | + $listing_table = $plugin_prefix.$post_type.'_detail'; |
|
1805 | + $wpdb->query($wpdb->prepare("UPDATE ".$listing_table." SET post_tags=%s WHERE post_id =%d", array($post_tags, $post_id))); |
|
1806 | 1806 | } |
1807 | 1807 | } |
1808 | 1808 | } |
@@ -1836,7 +1836,7 @@ discard block |
||
1836 | 1836 | if ($country_slug == $slug || $region_slug == $slug || $city_slug == $slug) |
1837 | 1837 | return $slug_exists = true; |
1838 | 1838 | |
1839 | - if ($wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s AND term_id != %d", array($slug, $term_id)))) |
|
1839 | + if ($wpdb->get_var($wpdb->prepare("SELECT slug FROM ".$table_prefix."terms WHERE slug=%s AND term_id != %d", array($slug, $term_id)))) |
|
1840 | 1840 | return $slug_exists = true; |
1841 | 1841 | |
1842 | 1842 | return $slug_exists; |
@@ -1876,43 +1876,43 @@ discard block |
||
1876 | 1876 | |
1877 | 1877 | |
1878 | 1878 | $gd_page = ''; |
1879 | - if(geodir_is_page('home')){ |
|
1879 | + if (geodir_is_page('home')) { |
|
1880 | 1880 | $gd_page = 'home'; |
1881 | 1881 | $title = (get_option('geodir_meta_title_homepage')) ? get_option('geodir_meta_title_homepage') : $title; |
1882 | 1882 | } |
1883 | - elseif(geodir_is_page('detail')){ |
|
1883 | + elseif (geodir_is_page('detail')) { |
|
1884 | 1884 | $gd_page = 'detail'; |
1885 | 1885 | $title = (get_option('geodir_meta_title_detail')) ? get_option('geodir_meta_title_detail') : $title; |
1886 | 1886 | } |
1887 | - elseif(geodir_is_page('pt')){ |
|
1887 | + elseif (geodir_is_page('pt')) { |
|
1888 | 1888 | $gd_page = 'pt'; |
1889 | 1889 | $title = (get_option('geodir_meta_title_pt')) ? get_option('geodir_meta_title_pt') : $title; |
1890 | 1890 | } |
1891 | - elseif(geodir_is_page('listing')){ |
|
1891 | + elseif (geodir_is_page('listing')) { |
|
1892 | 1892 | $gd_page = 'listing'; |
1893 | 1893 | $title = (get_option('geodir_meta_title_listing')) ? get_option('geodir_meta_title_listing') : $title; |
1894 | 1894 | } |
1895 | - elseif(geodir_is_page('location')){ |
|
1895 | + elseif (geodir_is_page('location')) { |
|
1896 | 1896 | $gd_page = 'location'; |
1897 | 1897 | $title = (get_option('geodir_meta_title_location')) ? get_option('geodir_meta_title_location') : $title; |
1898 | 1898 | } |
1899 | - elseif(geodir_is_page('search')){ |
|
1899 | + elseif (geodir_is_page('search')) { |
|
1900 | 1900 | $gd_page = 'search'; |
1901 | 1901 | $title = (get_option('geodir_meta_title_search')) ? get_option('geodir_meta_title_search') : $title; |
1902 | 1902 | } |
1903 | - elseif(geodir_is_page('add-listing')){ |
|
1903 | + elseif (geodir_is_page('add-listing')) { |
|
1904 | 1904 | $gd_page = 'add-listing'; |
1905 | 1905 | $title = (get_option('geodir_meta_title_add-listing')) ? get_option('geodir_meta_title_add-listing') : $title; |
1906 | 1906 | } |
1907 | - elseif(geodir_is_page('author')){ |
|
1907 | + elseif (geodir_is_page('author')) { |
|
1908 | 1908 | $gd_page = 'author'; |
1909 | 1909 | $title = (get_option('geodir_meta_title_author')) ? get_option('geodir_meta_title_author') : $title; |
1910 | 1910 | } |
1911 | - elseif(geodir_is_page('login')){ |
|
1911 | + elseif (geodir_is_page('login')) { |
|
1912 | 1912 | $gd_page = 'login'; |
1913 | 1913 | $title = (get_option('geodir_meta_title_login')) ? get_option('geodir_meta_title_login') : $title; |
1914 | 1914 | } |
1915 | - elseif(geodir_is_page('listing-success')){ |
|
1915 | + elseif (geodir_is_page('listing-success')) { |
|
1916 | 1916 | $gd_page = 'listing-success'; |
1917 | 1917 | $title = (get_option('geodir_meta_title_listing-success')) ? get_option('geodir_meta_title_listing-success') : $title; |
1918 | 1918 | } |
@@ -1944,12 +1944,12 @@ discard block |
||
1944 | 1944 | |
1945 | 1945 | if (!get_option('geodir_set_post_attachments')) { |
1946 | 1946 | |
1947 | - require_once(ABSPATH . 'wp-admin/includes/image.php'); |
|
1948 | - require_once(ABSPATH . 'wp-admin/includes/file.php'); |
|
1947 | + require_once(ABSPATH.'wp-admin/includes/image.php'); |
|
1948 | + require_once(ABSPATH.'wp-admin/includes/file.php'); |
|
1949 | 1949 | |
1950 | 1950 | $all_postypes = geodir_get_posttypes(); |
1951 | 1951 | |
1952 | - foreach($all_postypes as $post_type){ |
|
1952 | + foreach ($all_postypes as $post_type) { |
|
1953 | 1953 | $args = array( |
1954 | 1954 | 'posts_per_page' => -1, |
1955 | 1955 | 'post_type' => $post_type, |
@@ -2043,7 +2043,7 @@ discard block |
||
2043 | 2043 | { |
2044 | 2044 | $user_id = get_current_user_id(); |
2045 | 2045 | |
2046 | - if(!$user_id){return $post;} |
|
2046 | + if (!$user_id) {return $post; } |
|
2047 | 2047 | |
2048 | 2048 | $gd_post_types = geodir_get_posttypes(); |
2049 | 2049 | |
@@ -2152,7 +2152,7 @@ discard block |
||
2152 | 2152 | |
2153 | 2153 | if (array_key_exists('post_video', $tabs_arr)) { |
2154 | 2154 | |
2155 | - $field_title = $wpdb->get_var($wpdb->prepare("select site_title from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array('geodir_video', $post_type))); |
|
2155 | + $field_title = $wpdb->get_var($wpdb->prepare("select site_title from ".GEODIR_CUSTOM_FIELDS_TABLE." where htmlvar_name = %s and post_type = %s ", array('geodir_video', $post_type))); |
|
2156 | 2156 | |
2157 | 2157 | if (isset($tabs_arr['post_video']['heading_text']) && $field_title != '') |
2158 | 2158 | $tabs_arr['post_video']['heading_text'] = $field_title; |
@@ -2160,7 +2160,7 @@ discard block |
||
2160 | 2160 | |
2161 | 2161 | if (array_key_exists('special_offers', $tabs_arr)) { |
2162 | 2162 | |
2163 | - $field_title = $wpdb->get_var($wpdb->prepare("select site_title from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array('geodir_special_offers', $post_type))); |
|
2163 | + $field_title = $wpdb->get_var($wpdb->prepare("select site_title from ".GEODIR_CUSTOM_FIELDS_TABLE." where htmlvar_name = %s and post_type = %s ", array('geodir_special_offers', $post_type))); |
|
2164 | 2164 | |
2165 | 2165 | if (isset($tabs_arr['special_offers']['heading_text']) && $field_title != '') |
2166 | 2166 | $tabs_arr['special_offers']['heading_text'] = $field_title; |
@@ -2181,7 +2181,7 @@ discard block |
||
2181 | 2181 | */ |
2182 | 2182 | function geodir_remove_template_redirect_actions() |
2183 | 2183 | { |
2184 | - if (geodir_is_page('login')){ |
|
2184 | + if (geodir_is_page('login')) { |
|
2185 | 2185 | remove_all_actions('template_redirect'); |
2186 | 2186 | remove_action('init', 'avia_modify_front', 10); |
2187 | 2187 | } |
@@ -2228,25 +2228,25 @@ discard block |
||
2228 | 2228 | $split_img_file_path = isset($split_img_path[1]) ? $split_img_path[1] : ''; |
2229 | 2229 | |
2230 | 2230 | $wpdb->query( |
2231 | - $wpdb->prepare("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id = %d AND file=%s ", |
|
2231 | + $wpdb->prepare("DELETE FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id = %d AND file=%s ", |
|
2232 | 2232 | array($post_id, $split_img_file_path) |
2233 | 2233 | ) |
2234 | 2234 | ); |
2235 | 2235 | |
2236 | 2236 | $attachment_data = $wpdb->get_row( |
2237 | - $wpdb->prepare("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=%d", |
|
2237 | + $wpdb->prepare("SELECT ID, MIN(`menu_order`) FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id=%d", |
|
2238 | 2238 | array($post_id) |
2239 | 2239 | ) |
2240 | 2240 | ); |
2241 | 2241 | |
2242 | 2242 | if (!empty($attachment_data)) { |
2243 | - $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID); |
|
2243 | + $wpdb->query("UPDATE ".GEODIR_ATTACHMENT_TABLE." SET menu_order=1 WHERE ID=".$attachment_data->ID); |
|
2244 | 2244 | } |
2245 | 2245 | |
2246 | 2246 | |
2247 | - $table_name = $plugin_prefix . $post_type . '_detail'; |
|
2247 | + $table_name = $plugin_prefix.$post_type.'_detail'; |
|
2248 | 2248 | |
2249 | - $wpdb->query("UPDATE " . $table_name . " SET featured_image='' WHERE post_id =" . $post_id); |
|
2249 | + $wpdb->query("UPDATE ".$table_name." SET featured_image='' WHERE post_id =".$post_id); |
|
2250 | 2250 | |
2251 | 2251 | geodir_set_wp_featured_image($post_id); |
2252 | 2252 | |
@@ -2274,9 +2274,9 @@ discard block |
||
2274 | 2274 | |
2275 | 2275 | foreach ($all_postypes as $posttype) { |
2276 | 2276 | |
2277 | - $tablename = $plugin_prefix . $posttype . '_detail'; |
|
2277 | + $tablename = $plugin_prefix.$posttype.'_detail'; |
|
2278 | 2278 | |
2279 | - $get_post_data = $wpdb->get_results("SELECT post_id FROM " . $tablename); |
|
2279 | + $get_post_data = $wpdb->get_results("SELECT post_id FROM ".$tablename); |
|
2280 | 2280 | |
2281 | 2281 | if (!empty($get_post_data)) { |
2282 | 2282 | |
@@ -2284,7 +2284,7 @@ discard block |
||
2284 | 2284 | |
2285 | 2285 | $post_id = $data->post_id; |
2286 | 2286 | |
2287 | - $attachment_data = $wpdb->get_results("SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id =" . $post_id . " AND file!=''"); |
|
2287 | + $attachment_data = $wpdb->get_results("SELECT * FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id =".$post_id." AND file!=''"); |
|
2288 | 2288 | |
2289 | 2289 | if (!empty($attachment_data)) { |
2290 | 2290 | |
@@ -2301,22 +2301,22 @@ discard block |
||
2301 | 2301 | |
2302 | 2302 | $file_name = $file_info['basename']; |
2303 | 2303 | |
2304 | - $img_arr['path'] = $uploads_path . $sub_dir . '/' . $file_name; |
|
2304 | + $img_arr['path'] = $uploads_path.$sub_dir.'/'.$file_name; |
|
2305 | 2305 | |
2306 | 2306 | if (!file_exists($img_arr['path'])) { |
2307 | 2307 | |
2308 | - $wpdb->query("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE ID=" . $attach->ID); |
|
2308 | + $wpdb->query("DELETE FROM ".GEODIR_ATTACHMENT_TABLE." WHERE ID=".$attach->ID); |
|
2309 | 2309 | |
2310 | 2310 | } |
2311 | 2311 | |
2312 | 2312 | } |
2313 | 2313 | |
2314 | - $attachment_data = $wpdb->get_row("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=" . $post_id . " GROUP BY post_id"); |
|
2314 | + $attachment_data = $wpdb->get_row("SELECT ID, MIN(`menu_order`) FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id=".$post_id." GROUP BY post_id"); |
|
2315 | 2315 | |
2316 | 2316 | if (!empty($attachment_data)) { |
2317 | 2317 | |
2318 | 2318 | if ($attachment_data->ID) |
2319 | - $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID); |
|
2319 | + $wpdb->query("UPDATE ".GEODIR_ATTACHMENT_TABLE." SET menu_order=1 WHERE ID=".$attachment_data->ID); |
|
2320 | 2320 | |
2321 | 2321 | } else { |
2322 | 2322 | |
@@ -2330,7 +2330,7 @@ discard block |
||
2330 | 2330 | |
2331 | 2331 | } |
2332 | 2332 | |
2333 | - $wpdb->query("UPDATE " . $tablename . " SET featured_image='' WHERE post_id =" . $post_id); |
|
2333 | + $wpdb->query("UPDATE ".$tablename." SET featured_image='' WHERE post_id =".$post_id); |
|
2334 | 2334 | |
2335 | 2335 | geodir_set_wp_featured_image($post_id); |
2336 | 2336 | |
@@ -2359,7 +2359,7 @@ discard block |
||
2359 | 2359 | { |
2360 | 2360 | |
2361 | 2361 | if (!get_option('geodir_default_rating_star_icon')) { |
2362 | - update_option('geodir_default_rating_star_icon', geodir_plugin_url() . '/geodirectory-assets/images/stars.png'); |
|
2362 | + update_option('geodir_default_rating_star_icon', geodir_plugin_url().'/geodirectory-assets/images/stars.png'); |
|
2363 | 2363 | } |
2364 | 2364 | |
2365 | 2365 | } |
@@ -2376,10 +2376,10 @@ discard block |
||
2376 | 2376 | * @global string $plugin_prefix Geodirectory plugin table prefix. |
2377 | 2377 | * @return array User listing count for each post type. |
2378 | 2378 | */ |
2379 | -function geodir_user_post_listing_count($user_id=null) |
|
2379 | +function geodir_user_post_listing_count($user_id = null) |
|
2380 | 2380 | { |
2381 | 2381 | global $wpdb, $plugin_prefix, $current_user; |
2382 | - if(!$user_id){ |
|
2382 | + if (!$user_id) { |
|
2383 | 2383 | $user_id = $current_user->ID; |
2384 | 2384 | } |
2385 | 2385 | |
@@ -2390,7 +2390,7 @@ discard block |
||
2390 | 2390 | $user_listing = array(); |
2391 | 2391 | if (is_array($all_posts) && !empty($all_posts)) { |
2392 | 2392 | foreach ($all_posts as $ptype) { |
2393 | - $total_posts = $wpdb->get_var("SELECT count( ID ) FROM " . $wpdb->prefix . "posts WHERE post_author=" . $user_id . " AND post_type='" . $ptype . "' AND ( post_status = 'publish' OR post_status = 'draft' OR post_status = 'private' )"); |
|
2393 | + $total_posts = $wpdb->get_var("SELECT count( ID ) FROM ".$wpdb->prefix."posts WHERE post_author=".$user_id." AND post_type='".$ptype."' AND ( post_status = 'publish' OR post_status = 'draft' OR post_status = 'private' )"); |
|
2394 | 2394 | |
2395 | 2395 | if ($total_posts > 0) { |
2396 | 2396 | $user_listing[$ptype] = $total_posts; |
@@ -2444,7 +2444,7 @@ discard block |
||
2444 | 2444 | $post->{$field_name} = $_REQUEST[$field_name]; |
2445 | 2445 | } |
2446 | 2446 | |
2447 | - if (isset($field['show_in']) && strpos($field['show_in'], '[owntab]') !== false && ((isset($post->{$field_name}) && $post->{$field_name} != '') || $field['type'] == 'fieldset') && in_array($field['type'], array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file'))) { |
|
2447 | + if (isset($field['show_in']) && strpos($field['show_in'], '[owntab]') !== false && ((isset($post->{$field_name}) && $post->{$field_name} != '') || $field['type'] == 'fieldset') && in_array($field['type'], array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file'))) { |
|
2448 | 2448 | if ($type['type'] == 'datepicker' && ($post->{$type['htmlvar_name']} == '' || $post->{$type['htmlvar_name']} == '0000-00-00')) { |
2449 | 2449 | continue; |
2450 | 2450 | } |
@@ -2493,11 +2493,11 @@ discard block |
||
2493 | 2493 | $variables_array['label'] = __($type['site_title'], 'geodirectory'); |
2494 | 2494 | $variables_array['value'] = ''; |
2495 | 2495 | $variables_array['value'] = $post->{$type['htmlvar_name']}; |
2496 | - }else{ |
|
2496 | + } else { |
|
2497 | 2497 | $i = 0; |
2498 | 2498 | $fieldset_count++; |
2499 | 2499 | $field_set_start = 1; |
2500 | - $fieldset_arr[$fieldset_count]['htmlvar_name'] = 'gd_tab_' . $fieldset_count; |
|
2500 | + $fieldset_arr[$fieldset_count]['htmlvar_name'] = 'gd_tab_'.$fieldset_count; |
|
2501 | 2501 | $fieldset_arr[$fieldset_count]['label'] = $label; |
2502 | 2502 | } |
2503 | 2503 | |
@@ -2517,7 +2517,7 @@ discard block |
||
2517 | 2517 | * @param string $fields_location The location the field is to be show. |
2518 | 2518 | * @param array $type The array of field values. |
2519 | 2519 | */ |
2520 | - $html = apply_filters("geodir_custom_field_output_{$filed_type}",$html,$fields_location,$type); |
|
2520 | + $html = apply_filters("geodir_custom_field_output_{$filed_type}", $html, $fields_location, $type); |
|
2521 | 2521 | |
2522 | 2522 | |
2523 | 2523 | /** |
@@ -2563,7 +2563,7 @@ discard block |
||
2563 | 2563 | * @param string $htmlvar_name The field HTML var name. |
2564 | 2564 | */ |
2565 | 2565 | 'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, $htmlvar_name), |
2566 | - 'tab_content' => '<div class="geodir-company_info field-group xxx">' . $fieldset_html . '</div>' |
|
2566 | + 'tab_content' => '<div class="geodir-company_info field-group xxx">'.$fieldset_html.'</div>' |
|
2567 | 2567 | ); |
2568 | 2568 | } |
2569 | 2569 | } else { |
@@ -2623,7 +2623,7 @@ discard block |
||
2623 | 2623 | } |
2624 | 2624 | $status .= ")</strong>"; |
2625 | 2625 | |
2626 | - $html = '<span class="geodir-post-status">' . $status_icon . ' <font class="geodir-status-label">' . __('Status: ', 'geodirectory') . '</font>' . $status . '</span>'; |
|
2626 | + $html = '<span class="geodir-post-status">'.$status_icon.' <font class="geodir-status-label">'.__('Status: ', 'geodirectory').'</font>'.$status.'</span>'; |
|
2627 | 2627 | } |
2628 | 2628 | } |
2629 | 2629 | |
@@ -2703,7 +2703,7 @@ discard block |
||
2703 | 2703 | function geodir_no_rating_comment_text($content, $comment = '') |
2704 | 2704 | { |
2705 | 2705 | if (!is_admin()) { |
2706 | - return '<div class="description">' . $content . '</div>'; |
|
2706 | + return '<div class="description">'.$content.'</div>'; |
|
2707 | 2707 | } else { |
2708 | 2708 | return $content; |
2709 | 2709 | } |
@@ -2781,7 +2781,7 @@ discard block |
||
2781 | 2781 | $classes[] = 'gd-no-rating'; |
2782 | 2782 | } |
2783 | 2783 | |
2784 | - $classes[] = 'gd-map-' . geodir_map_name(); |
|
2784 | + $classes[] = 'gd-map-'.geodir_map_name(); |
|
2785 | 2785 | |
2786 | 2786 | return $classes; |
2787 | 2787 | } |
@@ -2801,7 +2801,7 @@ discard block |
||
2801 | 2801 | $class .= ' gd-no-rating'; |
2802 | 2802 | } |
2803 | 2803 | |
2804 | - $class .= ' gd-map-' . geodir_map_name(); |
|
2804 | + $class .= ' gd-map-'.geodir_map_name(); |
|
2805 | 2805 | |
2806 | 2806 | return $class; |
2807 | 2807 | } |
@@ -2836,7 +2836,7 @@ discard block |
||
2836 | 2836 | * @return array Translation texts. |
2837 | 2837 | */ |
2838 | 2838 | function geodir_load_gd_options_text_translation($translation_texts = array()) { |
2839 | - $translation_texts = !empty( $translation_texts ) && is_array( $translation_texts ) ? $translation_texts : array(); |
|
2839 | + $translation_texts = !empty($translation_texts) && is_array($translation_texts) ? $translation_texts : array(); |
|
2840 | 2840 | |
2841 | 2841 | $gd_options = array('geodir_post_submited_success_email_subject_admin', 'geodir_post_submited_success_email_content_admin', 'geodir_post_submited_success_email_subject', 'geodir_post_submited_success_email_content', 'geodir_forgot_password_subject', 'geodir_forgot_password_content', 'geodir_registration_success_email_subject', 'geodir_registration_success_email_content', 'geodir_post_published_email_subject', 'geodir_post_published_email_content', 'geodir_email_friend_subject', 'geodir_email_friend_content', 'geodir_email_enquiry_subject', 'geodir_email_enquiry_content', 'geodir_post_added_success_msg_content', 'geodir_post_edited_email_subject_admin', 'geodir_post_edited_email_content_admin'); |
2842 | 2842 | |
@@ -2902,14 +2902,14 @@ discard block |
||
2902 | 2902 | * @param array $args The array of menu arguments. |
2903 | 2903 | * @return array The modified arguments. |
2904 | 2904 | */ |
2905 | -function geodir_add_nav_menu_class( $args ) |
|
2905 | +function geodir_add_nav_menu_class($args) |
|
2906 | 2906 | { |
2907 | 2907 | |
2908 | - if(isset($args['menu_class'])){ |
|
2908 | + if (isset($args['menu_class'])) { |
|
2909 | 2909 | $args['menu_class'] = $args['menu_class']." gd-menu-z"; |
2910 | 2910 | } |
2911 | 2911 | |
2912 | 2912 | return $args; |
2913 | 2913 | } |
2914 | 2914 | |
2915 | -add_filter( 'wp_nav_menu_args', 'geodir_add_nav_menu_class' ); |
|
2916 | 2915 | \ No newline at end of file |
2916 | +add_filter('wp_nav_menu_args', 'geodir_add_nav_menu_class'); |
|
2917 | 2917 | \ No newline at end of file |
@@ -19,21 +19,21 @@ discard block |
||
19 | 19 | * |
20 | 20 | * @return string The html to output for the custom field. |
21 | 21 | */ |
22 | -function geodir_cf_checkbox($html,$location,$cf,$p=''){ |
|
22 | +function geodir_cf_checkbox($html, $location, $cf, $p = '') { |
|
23 | 23 | |
24 | 24 | // check we have the post value |
25 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
26 | - else{ global $post;} |
|
25 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
26 | + else { global $post; } |
|
27 | 27 | |
28 | - if(!is_array($cf) && $cf!=''){ |
|
28 | + if (!is_array($cf) && $cf != '') { |
|
29 | 29 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
30 | - if(!$cf){return NULL;} |
|
30 | + if (!$cf) {return NULL; } |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | $html_var = $cf['htmlvar_name']; |
34 | 34 | |
35 | 35 | // Check if there is a location specific filter. |
36 | - if(has_filter("geodir_custom_field_output_checkbox_loc_{$location}")){ |
|
36 | + if (has_filter("geodir_custom_field_output_checkbox_loc_{$location}")) { |
|
37 | 37 | /** |
38 | 38 | * Filter the checkbox html by location. |
39 | 39 | * |
@@ -41,11 +41,11 @@ discard block |
||
41 | 41 | * @param array $cf The custom field array. |
42 | 42 | * @since 1.6.6 |
43 | 43 | */ |
44 | - $html = apply_filters("geodir_custom_field_output_checkbox_loc_{$location}",$html,$cf); |
|
44 | + $html = apply_filters("geodir_custom_field_output_checkbox_loc_{$location}", $html, $cf); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | // Check if there is a custom field specific filter. |
48 | - if(has_filter("geodir_custom_field_output_checkbox_var_{$html_var}")){ |
|
48 | + if (has_filter("geodir_custom_field_output_checkbox_var_{$html_var}")) { |
|
49 | 49 | /** |
50 | 50 | * Filter the checkbox html by individual custom field. |
51 | 51 | * |
@@ -54,11 +54,11 @@ discard block |
||
54 | 54 | * @param array $cf The custom field array. |
55 | 55 | * @since 1.6.6 |
56 | 56 | */ |
57 | - $html = apply_filters("geodir_custom_field_output_checkbox_var_{$html_var}",$html,$location,$cf); |
|
57 | + $html = apply_filters("geodir_custom_field_output_checkbox_var_{$html_var}", $html, $location, $cf); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | // Check if there is a custom field key specific filter. |
61 | - if(has_filter("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}")){ |
|
61 | + if (has_filter("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}")) { |
|
62 | 62 | /** |
63 | 63 | * Filter the checkbox html by field type key. |
64 | 64 | * |
@@ -67,18 +67,18 @@ discard block |
||
67 | 67 | * @param array $cf The custom field array. |
68 | 68 | * @since 1.6.6 |
69 | 69 | */ |
70 | - $html = apply_filters("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
70 | + $html = apply_filters("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | // If not html then we run the standard output. |
74 | - if(empty($html)){ |
|
74 | + if (empty($html)) { |
|
75 | 75 | |
76 | - if ( (int) $post->{$html_var} == 1 ): |
|
76 | + if ((int) $post->{$html_var} == 1): |
|
77 | 77 | |
78 | - if ( $post->{$html_var} == '1' ): |
|
79 | - $html_val = __( 'Yes', 'geodirectory' ); |
|
78 | + if ($post->{$html_var} == '1'): |
|
79 | + $html_val = __('Yes', 'geodirectory'); |
|
80 | 80 | else: |
81 | - $html_val = __( 'No', 'geodirectory' ); |
|
81 | + $html_val = __('No', 'geodirectory'); |
|
82 | 82 | endif; |
83 | 83 | |
84 | 84 | $field_icon = geodir_field_icon_proccess($cf); |
@@ -91,16 +91,16 @@ discard block |
||
91 | 91 | $field_icon = ''; |
92 | 92 | } |
93 | 93 | |
94 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-checkbox" style="' . $field_icon . '">' . $field_icon_af; |
|
95 | - $html .= ( trim( $cf['site_title'] ) ) ? __( $cf['site_title'], 'geodirectory' ) . ': ' : ''; |
|
96 | - $html .= '</span>' . $html_val . '</div>'; |
|
94 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-checkbox" style="'.$field_icon.'">'.$field_icon_af; |
|
95 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : ''; |
|
96 | + $html .= '</span>'.$html_val.'</div>'; |
|
97 | 97 | endif; |
98 | 98 | |
99 | 99 | } |
100 | 100 | |
101 | 101 | return $html; |
102 | 102 | } |
103 | -add_filter('geodir_custom_field_output_checkbox','geodir_cf_checkbox',10,3); |
|
103 | +add_filter('geodir_custom_field_output_checkbox', 'geodir_cf_checkbox', 10, 3); |
|
104 | 104 | |
105 | 105 | |
106 | 106 | /** |
@@ -113,21 +113,21 @@ discard block |
||
113 | 113 | * |
114 | 114 | * @return string The html to output for the custom field. |
115 | 115 | */ |
116 | -function geodir_cf_fieldset($html,$location,$cf,$p=''){ |
|
116 | +function geodir_cf_fieldset($html, $location, $cf, $p = '') { |
|
117 | 117 | |
118 | 118 | // check we have the post value |
119 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
120 | - else{ global $post;} |
|
119 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
120 | + else { global $post; } |
|
121 | 121 | |
122 | - if(!is_array($cf) && $cf!=''){ |
|
122 | + if (!is_array($cf) && $cf != '') { |
|
123 | 123 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
124 | - if(!$cf){return NULL;} |
|
124 | + if (!$cf) {return NULL; } |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | $html_var = $cf['htmlvar_name']; |
128 | 128 | |
129 | 129 | // Check if there is a location specific filter. |
130 | - if(has_filter("geodir_custom_field_output_fieldset_loc_{$location}")){ |
|
130 | + if (has_filter("geodir_custom_field_output_fieldset_loc_{$location}")) { |
|
131 | 131 | /** |
132 | 132 | * Filter the fieldset html by location. |
133 | 133 | * |
@@ -135,11 +135,11 @@ discard block |
||
135 | 135 | * @param array $cf The custom field array. |
136 | 136 | * @since 1.6.6 |
137 | 137 | */ |
138 | - $html = apply_filters("geodir_custom_field_output_fieldset_loc_{$location}",$html,$cf); |
|
138 | + $html = apply_filters("geodir_custom_field_output_fieldset_loc_{$location}", $html, $cf); |
|
139 | 139 | } |
140 | 140 | |
141 | 141 | // Check if there is a custom field specific filter. |
142 | - if(has_filter("geodir_custom_field_output_fieldset_var_{$html_var}")){ |
|
142 | + if (has_filter("geodir_custom_field_output_fieldset_var_{$html_var}")) { |
|
143 | 143 | /** |
144 | 144 | * Filter the fieldset html by individual custom field. |
145 | 145 | * |
@@ -148,11 +148,11 @@ discard block |
||
148 | 148 | * @param array $cf The custom field array. |
149 | 149 | * @since 1.6.6 |
150 | 150 | */ |
151 | - $html = apply_filters("geodir_custom_field_output_fieldset_var_{$html_var}",$html,$location,$cf); |
|
151 | + $html = apply_filters("geodir_custom_field_output_fieldset_var_{$html_var}", $html, $location, $cf); |
|
152 | 152 | } |
153 | 153 | |
154 | 154 | // Check if there is a custom field key specific filter. |
155 | - if(has_filter("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}")){ |
|
155 | + if (has_filter("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}")) { |
|
156 | 156 | /** |
157 | 157 | * Filter the fieldset html by field type key. |
158 | 158 | * |
@@ -161,20 +161,20 @@ discard block |
||
161 | 161 | * @param array $cf The custom field array. |
162 | 162 | * @since 1.6.6 |
163 | 163 | */ |
164 | - $html = apply_filters("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
164 | + $html = apply_filters("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
165 | 165 | } |
166 | 166 | |
167 | 167 | // If not html then we run the standard output. |
168 | - if(empty($html)){ |
|
168 | + if (empty($html)) { |
|
169 | 169 | |
170 | 170 | global $field_set_start; |
171 | 171 | $fieldset_class = 'fieldset-'.sanitize_title_with_dashes($cf['site_title']); |
172 | 172 | |
173 | 173 | if ($field_set_start == 1) { |
174 | - $html = '';//'<h2 class="'.$fieldset_class.'">xxx'.$field_set_start . __($cf['site_title'], 'geodirectory') . '</h2>'; |
|
174 | + $html = ''; //'<h2 class="'.$fieldset_class.'">xxx'.$field_set_start . __($cf['site_title'], 'geodirectory') . '</h2>'; |
|
175 | 175 | //$html = '</div><div class="geodir-company_info field-group ' . $cf['htmlvar_name'] . '"><h2 class="'.$fieldset_class.'">' . __($cf['site_title'], 'geodirectory') . '</h2>'; |
176 | 176 | } else { |
177 | - $html = '<h2 class="'.$fieldset_class.'">'. __($cf['site_title'], 'geodirectory') . '</h2>'; |
|
177 | + $html = '<h2 class="'.$fieldset_class.'">'.__($cf['site_title'], 'geodirectory').'</h2>'; |
|
178 | 178 | //$field_set_start = 1; |
179 | 179 | } |
180 | 180 | |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | |
183 | 183 | return $html; |
184 | 184 | } |
185 | -add_filter('geodir_custom_field_output_fieldset','geodir_cf_fieldset',10,3); |
|
185 | +add_filter('geodir_custom_field_output_fieldset', 'geodir_cf_fieldset', 10, 3); |
|
186 | 186 | |
187 | 187 | |
188 | 188 | /** |
@@ -195,21 +195,21 @@ discard block |
||
195 | 195 | * |
196 | 196 | * @return string The html to output for the custom field. |
197 | 197 | */ |
198 | -function geodir_cf_url($html,$location,$cf,$p=''){ |
|
198 | +function geodir_cf_url($html, $location, $cf, $p = '') { |
|
199 | 199 | |
200 | 200 | // check we have the post value |
201 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
202 | - else{ global $post;} |
|
201 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
202 | + else { global $post; } |
|
203 | 203 | |
204 | - if(!is_array($cf) && $cf!=''){ |
|
204 | + if (!is_array($cf) && $cf != '') { |
|
205 | 205 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
206 | - if(!$cf){return NULL;} |
|
206 | + if (!$cf) {return NULL; } |
|
207 | 207 | } |
208 | 208 | |
209 | 209 | $html_var = $cf['htmlvar_name']; |
210 | 210 | |
211 | 211 | // Check if there is a location specific filter. |
212 | - if(has_filter("geodir_custom_field_output_url_loc_{$location}")){ |
|
212 | + if (has_filter("geodir_custom_field_output_url_loc_{$location}")) { |
|
213 | 213 | /** |
214 | 214 | * Filter the url html by location. |
215 | 215 | * |
@@ -217,11 +217,11 @@ discard block |
||
217 | 217 | * @param array $cf The custom field array. |
218 | 218 | * @since 1.6.6 |
219 | 219 | */ |
220 | - $html = apply_filters("geodir_custom_field_output_url_loc_{$location}",$html,$cf); |
|
220 | + $html = apply_filters("geodir_custom_field_output_url_loc_{$location}", $html, $cf); |
|
221 | 221 | } |
222 | 222 | |
223 | 223 | // Check if there is a custom field specific filter. |
224 | - if(has_filter("geodir_custom_field_output_url_var_{$html_var}")){ |
|
224 | + if (has_filter("geodir_custom_field_output_url_var_{$html_var}")) { |
|
225 | 225 | /** |
226 | 226 | * Filter the url html by individual custom field. |
227 | 227 | * |
@@ -230,11 +230,11 @@ discard block |
||
230 | 230 | * @param array $cf The custom field array. |
231 | 231 | * @since 1.6.6 |
232 | 232 | */ |
233 | - $html = apply_filters("geodir_custom_field_output_url_var_{$html_var}",$html,$location,$cf); |
|
233 | + $html = apply_filters("geodir_custom_field_output_url_var_{$html_var}", $html, $location, $cf); |
|
234 | 234 | } |
235 | 235 | |
236 | 236 | // Check if there is a custom field key specific filter. |
237 | - if(has_filter("geodir_custom_field_output_url_key_{$cf['field_type_key']}")){ |
|
237 | + if (has_filter("geodir_custom_field_output_url_key_{$cf['field_type_key']}")) { |
|
238 | 238 | /** |
239 | 239 | * Filter the url html by field type key. |
240 | 240 | * |
@@ -243,11 +243,11 @@ discard block |
||
243 | 243 | * @param array $cf The custom field array. |
244 | 244 | * @since 1.6.6 |
245 | 245 | */ |
246 | - $html = apply_filters("geodir_custom_field_output_url_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
246 | + $html = apply_filters("geodir_custom_field_output_url_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
247 | 247 | } |
248 | 248 | |
249 | 249 | // If not html then we run the standard output. |
250 | - if(empty($html)){ |
|
250 | + if (empty($html)) { |
|
251 | 251 | |
252 | 252 | if ($post->{$cf['htmlvar_name']}): |
253 | 253 | |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | |
275 | 275 | $website = !empty($a_url['url']) ? $a_url['url'] : ''; |
276 | 276 | $title = !empty($a_url['label']) ? $a_url['label'] : $cf['site_title']; |
277 | - if(!empty($cf['default_value'])){$title = $cf['default_value'];} |
|
277 | + if (!empty($cf['default_value'])) {$title = $cf['default_value']; } |
|
278 | 278 | $title = $title != '' ? __(stripslashes($title), 'geodirectory') : ''; |
279 | 279 | |
280 | 280 | |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | * @param string $website Website URL. |
291 | 291 | * @param int $post->ID Post ID. |
292 | 292 | */ |
293 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '"><span class="geodir-i-website" style="' . $field_icon . '">' . $field_icon_af . '<a href="' . $website . '" target="_blank" ' . $rel . ' ><strong>' . apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID) . '</strong></a></span></div>'; |
|
293 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'"><span class="geodir-i-website" style="'.$field_icon.'">'.$field_icon_af.'<a href="'.$website.'" target="_blank" '.$rel.' ><strong>'.apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID).'</strong></a></span></div>'; |
|
294 | 294 | |
295 | 295 | endif; |
296 | 296 | |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | |
299 | 299 | return $html; |
300 | 300 | } |
301 | -add_filter('geodir_custom_field_output_url','geodir_cf_url',10,3); |
|
301 | +add_filter('geodir_custom_field_output_url', 'geodir_cf_url', 10, 3); |
|
302 | 302 | |
303 | 303 | |
304 | 304 | /** |
@@ -311,21 +311,21 @@ discard block |
||
311 | 311 | * |
312 | 312 | * @return string The html to output for the custom field. |
313 | 313 | */ |
314 | -function geodir_cf_phone($html,$location,$cf,$p=''){ |
|
314 | +function geodir_cf_phone($html, $location, $cf, $p = '') { |
|
315 | 315 | |
316 | 316 | // check we have the post value |
317 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
318 | - else{ global $post;} |
|
317 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
318 | + else { global $post; } |
|
319 | 319 | |
320 | - if(!is_array($cf) && $cf!=''){ |
|
320 | + if (!is_array($cf) && $cf != '') { |
|
321 | 321 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
322 | - if(!$cf){return NULL;} |
|
322 | + if (!$cf) {return NULL; } |
|
323 | 323 | } |
324 | 324 | |
325 | 325 | $html_var = $cf['htmlvar_name']; |
326 | 326 | |
327 | 327 | // Check if there is a location specific filter. |
328 | - if(has_filter("geodir_custom_field_output_phone_loc_{$location}")){ |
|
328 | + if (has_filter("geodir_custom_field_output_phone_loc_{$location}")) { |
|
329 | 329 | /** |
330 | 330 | * Filter the phone html by location. |
331 | 331 | * |
@@ -333,11 +333,11 @@ discard block |
||
333 | 333 | * @param array $cf The custom field array. |
334 | 334 | * @since 1.6.6 |
335 | 335 | */ |
336 | - $html = apply_filters("geodir_custom_field_output_phone_loc_{$location}",$html,$cf); |
|
336 | + $html = apply_filters("geodir_custom_field_output_phone_loc_{$location}", $html, $cf); |
|
337 | 337 | } |
338 | 338 | |
339 | 339 | // Check if there is a custom field specific filter. |
340 | - if(has_filter("geodir_custom_field_output_phone_var_{$html_var}")){ |
|
340 | + if (has_filter("geodir_custom_field_output_phone_var_{$html_var}")) { |
|
341 | 341 | /** |
342 | 342 | * Filter the phone html by individual custom field. |
343 | 343 | * |
@@ -346,11 +346,11 @@ discard block |
||
346 | 346 | * @param array $cf The custom field array. |
347 | 347 | * @since 1.6.6 |
348 | 348 | */ |
349 | - $html = apply_filters("geodir_custom_field_output_phone_var_{$html_var}",$html,$location,$cf); |
|
349 | + $html = apply_filters("geodir_custom_field_output_phone_var_{$html_var}", $html, $location, $cf); |
|
350 | 350 | } |
351 | 351 | |
352 | 352 | // Check if there is a custom field key specific filter. |
353 | - if(has_filter("geodir_custom_field_output_phone_key_{$cf['field_type_key']}")){ |
|
353 | + if (has_filter("geodir_custom_field_output_phone_key_{$cf['field_type_key']}")) { |
|
354 | 354 | /** |
355 | 355 | * Filter the phone html by field type key. |
356 | 356 | * |
@@ -359,11 +359,11 @@ discard block |
||
359 | 359 | * @param array $cf The custom field array. |
360 | 360 | * @since 1.6.6 |
361 | 361 | */ |
362 | - $html = apply_filters("geodir_custom_field_output_phone_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
362 | + $html = apply_filters("geodir_custom_field_output_phone_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
363 | 363 | } |
364 | 364 | |
365 | 365 | // If not html then we run the standard output. |
366 | - if(empty($html)){ |
|
366 | + if (empty($html)) { |
|
367 | 367 | |
368 | 368 | if ($post->{$cf['htmlvar_name']}): |
369 | 369 | |
@@ -378,9 +378,9 @@ discard block |
||
378 | 378 | } |
379 | 379 | |
380 | 380 | |
381 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-contact" style="' . $field_icon . '">' . $field_icon_af . |
|
382 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ' '; |
|
383 | - $html .= '</span><a href="tel:' . preg_replace('/[^0-9+]/', '', $post->{$cf['htmlvar_name']}) . '">' . $post->{$cf['htmlvar_name']} . '</a></div>'; |
|
381 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-contact" style="'.$field_icon.'">'.$field_icon_af. |
|
382 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : ' '; |
|
383 | + $html .= '</span><a href="tel:'.preg_replace('/[^0-9+]/', '', $post->{$cf['htmlvar_name']}).'">'.$post->{$cf['htmlvar_name']}.'</a></div>'; |
|
384 | 384 | |
385 | 385 | endif; |
386 | 386 | |
@@ -388,7 +388,7 @@ discard block |
||
388 | 388 | |
389 | 389 | return $html; |
390 | 390 | } |
391 | -add_filter('geodir_custom_field_output_phone','geodir_cf_phone',10,3); |
|
391 | +add_filter('geodir_custom_field_output_phone', 'geodir_cf_phone', 10, 3); |
|
392 | 392 | |
393 | 393 | |
394 | 394 | /** |
@@ -401,21 +401,21 @@ discard block |
||
401 | 401 | * |
402 | 402 | * @return string The html to output for the custom field. |
403 | 403 | */ |
404 | -function geodir_cf_time($html,$location,$cf,$p=''){ |
|
404 | +function geodir_cf_time($html, $location, $cf, $p = '') { |
|
405 | 405 | |
406 | 406 | // check we have the post value |
407 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
408 | - else{ global $post;} |
|
407 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
408 | + else { global $post; } |
|
409 | 409 | |
410 | - if(!is_array($cf) && $cf!=''){ |
|
410 | + if (!is_array($cf) && $cf != '') { |
|
411 | 411 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
412 | - if(!$cf){return NULL;} |
|
412 | + if (!$cf) {return NULL; } |
|
413 | 413 | } |
414 | 414 | |
415 | 415 | $html_var = $cf['htmlvar_name']; |
416 | 416 | |
417 | 417 | // Check if there is a location specific filter. |
418 | - if(has_filter("geodir_custom_field_output_time_loc_{$location}")){ |
|
418 | + if (has_filter("geodir_custom_field_output_time_loc_{$location}")) { |
|
419 | 419 | /** |
420 | 420 | * Filter the time html by location. |
421 | 421 | * |
@@ -423,11 +423,11 @@ discard block |
||
423 | 423 | * @param array $cf The custom field array. |
424 | 424 | * @since 1.6.6 |
425 | 425 | */ |
426 | - $html = apply_filters("geodir_custom_field_output_time_loc_{$location}",$html,$cf); |
|
426 | + $html = apply_filters("geodir_custom_field_output_time_loc_{$location}", $html, $cf); |
|
427 | 427 | } |
428 | 428 | |
429 | 429 | // Check if there is a custom field specific filter. |
430 | - if(has_filter("geodir_custom_field_output_time_var_{$html_var}")){ |
|
430 | + if (has_filter("geodir_custom_field_output_time_var_{$html_var}")) { |
|
431 | 431 | /** |
432 | 432 | * Filter the time html by individual custom field. |
433 | 433 | * |
@@ -436,11 +436,11 @@ discard block |
||
436 | 436 | * @param array $cf The custom field array. |
437 | 437 | * @since 1.6.6 |
438 | 438 | */ |
439 | - $html = apply_filters("geodir_custom_field_output_time_var_{$html_var}",$html,$location,$cf); |
|
439 | + $html = apply_filters("geodir_custom_field_output_time_var_{$html_var}", $html, $location, $cf); |
|
440 | 440 | } |
441 | 441 | |
442 | 442 | // Check if there is a custom field key specific filter. |
443 | - if(has_filter("geodir_custom_field_output_time_key_{$cf['field_type_key']}")){ |
|
443 | + if (has_filter("geodir_custom_field_output_time_key_{$cf['field_type_key']}")) { |
|
444 | 444 | /** |
445 | 445 | * Filter the time html by field type key. |
446 | 446 | * |
@@ -449,11 +449,11 @@ discard block |
||
449 | 449 | * @param array $cf The custom field array. |
450 | 450 | * @since 1.6.6 |
451 | 451 | */ |
452 | - $html = apply_filters("geodir_custom_field_output_time_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
452 | + $html = apply_filters("geodir_custom_field_output_time_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
453 | 453 | } |
454 | 454 | |
455 | 455 | // If not html then we run the standard output. |
456 | - if(empty($html)){ |
|
456 | + if (empty($html)) { |
|
457 | 457 | |
458 | 458 | if ($post->{$cf['htmlvar_name']}): |
459 | 459 | |
@@ -473,9 +473,9 @@ discard block |
||
473 | 473 | } |
474 | 474 | |
475 | 475 | |
476 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-time" style="' . $field_icon . '">' . $field_icon_af; |
|
477 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ' '; |
|
478 | - $html .= '</span>' . $value . '</div>'; |
|
476 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-time" style="'.$field_icon.'">'.$field_icon_af; |
|
477 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : ' '; |
|
478 | + $html .= '</span>'.$value.'</div>'; |
|
479 | 479 | |
480 | 480 | endif; |
481 | 481 | |
@@ -483,7 +483,7 @@ discard block |
||
483 | 483 | |
484 | 484 | return $html; |
485 | 485 | } |
486 | -add_filter('geodir_custom_field_output_time','geodir_cf_time',10,3); |
|
486 | +add_filter('geodir_custom_field_output_time', 'geodir_cf_time', 10, 3); |
|
487 | 487 | |
488 | 488 | |
489 | 489 | /** |
@@ -496,21 +496,21 @@ discard block |
||
496 | 496 | * |
497 | 497 | * @return string The html to output for the custom field. |
498 | 498 | */ |
499 | -function geodir_cf_datepicker($html,$location,$cf,$p=''){ |
|
499 | +function geodir_cf_datepicker($html, $location, $cf, $p = '') { |
|
500 | 500 | |
501 | 501 | // check we have the post value |
502 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
503 | - else{ global $post;} |
|
502 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
503 | + else { global $post; } |
|
504 | 504 | |
505 | - if(!is_array($cf) && $cf!=''){ |
|
505 | + if (!is_array($cf) && $cf != '') { |
|
506 | 506 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
507 | - if(!$cf){return NULL;} |
|
507 | + if (!$cf) {return NULL; } |
|
508 | 508 | } |
509 | 509 | |
510 | 510 | $html_var = $cf['htmlvar_name']; |
511 | 511 | |
512 | 512 | // Check if there is a location specific filter. |
513 | - if(has_filter("geodir_custom_field_output_datepicker_loc_{$location}")){ |
|
513 | + if (has_filter("geodir_custom_field_output_datepicker_loc_{$location}")) { |
|
514 | 514 | /** |
515 | 515 | * Filter the datepicker html by location. |
516 | 516 | * |
@@ -518,11 +518,11 @@ discard block |
||
518 | 518 | * @param array $cf The custom field array. |
519 | 519 | * @since 1.6.6 |
520 | 520 | */ |
521 | - $html = apply_filters("geodir_custom_field_output_datepicker_loc_{$location}",$html,$cf); |
|
521 | + $html = apply_filters("geodir_custom_field_output_datepicker_loc_{$location}", $html, $cf); |
|
522 | 522 | } |
523 | 523 | |
524 | 524 | // Check if there is a custom field specific filter. |
525 | - if(has_filter("geodir_custom_field_output_datepicker_var_{$html_var}")){ |
|
525 | + if (has_filter("geodir_custom_field_output_datepicker_var_{$html_var}")) { |
|
526 | 526 | /** |
527 | 527 | * Filter the datepicker html by individual custom field. |
528 | 528 | * |
@@ -531,11 +531,11 @@ discard block |
||
531 | 531 | * @param array $cf The custom field array. |
532 | 532 | * @since 1.6.6 |
533 | 533 | */ |
534 | - $html = apply_filters("geodir_custom_field_output_datepicker_var_{$html_var}",$html,$location,$cf); |
|
534 | + $html = apply_filters("geodir_custom_field_output_datepicker_var_{$html_var}", $html, $location, $cf); |
|
535 | 535 | } |
536 | 536 | |
537 | 537 | // Check if there is a custom field key specific filter. |
538 | - if(has_filter("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}")){ |
|
538 | + if (has_filter("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}")) { |
|
539 | 539 | /** |
540 | 540 | * Filter the datepicker html by field type key. |
541 | 541 | * |
@@ -544,11 +544,11 @@ discard block |
||
544 | 544 | * @param array $cf The custom field array. |
545 | 545 | * @since 1.6.6 |
546 | 546 | */ |
547 | - $html = apply_filters("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
547 | + $html = apply_filters("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
548 | 548 | } |
549 | 549 | |
550 | 550 | // If not html then we run the standard output. |
551 | - if(empty($html)){ |
|
551 | + if (empty($html)) { |
|
552 | 552 | |
553 | 553 | if ($post->{$cf['htmlvar_name']}): |
554 | 554 | |
@@ -559,21 +559,21 @@ discard block |
||
559 | 559 | } |
560 | 560 | // check if we need to change the format or not |
561 | 561 | $date_format_len = strlen(str_replace(' ', '', $date_format)); |
562 | - if($date_format_len>5){// if greater then 4 then it's the old style format. |
|
562 | + if ($date_format_len > 5) {// if greater then 4 then it's the old style format. |
|
563 | 563 | |
564 | - $search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format |
|
565 | - $replace = array('d','j','l','m','n','F','Y');//PHP date format |
|
564 | + $search = array('dd', 'd', 'DD', 'mm', 'm', 'MM', 'yy'); //jQuery UI datepicker format |
|
565 | + $replace = array('d', 'j', 'l', 'm', 'n', 'F', 'Y'); //PHP date format |
|
566 | 566 | |
567 | 567 | $date_format = str_replace($search, $replace, $date_format); |
568 | 568 | |
569 | - $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 |
|
570 | - }else{ |
|
569 | + $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 |
|
570 | + } else { |
|
571 | 571 | $post_htmlvar_value = $post->{$cf['htmlvar_name']}; |
572 | 572 | } |
573 | 573 | |
574 | - if ($post->{$cf['htmlvar_name']} != '' && $post->{$cf['htmlvar_name']}!="0000-00-00") { |
|
574 | + if ($post->{$cf['htmlvar_name']} != '' && $post->{$cf['htmlvar_name']} != "0000-00-00") { |
|
575 | 575 | $value = date_i18n($date_format, strtotime($post_htmlvar_value)); |
576 | - }else{ |
|
576 | + } else { |
|
577 | 577 | return ''; |
578 | 578 | } |
579 | 579 | |
@@ -590,9 +590,9 @@ discard block |
||
590 | 590 | |
591 | 591 | |
592 | 592 | |
593 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-datepicker" style="' . $field_icon . '">' . $field_icon_af; |
|
594 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
595 | - $html .= '</span>' . $value . '</div>'; |
|
593 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-datepicker" style="'.$field_icon.'">'.$field_icon_af; |
|
594 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : ''; |
|
595 | + $html .= '</span>'.$value.'</div>'; |
|
596 | 596 | |
597 | 597 | endif; |
598 | 598 | |
@@ -600,7 +600,7 @@ discard block |
||
600 | 600 | |
601 | 601 | return $html; |
602 | 602 | } |
603 | -add_filter('geodir_custom_field_output_datepicker','geodir_cf_datepicker',10,3); |
|
603 | +add_filter('geodir_custom_field_output_datepicker', 'geodir_cf_datepicker', 10, 3); |
|
604 | 604 | |
605 | 605 | |
606 | 606 | /** |
@@ -613,21 +613,21 @@ discard block |
||
613 | 613 | * |
614 | 614 | * @return string The html to output for the custom field. |
615 | 615 | */ |
616 | -function geodir_cf_text($html,$location,$cf,$p=''){ |
|
616 | +function geodir_cf_text($html, $location, $cf, $p = '') { |
|
617 | 617 | |
618 | 618 | // check we have the post value |
619 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
620 | - else{ global $post;} |
|
619 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
620 | + else { global $post; } |
|
621 | 621 | |
622 | - if(!is_array($cf) && $cf!=''){ |
|
622 | + if (!is_array($cf) && $cf != '') { |
|
623 | 623 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
624 | - if(!$cf){return NULL;} |
|
624 | + if (!$cf) {return NULL; } |
|
625 | 625 | } |
626 | 626 | |
627 | 627 | $html_var = $cf['htmlvar_name']; |
628 | 628 | |
629 | 629 | // Check if there is a location specific filter. |
630 | - if(has_filter("geodir_custom_field_output_text_loc_{$location}")){ |
|
630 | + if (has_filter("geodir_custom_field_output_text_loc_{$location}")) { |
|
631 | 631 | /** |
632 | 632 | * Filter the text html by location. |
633 | 633 | * |
@@ -635,11 +635,11 @@ discard block |
||
635 | 635 | * @param array $cf The custom field array. |
636 | 636 | * @since 1.6.6 |
637 | 637 | */ |
638 | - $html = apply_filters("geodir_custom_field_output_text_loc_{$location}",$html,$cf); |
|
638 | + $html = apply_filters("geodir_custom_field_output_text_loc_{$location}", $html, $cf); |
|
639 | 639 | } |
640 | 640 | |
641 | 641 | // Check if there is a custom field specific filter. |
642 | - if(has_filter("geodir_custom_field_output_text_var_{$html_var}")){ |
|
642 | + if (has_filter("geodir_custom_field_output_text_var_{$html_var}")) { |
|
643 | 643 | /** |
644 | 644 | * Filter the text html by individual custom field. |
645 | 645 | * |
@@ -648,11 +648,11 @@ discard block |
||
648 | 648 | * @param array $cf The custom field array. |
649 | 649 | * @since 1.6.6 |
650 | 650 | */ |
651 | - $html = apply_filters("geodir_custom_field_output_text_var_{$html_var}",$html,$location,$cf); |
|
651 | + $html = apply_filters("geodir_custom_field_output_text_var_{$html_var}", $html, $location, $cf); |
|
652 | 652 | } |
653 | 653 | |
654 | 654 | // Check if there is a custom field key specific filter. |
655 | - if(has_filter("geodir_custom_field_output_text_key_{$cf['field_type_key']}")){ |
|
655 | + if (has_filter("geodir_custom_field_output_text_key_{$cf['field_type_key']}")) { |
|
656 | 656 | /** |
657 | 657 | * Filter the text html by field type key. |
658 | 658 | * |
@@ -661,15 +661,15 @@ discard block |
||
661 | 661 | * @param array $cf The custom field array. |
662 | 662 | * @since 1.6.6 |
663 | 663 | */ |
664 | - $html = apply_filters("geodir_custom_field_output_text_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
664 | + $html = apply_filters("geodir_custom_field_output_text_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
665 | 665 | } |
666 | 666 | |
667 | 667 | |
668 | 668 | |
669 | 669 | // If not html then we run the standard output. |
670 | - if(empty($html)){ |
|
670 | + if (empty($html)) { |
|
671 | 671 | |
672 | - if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != '' ): |
|
672 | + if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != ''): |
|
673 | 673 | |
674 | 674 | $class = ($cf['htmlvar_name'] == 'geodir_timing') ? "geodir-i-time" : "geodir-i-text"; |
675 | 675 | |
@@ -684,9 +684,9 @@ discard block |
||
684 | 684 | } |
685 | 685 | |
686 | 686 | |
687 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="'.$class.'" style="' . $field_icon . '">' . $field_icon_af; |
|
688 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
689 | - $html .= '</span>' . $post->{$cf['htmlvar_name']} . '</div>'; |
|
687 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="'.$class.'" style="'.$field_icon.'">'.$field_icon_af; |
|
688 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : ''; |
|
689 | + $html .= '</span>'.$post->{$cf['htmlvar_name']}.'</div>'; |
|
690 | 690 | |
691 | 691 | endif; |
692 | 692 | |
@@ -694,7 +694,7 @@ discard block |
||
694 | 694 | |
695 | 695 | return $html; |
696 | 696 | } |
697 | -add_filter('geodir_custom_field_output_text','geodir_cf_text',10,3); |
|
697 | +add_filter('geodir_custom_field_output_text', 'geodir_cf_text', 10, 3); |
|
698 | 698 | |
699 | 699 | |
700 | 700 | /** |
@@ -707,21 +707,21 @@ discard block |
||
707 | 707 | * |
708 | 708 | * @return string The html to output for the custom field. |
709 | 709 | */ |
710 | -function geodir_cf_radio($html,$location,$cf,$p=''){ |
|
710 | +function geodir_cf_radio($html, $location, $cf, $p = '') { |
|
711 | 711 | |
712 | 712 | // check we have the post value |
713 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
714 | - else{ global $post;} |
|
713 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
714 | + else { global $post; } |
|
715 | 715 | |
716 | - if(!is_array($cf) && $cf!=''){ |
|
716 | + if (!is_array($cf) && $cf != '') { |
|
717 | 717 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
718 | - if(!$cf){return NULL;} |
|
718 | + if (!$cf) {return NULL; } |
|
719 | 719 | } |
720 | 720 | |
721 | 721 | $html_var = $cf['htmlvar_name']; |
722 | 722 | |
723 | 723 | // Check if there is a location specific filter. |
724 | - if(has_filter("geodir_custom_field_output_radio_loc_{$location}")){ |
|
724 | + if (has_filter("geodir_custom_field_output_radio_loc_{$location}")) { |
|
725 | 725 | /** |
726 | 726 | * Filter the radio html by location. |
727 | 727 | * |
@@ -729,11 +729,11 @@ discard block |
||
729 | 729 | * @param array $cf The custom field array. |
730 | 730 | * @since 1.6.6 |
731 | 731 | */ |
732 | - $html = apply_filters("geodir_custom_field_output_radio_loc_{$location}",$html,$cf); |
|
732 | + $html = apply_filters("geodir_custom_field_output_radio_loc_{$location}", $html, $cf); |
|
733 | 733 | } |
734 | 734 | |
735 | 735 | // Check if there is a custom field specific filter. |
736 | - if(has_filter("geodir_custom_field_output_radio_var_{$html_var}")){ |
|
736 | + if (has_filter("geodir_custom_field_output_radio_var_{$html_var}")) { |
|
737 | 737 | /** |
738 | 738 | * Filter the radio html by individual custom field. |
739 | 739 | * |
@@ -742,11 +742,11 @@ discard block |
||
742 | 742 | * @param array $cf The custom field array. |
743 | 743 | * @since 1.6.6 |
744 | 744 | */ |
745 | - $html = apply_filters("geodir_custom_field_output_radio_var_{$html_var}",$html,$location,$cf); |
|
745 | + $html = apply_filters("geodir_custom_field_output_radio_var_{$html_var}", $html, $location, $cf); |
|
746 | 746 | } |
747 | 747 | |
748 | 748 | // Check if there is a custom field key specific filter. |
749 | - if(has_filter("geodir_custom_field_output_radio_key_{$cf['field_type_key']}")){ |
|
749 | + if (has_filter("geodir_custom_field_output_radio_key_{$cf['field_type_key']}")) { |
|
750 | 750 | /** |
751 | 751 | * Filter the radio html by field type key. |
752 | 752 | * |
@@ -755,11 +755,11 @@ discard block |
||
755 | 755 | * @param array $cf The custom field array. |
756 | 756 | * @since 1.6.6 |
757 | 757 | */ |
758 | - $html = apply_filters("geodir_custom_field_output_radio_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
758 | + $html = apply_filters("geodir_custom_field_output_radio_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
759 | 759 | } |
760 | 760 | |
761 | 761 | // If not html then we run the standard output. |
762 | - if(empty($html)){ |
|
762 | + if (empty($html)) { |
|
763 | 763 | |
764 | 764 | $html_val = __($post->{$cf['htmlvar_name']}, 'geodirectory'); |
765 | 765 | if ($post->{$cf['htmlvar_name']} != ''): |
@@ -793,16 +793,16 @@ discard block |
||
793 | 793 | } |
794 | 794 | |
795 | 795 | |
796 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-radio" style="' . $field_icon . '">' . $field_icon_af; |
|
797 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
798 | - $html .= '</span>' . $html_val . '</div>'; |
|
796 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-radio" style="'.$field_icon.'">'.$field_icon_af; |
|
797 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : ''; |
|
798 | + $html .= '</span>'.$html_val.'</div>'; |
|
799 | 799 | endif; |
800 | 800 | |
801 | 801 | } |
802 | 802 | |
803 | 803 | return $html; |
804 | 804 | } |
805 | -add_filter('geodir_custom_field_output_radio','geodir_cf_radio',10,3); |
|
805 | +add_filter('geodir_custom_field_output_radio', 'geodir_cf_radio', 10, 3); |
|
806 | 806 | |
807 | 807 | |
808 | 808 | /** |
@@ -815,21 +815,21 @@ discard block |
||
815 | 815 | * |
816 | 816 | * @return string The html to output for the custom field. |
817 | 817 | */ |
818 | -function geodir_cf_select($html,$location,$cf,$p=''){ |
|
818 | +function geodir_cf_select($html, $location, $cf, $p = '') { |
|
819 | 819 | |
820 | 820 | // check we have the post value |
821 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
822 | - else{ global $post;} |
|
821 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
822 | + else { global $post; } |
|
823 | 823 | |
824 | - if(!is_array($cf) && $cf!=''){ |
|
824 | + if (!is_array($cf) && $cf != '') { |
|
825 | 825 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
826 | - if(!$cf){return NULL;} |
|
826 | + if (!$cf) {return NULL; } |
|
827 | 827 | } |
828 | 828 | |
829 | 829 | $html_var = $cf['htmlvar_name']; |
830 | 830 | |
831 | 831 | // Check if there is a location specific filter. |
832 | - if(has_filter("geodir_custom_field_output_select_loc_{$location}")){ |
|
832 | + if (has_filter("geodir_custom_field_output_select_loc_{$location}")) { |
|
833 | 833 | /** |
834 | 834 | * Filter the select html by location. |
835 | 835 | * |
@@ -837,11 +837,11 @@ discard block |
||
837 | 837 | * @param array $cf The custom field array. |
838 | 838 | * @since 1.6.6 |
839 | 839 | */ |
840 | - $html = apply_filters("geodir_custom_field_output_select_loc_{$location}",$html,$cf); |
|
840 | + $html = apply_filters("geodir_custom_field_output_select_loc_{$location}", $html, $cf); |
|
841 | 841 | } |
842 | 842 | |
843 | 843 | // Check if there is a custom field specific filter. |
844 | - if(has_filter("geodir_custom_field_output_select_var_{$html_var}")){ |
|
844 | + if (has_filter("geodir_custom_field_output_select_var_{$html_var}")) { |
|
845 | 845 | /** |
846 | 846 | * Filter the select html by individual custom field. |
847 | 847 | * |
@@ -850,11 +850,11 @@ discard block |
||
850 | 850 | * @param array $cf The custom field array. |
851 | 851 | * @since 1.6.6 |
852 | 852 | */ |
853 | - $html = apply_filters("geodir_custom_field_output_select_var_{$html_var}",$html,$location,$cf); |
|
853 | + $html = apply_filters("geodir_custom_field_output_select_var_{$html_var}", $html, $location, $cf); |
|
854 | 854 | } |
855 | 855 | |
856 | 856 | // Check if there is a custom field key specific filter. |
857 | - if(has_filter("geodir_custom_field_output_select_key_{$cf['field_type_key']}")){ |
|
857 | + if (has_filter("geodir_custom_field_output_select_key_{$cf['field_type_key']}")) { |
|
858 | 858 | /** |
859 | 859 | * Filter the select html by field type key. |
860 | 860 | * |
@@ -863,11 +863,11 @@ discard block |
||
863 | 863 | * @param array $cf The custom field array. |
864 | 864 | * @since 1.6.6 |
865 | 865 | */ |
866 | - $html = apply_filters("geodir_custom_field_output_select_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
866 | + $html = apply_filters("geodir_custom_field_output_select_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
867 | 867 | } |
868 | 868 | |
869 | 869 | // If not html then we run the standard output. |
870 | - if(empty($html)){ |
|
870 | + if (empty($html)) { |
|
871 | 871 | |
872 | 872 | if ($post->{$cf['htmlvar_name']}): |
873 | 873 | $field_value = __($post->{$cf['htmlvar_name']}, 'geodirectory'); |
@@ -895,16 +895,16 @@ discard block |
||
895 | 895 | } |
896 | 896 | |
897 | 897 | |
898 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af; |
|
899 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
900 | - $html .= '</span>' . $field_value . '</div>'; |
|
898 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-select" style="'.$field_icon.'">'.$field_icon_af; |
|
899 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : ''; |
|
900 | + $html .= '</span>'.$field_value.'</div>'; |
|
901 | 901 | endif; |
902 | 902 | |
903 | 903 | } |
904 | 904 | |
905 | 905 | return $html; |
906 | 906 | } |
907 | -add_filter('geodir_custom_field_output_select','geodir_cf_select',10,3); |
|
907 | +add_filter('geodir_custom_field_output_select', 'geodir_cf_select', 10, 3); |
|
908 | 908 | |
909 | 909 | |
910 | 910 | /** |
@@ -917,21 +917,21 @@ discard block |
||
917 | 917 | * |
918 | 918 | * @return string The html to output for the custom field. |
919 | 919 | */ |
920 | -function geodir_cf_multiselect($html,$location,$cf,$p=''){ |
|
920 | +function geodir_cf_multiselect($html, $location, $cf, $p = '') { |
|
921 | 921 | |
922 | 922 | // check we have the post value |
923 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
924 | - else{ global $post;} |
|
923 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
924 | + else { global $post; } |
|
925 | 925 | |
926 | - if(!is_array($cf) && $cf!=''){ |
|
926 | + if (!is_array($cf) && $cf != '') { |
|
927 | 927 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
928 | - if(!$cf){return NULL;} |
|
928 | + if (!$cf) {return NULL; } |
|
929 | 929 | } |
930 | 930 | |
931 | 931 | $html_var = $cf['htmlvar_name']; |
932 | 932 | |
933 | 933 | // Check if there is a location specific filter. |
934 | - if(has_filter("geodir_custom_field_output_multiselect_loc_{$location}")){ |
|
934 | + if (has_filter("geodir_custom_field_output_multiselect_loc_{$location}")) { |
|
935 | 935 | /** |
936 | 936 | * Filter the multiselect html by location. |
937 | 937 | * |
@@ -939,11 +939,11 @@ discard block |
||
939 | 939 | * @param array $cf The custom field array. |
940 | 940 | * @since 1.6.6 |
941 | 941 | */ |
942 | - $html = apply_filters("geodir_custom_field_output_multiselect_loc_{$location}",$html,$cf); |
|
942 | + $html = apply_filters("geodir_custom_field_output_multiselect_loc_{$location}", $html, $cf); |
|
943 | 943 | } |
944 | 944 | |
945 | 945 | // Check if there is a custom field specific filter. |
946 | - if(has_filter("geodir_custom_field_output_multiselect_var_{$html_var}")){ |
|
946 | + if (has_filter("geodir_custom_field_output_multiselect_var_{$html_var}")) { |
|
947 | 947 | /** |
948 | 948 | * Filter the multiselect html by individual custom field. |
949 | 949 | * |
@@ -952,11 +952,11 @@ discard block |
||
952 | 952 | * @param array $cf The custom field array. |
953 | 953 | * @since 1.6.6 |
954 | 954 | */ |
955 | - $html = apply_filters("geodir_custom_field_output_multiselect_var_{$html_var}",$html,$location,$cf); |
|
955 | + $html = apply_filters("geodir_custom_field_output_multiselect_var_{$html_var}", $html, $location, $cf); |
|
956 | 956 | } |
957 | 957 | |
958 | 958 | // Check if there is a custom field key specific filter. |
959 | - if(has_filter("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}")){ |
|
959 | + if (has_filter("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}")) { |
|
960 | 960 | /** |
961 | 961 | * Filter the multiselect html by field type key. |
962 | 962 | * |
@@ -965,11 +965,11 @@ discard block |
||
965 | 965 | * @param array $cf The custom field array. |
966 | 966 | * @since 1.6.6 |
967 | 967 | */ |
968 | - $html = apply_filters("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
968 | + $html = apply_filters("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
969 | 969 | } |
970 | 970 | |
971 | 971 | // If not html then we run the standard output. |
972 | - if(empty($html)){ |
|
972 | + if (empty($html)) { |
|
973 | 973 | |
974 | 974 | |
975 | 975 | if (!empty($post->{$cf['htmlvar_name']})): |
@@ -1004,15 +1004,15 @@ discard block |
||
1004 | 1004 | } |
1005 | 1005 | |
1006 | 1006 | |
1007 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af; |
|
1008 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
1007 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-select" style="'.$field_icon.'">'.$field_icon_af; |
|
1008 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : ''; |
|
1009 | 1009 | $html .= '</span>'; |
1010 | 1010 | |
1011 | 1011 | if (count($option_values) > 1) { |
1012 | 1012 | $html .= '<ul>'; |
1013 | 1013 | |
1014 | 1014 | foreach ($option_values as $val) { |
1015 | - $html .= '<li>' . $val . '</li>'; |
|
1015 | + $html .= '<li>'.$val.'</li>'; |
|
1016 | 1016 | } |
1017 | 1017 | |
1018 | 1018 | $html .= '</ul>'; |
@@ -1027,7 +1027,7 @@ discard block |
||
1027 | 1027 | |
1028 | 1028 | return $html; |
1029 | 1029 | } |
1030 | -add_filter('geodir_custom_field_output_multiselect','geodir_cf_multiselect',10,3); |
|
1030 | +add_filter('geodir_custom_field_output_multiselect', 'geodir_cf_multiselect', 10, 3); |
|
1031 | 1031 | |
1032 | 1032 | |
1033 | 1033 | /** |
@@ -1040,21 +1040,21 @@ discard block |
||
1040 | 1040 | * |
1041 | 1041 | * @return string The html to output for the custom field. |
1042 | 1042 | */ |
1043 | -function geodir_cf_email($html,$location,$cf,$p=''){ |
|
1043 | +function geodir_cf_email($html, $location, $cf, $p = '') { |
|
1044 | 1044 | |
1045 | 1045 | // check we have the post value |
1046 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
1047 | - else{ global $post;} |
|
1046 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
1047 | + else { global $post; } |
|
1048 | 1048 | |
1049 | - if(!is_array($cf) && $cf!=''){ |
|
1049 | + if (!is_array($cf) && $cf != '') { |
|
1050 | 1050 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
1051 | - if(!$cf){return NULL;} |
|
1051 | + if (!$cf) {return NULL; } |
|
1052 | 1052 | } |
1053 | 1053 | |
1054 | 1054 | $html_var = $cf['htmlvar_name']; |
1055 | 1055 | |
1056 | 1056 | // Check if there is a location specific filter. |
1057 | - if(has_filter("geodir_custom_field_output_email_loc_{$location}")){ |
|
1057 | + if (has_filter("geodir_custom_field_output_email_loc_{$location}")) { |
|
1058 | 1058 | /** |
1059 | 1059 | * Filter the email html by location. |
1060 | 1060 | * |
@@ -1062,11 +1062,11 @@ discard block |
||
1062 | 1062 | * @param array $cf The custom field array. |
1063 | 1063 | * @since 1.6.6 |
1064 | 1064 | */ |
1065 | - $html = apply_filters("geodir_custom_field_output_email_loc_{$location}",$html,$cf); |
|
1065 | + $html = apply_filters("geodir_custom_field_output_email_loc_{$location}", $html, $cf); |
|
1066 | 1066 | } |
1067 | 1067 | |
1068 | 1068 | // Check if there is a custom field specific filter. |
1069 | - if(has_filter("geodir_custom_field_output_email_var_{$html_var}")){ |
|
1069 | + if (has_filter("geodir_custom_field_output_email_var_{$html_var}")) { |
|
1070 | 1070 | /** |
1071 | 1071 | * Filter the email html by individual custom field. |
1072 | 1072 | * |
@@ -1075,11 +1075,11 @@ discard block |
||
1075 | 1075 | * @param array $cf The custom field array. |
1076 | 1076 | * @since 1.6.6 |
1077 | 1077 | */ |
1078 | - $html = apply_filters("geodir_custom_field_output_email_var_{$html_var}",$html,$location,$cf); |
|
1078 | + $html = apply_filters("geodir_custom_field_output_email_var_{$html_var}", $html, $location, $cf); |
|
1079 | 1079 | } |
1080 | 1080 | |
1081 | 1081 | // Check if there is a custom field key specific filter. |
1082 | - if(has_filter("geodir_custom_field_output_email_key_{$cf['field_type_key']}")){ |
|
1082 | + if (has_filter("geodir_custom_field_output_email_key_{$cf['field_type_key']}")) { |
|
1083 | 1083 | /** |
1084 | 1084 | * Filter the email html by field type key. |
1085 | 1085 | * |
@@ -1088,18 +1088,18 @@ discard block |
||
1088 | 1088 | * @param array $cf The custom field array. |
1089 | 1089 | * @since 1.6.6 |
1090 | 1090 | */ |
1091 | - $html = apply_filters("geodir_custom_field_output_email_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
1091 | + $html = apply_filters("geodir_custom_field_output_email_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
1092 | 1092 | } |
1093 | 1093 | |
1094 | 1094 | // If not html then we run the standard output. |
1095 | - if(empty($html)){ |
|
1095 | + if (empty($html)) { |
|
1096 | 1096 | |
1097 | 1097 | global $preview; |
1098 | 1098 | if ($cf['htmlvar_name'] == 'geodir_email' && !(geodir_is_page('detail') || geodir_is_page('preview'))) { |
1099 | 1099 | return ''; // Remove Send Enquiry | Send To Friend from listings page |
1100 | 1100 | } |
1101 | 1101 | |
1102 | - $package_info = (array)geodir_post_package_info(array(), $post, $post->post_type); |
|
1102 | + $package_info = (array) geodir_post_package_info(array(), $post, $post->post_type); |
|
1103 | 1103 | |
1104 | 1104 | if ($cf['htmlvar_name'] == 'geodir_email' && ((isset($package_info->sendtofriend) && $package_info->sendtofriend) || $post->{$cf['htmlvar_name']})) { |
1105 | 1105 | $send_to_friend = true; |
@@ -1110,7 +1110,7 @@ discard block |
||
1110 | 1110 | if (!$preview) { |
1111 | 1111 | $b_send_inquiry = 'b_send_inquiry'; |
1112 | 1112 | $b_sendtofriend = 'b_sendtofriend'; |
1113 | - $html = '<input type="hidden" name="geodir_popup_post_id" value="' . $post->ID . '" /><div class="geodir_display_popup_forms"></div>'; |
|
1113 | + $html = '<input type="hidden" name="geodir_popup_post_id" value="'.$post->ID.'" /><div class="geodir_display_popup_forms"></div>'; |
|
1114 | 1114 | } |
1115 | 1115 | |
1116 | 1116 | $field_icon = geodir_field_icon_proccess($cf); |
@@ -1124,26 +1124,26 @@ discard block |
||
1124 | 1124 | } |
1125 | 1125 | |
1126 | 1126 | |
1127 | - $html .= '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af; |
|
1127 | + $html .= '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'"><span class="geodir-i-email" style="'.$field_icon.'">'.$field_icon_af; |
|
1128 | 1128 | $seperator = ''; |
1129 | 1129 | if ($post->{$cf['htmlvar_name']}) { |
1130 | - $html .= '<a href="javascript:void(0);" class="' . $b_send_inquiry . '" >' . SEND_INQUIRY . '</a>'; |
|
1130 | + $html .= '<a href="javascript:void(0);" class="'.$b_send_inquiry.'" >'.SEND_INQUIRY.'</a>'; |
|
1131 | 1131 | $seperator = ' | '; |
1132 | 1132 | } |
1133 | 1133 | |
1134 | 1134 | if (isset($package_info->sendtofriend) && $package_info->sendtofriend) { |
1135 | - $html .= $seperator . '<a href="javascript:void(0);" class="' . $b_sendtofriend . '">' . SEND_TO_FRIEND . '</a>'; |
|
1135 | + $html .= $seperator.'<a href="javascript:void(0);" class="'.$b_sendtofriend.'">'.SEND_TO_FRIEND.'</a>'; |
|
1136 | 1136 | } |
1137 | 1137 | |
1138 | 1138 | $html .= '</span></div>'; |
1139 | 1139 | |
1140 | 1140 | |
1141 | 1141 | if (isset($_REQUEST['send_inquiry']) && $_REQUEST['send_inquiry'] == 'success') { |
1142 | - $html .= '<p class="sucess_msg">' . SEND_INQUIRY_SUCCESS . '</p>'; |
|
1142 | + $html .= '<p class="sucess_msg">'.SEND_INQUIRY_SUCCESS.'</p>'; |
|
1143 | 1143 | } elseif (isset($_REQUEST['sendtofrnd']) && $_REQUEST['sendtofrnd'] == 'success') { |
1144 | - $html .= '<p class="sucess_msg">' . SEND_FRIEND_SUCCESS . '</p>'; |
|
1144 | + $html .= '<p class="sucess_msg">'.SEND_FRIEND_SUCCESS.'</p>'; |
|
1145 | 1145 | } elseif (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 'captch') { |
1146 | - $html .= '<p class="error_msg_fix">' . WRONG_CAPTCH_MSG . '</p>'; |
|
1146 | + $html .= '<p class="error_msg_fix">'.WRONG_CAPTCH_MSG.'</p>'; |
|
1147 | 1147 | } |
1148 | 1148 | |
1149 | 1149 | /*if(!$preview){require_once (geodir_plugin_path().'/geodirectory-templates/popup-forms.php');}*/ |
@@ -1163,11 +1163,11 @@ discard block |
||
1163 | 1163 | } |
1164 | 1164 | |
1165 | 1165 | |
1166 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af; |
|
1167 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
1166 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-email" style="'.$field_icon.'">'.$field_icon_af; |
|
1167 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : ''; |
|
1168 | 1168 | $html .= '</span><span class="geodir-email-address-output">'; |
1169 | 1169 | $email = $post->{$cf['htmlvar_name']} ; |
1170 | - if($e_split = explode('@',$email)){ |
|
1170 | + if ($e_split = explode('@', $email)) { |
|
1171 | 1171 | /** |
1172 | 1172 | * Filter email custom field name output. |
1173 | 1173 | * |
@@ -1176,10 +1176,10 @@ discard block |
||
1176 | 1176 | * @param string $email The email string being output. |
1177 | 1177 | * @param array $cf Custom field variables array. |
1178 | 1178 | */ |
1179 | - $email_name = apply_filters('geodir_email_field_name_output',$email,$cf); |
|
1180 | - $html .= "<script>document.write('<a href=\"mailto:'+'$e_split[0]' + '@' + '$e_split[1]'+'\">$email_name</a>')</script>"; |
|
1181 | - }else{ |
|
1182 | - $html .= $email; |
|
1179 | + $email_name = apply_filters('geodir_email_field_name_output', $email, $cf); |
|
1180 | + $html .= "<script>document.write('<a href=\"mailto:'+'$e_split[0]' + '@' + '$e_split[1]'+'\">$email_name</a>')</script>"; |
|
1181 | + } else { |
|
1182 | + $html .= $email; |
|
1183 | 1183 | } |
1184 | 1184 | $html .= '</span></div>'; |
1185 | 1185 | } |
@@ -1190,7 +1190,7 @@ discard block |
||
1190 | 1190 | |
1191 | 1191 | return $html; |
1192 | 1192 | } |
1193 | -add_filter('geodir_custom_field_output_email','geodir_cf_email',10,3); |
|
1193 | +add_filter('geodir_custom_field_output_email', 'geodir_cf_email', 10, 3); |
|
1194 | 1194 | |
1195 | 1195 | |
1196 | 1196 | /** |
@@ -1203,21 +1203,21 @@ discard block |
||
1203 | 1203 | * |
1204 | 1204 | * @return string The html to output for the custom field. |
1205 | 1205 | */ |
1206 | -function geodir_cf_file($html,$location,$cf,$p=''){ |
|
1206 | +function geodir_cf_file($html, $location, $cf, $p = '') { |
|
1207 | 1207 | |
1208 | 1208 | // check we have the post value |
1209 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
1210 | - else{ global $post;} |
|
1209 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
1210 | + else { global $post; } |
|
1211 | 1211 | |
1212 | - if(!is_array($cf) && $cf!=''){ |
|
1212 | + if (!is_array($cf) && $cf != '') { |
|
1213 | 1213 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
1214 | - if(!$cf){return NULL;} |
|
1214 | + if (!$cf) {return NULL; } |
|
1215 | 1215 | } |
1216 | 1216 | |
1217 | 1217 | $html_var = $cf['htmlvar_name']; |
1218 | 1218 | |
1219 | 1219 | // Check if there is a location specific filter. |
1220 | - if(has_filter("geodir_custom_field_output_file_loc_{$location}")){ |
|
1220 | + if (has_filter("geodir_custom_field_output_file_loc_{$location}")) { |
|
1221 | 1221 | /** |
1222 | 1222 | * Filter the file html by location. |
1223 | 1223 | * |
@@ -1225,11 +1225,11 @@ discard block |
||
1225 | 1225 | * @param array $cf The custom field array. |
1226 | 1226 | * @since 1.6.6 |
1227 | 1227 | */ |
1228 | - $html = apply_filters("geodir_custom_field_output_file_loc_{$location}",$html,$cf); |
|
1228 | + $html = apply_filters("geodir_custom_field_output_file_loc_{$location}", $html, $cf); |
|
1229 | 1229 | } |
1230 | 1230 | |
1231 | 1231 | // Check if there is a custom field specific filter. |
1232 | - if(has_filter("geodir_custom_field_output_file_var_{$html_var}")){ |
|
1232 | + if (has_filter("geodir_custom_field_output_file_var_{$html_var}")) { |
|
1233 | 1233 | /** |
1234 | 1234 | * Filter the file html by individual custom field. |
1235 | 1235 | * |
@@ -1238,11 +1238,11 @@ discard block |
||
1238 | 1238 | * @param array $cf The custom field array. |
1239 | 1239 | * @since 1.6.6 |
1240 | 1240 | */ |
1241 | - $html = apply_filters("geodir_custom_field_output_file_var_{$html_var}",$html,$location,$cf); |
|
1241 | + $html = apply_filters("geodir_custom_field_output_file_var_{$html_var}", $html, $location, $cf); |
|
1242 | 1242 | } |
1243 | 1243 | |
1244 | 1244 | // Check if there is a custom field key specific filter. |
1245 | - if(has_filter("geodir_custom_field_output_file_key_{$cf['field_type_key']}")){ |
|
1245 | + if (has_filter("geodir_custom_field_output_file_key_{$cf['field_type_key']}")) { |
|
1246 | 1246 | /** |
1247 | 1247 | * Filter the file html by field type key. |
1248 | 1248 | * |
@@ -1251,11 +1251,11 @@ discard block |
||
1251 | 1251 | * @param array $cf The custom field array. |
1252 | 1252 | * @since 1.6.6 |
1253 | 1253 | */ |
1254 | - $html = apply_filters("geodir_custom_field_output_file_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
1254 | + $html = apply_filters("geodir_custom_field_output_file_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
1255 | 1255 | } |
1256 | 1256 | |
1257 | 1257 | // If not html then we run the standard output. |
1258 | - if(empty($html)){ |
|
1258 | + if (empty($html)) { |
|
1259 | 1259 | |
1260 | 1260 | if (!empty($post->{$cf['htmlvar_name']})): |
1261 | 1261 | |
@@ -1263,7 +1263,7 @@ discard block |
||
1263 | 1263 | if (!empty($files)): |
1264 | 1264 | |
1265 | 1265 | $extra_fields = !empty($cf['extra_fields']) ? maybe_unserialize($cf['extra_fields']) : NULL; |
1266 | - $allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types'] ) ? $extra_fields['gd_file_types'] : ''; |
|
1266 | + $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'] : ''; |
|
1267 | 1267 | |
1268 | 1268 | $file_paths = ''; |
1269 | 1269 | foreach ($files as $file) { |
@@ -1300,9 +1300,9 @@ discard block |
||
1300 | 1300 | //$file_paths .= '<img src="'.$file.'" />'; |
1301 | 1301 | $file_paths .= '</div>'; |
1302 | 1302 | } else { |
1303 | - $ext_path = '_' . $html_var . '_'; |
|
1303 | + $ext_path = '_'.$html_var.'_'; |
|
1304 | 1304 | $filename = explode($ext_path, $filename); |
1305 | - $file_paths .= '<a href="' . $file . '" target="_blank">' . $filename[count($filename) - 1] . '</a>'; |
|
1305 | + $file_paths .= '<a href="'.$file.'" target="_blank">'.$filename[count($filename) - 1].'</a>'; |
|
1306 | 1306 | } |
1307 | 1307 | } |
1308 | 1308 | } |
@@ -1317,11 +1317,11 @@ discard block |
||
1317 | 1317 | $field_icon = ''; |
1318 | 1318 | } |
1319 | 1319 | |
1320 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' geodir-custom-file-box ' . $cf['htmlvar_name'] . '"><div class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af; |
|
1320 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' geodir-custom-file-box '.$cf['htmlvar_name'].'"><div class="geodir-i-select" style="'.$field_icon.'">'.$field_icon_af; |
|
1321 | 1321 | $html .= '<span style="display: inline-block; vertical-align: top; padding-right: 14px;">'; |
1322 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
1322 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : ''; |
|
1323 | 1323 | $html .= '</span>'; |
1324 | - $html .= $file_paths . '</div></div>'; |
|
1324 | + $html .= $file_paths.'</div></div>'; |
|
1325 | 1325 | |
1326 | 1326 | endif; |
1327 | 1327 | endif; |
@@ -1330,7 +1330,7 @@ discard block |
||
1330 | 1330 | |
1331 | 1331 | return $html; |
1332 | 1332 | } |
1333 | -add_filter('geodir_custom_field_output_file','geodir_cf_file',10,3); |
|
1333 | +add_filter('geodir_custom_field_output_file', 'geodir_cf_file', 10, 3); |
|
1334 | 1334 | |
1335 | 1335 | |
1336 | 1336 | |
@@ -1344,21 +1344,21 @@ discard block |
||
1344 | 1344 | * |
1345 | 1345 | * @return string The html to output for the custom field. |
1346 | 1346 | */ |
1347 | -function geodir_cf_textarea($html,$location,$cf,$p=''){ |
|
1347 | +function geodir_cf_textarea($html, $location, $cf, $p = '') { |
|
1348 | 1348 | |
1349 | 1349 | // check we have the post value |
1350 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
1351 | - else{ global $post;} |
|
1350 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
1351 | + else { global $post; } |
|
1352 | 1352 | |
1353 | - if(!is_array($cf) && $cf!=''){ |
|
1353 | + if (!is_array($cf) && $cf != '') { |
|
1354 | 1354 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
1355 | - if(!$cf){return NULL;} |
|
1355 | + if (!$cf) {return NULL; } |
|
1356 | 1356 | } |
1357 | 1357 | |
1358 | 1358 | $html_var = $cf['htmlvar_name']; |
1359 | 1359 | |
1360 | 1360 | // Check if there is a location specific filter. |
1361 | - if(has_filter("geodir_custom_field_output_textarea_loc_{$location}")){ |
|
1361 | + if (has_filter("geodir_custom_field_output_textarea_loc_{$location}")) { |
|
1362 | 1362 | /** |
1363 | 1363 | * Filter the textarea html by location. |
1364 | 1364 | * |
@@ -1366,11 +1366,11 @@ discard block |
||
1366 | 1366 | * @param array $cf The custom field array. |
1367 | 1367 | * @since 1.6.6 |
1368 | 1368 | */ |
1369 | - $html = apply_filters("geodir_custom_field_output_textarea_loc_{$location}",$html,$cf); |
|
1369 | + $html = apply_filters("geodir_custom_field_output_textarea_loc_{$location}", $html, $cf); |
|
1370 | 1370 | } |
1371 | 1371 | |
1372 | 1372 | // Check if there is a custom field specific filter. |
1373 | - if(has_filter("geodir_custom_field_output_textarea_var_{$html_var}")){ |
|
1373 | + if (has_filter("geodir_custom_field_output_textarea_var_{$html_var}")) { |
|
1374 | 1374 | /** |
1375 | 1375 | * Filter the textarea html by individual custom field. |
1376 | 1376 | * |
@@ -1379,11 +1379,11 @@ discard block |
||
1379 | 1379 | * @param array $cf The custom field array. |
1380 | 1380 | * @since 1.6.6 |
1381 | 1381 | */ |
1382 | - $html = apply_filters("geodir_custom_field_output_textarea_var_{$html_var}",$html,$location,$cf); |
|
1382 | + $html = apply_filters("geodir_custom_field_output_textarea_var_{$html_var}", $html, $location, $cf); |
|
1383 | 1383 | } |
1384 | 1384 | |
1385 | 1385 | // Check if there is a custom field key specific filter. |
1386 | - if(has_filter("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}")){ |
|
1386 | + if (has_filter("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}")) { |
|
1387 | 1387 | /** |
1388 | 1388 | * Filter the textarea html by field type key. |
1389 | 1389 | * |
@@ -1392,11 +1392,11 @@ discard block |
||
1392 | 1392 | * @param array $cf The custom field array. |
1393 | 1393 | * @since 1.6.6 |
1394 | 1394 | */ |
1395 | - $html = apply_filters("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
1395 | + $html = apply_filters("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
1396 | 1396 | } |
1397 | 1397 | |
1398 | 1398 | // If not html then we run the standard output. |
1399 | - if(empty($html)){ |
|
1399 | + if (empty($html)) { |
|
1400 | 1400 | |
1401 | 1401 | if (!empty($post->{$cf['htmlvar_name']})) { |
1402 | 1402 | |
@@ -1411,9 +1411,9 @@ discard block |
||
1411 | 1411 | } |
1412 | 1412 | |
1413 | 1413 | |
1414 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af; |
|
1415 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
1416 | - $html .= '</span>' . wpautop($post->{$cf['htmlvar_name']}) . '</div>'; |
|
1414 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-text" style="'.$field_icon.'">'.$field_icon_af; |
|
1415 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : ''; |
|
1416 | + $html .= '</span>'.wpautop($post->{$cf['htmlvar_name']}).'</div>'; |
|
1417 | 1417 | |
1418 | 1418 | } |
1419 | 1419 | |
@@ -1421,7 +1421,7 @@ discard block |
||
1421 | 1421 | |
1422 | 1422 | return $html; |
1423 | 1423 | } |
1424 | -add_filter('geodir_custom_field_output_textarea','geodir_cf_textarea',10,3); |
|
1424 | +add_filter('geodir_custom_field_output_textarea', 'geodir_cf_textarea', 10, 3); |
|
1425 | 1425 | |
1426 | 1426 | |
1427 | 1427 | |
@@ -1435,21 +1435,21 @@ discard block |
||
1435 | 1435 | * |
1436 | 1436 | * @return string The html to output for the custom field. |
1437 | 1437 | */ |
1438 | -function geodir_cf_html($html,$location,$cf,$p=''){ |
|
1438 | +function geodir_cf_html($html, $location, $cf, $p = '') { |
|
1439 | 1439 | |
1440 | 1440 | // check we have the post value |
1441 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
1442 | - else{ global $post;} |
|
1441 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
1442 | + else { global $post; } |
|
1443 | 1443 | |
1444 | - if(!is_array($cf) && $cf!=''){ |
|
1444 | + if (!is_array($cf) && $cf != '') { |
|
1445 | 1445 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
1446 | - if(!$cf){return NULL;} |
|
1446 | + if (!$cf) {return NULL; } |
|
1447 | 1447 | } |
1448 | 1448 | |
1449 | 1449 | $html_var = $cf['htmlvar_name']; |
1450 | 1450 | |
1451 | 1451 | // Check if there is a location specific filter. |
1452 | - if(has_filter("geodir_custom_field_output_html_loc_{$location}")){ |
|
1452 | + if (has_filter("geodir_custom_field_output_html_loc_{$location}")) { |
|
1453 | 1453 | /** |
1454 | 1454 | * Filter the html html by location. |
1455 | 1455 | * |
@@ -1457,11 +1457,11 @@ discard block |
||
1457 | 1457 | * @param array $cf The custom field array. |
1458 | 1458 | * @since 1.6.6 |
1459 | 1459 | */ |
1460 | - $html = apply_filters("geodir_custom_field_output_html_loc_{$location}",$html,$cf); |
|
1460 | + $html = apply_filters("geodir_custom_field_output_html_loc_{$location}", $html, $cf); |
|
1461 | 1461 | } |
1462 | 1462 | |
1463 | 1463 | // Check if there is a custom field specific filter. |
1464 | - if(has_filter("geodir_custom_field_output_html_var_{$html_var}")){ |
|
1464 | + if (has_filter("geodir_custom_field_output_html_var_{$html_var}")) { |
|
1465 | 1465 | /** |
1466 | 1466 | * Filter the html html by individual custom field. |
1467 | 1467 | * |
@@ -1470,11 +1470,11 @@ discard block |
||
1470 | 1470 | * @param array $cf The custom field array. |
1471 | 1471 | * @since 1.6.6 |
1472 | 1472 | */ |
1473 | - $html = apply_filters("geodir_custom_field_output_html_var_{$html_var}",$html,$location,$cf); |
|
1473 | + $html = apply_filters("geodir_custom_field_output_html_var_{$html_var}", $html, $location, $cf); |
|
1474 | 1474 | } |
1475 | 1475 | |
1476 | 1476 | // Check if there is a custom field key specific filter. |
1477 | - if(has_filter("geodir_custom_field_output_html_key_{$cf['field_type_key']}")){ |
|
1477 | + if (has_filter("geodir_custom_field_output_html_key_{$cf['field_type_key']}")) { |
|
1478 | 1478 | /** |
1479 | 1479 | * Filter the html html by field type key. |
1480 | 1480 | * |
@@ -1483,11 +1483,11 @@ discard block |
||
1483 | 1483 | * @param array $cf The custom field array. |
1484 | 1484 | * @since 1.6.6 |
1485 | 1485 | */ |
1486 | - $html = apply_filters("geodir_custom_field_output_html_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
1486 | + $html = apply_filters("geodir_custom_field_output_html_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
1487 | 1487 | } |
1488 | 1488 | |
1489 | 1489 | // If not html then we run the standard output. |
1490 | - if(empty($html)){ |
|
1490 | + if (empty($html)) { |
|
1491 | 1491 | |
1492 | 1492 | if (!empty($post->{$cf['htmlvar_name']})) { |
1493 | 1493 | |
@@ -1501,9 +1501,9 @@ discard block |
||
1501 | 1501 | $field_icon = ''; |
1502 | 1502 | } |
1503 | 1503 | |
1504 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af; |
|
1505 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
1506 | - $html .= '</span>' . wpautop($post->{$cf['htmlvar_name']}) . '</div>'; |
|
1504 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-text" style="'.$field_icon.'">'.$field_icon_af; |
|
1505 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : ''; |
|
1506 | + $html .= '</span>'.wpautop($post->{$cf['htmlvar_name']}).'</div>'; |
|
1507 | 1507 | |
1508 | 1508 | } |
1509 | 1509 | |
@@ -1511,7 +1511,7 @@ discard block |
||
1511 | 1511 | |
1512 | 1512 | return $html; |
1513 | 1513 | } |
1514 | -add_filter('geodir_custom_field_output_html','geodir_cf_html',10,3); |
|
1514 | +add_filter('geodir_custom_field_output_html', 'geodir_cf_html', 10, 3); |
|
1515 | 1515 | |
1516 | 1516 | |
1517 | 1517 | |
@@ -1525,21 +1525,21 @@ discard block |
||
1525 | 1525 | * |
1526 | 1526 | * @return string The html to output for the custom field. |
1527 | 1527 | */ |
1528 | -function geodir_cf_taxonomy($html,$location,$cf,$p=''){ |
|
1528 | +function geodir_cf_taxonomy($html, $location, $cf, $p = '') { |
|
1529 | 1529 | |
1530 | 1530 | // check we have the post value |
1531 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
1532 | - else{ global $post;} |
|
1531 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
1532 | + else { global $post; } |
|
1533 | 1533 | |
1534 | - if(!is_array($cf) && $cf!=''){ |
|
1534 | + if (!is_array($cf) && $cf != '') { |
|
1535 | 1535 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
1536 | - if(!$cf){return NULL;} |
|
1536 | + if (!$cf) {return NULL; } |
|
1537 | 1537 | } |
1538 | 1538 | |
1539 | 1539 | $html_var = $cf['htmlvar_name']; |
1540 | 1540 | |
1541 | 1541 | // Check if there is a location specific filter. |
1542 | - if(has_filter("geodir_custom_field_output_taxonomy_loc_{$location}")){ |
|
1542 | + if (has_filter("geodir_custom_field_output_taxonomy_loc_{$location}")) { |
|
1543 | 1543 | /** |
1544 | 1544 | * Filter the taxonomy html by location. |
1545 | 1545 | * |
@@ -1547,11 +1547,11 @@ discard block |
||
1547 | 1547 | * @param array $cf The custom field array. |
1548 | 1548 | * @since 1.6.6 |
1549 | 1549 | */ |
1550 | - $html = apply_filters("geodir_custom_field_output_taxonomy_loc_{$location}",$html,$cf); |
|
1550 | + $html = apply_filters("geodir_custom_field_output_taxonomy_loc_{$location}", $html, $cf); |
|
1551 | 1551 | } |
1552 | 1552 | |
1553 | 1553 | // Check if there is a custom field specific filter. |
1554 | - if(has_filter("geodir_custom_field_output_taxonomy_var_{$html_var}")){ |
|
1554 | + if (has_filter("geodir_custom_field_output_taxonomy_var_{$html_var}")) { |
|
1555 | 1555 | /** |
1556 | 1556 | * Filter the taxonomy html by individual custom field. |
1557 | 1557 | * |
@@ -1560,11 +1560,11 @@ discard block |
||
1560 | 1560 | * @param array $cf The custom field array. |
1561 | 1561 | * @since 1.6.6 |
1562 | 1562 | */ |
1563 | - $html = apply_filters("geodir_custom_field_output_taxonomy_var_{$html_var}",$html,$location,$cf); |
|
1563 | + $html = apply_filters("geodir_custom_field_output_taxonomy_var_{$html_var}", $html, $location, $cf); |
|
1564 | 1564 | } |
1565 | 1565 | |
1566 | 1566 | // Check if there is a custom field key specific filter. |
1567 | - if(has_filter("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}")){ |
|
1567 | + if (has_filter("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}")) { |
|
1568 | 1568 | /** |
1569 | 1569 | * Filter the taxonomy html by field type key. |
1570 | 1570 | * |
@@ -1573,14 +1573,14 @@ discard block |
||
1573 | 1573 | * @param array $cf The custom field array. |
1574 | 1574 | * @since 1.6.6 |
1575 | 1575 | */ |
1576 | - $html = apply_filters("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
1576 | + $html = apply_filters("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
1577 | 1577 | } |
1578 | 1578 | |
1579 | 1579 | // If not html then we run the standard output. |
1580 | - if(empty($html)){ |
|
1580 | + if (empty($html)) { |
|
1581 | 1581 | |
1582 | - if ($html_var == $post->post_type . 'category' && !empty($post->{$html_var})) { |
|
1583 | - $post_taxonomy = $post->post_type . 'category'; |
|
1582 | + if ($html_var == $post->post_type.'category' && !empty($post->{$html_var})) { |
|
1583 | + $post_taxonomy = $post->post_type.'category'; |
|
1584 | 1584 | $field_value = $post->{$html_var}; |
1585 | 1585 | $links = array(); |
1586 | 1586 | $terms = array(); |
@@ -1598,7 +1598,7 @@ discard block |
||
1598 | 1598 | if ($term != '') { |
1599 | 1599 | $term = get_term_by('id', $term, $html_var); |
1600 | 1600 | if (is_object($term)) { |
1601 | - $links[] = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>" . $term->name . "</a>"; |
|
1601 | + $links[] = "<a href='".esc_attr(get_term_link($term, $post_taxonomy))."'>".$term->name."</a>"; |
|
1602 | 1602 | $terms[] = $term; |
1603 | 1603 | } |
1604 | 1604 | } |
@@ -1612,7 +1612,7 @@ discard block |
||
1612 | 1612 | $terms = $termsOrdered; |
1613 | 1613 | } |
1614 | 1614 | } |
1615 | - $html_value = !empty($links) && !empty($terms) ? wp_sprintf('%l', $links, (object)$terms) : ''; |
|
1615 | + $html_value = !empty($links) && !empty($terms) ? wp_sprintf('%l', $links, (object) $terms) : ''; |
|
1616 | 1616 | |
1617 | 1617 | if ($html_value != '') { |
1618 | 1618 | $field_icon = geodir_field_icon_proccess($cf); |
@@ -1625,9 +1625,9 @@ discard block |
||
1625 | 1625 | $field_icon = ''; |
1626 | 1626 | } |
1627 | 1627 | |
1628 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $html_var . '" style="clear:both;"><span class="geodir-i-taxonomy geodir-i-category" style="' . $field_icon . '">' . $field_icon_af; |
|
1629 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
1630 | - $html .= '</span> ' . $html_value . '</div>'; |
|
1628 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$html_var.'" style="clear:both;"><span class="geodir-i-taxonomy geodir-i-category" style="'.$field_icon.'">'.$field_icon_af; |
|
1629 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : ''; |
|
1630 | + $html .= '</span> '.$html_value.'</div>'; |
|
1631 | 1631 | } |
1632 | 1632 | } |
1633 | 1633 | |
@@ -1635,7 +1635,7 @@ discard block |
||
1635 | 1635 | |
1636 | 1636 | return $html; |
1637 | 1637 | } |
1638 | -add_filter('geodir_custom_field_output_taxonomy','geodir_cf_taxonomy',10,3); |
|
1638 | +add_filter('geodir_custom_field_output_taxonomy', 'geodir_cf_taxonomy', 10, 3); |
|
1639 | 1639 | |
1640 | 1640 | |
1641 | 1641 | /** |
@@ -1648,21 +1648,21 @@ discard block |
||
1648 | 1648 | * |
1649 | 1649 | * @return string The html to output for the custom field. |
1650 | 1650 | */ |
1651 | -function geodir_cf_address($html,$location,$cf,$p=''){ |
|
1651 | +function geodir_cf_address($html, $location, $cf, $p = '') { |
|
1652 | 1652 | |
1653 | 1653 | // check we have the post value |
1654 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
1655 | - else{ global $post;} |
|
1654 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
1655 | + else { global $post; } |
|
1656 | 1656 | |
1657 | - if(!is_array($cf) && $cf!=''){ |
|
1657 | + if (!is_array($cf) && $cf != '') { |
|
1658 | 1658 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
1659 | - if(!$cf){return NULL;} |
|
1659 | + if (!$cf) {return NULL; } |
|
1660 | 1660 | } |
1661 | 1661 | |
1662 | 1662 | $html_var = $cf['htmlvar_name']; |
1663 | 1663 | |
1664 | 1664 | // Check if there is a location specific filter. |
1665 | - if(has_filter("geodir_custom_field_output_address_loc_{$location}")){ |
|
1665 | + if (has_filter("geodir_custom_field_output_address_loc_{$location}")) { |
|
1666 | 1666 | /** |
1667 | 1667 | * Filter the address html by location. |
1668 | 1668 | * |
@@ -1670,11 +1670,11 @@ discard block |
||
1670 | 1670 | * @param array $cf The custom field array. |
1671 | 1671 | * @since 1.6.6 |
1672 | 1672 | */ |
1673 | - $html = apply_filters("geodir_custom_field_output_address_loc_{$location}",$html,$cf); |
|
1673 | + $html = apply_filters("geodir_custom_field_output_address_loc_{$location}", $html, $cf); |
|
1674 | 1674 | } |
1675 | 1675 | |
1676 | 1676 | // Check if there is a custom field specific filter. |
1677 | - if(has_filter("geodir_custom_field_output_address_var_{$html_var}")){ |
|
1677 | + if (has_filter("geodir_custom_field_output_address_var_{$html_var}")) { |
|
1678 | 1678 | /** |
1679 | 1679 | * Filter the address html by individual custom field. |
1680 | 1680 | * |
@@ -1683,11 +1683,11 @@ discard block |
||
1683 | 1683 | * @param array $cf The custom field array. |
1684 | 1684 | * @since 1.6.6 |
1685 | 1685 | */ |
1686 | - $html = apply_filters("geodir_custom_field_output_address_var_{$html_var}",$html,$location,$cf); |
|
1686 | + $html = apply_filters("geodir_custom_field_output_address_var_{$html_var}", $html, $location, $cf); |
|
1687 | 1687 | } |
1688 | 1688 | |
1689 | 1689 | // Check if there is a custom field key specific filter. |
1690 | - if(has_filter("geodir_custom_field_output_address_key_{$cf['field_type_key']}")){ |
|
1690 | + if (has_filter("geodir_custom_field_output_address_key_{$cf['field_type_key']}")) { |
|
1691 | 1691 | /** |
1692 | 1692 | * Filter the address html by field type key. |
1693 | 1693 | * |
@@ -1696,14 +1696,14 @@ discard block |
||
1696 | 1696 | * @param array $cf The custom field array. |
1697 | 1697 | * @since 1.6.6 |
1698 | 1698 | */ |
1699 | - $html = apply_filters("geodir_custom_field_output_address_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
1699 | + $html = apply_filters("geodir_custom_field_output_address_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
1700 | 1700 | } |
1701 | 1701 | |
1702 | 1702 | // If not html then we run the standard output. |
1703 | - if(empty($html)){ |
|
1703 | + if (empty($html)) { |
|
1704 | 1704 | |
1705 | 1705 | global $preview; |
1706 | - $html_var = $cf['htmlvar_name'] . '_address'; |
|
1706 | + $html_var = $cf['htmlvar_name'].'_address'; |
|
1707 | 1707 | |
1708 | 1708 | if ($cf['extra_fields']) { |
1709 | 1709 | |
@@ -1766,10 +1766,10 @@ discard block |
||
1766 | 1766 | |
1767 | 1767 | if ($post->{$html_var}) { |
1768 | 1768 | |
1769 | - $field_icon = geodir_field_icon_proccess( $cf ); |
|
1770 | - if ( strpos( $field_icon, 'http' ) !== false ) { |
|
1769 | + $field_icon = geodir_field_icon_proccess($cf); |
|
1770 | + if (strpos($field_icon, 'http') !== false) { |
|
1771 | 1771 | $field_icon_af = ''; |
1772 | - } elseif ( $field_icon == '' ) { |
|
1772 | + } elseif ($field_icon == '') { |
|
1773 | 1773 | $field_icon_af = '<i class="fa fa-home"></i>'; |
1774 | 1774 | } else { |
1775 | 1775 | $field_icon_af = $field_icon; |
@@ -1778,26 +1778,26 @@ discard block |
||
1778 | 1778 | |
1779 | 1779 | |
1780 | 1780 | |
1781 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;" itemscope itemtype="http://schema.org/PostalAddress">'; |
|
1782 | - $html .= '<span class="geodir-i-location" style="' . $field_icon . '">' . $field_icon_af; |
|
1783 | - $html .= ( trim( $cf['site_title'] ) ) ? __( $cf['site_title'], 'geodirectory' ) . ': ' : ' '; |
|
1781 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;" itemscope itemtype="http://schema.org/PostalAddress">'; |
|
1782 | + $html .= '<span class="geodir-i-location" style="'.$field_icon.'">'.$field_icon_af; |
|
1783 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : ' '; |
|
1784 | 1784 | $html .= '</span>'; |
1785 | 1785 | |
1786 | 1786 | |
1787 | - if ( $post->post_address ) { |
|
1788 | - $html .= '<span itemprop="streetAddress">' . $post->post_address . '</span><br>'; |
|
1787 | + if ($post->post_address) { |
|
1788 | + $html .= '<span itemprop="streetAddress">'.$post->post_address.'</span><br>'; |
|
1789 | 1789 | } |
1790 | - if ($show_city_in_address && $post->post_city ) { |
|
1791 | - $html .= '<span itemprop="addressLocality">' . $post->post_city . '</span><br>'; |
|
1790 | + if ($show_city_in_address && $post->post_city) { |
|
1791 | + $html .= '<span itemprop="addressLocality">'.$post->post_city.'</span><br>'; |
|
1792 | 1792 | } |
1793 | - if ($show_region_in_address && $post->post_region ) { |
|
1794 | - $html .= '<span itemprop="addressRegion">' . $post->post_region . '</span><br>'; |
|
1793 | + if ($show_region_in_address && $post->post_region) { |
|
1794 | + $html .= '<span itemprop="addressRegion">'.$post->post_region.'</span><br>'; |
|
1795 | 1795 | } |
1796 | - if ($show_zip_in_address && $post->post_zip ) { |
|
1797 | - $html .= '<span itemprop="postalCode">' . $post->post_zip . '</span><br>'; |
|
1796 | + if ($show_zip_in_address && $post->post_zip) { |
|
1797 | + $html .= '<span itemprop="postalCode">'.$post->post_zip.'</span><br>'; |
|
1798 | 1798 | } |
1799 | - if ($show_country_in_address && $post->post_country ) { |
|
1800 | - $html .= '<span itemprop="addressCountry">' . __( $post->post_country, 'geodirectory' ) . '</span><br>'; |
|
1799 | + if ($show_country_in_address && $post->post_country) { |
|
1800 | + $html .= '<span itemprop="addressCountry">'.__($post->post_country, 'geodirectory').'</span><br>'; |
|
1801 | 1801 | } |
1802 | 1802 | $html .= '</div>'; |
1803 | 1803 | |
@@ -1808,4 +1808,4 @@ discard block |
||
1808 | 1808 | |
1809 | 1809 | return $html; |
1810 | 1810 | } |
1811 | -add_filter('geodir_custom_field_output_address','geodir_cf_address',10,3); |
|
1812 | 1811 | \ No newline at end of file |
1812 | +add_filter('geodir_custom_field_output_address', 'geodir_cf_address', 10, 3); |
|
1813 | 1813 | \ No newline at end of file |