@@ -46,7 +46,6 @@ discard block |
||
46 | 46 | * @since 1.0.0 |
47 | 47 | * @since 1.5.2 Added TERRAIN map type. |
48 | 48 | * |
49 | - * @param string $value Input value to validate measurement. |
|
50 | 49 | * @return string The measurement valud in valid format. |
51 | 50 | */ |
52 | 51 | function gdsc_validate_map_args($params) |
@@ -95,7 +94,7 @@ discard block |
||
95 | 94 | * @param mixed $in The variable to check |
96 | 95 | * @param bool $strict If set to false, consider everything that is not false to be true. |
97 | 96 | * |
98 | - * @return bool The boolean equivalent or null |
|
97 | + * @return null|boolean The boolean equivalent or null |
|
99 | 98 | */ |
100 | 99 | function gdsc_to_bool_val($in, $strict = false) |
101 | 100 | { |
@@ -559,19 +559,19 @@ discard block |
||
559 | 559 | $post_number = !empty($args['post_number']) ? $args['post_number'] : 10; |
560 | 560 | $add_location_filter = !empty($args['add_location_filter']) ? true : false; |
561 | 561 | $list_sort = !empty($args['list_sort']) ? $args['list_sort'] : 'latest'; |
562 | - $character_count = isset($args['character_count']) ? $args['character_count'] : ''; |
|
563 | - $layout = !empty($args['layout']) ? $args['layout'] : 'gridview_onehalf'; |
|
564 | - $with_pagination = !empty($args['with_pagination']) ? true : false; |
|
565 | - $event_type = !empty($args['event_type']) ? $args['event_type'] : ''; |
|
562 | + $character_count = isset($args['character_count']) ? $args['character_count'] : ''; |
|
563 | + $layout = !empty($args['layout']) ? $args['layout'] : 'gridview_onehalf'; |
|
564 | + $with_pagination = !empty($args['with_pagination']) ? true : false; |
|
565 | + $event_type = !empty($args['event_type']) ? $args['event_type'] : ''; |
|
566 | 566 | |
567 | 567 | $top_pagination = $with_pagination && !empty($args['top_pagination']) ? true : false; |
568 | - $bottom_pagination = $with_pagination && !empty($args['bottom_pagination']) ? true : false; |
|
568 | + $bottom_pagination = $with_pagination && !empty($args['bottom_pagination']) ? true : false; |
|
569 | 569 | |
570 | 570 | $shortcode_atts = !empty($args['shortcode_atts']) ? $args['shortcode_atts'] : array(); |
571 | 571 | |
572 | 572 | // ajax mode |
573 | - $geodir_ajax = !empty($args['geodir_ajax']) ? true : false; |
|
574 | - $pageno = $geodir_ajax && !empty($args['pageno']) ? $args['pageno'] : 1; |
|
573 | + $geodir_ajax = !empty($args['geodir_ajax']) ? true : false; |
|
574 | + $pageno = $geodir_ajax && !empty($args['pageno']) ? $args['pageno'] : 1; |
|
575 | 575 | |
576 | 576 | $query_args = array( |
577 | 577 | 'posts_per_page' => $post_number, |
@@ -722,7 +722,7 @@ discard block |
||
722 | 722 | if(!pid > 0 || !(container && typeof container != 'undefined')) { |
723 | 723 | return false; |
724 | 724 | } |
725 | - var scatts = "<?php echo addslashes(json_encode($shortcode_atts));?>"; |
|
725 | + var scatts = "<?php echo addslashes(json_encode($shortcode_atts)); ?>"; |
|
726 | 726 | |
727 | 727 | var data = { |
728 | 728 | 'action': 'geodir_sclistings', |
@@ -802,7 +802,7 @@ discard block |
||
802 | 802 | if ($max_page > 1 || $always_show) { |
803 | 803 | // Extra pagination info |
804 | 804 | $geodir_pagination_more_info = get_option('geodir_pagination_advance_info'); |
805 | - $start_no = ( $pageno - 1 ) * $posts_per_page + 1; |
|
805 | + $start_no = ($pageno - 1) * $posts_per_page + 1; |
|
806 | 806 | $end_no = min($pageno * $posts_per_page, $numposts); |
807 | 807 | |
808 | 808 | if ($geodir_pagination_more_info != '') { |
@@ -821,7 +821,7 @@ discard block |
||
821 | 821 | } |
822 | 822 | |
823 | 823 | if (($pageno - 1) > 0) { |
824 | - echo '<a class="gd-page-sc-prev" href="javascript:void(0);" onclick="gd_sc_gopage(this, ' . (int)($pageno - 1) . ');">' . $prelabel . '</a> '; |
|
824 | + echo '<a class="gd-page-sc-prev" href="javascript:void(0);" onclick="gd_sc_gopage(this, ' . (int) ($pageno - 1) . ');">' . $prelabel . '</a> '; |
|
825 | 825 | } |
826 | 826 | |
827 | 827 | for ($i = $pageno - $half_pages_to_show; $i <= $pageno + $half_pages_to_show; $i++) { |
@@ -829,17 +829,17 @@ discard block |
||
829 | 829 | if ($i == $pageno) { |
830 | 830 | echo "<strong class='on' class='gd-page-sc-act'>$i</strong>"; |
831 | 831 | } else { |
832 | - echo ' <a class="gd-page-sc-no" href="javascript:void(0);" onclick="gd_sc_gopage(this, ' . (int)$i . ');">' . $i . '</a> '; |
|
832 | + echo ' <a class="gd-page-sc-no" href="javascript:void(0);" onclick="gd_sc_gopage(this, ' . (int) $i . ');">' . $i . '</a> '; |
|
833 | 833 | } |
834 | 834 | } |
835 | 835 | } |
836 | 836 | |
837 | 837 | if (($pageno + 1) <= $max_page) { |
838 | - echo ' <a class="gd-page-sc-nxt" href="javascript:void(0);" onclick="gd_sc_gopage(this, ' . (int)($pageno + 1) . ');">' . $nxtlabel . '</a>'; |
|
838 | + echo ' <a class="gd-page-sc-nxt" href="javascript:void(0);" onclick="gd_sc_gopage(this, ' . (int) ($pageno + 1) . ');">' . $nxtlabel . '</a>'; |
|
839 | 839 | } |
840 | 840 | |
841 | 841 | if ($pageno < $max_page) { |
842 | - echo ' <a class="gd-page-sc-lst" href="javascript:void(0);" onclick="gd_sc_gopage(this, ' . (int)$max_page . ');">»</a>'; |
|
842 | + echo ' <a class="gd-page-sc-lst" href="javascript:void(0);" onclick="gd_sc_gopage(this, ' . (int) $max_page . ');">»</a>'; |
|
843 | 843 | } |
844 | 844 | echo "</div> $after"; |
845 | 845 | } |
@@ -862,7 +862,7 @@ discard block |
||
862 | 862 | $scatts = isset($_POST['scatts']) ? $_POST['scatts'] : NULL; |
863 | 863 | $pageno = isset($_POST['pageno']) ? absint($_POST['pageno']) : 1; |
864 | 864 | |
865 | - $shortcode_atts = !empty($scatts) ? (array)json_decode(stripslashes_deep($scatts)) : NULL; |
|
865 | + $shortcode_atts = !empty($scatts) ? (array) json_decode(stripslashes_deep($scatts)) : NULL; |
|
866 | 866 | |
867 | 867 | if (!empty($shortcode_atts) && is_array($shortcode_atts)) { |
868 | 868 | $shortcode_atts['pageno'] = $pageno; |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | |
10 | 10 | // If this file is called directly, abort. |
11 | 11 | if (!defined('WPINC')) { |
12 | - die; |
|
12 | + die; |
|
13 | 13 | } |
14 | 14 | |
15 | 15 | /** |
@@ -22,22 +22,22 @@ discard block |
||
22 | 22 | */ |
23 | 23 | function gdsc_validate_measurements($value) |
24 | 24 | { |
25 | - if ((strlen($value) - 1) == strpos(trim($value), '%')) { |
|
26 | - // $value is entered as a percent, so it can't be less than 0 or more than 100 |
|
27 | - $value = preg_replace('/\D/', '', $value); |
|
28 | - if (100 < $value) { |
|
29 | - $value = 100; |
|
30 | - } |
|
31 | - // Re-add the percent symbol |
|
32 | - $value = $value . '%'; |
|
33 | - } elseif ((strlen($value) - 2) == strpos(trim($value), 'px')) { |
|
34 | - // Get the absint & re-add the 'px' |
|
35 | - $value = preg_replace('/\D/', '', $value) . 'px'; |
|
36 | - } else { |
|
37 | - $value = preg_replace('/\D/', '', $value); |
|
38 | - } |
|
39 | - |
|
40 | - return $value; |
|
25 | + if ((strlen($value) - 1) == strpos(trim($value), '%')) { |
|
26 | + // $value is entered as a percent, so it can't be less than 0 or more than 100 |
|
27 | + $value = preg_replace('/\D/', '', $value); |
|
28 | + if (100 < $value) { |
|
29 | + $value = 100; |
|
30 | + } |
|
31 | + // Re-add the percent symbol |
|
32 | + $value = $value . '%'; |
|
33 | + } elseif ((strlen($value) - 2) == strpos(trim($value), 'px')) { |
|
34 | + // Get the absint & re-add the 'px' |
|
35 | + $value = preg_replace('/\D/', '', $value) . 'px'; |
|
36 | + } else { |
|
37 | + $value = preg_replace('/\D/', '', $value); |
|
38 | + } |
|
39 | + |
|
40 | + return $value; |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | /** |
@@ -52,35 +52,35 @@ discard block |
||
52 | 52 | function gdsc_validate_map_args($params) |
53 | 53 | { |
54 | 54 | |
55 | - $params['width'] = gdsc_validate_measurements($params['width']); |
|
56 | - $params['height'] = gdsc_validate_measurements($params['height']); |
|
55 | + $params['width'] = gdsc_validate_measurements($params['width']); |
|
56 | + $params['height'] = gdsc_validate_measurements($params['height']); |
|
57 | 57 | |
58 | - // Only accept our 4 maptypes. Otherwise, revert to the default. |
|
59 | - if (!(in_array(geodir_strtoupper($params['maptype']), array('HYBRID', 'SATELLITE', 'ROADMAP', 'TERRAIN')))) { |
|
60 | - $params['maptype'] = 'ROADMAP'; |
|
61 | - } else { |
|
62 | - $params['maptype'] = geodir_strtoupper($params['maptype']); |
|
63 | - } |
|
58 | + // Only accept our 4 maptypes. Otherwise, revert to the default. |
|
59 | + if (!(in_array(geodir_strtoupper($params['maptype']), array('HYBRID', 'SATELLITE', 'ROADMAP', 'TERRAIN')))) { |
|
60 | + $params['maptype'] = 'ROADMAP'; |
|
61 | + } else { |
|
62 | + $params['maptype'] = geodir_strtoupper($params['maptype']); |
|
63 | + } |
|
64 | 64 | |
65 | - // Zoom accepts a value between 1 and 19 |
|
66 | - $params['zoom'] = absint($params['zoom']); |
|
67 | - if (19 < $params['zoom']) { |
|
68 | - $params['zoom'] = '19'; |
|
69 | - } |
|
70 | - if (0 == $params['zoom']) { |
|
71 | - $params['zoom'] = '1'; |
|
72 | - } |
|
65 | + // Zoom accepts a value between 1 and 19 |
|
66 | + $params['zoom'] = absint($params['zoom']); |
|
67 | + if (19 < $params['zoom']) { |
|
68 | + $params['zoom'] = '19'; |
|
69 | + } |
|
70 | + if (0 == $params['zoom']) { |
|
71 | + $params['zoom'] = '1'; |
|
72 | + } |
|
73 | 73 | |
74 | - // Child_collapse must be boolean |
|
75 | - $params['child_collapse'] = gdsc_to_bool_val($params['child_collapse']); |
|
74 | + // Child_collapse must be boolean |
|
75 | + $params['child_collapse'] = gdsc_to_bool_val($params['child_collapse']); |
|
76 | 76 | |
77 | - // Scrollwheel must be boolean |
|
78 | - $params['scrollwheel'] = gdsc_to_bool_val($params['scrollwheel']); |
|
77 | + // Scrollwheel must be boolean |
|
78 | + $params['scrollwheel'] = gdsc_to_bool_val($params['scrollwheel']); |
|
79 | 79 | |
80 | - // Scrollwheel must be boolean |
|
81 | - $params['autozoom'] = gdsc_to_bool_val($params['autozoom']); |
|
80 | + // Scrollwheel must be boolean |
|
81 | + $params['autozoom'] = gdsc_to_bool_val($params['autozoom']); |
|
82 | 82 | |
83 | - return $params; |
|
83 | + return $params; |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | /** |
@@ -99,52 +99,52 @@ discard block |
||
99 | 99 | */ |
100 | 100 | function gdsc_to_bool_val($in, $strict = false) |
101 | 101 | { |
102 | - $out = null; |
|
103 | - |
|
104 | - // if not strict, we only have to check if something is false |
|
105 | - if (in_array($in, array( |
|
106 | - 'false', |
|
107 | - 'False', |
|
108 | - 'FALSE', |
|
109 | - 'no', |
|
110 | - 'No', |
|
111 | - 'n', |
|
112 | - 'N', |
|
113 | - '0', |
|
114 | - 'off', |
|
115 | - 'Off', |
|
116 | - 'OFF', |
|
117 | - false, |
|
118 | - 0, |
|
119 | - null |
|
120 | - ), true)) { |
|
121 | - $out = false; |
|
122 | - } else if ($strict) { |
|
123 | - // if strict, check the equivalent true values |
|
124 | - if (in_array($in, array( |
|
125 | - 'true', |
|
126 | - 'True', |
|
127 | - 'TRUE', |
|
128 | - 'yes', |
|
129 | - 'Yes', |
|
130 | - 'y', |
|
131 | - 'Y', |
|
132 | - '1', |
|
133 | - 'on', |
|
134 | - 'On', |
|
135 | - 'ON', |
|
136 | - true, |
|
137 | - 1 |
|
138 | - ), true)) { |
|
139 | - $out = true; |
|
140 | - } |
|
141 | - } else { |
|
142 | - // not strict? let the regular php bool check figure it out (will |
|
143 | - // largely default to true) |
|
144 | - $out = ($in ? true : false); |
|
145 | - } |
|
146 | - |
|
147 | - return $out; |
|
102 | + $out = null; |
|
103 | + |
|
104 | + // if not strict, we only have to check if something is false |
|
105 | + if (in_array($in, array( |
|
106 | + 'false', |
|
107 | + 'False', |
|
108 | + 'FALSE', |
|
109 | + 'no', |
|
110 | + 'No', |
|
111 | + 'n', |
|
112 | + 'N', |
|
113 | + '0', |
|
114 | + 'off', |
|
115 | + 'Off', |
|
116 | + 'OFF', |
|
117 | + false, |
|
118 | + 0, |
|
119 | + null |
|
120 | + ), true)) { |
|
121 | + $out = false; |
|
122 | + } else if ($strict) { |
|
123 | + // if strict, check the equivalent true values |
|
124 | + if (in_array($in, array( |
|
125 | + 'true', |
|
126 | + 'True', |
|
127 | + 'TRUE', |
|
128 | + 'yes', |
|
129 | + 'Yes', |
|
130 | + 'y', |
|
131 | + 'Y', |
|
132 | + '1', |
|
133 | + 'on', |
|
134 | + 'On', |
|
135 | + 'ON', |
|
136 | + true, |
|
137 | + 1 |
|
138 | + ), true)) { |
|
139 | + $out = true; |
|
140 | + } |
|
141 | + } else { |
|
142 | + // not strict? let the regular php bool check figure it out (will |
|
143 | + // largely default to true) |
|
144 | + $out = ($in ? true : false); |
|
145 | + } |
|
146 | + |
|
147 | + return $out; |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | /** |
@@ -157,16 +157,16 @@ discard block |
||
157 | 157 | */ |
158 | 158 | function gdsc_is_post_type_valid($incoming_post_type) |
159 | 159 | { |
160 | - $post_types = geodir_get_posttypes(); |
|
161 | - $post_types = array_map('geodir_strtolower', $post_types); |
|
162 | - $post_type_found = false; |
|
163 | - foreach ($post_types as $type) { |
|
164 | - if (geodir_strtolower($incoming_post_type) == geodir_strtolower($type)) { |
|
165 | - $post_type_found = true; |
|
166 | - } |
|
167 | - } |
|
168 | - |
|
169 | - return $post_type_found; |
|
160 | + $post_types = geodir_get_posttypes(); |
|
161 | + $post_types = array_map('geodir_strtolower', $post_types); |
|
162 | + $post_type_found = false; |
|
163 | + foreach ($post_types as $type) { |
|
164 | + if (geodir_strtolower($incoming_post_type) == geodir_strtolower($type)) { |
|
165 | + $post_type_found = true; |
|
166 | + } |
|
167 | + } |
|
168 | + |
|
169 | + return $post_type_found; |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | /** |
@@ -186,52 +186,52 @@ discard block |
||
186 | 186 | */ |
187 | 187 | function gdsc_listing_loop_filter($query) |
188 | 188 | { |
189 | - global $wp_query, $geodir_post_type, $table, $plugin_prefix, $term; |
|
190 | - |
|
191 | - $geodir_post_type = geodir_get_current_posttype(); |
|
192 | - |
|
193 | - if (isset($wp_query->tax_query->queries) && $wp_query->tax_query->queries) { |
|
194 | - $taxonomies = wp_list_pluck($wp_query->tax_query->queries, 'taxonomy'); |
|
195 | - |
|
196 | - if (isset($wp_query->query[$taxonomies[0]])) { |
|
197 | - $request_term = explode("/", $wp_query->query[$taxonomies[0]]); |
|
198 | - $request_term = end($request_term); |
|
199 | - if (!term_exists($request_term)) { |
|
200 | - $args = array('number' => '1',); |
|
201 | - $terms_arr = get_terms($taxonomies[0], $args); |
|
202 | - foreach ($terms_arr as $location_term) { |
|
203 | - $term_arr = $location_term; |
|
204 | - $term_arr->name = geodir_ucwords(str_replace('-', ' ', $request_term)); |
|
205 | - } |
|
206 | - $wp_query->queried_object_id = 1; |
|
207 | - $wp_query->queried_object = $term_arr; |
|
208 | - } |
|
209 | - } |
|
189 | + global $wp_query, $geodir_post_type, $table, $plugin_prefix, $term; |
|
190 | + |
|
191 | + $geodir_post_type = geodir_get_current_posttype(); |
|
192 | + |
|
193 | + if (isset($wp_query->tax_query->queries) && $wp_query->tax_query->queries) { |
|
194 | + $taxonomies = wp_list_pluck($wp_query->tax_query->queries, 'taxonomy'); |
|
195 | + |
|
196 | + if (isset($wp_query->query[$taxonomies[0]])) { |
|
197 | + $request_term = explode("/", $wp_query->query[$taxonomies[0]]); |
|
198 | + $request_term = end($request_term); |
|
199 | + if (!term_exists($request_term)) { |
|
200 | + $args = array('number' => '1',); |
|
201 | + $terms_arr = get_terms($taxonomies[0], $args); |
|
202 | + foreach ($terms_arr as $location_term) { |
|
203 | + $term_arr = $location_term; |
|
204 | + $term_arr->name = geodir_ucwords(str_replace('-', ' ', $request_term)); |
|
205 | + } |
|
206 | + $wp_query->queried_object_id = 1; |
|
207 | + $wp_query->queried_object = $term_arr; |
|
208 | + } |
|
209 | + } |
|
210 | 210 | |
211 | - } |
|
212 | - if (isset($query->query_vars['is_geodir_loop']) && $query->query_vars['is_geodir_loop']) { |
|
211 | + } |
|
212 | + if (isset($query->query_vars['is_geodir_loop']) && $query->query_vars['is_geodir_loop']) { |
|
213 | 213 | |
214 | - $table = $plugin_prefix . $geodir_post_type . '_detail'; |
|
214 | + $table = $plugin_prefix . $geodir_post_type . '_detail'; |
|
215 | 215 | |
216 | - add_filter('posts_fields', 'geodir_posts_fields', 1); |
|
217 | - add_filter('posts_join', 'geodir_posts_join', 1); |
|
218 | - geodir_post_where(); |
|
219 | - if (!is_admin()) { |
|
220 | - add_filter('posts_orderby', 'geodir_posts_orderby', 1); |
|
221 | - } |
|
216 | + add_filter('posts_fields', 'geodir_posts_fields', 1); |
|
217 | + add_filter('posts_join', 'geodir_posts_join', 1); |
|
218 | + geodir_post_where(); |
|
219 | + if (!is_admin()) { |
|
220 | + add_filter('posts_orderby', 'geodir_posts_orderby', 1); |
|
221 | + } |
|
222 | 222 | |
223 | - // advanced filter for popular post view widget |
|
224 | - global $wp_query; |
|
225 | - if (!is_admin()) { |
|
226 | - if (!empty($wp_query->query['with_pics_only'])) { |
|
227 | - add_filter('posts_join', 'geodir_filter_widget_join', 1000); |
|
228 | - } |
|
229 | - add_filter('posts_where', 'geodir_filter_widget_where', 1000); |
|
230 | - } |
|
223 | + // advanced filter for popular post view widget |
|
224 | + global $wp_query; |
|
225 | + if (!is_admin()) { |
|
226 | + if (!empty($wp_query->query['with_pics_only'])) { |
|
227 | + add_filter('posts_join', 'geodir_filter_widget_join', 1000); |
|
228 | + } |
|
229 | + add_filter('posts_where', 'geodir_filter_widget_where', 1000); |
|
230 | + } |
|
231 | 231 | |
232 | - } |
|
232 | + } |
|
233 | 233 | |
234 | - return $query; |
|
234 | + return $query; |
|
235 | 235 | } |
236 | 236 | |
237 | 237 | /** |
@@ -245,40 +245,40 @@ discard block |
||
245 | 245 | */ |
246 | 246 | function gdsc_manage_category_choice($post_type, $category) |
247 | 247 | { |
248 | - if (0 == $category || '' == $category) { |
|
249 | - return ''; |
|
250 | - } |
|
248 | + if (0 == $category || '' == $category) { |
|
249 | + return ''; |
|
250 | + } |
|
251 | 251 | |
252 | - if (!(gdsc_is_post_type_valid($post_type))) { |
|
253 | - return ''; |
|
254 | - } |
|
252 | + if (!(gdsc_is_post_type_valid($post_type))) { |
|
253 | + return ''; |
|
254 | + } |
|
255 | 255 | |
256 | - $taxonomies = geodir_get_taxonomies($post_type); |
|
256 | + $taxonomies = geodir_get_taxonomies($post_type); |
|
257 | 257 | |
258 | - $categories = get_terms(array('taxonomy' => $taxonomies[0])); |
|
258 | + $categories = get_terms(array('taxonomy' => $taxonomies[0])); |
|
259 | 259 | |
260 | - $cat_id = 0; |
|
260 | + $cat_id = 0; |
|
261 | 261 | |
262 | - foreach ($categories as $cat) { |
|
263 | - if (is_numeric($category)) { |
|
264 | - if (absint($category) == $cat->term_id) { |
|
265 | - $cat_id = $cat->term_id; |
|
266 | - break; |
|
267 | - } |
|
268 | - } else { |
|
269 | - if ($category == $cat->slug) { |
|
270 | - $cat_id = $cat->term_id; |
|
271 | - break; |
|
272 | - } |
|
262 | + foreach ($categories as $cat) { |
|
263 | + if (is_numeric($category)) { |
|
264 | + if (absint($category) == $cat->term_id) { |
|
265 | + $cat_id = $cat->term_id; |
|
266 | + break; |
|
267 | + } |
|
268 | + } else { |
|
269 | + if ($category == $cat->slug) { |
|
270 | + $cat_id = $cat->term_id; |
|
271 | + break; |
|
272 | + } |
|
273 | 273 | |
274 | - if ($category == $cat->name) { |
|
275 | - $cat_id = $cat->term_id; |
|
276 | - break; |
|
277 | - } |
|
278 | - } |
|
279 | - } |
|
274 | + if ($category == $cat->name) { |
|
275 | + $cat_id = $cat->term_id; |
|
276 | + break; |
|
277 | + } |
|
278 | + } |
|
279 | + } |
|
280 | 280 | |
281 | - return $cat_id; |
|
281 | + return $cat_id; |
|
282 | 282 | } |
283 | 283 | |
284 | 284 | // @todo: Extract this |
@@ -288,11 +288,11 @@ discard block |
||
288 | 288 | * Adds the script in the page footer for the home page google map. |
289 | 289 | * |
290 | 290 | * @since 1.0.0 |
291 | - * @return string Print the script in page footer. |
|
291 | + * @return string Print the script in page footer. |
|
292 | 292 | */ |
293 | 293 | function geodir_home_map_add_script() |
294 | - { |
|
295 | - ?> |
|
294 | + { |
|
295 | + ?> |
|
296 | 296 | <script type="text/javascript"> |
297 | 297 | jQuery(document).ready(function () { |
298 | 298 | geoDirMapSlide(); |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | } |
366 | 366 | </script> |
367 | 367 | <?php |
368 | - } |
|
368 | + } |
|
369 | 369 | } |
370 | 370 | |
371 | 371 | /** |
@@ -376,7 +376,7 @@ discard block |
||
376 | 376 | */ |
377 | 377 | function geodir_popular_category_add_scripts() |
378 | 378 | { |
379 | - ?> |
|
379 | + ?> |
|
380 | 380 | <script type="text/javascript"> |
381 | 381 | jQuery(function ($) { |
382 | 382 | $('.geodir-showcat').click(function () { |
@@ -406,56 +406,56 @@ discard block |
||
406 | 406 | */ |
407 | 407 | function gdsc_validate_layout_choice($layout_choice) |
408 | 408 | { |
409 | - switch (geodir_strtolower($layout_choice)) { |
|
410 | - case 'list'; |
|
411 | - case 'one'; |
|
412 | - case 'one_column'; |
|
413 | - case 'onecolumn'; |
|
414 | - case '1'; |
|
415 | - $layout_choice = 'list'; |
|
416 | - break; |
|
417 | - case 'gridview_onehalf'; |
|
418 | - case 'two'; |
|
419 | - case 'two_column'; |
|
420 | - case 'two_columns'; |
|
421 | - case 'twocolumn'; |
|
422 | - case 'twocolumns'; |
|
423 | - case '2'; |
|
424 | - $layout_choice = 'gridview_onehalf'; |
|
425 | - break; |
|
426 | - case 'gridview_onethird'; |
|
427 | - case 'three'; |
|
428 | - case 'three_column'; |
|
429 | - case 'three_columns'; |
|
430 | - case 'threecolumn'; |
|
431 | - case 'threecolumns'; |
|
432 | - case '3'; |
|
433 | - $layout_choice = 'gridview_onethird'; |
|
434 | - break; |
|
435 | - case 'gridview_onefourth'; |
|
436 | - case 'four'; |
|
437 | - case 'four_column'; |
|
438 | - case 'four_columns'; |
|
439 | - case 'fourcolumn'; |
|
440 | - case 'fourcolumns'; |
|
441 | - case '4'; |
|
442 | - $layout_choice = 'gridview_onefourth'; |
|
443 | - break; |
|
444 | - case 'gridview_onefifth'; |
|
445 | - case 'five'; |
|
446 | - case 'five_column'; |
|
447 | - case 'five_columns'; |
|
448 | - case 'fivecolumn'; |
|
449 | - case 'fivecolumns'; |
|
450 | - case '5'; |
|
451 | - $layout_choice = 'gridview_onefifth'; |
|
452 | - break; |
|
453 | - default: |
|
454 | - $layout_choice = 'gridview_onehalf'; |
|
455 | - break; |
|
456 | - } |
|
457 | - |
|
458 | - return $layout_choice; |
|
409 | + switch (geodir_strtolower($layout_choice)) { |
|
410 | + case 'list'; |
|
411 | + case 'one'; |
|
412 | + case 'one_column'; |
|
413 | + case 'onecolumn'; |
|
414 | + case '1'; |
|
415 | + $layout_choice = 'list'; |
|
416 | + break; |
|
417 | + case 'gridview_onehalf'; |
|
418 | + case 'two'; |
|
419 | + case 'two_column'; |
|
420 | + case 'two_columns'; |
|
421 | + case 'twocolumn'; |
|
422 | + case 'twocolumns'; |
|
423 | + case '2'; |
|
424 | + $layout_choice = 'gridview_onehalf'; |
|
425 | + break; |
|
426 | + case 'gridview_onethird'; |
|
427 | + case 'three'; |
|
428 | + case 'three_column'; |
|
429 | + case 'three_columns'; |
|
430 | + case 'threecolumn'; |
|
431 | + case 'threecolumns'; |
|
432 | + case '3'; |
|
433 | + $layout_choice = 'gridview_onethird'; |
|
434 | + break; |
|
435 | + case 'gridview_onefourth'; |
|
436 | + case 'four'; |
|
437 | + case 'four_column'; |
|
438 | + case 'four_columns'; |
|
439 | + case 'fourcolumn'; |
|
440 | + case 'fourcolumns'; |
|
441 | + case '4'; |
|
442 | + $layout_choice = 'gridview_onefourth'; |
|
443 | + break; |
|
444 | + case 'gridview_onefifth'; |
|
445 | + case 'five'; |
|
446 | + case 'five_column'; |
|
447 | + case 'five_columns'; |
|
448 | + case 'fivecolumn'; |
|
449 | + case 'fivecolumns'; |
|
450 | + case '5'; |
|
451 | + $layout_choice = 'gridview_onefifth'; |
|
452 | + break; |
|
453 | + default: |
|
454 | + $layout_choice = 'gridview_onehalf'; |
|
455 | + break; |
|
456 | + } |
|
457 | + |
|
458 | + return $layout_choice; |
|
459 | 459 | } |
460 | 460 | |
461 | 461 | /** |
@@ -468,20 +468,20 @@ discard block |
||
468 | 468 | */ |
469 | 469 | function gdsc_validate_sort_choice($sort_choice) |
470 | 470 | { |
471 | - $sorts = array( |
|
472 | - 'az', |
|
473 | - 'latest', |
|
474 | - 'featured', |
|
475 | - 'high_review', |
|
476 | - 'high_rating', |
|
477 | - 'random', |
|
478 | - ); |
|
479 | - |
|
480 | - if (!(in_array($sort_choice, $sorts))) { |
|
481 | - $sort_choice = 'latest'; |
|
482 | - } |
|
483 | - |
|
484 | - return $sort_choice; |
|
471 | + $sorts = array( |
|
472 | + 'az', |
|
473 | + 'latest', |
|
474 | + 'featured', |
|
475 | + 'high_review', |
|
476 | + 'high_rating', |
|
477 | + 'random', |
|
478 | + ); |
|
479 | + |
|
480 | + if (!(in_array($sort_choice, $sorts))) { |
|
481 | + $sort_choice = 'latest'; |
|
482 | + } |
|
483 | + |
|
484 | + return $sort_choice; |
|
485 | 485 | } |
486 | 486 | |
487 | 487 | /** |
@@ -494,22 +494,22 @@ discard block |
||
494 | 494 | */ |
495 | 495 | function gdsc_validate_listing_width($width_choice) |
496 | 496 | { |
497 | - if (!(empty($width_choice))) { |
|
498 | - $width_choice = absint($width_choice); |
|
499 | - } else { |
|
500 | - return ''; |
|
501 | - } |
|
502 | - |
|
503 | - if (100 < $width_choice) { |
|
504 | - $width_choice = 100; |
|
505 | - } |
|
506 | - |
|
507 | - // If listing_width is too narrow, it won't work, arbitrarily set to 10% here |
|
508 | - if (10 > $width_choice) { |
|
509 | - $width_choice = 10; |
|
510 | - } |
|
511 | - |
|
512 | - return $width_choice; |
|
497 | + if (!(empty($width_choice))) { |
|
498 | + $width_choice = absint($width_choice); |
|
499 | + } else { |
|
500 | + return ''; |
|
501 | + } |
|
502 | + |
|
503 | + if (100 < $width_choice) { |
|
504 | + $width_choice = 100; |
|
505 | + } |
|
506 | + |
|
507 | + // If listing_width is too narrow, it won't work, arbitrarily set to 10% here |
|
508 | + if (10 > $width_choice) { |
|
509 | + $width_choice = 10; |
|
510 | + } |
|
511 | + |
|
512 | + return $width_choice; |
|
513 | 513 | } |
514 | 514 | |
515 | 515 | /** |
@@ -522,18 +522,18 @@ discard block |
||
522 | 522 | */ |
523 | 523 | function gdsc_validate_list_filter_choice($filter_choice) |
524 | 524 | { |
525 | - $filters = array( |
|
526 | - 'all', |
|
527 | - 'today', |
|
528 | - 'upcoming', |
|
529 | - 'past', |
|
530 | - ); |
|
531 | - |
|
532 | - if (!(in_array($filter_choice, $filters))) { |
|
533 | - $filter_choice = 'all'; |
|
534 | - } |
|
535 | - |
|
536 | - return $filter_choice; |
|
525 | + $filters = array( |
|
526 | + 'all', |
|
527 | + 'today', |
|
528 | + 'upcoming', |
|
529 | + 'past', |
|
530 | + ); |
|
531 | + |
|
532 | + if (!(in_array($filter_choice, $filters))) { |
|
533 | + $filter_choice = 'all'; |
|
534 | + } |
|
535 | + |
|
536 | + return $filter_choice; |
|
537 | 537 | } |
538 | 538 | |
539 | 539 | /** |
@@ -553,7 +553,7 @@ discard block |
||
553 | 553 | * @return string Listings HTML content. |
554 | 554 | */ |
555 | 555 | function geodir_sc_gd_listings_output($args = array()) { |
556 | - $title = !empty($args['title']) ? __($args['title'], 'geodirectory') : ''; |
|
556 | + $title = !empty($args['title']) ? __($args['title'], 'geodirectory') : ''; |
|
557 | 557 | $post_type = !empty($args['post_type']) ? $args['post_type'] : 'gd_place'; |
558 | 558 | $category = !empty($args['category']) ? $args['category'] : '0'; |
559 | 559 | $post_number = !empty($args['post_number']) ? $args['post_number'] : 10; |
@@ -574,61 +574,61 @@ discard block |
||
574 | 574 | $pageno = $geodir_ajax && !empty($args['pageno']) ? $args['pageno'] : 1; |
575 | 575 | |
576 | 576 | $query_args = array( |
577 | - 'posts_per_page' => $post_number, |
|
578 | - 'is_geodir_loop' => true, |
|
579 | - 'gd_location' => $add_location_filter, |
|
580 | - 'post_type' => $post_type, |
|
581 | - 'order_by' => $list_sort, |
|
577 | + 'posts_per_page' => $post_number, |
|
578 | + 'is_geodir_loop' => true, |
|
579 | + 'gd_location' => $add_location_filter, |
|
580 | + 'post_type' => $post_type, |
|
581 | + 'order_by' => $list_sort, |
|
582 | 582 | 'pageno' => $pageno |
583 | - ); |
|
583 | + ); |
|
584 | 584 | |
585 | - if ($character_count >= 0) { |
|
586 | - $query_args['excerpt_length'] = $character_count; |
|
587 | - } |
|
585 | + if ($character_count >= 0) { |
|
586 | + $query_args['excerpt_length'] = $character_count; |
|
587 | + } |
|
588 | 588 | |
589 | - if (!empty($args['post_author'])) { |
|
590 | - $query_args['post_author'] = $args['post_author']; |
|
591 | - } |
|
589 | + if (!empty($args['post_author'])) { |
|
590 | + $query_args['post_author'] = $args['post_author']; |
|
591 | + } |
|
592 | 592 | |
593 | - if (!empty($args['show_featured_only'])) { |
|
594 | - $query_args['show_featured_only'] = 1; |
|
595 | - } |
|
593 | + if (!empty($args['show_featured_only'])) { |
|
594 | + $query_args['show_featured_only'] = 1; |
|
595 | + } |
|
596 | 596 | |
597 | - if (!empty($args['show_special_only'])) { |
|
598 | - $query_args['show_special_only'] = 1; |
|
599 | - } |
|
597 | + if (!empty($args['show_special_only'])) { |
|
598 | + $query_args['show_special_only'] = 1; |
|
599 | + } |
|
600 | 600 | |
601 | - if (!empty($args['with_pics_only'])) { |
|
602 | - $query_args['with_pics_only'] = 0; |
|
603 | - $query_args['featured_image_only'] = 1; |
|
604 | - } |
|
601 | + if (!empty($args['with_pics_only'])) { |
|
602 | + $query_args['with_pics_only'] = 0; |
|
603 | + $query_args['featured_image_only'] = 1; |
|
604 | + } |
|
605 | 605 | |
606 | - if (!empty($args['with_videos_only'])) { |
|
607 | - $query_args['with_videos_only'] = 1; |
|
608 | - } |
|
609 | - $with_no_results = !empty($args['without_no_results']) ? false : true; |
|
606 | + if (!empty($args['with_videos_only'])) { |
|
607 | + $query_args['with_videos_only'] = 1; |
|
608 | + } |
|
609 | + $with_no_results = !empty($args['without_no_results']) ? false : true; |
|
610 | 610 | |
611 | - if (!empty($category) && isset($category[0]) && $category[0] != '0') { |
|
612 | - $category_taxonomy = geodir_get_taxonomies($post_type); |
|
611 | + if (!empty($category) && isset($category[0]) && $category[0] != '0') { |
|
612 | + $category_taxonomy = geodir_get_taxonomies($post_type); |
|
613 | 613 | |
614 | - ######### WPML ######### |
|
615 | - if (function_exists('icl_object_id')) { |
|
616 | - $category = gd_lang_object_ids($category, $category_taxonomy[0]); |
|
617 | - } |
|
618 | - ######### WPML ######### |
|
614 | + ######### WPML ######### |
|
615 | + if (function_exists('icl_object_id')) { |
|
616 | + $category = gd_lang_object_ids($category, $category_taxonomy[0]); |
|
617 | + } |
|
618 | + ######### WPML ######### |
|
619 | 619 | |
620 | - $tax_query = array( |
|
621 | - 'taxonomy' => $category_taxonomy[0], |
|
622 | - 'field' => 'id', |
|
623 | - 'terms' => $category |
|
624 | - ); |
|
620 | + $tax_query = array( |
|
621 | + 'taxonomy' => $category_taxonomy[0], |
|
622 | + 'field' => 'id', |
|
623 | + 'terms' => $category |
|
624 | + ); |
|
625 | 625 | |
626 | - $query_args['tax_query'] = array($tax_query); |
|
627 | - } |
|
626 | + $query_args['tax_query'] = array($tax_query); |
|
627 | + } |
|
628 | 628 | |
629 | - global $gridview_columns_widget, $geodir_is_widget_listing; |
|
629 | + global $gridview_columns_widget, $geodir_is_widget_listing; |
|
630 | 630 | |
631 | - if ($post_type == 'gd_event' && function_exists('geodir_event_get_widget_events')) { |
|
631 | + if ($post_type == 'gd_event' && function_exists('geodir_event_get_widget_events')) { |
|
632 | 632 | global $geodir_event_widget_listview; |
633 | 633 | $geodir_event_widget_listview = true; |
634 | 634 | |
@@ -645,15 +645,15 @@ discard block |
||
645 | 645 | } |
646 | 646 | $current_gridview_columns_widget = $gridview_columns_widget; |
647 | 647 | |
648 | - ob_start(); |
|
648 | + ob_start(); |
|
649 | 649 | if (!empty($widget_listings) || $with_no_results) { |
650 | 650 | if (!$geodir_ajax) { |
651 | - /** |
|
652 | - * Called before the shortcode [gd_listings] content is output. |
|
653 | - * |
|
654 | - * @since 1.0.0 |
|
655 | - */ |
|
656 | - do_action('geodir_before_sc_gd_listings'); |
|
651 | + /** |
|
652 | + * Called before the shortcode [gd_listings] content is output. |
|
653 | + * |
|
654 | + * @since 1.0.0 |
|
655 | + */ |
|
656 | + do_action('geodir_before_sc_gd_listings'); |
|
657 | 657 | ?> |
658 | 658 | <div class="geodir_locations geodir_location_listing geodir-sc-gd-listings"> |
659 | 659 | <?php } ?> |
@@ -663,15 +663,15 @@ discard block |
||
663 | 663 | </div> |
664 | 664 | <?php } ?> |
665 | 665 | <?php |
666 | - if (strstr($layout, 'gridview')) { |
|
667 | - $listing_view_exp = explode('_', $layout); |
|
668 | - $gridview_columns_widget = $layout; |
|
669 | - $layout = $listing_view_exp[0]; |
|
670 | - } else { |
|
671 | - $gridview_columns_widget = ''; |
|
672 | - } |
|
666 | + if (strstr($layout, 'gridview')) { |
|
667 | + $listing_view_exp = explode('_', $layout); |
|
668 | + $gridview_columns_widget = $layout; |
|
669 | + $layout = $listing_view_exp[0]; |
|
670 | + } else { |
|
671 | + $gridview_columns_widget = ''; |
|
672 | + } |
|
673 | 673 | |
674 | - /** |
|
674 | + /** |
|
675 | 675 | * Filter the widget listing listview template. |
676 | 676 | * |
677 | 677 | * @since 1.0.0 |
@@ -680,43 +680,43 @@ discard block |
||
680 | 680 | */ |
681 | 681 | $template = apply_filters("geodir_template_part-widget-listing-listview", geodir_locate_template('widget-listing-listview')); |
682 | 682 | |
683 | - global $post, $map_jason, $map_canvas_arr, $gd_session; |
|
683 | + global $post, $map_jason, $map_canvas_arr, $gd_session; |
|
684 | 684 | |
685 | - $current_post = $post; |
|
686 | - $current_map_jason = $map_jason; |
|
687 | - $current_map_canvas_arr = $map_canvas_arr; |
|
688 | - $geodir_is_widget_listing = true; |
|
685 | + $current_post = $post; |
|
686 | + $current_map_jason = $map_jason; |
|
687 | + $current_map_canvas_arr = $map_canvas_arr; |
|
688 | + $geodir_is_widget_listing = true; |
|
689 | 689 | $gd_session->un_set('gd_listing_view'); |
690 | 690 | |
691 | - if ($with_pagination && $top_pagination) { |
|
691 | + if ($with_pagination && $top_pagination) { |
|
692 | 692 | echo geodir_sc_listings_pagination($total_posts, $post_number, $pageno); |
693 | 693 | } |
694 | 694 | |
695 | - /** |
|
696 | - * Includes listing listview template. |
|
697 | - * |
|
698 | - * @since 1.0.0 |
|
699 | - */ |
|
695 | + /** |
|
696 | + * Includes listing listview template. |
|
697 | + * |
|
698 | + * @since 1.0.0 |
|
699 | + */ |
|
700 | 700 | include($template); |
701 | 701 | |
702 | 702 | if ($with_pagination && $bottom_pagination) { |
703 | 703 | echo geodir_sc_listings_pagination($total_posts, $post_number, $pageno); |
704 | 704 | } |
705 | 705 | |
706 | - $geodir_is_widget_listing = false; |
|
706 | + $geodir_is_widget_listing = false; |
|
707 | 707 | |
708 | - $GLOBALS['post'] = $current_post; |
|
708 | + $GLOBALS['post'] = $current_post; |
|
709 | 709 | if (!empty($current_post)) { |
710 | - setup_postdata($current_post); |
|
710 | + setup_postdata($current_post); |
|
711 | 711 | } |
712 | - $map_jason = $current_map_jason; |
|
713 | - $map_canvas_arr = $current_map_canvas_arr; |
|
712 | + $map_jason = $current_map_jason; |
|
713 | + $map_canvas_arr = $current_map_canvas_arr; |
|
714 | 714 | global $gridview_columns_widget; |
715 | 715 | $gridview_columns_widget = $current_gridview_columns_widget; |
716 | 716 | ?> |
717 | 717 | <p class="geodir-sclisting-loading" style="display:none;"><i class="fa fa-cog fa-spin"></i></p> |
718 | 718 | <?php |
719 | - if (!$geodir_ajax) { |
|
719 | + if (!$geodir_ajax) { |
|
720 | 720 | ?> |
721 | 721 | </div> |
722 | 722 | <script type="text/javascript"> |
@@ -753,11 +753,11 @@ discard block |
||
753 | 753 | </script> |
754 | 754 | <?php } ?> |
755 | 755 | <?php |
756 | - } |
|
756 | + } |
|
757 | 757 | $output = ob_get_contents(); |
758 | - ob_end_clean(); |
|
758 | + ob_end_clean(); |
|
759 | 759 | |
760 | - return trim($output); |
|
760 | + return trim($output); |
|
761 | 761 | } |
762 | 762 | |
763 | 763 | /** |
@@ -784,15 +784,15 @@ discard block |
||
784 | 784 | * @return string Listings pagination HTML content. |
785 | 785 | */ |
786 | 786 | function geodir_sc_listings_pagination($total_posts, $posts_per_page, $pageno, $before = '', $after = '', $prelabel = '', $nxtlabel = '', $pages_to_show = 5, $always_show = false) { |
787 | - if (empty($prelabel)) { |
|
788 | - $prelabel = '<strong>«</strong>'; |
|
789 | - } |
|
787 | + if (empty($prelabel)) { |
|
788 | + $prelabel = '<strong>«</strong>'; |
|
789 | + } |
|
790 | 790 | |
791 | - if (empty($nxtlabel)) { |
|
792 | - $nxtlabel = '<strong>»</strong>'; |
|
793 | - } |
|
791 | + if (empty($nxtlabel)) { |
|
792 | + $nxtlabel = '<strong>»</strong>'; |
|
793 | + } |
|
794 | 794 | |
795 | - $half_pages_to_show = round($pages_to_show / 2); |
|
795 | + $half_pages_to_show = round($pages_to_show / 2); |
|
796 | 796 | |
797 | 797 | $numposts = $total_posts; |
798 | 798 | |
@@ -848,9 +848,9 @@ discard block |
||
848 | 848 | echo "</div> $after"; |
849 | 849 | } |
850 | 850 | $output = ob_get_contents(); |
851 | - ob_end_clean(); |
|
851 | + ob_end_clean(); |
|
852 | 852 | |
853 | - return trim($output); |
|
853 | + return trim($output); |
|
854 | 854 | } |
855 | 855 | |
856 | 856 | /** |
@@ -861,10 +861,10 @@ discard block |
||
861 | 861 | * @return string Listings HTML content. |
862 | 862 | */ |
863 | 863 | function geodir_sclistings_callback() { |
864 | - check_ajax_referer('geodir-sclistings-nonce', 'geodir_sclistings_nonce'); |
|
865 | - //set variables |
|
866 | - $scatts = isset($_POST['scatts']) ? $_POST['scatts'] : NULL; |
|
867 | - $pageno = isset($_POST['pageno']) ? absint($_POST['pageno']) : 1; |
|
864 | + check_ajax_referer('geodir-sclistings-nonce', 'geodir_sclistings_nonce'); |
|
865 | + //set variables |
|
866 | + $scatts = isset($_POST['scatts']) ? $_POST['scatts'] : NULL; |
|
867 | + $pageno = isset($_POST['pageno']) ? absint($_POST['pageno']) : 1; |
|
868 | 868 | |
869 | 869 | $shortcode_atts = !empty($scatts) ? (array)json_decode(stripslashes_deep($scatts)) : NULL; |
870 | 870 | |
@@ -876,7 +876,7 @@ discard block |
||
876 | 876 | } else { |
877 | 877 | echo 0; |
878 | 878 | } |
879 | - wp_die(); |
|
879 | + wp_die(); |
|
880 | 880 | } |
881 | 881 | add_action('wp_ajax_geodir_sclistings', 'geodir_sclistings_callback'); |
882 | 882 | add_action('wp_ajax_nopriv_geodir_sclistings', 'geodir_sclistings_callback'); |
883 | 883 | \ No newline at end of file |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | * @package GeoDirectory |
14 | 14 | * @global object $current_user Current user object. |
15 | 15 | * @param bool $redirect Optional. Do you want to redirect to signup page, if user not logged in? Default: false. |
16 | - * @return bool |
|
16 | + * @return null|boolean |
|
17 | 17 | */ |
18 | 18 | function geodir_is_login($redirect = false) |
19 | 19 | { |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | * |
70 | 70 | * @since 1.0.0 |
71 | 71 | * @package GeoDirectory |
72 | - * @return string|mixed|void The email ID. |
|
72 | + * @return string The email ID. |
|
73 | 73 | */ |
74 | 74 | function geodir_get_site_email_id() |
75 | 75 | { |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | if ($redirect) { |
23 | 23 | ?> |
24 | 24 | <script type="text/javascript"> |
25 | - window.location.href = '<?php echo geodir_login_url();?>'; |
|
25 | + window.location.href = '<?php echo geodir_login_url(); ?>'; |
|
26 | 26 | </script> |
27 | 27 | <?php |
28 | 28 | } else |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | */ |
237 | 237 | $message = apply_filters('password_reset_message', $message, $new_pass); |
238 | 238 | //geodir_sendEmail($fromEmail,$fromEmailName,$user_email,$user_name,$title,$message,$extra='');///forgot password email |
239 | - geodir_sendEmail($fromEmail, $fromEmailName, $user_email, $user_name, $title, $message, $extra = '', 'forgot_password', $post_id = '', $user->ID);///forgot password email |
|
239 | + geodir_sendEmail($fromEmail, $fromEmailName, $user_email, $user_name, $title, $message, $extra = '', 'forgot_password', $post_id = '', $user->ID); ///forgot password email |
|
240 | 240 | |
241 | 241 | return true; |
242 | 242 | } |
@@ -396,7 +396,7 @@ discard block |
||
396 | 396 | |
397 | 397 | /////////////customer email////////////// |
398 | 398 | //geodir_sendEmail($fromEmail,$fromEmailName,$user_email,$userName,$subject,$client_message,$extra='');///To client email |
399 | - geodir_sendEmail($fromEmail, $fromEmailName, $user_email, $userName, '', $message, '', 'registration', '', $user_id);/// registration email |
|
399 | + geodir_sendEmail($fromEmail, $fromEmailName, $user_email, $userName, '', $message, '', 'registration', '', $user_id); /// registration email |
|
400 | 400 | //////REGISTRATION EMAIL END//////// |
401 | 401 | } |
402 | 402 | |
@@ -507,7 +507,7 @@ discard block |
||
507 | 507 | exit(); |
508 | 508 | } |
509 | 509 | |
510 | - wp_redirect(geodir_login_url(array('error'=>'invalidkey','action'=>'lostpassword'))); |
|
510 | + wp_redirect(geodir_login_url(array('error'=>'invalidkey', 'action'=>'lostpassword'))); |
|
511 | 511 | exit(); |
512 | 512 | |
513 | 513 | break; |
@@ -725,7 +725,7 @@ discard block |
||
725 | 725 | if (isset($_REQUEST['pagetype']) && $_REQUEST['pagetype'] != '') { |
726 | 726 | wp_redirect($_REQUEST['pagetype'] . '&emsg=1'); |
727 | 727 | } else { |
728 | - wp_redirect(geodir_login_url(array('logemsg'=>'1','redirect_to'=>urlencode($_REQUEST['redirect_to'])))); |
|
728 | + wp_redirect(geodir_login_url(array('logemsg'=>'1', 'redirect_to'=>urlencode($_REQUEST['redirect_to'])))); |
|
729 | 729 | } |
730 | 730 | exit; |
731 | 731 | } |
@@ -1,10 +1,10 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Account Signup functions. |
|
4 | - * |
|
5 | - * @since 1.0.0 |
|
6 | - * @package GeoDirectory |
|
7 | - */ |
|
3 | + * Account Signup functions. |
|
4 | + * |
|
5 | + * @since 1.0.0 |
|
6 | + * @package GeoDirectory |
|
7 | + */ |
|
8 | 8 | |
9 | 9 | /** |
10 | 10 | * Check whether the user is logged in or not. |
@@ -17,18 +17,18 @@ discard block |
||
17 | 17 | */ |
18 | 18 | function geodir_is_login($redirect = false) |
19 | 19 | { |
20 | - global $current_user; |
|
21 | - if (!$current_user->ID) { |
|
22 | - if ($redirect) { |
|
23 | - ?> |
|
20 | + global $current_user; |
|
21 | + if (!$current_user->ID) { |
|
22 | + if ($redirect) { |
|
23 | + ?> |
|
24 | 24 | <script type="text/javascript"> |
25 | 25 | window.location.href = '<?php echo geodir_login_url();?>'; |
26 | 26 | </script> |
27 | 27 | <?php |
28 | - } else |
|
29 | - return false; |
|
30 | - } else |
|
31 | - return true; |
|
28 | + } else |
|
29 | + return false; |
|
30 | + } else |
|
31 | + return true; |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | /** |
@@ -42,25 +42,25 @@ discard block |
||
42 | 42 | { |
43 | 43 | |
44 | 44 | // Redirect to https login if forced to use SSL |
45 | - if (force_ssl_admin() && !is_ssl()) { |
|
46 | - if (0 === strpos($_SERVER['REQUEST_URI'], 'http')) { |
|
47 | - wp_redirect(preg_replace('|^http://|', 'https://', $_SERVER['REQUEST_URI'])); |
|
48 | - exit(); |
|
49 | - } else { |
|
50 | - wp_redirect('https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); |
|
51 | - exit(); |
|
52 | - } |
|
53 | - } |
|
54 | - |
|
55 | - /** |
|
56 | - * Filter the login message. |
|
57 | - * |
|
58 | - * @since 1.0.0 |
|
59 | - * |
|
60 | - * @param string $message Login message. |
|
61 | - */ |
|
62 | - $message = apply_filters('login_message', $message); |
|
63 | - if (!empty($message)) echo $message . "\n"; |
|
45 | + if (force_ssl_admin() && !is_ssl()) { |
|
46 | + if (0 === strpos($_SERVER['REQUEST_URI'], 'http')) { |
|
47 | + wp_redirect(preg_replace('|^http://|', 'https://', $_SERVER['REQUEST_URI'])); |
|
48 | + exit(); |
|
49 | + } else { |
|
50 | + wp_redirect('https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); |
|
51 | + exit(); |
|
52 | + } |
|
53 | + } |
|
54 | + |
|
55 | + /** |
|
56 | + * Filter the login message. |
|
57 | + * |
|
58 | + * @since 1.0.0 |
|
59 | + * |
|
60 | + * @param string $message Login message. |
|
61 | + */ |
|
62 | + $message = apply_filters('login_message', $message); |
|
63 | + if (!empty($message)) echo $message . "\n"; |
|
64 | 64 | |
65 | 65 | } |
66 | 66 | |
@@ -73,59 +73,59 @@ discard block |
||
73 | 73 | */ |
74 | 74 | function geodir_get_site_email_id() |
75 | 75 | { |
76 | - if (get_option('site_email')) { |
|
76 | + if (get_option('site_email')) { |
|
77 | 77 | |
78 | - return get_option('site_email'); |
|
78 | + return get_option('site_email'); |
|
79 | 79 | |
80 | - } else { |
|
80 | + } else { |
|
81 | 81 | |
82 | - return get_option('admin_email'); |
|
82 | + return get_option('admin_email'); |
|
83 | 83 | |
84 | - } |
|
84 | + } |
|
85 | 85 | |
86 | 86 | } |
87 | 87 | |
88 | 88 | |
89 | 89 | if (!function_exists('get_site_emailName')) { |
90 | - /** |
|
91 | - * Get site name for sending emails. |
|
92 | - * |
|
93 | - * @since 1.0.0 |
|
94 | - * @package GeoDirectory |
|
95 | - * @return string Site name. |
|
96 | - */ |
|
97 | - function get_site_emailName() |
|
90 | + /** |
|
91 | + * Get site name for sending emails. |
|
92 | + * |
|
93 | + * @since 1.0.0 |
|
94 | + * @package GeoDirectory |
|
95 | + * @return string Site name. |
|
96 | + */ |
|
97 | + function get_site_emailName() |
|
98 | 98 | |
99 | - { |
|
99 | + { |
|
100 | 100 | |
101 | - if (get_option('site_email_name')) { |
|
101 | + if (get_option('site_email_name')) { |
|
102 | 102 | |
103 | - return stripslashes(get_option('site_email_name')); |
|
103 | + return stripslashes(get_option('site_email_name')); |
|
104 | 104 | |
105 | - } else { |
|
105 | + } else { |
|
106 | 106 | |
107 | - return stripslashes(get_option('blogname')); |
|
107 | + return stripslashes(get_option('blogname')); |
|
108 | 108 | |
109 | - } |
|
109 | + } |
|
110 | 110 | |
111 | - } |
|
111 | + } |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | if (!function_exists('is_allow_user_register')) { |
115 | - /** |
|
116 | - * Checks whether the site allowing user registration or not. |
|
117 | - * |
|
118 | - * @since 1.0.0 |
|
119 | - * @package GeoDirectory |
|
120 | - * @return bool|string |
|
121 | - */ |
|
122 | - function is_allow_user_register() |
|
115 | + /** |
|
116 | + * Checks whether the site allowing user registration or not. |
|
117 | + * |
|
118 | + * @since 1.0.0 |
|
119 | + * @package GeoDirectory |
|
120 | + * @return bool|string |
|
121 | + */ |
|
122 | + function is_allow_user_register() |
|
123 | 123 | |
124 | - { |
|
124 | + { |
|
125 | 125 | |
126 | - return get_option('users_can_register'); |
|
126 | + return get_option('users_can_register'); |
|
127 | 127 | |
128 | - } |
|
128 | + } |
|
129 | 129 | } |
130 | 130 | |
131 | 131 | /** |
@@ -138,107 +138,107 @@ discard block |
||
138 | 138 | */ |
139 | 139 | function geodir_retrieve_password() |
140 | 140 | { |
141 | - global $wpdb; |
|
142 | - |
|
143 | - $errors = new WP_Error(); |
|
144 | - if (empty($_POST['user_login']) && empty($_POST['user_email'])) |
|
145 | - $errors->add('empty_username', __('<strong>ERROR</strong>: Enter a username or e-mail address.', 'geodirectory')); |
|
146 | - |
|
147 | - if (strpos($_POST['user_login'], '@')) { |
|
148 | - //$user_data = get_user_by_email(trim($_POST['user_login'])); |
|
149 | - $user_data = get_user_by('email', trim($_POST['user_login'])); |
|
150 | - if (empty($user_data)) |
|
151 | - $errors->add('invalid_email', __('<strong>ERROR</strong>: There is no user registered with that email address.', 'geodirectory')); |
|
152 | - } else { |
|
153 | - $login = trim($_POST['user_login']); |
|
154 | - $user_data = get_user_by('email', $login); |
|
155 | - } |
|
156 | - |
|
157 | - /** |
|
158 | - * Called in the geodir_retrieve_password() function before any errors are set or any emails are sent. |
|
159 | - * |
|
160 | - * @since 1.0.0 |
|
161 | - */ |
|
162 | - do_action('lostpassword_post'); |
|
163 | - |
|
164 | - if ($errors->get_error_code()) |
|
165 | - return $errors; |
|
166 | - |
|
167 | - if (!$user_data) { |
|
168 | - $errors->add('invalidcombo', __('<strong>ERROR</strong>: Invalid username or e-mail.', 'geodirectory')); |
|
169 | - return $errors; |
|
170 | - } |
|
171 | - |
|
172 | - // redefining user_login ensures we return the right case in the email |
|
173 | - $user_login = $user_data->user_login; |
|
174 | - $user_email = $user_data->user_email; |
|
175 | - |
|
176 | - /** |
|
177 | - * Called in the geodir_retrieve_password() function before any emails are sent. |
|
178 | - * |
|
179 | - * @since 1.0.0 |
|
180 | - * @param string $user_login The users username. |
|
181 | - */ |
|
182 | - do_action('retrieve_password', $user_login); |
|
183 | - |
|
184 | - //////////////////////////////////// |
|
185 | - $user_email = isset($_POST['user_email']) ? $_POST['user_email'] : ''; |
|
186 | - $user_login = $_POST['user_login']; |
|
187 | - |
|
188 | - $user = $wpdb->get_row( |
|
189 | - $wpdb->prepare( |
|
190 | - "SELECT * FROM $wpdb->users WHERE user_login like %s or user_email like %s", |
|
191 | - array($user_login, $user_login) |
|
192 | - ) |
|
193 | - ); |
|
194 | - |
|
195 | - if (empty($user)) |
|
196 | - return new WP_Error('invalid_key', __('Invalid key', 'geodirectory')); |
|
197 | - |
|
198 | - $new_pass = wp_generate_password(12, false); |
|
199 | - |
|
200 | - /** |
|
201 | - * Called in the geodir_retrieve_password() function before any emails are sent. |
|
202 | - * |
|
203 | - * @since 1.0.0 |
|
204 | - * @param object $user The user object. |
|
205 | - * @param string $new_pass The new pass being sent to the user. |
|
206 | - */ |
|
207 | - do_action('password_reset', $user, $new_pass); |
|
208 | - |
|
209 | - wp_set_password($new_pass, $user->ID); |
|
210 | - update_user_meta($user->ID, 'default_password_nag', true); //Set up the Password change nag. |
|
211 | - $message = '<p><b>' . __('Your login Information :', 'geodirectory') . '</b></p>'; |
|
212 | - $message .= '<p>' . sprintf(__('Username: %s', 'geodirectory'), $user->user_login) . "</p>"; |
|
213 | - $message .= '<p>' . sprintf(__('Password: %s', 'geodirectory'), $new_pass) . "</p>"; |
|
214 | - //$message .= '<p>You can login to : <a href="'.home_url().'/?ptype=login' . "\">Login</a> or the URL is : ".home_url()."/?ptype=login</p>"; |
|
215 | - //$message .= '<p>Thank You,<br> '.get_option('blogname').'</p>'; |
|
216 | - $user_email = $user_data->user_email; |
|
217 | - $user_name = geodir_get_client_name($user->ID); |
|
218 | - $fromEmail = geodir_get_site_email_id(); |
|
219 | - $fromEmailName = get_site_emailName(); |
|
220 | - $title = sprintf(__('[%s] Your new password', 'geodirectory'), get_option('blogname')); |
|
221 | - /** |
|
222 | - * Filter the password reset email subject part. |
|
223 | - * |
|
224 | - * @since 1.0.0 |
|
225 | - * |
|
226 | - * @param string $title Password reset email subject. |
|
227 | - */ |
|
228 | - $title = apply_filters('password_reset_title', $title); |
|
229 | - /** |
|
230 | - * Filter the password reset email message part. |
|
231 | - * |
|
232 | - * @since 1.0.0 |
|
233 | - * |
|
234 | - * @param string $message Password reset email message. |
|
235 | - * @param string $new_pass The new password string. |
|
236 | - */ |
|
237 | - $message = apply_filters('password_reset_message', $message, $new_pass); |
|
238 | - //geodir_sendEmail($fromEmail,$fromEmailName,$user_email,$user_name,$title,$message,$extra='');///forgot password email |
|
239 | - geodir_sendEmail($fromEmail, $fromEmailName, $user_email, $user_name, $title, $message, $extra = '', 'forgot_password', $post_id = '', $user->ID);///forgot password email |
|
240 | - |
|
241 | - return true; |
|
141 | + global $wpdb; |
|
142 | + |
|
143 | + $errors = new WP_Error(); |
|
144 | + if (empty($_POST['user_login']) && empty($_POST['user_email'])) |
|
145 | + $errors->add('empty_username', __('<strong>ERROR</strong>: Enter a username or e-mail address.', 'geodirectory')); |
|
146 | + |
|
147 | + if (strpos($_POST['user_login'], '@')) { |
|
148 | + //$user_data = get_user_by_email(trim($_POST['user_login'])); |
|
149 | + $user_data = get_user_by('email', trim($_POST['user_login'])); |
|
150 | + if (empty($user_data)) |
|
151 | + $errors->add('invalid_email', __('<strong>ERROR</strong>: There is no user registered with that email address.', 'geodirectory')); |
|
152 | + } else { |
|
153 | + $login = trim($_POST['user_login']); |
|
154 | + $user_data = get_user_by('email', $login); |
|
155 | + } |
|
156 | + |
|
157 | + /** |
|
158 | + * Called in the geodir_retrieve_password() function before any errors are set or any emails are sent. |
|
159 | + * |
|
160 | + * @since 1.0.0 |
|
161 | + */ |
|
162 | + do_action('lostpassword_post'); |
|
163 | + |
|
164 | + if ($errors->get_error_code()) |
|
165 | + return $errors; |
|
166 | + |
|
167 | + if (!$user_data) { |
|
168 | + $errors->add('invalidcombo', __('<strong>ERROR</strong>: Invalid username or e-mail.', 'geodirectory')); |
|
169 | + return $errors; |
|
170 | + } |
|
171 | + |
|
172 | + // redefining user_login ensures we return the right case in the email |
|
173 | + $user_login = $user_data->user_login; |
|
174 | + $user_email = $user_data->user_email; |
|
175 | + |
|
176 | + /** |
|
177 | + * Called in the geodir_retrieve_password() function before any emails are sent. |
|
178 | + * |
|
179 | + * @since 1.0.0 |
|
180 | + * @param string $user_login The users username. |
|
181 | + */ |
|
182 | + do_action('retrieve_password', $user_login); |
|
183 | + |
|
184 | + //////////////////////////////////// |
|
185 | + $user_email = isset($_POST['user_email']) ? $_POST['user_email'] : ''; |
|
186 | + $user_login = $_POST['user_login']; |
|
187 | + |
|
188 | + $user = $wpdb->get_row( |
|
189 | + $wpdb->prepare( |
|
190 | + "SELECT * FROM $wpdb->users WHERE user_login like %s or user_email like %s", |
|
191 | + array($user_login, $user_login) |
|
192 | + ) |
|
193 | + ); |
|
194 | + |
|
195 | + if (empty($user)) |
|
196 | + return new WP_Error('invalid_key', __('Invalid key', 'geodirectory')); |
|
197 | + |
|
198 | + $new_pass = wp_generate_password(12, false); |
|
199 | + |
|
200 | + /** |
|
201 | + * Called in the geodir_retrieve_password() function before any emails are sent. |
|
202 | + * |
|
203 | + * @since 1.0.0 |
|
204 | + * @param object $user The user object. |
|
205 | + * @param string $new_pass The new pass being sent to the user. |
|
206 | + */ |
|
207 | + do_action('password_reset', $user, $new_pass); |
|
208 | + |
|
209 | + wp_set_password($new_pass, $user->ID); |
|
210 | + update_user_meta($user->ID, 'default_password_nag', true); //Set up the Password change nag. |
|
211 | + $message = '<p><b>' . __('Your login Information :', 'geodirectory') . '</b></p>'; |
|
212 | + $message .= '<p>' . sprintf(__('Username: %s', 'geodirectory'), $user->user_login) . "</p>"; |
|
213 | + $message .= '<p>' . sprintf(__('Password: %s', 'geodirectory'), $new_pass) . "</p>"; |
|
214 | + //$message .= '<p>You can login to : <a href="'.home_url().'/?ptype=login' . "\">Login</a> or the URL is : ".home_url()."/?ptype=login</p>"; |
|
215 | + //$message .= '<p>Thank You,<br> '.get_option('blogname').'</p>'; |
|
216 | + $user_email = $user_data->user_email; |
|
217 | + $user_name = geodir_get_client_name($user->ID); |
|
218 | + $fromEmail = geodir_get_site_email_id(); |
|
219 | + $fromEmailName = get_site_emailName(); |
|
220 | + $title = sprintf(__('[%s] Your new password', 'geodirectory'), get_option('blogname')); |
|
221 | + /** |
|
222 | + * Filter the password reset email subject part. |
|
223 | + * |
|
224 | + * @since 1.0.0 |
|
225 | + * |
|
226 | + * @param string $title Password reset email subject. |
|
227 | + */ |
|
228 | + $title = apply_filters('password_reset_title', $title); |
|
229 | + /** |
|
230 | + * Filter the password reset email message part. |
|
231 | + * |
|
232 | + * @since 1.0.0 |
|
233 | + * |
|
234 | + * @param string $message Password reset email message. |
|
235 | + * @param string $new_pass The new password string. |
|
236 | + */ |
|
237 | + $message = apply_filters('password_reset_message', $message, $new_pass); |
|
238 | + //geodir_sendEmail($fromEmail,$fromEmailName,$user_email,$user_name,$title,$message,$extra='');///forgot password email |
|
239 | + geodir_sendEmail($fromEmail, $fromEmailName, $user_email, $user_name, $title, $message, $extra = '', 'forgot_password', $post_id = '', $user->ID);///forgot password email |
|
240 | + |
|
241 | + return true; |
|
242 | 242 | } |
243 | 243 | |
244 | 244 | /** |
@@ -253,80 +253,80 @@ discard block |
||
253 | 253 | */ |
254 | 254 | function geodir_register_new_user($user_login, $user_email) |
255 | 255 | { |
256 | - global $wpdb; |
|
257 | - $errors = new WP_Error(); |
|
258 | - |
|
259 | - |
|
260 | - $user_login = sanitize_user($user_login); |
|
261 | - $user_login = str_replace(",", "", $user_login); |
|
262 | - $user_email = str_replace(",", "", $user_email); |
|
263 | - /** |
|
264 | - * Filter the user registration email. |
|
265 | - * |
|
266 | - * @since 1.0.0 |
|
267 | - * |
|
268 | - * @param string $user_email User registration email. |
|
269 | - */ |
|
270 | - $user_email = apply_filters('user_registration_email', $user_email); |
|
271 | - |
|
272 | - |
|
273 | - if (get_option('geodir_allow_cpass')) { |
|
274 | - $user_pass = $_REQUEST['user_pass']; |
|
275 | - $user_pass2 = $_REQUEST['user_pass2']; |
|
276 | - // Check the password |
|
277 | - if ($user_pass != $user_pass2) { |
|
278 | - $errors->add('pass_match', __('ERROR: Passwords do not match.', 'geodirectory')); |
|
279 | - } elseif (strlen($user_pass) < 7) { |
|
280 | - $errors->add('pass_match', __('ERROR: Password must be 7 characters or more.', 'geodirectory')); |
|
281 | - } |
|
282 | - } |
|
283 | - |
|
284 | - // Check the username |
|
285 | - if ($user_login == '') |
|
286 | - $errors->add('empty_username', __('ERROR: Please enter a username.', 'geodirectory')); |
|
287 | - elseif (!validate_username($user_login)) { |
|
288 | - $errors->add('invalid_username', __('<strong>ERROR</strong>: This username is invalid. Please enter a valid username.', 'geodirectory')); |
|
289 | - $user_login = ''; |
|
290 | - } elseif (username_exists($user_login)) |
|
291 | - $errors->add('username_exists', __('<strong>ERROR</strong>: This username is already registered, please choose another one.', 'geodirectory')); |
|
292 | - |
|
293 | - // Check the e-mail address |
|
294 | - if ($user_email == '') { |
|
295 | - $errors->add('empty_email', __('<strong>ERROR</strong>: Please type your e-mail address.', 'geodirectory')); |
|
296 | - } elseif (!is_email($user_email)) { |
|
297 | - $errors->add('invalid_email', __('<strong>ERROR</strong>: The email address isn’t correct.', 'geodirectory')); |
|
298 | - $user_email = ''; |
|
299 | - } elseif (email_exists($user_email)) |
|
300 | - $errors->add('email_exists', __('<strong>ERROR</strong>: This email is already registered, please choose another one.', 'geodirectory')); |
|
301 | - |
|
302 | - /** |
|
303 | - * Called when registering a new user. |
|
304 | - * |
|
305 | - * This is a WordPress core hook. |
|
306 | - * |
|
307 | - * @link https://codex.wordpress.org/Plugin_API/Action_Reference/register_post |
|
308 | - * @since 1.0.0 |
|
309 | - */ |
|
310 | - do_action('register_post', $user_login, $user_email, $errors); |
|
311 | - /** |
|
312 | - * Filter the registration error messages. |
|
313 | - * |
|
314 | - * @since 1.0.0 |
|
315 | - * |
|
316 | - * @param object $errors Registration error messages. |
|
317 | - */ |
|
318 | - $errors = apply_filters('registration_errors', $errors); |
|
319 | - |
|
320 | - if ($errors->get_error_code()) |
|
321 | - return $errors; |
|
322 | - |
|
323 | - |
|
324 | - if (!isset($user_pass) || $user_pass == '') { |
|
325 | - $user_pass = wp_generate_password(12, false); |
|
326 | - } |
|
327 | - $user_id = wp_create_user($user_login, $user_pass, $user_email); |
|
328 | - $user_web = ''; |
|
329 | - /*$user_add1 = $_POST['user_add1']; |
|
256 | + global $wpdb; |
|
257 | + $errors = new WP_Error(); |
|
258 | + |
|
259 | + |
|
260 | + $user_login = sanitize_user($user_login); |
|
261 | + $user_login = str_replace(",", "", $user_login); |
|
262 | + $user_email = str_replace(",", "", $user_email); |
|
263 | + /** |
|
264 | + * Filter the user registration email. |
|
265 | + * |
|
266 | + * @since 1.0.0 |
|
267 | + * |
|
268 | + * @param string $user_email User registration email. |
|
269 | + */ |
|
270 | + $user_email = apply_filters('user_registration_email', $user_email); |
|
271 | + |
|
272 | + |
|
273 | + if (get_option('geodir_allow_cpass')) { |
|
274 | + $user_pass = $_REQUEST['user_pass']; |
|
275 | + $user_pass2 = $_REQUEST['user_pass2']; |
|
276 | + // Check the password |
|
277 | + if ($user_pass != $user_pass2) { |
|
278 | + $errors->add('pass_match', __('ERROR: Passwords do not match.', 'geodirectory')); |
|
279 | + } elseif (strlen($user_pass) < 7) { |
|
280 | + $errors->add('pass_match', __('ERROR: Password must be 7 characters or more.', 'geodirectory')); |
|
281 | + } |
|
282 | + } |
|
283 | + |
|
284 | + // Check the username |
|
285 | + if ($user_login == '') |
|
286 | + $errors->add('empty_username', __('ERROR: Please enter a username.', 'geodirectory')); |
|
287 | + elseif (!validate_username($user_login)) { |
|
288 | + $errors->add('invalid_username', __('<strong>ERROR</strong>: This username is invalid. Please enter a valid username.', 'geodirectory')); |
|
289 | + $user_login = ''; |
|
290 | + } elseif (username_exists($user_login)) |
|
291 | + $errors->add('username_exists', __('<strong>ERROR</strong>: This username is already registered, please choose another one.', 'geodirectory')); |
|
292 | + |
|
293 | + // Check the e-mail address |
|
294 | + if ($user_email == '') { |
|
295 | + $errors->add('empty_email', __('<strong>ERROR</strong>: Please type your e-mail address.', 'geodirectory')); |
|
296 | + } elseif (!is_email($user_email)) { |
|
297 | + $errors->add('invalid_email', __('<strong>ERROR</strong>: The email address isn’t correct.', 'geodirectory')); |
|
298 | + $user_email = ''; |
|
299 | + } elseif (email_exists($user_email)) |
|
300 | + $errors->add('email_exists', __('<strong>ERROR</strong>: This email is already registered, please choose another one.', 'geodirectory')); |
|
301 | + |
|
302 | + /** |
|
303 | + * Called when registering a new user. |
|
304 | + * |
|
305 | + * This is a WordPress core hook. |
|
306 | + * |
|
307 | + * @link https://codex.wordpress.org/Plugin_API/Action_Reference/register_post |
|
308 | + * @since 1.0.0 |
|
309 | + */ |
|
310 | + do_action('register_post', $user_login, $user_email, $errors); |
|
311 | + /** |
|
312 | + * Filter the registration error messages. |
|
313 | + * |
|
314 | + * @since 1.0.0 |
|
315 | + * |
|
316 | + * @param object $errors Registration error messages. |
|
317 | + */ |
|
318 | + $errors = apply_filters('registration_errors', $errors); |
|
319 | + |
|
320 | + if ($errors->get_error_code()) |
|
321 | + return $errors; |
|
322 | + |
|
323 | + |
|
324 | + if (!isset($user_pass) || $user_pass == '') { |
|
325 | + $user_pass = wp_generate_password(12, false); |
|
326 | + } |
|
327 | + $user_id = wp_create_user($user_login, $user_pass, $user_email); |
|
328 | + $user_web = ''; |
|
329 | + /*$user_add1 = $_POST['user_add1']; |
|
330 | 330 | $user_add2 = $_POST['user_add2']; |
331 | 331 | $user_city = $_POST['user_city']; |
332 | 332 | $user_state = $_POST['user_state']; |
@@ -335,77 +335,77 @@ discard block |
||
335 | 335 | $user_web = $_POST['user_web']; |
336 | 336 | $user_phone = $_POST['user_phone']; |
337 | 337 | $user_twitter = $_POST['user_twitter']; */ |
338 | - $user_fname = sanitize_user($_POST['user_fname']); |
|
339 | - $user_fname = str_replace(",", "", $user_fname); |
|
340 | - |
|
341 | - /** |
|
342 | - * Filter the submitted user meta. |
|
343 | - * |
|
344 | - * @since 1.0.0 |
|
345 | - * |
|
346 | - * @param int $user_id User ID. |
|
347 | - */ |
|
348 | - $user_address_info = apply_filters('geodir_manage_user_meta', array( |
|
349 | - "user_add1" => '', |
|
350 | - "user_add2" => '', |
|
351 | - "user_city" => '', |
|
352 | - "user_state" => '', |
|
353 | - "user_country" => '', |
|
354 | - "user_postalcode" => '', |
|
355 | - "user_phone" => '', |
|
356 | - "user_twitter" => '', |
|
357 | - "first_name" => $user_fname, |
|
358 | - "last_name" => '', |
|
359 | - ), $user_id); |
|
360 | - foreach ($user_address_info as $key => $val) { |
|
361 | - update_user_meta($user_id, $key, $val); // User Address Information Here |
|
362 | - } |
|
363 | - //update_user_meta($user_id, 'user_address_info', ($user_address_info)); // User Address Information Here |
|
364 | - $userName = $user_fname; |
|
365 | - update_user_meta($user_id, 'first_name', $userName); // User Address Information Here |
|
366 | - //update_user_meta($user_id, 'last_name', $_POST['user_lname']); // User Address Information Here |
|
367 | - |
|
368 | - // Changed by vikas sharma to enable all type of characters in author permalink... |
|
369 | - $user_nicename = sanitize_title($userName); |
|
370 | - |
|
371 | - $updateUsersql = $wpdb->prepare("update $wpdb->users set user_url=%s, user_nicename=%s, display_name=%s where ID=%d", array($user_web, $user_nicename, $userName, $user_id)); |
|
372 | - |
|
373 | - $wpdb->query($updateUsersql); |
|
374 | - |
|
375 | - if (!$user_id) { |
|
376 | - $errors->add('registerfail', sprintf(__('<strong>ERROR</strong>: Couldn’t register you... please contact the <a href="mailto:%s">webmaster</a> !', 'geodirectory'), get_option('admin_email'))); |
|
377 | - return $errors; |
|
378 | - } |
|
379 | - global $upload_folder_path; |
|
380 | - |
|
381 | - if ($user_id) { |
|
382 | - |
|
383 | - /** |
|
384 | - * Called after registering a user and before the registration email is sent. |
|
385 | - * |
|
386 | - * @since 1.0.0 |
|
387 | - * @param int $user_id The user ID of the registered user. |
|
388 | - */ |
|
389 | - do_action('geodir_user_register', $user_id); |
|
390 | - ///////REGISTRATION EMAIL START////// |
|
391 | - $fromEmail = geodir_get_site_email_id(); |
|
392 | - $fromEmailName = get_site_emailName(); |
|
393 | - $message = __('<p><b>' . __('Your login Information :', 'geodirectory') . '</b></p> |
|
338 | + $user_fname = sanitize_user($_POST['user_fname']); |
|
339 | + $user_fname = str_replace(",", "", $user_fname); |
|
340 | + |
|
341 | + /** |
|
342 | + * Filter the submitted user meta. |
|
343 | + * |
|
344 | + * @since 1.0.0 |
|
345 | + * |
|
346 | + * @param int $user_id User ID. |
|
347 | + */ |
|
348 | + $user_address_info = apply_filters('geodir_manage_user_meta', array( |
|
349 | + "user_add1" => '', |
|
350 | + "user_add2" => '', |
|
351 | + "user_city" => '', |
|
352 | + "user_state" => '', |
|
353 | + "user_country" => '', |
|
354 | + "user_postalcode" => '', |
|
355 | + "user_phone" => '', |
|
356 | + "user_twitter" => '', |
|
357 | + "first_name" => $user_fname, |
|
358 | + "last_name" => '', |
|
359 | + ), $user_id); |
|
360 | + foreach ($user_address_info as $key => $val) { |
|
361 | + update_user_meta($user_id, $key, $val); // User Address Information Here |
|
362 | + } |
|
363 | + //update_user_meta($user_id, 'user_address_info', ($user_address_info)); // User Address Information Here |
|
364 | + $userName = $user_fname; |
|
365 | + update_user_meta($user_id, 'first_name', $userName); // User Address Information Here |
|
366 | + //update_user_meta($user_id, 'last_name', $_POST['user_lname']); // User Address Information Here |
|
367 | + |
|
368 | + // Changed by vikas sharma to enable all type of characters in author permalink... |
|
369 | + $user_nicename = sanitize_title($userName); |
|
370 | + |
|
371 | + $updateUsersql = $wpdb->prepare("update $wpdb->users set user_url=%s, user_nicename=%s, display_name=%s where ID=%d", array($user_web, $user_nicename, $userName, $user_id)); |
|
372 | + |
|
373 | + $wpdb->query($updateUsersql); |
|
374 | + |
|
375 | + if (!$user_id) { |
|
376 | + $errors->add('registerfail', sprintf(__('<strong>ERROR</strong>: Couldn’t register you... please contact the <a href="mailto:%s">webmaster</a> !', 'geodirectory'), get_option('admin_email'))); |
|
377 | + return $errors; |
|
378 | + } |
|
379 | + global $upload_folder_path; |
|
380 | + |
|
381 | + if ($user_id) { |
|
382 | + |
|
383 | + /** |
|
384 | + * Called after registering a user and before the registration email is sent. |
|
385 | + * |
|
386 | + * @since 1.0.0 |
|
387 | + * @param int $user_id The user ID of the registered user. |
|
388 | + */ |
|
389 | + do_action('geodir_user_register', $user_id); |
|
390 | + ///////REGISTRATION EMAIL START////// |
|
391 | + $fromEmail = geodir_get_site_email_id(); |
|
392 | + $fromEmailName = get_site_emailName(); |
|
393 | + $message = __('<p><b>' . __('Your login Information :', 'geodirectory') . '</b></p> |
|
394 | 394 | <p>' . __('Username:', 'geodirectory') . ' ' . $user_login . '</p> |
395 | 395 | <p>' . __('Password:', 'geodirectory') . ' ' . $user_pass . '</p>'); |
396 | 396 | |
397 | - /////////////customer email////////////// |
|
398 | - //geodir_sendEmail($fromEmail,$fromEmailName,$user_email,$userName,$subject,$client_message,$extra='');///To client email |
|
399 | - geodir_sendEmail($fromEmail, $fromEmailName, $user_email, $userName, '', $message, '', 'registration', '', $user_id);/// registration email |
|
400 | - //////REGISTRATION EMAIL END//////// |
|
401 | - } |
|
397 | + /////////////customer email////////////// |
|
398 | + //geodir_sendEmail($fromEmail,$fromEmailName,$user_email,$userName,$subject,$client_message,$extra='');///To client email |
|
399 | + geodir_sendEmail($fromEmail, $fromEmailName, $user_email, $userName, '', $message, '', 'registration', '', $user_id);/// registration email |
|
400 | + //////REGISTRATION EMAIL END//////// |
|
401 | + } |
|
402 | 402 | |
403 | - if (get_option('ptthemes_auto_login')) { |
|
404 | - $errors->add('auto_login', __('<strong>SUCCESS</strong>: Thank you for registering, please check your email for your login details.', 'geodirectory')); |
|
405 | - return $errors; |
|
406 | - } |
|
403 | + if (get_option('ptthemes_auto_login')) { |
|
404 | + $errors->add('auto_login', __('<strong>SUCCESS</strong>: Thank you for registering, please check your email for your login details.', 'geodirectory')); |
|
405 | + return $errors; |
|
406 | + } |
|
407 | 407 | |
408 | - return array($user_id, $user_pass); |
|
408 | + return array($user_id, $user_pass); |
|
409 | 409 | } |
410 | 410 | |
411 | 411 | /** |
@@ -418,319 +418,319 @@ discard block |
||
418 | 418 | */ |
419 | 419 | function geodir_user_signup() |
420 | 420 | { |
421 | - global $errors; |
|
422 | - $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'login'; |
|
423 | - |
|
424 | - $errors = new WP_Error(); |
|
425 | - |
|
426 | - if (isset($_GET['key'])) |
|
427 | - $action = 'resetpass'; |
|
428 | - |
|
429 | - // validate action so as to default to the login screen |
|
430 | - if (!in_array($action, array('logout', 'lostpassword', 'retrievepassword', 'resetpass', 'rp', 'register', 'login')) && false === has_filter('login_form_' . $action)) |
|
431 | - $action = 'login'; |
|
432 | - |
|
433 | - nocache_headers(); |
|
434 | - |
|
435 | - if (defined('RELOCATE')) { // Move flag is set |
|
436 | - if (isset($_SERVER['PATH_INFO']) && ($_SERVER['PATH_INFO'] != $_SERVER['PHP_SELF'])) |
|
437 | - $_SERVER['PHP_SELF'] = str_replace($_SERVER['PATH_INFO'], '', $_SERVER['PHP_SELF']); |
|
438 | - |
|
439 | - $schema = (isset($_SERVER['HTTPS']) && geodir_strtolower($_SERVER['HTTPS']) == 'on') ? 'https://' : 'http://'; |
|
440 | - if (dirname($schema . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']) != home_url()) |
|
441 | - update_option('siteurl', dirname($schema . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'])); |
|
442 | - } |
|
443 | - |
|
444 | - //Set a cookie now to see if they are supported by the browser. |
|
445 | - //setcookie(TEST_COOKIE, 'WP Cookie check', 0, COOKIEPATH, COOKIE_DOMAIN); |
|
446 | - if (SITECOOKIEPATH != COOKIEPATH) |
|
447 | - setcookie(TEST_COOKIE, 'WP Cookie check', 0, SITECOOKIEPATH, COOKIE_DOMAIN); |
|
448 | - |
|
449 | - /** |
|
450 | - * Allow plugins to override the default actions, and to add extra actions if they want on the register/signin page. |
|
451 | - * |
|
452 | - * Used dynamic hook login_form_$action |
|
453 | - * |
|
454 | - * @since 1.0.0 |
|
455 | - */ |
|
456 | - do_action('login_form_' . $action); |
|
457 | - |
|
458 | - $http_post = ('POST' == $_SERVER['REQUEST_METHOD']); |
|
459 | - |
|
460 | - switch ($action): |
|
461 | - |
|
462 | - case 'logout' : |
|
463 | - //check_admin_referer('log-out'); |
|
464 | - wp_logout(); |
|
465 | - |
|
466 | - $redirect_to = $_SERVER['HTTP_REFERER']; |
|
467 | - //$redirect_to = home_url().'/?ptype=login&loggedout=true'; |
|
468 | - if (isset($_REQUEST['redirect_to'])) |
|
469 | - $redirect_to = $_REQUEST['redirect_to']; |
|
470 | - $redirect_to = home_url(); |
|
471 | - wp_safe_redirect($redirect_to); |
|
472 | - exit(); |
|
473 | - |
|
474 | - break; |
|
475 | - |
|
476 | - case 'lostpassword' : |
|
477 | - case 'retrievepassword' : |
|
478 | - if ($http_post) { |
|
479 | - $errors = geodir_retrieve_password(); |
|
480 | - $error_message = isset($errors->errors['invalid_email'][0]) ? $errors->errors['invalid_email'][0] : ''; |
|
481 | - if (!is_wp_error($errors)) { |
|
482 | - wp_redirect(geodir_login_url(array('checkemail'=>'confirm'))); |
|
483 | - exit(); |
|
484 | - } else { |
|
485 | - wp_redirect(geodir_login_url(array('emsg'=>'fw'))); |
|
486 | - exit(); |
|
487 | - } |
|
488 | - } |
|
489 | - if (isset($_GET['error']) && 'invalidkey' == $_GET['error']) $errors->add('invalidkey', __('Sorry, that key does not appear to be valid.', 'geodirectory')); |
|
490 | - /** |
|
491 | - * Called in the geodir_user_signup() function during the lostpassword case. |
|
492 | - * |
|
493 | - * @since 1.0.0 |
|
494 | - */ |
|
495 | - do_action('lost_password'); |
|
496 | - $message = '<div class="sucess_msg">' . ENTER_USER_EMAIL_NEW_PW_MSG . '</div>'; |
|
497 | - $user_login = isset($_POST['user_login']) ? stripslashes($_POST['user_login']) : ''; |
|
498 | - |
|
499 | - break; |
|
500 | - |
|
501 | - case 'resetpass' : |
|
502 | - case 'rp' : |
|
503 | - $errors = reset_password($_GET['key'], $_GET['login']); |
|
504 | - |
|
505 | - if (!is_wp_error($errors)) { |
|
506 | - wp_redirect(geodir_login_url(array('checkemail'=>'newpass'))); |
|
507 | - exit(); |
|
508 | - } |
|
509 | - |
|
510 | - wp_redirect(geodir_login_url(array('error'=>'invalidkey','action'=>'lostpassword'))); |
|
511 | - exit(); |
|
512 | - |
|
513 | - break; |
|
514 | - |
|
515 | - case 'register' : |
|
516 | - ############################### fix by Stiofan - HebTech.co.uk ### SECURITY FIX ############################## |
|
517 | - if (!get_option('users_can_register')) { |
|
518 | - wp_redirect(geodir_login_url(array('emsg'=>'regnewusr'))); |
|
519 | - exit(); |
|
520 | - } |
|
521 | - ############################### fix by Stiofan - HebTech.co.uk ### SECURITY FIX ############################## |
|
522 | - global $user_email, $user_fname; |
|
523 | - $user_login = ''; |
|
524 | - $user_email = ''; |
|
525 | - if ($http_post) { |
|
526 | - $user_login = $_POST['user_email']; |
|
527 | - $user_email = $_POST['user_email']; |
|
528 | - $user_fname = $_POST['user_fname']; |
|
529 | - |
|
530 | - $errors = geodir_register_new_user($user_login, $user_email); |
|
531 | - |
|
532 | - /* display error in registration form */ |
|
533 | - if (is_wp_error($errors)) { |
|
534 | - $error_code = $errors->get_error_code(); |
|
535 | - $error_message = $errors->get_error_message($error_code); |
|
536 | - if (!isset($_POST['user_login']) && ($error_code == 'empty_username' || $error_code == 'invalid_username' || $error_code == 'username_exists')) { |
|
537 | - if ($error_code == 'empty_username') { |
|
538 | - $error_code = 'empty_email'; |
|
539 | - } else if ($error_code == 'invalid_username') { |
|
540 | - $error_code = 'invalid_email'; |
|
541 | - } else if ($error_code == 'username_exists') { |
|
542 | - $error_code = 'email_exists'; |
|
543 | - } |
|
544 | - |
|
545 | - $error_message = $errors->get_error_message($error_code); |
|
546 | - } |
|
547 | - global $geodir_signup_error; |
|
548 | - $geodir_signup_error = $error_message; |
|
549 | - } |
|
550 | - |
|
551 | - if (!is_wp_error($errors)) { |
|
552 | - $_POST['log'] = $user_login; |
|
553 | - $_POST['pwd'] = $errors[1]; |
|
554 | - $_POST['testcookie'] = 1; |
|
555 | - |
|
556 | - $secure_cookie = ''; |
|
557 | - // If the user wants ssl but the session is not ssl, force a secure cookie. |
|
558 | - if (!empty($_POST['log'])) { |
|
559 | - $user_name = sanitize_user($_POST['log']); |
|
560 | - if ($user = get_user_by('email', $user_name)) { |
|
561 | - if (get_user_option('use_ssl', $user->ID)) { |
|
562 | - $secure_cookie = true; |
|
563 | - force_ssl_admin(true); |
|
564 | - } |
|
565 | - } |
|
566 | - } |
|
567 | - |
|
568 | - $redirect_to = $_REQUEST['redirect_to']; |
|
569 | - |
|
570 | - if (!isset($_REQUEST['redirect_to']) || $_REQUEST['redirect_to'] == '') { |
|
571 | - if (isset($_SERVER['HTTP_REFERER']) && strstr($_SERVER['HTTP_REFERER'], home_url())) { |
|
572 | - $redirect_to = $_SERVER['HTTP_REFERER']; |
|
573 | - } else { |
|
574 | - $redirect_to = home_url(); |
|
575 | - } |
|
576 | - |
|
577 | - } |
|
578 | - |
|
579 | - if (isset($_REQUEST['redirect_add_listing']) && $_REQUEST['redirect_add_listing'] != '') { |
|
580 | - |
|
581 | - $redirect_to = $_REQUEST['redirect_add_listing']; |
|
582 | - } |
|
583 | - |
|
584 | - |
|
585 | - if (!$secure_cookie && is_ssl() && force_ssl_login() && !force_ssl_admin() && (0 !== strpos($redirect_to, 'https')) && (0 === strpos($redirect_to, 'http'))) |
|
586 | - $secure_cookie = false; |
|
587 | - |
|
588 | - $user = wp_signon('', $secure_cookie); |
|
589 | - |
|
590 | - $requested_redirect_to = isset($_REQUEST['redirect_add_listing']) && $_REQUEST['redirect_add_listing'] != '' ? $_REQUEST['redirect_add_listing'] : (isset($_REQUEST['redirect_to']) ? $_REQUEST['redirect_to'] : ''); |
|
591 | - /** |
|
592 | - * Filter the login redirect URL. |
|
593 | - * |
|
594 | - * @since 1.4.9 |
|
595 | - * @param string $redirect_to The redirect destination URL. |
|
596 | - * @param string $requested_redirect_to The requested redirect destination URL passed as a parameter. |
|
597 | - * @param WP_User|WP_Error $user WP_User object if login was successful, WP_Error object otherwise. |
|
598 | - */ |
|
599 | - $redirect_to = apply_filters('login_redirect', $redirect_to, $requested_redirect_to, $user); |
|
600 | - |
|
601 | - |
|
602 | - if (!is_wp_error($user)) { |
|
603 | - wp_safe_redirect($redirect_to); |
|
604 | - exit(); |
|
605 | - } |
|
606 | - exit(); |
|
607 | - } |
|
608 | - } |
|
609 | - |
|
610 | - break; |
|
611 | - |
|
612 | - case 'login' : |
|
613 | - default: |
|
614 | - $secure_cookie = ''; |
|
615 | - |
|
616 | - if (!empty($_POST['log'])) { |
|
617 | - $user_name = sanitize_user($_POST['log']); |
|
618 | - if ($user = get_user_by('login', $user_name)) { |
|
619 | - |
|
620 | - if (get_user_option('use_ssl', $user->ID)) { |
|
621 | - $secure_cookie = true; |
|
622 | - force_ssl_admin(true); |
|
623 | - } |
|
624 | - } elseif ($user = get_user_by('email', $user_name)) { |
|
625 | - $_POST['log'] = $user->user_login; // If signing in by email, set the username for normal WP login |
|
626 | - if (get_user_option('use_ssl', $user->ID)) { |
|
627 | - $secure_cookie = true; |
|
628 | - force_ssl_admin(true); |
|
629 | - } |
|
630 | - } |
|
631 | - } |
|
632 | - /////////////////////////// |
|
633 | - if (isset($_REQUEST['redirect_add_listing'])) { |
|
634 | - $_REQUEST['redirect_to'] = $_REQUEST['redirect_add_listing']; |
|
635 | - } |
|
636 | - |
|
637 | - |
|
638 | - if (!isset($_REQUEST['redirect_to']) || $_REQUEST['redirect_to'] == '') { |
|
639 | - if (is_user_logged_in()) : |
|
640 | - $user_ID = isset($user->ID) ? $user->ID : ''; |
|
641 | - $author_link = get_author_posts_url($user_ID); |
|
642 | - $default_author_link = geodir_getlink($author_link, array('geodir_dashbord' => 'true', 'stype' => 'gd_place'), false); |
|
643 | - |
|
644 | - /** |
|
645 | - * Filter the author link. |
|
646 | - * |
|
647 | - * @since 1.0.0 |
|
648 | - * |
|
649 | - * @param string $default_author_link Default author link. |
|
650 | - * @param int $user_ID The user ID. |
|
651 | - */ |
|
652 | - $default_author_link = apply_filters('geodir_dashboard_author_link', $default_author_link, $user_ID); |
|
653 | - |
|
654 | - $_REQUEST['redirect_to'] = $default_author_link; |
|
655 | - else: |
|
656 | - $_REQUEST['redirect_to'] = home_url(); |
|
657 | - endif; |
|
658 | - |
|
659 | - } |
|
660 | - if (isset($_REQUEST['redirect_to'])) { |
|
661 | - $redirect_to = $_REQUEST['redirect_to']; |
|
662 | - // Redirect to https if user wants ssl |
|
663 | - if ($secure_cookie && false !== strpos($redirect_to, 'wp-admin')) |
|
664 | - $redirect_to = preg_replace('|^http://|', 'https://', $redirect_to); |
|
665 | - } else { |
|
666 | - $redirect_to = admin_url(); |
|
667 | - } |
|
668 | - |
|
669 | - if (!$secure_cookie && is_ssl() && force_ssl_login() && !force_ssl_admin() && (0 !== strpos($redirect_to, 'https')) && (0 === strpos($redirect_to, 'http'))) |
|
670 | - $secure_cookie = false; |
|
671 | - $user = wp_signon('', $secure_cookie); |
|
672 | - |
|
673 | - |
|
674 | - /** |
|
675 | - * Filter the login redirect URL. |
|
676 | - * |
|
677 | - * @since 1.4.9 |
|
678 | - * @param string $redirect_to The redirect destination URL. |
|
679 | - * @param WP_User|WP_Error $user WP_User object if login was successful, WP_Error object otherwise. |
|
680 | - */ |
|
681 | - $redirect_to = apply_filters('login_redirect', $redirect_to, isset($_REQUEST['redirect_to']) ? $_REQUEST['redirect_to'] : '', $user); |
|
682 | - |
|
683 | - if (is_wp_error($user)) { |
|
684 | - if (isset($_SERVER['HTTP_REFERER']) && strstr($_SERVER['HTTP_REFERER'], 'ptype=property_submit') && $_POST['log'] != '' && $_POST['pwd'] != '') { |
|
685 | - wp_redirect($_SERVER['HTTP_REFERER'] . '&emsg=1'); |
|
686 | - } |
|
687 | - } |
|
688 | - if (!is_wp_error($user)) { |
|
689 | - |
|
690 | - // Some servers are not logging the user in properly after wp_signon, se we set the user here. |
|
691 | - //wp_set_current_user($user->ID); |
|
692 | - //echo '###';exit; |
|
693 | - |
|
694 | - if ($redirect_to) { |
|
695 | - wp_redirect($redirect_to); |
|
696 | - } else { |
|
697 | - wp_redirect(home_url()); |
|
698 | - } |
|
699 | - exit(); |
|
700 | - } |
|
701 | - |
|
702 | - $errors = $user; |
|
703 | - |
|
704 | - // Clear errors if loggedout is set. |
|
705 | - if (!empty($_GET['loggedout'])) |
|
706 | - $errors = new WP_Error(); |
|
707 | - // If cookies are disabled we can't log in even with a valid user+pass |
|
708 | - if (isset($_POST['testcookie']) && empty($_COOKIE[TEST_COOKIE])) |
|
709 | - $errors->add('test_cookie', __("<strong>ERROR</strong>: Cookies are blocked or not supported by your browser. You must <a href='http://www.google.com/cookies.html'>enable cookies</a> to use WordPress.", 'geodirectory')); |
|
710 | - |
|
711 | - // Some parts of this script use the main login form to display a message |
|
712 | - if (isset($_GET['loggedout']) && TRUE == $_GET['loggedout']) { |
|
713 | - $successmsg = '<div class="sucess_msg">' . YOU_ARE_LOGED_OUT_MSG . '</div>'; |
|
714 | - } elseif (isset($_GET['registration']) && 'disabled' == $_GET['registration']) { |
|
715 | - $successmsg = USER_REG_NOT_ALLOW_MSG; |
|
716 | - } elseif (isset($_GET['checkemail']) && 'confirm' == $_GET['checkemail']) { |
|
717 | - $successmsg = EMAIL_CONFIRM_LINK_MSG; |
|
718 | - } elseif (isset($_GET['checkemail']) && 'newpass' == $_GET['checkemail']) { |
|
719 | - $successmsg = NEW_PW_EMAIL_MSG; |
|
720 | - } elseif (isset($_GET['checkemail']) && 'registered' == $_GET['checkemail']) { |
|
721 | - $successmsg = REG_COMPLETE_MSG; |
|
722 | - } |
|
723 | - |
|
724 | - if ((isset($_POST['log']) && $_POST['log'] != '' && $errors) || ((!isset($_POST['log']) || $_POST['log'] == '') && isset($_REQUEST['testcookie']) && $_REQUEST['testcookie'])) { |
|
725 | - if (isset($_REQUEST['pagetype']) && $_REQUEST['pagetype'] != '') { |
|
726 | - wp_redirect($_REQUEST['pagetype'] . '&emsg=1'); |
|
727 | - } else { |
|
728 | - wp_redirect(geodir_login_url(array('logemsg'=>'1','redirect_to'=>urlencode($_REQUEST['redirect_to'])))); |
|
729 | - } |
|
730 | - exit; |
|
731 | - } |
|
732 | - break; |
|
733 | - endswitch; // end action switch |
|
421 | + global $errors; |
|
422 | + $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'login'; |
|
423 | + |
|
424 | + $errors = new WP_Error(); |
|
425 | + |
|
426 | + if (isset($_GET['key'])) |
|
427 | + $action = 'resetpass'; |
|
428 | + |
|
429 | + // validate action so as to default to the login screen |
|
430 | + if (!in_array($action, array('logout', 'lostpassword', 'retrievepassword', 'resetpass', 'rp', 'register', 'login')) && false === has_filter('login_form_' . $action)) |
|
431 | + $action = 'login'; |
|
432 | + |
|
433 | + nocache_headers(); |
|
434 | + |
|
435 | + if (defined('RELOCATE')) { // Move flag is set |
|
436 | + if (isset($_SERVER['PATH_INFO']) && ($_SERVER['PATH_INFO'] != $_SERVER['PHP_SELF'])) |
|
437 | + $_SERVER['PHP_SELF'] = str_replace($_SERVER['PATH_INFO'], '', $_SERVER['PHP_SELF']); |
|
438 | + |
|
439 | + $schema = (isset($_SERVER['HTTPS']) && geodir_strtolower($_SERVER['HTTPS']) == 'on') ? 'https://' : 'http://'; |
|
440 | + if (dirname($schema . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']) != home_url()) |
|
441 | + update_option('siteurl', dirname($schema . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'])); |
|
442 | + } |
|
443 | + |
|
444 | + //Set a cookie now to see if they are supported by the browser. |
|
445 | + //setcookie(TEST_COOKIE, 'WP Cookie check', 0, COOKIEPATH, COOKIE_DOMAIN); |
|
446 | + if (SITECOOKIEPATH != COOKIEPATH) |
|
447 | + setcookie(TEST_COOKIE, 'WP Cookie check', 0, SITECOOKIEPATH, COOKIE_DOMAIN); |
|
448 | + |
|
449 | + /** |
|
450 | + * Allow plugins to override the default actions, and to add extra actions if they want on the register/signin page. |
|
451 | + * |
|
452 | + * Used dynamic hook login_form_$action |
|
453 | + * |
|
454 | + * @since 1.0.0 |
|
455 | + */ |
|
456 | + do_action('login_form_' . $action); |
|
457 | + |
|
458 | + $http_post = ('POST' == $_SERVER['REQUEST_METHOD']); |
|
459 | + |
|
460 | + switch ($action): |
|
461 | + |
|
462 | + case 'logout' : |
|
463 | + //check_admin_referer('log-out'); |
|
464 | + wp_logout(); |
|
465 | + |
|
466 | + $redirect_to = $_SERVER['HTTP_REFERER']; |
|
467 | + //$redirect_to = home_url().'/?ptype=login&loggedout=true'; |
|
468 | + if (isset($_REQUEST['redirect_to'])) |
|
469 | + $redirect_to = $_REQUEST['redirect_to']; |
|
470 | + $redirect_to = home_url(); |
|
471 | + wp_safe_redirect($redirect_to); |
|
472 | + exit(); |
|
473 | + |
|
474 | + break; |
|
475 | + |
|
476 | + case 'lostpassword' : |
|
477 | + case 'retrievepassword' : |
|
478 | + if ($http_post) { |
|
479 | + $errors = geodir_retrieve_password(); |
|
480 | + $error_message = isset($errors->errors['invalid_email'][0]) ? $errors->errors['invalid_email'][0] : ''; |
|
481 | + if (!is_wp_error($errors)) { |
|
482 | + wp_redirect(geodir_login_url(array('checkemail'=>'confirm'))); |
|
483 | + exit(); |
|
484 | + } else { |
|
485 | + wp_redirect(geodir_login_url(array('emsg'=>'fw'))); |
|
486 | + exit(); |
|
487 | + } |
|
488 | + } |
|
489 | + if (isset($_GET['error']) && 'invalidkey' == $_GET['error']) $errors->add('invalidkey', __('Sorry, that key does not appear to be valid.', 'geodirectory')); |
|
490 | + /** |
|
491 | + * Called in the geodir_user_signup() function during the lostpassword case. |
|
492 | + * |
|
493 | + * @since 1.0.0 |
|
494 | + */ |
|
495 | + do_action('lost_password'); |
|
496 | + $message = '<div class="sucess_msg">' . ENTER_USER_EMAIL_NEW_PW_MSG . '</div>'; |
|
497 | + $user_login = isset($_POST['user_login']) ? stripslashes($_POST['user_login']) : ''; |
|
498 | + |
|
499 | + break; |
|
500 | + |
|
501 | + case 'resetpass' : |
|
502 | + case 'rp' : |
|
503 | + $errors = reset_password($_GET['key'], $_GET['login']); |
|
504 | + |
|
505 | + if (!is_wp_error($errors)) { |
|
506 | + wp_redirect(geodir_login_url(array('checkemail'=>'newpass'))); |
|
507 | + exit(); |
|
508 | + } |
|
509 | + |
|
510 | + wp_redirect(geodir_login_url(array('error'=>'invalidkey','action'=>'lostpassword'))); |
|
511 | + exit(); |
|
512 | + |
|
513 | + break; |
|
514 | + |
|
515 | + case 'register' : |
|
516 | + ############################### fix by Stiofan - HebTech.co.uk ### SECURITY FIX ############################## |
|
517 | + if (!get_option('users_can_register')) { |
|
518 | + wp_redirect(geodir_login_url(array('emsg'=>'regnewusr'))); |
|
519 | + exit(); |
|
520 | + } |
|
521 | + ############################### fix by Stiofan - HebTech.co.uk ### SECURITY FIX ############################## |
|
522 | + global $user_email, $user_fname; |
|
523 | + $user_login = ''; |
|
524 | + $user_email = ''; |
|
525 | + if ($http_post) { |
|
526 | + $user_login = $_POST['user_email']; |
|
527 | + $user_email = $_POST['user_email']; |
|
528 | + $user_fname = $_POST['user_fname']; |
|
529 | + |
|
530 | + $errors = geodir_register_new_user($user_login, $user_email); |
|
531 | + |
|
532 | + /* display error in registration form */ |
|
533 | + if (is_wp_error($errors)) { |
|
534 | + $error_code = $errors->get_error_code(); |
|
535 | + $error_message = $errors->get_error_message($error_code); |
|
536 | + if (!isset($_POST['user_login']) && ($error_code == 'empty_username' || $error_code == 'invalid_username' || $error_code == 'username_exists')) { |
|
537 | + if ($error_code == 'empty_username') { |
|
538 | + $error_code = 'empty_email'; |
|
539 | + } else if ($error_code == 'invalid_username') { |
|
540 | + $error_code = 'invalid_email'; |
|
541 | + } else if ($error_code == 'username_exists') { |
|
542 | + $error_code = 'email_exists'; |
|
543 | + } |
|
544 | + |
|
545 | + $error_message = $errors->get_error_message($error_code); |
|
546 | + } |
|
547 | + global $geodir_signup_error; |
|
548 | + $geodir_signup_error = $error_message; |
|
549 | + } |
|
550 | + |
|
551 | + if (!is_wp_error($errors)) { |
|
552 | + $_POST['log'] = $user_login; |
|
553 | + $_POST['pwd'] = $errors[1]; |
|
554 | + $_POST['testcookie'] = 1; |
|
555 | + |
|
556 | + $secure_cookie = ''; |
|
557 | + // If the user wants ssl but the session is not ssl, force a secure cookie. |
|
558 | + if (!empty($_POST['log'])) { |
|
559 | + $user_name = sanitize_user($_POST['log']); |
|
560 | + if ($user = get_user_by('email', $user_name)) { |
|
561 | + if (get_user_option('use_ssl', $user->ID)) { |
|
562 | + $secure_cookie = true; |
|
563 | + force_ssl_admin(true); |
|
564 | + } |
|
565 | + } |
|
566 | + } |
|
567 | + |
|
568 | + $redirect_to = $_REQUEST['redirect_to']; |
|
569 | + |
|
570 | + if (!isset($_REQUEST['redirect_to']) || $_REQUEST['redirect_to'] == '') { |
|
571 | + if (isset($_SERVER['HTTP_REFERER']) && strstr($_SERVER['HTTP_REFERER'], home_url())) { |
|
572 | + $redirect_to = $_SERVER['HTTP_REFERER']; |
|
573 | + } else { |
|
574 | + $redirect_to = home_url(); |
|
575 | + } |
|
576 | + |
|
577 | + } |
|
578 | + |
|
579 | + if (isset($_REQUEST['redirect_add_listing']) && $_REQUEST['redirect_add_listing'] != '') { |
|
580 | + |
|
581 | + $redirect_to = $_REQUEST['redirect_add_listing']; |
|
582 | + } |
|
583 | + |
|
584 | + |
|
585 | + if (!$secure_cookie && is_ssl() && force_ssl_login() && !force_ssl_admin() && (0 !== strpos($redirect_to, 'https')) && (0 === strpos($redirect_to, 'http'))) |
|
586 | + $secure_cookie = false; |
|
587 | + |
|
588 | + $user = wp_signon('', $secure_cookie); |
|
589 | + |
|
590 | + $requested_redirect_to = isset($_REQUEST['redirect_add_listing']) && $_REQUEST['redirect_add_listing'] != '' ? $_REQUEST['redirect_add_listing'] : (isset($_REQUEST['redirect_to']) ? $_REQUEST['redirect_to'] : ''); |
|
591 | + /** |
|
592 | + * Filter the login redirect URL. |
|
593 | + * |
|
594 | + * @since 1.4.9 |
|
595 | + * @param string $redirect_to The redirect destination URL. |
|
596 | + * @param string $requested_redirect_to The requested redirect destination URL passed as a parameter. |
|
597 | + * @param WP_User|WP_Error $user WP_User object if login was successful, WP_Error object otherwise. |
|
598 | + */ |
|
599 | + $redirect_to = apply_filters('login_redirect', $redirect_to, $requested_redirect_to, $user); |
|
600 | + |
|
601 | + |
|
602 | + if (!is_wp_error($user)) { |
|
603 | + wp_safe_redirect($redirect_to); |
|
604 | + exit(); |
|
605 | + } |
|
606 | + exit(); |
|
607 | + } |
|
608 | + } |
|
609 | + |
|
610 | + break; |
|
611 | + |
|
612 | + case 'login' : |
|
613 | + default: |
|
614 | + $secure_cookie = ''; |
|
615 | + |
|
616 | + if (!empty($_POST['log'])) { |
|
617 | + $user_name = sanitize_user($_POST['log']); |
|
618 | + if ($user = get_user_by('login', $user_name)) { |
|
619 | + |
|
620 | + if (get_user_option('use_ssl', $user->ID)) { |
|
621 | + $secure_cookie = true; |
|
622 | + force_ssl_admin(true); |
|
623 | + } |
|
624 | + } elseif ($user = get_user_by('email', $user_name)) { |
|
625 | + $_POST['log'] = $user->user_login; // If signing in by email, set the username for normal WP login |
|
626 | + if (get_user_option('use_ssl', $user->ID)) { |
|
627 | + $secure_cookie = true; |
|
628 | + force_ssl_admin(true); |
|
629 | + } |
|
630 | + } |
|
631 | + } |
|
632 | + /////////////////////////// |
|
633 | + if (isset($_REQUEST['redirect_add_listing'])) { |
|
634 | + $_REQUEST['redirect_to'] = $_REQUEST['redirect_add_listing']; |
|
635 | + } |
|
636 | + |
|
637 | + |
|
638 | + if (!isset($_REQUEST['redirect_to']) || $_REQUEST['redirect_to'] == '') { |
|
639 | + if (is_user_logged_in()) : |
|
640 | + $user_ID = isset($user->ID) ? $user->ID : ''; |
|
641 | + $author_link = get_author_posts_url($user_ID); |
|
642 | + $default_author_link = geodir_getlink($author_link, array('geodir_dashbord' => 'true', 'stype' => 'gd_place'), false); |
|
643 | + |
|
644 | + /** |
|
645 | + * Filter the author link. |
|
646 | + * |
|
647 | + * @since 1.0.0 |
|
648 | + * |
|
649 | + * @param string $default_author_link Default author link. |
|
650 | + * @param int $user_ID The user ID. |
|
651 | + */ |
|
652 | + $default_author_link = apply_filters('geodir_dashboard_author_link', $default_author_link, $user_ID); |
|
653 | + |
|
654 | + $_REQUEST['redirect_to'] = $default_author_link; |
|
655 | + else: |
|
656 | + $_REQUEST['redirect_to'] = home_url(); |
|
657 | + endif; |
|
658 | + |
|
659 | + } |
|
660 | + if (isset($_REQUEST['redirect_to'])) { |
|
661 | + $redirect_to = $_REQUEST['redirect_to']; |
|
662 | + // Redirect to https if user wants ssl |
|
663 | + if ($secure_cookie && false !== strpos($redirect_to, 'wp-admin')) |
|
664 | + $redirect_to = preg_replace('|^http://|', 'https://', $redirect_to); |
|
665 | + } else { |
|
666 | + $redirect_to = admin_url(); |
|
667 | + } |
|
668 | + |
|
669 | + if (!$secure_cookie && is_ssl() && force_ssl_login() && !force_ssl_admin() && (0 !== strpos($redirect_to, 'https')) && (0 === strpos($redirect_to, 'http'))) |
|
670 | + $secure_cookie = false; |
|
671 | + $user = wp_signon('', $secure_cookie); |
|
672 | + |
|
673 | + |
|
674 | + /** |
|
675 | + * Filter the login redirect URL. |
|
676 | + * |
|
677 | + * @since 1.4.9 |
|
678 | + * @param string $redirect_to The redirect destination URL. |
|
679 | + * @param WP_User|WP_Error $user WP_User object if login was successful, WP_Error object otherwise. |
|
680 | + */ |
|
681 | + $redirect_to = apply_filters('login_redirect', $redirect_to, isset($_REQUEST['redirect_to']) ? $_REQUEST['redirect_to'] : '', $user); |
|
682 | + |
|
683 | + if (is_wp_error($user)) { |
|
684 | + if (isset($_SERVER['HTTP_REFERER']) && strstr($_SERVER['HTTP_REFERER'], 'ptype=property_submit') && $_POST['log'] != '' && $_POST['pwd'] != '') { |
|
685 | + wp_redirect($_SERVER['HTTP_REFERER'] . '&emsg=1'); |
|
686 | + } |
|
687 | + } |
|
688 | + if (!is_wp_error($user)) { |
|
689 | + |
|
690 | + // Some servers are not logging the user in properly after wp_signon, se we set the user here. |
|
691 | + //wp_set_current_user($user->ID); |
|
692 | + //echo '###';exit; |
|
693 | + |
|
694 | + if ($redirect_to) { |
|
695 | + wp_redirect($redirect_to); |
|
696 | + } else { |
|
697 | + wp_redirect(home_url()); |
|
698 | + } |
|
699 | + exit(); |
|
700 | + } |
|
701 | + |
|
702 | + $errors = $user; |
|
703 | + |
|
704 | + // Clear errors if loggedout is set. |
|
705 | + if (!empty($_GET['loggedout'])) |
|
706 | + $errors = new WP_Error(); |
|
707 | + // If cookies are disabled we can't log in even with a valid user+pass |
|
708 | + if (isset($_POST['testcookie']) && empty($_COOKIE[TEST_COOKIE])) |
|
709 | + $errors->add('test_cookie', __("<strong>ERROR</strong>: Cookies are blocked or not supported by your browser. You must <a href='http://www.google.com/cookies.html'>enable cookies</a> to use WordPress.", 'geodirectory')); |
|
710 | + |
|
711 | + // Some parts of this script use the main login form to display a message |
|
712 | + if (isset($_GET['loggedout']) && TRUE == $_GET['loggedout']) { |
|
713 | + $successmsg = '<div class="sucess_msg">' . YOU_ARE_LOGED_OUT_MSG . '</div>'; |
|
714 | + } elseif (isset($_GET['registration']) && 'disabled' == $_GET['registration']) { |
|
715 | + $successmsg = USER_REG_NOT_ALLOW_MSG; |
|
716 | + } elseif (isset($_GET['checkemail']) && 'confirm' == $_GET['checkemail']) { |
|
717 | + $successmsg = EMAIL_CONFIRM_LINK_MSG; |
|
718 | + } elseif (isset($_GET['checkemail']) && 'newpass' == $_GET['checkemail']) { |
|
719 | + $successmsg = NEW_PW_EMAIL_MSG; |
|
720 | + } elseif (isset($_GET['checkemail']) && 'registered' == $_GET['checkemail']) { |
|
721 | + $successmsg = REG_COMPLETE_MSG; |
|
722 | + } |
|
723 | + |
|
724 | + if ((isset($_POST['log']) && $_POST['log'] != '' && $errors) || ((!isset($_POST['log']) || $_POST['log'] == '') && isset($_REQUEST['testcookie']) && $_REQUEST['testcookie'])) { |
|
725 | + if (isset($_REQUEST['pagetype']) && $_REQUEST['pagetype'] != '') { |
|
726 | + wp_redirect($_REQUEST['pagetype'] . '&emsg=1'); |
|
727 | + } else { |
|
728 | + wp_redirect(geodir_login_url(array('logemsg'=>'1','redirect_to'=>urlencode($_REQUEST['redirect_to'])))); |
|
729 | + } |
|
730 | + exit; |
|
731 | + } |
|
732 | + break; |
|
733 | + endswitch; // end action switch |
|
734 | 734 | } |
735 | 735 | |
736 | 736 | ?> |
737 | 737 | \ No newline at end of file |
@@ -25,11 +25,13 @@ discard block |
||
25 | 25 | window.location.href = '<?php echo geodir_login_url();?>'; |
26 | 26 | </script> |
27 | 27 | <?php |
28 | - } else |
|
29 | - return false; |
|
30 | - } else |
|
31 | - return true; |
|
32 | -} |
|
28 | + } else { |
|
29 | + return false; |
|
30 | + } |
|
31 | + } else { |
|
32 | + return true; |
|
33 | + } |
|
34 | + } |
|
33 | 35 | |
34 | 36 | /** |
35 | 37 | * Redirect to SSL url, if SSL is being used. |
@@ -60,7 +62,9 @@ discard block |
||
60 | 62 | * @param string $message Login message. |
61 | 63 | */ |
62 | 64 | $message = apply_filters('login_message', $message); |
63 | - if (!empty($message)) echo $message . "\n"; |
|
65 | + if (!empty($message)) { |
|
66 | + echo $message . "\n"; |
|
67 | + } |
|
64 | 68 | |
65 | 69 | } |
66 | 70 | |
@@ -141,14 +145,16 @@ discard block |
||
141 | 145 | global $wpdb; |
142 | 146 | |
143 | 147 | $errors = new WP_Error(); |
144 | - if (empty($_POST['user_login']) && empty($_POST['user_email'])) |
|
145 | - $errors->add('empty_username', __('<strong>ERROR</strong>: Enter a username or e-mail address.', 'geodirectory')); |
|
148 | + if (empty($_POST['user_login']) && empty($_POST['user_email'])) { |
|
149 | + $errors->add('empty_username', __('<strong>ERROR</strong>: Enter a username or e-mail address.', 'geodirectory')); |
|
150 | + } |
|
146 | 151 | |
147 | 152 | if (strpos($_POST['user_login'], '@')) { |
148 | 153 | //$user_data = get_user_by_email(trim($_POST['user_login'])); |
149 | 154 | $user_data = get_user_by('email', trim($_POST['user_login'])); |
150 | - if (empty($user_data)) |
|
151 | - $errors->add('invalid_email', __('<strong>ERROR</strong>: There is no user registered with that email address.', 'geodirectory')); |
|
155 | + if (empty($user_data)) { |
|
156 | + $errors->add('invalid_email', __('<strong>ERROR</strong>: There is no user registered with that email address.', 'geodirectory')); |
|
157 | + } |
|
152 | 158 | } else { |
153 | 159 | $login = trim($_POST['user_login']); |
154 | 160 | $user_data = get_user_by('email', $login); |
@@ -161,8 +167,9 @@ discard block |
||
161 | 167 | */ |
162 | 168 | do_action('lostpassword_post'); |
163 | 169 | |
164 | - if ($errors->get_error_code()) |
|
165 | - return $errors; |
|
170 | + if ($errors->get_error_code()) { |
|
171 | + return $errors; |
|
172 | + } |
|
166 | 173 | |
167 | 174 | if (!$user_data) { |
168 | 175 | $errors->add('invalidcombo', __('<strong>ERROR</strong>: Invalid username or e-mail.', 'geodirectory')); |
@@ -192,8 +199,9 @@ discard block |
||
192 | 199 | ) |
193 | 200 | ); |
194 | 201 | |
195 | - if (empty($user)) |
|
196 | - return new WP_Error('invalid_key', __('Invalid key', 'geodirectory')); |
|
202 | + if (empty($user)) { |
|
203 | + return new WP_Error('invalid_key', __('Invalid key', 'geodirectory')); |
|
204 | + } |
|
197 | 205 | |
198 | 206 | $new_pass = wp_generate_password(12, false); |
199 | 207 | |
@@ -282,13 +290,14 @@ discard block |
||
282 | 290 | } |
283 | 291 | |
284 | 292 | // Check the username |
285 | - if ($user_login == '') |
|
286 | - $errors->add('empty_username', __('ERROR: Please enter a username.', 'geodirectory')); |
|
287 | - elseif (!validate_username($user_login)) { |
|
293 | + if ($user_login == '') { |
|
294 | + $errors->add('empty_username', __('ERROR: Please enter a username.', 'geodirectory')); |
|
295 | + } elseif (!validate_username($user_login)) { |
|
288 | 296 | $errors->add('invalid_username', __('<strong>ERROR</strong>: This username is invalid. Please enter a valid username.', 'geodirectory')); |
289 | 297 | $user_login = ''; |
290 | - } elseif (username_exists($user_login)) |
|
291 | - $errors->add('username_exists', __('<strong>ERROR</strong>: This username is already registered, please choose another one.', 'geodirectory')); |
|
298 | + } elseif (username_exists($user_login)) { |
|
299 | + $errors->add('username_exists', __('<strong>ERROR</strong>: This username is already registered, please choose another one.', 'geodirectory')); |
|
300 | + } |
|
292 | 301 | |
293 | 302 | // Check the e-mail address |
294 | 303 | if ($user_email == '') { |
@@ -296,8 +305,9 @@ discard block |
||
296 | 305 | } elseif (!is_email($user_email)) { |
297 | 306 | $errors->add('invalid_email', __('<strong>ERROR</strong>: The email address isn’t correct.', 'geodirectory')); |
298 | 307 | $user_email = ''; |
299 | - } elseif (email_exists($user_email)) |
|
300 | - $errors->add('email_exists', __('<strong>ERROR</strong>: This email is already registered, please choose another one.', 'geodirectory')); |
|
308 | + } elseif (email_exists($user_email)) { |
|
309 | + $errors->add('email_exists', __('<strong>ERROR</strong>: This email is already registered, please choose another one.', 'geodirectory')); |
|
310 | + } |
|
301 | 311 | |
302 | 312 | /** |
303 | 313 | * Called when registering a new user. |
@@ -317,8 +327,9 @@ discard block |
||
317 | 327 | */ |
318 | 328 | $errors = apply_filters('registration_errors', $errors); |
319 | 329 | |
320 | - if ($errors->get_error_code()) |
|
321 | - return $errors; |
|
330 | + if ($errors->get_error_code()) { |
|
331 | + return $errors; |
|
332 | + } |
|
322 | 333 | |
323 | 334 | |
324 | 335 | if (!isset($user_pass) || $user_pass == '') { |
@@ -423,28 +434,33 @@ discard block |
||
423 | 434 | |
424 | 435 | $errors = new WP_Error(); |
425 | 436 | |
426 | - if (isset($_GET['key'])) |
|
427 | - $action = 'resetpass'; |
|
437 | + if (isset($_GET['key'])) { |
|
438 | + $action = 'resetpass'; |
|
439 | + } |
|
428 | 440 | |
429 | 441 | // validate action so as to default to the login screen |
430 | - if (!in_array($action, array('logout', 'lostpassword', 'retrievepassword', 'resetpass', 'rp', 'register', 'login')) && false === has_filter('login_form_' . $action)) |
|
431 | - $action = 'login'; |
|
442 | + if (!in_array($action, array('logout', 'lostpassword', 'retrievepassword', 'resetpass', 'rp', 'register', 'login')) && false === has_filter('login_form_' . $action)) { |
|
443 | + $action = 'login'; |
|
444 | + } |
|
432 | 445 | |
433 | 446 | nocache_headers(); |
434 | 447 | |
435 | 448 | if (defined('RELOCATE')) { // Move flag is set |
436 | - if (isset($_SERVER['PATH_INFO']) && ($_SERVER['PATH_INFO'] != $_SERVER['PHP_SELF'])) |
|
437 | - $_SERVER['PHP_SELF'] = str_replace($_SERVER['PATH_INFO'], '', $_SERVER['PHP_SELF']); |
|
449 | + if (isset($_SERVER['PATH_INFO']) && ($_SERVER['PATH_INFO'] != $_SERVER['PHP_SELF'])) { |
|
450 | + $_SERVER['PHP_SELF'] = str_replace($_SERVER['PATH_INFO'], '', $_SERVER['PHP_SELF']); |
|
451 | + } |
|
438 | 452 | |
439 | 453 | $schema = (isset($_SERVER['HTTPS']) && geodir_strtolower($_SERVER['HTTPS']) == 'on') ? 'https://' : 'http://'; |
440 | - if (dirname($schema . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']) != home_url()) |
|
441 | - update_option('siteurl', dirname($schema . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'])); |
|
454 | + if (dirname($schema . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']) != home_url()) { |
|
455 | + update_option('siteurl', dirname($schema . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'])); |
|
456 | + } |
|
442 | 457 | } |
443 | 458 | |
444 | 459 | //Set a cookie now to see if they are supported by the browser. |
445 | 460 | //setcookie(TEST_COOKIE, 'WP Cookie check', 0, COOKIEPATH, COOKIE_DOMAIN); |
446 | - if (SITECOOKIEPATH != COOKIEPATH) |
|
447 | - setcookie(TEST_COOKIE, 'WP Cookie check', 0, SITECOOKIEPATH, COOKIE_DOMAIN); |
|
461 | + if (SITECOOKIEPATH != COOKIEPATH) { |
|
462 | + setcookie(TEST_COOKIE, 'WP Cookie check', 0, SITECOOKIEPATH, COOKIE_DOMAIN); |
|
463 | + } |
|
448 | 464 | |
449 | 465 | /** |
450 | 466 | * Allow plugins to override the default actions, and to add extra actions if they want on the register/signin page. |
@@ -465,8 +481,9 @@ discard block |
||
465 | 481 | |
466 | 482 | $redirect_to = $_SERVER['HTTP_REFERER']; |
467 | 483 | //$redirect_to = home_url().'/?ptype=login&loggedout=true'; |
468 | - if (isset($_REQUEST['redirect_to'])) |
|
469 | - $redirect_to = $_REQUEST['redirect_to']; |
|
484 | + if (isset($_REQUEST['redirect_to'])) { |
|
485 | + $redirect_to = $_REQUEST['redirect_to']; |
|
486 | + } |
|
470 | 487 | $redirect_to = home_url(); |
471 | 488 | wp_safe_redirect($redirect_to); |
472 | 489 | exit(); |
@@ -486,7 +503,9 @@ discard block |
||
486 | 503 | exit(); |
487 | 504 | } |
488 | 505 | } |
489 | - if (isset($_GET['error']) && 'invalidkey' == $_GET['error']) $errors->add('invalidkey', __('Sorry, that key does not appear to be valid.', 'geodirectory')); |
|
506 | + if (isset($_GET['error']) && 'invalidkey' == $_GET['error']) { |
|
507 | + $errors->add('invalidkey', __('Sorry, that key does not appear to be valid.', 'geodirectory')); |
|
508 | + } |
|
490 | 509 | /** |
491 | 510 | * Called in the geodir_user_signup() function during the lostpassword case. |
492 | 511 | * |
@@ -582,8 +601,9 @@ discard block |
||
582 | 601 | } |
583 | 602 | |
584 | 603 | |
585 | - if (!$secure_cookie && is_ssl() && force_ssl_login() && !force_ssl_admin() && (0 !== strpos($redirect_to, 'https')) && (0 === strpos($redirect_to, 'http'))) |
|
586 | - $secure_cookie = false; |
|
604 | + if (!$secure_cookie && is_ssl() && force_ssl_login() && !force_ssl_admin() && (0 !== strpos($redirect_to, 'https')) && (0 === strpos($redirect_to, 'http'))) { |
|
605 | + $secure_cookie = false; |
|
606 | + } |
|
587 | 607 | |
588 | 608 | $user = wp_signon('', $secure_cookie); |
589 | 609 | |
@@ -652,22 +672,26 @@ discard block |
||
652 | 672 | $default_author_link = apply_filters('geodir_dashboard_author_link', $default_author_link, $user_ID); |
653 | 673 | |
654 | 674 | $_REQUEST['redirect_to'] = $default_author_link; |
655 | - else: |
|
656 | - $_REQUEST['redirect_to'] = home_url(); |
|
675 | + else { |
|
676 | + : |
|
677 | + $_REQUEST['redirect_to'] = home_url(); |
|
678 | + } |
|
657 | 679 | endif; |
658 | 680 | |
659 | 681 | } |
660 | 682 | if (isset($_REQUEST['redirect_to'])) { |
661 | 683 | $redirect_to = $_REQUEST['redirect_to']; |
662 | 684 | // Redirect to https if user wants ssl |
663 | - if ($secure_cookie && false !== strpos($redirect_to, 'wp-admin')) |
|
664 | - $redirect_to = preg_replace('|^http://|', 'https://', $redirect_to); |
|
685 | + if ($secure_cookie && false !== strpos($redirect_to, 'wp-admin')) { |
|
686 | + $redirect_to = preg_replace('|^http://|', 'https://', $redirect_to); |
|
687 | + } |
|
665 | 688 | } else { |
666 | 689 | $redirect_to = admin_url(); |
667 | 690 | } |
668 | 691 | |
669 | - if (!$secure_cookie && is_ssl() && force_ssl_login() && !force_ssl_admin() && (0 !== strpos($redirect_to, 'https')) && (0 === strpos($redirect_to, 'http'))) |
|
670 | - $secure_cookie = false; |
|
692 | + if (!$secure_cookie && is_ssl() && force_ssl_login() && !force_ssl_admin() && (0 !== strpos($redirect_to, 'https')) && (0 === strpos($redirect_to, 'http'))) { |
|
693 | + $secure_cookie = false; |
|
694 | + } |
|
671 | 695 | $user = wp_signon('', $secure_cookie); |
672 | 696 | |
673 | 697 | |
@@ -702,11 +726,13 @@ discard block |
||
702 | 726 | $errors = $user; |
703 | 727 | |
704 | 728 | // Clear errors if loggedout is set. |
705 | - if (!empty($_GET['loggedout'])) |
|
706 | - $errors = new WP_Error(); |
|
729 | + if (!empty($_GET['loggedout'])) { |
|
730 | + $errors = new WP_Error(); |
|
731 | + } |
|
707 | 732 | // If cookies are disabled we can't log in even with a valid user+pass |
708 | - if (isset($_POST['testcookie']) && empty($_COOKIE[TEST_COOKIE])) |
|
709 | - $errors->add('test_cookie', __("<strong>ERROR</strong>: Cookies are blocked or not supported by your browser. You must <a href='http://www.google.com/cookies.html'>enable cookies</a> to use WordPress.", 'geodirectory')); |
|
733 | + if (isset($_POST['testcookie']) && empty($_COOKIE[TEST_COOKIE])) { |
|
734 | + $errors->add('test_cookie', __("<strong>ERROR</strong>: Cookies are blocked or not supported by your browser. You must <a href='http://www.google.com/cookies.html'>enable cookies</a> to use WordPress.", 'geodirectory')); |
|
735 | + } |
|
710 | 736 | |
711 | 737 | // Some parts of this script use the main login form to display a message |
712 | 738 | if (isset($_GET['loggedout']) && TRUE == $_GET['loggedout']) { |
@@ -393,7 +393,7 @@ |
||
393 | 393 | * @global object $post The current post object. |
394 | 394 | * @global object $geodirectory Not yet implemented. |
395 | 395 | * @param string $slug The template slug. |
396 | - * @param null $name The template name. |
|
396 | + * @param string $name The template name. |
|
397 | 397 | */ |
398 | 398 | function geodir_get_template_part($slug = '', $name = NULL) |
399 | 399 | { |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | $listing_page_id = $post->ID; |
34 | 34 | |
35 | 35 | $regex_pattern = get_shortcode_regex(); |
36 | - preg_match('/'.$regex_pattern.'/s', $post->post_content, $regex_matches); |
|
36 | + preg_match('/' . $regex_pattern . '/s', $post->post_content, $regex_matches); |
|
37 | 37 | |
38 | 38 | if (!empty($regex_matches) && isset($regex_matches[2]) == 'gd_add_listing' && isset($regex_matches[3])) { |
39 | 39 | $shortcode_atts = shortcode_parse_atts($regex_matches[3]); |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | if (!empty($post_types)) |
56 | 56 | $post_type = $post_types[0]; |
57 | 57 | |
58 | - if($sc_post_type != '' ) |
|
58 | + if ($sc_post_type != '') |
|
59 | 59 | $post_type = $sc_post_type; |
60 | 60 | |
61 | 61 | if ($is_wpml && !empty($wp->query_vars['page_id'])) { |
@@ -410,7 +410,7 @@ discard block |
||
410 | 410 | */ |
411 | 411 | do_action("geodir_get_template_part_{$slug}", $slug, $name); |
412 | 412 | $templates = array(); |
413 | - $name = (string)$name; |
|
413 | + $name = (string) $name; |
|
414 | 414 | if ('' !== $name) { |
415 | 415 | $template_name = "{$slug}-{$name}.php"; |
416 | 416 | |
@@ -524,7 +524,7 @@ discard block |
||
524 | 524 | function geodir_convert_listing_view_class($columns = '') { |
525 | 525 | $class = ''; |
526 | 526 | |
527 | - switch ((int)$columns) { |
|
527 | + switch ((int) $columns) { |
|
528 | 528 | case 1: |
529 | 529 | $class = ''; |
530 | 530 | break; |
@@ -589,7 +589,7 @@ discard block |
||
589 | 589 | $html .= '<option value=""></option>'; |
590 | 590 | if (!empty($star_texts) && is_array($star_texts)) { |
591 | 591 | foreach ($star_texts as $i => $text) { |
592 | - $html .= '<option ' . selected((int)($i + 1), (int)$default, false) . ' value="' . (int)($i + 1) . '">' . $text . '</option>'; |
|
592 | + $html .= '<option ' . selected((int) ($i + 1), (int) $default, false) . ' value="' . (int) ($i + 1) . '">' . $text . '</option>'; |
|
593 | 593 | } |
594 | 594 | } else { |
595 | 595 | $html .= '<option value="1">1</option>'; |
@@ -618,14 +618,14 @@ discard block |
||
618 | 618 | function geodir_font_awesome_rating_stars_html($html, $rating, $star_count = 5) { |
619 | 619 | if (get_option('geodir_reviewrating_enable_font_awesome') == '1') { |
620 | 620 | $rating = min($rating, $star_count); |
621 | - $full_stars = floor( $rating ); |
|
622 | - $half_stars = ceil( $rating - $full_stars ); |
|
621 | + $full_stars = floor($rating); |
|
622 | + $half_stars = ceil($rating - $full_stars); |
|
623 | 623 | $empty_stars = $star_count - $full_stars - $half_stars; |
624 | 624 | |
625 | 625 | $html = '<div class="gd-star-rating gd-fa-star-rating">'; |
626 | - $html .= str_repeat( '<i class="fa fa-star gd-full-star"></i>', $full_stars ); |
|
627 | - $html .= str_repeat( '<i class="fa fa-star-o fa-star-half-full gd-half-star"></i>', $half_stars ); |
|
628 | - $html .= str_repeat( '<i class="fa fa-star-o gd-empty-star"></i>', $empty_stars); |
|
626 | + $html .= str_repeat('<i class="fa fa-star gd-full-star"></i>', $full_stars); |
|
627 | + $html .= str_repeat('<i class="fa fa-star-o fa-star-half-full gd-half-star"></i>', $half_stars); |
|
628 | + $html .= str_repeat('<i class="fa fa-star-o gd-empty-star"></i>', $empty_stars); |
|
629 | 629 | $html .= '</div>'; |
630 | 630 | } |
631 | 631 |
@@ -47,16 +47,19 @@ discard block |
||
47 | 47 | |
48 | 48 | if ($listing_page_id != '' && (is_page($listing_page_id) || ($is_wpml && !empty($wp->query_vars['page_id']))) && isset($_REQUEST['listing_type']) |
49 | 49 | && in_array($_REQUEST['listing_type'], geodir_get_posttypes()) |
50 | - ) |
|
51 | - $post_type = sanitize_text_field($_REQUEST['listing_type']); |
|
50 | + ) { |
|
51 | + $post_type = sanitize_text_field($_REQUEST['listing_type']); |
|
52 | + } |
|
52 | 53 | if (empty($post_type) && !isset($_REQUEST['pid'])) { |
53 | 54 | $pagename = $wp->query_vars['pagename']; |
54 | 55 | $post_types = geodir_get_posttypes(); |
55 | - if (!empty($post_types)) |
|
56 | - $post_type = $post_types[0]; |
|
56 | + if (!empty($post_types)) { |
|
57 | + $post_type = $post_types[0]; |
|
58 | + } |
|
57 | 59 | |
58 | - if($sc_post_type != '' ) |
|
59 | - $post_type = $sc_post_type; |
|
60 | + if($sc_post_type != '' ) { |
|
61 | + $post_type = $sc_post_type; |
|
62 | + } |
|
60 | 63 | |
61 | 64 | if ($is_wpml && !empty($wp->query_vars['page_id'])) { |
62 | 65 | wp_redirect(geodir_getlink(get_permalink($wp->query_vars['page_id']), array('listing_type' => $post_type))); |
@@ -71,14 +74,16 @@ discard block |
||
71 | 74 | $success_page_id = geodir_success_page_id(); |
72 | 75 | if ($success_page_id != '' && is_page($success_page_id) && isset($_REQUEST['listing_type']) |
73 | 76 | && in_array($_REQUEST['listing_type'], geodir_get_posttypes()) |
74 | - ) |
|
75 | - $post_type = sanitize_text_field($_REQUEST['listing_type']); |
|
77 | + ) { |
|
78 | + $post_type = sanitize_text_field($_REQUEST['listing_type']); |
|
79 | + } |
|
76 | 80 | return $template = locate_template(array("geodirectory/{$post_type}-success.php", "geodirectory/listing-success.php")); |
77 | 81 | break; |
78 | 82 | case 'detail': |
79 | 83 | case 'preview': |
80 | - if (in_array(get_post_type(), geodir_get_posttypes())) |
|
81 | - $post_type = get_post_type(); |
|
84 | + if (in_array(get_post_type(), geodir_get_posttypes())) { |
|
85 | + $post_type = get_post_type(); |
|
86 | + } |
|
82 | 87 | return $template = locate_template(array("geodirectory/single-{$post_type}.php", "geodirectory/listing-detail.php")); |
83 | 88 | break; |
84 | 89 | case 'listing': |
@@ -184,7 +189,9 @@ discard block |
||
184 | 189 | |
185 | 190 | $template = geodir_locate_template('signup'); |
186 | 191 | |
187 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-signup.php'; |
|
192 | + if (!$template) { |
|
193 | + $template = geodir_plugin_path() . '/geodirectory-templates/geodir-signup.php'; |
|
194 | + } |
|
188 | 195 | |
189 | 196 | /** |
190 | 197 | * Filter the signup template path. |
@@ -202,7 +209,9 @@ discard block |
||
202 | 209 | |
203 | 210 | $template = geodir_locate_template('information'); |
204 | 211 | |
205 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-information.php'; |
|
212 | + if (!$template) { |
|
213 | + $template = geodir_plugin_path() . '/geodirectory-templates/geodir-information.php'; |
|
214 | + } |
|
206 | 215 | /** |
207 | 216 | * Filter the information template path. |
208 | 217 | * |
@@ -219,7 +228,9 @@ discard block |
||
219 | 228 | if (!$is_current_user_owner) { |
220 | 229 | $template = geodir_locate_template('information'); |
221 | 230 | |
222 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-information.php'; |
|
231 | + if (!$template) { |
|
232 | + $template = geodir_plugin_path() . '/geodirectory-templates/geodir-information.php'; |
|
233 | + } |
|
223 | 234 | /** |
224 | 235 | * Filter the information template path. |
225 | 236 | * |
@@ -241,7 +252,9 @@ discard block |
||
241 | 252 | |
242 | 253 | $template = geodir_locate_template('add-listing'); |
243 | 254 | |
244 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/add-listing.php'; |
|
255 | + if (!$template) { |
|
256 | + $template = geodir_plugin_path() . '/geodirectory-templates/add-listing.php'; |
|
257 | + } |
|
245 | 258 | /** |
246 | 259 | * Filter the add listing template path. |
247 | 260 | * |
@@ -258,7 +271,9 @@ discard block |
||
258 | 271 | |
259 | 272 | $template = geodir_locate_template('preview'); |
260 | 273 | |
261 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/listing-detail.php'; |
|
274 | + if (!$template) { |
|
275 | + $template = geodir_plugin_path() . '/geodirectory-templates/listing-detail.php'; |
|
276 | + } |
|
262 | 277 | /** |
263 | 278 | * Filter the preview template path. |
264 | 279 | * |
@@ -274,7 +289,9 @@ discard block |
||
274 | 289 | |
275 | 290 | $template = geodir_locate_template('success'); |
276 | 291 | |
277 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/listing-success.php'; |
|
292 | + if (!$template) { |
|
293 | + $template = geodir_plugin_path() . '/geodirectory-templates/listing-success.php'; |
|
294 | + } |
|
278 | 295 | /** |
279 | 296 | * Filter the success template path. |
280 | 297 | * |
@@ -289,7 +306,9 @@ discard block |
||
289 | 306 | |
290 | 307 | $template = geodir_locate_template('detail'); |
291 | 308 | |
292 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/listing-detail.php'; |
|
309 | + if (!$template) { |
|
310 | + $template = geodir_plugin_path() . '/geodirectory-templates/listing-detail.php'; |
|
311 | + } |
|
293 | 312 | /** |
294 | 313 | * Filter the detail template path. |
295 | 314 | * |
@@ -304,7 +323,9 @@ discard block |
||
304 | 323 | |
305 | 324 | $template = geodir_locate_template('listing'); |
306 | 325 | |
307 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-listing.php'; |
|
326 | + if (!$template) { |
|
327 | + $template = geodir_plugin_path() . '/geodirectory-templates/geodir-listing.php'; |
|
328 | + } |
|
308 | 329 | /** |
309 | 330 | * Filter the listing template path. |
310 | 331 | * |
@@ -319,7 +340,9 @@ discard block |
||
319 | 340 | |
320 | 341 | $template = geodir_locate_template('search'); |
321 | 342 | |
322 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-search.php'; |
|
343 | + if (!$template) { |
|
344 | + $template = geodir_plugin_path() . '/geodirectory-templates/geodir-search.php'; |
|
345 | + } |
|
323 | 346 | /** |
324 | 347 | * Filter the search template path. |
325 | 348 | * |
@@ -334,7 +357,9 @@ discard block |
||
334 | 357 | |
335 | 358 | $template = geodir_locate_template('author'); |
336 | 359 | |
337 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-author.php'; |
|
360 | + if (!$template) { |
|
361 | + $template = geodir_plugin_path() . '/geodirectory-templates/geodir-author.php'; |
|
362 | + } |
|
338 | 363 | /** |
339 | 364 | * Filter the author template path. |
340 | 365 | * |
@@ -355,7 +380,9 @@ discard block |
||
355 | 380 | |
356 | 381 | $template = geodir_locate_template('geodir-home'); |
357 | 382 | |
358 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-home.php'; |
|
383 | + if (!$template) { |
|
384 | + $template = geodir_plugin_path() . '/geodirectory-templates/geodir-home.php'; |
|
385 | + } |
|
359 | 386 | /** |
360 | 387 | * Filter the home page template path. |
361 | 388 | * |
@@ -368,7 +395,9 @@ discard block |
||
368 | 395 | |
369 | 396 | $template = geodir_locate_template('location'); |
370 | 397 | |
371 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-location.php'; |
|
398 | + if (!$template) { |
|
399 | + $template = geodir_plugin_path() . '/geodirectory-templates/geodir-location.php'; |
|
400 | + } |
|
372 | 401 | /** |
373 | 402 | * Filter the location template path. |
374 | 403 | * |
@@ -377,8 +406,9 @@ discard block |
||
377 | 406 | */ |
378 | 407 | return $template = apply_filters('geodir_template_location', $template); |
379 | 408 | |
380 | - } else |
|
381 | - return $template; |
|
409 | + } else { |
|
410 | + return $template; |
|
411 | + } |
|
382 | 412 | |
383 | 413 | } |
384 | 414 | |
@@ -432,8 +462,10 @@ discard block |
||
432 | 462 | * @since 1.0.0 |
433 | 463 | */ |
434 | 464 | include($template); |
435 | - else: |
|
436 | - locate_template(array("geodirectory/" . $template_name), true, false); |
|
465 | + else { |
|
466 | + : |
|
467 | + locate_template(array("geodirectory/" . $template_name), true, false); |
|
468 | + } |
|
437 | 469 | endif; |
438 | 470 | |
439 | 471 | } |
@@ -19,18 +19,18 @@ discard block |
||
19 | 19 | */ |
20 | 20 | function geodir_locate_template($template = '') |
21 | 21 | { |
22 | - global $post_type, $wp, $post; |
|
23 | - $fields = array(); |
|
22 | + global $post_type, $wp, $post; |
|
23 | + $fields = array(); |
|
24 | 24 | |
25 | - switch ($template): |
|
26 | - case 'signup': |
|
27 | - return $template = locate_template(array("geodirectory/geodir-signup.php")); |
|
28 | - break; |
|
29 | - case 'add-listing': |
|
25 | + switch ($template): |
|
26 | + case 'signup': |
|
27 | + return $template = locate_template(array("geodirectory/geodir-signup.php")); |
|
28 | + break; |
|
29 | + case 'add-listing': |
|
30 | 30 | |
31 | - $sc_post_type = ''; |
|
31 | + $sc_post_type = ''; |
|
32 | 32 | if (is_page() && isset($post->post_content) && has_shortcode($post->post_content, 'gd_add_listing')) { |
33 | - $listing_page_id = $post->ID; |
|
33 | + $listing_page_id = $post->ID; |
|
34 | 34 | |
35 | 35 | $regex_pattern = get_shortcode_regex(); |
36 | 36 | preg_match('/'.$regex_pattern.'/s', $post->post_content, $regex_matches); |
@@ -39,100 +39,100 @@ discard block |
||
39 | 39 | $shortcode_atts = shortcode_parse_atts($regex_matches[3]); |
40 | 40 | $sc_post_type = !empty($shortcode_atts) && isset($shortcode_atts['listing_type']) && !empty($shortcode_atts['listing_type']) ? $shortcode_atts['listing_type'] : ''; |
41 | 41 | } |
42 | - } else { |
|
43 | - $listing_page_id = geodir_add_listing_page_id(); |
|
44 | - } |
|
42 | + } else { |
|
43 | + $listing_page_id = geodir_add_listing_page_id(); |
|
44 | + } |
|
45 | 45 | |
46 | 46 | $is_wpml = function_exists('icl_object_id') ? true : false; |
47 | 47 | |
48 | - if ($listing_page_id != '' && (is_page($listing_page_id) || ($is_wpml && !empty($wp->query_vars['page_id']))) && isset($_REQUEST['listing_type']) |
|
49 | - && in_array($_REQUEST['listing_type'], geodir_get_posttypes()) |
|
50 | - ) |
|
51 | - $post_type = sanitize_text_field($_REQUEST['listing_type']); |
|
52 | - if (empty($post_type) && !isset($_REQUEST['pid'])) { |
|
53 | - $pagename = $wp->query_vars['pagename']; |
|
54 | - $post_types = geodir_get_posttypes(); |
|
55 | - if (!empty($post_types)) |
|
56 | - $post_type = $post_types[0]; |
|
48 | + if ($listing_page_id != '' && (is_page($listing_page_id) || ($is_wpml && !empty($wp->query_vars['page_id']))) && isset($_REQUEST['listing_type']) |
|
49 | + && in_array($_REQUEST['listing_type'], geodir_get_posttypes()) |
|
50 | + ) |
|
51 | + $post_type = sanitize_text_field($_REQUEST['listing_type']); |
|
52 | + if (empty($post_type) && !isset($_REQUEST['pid'])) { |
|
53 | + $pagename = $wp->query_vars['pagename']; |
|
54 | + $post_types = geodir_get_posttypes(); |
|
55 | + if (!empty($post_types)) |
|
56 | + $post_type = $post_types[0]; |
|
57 | 57 | |
58 | 58 | if($sc_post_type != '' ) |
59 | 59 | $post_type = $sc_post_type; |
60 | 60 | |
61 | - if ($is_wpml && !empty($wp->query_vars['page_id'])) { |
|
61 | + if ($is_wpml && !empty($wp->query_vars['page_id'])) { |
|
62 | 62 | wp_redirect(geodir_getlink(get_permalink($wp->query_vars['page_id']), array('listing_type' => $post_type))); |
63 | 63 | } else { |
64 | 64 | wp_redirect(trailingslashit(get_site_url()) . $pagename . '/?listing_type=' . $post_type); |
65 | 65 | } |
66 | - exit(); |
|
67 | - } |
|
68 | - return $template = locate_template(array("geodirectory/add-{$post_type}.php", "geodirectory/add-listing.php")); |
|
69 | - break; |
|
70 | - case 'success': |
|
71 | - $success_page_id = geodir_success_page_id(); |
|
72 | - if ($success_page_id != '' && is_page($success_page_id) && isset($_REQUEST['listing_type']) |
|
73 | - && in_array($_REQUEST['listing_type'], geodir_get_posttypes()) |
|
74 | - ) |
|
75 | - $post_type = sanitize_text_field($_REQUEST['listing_type']); |
|
76 | - return $template = locate_template(array("geodirectory/{$post_type}-success.php", "geodirectory/listing-success.php")); |
|
77 | - break; |
|
78 | - case 'detail': |
|
79 | - case 'preview': |
|
80 | - if (in_array(get_post_type(), geodir_get_posttypes())) |
|
81 | - $post_type = get_post_type(); |
|
82 | - return $template = locate_template(array("geodirectory/single-{$post_type}.php", "geodirectory/listing-detail.php")); |
|
83 | - break; |
|
84 | - case 'listing': |
|
85 | - $templates = array(); |
|
86 | - if (is_post_type_archive() && in_array(get_post_type(), geodir_get_posttypes())) { |
|
87 | - $post_type = get_post_type(); |
|
88 | - $templates[] = "geodirectory/archive-$post_type.php"; |
|
89 | - } |
|
90 | - |
|
91 | - |
|
92 | - if (is_tax() && geodir_get_taxonomy_posttype()) { |
|
93 | - $query_obj = get_queried_object(); |
|
94 | - $curr_taxonomy = isset($query_obj->taxonomy) ? $query_obj->taxonomy : ''; |
|
95 | - $curr_term = isset($query_obj->slug) ? $query_obj->slug : ''; |
|
96 | - $templates[] = "geodirectory/taxonomy-$curr_taxonomy-$curr_term.php"; |
|
97 | - $templates[] = "geodirectory/taxonomy-$curr_taxonomy.php"; |
|
98 | - } |
|
99 | - |
|
100 | - $templates[] = "geodirectory/geodir-listing.php"; |
|
101 | - |
|
102 | - return $template = locate_template($templates); |
|
103 | - break; |
|
104 | - case 'information': |
|
105 | - return $template = locate_template(array("geodirectory/geodir-information.php")); |
|
106 | - break; |
|
107 | - case 'author': |
|
108 | - return $template = locate_template(array("geodirectory/geodir-author.php")); |
|
109 | - break; |
|
110 | - case 'search': |
|
111 | - return $template = locate_template(array("geodirectory/geodir-search.php")); |
|
112 | - break; |
|
113 | - case 'location': |
|
114 | - return $template = locate_template(array("geodirectory/geodir-location.php")); |
|
115 | - break; |
|
116 | - case 'geodir-home': |
|
117 | - return $template = locate_template(array("geodirectory/geodir-home.php")); |
|
118 | - break; |
|
119 | - case 'listing-listview': |
|
120 | - $template = locate_template(array("geodirectory/listing-listview.php")); |
|
121 | - if (!$template) { |
|
122 | - $template = geodir_plugin_path() . '/geodirectory-templates/listing-listview.php'; |
|
123 | - } |
|
124 | - return $template; |
|
125 | - break; |
|
126 | - case 'widget-listing-listview': |
|
127 | - $template = locate_template(array("geodirectory/widget-listing-listview.php")); |
|
128 | - if (!$template) { |
|
129 | - $template = geodir_plugin_path() . '/geodirectory-templates/widget-listing-listview.php'; |
|
130 | - } |
|
131 | - return $template; |
|
132 | - break; |
|
133 | - endswitch; |
|
134 | - |
|
135 | - return false; |
|
66 | + exit(); |
|
67 | + } |
|
68 | + return $template = locate_template(array("geodirectory/add-{$post_type}.php", "geodirectory/add-listing.php")); |
|
69 | + break; |
|
70 | + case 'success': |
|
71 | + $success_page_id = geodir_success_page_id(); |
|
72 | + if ($success_page_id != '' && is_page($success_page_id) && isset($_REQUEST['listing_type']) |
|
73 | + && in_array($_REQUEST['listing_type'], geodir_get_posttypes()) |
|
74 | + ) |
|
75 | + $post_type = sanitize_text_field($_REQUEST['listing_type']); |
|
76 | + return $template = locate_template(array("geodirectory/{$post_type}-success.php", "geodirectory/listing-success.php")); |
|
77 | + break; |
|
78 | + case 'detail': |
|
79 | + case 'preview': |
|
80 | + if (in_array(get_post_type(), geodir_get_posttypes())) |
|
81 | + $post_type = get_post_type(); |
|
82 | + return $template = locate_template(array("geodirectory/single-{$post_type}.php", "geodirectory/listing-detail.php")); |
|
83 | + break; |
|
84 | + case 'listing': |
|
85 | + $templates = array(); |
|
86 | + if (is_post_type_archive() && in_array(get_post_type(), geodir_get_posttypes())) { |
|
87 | + $post_type = get_post_type(); |
|
88 | + $templates[] = "geodirectory/archive-$post_type.php"; |
|
89 | + } |
|
90 | + |
|
91 | + |
|
92 | + if (is_tax() && geodir_get_taxonomy_posttype()) { |
|
93 | + $query_obj = get_queried_object(); |
|
94 | + $curr_taxonomy = isset($query_obj->taxonomy) ? $query_obj->taxonomy : ''; |
|
95 | + $curr_term = isset($query_obj->slug) ? $query_obj->slug : ''; |
|
96 | + $templates[] = "geodirectory/taxonomy-$curr_taxonomy-$curr_term.php"; |
|
97 | + $templates[] = "geodirectory/taxonomy-$curr_taxonomy.php"; |
|
98 | + } |
|
99 | + |
|
100 | + $templates[] = "geodirectory/geodir-listing.php"; |
|
101 | + |
|
102 | + return $template = locate_template($templates); |
|
103 | + break; |
|
104 | + case 'information': |
|
105 | + return $template = locate_template(array("geodirectory/geodir-information.php")); |
|
106 | + break; |
|
107 | + case 'author': |
|
108 | + return $template = locate_template(array("geodirectory/geodir-author.php")); |
|
109 | + break; |
|
110 | + case 'search': |
|
111 | + return $template = locate_template(array("geodirectory/geodir-search.php")); |
|
112 | + break; |
|
113 | + case 'location': |
|
114 | + return $template = locate_template(array("geodirectory/geodir-location.php")); |
|
115 | + break; |
|
116 | + case 'geodir-home': |
|
117 | + return $template = locate_template(array("geodirectory/geodir-home.php")); |
|
118 | + break; |
|
119 | + case 'listing-listview': |
|
120 | + $template = locate_template(array("geodirectory/listing-listview.php")); |
|
121 | + if (!$template) { |
|
122 | + $template = geodir_plugin_path() . '/geodirectory-templates/listing-listview.php'; |
|
123 | + } |
|
124 | + return $template; |
|
125 | + break; |
|
126 | + case 'widget-listing-listview': |
|
127 | + $template = locate_template(array("geodirectory/widget-listing-listview.php")); |
|
128 | + if (!$template) { |
|
129 | + $template = geodir_plugin_path() . '/geodirectory-templates/widget-listing-listview.php'; |
|
130 | + } |
|
131 | + return $template; |
|
132 | + break; |
|
133 | + endswitch; |
|
134 | + |
|
135 | + return false; |
|
136 | 136 | |
137 | 137 | } |
138 | 138 | |
@@ -151,238 +151,238 @@ discard block |
||
151 | 151 | function geodir_template_loader($template) |
152 | 152 | { |
153 | 153 | |
154 | - global $wp_query; |
|
155 | - |
|
156 | - /** |
|
157 | - * Filter the custom page list. |
|
158 | - * |
|
159 | - * @since 1.0.0 |
|
160 | - */ |
|
161 | - $geodir_custom_page_list = apply_filters('geodir_set_custom_pages', array( |
|
162 | - 'geodir_signup_page' => |
|
163 | - apply_filters('geodir_set_custom_signup_page', false), |
|
164 | - 'geodir_add_listing_page' => |
|
165 | - apply_filters('geodir_set_custom_add_listing_page', false), |
|
166 | - 'geodir_preview_page' => |
|
167 | - apply_filters('geodir_set_custom_preview_page', false), |
|
168 | - 'geodir_listing_success_page' => |
|
169 | - apply_filters('geodir_set_custom_listing_success_page', false), |
|
170 | - 'geodir_listing_detail_page' => |
|
171 | - apply_filters('geodir_set_custom_listing_detail_page', false), |
|
172 | - 'geodir_listing_page' => |
|
173 | - apply_filters('geodir_set_custom_listing_page', false), |
|
174 | - 'geodir_search_page' => |
|
175 | - apply_filters('geodir_set_custom_search_page', false), |
|
176 | - 'geodir_author_page' => |
|
177 | - apply_filters('geodir_set_custom_author_page', false), |
|
178 | - 'geodir_home_map_page' => |
|
179 | - apply_filters('geodir_set_custom_home_map_page', false) |
|
180 | - )); |
|
181 | - |
|
182 | - |
|
183 | - if (geodir_is_page('login') || $geodir_custom_page_list['geodir_signup_page']) { |
|
184 | - |
|
185 | - $template = geodir_locate_template('signup'); |
|
186 | - |
|
187 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-signup.php'; |
|
188 | - |
|
189 | - /** |
|
190 | - * Filter the signup template path. |
|
191 | - * |
|
192 | - * @since 1.0.0 |
|
193 | - * @param string $template The template path. |
|
194 | - */ |
|
195 | - return $template = apply_filters('geodir_template_signup', $template); |
|
196 | - } |
|
197 | - |
|
198 | - if (geodir_is_page('add-listing') || $geodir_custom_page_list['geodir_add_listing_page']) { |
|
199 | - if (!geodir_is_default_location_set()) { |
|
200 | - global $information; |
|
201 | - $information = sprintf(__('Please %sclick here%s to set a default location, this will make the plugin work properly.', 'geodirectory'), '<a href=\'' . admin_url('admin.php?page=geodirectory&tab=default_location_settings') . '\'>', '</a>'); |
|
202 | - |
|
203 | - $template = geodir_locate_template('information'); |
|
204 | - |
|
205 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-information.php'; |
|
206 | - /** |
|
207 | - * Filter the information template path. |
|
208 | - * |
|
209 | - * @since 1.0.0 |
|
210 | - * @param string $template The template path. |
|
211 | - */ |
|
212 | - return $template = apply_filters('geodir_template_information', $template); |
|
213 | - } |
|
214 | - // check if pid exists in the record if yes then check if this post belongs to the user who is logged in. |
|
215 | - if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') { |
|
216 | - global $information; |
|
217 | - $information = __('This listing does not belong to your account, please check the listing id carefully.', 'geodirectory'); |
|
218 | - $is_current_user_owner = geodir_listing_belong_to_current_user(); |
|
219 | - if (!$is_current_user_owner) { |
|
220 | - $template = geodir_locate_template('information'); |
|
221 | - |
|
222 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-information.php'; |
|
223 | - /** |
|
224 | - * Filter the information template path. |
|
225 | - * |
|
226 | - * @since 1.0.0 |
|
227 | - * @param string $template The template path. |
|
228 | - */ |
|
229 | - return $template = apply_filters('geodir_template_information', $template); |
|
230 | - } |
|
231 | - |
|
232 | - |
|
233 | - } |
|
234 | - |
|
235 | - //geodir_is_login(true); |
|
236 | - global $current_user; |
|
237 | - if (!$current_user->ID) { |
|
238 | - wp_redirect(geodir_login_url(array('redirect_add_listing'=>urlencode(geodir_curPageURL()))), 302); |
|
239 | - exit; |
|
240 | - } |
|
241 | - |
|
242 | - $template = geodir_locate_template('add-listing'); |
|
243 | - |
|
244 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/add-listing.php'; |
|
245 | - /** |
|
246 | - * Filter the add listing template path. |
|
247 | - * |
|
248 | - * @since 1.0.0 |
|
249 | - * @param string $template The template path. |
|
250 | - */ |
|
251 | - return $template = apply_filters('geodir_template_add_listing', $template); |
|
252 | - } |
|
253 | - |
|
254 | - |
|
255 | - if (geodir_is_page('preview') || $geodir_custom_page_list['geodir_preview_page']) { |
|
256 | - global $preview; |
|
257 | - $preview = true; |
|
258 | - |
|
259 | - $template = geodir_locate_template('preview'); |
|
260 | - |
|
261 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/listing-detail.php'; |
|
262 | - /** |
|
263 | - * Filter the preview template path. |
|
264 | - * |
|
265 | - * @since 1.0.0 |
|
266 | - * @param string $template The template path. |
|
267 | - */ |
|
268 | - return $template = apply_filters('geodir_template_preview', $template); |
|
269 | - |
|
270 | - } |
|
271 | - |
|
272 | - |
|
273 | - if (geodir_is_page('listing-success') || $geodir_custom_page_list['geodir_listing_success_page']) { |
|
274 | - |
|
275 | - $template = geodir_locate_template('success'); |
|
276 | - |
|
277 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/listing-success.php'; |
|
278 | - /** |
|
279 | - * Filter the success template path. |
|
280 | - * |
|
281 | - * @since 1.0.0 |
|
282 | - * @param string $template The template path. |
|
283 | - */ |
|
284 | - return $template = apply_filters('geodir_template_success', $template); |
|
285 | - |
|
286 | - } |
|
287 | - |
|
288 | - if (geodir_is_page('detail') || $geodir_custom_page_list['geodir_listing_detail_page']) { |
|
289 | - |
|
290 | - $template = geodir_locate_template('detail'); |
|
291 | - |
|
292 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/listing-detail.php'; |
|
293 | - /** |
|
294 | - * Filter the detail template path. |
|
295 | - * |
|
296 | - * @since 1.0.0 |
|
297 | - * @param string $template The template path. |
|
298 | - */ |
|
299 | - return $template = apply_filters('geodir_template_detail', $template); |
|
300 | - |
|
301 | - } |
|
302 | - |
|
303 | - if (geodir_is_page('listing') || $geodir_custom_page_list['geodir_listing_page']) { |
|
304 | - |
|
305 | - $template = geodir_locate_template('listing'); |
|
306 | - |
|
307 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-listing.php'; |
|
308 | - /** |
|
309 | - * Filter the listing template path. |
|
310 | - * |
|
311 | - * @since 1.0.0 |
|
312 | - * @param string $template The template path. |
|
313 | - */ |
|
314 | - return $template = apply_filters('geodir_template_listing', $template); |
|
154 | + global $wp_query; |
|
315 | 155 | |
316 | - } |
|
156 | + /** |
|
157 | + * Filter the custom page list. |
|
158 | + * |
|
159 | + * @since 1.0.0 |
|
160 | + */ |
|
161 | + $geodir_custom_page_list = apply_filters('geodir_set_custom_pages', array( |
|
162 | + 'geodir_signup_page' => |
|
163 | + apply_filters('geodir_set_custom_signup_page', false), |
|
164 | + 'geodir_add_listing_page' => |
|
165 | + apply_filters('geodir_set_custom_add_listing_page', false), |
|
166 | + 'geodir_preview_page' => |
|
167 | + apply_filters('geodir_set_custom_preview_page', false), |
|
168 | + 'geodir_listing_success_page' => |
|
169 | + apply_filters('geodir_set_custom_listing_success_page', false), |
|
170 | + 'geodir_listing_detail_page' => |
|
171 | + apply_filters('geodir_set_custom_listing_detail_page', false), |
|
172 | + 'geodir_listing_page' => |
|
173 | + apply_filters('geodir_set_custom_listing_page', false), |
|
174 | + 'geodir_search_page' => |
|
175 | + apply_filters('geodir_set_custom_search_page', false), |
|
176 | + 'geodir_author_page' => |
|
177 | + apply_filters('geodir_set_custom_author_page', false), |
|
178 | + 'geodir_home_map_page' => |
|
179 | + apply_filters('geodir_set_custom_home_map_page', false) |
|
180 | + )); |
|
181 | + |
|
182 | + |
|
183 | + if (geodir_is_page('login') || $geodir_custom_page_list['geodir_signup_page']) { |
|
184 | + |
|
185 | + $template = geodir_locate_template('signup'); |
|
186 | + |
|
187 | + if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-signup.php'; |
|
188 | + |
|
189 | + /** |
|
190 | + * Filter the signup template path. |
|
191 | + * |
|
192 | + * @since 1.0.0 |
|
193 | + * @param string $template The template path. |
|
194 | + */ |
|
195 | + return $template = apply_filters('geodir_template_signup', $template); |
|
196 | + } |
|
317 | 197 | |
318 | - if (geodir_is_page('search') || $geodir_custom_page_list['geodir_search_page']) { |
|
198 | + if (geodir_is_page('add-listing') || $geodir_custom_page_list['geodir_add_listing_page']) { |
|
199 | + if (!geodir_is_default_location_set()) { |
|
200 | + global $information; |
|
201 | + $information = sprintf(__('Please %sclick here%s to set a default location, this will make the plugin work properly.', 'geodirectory'), '<a href=\'' . admin_url('admin.php?page=geodirectory&tab=default_location_settings') . '\'>', '</a>'); |
|
202 | + |
|
203 | + $template = geodir_locate_template('information'); |
|
204 | + |
|
205 | + if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-information.php'; |
|
206 | + /** |
|
207 | + * Filter the information template path. |
|
208 | + * |
|
209 | + * @since 1.0.0 |
|
210 | + * @param string $template The template path. |
|
211 | + */ |
|
212 | + return $template = apply_filters('geodir_template_information', $template); |
|
213 | + } |
|
214 | + // check if pid exists in the record if yes then check if this post belongs to the user who is logged in. |
|
215 | + if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') { |
|
216 | + global $information; |
|
217 | + $information = __('This listing does not belong to your account, please check the listing id carefully.', 'geodirectory'); |
|
218 | + $is_current_user_owner = geodir_listing_belong_to_current_user(); |
|
219 | + if (!$is_current_user_owner) { |
|
220 | + $template = geodir_locate_template('information'); |
|
221 | + |
|
222 | + if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-information.php'; |
|
223 | + /** |
|
224 | + * Filter the information template path. |
|
225 | + * |
|
226 | + * @since 1.0.0 |
|
227 | + * @param string $template The template path. |
|
228 | + */ |
|
229 | + return $template = apply_filters('geodir_template_information', $template); |
|
230 | + } |
|
319 | 231 | |
320 | - $template = geodir_locate_template('search'); |
|
321 | 232 | |
322 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-search.php'; |
|
323 | - /** |
|
324 | - * Filter the search template path. |
|
325 | - * |
|
326 | - * @since 1.0.0 |
|
327 | - * @param string $template The template path. |
|
328 | - */ |
|
329 | - return $template = apply_filters('geodir_template_search', $template); |
|
233 | + } |
|
234 | + |
|
235 | + //geodir_is_login(true); |
|
236 | + global $current_user; |
|
237 | + if (!$current_user->ID) { |
|
238 | + wp_redirect(geodir_login_url(array('redirect_add_listing'=>urlencode(geodir_curPageURL()))), 302); |
|
239 | + exit; |
|
240 | + } |
|
241 | + |
|
242 | + $template = geodir_locate_template('add-listing'); |
|
243 | + |
|
244 | + if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/add-listing.php'; |
|
245 | + /** |
|
246 | + * Filter the add listing template path. |
|
247 | + * |
|
248 | + * @since 1.0.0 |
|
249 | + * @param string $template The template path. |
|
250 | + */ |
|
251 | + return $template = apply_filters('geodir_template_add_listing', $template); |
|
252 | + } |
|
330 | 253 | |
331 | - } |
|
332 | 254 | |
333 | - if (geodir_is_page('author') || $geodir_custom_page_list['geodir_author_page']) { |
|
255 | + if (geodir_is_page('preview') || $geodir_custom_page_list['geodir_preview_page']) { |
|
256 | + global $preview; |
|
257 | + $preview = true; |
|
334 | 258 | |
335 | - $template = geodir_locate_template('author'); |
|
259 | + $template = geodir_locate_template('preview'); |
|
336 | 260 | |
337 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-author.php'; |
|
338 | - /** |
|
339 | - * Filter the author template path. |
|
340 | - * |
|
341 | - * @since 1.0.0 |
|
342 | - * @param string $template The template path. |
|
343 | - */ |
|
344 | - return $template = apply_filters('geodir_template_author', $template); |
|
261 | + if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/listing-detail.php'; |
|
262 | + /** |
|
263 | + * Filter the preview template path. |
|
264 | + * |
|
265 | + * @since 1.0.0 |
|
266 | + * @param string $template The template path. |
|
267 | + */ |
|
268 | + return $template = apply_filters('geodir_template_preview', $template); |
|
345 | 269 | |
346 | - } |
|
270 | + } |
|
347 | 271 | |
348 | - if (get_option('geodir_set_as_home') || geodir_is_page('home') || geodir_is_page('location')) { |
|
349 | 272 | |
350 | - global $post, $wp_query; |
|
273 | + if (geodir_is_page('listing-success') || $geodir_custom_page_list['geodir_listing_success_page']) { |
|
351 | 274 | |
352 | - if (geodir_is_page('home') || ('page' == get_option('show_on_front') && isset($post->ID) && $post->ID == get_option('page_on_front')) |
|
353 | - || (is_home() && !$wp_query->is_posts_page) |
|
354 | - ) { |
|
275 | + $template = geodir_locate_template('success'); |
|
355 | 276 | |
356 | - $template = geodir_locate_template('geodir-home'); |
|
277 | + if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/listing-success.php'; |
|
278 | + /** |
|
279 | + * Filter the success template path. |
|
280 | + * |
|
281 | + * @since 1.0.0 |
|
282 | + * @param string $template The template path. |
|
283 | + */ |
|
284 | + return $template = apply_filters('geodir_template_success', $template); |
|
357 | 285 | |
358 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-home.php'; |
|
359 | - /** |
|
360 | - * Filter the home page template path. |
|
361 | - * |
|
362 | - * @since 1.0.0 |
|
363 | - * @param string $template The template path. |
|
364 | - */ |
|
365 | - return $template = apply_filters('geodir_template_homepage', $template); |
|
286 | + } |
|
366 | 287 | |
367 | - } elseif (geodir_is_page('location')) { |
|
288 | + if (geodir_is_page('detail') || $geodir_custom_page_list['geodir_listing_detail_page']) { |
|
368 | 289 | |
369 | - $template = geodir_locate_template('location'); |
|
290 | + $template = geodir_locate_template('detail'); |
|
370 | 291 | |
371 | - if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-location.php'; |
|
372 | - /** |
|
373 | - * Filter the location template path. |
|
374 | - * |
|
375 | - * @since 1.0.0 |
|
376 | - * @param string $template The template path. |
|
377 | - */ |
|
378 | - return $template = apply_filters('geodir_template_location', $template); |
|
292 | + if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/listing-detail.php'; |
|
293 | + /** |
|
294 | + * Filter the detail template path. |
|
295 | + * |
|
296 | + * @since 1.0.0 |
|
297 | + * @param string $template The template path. |
|
298 | + */ |
|
299 | + return $template = apply_filters('geodir_template_detail', $template); |
|
300 | + |
|
301 | + } |
|
302 | + |
|
303 | + if (geodir_is_page('listing') || $geodir_custom_page_list['geodir_listing_page']) { |
|
304 | + |
|
305 | + $template = geodir_locate_template('listing'); |
|
306 | + |
|
307 | + if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-listing.php'; |
|
308 | + /** |
|
309 | + * Filter the listing template path. |
|
310 | + * |
|
311 | + * @since 1.0.0 |
|
312 | + * @param string $template The template path. |
|
313 | + */ |
|
314 | + return $template = apply_filters('geodir_template_listing', $template); |
|
315 | + |
|
316 | + } |
|
379 | 317 | |
380 | - } else |
|
381 | - return $template; |
|
318 | + if (geodir_is_page('search') || $geodir_custom_page_list['geodir_search_page']) { |
|
382 | 319 | |
383 | - } |
|
320 | + $template = geodir_locate_template('search'); |
|
384 | 321 | |
385 | - return $template; |
|
322 | + if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-search.php'; |
|
323 | + /** |
|
324 | + * Filter the search template path. |
|
325 | + * |
|
326 | + * @since 1.0.0 |
|
327 | + * @param string $template The template path. |
|
328 | + */ |
|
329 | + return $template = apply_filters('geodir_template_search', $template); |
|
330 | + |
|
331 | + } |
|
332 | + |
|
333 | + if (geodir_is_page('author') || $geodir_custom_page_list['geodir_author_page']) { |
|
334 | + |
|
335 | + $template = geodir_locate_template('author'); |
|
336 | + |
|
337 | + if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-author.php'; |
|
338 | + /** |
|
339 | + * Filter the author template path. |
|
340 | + * |
|
341 | + * @since 1.0.0 |
|
342 | + * @param string $template The template path. |
|
343 | + */ |
|
344 | + return $template = apply_filters('geodir_template_author', $template); |
|
345 | + |
|
346 | + } |
|
347 | + |
|
348 | + if (get_option('geodir_set_as_home') || geodir_is_page('home') || geodir_is_page('location')) { |
|
349 | + |
|
350 | + global $post, $wp_query; |
|
351 | + |
|
352 | + if (geodir_is_page('home') || ('page' == get_option('show_on_front') && isset($post->ID) && $post->ID == get_option('page_on_front')) |
|
353 | + || (is_home() && !$wp_query->is_posts_page) |
|
354 | + ) { |
|
355 | + |
|
356 | + $template = geodir_locate_template('geodir-home'); |
|
357 | + |
|
358 | + if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-home.php'; |
|
359 | + /** |
|
360 | + * Filter the home page template path. |
|
361 | + * |
|
362 | + * @since 1.0.0 |
|
363 | + * @param string $template The template path. |
|
364 | + */ |
|
365 | + return $template = apply_filters('geodir_template_homepage', $template); |
|
366 | + |
|
367 | + } elseif (geodir_is_page('location')) { |
|
368 | + |
|
369 | + $template = geodir_locate_template('location'); |
|
370 | + |
|
371 | + if (!$template) $template = geodir_plugin_path() . '/geodirectory-templates/geodir-location.php'; |
|
372 | + /** |
|
373 | + * Filter the location template path. |
|
374 | + * |
|
375 | + * @since 1.0.0 |
|
376 | + * @param string $template The template path. |
|
377 | + */ |
|
378 | + return $template = apply_filters('geodir_template_location', $template); |
|
379 | + |
|
380 | + } else |
|
381 | + return $template; |
|
382 | + |
|
383 | + } |
|
384 | + |
|
385 | + return $template; |
|
386 | 386 | } |
387 | 387 | |
388 | 388 | /** |
@@ -397,44 +397,44 @@ discard block |
||
397 | 397 | */ |
398 | 398 | function geodir_get_template_part($slug = '', $name = NULL) |
399 | 399 | { |
400 | - global $geodirectory, $post; |
|
401 | - /** |
|
402 | - * Called at the start for the geodir_get_template_part() function. |
|
403 | - * |
|
404 | - * Used dynamic hook name: geodir_get_template_part_{$slug} |
|
405 | - * |
|
406 | - * @since 1.0.0 |
|
407 | - * @package GeoDirectory |
|
408 | - * @param string $slug The template slug. |
|
409 | - * @param string $name The template name. |
|
410 | - */ |
|
411 | - do_action("geodir_get_template_part_{$slug}", $slug, $name); |
|
412 | - $templates = array(); |
|
413 | - $name = (string)$name; |
|
414 | - if ('' !== $name) { |
|
415 | - $template_name = "{$slug}-{$name}.php"; |
|
416 | - |
|
417 | - } else { |
|
418 | - $template_name = "{$slug}.php"; |
|
419 | - } |
|
420 | - |
|
421 | - if (!locate_template(array("geodirectory/" . $template_name))) : |
|
422 | - /** |
|
423 | - * Filter the template part with slug and name. |
|
424 | - * |
|
425 | - * @since 1.0.0 |
|
426 | - * @param string $template_name The template name. |
|
427 | - */ |
|
428 | - $template = apply_filters("geodir_template_part-{$slug}-{$name}", geodir_plugin_path() . '/geodirectory-templates/' . $template_name); |
|
429 | - /** |
|
430 | - * Includes the template part with slug and name. |
|
431 | - * |
|
432 | - * @since 1.0.0 |
|
433 | - */ |
|
434 | - include($template); |
|
435 | - else: |
|
436 | - locate_template(array("geodirectory/" . $template_name), true, false); |
|
437 | - endif; |
|
400 | + global $geodirectory, $post; |
|
401 | + /** |
|
402 | + * Called at the start for the geodir_get_template_part() function. |
|
403 | + * |
|
404 | + * Used dynamic hook name: geodir_get_template_part_{$slug} |
|
405 | + * |
|
406 | + * @since 1.0.0 |
|
407 | + * @package GeoDirectory |
|
408 | + * @param string $slug The template slug. |
|
409 | + * @param string $name The template name. |
|
410 | + */ |
|
411 | + do_action("geodir_get_template_part_{$slug}", $slug, $name); |
|
412 | + $templates = array(); |
|
413 | + $name = (string)$name; |
|
414 | + if ('' !== $name) { |
|
415 | + $template_name = "{$slug}-{$name}.php"; |
|
416 | + |
|
417 | + } else { |
|
418 | + $template_name = "{$slug}.php"; |
|
419 | + } |
|
420 | + |
|
421 | + if (!locate_template(array("geodirectory/" . $template_name))) : |
|
422 | + /** |
|
423 | + * Filter the template part with slug and name. |
|
424 | + * |
|
425 | + * @since 1.0.0 |
|
426 | + * @param string $template_name The template name. |
|
427 | + */ |
|
428 | + $template = apply_filters("geodir_template_part-{$slug}-{$name}", geodir_plugin_path() . '/geodirectory-templates/' . $template_name); |
|
429 | + /** |
|
430 | + * Includes the template part with slug and name. |
|
431 | + * |
|
432 | + * @since 1.0.0 |
|
433 | + */ |
|
434 | + include($template); |
|
435 | + else: |
|
436 | + locate_template(array("geodirectory/" . $template_name), true, false); |
|
437 | + endif; |
|
438 | 438 | |
439 | 439 | } |
440 | 440 | |
@@ -450,23 +450,23 @@ discard block |
||
450 | 450 | */ |
451 | 451 | function geodir_core_post_view_extra_class($class, $all_postypes = '') |
452 | 452 | { |
453 | - global $post; |
|
453 | + global $post; |
|
454 | 454 | |
455 | - if (!$all_postypes) { |
|
456 | - $all_postypes = geodir_get_posttypes(); |
|
457 | - } |
|
455 | + if (!$all_postypes) { |
|
456 | + $all_postypes = geodir_get_posttypes(); |
|
457 | + } |
|
458 | 458 | |
459 | - $gdp_post_id = !empty($post) && isset($post->ID) ? $post->ID : NULL; |
|
460 | - $gdp_post_type = $gdp_post_id > 0 && isset($post->post_type) ? $post->post_type : NULL; |
|
461 | - $gdp_post_type = $gdp_post_type != '' && !empty($all_postypes) && in_array($gdp_post_type, $all_postypes) ? $gdp_post_type : NULL; |
|
459 | + $gdp_post_id = !empty($post) && isset($post->ID) ? $post->ID : NULL; |
|
460 | + $gdp_post_type = $gdp_post_id > 0 && isset($post->post_type) ? $post->post_type : NULL; |
|
461 | + $gdp_post_type = $gdp_post_type != '' && !empty($all_postypes) && in_array($gdp_post_type, $all_postypes) ? $gdp_post_type : NULL; |
|
462 | 462 | |
463 | - if ($gdp_post_id && $gdp_post_type) { |
|
464 | - $append_class = 'gd-post-' . $gdp_post_type; |
|
465 | - $append_class .= isset($post->is_featured) && $post->is_featured > 0 ? ' gd-post-featured' : ''; |
|
466 | - $class = $class != '' ? $class . ' ' . $append_class : $append_class; |
|
467 | - } |
|
463 | + if ($gdp_post_id && $gdp_post_type) { |
|
464 | + $append_class = 'gd-post-' . $gdp_post_type; |
|
465 | + $append_class .= isset($post->is_featured) && $post->is_featured > 0 ? ' gd-post-featured' : ''; |
|
466 | + $class = $class != '' ? $class . ' ' . $append_class : $append_class; |
|
467 | + } |
|
468 | 468 | |
469 | - return $class; |
|
469 | + return $class; |
|
470 | 470 | } |
471 | 471 | |
472 | 472 | /** |
@@ -480,7 +480,7 @@ discard block |
||
480 | 480 | * @param bool $favorite Listing Optional. Are favorite listings results? Default: false. |
481 | 481 | */ |
482 | 482 | function geodir_display_message_not_found_on_listing($template_listview = 'listing-listview', $favorite = false) { |
483 | - if ($favorite) { |
|
483 | + if ($favorite) { |
|
484 | 484 | $message = __('No favorite listings found which match your selection.', 'geodirectory'); |
485 | 485 | } else { |
486 | 486 | $message = __('No listings found which match your selection.', 'geodirectory'); |
@@ -107,7 +107,6 @@ |
||
107 | 107 | * @link http://php.net/manual/en/arrayaccess.offsetset.php |
108 | 108 | * |
109 | 109 | * @param mixed $offset The offset to assign the value to. |
110 | - * @param mixed $value The value to set. |
|
111 | 110 | * |
112 | 111 | * @return void |
113 | 112 | */ |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | */ |
12 | 12 | |
13 | 13 | // Exit if accessed directly |
14 | -if ( ! defined( 'ABSPATH' ) ) exit; |
|
14 | +if (!defined('ABSPATH')) exit; |
|
15 | 15 | |
16 | 16 | /** |
17 | 17 | * Recursive array class to allow multidimensional array access. |
@@ -39,9 +39,9 @@ discard block |
||
39 | 39 | * |
40 | 40 | * @param array $data |
41 | 41 | */ |
42 | - protected function __construct( $data = array() ) { |
|
43 | - foreach ( $data as $key => $value ) { |
|
44 | - $this[ $key ] = $value; |
|
42 | + protected function __construct($data = array()) { |
|
43 | + foreach ($data as $key => $value) { |
|
44 | + $this[$key] = $value; |
|
45 | 45 | } |
46 | 46 | } |
47 | 47 | |
@@ -49,9 +49,9 @@ discard block |
||
49 | 49 | * Allow deep copies of objects |
50 | 50 | */ |
51 | 51 | public function __clone() { |
52 | - foreach ( $this->container as $key => $value ) { |
|
53 | - if ( $value instanceof self ) { |
|
54 | - $this[ $key ] = clone $value; |
|
52 | + foreach ($this->container as $key => $value) { |
|
53 | + if ($value instanceof self) { |
|
54 | + $this[$key] = clone $value; |
|
55 | 55 | } |
56 | 56 | } |
57 | 57 | } |
@@ -63,9 +63,9 @@ discard block |
||
63 | 63 | */ |
64 | 64 | public function toArray() { |
65 | 65 | $data = $this->container; |
66 | - foreach ( $data as $key => $value ) { |
|
67 | - if ( $value instanceof self ) { |
|
68 | - $data[ $key ] = $value->toArray(); |
|
66 | + foreach ($data as $key => $value) { |
|
67 | + if ($value instanceof self) { |
|
68 | + $data[$key] = $value->toArray(); |
|
69 | 69 | } |
70 | 70 | } |
71 | 71 | return $data; |
@@ -84,8 +84,8 @@ discard block |
||
84 | 84 | * |
85 | 85 | * @return boolean true on success or false on failure. |
86 | 86 | */ |
87 | - public function offsetExists( $offset ) { |
|
88 | - return isset( $this->container[ $offset ]) ; |
|
87 | + public function offsetExists($offset) { |
|
88 | + return isset($this->container[$offset]); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | /** |
@@ -97,8 +97,8 @@ discard block |
||
97 | 97 | * |
98 | 98 | * @return mixed Can return all value types. |
99 | 99 | */ |
100 | - public function offsetGet( $offset ) { |
|
101 | - return isset( $this->container[ $offset ] ) ? $this->container[ $offset ] : null; |
|
100 | + public function offsetGet($offset) { |
|
101 | + return isset($this->container[$offset]) ? $this->container[$offset] : null; |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | /** |
@@ -111,14 +111,14 @@ discard block |
||
111 | 111 | * |
112 | 112 | * @return void |
113 | 113 | */ |
114 | - public function offsetSet( $offset, $data ) { |
|
115 | - if ( is_array( $data ) ) { |
|
116 | - $data = new self( $data ); |
|
114 | + public function offsetSet($offset, $data) { |
|
115 | + if (is_array($data)) { |
|
116 | + $data = new self($data); |
|
117 | 117 | } |
118 | - if ( $offset === null ) { // don't forget this! |
|
118 | + if ($offset === null) { // don't forget this! |
|
119 | 119 | $this->container[] = $data; |
120 | 120 | } else { |
121 | - $this->container[ $offset ] = $data; |
|
121 | + $this->container[$offset] = $data; |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | $this->dirty = true; |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | * |
134 | 134 | * @return void |
135 | 135 | */ |
136 | - public function offsetUnset( $offset ) { |
|
137 | - unset( $this->container[ $offset ] ); |
|
136 | + public function offsetUnset($offset) { |
|
137 | + unset($this->container[$offset]); |
|
138 | 138 | } |
139 | 139 | } |
@@ -11,7 +11,9 @@ |
||
11 | 11 | */ |
12 | 12 | |
13 | 13 | // Exit if accessed directly |
14 | -if ( ! defined( 'ABSPATH' ) ) exit; |
|
14 | +if ( ! defined( 'ABSPATH' ) ) { |
|
15 | + exit; |
|
16 | +} |
|
15 | 17 | |
16 | 18 | /** |
17 | 19 | * Return the current cache expire setting. |
@@ -72,8 +72,8 @@ |
||
72 | 72 | } |
73 | 73 | |
74 | 74 | /** |
75 | - * ArrayAccess Implementation |
|
76 | - **/ |
|
75 | + * ArrayAccess Implementation |
|
76 | + **/ |
|
77 | 77 | |
78 | 78 | /** |
79 | 79 | * Whether a offset exists |
@@ -51,7 +51,6 @@ |
||
51 | 51 | /** |
52 | 52 | * Retrieve the current session instance. |
53 | 53 | * |
54 | - * @param bool $session_id Session ID from which to populate data. |
|
55 | 54 | * |
56 | 55 | * @return bool|WP_Session |
57 | 56 | */ |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | */ |
12 | 12 | |
13 | 13 | // Exit if accessed directly |
14 | -if ( ! defined( 'ABSPATH' ) ) exit; |
|
14 | +if (!defined('ABSPATH')) exit; |
|
15 | 15 | |
16 | 16 | /** |
17 | 17 | * WordPress Session class for managing user session data. |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | * @return bool|WP_Session |
57 | 57 | */ |
58 | 58 | public static function get_instance() { |
59 | - if ( ! self::$instance ) { |
|
59 | + if (!self::$instance) { |
|
60 | 60 | self::$instance = new self(); |
61 | 61 | } |
62 | 62 | |
@@ -72,17 +72,17 @@ discard block |
||
72 | 72 | * @uses apply_filters Calls `wp_session_expiration` to determine how long until sessions expire. |
73 | 73 | */ |
74 | 74 | protected function __construct() { |
75 | - if ( isset( $_COOKIE[WP_SESSION_COOKIE] ) ) { |
|
76 | - $cookie = stripslashes( $_COOKIE[WP_SESSION_COOKIE] ); |
|
77 | - $cookie_crumbs = explode( '||', $cookie ); |
|
75 | + if (isset($_COOKIE[WP_SESSION_COOKIE])) { |
|
76 | + $cookie = stripslashes($_COOKIE[WP_SESSION_COOKIE]); |
|
77 | + $cookie_crumbs = explode('||', $cookie); |
|
78 | 78 | |
79 | - if( $this->is_valid_md5( $cookie_crumbs[0] ) ) { |
|
79 | + if ($this->is_valid_md5($cookie_crumbs[0])) { |
|
80 | 80 | |
81 | 81 | $this->session_id = $cookie_crumbs[0]; |
82 | 82 | |
83 | 83 | } else { |
84 | 84 | |
85 | - $this->regenerate_id( true ); |
|
85 | + $this->regenerate_id(true); |
|
86 | 86 | |
87 | 87 | } |
88 | 88 | |
@@ -90,10 +90,10 @@ discard block |
||
90 | 90 | $this->exp_variant = $cookie_crumbs[2]; |
91 | 91 | |
92 | 92 | // Update the session expiration if we're past the variant time |
93 | - if ( time() > $this->exp_variant ) { |
|
93 | + if (time() > $this->exp_variant) { |
|
94 | 94 | $this->set_expiration(); |
95 | - delete_option( "_wp_session_expires_{$this->session_id}" ); |
|
96 | - add_option( "_wp_session_expires_{$this->session_id}", $this->expires, '', 'no' ); |
|
95 | + delete_option("_wp_session_expires_{$this->session_id}"); |
|
96 | + add_option("_wp_session_expires_{$this->session_id}", $this->expires, '', 'no'); |
|
97 | 97 | } |
98 | 98 | } else { |
99 | 99 | $this->session_id = $this->generate_id(); |
@@ -125,8 +125,8 @@ discard block |
||
125 | 125 | * @uses apply_filters Calls `wp_session_expiration` to get the standard expiration time for sessions. |
126 | 126 | */ |
127 | 127 | protected function set_expiration() { |
128 | - $this->exp_variant = time() + (int) apply_filters( 'wp_session_expiration_variant', 24 * 60 ); |
|
129 | - $this->expires = time() + (int) apply_filters( 'wp_session_expiration', 30 * 60 ); |
|
128 | + $this->exp_variant = time() + (int) apply_filters('wp_session_expiration_variant', 24 * 60); |
|
129 | + $this->expires = time() + (int) apply_filters('wp_session_expiration', 30 * 60); |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | /** |
@@ -134,9 +134,9 @@ discard block |
||
134 | 134 | */ |
135 | 135 | protected function set_cookie() { |
136 | 136 | try { |
137 | - setcookie( WP_SESSION_COOKIE, $this->session_id . '||' . $this->expires . '||' . $this->exp_variant , $this->expires, COOKIEPATH, COOKIE_DOMAIN ); |
|
138 | - } catch(Exception $e) { |
|
139 | - error_log( 'Set Cookie Error: ' . $e->getMessage() ); |
|
137 | + setcookie(WP_SESSION_COOKIE, $this->session_id . '||' . $this->expires . '||' . $this->exp_variant, $this->expires, COOKIEPATH, COOKIE_DOMAIN); |
|
138 | + } catch (Exception $e) { |
|
139 | + error_log('Set Cookie Error: ' . $e->getMessage()); |
|
140 | 140 | } |
141 | 141 | } |
142 | 142 | |
@@ -146,10 +146,10 @@ discard block |
||
146 | 146 | * @return string |
147 | 147 | */ |
148 | 148 | protected function generate_id() { |
149 | - require_once( ABSPATH . 'wp-includes/class-phpass.php'); |
|
150 | - $hasher = new PasswordHash( 8, false ); |
|
149 | + require_once(ABSPATH . 'wp-includes/class-phpass.php'); |
|
150 | + $hasher = new PasswordHash(8, false); |
|
151 | 151 | |
152 | - return md5( $hasher->get_random_bytes( 32 ) ); |
|
152 | + return md5($hasher->get_random_bytes(32)); |
|
153 | 153 | } |
154 | 154 | |
155 | 155 | /** |
@@ -158,8 +158,8 @@ discard block |
||
158 | 158 | * @param string $md5 |
159 | 159 | * @return int |
160 | 160 | */ |
161 | - protected function is_valid_md5( $md5 = '' ){ |
|
162 | - return preg_match( '/^[a-f0-9]{32}$/', $md5 ); |
|
161 | + protected function is_valid_md5($md5 = '') { |
|
162 | + return preg_match('/^[a-f0-9]{32}$/', $md5); |
|
163 | 163 | } |
164 | 164 | |
165 | 165 | /** |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | * @return array |
171 | 171 | */ |
172 | 172 | protected function read_data() { |
173 | - $this->container = get_option( "_wp_session_{$this->session_id}", array() ); |
|
173 | + $this->container = get_option("_wp_session_{$this->session_id}", array()); |
|
174 | 174 | |
175 | 175 | return $this->container; |
176 | 176 | } |
@@ -182,13 +182,13 @@ discard block |
||
182 | 182 | $option_key = "_wp_session_{$this->session_id}"; |
183 | 183 | |
184 | 184 | // Only write the collection to the DB if it's changed. |
185 | - if ( $this->dirty ) { |
|
186 | - if ( false === get_option( $option_key ) ) { |
|
187 | - add_option( "_wp_session_{$this->session_id}", $this->container, '', 'no' ); |
|
188 | - add_option( "_wp_session_expires_{$this->session_id}", $this->expires, '', 'no' ); |
|
185 | + if ($this->dirty) { |
|
186 | + if (false === get_option($option_key)) { |
|
187 | + add_option("_wp_session_{$this->session_id}", $this->container, '', 'no'); |
|
188 | + add_option("_wp_session_expires_{$this->session_id}", $this->expires, '', 'no'); |
|
189 | 189 | } else { |
190 | - delete_option( "_wp_session_{$this->session_id}" ); |
|
191 | - add_option( "_wp_session_{$this->session_id}", $this->container, '', 'no' ); |
|
190 | + delete_option("_wp_session_{$this->session_id}"); |
|
191 | + add_option("_wp_session_{$this->session_id}", $this->container, '', 'no'); |
|
192 | 192 | } |
193 | 193 | } |
194 | 194 | } |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | * @return string |
200 | 200 | */ |
201 | 201 | public function json_out() { |
202 | - return json_encode( $this->container ); |
|
202 | + return json_encode($this->container); |
|
203 | 203 | } |
204 | 204 | |
205 | 205 | /** |
@@ -209,10 +209,10 @@ discard block |
||
209 | 209 | * |
210 | 210 | * @return bool |
211 | 211 | */ |
212 | - public function json_in( $data ) { |
|
213 | - $array = json_decode( $data ); |
|
212 | + public function json_in($data) { |
|
213 | + $array = json_decode($data); |
|
214 | 214 | |
215 | - if ( is_array( $array ) ) { |
|
215 | + if (is_array($array)) { |
|
216 | 216 | $this->container = $array; |
217 | 217 | return true; |
218 | 218 | } |
@@ -225,9 +225,9 @@ discard block |
||
225 | 225 | * |
226 | 226 | * @param bool $delete_old Flag whether or not to delete the old session data from the server. |
227 | 227 | */ |
228 | - public function regenerate_id( $delete_old = false ) { |
|
229 | - if ( $delete_old ) { |
|
230 | - delete_option( "_wp_session_{$this->session_id}" ); |
|
228 | + public function regenerate_id($delete_old = false) { |
|
229 | + if ($delete_old) { |
|
230 | + delete_option("_wp_session_{$this->session_id}"); |
|
231 | 231 | } |
232 | 232 | |
233 | 233 | $this->session_id = $this->generate_id(); |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | * @return mixed |
273 | 273 | */ |
274 | 274 | public function current() { |
275 | - return current( $this->container ); |
|
275 | + return current($this->container); |
|
276 | 276 | } |
277 | 277 | |
278 | 278 | /** |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | * @return mixed |
284 | 284 | */ |
285 | 285 | public function key() { |
286 | - return key( $this->container ); |
|
286 | + return key($this->container); |
|
287 | 287 | } |
288 | 288 | |
289 | 289 | /** |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | * @return void |
295 | 295 | */ |
296 | 296 | public function next() { |
297 | - next( $this->container ); |
|
297 | + next($this->container); |
|
298 | 298 | } |
299 | 299 | |
300 | 300 | /** |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | * @return void |
306 | 306 | */ |
307 | 307 | public function rewind() { |
308 | - reset( $this->container ); |
|
308 | + reset($this->container); |
|
309 | 309 | } |
310 | 310 | |
311 | 311 | /** |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | * @return bool |
317 | 317 | */ |
318 | 318 | public function valid() { |
319 | - return $this->offsetExists( $this->key() ); |
|
319 | + return $this->offsetExists($this->key()); |
|
320 | 320 | } |
321 | 321 | |
322 | 322 | /*****************************************************************/ |
@@ -331,6 +331,6 @@ discard block |
||
331 | 331 | * @return int |
332 | 332 | */ |
333 | 333 | public function count() { |
334 | - return count( $this->container ); |
|
334 | + return count($this->container); |
|
335 | 335 | } |
336 | 336 | } |
@@ -1,14 +1,14 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * WordPress session managment. |
|
4 | - * |
|
5 | - * Standardizes WordPress session data using database-backed options for storage. |
|
6 | - * for storing user session information. |
|
7 | - * |
|
8 | - * @package WordPress |
|
9 | - * @subpackage Session |
|
10 | - * @since 3.7.0 |
|
11 | - */ |
|
3 | + * WordPress session managment. |
|
4 | + * |
|
5 | + * Standardizes WordPress session data using database-backed options for storage. |
|
6 | + * for storing user session information. |
|
7 | + * |
|
8 | + * @package WordPress |
|
9 | + * @subpackage Session |
|
10 | + * @since 3.7.0 |
|
11 | + */ |
|
12 | 12 | |
13 | 13 | // Exit if accessed directly |
14 | 14 | if ( ! defined( 'ABSPATH' ) ) exit; |
@@ -134,10 +134,10 @@ discard block |
||
134 | 134 | */ |
135 | 135 | protected function set_cookie() { |
136 | 136 | try { |
137 | - setcookie( WP_SESSION_COOKIE, $this->session_id . '||' . $this->expires . '||' . $this->exp_variant , $this->expires, COOKIEPATH, COOKIE_DOMAIN ); |
|
138 | - } catch(Exception $e) { |
|
139 | - error_log( 'Set Cookie Error: ' . $e->getMessage() ); |
|
140 | - } |
|
137 | + setcookie( WP_SESSION_COOKIE, $this->session_id . '||' . $this->expires . '||' . $this->exp_variant , $this->expires, COOKIEPATH, COOKIE_DOMAIN ); |
|
138 | + } catch(Exception $e) { |
|
139 | + error_log( 'Set Cookie Error: ' . $e->getMessage() ); |
|
140 | + } |
|
141 | 141 | } |
142 | 142 | |
143 | 143 | /** |
@@ -11,7 +11,9 @@ |
||
11 | 11 | */ |
12 | 12 | |
13 | 13 | // Exit if accessed directly |
14 | -if ( ! defined( 'ABSPATH' ) ) exit; |
|
14 | +if ( ! defined( 'ABSPATH' ) ) { |
|
15 | + exit; |
|
16 | +} |
|
15 | 17 | |
16 | 18 | /** |
17 | 19 | * Return the current cache expire setting. |
@@ -2203,7 +2203,7 @@ |
||
2203 | 2203 | * @global object $wpdb WordPress Database object. |
2204 | 2204 | * @global string $plugin_prefix Geodirectory plugin table prefix. |
2205 | 2205 | * @param int $attachment_id Attachment ID. |
2206 | - * @return bool|void Returns false on failure. |
|
2206 | + * @return false|null Returns false on failure. |
|
2207 | 2207 | */ |
2208 | 2208 | function geodirectory_before_featured_image_delete($attachment_id) |
2209 | 2209 | { |
@@ -86,8 +86,9 @@ discard block |
||
86 | 86 | add_filter('query_vars', 'geodir_add_location_var'); |
87 | 87 | add_filter('query_vars', 'geodir_add_geodir_page_var'); |
88 | 88 | add_action('wp', 'geodir_add_page_id_in_query_var'); // problem fix in wordpress 3.8 |
89 | -if (get_option('permalink_structure') != '') |
|
90 | - add_filter('parse_request', 'geodir_set_location_var_in_session_in_core'); |
|
89 | +if (get_option('permalink_structure') != '') { |
|
90 | + add_filter('parse_request', 'geodir_set_location_var_in_session_in_core'); |
|
91 | +} |
|
91 | 92 | |
92 | 93 | add_filter('parse_query', 'geodir_modified_query'); |
93 | 94 | |
@@ -420,8 +421,9 @@ discard block |
||
420 | 421 | */ |
421 | 422 | do_action('geodir_after_social_sharing_buttons'); |
422 | 423 | $content_html = ob_get_clean(); |
423 | - if (trim($content_html) != '') |
|
424 | - $content_html = '<div class="geodir-company_info geodir-details-sidebar-social-sharing">' . $content_html . '</div>'; |
|
424 | + if (trim($content_html) != '') { |
|
425 | + $content_html = '<div class="geodir-company_info geodir-details-sidebar-social-sharing">' . $content_html . '</div>'; |
|
426 | + } |
|
425 | 427 | if ((int)get_option('geodir_disable_tfg_buttons_section') != 1) { |
426 | 428 | /** |
427 | 429 | * Filter the geodir_social_sharing_buttons() function content. |
@@ -467,8 +469,9 @@ discard block |
||
467 | 469 | */ |
468 | 470 | do_action('geodir_after_share_this_button'); |
469 | 471 | $content_html = ob_get_clean(); |
470 | - if (trim($content_html) != '') |
|
471 | - $content_html = '<div class="geodir-company_info geodir-details-sidebar-sharethis">' . $content_html . '</div>'; |
|
472 | + if (trim($content_html) != '') { |
|
473 | + $content_html = '<div class="geodir-company_info geodir-details-sidebar-sharethis">' . $content_html . '</div>'; |
|
474 | + } |
|
472 | 475 | if ((int)get_option('geodir_disable_sharethis_button_section') != 1) { |
473 | 476 | /** |
474 | 477 | * Filter the geodir_share_this_button() function content. |
@@ -526,8 +529,9 @@ discard block |
||
526 | 529 | */ |
527 | 530 | do_action('geodir_after_edit_post_link'); |
528 | 531 | $content_html = ob_get_clean(); |
529 | - if (trim($content_html) != '') |
|
530 | - $content_html = '<div class="geodir-company_info geodir-details-sidebar-user-links">' . $content_html . '</div>'; |
|
532 | + if (trim($content_html) != '') { |
|
533 | + $content_html = '<div class="geodir-company_info geodir-details-sidebar-user-links">' . $content_html . '</div>'; |
|
534 | + } |
|
531 | 535 | if ((int)get_option('geodir_disable_user_links_section') != 1) { |
532 | 536 | /** |
533 | 537 | * Filter the geodir_edit_post_link() function content. |
@@ -1080,8 +1084,9 @@ discard block |
||
1080 | 1084 | */ |
1081 | 1085 | do_action('geodir_after_google_analytics'); |
1082 | 1086 | $content_html = ob_get_clean(); |
1083 | - if (trim($content_html) != '') |
|
1084 | - $content_html = '<div class="geodir-company_info geodir-details-sidebar-google-analytics">' . $content_html . '</div>'; |
|
1087 | + if (trim($content_html) != '') { |
|
1088 | + $content_html = '<div class="geodir-company_info geodir-details-sidebar-google-analytics">' . $content_html . '</div>'; |
|
1089 | + } |
|
1085 | 1090 | if ((int)get_option('geodir_disable_google_analytics_section') != 1) { |
1086 | 1091 | /** |
1087 | 1092 | * Filter the geodir_edit_post_link() function content. |
@@ -1216,8 +1221,9 @@ discard block |
||
1216 | 1221 | do_action('geodir_after_detail_page_more_info'); |
1217 | 1222 | |
1218 | 1223 | $content_html = ob_get_clean(); |
1219 | - if (trim($content_html) != '') |
|
1220 | - $content_html = '<div class="geodir-company_info geodir-details-sidebar-listing-info">' . $content_html . '</div>'; |
|
1224 | + if (trim($content_html) != '') { |
|
1225 | + $content_html = '<div class="geodir-company_info geodir-details-sidebar-listing-info">' . $content_html . '</div>'; |
|
1226 | + } |
|
1221 | 1227 | if ((int)get_option('geodir_disable_listing_info_section') != 1) { |
1222 | 1228 | /** |
1223 | 1229 | * Filter the output html for function geodir_detail_page_more_info(). |
@@ -1322,8 +1328,9 @@ discard block |
||
1322 | 1328 | $arr_alert_msg = apply_filters('geodir_all_js_msg', $arr_alert_msg); |
1323 | 1329 | |
1324 | 1330 | foreach ($arr_alert_msg as $key => $value) { |
1325 | - if (!is_scalar($value)) |
|
1326 | - continue; |
|
1331 | + if (!is_scalar($value)) { |
|
1332 | + continue; |
|
1333 | + } |
|
1327 | 1334 | $arr_alert_msg[$key] = html_entity_decode((string)$value, ENT_QUOTES, 'UTF-8'); |
1328 | 1335 | } |
1329 | 1336 | |
@@ -1377,17 +1384,19 @@ discard block |
||
1377 | 1384 | global $geodir_sidebars; |
1378 | 1385 | global $sidebars_widgets; |
1379 | 1386 | |
1380 | - if (!is_array($sidebars_widgets)) |
|
1381 | - $sidebars_widgets = wp_get_sidebars_widgets(); |
|
1387 | + if (!is_array($sidebars_widgets)) { |
|
1388 | + $sidebars_widgets = wp_get_sidebars_widgets(); |
|
1389 | + } |
|
1382 | 1390 | $geodir_old_sidebars = array(); |
1383 | 1391 | |
1384 | 1392 | if (is_array($geodir_sidebars)) { |
1385 | 1393 | foreach ($geodir_sidebars as $val) { |
1386 | 1394 | if (is_array($sidebars_widgets)) { |
1387 | - if (array_key_exists($val, $sidebars_widgets)) |
|
1388 | - $geodir_old_sidebars[$val] = $sidebars_widgets[$val]; |
|
1389 | - else |
|
1390 | - $geodir_old_sidebars[$val] = array(); |
|
1395 | + if (array_key_exists($val, $sidebars_widgets)) { |
|
1396 | + $geodir_old_sidebars[$val] = $sidebars_widgets[$val]; |
|
1397 | + } else { |
|
1398 | + $geodir_old_sidebars[$val] = array(); |
|
1399 | + } |
|
1391 | 1400 | } |
1392 | 1401 | } |
1393 | 1402 | } |
@@ -1408,8 +1417,9 @@ discard block |
||
1408 | 1417 | { |
1409 | 1418 | global $sidebars_widgets; |
1410 | 1419 | |
1411 | - if (!is_array($sidebars_widgets)) |
|
1412 | - $sidebars_widgets = wp_get_sidebars_widgets(); |
|
1420 | + if (!is_array($sidebars_widgets)) { |
|
1421 | + $sidebars_widgets = wp_get_sidebars_widgets(); |
|
1422 | + } |
|
1413 | 1423 | |
1414 | 1424 | if (is_array($sidebars_widgets)) { |
1415 | 1425 | $geodir_old_sidebars = get_option('geodir_sidebars'); |
@@ -1551,20 +1561,25 @@ discard block |
||
1551 | 1561 | |
1552 | 1562 | global $post, $post_images, $video, $special_offers, $related_listing, $geodir_post_detail_fields; |
1553 | 1563 | |
1554 | - if ($tab == 'post_info') |
|
1555 | - $is_display = (!empty($geodir_post_detail_fields)) ? true : false; |
|
1564 | + if ($tab == 'post_info') { |
|
1565 | + $is_display = (!empty($geodir_post_detail_fields)) ? true : false; |
|
1566 | + } |
|
1556 | 1567 | |
1557 | - if ($tab == 'post_images') |
|
1558 | - $is_display = (!empty($post_images)) ? true : false; |
|
1568 | + if ($tab == 'post_images') { |
|
1569 | + $is_display = (!empty($post_images)) ? true : false; |
|
1570 | + } |
|
1559 | 1571 | |
1560 | - if ($tab == 'post_video') |
|
1561 | - $is_display = (!empty($video)) ? true : false; |
|
1572 | + if ($tab == 'post_video') { |
|
1573 | + $is_display = (!empty($video)) ? true : false; |
|
1574 | + } |
|
1562 | 1575 | |
1563 | - if ($tab == 'special_offers') |
|
1564 | - $is_display = (!empty($special_offers)) ? true : false; |
|
1576 | + if ($tab == 'special_offers') { |
|
1577 | + $is_display = (!empty($special_offers)) ? true : false; |
|
1578 | + } |
|
1565 | 1579 | |
1566 | - if ($tab == 'reviews') |
|
1567 | - $is_display = (geodir_is_page('detail')) ? true : false; |
|
1580 | + if ($tab == 'reviews') { |
|
1581 | + $is_display = (geodir_is_page('detail')) ? true : false; |
|
1582 | + } |
|
1568 | 1583 | |
1569 | 1584 | if ($tab == 'related_listing') { |
1570 | 1585 | $message = __('No listings found which match your selection.', 'geodirectory'); |
@@ -1840,11 +1855,13 @@ discard block |
||
1840 | 1855 | $region_slug = $default_location->region_slug; |
1841 | 1856 | $city_slug = $default_location->city_slug; |
1842 | 1857 | |
1843 | - if ($country_slug == $slug || $region_slug == $slug || $city_slug == $slug) |
|
1844 | - return $slug_exists = true; |
|
1858 | + if ($country_slug == $slug || $region_slug == $slug || $city_slug == $slug) { |
|
1859 | + return $slug_exists = true; |
|
1860 | + } |
|
1845 | 1861 | |
1846 | - if ($wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s AND term_id != %d", array($slug, $term_id)))) |
|
1847 | - return $slug_exists = true; |
|
1862 | + if ($wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s AND term_id != %d", array($slug, $term_id)))) { |
|
1863 | + return $slug_exists = true; |
|
1864 | + } |
|
1848 | 1865 | |
1849 | 1866 | return $slug_exists; |
1850 | 1867 | } |
@@ -1886,40 +1903,31 @@ discard block |
||
1886 | 1903 | if(geodir_is_page('home')){ |
1887 | 1904 | $gd_page = 'home'; |
1888 | 1905 | $title = (get_option('geodir_meta_title_homepage')) ? get_option('geodir_meta_title_homepage') : $title; |
1889 | - } |
|
1890 | - elseif(geodir_is_page('detail')){ |
|
1906 | + } elseif(geodir_is_page('detail')){ |
|
1891 | 1907 | $gd_page = 'detail'; |
1892 | 1908 | $title = (get_option('geodir_meta_title_detail')) ? get_option('geodir_meta_title_detail') : $title; |
1893 | - } |
|
1894 | - elseif(geodir_is_page('pt')){ |
|
1909 | + } elseif(geodir_is_page('pt')){ |
|
1895 | 1910 | $gd_page = 'pt'; |
1896 | 1911 | $title = (get_option('geodir_meta_title_pt')) ? get_option('geodir_meta_title_pt') : $title; |
1897 | - } |
|
1898 | - elseif(geodir_is_page('listing')){ |
|
1912 | + } elseif(geodir_is_page('listing')){ |
|
1899 | 1913 | $gd_page = 'listing'; |
1900 | 1914 | $title = (get_option('geodir_meta_title_listing')) ? get_option('geodir_meta_title_listing') : $title; |
1901 | - } |
|
1902 | - elseif(geodir_is_page('location')){ |
|
1915 | + } elseif(geodir_is_page('location')){ |
|
1903 | 1916 | $gd_page = 'location'; |
1904 | 1917 | $title = (get_option('geodir_meta_title_location')) ? get_option('geodir_meta_title_location') : $title; |
1905 | - } |
|
1906 | - elseif(geodir_is_page('search')){ |
|
1918 | + } elseif(geodir_is_page('search')){ |
|
1907 | 1919 | $gd_page = 'search'; |
1908 | 1920 | $title = (get_option('geodir_meta_title_search')) ? get_option('geodir_meta_title_search') : $title; |
1909 | - } |
|
1910 | - elseif(geodir_is_page('add-listing')){ |
|
1921 | + } elseif(geodir_is_page('add-listing')){ |
|
1911 | 1922 | $gd_page = 'add-listing'; |
1912 | 1923 | $title = (get_option('geodir_meta_title_add-listing')) ? get_option('geodir_meta_title_add-listing') : $title; |
1913 | - } |
|
1914 | - elseif(geodir_is_page('author')){ |
|
1924 | + } elseif(geodir_is_page('author')){ |
|
1915 | 1925 | $gd_page = 'author'; |
1916 | 1926 | $title = (get_option('geodir_meta_title_author')) ? get_option('geodir_meta_title_author') : $title; |
1917 | - } |
|
1918 | - elseif(geodir_is_page('login')){ |
|
1927 | + } elseif(geodir_is_page('login')){ |
|
1919 | 1928 | $gd_page = 'login'; |
1920 | 1929 | $title = (get_option('geodir_meta_title_login')) ? get_option('geodir_meta_title_login') : $title; |
1921 | - } |
|
1922 | - elseif(geodir_is_page('listing-success')){ |
|
1930 | + } elseif(geodir_is_page('listing-success')){ |
|
1923 | 1931 | $gd_page = 'listing-success'; |
1924 | 1932 | $title = (get_option('geodir_meta_title_listing-success')) ? get_option('geodir_meta_title_listing-success') : $title; |
1925 | 1933 | } |
@@ -1994,11 +2002,13 @@ discard block |
||
1994 | 2002 | |
1995 | 2003 | if (!get_option('geodir_remove_url_seperator')) { |
1996 | 2004 | |
1997 | - if (get_option('geodir_listingurl_separator')) |
|
1998 | - delete_option('geodir_listingurl_separator'); |
|
2005 | + if (get_option('geodir_listingurl_separator')) { |
|
2006 | + delete_option('geodir_listingurl_separator'); |
|
2007 | + } |
|
1999 | 2008 | |
2000 | - if (get_option('geodir_detailurl_separator')) |
|
2001 | - delete_option('geodir_detailurl_separator'); |
|
2009 | + if (get_option('geodir_detailurl_separator')) { |
|
2010 | + delete_option('geodir_detailurl_separator'); |
|
2011 | + } |
|
2002 | 2012 | |
2003 | 2013 | flush_rewrite_rules(false); |
2004 | 2014 | |
@@ -2022,8 +2032,9 @@ discard block |
||
2022 | 2032 | { |
2023 | 2033 | foreach ($permalink_arr as $key => $value) { |
2024 | 2034 | |
2025 | - if ($value['id'] == 'geodir_listingurl_separator' || $value['id'] == 'geodir_detailurl_separator') |
|
2026 | - unset($permalink_arr[$key]); |
|
2035 | + if ($value['id'] == 'geodir_listingurl_separator' || $value['id'] == 'geodir_detailurl_separator') { |
|
2036 | + unset($permalink_arr[$key]); |
|
2037 | + } |
|
2027 | 2038 | |
2028 | 2039 | } |
2029 | 2040 | |
@@ -2156,16 +2167,18 @@ discard block |
||
2156 | 2167 | |
2157 | 2168 | $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 | 2169 | |
2159 | - if (isset($tabs_arr['post_video']['heading_text']) && $field_title != '') |
|
2160 | - $tabs_arr['post_video']['heading_text'] = $field_title; |
|
2170 | + if (isset($tabs_arr['post_video']['heading_text']) && $field_title != '') { |
|
2171 | + $tabs_arr['post_video']['heading_text'] = $field_title; |
|
2172 | + } |
|
2161 | 2173 | } |
2162 | 2174 | |
2163 | 2175 | if (array_key_exists('special_offers', $tabs_arr)) { |
2164 | 2176 | |
2165 | 2177 | $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 | 2178 | |
2167 | - if (isset($tabs_arr['special_offers']['heading_text']) && $field_title != '') |
|
2168 | - $tabs_arr['special_offers']['heading_text'] = $field_title; |
|
2179 | + if (isset($tabs_arr['special_offers']['heading_text']) && $field_title != '') { |
|
2180 | + $tabs_arr['special_offers']['heading_text'] = $field_title; |
|
2181 | + } |
|
2169 | 2182 | } |
2170 | 2183 | |
2171 | 2184 | } |
@@ -2220,8 +2233,9 @@ discard block |
||
2220 | 2233 | |
2221 | 2234 | $all_postypes = geodir_get_posttypes(); |
2222 | 2235 | |
2223 | - if (!in_array($post_type, $all_postypes) || !is_admin()) |
|
2224 | - return false; |
|
2236 | + if (!in_array($post_type, $all_postypes) || !is_admin()) { |
|
2237 | + return false; |
|
2238 | + } |
|
2225 | 2239 | |
2226 | 2240 | $uploads = wp_upload_dir(); |
2227 | 2241 | |
@@ -2295,8 +2309,9 @@ discard block |
||
2295 | 2309 | $file_info = pathinfo($attach->file); |
2296 | 2310 | |
2297 | 2311 | $sub_dir = ''; |
2298 | - if ($file_info['dirname'] != '.' && $file_info['dirname'] != '..') |
|
2299 | - $sub_dir = stripslashes_deep($file_info['dirname']); |
|
2312 | + if ($file_info['dirname'] != '.' && $file_info['dirname'] != '..') { |
|
2313 | + $sub_dir = stripslashes_deep($file_info['dirname']); |
|
2314 | + } |
|
2300 | 2315 | |
2301 | 2316 | $uploads = wp_upload_dir(trim($sub_dir, '/')); // Array of key => value pairs |
2302 | 2317 | $uploads_baseurl = $uploads['baseurl']; |
@@ -2318,8 +2333,9 @@ discard block |
||
2318 | 2333 | |
2319 | 2334 | if (!empty($attachment_data)) { |
2320 | 2335 | |
2321 | - if ($attachment_data->ID) |
|
2322 | - $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID); |
|
2336 | + if ($attachment_data->ID) { |
|
2337 | + $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID); |
|
2338 | + } |
|
2323 | 2339 | |
2324 | 2340 | } else { |
2325 | 2341 | |
@@ -2605,9 +2621,10 @@ discard block |
||
2605 | 2621 | break; |
2606 | 2622 | case 'time': { |
2607 | 2623 | $value = ''; |
2608 | - if ($post->$type['htmlvar_name'] != '') |
|
2609 | - //$value = date('h:i',strtotime($post->$type['htmlvar_name'])); |
|
2610 | - $value = date(get_option('time_format'), strtotime($post->$type['htmlvar_name'])); |
|
2624 | + if ($post->$type['htmlvar_name'] != '') { |
|
2625 | + //$value = date('h:i',strtotime($post->$type['htmlvar_name'])); |
|
2626 | + $value = date(get_option('time_format'), strtotime($post->$type['htmlvar_name'])); |
|
2627 | + } |
|
2611 | 2628 | |
2612 | 2629 | if (strpos($field_icon, 'http') !== false) { |
2613 | 2630 | $field_icon_af = ''; |
@@ -2642,8 +2659,9 @@ discard block |
||
2642 | 2659 | $post_htmlvar_value = $date_format == 'd/m/Y' ? str_replace('/', '-', $post->$type['htmlvar_name']) : $post->$type['htmlvar_name']; // PHP doesn't work well with dd/mm/yyyy format |
2643 | 2660 | |
2644 | 2661 | $value = ''; |
2645 | - if ($post->$type['htmlvar_name'] != '') |
|
2646 | - $value = date($date_format, strtotime($post_htmlvar_value)); |
|
2662 | + if ($post->$type['htmlvar_name'] != '') { |
|
2663 | + $value = date($date_format, strtotime($post_htmlvar_value)); |
|
2664 | + } |
|
2647 | 2665 | |
2648 | 2666 | if (strpos($field_icon, 'http') !== false) { |
2649 | 2667 | $field_icon_af = ''; |
@@ -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 */ |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | //////////////////////// |
178 | 178 | |
179 | 179 | add_action('geodir_update_postrating', 'geodir_term_review_count_force_update', 100); |
180 | -add_action('transition_post_status', 'geodir_term_review_count_force_update', 100,3); |
|
180 | +add_action('transition_post_status', 'geodir_term_review_count_force_update', 100, 3); |
|
181 | 181 | add_action('created_term', 'geodir_term_review_count_force_update', 100); |
182 | 182 | add_action('edited_term', 'geodir_term_review_count_force_update', 100); |
183 | 183 | add_action('delete_term', 'geodir_term_review_count_force_update', 100); |
@@ -319,8 +319,8 @@ discard block |
||
319 | 319 | |
320 | 320 | /////// GEO DIRECOTORY CUSTOM HOOKS /// |
321 | 321 | |
322 | -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 |
|
323 | -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 |
|
322 | +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 |
|
323 | +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 |
|
324 | 324 | |
325 | 325 | // Detail page sidebar content |
326 | 326 | add_action('geodir_detail_page_sidebar', 'geodir_detail_page_sidebar_content_sorting', 1); |
@@ -422,7 +422,7 @@ discard block |
||
422 | 422 | $content_html = ob_get_clean(); |
423 | 423 | if (trim($content_html) != '') |
424 | 424 | $content_html = '<div class="geodir-company_info geodir-details-sidebar-social-sharing">' . $content_html . '</div>'; |
425 | - if ((int)get_option('geodir_disable_tfg_buttons_section') != 1) { |
|
425 | + if ((int) get_option('geodir_disable_tfg_buttons_section') != 1) { |
|
426 | 426 | /** |
427 | 427 | * Filter the geodir_social_sharing_buttons() function content. |
428 | 428 | * |
@@ -469,7 +469,7 @@ discard block |
||
469 | 469 | $content_html = ob_get_clean(); |
470 | 470 | if (trim($content_html) != '') |
471 | 471 | $content_html = '<div class="geodir-company_info geodir-details-sidebar-sharethis">' . $content_html . '</div>'; |
472 | - if ((int)get_option('geodir_disable_sharethis_button_section') != 1) { |
|
472 | + if ((int) get_option('geodir_disable_sharethis_button_section') != 1) { |
|
473 | 473 | /** |
474 | 474 | * Filter the geodir_share_this_button() function content. |
475 | 475 | * |
@@ -508,7 +508,7 @@ discard block |
||
508 | 508 | $post_id = $post->ID; |
509 | 509 | |
510 | 510 | if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') { |
511 | - $post_id = (int)$_REQUEST['pid']; |
|
511 | + $post_id = (int) $_REQUEST['pid']; |
|
512 | 512 | } |
513 | 513 | |
514 | 514 | $postlink = get_permalink(geodir_add_listing_page_id()); |
@@ -525,7 +525,7 @@ discard block |
||
525 | 525 | $content_html = ob_get_clean(); |
526 | 526 | if (trim($content_html) != '') |
527 | 527 | $content_html = '<div class="geodir-company_info geodir-details-sidebar-user-links">' . $content_html . '</div>'; |
528 | - if ((int)get_option('geodir_disable_user_links_section') != 1) { |
|
528 | + if ((int) get_option('geodir_disable_user_links_section') != 1) { |
|
529 | 529 | /** |
530 | 530 | * Filter the geodir_edit_post_link() function content. |
531 | 531 | * |
@@ -564,7 +564,7 @@ discard block |
||
564 | 564 | */ |
565 | 565 | do_action('geodir_before_google_analytics'); |
566 | 566 | |
567 | - 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' )) ) { |
|
567 | + 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'))) { |
|
568 | 568 | $page_url = urlencode($_SERVER['REQUEST_URI']); |
569 | 569 | ?> |
570 | 570 | <script type="text/javascript"> |
@@ -588,34 +588,34 @@ discard block |
||
588 | 588 | }); |
589 | 589 | |
590 | 590 | function gdga_weekVSweek() { |
591 | - jQuery.ajax({url: "<?php echo get_bloginfo('url').'/?ptype=ga&ga_page='.$page_url; ?>&ga_type=thisweek", success: function(result){ |
|
591 | + jQuery.ajax({url: "<?php echo get_bloginfo('url') . '/?ptype=ga&ga_page=' . $page_url; ?>&ga_type=thisweek", success: function(result){ |
|
592 | 592 | ga_data1 = jQuery.parseJSON(result); |
593 | 593 | if(ga_data1.error){jQuery('#ga_stats').html(result);return;} |
594 | 594 | gd_renderWeekOverWeekChart(); |
595 | 595 | }}); |
596 | 596 | |
597 | - jQuery.ajax({url: "<?php echo get_bloginfo('url').'/?ptype=ga&ga_page='.$page_url; ?>&ga_type=lastweek", success: function(result){ |
|
597 | + jQuery.ajax({url: "<?php echo get_bloginfo('url') . '/?ptype=ga&ga_page=' . $page_url; ?>&ga_type=lastweek", success: function(result){ |
|
598 | 598 | ga_data2 = jQuery.parseJSON(result); |
599 | 599 | gd_renderWeekOverWeekChart(); |
600 | 600 | }}); |
601 | 601 | } |
602 | 602 | |
603 | 603 | function gdga_yearVSyear() { |
604 | - jQuery.ajax({url: "<?php echo get_bloginfo('url').'/?ptype=ga&ga_page='.$page_url; ?>&ga_type=thisyear", success: function(result){ |
|
604 | + jQuery.ajax({url: "<?php echo get_bloginfo('url') . '/?ptype=ga&ga_page=' . $page_url; ?>&ga_type=thisyear", success: function(result){ |
|
605 | 605 | ga_data3 = jQuery.parseJSON(result); |
606 | 606 | if(ga_data3.error){jQuery('#ga_stats').html(result);return;} |
607 | 607 | |
608 | 608 | gd_renderYearOverYearChart() |
609 | 609 | }}); |
610 | 610 | |
611 | - jQuery.ajax({url: "<?php echo get_bloginfo('url').'/?ptype=ga&ga_page='.$page_url; ?>&ga_type=lastyear", success: function(result){ |
|
611 | + jQuery.ajax({url: "<?php echo get_bloginfo('url') . '/?ptype=ga&ga_page=' . $page_url; ?>&ga_type=lastyear", success: function(result){ |
|
612 | 612 | ga_data4 = jQuery.parseJSON(result); |
613 | 613 | gd_renderYearOverYearChart() |
614 | 614 | }}); |
615 | 615 | } |
616 | 616 | |
617 | 617 | function gdga_country() { |
618 | - jQuery.ajax({url: "<?php echo get_bloginfo('url').'/?ptype=ga&ga_page='.$page_url; ?>&ga_type=country", success: function(result){ |
|
618 | + jQuery.ajax({url: "<?php echo get_bloginfo('url') . '/?ptype=ga&ga_page=' . $page_url; ?>&ga_type=country", success: function(result){ |
|
619 | 619 | ga_data5 = jQuery.parseJSON(result); |
620 | 620 | if(ga_data5.error){jQuery('#ga_stats').html(result);return;} |
621 | 621 | gd_renderTopCountriesChart(); |
@@ -623,7 +623,7 @@ discard block |
||
623 | 623 | } |
624 | 624 | |
625 | 625 | function gdga_realtime() { |
626 | - jQuery.ajax({url: "<?php echo get_bloginfo('url').'/?ptype=ga&ga_page='.$page_url; ?>&ga_type=realtime", success: function(result){ |
|
626 | + jQuery.ajax({url: "<?php echo get_bloginfo('url') . '/?ptype=ga&ga_page=' . $page_url; ?>&ga_type=realtime", success: function(result){ |
|
627 | 627 | ga_data6 = jQuery.parseJSON(result); |
628 | 628 | if(ga_data6.error){jQuery('#ga_stats').html(result);return;} |
629 | 629 | gd_renderRealTime(); |
@@ -689,7 +689,7 @@ discard block |
||
689 | 689 | } |
690 | 690 | |
691 | 691 | function gdga_noResults() { |
692 | - jQuery('#gdga-chart-container').html('<?php _e('No results available','geodirectory');?>'); |
|
692 | + jQuery('#gdga-chart-container').html('<?php _e('No results available', 'geodirectory'); ?>'); |
|
693 | 693 | jQuery('#gdga-legend-container').html(''); |
694 | 694 | } |
695 | 695 | |
@@ -721,18 +721,18 @@ discard block |
||
721 | 721 | var data2 = results[1].rows.map(function(row) { return +row[2]; }); |
722 | 722 | //var labelsN = results[0].rows.map(function(row) { return +row[1]; }); |
723 | 723 | |
724 | - var labels = ['<?php _e('Jan', 'geodirectory');?>', |
|
725 | - '<?php _e('Feb', 'geodirectory');?>', |
|
726 | - '<?php _e('Mar', 'geodirectory');?>', |
|
727 | - '<?php _e('Apr', 'geodirectory');?>', |
|
728 | - '<?php _e('May', 'geodirectory');?>', |
|
729 | - '<?php _e('Jun', 'geodirectory');?>', |
|
730 | - '<?php _e('Jul', 'geodirectory');?>', |
|
731 | - '<?php _e('Aug', 'geodirectory');?>', |
|
732 | - '<?php _e('Sep', 'geodirectory');?>', |
|
733 | - '<?php _e('Oct', 'geodirectory');?>', |
|
734 | - '<?php _e('Nov', 'geodirectory');?>', |
|
735 | - '<?php _e('Dec', 'geodirectory');?>']; |
|
724 | + var labels = ['<?php _e('Jan', 'geodirectory'); ?>', |
|
725 | + '<?php _e('Feb', 'geodirectory'); ?>', |
|
726 | + '<?php _e('Mar', 'geodirectory'); ?>', |
|
727 | + '<?php _e('Apr', 'geodirectory'); ?>', |
|
728 | + '<?php _e('May', 'geodirectory'); ?>', |
|
729 | + '<?php _e('Jun', 'geodirectory'); ?>', |
|
730 | + '<?php _e('Jul', 'geodirectory'); ?>', |
|
731 | + '<?php _e('Aug', 'geodirectory'); ?>', |
|
732 | + '<?php _e('Sep', 'geodirectory'); ?>', |
|
733 | + '<?php _e('Oct', 'geodirectory'); ?>', |
|
734 | + '<?php _e('Nov', 'geodirectory'); ?>', |
|
735 | + '<?php _e('Dec', 'geodirectory'); ?>']; |
|
736 | 736 | |
737 | 737 | // Ensure the data arrays are at least as long as the labels array. |
738 | 738 | // Chart.js bar charts don't (yet) accept sparse datasets. |
@@ -745,13 +745,13 @@ discard block |
||
745 | 745 | labels : labels, |
746 | 746 | datasets : [ |
747 | 747 | { |
748 | - label: '<?php _e('Last Year', 'geodirectory');?>', |
|
748 | + label: '<?php _e('Last Year', 'geodirectory'); ?>', |
|
749 | 749 | fillColor : "rgba(220,220,220,0.5)", |
750 | 750 | strokeColor : "rgba(220,220,220,1)", |
751 | 751 | data : data2 |
752 | 752 | }, |
753 | 753 | { |
754 | - label: '<?php _e('This Year', 'geodirectory');?>', |
|
754 | + label: '<?php _e('This Year', 'geodirectory'); ?>', |
|
755 | 755 | fillColor : "rgba(151,187,205,0.5)", |
756 | 756 | strokeColor : "rgba(151,187,205,1)", |
757 | 757 | data : data1 |
@@ -796,30 +796,30 @@ discard block |
||
796 | 796 | |
797 | 797 | <?php |
798 | 798 | // Here we list the shorthand days of the week so it can be used in translation. |
799 | - __("Mon",'geodirectory'); |
|
800 | - __("Tue",'geodirectory'); |
|
801 | - __("Wed",'geodirectory'); |
|
802 | - __("Thu",'geodirectory'); |
|
803 | - __("Fri",'geodirectory'); |
|
804 | - __("Sat",'geodirectory'); |
|
805 | - __("Sun",'geodirectory'); |
|
799 | + __("Mon", 'geodirectory'); |
|
800 | + __("Tue", 'geodirectory'); |
|
801 | + __("Wed", 'geodirectory'); |
|
802 | + __("Thu", 'geodirectory'); |
|
803 | + __("Fri", 'geodirectory'); |
|
804 | + __("Sat", 'geodirectory'); |
|
805 | + __("Sun", 'geodirectory'); |
|
806 | 806 | ?> |
807 | 807 | |
808 | 808 | labels = [ |
809 | - "<?php _e(date('D', strtotime("+1 day")),'geodirectory'); ?>", |
|
810 | - "<?php _e(date('D', strtotime("+2 day")),'geodirectory'); ?>", |
|
811 | - "<?php _e(date('D', strtotime("+3 day")),'geodirectory'); ?>", |
|
812 | - "<?php _e(date('D', strtotime("+4 day")),'geodirectory'); ?>", |
|
813 | - "<?php _e(date('D', strtotime("+5 day")),'geodirectory'); ?>", |
|
814 | - "<?php _e(date('D', strtotime("+6 day")),'geodirectory'); ?>", |
|
815 | - "<?php _e(date('D', strtotime("+7 day")),'geodirectory'); ?>" |
|
809 | + "<?php _e(date('D', strtotime("+1 day")), 'geodirectory'); ?>", |
|
810 | + "<?php _e(date('D', strtotime("+2 day")), 'geodirectory'); ?>", |
|
811 | + "<?php _e(date('D', strtotime("+3 day")), 'geodirectory'); ?>", |
|
812 | + "<?php _e(date('D', strtotime("+4 day")), 'geodirectory'); ?>", |
|
813 | + "<?php _e(date('D', strtotime("+5 day")), 'geodirectory'); ?>", |
|
814 | + "<?php _e(date('D', strtotime("+6 day")), 'geodirectory'); ?>", |
|
815 | + "<?php _e(date('D', strtotime("+7 day")), 'geodirectory'); ?>" |
|
816 | 816 | ]; |
817 | 817 | |
818 | 818 | var data = { |
819 | 819 | labels : labels, |
820 | 820 | datasets : [ |
821 | 821 | { |
822 | - label: '<?php _e('Last Week', 'geodirectory');?>', |
|
822 | + label: '<?php _e('Last Week', 'geodirectory'); ?>', |
|
823 | 823 | fillColor : "rgba(220,220,220,0.5)", |
824 | 824 | strokeColor : "rgba(220,220,220,1)", |
825 | 825 | pointColor : "rgba(220,220,220,1)", |
@@ -827,7 +827,7 @@ discard block |
||
827 | 827 | data : data2 |
828 | 828 | }, |
829 | 829 | { |
830 | - label: '<?php _e('This Week', 'geodirectory');?>', |
|
830 | + label: '<?php _e('This Week', 'geodirectory'); ?>', |
|
831 | 831 | fillColor : "rgba(151,187,205,0.5)", |
832 | 832 | strokeColor : "rgba(151,187,205,1)", |
833 | 833 | pointColor : "rgba(151,187,205,1)", |
@@ -1009,18 +1009,18 @@ discard block |
||
1009 | 1009 | |
1010 | 1010 | |
1011 | 1011 | <span id="ga_stats"> |
1012 | - <div id="ga-analytics-title"><?php _e("Analytics", 'geodirectory');?></div> |
|
1012 | + <div id="ga-analytics-title"><?php _e("Analytics", 'geodirectory'); ?></div> |
|
1013 | 1013 | |
1014 | 1014 | <div id="gd-active-users-container"> |
1015 | - <div class="gd-ActiveUsers"><?php _e("Active Users:", 'geodirectory');?> |
|
1015 | + <div class="gd-ActiveUsers"><?php _e("Active Users:", 'geodirectory'); ?> |
|
1016 | 1016 | <b class="gd-ActiveUsers-value">0</b> |
1017 | 1017 | </div> |
1018 | 1018 | </div> |
1019 | 1019 | |
1020 | 1020 | <select id="gdga-select-analytic" onchange="gdga_select_option();" style="display: none;"> |
1021 | - <option value="weeks"><?php _e("Last Week vs This Week", 'geodirectory');?></option> |
|
1022 | - <option value="years"><?php _e("This Year vs Last Year", 'geodirectory');?></option> |
|
1023 | - <option value="country"><?php _e("Top Countries", 'geodirectory');?></option> |
|
1021 | + <option value="weeks"><?php _e("Last Week vs This Week", 'geodirectory'); ?></option> |
|
1022 | + <option value="years"><?php _e("This Year vs Last Year", 'geodirectory'); ?></option> |
|
1023 | + <option value="country"><?php _e("Top Countries", 'geodirectory'); ?></option> |
|
1024 | 1024 | </select> |
1025 | 1025 | <img alt="loader icon" id="gdga-loader-icon" src="<?php echo geodir_plugin_url() . '/geodirectory-assets/images/ajax-loader.gif'; ?>" /> |
1026 | 1026 | <div class="Chartjs-figure" id="gdga-chart-container"></div> |
@@ -1038,7 +1038,7 @@ discard block |
||
1038 | 1038 | $content_html = ob_get_clean(); |
1039 | 1039 | if (trim($content_html) != '') |
1040 | 1040 | $content_html = '<div class="geodir-company_info geodir-details-sidebar-google-analytics">' . $content_html . '</div>'; |
1041 | - if ((int)get_option('geodir_disable_google_analytics_section') != 1) { |
|
1041 | + if ((int) get_option('geodir_disable_google_analytics_section') != 1) { |
|
1042 | 1042 | /** |
1043 | 1043 | * Filter the geodir_edit_post_link() function content. |
1044 | 1044 | * |
@@ -1134,7 +1134,7 @@ discard block |
||
1134 | 1134 | if (trim($content_html) != '') { |
1135 | 1135 | $content_html = '<div class="geodir-company_info geodir-details-sidebar-rating">' . $content_html . '</div>'; |
1136 | 1136 | } |
1137 | - if ((int)get_option('geodir_disable_rating_info_section') != 1) { |
|
1137 | + if ((int) get_option('geodir_disable_rating_info_section') != 1) { |
|
1138 | 1138 | /** |
1139 | 1139 | * Filter the geodir_detail_page_review_rating() function content. |
1140 | 1140 | * |
@@ -1174,7 +1174,7 @@ discard block |
||
1174 | 1174 | $content_html = ob_get_clean(); |
1175 | 1175 | if (trim($content_html) != '') |
1176 | 1176 | $content_html = '<div class="geodir-company_info geodir-details-sidebar-listing-info">' . $content_html . '</div>'; |
1177 | - if ((int)get_option('geodir_disable_listing_info_section') != 1) { |
|
1177 | + if ((int) get_option('geodir_disable_listing_info_section') != 1) { |
|
1178 | 1178 | /** |
1179 | 1179 | * Filter the output html for function geodir_detail_page_more_info(). |
1180 | 1180 | * |
@@ -1265,7 +1265,7 @@ discard block |
||
1265 | 1265 | 'gd_allowed_img_types' => !empty($allowed_img_types) ? implode(',', $allowed_img_types) : '', |
1266 | 1266 | 'geodir_txt_form_wait' => __('Wait...', 'geodirectory'), |
1267 | 1267 | 'geodir_txt_form_searching' => __('Searching...', 'geodirectory'), |
1268 | - 'fa_rating' => (int)get_option('geodir_reviewrating_enable_font_awesome') == 1 ? 1 : '', |
|
1268 | + 'fa_rating' => (int) get_option('geodir_reviewrating_enable_font_awesome') == 1 ? 1 : '', |
|
1269 | 1269 | 'reviewrating' => defined('GEODIRREVIEWRATING_VERSION') ? 1 : '', |
1270 | 1270 | ); |
1271 | 1271 | |
@@ -1282,7 +1282,7 @@ discard block |
||
1282 | 1282 | foreach ($arr_alert_msg as $key => $value) { |
1283 | 1283 | if (!is_scalar($value)) |
1284 | 1284 | continue; |
1285 | - $arr_alert_msg[$key] = html_entity_decode((string)$value, ENT_QUOTES, 'UTF-8'); |
|
1285 | + $arr_alert_msg[$key] = html_entity_decode((string) $value, ENT_QUOTES, 'UTF-8'); |
|
1286 | 1286 | } |
1287 | 1287 | |
1288 | 1288 | $script = "var geodir_all_js_msg = " . json_encode($arr_alert_msg) . ';'; |
@@ -1458,7 +1458,7 @@ discard block |
||
1458 | 1458 | global $post; |
1459 | 1459 | $term_condition = ''; |
1460 | 1460 | if (isset($_REQUEST['backandedit'])) { |
1461 | - $post = (object)$gd_session->get('listing'); |
|
1461 | + $post = (object) $gd_session->get('listing'); |
|
1462 | 1462 | $term_condition = isset($post->geodir_accept_term_condition) ? $post->geodir_accept_term_condition : ''; |
1463 | 1463 | } |
1464 | 1464 | |
@@ -1472,7 +1472,7 @@ discard block |
||
1472 | 1472 | echo 'checked="checked"'; |
1473 | 1473 | } ?> field_type="checkbox" name="geodir_accept_term_condition" id="geodir_accept_term_condition" |
1474 | 1474 | class="geodir_textfield" value="1" |
1475 | - 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> |
|
1475 | + 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> |
|
1476 | 1476 | </span> |
1477 | 1477 | </div> |
1478 | 1478 | <span class="geodir_message_error"><?php if (isset($required_msg)) { |
@@ -1512,7 +1512,7 @@ discard block |
||
1512 | 1512 | /** This action is documented in geodirectory_template_actions.php */ |
1513 | 1513 | $desc_limit = apply_filters('geodir_description_field_desc_limit', ''); |
1514 | 1514 | |
1515 | - if (!($desc_limit === '' || (int)$desc_limit > 0)) { |
|
1515 | + if (!($desc_limit === '' || (int) $desc_limit > 0)) { |
|
1516 | 1516 | $is_display = false; |
1517 | 1517 | } |
1518 | 1518 | } |
@@ -1586,7 +1586,7 @@ discard block |
||
1586 | 1586 | global $wpdb, $plugin_prefix; |
1587 | 1587 | |
1588 | 1588 | // Remove unused virtual page |
1589 | - $listings_page_id = (int)get_option('geodir_listing_page'); |
|
1589 | + $listings_page_id = (int) get_option('geodir_listing_page'); |
|
1590 | 1590 | if ($listings_page_id) { |
1591 | 1591 | $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'))); |
1592 | 1592 | delete_option('geodir_listing_page'); |
@@ -1848,43 +1848,43 @@ discard block |
||
1848 | 1848 | |
1849 | 1849 | |
1850 | 1850 | $gd_page = ''; |
1851 | - if(geodir_is_page('home')){ |
|
1851 | + if (geodir_is_page('home')) { |
|
1852 | 1852 | $gd_page = 'home'; |
1853 | 1853 | $title = (get_option('geodir_meta_title_homepage')) ? get_option('geodir_meta_title_homepage') : $title; |
1854 | 1854 | } |
1855 | - elseif(geodir_is_page('detail')){ |
|
1855 | + elseif (geodir_is_page('detail')) { |
|
1856 | 1856 | $gd_page = 'detail'; |
1857 | 1857 | $title = (get_option('geodir_meta_title_detail')) ? get_option('geodir_meta_title_detail') : $title; |
1858 | 1858 | } |
1859 | - elseif(geodir_is_page('pt')){ |
|
1859 | + elseif (geodir_is_page('pt')) { |
|
1860 | 1860 | $gd_page = 'pt'; |
1861 | 1861 | $title = (get_option('geodir_meta_title_pt')) ? get_option('geodir_meta_title_pt') : $title; |
1862 | 1862 | } |
1863 | - elseif(geodir_is_page('listing')){ |
|
1863 | + elseif (geodir_is_page('listing')) { |
|
1864 | 1864 | $gd_page = 'listing'; |
1865 | 1865 | $title = (get_option('geodir_meta_title_listing')) ? get_option('geodir_meta_title_listing') : $title; |
1866 | 1866 | } |
1867 | - elseif(geodir_is_page('location')){ |
|
1867 | + elseif (geodir_is_page('location')) { |
|
1868 | 1868 | $gd_page = 'location'; |
1869 | 1869 | $title = (get_option('geodir_meta_title_location')) ? get_option('geodir_meta_title_location') : $title; |
1870 | 1870 | } |
1871 | - elseif(geodir_is_page('search')){ |
|
1871 | + elseif (geodir_is_page('search')) { |
|
1872 | 1872 | $gd_page = 'search'; |
1873 | 1873 | $title = (get_option('geodir_meta_title_search')) ? get_option('geodir_meta_title_search') : $title; |
1874 | 1874 | } |
1875 | - elseif(geodir_is_page('add-listing')){ |
|
1875 | + elseif (geodir_is_page('add-listing')) { |
|
1876 | 1876 | $gd_page = 'add-listing'; |
1877 | 1877 | $title = (get_option('geodir_meta_title_add-listing')) ? get_option('geodir_meta_title_add-listing') : $title; |
1878 | 1878 | } |
1879 | - elseif(geodir_is_page('author')){ |
|
1879 | + elseif (geodir_is_page('author')) { |
|
1880 | 1880 | $gd_page = 'author'; |
1881 | 1881 | $title = (get_option('geodir_meta_title_author')) ? get_option('geodir_meta_title_author') : $title; |
1882 | 1882 | } |
1883 | - elseif(geodir_is_page('login')){ |
|
1883 | + elseif (geodir_is_page('login')) { |
|
1884 | 1884 | $gd_page = 'login'; |
1885 | 1885 | $title = (get_option('geodir_meta_title_login')) ? get_option('geodir_meta_title_login') : $title; |
1886 | 1886 | } |
1887 | - elseif(geodir_is_page('listing-success')){ |
|
1887 | + elseif (geodir_is_page('listing-success')) { |
|
1888 | 1888 | $gd_page = 'listing-success'; |
1889 | 1889 | $title = (get_option('geodir_meta_title_listing-success')) ? get_option('geodir_meta_title_listing-success') : $title; |
1890 | 1890 | } |
@@ -2148,7 +2148,7 @@ discard block |
||
2148 | 2148 | */ |
2149 | 2149 | function geodir_remove_template_redirect_actions() |
2150 | 2150 | { |
2151 | - if (geodir_is_page('login')){ |
|
2151 | + if (geodir_is_page('login')) { |
|
2152 | 2152 | remove_all_actions('template_redirect'); |
2153 | 2153 | remove_action('init', 'avia_modify_front', 10); |
2154 | 2154 | } |
@@ -2595,8 +2595,8 @@ discard block |
||
2595 | 2595 | $date_format = $date_format['date_format']; |
2596 | 2596 | } |
2597 | 2597 | |
2598 | - $search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format |
|
2599 | - $replace = array('d','j','l','m','n','F','Y');//PHP date format |
|
2598 | + $search = array('dd', 'd', 'DD', 'mm', 'm', 'MM', 'yy'); //jQuery UI datepicker format |
|
2599 | + $replace = array('d', 'j', 'l', 'm', 'n', 'F', 'Y'); //PHP date format |
|
2600 | 2600 | |
2601 | 2601 | $date_format = str_replace($search, $replace, $date_format); |
2602 | 2602 | |
@@ -2691,7 +2691,7 @@ discard block |
||
2691 | 2691 | $html_var = $type['htmlvar_name']; |
2692 | 2692 | $html_val = $type['htmlvar_name']; |
2693 | 2693 | |
2694 | - if ((int)$post->$html_var == 1) { |
|
2694 | + if ((int) $post->$html_var == 1) { |
|
2695 | 2695 | |
2696 | 2696 | if ($post->$type['htmlvar_name'] == '1') { |
2697 | 2697 | $html_val = __('Yes', 'geodirectory'); |
@@ -2867,7 +2867,7 @@ discard block |
||
2867 | 2867 | |
2868 | 2868 | if (!empty($files)) { |
2869 | 2869 | $extra_fields = !empty($type['extra_fields']) ? maybe_unserialize($type['extra_fields']) : NULL; |
2870 | - $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'] : ''; |
|
2870 | + $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'] : ''; |
|
2871 | 2871 | |
2872 | 2872 | $file_paths = ''; |
2873 | 2873 | foreach ($files as $file) { |
@@ -2895,7 +2895,7 @@ discard block |
||
2895 | 2895 | // If the uploaded file is image |
2896 | 2896 | if (in_array($uploaded_file_type, $image_file_types)) { |
2897 | 2897 | $file_paths .= '<div class="geodir-custom-post-gallery" class="clearfix">'; |
2898 | - $file_paths .= '<a href="'.$file.'">'; |
|
2898 | + $file_paths .= '<a href="' . $file . '">'; |
|
2899 | 2899 | $file_paths .= geodir_show_image(array('src' => $file), 'thumbnail', false, false); |
2900 | 2900 | $file_paths .= '</a>'; |
2901 | 2901 | $file_paths .= '</div>'; |
@@ -3245,7 +3245,7 @@ discard block |
||
3245 | 3245 | * @return array Translation texts. |
3246 | 3246 | */ |
3247 | 3247 | function geodir_load_gd_options_text_translation($translation_texts = array()) { |
3248 | - $translation_texts = !empty( $translation_texts ) && is_array( $translation_texts ) ? $translation_texts : array(); |
|
3248 | + $translation_texts = !empty($translation_texts) && is_array($translation_texts) ? $translation_texts : array(); |
|
3249 | 3249 | |
3250 | 3250 | $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'); |
3251 | 3251 |
@@ -1,12 +1,12 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Hook and filter actions used by the plugin |
|
4 | - * |
|
5 | - * @since 1.0.0 |
|
6 | - * @package GeoDirectory |
|
7 | - * @global array $geodir_addon_list List of active GeoDirectory extensions. |
|
8 | - * @global string $plugin_file_name Plugin main file name. 'geodirectory/geodirectory.php'. |
|
9 | - */ |
|
3 | + * Hook and filter actions used by the plugin |
|
4 | + * |
|
5 | + * @since 1.0.0 |
|
6 | + * @package GeoDirectory |
|
7 | + * @global array $geodir_addon_list List of active GeoDirectory extensions. |
|
8 | + * @global string $plugin_file_name Plugin main file name. 'geodirectory/geodirectory.php'. |
|
9 | + */ |
|
10 | 10 | |
11 | 11 | /** |
12 | 12 | * Return the GeoDirectory ajax specific url. |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | */ |
20 | 20 | function geodir_get_ajax_url() |
21 | 21 | { |
22 | - return admin_url('admin-ajax.php?action=geodir_ajax_action'); |
|
22 | + return admin_url('admin-ajax.php?action=geodir_ajax_action'); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | ///////////////////// |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | add_filter('query_vars', 'geodir_add_geodir_page_var'); |
88 | 88 | add_action('wp', 'geodir_add_page_id_in_query_var'); // problem fix in wordpress 3.8 |
89 | 89 | if (get_option('permalink_structure') != '') |
90 | - add_filter('parse_request', 'geodir_set_location_var_in_session_in_core'); |
|
90 | + add_filter('parse_request', 'geodir_set_location_var_in_session_in_core'); |
|
91 | 91 | |
92 | 92 | add_filter('parse_query', 'geodir_modified_query'); |
93 | 93 | |
@@ -154,14 +154,14 @@ discard block |
||
154 | 154 | /* POST AND LOOP ACTIONS */ |
155 | 155 | //////////////////////// |
156 | 156 | if (!is_admin()) { |
157 | - add_action('pre_get_posts', 'geodir_exclude_page', 100); /// Will help to exclude virtural page from everywhere |
|
158 | - add_filter('wp_list_pages_excludes', 'exclude_from_wp_list_pages', 100); |
|
159 | - /** Exclude Virtual Pages From Pages List **/ |
|
160 | - add_action('pre_get_posts', 'set_listing_request', 0); |
|
161 | - add_action('pre_get_posts', 'geodir_listing_loop_filter', 1); |
|
162 | - add_filter('excerpt_more', 'geodir_excerpt_more', 1000); |
|
163 | - add_filter('excerpt_length', 'geodir_excerpt_length', 1000); |
|
164 | - add_action('the_post', 'create_marker_jason_of_posts'); // Add marker in json array, Map related filter |
|
157 | + add_action('pre_get_posts', 'geodir_exclude_page', 100); /// Will help to exclude virtural page from everywhere |
|
158 | + add_filter('wp_list_pages_excludes', 'exclude_from_wp_list_pages', 100); |
|
159 | + /** Exclude Virtual Pages From Pages List **/ |
|
160 | + add_action('pre_get_posts', 'set_listing_request', 0); |
|
161 | + add_action('pre_get_posts', 'geodir_listing_loop_filter', 1); |
|
162 | + add_filter('excerpt_more', 'geodir_excerpt_more', 1000); |
|
163 | + add_filter('excerpt_length', 'geodir_excerpt_length', 1000); |
|
164 | + add_action('the_post', 'create_marker_jason_of_posts'); // Add marker in json array, Map related filter |
|
165 | 165 | } |
166 | 166 | |
167 | 167 | |
@@ -221,12 +221,12 @@ discard block |
||
221 | 221 | */ |
222 | 222 | function geodir_unset_prev_theme_nav_location($newname) |
223 | 223 | { |
224 | - $geodir_theme_location = get_option('geodir_theme_location_nav_' . $newname); |
|
225 | - if ($geodir_theme_location) { |
|
226 | - update_option('geodir_theme_location_nav', $geodir_theme_location); |
|
227 | - } else { |
|
228 | - update_option('geodir_theme_location_nav', ''); |
|
229 | - } |
|
224 | + $geodir_theme_location = get_option('geodir_theme_location_nav_' . $newname); |
|
225 | + if ($geodir_theme_location) { |
|
226 | + update_option('geodir_theme_location_nav', $geodir_theme_location); |
|
227 | + } else { |
|
228 | + update_option('geodir_theme_location_nav', ''); |
|
229 | + } |
|
230 | 230 | } |
231 | 231 | |
232 | 232 | /// add action for theme switch to blank previous theme navigation location setting |
@@ -247,32 +247,32 @@ discard block |
||
247 | 247 | */ |
248 | 248 | function geodir_add_post_filters() |
249 | 249 | { |
250 | - /** |
|
251 | - * Contains all function for filtering listing. |
|
252 | - * |
|
253 | - * @since 1.0.0 |
|
254 | - * @package GeoDirectory |
|
255 | - */ |
|
256 | - include_once('geodirectory-functions/listing_filters.php'); |
|
250 | + /** |
|
251 | + * Contains all function for filtering listing. |
|
252 | + * |
|
253 | + * @since 1.0.0 |
|
254 | + * @package GeoDirectory |
|
255 | + */ |
|
256 | + include_once('geodirectory-functions/listing_filters.php'); |
|
257 | 257 | } |
258 | 258 | |
259 | 259 | |
260 | 260 | if (!function_exists('geodir_init_defaults')) { |
261 | - /** |
|
262 | - * Calls the function to register the GeoDirectory default CPT and taxonomies. |
|
263 | - * |
|
264 | - * @since 1.0.0 |
|
265 | - * @package GeoDirectory |
|
266 | - */ |
|
267 | - function geodir_init_defaults() |
|
268 | - { |
|
269 | - if (function_exists('geodir_register_defaults')) { |
|
261 | + /** |
|
262 | + * Calls the function to register the GeoDirectory default CPT and taxonomies. |
|
263 | + * |
|
264 | + * @since 1.0.0 |
|
265 | + * @package GeoDirectory |
|
266 | + */ |
|
267 | + function geodir_init_defaults() |
|
268 | + { |
|
269 | + if (function_exists('geodir_register_defaults')) { |
|
270 | 270 | |
271 | - geodir_register_defaults(); |
|
271 | + geodir_register_defaults(); |
|
272 | 272 | |
273 | - } |
|
273 | + } |
|
274 | 274 | |
275 | - } |
|
275 | + } |
|
276 | 276 | } |
277 | 277 | |
278 | 278 | |
@@ -294,26 +294,26 @@ discard block |
||
294 | 294 | // CALLED ON 'sidebars_widgets' FILTER |
295 | 295 | |
296 | 296 | if (!function_exists('geodir_restrict_widget')) { |
297 | - /** |
|
298 | - * Sets global values to be able to tell if the current page is a GeoDirectory listing page or a GeoDirectory details page. |
|
299 | - * |
|
300 | - * @global bool $is_listing Sets the global value to true if on a GD category page. False if not. |
|
301 | - * @global bool $is_single_place Sets the global value to true if on a GD details (post) page. False if not. |
|
302 | - * @since 1.0.0 |
|
303 | - * @package GeoDirectory |
|
304 | - */ |
|
305 | - function geodir_restrict_widget() |
|
306 | - { |
|
307 | - global $is_listing, $is_single_place; |
|
297 | + /** |
|
298 | + * Sets global values to be able to tell if the current page is a GeoDirectory listing page or a GeoDirectory details page. |
|
299 | + * |
|
300 | + * @global bool $is_listing Sets the global value to true if on a GD category page. False if not. |
|
301 | + * @global bool $is_single_place Sets the global value to true if on a GD details (post) page. False if not. |
|
302 | + * @since 1.0.0 |
|
303 | + * @package GeoDirectory |
|
304 | + */ |
|
305 | + function geodir_restrict_widget() |
|
306 | + { |
|
307 | + global $is_listing, $is_single_place; |
|
308 | 308 | |
309 | - // set is listing |
|
310 | - (geodir_is_page('listing')) ? $is_listing = true : $is_listing = false; |
|
309 | + // set is listing |
|
310 | + (geodir_is_page('listing')) ? $is_listing = true : $is_listing = false; |
|
311 | 311 | |
312 | - // set is single place |
|
313 | - (geodir_is_page('place')) ? $is_single_place = true : $is_single_place = false; |
|
312 | + // set is single place |
|
313 | + (geodir_is_page('place')) ? $is_single_place = true : $is_single_place = false; |
|
314 | 314 | |
315 | 315 | |
316 | - } |
|
316 | + } |
|
317 | 317 | } |
318 | 318 | |
319 | 319 | |
@@ -334,32 +334,32 @@ discard block |
||
334 | 334 | */ |
335 | 335 | function geodir_detail_page_sidebar_content_sorting() |
336 | 336 | { |
337 | - $arr_detail_page_sidebar_content = |
|
338 | - /** |
|
339 | - * An array of functions to be called to be displayed on the details (post) page sidebar. |
|
340 | - * |
|
341 | - * This filter can be used to remove sections of the details page sidebar, |
|
342 | - * add new sections or rearrange the order of the sections. |
|
343 | - * |
|
344 | - * @param array array('geodir_social_sharing_buttons','geodir_share_this_button','geodir_detail_page_google_analytics','geodir_edit_post_link','geodir_detail_page_review_rating','geodir_detail_page_more_info') The array of functions that will be called. |
|
345 | - * @since 1.0.0 |
|
346 | - */ |
|
347 | - apply_filters('geodir_detail_page_sidebar_content', |
|
348 | - array('geodir_social_sharing_buttons', |
|
349 | - 'geodir_share_this_button', |
|
350 | - 'geodir_detail_page_google_analytics', |
|
351 | - 'geodir_edit_post_link', |
|
352 | - 'geodir_detail_page_review_rating', |
|
353 | - 'geodir_detail_page_more_info' |
|
354 | - ) // end of array |
|
355 | - ); // end of apply filter |
|
356 | - if (!empty($arr_detail_page_sidebar_content)) { |
|
357 | - foreach ($arr_detail_page_sidebar_content as $content_function) { |
|
358 | - if (function_exists($content_function)) { |
|
359 | - add_action('geodir_detail_page_sidebar', $content_function); |
|
360 | - } |
|
361 | - } |
|
362 | - } |
|
337 | + $arr_detail_page_sidebar_content = |
|
338 | + /** |
|
339 | + * An array of functions to be called to be displayed on the details (post) page sidebar. |
|
340 | + * |
|
341 | + * This filter can be used to remove sections of the details page sidebar, |
|
342 | + * add new sections or rearrange the order of the sections. |
|
343 | + * |
|
344 | + * @param array array('geodir_social_sharing_buttons','geodir_share_this_button','geodir_detail_page_google_analytics','geodir_edit_post_link','geodir_detail_page_review_rating','geodir_detail_page_more_info') The array of functions that will be called. |
|
345 | + * @since 1.0.0 |
|
346 | + */ |
|
347 | + apply_filters('geodir_detail_page_sidebar_content', |
|
348 | + array('geodir_social_sharing_buttons', |
|
349 | + 'geodir_share_this_button', |
|
350 | + 'geodir_detail_page_google_analytics', |
|
351 | + 'geodir_edit_post_link', |
|
352 | + 'geodir_detail_page_review_rating', |
|
353 | + 'geodir_detail_page_more_info' |
|
354 | + ) // end of array |
|
355 | + ); // end of apply filter |
|
356 | + if (!empty($arr_detail_page_sidebar_content)) { |
|
357 | + foreach ($arr_detail_page_sidebar_content as $content_function) { |
|
358 | + if (function_exists($content_function)) { |
|
359 | + add_action('geodir_detail_page_sidebar', $content_function); |
|
360 | + } |
|
361 | + } |
|
362 | + } |
|
363 | 363 | } |
364 | 364 | |
365 | 365 | add_action('geodir_after_edit_post_link', 'geodir_add_to_favourite_link', 1); |
@@ -374,14 +374,14 @@ discard block |
||
374 | 374 | */ |
375 | 375 | function geodir_add_to_favourite_link() |
376 | 376 | { |
377 | - global $post, $preview; |
|
378 | - if (!$preview && geodir_is_page('detail')) { |
|
379 | - ?> |
|
377 | + global $post, $preview; |
|
378 | + if (!$preview && geodir_is_page('detail')) { |
|
379 | + ?> |
|
380 | 380 | <p class="edit_link"> |
381 | 381 | <?php geodir_favourite_html($post->post_author, $post->ID); ?> |
382 | 382 | </p> |
383 | 383 | <?php |
384 | - } |
|
384 | + } |
|
385 | 385 | } |
386 | 386 | |
387 | 387 | /** |
@@ -395,41 +395,41 @@ discard block |
||
395 | 395 | */ |
396 | 396 | function geodir_social_sharing_buttons() |
397 | 397 | { |
398 | - global $preview; |
|
399 | - ob_start(); // Start buffering; |
|
400 | - /** |
|
401 | - * This action is called before the social buttons twitter,facebook and google plus are output in a containing div. |
|
402 | - * |
|
403 | - * @since 1.0.0 |
|
404 | - */ |
|
405 | - do_action('geodir_before_social_sharing_buttons'); |
|
406 | - if (!$preview) { |
|
407 | - ?> |
|
398 | + global $preview; |
|
399 | + ob_start(); // Start buffering; |
|
400 | + /** |
|
401 | + * This action is called before the social buttons twitter,facebook and google plus are output in a containing div. |
|
402 | + * |
|
403 | + * @since 1.0.0 |
|
404 | + */ |
|
405 | + do_action('geodir_before_social_sharing_buttons'); |
|
406 | + if (!$preview) { |
|
407 | + ?> |
|
408 | 408 | <div class="likethis"> |
409 | 409 | <?php geodir_twitter_tweet_button(); ?> |
410 | 410 | <?php geodir_fb_like_button(); ?> |
411 | 411 | <?php geodir_google_plus_button(); ?> |
412 | 412 | </div> |
413 | 413 | <?php |
414 | - }// end of if, if its a preview or not |
|
415 | - |
|
416 | - /** |
|
417 | - * This action is called after the social buttons twitter,facebook and google plus are output in a containing div. |
|
418 | - * |
|
419 | - * @since 1.0.0 |
|
420 | - */ |
|
421 | - do_action('geodir_after_social_sharing_buttons'); |
|
422 | - $content_html = ob_get_clean(); |
|
423 | - if (trim($content_html) != '') |
|
424 | - $content_html = '<div class="geodir-company_info geodir-details-sidebar-social-sharing">' . $content_html . '</div>'; |
|
425 | - if ((int)get_option('geodir_disable_tfg_buttons_section') != 1) { |
|
426 | - /** |
|
427 | - * Filter the geodir_social_sharing_buttons() function content. |
|
428 | - * |
|
429 | - * @param string $content_html The output html of the geodir_social_sharing_buttons() function. |
|
430 | - */ |
|
431 | - echo $content_html = apply_filters('geodir_social_sharing_buttons_html', $content_html); |
|
432 | - } |
|
414 | + }// end of if, if its a preview or not |
|
415 | + |
|
416 | + /** |
|
417 | + * This action is called after the social buttons twitter,facebook and google plus are output in a containing div. |
|
418 | + * |
|
419 | + * @since 1.0.0 |
|
420 | + */ |
|
421 | + do_action('geodir_after_social_sharing_buttons'); |
|
422 | + $content_html = ob_get_clean(); |
|
423 | + if (trim($content_html) != '') |
|
424 | + $content_html = '<div class="geodir-company_info geodir-details-sidebar-social-sharing">' . $content_html . '</div>'; |
|
425 | + if ((int)get_option('geodir_disable_tfg_buttons_section') != 1) { |
|
426 | + /** |
|
427 | + * Filter the geodir_social_sharing_buttons() function content. |
|
428 | + * |
|
429 | + * @param string $content_html The output html of the geodir_social_sharing_buttons() function. |
|
430 | + */ |
|
431 | + echo $content_html = apply_filters('geodir_social_sharing_buttons_html', $content_html); |
|
432 | + } |
|
433 | 433 | |
434 | 434 | |
435 | 435 | } |
@@ -445,39 +445,39 @@ discard block |
||
445 | 445 | */ |
446 | 446 | function geodir_share_this_button() |
447 | 447 | { |
448 | - global $preview; |
|
449 | - ob_start(); // Start buffering; |
|
450 | - /** |
|
451 | - * This is called before the share this html in the function geodir_share_this_button() |
|
452 | - * |
|
453 | - * @since 1.0.0 |
|
454 | - */ |
|
455 | - do_action('geodir_before_share_this_button'); |
|
456 | - if (!$preview) { |
|
457 | - ?> |
|
448 | + global $preview; |
|
449 | + ob_start(); // Start buffering; |
|
450 | + /** |
|
451 | + * This is called before the share this html in the function geodir_share_this_button() |
|
452 | + * |
|
453 | + * @since 1.0.0 |
|
454 | + */ |
|
455 | + do_action('geodir_before_share_this_button'); |
|
456 | + if (!$preview) { |
|
457 | + ?> |
|
458 | 458 | <div class="share clearfix"> |
459 | 459 | <?php geodir_share_this_button_code(); ?> |
460 | 460 | </div> |
461 | 461 | <?php |
462 | - }// end of if, if its a preview or not |
|
463 | - /** |
|
464 | - * This is called after the share this html in the function geodir_share_this_button() |
|
465 | - * |
|
466 | - * @since 1.0.0 |
|
467 | - */ |
|
468 | - do_action('geodir_after_share_this_button'); |
|
469 | - $content_html = ob_get_clean(); |
|
470 | - if (trim($content_html) != '') |
|
471 | - $content_html = '<div class="geodir-company_info geodir-details-sidebar-sharethis">' . $content_html . '</div>'; |
|
472 | - if ((int)get_option('geodir_disable_sharethis_button_section') != 1) { |
|
473 | - /** |
|
474 | - * Filter the geodir_share_this_button() function content. |
|
475 | - * |
|
476 | - * @param string $content_html The output html of the geodir_share_this_button() function. |
|
477 | - * @since 1.0.0 |
|
478 | - */ |
|
479 | - echo $content_html = apply_filters('geodir_share_this_button_html', $content_html); |
|
480 | - } |
|
462 | + }// end of if, if its a preview or not |
|
463 | + /** |
|
464 | + * This is called after the share this html in the function geodir_share_this_button() |
|
465 | + * |
|
466 | + * @since 1.0.0 |
|
467 | + */ |
|
468 | + do_action('geodir_after_share_this_button'); |
|
469 | + $content_html = ob_get_clean(); |
|
470 | + if (trim($content_html) != '') |
|
471 | + $content_html = '<div class="geodir-company_info geodir-details-sidebar-sharethis">' . $content_html . '</div>'; |
|
472 | + if ((int)get_option('geodir_disable_sharethis_button_section') != 1) { |
|
473 | + /** |
|
474 | + * Filter the geodir_share_this_button() function content. |
|
475 | + * |
|
476 | + * @param string $content_html The output html of the geodir_share_this_button() function. |
|
477 | + * @since 1.0.0 |
|
478 | + */ |
|
479 | + echo $content_html = apply_filters('geodir_share_this_button_html', $content_html); |
|
480 | + } |
|
481 | 481 | |
482 | 482 | } |
483 | 483 | |
@@ -493,46 +493,46 @@ discard block |
||
493 | 493 | */ |
494 | 494 | function geodir_edit_post_link() |
495 | 495 | { |
496 | - global $post, $preview; |
|
497 | - ob_start(); // Start buffering; |
|
498 | - /** |
|
499 | - * This is called before the edit post link html in the function geodir_edit_post_link() |
|
500 | - * |
|
501 | - * @since 1.0.0 |
|
502 | - */ |
|
503 | - do_action('geodir_before_edit_post_link'); |
|
504 | - if (!$preview) { |
|
505 | - $is_current_user_owner = geodir_listing_belong_to_current_user(); |
|
496 | + global $post, $preview; |
|
497 | + ob_start(); // Start buffering; |
|
498 | + /** |
|
499 | + * This is called before the edit post link html in the function geodir_edit_post_link() |
|
500 | + * |
|
501 | + * @since 1.0.0 |
|
502 | + */ |
|
503 | + do_action('geodir_before_edit_post_link'); |
|
504 | + if (!$preview) { |
|
505 | + $is_current_user_owner = geodir_listing_belong_to_current_user(); |
|
506 | 506 | |
507 | - if ($is_current_user_owner) { |
|
508 | - $post_id = $post->ID; |
|
507 | + if ($is_current_user_owner) { |
|
508 | + $post_id = $post->ID; |
|
509 | 509 | |
510 | - if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') { |
|
511 | - $post_id = (int)$_REQUEST['pid']; |
|
512 | - } |
|
510 | + if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') { |
|
511 | + $post_id = (int)$_REQUEST['pid']; |
|
512 | + } |
|
513 | 513 | |
514 | - $postlink = get_permalink(geodir_add_listing_page_id()); |
|
515 | - $editlink = geodir_getlink($postlink, array('pid' => $post_id), false); |
|
516 | - echo ' <p class="edit_link"><i class="fa fa-pencil"></i> <a href="' . esc_url($editlink) . '">' . __('Edit this Post', 'geodirectory') . '</a></p>'; |
|
517 | - } |
|
518 | - }// end of if, if its a preview or not |
|
519 | - /** |
|
520 | - * This is called after the edit post link html in the function geodir_edit_post_link() |
|
521 | - * |
|
522 | - * @since 1.0.0 |
|
523 | - */ |
|
524 | - do_action('geodir_after_edit_post_link'); |
|
525 | - $content_html = ob_get_clean(); |
|
526 | - if (trim($content_html) != '') |
|
527 | - $content_html = '<div class="geodir-company_info geodir-details-sidebar-user-links">' . $content_html . '</div>'; |
|
528 | - if ((int)get_option('geodir_disable_user_links_section') != 1) { |
|
529 | - /** |
|
530 | - * Filter the geodir_edit_post_link() function content. |
|
531 | - * |
|
532 | - * @param string $content_html The output html of the geodir_edit_post_link() function. |
|
533 | - */ |
|
534 | - echo $content_html = apply_filters('geodir_edit_post_link_html', $content_html); |
|
535 | - } |
|
514 | + $postlink = get_permalink(geodir_add_listing_page_id()); |
|
515 | + $editlink = geodir_getlink($postlink, array('pid' => $post_id), false); |
|
516 | + echo ' <p class="edit_link"><i class="fa fa-pencil"></i> <a href="' . esc_url($editlink) . '">' . __('Edit this Post', 'geodirectory') . '</a></p>'; |
|
517 | + } |
|
518 | + }// end of if, if its a preview or not |
|
519 | + /** |
|
520 | + * This is called after the edit post link html in the function geodir_edit_post_link() |
|
521 | + * |
|
522 | + * @since 1.0.0 |
|
523 | + */ |
|
524 | + do_action('geodir_after_edit_post_link'); |
|
525 | + $content_html = ob_get_clean(); |
|
526 | + if (trim($content_html) != '') |
|
527 | + $content_html = '<div class="geodir-company_info geodir-details-sidebar-user-links">' . $content_html . '</div>'; |
|
528 | + if ((int)get_option('geodir_disable_user_links_section') != 1) { |
|
529 | + /** |
|
530 | + * Filter the geodir_edit_post_link() function content. |
|
531 | + * |
|
532 | + * @param string $content_html The output html of the geodir_edit_post_link() function. |
|
533 | + */ |
|
534 | + echo $content_html = apply_filters('geodir_edit_post_link_html', $content_html); |
|
535 | + } |
|
536 | 536 | } |
537 | 537 | |
538 | 538 | /** |
@@ -546,27 +546,27 @@ discard block |
||
546 | 546 | */ |
547 | 547 | function geodir_detail_page_google_analytics() |
548 | 548 | { |
549 | - global $post; |
|
550 | - $package_info = array(); |
|
551 | - $package_info = geodir_post_package_info($package_info, $post); |
|
549 | + global $post; |
|
550 | + $package_info = array(); |
|
551 | + $package_info = geodir_post_package_info($package_info, $post); |
|
552 | 552 | |
553 | - $id = trim(get_option('geodir_ga_id')); |
|
553 | + $id = trim(get_option('geodir_ga_id')); |
|
554 | 554 | |
555 | - if (!$id) { |
|
556 | - return; //if no Google Analytics ID then bail. |
|
557 | - } |
|
555 | + if (!$id) { |
|
556 | + return; //if no Google Analytics ID then bail. |
|
557 | + } |
|
558 | 558 | |
559 | - ob_start(); // Start buffering; |
|
560 | - /** |
|
561 | - * This is called before the edit post link html in the function geodir_detail_page_google_analytics() |
|
562 | - * |
|
563 | - * @since 1.0.0 |
|
564 | - */ |
|
565 | - do_action('geodir_before_google_analytics'); |
|
559 | + ob_start(); // Start buffering; |
|
560 | + /** |
|
561 | + * This is called before the edit post link html in the function geodir_detail_page_google_analytics() |
|
562 | + * |
|
563 | + * @since 1.0.0 |
|
564 | + */ |
|
565 | + do_action('geodir_before_google_analytics'); |
|
566 | 566 | |
567 | - 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' )) ) { |
|
568 | - $page_url = urlencode($_SERVER['REQUEST_URI']); |
|
569 | - ?> |
|
567 | + 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' )) ) { |
|
568 | + $page_url = urlencode($_SERVER['REQUEST_URI']); |
|
569 | + ?> |
|
570 | 570 | <script type="text/javascript"> |
571 | 571 | ga_data1 = false; |
572 | 572 | ga_data2 = false; |
@@ -795,15 +795,15 @@ discard block |
||
795 | 795 | var labels = results[1].rows.map(function(row) { return +row[0]; }); |
796 | 796 | |
797 | 797 | <?php |
798 | - // Here we list the shorthand days of the week so it can be used in translation. |
|
799 | - __("Mon",'geodirectory'); |
|
800 | - __("Tue",'geodirectory'); |
|
801 | - __("Wed",'geodirectory'); |
|
802 | - __("Thu",'geodirectory'); |
|
803 | - __("Fri",'geodirectory'); |
|
804 | - __("Sat",'geodirectory'); |
|
805 | - __("Sun",'geodirectory'); |
|
806 | - ?> |
|
798 | + // Here we list the shorthand days of the week so it can be used in translation. |
|
799 | + __("Mon",'geodirectory'); |
|
800 | + __("Tue",'geodirectory'); |
|
801 | + __("Wed",'geodirectory'); |
|
802 | + __("Thu",'geodirectory'); |
|
803 | + __("Fri",'geodirectory'); |
|
804 | + __("Sat",'geodirectory'); |
|
805 | + __("Sun",'geodirectory'); |
|
806 | + ?> |
|
807 | 807 | |
808 | 808 | labels = [ |
809 | 809 | "<?php _e(date('D', strtotime("+1 day")),'geodirectory'); ?>", |
@@ -1028,24 +1028,24 @@ discard block |
||
1028 | 1028 | </span> |
1029 | 1029 | |
1030 | 1030 | <?php |
1031 | - } |
|
1032 | - /** |
|
1033 | - * This is called after the edit post link html in the function geodir_detail_page_google_analytics() |
|
1034 | - * |
|
1035 | - * @since 1.0.0 |
|
1036 | - */ |
|
1037 | - do_action('geodir_after_google_analytics'); |
|
1038 | - $content_html = ob_get_clean(); |
|
1039 | - if (trim($content_html) != '') |
|
1040 | - $content_html = '<div class="geodir-company_info geodir-details-sidebar-google-analytics">' . $content_html . '</div>'; |
|
1041 | - if ((int)get_option('geodir_disable_google_analytics_section') != 1) { |
|
1042 | - /** |
|
1043 | - * Filter the geodir_edit_post_link() function content. |
|
1044 | - * |
|
1045 | - * @param string $content_html The output html of the geodir_edit_post_link() function. |
|
1046 | - */ |
|
1047 | - echo $content_html = apply_filters('geodir_google_analytic_html', $content_html); |
|
1048 | - } |
|
1031 | + } |
|
1032 | + /** |
|
1033 | + * This is called after the edit post link html in the function geodir_detail_page_google_analytics() |
|
1034 | + * |
|
1035 | + * @since 1.0.0 |
|
1036 | + */ |
|
1037 | + do_action('geodir_after_google_analytics'); |
|
1038 | + $content_html = ob_get_clean(); |
|
1039 | + if (trim($content_html) != '') |
|
1040 | + $content_html = '<div class="geodir-company_info geodir-details-sidebar-google-analytics">' . $content_html . '</div>'; |
|
1041 | + if ((int)get_option('geodir_disable_google_analytics_section') != 1) { |
|
1042 | + /** |
|
1043 | + * Filter the geodir_edit_post_link() function content. |
|
1044 | + * |
|
1045 | + * @param string $content_html The output html of the geodir_edit_post_link() function. |
|
1046 | + */ |
|
1047 | + echo $content_html = apply_filters('geodir_google_analytic_html', $content_html); |
|
1048 | + } |
|
1049 | 1049 | } |
1050 | 1050 | |
1051 | 1051 | /** |
@@ -1059,90 +1059,90 @@ discard block |
||
1059 | 1059 | */ |
1060 | 1060 | function geodir_detail_page_review_rating() |
1061 | 1061 | { |
1062 | - global $post, $preview, $post_images; |
|
1063 | - ob_start(); // Start buffering; |
|
1064 | - /** |
|
1065 | - * This is called before the rating html in the function geodir_detail_page_review_rating(). |
|
1066 | - * |
|
1067 | - * This is called outside the check for an actual rating and the check for preview page. |
|
1068 | - * |
|
1069 | - * @since 1.0.0 |
|
1070 | - */ |
|
1071 | - do_action('geodir_before_detail_page_review_rating'); |
|
1072 | - |
|
1073 | - $comment_count = geodir_get_review_count_total($post->ID); |
|
1074 | - $post_avgratings = geodir_get_post_rating($post->ID); |
|
1075 | - |
|
1076 | - if ($post_avgratings != 0 && !$preview) { |
|
1077 | - /** |
|
1078 | - * This is called before the rating html in the function geodir_detail_page_review_rating(). |
|
1079 | - * |
|
1080 | - * This is called inside the check for an actual rating and the check for preview page. |
|
1081 | - * |
|
1082 | - * @since 1.0.0 |
|
1083 | - * @param float $post_avgratings Average rating for the surrent post. |
|
1084 | - * @param int $post->ID Current post ID. |
|
1085 | - */ |
|
1086 | - do_action('geodir_before_review_rating_stars_on_detail', $post_avgratings, $post->ID); |
|
1087 | - |
|
1088 | - $html = '<p style=" float:left;">'; |
|
1089 | - $html .= geodir_get_rating_stars($post_avgratings, $post->ID); |
|
1090 | - $html .= '<div class="average-review" itemscope itemtype="http://data-vocabulary.org/Review-aggregate">'; |
|
1091 | - $post_avgratings = (is_float($post_avgratings) || (strpos($post_avgratings, ".", 1) == 1 && strlen($post_avgratings) > 3)) ? number_format($post_avgratings, 1, '.', '') : $post_avgratings; |
|
1062 | + global $post, $preview, $post_images; |
|
1063 | + ob_start(); // Start buffering; |
|
1064 | + /** |
|
1065 | + * This is called before the rating html in the function geodir_detail_page_review_rating(). |
|
1066 | + * |
|
1067 | + * This is called outside the check for an actual rating and the check for preview page. |
|
1068 | + * |
|
1069 | + * @since 1.0.0 |
|
1070 | + */ |
|
1071 | + do_action('geodir_before_detail_page_review_rating'); |
|
1072 | + |
|
1073 | + $comment_count = geodir_get_review_count_total($post->ID); |
|
1074 | + $post_avgratings = geodir_get_post_rating($post->ID); |
|
1075 | + |
|
1076 | + if ($post_avgratings != 0 && !$preview) { |
|
1077 | + /** |
|
1078 | + * This is called before the rating html in the function geodir_detail_page_review_rating(). |
|
1079 | + * |
|
1080 | + * This is called inside the check for an actual rating and the check for preview page. |
|
1081 | + * |
|
1082 | + * @since 1.0.0 |
|
1083 | + * @param float $post_avgratings Average rating for the surrent post. |
|
1084 | + * @param int $post->ID Current post ID. |
|
1085 | + */ |
|
1086 | + do_action('geodir_before_review_rating_stars_on_detail', $post_avgratings, $post->ID); |
|
1087 | + |
|
1088 | + $html = '<p style=" float:left;">'; |
|
1089 | + $html .= geodir_get_rating_stars($post_avgratings, $post->ID); |
|
1090 | + $html .= '<div class="average-review" itemscope itemtype="http://data-vocabulary.org/Review-aggregate">'; |
|
1091 | + $post_avgratings = (is_float($post_avgratings) || (strpos($post_avgratings, ".", 1) == 1 && strlen($post_avgratings) > 3)) ? number_format($post_avgratings, 1, '.', '') : $post_avgratings; |
|
1092 | 1092 | |
1093 | 1093 | $reviews_text = $comment_count > 1 ? __("reviews", 'geodirectory') : __("review", 'geodirectory'); |
1094 | 1094 | |
1095 | 1095 | $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 />'; |
1096 | 1096 | |
1097 | - $html .= '<span class="item">'; |
|
1098 | - $html .= '<span class="fn" itemprop="itemreviewed">' . $post->post_title . '</span>'; |
|
1097 | + $html .= '<span class="item">'; |
|
1098 | + $html .= '<span class="fn" itemprop="itemreviewed">' . $post->post_title . '</span>'; |
|
1099 | 1099 | |
1100 | - if ($post_images) { |
|
1101 | - foreach ($post_images as $img) { |
|
1102 | - $post_img = $img->src; |
|
1103 | - break; |
|
1104 | - } |
|
1105 | - } |
|
1106 | - |
|
1107 | - if (isset($post_img) && $post_img) { |
|
1108 | - $html .= '<br /><img src="' . $post_img . '" class="photo hreview-img" alt="' . esc_attr($post->post_title) . '" itemprop="photo" content="' . $post_img . '" class="photo hreview-img" />'; |
|
1109 | - } |
|
1110 | - |
|
1111 | - $html .= '</span>'; |
|
1112 | - |
|
1113 | - echo $html .= '</div>'; |
|
1114 | - /** |
|
1115 | - * This is called after the rating html in the function geodir_detail_page_review_rating(). |
|
1116 | - * |
|
1117 | - * This is called inside the check for an actual rating and the check for preview page. |
|
1118 | - * |
|
1119 | - * @since 1.0.0 |
|
1120 | - * @param float $post_avgratings Average rating for the surrent post. |
|
1121 | - * @param int $post->ID Current post ID. |
|
1122 | - */ |
|
1123 | - do_action('geodir_after_review_rating_stars_on_detail', $post_avgratings, $post->ID); |
|
1124 | - } |
|
1125 | - /** |
|
1126 | - * This is called before the rating html in the function geodir_detail_page_review_rating(). |
|
1127 | - * |
|
1128 | - * This is called outside the check for an actual rating and the check for preview page. |
|
1129 | - * |
|
1130 | - * @since 1.0.0 |
|
1131 | - */ |
|
1132 | - do_action('geodir_after_detail_page_review_rating'); |
|
1133 | - $content_html = ob_get_clean(); |
|
1134 | - if (trim($content_html) != '') { |
|
1135 | - $content_html = '<div class="geodir-company_info geodir-details-sidebar-rating">' . $content_html . '</div>'; |
|
1136 | - } |
|
1137 | - if ((int)get_option('geodir_disable_rating_info_section') != 1) { |
|
1138 | - /** |
|
1139 | - * Filter the geodir_detail_page_review_rating() function content. |
|
1140 | - * |
|
1141 | - * @since 1.0.0 |
|
1142 | - * @param string $content_html The output html of the geodir_detail_page_review_rating() function. |
|
1143 | - */ |
|
1144 | - echo $content_html = apply_filters('geodir_detail_page_review_rating_html', $content_html); |
|
1145 | - } |
|
1100 | + if ($post_images) { |
|
1101 | + foreach ($post_images as $img) { |
|
1102 | + $post_img = $img->src; |
|
1103 | + break; |
|
1104 | + } |
|
1105 | + } |
|
1106 | + |
|
1107 | + if (isset($post_img) && $post_img) { |
|
1108 | + $html .= '<br /><img src="' . $post_img . '" class="photo hreview-img" alt="' . esc_attr($post->post_title) . '" itemprop="photo" content="' . $post_img . '" class="photo hreview-img" />'; |
|
1109 | + } |
|
1110 | + |
|
1111 | + $html .= '</span>'; |
|
1112 | + |
|
1113 | + echo $html .= '</div>'; |
|
1114 | + /** |
|
1115 | + * This is called after the rating html in the function geodir_detail_page_review_rating(). |
|
1116 | + * |
|
1117 | + * This is called inside the check for an actual rating and the check for preview page. |
|
1118 | + * |
|
1119 | + * @since 1.0.0 |
|
1120 | + * @param float $post_avgratings Average rating for the surrent post. |
|
1121 | + * @param int $post->ID Current post ID. |
|
1122 | + */ |
|
1123 | + do_action('geodir_after_review_rating_stars_on_detail', $post_avgratings, $post->ID); |
|
1124 | + } |
|
1125 | + /** |
|
1126 | + * This is called before the rating html in the function geodir_detail_page_review_rating(). |
|
1127 | + * |
|
1128 | + * This is called outside the check for an actual rating and the check for preview page. |
|
1129 | + * |
|
1130 | + * @since 1.0.0 |
|
1131 | + */ |
|
1132 | + do_action('geodir_after_detail_page_review_rating'); |
|
1133 | + $content_html = ob_get_clean(); |
|
1134 | + if (trim($content_html) != '') { |
|
1135 | + $content_html = '<div class="geodir-company_info geodir-details-sidebar-rating">' . $content_html . '</div>'; |
|
1136 | + } |
|
1137 | + if ((int)get_option('geodir_disable_rating_info_section') != 1) { |
|
1138 | + /** |
|
1139 | + * Filter the geodir_detail_page_review_rating() function content. |
|
1140 | + * |
|
1141 | + * @since 1.0.0 |
|
1142 | + * @param string $content_html The output html of the geodir_detail_page_review_rating() function. |
|
1143 | + */ |
|
1144 | + echo $content_html = apply_filters('geodir_detail_page_review_rating_html', $content_html); |
|
1145 | + } |
|
1146 | 1146 | } |
1147 | 1147 | |
1148 | 1148 | /** |
@@ -1154,35 +1154,35 @@ discard block |
||
1154 | 1154 | */ |
1155 | 1155 | function geodir_detail_page_more_info() |
1156 | 1156 | { |
1157 | - ob_start(); // Start buffering; |
|
1158 | - /** |
|
1159 | - * This is called before the info section html. |
|
1160 | - * |
|
1161 | - * @since 1.0.0 |
|
1162 | - */ |
|
1163 | - do_action('geodir_before_detail_page_more_info'); |
|
1164 | - if ($geodir_post_detail_fields = geodir_show_listing_info()) { |
|
1165 | - echo $geodir_post_detail_fields; |
|
1166 | - } |
|
1167 | - /** |
|
1168 | - * This is called after the info section html. |
|
1169 | - * |
|
1170 | - * @since 1.0.0 |
|
1171 | - */ |
|
1172 | - do_action('geodir_after_detail_page_more_info'); |
|
1173 | - |
|
1174 | - $content_html = ob_get_clean(); |
|
1175 | - if (trim($content_html) != '') |
|
1176 | - $content_html = '<div class="geodir-company_info geodir-details-sidebar-listing-info">' . $content_html . '</div>'; |
|
1177 | - if ((int)get_option('geodir_disable_listing_info_section') != 1) { |
|
1178 | - /** |
|
1179 | - * Filter the output html for function geodir_detail_page_more_info(). |
|
1180 | - * |
|
1181 | - * @since 1.0.0 |
|
1182 | - * @param string $content_html The output html of the geodir_detail_page_more_info() function. |
|
1183 | - */ |
|
1184 | - echo $content_html = apply_filters('geodir_detail_page_more_info_html', $content_html); |
|
1185 | - } |
|
1157 | + ob_start(); // Start buffering; |
|
1158 | + /** |
|
1159 | + * This is called before the info section html. |
|
1160 | + * |
|
1161 | + * @since 1.0.0 |
|
1162 | + */ |
|
1163 | + do_action('geodir_before_detail_page_more_info'); |
|
1164 | + if ($geodir_post_detail_fields = geodir_show_listing_info()) { |
|
1165 | + echo $geodir_post_detail_fields; |
|
1166 | + } |
|
1167 | + /** |
|
1168 | + * This is called after the info section html. |
|
1169 | + * |
|
1170 | + * @since 1.0.0 |
|
1171 | + */ |
|
1172 | + do_action('geodir_after_detail_page_more_info'); |
|
1173 | + |
|
1174 | + $content_html = ob_get_clean(); |
|
1175 | + if (trim($content_html) != '') |
|
1176 | + $content_html = '<div class="geodir-company_info geodir-details-sidebar-listing-info">' . $content_html . '</div>'; |
|
1177 | + if ((int)get_option('geodir_disable_listing_info_section') != 1) { |
|
1178 | + /** |
|
1179 | + * Filter the output html for function geodir_detail_page_more_info(). |
|
1180 | + * |
|
1181 | + * @since 1.0.0 |
|
1182 | + * @param string $content_html The output html of the geodir_detail_page_more_info() function. |
|
1183 | + */ |
|
1184 | + echo $content_html = apply_filters('geodir_detail_page_more_info_html', $content_html); |
|
1185 | + } |
|
1186 | 1186 | } |
1187 | 1187 | |
1188 | 1188 | |
@@ -1196,15 +1196,15 @@ discard block |
||
1196 | 1196 | */ |
1197 | 1197 | function geodir_localize_all_js_msg() |
1198 | 1198 | {// check_ajax_referer function is used to make sure no files are uplaoded remotly but it will fail if used between https and non https so we do the check below of the urls |
1199 | - if (str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) { |
|
1200 | - $ajax_url = admin_url('admin-ajax.php'); |
|
1201 | - } elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) { |
|
1202 | - $ajax_url = admin_url('admin-ajax.php'); |
|
1203 | - } elseif (str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) { |
|
1204 | - $ajax_url = str_replace("https", "http", admin_url('admin-ajax.php')); |
|
1205 | - } elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) { |
|
1206 | - $ajax_url = str_replace("http", "https", admin_url('admin-ajax.php')); |
|
1207 | - } |
|
1199 | + if (str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) { |
|
1200 | + $ajax_url = admin_url('admin-ajax.php'); |
|
1201 | + } elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) { |
|
1202 | + $ajax_url = admin_url('admin-ajax.php'); |
|
1203 | + } elseif (str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) { |
|
1204 | + $ajax_url = str_replace("https", "http", admin_url('admin-ajax.php')); |
|
1205 | + } elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) { |
|
1206 | + $ajax_url = str_replace("http", "https", admin_url('admin-ajax.php')); |
|
1207 | + } |
|
1208 | 1208 | |
1209 | 1209 | /** |
1210 | 1210 | * Filter the allowed image type extensions for post images. |
@@ -1214,52 +1214,52 @@ discard block |
||
1214 | 1214 | */ |
1215 | 1215 | $allowed_img_types = apply_filters('geodir_allowed_post_image_exts', array('jpg', 'jpeg', 'jpe', 'gif', 'png')); |
1216 | 1216 | |
1217 | - $arr_alert_msg = array( |
|
1218 | - 'geodir_plugin_url' => geodir_plugin_url(), |
|
1219 | - 'geodir_admin_ajax_url' => $ajax_url, |
|
1220 | - 'custom_field_not_blank_var' => __('HTML Variable Name must not be blank', 'geodirectory'), |
|
1221 | - 'custom_field_not_special_char' => __('Please do not use special character and spaces in HTML Variable Name.', 'geodirectory'), |
|
1222 | - 'custom_field_unique_name' => __('HTML Variable Name should be a unique name.', 'geodirectory'), |
|
1223 | - 'custom_field_delete' => __('Are you wish to delete this field?', 'geodirectory'), |
|
1224 | - //start not show alert msg |
|
1225 | - 'tax_meta_class_succ_del_msg' => __('File has been successfully deleted.', 'geodirectory'), |
|
1226 | - 'tax_meta_class_not_permission_to_del_msg' => __('You do NOT have permission to delete this file.', 'geodirectory'), |
|
1227 | - 'tax_meta_class_order_save_msg' => __('Order saved!', 'geodirectory'), |
|
1228 | - 'tax_meta_class_not_permission_record_img_msg' => __('You do not have permission to reorder images.', 'geodirectory'), |
|
1229 | - 'address_not_found_on_map_msg' => __('Address not found for:', 'geodirectory'), |
|
1230 | - // end not show alert msg |
|
1231 | - 'my_place_listing_del' => __('Are you wish to delete this listing?', 'geodirectory'), |
|
1232 | - //start not show alert msg |
|
1233 | - 'rating_error_msg' => __('Error : please retry', 'geodirectory'), |
|
1234 | - 'listing_url_prefix_msg' => __('Please enter listing url prefix', 'geodirectory'), |
|
1235 | - 'invalid_listing_prefix_msg' => __('Invalid character in listing url prefix', 'geodirectory'), |
|
1236 | - 'location_url_prefix_msg' => __('Please enter location url prefix', 'geodirectory'), |
|
1237 | - 'invalid_location_prefix_msg' => __('Invalid character in location url prefix', 'geodirectory'), |
|
1238 | - 'location_and_cat_url_separator_msg' => __('Please enter location and category url separator', 'geodirectory'), |
|
1239 | - 'invalid_char_and_cat_url_separator_msg' => __('Invalid character in location and category url separator', 'geodirectory'), |
|
1240 | - 'listing_det_url_separator_msg' => __('Please enter listing detail url separator', 'geodirectory'), |
|
1241 | - 'invalid_char_listing_det_url_separator_msg' => __('Invalid character in listing detail url separator', 'geodirectory'), |
|
1242 | - 'loading_listing_error_favorite' => __('Error loading listing.', 'geodirectory'), |
|
1243 | - 'geodir_field_id_required' => __('This field is required.', 'geodirectory'), |
|
1244 | - 'geodir_valid_email_address_msg' => __('Please enter valid email address.', 'geodirectory'), |
|
1245 | - 'geodir_default_marker_icon' => get_option('geodir_default_marker_icon'), |
|
1246 | - 'geodir_latitude_error_msg' => GEODIR_LATITUDE_ERROR_MSG, |
|
1247 | - 'geodir_longgitude_error_msg' => GEODIR_LOGNGITUDE_ERROR_MSG, |
|
1248 | - 'geodir_default_rating_star_icon' => get_option('geodir_default_rating_star_icon'), |
|
1249 | - 'gd_cmt_btn_post_reply' => __('Post Reply', 'geodirectory'), |
|
1250 | - 'gd_cmt_btn_reply_text' => __('Reply text', 'geodirectory'), |
|
1251 | - 'gd_cmt_btn_post_review' => __('Post Review', 'geodirectory'), |
|
1252 | - 'gd_cmt_btn_review_text' => __('Review text', 'geodirectory'), |
|
1253 | - 'gd_cmt_err_no_rating' => __("Please select star rating, you can't leave a review without stars.", 'geodirectory'), |
|
1254 | - /* on/off dragging for phone devices */ |
|
1255 | - 'geodir_onoff_dragging' => get_option('geodir_map_onoff_dragging') ? true : false, |
|
1256 | - 'geodir_is_mobile' => wp_is_mobile() ? true : false, |
|
1257 | - 'geodir_on_dragging_text' => __('Enable Dragging', 'geodirectory'), |
|
1258 | - 'geodir_off_dragging_text' => __('Disable Dragging', 'geodirectory'), |
|
1259 | - 'geodir_err_max_file_size' => __('File size error : You tried to upload a file over %s', 'geodirectory'), |
|
1260 | - 'geodir_err_file_upload_limit' => __('You have reached your upload limit of %s files.', 'geodirectory'), |
|
1261 | - 'geodir_err_pkg_upload_limit' => __('You may only upload %s files with this package, please try again.', 'geodirectory'), |
|
1262 | - 'geodir_action_remove' => __('Remove', 'geodirectory'), |
|
1217 | + $arr_alert_msg = array( |
|
1218 | + 'geodir_plugin_url' => geodir_plugin_url(), |
|
1219 | + 'geodir_admin_ajax_url' => $ajax_url, |
|
1220 | + 'custom_field_not_blank_var' => __('HTML Variable Name must not be blank', 'geodirectory'), |
|
1221 | + 'custom_field_not_special_char' => __('Please do not use special character and spaces in HTML Variable Name.', 'geodirectory'), |
|
1222 | + 'custom_field_unique_name' => __('HTML Variable Name should be a unique name.', 'geodirectory'), |
|
1223 | + 'custom_field_delete' => __('Are you wish to delete this field?', 'geodirectory'), |
|
1224 | + //start not show alert msg |
|
1225 | + 'tax_meta_class_succ_del_msg' => __('File has been successfully deleted.', 'geodirectory'), |
|
1226 | + 'tax_meta_class_not_permission_to_del_msg' => __('You do NOT have permission to delete this file.', 'geodirectory'), |
|
1227 | + 'tax_meta_class_order_save_msg' => __('Order saved!', 'geodirectory'), |
|
1228 | + 'tax_meta_class_not_permission_record_img_msg' => __('You do not have permission to reorder images.', 'geodirectory'), |
|
1229 | + 'address_not_found_on_map_msg' => __('Address not found for:', 'geodirectory'), |
|
1230 | + // end not show alert msg |
|
1231 | + 'my_place_listing_del' => __('Are you wish to delete this listing?', 'geodirectory'), |
|
1232 | + //start not show alert msg |
|
1233 | + 'rating_error_msg' => __('Error : please retry', 'geodirectory'), |
|
1234 | + 'listing_url_prefix_msg' => __('Please enter listing url prefix', 'geodirectory'), |
|
1235 | + 'invalid_listing_prefix_msg' => __('Invalid character in listing url prefix', 'geodirectory'), |
|
1236 | + 'location_url_prefix_msg' => __('Please enter location url prefix', 'geodirectory'), |
|
1237 | + 'invalid_location_prefix_msg' => __('Invalid character in location url prefix', 'geodirectory'), |
|
1238 | + 'location_and_cat_url_separator_msg' => __('Please enter location and category url separator', 'geodirectory'), |
|
1239 | + 'invalid_char_and_cat_url_separator_msg' => __('Invalid character in location and category url separator', 'geodirectory'), |
|
1240 | + 'listing_det_url_separator_msg' => __('Please enter listing detail url separator', 'geodirectory'), |
|
1241 | + 'invalid_char_listing_det_url_separator_msg' => __('Invalid character in listing detail url separator', 'geodirectory'), |
|
1242 | + 'loading_listing_error_favorite' => __('Error loading listing.', 'geodirectory'), |
|
1243 | + 'geodir_field_id_required' => __('This field is required.', 'geodirectory'), |
|
1244 | + 'geodir_valid_email_address_msg' => __('Please enter valid email address.', 'geodirectory'), |
|
1245 | + 'geodir_default_marker_icon' => get_option('geodir_default_marker_icon'), |
|
1246 | + 'geodir_latitude_error_msg' => GEODIR_LATITUDE_ERROR_MSG, |
|
1247 | + 'geodir_longgitude_error_msg' => GEODIR_LOGNGITUDE_ERROR_MSG, |
|
1248 | + 'geodir_default_rating_star_icon' => get_option('geodir_default_rating_star_icon'), |
|
1249 | + 'gd_cmt_btn_post_reply' => __('Post Reply', 'geodirectory'), |
|
1250 | + 'gd_cmt_btn_reply_text' => __('Reply text', 'geodirectory'), |
|
1251 | + 'gd_cmt_btn_post_review' => __('Post Review', 'geodirectory'), |
|
1252 | + 'gd_cmt_btn_review_text' => __('Review text', 'geodirectory'), |
|
1253 | + 'gd_cmt_err_no_rating' => __("Please select star rating, you can't leave a review without stars.", 'geodirectory'), |
|
1254 | + /* on/off dragging for phone devices */ |
|
1255 | + 'geodir_onoff_dragging' => get_option('geodir_map_onoff_dragging') ? true : false, |
|
1256 | + 'geodir_is_mobile' => wp_is_mobile() ? true : false, |
|
1257 | + 'geodir_on_dragging_text' => __('Enable Dragging', 'geodirectory'), |
|
1258 | + 'geodir_off_dragging_text' => __('Disable Dragging', 'geodirectory'), |
|
1259 | + 'geodir_err_max_file_size' => __('File size error : You tried to upload a file over %s', 'geodirectory'), |
|
1260 | + 'geodir_err_file_upload_limit' => __('You have reached your upload limit of %s files.', 'geodirectory'), |
|
1261 | + 'geodir_err_pkg_upload_limit' => __('You may only upload %s files with this package, please try again.', 'geodirectory'), |
|
1262 | + 'geodir_action_remove' => __('Remove', 'geodirectory'), |
|
1263 | 1263 | 'geodir_txt_all_files' => __('Allowed files', 'geodirectory'), |
1264 | 1264 | 'geodir_err_file_type' => __('File type error. Allowed file types: %s', 'geodirectory'), |
1265 | 1265 | 'gd_allowed_img_types' => !empty($allowed_img_types) ? implode(',', $allowed_img_types) : '', |
@@ -1267,28 +1267,28 @@ discard block |
||
1267 | 1267 | 'geodir_txt_form_searching' => __('Searching...', 'geodirectory'), |
1268 | 1268 | 'fa_rating' => (int)get_option('geodir_reviewrating_enable_font_awesome') == 1 ? 1 : '', |
1269 | 1269 | 'reviewrating' => defined('GEODIRREVIEWRATING_VERSION') ? 1 : '', |
1270 | - ); |
|
1271 | - |
|
1272 | - /** |
|
1273 | - * Filters the translated JS strings from function geodir_localize_all_js_msg(). |
|
1274 | - * |
|
1275 | - * With this filter you can add, remove or change translated JS strings. |
|
1276 | - * You should add your own translations to this if you are building an addon rather than adding another script block. |
|
1277 | - * |
|
1278 | - * @since 1.0.0 |
|
1279 | - */ |
|
1280 | - $arr_alert_msg = apply_filters('geodir_all_js_msg', $arr_alert_msg); |
|
1281 | - |
|
1282 | - foreach ($arr_alert_msg as $key => $value) { |
|
1283 | - if (!is_scalar($value)) |
|
1284 | - continue; |
|
1285 | - $arr_alert_msg[$key] = html_entity_decode((string)$value, ENT_QUOTES, 'UTF-8'); |
|
1286 | - } |
|
1270 | + ); |
|
1287 | 1271 | |
1288 | - $script = "var geodir_all_js_msg = " . json_encode($arr_alert_msg) . ';'; |
|
1289 | - echo '<script>'; |
|
1290 | - echo $script; |
|
1291 | - echo '</script>'; |
|
1272 | + /** |
|
1273 | + * Filters the translated JS strings from function geodir_localize_all_js_msg(). |
|
1274 | + * |
|
1275 | + * With this filter you can add, remove or change translated JS strings. |
|
1276 | + * You should add your own translations to this if you are building an addon rather than adding another script block. |
|
1277 | + * |
|
1278 | + * @since 1.0.0 |
|
1279 | + */ |
|
1280 | + $arr_alert_msg = apply_filters('geodir_all_js_msg', $arr_alert_msg); |
|
1281 | + |
|
1282 | + foreach ($arr_alert_msg as $key => $value) { |
|
1283 | + if (!is_scalar($value)) |
|
1284 | + continue; |
|
1285 | + $arr_alert_msg[$key] = html_entity_decode((string)$value, ENT_QUOTES, 'UTF-8'); |
|
1286 | + } |
|
1287 | + |
|
1288 | + $script = "var geodir_all_js_msg = " . json_encode($arr_alert_msg) . ';'; |
|
1289 | + echo '<script>'; |
|
1290 | + echo $script; |
|
1291 | + echo '</script>'; |
|
1292 | 1292 | } |
1293 | 1293 | |
1294 | 1294 | add_action('admin_bar_menu', 'geodir_admin_bar_site_menu', 31); |
@@ -1304,9 +1304,9 @@ discard block |
||
1304 | 1304 | */ |
1305 | 1305 | function geodir_admin_bar_site_menu($wp_admin_bar) |
1306 | 1306 | { |
1307 | - if (get_option("geodir_installed")) { |
|
1308 | - $wp_admin_bar->add_menu(array('parent' => 'appearance', 'id' => 'geodirectory', 'title' => __('GeoDirectory', 'geodirectory'), 'href' => admin_url('?page=geodirectory'))); |
|
1309 | - } |
|
1307 | + if (get_option("geodir_installed")) { |
|
1308 | + $wp_admin_bar->add_menu(array('parent' => 'appearance', 'id' => 'geodirectory', 'title' => __('GeoDirectory', 'geodirectory'), 'href' => admin_url('?page=geodirectory'))); |
|
1309 | + } |
|
1310 | 1310 | } |
1311 | 1311 | |
1312 | 1312 | add_action('geodir_before_listing', 'geodir_display_sort_options'); /*function in custom_functions.php*/ |
@@ -1332,25 +1332,25 @@ discard block |
||
1332 | 1332 | */ |
1333 | 1333 | function geodir_store_sidebars() |
1334 | 1334 | { |
1335 | - global $geodir_sidebars; |
|
1336 | - global $sidebars_widgets; |
|
1337 | - |
|
1338 | - if (!is_array($sidebars_widgets)) |
|
1339 | - $sidebars_widgets = wp_get_sidebars_widgets(); |
|
1340 | - $geodir_old_sidebars = array(); |
|
1341 | - |
|
1342 | - if (is_array($geodir_sidebars)) { |
|
1343 | - foreach ($geodir_sidebars as $val) { |
|
1344 | - if (is_array($sidebars_widgets)) { |
|
1345 | - if (array_key_exists($val, $sidebars_widgets)) |
|
1346 | - $geodir_old_sidebars[$val] = $sidebars_widgets[$val]; |
|
1347 | - else |
|
1348 | - $geodir_old_sidebars[$val] = array(); |
|
1349 | - } |
|
1350 | - } |
|
1351 | - } |
|
1352 | - update_option('geodir_sidebars', $geodir_old_sidebars); |
|
1353 | - geodir_option_version_backup('geodir_sidebars'); |
|
1335 | + global $geodir_sidebars; |
|
1336 | + global $sidebars_widgets; |
|
1337 | + |
|
1338 | + if (!is_array($sidebars_widgets)) |
|
1339 | + $sidebars_widgets = wp_get_sidebars_widgets(); |
|
1340 | + $geodir_old_sidebars = array(); |
|
1341 | + |
|
1342 | + if (is_array($geodir_sidebars)) { |
|
1343 | + foreach ($geodir_sidebars as $val) { |
|
1344 | + if (is_array($sidebars_widgets)) { |
|
1345 | + if (array_key_exists($val, $sidebars_widgets)) |
|
1346 | + $geodir_old_sidebars[$val] = $sidebars_widgets[$val]; |
|
1347 | + else |
|
1348 | + $geodir_old_sidebars[$val] = array(); |
|
1349 | + } |
|
1350 | + } |
|
1351 | + } |
|
1352 | + update_option('geodir_sidebars', $geodir_old_sidebars); |
|
1353 | + geodir_option_version_backup('geodir_sidebars'); |
|
1354 | 1354 | |
1355 | 1355 | } |
1356 | 1356 | |
@@ -1364,34 +1364,34 @@ discard block |
||
1364 | 1364 | */ |
1365 | 1365 | function geodir_restore_sidebars() |
1366 | 1366 | { |
1367 | - global $sidebars_widgets; |
|
1368 | - |
|
1369 | - if (!is_array($sidebars_widgets)) |
|
1370 | - $sidebars_widgets = wp_get_sidebars_widgets(); |
|
1371 | - |
|
1372 | - if (is_array($sidebars_widgets)) { |
|
1373 | - $geodir_old_sidebars = get_option('geodir_sidebars'); |
|
1374 | - if (is_array($geodir_old_sidebars)) { |
|
1375 | - foreach ($geodir_old_sidebars as $key => $val) { |
|
1376 | - //if(array_key_exists($key, $sidebars_widgets)) |
|
1377 | - { |
|
1378 | - $sidebars_widgets[$key] = $geodir_old_sidebars[$key]; |
|
1379 | - } |
|
1367 | + global $sidebars_widgets; |
|
1380 | 1368 | |
1369 | + if (!is_array($sidebars_widgets)) |
|
1370 | + $sidebars_widgets = wp_get_sidebars_widgets(); |
|
1381 | 1371 | |
1382 | - } |
|
1383 | - } |
|
1372 | + if (is_array($sidebars_widgets)) { |
|
1373 | + $geodir_old_sidebars = get_option('geodir_sidebars'); |
|
1374 | + if (is_array($geodir_old_sidebars)) { |
|
1375 | + foreach ($geodir_old_sidebars as $key => $val) { |
|
1376 | + //if(array_key_exists($key, $sidebars_widgets)) |
|
1377 | + { |
|
1378 | + $sidebars_widgets[$key] = $geodir_old_sidebars[$key]; |
|
1379 | + } |
|
1384 | 1380 | |
1385 | - // now clear all non geodiretory sidebars |
|
1386 | - foreach ($sidebars_widgets as $key => $val) { |
|
1387 | - if (!array_key_exists($key, $geodir_old_sidebars)) { |
|
1388 | - $sidebars_widgets[$key] = array(); |
|
1389 | - } |
|
1390 | - } |
|
1391 | - } |
|
1392 | 1381 | |
1393 | - update_option('sidebars_widgets', $sidebars_widgets); |
|
1394 | - update_option('geodir_sidebars', ''); |
|
1382 | + } |
|
1383 | + } |
|
1384 | + |
|
1385 | + // now clear all non geodiretory sidebars |
|
1386 | + foreach ($sidebars_widgets as $key => $val) { |
|
1387 | + if (!array_key_exists($key, $geodir_old_sidebars)) { |
|
1388 | + $sidebars_widgets[$key] = array(); |
|
1389 | + } |
|
1390 | + } |
|
1391 | + } |
|
1392 | + |
|
1393 | + update_option('sidebars_widgets', $sidebars_widgets); |
|
1394 | + update_option('geodir_sidebars', ''); |
|
1395 | 1395 | } |
1396 | 1396 | |
1397 | 1397 | add_action('geodir_after_listing_post_gridview', 'geodir_after_listing_post_gridview'); |
@@ -1404,9 +1404,9 @@ discard block |
||
1404 | 1404 | */ |
1405 | 1405 | function geodir_after_listing_post_gridview() |
1406 | 1406 | { |
1407 | - global $gridview_columns; |
|
1407 | + global $gridview_columns; |
|
1408 | 1408 | |
1409 | - $gridview_columns = ''; |
|
1409 | + $gridview_columns = ''; |
|
1410 | 1410 | |
1411 | 1411 | } |
1412 | 1412 | |
@@ -1434,11 +1434,11 @@ discard block |
||
1434 | 1434 | */ |
1435 | 1435 | function so_handle_038($url, $original_url, $_context) |
1436 | 1436 | { |
1437 | - if (strstr($url, "maps.google.com/maps/api/js") !== false) { |
|
1438 | - $url = str_replace("&", "&", $url); // or $url = $original_url |
|
1439 | - } |
|
1437 | + if (strstr($url, "maps.google.com/maps/api/js") !== false) { |
|
1438 | + $url = str_replace("&", "&", $url); // or $url = $original_url |
|
1439 | + } |
|
1440 | 1440 | |
1441 | - return $url; |
|
1441 | + return $url; |
|
1442 | 1442 | } |
1443 | 1443 | |
1444 | 1444 | |
@@ -1454,34 +1454,34 @@ discard block |
||
1454 | 1454 | function geodir_after_main_form_fields() { |
1455 | 1455 | global $gd_session; |
1456 | 1456 | |
1457 | - if (get_option('geodir_accept_term_condition')) { |
|
1458 | - global $post; |
|
1459 | - $term_condition = ''; |
|
1460 | - if (isset($_REQUEST['backandedit'])) { |
|
1461 | - $post = (object)$gd_session->get('listing'); |
|
1462 | - $term_condition = isset($post->geodir_accept_term_condition) ? $post->geodir_accept_term_condition : ''; |
|
1463 | - } |
|
1464 | - |
|
1465 | - ?> |
|
1457 | + if (get_option('geodir_accept_term_condition')) { |
|
1458 | + global $post; |
|
1459 | + $term_condition = ''; |
|
1460 | + if (isset($_REQUEST['backandedit'])) { |
|
1461 | + $post = (object)$gd_session->get('listing'); |
|
1462 | + $term_condition = isset($post->geodir_accept_term_condition) ? $post->geodir_accept_term_condition : ''; |
|
1463 | + } |
|
1464 | + |
|
1465 | + ?> |
|
1466 | 1466 | <div id="geodir_accept_term_condition_row" class="required_field geodir_form_row clearfix"> |
1467 | 1467 | <label> </label> |
1468 | 1468 | |
1469 | 1469 | <div class="geodir_taxonomy_field" style="float:left; width:70%;"> |
1470 | 1470 | <span style="display:block"> |
1471 | 1471 | <input class="main_list_selecter" type="checkbox" <?php if ($term_condition == '1') { |
1472 | - echo 'checked="checked"'; |
|
1473 | - } ?> field_type="checkbox" name="geodir_accept_term_condition" id="geodir_accept_term_condition" |
|
1472 | + echo 'checked="checked"'; |
|
1473 | + } ?> field_type="checkbox" name="geodir_accept_term_condition" id="geodir_accept_term_condition" |
|
1474 | 1474 | class="geodir_textfield" value="1" |
1475 | 1475 | 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> |
1476 | 1476 | </span> |
1477 | 1477 | </div> |
1478 | 1478 | <span class="geodir_message_error"><?php if (isset($required_msg)) { |
1479 | - _e($required_msg, 'geodirectory'); |
|
1480 | - } ?></span> |
|
1479 | + _e($required_msg, 'geodirectory'); |
|
1480 | + } ?></span> |
|
1481 | 1481 | </div> |
1482 | 1482 | <?php |
1483 | 1483 | |
1484 | - } |
|
1484 | + } |
|
1485 | 1485 | } |
1486 | 1486 | |
1487 | 1487 | |
@@ -1506,42 +1506,42 @@ discard block |
||
1506 | 1506 | */ |
1507 | 1507 | function geodir_detail_page_tab_is_display($is_display, $tab) |
1508 | 1508 | { |
1509 | - global $post, $post_images, $video, $special_offers, $related_listing, $geodir_post_detail_fields; |
|
1509 | + global $post, $post_images, $video, $special_offers, $related_listing, $geodir_post_detail_fields; |
|
1510 | 1510 | |
1511 | - if ($tab == 'post_profile') { |
|
1512 | - /** This action is documented in geodirectory_template_actions.php */ |
|
1513 | - $desc_limit = apply_filters('geodir_description_field_desc_limit', ''); |
|
1511 | + if ($tab == 'post_profile') { |
|
1512 | + /** This action is documented in geodirectory_template_actions.php */ |
|
1513 | + $desc_limit = apply_filters('geodir_description_field_desc_limit', ''); |
|
1514 | 1514 | |
1515 | - if (!($desc_limit === '' || (int)$desc_limit > 0)) { |
|
1516 | - $is_display = false; |
|
1517 | - } |
|
1518 | - } |
|
1515 | + if (!($desc_limit === '' || (int)$desc_limit > 0)) { |
|
1516 | + $is_display = false; |
|
1517 | + } |
|
1518 | + } |
|
1519 | 1519 | |
1520 | - if ($tab == 'post_info') |
|
1521 | - $is_display = (!empty($geodir_post_detail_fields)) ? true : false; |
|
1520 | + if ($tab == 'post_info') |
|
1521 | + $is_display = (!empty($geodir_post_detail_fields)) ? true : false; |
|
1522 | 1522 | |
1523 | - if ($tab == 'post_images') |
|
1524 | - $is_display = (!empty($post_images)) ? true : false; |
|
1523 | + if ($tab == 'post_images') |
|
1524 | + $is_display = (!empty($post_images)) ? true : false; |
|
1525 | 1525 | |
1526 | - if ($tab == 'post_video') |
|
1527 | - $is_display = (!empty($video)) ? true : false; |
|
1526 | + if ($tab == 'post_video') |
|
1527 | + $is_display = (!empty($video)) ? true : false; |
|
1528 | 1528 | |
1529 | - if ($tab == 'special_offers') |
|
1530 | - $is_display = (!empty($special_offers)) ? true : false; |
|
1529 | + if ($tab == 'special_offers') |
|
1530 | + $is_display = (!empty($special_offers)) ? true : false; |
|
1531 | 1531 | |
1532 | - if ($tab == 'reviews') |
|
1533 | - $is_display = (geodir_is_page('detail')) ? true : false; |
|
1532 | + if ($tab == 'reviews') |
|
1533 | + $is_display = (geodir_is_page('detail')) ? true : false; |
|
1534 | 1534 | |
1535 | - if ($tab == 'related_listing') { |
|
1536 | - $message = __('No listings found which match your selection.', 'geodirectory'); |
|
1535 | + if ($tab == 'related_listing') { |
|
1536 | + $message = __('No listings found which match your selection.', 'geodirectory'); |
|
1537 | 1537 | |
1538 | - /** This action is documented in geodirectory-functions/template_functions.php */ |
|
1539 | - $message = apply_filters('geodir_message_listing_not_found', $message, 'listing-listview', false); |
|
1538 | + /** This action is documented in geodirectory-functions/template_functions.php */ |
|
1539 | + $message = apply_filters('geodir_message_listing_not_found', $message, 'listing-listview', false); |
|
1540 | 1540 | |
1541 | - $is_display = ((strpos($related_listing, $message) !== false || $related_listing == '' || !geodir_is_page('detail'))) ? false : true; |
|
1542 | - } |
|
1541 | + $is_display = ((strpos($related_listing, $message) !== false || $related_listing == '' || !geodir_is_page('detail'))) ? false : true; |
|
1542 | + } |
|
1543 | 1543 | |
1544 | - return $is_display; |
|
1544 | + return $is_display; |
|
1545 | 1545 | } |
1546 | 1546 | |
1547 | 1547 | |
@@ -1557,17 +1557,17 @@ discard block |
||
1557 | 1557 | * @global string $plugin_prefix Geodirectory plugin table prefix. |
1558 | 1558 | */ |
1559 | 1559 | function geodir_changes_in_custom_fields_table() { |
1560 | - global $wpdb, $plugin_prefix; |
|
1560 | + global $wpdb, $plugin_prefix; |
|
1561 | 1561 | |
1562 | 1562 | // Remove unused virtual page |
1563 | 1563 | $listings_page_id = (int)get_option('geodir_listing_page'); |
1564 | 1564 | if ($listings_page_id) { |
1565 | 1565 | $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'))); |
1566 | - delete_option('geodir_listing_page'); |
|
1566 | + delete_option('geodir_listing_page'); |
|
1567 | 1567 | } |
1568 | 1568 | |
1569 | - // updated custom field table(add field to show custom field as a tab) |
|
1570 | - /*if (!$wpdb->get_var("SHOW COLUMNS FROM ".GEODIR_CUSTOM_FIELDS_TABLE." WHERE field = 'show_as_tab'")) { |
|
1569 | + // updated custom field table(add field to show custom field as a tab) |
|
1570 | + /*if (!$wpdb->get_var("SHOW COLUMNS FROM ".GEODIR_CUSTOM_FIELDS_TABLE." WHERE field = 'show_as_tab'")) { |
|
1571 | 1571 | $wpdb->query("ALTER TABLE `".GEODIR_CUSTOM_FIELDS_TABLE."` ADD `show_as_tab` ENUM( '0', '1' ) NOT NULL DEFAULT '0' AFTER `show_on_detail`"); |
1572 | 1572 | } |
1573 | 1573 | |
@@ -1575,66 +1575,66 @@ discard block |
||
1575 | 1575 | $wpdb->query("ALTER TABLE `".GEODIR_CUSTOM_FIELDS_TABLE."` ADD `for_admin_use` ENUM( '0', '1' ) NOT NULL DEFAULT '0'"); |
1576 | 1576 | }*/ |
1577 | 1577 | |
1578 | - if (!get_option('geodir_changes_in_custom_fields_table')) { |
|
1578 | + if (!get_option('geodir_changes_in_custom_fields_table')) { |
|
1579 | 1579 | |
1580 | - $post_types = geodir_get_posttypes(); |
|
1580 | + $post_types = geodir_get_posttypes(); |
|
1581 | 1581 | |
1582 | - /*if(!$wpdb->get_var("SHOW COLUMNS FROM ".GEODIR_CUSTOM_FIELDS_TABLE." WHERE field = 'is_admin'")) |
|
1582 | + /*if(!$wpdb->get_var("SHOW COLUMNS FROM ".GEODIR_CUSTOM_FIELDS_TABLE." WHERE field = 'is_admin'")) |
|
1583 | 1583 | $wpdb->query("ALTER TABLE `".GEODIR_CUSTOM_FIELDS_TABLE."` ADD `is_admin` ENUM( '0', '1' ) NOT NULL DEFAULT '0' AFTER `is_default`");*/ |
1584 | 1584 | |
1585 | - $wpdb->query( |
|
1586 | - $wpdb->prepare( |
|
1587 | - "UPDATE " . GEODIR_CUSTOM_FIELDS_TABLE . " SET is_default=%s, is_admin=%s WHERE is_default=%s", |
|
1588 | - array('1', '1', 'admin') |
|
1589 | - ) |
|
1590 | - ); |
|
1585 | + $wpdb->query( |
|
1586 | + $wpdb->prepare( |
|
1587 | + "UPDATE " . GEODIR_CUSTOM_FIELDS_TABLE . " SET is_default=%s, is_admin=%s WHERE is_default=%s", |
|
1588 | + array('1', '1', 'admin') |
|
1589 | + ) |
|
1590 | + ); |
|
1591 | 1591 | |
1592 | 1592 | |
1593 | - /* --- terms meta value set --- */ |
|
1593 | + /* --- terms meta value set --- */ |
|
1594 | 1594 | |
1595 | - update_option('geodir_default_marker_icon', geodir_plugin_url() . '/geodirectory-functions/map-functions/icons/pin.png'); |
|
1595 | + update_option('geodir_default_marker_icon', geodir_plugin_url() . '/geodirectory-functions/map-functions/icons/pin.png'); |
|
1596 | 1596 | |
1597 | - $options_data = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "options WHERE option_name LIKE %s", array('%tax_meta_%'))); |
|
1597 | + $options_data = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "options WHERE option_name LIKE %s", array('%tax_meta_%'))); |
|
1598 | 1598 | |
1599 | - if (!empty($options_data)) { |
|
1599 | + if (!empty($options_data)) { |
|
1600 | 1600 | |
1601 | - foreach ($options_data as $optobj) { |
|
1601 | + foreach ($options_data as $optobj) { |
|
1602 | 1602 | |
1603 | - $option_val = str_replace('tax_meta_', '', $optobj->option_name); |
|
1603 | + $option_val = str_replace('tax_meta_', '', $optobj->option_name); |
|
1604 | 1604 | |
1605 | - $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))); |
|
1605 | + $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))); |
|
1606 | 1606 | |
1607 | - if (!empty($taxonomies_data)) { |
|
1607 | + if (!empty($taxonomies_data)) { |
|
1608 | 1608 | |
1609 | - foreach ($taxonomies_data as $taxobj) { |
|
1609 | + foreach ($taxonomies_data as $taxobj) { |
|
1610 | 1610 | |
1611 | - $taxObject = get_taxonomy($taxobj->taxonomy); |
|
1612 | - $post_type = $taxObject->object_type[0]; |
|
1611 | + $taxObject = get_taxonomy($taxobj->taxonomy); |
|
1612 | + $post_type = $taxObject->object_type[0]; |
|
1613 | 1613 | |
1614 | - $opt_value = 'tax_meta_' . $post_type . '_' . $option_val; |
|
1614 | + $opt_value = 'tax_meta_' . $post_type . '_' . $option_val; |
|
1615 | 1615 | |
1616 | - $duplicate_data = $wpdb->get_var($wpdb->prepare("SELECT option_id FROM " . $wpdb->prefix . "options WHERE option_name=%s", array('tax_meta_' . $option_val))); |
|
1616 | + $duplicate_data = $wpdb->get_var($wpdb->prepare("SELECT option_id FROM " . $wpdb->prefix . "options WHERE option_name=%s", array('tax_meta_' . $option_val))); |
|
1617 | 1617 | |
1618 | - if ($duplicate_data) { |
|
1618 | + if ($duplicate_data) { |
|
1619 | 1619 | |
1620 | - $wpdb->query($wpdb->prepare("UPDATE " . $wpdb->prefix . "options SET option_name=%s WHERE option_id=%d", array($opt_value, $optobj->option_id))); |
|
1620 | + $wpdb->query($wpdb->prepare("UPDATE " . $wpdb->prefix . "options SET option_name=%s WHERE option_id=%d", array($opt_value, $optobj->option_id))); |
|
1621 | 1621 | |
1622 | - } else { |
|
1622 | + } else { |
|
1623 | 1623 | |
1624 | - $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))); |
|
1624 | + $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))); |
|
1625 | 1625 | |
1626 | - } |
|
1626 | + } |
|
1627 | 1627 | |
1628 | - } |
|
1628 | + } |
|
1629 | 1629 | |
1630 | - } |
|
1630 | + } |
|
1631 | 1631 | |
1632 | - } |
|
1633 | - } |
|
1632 | + } |
|
1633 | + } |
|
1634 | 1634 | |
1635 | - update_option('geodir_changes_in_custom_fields_table', '1'); |
|
1635 | + update_option('geodir_changes_in_custom_fields_table', '1'); |
|
1636 | 1636 | |
1637 | - } |
|
1637 | + } |
|
1638 | 1638 | |
1639 | 1639 | } |
1640 | 1640 | |
@@ -1653,24 +1653,24 @@ discard block |
||
1653 | 1653 | function geodir_location_slug_check($slug) |
1654 | 1654 | { |
1655 | 1655 | |
1656 | - global $wpdb, $table_prefix; |
|
1656 | + global $wpdb, $table_prefix; |
|
1657 | 1657 | |
1658 | - $slug_exists = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($slug))); |
|
1658 | + $slug_exists = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($slug))); |
|
1659 | 1659 | |
1660 | - if ($slug_exists) { |
|
1660 | + if ($slug_exists) { |
|
1661 | 1661 | |
1662 | - $suffix = 1; |
|
1663 | - do { |
|
1664 | - $alt_location_name = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix"; |
|
1665 | - $location_slug_check = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($alt_location_name))); |
|
1666 | - $suffix++; |
|
1667 | - } while ($location_slug_check && $suffix < 100); |
|
1662 | + $suffix = 1; |
|
1663 | + do { |
|
1664 | + $alt_location_name = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix"; |
|
1665 | + $location_slug_check = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($alt_location_name))); |
|
1666 | + $suffix++; |
|
1667 | + } while ($location_slug_check && $suffix < 100); |
|
1668 | 1668 | |
1669 | - $slug = $alt_location_name; |
|
1669 | + $slug = $alt_location_name; |
|
1670 | 1670 | |
1671 | - } |
|
1671 | + } |
|
1672 | 1672 | |
1673 | - return $slug; |
|
1673 | + return $slug; |
|
1674 | 1674 | |
1675 | 1675 | } |
1676 | 1676 | |
@@ -1695,42 +1695,42 @@ discard block |
||
1695 | 1695 | function geodir_update_term_slug($term_id, $tt_id, $taxonomy) |
1696 | 1696 | { |
1697 | 1697 | |
1698 | - global $wpdb, $plugin_prefix, $table_prefix; |
|
1698 | + global $wpdb, $plugin_prefix, $table_prefix; |
|
1699 | 1699 | |
1700 | - $tern_data = get_term_by('id', $term_id, $taxonomy); |
|
1700 | + $tern_data = get_term_by('id', $term_id, $taxonomy); |
|
1701 | 1701 | |
1702 | - $slug = $tern_data->slug; |
|
1702 | + $slug = $tern_data->slug; |
|
1703 | 1703 | |
1704 | - /** |
|
1705 | - * Filter if a term slug exists. |
|
1706 | - * |
|
1707 | - * @since 1.0.0 |
|
1708 | - * @package GeoDirectory |
|
1709 | - * @param bool $bool Default: false. |
|
1710 | - * @param string $slug The term slug. |
|
1711 | - * @param int $term_id The term ID. |
|
1712 | - */ |
|
1713 | - $slug_exists = apply_filters('geodir_term_slug_is_exists', false, $slug, $term_id); |
|
1704 | + /** |
|
1705 | + * Filter if a term slug exists. |
|
1706 | + * |
|
1707 | + * @since 1.0.0 |
|
1708 | + * @package GeoDirectory |
|
1709 | + * @param bool $bool Default: false. |
|
1710 | + * @param string $slug The term slug. |
|
1711 | + * @param int $term_id The term ID. |
|
1712 | + */ |
|
1713 | + $slug_exists = apply_filters('geodir_term_slug_is_exists', false, $slug, $term_id); |
|
1714 | 1714 | |
1715 | - if ($slug_exists) { |
|
1715 | + if ($slug_exists) { |
|
1716 | 1716 | |
1717 | - $suffix = 1; |
|
1718 | - do { |
|
1719 | - $new_slug = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix"; |
|
1717 | + $suffix = 1; |
|
1718 | + do { |
|
1719 | + $new_slug = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix"; |
|
1720 | 1720 | |
1721 | - /** This action is documented in geodirectory_hooks_actions.php */ |
|
1722 | - $term_slug_check = apply_filters('geodir_term_slug_is_exists', false, $new_slug, $term_id); |
|
1721 | + /** This action is documented in geodirectory_hooks_actions.php */ |
|
1722 | + $term_slug_check = apply_filters('geodir_term_slug_is_exists', false, $new_slug, $term_id); |
|
1723 | 1723 | |
1724 | - $suffix++; |
|
1725 | - } while ($term_slug_check && $suffix < 100); |
|
1724 | + $suffix++; |
|
1725 | + } while ($term_slug_check && $suffix < 100); |
|
1726 | 1726 | |
1727 | - $slug = $new_slug; |
|
1727 | + $slug = $new_slug; |
|
1728 | 1728 | |
1729 | - //wp_update_term( $term_id, $taxonomy, array('slug' => $slug) ); |
|
1729 | + //wp_update_term( $term_id, $taxonomy, array('slug' => $slug) ); |
|
1730 | 1730 | |
1731 | - $wpdb->query($wpdb->prepare("UPDATE " . $table_prefix . "terms SET slug=%s WHERE term_id=%d", array($slug, $term_id))); |
|
1731 | + $wpdb->query($wpdb->prepare("UPDATE " . $table_prefix . "terms SET slug=%s WHERE term_id=%d", array($slug, $term_id))); |
|
1732 | 1732 | |
1733 | - } |
|
1733 | + } |
|
1734 | 1734 | |
1735 | 1735 | // Update tag in detail table. |
1736 | 1736 | $taxonomy_obj = get_taxonomy($taxonomy); |
@@ -1771,21 +1771,21 @@ discard block |
||
1771 | 1771 | function geodir_term_slug_is_exists($slug_exists, $slug, $term_id) |
1772 | 1772 | { |
1773 | 1773 | |
1774 | - global $wpdb, $table_prefix; |
|
1774 | + global $wpdb, $table_prefix; |
|
1775 | 1775 | |
1776 | - $default_location = geodir_get_default_location(); |
|
1776 | + $default_location = geodir_get_default_location(); |
|
1777 | 1777 | |
1778 | - $country_slug = $default_location->country_slug; |
|
1779 | - $region_slug = $default_location->region_slug; |
|
1780 | - $city_slug = $default_location->city_slug; |
|
1778 | + $country_slug = $default_location->country_slug; |
|
1779 | + $region_slug = $default_location->region_slug; |
|
1780 | + $city_slug = $default_location->city_slug; |
|
1781 | 1781 | |
1782 | - if ($country_slug == $slug || $region_slug == $slug || $city_slug == $slug) |
|
1783 | - return $slug_exists = true; |
|
1782 | + if ($country_slug == $slug || $region_slug == $slug || $city_slug == $slug) |
|
1783 | + return $slug_exists = true; |
|
1784 | 1784 | |
1785 | - if ($wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s AND term_id != %d", array($slug, $term_id)))) |
|
1786 | - return $slug_exists = true; |
|
1785 | + if ($wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s AND term_id != %d", array($slug, $term_id)))) |
|
1786 | + return $slug_exists = true; |
|
1787 | 1787 | |
1788 | - return $slug_exists; |
|
1788 | + return $slug_exists; |
|
1789 | 1789 | } |
1790 | 1790 | |
1791 | 1791 | |
@@ -1804,75 +1804,75 @@ discard block |
||
1804 | 1804 | */ |
1805 | 1805 | function geodir_custom_page_title($title = '', $sep = '') |
1806 | 1806 | { |
1807 | - global $wp; |
|
1808 | - if (class_exists('WPSEO_Frontend') || class_exists('All_in_One_SEO_Pack')) { |
|
1809 | - return $title; |
|
1810 | - } |
|
1807 | + global $wp; |
|
1808 | + if (class_exists('WPSEO_Frontend') || class_exists('All_in_One_SEO_Pack')) { |
|
1809 | + return $title; |
|
1810 | + } |
|
1811 | 1811 | |
1812 | - if ($sep == '') { |
|
1813 | - /** |
|
1814 | - * Filter the page title separator. |
|
1815 | - * |
|
1816 | - * @since 1.0.0 |
|
1817 | - * @package GeoDirectory |
|
1818 | - * @param string $sep The separator, default: `|`. |
|
1819 | - */ |
|
1820 | - $sep = apply_filters('geodir_page_title_separator', '|'); |
|
1821 | - } |
|
1812 | + if ($sep == '') { |
|
1813 | + /** |
|
1814 | + * Filter the page title separator. |
|
1815 | + * |
|
1816 | + * @since 1.0.0 |
|
1817 | + * @package GeoDirectory |
|
1818 | + * @param string $sep The separator, default: `|`. |
|
1819 | + */ |
|
1820 | + $sep = apply_filters('geodir_page_title_separator', '|'); |
|
1821 | + } |
|
1822 | 1822 | |
1823 | 1823 | |
1824 | - $gd_page = ''; |
|
1825 | - if(geodir_is_page('home')){ |
|
1826 | - $gd_page = 'home'; |
|
1827 | - $title = (get_option('geodir_meta_title_homepage')) ? get_option('geodir_meta_title_homepage') : $title; |
|
1828 | - } |
|
1829 | - elseif(geodir_is_page('detail')){ |
|
1830 | - $gd_page = 'detail'; |
|
1831 | - $title = (get_option('geodir_meta_title_detail')) ? get_option('geodir_meta_title_detail') : $title; |
|
1832 | - } |
|
1833 | - elseif(geodir_is_page('pt')){ |
|
1834 | - $gd_page = 'pt'; |
|
1835 | - $title = (get_option('geodir_meta_title_pt')) ? get_option('geodir_meta_title_pt') : $title; |
|
1836 | - } |
|
1837 | - elseif(geodir_is_page('listing')){ |
|
1838 | - $gd_page = 'listing'; |
|
1839 | - $title = (get_option('geodir_meta_title_listing')) ? get_option('geodir_meta_title_listing') : $title; |
|
1840 | - } |
|
1841 | - elseif(geodir_is_page('location')){ |
|
1842 | - $gd_page = 'location'; |
|
1843 | - $title = (get_option('geodir_meta_title_location')) ? get_option('geodir_meta_title_location') : $title; |
|
1844 | - } |
|
1845 | - elseif(geodir_is_page('search')){ |
|
1846 | - $gd_page = 'search'; |
|
1847 | - $title = (get_option('geodir_meta_title_search')) ? get_option('geodir_meta_title_search') : $title; |
|
1848 | - } |
|
1849 | - elseif(geodir_is_page('add-listing')){ |
|
1850 | - $gd_page = 'add-listing'; |
|
1851 | - $title = (get_option('geodir_meta_title_add-listing')) ? get_option('geodir_meta_title_add-listing') : $title; |
|
1852 | - } |
|
1853 | - elseif(geodir_is_page('author')){ |
|
1854 | - $gd_page = 'author'; |
|
1855 | - $title = (get_option('geodir_meta_title_author')) ? get_option('geodir_meta_title_author') : $title; |
|
1856 | - } |
|
1857 | - elseif(geodir_is_page('login')){ |
|
1858 | - $gd_page = 'login'; |
|
1859 | - $title = (get_option('geodir_meta_title_login')) ? get_option('geodir_meta_title_login') : $title; |
|
1860 | - } |
|
1861 | - elseif(geodir_is_page('listing-success')){ |
|
1862 | - $gd_page = 'listing-success'; |
|
1863 | - $title = (get_option('geodir_meta_title_listing-success')) ? get_option('geodir_meta_title_listing-success') : $title; |
|
1864 | - } |
|
1824 | + $gd_page = ''; |
|
1825 | + if(geodir_is_page('home')){ |
|
1826 | + $gd_page = 'home'; |
|
1827 | + $title = (get_option('geodir_meta_title_homepage')) ? get_option('geodir_meta_title_homepage') : $title; |
|
1828 | + } |
|
1829 | + elseif(geodir_is_page('detail')){ |
|
1830 | + $gd_page = 'detail'; |
|
1831 | + $title = (get_option('geodir_meta_title_detail')) ? get_option('geodir_meta_title_detail') : $title; |
|
1832 | + } |
|
1833 | + elseif(geodir_is_page('pt')){ |
|
1834 | + $gd_page = 'pt'; |
|
1835 | + $title = (get_option('geodir_meta_title_pt')) ? get_option('geodir_meta_title_pt') : $title; |
|
1836 | + } |
|
1837 | + elseif(geodir_is_page('listing')){ |
|
1838 | + $gd_page = 'listing'; |
|
1839 | + $title = (get_option('geodir_meta_title_listing')) ? get_option('geodir_meta_title_listing') : $title; |
|
1840 | + } |
|
1841 | + elseif(geodir_is_page('location')){ |
|
1842 | + $gd_page = 'location'; |
|
1843 | + $title = (get_option('geodir_meta_title_location')) ? get_option('geodir_meta_title_location') : $title; |
|
1844 | + } |
|
1845 | + elseif(geodir_is_page('search')){ |
|
1846 | + $gd_page = 'search'; |
|
1847 | + $title = (get_option('geodir_meta_title_search')) ? get_option('geodir_meta_title_search') : $title; |
|
1848 | + } |
|
1849 | + elseif(geodir_is_page('add-listing')){ |
|
1850 | + $gd_page = 'add-listing'; |
|
1851 | + $title = (get_option('geodir_meta_title_add-listing')) ? get_option('geodir_meta_title_add-listing') : $title; |
|
1852 | + } |
|
1853 | + elseif(geodir_is_page('author')){ |
|
1854 | + $gd_page = 'author'; |
|
1855 | + $title = (get_option('geodir_meta_title_author')) ? get_option('geodir_meta_title_author') : $title; |
|
1856 | + } |
|
1857 | + elseif(geodir_is_page('login')){ |
|
1858 | + $gd_page = 'login'; |
|
1859 | + $title = (get_option('geodir_meta_title_login')) ? get_option('geodir_meta_title_login') : $title; |
|
1860 | + } |
|
1861 | + elseif(geodir_is_page('listing-success')){ |
|
1862 | + $gd_page = 'listing-success'; |
|
1863 | + $title = (get_option('geodir_meta_title_listing-success')) ? get_option('geodir_meta_title_listing-success') : $title; |
|
1864 | + } |
|
1865 | 1865 | |
1866 | 1866 | |
1867 | - /** |
|
1868 | - * Filter page meta title to replace variables. |
|
1869 | - * |
|
1870 | - * @since 1.5.4 |
|
1871 | - * @param string $title The page title including variables. |
|
1872 | - * @param string $gd_page The GeoDirectory page type if any. |
|
1873 | - * @param string $sep The title separator symbol. |
|
1874 | - */ |
|
1875 | - return apply_filters('geodir_seo_meta_title', __($title, 'geodirectory'), $gd_page, $sep); |
|
1867 | + /** |
|
1868 | + * Filter page meta title to replace variables. |
|
1869 | + * |
|
1870 | + * @since 1.5.4 |
|
1871 | + * @param string $title The page title including variables. |
|
1872 | + * @param string $gd_page The GeoDirectory page type if any. |
|
1873 | + * @param string $sep The title separator symbol. |
|
1874 | + */ |
|
1875 | + return apply_filters('geodir_seo_meta_title', __($title, 'geodirectory'), $gd_page, $sep); |
|
1876 | 1876 | |
1877 | 1877 | } |
1878 | 1878 | |
@@ -1888,33 +1888,33 @@ discard block |
||
1888 | 1888 | function geodir_set_post_attachment() |
1889 | 1889 | { |
1890 | 1890 | |
1891 | - if (!get_option('geodir_set_post_attachments')) { |
|
1891 | + if (!get_option('geodir_set_post_attachments')) { |
|
1892 | 1892 | |
1893 | - require_once(ABSPATH . 'wp-admin/includes/image.php'); |
|
1894 | - require_once(ABSPATH . 'wp-admin/includes/file.php'); |
|
1893 | + require_once(ABSPATH . 'wp-admin/includes/image.php'); |
|
1894 | + require_once(ABSPATH . 'wp-admin/includes/file.php'); |
|
1895 | 1895 | |
1896 | - $all_postypes = geodir_get_posttypes(); |
|
1896 | + $all_postypes = geodir_get_posttypes(); |
|
1897 | 1897 | |
1898 | - $args = array( |
|
1899 | - 'posts_per_page' => -1, |
|
1900 | - 'post_type' => $all_postypes, |
|
1901 | - 'post_status' => 'publish'); |
|
1898 | + $args = array( |
|
1899 | + 'posts_per_page' => -1, |
|
1900 | + 'post_type' => $all_postypes, |
|
1901 | + 'post_status' => 'publish'); |
|
1902 | 1902 | |
1903 | - $posts_array = get_posts($args); |
|
1903 | + $posts_array = get_posts($args); |
|
1904 | 1904 | |
1905 | - if (!empty($posts_array)) { |
|
1905 | + if (!empty($posts_array)) { |
|
1906 | 1906 | |
1907 | - foreach ($posts_array as $post) { |
|
1907 | + foreach ($posts_array as $post) { |
|
1908 | 1908 | |
1909 | - geodir_set_wp_featured_image($post->ID); |
|
1909 | + geodir_set_wp_featured_image($post->ID); |
|
1910 | 1910 | |
1911 | - } |
|
1911 | + } |
|
1912 | 1912 | |
1913 | - } |
|
1913 | + } |
|
1914 | 1914 | |
1915 | - update_option('geodir_set_post_attachments', '1'); |
|
1915 | + update_option('geodir_set_post_attachments', '1'); |
|
1916 | 1916 | |
1917 | - } |
|
1917 | + } |
|
1918 | 1918 | |
1919 | 1919 | } |
1920 | 1920 | |
@@ -1931,19 +1931,19 @@ discard block |
||
1931 | 1931 | function geodir_remove_url_seperator() |
1932 | 1932 | { |
1933 | 1933 | |
1934 | - if (!get_option('geodir_remove_url_seperator')) { |
|
1934 | + if (!get_option('geodir_remove_url_seperator')) { |
|
1935 | 1935 | |
1936 | - if (get_option('geodir_listingurl_separator')) |
|
1937 | - delete_option('geodir_listingurl_separator'); |
|
1936 | + if (get_option('geodir_listingurl_separator')) |
|
1937 | + delete_option('geodir_listingurl_separator'); |
|
1938 | 1938 | |
1939 | - if (get_option('geodir_detailurl_separator')) |
|
1940 | - delete_option('geodir_detailurl_separator'); |
|
1939 | + if (get_option('geodir_detailurl_separator')) |
|
1940 | + delete_option('geodir_detailurl_separator'); |
|
1941 | 1941 | |
1942 | - flush_rewrite_rules(false); |
|
1942 | + flush_rewrite_rules(false); |
|
1943 | 1943 | |
1944 | - update_option('geodir_remove_url_seperator', '1'); |
|
1944 | + update_option('geodir_remove_url_seperator', '1'); |
|
1945 | 1945 | |
1946 | - } |
|
1946 | + } |
|
1947 | 1947 | |
1948 | 1948 | } |
1949 | 1949 | |
@@ -1959,39 +1959,39 @@ discard block |
||
1959 | 1959 | */ |
1960 | 1960 | function geodir_remove_url_seperator_form_permalink_settings($permalink_arr) |
1961 | 1961 | { |
1962 | - foreach ($permalink_arr as $key => $value) { |
|
1962 | + foreach ($permalink_arr as $key => $value) { |
|
1963 | 1963 | |
1964 | - if ($value['id'] == 'geodir_listingurl_separator' || $value['id'] == 'geodir_detailurl_separator') |
|
1965 | - unset($permalink_arr[$key]); |
|
1964 | + if ($value['id'] == 'geodir_listingurl_separator' || $value['id'] == 'geodir_detailurl_separator') |
|
1965 | + unset($permalink_arr[$key]); |
|
1966 | 1966 | |
1967 | - } |
|
1967 | + } |
|
1968 | 1968 | |
1969 | - return $permalink_arr; |
|
1969 | + return $permalink_arr; |
|
1970 | 1970 | |
1971 | 1971 | } |
1972 | 1972 | |
1973 | 1973 | if (!is_admin()) { |
1974 | - add_filter('posts_results', 'geodir_set_status_draft_to_publish_for_own_post'); |
|
1974 | + add_filter('posts_results', 'geodir_set_status_draft_to_publish_for_own_post'); |
|
1975 | 1975 | } |
1976 | 1976 | /** |
1977 | - * Set status from draft to publish. |
|
1978 | - * |
|
1979 | - * @since 1.0.0 |
|
1980 | - * @package GeoDirectory |
|
1981 | - * @global object $wp WordPress object. |
|
1982 | - * @param object $post Post object. |
|
1983 | - * @return object Modified post object. |
|
1984 | - */ |
|
1977 | + * Set status from draft to publish. |
|
1978 | + * |
|
1979 | + * @since 1.0.0 |
|
1980 | + * @package GeoDirectory |
|
1981 | + * @global object $wp WordPress object. |
|
1982 | + * @param object $post Post object. |
|
1983 | + * @return object Modified post object. |
|
1984 | + */ |
|
1985 | 1985 | function geodir_set_status_draft_to_publish_for_own_post($post) |
1986 | 1986 | { |
1987 | - global $wp; |
|
1988 | - $user_id = get_current_user_id(); |
|
1987 | + global $wp; |
|
1988 | + $user_id = get_current_user_id(); |
|
1989 | 1989 | |
1990 | - if (!empty($post) && $post[0]->post_author == $user_id) { |
|
1991 | - $post[0]->post_status = 'publish'; |
|
1992 | - } |
|
1993 | - //print_r($post) ; |
|
1994 | - return $post; |
|
1990 | + if (!empty($post) && $post[0]->post_author == $user_id) { |
|
1991 | + $post[0]->post_status = 'publish'; |
|
1992 | + } |
|
1993 | + //print_r($post) ; |
|
1994 | + return $post; |
|
1995 | 1995 | } |
1996 | 1996 | |
1997 | 1997 | |
@@ -2083,33 +2083,33 @@ discard block |
||
2083 | 2083 | */ |
2084 | 2084 | function geodir_detail_page_tab_headings_change($tabs_arr) |
2085 | 2085 | { |
2086 | - global $wpdb; |
|
2086 | + global $wpdb; |
|
2087 | 2087 | |
2088 | - $post_type = geodir_get_current_posttype(); |
|
2088 | + $post_type = geodir_get_current_posttype(); |
|
2089 | 2089 | |
2090 | - $all_postypes = geodir_get_posttypes(); |
|
2090 | + $all_postypes = geodir_get_posttypes(); |
|
2091 | 2091 | |
2092 | - if (!empty($tabs_arr) && $post_type != '' && in_array($post_type, $all_postypes)) { |
|
2092 | + if (!empty($tabs_arr) && $post_type != '' && in_array($post_type, $all_postypes)) { |
|
2093 | 2093 | |
2094 | - if (array_key_exists('post_video', $tabs_arr)) { |
|
2094 | + if (array_key_exists('post_video', $tabs_arr)) { |
|
2095 | 2095 | |
2096 | - $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))); |
|
2096 | + $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))); |
|
2097 | 2097 | |
2098 | - if (isset($tabs_arr['post_video']['heading_text']) && $field_title != '') |
|
2099 | - $tabs_arr['post_video']['heading_text'] = $field_title; |
|
2100 | - } |
|
2098 | + if (isset($tabs_arr['post_video']['heading_text']) && $field_title != '') |
|
2099 | + $tabs_arr['post_video']['heading_text'] = $field_title; |
|
2100 | + } |
|
2101 | 2101 | |
2102 | - if (array_key_exists('special_offers', $tabs_arr)) { |
|
2102 | + if (array_key_exists('special_offers', $tabs_arr)) { |
|
2103 | 2103 | |
2104 | - $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))); |
|
2104 | + $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))); |
|
2105 | 2105 | |
2106 | - if (isset($tabs_arr['special_offers']['heading_text']) && $field_title != '') |
|
2107 | - $tabs_arr['special_offers']['heading_text'] = $field_title; |
|
2108 | - } |
|
2106 | + if (isset($tabs_arr['special_offers']['heading_text']) && $field_title != '') |
|
2107 | + $tabs_arr['special_offers']['heading_text'] = $field_title; |
|
2108 | + } |
|
2109 | 2109 | |
2110 | - } |
|
2110 | + } |
|
2111 | 2111 | |
2112 | - return $tabs_arr; |
|
2112 | + return $tabs_arr; |
|
2113 | 2113 | |
2114 | 2114 | } |
2115 | 2115 | |
@@ -2122,10 +2122,10 @@ discard block |
||
2122 | 2122 | */ |
2123 | 2123 | function geodir_remove_template_redirect_actions() |
2124 | 2124 | { |
2125 | - if (geodir_is_page('login')){ |
|
2126 | - remove_all_actions('template_redirect'); |
|
2127 | - remove_action('init', 'avia_modify_front', 10); |
|
2128 | - } |
|
2125 | + if (geodir_is_page('login')){ |
|
2126 | + remove_all_actions('template_redirect'); |
|
2127 | + remove_action('init', 'avia_modify_front', 10); |
|
2128 | + } |
|
2129 | 2129 | } |
2130 | 2130 | |
2131 | 2131 | |
@@ -2147,51 +2147,51 @@ discard block |
||
2147 | 2147 | function geodirectory_before_featured_image_delete($attachment_id) |
2148 | 2148 | { |
2149 | 2149 | |
2150 | - global $wpdb, $plugin_prefix; |
|
2150 | + global $wpdb, $plugin_prefix; |
|
2151 | 2151 | |
2152 | - $post_id = get_post_field('post_parent', $attachment_id); |
|
2152 | + $post_id = get_post_field('post_parent', $attachment_id); |
|
2153 | 2153 | |
2154 | - $attachment_url = wp_get_attachment_url($attachment_id); |
|
2154 | + $attachment_url = wp_get_attachment_url($attachment_id); |
|
2155 | 2155 | |
2156 | - if ($post_id > 0 && (isset($_REQUEST['action']) && $_REQUEST['action'] == 'delete')) { |
|
2156 | + if ($post_id > 0 && (isset($_REQUEST['action']) && $_REQUEST['action'] == 'delete')) { |
|
2157 | 2157 | |
2158 | - $post_type = get_post_type($post_id); |
|
2158 | + $post_type = get_post_type($post_id); |
|
2159 | 2159 | |
2160 | - $all_postypes = geodir_get_posttypes(); |
|
2160 | + $all_postypes = geodir_get_posttypes(); |
|
2161 | 2161 | |
2162 | - if (!in_array($post_type, $all_postypes) || !is_admin()) |
|
2163 | - return false; |
|
2162 | + if (!in_array($post_type, $all_postypes) || !is_admin()) |
|
2163 | + return false; |
|
2164 | 2164 | |
2165 | - $uploads = wp_upload_dir(); |
|
2165 | + $uploads = wp_upload_dir(); |
|
2166 | 2166 | |
2167 | - $split_img_path = explode($uploads['baseurl'], $attachment_url); |
|
2167 | + $split_img_path = explode($uploads['baseurl'], $attachment_url); |
|
2168 | 2168 | |
2169 | - $split_img_file_path = isset($split_img_path[1]) ? $split_img_path[1] : ''; |
|
2169 | + $split_img_file_path = isset($split_img_path[1]) ? $split_img_path[1] : ''; |
|
2170 | 2170 | |
2171 | - $wpdb->query( |
|
2172 | - $wpdb->prepare("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id = %d AND file=%s ", |
|
2173 | - array($post_id, $split_img_file_path) |
|
2174 | - ) |
|
2175 | - ); |
|
2171 | + $wpdb->query( |
|
2172 | + $wpdb->prepare("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id = %d AND file=%s ", |
|
2173 | + array($post_id, $split_img_file_path) |
|
2174 | + ) |
|
2175 | + ); |
|
2176 | 2176 | |
2177 | - $attachment_data = $wpdb->get_row( |
|
2178 | - $wpdb->prepare("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=%d", |
|
2179 | - array($post_id) |
|
2180 | - ) |
|
2181 | - ); |
|
2177 | + $attachment_data = $wpdb->get_row( |
|
2178 | + $wpdb->prepare("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=%d", |
|
2179 | + array($post_id) |
|
2180 | + ) |
|
2181 | + ); |
|
2182 | 2182 | |
2183 | - if (!empty($attachment_data)) { |
|
2184 | - $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID); |
|
2185 | - } |
|
2183 | + if (!empty($attachment_data)) { |
|
2184 | + $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID); |
|
2185 | + } |
|
2186 | 2186 | |
2187 | 2187 | |
2188 | - $table_name = $plugin_prefix . $post_type . '_detail'; |
|
2188 | + $table_name = $plugin_prefix . $post_type . '_detail'; |
|
2189 | 2189 | |
2190 | - $wpdb->query("UPDATE " . $table_name . " SET featured_image='' WHERE post_id =" . $post_id); |
|
2190 | + $wpdb->query("UPDATE " . $table_name . " SET featured_image='' WHERE post_id =" . $post_id); |
|
2191 | 2191 | |
2192 | - geodir_set_wp_featured_image($post_id); |
|
2192 | + geodir_set_wp_featured_image($post_id); |
|
2193 | 2193 | |
2194 | - } |
|
2194 | + } |
|
2195 | 2195 | |
2196 | 2196 | } |
2197 | 2197 | |
@@ -2209,80 +2209,80 @@ discard block |
||
2209 | 2209 | function geodir_temp_set_post_attachment() |
2210 | 2210 | { |
2211 | 2211 | |
2212 | - global $wpdb, $plugin_prefix; |
|
2212 | + global $wpdb, $plugin_prefix; |
|
2213 | 2213 | |
2214 | - $all_postypes = geodir_get_posttypes(); |
|
2214 | + $all_postypes = geodir_get_posttypes(); |
|
2215 | 2215 | |
2216 | - foreach ($all_postypes as $posttype) { |
|
2216 | + foreach ($all_postypes as $posttype) { |
|
2217 | 2217 | |
2218 | - $tablename = $plugin_prefix . $posttype . '_detail'; |
|
2218 | + $tablename = $plugin_prefix . $posttype . '_detail'; |
|
2219 | 2219 | |
2220 | - $get_post_data = $wpdb->get_results("SELECT post_id FROM " . $tablename); |
|
2220 | + $get_post_data = $wpdb->get_results("SELECT post_id FROM " . $tablename); |
|
2221 | 2221 | |
2222 | - if (!empty($get_post_data)) { |
|
2222 | + if (!empty($get_post_data)) { |
|
2223 | 2223 | |
2224 | - foreach ($get_post_data as $data) { |
|
2224 | + foreach ($get_post_data as $data) { |
|
2225 | 2225 | |
2226 | - $post_id = $data->post_id; |
|
2226 | + $post_id = $data->post_id; |
|
2227 | 2227 | |
2228 | - $attachment_data = $wpdb->get_results("SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id =" . $post_id . " AND file!=''"); |
|
2228 | + $attachment_data = $wpdb->get_results("SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id =" . $post_id . " AND file!=''"); |
|
2229 | 2229 | |
2230 | - if (!empty($attachment_data)) { |
|
2230 | + if (!empty($attachment_data)) { |
|
2231 | 2231 | |
2232 | - foreach ($attachment_data as $attach) { |
|
2232 | + foreach ($attachment_data as $attach) { |
|
2233 | 2233 | |
2234 | - $file_info = pathinfo($attach->file); |
|
2234 | + $file_info = pathinfo($attach->file); |
|
2235 | 2235 | |
2236 | - $sub_dir = ''; |
|
2237 | - if ($file_info['dirname'] != '.' && $file_info['dirname'] != '..') |
|
2238 | - $sub_dir = stripslashes_deep($file_info['dirname']); |
|
2236 | + $sub_dir = ''; |
|
2237 | + if ($file_info['dirname'] != '.' && $file_info['dirname'] != '..') |
|
2238 | + $sub_dir = stripslashes_deep($file_info['dirname']); |
|
2239 | 2239 | |
2240 | - $uploads = wp_upload_dir(trim($sub_dir, '/')); // Array of key => value pairs |
|
2241 | - $uploads_baseurl = $uploads['baseurl']; |
|
2242 | - $uploads_path = $uploads['basedir']; |
|
2240 | + $uploads = wp_upload_dir(trim($sub_dir, '/')); // Array of key => value pairs |
|
2241 | + $uploads_baseurl = $uploads['baseurl']; |
|
2242 | + $uploads_path = $uploads['basedir']; |
|
2243 | 2243 | |
2244 | - $file_name = $file_info['basename']; |
|
2244 | + $file_name = $file_info['basename']; |
|
2245 | 2245 | |
2246 | - $img_arr['path'] = $uploads_path . $sub_dir . '/' . $file_name; |
|
2246 | + $img_arr['path'] = $uploads_path . $sub_dir . '/' . $file_name; |
|
2247 | 2247 | |
2248 | - if (!file_exists($img_arr['path'])) { |
|
2248 | + if (!file_exists($img_arr['path'])) { |
|
2249 | 2249 | |
2250 | - $wpdb->query("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE ID=" . $attach->ID); |
|
2250 | + $wpdb->query("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE ID=" . $attach->ID); |
|
2251 | 2251 | |
2252 | - } |
|
2252 | + } |
|
2253 | 2253 | |
2254 | - } |
|
2254 | + } |
|
2255 | 2255 | |
2256 | - $attachment_data = $wpdb->get_row("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=" . $post_id . " GROUP BY post_id"); |
|
2256 | + $attachment_data = $wpdb->get_row("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=" . $post_id . " GROUP BY post_id"); |
|
2257 | 2257 | |
2258 | - if (!empty($attachment_data)) { |
|
2258 | + if (!empty($attachment_data)) { |
|
2259 | 2259 | |
2260 | - if ($attachment_data->ID) |
|
2261 | - $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID); |
|
2260 | + if ($attachment_data->ID) |
|
2261 | + $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID); |
|
2262 | 2262 | |
2263 | - } else { |
|
2263 | + } else { |
|
2264 | 2264 | |
2265 | - if (has_post_thumbnail($post_id)) { |
|
2265 | + if (has_post_thumbnail($post_id)) { |
|
2266 | 2266 | |
2267 | - $post_thumbnail_id = get_post_thumbnail_id($post_id); |
|
2267 | + $post_thumbnail_id = get_post_thumbnail_id($post_id); |
|
2268 | 2268 | |
2269 | - wp_delete_attachment($post_thumbnail_id); |
|
2269 | + wp_delete_attachment($post_thumbnail_id); |
|
2270 | 2270 | |
2271 | - } |
|
2271 | + } |
|
2272 | 2272 | |
2273 | - } |
|
2273 | + } |
|
2274 | 2274 | |
2275 | - $wpdb->query("UPDATE " . $tablename . " SET featured_image='' WHERE post_id =" . $post_id); |
|
2275 | + $wpdb->query("UPDATE " . $tablename . " SET featured_image='' WHERE post_id =" . $post_id); |
|
2276 | 2276 | |
2277 | - geodir_set_wp_featured_image($post_id); |
|
2277 | + geodir_set_wp_featured_image($post_id); |
|
2278 | 2278 | |
2279 | - } |
|
2279 | + } |
|
2280 | 2280 | |
2281 | - } |
|
2281 | + } |
|
2282 | 2282 | |
2283 | - } |
|
2283 | + } |
|
2284 | 2284 | |
2285 | - } |
|
2285 | + } |
|
2286 | 2286 | |
2287 | 2287 | } |
2288 | 2288 | |
@@ -2300,9 +2300,9 @@ discard block |
||
2300 | 2300 | function geodir_default_rating_star_icon() |
2301 | 2301 | { |
2302 | 2302 | |
2303 | - if (!get_option('geodir_default_rating_star_icon')) { |
|
2304 | - update_option('geodir_default_rating_star_icon', geodir_plugin_url() . '/geodirectory-assets/images/stars.png'); |
|
2305 | - } |
|
2303 | + if (!get_option('geodir_default_rating_star_icon')) { |
|
2304 | + update_option('geodir_default_rating_star_icon', geodir_plugin_url() . '/geodirectory-assets/images/stars.png'); |
|
2305 | + } |
|
2306 | 2306 | |
2307 | 2307 | } |
2308 | 2308 | |
@@ -2320,24 +2320,24 @@ discard block |
||
2320 | 2320 | */ |
2321 | 2321 | function geodir_user_post_listing_count() |
2322 | 2322 | { |
2323 | - global $wpdb, $plugin_prefix, $current_user; |
|
2323 | + global $wpdb, $plugin_prefix, $current_user; |
|
2324 | 2324 | |
2325 | - $user_id = $current_user->ID; |
|
2326 | - $all_postypes = geodir_get_posttypes(); |
|
2327 | - $all_posts = get_option('geodir_listing_link_user_dashboard'); |
|
2325 | + $user_id = $current_user->ID; |
|
2326 | + $all_postypes = geodir_get_posttypes(); |
|
2327 | + $all_posts = get_option('geodir_listing_link_user_dashboard'); |
|
2328 | 2328 | |
2329 | - $user_listing = array(); |
|
2330 | - if (is_array($all_posts) && !empty($all_posts)) { |
|
2331 | - foreach ($all_posts as $ptype) { |
|
2332 | - $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' )"); |
|
2329 | + $user_listing = array(); |
|
2330 | + if (is_array($all_posts) && !empty($all_posts)) { |
|
2331 | + foreach ($all_posts as $ptype) { |
|
2332 | + $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' )"); |
|
2333 | 2333 | |
2334 | - if ($total_posts > 0) { |
|
2335 | - $user_listing[$ptype] = $total_posts; |
|
2336 | - } |
|
2337 | - } |
|
2338 | - } |
|
2334 | + if ($total_posts > 0) { |
|
2335 | + $user_listing[$ptype] = $total_posts; |
|
2336 | + } |
|
2337 | + } |
|
2338 | + } |
|
2339 | 2339 | |
2340 | - return $user_listing; |
|
2340 | + return $user_listing; |
|
2341 | 2341 | } |
2342 | 2342 | |
2343 | 2343 | |
@@ -2354,27 +2354,27 @@ discard block |
||
2354 | 2354 | */ |
2355 | 2355 | function geodir_user_favourite_listing_count() |
2356 | 2356 | { |
2357 | - global $wpdb, $plugin_prefix, $current_user; |
|
2357 | + global $wpdb, $plugin_prefix, $current_user; |
|
2358 | 2358 | |
2359 | - $user_id = $current_user->ID; |
|
2360 | - $all_postypes = geodir_get_posttypes(); |
|
2361 | - $user_favorites = get_user_meta($user_id, 'gd_user_favourite_post', true); |
|
2362 | - $all_posts = get_option('geodir_favorite_link_user_dashboard'); |
|
2359 | + $user_id = $current_user->ID; |
|
2360 | + $all_postypes = geodir_get_posttypes(); |
|
2361 | + $user_favorites = get_user_meta($user_id, 'gd_user_favourite_post', true); |
|
2362 | + $all_posts = get_option('geodir_favorite_link_user_dashboard'); |
|
2363 | 2363 | |
2364 | - $user_listing = array(); |
|
2365 | - if (is_array($all_posts) && !empty($all_posts) && is_array($user_favorites) && !empty($user_favorites)) { |
|
2366 | - $user_favorites = "'" . implode("','", $user_favorites) . "'"; |
|
2364 | + $user_listing = array(); |
|
2365 | + if (is_array($all_posts) && !empty($all_posts) && is_array($user_favorites) && !empty($user_favorites)) { |
|
2366 | + $user_favorites = "'" . implode("','", $user_favorites) . "'"; |
|
2367 | 2367 | |
2368 | - foreach ($all_posts as $ptype) { |
|
2369 | - $total_posts = $wpdb->get_var("SELECT count( ID ) FROM " . $wpdb->prefix . "posts WHERE post_type='" . $ptype . "' AND post_status = 'publish' AND ID IN (" . $user_favorites . ")"); |
|
2368 | + foreach ($all_posts as $ptype) { |
|
2369 | + $total_posts = $wpdb->get_var("SELECT count( ID ) FROM " . $wpdb->prefix . "posts WHERE post_type='" . $ptype . "' AND post_status = 'publish' AND ID IN (" . $user_favorites . ")"); |
|
2370 | 2370 | |
2371 | - if ($total_posts > 0) { |
|
2372 | - $user_listing[$ptype] = $total_posts; |
|
2373 | - } |
|
2374 | - } |
|
2375 | - } |
|
2371 | + if ($total_posts > 0) { |
|
2372 | + $user_listing[$ptype] = $total_posts; |
|
2373 | + } |
|
2374 | + } |
|
2375 | + } |
|
2376 | 2376 | |
2377 | - return $user_listing; |
|
2377 | + return $user_listing; |
|
2378 | 2378 | } |
2379 | 2379 | |
2380 | 2380 | add_filter('geodir_detail_page_tab_list_extend', 'geodir_detail_page_custom_field_tab'); |
@@ -2391,584 +2391,584 @@ discard block |
||
2391 | 2391 | */ |
2392 | 2392 | function geodir_detail_page_custom_field_tab($tabs_arr) |
2393 | 2393 | { |
2394 | - global $post; |
|
2395 | - |
|
2396 | - $post_type = geodir_get_current_posttype(); |
|
2397 | - $all_postypes = geodir_get_posttypes(); |
|
2398 | - |
|
2399 | - if (!empty($tabs_arr) && $post_type != '' && in_array($post_type, $all_postypes) && (geodir_is_page('detail') || geodir_is_page('preview'))) { |
|
2400 | - $package_info = array(); |
|
2401 | - $package_info = geodir_post_package_info($package_info, $post); |
|
2402 | - $post_package_id = $package_info->pid; |
|
2403 | - $fields_location = 'detail'; |
|
2404 | - |
|
2405 | - $custom_fields = geodir_post_custom_fields($post_package_id, 'default', $post_type, $fields_location); |
|
2406 | - if (!empty($custom_fields)) { |
|
2407 | - $parse_custom_fields = array(); |
|
2408 | - foreach ($custom_fields as $field) { |
|
2409 | - $field = stripslashes_deep($field); // strip slashes |
|
2394 | + global $post; |
|
2395 | + |
|
2396 | + $post_type = geodir_get_current_posttype(); |
|
2397 | + $all_postypes = geodir_get_posttypes(); |
|
2398 | + |
|
2399 | + if (!empty($tabs_arr) && $post_type != '' && in_array($post_type, $all_postypes) && (geodir_is_page('detail') || geodir_is_page('preview'))) { |
|
2400 | + $package_info = array(); |
|
2401 | + $package_info = geodir_post_package_info($package_info, $post); |
|
2402 | + $post_package_id = $package_info->pid; |
|
2403 | + $fields_location = 'detail'; |
|
2404 | + |
|
2405 | + $custom_fields = geodir_post_custom_fields($post_package_id, 'default', $post_type, $fields_location); |
|
2406 | + if (!empty($custom_fields)) { |
|
2407 | + $parse_custom_fields = array(); |
|
2408 | + foreach ($custom_fields as $field) { |
|
2409 | + $field = stripslashes_deep($field); // strip slashes |
|
2410 | 2410 | |
2411 | - $type = $field; |
|
2412 | - $field_name = $field['htmlvar_name']; |
|
2413 | - if (empty($geodir_post_info) && geodir_is_page('preview') && $field_name != '' && !isset($post->$field_name) && isset($_REQUEST[$field_name])) { |
|
2414 | - $post->$field_name = $_REQUEST[$field_name]; |
|
2415 | - } |
|
2416 | - |
|
2417 | - if (isset($field['show_as_tab']) && $field['show_as_tab'] == 1 && ((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'))) { |
|
2418 | - if ($type['type'] == 'datepicker' && ($post->$type['htmlvar_name'] == '' || $post->$type['htmlvar_name'] == '0000-00-00')) { |
|
2419 | - continue; |
|
2420 | - } |
|
2421 | - |
|
2422 | - $parse_custom_fields[] = $field; |
|
2423 | - } |
|
2424 | - } |
|
2425 | - $custom_fields = $parse_custom_fields; |
|
2426 | - } |
|
2427 | - |
|
2428 | - if (!empty($custom_fields)) { |
|
2429 | - $field_set_start = 0; |
|
2430 | - $fieldset_count = 0; |
|
2431 | - $fieldset = ''; |
|
2432 | - $total_fields = count($custom_fields); |
|
2433 | - $count_field = 0; |
|
2434 | - $fieldset_arr = array(); |
|
2435 | - $i = 0; |
|
2436 | - $geodir_post_info = isset($post->ID) && !empty($post->ID) ? geodir_get_post_info($post->ID) : NULL; |
|
2437 | - |
|
2438 | - foreach ($custom_fields as $field) { |
|
2439 | - $count_field++; |
|
2440 | - $field_name = $field['htmlvar_name']; |
|
2441 | - if (empty($geodir_post_info) && geodir_is_page('preview') && $field_name != '' && !isset($post->$field_name) && isset($_REQUEST[$field_name])) { |
|
2442 | - $post->$field_name = $_REQUEST[$field_name]; |
|
2443 | - } |
|
2444 | - |
|
2445 | - if (isset($field['show_as_tab']) && $field['show_as_tab'] == 1 && ((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'))) { |
|
2446 | - $label = $field['site_title'] != '' ? $field['site_title'] : $field['admin_title']; |
|
2447 | - $site_title = trim($field['site_title']); |
|
2448 | - $type = $field; |
|
2449 | - $html = ''; |
|
2450 | - $html_var = $field_name; |
|
2451 | - $field_icon = ''; |
|
2452 | - $variables_array = array(); |
|
2453 | - |
|
2454 | - if ($type['type'] == 'datepicker' && ($post->$type['htmlvar_name'] == '' || $post->$type['htmlvar_name'] == '0000-00-00')) { |
|
2455 | - continue; |
|
2456 | - } |
|
2457 | - |
|
2458 | - if ($type['type'] != 'fieldset') { |
|
2459 | - $i++; |
|
2460 | - $variables_array['post_id'] = $post->ID; |
|
2461 | - $variables_array['label'] = __($type['site_title'], 'geodirectory'); |
|
2462 | - $variables_array['value'] = ''; |
|
2463 | - $variables_array['value'] = $post->$type['htmlvar_name']; |
|
2464 | - } |
|
2465 | - |
|
2466 | - if (strpos($type['field_icon'], 'http') !== false) { |
|
2467 | - $field_icon = ' background: url(' . $type['field_icon'] . ') no-repeat left center;background-size:18px 18px;padding-left: 21px;'; |
|
2468 | - } elseif (strpos($type['field_icon'], 'fa fa-') !== false) { |
|
2469 | - $field_icon = '<i class="' . $type['field_icon'] . '"></i>'; |
|
2470 | - } |
|
2411 | + $type = $field; |
|
2412 | + $field_name = $field['htmlvar_name']; |
|
2413 | + if (empty($geodir_post_info) && geodir_is_page('preview') && $field_name != '' && !isset($post->$field_name) && isset($_REQUEST[$field_name])) { |
|
2414 | + $post->$field_name = $_REQUEST[$field_name]; |
|
2415 | + } |
|
2416 | + |
|
2417 | + if (isset($field['show_as_tab']) && $field['show_as_tab'] == 1 && ((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'))) { |
|
2418 | + if ($type['type'] == 'datepicker' && ($post->$type['htmlvar_name'] == '' || $post->$type['htmlvar_name'] == '0000-00-00')) { |
|
2419 | + continue; |
|
2420 | + } |
|
2421 | + |
|
2422 | + $parse_custom_fields[] = $field; |
|
2423 | + } |
|
2424 | + } |
|
2425 | + $custom_fields = $parse_custom_fields; |
|
2426 | + } |
|
2471 | 2427 | |
2472 | - switch ($type['type']) { |
|
2473 | - case 'fieldset': { |
|
2474 | - $i = 0; |
|
2475 | - $fieldset_count++; |
|
2476 | - $field_set_start = 1; |
|
2477 | - $fieldset_arr[$fieldset_count]['htmlvar_name'] = 'gd_tab_' . $fieldset_count; |
|
2478 | - $fieldset_arr[$fieldset_count]['label'] = $label; |
|
2479 | - } |
|
2480 | - break; |
|
2481 | - case 'url': { |
|
2482 | - if (strpos($field_icon, 'http') !== false) { |
|
2483 | - $field_icon_af = ''; |
|
2484 | - } elseif ($field_icon == '') { |
|
2485 | - |
|
2486 | - if ($type['name'] == 'geodir_facebook') { |
|
2487 | - $field_icon_af = '<i class="fa fa-facebook-square"></i>'; |
|
2488 | - } elseif ($type['name'] == 'geodir_twitter') { |
|
2489 | - $field_icon_af = '<i class="fa fa-twitter-square"></i>'; |
|
2490 | - } else { |
|
2491 | - $field_icon_af = '<i class="fa fa-link"></i>'; |
|
2492 | - } |
|
2493 | - |
|
2494 | - } else { |
|
2495 | - $field_icon_af = $field_icon; |
|
2496 | - $field_icon = ''; |
|
2497 | - } |
|
2428 | + if (!empty($custom_fields)) { |
|
2429 | + $field_set_start = 0; |
|
2430 | + $fieldset_count = 0; |
|
2431 | + $fieldset = ''; |
|
2432 | + $total_fields = count($custom_fields); |
|
2433 | + $count_field = 0; |
|
2434 | + $fieldset_arr = array(); |
|
2435 | + $i = 0; |
|
2436 | + $geodir_post_info = isset($post->ID) && !empty($post->ID) ? geodir_get_post_info($post->ID) : NULL; |
|
2437 | + |
|
2438 | + foreach ($custom_fields as $field) { |
|
2439 | + $count_field++; |
|
2440 | + $field_name = $field['htmlvar_name']; |
|
2441 | + if (empty($geodir_post_info) && geodir_is_page('preview') && $field_name != '' && !isset($post->$field_name) && isset($_REQUEST[$field_name])) { |
|
2442 | + $post->$field_name = $_REQUEST[$field_name]; |
|
2443 | + } |
|
2444 | + |
|
2445 | + if (isset($field['show_as_tab']) && $field['show_as_tab'] == 1 && ((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'))) { |
|
2446 | + $label = $field['site_title'] != '' ? $field['site_title'] : $field['admin_title']; |
|
2447 | + $site_title = trim($field['site_title']); |
|
2448 | + $type = $field; |
|
2449 | + $html = ''; |
|
2450 | + $html_var = $field_name; |
|
2451 | + $field_icon = ''; |
|
2452 | + $variables_array = array(); |
|
2453 | + |
|
2454 | + if ($type['type'] == 'datepicker' && ($post->$type['htmlvar_name'] == '' || $post->$type['htmlvar_name'] == '0000-00-00')) { |
|
2455 | + continue; |
|
2456 | + } |
|
2457 | + |
|
2458 | + if ($type['type'] != 'fieldset') { |
|
2459 | + $i++; |
|
2460 | + $variables_array['post_id'] = $post->ID; |
|
2461 | + $variables_array['label'] = __($type['site_title'], 'geodirectory'); |
|
2462 | + $variables_array['value'] = ''; |
|
2463 | + $variables_array['value'] = $post->$type['htmlvar_name']; |
|
2464 | + } |
|
2465 | + |
|
2466 | + if (strpos($type['field_icon'], 'http') !== false) { |
|
2467 | + $field_icon = ' background: url(' . $type['field_icon'] . ') no-repeat left center;background-size:18px 18px;padding-left: 21px;'; |
|
2468 | + } elseif (strpos($type['field_icon'], 'fa fa-') !== false) { |
|
2469 | + $field_icon = '<i class="' . $type['field_icon'] . '"></i>'; |
|
2470 | + } |
|
2471 | + |
|
2472 | + switch ($type['type']) { |
|
2473 | + case 'fieldset': { |
|
2474 | + $i = 0; |
|
2475 | + $fieldset_count++; |
|
2476 | + $field_set_start = 1; |
|
2477 | + $fieldset_arr[$fieldset_count]['htmlvar_name'] = 'gd_tab_' . $fieldset_count; |
|
2478 | + $fieldset_arr[$fieldset_count]['label'] = $label; |
|
2479 | + } |
|
2480 | + break; |
|
2481 | + case 'url': { |
|
2482 | + if (strpos($field_icon, 'http') !== false) { |
|
2483 | + $field_icon_af = ''; |
|
2484 | + } elseif ($field_icon == '') { |
|
2485 | + |
|
2486 | + if ($type['name'] == 'geodir_facebook') { |
|
2487 | + $field_icon_af = '<i class="fa fa-facebook-square"></i>'; |
|
2488 | + } elseif ($type['name'] == 'geodir_twitter') { |
|
2489 | + $field_icon_af = '<i class="fa fa-twitter-square"></i>'; |
|
2490 | + } else { |
|
2491 | + $field_icon_af = '<i class="fa fa-link"></i>'; |
|
2492 | + } |
|
2493 | + |
|
2494 | + } else { |
|
2495 | + $field_icon_af = $field_icon; |
|
2496 | + $field_icon = ''; |
|
2497 | + } |
|
2498 | 2498 | |
2499 | - $a_url = geodir_parse_custom_field_url($post->$type['htmlvar_name']); |
|
2500 | - |
|
2501 | - $website = !empty($a_url['url']) ? $a_url['url'] : ''; |
|
2502 | - $title = !empty($a_url['label']) ? $a_url['label'] : $type['site_title']; |
|
2503 | - $title = $title != '' ? __(stripslashes($title), 'geodirectory') : ''; |
|
2504 | - |
|
2505 | - $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
|
2506 | - |
|
2507 | - // all search engines that use the nofollow value exclude links that use it from their ranking calculation |
|
2508 | - $rel = strpos($website, get_site_url()) !== false ? '' : 'rel="nofollow"'; |
|
2509 | - |
|
2510 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '"><span class="geodir-i-website" style="' . $field_icon . '">' . $field_icon_af . ' <a href="' . $website . '" target="_blank" ' . $rel . ' ><strong>' . |
|
2511 | - /** |
|
2512 | - * Filer the custom field website name. |
|
2513 | - * |
|
2514 | - * @since 1.0.0 |
|
2515 | - * @param string $title The field name default: "Website". |
|
2516 | - * @param string $website The website address. |
|
2517 | - * @param int $post->ID The post ID. |
|
2518 | - */ |
|
2519 | - apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID) . '</strong></a></span></div>'; |
|
2520 | - } |
|
2521 | - break; |
|
2522 | - case 'phone': { |
|
2523 | - if (strpos($field_icon, 'http') !== false) { |
|
2524 | - $field_icon_af = ''; |
|
2525 | - } elseif ($field_icon == '') { |
|
2526 | - $field_icon_af = '<i class="fa fa-phone"></i>'; |
|
2527 | - } else { |
|
2528 | - $field_icon_af = $field_icon; |
|
2529 | - $field_icon = ''; |
|
2530 | - } |
|
2531 | - |
|
2532 | - $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
|
2533 | - |
|
2534 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-contact" style="' . $field_icon . '">' . $field_icon_af; |
|
2535 | - if ($field_set_start == 1 && $site_title != '') { |
|
2536 | - $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
2537 | - } |
|
2538 | - $html .= ' </span>' . stripslashes($post->$type['htmlvar_name']) . '</div>'; |
|
2539 | - } |
|
2540 | - break; |
|
2541 | - case 'time': { |
|
2542 | - $value = ''; |
|
2543 | - if ($post->$type['htmlvar_name'] != '') |
|
2544 | - //$value = date('h:i',strtotime($post->$type['htmlvar_name'])); |
|
2545 | - $value = date(get_option('time_format'), strtotime($post->$type['htmlvar_name'])); |
|
2546 | - |
|
2547 | - if (strpos($field_icon, 'http') !== false) { |
|
2548 | - $field_icon_af = ''; |
|
2549 | - } elseif ($field_icon == '') { |
|
2550 | - $field_icon_af = '<i class="fa fa-clock-o"></i>'; |
|
2551 | - } else { |
|
2552 | - $field_icon_af = $field_icon; |
|
2553 | - $field_icon = ''; |
|
2554 | - } |
|
2555 | - |
|
2556 | - $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
|
2557 | - |
|
2558 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-time" style="' . $field_icon . '">' . $field_icon_af; |
|
2559 | - if ($field_set_start == 1 && $site_title != '') { |
|
2560 | - $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
2561 | - } |
|
2562 | - $html .= ' </span>' . stripslashes($value) . '</div>'; |
|
2563 | - } |
|
2564 | - break; |
|
2565 | - case 'datepicker': { |
|
2566 | - $date_format = geodir_default_date_format(); |
|
2567 | - if ($type['extra_fields'] != '') { |
|
2568 | - $date_format = unserialize($type['extra_fields']); |
|
2569 | - $date_format = $date_format['date_format']; |
|
2570 | - } |
|
2571 | - |
|
2572 | - $search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format |
|
2573 | - $replace = array('d','j','l','m','n','F','Y');//PHP date format |
|
2574 | - |
|
2575 | - $date_format = str_replace($search, $replace, $date_format); |
|
2576 | - |
|
2577 | - $post_htmlvar_value = $date_format == 'd/m/Y' ? str_replace('/', '-', $post->$type['htmlvar_name']) : $post->$type['htmlvar_name']; // PHP doesn't work well with dd/mm/yyyy format |
|
2578 | - |
|
2579 | - $value = ''; |
|
2580 | - if ($post->$type['htmlvar_name'] != '') |
|
2581 | - $value = date($date_format, strtotime($post_htmlvar_value)); |
|
2582 | - |
|
2583 | - if (strpos($field_icon, 'http') !== false) { |
|
2584 | - $field_icon_af = ''; |
|
2585 | - } elseif ($field_icon == '') { |
|
2586 | - $field_icon_af = '<i class="fa fa-calendar"></i>'; |
|
2587 | - } else { |
|
2588 | - $field_icon_af = $field_icon; |
|
2589 | - $field_icon = ''; |
|
2590 | - } |
|
2591 | - |
|
2592 | - $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
|
2593 | - |
|
2594 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-datepicker" style="' . $field_icon . '">' . $field_icon_af; |
|
2595 | - if ($field_set_start == 1 && $site_title != '') { |
|
2596 | - $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
2597 | - } |
|
2598 | - $html .= ' </span>' . $value . '</div>'; |
|
2599 | - } |
|
2600 | - break; |
|
2601 | - case 'text': { |
|
2602 | - if (strpos($field_icon, 'http') !== false) { |
|
2603 | - $field_icon_af = ''; |
|
2604 | - } elseif ($field_icon == '') { |
|
2605 | - $field_icon_af = ''; |
|
2606 | - } else { |
|
2607 | - $field_icon_af = $field_icon; |
|
2608 | - $field_icon = ''; |
|
2609 | - } |
|
2610 | - |
|
2611 | - $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
|
2612 | - |
|
2613 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af; |
|
2614 | - if ($field_set_start == 1 && $site_title != '') { |
|
2615 | - $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
2616 | - } |
|
2617 | - $html .= ' </span>' . stripslashes($post->$type['htmlvar_name']) . '</div>'; |
|
2618 | - } |
|
2619 | - break; |
|
2620 | - case 'radio': { |
|
2621 | - |
|
2622 | - if ($post->$type['htmlvar_name'] != '') { |
|
2623 | - if ($post->$type['htmlvar_name'] == 'f' || $post->$type['htmlvar_name'] == '0') { |
|
2624 | - $html_val = __('No', 'geodirectory'); |
|
2625 | - } else if ($post->$type['htmlvar_name'] == 't' || $post->$type['htmlvar_name'] == '1') { |
|
2626 | - $html_val = __('Yes', 'geodirectory'); |
|
2627 | - } else { |
|
2628 | - $html_val = __($post->$type['htmlvar_name'], 'geodirectory'); |
|
2499 | + $a_url = geodir_parse_custom_field_url($post->$type['htmlvar_name']); |
|
2500 | + |
|
2501 | + $website = !empty($a_url['url']) ? $a_url['url'] : ''; |
|
2502 | + $title = !empty($a_url['label']) ? $a_url['label'] : $type['site_title']; |
|
2503 | + $title = $title != '' ? __(stripslashes($title), 'geodirectory') : ''; |
|
2504 | + |
|
2505 | + $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
|
2506 | + |
|
2507 | + // all search engines that use the nofollow value exclude links that use it from their ranking calculation |
|
2508 | + $rel = strpos($website, get_site_url()) !== false ? '' : 'rel="nofollow"'; |
|
2509 | + |
|
2510 | + $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '"><span class="geodir-i-website" style="' . $field_icon . '">' . $field_icon_af . ' <a href="' . $website . '" target="_blank" ' . $rel . ' ><strong>' . |
|
2511 | + /** |
|
2512 | + * Filer the custom field website name. |
|
2513 | + * |
|
2514 | + * @since 1.0.0 |
|
2515 | + * @param string $title The field name default: "Website". |
|
2516 | + * @param string $website The website address. |
|
2517 | + * @param int $post->ID The post ID. |
|
2518 | + */ |
|
2519 | + apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID) . '</strong></a></span></div>'; |
|
2520 | + } |
|
2521 | + break; |
|
2522 | + case 'phone': { |
|
2523 | + if (strpos($field_icon, 'http') !== false) { |
|
2524 | + $field_icon_af = ''; |
|
2525 | + } elseif ($field_icon == '') { |
|
2526 | + $field_icon_af = '<i class="fa fa-phone"></i>'; |
|
2527 | + } else { |
|
2528 | + $field_icon_af = $field_icon; |
|
2529 | + $field_icon = ''; |
|
2530 | + } |
|
2531 | + |
|
2532 | + $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
|
2533 | + |
|
2534 | + $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-contact" style="' . $field_icon . '">' . $field_icon_af; |
|
2535 | + if ($field_set_start == 1 && $site_title != '') { |
|
2536 | + $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
2537 | + } |
|
2538 | + $html .= ' </span>' . stripslashes($post->$type['htmlvar_name']) . '</div>'; |
|
2539 | + } |
|
2540 | + break; |
|
2541 | + case 'time': { |
|
2542 | + $value = ''; |
|
2543 | + if ($post->$type['htmlvar_name'] != '') |
|
2544 | + //$value = date('h:i',strtotime($post->$type['htmlvar_name'])); |
|
2545 | + $value = date(get_option('time_format'), strtotime($post->$type['htmlvar_name'])); |
|
2546 | + |
|
2547 | + if (strpos($field_icon, 'http') !== false) { |
|
2548 | + $field_icon_af = ''; |
|
2549 | + } elseif ($field_icon == '') { |
|
2550 | + $field_icon_af = '<i class="fa fa-clock-o"></i>'; |
|
2551 | + } else { |
|
2552 | + $field_icon_af = $field_icon; |
|
2553 | + $field_icon = ''; |
|
2554 | + } |
|
2555 | + |
|
2556 | + $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
|
2557 | + |
|
2558 | + $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-time" style="' . $field_icon . '">' . $field_icon_af; |
|
2559 | + if ($field_set_start == 1 && $site_title != '') { |
|
2560 | + $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
2561 | + } |
|
2562 | + $html .= ' </span>' . stripslashes($value) . '</div>'; |
|
2563 | + } |
|
2564 | + break; |
|
2565 | + case 'datepicker': { |
|
2566 | + $date_format = geodir_default_date_format(); |
|
2567 | + if ($type['extra_fields'] != '') { |
|
2568 | + $date_format = unserialize($type['extra_fields']); |
|
2569 | + $date_format = $date_format['date_format']; |
|
2570 | + } |
|
2571 | + |
|
2572 | + $search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format |
|
2573 | + $replace = array('d','j','l','m','n','F','Y');//PHP date format |
|
2574 | + |
|
2575 | + $date_format = str_replace($search, $replace, $date_format); |
|
2576 | + |
|
2577 | + $post_htmlvar_value = $date_format == 'd/m/Y' ? str_replace('/', '-', $post->$type['htmlvar_name']) : $post->$type['htmlvar_name']; // PHP doesn't work well with dd/mm/yyyy format |
|
2578 | + |
|
2579 | + $value = ''; |
|
2580 | + if ($post->$type['htmlvar_name'] != '') |
|
2581 | + $value = date($date_format, strtotime($post_htmlvar_value)); |
|
2582 | + |
|
2583 | + if (strpos($field_icon, 'http') !== false) { |
|
2584 | + $field_icon_af = ''; |
|
2585 | + } elseif ($field_icon == '') { |
|
2586 | + $field_icon_af = '<i class="fa fa-calendar"></i>'; |
|
2587 | + } else { |
|
2588 | + $field_icon_af = $field_icon; |
|
2589 | + $field_icon = ''; |
|
2590 | + } |
|
2591 | + |
|
2592 | + $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
|
2593 | + |
|
2594 | + $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-datepicker" style="' . $field_icon . '">' . $field_icon_af; |
|
2595 | + if ($field_set_start == 1 && $site_title != '') { |
|
2596 | + $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
2597 | + } |
|
2598 | + $html .= ' </span>' . $value . '</div>'; |
|
2599 | + } |
|
2600 | + break; |
|
2601 | + case 'text': { |
|
2602 | + if (strpos($field_icon, 'http') !== false) { |
|
2603 | + $field_icon_af = ''; |
|
2604 | + } elseif ($field_icon == '') { |
|
2605 | + $field_icon_af = ''; |
|
2606 | + } else { |
|
2607 | + $field_icon_af = $field_icon; |
|
2608 | + $field_icon = ''; |
|
2609 | + } |
|
2610 | + |
|
2611 | + $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
|
2612 | + |
|
2613 | + $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af; |
|
2614 | + if ($field_set_start == 1 && $site_title != '') { |
|
2615 | + $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
2616 | + } |
|
2617 | + $html .= ' </span>' . stripslashes($post->$type['htmlvar_name']) . '</div>'; |
|
2618 | + } |
|
2619 | + break; |
|
2620 | + case 'radio': { |
|
2621 | + |
|
2622 | + if ($post->$type['htmlvar_name'] != '') { |
|
2623 | + if ($post->$type['htmlvar_name'] == 'f' || $post->$type['htmlvar_name'] == '0') { |
|
2624 | + $html_val = __('No', 'geodirectory'); |
|
2625 | + } else if ($post->$type['htmlvar_name'] == 't' || $post->$type['htmlvar_name'] == '1') { |
|
2626 | + $html_val = __('Yes', 'geodirectory'); |
|
2627 | + } else { |
|
2628 | + $html_val = __($post->$type['htmlvar_name'], 'geodirectory'); |
|
2629 | 2629 | |
2630 | - if (!empty($type['option_values'])) { |
|
2631 | - $cf_option_values = geodir_string_values_to_options(stripslashes_deep($type['option_values']), true); |
|
2630 | + if (!empty($type['option_values'])) { |
|
2631 | + $cf_option_values = geodir_string_values_to_options(stripslashes_deep($type['option_values']), true); |
|
2632 | 2632 | |
2633 | - if (!empty($cf_option_values)) { |
|
2634 | - foreach ($cf_option_values as $cf_option_value) { |
|
2635 | - if (isset($cf_option_value['value']) && $cf_option_value['value'] == $post->$type['htmlvar_name']) { |
|
2636 | - $html_val = $cf_option_value['label']; |
|
2637 | - } |
|
2638 | - } |
|
2639 | - } |
|
2640 | - } |
|
2641 | - } |
|
2642 | - |
|
2643 | - if (strpos($field_icon, 'http') !== false) { |
|
2644 | - $field_icon_af = ''; |
|
2645 | - } else if ($field_icon == '') { |
|
2646 | - $field_icon_af = ''; |
|
2647 | - } else { |
|
2648 | - $field_icon_af = $field_icon; |
|
2649 | - $field_icon = ''; |
|
2650 | - } |
|
2651 | - |
|
2652 | - $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
|
2653 | - |
|
2654 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-radio" style="' . $field_icon . '">' . $field_icon_af; |
|
2655 | - |
|
2656 | - if ($field_set_start == 1 && $site_title != '') { |
|
2657 | - $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
2658 | - } |
|
2659 | - |
|
2660 | - $html .= ' </span>' . $html_val . '</div>'; |
|
2661 | - } |
|
2662 | - } |
|
2663 | - break; |
|
2664 | - case 'checkbox': { |
|
2665 | - $html_var = $type['htmlvar_name']; |
|
2666 | - $html_val = $type['htmlvar_name']; |
|
2667 | - |
|
2668 | - if ((int)$post->$html_var == 1) { |
|
2669 | - |
|
2670 | - if ($post->$type['htmlvar_name'] == '1') { |
|
2671 | - $html_val = __('Yes', 'geodirectory'); |
|
2672 | - } else { |
|
2673 | - $html_val = __('No', 'geodirectory'); |
|
2674 | - } |
|
2675 | - |
|
2676 | - if (strpos($field_icon, 'http') !== false) { |
|
2677 | - $field_icon_af = ''; |
|
2678 | - } else if ($field_icon == '') { |
|
2679 | - $field_icon_af = ''; |
|
2680 | - } else { |
|
2681 | - $field_icon_af = $field_icon; |
|
2682 | - $field_icon = ''; |
|
2683 | - } |
|
2684 | - |
|
2685 | - $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
|
2686 | - |
|
2687 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-checkbox" style="' . $field_icon . '">' . $field_icon_af; |
|
2688 | - |
|
2689 | - if ($field_set_start == 1 && $site_title != '') { |
|
2690 | - $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
2691 | - } |
|
2692 | - |
|
2693 | - $html .= ' </span>' . $html_val . '</div>'; |
|
2694 | - } |
|
2695 | - } |
|
2696 | - break; |
|
2697 | - case 'select': { |
|
2698 | - if (strpos($field_icon, 'http') !== false) { |
|
2699 | - $field_icon_af = ''; |
|
2700 | - } elseif ($field_icon == '') { |
|
2701 | - $field_icon_af = ''; |
|
2702 | - } else { |
|
2703 | - $field_icon_af = $field_icon; |
|
2704 | - $field_icon = ''; |
|
2705 | - } |
|
2633 | + if (!empty($cf_option_values)) { |
|
2634 | + foreach ($cf_option_values as $cf_option_value) { |
|
2635 | + if (isset($cf_option_value['value']) && $cf_option_value['value'] == $post->$type['htmlvar_name']) { |
|
2636 | + $html_val = $cf_option_value['label']; |
|
2637 | + } |
|
2638 | + } |
|
2639 | + } |
|
2640 | + } |
|
2641 | + } |
|
2642 | + |
|
2643 | + if (strpos($field_icon, 'http') !== false) { |
|
2644 | + $field_icon_af = ''; |
|
2645 | + } else if ($field_icon == '') { |
|
2646 | + $field_icon_af = ''; |
|
2647 | + } else { |
|
2648 | + $field_icon_af = $field_icon; |
|
2649 | + $field_icon = ''; |
|
2650 | + } |
|
2651 | + |
|
2652 | + $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
|
2653 | + |
|
2654 | + $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-radio" style="' . $field_icon . '">' . $field_icon_af; |
|
2655 | + |
|
2656 | + if ($field_set_start == 1 && $site_title != '') { |
|
2657 | + $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
2658 | + } |
|
2659 | + |
|
2660 | + $html .= ' </span>' . $html_val . '</div>'; |
|
2661 | + } |
|
2662 | + } |
|
2663 | + break; |
|
2664 | + case 'checkbox': { |
|
2665 | + $html_var = $type['htmlvar_name']; |
|
2666 | + $html_val = $type['htmlvar_name']; |
|
2667 | + |
|
2668 | + if ((int)$post->$html_var == 1) { |
|
2669 | + |
|
2670 | + if ($post->$type['htmlvar_name'] == '1') { |
|
2671 | + $html_val = __('Yes', 'geodirectory'); |
|
2672 | + } else { |
|
2673 | + $html_val = __('No', 'geodirectory'); |
|
2674 | + } |
|
2675 | + |
|
2676 | + if (strpos($field_icon, 'http') !== false) { |
|
2677 | + $field_icon_af = ''; |
|
2678 | + } else if ($field_icon == '') { |
|
2679 | + $field_icon_af = ''; |
|
2680 | + } else { |
|
2681 | + $field_icon_af = $field_icon; |
|
2682 | + $field_icon = ''; |
|
2683 | + } |
|
2684 | + |
|
2685 | + $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
|
2686 | + |
|
2687 | + $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-checkbox" style="' . $field_icon . '">' . $field_icon_af; |
|
2688 | + |
|
2689 | + if ($field_set_start == 1 && $site_title != '') { |
|
2690 | + $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
2691 | + } |
|
2692 | + |
|
2693 | + $html .= ' </span>' . $html_val . '</div>'; |
|
2694 | + } |
|
2695 | + } |
|
2696 | + break; |
|
2697 | + case 'select': { |
|
2698 | + if (strpos($field_icon, 'http') !== false) { |
|
2699 | + $field_icon_af = ''; |
|
2700 | + } elseif ($field_icon == '') { |
|
2701 | + $field_icon_af = ''; |
|
2702 | + } else { |
|
2703 | + $field_icon_af = $field_icon; |
|
2704 | + $field_icon = ''; |
|
2705 | + } |
|
2706 | 2706 | |
2707 | - $field_value = __($post->$type['htmlvar_name'], 'geodirectory'); |
|
2707 | + $field_value = __($post->$type['htmlvar_name'], 'geodirectory'); |
|
2708 | 2708 | |
2709 | - if (!empty($type['option_values'])) { |
|
2710 | - $cf_option_values = geodir_string_values_to_options(stripslashes_deep($type['option_values']), true); |
|
2709 | + if (!empty($type['option_values'])) { |
|
2710 | + $cf_option_values = geodir_string_values_to_options(stripslashes_deep($type['option_values']), true); |
|
2711 | 2711 | |
2712 | - if (!empty($cf_option_values)) { |
|
2713 | - foreach ($cf_option_values as $cf_option_value) { |
|
2714 | - if (isset($cf_option_value['value']) && $cf_option_value['value'] == $post->$type['htmlvar_name']) { |
|
2715 | - $field_value = $cf_option_value['label']; |
|
2716 | - } |
|
2717 | - } |
|
2718 | - } |
|
2719 | - } |
|
2720 | - |
|
2721 | - $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
|
2722 | - |
|
2723 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af; |
|
2724 | - if ($field_set_start == 1 && $site_title != '') { |
|
2725 | - $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
2726 | - } |
|
2727 | - $html .= ' </span>' . $field_value . '</div>'; |
|
2728 | - } |
|
2729 | - break; |
|
2730 | - case 'multiselect': { |
|
2731 | - if (is_array($post->$type['htmlvar_name'])) { |
|
2732 | - $post->$type['htmlvar_name'] = implode(', ', $post->$type['htmlvar_name']); |
|
2733 | - } |
|
2734 | - |
|
2735 | - if (strpos($field_icon, 'http') !== false) { |
|
2736 | - $field_icon_af = ''; |
|
2737 | - } elseif ($field_icon == '') { |
|
2738 | - $field_icon_af = ''; |
|
2739 | - } else { |
|
2740 | - $field_icon_af = $field_icon; |
|
2741 | - $field_icon = ''; |
|
2742 | - } |
|
2743 | - |
|
2744 | - $field_values = explode(',', trim($post->$type['htmlvar_name'], ",")); |
|
2745 | - |
|
2746 | - $option_values = array(); |
|
2747 | - if (!empty($type['option_values'])) { |
|
2748 | - $cf_option_values = geodir_string_values_to_options(stripslashes_deep($type['option_values']), true); |
|
2712 | + if (!empty($cf_option_values)) { |
|
2713 | + foreach ($cf_option_values as $cf_option_value) { |
|
2714 | + if (isset($cf_option_value['value']) && $cf_option_value['value'] == $post->$type['htmlvar_name']) { |
|
2715 | + $field_value = $cf_option_value['label']; |
|
2716 | + } |
|
2717 | + } |
|
2718 | + } |
|
2719 | + } |
|
2720 | + |
|
2721 | + $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
|
2722 | + |
|
2723 | + $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af; |
|
2724 | + if ($field_set_start == 1 && $site_title != '') { |
|
2725 | + $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
2726 | + } |
|
2727 | + $html .= ' </span>' . $field_value . '</div>'; |
|
2728 | + } |
|
2729 | + break; |
|
2730 | + case 'multiselect': { |
|
2731 | + if (is_array($post->$type['htmlvar_name'])) { |
|
2732 | + $post->$type['htmlvar_name'] = implode(', ', $post->$type['htmlvar_name']); |
|
2733 | + } |
|
2734 | + |
|
2735 | + if (strpos($field_icon, 'http') !== false) { |
|
2736 | + $field_icon_af = ''; |
|
2737 | + } elseif ($field_icon == '') { |
|
2738 | + $field_icon_af = ''; |
|
2739 | + } else { |
|
2740 | + $field_icon_af = $field_icon; |
|
2741 | + $field_icon = ''; |
|
2742 | + } |
|
2743 | + |
|
2744 | + $field_values = explode(',', trim($post->$type['htmlvar_name'], ",")); |
|
2745 | + |
|
2746 | + $option_values = array(); |
|
2747 | + if (!empty($type['option_values'])) { |
|
2748 | + $cf_option_values = geodir_string_values_to_options(stripslashes_deep($type['option_values']), true); |
|
2749 | 2749 | |
2750 | - if (!empty($cf_option_values)) { |
|
2751 | - foreach ($cf_option_values as $cf_option_value) { |
|
2752 | - if (isset($cf_option_value['value']) && in_array($cf_option_value['value'], $field_values)) { |
|
2753 | - $option_values[] = $cf_option_value['label']; |
|
2754 | - } |
|
2755 | - } |
|
2756 | - } |
|
2757 | - } |
|
2758 | - |
|
2759 | - $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
|
2760 | - |
|
2761 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af; |
|
2762 | - if ($field_set_start == 1 && $site_title != '') { |
|
2763 | - $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
2764 | - } |
|
2765 | - $html .= ' </span>'; |
|
2766 | - |
|
2767 | - if (count($option_values) > 1) { |
|
2768 | - $html .= '<ul>'; |
|
2769 | - foreach ($option_values as $val) { |
|
2770 | - $html .= '<li>' . $val . '</li>'; |
|
2771 | - } |
|
2772 | - $html .= '</ul>'; |
|
2773 | - } else { |
|
2774 | - $html .= $post->$type['htmlvar_name']; |
|
2775 | - } |
|
2776 | - $html .= '</div>'; |
|
2777 | - } |
|
2778 | - break; |
|
2779 | - case 'email': { |
|
2780 | - if (strpos($field_icon, 'http') !== false) { |
|
2781 | - $field_icon_af = ''; |
|
2782 | - } elseif ($field_icon == '') { |
|
2783 | - $field_icon_af = '<i class="fa fa-envelope"></i>'; |
|
2784 | - } else { |
|
2785 | - $field_icon_af = $field_icon; |
|
2786 | - $field_icon = ''; |
|
2787 | - } |
|
2788 | - |
|
2789 | - $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
|
2790 | - |
|
2791 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af; |
|
2792 | - if ($field_set_start == 1 && $site_title != '') { |
|
2793 | - $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
2794 | - } |
|
2795 | - $html .= ' </span>' . stripslashes($post->$type['htmlvar_name']) . '</div>'; |
|
2796 | - } |
|
2797 | - break; |
|
2798 | - case 'textarea': { |
|
2799 | - if (strpos($field_icon, 'http') !== false) { |
|
2800 | - $field_icon_af = ''; |
|
2801 | - } elseif ($field_icon == '') { |
|
2802 | - $field_icon_af = ''; |
|
2803 | - } else { |
|
2804 | - $field_icon_af = $field_icon; |
|
2805 | - $field_icon = ''; |
|
2806 | - } |
|
2807 | - |
|
2808 | - $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
|
2809 | - |
|
2810 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af; |
|
2811 | - if ($field_set_start == 1 && $site_title != '') { |
|
2812 | - $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
2813 | - } |
|
2814 | - $html .= '</span>' . wpautop(stripslashes($post->$type['htmlvar_name'])) . '</div>'; |
|
2815 | - } |
|
2816 | - break; |
|
2817 | - case 'html': { |
|
2818 | - if (strpos($field_icon, 'http') !== false) { |
|
2819 | - $field_icon_af = ''; |
|
2820 | - } elseif ($field_icon == '') { |
|
2821 | - $field_icon_af = ''; |
|
2822 | - } else { |
|
2823 | - $field_icon_af = $field_icon; |
|
2824 | - $field_icon = ''; |
|
2825 | - } |
|
2826 | - |
|
2827 | - $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
|
2828 | - |
|
2829 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af; |
|
2830 | - if ($field_set_start == 1 && $site_title != '') { |
|
2831 | - $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
2832 | - } |
|
2833 | - $html .= ' </span>' . wpautop(stripslashes($post->$type['htmlvar_name'])) . '</div>'; |
|
2834 | - } |
|
2835 | - break; |
|
2836 | - case 'file': { |
|
2837 | - $html_var = $type['htmlvar_name']; |
|
2838 | - |
|
2839 | - if (!empty($post->$type['htmlvar_name'])) { |
|
2840 | - $files = explode(",", $post->$type['htmlvar_name']); |
|
2841 | - |
|
2842 | - if (!empty($files)) { |
|
2843 | - $extra_fields = !empty($type['extra_fields']) ? maybe_unserialize($type['extra_fields']) : NULL; |
|
2844 | - $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'] : ''; |
|
2750 | + if (!empty($cf_option_values)) { |
|
2751 | + foreach ($cf_option_values as $cf_option_value) { |
|
2752 | + if (isset($cf_option_value['value']) && in_array($cf_option_value['value'], $field_values)) { |
|
2753 | + $option_values[] = $cf_option_value['label']; |
|
2754 | + } |
|
2755 | + } |
|
2756 | + } |
|
2757 | + } |
|
2758 | + |
|
2759 | + $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
|
2760 | + |
|
2761 | + $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af; |
|
2762 | + if ($field_set_start == 1 && $site_title != '') { |
|
2763 | + $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
2764 | + } |
|
2765 | + $html .= ' </span>'; |
|
2766 | + |
|
2767 | + if (count($option_values) > 1) { |
|
2768 | + $html .= '<ul>'; |
|
2769 | + foreach ($option_values as $val) { |
|
2770 | + $html .= '<li>' . $val . '</li>'; |
|
2771 | + } |
|
2772 | + $html .= '</ul>'; |
|
2773 | + } else { |
|
2774 | + $html .= $post->$type['htmlvar_name']; |
|
2775 | + } |
|
2776 | + $html .= '</div>'; |
|
2777 | + } |
|
2778 | + break; |
|
2779 | + case 'email': { |
|
2780 | + if (strpos($field_icon, 'http') !== false) { |
|
2781 | + $field_icon_af = ''; |
|
2782 | + } elseif ($field_icon == '') { |
|
2783 | + $field_icon_af = '<i class="fa fa-envelope"></i>'; |
|
2784 | + } else { |
|
2785 | + $field_icon_af = $field_icon; |
|
2786 | + $field_icon = ''; |
|
2787 | + } |
|
2788 | + |
|
2789 | + $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
|
2790 | + |
|
2791 | + $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af; |
|
2792 | + if ($field_set_start == 1 && $site_title != '') { |
|
2793 | + $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
2794 | + } |
|
2795 | + $html .= ' </span>' . stripslashes($post->$type['htmlvar_name']) . '</div>'; |
|
2796 | + } |
|
2797 | + break; |
|
2798 | + case 'textarea': { |
|
2799 | + if (strpos($field_icon, 'http') !== false) { |
|
2800 | + $field_icon_af = ''; |
|
2801 | + } elseif ($field_icon == '') { |
|
2802 | + $field_icon_af = ''; |
|
2803 | + } else { |
|
2804 | + $field_icon_af = $field_icon; |
|
2805 | + $field_icon = ''; |
|
2806 | + } |
|
2807 | + |
|
2808 | + $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
|
2809 | + |
|
2810 | + $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af; |
|
2811 | + if ($field_set_start == 1 && $site_title != '') { |
|
2812 | + $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
2813 | + } |
|
2814 | + $html .= '</span>' . wpautop(stripslashes($post->$type['htmlvar_name'])) . '</div>'; |
|
2815 | + } |
|
2816 | + break; |
|
2817 | + case 'html': { |
|
2818 | + if (strpos($field_icon, 'http') !== false) { |
|
2819 | + $field_icon_af = ''; |
|
2820 | + } elseif ($field_icon == '') { |
|
2821 | + $field_icon_af = ''; |
|
2822 | + } else { |
|
2823 | + $field_icon_af = $field_icon; |
|
2824 | + $field_icon = ''; |
|
2825 | + } |
|
2826 | + |
|
2827 | + $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
|
2828 | + |
|
2829 | + $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af; |
|
2830 | + if ($field_set_start == 1 && $site_title != '') { |
|
2831 | + $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
2832 | + } |
|
2833 | + $html .= ' </span>' . wpautop(stripslashes($post->$type['htmlvar_name'])) . '</div>'; |
|
2834 | + } |
|
2835 | + break; |
|
2836 | + case 'file': { |
|
2837 | + $html_var = $type['htmlvar_name']; |
|
2838 | + |
|
2839 | + if (!empty($post->$type['htmlvar_name'])) { |
|
2840 | + $files = explode(",", $post->$type['htmlvar_name']); |
|
2841 | + |
|
2842 | + if (!empty($files)) { |
|
2843 | + $extra_fields = !empty($type['extra_fields']) ? maybe_unserialize($type['extra_fields']) : NULL; |
|
2844 | + $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'] : ''; |
|
2845 | 2845 | |
2846 | - $file_paths = ''; |
|
2847 | - foreach ($files as $file) { |
|
2848 | - if (!empty($file)) { |
|
2849 | - $filetype = wp_check_filetype($file); |
|
2850 | - $image_name_arr = explode('/', $file); |
|
2851 | - $curr_img_dir = $image_name_arr[count($image_name_arr) - 2]; |
|
2852 | - $filename = end($image_name_arr); |
|
2853 | - $img_name_arr = explode('.', $filename); |
|
2854 | - |
|
2855 | - $arr_file_type = wp_check_filetype($filename); |
|
2856 | - if (empty($arr_file_type['ext']) || empty($arr_file_type['type'])) { |
|
2857 | - continue; |
|
2858 | - } |
|
2859 | - $uploaded_file_type = $arr_file_type['type']; |
|
2860 | - $uploaded_file_ext = $arr_file_type['ext']; |
|
2846 | + $file_paths = ''; |
|
2847 | + foreach ($files as $file) { |
|
2848 | + if (!empty($file)) { |
|
2849 | + $filetype = wp_check_filetype($file); |
|
2850 | + $image_name_arr = explode('/', $file); |
|
2851 | + $curr_img_dir = $image_name_arr[count($image_name_arr) - 2]; |
|
2852 | + $filename = end($image_name_arr); |
|
2853 | + $img_name_arr = explode('.', $filename); |
|
2854 | + |
|
2855 | + $arr_file_type = wp_check_filetype($filename); |
|
2856 | + if (empty($arr_file_type['ext']) || empty($arr_file_type['type'])) { |
|
2857 | + continue; |
|
2858 | + } |
|
2859 | + $uploaded_file_type = $arr_file_type['type']; |
|
2860 | + $uploaded_file_ext = $arr_file_type['ext']; |
|
2861 | 2861 | |
2862 | - if (!empty($allowed_file_types) && !in_array($uploaded_file_ext, $allowed_file_types)) { |
|
2863 | - continue; // Invalid file type. |
|
2864 | - } |
|
2865 | - |
|
2866 | - //$allowed_file_types = array('application/pdf', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'text/csv', 'text/plain'); |
|
2867 | - $image_file_types = array('image/jpg', 'image/jpeg', 'image/gif', 'image/png', 'image/bmp', 'image/x-icon'); |
|
2868 | - |
|
2869 | - // If the uploaded file is image |
|
2870 | - if (in_array($uploaded_file_type, $image_file_types)) { |
|
2871 | - $file_paths .= '<div class="geodir-custom-post-gallery" class="clearfix">'; |
|
2872 | - $file_paths .= '<a href="'.$file.'">'; |
|
2873 | - $file_paths .= geodir_show_image(array('src' => $file), 'thumbnail', false, false); |
|
2874 | - $file_paths .= '</a>'; |
|
2875 | - $file_paths .= '</div>'; |
|
2876 | - } else { |
|
2877 | - $ext_path = '_' . $html_var . '_'; |
|
2878 | - $filename = explode($ext_path, $filename); |
|
2879 | - $file_paths .= '<a href="' . $file . '" target="_blank">' . $filename[count($filename) - 1] . '</a>'; |
|
2880 | - } |
|
2881 | - } |
|
2882 | - } |
|
2883 | - |
|
2884 | - if (strpos($field_icon, 'http') !== false) { |
|
2885 | - $field_icon_af = ''; |
|
2886 | - } else if ($field_icon == '') { |
|
2887 | - $field_icon_af = ''; |
|
2888 | - } else { |
|
2889 | - $field_icon_af = $field_icon; |
|
2890 | - $field_icon = ''; |
|
2891 | - } |
|
2892 | - |
|
2893 | - $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
|
2894 | - |
|
2895 | - |
|
2896 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . ' geodir-custom-file-box" style="clear:both;"><span class="geodir-i-file" style="display:inline-block;vertical-align:top;padding-right:14px;' . $field_icon . '">' . $field_icon_af; |
|
2897 | - |
|
2898 | - if ($field_set_start == 1 && $site_title != '') { |
|
2899 | - $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
2900 | - } |
|
2901 | - |
|
2902 | - $html .= ' </span>' . $file_paths . '</div>'; |
|
2903 | - } |
|
2904 | - } |
|
2905 | - } |
|
2906 | - break; |
|
2907 | - } |
|
2908 | - |
|
2909 | - |
|
2910 | - /** |
|
2911 | - * Filter custom field output in tab. |
|
2912 | - * |
|
2913 | - * @since 1.5.6 |
|
2914 | - * |
|
2915 | - * @param string $html_var The HTML variable name for the field. |
|
2916 | - * @param string $html Custom field unfiltered HTML. |
|
2917 | - * @param array $variables_array Custom field variables array. |
|
2918 | - */ |
|
2919 | - $html = apply_filters("geodir_tab_show_{$html_var}", $html, $variables_array); |
|
2920 | - |
|
2921 | - |
|
2922 | - if ($field_set_start == 1) { |
|
2923 | - $add_html = false; |
|
2924 | - if ($type['type'] == 'fieldset' && $fieldset_count > 1) { |
|
2925 | - if ($fieldset != '') { |
|
2926 | - $add_html = true; |
|
2927 | - $label = $fieldset_arr[$fieldset_count - 1]['label']; |
|
2928 | - $htmlvar_name = $fieldset_arr[$fieldset_count - 1]['htmlvar_name']; |
|
2929 | - } |
|
2930 | - $fieldset_html = $fieldset; |
|
2931 | - $fieldset = ''; |
|
2932 | - } else { |
|
2933 | - $fieldset .= $html; |
|
2934 | - if ($total_fields == $count_field && $fieldset != '') { |
|
2935 | - $add_html = true; |
|
2936 | - $label = $fieldset_arr[$fieldset_count]['label']; |
|
2937 | - $htmlvar_name = $fieldset_arr[$fieldset_count]['htmlvar_name']; |
|
2938 | - $fieldset_html = $fieldset; |
|
2939 | - } |
|
2940 | - } |
|
2941 | - |
|
2942 | - if ($add_html) { |
|
2943 | - $tabs_arr[$htmlvar_name] = array( |
|
2944 | - 'heading_text' => __($label, 'geodirectory'), |
|
2945 | - 'is_active_tab' => false, |
|
2946 | - /** |
|
2947 | - * Filter if a custom field should be displayed on the details page tab. |
|
2948 | - * |
|
2949 | - * @since 1.0.0 |
|
2950 | - * @param string $htmlvar_name The field HTML var name. |
|
2951 | - */ |
|
2952 | - 'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, $htmlvar_name), |
|
2953 | - 'tab_content' => '<div class="geodir-company_info field-group">' . $fieldset_html . '</html>' |
|
2954 | - ); |
|
2955 | - } |
|
2956 | - } else { |
|
2957 | - if ($html != '') { |
|
2958 | - $tabs_arr[$field['htmlvar_name']] = array( |
|
2959 | - 'heading_text' => __($label, 'geodirectory'), |
|
2960 | - 'is_active_tab' => false, |
|
2961 | - /** This action is documented in geodirectory_hooks_actions.php */ |
|
2962 | - 'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, $field['htmlvar_name']), |
|
2963 | - 'tab_content' => $html |
|
2964 | - ); |
|
2965 | - } |
|
2966 | - } |
|
2967 | - } |
|
2968 | - } |
|
2969 | - } |
|
2970 | - } |
|
2971 | - return $tabs_arr; |
|
2862 | + if (!empty($allowed_file_types) && !in_array($uploaded_file_ext, $allowed_file_types)) { |
|
2863 | + continue; // Invalid file type. |
|
2864 | + } |
|
2865 | + |
|
2866 | + //$allowed_file_types = array('application/pdf', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'text/csv', 'text/plain'); |
|
2867 | + $image_file_types = array('image/jpg', 'image/jpeg', 'image/gif', 'image/png', 'image/bmp', 'image/x-icon'); |
|
2868 | + |
|
2869 | + // If the uploaded file is image |
|
2870 | + if (in_array($uploaded_file_type, $image_file_types)) { |
|
2871 | + $file_paths .= '<div class="geodir-custom-post-gallery" class="clearfix">'; |
|
2872 | + $file_paths .= '<a href="'.$file.'">'; |
|
2873 | + $file_paths .= geodir_show_image(array('src' => $file), 'thumbnail', false, false); |
|
2874 | + $file_paths .= '</a>'; |
|
2875 | + $file_paths .= '</div>'; |
|
2876 | + } else { |
|
2877 | + $ext_path = '_' . $html_var . '_'; |
|
2878 | + $filename = explode($ext_path, $filename); |
|
2879 | + $file_paths .= '<a href="' . $file . '" target="_blank">' . $filename[count($filename) - 1] . '</a>'; |
|
2880 | + } |
|
2881 | + } |
|
2882 | + } |
|
2883 | + |
|
2884 | + if (strpos($field_icon, 'http') !== false) { |
|
2885 | + $field_icon_af = ''; |
|
2886 | + } else if ($field_icon == '') { |
|
2887 | + $field_icon_af = ''; |
|
2888 | + } else { |
|
2889 | + $field_icon_af = $field_icon; |
|
2890 | + $field_icon = ''; |
|
2891 | + } |
|
2892 | + |
|
2893 | + $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
|
2894 | + |
|
2895 | + |
|
2896 | + $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . ' geodir-custom-file-box" style="clear:both;"><span class="geodir-i-file" style="display:inline-block;vertical-align:top;padding-right:14px;' . $field_icon . '">' . $field_icon_af; |
|
2897 | + |
|
2898 | + if ($field_set_start == 1 && $site_title != '') { |
|
2899 | + $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
2900 | + } |
|
2901 | + |
|
2902 | + $html .= ' </span>' . $file_paths . '</div>'; |
|
2903 | + } |
|
2904 | + } |
|
2905 | + } |
|
2906 | + break; |
|
2907 | + } |
|
2908 | + |
|
2909 | + |
|
2910 | + /** |
|
2911 | + * Filter custom field output in tab. |
|
2912 | + * |
|
2913 | + * @since 1.5.6 |
|
2914 | + * |
|
2915 | + * @param string $html_var The HTML variable name for the field. |
|
2916 | + * @param string $html Custom field unfiltered HTML. |
|
2917 | + * @param array $variables_array Custom field variables array. |
|
2918 | + */ |
|
2919 | + $html = apply_filters("geodir_tab_show_{$html_var}", $html, $variables_array); |
|
2920 | + |
|
2921 | + |
|
2922 | + if ($field_set_start == 1) { |
|
2923 | + $add_html = false; |
|
2924 | + if ($type['type'] == 'fieldset' && $fieldset_count > 1) { |
|
2925 | + if ($fieldset != '') { |
|
2926 | + $add_html = true; |
|
2927 | + $label = $fieldset_arr[$fieldset_count - 1]['label']; |
|
2928 | + $htmlvar_name = $fieldset_arr[$fieldset_count - 1]['htmlvar_name']; |
|
2929 | + } |
|
2930 | + $fieldset_html = $fieldset; |
|
2931 | + $fieldset = ''; |
|
2932 | + } else { |
|
2933 | + $fieldset .= $html; |
|
2934 | + if ($total_fields == $count_field && $fieldset != '') { |
|
2935 | + $add_html = true; |
|
2936 | + $label = $fieldset_arr[$fieldset_count]['label']; |
|
2937 | + $htmlvar_name = $fieldset_arr[$fieldset_count]['htmlvar_name']; |
|
2938 | + $fieldset_html = $fieldset; |
|
2939 | + } |
|
2940 | + } |
|
2941 | + |
|
2942 | + if ($add_html) { |
|
2943 | + $tabs_arr[$htmlvar_name] = array( |
|
2944 | + 'heading_text' => __($label, 'geodirectory'), |
|
2945 | + 'is_active_tab' => false, |
|
2946 | + /** |
|
2947 | + * Filter if a custom field should be displayed on the details page tab. |
|
2948 | + * |
|
2949 | + * @since 1.0.0 |
|
2950 | + * @param string $htmlvar_name The field HTML var name. |
|
2951 | + */ |
|
2952 | + 'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, $htmlvar_name), |
|
2953 | + 'tab_content' => '<div class="geodir-company_info field-group">' . $fieldset_html . '</html>' |
|
2954 | + ); |
|
2955 | + } |
|
2956 | + } else { |
|
2957 | + if ($html != '') { |
|
2958 | + $tabs_arr[$field['htmlvar_name']] = array( |
|
2959 | + 'heading_text' => __($label, 'geodirectory'), |
|
2960 | + 'is_active_tab' => false, |
|
2961 | + /** This action is documented in geodirectory_hooks_actions.php */ |
|
2962 | + 'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, $field['htmlvar_name']), |
|
2963 | + 'tab_content' => $html |
|
2964 | + ); |
|
2965 | + } |
|
2966 | + } |
|
2967 | + } |
|
2968 | + } |
|
2969 | + } |
|
2970 | + } |
|
2971 | + return $tabs_arr; |
|
2972 | 2972 | } |
2973 | 2973 | |
2974 | 2974 | /* display add listing page for wpml */ |
@@ -2992,37 +2992,37 @@ discard block |
||
2992 | 2992 | */ |
2993 | 2993 | function geodir_add_post_status_author_page() |
2994 | 2994 | { |
2995 | - global $wpdb, $post; |
|
2996 | - |
|
2997 | - $html = ''; |
|
2998 | - if (get_current_user_id()) { |
|
2999 | - if (geodir_is_page('author') && !empty($post) && isset($post->post_author) && $post->post_author == get_current_user_id()) { |
|
3000 | - |
|
3001 | - // we need to query real status direct as we dynamically change the status for author on author page so even non author status can view them. |
|
3002 | - $real_status = $wpdb->get_var("SELECT post_status from $wpdb->posts WHERE ID=$post->ID"); |
|
3003 | - $status = "<strong>("; |
|
3004 | - $status_icon = '<i class="fa fa-play"></i>'; |
|
3005 | - if ($real_status == 'publish') { |
|
3006 | - $status .= __('Published', 'geodirectory'); |
|
3007 | - } else { |
|
3008 | - $status .= __('Not published', 'geodirectory'); |
|
3009 | - $status_icon = '<i class="fa fa-pause"></i>'; |
|
3010 | - } |
|
3011 | - $status .= ")</strong>"; |
|
2995 | + global $wpdb, $post; |
|
2996 | + |
|
2997 | + $html = ''; |
|
2998 | + if (get_current_user_id()) { |
|
2999 | + if (geodir_is_page('author') && !empty($post) && isset($post->post_author) && $post->post_author == get_current_user_id()) { |
|
3000 | + |
|
3001 | + // we need to query real status direct as we dynamically change the status for author on author page so even non author status can view them. |
|
3002 | + $real_status = $wpdb->get_var("SELECT post_status from $wpdb->posts WHERE ID=$post->ID"); |
|
3003 | + $status = "<strong>("; |
|
3004 | + $status_icon = '<i class="fa fa-play"></i>'; |
|
3005 | + if ($real_status == 'publish') { |
|
3006 | + $status .= __('Published', 'geodirectory'); |
|
3007 | + } else { |
|
3008 | + $status .= __('Not published', 'geodirectory'); |
|
3009 | + $status_icon = '<i class="fa fa-pause"></i>'; |
|
3010 | + } |
|
3011 | + $status .= ")</strong>"; |
|
3012 | 3012 | |
3013 | - $html = '<span class="geodir-post-status">' . $status_icon . ' <font class="geodir-status-label">' . __('Status: ', 'geodirectory') . '</font>' . $status . '</span>'; |
|
3014 | - } |
|
3015 | - } |
|
3013 | + $html = '<span class="geodir-post-status">' . $status_icon . ' <font class="geodir-status-label">' . __('Status: ', 'geodirectory') . '</font>' . $status . '</span>'; |
|
3014 | + } |
|
3015 | + } |
|
3016 | 3016 | |
3017 | - if ($html != '') { |
|
3018 | - /** |
|
3019 | - * Filter the post status text on the author page. |
|
3020 | - * |
|
3021 | - * @since 1.0.0 |
|
3022 | - * @param string $html The HTML of the status. |
|
3023 | - */ |
|
3024 | - echo apply_filters('geodir_filter_status_text_on_author_page', $html); |
|
3025 | - } |
|
3017 | + if ($html != '') { |
|
3018 | + /** |
|
3019 | + * Filter the post status text on the author page. |
|
3020 | + * |
|
3021 | + * @since 1.0.0 |
|
3022 | + * @param string $html The HTML of the status. |
|
3023 | + */ |
|
3024 | + echo apply_filters('geodir_filter_status_text_on_author_page', $html); |
|
3025 | + } |
|
3026 | 3026 | |
3027 | 3027 | |
3028 | 3028 | } |
@@ -3036,21 +3036,21 @@ discard block |
||
3036 | 3036 | */ |
3037 | 3037 | function geodir_init_no_rating() |
3038 | 3038 | { |
3039 | - if (get_option('geodir_disable_rating')) { |
|
3040 | - remove_action('comment_form_logged_in_after', 'geodir_comment_rating_fields'); |
|
3041 | - remove_action('comment_form_before_fields', 'geodir_comment_rating_fields'); |
|
3042 | - remove_action('comment_form_logged_in_after', 'geodir_reviewrating_comment_rating_fields'); |
|
3043 | - remove_action('comment_form_before_fields', 'geodir_reviewrating_comment_rating_fields'); |
|
3044 | - remove_action('add_meta_boxes_comment', 'geodir_comment_add_meta_box'); |
|
3045 | - remove_action('add_meta_boxes', 'geodir_reviewrating_comment_metabox', 13); |
|
3046 | - remove_filter('comment_text', 'geodir_wrap_comment_text', 40); |
|
3047 | - |
|
3048 | - add_action('comment_form_logged_in_after', 'geodir_no_rating_rating_fields'); |
|
3049 | - add_action('comment_form_before_fields', 'geodir_no_rating_rating_fields'); |
|
3050 | - add_filter('comment_text', 'geodir_no_rating_comment_text', 100, 2); |
|
3051 | - add_filter('geodir_detail_page_review_rating_html', 'geodir_no_rating_review_rating_html', 100); |
|
3052 | - add_filter('geodir_get_sort_options', 'geodir_no_rating_get_sort_options', 100, 2); |
|
3053 | - } |
|
3039 | + if (get_option('geodir_disable_rating')) { |
|
3040 | + remove_action('comment_form_logged_in_after', 'geodir_comment_rating_fields'); |
|
3041 | + remove_action('comment_form_before_fields', 'geodir_comment_rating_fields'); |
|
3042 | + remove_action('comment_form_logged_in_after', 'geodir_reviewrating_comment_rating_fields'); |
|
3043 | + remove_action('comment_form_before_fields', 'geodir_reviewrating_comment_rating_fields'); |
|
3044 | + remove_action('add_meta_boxes_comment', 'geodir_comment_add_meta_box'); |
|
3045 | + remove_action('add_meta_boxes', 'geodir_reviewrating_comment_metabox', 13); |
|
3046 | + remove_filter('comment_text', 'geodir_wrap_comment_text', 40); |
|
3047 | + |
|
3048 | + add_action('comment_form_logged_in_after', 'geodir_no_rating_rating_fields'); |
|
3049 | + add_action('comment_form_before_fields', 'geodir_no_rating_rating_fields'); |
|
3050 | + add_filter('comment_text', 'geodir_no_rating_comment_text', 100, 2); |
|
3051 | + add_filter('geodir_detail_page_review_rating_html', 'geodir_no_rating_review_rating_html', 100); |
|
3052 | + add_filter('geodir_get_sort_options', 'geodir_no_rating_get_sort_options', 100, 2); |
|
3053 | + } |
|
3054 | 3054 | } |
3055 | 3055 | |
3056 | 3056 | /** |
@@ -3062,20 +3062,20 @@ discard block |
||
3062 | 3062 | */ |
3063 | 3063 | function geodir_no_rating_rating_fields() |
3064 | 3064 | { |
3065 | - global $post; |
|
3065 | + global $post; |
|
3066 | 3066 | |
3067 | - $post_types = geodir_get_posttypes(); |
|
3067 | + $post_types = geodir_get_posttypes(); |
|
3068 | 3068 | |
3069 | - if (!empty($post) && isset($post->post_type) && in_array($post->post_type, $post_types)) { |
|
3070 | - if (is_plugin_active('geodir_review_rating_manager/geodir_review_rating_manager.php')) { |
|
3071 | - echo '<input type="hidden" value="1" name="geodir_rating[overall]" />'; |
|
3072 | - if (get_option('geodir_reviewrating_enable_images')) { |
|
3073 | - geodir_reviewrating_rating_img_html(); |
|
3074 | - } |
|
3075 | - } else { |
|
3076 | - echo '<input type="hidden" id="geodir_overallrating" name="geodir_overallrating" value="1" />'; |
|
3077 | - } |
|
3078 | - } |
|
3069 | + if (!empty($post) && isset($post->post_type) && in_array($post->post_type, $post_types)) { |
|
3070 | + if (is_plugin_active('geodir_review_rating_manager/geodir_review_rating_manager.php')) { |
|
3071 | + echo '<input type="hidden" value="1" name="geodir_rating[overall]" />'; |
|
3072 | + if (get_option('geodir_reviewrating_enable_images')) { |
|
3073 | + geodir_reviewrating_rating_img_html(); |
|
3074 | + } |
|
3075 | + } else { |
|
3076 | + echo '<input type="hidden" id="geodir_overallrating" name="geodir_overallrating" value="1" />'; |
|
3077 | + } |
|
3078 | + } |
|
3079 | 3079 | } |
3080 | 3080 | |
3081 | 3081 | /** |
@@ -3089,11 +3089,11 @@ discard block |
||
3089 | 3089 | */ |
3090 | 3090 | function geodir_no_rating_comment_text($content, $comment = '') |
3091 | 3091 | { |
3092 | - if (!is_admin()) { |
|
3093 | - return '<div class="description">' . $content . '</div>'; |
|
3094 | - } else { |
|
3095 | - return $content; |
|
3096 | - } |
|
3092 | + if (!is_admin()) { |
|
3093 | + return '<div class="description">' . $content . '</div>'; |
|
3094 | + } else { |
|
3095 | + return $content; |
|
3096 | + } |
|
3097 | 3097 | } |
3098 | 3098 | |
3099 | 3099 | /** |
@@ -3106,7 +3106,7 @@ discard block |
||
3106 | 3106 | */ |
3107 | 3107 | function geodir_no_rating_review_rating_html($content = '') |
3108 | 3108 | { |
3109 | - return NULL; |
|
3109 | + return NULL; |
|
3110 | 3110 | } |
3111 | 3111 | |
3112 | 3112 | /** |
@@ -3120,19 +3120,19 @@ discard block |
||
3120 | 3120 | */ |
3121 | 3121 | function geodir_no_rating_get_sort_options($options, $post_type = '') |
3122 | 3122 | { |
3123 | - $new_options = array(); |
|
3124 | - if (!empty($options)) { |
|
3125 | - foreach ($options as $option) { |
|
3126 | - if (is_object($option) && isset($option->htmlvar_name) && $option->htmlvar_name == 'overall_rating') { |
|
3127 | - continue; |
|
3128 | - } |
|
3129 | - $new_options[] = $option; |
|
3130 | - } |
|
3123 | + $new_options = array(); |
|
3124 | + if (!empty($options)) { |
|
3125 | + foreach ($options as $option) { |
|
3126 | + if (is_object($option) && isset($option->htmlvar_name) && $option->htmlvar_name == 'overall_rating') { |
|
3127 | + continue; |
|
3128 | + } |
|
3129 | + $new_options[] = $option; |
|
3130 | + } |
|
3131 | 3131 | |
3132 | - $options = $new_options; |
|
3133 | - } |
|
3132 | + $options = $new_options; |
|
3133 | + } |
|
3134 | 3134 | |
3135 | - return $options; |
|
3135 | + return $options; |
|
3136 | 3136 | } |
3137 | 3137 | |
3138 | 3138 | add_filter('geodir_all_js_msg', 'geodir_all_js_msg_no_rating', 100); |
@@ -3146,11 +3146,11 @@ discard block |
||
3146 | 3146 | */ |
3147 | 3147 | function geodir_all_js_msg_no_rating($msg = array()) |
3148 | 3148 | { |
3149 | - if (get_option('geodir_disable_rating')) { |
|
3150 | - $msg['gd_cmt_no_rating'] = true; |
|
3151 | - } |
|
3149 | + if (get_option('geodir_disable_rating')) { |
|
3150 | + $msg['gd_cmt_no_rating'] = true; |
|
3151 | + } |
|
3152 | 3152 | |
3153 | - return $msg; |
|
3153 | + return $msg; |
|
3154 | 3154 | } |
3155 | 3155 | |
3156 | 3156 | add_filter('body_class', 'geodir_body_class_no_rating', 100); |
@@ -3164,11 +3164,11 @@ discard block |
||
3164 | 3164 | */ |
3165 | 3165 | function geodir_body_class_no_rating($classes = array()) |
3166 | 3166 | { |
3167 | - if (get_option('geodir_disable_rating')) { |
|
3168 | - $classes[] = 'gd-no-rating'; |
|
3169 | - } |
|
3167 | + if (get_option('geodir_disable_rating')) { |
|
3168 | + $classes[] = 'gd-no-rating'; |
|
3169 | + } |
|
3170 | 3170 | |
3171 | - return $classes; |
|
3171 | + return $classes; |
|
3172 | 3172 | } |
3173 | 3173 | |
3174 | 3174 | add_filter('admin_body_class', 'geodir_admin_body_class_no_rating', 100); |
@@ -3182,11 +3182,11 @@ discard block |
||
3182 | 3182 | */ |
3183 | 3183 | function geodir_admin_body_class_no_rating($class = '') |
3184 | 3184 | { |
3185 | - if (get_option('geodir_disable_rating')) { |
|
3186 | - $class .= ' gd-no-rating'; |
|
3187 | - } |
|
3185 | + if (get_option('geodir_disable_rating')) { |
|
3186 | + $class .= ' gd-no-rating'; |
|
3187 | + } |
|
3188 | 3188 | |
3189 | - return $class; |
|
3189 | + return $class; |
|
3190 | 3190 | } |
3191 | 3191 | |
3192 | 3192 | add_action('wp_head', 'geodir_wp_head_no_rating'); |
@@ -3199,10 +3199,10 @@ discard block |
||
3199 | 3199 | */ |
3200 | 3200 | function geodir_wp_head_no_rating() |
3201 | 3201 | { |
3202 | - if (get_option('geodir_disable_rating')) { |
|
3203 | - echo '<style>body .geodir-rating, body .geodir-bubble-rating, body .gd_ratings_module_box{display:none!important;}</style>'; |
|
3204 | - echo '<script type="text/javascript">jQuery(function(){jQuery(".gd_rating_show").parent(".geodir-rating").remove();});</script>'; |
|
3205 | - } |
|
3202 | + if (get_option('geodir_disable_rating')) { |
|
3203 | + echo '<style>body .geodir-rating, body .geodir-bubble-rating, body .gd_ratings_module_box{display:none!important;}</style>'; |
|
3204 | + echo '<script type="text/javascript">jQuery(function(){jQuery(".gd_rating_show").parent(".geodir-rating").remove();});</script>'; |
|
3205 | + } |
|
3206 | 3206 | } |
3207 | 3207 | |
3208 | 3208 | add_filter('geodir_load_db_language', 'geodir_load_custom_field_translation'); |
@@ -3219,36 +3219,36 @@ discard block |
||
3219 | 3219 | * @return array Translation texts. |
3220 | 3220 | */ |
3221 | 3221 | function geodir_load_gd_options_text_translation($translation_texts = array()) { |
3222 | - $translation_texts = !empty( $translation_texts ) && is_array( $translation_texts ) ? $translation_texts : array(); |
|
3223 | - |
|
3224 | - $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'); |
|
3225 | - |
|
3226 | - /** |
|
3227 | - * Filters the geodirectory option names that requires to add for translation. |
|
3228 | - * |
|
3229 | - * @since 1.5.7 |
|
3230 | - * @package GeoDirectory |
|
3231 | - * |
|
3232 | - * @param array $gd_options Array of option names. |
|
3233 | - */ |
|
3234 | - $gd_options = apply_filters('geodir_gd_options_for_translation', $gd_options); |
|
3235 | - $gd_options = array_unique($gd_options); |
|
3236 | - |
|
3237 | - if (!empty($gd_options)) { |
|
3238 | - foreach ($gd_options as $gd_option) { |
|
3239 | - if ($gd_option != '' && $option_value = get_option($gd_option)) { |
|
3240 | - $option_value = is_string($option_value) ? stripslashes_deep($option_value) : ''; |
|
3222 | + $translation_texts = !empty( $translation_texts ) && is_array( $translation_texts ) ? $translation_texts : array(); |
|
3223 | + |
|
3224 | + $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'); |
|
3225 | + |
|
3226 | + /** |
|
3227 | + * Filters the geodirectory option names that requires to add for translation. |
|
3228 | + * |
|
3229 | + * @since 1.5.7 |
|
3230 | + * @package GeoDirectory |
|
3231 | + * |
|
3232 | + * @param array $gd_options Array of option names. |
|
3233 | + */ |
|
3234 | + $gd_options = apply_filters('geodir_gd_options_for_translation', $gd_options); |
|
3235 | + $gd_options = array_unique($gd_options); |
|
3236 | + |
|
3237 | + if (!empty($gd_options)) { |
|
3238 | + foreach ($gd_options as $gd_option) { |
|
3239 | + if ($gd_option != '' && $option_value = get_option($gd_option)) { |
|
3240 | + $option_value = is_string($option_value) ? stripslashes_deep($option_value) : ''; |
|
3241 | 3241 | |
3242 | - if ($option_value != '' && !in_array($option_value, $translation_texts)) { |
|
3243 | - $translation_texts[] = stripslashes_deep($option_value); |
|
3244 | - } |
|
3245 | - } |
|
3246 | - } |
|
3247 | - } |
|
3242 | + if ($option_value != '' && !in_array($option_value, $translation_texts)) { |
|
3243 | + $translation_texts[] = stripslashes_deep($option_value); |
|
3244 | + } |
|
3245 | + } |
|
3246 | + } |
|
3247 | + } |
|
3248 | 3248 | |
3249 | - $translation_texts = !empty($translation_texts) ? array_unique($translation_texts) : $translation_texts; |
|
3249 | + $translation_texts = !empty($translation_texts) ? array_unique($translation_texts) : $translation_texts; |
|
3250 | 3250 | |
3251 | - return $translation_texts; |
|
3251 | + return $translation_texts; |
|
3252 | 3252 | } |
3253 | 3253 | |
3254 | 3254 | add_filter('geodir_load_db_language', 'geodir_load_gd_options_text_translation'); |
@@ -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 |
@@ -579,7 +579,7 @@ |
||
579 | 579 | ), |
580 | 580 | array( |
581 | 581 | 'name' => __('Enable Font Awesome', 'geodirectory'), |
582 | - 'desc' => __('When enabled all rating images will be using font awesome rating icons as images.', 'geodirectory' ), |
|
582 | + 'desc' => __('When enabled all rating images will be using font awesome rating icons as images.', 'geodirectory'), |
|
583 | 583 | 'id' => 'geodir_reviewrating_enable_font_awesome', |
584 | 584 | 'type' => 'checkbox', |
585 | 585 | 'std' => '0' |
@@ -17,14 +17,14 @@ discard block |
||
17 | 17 | */ |
18 | 18 | function geodir_post_type_setting_fun() |
19 | 19 | { |
20 | - $post_type_arr = array(); |
|
20 | + $post_type_arr = array(); |
|
21 | 21 | |
22 | - $post_types = geodir_get_posttypes('object'); |
|
22 | + $post_types = geodir_get_posttypes('object'); |
|
23 | 23 | |
24 | - foreach ($post_types as $key => $post_types_obj) { |
|
25 | - $post_type_arr[$key] = $post_types_obj->labels->singular_name; |
|
26 | - } |
|
27 | - return $post_type_arr; |
|
24 | + foreach ($post_types as $key => $post_types_obj) { |
|
25 | + $post_type_arr[$key] = $post_types_obj->labels->singular_name; |
|
26 | + } |
|
27 | + return $post_type_arr; |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | /** |
@@ -35,548 +35,548 @@ discard block |
||
35 | 35 | */ |
36 | 36 | function geodir_theme_location_setting_fun() |
37 | 37 | { |
38 | - $post_type_arr = array(); |
|
39 | - $geodir_all_nav_locations = get_registered_nav_menus(); |
|
40 | - $geodir_active_nav_locations = get_nav_menu_locations(); |
|
41 | - if (!empty($geodir_active_nav_locations) && is_array($geodir_active_nav_locations)) { |
|
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]; |
|
45 | - } |
|
46 | - } |
|
47 | - |
|
48 | - return $post_type_arr; |
|
38 | + $post_type_arr = array(); |
|
39 | + $geodir_all_nav_locations = get_registered_nav_menus(); |
|
40 | + $geodir_active_nav_locations = get_nav_menu_locations(); |
|
41 | + if (!empty($geodir_active_nav_locations) && is_array($geodir_active_nav_locations)) { |
|
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]; |
|
45 | + } |
|
46 | + } |
|
47 | + |
|
48 | + return $post_type_arr; |
|
49 | 49 | } |
50 | 50 | /** |
51 | - * Filter GD design settings array. |
|
52 | - * |
|
53 | - * @since 1.0.0 |
|
54 | - * @package GeoDirectory |
|
55 | - */ |
|
51 | + * Filter GD design settings array. |
|
52 | + * |
|
53 | + * @since 1.0.0 |
|
54 | + * @package GeoDirectory |
|
55 | + */ |
|
56 | 56 | $geodir_settings['design_settings'] = apply_filters('geodir_design_settings', array( |
57 | 57 | |
58 | - /* Home Layout Settings start */ |
|
59 | - array('name' => __('Home', 'geodirectory'), 'type' => 'title', 'desc' => 'Setting to set home page layout', 'id' => 'home_page_settings '), |
|
58 | + /* Home Layout Settings start */ |
|
59 | + array('name' => __('Home', 'geodirectory'), 'type' => 'title', 'desc' => 'Setting to set home page layout', 'id' => 'home_page_settings '), |
|
60 | 60 | |
61 | 61 | |
62 | - array('name' => __('Home Top Section Settings', 'geodirectory'), |
|
63 | - 'type' => 'sectionstart', |
|
64 | - 'desc' => '', |
|
65 | - 'id' => 'geodir_home_top_section'), |
|
62 | + array('name' => __('Home Top Section Settings', 'geodirectory'), |
|
63 | + 'type' => 'sectionstart', |
|
64 | + 'desc' => '', |
|
65 | + 'id' => 'geodir_home_top_section'), |
|
66 | 66 | |
67 | - array( |
|
68 | - 'name' => __('Geodirectory home page', 'geodirectory'), |
|
69 | - 'desc' => __('Set geodirectory home page as your home. <b style="color:red;">This setting has been depreciated and will be removed in the next version, instead please set the GD home page in GD>Permalinks and then set this page to the front page under Settings>Reading>Front Page</b>', 'geodirectory'), |
|
70 | - 'id' => 'geodir_set_as_home', |
|
71 | - 'type' => 'checkbox', |
|
72 | - 'std' => '0' // Default value to show home top section |
|
73 | - ), |
|
67 | + array( |
|
68 | + 'name' => __('Geodirectory home page', 'geodirectory'), |
|
69 | + 'desc' => __('Set geodirectory home page as your home. <b style="color:red;">This setting has been depreciated and will be removed in the next version, instead please set the GD home page in GD>Permalinks and then set this page to the front page under Settings>Reading>Front Page</b>', 'geodirectory'), |
|
70 | + 'id' => 'geodir_set_as_home', |
|
71 | + 'type' => 'checkbox', |
|
72 | + 'std' => '0' // Default value to show home top section |
|
73 | + ), |
|
74 | 74 | |
75 | - array( |
|
76 | - 'name' => __('Home top section', 'geodirectory'), |
|
77 | - 'desc' => __('Show the top section of home page', 'geodirectory'), |
|
78 | - 'id' => 'geodir_show_home_top_section', |
|
79 | - 'type' => 'checkbox', |
|
80 | - 'std' => '1' // Default value to show home top section |
|
81 | - ), |
|
75 | + array( |
|
76 | + 'name' => __('Home top section', 'geodirectory'), |
|
77 | + 'desc' => __('Show the top section of home page', 'geodirectory'), |
|
78 | + 'id' => 'geodir_show_home_top_section', |
|
79 | + 'type' => 'checkbox', |
|
80 | + 'std' => '1' // Default value to show home top section |
|
81 | + ), |
|
82 | 82 | |
83 | 83 | |
84 | - array('type' => 'sectionend', 'id' => 'geodir_home_top_section'), |
|
84 | + array('type' => 'sectionend', 'id' => 'geodir_home_top_section'), |
|
85 | 85 | |
86 | 86 | |
87 | - array('name' => __('Home Page Layout Settings', 'geodirectory'), |
|
88 | - 'type' => 'sectionstart', |
|
89 | - 'desc' => '', |
|
90 | - 'id' => 'geodir_home_layout'), |
|
87 | + array('name' => __('Home Page Layout Settings', 'geodirectory'), |
|
88 | + 'type' => 'sectionstart', |
|
89 | + 'desc' => '', |
|
90 | + 'id' => 'geodir_home_layout'), |
|
91 | 91 | |
92 | - array( |
|
93 | - 'name' => __('Home right section', 'geodirectory'), |
|
94 | - 'desc' => __('Show the right section of home page', 'geodirectory'), |
|
95 | - 'id' => 'geodir_show_home_right_section', |
|
96 | - 'type' => 'checkbox', |
|
97 | - 'std' => '1' // Default value to show home top section |
|
98 | - ), |
|
92 | + array( |
|
93 | + 'name' => __('Home right section', 'geodirectory'), |
|
94 | + 'desc' => __('Show the right section of home page', 'geodirectory'), |
|
95 | + 'id' => 'geodir_show_home_right_section', |
|
96 | + 'type' => 'checkbox', |
|
97 | + 'std' => '1' // Default value to show home top section |
|
98 | + ), |
|
99 | 99 | |
100 | - array( |
|
101 | - 'name' => __('Width of home right section', 'geodirectory'), |
|
102 | - 'desc' => __('Enter the width of right section of home page in %', 'geodirectory'), |
|
103 | - 'id' => 'geodir_width_home_right_section', |
|
104 | - 'type' => 'text', |
|
105 | - 'css' => 'min-width:300px;', |
|
106 | - 'std' => '30' // Default value to show home top section |
|
107 | - ), |
|
100 | + array( |
|
101 | + 'name' => __('Width of home right section', 'geodirectory'), |
|
102 | + 'desc' => __('Enter the width of right section of home page in %', 'geodirectory'), |
|
103 | + 'id' => 'geodir_width_home_right_section', |
|
104 | + 'type' => 'text', |
|
105 | + 'css' => 'min-width:300px;', |
|
106 | + 'std' => '30' // Default value to show home top section |
|
107 | + ), |
|
108 | 108 | |
109 | - array( |
|
110 | - 'name' => __('Home content section', 'geodirectory'), |
|
111 | - 'desc' => __('Show the content section of home page', 'geodirectory'), |
|
112 | - 'id' => 'geodir_show_home_contant_section', |
|
113 | - 'type' => 'checkbox', |
|
114 | - 'std' => '1' // Default value to show home top section |
|
115 | - ), |
|
109 | + array( |
|
110 | + 'name' => __('Home content section', 'geodirectory'), |
|
111 | + 'desc' => __('Show the content section of home page', 'geodirectory'), |
|
112 | + 'id' => 'geodir_show_home_contant_section', |
|
113 | + 'type' => 'checkbox', |
|
114 | + 'std' => '1' // Default value to show home top section |
|
115 | + ), |
|
116 | 116 | |
117 | - array( |
|
118 | - 'name' => __('Width of home content section', 'geodirectory'), |
|
119 | - 'desc' => __('Enter the width of content section of home page in %', 'geodirectory'), |
|
120 | - 'id' => 'geodir_width_home_contant_section', |
|
121 | - 'type' => 'text', |
|
122 | - 'css' => 'min-width:300px;', |
|
123 | - 'std' => '63' // Default value to show home top section |
|
124 | - ), |
|
117 | + array( |
|
118 | + 'name' => __('Width of home content section', 'geodirectory'), |
|
119 | + 'desc' => __('Enter the width of content section of home page in %', 'geodirectory'), |
|
120 | + 'id' => 'geodir_width_home_contant_section', |
|
121 | + 'type' => 'text', |
|
122 | + 'css' => 'min-width:300px;', |
|
123 | + 'std' => '63' // Default value to show home top section |
|
124 | + ), |
|
125 | 125 | |
126 | - array( |
|
127 | - 'name' => __('Home left section', 'geodirectory'), |
|
128 | - 'desc' => __('Show the left section of home page', 'geodirectory'), |
|
129 | - 'id' => 'geodir_show_home_left_section', |
|
130 | - 'type' => 'checkbox', |
|
131 | - 'std' => '0' // Default value to show home top section |
|
132 | - ), |
|
126 | + array( |
|
127 | + 'name' => __('Home left section', 'geodirectory'), |
|
128 | + 'desc' => __('Show the left section of home page', 'geodirectory'), |
|
129 | + 'id' => 'geodir_show_home_left_section', |
|
130 | + 'type' => 'checkbox', |
|
131 | + 'std' => '0' // Default value to show home top section |
|
132 | + ), |
|
133 | 133 | |
134 | - array( |
|
135 | - 'name' => __('Width of home left section', 'geodirectory'), |
|
136 | - 'desc' => __('Enter the width of left section of home page in %', 'geodirectory'), |
|
137 | - 'id' => 'geodir_width_home_left_section', |
|
138 | - 'type' => 'text', |
|
139 | - 'css' => 'min-width:300px;', |
|
140 | - 'std' => '30' // Default value to show home top section |
|
141 | - ), |
|
134 | + array( |
|
135 | + 'name' => __('Width of home left section', 'geodirectory'), |
|
136 | + 'desc' => __('Enter the width of left section of home page in %', 'geodirectory'), |
|
137 | + 'id' => 'geodir_width_home_left_section', |
|
138 | + 'type' => 'text', |
|
139 | + 'css' => 'min-width:300px;', |
|
140 | + 'std' => '30' // Default value to show home top section |
|
141 | + ), |
|
142 | 142 | |
143 | - array( |
|
144 | - 'name' => __('Home bottom section', 'geodirectory'), |
|
145 | - 'desc' => __('Show the bottom section of home page', 'geodirectory'), |
|
146 | - 'id' => 'geodir_show_home_bottom_section', |
|
147 | - 'type' => 'checkbox', |
|
148 | - 'std' => '0' // Default value to show home top section |
|
149 | - ), |
|
150 | - array( |
|
151 | - 'name' => __('Resize image large size', 'geodirectory'), |
|
152 | - 'desc' => sprintf(__('Use default wordpress media image large size ( %s ) for featured image upload. If unchecked then default geodirectory image large size ( 800x800 ) will be used.', 'geodirectory'), get_option('large_size_w') . 'x' . get_option('large_size_h')), |
|
153 | - 'id' => 'geodir_use_wp_media_large_size', |
|
154 | - 'type' => 'checkbox', |
|
155 | - 'std' => '0' |
|
156 | - ), |
|
143 | + array( |
|
144 | + 'name' => __('Home bottom section', 'geodirectory'), |
|
145 | + 'desc' => __('Show the bottom section of home page', 'geodirectory'), |
|
146 | + 'id' => 'geodir_show_home_bottom_section', |
|
147 | + 'type' => 'checkbox', |
|
148 | + 'std' => '0' // Default value to show home top section |
|
149 | + ), |
|
150 | + array( |
|
151 | + 'name' => __('Resize image large size', 'geodirectory'), |
|
152 | + 'desc' => sprintf(__('Use default wordpress media image large size ( %s ) for featured image upload. If unchecked then default geodirectory image large size ( 800x800 ) will be used.', 'geodirectory'), get_option('large_size_w') . 'x' . get_option('large_size_h')), |
|
153 | + 'id' => 'geodir_use_wp_media_large_size', |
|
154 | + 'type' => 'checkbox', |
|
155 | + 'std' => '0' |
|
156 | + ), |
|
157 | 157 | |
158 | - array('type' => 'sectionend', 'id' => 'geodir_home_layout'), |
|
158 | + array('type' => 'sectionend', 'id' => 'geodir_home_layout'), |
|
159 | 159 | |
160 | 160 | |
161 | - /* Home Layout Settings end */ |
|
161 | + /* Home Layout Settings end */ |
|
162 | 162 | |
163 | 163 | |
164 | - /* Listing Layout Settings end */ |
|
164 | + /* Listing Layout Settings end */ |
|
165 | 165 | |
166 | - array('name' => __('Listings', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_listing_settings '), |
|
166 | + array('name' => __('Listings', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_listing_settings '), |
|
167 | 167 | |
168 | 168 | |
169 | - array('name' => __('Listing Page Layout Settings', 'geodirectory'), |
|
170 | - 'type' => 'sectionstart', |
|
171 | - 'desc' => '', |
|
172 | - 'id' => 'geodir_listing_layout'), |
|
169 | + array('name' => __('Listing Page Layout Settings', 'geodirectory'), |
|
170 | + 'type' => 'sectionstart', |
|
171 | + 'desc' => '', |
|
172 | + 'id' => 'geodir_listing_layout'), |
|
173 | 173 | |
174 | - array( |
|
175 | - 'name' => __('Listing top section', 'geodirectory'), |
|
176 | - 'desc' => __('Show the top section of listing page', 'geodirectory'), |
|
177 | - 'id' => 'geodir_show_listing_top_section', |
|
178 | - 'type' => 'checkbox', |
|
179 | - 'std' => '1' // Default value to show home top section |
|
180 | - ), |
|
174 | + array( |
|
175 | + 'name' => __('Listing top section', 'geodirectory'), |
|
176 | + 'desc' => __('Show the top section of listing page', 'geodirectory'), |
|
177 | + 'id' => 'geodir_show_listing_top_section', |
|
178 | + 'type' => 'checkbox', |
|
179 | + 'std' => '1' // Default value to show home top section |
|
180 | + ), |
|
181 | 181 | |
182 | - array( |
|
183 | - 'name' => __('Listing right section', 'geodirectory'), |
|
184 | - 'desc' => __('Show the right section of listing page', 'geodirectory'), |
|
185 | - 'id' => 'geodir_show_listing_right_section', |
|
186 | - 'type' => 'checkbox', |
|
187 | - 'std' => '1' // Default value to show home top section |
|
188 | - ), |
|
182 | + array( |
|
183 | + 'name' => __('Listing right section', 'geodirectory'), |
|
184 | + 'desc' => __('Show the right section of listing page', 'geodirectory'), |
|
185 | + 'id' => 'geodir_show_listing_right_section', |
|
186 | + 'type' => 'checkbox', |
|
187 | + 'std' => '1' // Default value to show home top section |
|
188 | + ), |
|
189 | 189 | |
190 | - array( |
|
191 | - 'name' => __('Width of listing right section', 'geodirectory'), |
|
192 | - 'desc' => __('Enter the width of right section of listing page in %', 'geodirectory'), |
|
193 | - 'id' => 'geodir_width_listing_right_section', |
|
194 | - 'type' => 'text', |
|
195 | - 'css' => 'min-width:300px;', |
|
196 | - 'std' => '30' // Default value to show home top section |
|
197 | - ), |
|
190 | + array( |
|
191 | + 'name' => __('Width of listing right section', 'geodirectory'), |
|
192 | + 'desc' => __('Enter the width of right section of listing page in %', 'geodirectory'), |
|
193 | + 'id' => 'geodir_width_listing_right_section', |
|
194 | + 'type' => 'text', |
|
195 | + 'css' => 'min-width:300px;', |
|
196 | + 'std' => '30' // Default value to show home top section |
|
197 | + ), |
|
198 | 198 | |
199 | 199 | |
200 | - array( |
|
201 | - 'name' => __('Listing content section view', 'geodirectory'), |
|
202 | - 'desc' => __('Set the listing view of listing page', 'geodirectory'), |
|
203 | - 'id' => 'geodir_listing_view', |
|
204 | - 'css' => 'min-width:300px;', |
|
205 | - 'std' => 'gridview_onehalf', |
|
206 | - 'type' => 'select', |
|
207 | - 'class' => 'chosen_select', |
|
208 | - 'options' => array_unique(array( |
|
209 | - 'gridview_onehalf' => __('Grid View (Two Columns)', 'geodirectory'), |
|
210 | - 'gridview_onethird' => __('Grid View (Three Columns)', 'geodirectory'), |
|
211 | - 'gridview_onefourth' => __('Grid View (Four Columns)', 'geodirectory'), |
|
212 | - 'gridview_onefifth' => __('Grid View (Five Columns)', 'geodirectory'), |
|
213 | - 'listview' => __('List view', 'geodirectory'), |
|
214 | - )) |
|
215 | - ), |
|
200 | + array( |
|
201 | + 'name' => __('Listing content section view', 'geodirectory'), |
|
202 | + 'desc' => __('Set the listing view of listing page', 'geodirectory'), |
|
203 | + 'id' => 'geodir_listing_view', |
|
204 | + 'css' => 'min-width:300px;', |
|
205 | + 'std' => 'gridview_onehalf', |
|
206 | + 'type' => 'select', |
|
207 | + 'class' => 'chosen_select', |
|
208 | + 'options' => array_unique(array( |
|
209 | + 'gridview_onehalf' => __('Grid View (Two Columns)', 'geodirectory'), |
|
210 | + 'gridview_onethird' => __('Grid View (Three Columns)', 'geodirectory'), |
|
211 | + 'gridview_onefourth' => __('Grid View (Four Columns)', 'geodirectory'), |
|
212 | + 'gridview_onefifth' => __('Grid View (Five Columns)', 'geodirectory'), |
|
213 | + 'listview' => __('List view', 'geodirectory'), |
|
214 | + )) |
|
215 | + ), |
|
216 | 216 | |
217 | - array( |
|
218 | - 'name' => __('Width of listing content section', 'geodirectory'), |
|
219 | - 'desc' => __('Enter the width of content section of listing page in %', 'geodirectory'), |
|
220 | - 'id' => 'geodir_width_listing_contant_section', |
|
221 | - 'type' => 'text', |
|
222 | - 'css' => 'min-width:300px;', |
|
223 | - 'std' => '63' // Default value to show home top section |
|
224 | - ), |
|
217 | + array( |
|
218 | + 'name' => __('Width of listing content section', 'geodirectory'), |
|
219 | + 'desc' => __('Enter the width of content section of listing page in %', 'geodirectory'), |
|
220 | + 'id' => 'geodir_width_listing_contant_section', |
|
221 | + 'type' => 'text', |
|
222 | + 'css' => 'min-width:300px;', |
|
223 | + 'std' => '63' // Default value to show home top section |
|
224 | + ), |
|
225 | 225 | |
226 | - array( |
|
227 | - 'name' => __('Listing left section', 'geodirectory'), |
|
228 | - 'desc' => __('Show the left section of listing page', 'geodirectory'), |
|
229 | - 'id' => 'geodir_show_listing_left_section', |
|
230 | - 'type' => 'checkbox', |
|
231 | - 'std' => '0' // Default value to show home top section |
|
232 | - ), |
|
226 | + array( |
|
227 | + 'name' => __('Listing left section', 'geodirectory'), |
|
228 | + 'desc' => __('Show the left section of listing page', 'geodirectory'), |
|
229 | + 'id' => 'geodir_show_listing_left_section', |
|
230 | + 'type' => 'checkbox', |
|
231 | + 'std' => '0' // Default value to show home top section |
|
232 | + ), |
|
233 | 233 | |
234 | - array( |
|
235 | - 'name' => __('Width of listing left section', 'geodirectory'), |
|
236 | - 'desc' => __('Enter the width of left section of listing in %', 'geodirectory'), |
|
237 | - 'id' => 'geodir_width_listing_left_section', |
|
238 | - 'type' => 'text', |
|
239 | - 'css' => 'min-width:300px;', |
|
240 | - 'std' => '30' // Default value to show home top section |
|
241 | - ), |
|
234 | + array( |
|
235 | + 'name' => __('Width of listing left section', 'geodirectory'), |
|
236 | + 'desc' => __('Enter the width of left section of listing in %', 'geodirectory'), |
|
237 | + 'id' => 'geodir_width_listing_left_section', |
|
238 | + 'type' => 'text', |
|
239 | + 'css' => 'min-width:300px;', |
|
240 | + 'std' => '30' // Default value to show home top section |
|
241 | + ), |
|
242 | 242 | |
243 | - array( |
|
244 | - 'name' => __('Listing bottom section', 'geodirectory'), |
|
245 | - 'desc' => __('Show the bottom section of listing page', 'geodirectory'), |
|
246 | - 'id' => 'geodir_show_listing_bottom_section', |
|
247 | - 'type' => 'checkbox', |
|
248 | - 'std' => '0' // Default value to show home top section |
|
249 | - ), |
|
243 | + array( |
|
244 | + 'name' => __('Listing bottom section', 'geodirectory'), |
|
245 | + 'desc' => __('Show the bottom section of listing page', 'geodirectory'), |
|
246 | + 'id' => 'geodir_show_listing_bottom_section', |
|
247 | + 'type' => 'checkbox', |
|
248 | + 'std' => '0' // Default value to show home top section |
|
249 | + ), |
|
250 | 250 | |
251 | - array( |
|
252 | - 'name' => __('Upload listing no image', 'geodirectory'), |
|
253 | - 'desc' => '', |
|
254 | - 'id' => 'geodir_listing_no_img', |
|
255 | - 'type' => 'file', |
|
256 | - 'std' => '0' // Default value to show home top section |
|
257 | - ), |
|
251 | + array( |
|
252 | + 'name' => __('Upload listing no image', 'geodirectory'), |
|
253 | + 'desc' => '', |
|
254 | + 'id' => 'geodir_listing_no_img', |
|
255 | + 'type' => 'file', |
|
256 | + 'std' => '0' // Default value to show home top section |
|
257 | + ), |
|
258 | 258 | |
259 | - array( |
|
260 | - 'name' => __('Description word limit', 'geodirectory'), |
|
261 | - 'desc' => '', |
|
262 | - 'id' => 'geodir_desc_word_limit', |
|
263 | - 'type' => 'text', |
|
264 | - 'css' => 'min-width:300px;', |
|
265 | - 'std' => '50' // Default value to show home top section |
|
266 | - ), |
|
259 | + array( |
|
260 | + 'name' => __('Description word limit', 'geodirectory'), |
|
261 | + 'desc' => '', |
|
262 | + 'id' => 'geodir_desc_word_limit', |
|
263 | + 'type' => 'text', |
|
264 | + 'css' => 'min-width:300px;', |
|
265 | + 'std' => '50' // Default value to show home top section |
|
266 | + ), |
|
267 | 267 | |
268 | - array('type' => 'sectionend', 'id' => 'geodir_listing_layout'), |
|
268 | + array('type' => 'sectionend', 'id' => 'geodir_listing_layout'), |
|
269 | 269 | |
270 | 270 | |
271 | - array('name' => __('Listing General Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_listing_gen_settings '), |
|
271 | + array('name' => __('Listing General Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_listing_gen_settings '), |
|
272 | 272 | |
273 | - array( |
|
274 | - 'name' => __('New listing default status', 'geodirectory'), |
|
275 | - 'desc' => __('Select new listing default status.', 'geodirectory'), |
|
276 | - 'tip' => '', |
|
277 | - 'id' => 'geodir_new_post_default_status', |
|
278 | - 'css' => 'min-width:300px;', |
|
279 | - 'std' => 'publish', |
|
280 | - 'type' => 'select', |
|
281 | - 'class' => 'chosen_select', |
|
282 | - 'options' => array_unique(array( |
|
283 | - 'publish' => __('publish', 'geodirectory'), |
|
284 | - 'draft' => __('draft', 'geodirectory'), |
|
285 | - )) |
|
286 | - ), |
|
273 | + array( |
|
274 | + 'name' => __('New listing default status', 'geodirectory'), |
|
275 | + 'desc' => __('Select new listing default status.', 'geodirectory'), |
|
276 | + 'tip' => '', |
|
277 | + 'id' => 'geodir_new_post_default_status', |
|
278 | + 'css' => 'min-width:300px;', |
|
279 | + 'std' => 'publish', |
|
280 | + 'type' => 'select', |
|
281 | + 'class' => 'chosen_select', |
|
282 | + 'options' => array_unique(array( |
|
283 | + 'publish' => __('publish', 'geodirectory'), |
|
284 | + 'draft' => __('draft', 'geodirectory'), |
|
285 | + )) |
|
286 | + ), |
|
287 | 287 | |
288 | - array( |
|
289 | - 'name' => __('New listings settings', 'geodirectory'), |
|
290 | - 'desc' => __('Enter number of days a listing will appear new.(enter 0 to disable feature)', 'geodirectory'), |
|
291 | - 'id' => 'geodir_listing_new_days', |
|
292 | - 'type' => 'text', |
|
293 | - 'css' => 'min-width:300px;', |
|
294 | - 'std' => '30' // Default value for the page title - changed in settings |
|
295 | - ), |
|
288 | + array( |
|
289 | + 'name' => __('New listings settings', 'geodirectory'), |
|
290 | + 'desc' => __('Enter number of days a listing will appear new.(enter 0 to disable feature)', 'geodirectory'), |
|
291 | + 'id' => 'geodir_listing_new_days', |
|
292 | + 'type' => 'text', |
|
293 | + 'css' => 'min-width:300px;', |
|
294 | + 'std' => '30' // Default value for the page title - changed in settings |
|
295 | + ), |
|
296 | 296 | |
297 | - array('type' => 'sectionend', 'id' => 'geodir_listing_gen_settings'), |
|
297 | + array('type' => 'sectionend', 'id' => 'geodir_listing_gen_settings'), |
|
298 | 298 | |
299 | 299 | |
300 | - array('name' => __('Add Listing Form Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_add_listing_gen_settings'), |
|
300 | + array('name' => __('Add Listing Form Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_add_listing_gen_settings'), |
|
301 | 301 | |
302 | - array( |
|
303 | - 'name' => __('Enable "Accept Terms and Conditions"', 'geodirectory'), |
|
304 | - 'desc' => __('Show the "Accept Terms and Conditions" field on add listing.', 'geodirectory'), |
|
305 | - 'id' => 'geodir_accept_term_condition', |
|
306 | - 'type' => 'checkbox', |
|
307 | - 'std' => '1' // Default value to show home top section |
|
308 | - ), |
|
302 | + array( |
|
303 | + 'name' => __('Enable "Accept Terms and Conditions"', 'geodirectory'), |
|
304 | + 'desc' => __('Show the "Accept Terms and Conditions" field on add listing.', 'geodirectory'), |
|
305 | + 'id' => 'geodir_accept_term_condition', |
|
306 | + 'type' => 'checkbox', |
|
307 | + 'std' => '1' // Default value to show home top section |
|
308 | + ), |
|
309 | 309 | |
310 | 310 | |
311 | - array( |
|
312 | - 'name' => __('Show description field as editor', 'geodirectory'), |
|
313 | - 'desc' => __('Select post types to show advanced editor on add listing page.', 'geodirectory'), |
|
314 | - 'tip' => '', |
|
315 | - 'id' => 'geodir_tiny_editor_on_add_listing', |
|
316 | - 'css' => 'min-width:300px;', |
|
317 | - 'std' => array(), |
|
318 | - 'type' => 'multiselect', |
|
319 | - 'placeholder_text' => __('Select post types', 'geodirectory'), |
|
320 | - 'class' => 'chosen_select', |
|
321 | - 'options' => array_unique(geodir_post_type_setting_fun()) |
|
322 | - ), |
|
311 | + array( |
|
312 | + 'name' => __('Show description field as editor', 'geodirectory'), |
|
313 | + 'desc' => __('Select post types to show advanced editor on add listing page.', 'geodirectory'), |
|
314 | + 'tip' => '', |
|
315 | + 'id' => 'geodir_tiny_editor_on_add_listing', |
|
316 | + 'css' => 'min-width:300px;', |
|
317 | + 'std' => array(), |
|
318 | + 'type' => 'multiselect', |
|
319 | + 'placeholder_text' => __('Select post types', 'geodirectory'), |
|
320 | + 'class' => 'chosen_select', |
|
321 | + 'options' => array_unique(geodir_post_type_setting_fun()) |
|
322 | + ), |
|
323 | 323 | |
324 | - array('type' => 'sectionend', 'id' => 'geodir_add_listing_gen_settings'), |
|
325 | - /* Listing Layout Settings end */ |
|
324 | + array('type' => 'sectionend', 'id' => 'geodir_add_listing_gen_settings'), |
|
325 | + /* Listing Layout Settings end */ |
|
326 | 326 | |
327 | 327 | |
328 | - /* Search Layout Settings end */ |
|
328 | + /* Search Layout Settings end */ |
|
329 | 329 | |
330 | - array('name' => __('Search', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_search_settings '), |
|
330 | + array('name' => __('Search', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_search_settings '), |
|
331 | 331 | |
332 | 332 | |
333 | - array('name' => __('Search Page Layout Settings', 'geodirectory'), |
|
334 | - 'type' => 'sectionstart', |
|
335 | - 'desc' => '', |
|
336 | - 'id' => 'geodir_search_layout'), |
|
333 | + array('name' => __('Search Page Layout Settings', 'geodirectory'), |
|
334 | + 'type' => 'sectionstart', |
|
335 | + 'desc' => '', |
|
336 | + 'id' => 'geodir_search_layout'), |
|
337 | 337 | |
338 | - array( |
|
339 | - 'name' => __('Search top section', 'geodirectory'), |
|
340 | - 'desc' => __('Show the top section of search page', 'geodirectory'), |
|
341 | - 'id' => 'geodir_show_search_top_section', |
|
342 | - 'type' => 'checkbox', |
|
343 | - 'std' => '1' // Default value to show home top section |
|
344 | - ), |
|
338 | + array( |
|
339 | + 'name' => __('Search top section', 'geodirectory'), |
|
340 | + 'desc' => __('Show the top section of search page', 'geodirectory'), |
|
341 | + 'id' => 'geodir_show_search_top_section', |
|
342 | + 'type' => 'checkbox', |
|
343 | + 'std' => '1' // Default value to show home top section |
|
344 | + ), |
|
345 | 345 | |
346 | - array( |
|
347 | - 'name' => __('Search right section', 'geodirectory'), |
|
348 | - 'desc' => __('Show the right section of search page', 'geodirectory'), |
|
349 | - 'id' => 'geodir_show_search_right_section', |
|
350 | - 'type' => 'checkbox', |
|
351 | - 'std' => '1' // Default value to show home top section |
|
352 | - ), |
|
346 | + array( |
|
347 | + 'name' => __('Search right section', 'geodirectory'), |
|
348 | + 'desc' => __('Show the right section of search page', 'geodirectory'), |
|
349 | + 'id' => 'geodir_show_search_right_section', |
|
350 | + 'type' => 'checkbox', |
|
351 | + 'std' => '1' // Default value to show home top section |
|
352 | + ), |
|
353 | 353 | |
354 | - array( |
|
355 | - 'name' => __('Width of search right section', 'geodirectory'), |
|
356 | - 'desc' => __('Enter the width of right section of search page in %', 'geodirectory'), |
|
357 | - 'id' => 'geodir_width_search_right_section', |
|
358 | - 'type' => 'text', |
|
359 | - 'css' => 'min-width:300px;', |
|
360 | - 'std' => '30' // Default value to show home top section |
|
361 | - ), |
|
354 | + array( |
|
355 | + 'name' => __('Width of search right section', 'geodirectory'), |
|
356 | + 'desc' => __('Enter the width of right section of search page in %', 'geodirectory'), |
|
357 | + 'id' => 'geodir_width_search_right_section', |
|
358 | + 'type' => 'text', |
|
359 | + 'css' => 'min-width:300px;', |
|
360 | + 'std' => '30' // Default value to show home top section |
|
361 | + ), |
|
362 | 362 | |
363 | 363 | |
364 | - array( |
|
365 | - 'name' => __('Search content section view', 'geodirectory'), |
|
366 | - 'desc' => __('Set the listing view of search page', 'geodirectory'), |
|
367 | - 'id' => 'geodir_search_view', |
|
368 | - 'css' => 'min-width:300px;', |
|
369 | - 'std' => 'gridview_onehalf', |
|
370 | - 'type' => 'select', |
|
371 | - 'class' => 'chosen_select', |
|
372 | - 'options' => array_unique(array( |
|
373 | - 'gridview_onehalf' => __('Grid View (Two Columns)', 'geodirectory'), |
|
374 | - 'gridview_onethird' => __('Grid View (Three Columns)', 'geodirectory'), |
|
375 | - 'gridview_onefourth' => __('Grid View (Four Columns)', 'geodirectory'), |
|
376 | - 'gridview_onefifth' => __('Grid View (Five Columns)', 'geodirectory'), |
|
377 | - 'listview' => __('List view', 'geodirectory'), |
|
378 | - )) |
|
379 | - ), |
|
364 | + array( |
|
365 | + 'name' => __('Search content section view', 'geodirectory'), |
|
366 | + 'desc' => __('Set the listing view of search page', 'geodirectory'), |
|
367 | + 'id' => 'geodir_search_view', |
|
368 | + 'css' => 'min-width:300px;', |
|
369 | + 'std' => 'gridview_onehalf', |
|
370 | + 'type' => 'select', |
|
371 | + 'class' => 'chosen_select', |
|
372 | + 'options' => array_unique(array( |
|
373 | + 'gridview_onehalf' => __('Grid View (Two Columns)', 'geodirectory'), |
|
374 | + 'gridview_onethird' => __('Grid View (Three Columns)', 'geodirectory'), |
|
375 | + 'gridview_onefourth' => __('Grid View (Four Columns)', 'geodirectory'), |
|
376 | + 'gridview_onefifth' => __('Grid View (Five Columns)', 'geodirectory'), |
|
377 | + 'listview' => __('List view', 'geodirectory'), |
|
378 | + )) |
|
379 | + ), |
|
380 | 380 | |
381 | - array( |
|
382 | - 'name' => __('Width of search content section', 'geodirectory'), |
|
383 | - 'desc' => __('Enter the width of content section of search page in %', 'geodirectory'), |
|
384 | - 'id' => 'geodir_width_search_contant_section', |
|
385 | - 'type' => 'text', |
|
386 | - 'css' => 'min-width:300px;', |
|
387 | - 'std' => '63' // Default value to show home top section |
|
388 | - ), |
|
381 | + array( |
|
382 | + 'name' => __('Width of search content section', 'geodirectory'), |
|
383 | + 'desc' => __('Enter the width of content section of search page in %', 'geodirectory'), |
|
384 | + 'id' => 'geodir_width_search_contant_section', |
|
385 | + 'type' => 'text', |
|
386 | + 'css' => 'min-width:300px;', |
|
387 | + 'std' => '63' // Default value to show home top section |
|
388 | + ), |
|
389 | 389 | |
390 | - array( |
|
391 | - 'name' => __('Search left section', 'geodirectory'), |
|
392 | - 'desc' => __('Show the left section of search page', 'geodirectory'), |
|
393 | - 'id' => 'geodir_show_search_left_section', |
|
394 | - 'type' => 'checkbox', |
|
395 | - 'std' => '0' // Default value to show home top section |
|
396 | - ), |
|
390 | + array( |
|
391 | + 'name' => __('Search left section', 'geodirectory'), |
|
392 | + 'desc' => __('Show the left section of search page', 'geodirectory'), |
|
393 | + 'id' => 'geodir_show_search_left_section', |
|
394 | + 'type' => 'checkbox', |
|
395 | + 'std' => '0' // Default value to show home top section |
|
396 | + ), |
|
397 | 397 | |
398 | - array( |
|
399 | - 'name' => __('Width of search left section', 'geodirectory'), |
|
400 | - 'desc' => __('Enter the width of left section of search in %', 'geodirectory'), |
|
401 | - 'id' => 'geodir_width_search_left_section', |
|
402 | - 'type' => 'text', |
|
403 | - 'css' => 'min-width:300px;', |
|
404 | - 'std' => '30' // Default value to show home top section |
|
405 | - ), |
|
398 | + array( |
|
399 | + 'name' => __('Width of search left section', 'geodirectory'), |
|
400 | + 'desc' => __('Enter the width of left section of search in %', 'geodirectory'), |
|
401 | + 'id' => 'geodir_width_search_left_section', |
|
402 | + 'type' => 'text', |
|
403 | + 'css' => 'min-width:300px;', |
|
404 | + 'std' => '30' // Default value to show home top section |
|
405 | + ), |
|
406 | 406 | |
407 | - array( |
|
408 | - 'name' => __('Search bottom section', 'geodirectory'), |
|
409 | - 'desc' => __('Show the bottom section of search page', 'geodirectory'), |
|
410 | - 'id' => 'geodir_show_search_bottom_section', |
|
411 | - 'type' => 'checkbox', |
|
412 | - 'std' => '0' // Default value to show home top section |
|
413 | - ), |
|
407 | + array( |
|
408 | + 'name' => __('Search bottom section', 'geodirectory'), |
|
409 | + 'desc' => __('Show the bottom section of search page', 'geodirectory'), |
|
410 | + 'id' => 'geodir_show_search_bottom_section', |
|
411 | + 'type' => 'checkbox', |
|
412 | + 'std' => '0' // Default value to show home top section |
|
413 | + ), |
|
414 | 414 | |
415 | 415 | array( |
416 | - 'name' => __('Show advanced pagination details', 'geodirectory'), |
|
417 | - 'desc' => __('This will add extra pagination info like "Showing listings x-y of z" aftre/before pagination.', 'geodirectory'), |
|
418 | - 'id' => 'geodir_pagination_advance_info', |
|
419 | - 'css' => 'min-width:300px;', |
|
420 | - 'std' => '', |
|
421 | - 'type' => 'select', |
|
422 | - 'class' => 'chosen_select', |
|
423 | - 'options' => array( |
|
416 | + 'name' => __('Show advanced pagination details', 'geodirectory'), |
|
417 | + 'desc' => __('This will add extra pagination info like "Showing listings x-y of z" aftre/before pagination.', 'geodirectory'), |
|
418 | + 'id' => 'geodir_pagination_advance_info', |
|
419 | + 'css' => 'min-width:300px;', |
|
420 | + 'std' => '', |
|
421 | + 'type' => 'select', |
|
422 | + 'class' => 'chosen_select', |
|
423 | + 'options' => array( |
|
424 | 424 | '' => __('Never Display', 'geodirectory'), |
425 | 425 | 'after' => __('After Pagination', 'geodirectory'), |
426 | 426 | 'before' => __('Before Pagination', 'geodirectory') |
427 | 427 | ) |
428 | - ), |
|
428 | + ), |
|
429 | 429 | |
430 | - array('type' => 'sectionend', 'id' => 'geodir_search_layout'), |
|
430 | + array('type' => 'sectionend', 'id' => 'geodir_search_layout'), |
|
431 | 431 | |
432 | 432 | |
433 | - array('name' => __('Search form default text settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_search_form_default_text_settings'), |
|
433 | + array('name' => __('Search form default text settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_search_form_default_text_settings'), |
|
434 | 434 | |
435 | - array( |
|
436 | - 'name' => __('Search field default value', 'geodirectory'), |
|
437 | - 'desc' => __('Show the search text box \'placeholder\' value on search form.', 'geodirectory'), |
|
438 | - 'id' => 'geodir_search_field_default_text', |
|
439 | - 'type' => 'text', |
|
440 | - 'css' => 'min-width:300px;', |
|
441 | - 'std' => 'Search for' // show on the listing page. |
|
442 | - ), |
|
435 | + array( |
|
436 | + 'name' => __('Search field default value', 'geodirectory'), |
|
437 | + 'desc' => __('Show the search text box \'placeholder\' value on search form.', 'geodirectory'), |
|
438 | + 'id' => 'geodir_search_field_default_text', |
|
439 | + 'type' => 'text', |
|
440 | + 'css' => 'min-width:300px;', |
|
441 | + 'std' => 'Search for' // show on the listing page. |
|
442 | + ), |
|
443 | 443 | |
444 | - array( |
|
445 | - 'name' => __('Near field default value', 'geodirectory'), |
|
446 | - 'desc' => __('Show the near text box \'placeholder\' value on search form.', 'geodirectory'), |
|
447 | - 'id' => 'geodir_near_field_default_text', |
|
448 | - 'type' => 'text', |
|
449 | - 'css' => 'min-width:300px;', |
|
450 | - 'std' => 'Near' // show on the listing page. |
|
451 | - ), |
|
444 | + array( |
|
445 | + 'name' => __('Near field default value', 'geodirectory'), |
|
446 | + 'desc' => __('Show the near text box \'placeholder\' value on search form.', 'geodirectory'), |
|
447 | + 'id' => 'geodir_near_field_default_text', |
|
448 | + 'type' => 'text', |
|
449 | + 'css' => 'min-width:300px;', |
|
450 | + 'std' => 'Near' // show on the listing page. |
|
451 | + ), |
|
452 | 452 | |
453 | - array( |
|
454 | - 'name' => __('Search button label', 'geodirectory'), |
|
455 | - 'desc' => __('Show the search button label on search form.', 'geodirectory'), |
|
456 | - 'id' => 'geodir_search_button_label', |
|
457 | - 'type' => 'text', |
|
458 | - 'css' => 'min-width:300px;', |
|
459 | - 'std' => 'Search' // show on the listing page. |
|
460 | - ), |
|
453 | + array( |
|
454 | + 'name' => __('Search button label', 'geodirectory'), |
|
455 | + 'desc' => __('Show the search button label on search form.', 'geodirectory'), |
|
456 | + 'id' => 'geodir_search_button_label', |
|
457 | + 'type' => 'text', |
|
458 | + 'css' => 'min-width:300px;', |
|
459 | + 'std' => 'Search' // show on the listing page. |
|
460 | + ), |
|
461 | 461 | |
462 | - array('type' => 'sectionend', 'id' => 'geodir_search_form_default_text_settings'), |
|
462 | + array('type' => 'sectionend', 'id' => 'geodir_search_form_default_text_settings'), |
|
463 | 463 | |
464 | - /* Listing Layout Settings end */ |
|
464 | + /* Listing Layout Settings end */ |
|
465 | 465 | |
466 | 466 | |
467 | - /* Detail Layout Settings end */ |
|
467 | + /* Detail Layout Settings end */ |
|
468 | 468 | |
469 | - array('name' => __('Detail', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_detail_settings '), |
|
469 | + array('name' => __('Detail', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_detail_settings '), |
|
470 | 470 | |
471 | - array('name' => __('Detail/Single Page Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'detail_page_settings '), |
|
471 | + array('name' => __('Detail/Single Page Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'detail_page_settings '), |
|
472 | 472 | |
473 | - array( |
|
474 | - 'name' => __('Detail top section', 'geodirectory'), |
|
475 | - 'desc' => __('Show the top section of listing page', 'geodirectory'), |
|
476 | - 'id' => 'geodir_show_detail_top_section', |
|
477 | - 'type' => 'checkbox', |
|
478 | - 'std' => '1' // Default value to show home top section |
|
479 | - ), |
|
473 | + array( |
|
474 | + 'name' => __('Detail top section', 'geodirectory'), |
|
475 | + 'desc' => __('Show the top section of listing page', 'geodirectory'), |
|
476 | + 'id' => 'geodir_show_detail_top_section', |
|
477 | + 'type' => 'checkbox', |
|
478 | + 'std' => '1' // Default value to show home top section |
|
479 | + ), |
|
480 | 480 | |
481 | - array( |
|
482 | - 'name' => __('Detail bottom section', 'geodirectory'), |
|
483 | - 'desc' => __('Show the bottom section of listing page', 'geodirectory'), |
|
484 | - 'id' => 'geodir_show_detail_bottom_section', |
|
485 | - 'type' => 'checkbox', |
|
486 | - 'std' => '1' // Default value to show home top section |
|
487 | - ), |
|
488 | - array( |
|
489 | - 'name' => __('Detail sidebar section on left side', 'geodirectory'), |
|
490 | - 'desc' => __('Display detail sidebar section on left side of the detail page', 'geodirectory'), |
|
491 | - 'id' => 'geodir_detail_sidebar_left_section', |
|
492 | - 'type' => 'checkbox', |
|
493 | - 'std' => '0' |
|
494 | - ), |
|
495 | - array( |
|
496 | - 'name' => __('Disable GD modal', 'geodirectory'), |
|
497 | - 'desc' => __('Disable GD modal that displays slideshow images in popup', 'geodirectory'), |
|
498 | - 'id' => 'geodir_disable_gb_modal', |
|
499 | - 'type' => 'checkbox', |
|
500 | - 'std' => '0' |
|
501 | - ), |
|
502 | - array( |
|
503 | - 'name' => __('Disable Tweet, Fb Like, Google+ buttons section', 'geodirectory'), |
|
504 | - 'desc' => __('Disable Tweet, Fb Like, Google+ buttons section that displays on Detail page sidebar', 'geodirectory'), |
|
505 | - 'id' => 'geodir_disable_tfg_buttons_section', |
|
506 | - 'type' => 'checkbox', |
|
507 | - 'std' => '0' |
|
508 | - ), |
|
509 | - array( |
|
510 | - 'name' => __('Disable share this button section', 'geodirectory'), |
|
511 | - 'desc' => __('Disable share this button section that displays on Detail page sidebar', 'geodirectory'), |
|
512 | - 'id' => 'geodir_disable_sharethis_button_section', |
|
513 | - 'type' => 'checkbox', |
|
514 | - 'std' => '0' |
|
515 | - ), |
|
516 | - array( |
|
517 | - 'name' => __('Disable Google Analytics section', 'geodirectory'), |
|
518 | - 'desc' => __('Disable Google Analytics section that displays on Detail page sidebar', 'geodirectory'), |
|
519 | - 'id' => 'geodir_disable_google_analytics_section', |
|
520 | - 'type' => 'checkbox', |
|
521 | - 'std' => '0' |
|
522 | - ), |
|
523 | - array( |
|
524 | - 'name' => __('Disable User Links section', 'geodirectory'), |
|
525 | - 'desc' => __('Disable User Links section (Edit post, Favorite etc..) that displays on Detail page sidebar', 'geodirectory'), |
|
526 | - 'id' => 'geodir_disable_user_links_section', |
|
527 | - 'type' => 'checkbox', |
|
528 | - 'std' => '0' |
|
529 | - ), |
|
530 | - array( |
|
531 | - 'name' => __('Disable Rating Info section', 'geodirectory'), |
|
532 | - 'desc' => __('Disable Rating Info section that displays on Detail page sidebar', 'geodirectory'), |
|
533 | - 'id' => 'geodir_disable_rating_info_section', |
|
534 | - 'type' => 'checkbox', |
|
535 | - 'std' => '0' |
|
536 | - ), |
|
537 | - array( |
|
538 | - 'name' => __('Disable Listing Info section', 'geodirectory'), |
|
539 | - 'desc' => __('Disable Listing Info section that displays on Detail page sidebar', 'geodirectory'), |
|
540 | - 'id' => 'geodir_disable_listing_info_section', |
|
541 | - 'type' => 'checkbox', |
|
542 | - 'std' => '0' |
|
543 | - ), |
|
481 | + array( |
|
482 | + 'name' => __('Detail bottom section', 'geodirectory'), |
|
483 | + 'desc' => __('Show the bottom section of listing page', 'geodirectory'), |
|
484 | + 'id' => 'geodir_show_detail_bottom_section', |
|
485 | + 'type' => 'checkbox', |
|
486 | + 'std' => '1' // Default value to show home top section |
|
487 | + ), |
|
488 | + array( |
|
489 | + 'name' => __('Detail sidebar section on left side', 'geodirectory'), |
|
490 | + 'desc' => __('Display detail sidebar section on left side of the detail page', 'geodirectory'), |
|
491 | + 'id' => 'geodir_detail_sidebar_left_section', |
|
492 | + 'type' => 'checkbox', |
|
493 | + 'std' => '0' |
|
494 | + ), |
|
495 | + array( |
|
496 | + 'name' => __('Disable GD modal', 'geodirectory'), |
|
497 | + 'desc' => __('Disable GD modal that displays slideshow images in popup', 'geodirectory'), |
|
498 | + 'id' => 'geodir_disable_gb_modal', |
|
499 | + 'type' => 'checkbox', |
|
500 | + 'std' => '0' |
|
501 | + ), |
|
502 | + array( |
|
503 | + 'name' => __('Disable Tweet, Fb Like, Google+ buttons section', 'geodirectory'), |
|
504 | + 'desc' => __('Disable Tweet, Fb Like, Google+ buttons section that displays on Detail page sidebar', 'geodirectory'), |
|
505 | + 'id' => 'geodir_disable_tfg_buttons_section', |
|
506 | + 'type' => 'checkbox', |
|
507 | + 'std' => '0' |
|
508 | + ), |
|
509 | + array( |
|
510 | + 'name' => __('Disable share this button section', 'geodirectory'), |
|
511 | + 'desc' => __('Disable share this button section that displays on Detail page sidebar', 'geodirectory'), |
|
512 | + 'id' => 'geodir_disable_sharethis_button_section', |
|
513 | + 'type' => 'checkbox', |
|
514 | + 'std' => '0' |
|
515 | + ), |
|
516 | + array( |
|
517 | + 'name' => __('Disable Google Analytics section', 'geodirectory'), |
|
518 | + 'desc' => __('Disable Google Analytics section that displays on Detail page sidebar', 'geodirectory'), |
|
519 | + 'id' => 'geodir_disable_google_analytics_section', |
|
520 | + 'type' => 'checkbox', |
|
521 | + 'std' => '0' |
|
522 | + ), |
|
523 | + array( |
|
524 | + 'name' => __('Disable User Links section', 'geodirectory'), |
|
525 | + 'desc' => __('Disable User Links section (Edit post, Favorite etc..) that displays on Detail page sidebar', 'geodirectory'), |
|
526 | + 'id' => 'geodir_disable_user_links_section', |
|
527 | + 'type' => 'checkbox', |
|
528 | + 'std' => '0' |
|
529 | + ), |
|
530 | + array( |
|
531 | + 'name' => __('Disable Rating Info section', 'geodirectory'), |
|
532 | + 'desc' => __('Disable Rating Info section that displays on Detail page sidebar', 'geodirectory'), |
|
533 | + 'id' => 'geodir_disable_rating_info_section', |
|
534 | + 'type' => 'checkbox', |
|
535 | + 'std' => '0' |
|
536 | + ), |
|
537 | + array( |
|
538 | + 'name' => __('Disable Listing Info section', 'geodirectory'), |
|
539 | + 'desc' => __('Disable Listing Info section that displays on Detail page sidebar', 'geodirectory'), |
|
540 | + 'id' => 'geodir_disable_listing_info_section', |
|
541 | + 'type' => 'checkbox', |
|
542 | + 'std' => '0' |
|
543 | + ), |
|
544 | 544 | |
545 | - array('type' => 'sectionend', 'id' => 'detail_page_settings'), |
|
545 | + array('type' => 'sectionend', 'id' => 'detail_page_settings'), |
|
546 | 546 | |
547 | 547 | |
548 | - /* ---------- DETAIL PAGE TAB SETTING START*/ |
|
548 | + /* ---------- DETAIL PAGE TAB SETTING START*/ |
|
549 | 549 | |
550 | - array('name' => __('Detail Page Tab Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_detail_page_tab_settings '), |
|
550 | + array('name' => __('Detail Page Tab Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_detail_page_tab_settings '), |
|
551 | 551 | |
552 | - array( |
|
553 | - 'name' => __('Exclude selected tabs from detail page', 'geodirectory'), |
|
554 | - 'desc' => __('Select tabs to exclude from the list of all appearing tabs on detail page.', 'geodirectory'), |
|
555 | - 'tip' => '', |
|
556 | - 'id' => 'geodir_detail_page_tabs_excluded', |
|
557 | - 'css' => 'min-width:300px;', |
|
558 | - 'std' => geodir_get_posttypes(), |
|
559 | - 'type' => 'multiselect', |
|
560 | - 'placeholder_text' => __('Select tabs', 'geodirectory'), |
|
561 | - 'class' => 'chosen_select', |
|
562 | - 'options' => array_unique(geodir_detail_page_tabs_key_value_array()) |
|
563 | - ), |
|
552 | + array( |
|
553 | + 'name' => __('Exclude selected tabs from detail page', 'geodirectory'), |
|
554 | + 'desc' => __('Select tabs to exclude from the list of all appearing tabs on detail page.', 'geodirectory'), |
|
555 | + 'tip' => '', |
|
556 | + 'id' => 'geodir_detail_page_tabs_excluded', |
|
557 | + 'css' => 'min-width:300px;', |
|
558 | + 'std' => geodir_get_posttypes(), |
|
559 | + 'type' => 'multiselect', |
|
560 | + 'placeholder_text' => __('Select tabs', 'geodirectory'), |
|
561 | + 'class' => 'chosen_select', |
|
562 | + 'options' => array_unique(geodir_detail_page_tabs_key_value_array()) |
|
563 | + ), |
|
564 | 564 | |
565 | 565 | |
566 | - array('type' => 'sectionend', 'id' => 'geodir_detail_page_tab_settings'), |
|
567 | - /* ---------- DETAIL PAGE TAB SETTING END*/ |
|
566 | + array('type' => 'sectionend', 'id' => 'geodir_detail_page_tab_settings'), |
|
567 | + /* ---------- DETAIL PAGE TAB SETTING END*/ |
|
568 | 568 | |
569 | - /* START DEFAULT STAR IMAGE*/ |
|
570 | - array('name' => __('Default Rating Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_rating_settings '), |
|
569 | + /* START DEFAULT STAR IMAGE*/ |
|
570 | + array('name' => __('Default Rating Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_rating_settings '), |
|
571 | 571 | |
572 | - array( |
|
573 | - 'name' => __('Upload default rating star icon', 'geodirectory'), |
|
574 | - 'desc' => '', |
|
575 | - 'id' => 'geodir_default_rating_star_icon', |
|
576 | - 'type' => 'file', |
|
577 | - 'std' => '0', |
|
578 | - 'value' => geodir_plugin_url() . '/geodirectory-assets/images/stars.png'// Default value to show home top section |
|
579 | - ), |
|
572 | + array( |
|
573 | + 'name' => __('Upload default rating star icon', 'geodirectory'), |
|
574 | + 'desc' => '', |
|
575 | + 'id' => 'geodir_default_rating_star_icon', |
|
576 | + 'type' => 'file', |
|
577 | + 'std' => '0', |
|
578 | + 'value' => geodir_plugin_url() . '/geodirectory-assets/images/stars.png'// Default value to show home top section |
|
579 | + ), |
|
580 | 580 | array( |
581 | 581 | 'name' => __('Enable Font Awesome', 'geodirectory'), |
582 | 582 | 'desc' => __('When enabled all rating images will be using font awesome rating icons as images.', 'geodirectory' ), |
@@ -592,368 +592,368 @@ discard block |
||
592 | 592 | 'std' => '#757575' |
593 | 593 | ), |
594 | 594 | |
595 | - array('type' => 'sectionend', 'id' => 'geodir_detail_page_tab_settings'), |
|
595 | + array('type' => 'sectionend', 'id' => 'geodir_detail_page_tab_settings'), |
|
596 | 596 | |
597 | - /* END DEFAULT STAR IMAGE*/ |
|
597 | + /* END DEFAULT STAR IMAGE*/ |
|
598 | 598 | |
599 | - /* Detail related post settings start */ |
|
599 | + /* Detail related post settings start */ |
|
600 | 600 | |
601 | - array('name' => __('Related Post Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'detail_page_related_post_settings '), |
|
601 | + array('name' => __('Related Post Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'detail_page_related_post_settings '), |
|
602 | 602 | |
603 | - array( |
|
604 | - 'name' => __('Show related post listing on', 'geodirectory'), |
|
605 | - 'desc' => __('Select the post types to display related listing on detail page.', 'geodirectory'), |
|
606 | - 'tip' => '', |
|
607 | - 'id' => 'geodir_add_related_listing_posttypes', |
|
608 | - 'css' => 'min-width:300px;', |
|
609 | - 'std' => geodir_get_posttypes(), |
|
610 | - 'type' => 'multiselect', |
|
611 | - 'placeholder_text' => __('Select post types', 'geodirectory'), |
|
612 | - 'class' => 'chosen_select', |
|
613 | - 'options' => array_unique(geodir_post_type_setting_fun()) |
|
614 | - ), |
|
603 | + array( |
|
604 | + 'name' => __('Show related post listing on', 'geodirectory'), |
|
605 | + 'desc' => __('Select the post types to display related listing on detail page.', 'geodirectory'), |
|
606 | + 'tip' => '', |
|
607 | + 'id' => 'geodir_add_related_listing_posttypes', |
|
608 | + 'css' => 'min-width:300px;', |
|
609 | + 'std' => geodir_get_posttypes(), |
|
610 | + 'type' => 'multiselect', |
|
611 | + 'placeholder_text' => __('Select post types', 'geodirectory'), |
|
612 | + 'class' => 'chosen_select', |
|
613 | + 'options' => array_unique(geodir_post_type_setting_fun()) |
|
614 | + ), |
|
615 | 615 | |
616 | - array( |
|
617 | - 'name' => __('Relate to', 'geodirectory'), |
|
618 | - 'desc' => __('Set the relation between current post to related posts.', 'geodirectory'), |
|
619 | - 'id' => 'geodir_related_post_relate_to', |
|
620 | - 'css' => 'min-width:300px;', |
|
621 | - 'std' => 'category', |
|
622 | - 'type' => 'select', |
|
623 | - 'class' => 'chosen_select', |
|
624 | - 'options' => array_unique(array( |
|
625 | - 'category' => __('Categories', 'geodirectory'), |
|
626 | - 'tags' => __('Tags', 'geodirectory'), |
|
627 | - )) |
|
628 | - ), |
|
616 | + array( |
|
617 | + 'name' => __('Relate to', 'geodirectory'), |
|
618 | + 'desc' => __('Set the relation between current post to related posts.', 'geodirectory'), |
|
619 | + 'id' => 'geodir_related_post_relate_to', |
|
620 | + 'css' => 'min-width:300px;', |
|
621 | + 'std' => 'category', |
|
622 | + 'type' => 'select', |
|
623 | + 'class' => 'chosen_select', |
|
624 | + 'options' => array_unique(array( |
|
625 | + 'category' => __('Categories', 'geodirectory'), |
|
626 | + 'tags' => __('Tags', 'geodirectory'), |
|
627 | + )) |
|
628 | + ), |
|
629 | 629 | |
630 | - array( |
|
631 | - 'name' => __('Layout', 'geodirectory'), |
|
632 | - 'desc' => __('Set the listing view of relate post on detail page', 'geodirectory'), |
|
633 | - 'id' => 'geodir_related_post_listing_view', |
|
634 | - 'css' => 'min-width:300px;', |
|
635 | - 'std' => 'gridview_onehalf', |
|
636 | - 'type' => 'select', |
|
637 | - 'class' => 'chosen_select', |
|
638 | - 'options' => array_unique(array( |
|
639 | - 'gridview_onehalf' => __('Grid View (Two Columns)', 'geodirectory'), |
|
640 | - 'gridview_onethird' => __('Grid View (Three Columns)', 'geodirectory'), |
|
641 | - 'gridview_onefourth' => __('Grid View (Four Columns)', 'geodirectory'), |
|
642 | - 'gridview_onefifth' => __('Grid View (Five Columns)', 'geodirectory'), |
|
643 | - 'listview' => __('List view', 'geodirectory'), |
|
644 | - )) |
|
645 | - ), |
|
630 | + array( |
|
631 | + 'name' => __('Layout', 'geodirectory'), |
|
632 | + 'desc' => __('Set the listing view of relate post on detail page', 'geodirectory'), |
|
633 | + 'id' => 'geodir_related_post_listing_view', |
|
634 | + 'css' => 'min-width:300px;', |
|
635 | + 'std' => 'gridview_onehalf', |
|
636 | + 'type' => 'select', |
|
637 | + 'class' => 'chosen_select', |
|
638 | + 'options' => array_unique(array( |
|
639 | + 'gridview_onehalf' => __('Grid View (Two Columns)', 'geodirectory'), |
|
640 | + 'gridview_onethird' => __('Grid View (Three Columns)', 'geodirectory'), |
|
641 | + 'gridview_onefourth' => __('Grid View (Four Columns)', 'geodirectory'), |
|
642 | + 'gridview_onefifth' => __('Grid View (Five Columns)', 'geodirectory'), |
|
643 | + 'listview' => __('List view', 'geodirectory'), |
|
644 | + )) |
|
645 | + ), |
|
646 | 646 | |
647 | - array( |
|
648 | - 'name' => __('Sort by', 'geodirectory'), |
|
649 | - 'desc' => __('Set the related post listing sort by view', 'geodirectory'), |
|
650 | - 'id' => 'geodir_related_post_sortby', |
|
651 | - 'css' => 'min-width:300px;', |
|
652 | - 'std' => 'latest', |
|
653 | - 'type' => 'select', |
|
654 | - 'class' => 'chosen_select', |
|
655 | - 'options' => array_unique(array( |
|
656 | - 'latest' => __('Latest', 'geodirectory'), |
|
657 | - 'featured' => __('Featured', 'geodirectory'), |
|
658 | - 'high_review' => __('Review', 'geodirectory'), |
|
659 | - 'high_rating' => __('Rating', 'geodirectory'), |
|
660 | - 'random' => __('Random', 'geodirectory'), |
|
661 | - )) |
|
662 | - ), |
|
647 | + array( |
|
648 | + 'name' => __('Sort by', 'geodirectory'), |
|
649 | + 'desc' => __('Set the related post listing sort by view', 'geodirectory'), |
|
650 | + 'id' => 'geodir_related_post_sortby', |
|
651 | + 'css' => 'min-width:300px;', |
|
652 | + 'std' => 'latest', |
|
653 | + 'type' => 'select', |
|
654 | + 'class' => 'chosen_select', |
|
655 | + 'options' => array_unique(array( |
|
656 | + 'latest' => __('Latest', 'geodirectory'), |
|
657 | + 'featured' => __('Featured', 'geodirectory'), |
|
658 | + 'high_review' => __('Review', 'geodirectory'), |
|
659 | + 'high_rating' => __('Rating', 'geodirectory'), |
|
660 | + 'random' => __('Random', 'geodirectory'), |
|
661 | + )) |
|
662 | + ), |
|
663 | 663 | |
664 | - array( |
|
665 | - 'name' => __('Number of posts:', 'geodirectory'), |
|
666 | - 'desc' => __('Enter number of posts to display on related posts listing', 'geodirectory'), |
|
667 | - 'id' => 'geodir_related_post_count', |
|
668 | - 'type' => 'text', |
|
669 | - 'css' => 'min-width:300px;', |
|
670 | - 'std' => '5' // Default value to show home top section |
|
671 | - ), |
|
664 | + array( |
|
665 | + 'name' => __('Number of posts:', 'geodirectory'), |
|
666 | + 'desc' => __('Enter number of posts to display on related posts listing', 'geodirectory'), |
|
667 | + 'id' => 'geodir_related_post_count', |
|
668 | + 'type' => 'text', |
|
669 | + 'css' => 'min-width:300px;', |
|
670 | + 'std' => '5' // Default value to show home top section |
|
671 | + ), |
|
672 | 672 | |
673 | - array( |
|
674 | - 'name' => __('Post excerpt', 'geodirectory'), |
|
675 | - 'desc' => __('Post content excerpt character count', 'geodirectory'), |
|
676 | - 'id' => 'geodir_related_post_excerpt', |
|
677 | - 'type' => 'text', |
|
678 | - 'css' => 'min-width:300px;', |
|
679 | - 'std' => '20' // Default value to show home top section |
|
680 | - ), |
|
673 | + array( |
|
674 | + 'name' => __('Post excerpt', 'geodirectory'), |
|
675 | + 'desc' => __('Post content excerpt character count', 'geodirectory'), |
|
676 | + 'id' => 'geodir_related_post_excerpt', |
|
677 | + 'type' => 'text', |
|
678 | + 'css' => 'min-width:300px;', |
|
679 | + 'std' => '20' // Default value to show home top section |
|
680 | + ), |
|
681 | 681 | |
682 | 682 | |
683 | - array('type' => 'sectionend', 'id' => 'detail_page_related_post_settings'), |
|
684 | - /* Detail Layout Settings end */ |
|
683 | + array('type' => 'sectionend', 'id' => 'detail_page_related_post_settings'), |
|
684 | + /* Detail Layout Settings end */ |
|
685 | 685 | |
686 | - /* Author Layout Settings Start */ |
|
686 | + /* Author Layout Settings Start */ |
|
687 | 687 | |
688 | - array('name' => __('Author', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_author_settings '), |
|
688 | + array('name' => __('Author', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_author_settings '), |
|
689 | 689 | |
690 | 690 | |
691 | - array('name' => __('Author Page Layout Settings', 'geodirectory'), |
|
692 | - 'type' => 'sectionstart', |
|
693 | - 'desc' => '', |
|
694 | - 'id' => 'geodir_author_layout'), |
|
691 | + array('name' => __('Author Page Layout Settings', 'geodirectory'), |
|
692 | + 'type' => 'sectionstart', |
|
693 | + 'desc' => '', |
|
694 | + 'id' => 'geodir_author_layout'), |
|
695 | 695 | |
696 | - array( |
|
697 | - 'name' => __('Author top section', 'geodirectory'), |
|
698 | - 'desc' => __('Show the top section of author page', 'geodirectory'), |
|
699 | - 'id' => 'geodir_show_author_top_section', |
|
700 | - 'type' => 'checkbox', |
|
701 | - 'std' => '1' // Default value to show home top section |
|
702 | - ), |
|
696 | + array( |
|
697 | + 'name' => __('Author top section', 'geodirectory'), |
|
698 | + 'desc' => __('Show the top section of author page', 'geodirectory'), |
|
699 | + 'id' => 'geodir_show_author_top_section', |
|
700 | + 'type' => 'checkbox', |
|
701 | + 'std' => '1' // Default value to show home top section |
|
702 | + ), |
|
703 | 703 | |
704 | - array( |
|
705 | - 'name' => __('Author right section', 'geodirectory'), |
|
706 | - 'desc' => __('Show the right section of author page', 'geodirectory'), |
|
707 | - 'id' => 'geodir_show_author_right_section', |
|
708 | - 'type' => 'checkbox', |
|
709 | - 'std' => '1' // Default value to show home top section |
|
710 | - ), |
|
704 | + array( |
|
705 | + 'name' => __('Author right section', 'geodirectory'), |
|
706 | + 'desc' => __('Show the right section of author page', 'geodirectory'), |
|
707 | + 'id' => 'geodir_show_author_right_section', |
|
708 | + 'type' => 'checkbox', |
|
709 | + 'std' => '1' // Default value to show home top section |
|
710 | + ), |
|
711 | 711 | |
712 | - array( |
|
713 | - 'name' => __('Width of author right section', 'geodirectory'), |
|
714 | - 'desc' => __('Enter the width of right section of author page in %', 'geodirectory'), |
|
715 | - 'id' => 'geodir_width_author_right_section', |
|
716 | - 'type' => 'text', |
|
717 | - 'css' => 'min-width:300px;', |
|
718 | - 'std' => '30' // Default value to show home top section |
|
719 | - ), |
|
712 | + array( |
|
713 | + 'name' => __('Width of author right section', 'geodirectory'), |
|
714 | + 'desc' => __('Enter the width of right section of author page in %', 'geodirectory'), |
|
715 | + 'id' => 'geodir_width_author_right_section', |
|
716 | + 'type' => 'text', |
|
717 | + 'css' => 'min-width:300px;', |
|
718 | + 'std' => '30' // Default value to show home top section |
|
719 | + ), |
|
720 | 720 | |
721 | - array( |
|
722 | - 'name' => __('Author content section view', 'geodirectory'), |
|
723 | - 'desc' => __('Set the listing view of author page', 'geodirectory'), |
|
724 | - 'id' => 'geodir_author_view', |
|
725 | - 'css' => 'min-width:300px;', |
|
726 | - 'std' => 'gridview_onehalf', |
|
727 | - 'type' => 'select', |
|
728 | - 'class' => 'chosen_select', |
|
729 | - 'options' => array_unique(array( |
|
730 | - 'gridview_onehalf' => __('Grid View (Two Columns)', 'geodirectory'), |
|
731 | - 'gridview_onethird' => __('Grid View (Three Columns)', 'geodirectory'), |
|
732 | - 'gridview_onefourth' => __('Grid View (Four Columns)', 'geodirectory'), |
|
733 | - 'gridview_onefifth' => __('Grid View (Five Columns)', 'geodirectory'), |
|
734 | - 'listview' => __('List view', 'geodirectory'), |
|
735 | - )) |
|
736 | - ), |
|
721 | + array( |
|
722 | + 'name' => __('Author content section view', 'geodirectory'), |
|
723 | + 'desc' => __('Set the listing view of author page', 'geodirectory'), |
|
724 | + 'id' => 'geodir_author_view', |
|
725 | + 'css' => 'min-width:300px;', |
|
726 | + 'std' => 'gridview_onehalf', |
|
727 | + 'type' => 'select', |
|
728 | + 'class' => 'chosen_select', |
|
729 | + 'options' => array_unique(array( |
|
730 | + 'gridview_onehalf' => __('Grid View (Two Columns)', 'geodirectory'), |
|
731 | + 'gridview_onethird' => __('Grid View (Three Columns)', 'geodirectory'), |
|
732 | + 'gridview_onefourth' => __('Grid View (Four Columns)', 'geodirectory'), |
|
733 | + 'gridview_onefifth' => __('Grid View (Five Columns)', 'geodirectory'), |
|
734 | + 'listview' => __('List view', 'geodirectory'), |
|
735 | + )) |
|
736 | + ), |
|
737 | 737 | |
738 | - array( |
|
739 | - 'name' => __('Width of author content section', 'geodirectory'), |
|
740 | - 'desc' => __('Enter the width of content section of author page in %', 'geodirectory'), |
|
741 | - 'id' => 'geodir_width_author_contant_section', |
|
742 | - 'type' => 'text', |
|
743 | - 'css' => 'min-width:300px;', |
|
744 | - 'std' => '63' // Default value to show home top section |
|
745 | - ), |
|
738 | + array( |
|
739 | + 'name' => __('Width of author content section', 'geodirectory'), |
|
740 | + 'desc' => __('Enter the width of content section of author page in %', 'geodirectory'), |
|
741 | + 'id' => 'geodir_width_author_contant_section', |
|
742 | + 'type' => 'text', |
|
743 | + 'css' => 'min-width:300px;', |
|
744 | + 'std' => '63' // Default value to show home top section |
|
745 | + ), |
|
746 | 746 | |
747 | - array( |
|
748 | - 'name' => __('Author left section', 'geodirectory'), |
|
749 | - 'desc' => __('Show the left section of author page', 'geodirectory'), |
|
750 | - 'id' => 'geodir_show_author_left_section', |
|
751 | - 'type' => 'checkbox', |
|
752 | - 'std' => '0' // Default value to show home top section |
|
753 | - ), |
|
747 | + array( |
|
748 | + 'name' => __('Author left section', 'geodirectory'), |
|
749 | + 'desc' => __('Show the left section of author page', 'geodirectory'), |
|
750 | + 'id' => 'geodir_show_author_left_section', |
|
751 | + 'type' => 'checkbox', |
|
752 | + 'std' => '0' // Default value to show home top section |
|
753 | + ), |
|
754 | 754 | |
755 | - array( |
|
756 | - 'name' => __('Width of author left section', 'geodirectory'), |
|
757 | - 'desc' => __('Enter the width of left section of home page in %', 'geodirectory'), |
|
758 | - 'id' => 'geodir_width_author_left_section', |
|
759 | - 'type' => 'text', |
|
760 | - 'css' => 'min-width:300px;', |
|
761 | - 'std' => '30' // Default value to show home top section |
|
762 | - ), |
|
755 | + array( |
|
756 | + 'name' => __('Width of author left section', 'geodirectory'), |
|
757 | + 'desc' => __('Enter the width of left section of home page in %', 'geodirectory'), |
|
758 | + 'id' => 'geodir_width_author_left_section', |
|
759 | + 'type' => 'text', |
|
760 | + 'css' => 'min-width:300px;', |
|
761 | + 'std' => '30' // Default value to show home top section |
|
762 | + ), |
|
763 | 763 | |
764 | - array( |
|
765 | - 'name' => __('Author bottom section', 'geodirectory'), |
|
766 | - 'desc' => __('Show the bottom section of author page', 'geodirectory'), |
|
767 | - 'id' => 'geodir_show_author_bottom_section', |
|
768 | - 'type' => 'checkbox', |
|
769 | - 'std' => '0' // Default value to show home top section |
|
770 | - ), |
|
764 | + array( |
|
765 | + 'name' => __('Author bottom section', 'geodirectory'), |
|
766 | + 'desc' => __('Show the bottom section of author page', 'geodirectory'), |
|
767 | + 'id' => 'geodir_show_author_bottom_section', |
|
768 | + 'type' => 'checkbox', |
|
769 | + 'std' => '0' // Default value to show home top section |
|
770 | + ), |
|
771 | 771 | |
772 | 772 | |
773 | - array( |
|
774 | - 'name' => __('Description word limit', 'geodirectory'), |
|
775 | - 'desc' => '', |
|
776 | - 'id' => 'geodir_author_desc_word_limit', |
|
777 | - 'type' => 'text', |
|
778 | - 'css' => 'min-width:300px;', |
|
779 | - 'std' => '50' // Default value to show home top section |
|
780 | - ), |
|
773 | + array( |
|
774 | + 'name' => __('Description word limit', 'geodirectory'), |
|
775 | + 'desc' => '', |
|
776 | + 'id' => 'geodir_author_desc_word_limit', |
|
777 | + 'type' => 'text', |
|
778 | + 'css' => 'min-width:300px;', |
|
779 | + 'std' => '50' // Default value to show home top section |
|
780 | + ), |
|
781 | 781 | |
782 | - array('type' => 'sectionend', 'id' => 'geodir_author_layout'), |
|
783 | - /* Author Layout Settings end */ |
|
782 | + array('type' => 'sectionend', 'id' => 'geodir_author_layout'), |
|
783 | + /* Author Layout Settings end */ |
|
784 | 784 | |
785 | 785 | |
786 | - /* Post Type Navigation Settings Start */ |
|
787 | - array('name' => __('Navigation', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_navigation_settings'), |
|
786 | + /* Post Type Navigation Settings Start */ |
|
787 | + array('name' => __('Navigation', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_navigation_settings'), |
|
788 | 788 | |
789 | 789 | |
790 | - /* Post Type Navigation Settings Start */ |
|
790 | + /* Post Type Navigation Settings Start */ |
|
791 | 791 | |
792 | - array('name' => __('Navigation Locations', 'geodirectory'), |
|
793 | - 'type' => 'sectionstart', |
|
794 | - 'desc' => '', |
|
795 | - 'id' => 'geodir_navigation_locations'), |
|
792 | + array('name' => __('Navigation Locations', 'geodirectory'), |
|
793 | + 'type' => 'sectionstart', |
|
794 | + 'desc' => '', |
|
795 | + 'id' => 'geodir_navigation_locations'), |
|
796 | 796 | |
797 | - array( |
|
798 | - 'name' => __('Show geodirectory navigation in selected menu locations', 'geodirectory'), |
|
799 | - 'desc' => '', |
|
800 | - 'tip' => '', |
|
801 | - 'id' => 'geodir_theme_location_nav', |
|
802 | - 'css' => 'min-width:300px;', |
|
803 | - 'std' => array(), |
|
804 | - 'type' => 'multiselect', |
|
805 | - 'placeholder_text' => __('Select menu locations', 'geodirectory'), |
|
806 | - 'class' => 'chosen_select', |
|
807 | - 'options' => array_unique(geodir_theme_location_setting_fun()) |
|
808 | - ), |
|
809 | - array('type' => 'sectionend', 'id' => 'geodir_navigation_options'), |
|
810 | - |
|
811 | - |
|
812 | - array('name' => __('Navigation Settings', 'geodirectory'), |
|
813 | - 'type' => 'sectionstart', |
|
814 | - 'desc' => '', |
|
815 | - 'id' => 'geodir_navigation_options'), |
|
797 | + array( |
|
798 | + 'name' => __('Show geodirectory navigation in selected menu locations', 'geodirectory'), |
|
799 | + 'desc' => '', |
|
800 | + 'tip' => '', |
|
801 | + 'id' => 'geodir_theme_location_nav', |
|
802 | + 'css' => 'min-width:300px;', |
|
803 | + 'std' => array(), |
|
804 | + 'type' => 'multiselect', |
|
805 | + 'placeholder_text' => __('Select menu locations', 'geodirectory'), |
|
806 | + 'class' => 'chosen_select', |
|
807 | + 'options' => array_unique(geodir_theme_location_setting_fun()) |
|
808 | + ), |
|
809 | + array('type' => 'sectionend', 'id' => 'geodir_navigation_options'), |
|
816 | 810 | |
817 | 811 | |
818 | - array( |
|
819 | - 'name' => __('Show add listing navigation in menu', 'geodirectory'), |
|
820 | - 'desc' => sprintf(__('Show add listing navigation in main menu? (untick to disable) If you disable this option, none of the add listing link will appear in main navigation.', 'geodirectory')), |
|
821 | - 'id' => 'geodir_show_addlisting_nav', |
|
822 | - 'std' => '1', |
|
823 | - 'type' => 'checkbox' |
|
824 | - ), |
|
812 | + array('name' => __('Navigation Settings', 'geodirectory'), |
|
813 | + 'type' => 'sectionstart', |
|
814 | + 'desc' => '', |
|
815 | + 'id' => 'geodir_navigation_options'), |
|
825 | 816 | |
826 | - array( |
|
827 | - 'name' => __('Show listings navigation in menu', 'geodirectory'), |
|
828 | - 'desc' => sprintf(__('Show listing navigation in main menu? (untick to disable) If you disable this option, none of the listing link will appear in main navigation.', 'geodirectory')), |
|
829 | - 'id' => 'geodir_show_listing_nav', |
|
830 | - 'std' => '1', |
|
831 | - 'type' => 'checkbox' |
|
832 | - ), |
|
833 | 817 | |
834 | - array('type' => 'sectionend', 'id' => 'geodir_navigation_options'), |
|
818 | + array( |
|
819 | + 'name' => __('Show add listing navigation in menu', 'geodirectory'), |
|
820 | + 'desc' => sprintf(__('Show add listing navigation in main menu? (untick to disable) If you disable this option, none of the add listing link will appear in main navigation.', 'geodirectory')), |
|
821 | + 'id' => 'geodir_show_addlisting_nav', |
|
822 | + 'std' => '1', |
|
823 | + 'type' => 'checkbox' |
|
824 | + ), |
|
835 | 825 | |
826 | + array( |
|
827 | + 'name' => __('Show listings navigation in menu', 'geodirectory'), |
|
828 | + 'desc' => sprintf(__('Show listing navigation in main menu? (untick to disable) If you disable this option, none of the listing link will appear in main navigation.', 'geodirectory')), |
|
829 | + 'id' => 'geodir_show_listing_nav', |
|
830 | + 'std' => '1', |
|
831 | + 'type' => 'checkbox' |
|
832 | + ), |
|
836 | 833 | |
837 | - array('name' => __('Post Type Navigation Settings', 'geodirectory'), |
|
838 | - 'type' => 'sectionstart', |
|
839 | - 'desc' => '', |
|
840 | - 'id' => 'geodir_post_type_navigation_layout'), |
|
841 | - array( |
|
842 | - 'name' => __('Show listing link in main navigation', 'geodirectory'), |
|
843 | - 'desc' => '', |
|
844 | - 'tip' => '', |
|
845 | - 'id' => 'geodir_add_posttype_in_main_nav', |
|
846 | - 'css' => 'min-width:300px;', |
|
847 | - 'std' => array(), |
|
848 | - 'type' => 'multiselect', |
|
849 | - 'placeholder_text' => __('Select post types', 'geodirectory'), |
|
850 | - 'class' => 'chosen_select', |
|
851 | - 'options' => array_unique(geodir_post_type_setting_fun()) |
|
852 | - ), |
|
834 | + array('type' => 'sectionend', 'id' => 'geodir_navigation_options'), |
|
853 | 835 | |
854 | - array( |
|
855 | - 'name' => __('Show listing link in listing navigation', 'geodirectory'), |
|
856 | - 'desc' => '', |
|
857 | - 'tip' => '', |
|
858 | - 'id' => 'geodir_add_posttype_in_listing_nav', |
|
859 | - 'css' => 'min-width:300px;', |
|
860 | - 'std' => geodir_get_posttypes(), |
|
861 | - 'type' => 'multiselect', |
|
862 | - 'placeholder_text' => __('Select post types', 'geodirectory'), |
|
863 | - 'class' => 'chosen_select', |
|
864 | - 'options' => array_unique(geodir_post_type_setting_fun()) |
|
865 | - ), |
|
866 | 836 | |
867 | - array( |
|
868 | - 'name' => __('Allow post type to add from frontend', 'geodirectory'), |
|
869 | - 'desc' => '', |
|
870 | - 'tip' => '', |
|
871 | - 'id' => 'geodir_allow_posttype_frontend', |
|
872 | - 'css' => 'min-width:300px;', |
|
873 | - 'std' => geodir_get_posttypes(), |
|
874 | - 'type' => 'multiselect', |
|
875 | - 'placeholder_text' => __('Select post types', 'geodirectory'), |
|
876 | - 'class' => 'chosen_select', |
|
877 | - 'options' => array_unique(geodir_post_type_setting_fun()) |
|
878 | - ), |
|
837 | + array('name' => __('Post Type Navigation Settings', 'geodirectory'), |
|
838 | + 'type' => 'sectionstart', |
|
839 | + 'desc' => '', |
|
840 | + 'id' => 'geodir_post_type_navigation_layout'), |
|
841 | + array( |
|
842 | + 'name' => __('Show listing link in main navigation', 'geodirectory'), |
|
843 | + 'desc' => '', |
|
844 | + 'tip' => '', |
|
845 | + 'id' => 'geodir_add_posttype_in_main_nav', |
|
846 | + 'css' => 'min-width:300px;', |
|
847 | + 'std' => array(), |
|
848 | + 'type' => 'multiselect', |
|
849 | + 'placeholder_text' => __('Select post types', 'geodirectory'), |
|
850 | + 'class' => 'chosen_select', |
|
851 | + 'options' => array_unique(geodir_post_type_setting_fun()) |
|
852 | + ), |
|
879 | 853 | |
880 | - array( |
|
881 | - 'name' => __('Show add listing link in main navigation', 'geodirectory'), |
|
882 | - 'desc' => '', |
|
883 | - 'tip' => '', |
|
884 | - 'id' => 'geodir_add_listing_link_main_nav', |
|
885 | - 'css' => 'min-width:300px;', |
|
886 | - 'std' => array(), |
|
887 | - 'type' => 'multiselect', |
|
888 | - 'placeholder_text' => __('Select post types', 'geodirectory'), |
|
889 | - 'class' => 'chosen_select', |
|
890 | - 'options' => array_unique(geodir_post_type_setting_fun()) |
|
891 | - ), |
|
854 | + array( |
|
855 | + 'name' => __('Show listing link in listing navigation', 'geodirectory'), |
|
856 | + 'desc' => '', |
|
857 | + 'tip' => '', |
|
858 | + 'id' => 'geodir_add_posttype_in_listing_nav', |
|
859 | + 'css' => 'min-width:300px;', |
|
860 | + 'std' => geodir_get_posttypes(), |
|
861 | + 'type' => 'multiselect', |
|
862 | + 'placeholder_text' => __('Select post types', 'geodirectory'), |
|
863 | + 'class' => 'chosen_select', |
|
864 | + 'options' => array_unique(geodir_post_type_setting_fun()) |
|
865 | + ), |
|
892 | 866 | |
893 | - array( |
|
894 | - 'name' => __('Show add listing link in add listing navigation', 'geodirectory'), |
|
895 | - 'desc' => '', |
|
896 | - 'tip' => '', |
|
897 | - 'id' => 'geodir_add_listing_link_add_listing_nav', |
|
898 | - 'css' => 'min-width:300px;', |
|
899 | - 'std' => geodir_get_posttypes(), |
|
900 | - 'type' => 'multiselect', |
|
901 | - 'class' => 'chosen_select', |
|
902 | - 'options' => array_unique(geodir_post_type_setting_fun()) |
|
903 | - ), |
|
867 | + array( |
|
868 | + 'name' => __('Allow post type to add from frontend', 'geodirectory'), |
|
869 | + 'desc' => '', |
|
870 | + 'tip' => '', |
|
871 | + 'id' => 'geodir_allow_posttype_frontend', |
|
872 | + 'css' => 'min-width:300px;', |
|
873 | + 'std' => geodir_get_posttypes(), |
|
874 | + 'type' => 'multiselect', |
|
875 | + 'placeholder_text' => __('Select post types', 'geodirectory'), |
|
876 | + 'class' => 'chosen_select', |
|
877 | + 'options' => array_unique(geodir_post_type_setting_fun()) |
|
878 | + ), |
|
904 | 879 | |
905 | - array('type' => 'sectionend', 'id' => 'geodir_post_type_navigation_layout'), |
|
880 | + array( |
|
881 | + 'name' => __('Show add listing link in main navigation', 'geodirectory'), |
|
882 | + 'desc' => '', |
|
883 | + 'tip' => '', |
|
884 | + 'id' => 'geodir_add_listing_link_main_nav', |
|
885 | + 'css' => 'min-width:300px;', |
|
886 | + 'std' => array(), |
|
887 | + 'type' => 'multiselect', |
|
888 | + 'placeholder_text' => __('Select post types', 'geodirectory'), |
|
889 | + 'class' => 'chosen_select', |
|
890 | + 'options' => array_unique(geodir_post_type_setting_fun()) |
|
891 | + ), |
|
906 | 892 | |
893 | + array( |
|
894 | + 'name' => __('Show add listing link in add listing navigation', 'geodirectory'), |
|
895 | + 'desc' => '', |
|
896 | + 'tip' => '', |
|
897 | + 'id' => 'geodir_add_listing_link_add_listing_nav', |
|
898 | + 'css' => 'min-width:300px;', |
|
899 | + 'std' => geodir_get_posttypes(), |
|
900 | + 'type' => 'multiselect', |
|
901 | + 'class' => 'chosen_select', |
|
902 | + 'options' => array_unique(geodir_post_type_setting_fun()) |
|
903 | + ), |
|
907 | 904 | |
908 | - array('name' => __('User Dashboard Post Type Navigation Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_user_dashboard_post_type '), |
|
905 | + array('type' => 'sectionend', 'id' => 'geodir_post_type_navigation_layout'), |
|
909 | 906 | |
910 | 907 | |
911 | - array( |
|
912 | - 'name' => __('Show add listing link in user dashboard', 'geodirectory'), |
|
913 | - 'desc' => '', |
|
914 | - 'tip' => '', |
|
915 | - 'id' => 'geodir_add_listing_link_user_dashboard', |
|
916 | - 'css' => 'min-width:300px;', |
|
917 | - 'std' => geodir_get_posttypes(), |
|
918 | - 'type' => 'multiselect', |
|
919 | - 'placeholder_text' => __('Select post types', 'geodirectory'), |
|
920 | - 'class' => 'chosen_select', |
|
921 | - 'options' => array_unique(geodir_post_type_setting_fun()) |
|
922 | - ), |
|
908 | + array('name' => __('User Dashboard Post Type Navigation Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_user_dashboard_post_type '), |
|
923 | 909 | |
924 | - array( |
|
925 | - 'name' => __('Show favorite link in user dashboard', 'geodirectory'), |
|
926 | - 'desc' => __('Option will not appear if user does not have a favorite of that post type', 'geodirectory'), |
|
927 | - 'tip' => '', |
|
928 | - 'id' => 'geodir_favorite_link_user_dashboard', |
|
929 | - 'css' => 'min-width:300px;', |
|
930 | - 'std' => geodir_get_posttypes(), |
|
931 | - 'type' => 'multiselect', |
|
932 | - 'placeholder_text' => __('Select post types', 'geodirectory'), |
|
933 | - 'class' => 'chosen_select', |
|
934 | - 'options' => array_unique(geodir_post_type_setting_fun()) |
|
935 | - ), |
|
936 | 910 | |
937 | - array( |
|
938 | - 'name' => __('Show listing link in user dashboard', 'geodirectory'), |
|
939 | - 'desc' => __('Option will not appear if user does not have his/her own listing of that post type', 'geodirectory'), |
|
940 | - 'tip' => '', |
|
941 | - 'id' => 'geodir_listing_link_user_dashboard', |
|
942 | - 'css' => 'min-width:300px;', |
|
943 | - 'std' => geodir_get_posttypes(), |
|
944 | - 'type' => 'multiselect', |
|
945 | - 'placeholder_text' => __('Select post types', 'geodirectory'), |
|
946 | - 'class' => 'chosen_select', |
|
947 | - 'options' => array_unique(geodir_post_type_setting_fun()) |
|
948 | - ), |
|
949 | - |
|
950 | - array('type' => 'sectionend', 'id' => 'geodir_user_dashboard_post_type'), |
|
951 | - /* Post Type Navigation Settings End */ |
|
952 | - |
|
953 | - /* Script Settings Start */ |
|
954 | - array('name' => __('Scripts', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_script_settings '), |
|
955 | - |
|
956 | - /* |
|
911 | + array( |
|
912 | + 'name' => __('Show add listing link in user dashboard', 'geodirectory'), |
|
913 | + 'desc' => '', |
|
914 | + 'tip' => '', |
|
915 | + 'id' => 'geodir_add_listing_link_user_dashboard', |
|
916 | + 'css' => 'min-width:300px;', |
|
917 | + 'std' => geodir_get_posttypes(), |
|
918 | + 'type' => 'multiselect', |
|
919 | + 'placeholder_text' => __('Select post types', 'geodirectory'), |
|
920 | + 'class' => 'chosen_select', |
|
921 | + 'options' => array_unique(geodir_post_type_setting_fun()) |
|
922 | + ), |
|
923 | + |
|
924 | + array( |
|
925 | + 'name' => __('Show favorite link in user dashboard', 'geodirectory'), |
|
926 | + 'desc' => __('Option will not appear if user does not have a favorite of that post type', 'geodirectory'), |
|
927 | + 'tip' => '', |
|
928 | + 'id' => 'geodir_favorite_link_user_dashboard', |
|
929 | + 'css' => 'min-width:300px;', |
|
930 | + 'std' => geodir_get_posttypes(), |
|
931 | + 'type' => 'multiselect', |
|
932 | + 'placeholder_text' => __('Select post types', 'geodirectory'), |
|
933 | + 'class' => 'chosen_select', |
|
934 | + 'options' => array_unique(geodir_post_type_setting_fun()) |
|
935 | + ), |
|
936 | + |
|
937 | + array( |
|
938 | + 'name' => __('Show listing link in user dashboard', 'geodirectory'), |
|
939 | + 'desc' => __('Option will not appear if user does not have his/her own listing of that post type', 'geodirectory'), |
|
940 | + 'tip' => '', |
|
941 | + 'id' => 'geodir_listing_link_user_dashboard', |
|
942 | + 'css' => 'min-width:300px;', |
|
943 | + 'std' => geodir_get_posttypes(), |
|
944 | + 'type' => 'multiselect', |
|
945 | + 'placeholder_text' => __('Select post types', 'geodirectory'), |
|
946 | + 'class' => 'chosen_select', |
|
947 | + 'options' => array_unique(geodir_post_type_setting_fun()) |
|
948 | + ), |
|
949 | + |
|
950 | + array('type' => 'sectionend', 'id' => 'geodir_user_dashboard_post_type'), |
|
951 | + /* Post Type Navigation Settings End */ |
|
952 | + |
|
953 | + /* Script Settings Start */ |
|
954 | + array('name' => __('Scripts', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_script_settings '), |
|
955 | + |
|
956 | + /* |
|
957 | 957 | array( 'name' => __( 'Add/Remove Scripts', 'geodirectory' ), |
958 | 958 | 'type' => 'sectionstart', |
959 | 959 | 'desc' => '', |
@@ -979,150 +979,150 @@ discard block |
||
979 | 979 | |
980 | 980 | */ |
981 | 981 | |
982 | - array('name' => __('SCSS Settings (CSS combine and minify)', 'geodirectory'), |
|
983 | - 'type' => 'sectionstart', |
|
984 | - 'desc' => '', |
|
985 | - 'id' => 'geodir_scss_settings'), |
|
982 | + array('name' => __('SCSS Settings (CSS combine and minify)', 'geodirectory'), |
|
983 | + 'type' => 'sectionstart', |
|
984 | + 'desc' => '', |
|
985 | + 'id' => 'geodir_scss_settings'), |
|
986 | 986 | |
987 | - array( |
|
988 | - 'name' => __('Disable Core SCSS', 'geodirectory'), |
|
989 | - 'desc' => __('Stops the CSS files being minified and output as one.', 'geodirectory'), |
|
990 | - 'id' => 'geodir_scss_core', |
|
991 | - 'type' => 'checkbox', |
|
992 | - 'std' => '0' // Default value to show home top section |
|
993 | - ), |
|
987 | + array( |
|
988 | + 'name' => __('Disable Core SCSS', 'geodirectory'), |
|
989 | + 'desc' => __('Stops the CSS files being minified and output as one.', 'geodirectory'), |
|
990 | + 'id' => 'geodir_scss_core', |
|
991 | + 'type' => 'checkbox', |
|
992 | + 'std' => '0' // Default value to show home top section |
|
993 | + ), |
|
994 | 994 | |
995 | - array('type' => 'sectionend', 'id' => 'geodir_scss_settings'), |
|
995 | + array('type' => 'sectionend', 'id' => 'geodir_scss_settings'), |
|
996 | 996 | |
997 | - array('name' => __('Script Settings', 'geodirectory'), |
|
998 | - 'type' => 'sectionstart', |
|
999 | - 'desc' => '', |
|
1000 | - 'id' => 'geodir_script_settings'), |
|
997 | + array('name' => __('Script Settings', 'geodirectory'), |
|
998 | + 'type' => 'sectionstart', |
|
999 | + 'desc' => '', |
|
1000 | + 'id' => 'geodir_script_settings'), |
|
1001 | 1001 | |
1002 | - array( |
|
1003 | - 'name' => __('Custom style css code', 'geodirectory'), |
|
1004 | - 'desc' => '', |
|
1005 | - 'id' => 'geodir_coustem_css', |
|
1006 | - 'type' => 'textarea', |
|
1007 | - 'css' => 'min-width:300px;', |
|
1008 | - 'std' => '' // Default value for the page title - changed in settings |
|
1009 | - ), |
|
1002 | + array( |
|
1003 | + 'name' => __('Custom style css code', 'geodirectory'), |
|
1004 | + 'desc' => '', |
|
1005 | + 'id' => 'geodir_coustem_css', |
|
1006 | + 'type' => 'textarea', |
|
1007 | + 'css' => 'min-width:300px;', |
|
1008 | + 'std' => '' // Default value for the page title - changed in settings |
|
1009 | + ), |
|
1010 | 1010 | |
1011 | - array( |
|
1012 | - 'name' => __('Header script code', 'geodirectory'), |
|
1013 | - 'desc' => '', |
|
1014 | - 'id' => 'geodir_header_scripts', |
|
1015 | - 'type' => 'textarea', |
|
1016 | - 'css' => 'min-width:300px;', |
|
1017 | - 'std' => '' // Default value for the page title - changed in settings |
|
1018 | - ), |
|
1011 | + array( |
|
1012 | + 'name' => __('Header script code', 'geodirectory'), |
|
1013 | + 'desc' => '', |
|
1014 | + 'id' => 'geodir_header_scripts', |
|
1015 | + 'type' => 'textarea', |
|
1016 | + 'css' => 'min-width:300px;', |
|
1017 | + 'std' => '' // Default value for the page title - changed in settings |
|
1018 | + ), |
|
1019 | 1019 | |
1020 | - array( |
|
1021 | - 'name' => __('Footer script code', 'geodirectory'), |
|
1022 | - 'desc' => '', |
|
1023 | - 'id' => 'geodir_footer_scripts', |
|
1024 | - 'type' => 'textarea', |
|
1025 | - 'css' => 'min-width:300px;', |
|
1026 | - 'std' => '' // Default value for the page title - changed in settings |
|
1027 | - ), |
|
1020 | + array( |
|
1021 | + 'name' => __('Footer script code', 'geodirectory'), |
|
1022 | + 'desc' => '', |
|
1023 | + 'id' => 'geodir_footer_scripts', |
|
1024 | + 'type' => 'textarea', |
|
1025 | + 'css' => 'min-width:300px;', |
|
1026 | + 'std' => '' // Default value for the page title - changed in settings |
|
1027 | + ), |
|
1028 | 1028 | |
1029 | - array('type' => 'sectionend', 'id' => 'geodir_script_settings'), |
|
1030 | - /* Script Settings End */ |
|
1029 | + array('type' => 'sectionend', 'id' => 'geodir_script_settings'), |
|
1030 | + /* Script Settings End */ |
|
1031 | 1031 | |
1032 | - /* Map Settings Start */ |
|
1033 | - array('name' => __('Map', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_map_settings '), |
|
1032 | + /* Map Settings Start */ |
|
1033 | + array('name' => __('Map', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_map_settings '), |
|
1034 | 1034 | |
1035 | - /* Untick the category by default on home map */ |
|
1036 | - array( |
|
1037 | - 'name' => __('Home Map Settings', 'geodirectory'), |
|
1038 | - 'type' => 'sectionstart', |
|
1039 | - 'desc' => '', |
|
1040 | - 'id' => 'geodir_home_map_section' |
|
1041 | - ), |
|
1042 | - array( |
|
1043 | - 'name' => __('Select category to untick by default on map', 'geodirectory'), |
|
1044 | - 'desc' => __('Select category to untick by default on the home map.', 'geodirectory'), |
|
1045 | - 'tip' => '', |
|
1046 | - 'id' => 'geodir_home_map_untick', |
|
1047 | - 'css' => 'min-width:300px;', |
|
1048 | - 'std' => '', |
|
1049 | - 'type' => 'multiselect', |
|
1050 | - 'placeholder_text' => __('Select category', 'geodirectory'), |
|
1051 | - 'class' => 'chosen_select', |
|
1052 | - 'options' => geodir_home_map_cats_key_value_array() |
|
1053 | - ), |
|
1054 | - array( |
|
1055 | - 'type' => 'sectionend', |
|
1056 | - 'id' => 'geodir_home_map_section' |
|
1057 | - ), |
|
1035 | + /* Untick the category by default on home map */ |
|
1036 | + array( |
|
1037 | + 'name' => __('Home Map Settings', 'geodirectory'), |
|
1038 | + 'type' => 'sectionstart', |
|
1039 | + 'desc' => '', |
|
1040 | + 'id' => 'geodir_home_map_section' |
|
1041 | + ), |
|
1042 | + array( |
|
1043 | + 'name' => __('Select category to untick by default on map', 'geodirectory'), |
|
1044 | + 'desc' => __('Select category to untick by default on the home map.', 'geodirectory'), |
|
1045 | + 'tip' => '', |
|
1046 | + 'id' => 'geodir_home_map_untick', |
|
1047 | + 'css' => 'min-width:300px;', |
|
1048 | + 'std' => '', |
|
1049 | + 'type' => 'multiselect', |
|
1050 | + 'placeholder_text' => __('Select category', 'geodirectory'), |
|
1051 | + 'class' => 'chosen_select', |
|
1052 | + 'options' => geodir_home_map_cats_key_value_array() |
|
1053 | + ), |
|
1054 | + array( |
|
1055 | + 'type' => 'sectionend', |
|
1056 | + 'id' => 'geodir_home_map_section' |
|
1057 | + ), |
|
1058 | 1058 | |
1059 | - array( |
|
1060 | - 'name' => __('Add Listing Map Settings', 'geodirectory'), |
|
1061 | - 'type' => 'sectionstart', |
|
1062 | - 'desc' => '', |
|
1063 | - 'id' => 'geodir_add_listing_map_section' |
|
1064 | - ), |
|
1065 | - array( |
|
1066 | - 'name' => __('Disable mouse scroll', 'geodirectory'), |
|
1067 | - 'desc' => __('Stops the mouse scroll zooming the map', 'geodirectory'), |
|
1068 | - 'id' => 'geodir_add_listing_mouse_scroll', |
|
1069 | - 'type' => 'checkbox', |
|
1070 | - 'std' => '0' // Default value to show home top section |
|
1071 | - ), |
|
1072 | - array( |
|
1073 | - 'type' => 'sectionend', |
|
1074 | - 'id' => 'geodir_add_listing_map_section' |
|
1075 | - ), |
|
1059 | + array( |
|
1060 | + 'name' => __('Add Listing Map Settings', 'geodirectory'), |
|
1061 | + 'type' => 'sectionstart', |
|
1062 | + 'desc' => '', |
|
1063 | + 'id' => 'geodir_add_listing_map_section' |
|
1064 | + ), |
|
1065 | + array( |
|
1066 | + 'name' => __('Disable mouse scroll', 'geodirectory'), |
|
1067 | + 'desc' => __('Stops the mouse scroll zooming the map', 'geodirectory'), |
|
1068 | + 'id' => 'geodir_add_listing_mouse_scroll', |
|
1069 | + 'type' => 'checkbox', |
|
1070 | + 'std' => '0' // Default value to show home top section |
|
1071 | + ), |
|
1072 | + array( |
|
1073 | + 'type' => 'sectionend', |
|
1074 | + 'id' => 'geodir_add_listing_map_section' |
|
1075 | + ), |
|
1076 | 1076 | |
1077 | 1077 | |
1078 | - array('name' => __('Default map settings', 'geodirectory'), |
|
1079 | - 'type' => 'sectionstart', |
|
1080 | - 'desc' => '', |
|
1081 | - 'id' => 'geodir_map_default_settings'), |
|
1078 | + array('name' => __('Default map settings', 'geodirectory'), |
|
1079 | + 'type' => 'sectionstart', |
|
1080 | + 'desc' => '', |
|
1081 | + 'id' => 'geodir_map_default_settings'), |
|
1082 | 1082 | |
1083 | - array( |
|
1084 | - 'name' => '', |
|
1085 | - 'desc' => '', |
|
1086 | - 'id' => 'map_default_settings', |
|
1087 | - 'type' => 'map_default_settings', |
|
1088 | - 'css' => 'min-width:300px;', |
|
1089 | - 'std' => '' // Default value for the page title - changed in settings |
|
1090 | - ), |
|
1083 | + array( |
|
1084 | + 'name' => '', |
|
1085 | + 'desc' => '', |
|
1086 | + 'id' => 'map_default_settings', |
|
1087 | + 'type' => 'map_default_settings', |
|
1088 | + 'css' => 'min-width:300px;', |
|
1089 | + 'std' => '' // Default value for the page title - changed in settings |
|
1090 | + ), |
|
1091 | 1091 | |
1092 | - array( |
|
1093 | - 'name' => __('Upload map default marker icon', 'geodirectory'), |
|
1094 | - 'desc' => '', |
|
1095 | - 'id' => 'geodir_default_marker_icon', |
|
1096 | - 'type' => 'file', |
|
1097 | - 'std' => '0', |
|
1098 | - 'value' => geodir_plugin_url() . '/geodirectory-functions/map-functions/icons/pin.png'// Default value to show home top section |
|
1099 | - ), |
|
1100 | - // add option that allows enable/disable map dragging to phone devices |
|
1101 | - array( |
|
1102 | - 'name' => __('Show button control on map to enable/disable dragging', 'geodirectory'), |
|
1103 | - 'desc' => __('If checked, it displays button control to enable/disable dragging on google maps for phone devices', 'geodirectory'), |
|
1104 | - 'id' => 'geodir_map_onoff_dragging', |
|
1105 | - 'type' => 'checkbox', |
|
1106 | - 'std' => '0' // Default value to show home top section |
|
1107 | - ), |
|
1092 | + array( |
|
1093 | + 'name' => __('Upload map default marker icon', 'geodirectory'), |
|
1094 | + 'desc' => '', |
|
1095 | + 'id' => 'geodir_default_marker_icon', |
|
1096 | + 'type' => 'file', |
|
1097 | + 'std' => '0', |
|
1098 | + 'value' => geodir_plugin_url() . '/geodirectory-functions/map-functions/icons/pin.png'// Default value to show home top section |
|
1099 | + ), |
|
1100 | + // add option that allows enable/disable map dragging to phone devices |
|
1101 | + array( |
|
1102 | + 'name' => __('Show button control on map to enable/disable dragging', 'geodirectory'), |
|
1103 | + 'desc' => __('If checked, it displays button control to enable/disable dragging on google maps for phone devices', 'geodirectory'), |
|
1104 | + 'id' => 'geodir_map_onoff_dragging', |
|
1105 | + 'type' => 'checkbox', |
|
1106 | + 'std' => '0' // Default value to show home top section |
|
1107 | + ), |
|
1108 | 1108 | |
1109 | - array('type' => 'sectionend', 'id' => 'geodir_map_default_settings'), |
|
1109 | + array('type' => 'sectionend', 'id' => 'geodir_map_default_settings'), |
|
1110 | 1110 | |
1111 | - array('name' => __('Show / hide post type and category on map', 'geodirectory'), |
|
1112 | - 'type' => 'sectionstart', |
|
1113 | - 'desc' => '', |
|
1114 | - 'id' => 'geodir_map_settings'), |
|
1111 | + array('name' => __('Show / hide post type and category on map', 'geodirectory'), |
|
1112 | + 'type' => 'sectionstart', |
|
1113 | + 'desc' => '', |
|
1114 | + 'id' => 'geodir_map_settings'), |
|
1115 | 1115 | |
1116 | - array( |
|
1117 | - 'name' => __('Select Map Category', 'geodirectory'), |
|
1118 | - 'desc' => '', |
|
1119 | - 'id' => 'geodir_map_settings', |
|
1120 | - 'type' => 'map', |
|
1121 | - 'css' => 'min-width:300px;', |
|
1122 | - 'std' => '' // Default value for the page title - changed in settings |
|
1123 | - ), |
|
1124 | - |
|
1125 | - array('type' => 'sectionend', 'id' => 'geodir_map_settings'), |
|
1126 | - /* Map Settings End */ |
|
1116 | + array( |
|
1117 | + 'name' => __('Select Map Category', 'geodirectory'), |
|
1118 | + 'desc' => '', |
|
1119 | + 'id' => 'geodir_map_settings', |
|
1120 | + 'type' => 'map', |
|
1121 | + 'css' => 'min-width:300px;', |
|
1122 | + 'std' => '' // Default value for the page title - changed in settings |
|
1123 | + ), |
|
1124 | + |
|
1125 | + array('type' => 'sectionend', 'id' => 'geodir_map_settings'), |
|
1126 | + /* Map Settings End */ |
|
1127 | 1127 | |
1128 | 1128 | )); // End Design settings |
@@ -122,7 +122,7 @@ |
||
122 | 122 | |
123 | 123 | array('type' => 'sectionend', 'id' => 'general_options'), |
124 | 124 | |
125 | -));/* General Options End*/ |
|
125 | +)); /* General Options End*/ |
|
126 | 126 | |
127 | 127 | /** |
128 | 128 | * Filter GD Google Analytic Settings array. |
@@ -1,11 +1,11 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * General tab settings. |
|
4 | - * |
|
5 | - * @since 1.0.0 |
|
6 | - * @package GeoDirectory |
|
7 | - * @global array $geodir_settings Geodirectory settings array. |
|
8 | - */ |
|
3 | + * General tab settings. |
|
4 | + * |
|
5 | + * @since 1.0.0 |
|
6 | + * @package GeoDirectory |
|
7 | + * @global array $geodir_settings Geodirectory settings array. |
|
8 | + */ |
|
9 | 9 | global $geodir_settings; |
10 | 10 | |
11 | 11 | /** |
@@ -16,30 +16,30 @@ discard block |
||
16 | 16 | */ |
17 | 17 | $general_options = apply_filters('geodir_general_options', array( |
18 | 18 | |
19 | - array('name' => __('General', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'general_options'), |
|
19 | + array('name' => __('General', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'general_options'), |
|
20 | 20 | |
21 | - array('name' => __('General Options', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'general_options'), |
|
21 | + array('name' => __('General Options', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'general_options'), |
|
22 | 22 | |
23 | - array( |
|
24 | - 'name' => __('Sender name', 'geodirectory'), |
|
25 | - 'desc' => __('(Name that will be shown as email sender when users receive emails from this site)', 'geodirectory'), |
|
26 | - 'id' => 'site_email_name', |
|
27 | - 'type' => 'text', |
|
28 | - 'css' => 'min-width:300px;', |
|
29 | - 'std' => get_bloginfo('name') // Default value for the page title - changed in settings |
|
30 | - ), |
|
23 | + array( |
|
24 | + 'name' => __('Sender name', 'geodirectory'), |
|
25 | + 'desc' => __('(Name that will be shown as email sender when users receive emails from this site)', 'geodirectory'), |
|
26 | + 'id' => 'site_email_name', |
|
27 | + 'type' => 'text', |
|
28 | + 'css' => 'min-width:300px;', |
|
29 | + 'std' => get_bloginfo('name') // Default value for the page title - changed in settings |
|
30 | + ), |
|
31 | 31 | |
32 | - array( |
|
33 | - 'name' => __('Email address', 'geodirectory'), |
|
34 | - 'desc' => __('(Emails to users will be sent via this mail ID)', 'geodirectory'), |
|
35 | - 'id' => 'site_email', |
|
36 | - 'type' => 'text', |
|
37 | - 'css' => 'min-width:300px;', |
|
38 | - 'std' => get_bloginfo('admin_email') // Default value for the page title - changed in settings |
|
39 | - ), |
|
32 | + array( |
|
33 | + 'name' => __('Email address', 'geodirectory'), |
|
34 | + 'desc' => __('(Emails to users will be sent via this mail ID)', 'geodirectory'), |
|
35 | + 'id' => 'site_email', |
|
36 | + 'type' => 'text', |
|
37 | + 'css' => 'min-width:300px;', |
|
38 | + 'std' => get_bloginfo('admin_email') // Default value for the page title - changed in settings |
|
39 | + ), |
|
40 | 40 | |
41 | 41 | |
42 | - /*array( |
|
42 | + /*array( |
|
43 | 43 | 'name' => __( 'Display Category', 'geodirectory' ), |
44 | 44 | 'desc' => __( 'Allow users to select category at add listing page', 'geodirectory' ), |
45 | 45 | 'tip' => '', |
@@ -58,69 +58,69 @@ discard block |
||
58 | 58 | |
59 | 59 | |
60 | 60 | */ |
61 | - array( |
|
62 | - 'name' => __('Allow user to see wp-admin area', 'geodirectory'), |
|
63 | - 'desc' => __('Yes', 'geodirectory'), |
|
64 | - 'id' => 'geodir_allow_wpadmin', |
|
65 | - 'std' => '1', |
|
66 | - 'type' => 'radio', |
|
67 | - 'value' => '1', |
|
68 | - 'radiogroup' => 'start' |
|
69 | - ), |
|
70 | - array( |
|
71 | - 'name' => __('Allow user to see wp-admin area', 'geodirectory'), |
|
72 | - 'desc' => __('No', 'geodirectory'), |
|
73 | - 'id' => 'geodir_allow_wpadmin', |
|
74 | - 'std' => '0', |
|
75 | - 'type' => 'radio', |
|
76 | - 'value' => '0', |
|
77 | - 'radiogroup' => 'end' |
|
78 | - ), |
|
79 | - |
|
80 | - array( |
|
81 | - 'name' => __('Allow user to choose own password', 'geodirectory'), |
|
82 | - 'desc' => __('Yes', 'geodirectory'), |
|
83 | - 'id' => 'geodir_allow_cpass', |
|
84 | - 'std' => '1', |
|
85 | - 'type' => 'radio', |
|
86 | - 'value' => '1', |
|
87 | - 'radiogroup' => 'start' |
|
88 | - ), |
|
89 | - array( |
|
90 | - 'name' => __('Allow user to choose own password', 'geodirectory'), |
|
91 | - 'desc' => __('No', 'geodirectory'), |
|
92 | - 'id' => 'geodir_allow_cpass', |
|
93 | - 'std' => '0', |
|
94 | - 'type' => 'radio', |
|
95 | - 'value' => '0', |
|
96 | - 'radiogroup' => 'end' |
|
97 | - ), |
|
98 | - array( |
|
99 | - 'name' => __('Disable rating on comments', 'geodirectory'), |
|
100 | - 'desc' => __('Disable rating without disabling comments on listings', 'geodirectory'), |
|
101 | - 'id' => 'geodir_disable_rating', |
|
102 | - 'type' => 'checkbox', |
|
103 | - 'std' => '0' |
|
104 | - ), |
|
105 | - array( |
|
106 | - 'name' => __('User deleted posts go to trash', 'geodirectory'), |
|
107 | - 'desc' => __('If checked a user deleted post will go to trash, otherwise it will be permanently deleted', 'geodirectory'), |
|
108 | - 'id' => 'geodir_disable_perm_delete', |
|
109 | - 'type' => 'checkbox', |
|
110 | - 'std' => '1' |
|
111 | - ), |
|
112 | - array( |
|
113 | - 'name' => __('Maxi upload file size(in mb)', 'geodirectory'), |
|
114 | - 'desc' => __('(Maximum upload file size in MB, 1 MB = 1024 KB. Must be greater then 0(ZERO), for ex: 2 )', 'geodirectory'), |
|
115 | - 'id' => 'geodir_upload_max_filesize', |
|
116 | - 'type' => 'text', |
|
117 | - 'css' => 'min-width:300px;', |
|
118 | - 'std' => '2' |
|
119 | - ), |
|
120 | - |
|
121 | - |
|
122 | - |
|
123 | - array('type' => 'sectionend', 'id' => 'general_options'), |
|
61 | + array( |
|
62 | + 'name' => __('Allow user to see wp-admin area', 'geodirectory'), |
|
63 | + 'desc' => __('Yes', 'geodirectory'), |
|
64 | + 'id' => 'geodir_allow_wpadmin', |
|
65 | + 'std' => '1', |
|
66 | + 'type' => 'radio', |
|
67 | + 'value' => '1', |
|
68 | + 'radiogroup' => 'start' |
|
69 | + ), |
|
70 | + array( |
|
71 | + 'name' => __('Allow user to see wp-admin area', 'geodirectory'), |
|
72 | + 'desc' => __('No', 'geodirectory'), |
|
73 | + 'id' => 'geodir_allow_wpadmin', |
|
74 | + 'std' => '0', |
|
75 | + 'type' => 'radio', |
|
76 | + 'value' => '0', |
|
77 | + 'radiogroup' => 'end' |
|
78 | + ), |
|
79 | + |
|
80 | + array( |
|
81 | + 'name' => __('Allow user to choose own password', 'geodirectory'), |
|
82 | + 'desc' => __('Yes', 'geodirectory'), |
|
83 | + 'id' => 'geodir_allow_cpass', |
|
84 | + 'std' => '1', |
|
85 | + 'type' => 'radio', |
|
86 | + 'value' => '1', |
|
87 | + 'radiogroup' => 'start' |
|
88 | + ), |
|
89 | + array( |
|
90 | + 'name' => __('Allow user to choose own password', 'geodirectory'), |
|
91 | + 'desc' => __('No', 'geodirectory'), |
|
92 | + 'id' => 'geodir_allow_cpass', |
|
93 | + 'std' => '0', |
|
94 | + 'type' => 'radio', |
|
95 | + 'value' => '0', |
|
96 | + 'radiogroup' => 'end' |
|
97 | + ), |
|
98 | + array( |
|
99 | + 'name' => __('Disable rating on comments', 'geodirectory'), |
|
100 | + 'desc' => __('Disable rating without disabling comments on listings', 'geodirectory'), |
|
101 | + 'id' => 'geodir_disable_rating', |
|
102 | + 'type' => 'checkbox', |
|
103 | + 'std' => '0' |
|
104 | + ), |
|
105 | + array( |
|
106 | + 'name' => __('User deleted posts go to trash', 'geodirectory'), |
|
107 | + 'desc' => __('If checked a user deleted post will go to trash, otherwise it will be permanently deleted', 'geodirectory'), |
|
108 | + 'id' => 'geodir_disable_perm_delete', |
|
109 | + 'type' => 'checkbox', |
|
110 | + 'std' => '1' |
|
111 | + ), |
|
112 | + array( |
|
113 | + 'name' => __('Maxi upload file size(in mb)', 'geodirectory'), |
|
114 | + 'desc' => __('(Maximum upload file size in MB, 1 MB = 1024 KB. Must be greater then 0(ZERO), for ex: 2 )', 'geodirectory'), |
|
115 | + 'id' => 'geodir_upload_max_filesize', |
|
116 | + 'type' => 'text', |
|
117 | + 'css' => 'min-width:300px;', |
|
118 | + 'std' => '2' |
|
119 | + ), |
|
120 | + |
|
121 | + |
|
122 | + |
|
123 | + array('type' => 'sectionend', 'id' => 'general_options'), |
|
124 | 124 | |
125 | 125 | ));/* General Options End*/ |
126 | 126 | |
@@ -132,82 +132,82 @@ discard block |
||
132 | 132 | */ |
133 | 133 | $google_analytic_settings = apply_filters('geodir_google_analytic_settings', array( |
134 | 134 | |
135 | - array('name' => __('Google Analytics', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'google_analytic_settings'), |
|
136 | - |
|
137 | - array('name' => __('Google Analytic Settings', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'google_analytic_settings'), |
|
138 | - |
|
139 | - |
|
140 | - |
|
141 | - array( |
|
142 | - 'name' => __('Show business owner google analytics stats?', 'geodirectory'), |
|
143 | - 'desc' => __('Yes', 'geodirectory'), |
|
144 | - 'id' => 'geodir_ga_stats', |
|
145 | - 'std' => '0', |
|
146 | - 'type' => 'radio', |
|
147 | - 'value' => '1', |
|
148 | - 'radiogroup' => 'start' |
|
149 | - ), |
|
150 | - array( |
|
151 | - 'name' => __('Show business owner Google Analytics stats?', 'geodirectory'), |
|
152 | - 'desc' => __('No', 'geodirectory'), |
|
153 | - 'id' => 'geodir_ga_stats', |
|
154 | - 'std' => '1', |
|
155 | - 'type' => 'radio', |
|
156 | - 'value' => '0', |
|
157 | - 'radiogroup' => 'end' |
|
158 | - ), |
|
159 | - |
|
160 | - array( |
|
161 | - 'name' => __('Google analytics "Profile ID(ie: ga:12345678)?', 'geodirectory') . ' ' . |
|
162 | - '<a target="_blank" href="https://docs.wpgeodirectory.com/gd-core-plugin-google-analytics/">' . __('help', 'geodirectory') . '</a>', |
|
163 | - 'desc' => '', |
|
164 | - 'id' => 'geodir_ga_id', |
|
165 | - 'type' => 'text', |
|
166 | - 'css' => 'min-width:300px;', |
|
167 | - 'std' => '' // Default value for the page title - changed in settings |
|
168 | - ), |
|
169 | - |
|
170 | - array( |
|
171 | - 'name' => __('Client ID', 'geodirectory') . ' ' . |
|
172 | - '<a target="_blank" href="https://docs.wpgeodirectory.com/gd-core-plugin-google-analytics/">' . __('help', 'geodirectory') . '</a>', |
|
173 | - 'desc' => '', |
|
174 | - 'id' => 'geodir_ga_client_id', |
|
175 | - 'type' => 'text', |
|
176 | - 'css' => 'min-width:300px;', |
|
177 | - 'std' => '' // Default value for the page title - changed in settings |
|
178 | - ), |
|
179 | - |
|
180 | - array( |
|
181 | - 'name' => __('Client secret', 'geodirectory') . ' ' . |
|
182 | - '<a target="_blank" href="https://docs.wpgeodirectory.com/gd-core-plugin-google-analytics/">' . __('help', 'geodirectory') . '</a>', |
|
183 | - 'desc' => '', |
|
184 | - 'id' => 'geodir_ga_client_secret', |
|
185 | - 'type' => 'password', |
|
186 | - 'css' => 'min-width:300px;', |
|
187 | - 'std' => '' // Default value for the page title - changed in settings |
|
188 | - ), |
|
189 | - |
|
190 | - array( |
|
191 | - 'name' => __('Google analytics access', 'geodirectory'), |
|
192 | - 'desc' => '', |
|
193 | - 'id' => 'geodir_ga_token', |
|
194 | - 'type' => 'google_analytics', |
|
195 | - 'css' => 'min-width:300px;', |
|
196 | - 'std' => '' // Default value for the page title - changed in settings |
|
197 | - ), |
|
198 | - |
|
199 | - |
|
200 | - array( |
|
201 | - 'name' => __('Google analytics tracking code', 'geodirectory'), |
|
202 | - 'desc' => '', |
|
203 | - 'id' => 'geodir_ga_tracking_code', |
|
204 | - 'type' => 'textarea', |
|
205 | - 'css' => 'min-width:300px;', |
|
206 | - 'std' => '' // Default value for the page title - changed in settings |
|
207 | - ), |
|
208 | - |
|
209 | - |
|
210 | - array('type' => 'sectionend', 'id' => 'google_analytic_settings'), |
|
135 | + array('name' => __('Google Analytics', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'google_analytic_settings'), |
|
136 | + |
|
137 | + array('name' => __('Google Analytic Settings', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'google_analytic_settings'), |
|
138 | + |
|
139 | + |
|
140 | + |
|
141 | + array( |
|
142 | + 'name' => __('Show business owner google analytics stats?', 'geodirectory'), |
|
143 | + 'desc' => __('Yes', 'geodirectory'), |
|
144 | + 'id' => 'geodir_ga_stats', |
|
145 | + 'std' => '0', |
|
146 | + 'type' => 'radio', |
|
147 | + 'value' => '1', |
|
148 | + 'radiogroup' => 'start' |
|
149 | + ), |
|
150 | + array( |
|
151 | + 'name' => __('Show business owner Google Analytics stats?', 'geodirectory'), |
|
152 | + 'desc' => __('No', 'geodirectory'), |
|
153 | + 'id' => 'geodir_ga_stats', |
|
154 | + 'std' => '1', |
|
155 | + 'type' => 'radio', |
|
156 | + 'value' => '0', |
|
157 | + 'radiogroup' => 'end' |
|
158 | + ), |
|
159 | + |
|
160 | + array( |
|
161 | + 'name' => __('Google analytics "Profile ID(ie: ga:12345678)?', 'geodirectory') . ' ' . |
|
162 | + '<a target="_blank" href="https://docs.wpgeodirectory.com/gd-core-plugin-google-analytics/">' . __('help', 'geodirectory') . '</a>', |
|
163 | + 'desc' => '', |
|
164 | + 'id' => 'geodir_ga_id', |
|
165 | + 'type' => 'text', |
|
166 | + 'css' => 'min-width:300px;', |
|
167 | + 'std' => '' // Default value for the page title - changed in settings |
|
168 | + ), |
|
169 | + |
|
170 | + array( |
|
171 | + 'name' => __('Client ID', 'geodirectory') . ' ' . |
|
172 | + '<a target="_blank" href="https://docs.wpgeodirectory.com/gd-core-plugin-google-analytics/">' . __('help', 'geodirectory') . '</a>', |
|
173 | + 'desc' => '', |
|
174 | + 'id' => 'geodir_ga_client_id', |
|
175 | + 'type' => 'text', |
|
176 | + 'css' => 'min-width:300px;', |
|
177 | + 'std' => '' // Default value for the page title - changed in settings |
|
178 | + ), |
|
179 | + |
|
180 | + array( |
|
181 | + 'name' => __('Client secret', 'geodirectory') . ' ' . |
|
182 | + '<a target="_blank" href="https://docs.wpgeodirectory.com/gd-core-plugin-google-analytics/">' . __('help', 'geodirectory') . '</a>', |
|
183 | + 'desc' => '', |
|
184 | + 'id' => 'geodir_ga_client_secret', |
|
185 | + 'type' => 'password', |
|
186 | + 'css' => 'min-width:300px;', |
|
187 | + 'std' => '' // Default value for the page title - changed in settings |
|
188 | + ), |
|
189 | + |
|
190 | + array( |
|
191 | + 'name' => __('Google analytics access', 'geodirectory'), |
|
192 | + 'desc' => '', |
|
193 | + 'id' => 'geodir_ga_token', |
|
194 | + 'type' => 'google_analytics', |
|
195 | + 'css' => 'min-width:300px;', |
|
196 | + 'std' => '' // Default value for the page title - changed in settings |
|
197 | + ), |
|
198 | + |
|
199 | + |
|
200 | + array( |
|
201 | + 'name' => __('Google analytics tracking code', 'geodirectory'), |
|
202 | + 'desc' => '', |
|
203 | + 'id' => 'geodir_ga_tracking_code', |
|
204 | + 'type' => 'textarea', |
|
205 | + 'css' => 'min-width:300px;', |
|
206 | + 'std' => '' // Default value for the page title - changed in settings |
|
207 | + ), |
|
208 | + |
|
209 | + |
|
210 | + array('type' => 'sectionend', 'id' => 'google_analytic_settings'), |
|
211 | 211 | |
212 | 212 | )); // google_analytic_settings End |
213 | 213 | |
@@ -219,84 +219,84 @@ discard block |
||
219 | 219 | */ |
220 | 220 | $search_settings = apply_filters('geodir_search_settings', array( |
221 | 221 | |
222 | - array('name' => __('Search', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'search_settings'), |
|
223 | - |
|
224 | - array('name' => __('Search Settings', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'search_settings'), |
|
225 | - |
|
226 | - array( |
|
227 | - 'name' => __('Limit squared distance area to X miles (helps improve search speed)', 'geodirectory'), |
|
228 | - 'desc' => __('Enter whole number only ex. 40 (Tokyo is largest city in the world @40 sq miles) LEAVE BLANK FOR NO DISTANCE LIMIT', 'geodirectory'), |
|
229 | - 'id' => 'geodir_search_dist', |
|
230 | - 'type' => 'text', |
|
231 | - 'css' => 'min-width:300px;', |
|
232 | - 'std' => '40' // Default value for the page title - changed in settings |
|
233 | - ), |
|
234 | - |
|
235 | - array( |
|
236 | - 'name' => __('Show search distances in miles or km', 'geodirectory'), |
|
237 | - 'desc' => __('Miles', 'geodirectory'), |
|
238 | - 'id' => 'geodir_search_dist_1', |
|
239 | - 'std' => 'miles', |
|
240 | - 'type' => 'radio', |
|
241 | - 'value' => 'miles', |
|
242 | - 'radiogroup' => 'start' |
|
243 | - ), |
|
244 | - array( |
|
245 | - 'name' => __('Show search distances in miles or km', 'geodirectory'), |
|
246 | - 'desc' => __('Kilometers', 'geodirectory'), |
|
247 | - 'id' => 'geodir_search_dist_1', |
|
248 | - 'std' => 'miles', |
|
249 | - 'type' => 'radio', |
|
250 | - 'value' => 'km', |
|
251 | - 'radiogroup' => 'end' |
|
252 | - ), |
|
253 | - |
|
254 | - array( |
|
255 | - 'name' => __('If distance is less than 0.01 show distance in meters or feet', 'geodirectory'), |
|
256 | - 'desc' => __('Meters', 'geodirectory'), |
|
257 | - 'id' => 'geodir_search_dist_2', |
|
258 | - 'std' => 'meters', |
|
259 | - 'type' => 'radio', |
|
260 | - 'value' => 'meters', |
|
261 | - 'radiogroup' => 'start' |
|
262 | - ), |
|
263 | - |
|
264 | - array( |
|
265 | - 'name' => __('If distance is less than 0.01 show distance in meters or feet', 'geodirectory'), |
|
266 | - 'desc' => __('Feet', 'geodirectory'), |
|
267 | - 'id' => 'geodir_search_dist_2', |
|
268 | - 'std' => 'meters', |
|
269 | - 'type' => 'radio', |
|
270 | - 'value' => 'feet', |
|
271 | - 'radiogroup' => 'end' |
|
272 | - ), |
|
273 | - |
|
274 | - array( |
|
275 | - 'name' => __('Add location specific text to (Near) search for Google', 'geodirectory'), |
|
276 | - 'desc' => __('This is usefull if your directory is limted to one location such as: New York or Australia (this setting should be blank if using default country, regions etc with multilocation addon as it will automatically add them)', 'geodirectory'), |
|
277 | - 'id' => 'geodir_search_near_addition', |
|
278 | - 'type' => 'text', |
|
279 | - 'css' => 'min-width:300px;', |
|
280 | - 'std' => '' |
|
281 | - ), |
|
282 | - array( |
|
283 | - 'name' => __('Individual word search limit', 'geodirectory'), |
|
284 | - 'desc' => __('With this option you can limit individual words being searched for, for example searching for `Jo Brown` would return results with words like `Jones`, you can exclude these types of small character words if you wish.', 'geodirectory'), |
|
285 | - 'id' => 'geodir_search_word_limit', |
|
286 | - 'css' => 'min-width:300px;', |
|
287 | - 'std' => 'gridview_onehalf', |
|
288 | - 'type' => 'select', |
|
289 | - 'class' => 'chosen_select', |
|
290 | - 'options' => array_unique(array( |
|
291 | - '0' => __('Disabled', 'geodirectory'), |
|
292 | - '1' => __('1 Character words excluded', 'geodirectory'), |
|
293 | - '2' => __('2 Character words and less excluded', 'geodirectory'), |
|
294 | - '3' => __('3 Character words and less excluded', 'geodirectory'), |
|
295 | - )) |
|
296 | - ), |
|
297 | - |
|
298 | - |
|
299 | - array('type' => 'sectionend', 'id' => 'search_settings'), |
|
222 | + array('name' => __('Search', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'search_settings'), |
|
223 | + |
|
224 | + array('name' => __('Search Settings', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'search_settings'), |
|
225 | + |
|
226 | + array( |
|
227 | + 'name' => __('Limit squared distance area to X miles (helps improve search speed)', 'geodirectory'), |
|
228 | + 'desc' => __('Enter whole number only ex. 40 (Tokyo is largest city in the world @40 sq miles) LEAVE BLANK FOR NO DISTANCE LIMIT', 'geodirectory'), |
|
229 | + 'id' => 'geodir_search_dist', |
|
230 | + 'type' => 'text', |
|
231 | + 'css' => 'min-width:300px;', |
|
232 | + 'std' => '40' // Default value for the page title - changed in settings |
|
233 | + ), |
|
234 | + |
|
235 | + array( |
|
236 | + 'name' => __('Show search distances in miles or km', 'geodirectory'), |
|
237 | + 'desc' => __('Miles', 'geodirectory'), |
|
238 | + 'id' => 'geodir_search_dist_1', |
|
239 | + 'std' => 'miles', |
|
240 | + 'type' => 'radio', |
|
241 | + 'value' => 'miles', |
|
242 | + 'radiogroup' => 'start' |
|
243 | + ), |
|
244 | + array( |
|
245 | + 'name' => __('Show search distances in miles or km', 'geodirectory'), |
|
246 | + 'desc' => __('Kilometers', 'geodirectory'), |
|
247 | + 'id' => 'geodir_search_dist_1', |
|
248 | + 'std' => 'miles', |
|
249 | + 'type' => 'radio', |
|
250 | + 'value' => 'km', |
|
251 | + 'radiogroup' => 'end' |
|
252 | + ), |
|
253 | + |
|
254 | + array( |
|
255 | + 'name' => __('If distance is less than 0.01 show distance in meters or feet', 'geodirectory'), |
|
256 | + 'desc' => __('Meters', 'geodirectory'), |
|
257 | + 'id' => 'geodir_search_dist_2', |
|
258 | + 'std' => 'meters', |
|
259 | + 'type' => 'radio', |
|
260 | + 'value' => 'meters', |
|
261 | + 'radiogroup' => 'start' |
|
262 | + ), |
|
263 | + |
|
264 | + array( |
|
265 | + 'name' => __('If distance is less than 0.01 show distance in meters or feet', 'geodirectory'), |
|
266 | + 'desc' => __('Feet', 'geodirectory'), |
|
267 | + 'id' => 'geodir_search_dist_2', |
|
268 | + 'std' => 'meters', |
|
269 | + 'type' => 'radio', |
|
270 | + 'value' => 'feet', |
|
271 | + 'radiogroup' => 'end' |
|
272 | + ), |
|
273 | + |
|
274 | + array( |
|
275 | + 'name' => __('Add location specific text to (Near) search for Google', 'geodirectory'), |
|
276 | + 'desc' => __('This is usefull if your directory is limted to one location such as: New York or Australia (this setting should be blank if using default country, regions etc with multilocation addon as it will automatically add them)', 'geodirectory'), |
|
277 | + 'id' => 'geodir_search_near_addition', |
|
278 | + 'type' => 'text', |
|
279 | + 'css' => 'min-width:300px;', |
|
280 | + 'std' => '' |
|
281 | + ), |
|
282 | + array( |
|
283 | + 'name' => __('Individual word search limit', 'geodirectory'), |
|
284 | + 'desc' => __('With this option you can limit individual words being searched for, for example searching for `Jo Brown` would return results with words like `Jones`, you can exclude these types of small character words if you wish.', 'geodirectory'), |
|
285 | + 'id' => 'geodir_search_word_limit', |
|
286 | + 'css' => 'min-width:300px;', |
|
287 | + 'std' => 'gridview_onehalf', |
|
288 | + 'type' => 'select', |
|
289 | + 'class' => 'chosen_select', |
|
290 | + 'options' => array_unique(array( |
|
291 | + '0' => __('Disabled', 'geodirectory'), |
|
292 | + '1' => __('1 Character words excluded', 'geodirectory'), |
|
293 | + '2' => __('2 Character words and less excluded', 'geodirectory'), |
|
294 | + '3' => __('3 Character words and less excluded', 'geodirectory'), |
|
295 | + )) |
|
296 | + ), |
|
297 | + |
|
298 | + |
|
299 | + array('type' => 'sectionend', 'id' => 'search_settings'), |
|
300 | 300 | |
301 | 301 | )); //search_settings End |
302 | 302 | |
@@ -308,17 +308,17 @@ discard block |
||
308 | 308 | */ |
309 | 309 | $dummy_data_settings = apply_filters('geodir_dummy_data_settings', array( |
310 | 310 | |
311 | - array('name' => __('Dummy Data', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'dummy_data_settings'), |
|
312 | - |
|
313 | - array( |
|
314 | - 'name' => '', |
|
315 | - 'desc' => '', |
|
316 | - 'id' => 'geodir_dummy_data_installer', |
|
317 | - 'type' => 'dummy_installer', |
|
318 | - 'css' => 'min-width:300px;', |
|
319 | - 'std' => '40' // Default value for the page title - changed in settings |
|
320 | - ), |
|
321 | - array('type' => 'sectionend', 'id' => 'geodir_dummy_data_settings'), |
|
311 | + array('name' => __('Dummy Data', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'dummy_data_settings'), |
|
312 | + |
|
313 | + array( |
|
314 | + 'name' => '', |
|
315 | + 'desc' => '', |
|
316 | + 'id' => 'geodir_dummy_data_installer', |
|
317 | + 'type' => 'dummy_installer', |
|
318 | + 'css' => 'min-width:300px;', |
|
319 | + 'std' => '40' // Default value for the page title - changed in settings |
|
320 | + ), |
|
321 | + array('type' => 'sectionend', 'id' => 'geodir_dummy_data_settings'), |
|
322 | 322 | |
323 | 323 | )); //dummy_data_settings End |
324 | 324 |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | 'id' => 'geodir_post_submited_success_email_subject_admin', |
130 | 130 | 'type' => 'text', |
131 | 131 | 'css' => 'min-width:300px;', |
132 | - 'std' => __('Post Submitted Successfully','geodirectory') // Default value for the page title - changed in settings |
|
132 | + 'std' => __('Post Submitted Successfully', 'geodirectory') // Default value for the page title - changed in settings |
|
133 | 133 | ), |
134 | 134 | array( |
135 | 135 | 'name' => '', |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | 'id' => 'geodir_post_submited_success_email_content_admin', |
138 | 138 | 'css' => 'width:500px; height: 150px;', |
139 | 139 | 'type' => 'textarea', |
140 | - 'std' => __('<p>Dear Admin,</p><p>A new listing has been published [#listing_link#]. This email is just for your information.</p><br><p>[#site_name#]</p>','geodirectory') |
|
140 | + 'std' => __('<p>Dear Admin,</p><p>A new listing has been published [#listing_link#]. This email is just for your information.</p><br><p>[#site_name#]</p>', 'geodirectory') |
|
141 | 141 | ), |
142 | 142 | |
143 | 143 | |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | 'id' => 'geodir_post_submited_success_email_subject', |
155 | 155 | 'type' => 'text', |
156 | 156 | 'css' => 'min-width:300px;', |
157 | - 'std' => __('Post Submitted Successfully','geodirectory') // Default value for the page title - changed in settings |
|
157 | + 'std' => __('Post Submitted Successfully', 'geodirectory') // Default value for the page title - changed in settings |
|
158 | 158 | ), |
159 | 159 | array( |
160 | 160 | 'name' => '', |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | 'id' => 'geodir_post_submited_success_email_content', |
163 | 163 | 'css' => 'width:500px; height: 150px;', |
164 | 164 | 'type' => 'textarea', |
165 | - 'std' => __('<p>Dear [#client_name#],</p><p>You submitted the below listing information. This email is just for your information.</p><p>[#listing_link#]</p><br><p>Thank you for your contribution.</p><p>[#site_name#]</p>','geodirectory') |
|
165 | + 'std' => __('<p>Dear [#client_name#],</p><p>You submitted the below listing information. This email is just for your information.</p><p>[#listing_link#]</p><br><p>Thank you for your contribution.</p><p>[#site_name#]</p>', 'geodirectory') |
|
166 | 166 | ), |
167 | 167 | |
168 | 168 | |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | 'id' => 'geodir_forgot_password_content', |
181 | 181 | 'css' => 'width:500px; height: 150px;', |
182 | 182 | 'type' => 'textarea', |
183 | - 'std' => __("<p>Dear [#client_name#],<p><p>You requested a new password for [#site_name_url#]</p><p>[#login_details#]</p><p>You can login here: [#login_url#]</p><p>Thank you,<br /><br />[#site_name_url#].</p>",'geodirectory') |
|
183 | + 'std' => __("<p>Dear [#client_name#],<p><p>You requested a new password for [#site_name_url#]</p><p>[#login_details#]</p><p>You can login here: [#login_url#]</p><p>Thank you,<br /><br />[#site_name_url#].</p>", 'geodirectory') |
|
184 | 184 | ), |
185 | 185 | |
186 | 186 | array( |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | 'id' => 'geodir_registration_success_email_content', |
198 | 198 | 'css' => 'width:500px; height: 150px;', |
199 | 199 | 'type' => 'textarea', |
200 | - 'std' => __("<p>Dear [#client_name#],</p><p>You can log in with the following information:</p><p>[#login_details#]</p><p>You can login here: [#login_url#]</p><p>Thank you,<br /><br />[#site_name_url#].</p>",'geodirectory') |
|
200 | + 'std' => __("<p>Dear [#client_name#],</p><p>You can log in with the following information:</p><p>[#login_details#]</p><p>You can login here: [#login_url#]</p><p>Thank you,<br /><br />[#site_name_url#].</p>", 'geodirectory') |
|
201 | 201 | ), |
202 | 202 | array( |
203 | 203 | 'name' => __('Listing published email', 'geodirectory'), |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | 'id' => 'geodir_email_friend_content', |
237 | 237 | 'css' => 'width:500px; height: 150px;', |
238 | 238 | 'type' => 'textarea', |
239 | - 'std' => __("<p>Dear [#to_name#],<p><p>Your friend has sent you a message from <b>[#site_name#]</b> </p><p>===============================</p><p><b>Subject : [#subject#]</b></p><p>[#comments#] [#listing_link#]</p><p>===============================</p><p>Thank you,<br /><br />[#site_name#].</p>",'geodirectory') |
|
239 | + 'std' => __("<p>Dear [#to_name#],<p><p>Your friend has sent you a message from <b>[#site_name#]</b> </p><p>===============================</p><p><b>Subject : [#subject#]</b></p><p>[#comments#] [#listing_link#]</p><p>===============================</p><p>Thank you,<br /><br />[#site_name#].</p>", 'geodirectory') |
|
240 | 240 | ), |
241 | 241 | |
242 | 242 | array( |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | 'id' => 'geodir_email_enquiry_content', |
254 | 254 | 'css' => 'width:500px; height: 150px;', |
255 | 255 | 'type' => 'textarea', |
256 | - 'std' => __("<p>Dear [#to_name#],<p><p>An enquiry has been sent from <b>[#listing_link#]</b></p><p>===============================</p><p>[#comments#]</p><p>===============================</p><p>Thank you,<br /><br />[#site_name_url#].</p>",'geodirectory') |
|
256 | + 'std' => __("<p>Dear [#to_name#],<p><p>An enquiry has been sent from <b>[#listing_link#]</b></p><p>===============================</p><p>[#comments#]</p><p>===============================</p><p>Thank you,<br /><br />[#site_name_url#].</p>", 'geodirectory') |
|
257 | 257 | ), |
258 | 258 | |
259 | 259 | array('type' => 'sectionend', 'id' => 'other_emails'), |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | 'id' => 'geodir_post_added_success_msg_content', |
270 | 270 | 'css' => 'width:500px; height: 150px;', |
271 | 271 | 'type' => 'textarea', |
272 | - 'std' => __('<p>Thank you, your information has been successfully received.</p><p><a href="[#submited_information_link#]" >View your submitted information »</a></p><p>Thank you for visiting us at [#site_name#].</p>','geodirectory') |
|
272 | + 'std' => __('<p>Thank you, your information has been successfully received.</p><p><a href="[#submited_information_link#]" >View your submitted information »</a></p><p>Thank you for visiting us at [#site_name#].</p>', 'geodirectory') |
|
273 | 273 | ), |
274 | 274 | |
275 | 275 |
@@ -17,262 +17,262 @@ |
||
17 | 17 | $geodir_settings['notifications_settings'] = apply_filters('geodir_notifications_settings', array( |
18 | 18 | |
19 | 19 | |
20 | - array('name' => __('Options', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'notification_options'), |
|
21 | - |
|
22 | - |
|
23 | - array('name' => __('Notification Options', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'notification_options'), |
|
24 | - |
|
25 | - array( |
|
26 | - 'name' => __('List of usable shortcodes', 'geodirectory'), |
|
27 | - 'desc' => __('[#client_name#],[#listing_link#],[#posted_date#],[#number_of_days#],[#number_of_grace_days#],[#login_url#],[#username#],[#user_email#],[#site_name_url#],[#renew_link#],[#post_id#],[#site_name#],[#from_email#](in most cases this will be the admin email, except for popup forms)', 'geodirectory'), |
|
28 | - 'id' => 'geodir_list_of_usable_shordcodes', |
|
29 | - 'type' => 'html_content', |
|
30 | - 'css' => 'min-width:300px;', |
|
31 | - 'std' => 'All Places' // Default value for the page title - changed in settings |
|
32 | - ), |
|
33 | - |
|
34 | - array( |
|
35 | - 'name' => __('Use advanced editor? (slow loading)', 'geodirectory'), |
|
36 | - 'desc' => __('Yes', 'geodirectory'), |
|
37 | - 'id' => 'geodir_tiny_editor', |
|
38 | - 'std' => 'yes', |
|
39 | - 'type' => 'radio', |
|
40 | - 'value' => '1', |
|
41 | - 'radiogroup' => 'start' |
|
42 | - ), |
|
43 | - array( |
|
44 | - 'name' => __('Use advanced editor?(slow loading)', 'geodirectory'), |
|
45 | - 'desc' => __('No', 'geodirectory'), |
|
46 | - 'id' => 'geodir_tiny_editor', |
|
47 | - 'std' => 'yes', |
|
48 | - 'type' => 'radio', |
|
49 | - 'value' => '0', |
|
50 | - 'radiogroup' => 'end' |
|
51 | - ), |
|
52 | - |
|
53 | - |
|
54 | - array('type' => 'sectionend', 'id' => 'notification_options'), |
|
55 | - |
|
56 | - |
|
57 | - array('name' => __('Site Bcc Options', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'site_bcc_options'), |
|
58 | - |
|
59 | - array('name' => __('Site Bcc Options', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'site_bcc_options'), |
|
60 | - |
|
61 | - array( |
|
62 | - 'name' => __('New user registration', 'geodirectory'), |
|
63 | - 'desc' => __('Yes', 'geodirectory'), |
|
64 | - 'id' => 'geodir_bcc_new_user', |
|
65 | - 'std' => 'yes', |
|
66 | - 'type' => 'radio', |
|
67 | - 'value' => '1', |
|
68 | - 'radiogroup' => 'start' |
|
69 | - ), |
|
70 | - array( |
|
71 | - 'name' => __('New user registration', 'geodirectory'), |
|
72 | - 'desc' => __('No', 'geodirectory'), |
|
73 | - 'id' => 'geodir_bcc_new_user', |
|
74 | - 'std' => 'yes', |
|
75 | - 'type' => 'radio', |
|
76 | - 'value' => '0', |
|
77 | - 'radiogroup' => 'end' |
|
78 | - ), |
|
79 | - |
|
80 | - array( |
|
81 | - 'name' => __('Send to friend', 'geodirectory'), |
|
82 | - 'desc' => __('Yes', 'geodirectory'), |
|
83 | - 'id' => 'geodir_bcc_friend', |
|
84 | - 'std' => 'yes', |
|
85 | - 'type' => 'radio', |
|
86 | - 'value' => '1', |
|
87 | - 'radiogroup' => 'start' |
|
88 | - ), |
|
89 | - array( |
|
90 | - 'name' => __('Send to friend', 'geodirectory'), |
|
91 | - 'desc' => __('No', 'geodirectory'), |
|
92 | - 'id' => 'geodir_bcc_friend', |
|
93 | - 'std' => 'yes', |
|
94 | - 'type' => 'radio', |
|
95 | - 'value' => '0', |
|
96 | - 'radiogroup' => 'end' |
|
97 | - ), |
|
98 | - |
|
99 | - array( |
|
100 | - 'name' => __('Send enquiry', 'geodirectory'), |
|
101 | - 'desc' => __('Yes', 'geodirectory'), |
|
102 | - 'id' => 'geodir_bcc_enquiry', |
|
103 | - 'std' => 'yes', |
|
104 | - 'type' => 'radio', |
|
105 | - 'value' => '1', |
|
106 | - 'radiogroup' => 'start' |
|
107 | - ), |
|
108 | - array( |
|
109 | - 'name' => __('Send enquiry', 'geodirectory'), |
|
110 | - 'desc' => __('No', 'geodirectory'), |
|
111 | - 'id' => 'geodir_bcc_enquiry', |
|
112 | - 'std' => 'yes', |
|
113 | - 'type' => 'radio', |
|
114 | - 'value' => '0', |
|
115 | - 'radiogroup' => 'end' |
|
116 | - ), |
|
117 | - |
|
118 | - |
|
119 | - array('type' => 'sectionend', 'id' => 'site_bcc_options'), |
|
120 | - |
|
121 | - |
|
122 | - array('name' => __('Admin Emails', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'admin_emails'), |
|
123 | - |
|
124 | - array('name' => __('Admin Emails', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'admin_emails'), |
|
125 | - |
|
126 | - array( |
|
127 | - 'name' => __('Post submit success to admin email', 'geodirectory'), |
|
128 | - 'desc' => '', |
|
129 | - 'id' => 'geodir_post_submited_success_email_subject_admin', |
|
130 | - 'type' => 'text', |
|
131 | - 'css' => 'min-width:300px;', |
|
132 | - 'std' => __('Post Submitted Successfully','geodirectory') // Default value for the page title - changed in settings |
|
133 | - ), |
|
134 | - array( |
|
135 | - 'name' => '', |
|
136 | - 'desc' => '', |
|
137 | - 'id' => 'geodir_post_submited_success_email_content_admin', |
|
138 | - 'css' => 'width:500px; height: 150px;', |
|
139 | - 'type' => 'textarea', |
|
140 | - 'std' => __('<p>Dear Admin,</p><p>A new listing has been published [#listing_link#]. This email is just for your information.</p><br><p>[#site_name#]</p>','geodirectory') |
|
141 | - ), |
|
142 | - |
|
143 | - |
|
144 | - array('type' => 'sectionend', 'id' => 'admin_emails'), |
|
145 | - |
|
146 | - |
|
147 | - array('name' => __('Client Emails', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'client_emails'), |
|
148 | - |
|
149 | - array('name' => __('Client Emails', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'client_emails'), |
|
150 | - |
|
151 | - array( |
|
152 | - 'name' => __('Post submit success to client email', 'geodirectory'), |
|
153 | - 'desc' => '', |
|
154 | - 'id' => 'geodir_post_submited_success_email_subject', |
|
155 | - 'type' => 'text', |
|
156 | - 'css' => 'min-width:300px;', |
|
157 | - 'std' => __('Post Submitted Successfully','geodirectory') // Default value for the page title - changed in settings |
|
158 | - ), |
|
159 | - array( |
|
160 | - 'name' => '', |
|
161 | - 'desc' => '', |
|
162 | - 'id' => 'geodir_post_submited_success_email_content', |
|
163 | - 'css' => 'width:500px; height: 150px;', |
|
164 | - 'type' => 'textarea', |
|
165 | - 'std' => __('<p>Dear [#client_name#],</p><p>You submitted the below listing information. This email is just for your information.</p><p>[#listing_link#]</p><br><p>Thank you for your contribution.</p><p>[#site_name#]</p>','geodirectory') |
|
166 | - ), |
|
167 | - |
|
168 | - |
|
169 | - array( |
|
170 | - 'name' => __('User forgot password email', 'geodirectory'), |
|
171 | - 'desc' => '', |
|
172 | - 'id' => 'geodir_forgot_password_subject', |
|
173 | - 'type' => 'text', |
|
174 | - 'css' => 'min-width:300px;', |
|
175 | - 'std' => __('[#site_name#] - Your new password', 'geodirectory') // Default value for the page title - changed in settings |
|
176 | - ), |
|
177 | - array( |
|
178 | - 'name' => '', |
|
179 | - 'desc' => '', |
|
180 | - 'id' => 'geodir_forgot_password_content', |
|
181 | - 'css' => 'width:500px; height: 150px;', |
|
182 | - 'type' => 'textarea', |
|
183 | - 'std' => __("<p>Dear [#client_name#],<p><p>You requested a new password for [#site_name_url#]</p><p>[#login_details#]</p><p>You can login here: [#login_url#]</p><p>Thank you,<br /><br />[#site_name_url#].</p>",'geodirectory') |
|
184 | - ), |
|
185 | - |
|
186 | - array( |
|
187 | - 'name' => __('Registration success email', 'geodirectory'), |
|
188 | - 'desc' => '', |
|
189 | - 'id' => 'geodir_registration_success_email_subject', |
|
190 | - 'type' => 'text', |
|
191 | - 'css' => 'min-width:300px;', |
|
192 | - 'std' => __('Your Log In Details', 'geodirectory') // Default value for the page title - changed in settings |
|
193 | - ), |
|
194 | - array( |
|
195 | - 'name' => '', |
|
196 | - 'desc' => '', |
|
197 | - 'id' => 'geodir_registration_success_email_content', |
|
198 | - 'css' => 'width:500px; height: 150px;', |
|
199 | - 'type' => 'textarea', |
|
200 | - 'std' => __("<p>Dear [#client_name#],</p><p>You can log in with the following information:</p><p>[#login_details#]</p><p>You can login here: [#login_url#]</p><p>Thank you,<br /><br />[#site_name_url#].</p>",'geodirectory') |
|
201 | - ), |
|
202 | - array( |
|
203 | - 'name' => __('Listing published email', 'geodirectory'), |
|
204 | - 'desc' => '', |
|
205 | - 'id' => 'geodir_post_published_email_subject', |
|
206 | - 'type' => 'text', |
|
207 | - 'css' => 'min-width:300px;', |
|
208 | - 'std' => __('Listing Published Successfully', 'geodirectory') // Default value for the page title - changed in settings |
|
209 | - ), |
|
210 | - array( |
|
211 | - 'name' => '', |
|
212 | - 'desc' => '', |
|
213 | - 'id' => 'geodir_post_published_email_content', |
|
214 | - 'css' => 'width:500px; height: 150px;', |
|
215 | - 'type' => 'textarea', |
|
216 | - 'std' => __("<p>Dear [#client_name#],</p><p>Your listing [#listing_link#] has been published. This email is just for your information.</p><p>[#listing_link#]</p><br><p>Thank you for your contribution.</p><p>[#site_name#]</p>", 'geodirectory') |
|
217 | - ), |
|
218 | - |
|
219 | - array('type' => 'sectionend', 'id' => 'client_emails'), |
|
220 | - |
|
221 | - array('name' => __('Other Emails', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'other_emails'), |
|
222 | - |
|
223 | - array('name' => __('Other Emails', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'other_emails'), |
|
224 | - |
|
225 | - array( |
|
226 | - 'name' => __('Send to friend', 'geodirectory'), |
|
227 | - 'desc' => '', |
|
228 | - 'id' => 'geodir_email_friend_subject', |
|
229 | - 'type' => 'text', |
|
230 | - 'css' => 'min-width:300px;', |
|
231 | - 'std' => __('[#from_name#] thought you might be interested in..', 'geodirectory') |
|
232 | - ), |
|
233 | - array( |
|
234 | - 'name' => '', |
|
235 | - 'desc' => '', |
|
236 | - 'id' => 'geodir_email_friend_content', |
|
237 | - 'css' => 'width:500px; height: 150px;', |
|
238 | - 'type' => 'textarea', |
|
239 | - 'std' => __("<p>Dear [#to_name#],<p><p>Your friend has sent you a message from <b>[#site_name#]</b> </p><p>===============================</p><p><b>Subject : [#subject#]</b></p><p>[#comments#] [#listing_link#]</p><p>===============================</p><p>Thank you,<br /><br />[#site_name#].</p>",'geodirectory') |
|
240 | - ), |
|
241 | - |
|
242 | - array( |
|
243 | - 'name' => __('Email enquiry', 'geodirectory'), |
|
244 | - 'desc' => '', |
|
245 | - 'id' => 'geodir_email_enquiry_subject', |
|
246 | - 'type' => 'text', |
|
247 | - 'css' => 'min-width:300px;', |
|
248 | - 'std' => __('Website Enquiry', 'geodirectory') |
|
249 | - ), |
|
250 | - array( |
|
251 | - 'name' => '', |
|
252 | - 'desc' => '', |
|
253 | - 'id' => 'geodir_email_enquiry_content', |
|
254 | - 'css' => 'width:500px; height: 150px;', |
|
255 | - 'type' => 'textarea', |
|
256 | - 'std' => __("<p>Dear [#to_name#],<p><p>An enquiry has been sent from <b>[#listing_link#]</b></p><p>===============================</p><p>[#comments#]</p><p>===============================</p><p>Thank you,<br /><br />[#site_name_url#].</p>",'geodirectory') |
|
257 | - ), |
|
258 | - |
|
259 | - array('type' => 'sectionend', 'id' => 'other_emails'), |
|
260 | - |
|
261 | - |
|
262 | - array('name' => __('Messages', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'messages'), |
|
263 | - |
|
264 | - array('name' => __('Messages', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'messages'), |
|
265 | - |
|
266 | - array( |
|
267 | - 'name' => __('Post submitted success', 'geodirectory'), |
|
268 | - 'desc' => '', |
|
269 | - 'id' => 'geodir_post_added_success_msg_content', |
|
270 | - 'css' => 'width:500px; height: 150px;', |
|
271 | - 'type' => 'textarea', |
|
272 | - 'std' => __('<p>Thank you, your information has been successfully received.</p><p><a href="[#submited_information_link#]" >View your submitted information »</a></p><p>Thank you for visiting us at [#site_name#].</p>','geodirectory') |
|
273 | - ), |
|
274 | - |
|
275 | - |
|
276 | - array('type' => 'sectionend', 'id' => 'messages'), |
|
20 | + array('name' => __('Options', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'notification_options'), |
|
21 | + |
|
22 | + |
|
23 | + array('name' => __('Notification Options', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'notification_options'), |
|
24 | + |
|
25 | + array( |
|
26 | + 'name' => __('List of usable shortcodes', 'geodirectory'), |
|
27 | + 'desc' => __('[#client_name#],[#listing_link#],[#posted_date#],[#number_of_days#],[#number_of_grace_days#],[#login_url#],[#username#],[#user_email#],[#site_name_url#],[#renew_link#],[#post_id#],[#site_name#],[#from_email#](in most cases this will be the admin email, except for popup forms)', 'geodirectory'), |
|
28 | + 'id' => 'geodir_list_of_usable_shordcodes', |
|
29 | + 'type' => 'html_content', |
|
30 | + 'css' => 'min-width:300px;', |
|
31 | + 'std' => 'All Places' // Default value for the page title - changed in settings |
|
32 | + ), |
|
33 | + |
|
34 | + array( |
|
35 | + 'name' => __('Use advanced editor? (slow loading)', 'geodirectory'), |
|
36 | + 'desc' => __('Yes', 'geodirectory'), |
|
37 | + 'id' => 'geodir_tiny_editor', |
|
38 | + 'std' => 'yes', |
|
39 | + 'type' => 'radio', |
|
40 | + 'value' => '1', |
|
41 | + 'radiogroup' => 'start' |
|
42 | + ), |
|
43 | + array( |
|
44 | + 'name' => __('Use advanced editor?(slow loading)', 'geodirectory'), |
|
45 | + 'desc' => __('No', 'geodirectory'), |
|
46 | + 'id' => 'geodir_tiny_editor', |
|
47 | + 'std' => 'yes', |
|
48 | + 'type' => 'radio', |
|
49 | + 'value' => '0', |
|
50 | + 'radiogroup' => 'end' |
|
51 | + ), |
|
52 | + |
|
53 | + |
|
54 | + array('type' => 'sectionend', 'id' => 'notification_options'), |
|
55 | + |
|
56 | + |
|
57 | + array('name' => __('Site Bcc Options', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'site_bcc_options'), |
|
58 | + |
|
59 | + array('name' => __('Site Bcc Options', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'site_bcc_options'), |
|
60 | + |
|
61 | + array( |
|
62 | + 'name' => __('New user registration', 'geodirectory'), |
|
63 | + 'desc' => __('Yes', 'geodirectory'), |
|
64 | + 'id' => 'geodir_bcc_new_user', |
|
65 | + 'std' => 'yes', |
|
66 | + 'type' => 'radio', |
|
67 | + 'value' => '1', |
|
68 | + 'radiogroup' => 'start' |
|
69 | + ), |
|
70 | + array( |
|
71 | + 'name' => __('New user registration', 'geodirectory'), |
|
72 | + 'desc' => __('No', 'geodirectory'), |
|
73 | + 'id' => 'geodir_bcc_new_user', |
|
74 | + 'std' => 'yes', |
|
75 | + 'type' => 'radio', |
|
76 | + 'value' => '0', |
|
77 | + 'radiogroup' => 'end' |
|
78 | + ), |
|
79 | + |
|
80 | + array( |
|
81 | + 'name' => __('Send to friend', 'geodirectory'), |
|
82 | + 'desc' => __('Yes', 'geodirectory'), |
|
83 | + 'id' => 'geodir_bcc_friend', |
|
84 | + 'std' => 'yes', |
|
85 | + 'type' => 'radio', |
|
86 | + 'value' => '1', |
|
87 | + 'radiogroup' => 'start' |
|
88 | + ), |
|
89 | + array( |
|
90 | + 'name' => __('Send to friend', 'geodirectory'), |
|
91 | + 'desc' => __('No', 'geodirectory'), |
|
92 | + 'id' => 'geodir_bcc_friend', |
|
93 | + 'std' => 'yes', |
|
94 | + 'type' => 'radio', |
|
95 | + 'value' => '0', |
|
96 | + 'radiogroup' => 'end' |
|
97 | + ), |
|
98 | + |
|
99 | + array( |
|
100 | + 'name' => __('Send enquiry', 'geodirectory'), |
|
101 | + 'desc' => __('Yes', 'geodirectory'), |
|
102 | + 'id' => 'geodir_bcc_enquiry', |
|
103 | + 'std' => 'yes', |
|
104 | + 'type' => 'radio', |
|
105 | + 'value' => '1', |
|
106 | + 'radiogroup' => 'start' |
|
107 | + ), |
|
108 | + array( |
|
109 | + 'name' => __('Send enquiry', 'geodirectory'), |
|
110 | + 'desc' => __('No', 'geodirectory'), |
|
111 | + 'id' => 'geodir_bcc_enquiry', |
|
112 | + 'std' => 'yes', |
|
113 | + 'type' => 'radio', |
|
114 | + 'value' => '0', |
|
115 | + 'radiogroup' => 'end' |
|
116 | + ), |
|
117 | + |
|
118 | + |
|
119 | + array('type' => 'sectionend', 'id' => 'site_bcc_options'), |
|
120 | + |
|
121 | + |
|
122 | + array('name' => __('Admin Emails', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'admin_emails'), |
|
123 | + |
|
124 | + array('name' => __('Admin Emails', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'admin_emails'), |
|
125 | + |
|
126 | + array( |
|
127 | + 'name' => __('Post submit success to admin email', 'geodirectory'), |
|
128 | + 'desc' => '', |
|
129 | + 'id' => 'geodir_post_submited_success_email_subject_admin', |
|
130 | + 'type' => 'text', |
|
131 | + 'css' => 'min-width:300px;', |
|
132 | + 'std' => __('Post Submitted Successfully','geodirectory') // Default value for the page title - changed in settings |
|
133 | + ), |
|
134 | + array( |
|
135 | + 'name' => '', |
|
136 | + 'desc' => '', |
|
137 | + 'id' => 'geodir_post_submited_success_email_content_admin', |
|
138 | + 'css' => 'width:500px; height: 150px;', |
|
139 | + 'type' => 'textarea', |
|
140 | + 'std' => __('<p>Dear Admin,</p><p>A new listing has been published [#listing_link#]. This email is just for your information.</p><br><p>[#site_name#]</p>','geodirectory') |
|
141 | + ), |
|
142 | + |
|
143 | + |
|
144 | + array('type' => 'sectionend', 'id' => 'admin_emails'), |
|
145 | + |
|
146 | + |
|
147 | + array('name' => __('Client Emails', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'client_emails'), |
|
148 | + |
|
149 | + array('name' => __('Client Emails', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'client_emails'), |
|
150 | + |
|
151 | + array( |
|
152 | + 'name' => __('Post submit success to client email', 'geodirectory'), |
|
153 | + 'desc' => '', |
|
154 | + 'id' => 'geodir_post_submited_success_email_subject', |
|
155 | + 'type' => 'text', |
|
156 | + 'css' => 'min-width:300px;', |
|
157 | + 'std' => __('Post Submitted Successfully','geodirectory') // Default value for the page title - changed in settings |
|
158 | + ), |
|
159 | + array( |
|
160 | + 'name' => '', |
|
161 | + 'desc' => '', |
|
162 | + 'id' => 'geodir_post_submited_success_email_content', |
|
163 | + 'css' => 'width:500px; height: 150px;', |
|
164 | + 'type' => 'textarea', |
|
165 | + 'std' => __('<p>Dear [#client_name#],</p><p>You submitted the below listing information. This email is just for your information.</p><p>[#listing_link#]</p><br><p>Thank you for your contribution.</p><p>[#site_name#]</p>','geodirectory') |
|
166 | + ), |
|
167 | + |
|
168 | + |
|
169 | + array( |
|
170 | + 'name' => __('User forgot password email', 'geodirectory'), |
|
171 | + 'desc' => '', |
|
172 | + 'id' => 'geodir_forgot_password_subject', |
|
173 | + 'type' => 'text', |
|
174 | + 'css' => 'min-width:300px;', |
|
175 | + 'std' => __('[#site_name#] - Your new password', 'geodirectory') // Default value for the page title - changed in settings |
|
176 | + ), |
|
177 | + array( |
|
178 | + 'name' => '', |
|
179 | + 'desc' => '', |
|
180 | + 'id' => 'geodir_forgot_password_content', |
|
181 | + 'css' => 'width:500px; height: 150px;', |
|
182 | + 'type' => 'textarea', |
|
183 | + 'std' => __("<p>Dear [#client_name#],<p><p>You requested a new password for [#site_name_url#]</p><p>[#login_details#]</p><p>You can login here: [#login_url#]</p><p>Thank you,<br /><br />[#site_name_url#].</p>",'geodirectory') |
|
184 | + ), |
|
185 | + |
|
186 | + array( |
|
187 | + 'name' => __('Registration success email', 'geodirectory'), |
|
188 | + 'desc' => '', |
|
189 | + 'id' => 'geodir_registration_success_email_subject', |
|
190 | + 'type' => 'text', |
|
191 | + 'css' => 'min-width:300px;', |
|
192 | + 'std' => __('Your Log In Details', 'geodirectory') // Default value for the page title - changed in settings |
|
193 | + ), |
|
194 | + array( |
|
195 | + 'name' => '', |
|
196 | + 'desc' => '', |
|
197 | + 'id' => 'geodir_registration_success_email_content', |
|
198 | + 'css' => 'width:500px; height: 150px;', |
|
199 | + 'type' => 'textarea', |
|
200 | + 'std' => __("<p>Dear [#client_name#],</p><p>You can log in with the following information:</p><p>[#login_details#]</p><p>You can login here: [#login_url#]</p><p>Thank you,<br /><br />[#site_name_url#].</p>",'geodirectory') |
|
201 | + ), |
|
202 | + array( |
|
203 | + 'name' => __('Listing published email', 'geodirectory'), |
|
204 | + 'desc' => '', |
|
205 | + 'id' => 'geodir_post_published_email_subject', |
|
206 | + 'type' => 'text', |
|
207 | + 'css' => 'min-width:300px;', |
|
208 | + 'std' => __('Listing Published Successfully', 'geodirectory') // Default value for the page title - changed in settings |
|
209 | + ), |
|
210 | + array( |
|
211 | + 'name' => '', |
|
212 | + 'desc' => '', |
|
213 | + 'id' => 'geodir_post_published_email_content', |
|
214 | + 'css' => 'width:500px; height: 150px;', |
|
215 | + 'type' => 'textarea', |
|
216 | + 'std' => __("<p>Dear [#client_name#],</p><p>Your listing [#listing_link#] has been published. This email is just for your information.</p><p>[#listing_link#]</p><br><p>Thank you for your contribution.</p><p>[#site_name#]</p>", 'geodirectory') |
|
217 | + ), |
|
218 | + |
|
219 | + array('type' => 'sectionend', 'id' => 'client_emails'), |
|
220 | + |
|
221 | + array('name' => __('Other Emails', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'other_emails'), |
|
222 | + |
|
223 | + array('name' => __('Other Emails', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'other_emails'), |
|
224 | + |
|
225 | + array( |
|
226 | + 'name' => __('Send to friend', 'geodirectory'), |
|
227 | + 'desc' => '', |
|
228 | + 'id' => 'geodir_email_friend_subject', |
|
229 | + 'type' => 'text', |
|
230 | + 'css' => 'min-width:300px;', |
|
231 | + 'std' => __('[#from_name#] thought you might be interested in..', 'geodirectory') |
|
232 | + ), |
|
233 | + array( |
|
234 | + 'name' => '', |
|
235 | + 'desc' => '', |
|
236 | + 'id' => 'geodir_email_friend_content', |
|
237 | + 'css' => 'width:500px; height: 150px;', |
|
238 | + 'type' => 'textarea', |
|
239 | + 'std' => __("<p>Dear [#to_name#],<p><p>Your friend has sent you a message from <b>[#site_name#]</b> </p><p>===============================</p><p><b>Subject : [#subject#]</b></p><p>[#comments#] [#listing_link#]</p><p>===============================</p><p>Thank you,<br /><br />[#site_name#].</p>",'geodirectory') |
|
240 | + ), |
|
241 | + |
|
242 | + array( |
|
243 | + 'name' => __('Email enquiry', 'geodirectory'), |
|
244 | + 'desc' => '', |
|
245 | + 'id' => 'geodir_email_enquiry_subject', |
|
246 | + 'type' => 'text', |
|
247 | + 'css' => 'min-width:300px;', |
|
248 | + 'std' => __('Website Enquiry', 'geodirectory') |
|
249 | + ), |
|
250 | + array( |
|
251 | + 'name' => '', |
|
252 | + 'desc' => '', |
|
253 | + 'id' => 'geodir_email_enquiry_content', |
|
254 | + 'css' => 'width:500px; height: 150px;', |
|
255 | + 'type' => 'textarea', |
|
256 | + 'std' => __("<p>Dear [#to_name#],<p><p>An enquiry has been sent from <b>[#listing_link#]</b></p><p>===============================</p><p>[#comments#]</p><p>===============================</p><p>Thank you,<br /><br />[#site_name_url#].</p>",'geodirectory') |
|
257 | + ), |
|
258 | + |
|
259 | + array('type' => 'sectionend', 'id' => 'other_emails'), |
|
260 | + |
|
261 | + |
|
262 | + array('name' => __('Messages', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'messages'), |
|
263 | + |
|
264 | + array('name' => __('Messages', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'messages'), |
|
265 | + |
|
266 | + array( |
|
267 | + 'name' => __('Post submitted success', 'geodirectory'), |
|
268 | + 'desc' => '', |
|
269 | + 'id' => 'geodir_post_added_success_msg_content', |
|
270 | + 'css' => 'width:500px; height: 150px;', |
|
271 | + 'type' => 'textarea', |
|
272 | + 'std' => __('<p>Thank you, your information has been successfully received.</p><p><a href="[#submited_information_link#]" >View your submitted information »</a></p><p>Thank you for visiting us at [#site_name#].</p>','geodirectory') |
|
273 | + ), |
|
274 | + |
|
275 | + |
|
276 | + array('type' => 'sectionend', 'id' => 'messages'), |
|
277 | 277 | |
278 | 278 | )); // End Manage NOtifications settings |