@@ -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 | 'osmStart' => __('Start', 'geodirectory'), |
@@ -1358,10 +1358,10 @@ discard block |
||
1358 | 1358 | foreach ($arr_alert_msg as $key => $value) { |
1359 | 1359 | if (!is_scalar($value)) |
1360 | 1360 | continue; |
1361 | - $arr_alert_msg[$key] = html_entity_decode((string)$value, ENT_QUOTES, 'UTF-8'); |
|
1361 | + $arr_alert_msg[$key] = html_entity_decode((string) $value, ENT_QUOTES, 'UTF-8'); |
|
1362 | 1362 | } |
1363 | 1363 | |
1364 | - $script = "var geodir_all_js_msg = " . json_encode($arr_alert_msg) . ';'; |
|
1364 | + $script = "var geodir_all_js_msg = ".json_encode($arr_alert_msg).';'; |
|
1365 | 1365 | echo '<script>'; |
1366 | 1366 | echo $script; |
1367 | 1367 | echo '</script>'; |
@@ -1451,7 +1451,7 @@ discard block |
||
1451 | 1451 | $geodir_old_sidebars = get_option('geodir_sidebars'); |
1452 | 1452 | if (is_array($geodir_old_sidebars)) { |
1453 | 1453 | foreach ($geodir_old_sidebars as $key => $val) { |
1454 | - if(0 === strpos($key, 'geodir_'))// if gd widget |
|
1454 | + if (0 === strpos($key, 'geodir_'))// if gd widget |
|
1455 | 1455 | { |
1456 | 1456 | $sidebars_widgets[$key] = $geodir_old_sidebars[$key]; |
1457 | 1457 | } |
@@ -1530,7 +1530,7 @@ discard block |
||
1530 | 1530 | global $post; |
1531 | 1531 | $term_condition = ''; |
1532 | 1532 | if (isset($_REQUEST['backandedit'])) { |
1533 | - $post = (object)$gd_session->get('listing'); |
|
1533 | + $post = (object) $gd_session->get('listing'); |
|
1534 | 1534 | $term_condition = isset($post->geodir_accept_term_condition) ? $post->geodir_accept_term_condition : ''; |
1535 | 1535 | } |
1536 | 1536 | |
@@ -1544,7 +1544,7 @@ discard block |
||
1544 | 1544 | echo 'checked="checked"'; |
1545 | 1545 | } ?> field_type="checkbox" name="geodir_accept_term_condition" id="geodir_accept_term_condition" |
1546 | 1546 | class="geodir_textfield" value="1" |
1547 | - 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> |
|
1547 | + 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> |
|
1548 | 1548 | </span> |
1549 | 1549 | </div> |
1550 | 1550 | <span class="geodir_message_error"><?php if (isset($required_msg)) { |
@@ -1584,7 +1584,7 @@ discard block |
||
1584 | 1584 | /** This action is documented in geodirectory_template_actions.php */ |
1585 | 1585 | $desc_limit = apply_filters('geodir_description_field_desc_limit', ''); |
1586 | 1586 | |
1587 | - if (!($desc_limit === '' || (int)$desc_limit > 0)) { |
|
1587 | + if (!($desc_limit === '' || (int) $desc_limit > 0)) { |
|
1588 | 1588 | $is_display = false; |
1589 | 1589 | } |
1590 | 1590 | } |
@@ -1632,16 +1632,16 @@ discard block |
||
1632 | 1632 | global $wpdb, $plugin_prefix; |
1633 | 1633 | |
1634 | 1634 | // Remove unused virtual page |
1635 | - $listings_page_id = (int)get_option('geodir_listing_page'); |
|
1635 | + $listings_page_id = (int) get_option('geodir_listing_page'); |
|
1636 | 1636 | if ($listings_page_id) { |
1637 | - $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'))); |
|
1637 | + $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'))); |
|
1638 | 1638 | delete_option('geodir_listing_page'); |
1639 | 1639 | } |
1640 | 1640 | |
1641 | 1641 | if (!get_option('geodir_changes_in_custom_fields_table')) { |
1642 | 1642 | $wpdb->query( |
1643 | 1643 | $wpdb->prepare( |
1644 | - "UPDATE " . GEODIR_CUSTOM_FIELDS_TABLE . " SET is_default=%s, is_admin=%s WHERE is_default=%s", |
|
1644 | + "UPDATE ".GEODIR_CUSTOM_FIELDS_TABLE." SET is_default=%s, is_admin=%s WHERE is_default=%s", |
|
1645 | 1645 | array('1', '1', 'admin') |
1646 | 1646 | ) |
1647 | 1647 | ); |
@@ -1649,9 +1649,9 @@ discard block |
||
1649 | 1649 | |
1650 | 1650 | /* --- terms meta value set --- */ |
1651 | 1651 | |
1652 | - update_option('geodir_default_marker_icon', geodir_plugin_url() . '/geodirectory-functions/map-functions/icons/pin.png'); |
|
1652 | + update_option('geodir_default_marker_icon', geodir_plugin_url().'/geodirectory-functions/map-functions/icons/pin.png'); |
|
1653 | 1653 | |
1654 | - $options_data = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "options WHERE option_name LIKE %s", array('%tax_meta_%'))); |
|
1654 | + $options_data = $wpdb->get_results($wpdb->prepare("SELECT * FROM ".$wpdb->prefix."options WHERE option_name LIKE %s", array('%tax_meta_%'))); |
|
1655 | 1655 | |
1656 | 1656 | if (!empty($options_data)) { |
1657 | 1657 | |
@@ -1659,7 +1659,7 @@ discard block |
||
1659 | 1659 | |
1660 | 1660 | $option_val = str_replace('tax_meta_', '', $optobj->option_name); |
1661 | 1661 | |
1662 | - $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))); |
|
1662 | + $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))); |
|
1663 | 1663 | |
1664 | 1664 | if (!empty($taxonomies_data)) { |
1665 | 1665 | |
@@ -1668,17 +1668,17 @@ discard block |
||
1668 | 1668 | $taxObject = get_taxonomy($taxobj->taxonomy); |
1669 | 1669 | $post_type = $taxObject->object_type[0]; |
1670 | 1670 | |
1671 | - $opt_value = 'tax_meta_' . $post_type . '_' . $option_val; |
|
1671 | + $opt_value = 'tax_meta_'.$post_type.'_'.$option_val; |
|
1672 | 1672 | |
1673 | - $duplicate_data = $wpdb->get_var($wpdb->prepare("SELECT option_id FROM " . $wpdb->prefix . "options WHERE option_name=%s", array('tax_meta_' . $option_val))); |
|
1673 | + $duplicate_data = $wpdb->get_var($wpdb->prepare("SELECT option_id FROM ".$wpdb->prefix."options WHERE option_name=%s", array('tax_meta_'.$option_val))); |
|
1674 | 1674 | |
1675 | 1675 | if ($duplicate_data) { |
1676 | 1676 | |
1677 | - $wpdb->query($wpdb->prepare("UPDATE " . $wpdb->prefix . "options SET option_name=%s WHERE option_id=%d", array($opt_value, $optobj->option_id))); |
|
1677 | + $wpdb->query($wpdb->prepare("UPDATE ".$wpdb->prefix."options SET option_name=%s WHERE option_id=%d", array($opt_value, $optobj->option_id))); |
|
1678 | 1678 | |
1679 | 1679 | } else { |
1680 | 1680 | |
1681 | - $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))); |
|
1681 | + $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))); |
|
1682 | 1682 | |
1683 | 1683 | } |
1684 | 1684 | |
@@ -1712,14 +1712,14 @@ discard block |
||
1712 | 1712 | |
1713 | 1713 | global $wpdb, $table_prefix; |
1714 | 1714 | |
1715 | - $slug_exists = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($slug))); |
|
1715 | + $slug_exists = $wpdb->get_var($wpdb->prepare("SELECT slug FROM ".$table_prefix."terms WHERE slug=%s", array($slug))); |
|
1716 | 1716 | |
1717 | 1717 | if ($slug_exists) { |
1718 | 1718 | |
1719 | 1719 | $suffix = 1; |
1720 | 1720 | do { |
1721 | - $alt_location_name = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix"; |
|
1722 | - $location_slug_check = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($alt_location_name))); |
|
1721 | + $alt_location_name = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1))."-$suffix"; |
|
1722 | + $location_slug_check = $wpdb->get_var($wpdb->prepare("SELECT slug FROM ".$table_prefix."terms WHERE slug=%s", array($alt_location_name))); |
|
1723 | 1723 | $suffix++; |
1724 | 1724 | } while ($location_slug_check && $suffix < 100); |
1725 | 1725 | |
@@ -1773,7 +1773,7 @@ discard block |
||
1773 | 1773 | |
1774 | 1774 | $suffix = 1; |
1775 | 1775 | do { |
1776 | - $new_slug = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix"; |
|
1776 | + $new_slug = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1))."-$suffix"; |
|
1777 | 1777 | |
1778 | 1778 | /** This action is documented in geodirectory_hooks_actions.php */ |
1779 | 1779 | $term_slug_check = apply_filters('geodir_term_slug_is_exists', false, $new_slug, $term_id); |
@@ -1785,7 +1785,7 @@ discard block |
||
1785 | 1785 | |
1786 | 1786 | //wp_update_term( $term_id, $taxonomy, array('slug' => $slug) ); |
1787 | 1787 | |
1788 | - $wpdb->query($wpdb->prepare("UPDATE " . $table_prefix . "terms SET slug=%s WHERE term_id=%d", array($slug, $term_id))); |
|
1788 | + $wpdb->query($wpdb->prepare("UPDATE ".$table_prefix."terms SET slug=%s WHERE term_id=%d", array($slug, $term_id))); |
|
1789 | 1789 | |
1790 | 1790 | } |
1791 | 1791 | |
@@ -1794,18 +1794,18 @@ discard block |
||
1794 | 1794 | $post_type = !empty($taxonomy_obj) ? $taxonomy_obj->object_type[0] : NULL; |
1795 | 1795 | |
1796 | 1796 | $post_types = geodir_get_posttypes(); |
1797 | - if ($post_type && in_array($post_type, $post_types) && $post_type . '_tags' == $taxonomy) { |
|
1798 | - $posts_obj = $wpdb->get_results($wpdb->prepare("SELECT object_id FROM " . $wpdb->term_relationships . " WHERE term_taxonomy_id = %d", array($tt_id))); |
|
1797 | + if ($post_type && in_array($post_type, $post_types) && $post_type.'_tags' == $taxonomy) { |
|
1798 | + $posts_obj = $wpdb->get_results($wpdb->prepare("SELECT object_id FROM ".$wpdb->term_relationships." WHERE term_taxonomy_id = %d", array($tt_id))); |
|
1799 | 1799 | |
1800 | 1800 | if (!empty($posts_obj)) { |
1801 | 1801 | foreach ($posts_obj as $post_obj) { |
1802 | 1802 | $post_id = $post_obj->object_id; |
1803 | 1803 | |
1804 | - $raw_tags = wp_get_object_terms($post_id, $post_type . '_tags', array('fields' => 'names')); |
|
1804 | + $raw_tags = wp_get_object_terms($post_id, $post_type.'_tags', array('fields' => 'names')); |
|
1805 | 1805 | $post_tags = !empty($raw_tags) ? implode(',', $raw_tags) : ''; |
1806 | 1806 | |
1807 | - $listing_table = $plugin_prefix . $post_type . '_detail'; |
|
1808 | - $wpdb->query($wpdb->prepare("UPDATE " . $listing_table . " SET post_tags=%s WHERE post_id =%d", array($post_tags, $post_id))); |
|
1807 | + $listing_table = $plugin_prefix.$post_type.'_detail'; |
|
1808 | + $wpdb->query($wpdb->prepare("UPDATE ".$listing_table." SET post_tags=%s WHERE post_id =%d", array($post_tags, $post_id))); |
|
1809 | 1809 | } |
1810 | 1810 | } |
1811 | 1811 | } |
@@ -1839,7 +1839,7 @@ discard block |
||
1839 | 1839 | if ($country_slug == $slug || $region_slug == $slug || $city_slug == $slug) |
1840 | 1840 | return $slug_exists = true; |
1841 | 1841 | |
1842 | - if ($wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s AND term_id != %d", array($slug, $term_id)))) |
|
1842 | + if ($wpdb->get_var($wpdb->prepare("SELECT slug FROM ".$table_prefix."terms WHERE slug=%s AND term_id != %d", array($slug, $term_id)))) |
|
1843 | 1843 | return $slug_exists = true; |
1844 | 1844 | |
1845 | 1845 | return $slug_exists; |
@@ -1879,43 +1879,43 @@ discard block |
||
1879 | 1879 | |
1880 | 1880 | |
1881 | 1881 | $gd_page = ''; |
1882 | - if(geodir_is_page('home')){ |
|
1882 | + if (geodir_is_page('home')) { |
|
1883 | 1883 | $gd_page = 'home'; |
1884 | 1884 | $title = (get_option('geodir_meta_title_homepage')) ? get_option('geodir_meta_title_homepage') : $title; |
1885 | 1885 | } |
1886 | - elseif(geodir_is_page('detail')){ |
|
1886 | + elseif (geodir_is_page('detail')) { |
|
1887 | 1887 | $gd_page = 'detail'; |
1888 | 1888 | $title = (get_option('geodir_meta_title_detail')) ? get_option('geodir_meta_title_detail') : $title; |
1889 | 1889 | } |
1890 | - elseif(geodir_is_page('pt')){ |
|
1890 | + elseif (geodir_is_page('pt')) { |
|
1891 | 1891 | $gd_page = 'pt'; |
1892 | 1892 | $title = (get_option('geodir_meta_title_pt')) ? get_option('geodir_meta_title_pt') : $title; |
1893 | 1893 | } |
1894 | - elseif(geodir_is_page('listing')){ |
|
1894 | + elseif (geodir_is_page('listing')) { |
|
1895 | 1895 | $gd_page = 'listing'; |
1896 | 1896 | $title = (get_option('geodir_meta_title_listing')) ? get_option('geodir_meta_title_listing') : $title; |
1897 | 1897 | } |
1898 | - elseif(geodir_is_page('location')){ |
|
1898 | + elseif (geodir_is_page('location')) { |
|
1899 | 1899 | $gd_page = 'location'; |
1900 | 1900 | $title = (get_option('geodir_meta_title_location')) ? get_option('geodir_meta_title_location') : $title; |
1901 | 1901 | } |
1902 | - elseif(geodir_is_page('search')){ |
|
1902 | + elseif (geodir_is_page('search')) { |
|
1903 | 1903 | $gd_page = 'search'; |
1904 | 1904 | $title = (get_option('geodir_meta_title_search')) ? get_option('geodir_meta_title_search') : $title; |
1905 | 1905 | } |
1906 | - elseif(geodir_is_page('add-listing')){ |
|
1906 | + elseif (geodir_is_page('add-listing')) { |
|
1907 | 1907 | $gd_page = 'add-listing'; |
1908 | 1908 | $title = (get_option('geodir_meta_title_add-listing')) ? get_option('geodir_meta_title_add-listing') : $title; |
1909 | 1909 | } |
1910 | - elseif(geodir_is_page('author')){ |
|
1910 | + elseif (geodir_is_page('author')) { |
|
1911 | 1911 | $gd_page = 'author'; |
1912 | 1912 | $title = (get_option('geodir_meta_title_author')) ? get_option('geodir_meta_title_author') : $title; |
1913 | 1913 | } |
1914 | - elseif(geodir_is_page('login')){ |
|
1914 | + elseif (geodir_is_page('login')) { |
|
1915 | 1915 | $gd_page = 'login'; |
1916 | 1916 | $title = (get_option('geodir_meta_title_login')) ? get_option('geodir_meta_title_login') : $title; |
1917 | 1917 | } |
1918 | - elseif(geodir_is_page('listing-success')){ |
|
1918 | + elseif (geodir_is_page('listing-success')) { |
|
1919 | 1919 | $gd_page = 'listing-success'; |
1920 | 1920 | $title = (get_option('geodir_meta_title_listing-success')) ? get_option('geodir_meta_title_listing-success') : $title; |
1921 | 1921 | } |
@@ -1947,12 +1947,12 @@ discard block |
||
1947 | 1947 | |
1948 | 1948 | if (!get_option('geodir_set_post_attachments')) { |
1949 | 1949 | |
1950 | - require_once(ABSPATH . 'wp-admin/includes/image.php'); |
|
1951 | - require_once(ABSPATH . 'wp-admin/includes/file.php'); |
|
1950 | + require_once(ABSPATH.'wp-admin/includes/image.php'); |
|
1951 | + require_once(ABSPATH.'wp-admin/includes/file.php'); |
|
1952 | 1952 | |
1953 | 1953 | $all_postypes = geodir_get_posttypes(); |
1954 | 1954 | |
1955 | - foreach($all_postypes as $post_type){ |
|
1955 | + foreach ($all_postypes as $post_type) { |
|
1956 | 1956 | $args = array( |
1957 | 1957 | 'posts_per_page' => -1, |
1958 | 1958 | 'post_type' => $post_type, |
@@ -2046,7 +2046,7 @@ discard block |
||
2046 | 2046 | { |
2047 | 2047 | $user_id = get_current_user_id(); |
2048 | 2048 | |
2049 | - if(!$user_id){return $post;} |
|
2049 | + if (!$user_id) {return $post; } |
|
2050 | 2050 | |
2051 | 2051 | $gd_post_types = geodir_get_posttypes(); |
2052 | 2052 | |
@@ -2155,7 +2155,7 @@ discard block |
||
2155 | 2155 | |
2156 | 2156 | if (array_key_exists('post_video', $tabs_arr)) { |
2157 | 2157 | |
2158 | - $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))); |
|
2158 | + $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))); |
|
2159 | 2159 | |
2160 | 2160 | if (isset($tabs_arr['post_video']['heading_text']) && $field_title != '') |
2161 | 2161 | $tabs_arr['post_video']['heading_text'] = $field_title; |
@@ -2163,7 +2163,7 @@ discard block |
||
2163 | 2163 | |
2164 | 2164 | if (array_key_exists('special_offers', $tabs_arr)) { |
2165 | 2165 | |
2166 | - $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))); |
|
2166 | + $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))); |
|
2167 | 2167 | |
2168 | 2168 | if (isset($tabs_arr['special_offers']['heading_text']) && $field_title != '') |
2169 | 2169 | $tabs_arr['special_offers']['heading_text'] = $field_title; |
@@ -2184,7 +2184,7 @@ discard block |
||
2184 | 2184 | */ |
2185 | 2185 | function geodir_remove_template_redirect_actions() |
2186 | 2186 | { |
2187 | - if (geodir_is_page('login')){ |
|
2187 | + if (geodir_is_page('login')) { |
|
2188 | 2188 | remove_all_actions('template_redirect'); |
2189 | 2189 | remove_action('init', 'avia_modify_front', 10); |
2190 | 2190 | } |
@@ -2231,25 +2231,25 @@ discard block |
||
2231 | 2231 | $split_img_file_path = isset($split_img_path[1]) ? $split_img_path[1] : ''; |
2232 | 2232 | |
2233 | 2233 | $wpdb->query( |
2234 | - $wpdb->prepare("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id = %d AND file=%s ", |
|
2234 | + $wpdb->prepare("DELETE FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id = %d AND file=%s ", |
|
2235 | 2235 | array($post_id, $split_img_file_path) |
2236 | 2236 | ) |
2237 | 2237 | ); |
2238 | 2238 | |
2239 | 2239 | $attachment_data = $wpdb->get_row( |
2240 | - $wpdb->prepare("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=%d", |
|
2240 | + $wpdb->prepare("SELECT ID, MIN(`menu_order`) FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id=%d", |
|
2241 | 2241 | array($post_id) |
2242 | 2242 | ) |
2243 | 2243 | ); |
2244 | 2244 | |
2245 | 2245 | if (!empty($attachment_data)) { |
2246 | - $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID); |
|
2246 | + $wpdb->query("UPDATE ".GEODIR_ATTACHMENT_TABLE." SET menu_order=1 WHERE ID=".$attachment_data->ID); |
|
2247 | 2247 | } |
2248 | 2248 | |
2249 | 2249 | |
2250 | - $table_name = $plugin_prefix . $post_type . '_detail'; |
|
2250 | + $table_name = $plugin_prefix.$post_type.'_detail'; |
|
2251 | 2251 | |
2252 | - $wpdb->query("UPDATE " . $table_name . " SET featured_image='' WHERE post_id =" . $post_id); |
|
2252 | + $wpdb->query("UPDATE ".$table_name." SET featured_image='' WHERE post_id =".$post_id); |
|
2253 | 2253 | |
2254 | 2254 | geodir_set_wp_featured_image($post_id); |
2255 | 2255 | |
@@ -2277,9 +2277,9 @@ discard block |
||
2277 | 2277 | |
2278 | 2278 | foreach ($all_postypes as $posttype) { |
2279 | 2279 | |
2280 | - $tablename = $plugin_prefix . $posttype . '_detail'; |
|
2280 | + $tablename = $plugin_prefix.$posttype.'_detail'; |
|
2281 | 2281 | |
2282 | - $get_post_data = $wpdb->get_results("SELECT post_id FROM " . $tablename); |
|
2282 | + $get_post_data = $wpdb->get_results("SELECT post_id FROM ".$tablename); |
|
2283 | 2283 | |
2284 | 2284 | if (!empty($get_post_data)) { |
2285 | 2285 | |
@@ -2287,7 +2287,7 @@ discard block |
||
2287 | 2287 | |
2288 | 2288 | $post_id = $data->post_id; |
2289 | 2289 | |
2290 | - $attachment_data = $wpdb->get_results("SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id =" . $post_id . " AND file!=''"); |
|
2290 | + $attachment_data = $wpdb->get_results("SELECT * FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id =".$post_id." AND file!=''"); |
|
2291 | 2291 | |
2292 | 2292 | if (!empty($attachment_data)) { |
2293 | 2293 | |
@@ -2304,22 +2304,22 @@ discard block |
||
2304 | 2304 | |
2305 | 2305 | $file_name = $file_info['basename']; |
2306 | 2306 | |
2307 | - $img_arr['path'] = $uploads_path . $sub_dir . '/' . $file_name; |
|
2307 | + $img_arr['path'] = $uploads_path.$sub_dir.'/'.$file_name; |
|
2308 | 2308 | |
2309 | 2309 | if (!file_exists($img_arr['path'])) { |
2310 | 2310 | |
2311 | - $wpdb->query("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE ID=" . $attach->ID); |
|
2311 | + $wpdb->query("DELETE FROM ".GEODIR_ATTACHMENT_TABLE." WHERE ID=".$attach->ID); |
|
2312 | 2312 | |
2313 | 2313 | } |
2314 | 2314 | |
2315 | 2315 | } |
2316 | 2316 | |
2317 | - $attachment_data = $wpdb->get_row("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=" . $post_id . " GROUP BY post_id"); |
|
2317 | + $attachment_data = $wpdb->get_row("SELECT ID, MIN(`menu_order`) FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id=".$post_id." GROUP BY post_id"); |
|
2318 | 2318 | |
2319 | 2319 | if (!empty($attachment_data)) { |
2320 | 2320 | |
2321 | 2321 | if ($attachment_data->ID) |
2322 | - $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID); |
|
2322 | + $wpdb->query("UPDATE ".GEODIR_ATTACHMENT_TABLE." SET menu_order=1 WHERE ID=".$attachment_data->ID); |
|
2323 | 2323 | |
2324 | 2324 | } else { |
2325 | 2325 | |
@@ -2333,7 +2333,7 @@ discard block |
||
2333 | 2333 | |
2334 | 2334 | } |
2335 | 2335 | |
2336 | - $wpdb->query("UPDATE " . $tablename . " SET featured_image='' WHERE post_id =" . $post_id); |
|
2336 | + $wpdb->query("UPDATE ".$tablename." SET featured_image='' WHERE post_id =".$post_id); |
|
2337 | 2337 | |
2338 | 2338 | geodir_set_wp_featured_image($post_id); |
2339 | 2339 | |
@@ -2362,7 +2362,7 @@ discard block |
||
2362 | 2362 | { |
2363 | 2363 | |
2364 | 2364 | if (!get_option('geodir_default_rating_star_icon')) { |
2365 | - update_option('geodir_default_rating_star_icon', geodir_plugin_url() . '/geodirectory-assets/images/stars.png'); |
|
2365 | + update_option('geodir_default_rating_star_icon', geodir_plugin_url().'/geodirectory-assets/images/stars.png'); |
|
2366 | 2366 | } |
2367 | 2367 | |
2368 | 2368 | } |
@@ -2379,10 +2379,10 @@ discard block |
||
2379 | 2379 | * @global string $plugin_prefix Geodirectory plugin table prefix. |
2380 | 2380 | * @return array User listing count for each post type. |
2381 | 2381 | */ |
2382 | -function geodir_user_post_listing_count($user_id=null) |
|
2382 | +function geodir_user_post_listing_count($user_id = null) |
|
2383 | 2383 | { |
2384 | 2384 | global $wpdb, $plugin_prefix, $current_user; |
2385 | - if(!$user_id){ |
|
2385 | + if (!$user_id) { |
|
2386 | 2386 | $user_id = $current_user->ID; |
2387 | 2387 | } |
2388 | 2388 | |
@@ -2393,7 +2393,7 @@ discard block |
||
2393 | 2393 | $user_listing = array(); |
2394 | 2394 | if (is_array($all_posts) && !empty($all_posts)) { |
2395 | 2395 | foreach ($all_posts as $ptype) { |
2396 | - $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' )"); |
|
2396 | + $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' )"); |
|
2397 | 2397 | |
2398 | 2398 | if ($total_posts > 0) { |
2399 | 2399 | $user_listing[$ptype] = $total_posts; |
@@ -2435,19 +2435,19 @@ discard block |
||
2435 | 2435 | $custom_fields = geodir_post_custom_fields($post_package_id, 'all', $post_type, $fields_location); |
2436 | 2436 | |
2437 | 2437 | //remove video and special offers if it is already set to show |
2438 | - if(isset($tabs_arr['post_video']['is_display']) && $tabs_arr['post_video']['is_display']){ |
|
2438 | + if (isset($tabs_arr['post_video']['is_display']) && $tabs_arr['post_video']['is_display']) { |
|
2439 | 2439 | $unset_video = true; |
2440 | 2440 | } |
2441 | 2441 | |
2442 | - if(isset($tabs_arr['special_offers']['is_display']) && $tabs_arr['special_offers']['is_display']){ |
|
2442 | + if (isset($tabs_arr['special_offers']['is_display']) && $tabs_arr['special_offers']['is_display']) { |
|
2443 | 2443 | $unset_special_offers = true; |
2444 | 2444 | } |
2445 | - if(isset($unset_video) || isset($unset_special_offers) && !empty($custom_fields)){ |
|
2446 | - foreach($custom_fields as $key => $custom_field){ |
|
2447 | - if($custom_field['name']=='geodir_video' && isset($unset_video)){ |
|
2445 | + if (isset($unset_video) || isset($unset_special_offers) && !empty($custom_fields)) { |
|
2446 | + foreach ($custom_fields as $key => $custom_field) { |
|
2447 | + if ($custom_field['name'] == 'geodir_video' && isset($unset_video)) { |
|
2448 | 2448 | unset($custom_fields[$key]); |
2449 | 2449 | } |
2450 | - if($custom_field['name']=='geodir_special_offers' && isset($unset_special_offers)){ |
|
2450 | + if ($custom_field['name'] == 'geodir_special_offers' && isset($unset_special_offers)) { |
|
2451 | 2451 | unset($custom_fields[$key]); |
2452 | 2452 | } |
2453 | 2453 | } |
@@ -2466,7 +2466,7 @@ discard block |
||
2466 | 2466 | $post->{$field_name} = $_REQUEST[$field_name]; |
2467 | 2467 | } |
2468 | 2468 | |
2469 | - 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'))) { |
|
2469 | + 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'))) { |
|
2470 | 2470 | if ($type['type'] == 'datepicker' && ($post->{$type['htmlvar_name']} == '' || $post->{$type['htmlvar_name']} == '0000-00-00')) { |
2471 | 2471 | continue; |
2472 | 2472 | } |
@@ -2515,11 +2515,11 @@ discard block |
||
2515 | 2515 | $variables_array['label'] = __($type['site_title'], 'geodirectory'); |
2516 | 2516 | $variables_array['value'] = ''; |
2517 | 2517 | $variables_array['value'] = $post->{$type['htmlvar_name']}; |
2518 | - }else{ |
|
2518 | + } else { |
|
2519 | 2519 | $i = 0; |
2520 | 2520 | $fieldset_count++; |
2521 | 2521 | $field_set_start = 1; |
2522 | - $fieldset_arr[$fieldset_count]['htmlvar_name'] = 'gd_tab_' . $fieldset_count; |
|
2522 | + $fieldset_arr[$fieldset_count]['htmlvar_name'] = 'gd_tab_'.$fieldset_count; |
|
2523 | 2523 | $fieldset_arr[$fieldset_count]['label'] = $label; |
2524 | 2524 | } |
2525 | 2525 | |
@@ -2527,7 +2527,7 @@ discard block |
||
2527 | 2527 | $type = stripslashes_deep($type); // strip slashes |
2528 | 2528 | $html = ''; |
2529 | 2529 | $html_var = isset($type['htmlvar_name']) ? $type['htmlvar_name'] : ''; |
2530 | - if($html_var=='post'){$html_var='post_address';} |
|
2530 | + if ($html_var == 'post') {$html_var = 'post_address'; } |
|
2531 | 2531 | $field_icon = geodir_field_icon_proccess($type); |
2532 | 2532 | $filed_type = $type['type']; |
2533 | 2533 | |
@@ -2540,7 +2540,7 @@ discard block |
||
2540 | 2540 | * @param string $fields_location The location the field is to be show. |
2541 | 2541 | * @param array $type The array of field values. |
2542 | 2542 | */ |
2543 | - $html = apply_filters("geodir_custom_field_output_{$filed_type}",$html,$fields_location,$type); |
|
2543 | + $html = apply_filters("geodir_custom_field_output_{$filed_type}", $html, $fields_location, $type); |
|
2544 | 2544 | |
2545 | 2545 | |
2546 | 2546 | /** |
@@ -2586,7 +2586,7 @@ discard block |
||
2586 | 2586 | * @param string $htmlvar_name The field HTML var name. |
2587 | 2587 | */ |
2588 | 2588 | 'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, $htmlvar_name), |
2589 | - 'tab_content' => '<div class="geodir-company_info field-group xxx">' . $fieldset_html . '</div>' |
|
2589 | + 'tab_content' => '<div class="geodir-company_info field-group xxx">'.$fieldset_html.'</div>' |
|
2590 | 2590 | ); |
2591 | 2591 | } |
2592 | 2592 | } else { |
@@ -2646,7 +2646,7 @@ discard block |
||
2646 | 2646 | } |
2647 | 2647 | $status .= ")</strong>"; |
2648 | 2648 | |
2649 | - $html = '<span class="geodir-post-status">' . $status_icon . ' <font class="geodir-status-label">' . __('Status: ', 'geodirectory') . '</font>' . $status . '</span>'; |
|
2649 | + $html = '<span class="geodir-post-status">'.$status_icon.' <font class="geodir-status-label">'.__('Status: ', 'geodirectory').'</font>'.$status.'</span>'; |
|
2650 | 2650 | } |
2651 | 2651 | } |
2652 | 2652 | |
@@ -2726,7 +2726,7 @@ discard block |
||
2726 | 2726 | function geodir_no_rating_comment_text($content, $comment = '') |
2727 | 2727 | { |
2728 | 2728 | if (!is_admin()) { |
2729 | - return '<div class="description">' . $content . '</div>'; |
|
2729 | + return '<div class="description">'.$content.'</div>'; |
|
2730 | 2730 | } else { |
2731 | 2731 | return $content; |
2732 | 2732 | } |
@@ -2804,7 +2804,7 @@ discard block |
||
2804 | 2804 | $classes[] = 'gd-no-rating'; |
2805 | 2805 | } |
2806 | 2806 | |
2807 | - $classes[] = 'gd-map-' . geodir_map_name(); |
|
2807 | + $classes[] = 'gd-map-'.geodir_map_name(); |
|
2808 | 2808 | |
2809 | 2809 | return $classes; |
2810 | 2810 | } |
@@ -2824,7 +2824,7 @@ discard block |
||
2824 | 2824 | $class .= ' gd-no-rating'; |
2825 | 2825 | } |
2826 | 2826 | |
2827 | - $class .= ' gd-map-' . geodir_map_name(); |
|
2827 | + $class .= ' gd-map-'.geodir_map_name(); |
|
2828 | 2828 | |
2829 | 2829 | return $class; |
2830 | 2830 | } |
@@ -2859,7 +2859,7 @@ discard block |
||
2859 | 2859 | * @return array Translation texts. |
2860 | 2860 | */ |
2861 | 2861 | function geodir_load_gd_options_text_translation($translation_texts = array()) { |
2862 | - $translation_texts = !empty( $translation_texts ) && is_array( $translation_texts ) ? $translation_texts : array(); |
|
2862 | + $translation_texts = !empty($translation_texts) && is_array($translation_texts) ? $translation_texts : array(); |
|
2863 | 2863 | |
2864 | 2864 | $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'); |
2865 | 2865 | |
@@ -2925,14 +2925,14 @@ discard block |
||
2925 | 2925 | * @param array $args The array of menu arguments. |
2926 | 2926 | * @return array The modified arguments. |
2927 | 2927 | */ |
2928 | -function geodir_add_nav_menu_class( $args ) |
|
2928 | +function geodir_add_nav_menu_class($args) |
|
2929 | 2929 | { |
2930 | 2930 | |
2931 | - if(isset($args['menu_class'])){ |
|
2931 | + if (isset($args['menu_class'])) { |
|
2932 | 2932 | $args['menu_class'] = $args['menu_class']." gd-menu-z"; |
2933 | 2933 | } |
2934 | 2934 | |
2935 | 2935 | return $args; |
2936 | 2936 | } |
2937 | 2937 | |
2938 | -add_filter( 'wp_nav_menu_args', 'geodir_add_nav_menu_class' ); |
|
2939 | 2938 | \ No newline at end of file |
2939 | +add_filter('wp_nav_menu_args', 'geodir_add_nav_menu_class'); |
|
2940 | 2940 | \ No newline at end of file |