@@ -40,8 +40,9 @@ |
||
40 | 40 | $geodir_active_nav_locations = get_nav_menu_locations(); |
41 | 41 | if (!empty($geodir_active_nav_locations) && is_array($geodir_active_nav_locations)) { |
42 | 42 | foreach ($geodir_active_nav_locations as $key => $theme_location) { |
43 | - if (!empty($geodir_all_nav_locations) && is_array($geodir_all_nav_locations) && array_key_exists($key, $geodir_all_nav_locations)) |
|
44 | - $post_type_arr[$key] = $geodir_all_nav_locations[$key]; |
|
43 | + if (!empty($geodir_all_nav_locations) && is_array($geodir_all_nav_locations) && array_key_exists($key, $geodir_all_nav_locations)) { |
|
44 | + $post_type_arr[$key] = $geodir_all_nav_locations[$key]; |
|
45 | + } |
|
45 | 46 | } |
46 | 47 | } |
47 | 48 |
@@ -106,24 +106,30 @@ discard block |
||
106 | 106 | $listing_slug = htmlentities(trim($_REQUEST['geodir_listing_prefix'])); |
107 | 107 | |
108 | 108 | if ($post_type == 'gd_place') { |
109 | - if (array_key_exists('has_archive', $args)) |
|
110 | - $args['has_archive'] = $listing_slug; |
|
109 | + if (array_key_exists('has_archive', $args)) { |
|
110 | + $args['has_archive'] = $listing_slug; |
|
111 | + } |
|
111 | 112 | |
112 | 113 | if (array_key_exists('rewrite', $args)) { |
113 | - if (array_key_exists('slug', $args['rewrite'])) |
|
114 | - $args['rewrite']['slug'] = $listing_slug;// . '/%gd_taxonomy%'; |
|
114 | + if (array_key_exists('slug', $args['rewrite'])) { |
|
115 | + $args['rewrite']['slug'] = $listing_slug; |
|
116 | + } |
|
117 | + // . '/%gd_taxonomy%'; |
|
115 | 118 | } |
116 | 119 | |
117 | 120 | $geodir_post_types = get_option('geodir_post_types'); |
118 | 121 | |
119 | 122 | if (array_key_exists($post_type, $geodir_post_types)) { |
120 | 123 | |
121 | - if (array_key_exists('has_archive', $geodir_post_types[$post_type])) |
|
122 | - $geodir_post_types[$post_type]['has_archive'] = $listing_slug; |
|
124 | + if (array_key_exists('has_archive', $geodir_post_types[$post_type])) { |
|
125 | + $geodir_post_types[$post_type]['has_archive'] = $listing_slug; |
|
126 | + } |
|
123 | 127 | |
124 | - if (array_key_exists('rewrite', $geodir_post_types[$post_type])) |
|
125 | - if (array_key_exists('slug', $geodir_post_types[$post_type]['rewrite'])) |
|
126 | - $geodir_post_types[$post_type]['rewrite']['slug'] = $listing_slug;// . '/%gd_taxonomy%'; |
|
128 | + if (array_key_exists('rewrite', $geodir_post_types[$post_type])) { |
|
129 | + if (array_key_exists('slug', $geodir_post_types[$post_type]['rewrite'])) |
|
130 | + $geodir_post_types[$post_type]['rewrite']['slug'] = $listing_slug; |
|
131 | + } |
|
132 | + // . '/%gd_taxonomy%'; |
|
127 | 133 | |
128 | 134 | update_option('geodir_post_types', $geodir_post_types); |
129 | 135 | |
@@ -138,10 +144,11 @@ discard block |
||
138 | 144 | if (array_key_exists('listing_slug', $geodir_taxonomies[$post_type . 'category'])) { |
139 | 145 | $geodir_taxonomies[$post_type . 'category']['listing_slug'] = $listing_slug; |
140 | 146 | |
141 | - if (array_key_exists('args', $geodir_taxonomies[$post_type . 'category'])) |
|
142 | - if (array_key_exists('rewrite', $geodir_taxonomies[$post_type . 'category']['args'])) |
|
147 | + if (array_key_exists('args', $geodir_taxonomies[$post_type . 'category'])) { |
|
148 | + if (array_key_exists('rewrite', $geodir_taxonomies[$post_type . 'category']['args'])) |
|
143 | 149 | if (array_key_exists('slug', $geodir_taxonomies[$post_type . 'category']['args']['rewrite'])) |
144 | - $geodir_taxonomies[$post_type . 'category']['args']['rewrite']['slug'] = $listing_slug; |
|
150 | + $geodir_taxonomies[$post_type . 'category']['args']['rewrite']['slug'] = $listing_slug; |
|
151 | + } |
|
145 | 152 | |
146 | 153 | update_option('geodir_taxonomies', $geodir_taxonomies); |
147 | 154 | |
@@ -152,10 +159,11 @@ discard block |
||
152 | 159 | if (array_key_exists('listing_slug', $geodir_taxonomies_tag[$post_type . '_tags'])) { |
153 | 160 | $geodir_taxonomies_tag[$post_type . '_tags']['listing_slug'] = $listing_slug . '/tags'; |
154 | 161 | |
155 | - if (array_key_exists('args', $geodir_taxonomies_tag[$post_type . '_tags'])) |
|
156 | - if (array_key_exists('rewrite', $geodir_taxonomies_tag[$post_type . '_tags']['args'])) |
|
162 | + if (array_key_exists('args', $geodir_taxonomies_tag[$post_type . '_tags'])) { |
|
163 | + if (array_key_exists('rewrite', $geodir_taxonomies_tag[$post_type . '_tags']['args'])) |
|
157 | 164 | if (array_key_exists('slug', $geodir_taxonomies_tag[$post_type . '_tags']['args']['rewrite'])) |
158 | - $geodir_taxonomies_tag[$post_type . '_tags']['args']['rewrite']['slug'] = $listing_slug . '/tags'; |
|
165 | + $geodir_taxonomies_tag[$post_type . '_tags']['args']['rewrite']['slug'] = $listing_slug . '/tags'; |
|
166 | + } |
|
159 | 167 | |
160 | 168 | update_option('geodir_taxonomies', $geodir_taxonomies_tag); |
161 | 169 | |
@@ -221,8 +229,9 @@ discard block |
||
221 | 229 | global $wpdb; |
222 | 230 | $location_prefix = $wpdb->get_var($wpdb->prepare("SELECT post_name FROM $wpdb->posts WHERE post_type='page' AND ID=%d", $location_page)); |
223 | 231 | } |
224 | - if (!isset($location_prefix)) |
|
225 | - $location_prefix = 'location'; |
|
232 | + if (!isset($location_prefix)) { |
|
233 | + $location_prefix = 'location'; |
|
234 | + } |
|
226 | 235 | |
227 | 236 | $location_manager = function_exists('geodir_location_plugin_activated') ? true : false; // Check location manager installed & active. |
228 | 237 | if ($location_manager) { |
@@ -441,14 +450,17 @@ discard block |
||
441 | 450 | $gd_country = ''; |
442 | 451 | $gd_region = ''; |
443 | 452 | $gd_city = ''; |
444 | - if (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') |
|
445 | - $gd_country = urldecode($wp->query_vars['gd_country']); |
|
453 | + if (isset($wp->query_vars['gd_country']) && $wp->query_vars['gd_country'] != '') { |
|
454 | + $gd_country = urldecode($wp->query_vars['gd_country']); |
|
455 | + } |
|
446 | 456 | |
447 | - if (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') |
|
448 | - $gd_region = urldecode($wp->query_vars['gd_region']); |
|
457 | + if (isset($wp->query_vars['gd_region']) && $wp->query_vars['gd_region'] != '') { |
|
458 | + $gd_region = urldecode($wp->query_vars['gd_region']); |
|
459 | + } |
|
449 | 460 | |
450 | - if (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') |
|
451 | - $gd_city = urldecode($wp->query_vars['gd_city']); |
|
461 | + if (isset($wp->query_vars['gd_city']) && $wp->query_vars['gd_city'] != '') { |
|
462 | + $gd_city = urldecode($wp->query_vars['gd_city']); |
|
463 | + } |
|
452 | 464 | |
453 | 465 | if (!($gd_country == '' && $gd_region == '' && $gd_city == '')) { |
454 | 466 | $default_location = geodir_get_default_location(); |
@@ -456,17 +468,19 @@ discard block |
||
456 | 468 | if (get_option('geodir_add_location_url')) { |
457 | 469 | if ($geodir_show_location_url != 'all') { |
458 | 470 | if ($gd_region == '') { |
459 | - if ($gd_ses_region = $gd_session->get('gd_region')) |
|
460 | - $gd_region = $gd_ses_region; |
|
461 | - else |
|
462 | - $gd_region = $default_location->region_slug; |
|
471 | + if ($gd_ses_region = $gd_session->get('gd_region')) { |
|
472 | + $gd_region = $gd_ses_region; |
|
473 | + } else { |
|
474 | + $gd_region = $default_location->region_slug; |
|
475 | + } |
|
463 | 476 | } |
464 | 477 | |
465 | 478 | if ($gd_city == '') { |
466 | - if ($gd_ses_city = $gd_session->get('gd_city')) |
|
467 | - $gd_city = $gd_ses_city; |
|
468 | - else |
|
469 | - $gd_city = $default_location->city_slug; |
|
479 | + if ($gd_ses_city = $gd_session->get('gd_city')) { |
|
480 | + $gd_city = $gd_ses_city; |
|
481 | + } else { |
|
482 | + $gd_city = $default_location->city_slug; |
|
483 | + } |
|
470 | 484 | |
471 | 485 | $base_location_link = geodir_get_location_link('base'); |
472 | 486 | wp_redirect($base_location_link . '/' . $gd_country . '/' . $gd_region . '/' . $gd_city); |
@@ -585,8 +599,9 @@ discard block |
||
585 | 599 | |
586 | 600 | |
587 | 601 | $geodir_term = str_replace('/' . $geodir_last_term, '', $geodir_term, $post_title_replace_count); |
588 | - if (!$post_title_replace_count) |
|
589 | - $geodir_term = str_replace($geodir_last_term, '', $geodir_term, $post_title_replace_count); |
|
602 | + if (!$post_title_replace_count) { |
|
603 | + $geodir_term = str_replace($geodir_last_term, '', $geodir_term, $post_title_replace_count); |
|
604 | + } |
|
590 | 605 | $geodir_terms = explode('/', $geodir_term); |
591 | 606 | $geodir_last_term = end($geodir_terms); |
592 | 607 | |
@@ -622,8 +637,9 @@ discard block |
||
622 | 637 | if (geodir_strtolower($default_location->country_slug) == geodir_strtolower($gd_country) && |
623 | 638 | geodir_strtolower($default_location->region_slug) == geodir_strtolower($gd_region) && |
624 | 639 | geodir_strtolower($default_location->city_slug) == geodir_strtolower($gd_city) |
625 | - ) |
|
626 | - $is_geodir_location_found = true; |
|
640 | + ) { |
|
641 | + $is_geodir_location_found = true; |
|
642 | + } |
|
627 | 643 | |
628 | 644 | // if location has not been found for country , region and city then search for country and region only |
629 | 645 | |
@@ -631,8 +647,9 @@ discard block |
||
631 | 647 | $gd_city = ''; |
632 | 648 | if (geodir_strtolower($default_location->country_slug) == geodir_strtolower($gd_country) && |
633 | 649 | geodir_strtolower($default_location->region_slug) == geodir_strtolower($gd_region) |
634 | - ) |
|
635 | - $is_geodir_location_found = true; |
|
650 | + ) { |
|
651 | + $is_geodir_location_found = true; |
|
652 | + } |
|
636 | 653 | |
637 | 654 | } |
638 | 655 | |
@@ -640,8 +657,9 @@ discard block |
||
640 | 657 | if (!$is_geodir_location_found) { |
641 | 658 | $gd_city = ''; |
642 | 659 | $gd_region = ''; |
643 | - if (geodir_strtolower($default_location->country_slug) == geodir_strtolower($gd_country)) |
|
644 | - $is_geodir_location_found = true; |
|
660 | + if (geodir_strtolower($default_location->country_slug) == geodir_strtolower($gd_country)) { |
|
661 | + $is_geodir_location_found = true; |
|
662 | + } |
|
645 | 663 | } |
646 | 664 | } else if ($geodir_show_location_url == 'country_city') { |
647 | 665 | if (count($geodir_terms) >= 2) { |
@@ -651,17 +669,19 @@ discard block |
||
651 | 669 | $gd_country = urldecode($geodir_terms[0]); |
652 | 670 | } |
653 | 671 | |
654 | - if (geodir_strtolower($default_location->country_slug) == geodir_strtolower($gd_country) && geodir_strtolower($default_location->city_slug) == geodir_strtolower($gd_city)) |
|
655 | - $is_geodir_location_found = true; |
|
672 | + if (geodir_strtolower($default_location->country_slug) == geodir_strtolower($gd_country) && geodir_strtolower($default_location->city_slug) == geodir_strtolower($gd_city)) { |
|
673 | + $is_geodir_location_found = true; |
|
674 | + } |
|
656 | 675 | |
657 | 676 | // if location has not been found for country and city then search for country only |
658 | 677 | if (!$is_geodir_location_found) { |
659 | 678 | $gd_city = ''; |
660 | 679 | |
661 | - if (geodir_strtolower($default_location->country_slug) == geodir_strtolower($gd_country)) |
|
662 | - $is_geodir_location_found = true; |
|
680 | + if (geodir_strtolower($default_location->country_slug) == geodir_strtolower($gd_country)) { |
|
681 | + $is_geodir_location_found = true; |
|
682 | + } |
|
663 | 683 | } |
664 | - } else if ($geodir_show_location_url == 'region_city') { |
|
684 | + } else if ($geodir_show_location_url == 'region_city') { |
|
665 | 685 | if (count($geodir_terms) >= 2) { |
666 | 686 | $gd_region = urldecode($geodir_terms[0]); |
667 | 687 | $gd_city = urldecode($geodir_terms[1]); |
@@ -669,15 +689,17 @@ discard block |
||
669 | 689 | $gd_region = urldecode($geodir_terms[0]); |
670 | 690 | } |
671 | 691 | |
672 | - if (geodir_strtolower($default_location->region_slug) == geodir_strtolower($gd_region) && geodir_strtolower($default_location->city_slug) == geodir_strtolower($gd_city)) |
|
673 | - $is_geodir_location_found = true; |
|
692 | + if (geodir_strtolower($default_location->region_slug) == geodir_strtolower($gd_region) && geodir_strtolower($default_location->city_slug) == geodir_strtolower($gd_city)) { |
|
693 | + $is_geodir_location_found = true; |
|
694 | + } |
|
674 | 695 | |
675 | 696 | // if location has not been found for region and city then search for region only |
676 | 697 | if (!$is_geodir_location_found) { |
677 | 698 | $gd_city = ''; |
678 | 699 | |
679 | - if (geodir_strtolower($default_location->region_slug) == geodir_strtolower($gd_region)) |
|
680 | - $is_geodir_location_found = true; |
|
700 | + if (geodir_strtolower($default_location->region_slug) == geodir_strtolower($gd_region)) { |
|
701 | + $is_geodir_location_found = true; |
|
702 | + } |
|
681 | 703 | } |
682 | 704 | } else { |
683 | 705 | $gd_city = $geodir_terms[0]; |
@@ -719,14 +741,17 @@ discard block |
||
719 | 741 | |
720 | 742 | $wp->query_vars[$geodir_taxonomy] = $geodir_term; |
721 | 743 | // eliminate location related terms from taxonomy term |
722 | - if ($gd_country != '') |
|
723 | - $wp->query_vars[$geodir_taxonomy] = preg_replace('/' . urlencode($gd_country) . '/', '', $wp->query_vars[$geodir_taxonomy], 1); |
|
744 | + if ($gd_country != '') { |
|
745 | + $wp->query_vars[$geodir_taxonomy] = preg_replace('/' . urlencode($gd_country) . '/', '', $wp->query_vars[$geodir_taxonomy], 1); |
|
746 | + } |
|
724 | 747 | |
725 | - if ($gd_region != '') |
|
726 | - $wp->query_vars[$geodir_taxonomy] = preg_replace('/' . urlencode($gd_region) . '/', '', $wp->query_vars[$geodir_taxonomy], 1); |
|
748 | + if ($gd_region != '') { |
|
749 | + $wp->query_vars[$geodir_taxonomy] = preg_replace('/' . urlencode($gd_region) . '/', '', $wp->query_vars[$geodir_taxonomy], 1); |
|
750 | + } |
|
727 | 751 | |
728 | - if ($gd_city != '') |
|
729 | - $wp->query_vars[$geodir_taxonomy] = preg_replace('/' . urlencode($gd_city) . '/', '', $wp->query_vars[$geodir_taxonomy], 1); |
|
752 | + if ($gd_city != '') { |
|
753 | + $wp->query_vars[$geodir_taxonomy] = preg_replace('/' . urlencode($gd_city) . '/', '', $wp->query_vars[$geodir_taxonomy], 1); |
|
754 | + } |
|
730 | 755 | |
731 | 756 | |
732 | 757 | $wp->query_vars[$geodir_taxonomy] = str_replace('///', '', $wp->query_vars[$geodir_taxonomy]); |
@@ -762,27 +787,34 @@ discard block |
||
762 | 787 | if (get_option('geodir_add_location_url')) { |
763 | 788 | if ($geodir_show_location_url == 'all') { |
764 | 789 | } else if ($geodir_show_location_url == 'country_city') { |
765 | - if (isset($wp->query_vars['gd_region'])) |
|
766 | - $wp->query_vars['gd_region'] = ''; |
|
790 | + if (isset($wp->query_vars['gd_region'])) { |
|
791 | + $wp->query_vars['gd_region'] = ''; |
|
792 | + } |
|
767 | 793 | } else if ($geodir_show_location_url == 'region_city') { |
768 | - if (isset($wp->query_vars['gd_country'])) |
|
769 | - $wp->query_vars['gd_country'] = ''; |
|
794 | + if (isset($wp->query_vars['gd_country'])) { |
|
795 | + $wp->query_vars['gd_country'] = ''; |
|
796 | + } |
|
770 | 797 | } else { |
771 | - if (isset($wp->query_vars['gd_country'])) |
|
772 | - $wp->query_vars['gd_country'] = ''; |
|
798 | + if (isset($wp->query_vars['gd_country'])) { |
|
799 | + $wp->query_vars['gd_country'] = ''; |
|
800 | + } |
|
773 | 801 | |
774 | - if (isset($wp->query_vars['gd_region'])) |
|
775 | - $wp->query_vars['gd_region'] = ''; |
|
802 | + if (isset($wp->query_vars['gd_region'])) { |
|
803 | + $wp->query_vars['gd_region'] = ''; |
|
804 | + } |
|
776 | 805 | } |
777 | 806 | } else { |
778 | - if (isset($wp->query_vars['gd_country'])) |
|
779 | - $wp->query_vars['gd_country'] = ''; |
|
807 | + if (isset($wp->query_vars['gd_country'])) { |
|
808 | + $wp->query_vars['gd_country'] = ''; |
|
809 | + } |
|
780 | 810 | |
781 | - if (isset($wp->query_vars['gd_region'])) |
|
782 | - $wp->query_vars['gd_region'] = ''; |
|
811 | + if (isset($wp->query_vars['gd_region'])) { |
|
812 | + $wp->query_vars['gd_region'] = ''; |
|
813 | + } |
|
783 | 814 | |
784 | - if (isset($wp->query_vars['gd_city'])) |
|
785 | - $wp->query_vars['gd_city'] = ''; |
|
815 | + if (isset($wp->query_vars['gd_city'])) { |
|
816 | + $wp->query_vars['gd_city'] = ''; |
|
817 | + } |
|
786 | 818 | } |
787 | 819 | } |
788 | 820 | |
@@ -894,8 +926,9 @@ discard block |
||
894 | 926 | function geodir_exclude_page_where($where) |
895 | 927 | { |
896 | 928 | global $wpdb; |
897 | - if (is_admin()) |
|
898 | - $where .= " AND $wpdb->posts.post_status != 'virtual'"; |
|
929 | + if (is_admin()) { |
|
930 | + $where .= " AND $wpdb->posts.post_status != 'virtual'"; |
|
931 | + } |
|
899 | 932 | |
900 | 933 | return $where; |
901 | 934 | } |
@@ -16,8 +16,9 @@ |
||
16 | 16 | * the visitor has not yet entered the password we will |
17 | 17 | * return early without loading the comments. |
18 | 18 | */ |
19 | -if (post_password_required()) |
|
20 | - return; |
|
19 | +if (post_password_required()) { |
|
20 | + return; |
|
21 | +} |
|
21 | 22 | ?> |
22 | 23 | |
23 | 24 | <div id="comments" class="comments-area"> |
@@ -61,10 +61,11 @@ |
||
61 | 61 | ob_start(); |
62 | 62 | echo '<h5 class="geodir_information">'; |
63 | 63 | |
64 | - if (!isset($_REQUEST['pid'])) |
|
65 | - printf(GOING_TO_FREE_MSG, $type_title, $alive_days); |
|
66 | - else |
|
67 | - printf(GOING_TO_UPDATE_MSG, $type_title, $alive_days); |
|
64 | + if (!isset($_REQUEST['pid'])) { |
|
65 | + printf(GOING_TO_FREE_MSG, $type_title, $alive_days); |
|
66 | + } else { |
|
67 | + printf(GOING_TO_UPDATE_MSG, $type_title, $alive_days); |
|
68 | + } |
|
68 | 69 | |
69 | 70 | echo '</h5>'; |
70 | 71 | $publish_listing_form_message = ob_get_clean(); |
@@ -353,7 +353,7 @@ |
||
353 | 353 | |
354 | 354 | if(!$cpt_left){ |
355 | 355 | $cpt_left = "gd-cpt-flat"; |
356 | - }else{ |
|
356 | + } else{ |
|
357 | 357 | $cpt_left = ''; |
358 | 358 | } |
359 | 359 |
@@ -192,8 +192,9 @@ |
||
192 | 192 | |
193 | 193 | foreach ($map_zoom_level as $level) { |
194 | 194 | $selected = ''; |
195 | - if ($level == $zoom) |
|
196 | - $selected = 'selected="selected"'; |
|
195 | + if ($level == $zoom) { |
|
196 | + $selected = 'selected="selected"'; |
|
197 | + } |
|
197 | 198 | |
198 | 199 | echo '<option ' . $selected . ' value="' . $level . '">' . $level . '</option>'; |
199 | 200 |
@@ -23,8 +23,12 @@ |
||
23 | 23 | |
24 | 24 | $collate = ''; |
25 | 25 | if ($wpdb->has_cap('collation')) { |
26 | - if (!empty($wpdb->charset)) $collate = "DEFAULT CHARACTER SET $wpdb->charset"; |
|
27 | - if (!empty($wpdb->collate)) $collate .= " COLLATE $wpdb->collate"; |
|
26 | + if (!empty($wpdb->charset)) { |
|
27 | + $collate = "DEFAULT CHARACTER SET $wpdb->charset"; |
|
28 | + } |
|
29 | + if (!empty($wpdb->collate)) { |
|
30 | + $collate .= " COLLATE $wpdb->collate"; |
|
31 | + } |
|
28 | 32 | } |
29 | 33 | |
30 | 34 | /** |
@@ -126,8 +126,10 @@ |
||
126 | 126 | $regexp = "<a\s[^>]*href=(\"??)([^\" >]*?)\\1[^>]*>(.*)<\/a>"; |
127 | 127 | if (preg_match_all("/$regexp/siU", $crums, $matches)) { |
128 | 128 | return $matches[0]; |
129 | - } else return ''; |
|
130 | -} |
|
129 | + } else { |
|
130 | + return ''; |
|
131 | + } |
|
132 | + } |
|
131 | 133 | |
132 | 134 | |
133 | 135 | /** |
@@ -1,6 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | // Exit if accessed directly. |
3 | -if (!defined( 'ABSPATH' ) ) exit; |
|
3 | +if (!defined( 'ABSPATH' ) ) { |
|
4 | + exit; |
|
5 | +} |
|
4 | 6 | |
5 | 7 | /** |
6 | 8 | * Geodir_Session Class. |