@@ -10,47 +10,47 @@ discard block |
||
10 | 10 | global $wpdb; |
11 | 11 | |
12 | 12 | if (get_option('geodirectory' . '_db_version') != GEODIRECTORY_VERSION) { |
13 | - /** |
|
14 | - * Include custom database table related functions. |
|
15 | - * |
|
16 | - * @since 1.0.0 |
|
17 | - * @package GeoDirectory |
|
18 | - */ |
|
19 | - include_once('geodirectory-admin/admin_db_install.php'); |
|
20 | - add_action('plugins_loaded', 'geodirectory_upgrade_all', 10); |
|
21 | - if (GEODIRECTORY_VERSION <= '1.3.6') { |
|
22 | - add_action('plugins_loaded', 'geodir_upgrade_136', 11); |
|
23 | - } |
|
13 | + /** |
|
14 | + * Include custom database table related functions. |
|
15 | + * |
|
16 | + * @since 1.0.0 |
|
17 | + * @package GeoDirectory |
|
18 | + */ |
|
19 | + include_once('geodirectory-admin/admin_db_install.php'); |
|
20 | + add_action('plugins_loaded', 'geodirectory_upgrade_all', 10); |
|
21 | + if (GEODIRECTORY_VERSION <= '1.3.6') { |
|
22 | + add_action('plugins_loaded', 'geodir_upgrade_136', 11); |
|
23 | + } |
|
24 | 24 | |
25 | - if (GEODIRECTORY_VERSION <= '1.4.6') { |
|
26 | - add_action('init', 'geodir_upgrade_146', 11); |
|
27 | - } |
|
25 | + if (GEODIRECTORY_VERSION <= '1.4.6') { |
|
26 | + add_action('init', 'geodir_upgrade_146', 11); |
|
27 | + } |
|
28 | 28 | |
29 | - if (GEODIRECTORY_VERSION <= '1.4.8') { |
|
30 | - add_action('init', 'geodir_upgrade_148', 11); |
|
31 | - } |
|
29 | + if (GEODIRECTORY_VERSION <= '1.4.8') { |
|
30 | + add_action('init', 'geodir_upgrade_148', 11); |
|
31 | + } |
|
32 | 32 | |
33 | - if (GEODIRECTORY_VERSION <= '1.5.0') { |
|
34 | - add_action('init', 'geodir_upgrade_150', 11); |
|
35 | - } |
|
33 | + if (GEODIRECTORY_VERSION <= '1.5.0') { |
|
34 | + add_action('init', 'geodir_upgrade_150', 11); |
|
35 | + } |
|
36 | 36 | |
37 | - if (GEODIRECTORY_VERSION <= '1.5.2') { |
|
38 | - add_action('init', 'geodir_upgrade_152', 11); |
|
39 | - } |
|
37 | + if (GEODIRECTORY_VERSION <= '1.5.2') { |
|
38 | + add_action('init', 'geodir_upgrade_152', 11); |
|
39 | + } |
|
40 | 40 | |
41 | - if (GEODIRECTORY_VERSION <= '1.5.3') { |
|
42 | - add_action('init', 'geodir_upgrade_153', 11); |
|
43 | - } |
|
41 | + if (GEODIRECTORY_VERSION <= '1.5.3') { |
|
42 | + add_action('init', 'geodir_upgrade_153', 11); |
|
43 | + } |
|
44 | 44 | |
45 | - if (GEODIRECTORY_VERSION <= '1.5.4') { |
|
46 | - add_action('init', 'geodir_upgrade_154', 11); |
|
47 | - } |
|
45 | + if (GEODIRECTORY_VERSION <= '1.5.4') { |
|
46 | + add_action('init', 'geodir_upgrade_154', 11); |
|
47 | + } |
|
48 | 48 | |
49 | 49 | |
50 | 50 | |
51 | - add_action('init', 'gd_fix_cpt_rewrite_slug', 11);// this needs to be kept for a few versions |
|
51 | + add_action('init', 'gd_fix_cpt_rewrite_slug', 11);// this needs to be kept for a few versions |
|
52 | 52 | |
53 | - update_option('geodirectory' . '_db_version', GEODIRECTORY_VERSION); |
|
53 | + update_option('geodirectory' . '_db_version', GEODIRECTORY_VERSION); |
|
54 | 54 | |
55 | 55 | } |
56 | 56 | |
@@ -63,10 +63,10 @@ discard block |
||
63 | 63 | */ |
64 | 64 | function geodirectory_upgrade_all() |
65 | 65 | { |
66 | - geodir_create_tables(); |
|
67 | - geodir_update_review_db(); |
|
68 | - gd_install_theme_compat(); |
|
69 | - gd_convert_custom_field_display(); |
|
66 | + geodir_create_tables(); |
|
67 | + geodir_update_review_db(); |
|
68 | + gd_install_theme_compat(); |
|
69 | + gd_convert_custom_field_display(); |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | /** |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | */ |
78 | 78 | function geodir_upgrade_136() |
79 | 79 | { |
80 | - geodir_fix_review_overall_rating(); |
|
80 | + geodir_fix_review_overall_rating(); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | /** |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | * @package GeoDirectory |
88 | 88 | */ |
89 | 89 | function geodir_upgrade_146(){ |
90 | - gd_convert_virtual_pages(); |
|
90 | + gd_convert_virtual_pages(); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | /** |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | * @package GeoDirectory |
98 | 98 | */ |
99 | 99 | function geodir_upgrade_150(){ |
100 | - gd_fix_cpt_rewrite_slug(); |
|
100 | + gd_fix_cpt_rewrite_slug(); |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | |
@@ -109,11 +109,11 @@ discard block |
||
109 | 109 | * @package GeoDirectory |
110 | 110 | */ |
111 | 111 | function geodir_upgrade_148(){ |
112 | - /* |
|
112 | + /* |
|
113 | 113 | * Blank the users google password if present as we now use oAuth 2.0 |
114 | 114 | */ |
115 | - update_option('geodir_ga_pass',''); |
|
116 | - update_option('geodir_ga_user',''); |
|
115 | + update_option('geodir_ga_pass',''); |
|
116 | + update_option('geodir_ga_user',''); |
|
117 | 117 | |
118 | 118 | } |
119 | 119 | |
@@ -125,8 +125,8 @@ discard block |
||
125 | 125 | * @package GeoDirectory |
126 | 126 | */ |
127 | 127 | function geodir_upgrade_153(){ |
128 | - geodir_create_page(esc_sql(_x('gd-info', 'page_slug', 'geodirectory')), 'geodir_info_page', __('Info', 'geodirectory'), ''); |
|
129 | - geodir_create_page(esc_sql(_x('gd-login', 'page_slug', 'geodirectory')), 'geodir_login_page', __('Login', 'geodirectory'), ''); |
|
128 | + geodir_create_page(esc_sql(_x('gd-info', 'page_slug', 'geodirectory')), 'geodir_info_page', __('Info', 'geodirectory'), ''); |
|
129 | + geodir_create_page(esc_sql(_x('gd-login', 'page_slug', 'geodirectory')), 'geodir_login_page', __('Login', 'geodirectory'), ''); |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | /** |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | * @package GeoDirectory |
137 | 137 | */ |
138 | 138 | function geodir_upgrade_154(){ |
139 | - geodir_create_page(esc_sql(_x('gd-home', 'page_slug', 'geodirectory')), 'geodir_home_page', __('GD Home page', 'geodirectory'), ''); |
|
139 | + geodir_create_page(esc_sql(_x('gd-home', 'page_slug', 'geodirectory')), 'geodir_home_page', __('GD Home page', 'geodirectory'), ''); |
|
140 | 140 | } |
141 | 141 | |
142 | 142 | /** |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | * @package GeoDirectory |
147 | 147 | */ |
148 | 148 | function geodir_upgrade_152(){ |
149 | - gd_fix_address_detail_table_limit(); |
|
149 | + gd_fix_address_detail_table_limit(); |
|
150 | 150 | } |
151 | 151 | |
152 | 152 | |
@@ -162,12 +162,12 @@ discard block |
||
162 | 162 | */ |
163 | 163 | function geodir_update_review_db() |
164 | 164 | { |
165 | - global $wpdb, $plugin_prefix; |
|
165 | + global $wpdb, $plugin_prefix; |
|
166 | 166 | |
167 | - geodir_fix_review_date(); |
|
168 | - geodir_fix_review_post_status(); |
|
169 | - geodir_fix_review_content(); |
|
170 | - geodir_fix_review_location(); |
|
167 | + geodir_fix_review_date(); |
|
168 | + geodir_fix_review_post_status(); |
|
169 | + geodir_fix_review_content(); |
|
170 | + geodir_fix_review_location(); |
|
171 | 171 | |
172 | 172 | } |
173 | 173 | |
@@ -180,8 +180,8 @@ discard block |
||
180 | 180 | */ |
181 | 181 | function geodir_fix_review_date() |
182 | 182 | { |
183 | - global $wpdb; |
|
184 | - $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.post_date = c.comment_date WHERE gdr.post_date='0000-00-00 00:00:00'"); |
|
183 | + global $wpdb; |
|
184 | + $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.post_date = c.comment_date WHERE gdr.post_date='0000-00-00 00:00:00'"); |
|
185 | 185 | } |
186 | 186 | |
187 | 187 | /** |
@@ -193,8 +193,8 @@ discard block |
||
193 | 193 | */ |
194 | 194 | function geodir_fix_review_post_status() |
195 | 195 | { |
196 | - global $wpdb; |
|
197 | - $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->posts p ON gdr.post_id=p.ID SET gdr.post_status = 1 WHERE gdr.post_status IS NULL AND p.post_status='publish'"); |
|
196 | + global $wpdb; |
|
197 | + $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->posts p ON gdr.post_id=p.ID SET gdr.post_status = 1 WHERE gdr.post_status IS NULL AND p.post_status='publish'"); |
|
198 | 198 | } |
199 | 199 | |
200 | 200 | /** |
@@ -207,12 +207,12 @@ discard block |
||
207 | 207 | */ |
208 | 208 | function geodir_fix_review_content() |
209 | 209 | { |
210 | - global $wpdb; |
|
211 | - if ($wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.comment_content = c.comment_content WHERE gdr.comment_content IS NULL")) { |
|
212 | - return true; |
|
213 | - } else { |
|
214 | - return false; |
|
215 | - } |
|
210 | + global $wpdb; |
|
211 | + if ($wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.comment_content = c.comment_content WHERE gdr.comment_content IS NULL")) { |
|
212 | + return true; |
|
213 | + } else { |
|
214 | + return false; |
|
215 | + } |
|
216 | 216 | } |
217 | 217 | |
218 | 218 | /** |
@@ -225,20 +225,20 @@ discard block |
||
225 | 225 | */ |
226 | 226 | function geodir_fix_review_location() |
227 | 227 | { |
228 | - global $wpdb; |
|
228 | + global $wpdb; |
|
229 | 229 | |
230 | - $all_postypes = geodir_get_posttypes(); |
|
230 | + $all_postypes = geodir_get_posttypes(); |
|
231 | 231 | |
232 | - if (!empty($all_postypes)) { |
|
233 | - foreach ($all_postypes as $key) { |
|
234 | - // update each GD CTP |
|
232 | + if (!empty($all_postypes)) { |
|
233 | + foreach ($all_postypes as $key) { |
|
234 | + // update each GD CTP |
|
235 | 235 | |
236 | - $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN " . $wpdb->prefix . "geodir_" . $key . "_detail d ON gdr.post_id=d.post_id SET gdr.post_latitude = d.post_latitude, gdr.post_longitude = d.post_longitude, gdr.post_city = d.post_city, gdr.post_region=d.post_region, gdr.post_country=d.post_country WHERE gdr.post_latitude IS NULL OR gdr.post_city IS NULL"); |
|
236 | + $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN " . $wpdb->prefix . "geodir_" . $key . "_detail d ON gdr.post_id=d.post_id SET gdr.post_latitude = d.post_latitude, gdr.post_longitude = d.post_longitude, gdr.post_city = d.post_city, gdr.post_region=d.post_region, gdr.post_country=d.post_country WHERE gdr.post_latitude IS NULL OR gdr.post_city IS NULL"); |
|
237 | 237 | |
238 | - } |
|
239 | - return true; |
|
240 | - } |
|
241 | - return false; |
|
238 | + } |
|
239 | + return true; |
|
240 | + } |
|
241 | + return false; |
|
242 | 242 | } |
243 | 243 | |
244 | 244 | /** |
@@ -250,82 +250,82 @@ discard block |
||
250 | 250 | */ |
251 | 251 | function geodir_fix_review_overall_rating() |
252 | 252 | { |
253 | - global $wpdb; |
|
253 | + global $wpdb; |
|
254 | 254 | |
255 | - $all_postypes = geodir_get_posttypes(); |
|
255 | + $all_postypes = geodir_get_posttypes(); |
|
256 | 256 | |
257 | - if (!empty($all_postypes)) { |
|
258 | - foreach ($all_postypes as $key) { |
|
259 | - // update each GD CTP |
|
260 | - $reviews = $wpdb->get_results("SELECT post_id FROM " . $wpdb->prefix . "geodir_" . $key . "_detail d"); |
|
257 | + if (!empty($all_postypes)) { |
|
258 | + foreach ($all_postypes as $key) { |
|
259 | + // update each GD CTP |
|
260 | + $reviews = $wpdb->get_results("SELECT post_id FROM " . $wpdb->prefix . "geodir_" . $key . "_detail d"); |
|
261 | 261 | |
262 | - if (!empty($reviews)) { |
|
263 | - foreach ($reviews as $post_id) { |
|
264 | - geodir_update_postrating($post_id->post_id, $key); |
|
265 | - } |
|
262 | + if (!empty($reviews)) { |
|
263 | + foreach ($reviews as $post_id) { |
|
264 | + geodir_update_postrating($post_id->post_id, $key); |
|
265 | + } |
|
266 | 266 | |
267 | - } |
|
267 | + } |
|
268 | 268 | |
269 | - } |
|
269 | + } |
|
270 | 270 | |
271 | - } |
|
271 | + } |
|
272 | 272 | } |
273 | 273 | |
274 | 274 | |
275 | 275 | function gd_convert_custom_field_display(){ |
276 | - global $wpdb; |
|
276 | + global $wpdb; |
|
277 | 277 | |
278 | - $field_info = $wpdb->get_results("select * from " . GEODIR_CUSTOM_FIELDS_TABLE); |
|
278 | + $field_info = $wpdb->get_results("select * from " . GEODIR_CUSTOM_FIELDS_TABLE); |
|
279 | 279 | |
280 | - $has_run = get_option('gd_convert_custom_field_display'); |
|
281 | - if($has_run){return;} |
|
280 | + $has_run = get_option('gd_convert_custom_field_display'); |
|
281 | + if($has_run){return;} |
|
282 | 282 | |
283 | - // set the field_type_key for standard fields |
|
284 | - $wpdb->query("UPDATE ".GEODIR_CUSTOM_FIELDS_TABLE." SET field_type_key = field_type"); |
|
283 | + // set the field_type_key for standard fields |
|
284 | + $wpdb->query("UPDATE ".GEODIR_CUSTOM_FIELDS_TABLE." SET field_type_key = field_type"); |
|
285 | 285 | |
286 | 286 | |
287 | - if(is_array( $field_info)){ |
|
287 | + if(is_array( $field_info)){ |
|
288 | 288 | |
289 | - foreach( $field_info as $cf){ |
|
289 | + foreach( $field_info as $cf){ |
|
290 | 290 | |
291 | - $id = $cf->id; |
|
291 | + $id = $cf->id; |
|
292 | 292 | |
293 | - if(!property_exists($cf,'show_in') || !$id){return;} |
|
293 | + if(!property_exists($cf,'show_in') || !$id){return;} |
|
294 | 294 | |
295 | - $show_in_arr = array(); |
|
295 | + $show_in_arr = array(); |
|
296 | 296 | |
297 | - if($cf->is_default){ |
|
298 | - $show_in_arr[] = "[detail]"; |
|
299 | - } |
|
297 | + if($cf->is_default){ |
|
298 | + $show_in_arr[] = "[detail]"; |
|
299 | + } |
|
300 | 300 | |
301 | - if($cf->show_on_detail){ |
|
302 | - $show_in_arr[] = "[moreinfo]"; |
|
303 | - } |
|
301 | + if($cf->show_on_detail){ |
|
302 | + $show_in_arr[] = "[moreinfo]"; |
|
303 | + } |
|
304 | 304 | |
305 | - if($cf->show_on_listing){ |
|
306 | - $show_in_arr[] = "[listing]"; |
|
307 | - } |
|
305 | + if($cf->show_on_listing){ |
|
306 | + $show_in_arr[] = "[listing]"; |
|
307 | + } |
|
308 | 308 | |
309 | - if($cf->show_as_tab || $cf->htmlvar_name=='geodir_video' || $cf->htmlvar_name=='geodir_special_offers'){ |
|
310 | - $show_in_arr[] = "[owntab]"; |
|
311 | - } |
|
309 | + if($cf->show_as_tab || $cf->htmlvar_name=='geodir_video' || $cf->htmlvar_name=='geodir_special_offers'){ |
|
310 | + $show_in_arr[] = "[owntab]"; |
|
311 | + } |
|
312 | 312 | |
313 | - if($cf->htmlvar_name=='post' || $cf->htmlvar_name=='geodir_contact' || $cf->htmlvar_name=='geodir_timing'){ |
|
314 | - $show_in_arr[] = "[mapbubble]"; |
|
315 | - } |
|
313 | + if($cf->htmlvar_name=='post' || $cf->htmlvar_name=='geodir_contact' || $cf->htmlvar_name=='geodir_timing'){ |
|
314 | + $show_in_arr[] = "[mapbubble]"; |
|
315 | + } |
|
316 | 316 | |
317 | - if(!empty($show_in_arr )){ |
|
318 | - $show_in_arr = implode(',',$show_in_arr); |
|
319 | - }else{ |
|
320 | - $show_in_arr = ''; |
|
321 | - } |
|
317 | + if(!empty($show_in_arr )){ |
|
318 | + $show_in_arr = implode(',',$show_in_arr); |
|
319 | + }else{ |
|
320 | + $show_in_arr = ''; |
|
321 | + } |
|
322 | 322 | |
323 | - $wpdb->query("UPDATE ".GEODIR_CUSTOM_FIELDS_TABLE." SET show_in='$show_in_arr' WHERE id=$id"); |
|
323 | + $wpdb->query("UPDATE ".GEODIR_CUSTOM_FIELDS_TABLE." SET show_in='$show_in_arr' WHERE id=$id"); |
|
324 | 324 | |
325 | - } |
|
325 | + } |
|
326 | 326 | |
327 | - update_option('gd_convert_custom_field_display',1); |
|
328 | - } |
|
327 | + update_option('gd_convert_custom_field_display',1); |
|
328 | + } |
|
329 | 329 | } |
330 | 330 | |
331 | 331 | ############################################ |
@@ -341,367 +341,367 @@ discard block |
||
341 | 341 | */ |
342 | 342 | function gd_install_theme_compat() |
343 | 343 | { |
344 | - global $wpdb; |
|
344 | + global $wpdb; |
|
345 | 345 | |
346 | - $theme_compat = array(); |
|
347 | - $theme_compat = get_option('gd_theme_compats'); |
|
346 | + $theme_compat = array(); |
|
347 | + $theme_compat = get_option('gd_theme_compats'); |
|
348 | 348 | //GDF |
349 | - $theme_compat['GeoDirectory_Framework'] = array( |
|
350 | - 'geodir_wrapper_open_id' => 'geodir_wrapper', |
|
351 | - 'geodir_wrapper_open_class' => '', |
|
352 | - 'geodir_wrapper_open_replace' => '', |
|
353 | - 'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->', |
|
354 | - 'geodir_wrapper_content_open_id' => 'geodir_content', |
|
355 | - 'geodir_wrapper_content_open_class' => '', |
|
356 | - 'geodir_wrapper_content_open_replace' => '', |
|
357 | - 'geodir_wrapper_content_close_replace' => '', |
|
358 | - 'geodir_article_open_id' => '', |
|
359 | - 'geodir_article_open_class' => '', |
|
360 | - 'geodir_article_open_replace' => '', |
|
361 | - 'geodir_article_close_replace' => '', |
|
362 | - 'geodir_sidebar_right_open_id' => '', |
|
363 | - 'geodir_sidebar_right_open_class' => '', |
|
364 | - 'geodir_sidebar_right_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
365 | - 'geodir_sidebar_right_close_replace' => '', |
|
366 | - 'geodir_sidebar_left_open_id' => '', |
|
367 | - 'geodir_sidebar_left_open_class' => '', |
|
368 | - 'geodir_sidebar_left_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
369 | - 'geodir_sidebar_left_close_replace' => '', |
|
370 | - 'geodir_main_content_open_id' => '', |
|
371 | - 'geodir_main_content_open_class' => '', |
|
372 | - 'geodir_main_content_open_replace' => '<!-- removed -->', |
|
373 | - 'geodir_main_content_close_replace' => '<!-- removed -->', |
|
374 | - 'geodir_top_content_add' => '', |
|
375 | - 'geodir_before_main_content_add' => '<div class="clearfix geodir-common">', |
|
376 | - 'geodir_before_widget_filter' => '', |
|
377 | - 'geodir_after_widget_filter' => '', |
|
378 | - 'geodir_theme_compat_css' => '', |
|
379 | - 'geodir_theme_compat_js' => '', |
|
380 | - 'geodir_theme_compat_default_options' => '', |
|
381 | - 'geodir_theme_compat_code' => '' |
|
382 | - ); |
|
349 | + $theme_compat['GeoDirectory_Framework'] = array( |
|
350 | + 'geodir_wrapper_open_id' => 'geodir_wrapper', |
|
351 | + 'geodir_wrapper_open_class' => '', |
|
352 | + 'geodir_wrapper_open_replace' => '', |
|
353 | + 'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->', |
|
354 | + 'geodir_wrapper_content_open_id' => 'geodir_content', |
|
355 | + 'geodir_wrapper_content_open_class' => '', |
|
356 | + 'geodir_wrapper_content_open_replace' => '', |
|
357 | + 'geodir_wrapper_content_close_replace' => '', |
|
358 | + 'geodir_article_open_id' => '', |
|
359 | + 'geodir_article_open_class' => '', |
|
360 | + 'geodir_article_open_replace' => '', |
|
361 | + 'geodir_article_close_replace' => '', |
|
362 | + 'geodir_sidebar_right_open_id' => '', |
|
363 | + 'geodir_sidebar_right_open_class' => '', |
|
364 | + 'geodir_sidebar_right_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
365 | + 'geodir_sidebar_right_close_replace' => '', |
|
366 | + 'geodir_sidebar_left_open_id' => '', |
|
367 | + 'geodir_sidebar_left_open_class' => '', |
|
368 | + 'geodir_sidebar_left_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
369 | + 'geodir_sidebar_left_close_replace' => '', |
|
370 | + 'geodir_main_content_open_id' => '', |
|
371 | + 'geodir_main_content_open_class' => '', |
|
372 | + 'geodir_main_content_open_replace' => '<!-- removed -->', |
|
373 | + 'geodir_main_content_close_replace' => '<!-- removed -->', |
|
374 | + 'geodir_top_content_add' => '', |
|
375 | + 'geodir_before_main_content_add' => '<div class="clearfix geodir-common">', |
|
376 | + 'geodir_before_widget_filter' => '', |
|
377 | + 'geodir_after_widget_filter' => '', |
|
378 | + 'geodir_theme_compat_css' => '', |
|
379 | + 'geodir_theme_compat_js' => '', |
|
380 | + 'geodir_theme_compat_default_options' => '', |
|
381 | + 'geodir_theme_compat_code' => '' |
|
382 | + ); |
|
383 | 383 | |
384 | 384 | //Directory Theme |
385 | - $theme_compat['Directory_Starter'] = array( |
|
386 | - 'geodir_wrapper_open_id' => 'geodir_wrapper', |
|
387 | - 'geodir_wrapper_open_class' => '', |
|
388 | - 'geodir_wrapper_open_replace' => '', |
|
389 | - 'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->', |
|
390 | - 'geodir_wrapper_content_open_id' => 'geodir_content', |
|
391 | - 'geodir_wrapper_content_open_class' => '', |
|
392 | - 'geodir_wrapper_content_open_replace' => '', |
|
393 | - 'geodir_wrapper_content_close_replace' => '', |
|
394 | - 'geodir_article_open_id' => '', |
|
395 | - 'geodir_article_open_class' => '', |
|
396 | - 'geodir_article_open_replace' => '', |
|
397 | - 'geodir_article_close_replace' => '', |
|
398 | - 'geodir_sidebar_right_open_id' => '', |
|
399 | - 'geodir_sidebar_right_open_class' => '', |
|
400 | - 'geodir_sidebar_right_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
401 | - 'geodir_sidebar_right_close_replace' => '', |
|
402 | - 'geodir_sidebar_left_open_id' => '', |
|
403 | - 'geodir_sidebar_left_open_class' => '', |
|
404 | - 'geodir_sidebar_left_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
405 | - 'geodir_sidebar_left_close_replace' => '', |
|
406 | - 'geodir_main_content_open_id' => '', |
|
407 | - 'geodir_main_content_open_class' => '', |
|
408 | - 'geodir_main_content_open_replace' => '<!-- removed -->', |
|
409 | - 'geodir_main_content_close_replace' => '<!-- removed -->', |
|
410 | - 'geodir_top_content_add' => '', |
|
411 | - 'geodir_before_main_content_add' => '<div class="clearfix geodir-common">', |
|
412 | - 'geodir_before_widget_filter' => '', |
|
413 | - 'geodir_after_widget_filter' => '', |
|
414 | - 'geodir_theme_compat_css' => '', |
|
415 | - 'geodir_theme_compat_js' => '', |
|
416 | - 'geodir_theme_compat_default_options' => '', |
|
417 | - 'geodir_theme_compat_code' => '' |
|
418 | - ); |
|
385 | + $theme_compat['Directory_Starter'] = array( |
|
386 | + 'geodir_wrapper_open_id' => 'geodir_wrapper', |
|
387 | + 'geodir_wrapper_open_class' => '', |
|
388 | + 'geodir_wrapper_open_replace' => '', |
|
389 | + 'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->', |
|
390 | + 'geodir_wrapper_content_open_id' => 'geodir_content', |
|
391 | + 'geodir_wrapper_content_open_class' => '', |
|
392 | + 'geodir_wrapper_content_open_replace' => '', |
|
393 | + 'geodir_wrapper_content_close_replace' => '', |
|
394 | + 'geodir_article_open_id' => '', |
|
395 | + 'geodir_article_open_class' => '', |
|
396 | + 'geodir_article_open_replace' => '', |
|
397 | + 'geodir_article_close_replace' => '', |
|
398 | + 'geodir_sidebar_right_open_id' => '', |
|
399 | + 'geodir_sidebar_right_open_class' => '', |
|
400 | + 'geodir_sidebar_right_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
401 | + 'geodir_sidebar_right_close_replace' => '', |
|
402 | + 'geodir_sidebar_left_open_id' => '', |
|
403 | + 'geodir_sidebar_left_open_class' => '', |
|
404 | + 'geodir_sidebar_left_open_replace' => '<aside id="gd-sidebar-wrapper" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
405 | + 'geodir_sidebar_left_close_replace' => '', |
|
406 | + 'geodir_main_content_open_id' => '', |
|
407 | + 'geodir_main_content_open_class' => '', |
|
408 | + 'geodir_main_content_open_replace' => '<!-- removed -->', |
|
409 | + 'geodir_main_content_close_replace' => '<!-- removed -->', |
|
410 | + 'geodir_top_content_add' => '', |
|
411 | + 'geodir_before_main_content_add' => '<div class="clearfix geodir-common">', |
|
412 | + 'geodir_before_widget_filter' => '', |
|
413 | + 'geodir_after_widget_filter' => '', |
|
414 | + 'geodir_theme_compat_css' => '', |
|
415 | + 'geodir_theme_compat_js' => '', |
|
416 | + 'geodir_theme_compat_default_options' => '', |
|
417 | + 'geodir_theme_compat_code' => '' |
|
418 | + ); |
|
419 | 419 | |
420 | 420 | //Jobby |
421 | - $theme_compat['Jobby'] = $theme_compat['Directory_Starter']; |
|
421 | + $theme_compat['Jobby'] = $theme_compat['Directory_Starter']; |
|
422 | 422 | |
423 | 423 | //GeoProperty |
424 | - $theme_compat['GeoProperty'] = $theme_compat['Directory_Starter']; |
|
424 | + $theme_compat['GeoProperty'] = $theme_compat['Directory_Starter']; |
|
425 | 425 | |
426 | 426 | //Avada |
427 | - $theme_compat['Avada'] = array( |
|
428 | - 'geodir_wrapper_open_id' => '', |
|
429 | - 'geodir_wrapper_open_class' => '', |
|
430 | - 'geodir_wrapper_open_replace' => '<!-- removed -->', |
|
431 | - 'geodir_wrapper_close_replace' => '<!-- removed -->', |
|
432 | - 'geodir_wrapper_content_open_id' => 'content', |
|
433 | - 'geodir_wrapper_content_open_class' => '', |
|
434 | - 'geodir_wrapper_content_open_replace' => '', |
|
435 | - 'geodir_wrapper_content_close_replace' => '', |
|
436 | - 'geodir_article_open_id' => '', |
|
437 | - 'geodir_article_open_class' => '', |
|
438 | - 'geodir_article_open_replace' => '', |
|
439 | - 'geodir_article_close_replace' => '', |
|
440 | - 'geodir_sidebar_right_open_id' => '', |
|
441 | - 'geodir_sidebar_right_open_class' => '', |
|
442 | - 'geodir_sidebar_right_open_replace' => '<div id="sidebar" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
443 | - 'geodir_sidebar_right_close_replace' => '</div><!-- end sidebar -->', |
|
444 | - 'geodir_sidebar_left_open_id' => '', |
|
445 | - 'geodir_sidebar_left_open_class' => '', |
|
446 | - 'geodir_sidebar_left_open_replace' => '<div id="sidebar" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
447 | - 'geodir_sidebar_left_close_replace' => '</div><!-- end sidebar -->', |
|
448 | - 'geodir_main_content_open_id' => '', |
|
449 | - 'geodir_main_content_open_class' => '', |
|
450 | - 'geodir_main_content_open_replace' => '<!-- removed -->', |
|
451 | - 'geodir_main_content_close_replace' => '<!-- removed -->', |
|
452 | - 'geodir_top_content_add' => '', |
|
453 | - 'geodir_before_main_content_add' => '', |
|
454 | - 'geodir_before_widget_filter' => '', |
|
455 | - 'geodir_after_widget_filter' => '', |
|
456 | - 'geodir_theme_compat_css' => stripslashes('.geodir-sidebar-left{float:left}select,textarea{border-style:solid;border-width:1px}.top-menu li > div{visibility:visible}.geodir-chosen-container-single .chosen-single{height:auto}ul li#menu-item-gd-location-switcher ul{width:222px}ul li#menu-item-gd-location-switcher ul li{padding-right:0!important}#mobile-nav li#mobile-menu-item-gd-location-switcher li a{padding-left:10px;padding-right:10px}#menu-item-gd-location-switcher dd,#mobile-menu-item-gd-location-switcher{margin-left:0}#menu-item-gd-location-switcher dd a{display:block}.geodir-chosen-container .chosen-results li.highlighted{background-color:#eee;background-image:none;color:#444}#mobile-nav li.mobile-nav-item li a:before{content:\'\';margin:0}#mobile-nav li.mobile-nav-item li a{padding:10px;width:auto}.geodir-listing-search{text-align:center}.geodir-search{float:none;margin:0}.geodir-search select,.geodir-search .search_by_post,.geodir-search input[type="text"],.geodir-search button[type="button"], .geodir-search input[type="button"],.geodir-search input[type="submit"]{display:inline-block;float:none}.geodir-cat-list ul li,.map_category ul li{list-style-type:none}.wpgeo-avada .page-title ul li:after{content:\'\'}.top_banner_section{margin-bottom:0}.geodir-category-list-in{margin:0;padding:15px}.geodir_full_page .geodir-cat-list .widget-title{margin-top:0}.geodir_full_page .geodir-cat-list ul li{padding-left:0}.geodir-loc-bar{border:none;margin:0;padding:0}.geodir-loc-bar-in{padding:15px 0}.geodir_full_page section.widget{margin-bottom:20px}.sidebar .geodir-loginbox-list li{margin-bottom:10px;padding-bottom:10px}.sidebar .geodir-loginbox-list li a{display:block}.sidebar .geodir-chosen-container .chosen-results li{margin:0;padding:5px 6px}.sidebar .geodir-chosen-container .chosen-results li.highlighted{background:#eee;background-image:none;color:#000}.sidebar .geodir_category_list_view li.geodir-gridview{display:inline-block;margin-bottom:15px}.wpgeo-avada.double-sidebars #main #sidebar{margin-left:3%}.wpgeo-avada.double-sidebars #main #sidebar-2{margin-left:-100%}.wpgeo-avada.double-sidebars #content{float:left;margin-left:0}.geodir_full_page section.widget{margin-bottom: 0px;} .sidebar .widget .geodir-hide {display: none;}li.fusion-mobile-nav-item .geodir_location_tab_container a:before{content: "" !important; margin-right: auto !important;}li.fusion-mobile-nav-item .geodir_location_tab_container a{padding-left:5px !important;}'), |
|
457 | - 'geodir_theme_compat_js' => '', |
|
458 | - 'geodir_theme_compat_default_options' => '', |
|
459 | - 'geodir_theme_compat_code' => 'Avada' |
|
460 | - ); |
|
427 | + $theme_compat['Avada'] = array( |
|
428 | + 'geodir_wrapper_open_id' => '', |
|
429 | + 'geodir_wrapper_open_class' => '', |
|
430 | + 'geodir_wrapper_open_replace' => '<!-- removed -->', |
|
431 | + 'geodir_wrapper_close_replace' => '<!-- removed -->', |
|
432 | + 'geodir_wrapper_content_open_id' => 'content', |
|
433 | + 'geodir_wrapper_content_open_class' => '', |
|
434 | + 'geodir_wrapper_content_open_replace' => '', |
|
435 | + 'geodir_wrapper_content_close_replace' => '', |
|
436 | + 'geodir_article_open_id' => '', |
|
437 | + 'geodir_article_open_class' => '', |
|
438 | + 'geodir_article_open_replace' => '', |
|
439 | + 'geodir_article_close_replace' => '', |
|
440 | + 'geodir_sidebar_right_open_id' => '', |
|
441 | + 'geodir_sidebar_right_open_class' => '', |
|
442 | + 'geodir_sidebar_right_open_replace' => '<div id="sidebar" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
443 | + 'geodir_sidebar_right_close_replace' => '</div><!-- end sidebar -->', |
|
444 | + 'geodir_sidebar_left_open_id' => '', |
|
445 | + 'geodir_sidebar_left_open_class' => '', |
|
446 | + 'geodir_sidebar_left_open_replace' => '<div id="sidebar" class="sidebar [class]" role="complementary" itemscope itemtype="[itemtype]" [width_css]>', |
|
447 | + 'geodir_sidebar_left_close_replace' => '</div><!-- end sidebar -->', |
|
448 | + 'geodir_main_content_open_id' => '', |
|
449 | + 'geodir_main_content_open_class' => '', |
|
450 | + 'geodir_main_content_open_replace' => '<!-- removed -->', |
|
451 | + 'geodir_main_content_close_replace' => '<!-- removed -->', |
|
452 | + 'geodir_top_content_add' => '', |
|
453 | + 'geodir_before_main_content_add' => '', |
|
454 | + 'geodir_before_widget_filter' => '', |
|
455 | + 'geodir_after_widget_filter' => '', |
|
456 | + 'geodir_theme_compat_css' => stripslashes('.geodir-sidebar-left{float:left}select,textarea{border-style:solid;border-width:1px}.top-menu li > div{visibility:visible}.geodir-chosen-container-single .chosen-single{height:auto}ul li#menu-item-gd-location-switcher ul{width:222px}ul li#menu-item-gd-location-switcher ul li{padding-right:0!important}#mobile-nav li#mobile-menu-item-gd-location-switcher li a{padding-left:10px;padding-right:10px}#menu-item-gd-location-switcher dd,#mobile-menu-item-gd-location-switcher{margin-left:0}#menu-item-gd-location-switcher dd a{display:block}.geodir-chosen-container .chosen-results li.highlighted{background-color:#eee;background-image:none;color:#444}#mobile-nav li.mobile-nav-item li a:before{content:\'\';margin:0}#mobile-nav li.mobile-nav-item li a{padding:10px;width:auto}.geodir-listing-search{text-align:center}.geodir-search{float:none;margin:0}.geodir-search select,.geodir-search .search_by_post,.geodir-search input[type="text"],.geodir-search button[type="button"], .geodir-search input[type="button"],.geodir-search input[type="submit"]{display:inline-block;float:none}.geodir-cat-list ul li,.map_category ul li{list-style-type:none}.wpgeo-avada .page-title ul li:after{content:\'\'}.top_banner_section{margin-bottom:0}.geodir-category-list-in{margin:0;padding:15px}.geodir_full_page .geodir-cat-list .widget-title{margin-top:0}.geodir_full_page .geodir-cat-list ul li{padding-left:0}.geodir-loc-bar{border:none;margin:0;padding:0}.geodir-loc-bar-in{padding:15px 0}.geodir_full_page section.widget{margin-bottom:20px}.sidebar .geodir-loginbox-list li{margin-bottom:10px;padding-bottom:10px}.sidebar .geodir-loginbox-list li a{display:block}.sidebar .geodir-chosen-container .chosen-results li{margin:0;padding:5px 6px}.sidebar .geodir-chosen-container .chosen-results li.highlighted{background:#eee;background-image:none;color:#000}.sidebar .geodir_category_list_view li.geodir-gridview{display:inline-block;margin-bottom:15px}.wpgeo-avada.double-sidebars #main #sidebar{margin-left:3%}.wpgeo-avada.double-sidebars #main #sidebar-2{margin-left:-100%}.wpgeo-avada.double-sidebars #content{float:left;margin-left:0}.geodir_full_page section.widget{margin-bottom: 0px;} .sidebar .widget .geodir-hide {display: none;}li.fusion-mobile-nav-item .geodir_location_tab_container a:before{content: "" !important; margin-right: auto !important;}li.fusion-mobile-nav-item .geodir_location_tab_container a{padding-left:5px !important;}'), |
|
457 | + 'geodir_theme_compat_js' => '', |
|
458 | + 'geodir_theme_compat_default_options' => '', |
|
459 | + 'geodir_theme_compat_code' => 'Avada' |
|
460 | + ); |
|
461 | 461 | |
462 | 462 | //Enfold |
463 | - $theme_compat['Enfold'] = array( |
|
464 | - 'geodir_wrapper_open_id' => '', |
|
465 | - 'geodir_wrapper_open_class' => '', |
|
466 | - 'geodir_wrapper_open_replace' => '', |
|
467 | - 'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->', |
|
468 | - 'geodir_wrapper_content_open_id' => '', |
|
469 | - 'geodir_wrapper_content_open_class' => '', |
|
470 | - 'geodir_wrapper_content_open_replace' => '', |
|
471 | - 'geodir_wrapper_content_close_replace' => '</div></main>', |
|
472 | - 'geodir_article_open_id' => '', |
|
473 | - 'geodir_article_open_class' => '', |
|
474 | - 'geodir_article_open_replace' => '', |
|
475 | - 'geodir_article_close_replace' => '', |
|
476 | - 'geodir_sidebar_right_open_id' => '', |
|
477 | - 'geodir_sidebar_right_open_class' => '', |
|
478 | - 'geodir_sidebar_right_open_replace' => '', |
|
479 | - 'geodir_sidebar_right_close_replace' => '</div></aside><!-- sidebar ends here-->', |
|
480 | - 'geodir_sidebar_left_open_id' => '', |
|
481 | - 'geodir_sidebar_left_open_class' => '', |
|
482 | - 'geodir_sidebar_left_open_replace' => '', |
|
483 | - 'geodir_sidebar_left_close_replace' => '</div></aside><!-- sidebar ends here-->', |
|
484 | - 'geodir_main_content_open_id' => '', |
|
485 | - 'geodir_main_content_open_class' => '', |
|
486 | - 'geodir_main_content_open_replace' => '', |
|
487 | - 'geodir_main_content_close_replace' => '', |
|
488 | - 'geodir_top_content_add' => '', |
|
489 | - 'geodir_before_main_content_add' => '', |
|
490 | - 'geodir_before_widget_filter' => '', |
|
491 | - 'geodir_after_widget_filter' => '', |
|
492 | - 'geodir_theme_compat_css' => stripslashes('.geodir_full_page .top_banner_section{margin-bottom:0}.widget .geodir-cat-list ul li{clear:none}.wpgeo-enfold .av-main-nav ul{width:222px}.geodir-listing-search .geodir-loc-bar{border-top:none;padding:0}#main .geodir-listing-search,.geodir-listing-search .geodir-loc-bar{margin-bottom:0}#main .geodir-loc-bar-in,#main .geodir-category-list-in{background-color:#fcfcfc;margin:20px 0;padding:20px}#main .geodir_full_page .geodir-loc-bar-in,#main .geodir_full_page .geodir-loc-bar,#main .geodir_full_page .geodir-category-list-in{margin-top:0;margin-bottom:0}#main .geodir-loc-bar-in{padding:20px}#main .geodir-search{margin:0;width:100%}#main .geodir-search select{margin:0 3% 0 0;padding:8px 10px;width:13%}#main .geodir-search input[type="text"]{margin:0 3% 0 0;padding:10px;width:32.4%}#main .geodir-search input[type="button"],#main .geodir-search input[type="submit"]{font-size:inherit;line-height:2.25;margin:0;padding:7px;width:13%}.enfold-home-top section.widget{margin:0;padding:0}.enfold-home-top .top_banner_section{margin-bottom:0}.enfold-home-top .geodir-loc-bar{background:#fcfcfc;border:none;margin:0;padding:0}#main .enfold-home-top .geodir-loc-bar-in{background:none;border:none;margin:0 auto;padding:20px 0}#main .geodir-breadcrumb{border-bottom-style:solid;border-bottom-width:1px}#gd-tabs dt{clear:none}#geodir_slider ul li{list-style-type:none;margin:0;padding:0}#respond{clear:both}#comments .comments-title span{display:inline;font-size:inherit;font-weight:700}#reviewsTab .comments-area .bypostauthor cite span{display:inline}#top #comments .commentlist .comment,#top #comments .commentlist .comment > div{min-height:0}.commentlist .commenttext{padding-top:15px}#comment_imagesdropbox{margin-bottom:20px}.wpgeo-enfold .geodir_category_list_view li{margin-left:0;padding:0}.widget ul.geodir-loginbox-list{overflow:visible}.geodir_category_list_view li .geodir-post-img{display:block}.wpgeo-enfold .geodir_event_listing_calendar tr.title{background:#ccc}@media only screen and (max-width:480px){.geodir_category_list_view li .geodir-content,.geodir_category_list_view li .geodir-post-img,.geodir_category_list_view li .geodir-addinfo{float:none;width:100%;margin:10px 0}#main .geodir-search input[type="text"],#main .geodir-search input[type="button"],#main .geodir-search input[type="submit"],#main .geodir-search select{margin:10px 0;width:100%}}#main .geodir_full_page section:last-child .geodir-loc-bar{margin-bottom: -1px;border-bottom: none;}'), |
|
493 | - 'geodir_theme_compat_js' => '', |
|
494 | - 'geodir_theme_compat_default_options' => '', |
|
495 | - 'geodir_theme_compat_code' => 'Enfold' |
|
496 | - ); |
|
463 | + $theme_compat['Enfold'] = array( |
|
464 | + 'geodir_wrapper_open_id' => '', |
|
465 | + 'geodir_wrapper_open_class' => '', |
|
466 | + 'geodir_wrapper_open_replace' => '', |
|
467 | + 'geodir_wrapper_close_replace' => '</div></div><!-- content ends here-->', |
|
468 | + 'geodir_wrapper_content_open_id' => '', |
|
469 | + 'geodir_wrapper_content_open_class' => '', |
|
470 | + 'geodir_wrapper_content_open_replace' => '', |
|
471 | + 'geodir_wrapper_content_close_replace' => '</div></main>', |
|
472 | + 'geodir_article_open_id' => '', |
|
473 | + 'geodir_article_open_class' => '', |
|
474 | + 'geodir_article_open_replace' => '', |
|
475 | + 'geodir_article_close_replace' => '', |
|
476 | + 'geodir_sidebar_right_open_id' => '', |
|
477 | + 'geodir_sidebar_right_open_class' => '', |
|
478 | + 'geodir_sidebar_right_open_replace' => '', |
|
479 | + 'geodir_sidebar_right_close_replace' => '</div></aside><!-- sidebar ends here-->', |
|
480 | + 'geodir_sidebar_left_open_id' => '', |
|
481 | + 'geodir_sidebar_left_open_class' => '', |
|
482 | + 'geodir_sidebar_left_open_replace' => '', |
|
483 | + 'geodir_sidebar_left_close_replace' => '</div></aside><!-- sidebar ends here-->', |
|
484 | + 'geodir_main_content_open_id' => '', |
|
485 | + 'geodir_main_content_open_class' => '', |
|
486 | + 'geodir_main_content_open_replace' => '', |
|
487 | + 'geodir_main_content_close_replace' => '', |
|
488 | + 'geodir_top_content_add' => '', |
|
489 | + 'geodir_before_main_content_add' => '', |
|
490 | + 'geodir_before_widget_filter' => '', |
|
491 | + 'geodir_after_widget_filter' => '', |
|
492 | + 'geodir_theme_compat_css' => stripslashes('.geodir_full_page .top_banner_section{margin-bottom:0}.widget .geodir-cat-list ul li{clear:none}.wpgeo-enfold .av-main-nav ul{width:222px}.geodir-listing-search .geodir-loc-bar{border-top:none;padding:0}#main .geodir-listing-search,.geodir-listing-search .geodir-loc-bar{margin-bottom:0}#main .geodir-loc-bar-in,#main .geodir-category-list-in{background-color:#fcfcfc;margin:20px 0;padding:20px}#main .geodir_full_page .geodir-loc-bar-in,#main .geodir_full_page .geodir-loc-bar,#main .geodir_full_page .geodir-category-list-in{margin-top:0;margin-bottom:0}#main .geodir-loc-bar-in{padding:20px}#main .geodir-search{margin:0;width:100%}#main .geodir-search select{margin:0 3% 0 0;padding:8px 10px;width:13%}#main .geodir-search input[type="text"]{margin:0 3% 0 0;padding:10px;width:32.4%}#main .geodir-search input[type="button"],#main .geodir-search input[type="submit"]{font-size:inherit;line-height:2.25;margin:0;padding:7px;width:13%}.enfold-home-top section.widget{margin:0;padding:0}.enfold-home-top .top_banner_section{margin-bottom:0}.enfold-home-top .geodir-loc-bar{background:#fcfcfc;border:none;margin:0;padding:0}#main .enfold-home-top .geodir-loc-bar-in{background:none;border:none;margin:0 auto;padding:20px 0}#main .geodir-breadcrumb{border-bottom-style:solid;border-bottom-width:1px}#gd-tabs dt{clear:none}#geodir_slider ul li{list-style-type:none;margin:0;padding:0}#respond{clear:both}#comments .comments-title span{display:inline;font-size:inherit;font-weight:700}#reviewsTab .comments-area .bypostauthor cite span{display:inline}#top #comments .commentlist .comment,#top #comments .commentlist .comment > div{min-height:0}.commentlist .commenttext{padding-top:15px}#comment_imagesdropbox{margin-bottom:20px}.wpgeo-enfold .geodir_category_list_view li{margin-left:0;padding:0}.widget ul.geodir-loginbox-list{overflow:visible}.geodir_category_list_view li .geodir-post-img{display:block}.wpgeo-enfold .geodir_event_listing_calendar tr.title{background:#ccc}@media only screen and (max-width:480px){.geodir_category_list_view li .geodir-content,.geodir_category_list_view li .geodir-post-img,.geodir_category_list_view li .geodir-addinfo{float:none;width:100%;margin:10px 0}#main .geodir-search input[type="text"],#main .geodir-search input[type="button"],#main .geodir-search input[type="submit"],#main .geodir-search select{margin:10px 0;width:100%}}#main .geodir_full_page section:last-child .geodir-loc-bar{margin-bottom: -1px;border-bottom: none;}'), |
|
493 | + 'geodir_theme_compat_js' => '', |
|
494 | + 'geodir_theme_compat_default_options' => '', |
|
495 | + 'geodir_theme_compat_code' => 'Enfold' |
|
496 | + ); |
|
497 | 497 | |
498 | 498 | // X |
499 | - $theme_compat['X'] = array( |
|
500 | - 'geodir_wrapper_open_id' => '', |
|
501 | - 'geodir_wrapper_open_class' => '', |
|
502 | - 'geodir_wrapper_open_replace' => '', |
|
503 | - 'geodir_wrapper_close_replace' => '', |
|
504 | - 'geodir_wrapper_content_open_id' => '', |
|
505 | - 'geodir_wrapper_content_open_class' => '', |
|
506 | - 'geodir_wrapper_content_open_replace' => '', |
|
507 | - 'geodir_wrapper_content_close_replace' => '', |
|
508 | - 'geodir_article_open_id' => '', |
|
509 | - 'geodir_article_open_class' => '', |
|
510 | - 'geodir_article_open_replace' => '', |
|
511 | - 'geodir_article_close_replace' => '', |
|
512 | - 'geodir_sidebar_right_open_id' => '', |
|
513 | - 'geodir_sidebar_right_open_class' => '', |
|
514 | - 'geodir_sidebar_right_open_replace' => '', |
|
515 | - 'geodir_sidebar_right_close_replace' => '', |
|
516 | - 'geodir_sidebar_left_open_id' => '', |
|
517 | - 'geodir_sidebar_left_open_class' => '', |
|
518 | - 'geodir_sidebar_left_open_replace' => '', |
|
519 | - 'geodir_sidebar_left_close_replace' => '', |
|
520 | - 'geodir_main_content_open_id' => '', |
|
521 | - 'geodir_main_content_open_class' => '', |
|
522 | - 'geodir_main_content_open_replace' => '', |
|
523 | - 'geodir_main_content_close_replace' => '', |
|
524 | - 'geodir_top_content_add' => '', |
|
525 | - 'geodir_before_main_content_add' => '', |
|
526 | - 'geodir_before_widget_filter' => '', |
|
527 | - 'geodir_after_widget_filter' => '', |
|
528 | - 'geodir_theme_compat_css' => stripslashes('.x-colophon.bottom{clear:both}#geodir-main-content,.geodir_flex-container{margin-top:16px}.geodir-x ul{list-style:none}.widget ul.geodir_category_list_view{border:none}.geodir_category_list_view li.geodir-gridview:last-child{border-bottom:1px solid #e1e1e1}.home .x-header-landmark{display:none}.geodir-x .x-main .geodir_advance_search_widget{margin:0}.geodir-x .top_banner_section{margin-bottom:0}.geodir-loc-bar{background:rgba(0,0,0,0.05);margin:0;padding:0}.geodir-loc-bar-in{background:none;border:none;padding:10px}.geodir-search{margin:0;width:100%}.widget .geodir-search select,.geodir-search input[type="text"],.geodir-search input[type="button"],.geodir-search input[type="submit"]{border:1px solid #ccc;box-shadow:none;height:auto;line-height:21px;margin:0 1% 0 0;padding:5px 10px}.widget .geodir-search select,.geodir-search input[type="text"]{width:28%}.geodir-search input[type="submit"],.geodir-search input[type="button"]{line-height:19px;margin-right:0;width:11%}.geodir-search input:hover[type="submit"],.geodir-search input:hover[type="button"]{background:#333;color:#fff}.geodir-cat-list .widget-title{margin-top:0}.geodir-x .geodir-category-list-in{background:rgba(0,0,0,0.05);border:none}.widget .geodir-cat-list ul.geodir-popular-cat-list{border:none;border-radius:0;box-shadow:none}.geodir_full_page .geodir-cat-list ul li{border:none}.geodir_full_page .geodir-cat-list ul li a{border:none}.post-type-archive .geodir-loc-bar{border:none;margin-top:20px}#menu-item-gd-location-switcher dd{margin-left:0}.geodir-chosen-container-single .chosen-single{height:auto}.widget ul.geodir-loginbox-list{overflow:visible}.geodir_full_page section.widget{clear:both}.x-ethos .entry-title{margin-bottom:20px}.x-ethos .geodir-chosen-container-single .chosen-single{padding:0 0 0 8px}.x-ethos .widget ul li a,.x-ethos .geodir_category_list_view li{color:#333}@media only screen and (max-width:767px){.widget .geodir-search select,.geodir-search input[type="text"],.geodir-search input[type="button"],.geodir-search input[type="submit"]{margin:0 0 10px;width:100%}}.geodir_full_page .geodir-loc-bar-in,.geodir_full_page .geodir-loc-bar,.geodir_full_page .geodir-category-list-in{margin-top:0;margin-bottom:0}.geodir_full_page .geodir-loc-bar-in,.geodir_full_page .geodir-category-list-in{border-bottom:1px solid rgba(0,0,0,0.1)}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}'), |
|
529 | - 'geodir_theme_compat_js' => '', |
|
530 | - 'geodir_theme_compat_default_options' => '', |
|
531 | - 'geodir_theme_compat_code' => 'X' |
|
532 | - ); |
|
499 | + $theme_compat['X'] = array( |
|
500 | + 'geodir_wrapper_open_id' => '', |
|
501 | + 'geodir_wrapper_open_class' => '', |
|
502 | + 'geodir_wrapper_open_replace' => '', |
|
503 | + 'geodir_wrapper_close_replace' => '', |
|
504 | + 'geodir_wrapper_content_open_id' => '', |
|
505 | + 'geodir_wrapper_content_open_class' => '', |
|
506 | + 'geodir_wrapper_content_open_replace' => '', |
|
507 | + 'geodir_wrapper_content_close_replace' => '', |
|
508 | + 'geodir_article_open_id' => '', |
|
509 | + 'geodir_article_open_class' => '', |
|
510 | + 'geodir_article_open_replace' => '', |
|
511 | + 'geodir_article_close_replace' => '', |
|
512 | + 'geodir_sidebar_right_open_id' => '', |
|
513 | + 'geodir_sidebar_right_open_class' => '', |
|
514 | + 'geodir_sidebar_right_open_replace' => '', |
|
515 | + 'geodir_sidebar_right_close_replace' => '', |
|
516 | + 'geodir_sidebar_left_open_id' => '', |
|
517 | + 'geodir_sidebar_left_open_class' => '', |
|
518 | + 'geodir_sidebar_left_open_replace' => '', |
|
519 | + 'geodir_sidebar_left_close_replace' => '', |
|
520 | + 'geodir_main_content_open_id' => '', |
|
521 | + 'geodir_main_content_open_class' => '', |
|
522 | + 'geodir_main_content_open_replace' => '', |
|
523 | + 'geodir_main_content_close_replace' => '', |
|
524 | + 'geodir_top_content_add' => '', |
|
525 | + 'geodir_before_main_content_add' => '', |
|
526 | + 'geodir_before_widget_filter' => '', |
|
527 | + 'geodir_after_widget_filter' => '', |
|
528 | + 'geodir_theme_compat_css' => stripslashes('.x-colophon.bottom{clear:both}#geodir-main-content,.geodir_flex-container{margin-top:16px}.geodir-x ul{list-style:none}.widget ul.geodir_category_list_view{border:none}.geodir_category_list_view li.geodir-gridview:last-child{border-bottom:1px solid #e1e1e1}.home .x-header-landmark{display:none}.geodir-x .x-main .geodir_advance_search_widget{margin:0}.geodir-x .top_banner_section{margin-bottom:0}.geodir-loc-bar{background:rgba(0,0,0,0.05);margin:0;padding:0}.geodir-loc-bar-in{background:none;border:none;padding:10px}.geodir-search{margin:0;width:100%}.widget .geodir-search select,.geodir-search input[type="text"],.geodir-search input[type="button"],.geodir-search input[type="submit"]{border:1px solid #ccc;box-shadow:none;height:auto;line-height:21px;margin:0 1% 0 0;padding:5px 10px}.widget .geodir-search select,.geodir-search input[type="text"]{width:28%}.geodir-search input[type="submit"],.geodir-search input[type="button"]{line-height:19px;margin-right:0;width:11%}.geodir-search input:hover[type="submit"],.geodir-search input:hover[type="button"]{background:#333;color:#fff}.geodir-cat-list .widget-title{margin-top:0}.geodir-x .geodir-category-list-in{background:rgba(0,0,0,0.05);border:none}.widget .geodir-cat-list ul.geodir-popular-cat-list{border:none;border-radius:0;box-shadow:none}.geodir_full_page .geodir-cat-list ul li{border:none}.geodir_full_page .geodir-cat-list ul li a{border:none}.post-type-archive .geodir-loc-bar{border:none;margin-top:20px}#menu-item-gd-location-switcher dd{margin-left:0}.geodir-chosen-container-single .chosen-single{height:auto}.widget ul.geodir-loginbox-list{overflow:visible}.geodir_full_page section.widget{clear:both}.x-ethos .entry-title{margin-bottom:20px}.x-ethos .geodir-chosen-container-single .chosen-single{padding:0 0 0 8px}.x-ethos .widget ul li a,.x-ethos .geodir_category_list_view li{color:#333}@media only screen and (max-width:767px){.widget .geodir-search select,.geodir-search input[type="text"],.geodir-search input[type="button"],.geodir-search input[type="submit"]{margin:0 0 10px;width:100%}}.geodir_full_page .geodir-loc-bar-in,.geodir_full_page .geodir-loc-bar,.geodir_full_page .geodir-category-list-in{margin-top:0;margin-bottom:0}.geodir_full_page .geodir-loc-bar-in,.geodir_full_page .geodir-category-list-in{border-bottom:1px solid rgba(0,0,0,0.1)}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}'), |
|
529 | + 'geodir_theme_compat_js' => '', |
|
530 | + 'geodir_theme_compat_default_options' => '', |
|
531 | + 'geodir_theme_compat_code' => 'X' |
|
532 | + ); |
|
533 | 533 | |
534 | 534 | // Divi |
535 | - $theme_compat['Divi'] = array( |
|
536 | - 'geodir_wrapper_open_id' => 'main-content', |
|
537 | - 'geodir_wrapper_open_class' => '', |
|
538 | - 'geodir_wrapper_open_replace' => '', |
|
539 | - 'geodir_wrapper_close_replace' => '', |
|
540 | - 'geodir_wrapper_content_open_id' => 'left-area', |
|
541 | - 'geodir_wrapper_content_open_class' => '', |
|
542 | - 'geodir_wrapper_content_open_replace' => '<div class="container"><div id="content-area" class="clearfix"><div id="[id]" class="[class]" role="main" >', |
|
543 | - 'geodir_wrapper_content_close_replace' => '', |
|
544 | - 'geodir_article_open_id' => '', |
|
545 | - 'geodir_article_open_class' => '', |
|
546 | - 'geodir_article_open_replace' => '', |
|
547 | - 'geodir_article_close_replace' => '', |
|
548 | - 'geodir_sidebar_right_open_id' => 'sidebar', |
|
549 | - 'geodir_sidebar_right_open_class' => '', |
|
550 | - 'geodir_sidebar_right_open_replace' => '<aside id="[id]" class="" role="complementary" itemscope itemtype="[itemtype]" >', |
|
551 | - 'geodir_sidebar_right_close_replace' => '</aside><!-- sidebar ends here--></div></div>', |
|
552 | - 'geodir_sidebar_left_open_id' => 'sidebar', |
|
553 | - 'geodir_sidebar_left_open_class' => '', |
|
554 | - 'geodir_sidebar_left_open_replace' => '<aside id="[id]" class="" role="complementary" itemscope itemtype="[itemtype]" >', |
|
555 | - 'geodir_sidebar_left_close_replace' => '</aside><!-- sidebar ends here--></div></div>', |
|
556 | - 'geodir_main_content_open_id' => '', |
|
557 | - 'geodir_main_content_open_class' => '', |
|
558 | - 'geodir_main_content_open_replace' => '', |
|
559 | - 'geodir_main_content_close_replace' => '', |
|
560 | - 'geodir_top_content_add' => '', |
|
561 | - 'geodir_before_main_content_add' => '', |
|
562 | - 'geodir_before_widget_filter' => '', |
|
563 | - 'geodir_after_widget_filter' => '', |
|
564 | - 'geodir_theme_compat_css' => stripslashes('#left-area ul.geodir-direction-nav{list-style-type:none}#sidebar .geodir-company_info{margin-left:30px}#sidebar .geodir-widget{float:none;margin:0 0 30px 30px}.geodir_full_page .geodir-loc-bar{padding:0;margin:0;border:none}.geodir_full_page .geodir-category-list-in{margin-top:0}.geodir_full_page .top_banner_section{margin-bottom:0}.archive .entry-header,.geodir-breadcrumb{border-bottom:1px solid #e2e2e2}.archive .entry-header h1,ul#breadcrumbs{margin:0 auto;width:1080px}#left-area ul.geodir_category_list_view{padding:10px 0}.nav li#menu-item-gd-location-switcher ul{width:222px}#menu-item-gd-location-switcher li.gd-location-switcher-menu-item{padding-right:0}#menu-item-gd-location-switcher dd{margin-left:0}#menu-item-gd-location-switcher .geodir_location_tab_container dd a{padding:5px;width:auto}@media only screen and ( max-width: 980px ){.geodir-loc-bar-in,.geodir-cat-list,ul#breadcrumbs{width:690px}}@media only screen and ( max-width: 767px ){.geodir-loc-bar-in,.geodir-cat-list,ul#breadcrumbs{width:400px}}@media only screen and ( max-width: 479px ){.geodir-loc-bar-in,.geodir-cat-list,ul#breadcrumbs{width:280px}}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}'), |
|
565 | - 'geodir_theme_compat_js' => '', |
|
566 | - 'geodir_theme_compat_default_options' => '', |
|
567 | - 'geodir_theme_compat_code' => 'Divi' |
|
568 | - ); |
|
535 | + $theme_compat['Divi'] = array( |
|
536 | + 'geodir_wrapper_open_id' => 'main-content', |
|
537 | + 'geodir_wrapper_open_class' => '', |
|
538 | + 'geodir_wrapper_open_replace' => '', |
|
539 | + 'geodir_wrapper_close_replace' => '', |
|
540 | + 'geodir_wrapper_content_open_id' => 'left-area', |
|
541 | + 'geodir_wrapper_content_open_class' => '', |
|
542 | + 'geodir_wrapper_content_open_replace' => '<div class="container"><div id="content-area" class="clearfix"><div id="[id]" class="[class]" role="main" >', |
|
543 | + 'geodir_wrapper_content_close_replace' => '', |
|
544 | + 'geodir_article_open_id' => '', |
|
545 | + 'geodir_article_open_class' => '', |
|
546 | + 'geodir_article_open_replace' => '', |
|
547 | + 'geodir_article_close_replace' => '', |
|
548 | + 'geodir_sidebar_right_open_id' => 'sidebar', |
|
549 | + 'geodir_sidebar_right_open_class' => '', |
|
550 | + 'geodir_sidebar_right_open_replace' => '<aside id="[id]" class="" role="complementary" itemscope itemtype="[itemtype]" >', |
|
551 | + 'geodir_sidebar_right_close_replace' => '</aside><!-- sidebar ends here--></div></div>', |
|
552 | + 'geodir_sidebar_left_open_id' => 'sidebar', |
|
553 | + 'geodir_sidebar_left_open_class' => '', |
|
554 | + 'geodir_sidebar_left_open_replace' => '<aside id="[id]" class="" role="complementary" itemscope itemtype="[itemtype]" >', |
|
555 | + 'geodir_sidebar_left_close_replace' => '</aside><!-- sidebar ends here--></div></div>', |
|
556 | + 'geodir_main_content_open_id' => '', |
|
557 | + 'geodir_main_content_open_class' => '', |
|
558 | + 'geodir_main_content_open_replace' => '', |
|
559 | + 'geodir_main_content_close_replace' => '', |
|
560 | + 'geodir_top_content_add' => '', |
|
561 | + 'geodir_before_main_content_add' => '', |
|
562 | + 'geodir_before_widget_filter' => '', |
|
563 | + 'geodir_after_widget_filter' => '', |
|
564 | + 'geodir_theme_compat_css' => stripslashes('#left-area ul.geodir-direction-nav{list-style-type:none}#sidebar .geodir-company_info{margin-left:30px}#sidebar .geodir-widget{float:none;margin:0 0 30px 30px}.geodir_full_page .geodir-loc-bar{padding:0;margin:0;border:none}.geodir_full_page .geodir-category-list-in{margin-top:0}.geodir_full_page .top_banner_section{margin-bottom:0}.archive .entry-header,.geodir-breadcrumb{border-bottom:1px solid #e2e2e2}.archive .entry-header h1,ul#breadcrumbs{margin:0 auto;width:1080px}#left-area ul.geodir_category_list_view{padding:10px 0}.nav li#menu-item-gd-location-switcher ul{width:222px}#menu-item-gd-location-switcher li.gd-location-switcher-menu-item{padding-right:0}#menu-item-gd-location-switcher dd{margin-left:0}#menu-item-gd-location-switcher .geodir_location_tab_container dd a{padding:5px;width:auto}@media only screen and ( max-width: 980px ){.geodir-loc-bar-in,.geodir-cat-list,ul#breadcrumbs{width:690px}}@media only screen and ( max-width: 767px ){.geodir-loc-bar-in,.geodir-cat-list,ul#breadcrumbs{width:400px}}@media only screen and ( max-width: 479px ){.geodir-loc-bar-in,.geodir-cat-list,ul#breadcrumbs{width:280px}}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}'), |
|
565 | + 'geodir_theme_compat_js' => '', |
|
566 | + 'geodir_theme_compat_default_options' => '', |
|
567 | + 'geodir_theme_compat_code' => 'Divi' |
|
568 | + ); |
|
569 | 569 | |
570 | 570 | // Genesis |
571 | - $theme_compat['Genesis'] = array( |
|
572 | - 'geodir_wrapper_open_id' => '', |
|
573 | - 'geodir_wrapper_open_class' => 'content-sidebar-wrap', |
|
574 | - 'geodir_wrapper_open_replace' => '', |
|
575 | - 'geodir_wrapper_close_replace' => '', |
|
576 | - 'geodir_wrapper_content_open_id' => '', |
|
577 | - 'geodir_wrapper_content_open_class' => 'content', |
|
578 | - 'geodir_wrapper_content_open_replace' => '<div class="[class]" role="main" >', |
|
579 | - 'geodir_wrapper_content_close_replace' => '', |
|
580 | - 'geodir_article_open_id' => '', |
|
581 | - 'geodir_article_open_class' => '', |
|
582 | - 'geodir_article_open_replace' => '', |
|
583 | - 'geodir_article_close_replace' => '', |
|
584 | - 'geodir_sidebar_right_open_id' => '', |
|
585 | - 'geodir_sidebar_right_open_class' => 'sidebar sidebar-primary widget-area', |
|
586 | - 'geodir_sidebar_right_open_replace' => '<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]">', |
|
587 | - 'geodir_sidebar_right_close_replace' => '', |
|
588 | - 'geodir_sidebar_left_open_id' => '', |
|
589 | - 'geodir_sidebar_left_open_class' => 'sidebar sidebar-secondary widget-area', |
|
590 | - 'geodir_sidebar_left_open_replace' => '<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]">', |
|
591 | - 'geodir_sidebar_left_close_replace' => '', |
|
592 | - 'geodir_main_content_open_id' => '', |
|
593 | - 'geodir_main_content_open_class' => '', |
|
594 | - 'geodir_main_content_open_replace' => '<main id="[id]" class="entry [class]" role="main">', |
|
595 | - 'geodir_main_content_close_replace' => '', |
|
596 | - 'geodir_top_content_add' => '', |
|
597 | - 'geodir_before_main_content_add' => '', |
|
598 | - 'geodir_before_widget_filter' => '', |
|
599 | - 'geodir_after_widget_filter' => '', |
|
600 | - 'geodir_location_switcher_menu_li_class_filter' => 'menu-item menu-item-gd-location-switcher menu-item-has-children gd-location-switcher', |
|
601 | - 'geodir_theme_compat_css' => stripslashes('.full-width-content #geodir-wrapper-content{width:100%}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}.content{float:left}.sidebar-content .content,.sidebar-content #geodir-wrapper-content{float:right}.sidebar .geodir-company_info{background-color:#fff;border:none}.geodir_full_page .geodir-loc-bar{padding:0;margin:0;border:none}.geodir_full_page .geodir-category-list-in{margin-top:0}.geodir_full_page .top_banner_section{margin-bottom:0}.geodir-breadcrumb-bar{margin-bottom:-35px} .search-page .entry-title,.listings-page .entry-title{font-size: 20px;}.site-inner .geodir-breadcrumb-bar{margin-bottom:0px}'), |
|
602 | - 'geodir_theme_compat_js' => '', |
|
603 | - 'geodir_theme_compat_default_options' => '', |
|
604 | - 'geodir_theme_compat_code' => 'Genesis' |
|
605 | - ); |
|
571 | + $theme_compat['Genesis'] = array( |
|
572 | + 'geodir_wrapper_open_id' => '', |
|
573 | + 'geodir_wrapper_open_class' => 'content-sidebar-wrap', |
|
574 | + 'geodir_wrapper_open_replace' => '', |
|
575 | + 'geodir_wrapper_close_replace' => '', |
|
576 | + 'geodir_wrapper_content_open_id' => '', |
|
577 | + 'geodir_wrapper_content_open_class' => 'content', |
|
578 | + 'geodir_wrapper_content_open_replace' => '<div class="[class]" role="main" >', |
|
579 | + 'geodir_wrapper_content_close_replace' => '', |
|
580 | + 'geodir_article_open_id' => '', |
|
581 | + 'geodir_article_open_class' => '', |
|
582 | + 'geodir_article_open_replace' => '', |
|
583 | + 'geodir_article_close_replace' => '', |
|
584 | + 'geodir_sidebar_right_open_id' => '', |
|
585 | + 'geodir_sidebar_right_open_class' => 'sidebar sidebar-primary widget-area', |
|
586 | + 'geodir_sidebar_right_open_replace' => '<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]">', |
|
587 | + 'geodir_sidebar_right_close_replace' => '', |
|
588 | + 'geodir_sidebar_left_open_id' => '', |
|
589 | + 'geodir_sidebar_left_open_class' => 'sidebar sidebar-secondary widget-area', |
|
590 | + 'geodir_sidebar_left_open_replace' => '<aside id="[id]" class="[class]" role="complementary" itemscope itemtype="[itemtype]">', |
|
591 | + 'geodir_sidebar_left_close_replace' => '', |
|
592 | + 'geodir_main_content_open_id' => '', |
|
593 | + 'geodir_main_content_open_class' => '', |
|
594 | + 'geodir_main_content_open_replace' => '<main id="[id]" class="entry [class]" role="main">', |
|
595 | + 'geodir_main_content_close_replace' => '', |
|
596 | + 'geodir_top_content_add' => '', |
|
597 | + 'geodir_before_main_content_add' => '', |
|
598 | + 'geodir_before_widget_filter' => '', |
|
599 | + 'geodir_after_widget_filter' => '', |
|
600 | + 'geodir_location_switcher_menu_li_class_filter' => 'menu-item menu-item-gd-location-switcher menu-item-has-children gd-location-switcher', |
|
601 | + 'geodir_theme_compat_css' => stripslashes('.full-width-content #geodir-wrapper-content{width:100%}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}.content{float:left}.sidebar-content .content,.sidebar-content #geodir-wrapper-content{float:right}.sidebar .geodir-company_info{background-color:#fff;border:none}.geodir_full_page .geodir-loc-bar{padding:0;margin:0;border:none}.geodir_full_page .geodir-category-list-in{margin-top:0}.geodir_full_page .top_banner_section{margin-bottom:0}.geodir-breadcrumb-bar{margin-bottom:-35px} .search-page .entry-title,.listings-page .entry-title{font-size: 20px;}.site-inner .geodir-breadcrumb-bar{margin-bottom:0px}'), |
|
602 | + 'geodir_theme_compat_js' => '', |
|
603 | + 'geodir_theme_compat_default_options' => '', |
|
604 | + 'geodir_theme_compat_code' => 'Genesis' |
|
605 | + ); |
|
606 | 606 | |
607 | 607 | // Jupiter |
608 | - $theme_compat['Jupiter'] = array( |
|
609 | - 'geodir_wrapper_open_id' => '', |
|
610 | - 'geodir_wrapper_open_class' => '', |
|
611 | - 'geodir_wrapper_open_replace' => '<div id="theme-page"><div class="mk-main-wrapper-holder"><div class="theme-page-wrapper mk-main-wrapper mk-grid vc_row-fluid">', |
|
612 | - 'geodir_wrapper_close_replace' => '</div></div></div>', |
|
613 | - 'geodir_wrapper_content_open_id' => '', |
|
614 | - 'geodir_wrapper_content_open_class' => '', |
|
615 | - 'geodir_wrapper_content_open_replace' => '', |
|
616 | - 'geodir_wrapper_content_close_replace' => '', |
|
617 | - 'geodir_article_open_id' => '', |
|
618 | - 'geodir_article_open_class' => '', |
|
619 | - 'geodir_article_open_replace' => '', |
|
620 | - 'geodir_article_close_replace' => '', |
|
621 | - 'geodir_sidebar_right_open_id' => 'mk-sidebar', |
|
622 | - 'geodir_sidebar_right_open_class' => 'mk-builtin geodir-sidebar-right geodir-listings-sidebar-right', |
|
623 | - 'geodir_sidebar_right_open_replace' => '', |
|
624 | - 'geodir_sidebar_right_close_replace' => '', |
|
625 | - 'geodir_sidebar_left_open_id' => 'mk-sidebar', |
|
626 | - 'geodir_sidebar_left_open_class' => 'mk-builtin geodir-sidebar-right geodir-listings-sidebar-right', |
|
627 | - 'geodir_sidebar_left_open_replace' => '', |
|
628 | - 'geodir_sidebar_left_close_replace' => '', |
|
629 | - 'geodir_main_content_open_id' => '', |
|
630 | - 'geodir_main_content_open_class' => '', |
|
631 | - 'geodir_main_content_open_replace' => '', |
|
632 | - 'geodir_main_content_close_replace' => '', |
|
633 | - 'geodir_top_content_add' => '', |
|
634 | - 'geodir_before_main_content_add' => '', |
|
635 | - 'geodir_before_widget_filter' => '', |
|
636 | - 'geodir_after_widget_filter' => '', |
|
637 | - 'geodir_before_title_filter' => '<h3 class="widgettitle geodir-widget-title">', |
|
638 | - 'geodir_after_title_filter' => '', |
|
639 | - 'geodir_menu_li_class_filter' => 'menu-item menu-item-has-children no-mega-menu', |
|
640 | - 'geodir_sub_menu_ul_class_filter' => '', |
|
641 | - 'geodir_sub_menu_li_class_filter' => '', |
|
642 | - 'geodir_menu_a_class_filter' => 'menu-item-link', |
|
643 | - 'geodir_sub_menu_a_class_filter' => 'menu-item-link one-page-nav-item', |
|
644 | - 'geodir_location_switcher_menu_li_class_filter' => 'menu-item menu-item-type-social menu-item-type-social gd-location-switcher menu-item-has-children no-mega-menu', |
|
645 | - 'geodir_location_switcher_menu_a_class_filter' => 'menu-item-link', |
|
646 | - 'geodir_location_switcher_menu_sub_ul_class_filter' => '', |
|
647 | - 'geodir_location_switcher_menu_sub_li_class_filter' => '', |
|
648 | - 'geodir_theme_compat_css' => stripslashes('.geodir-widget li,.geodir_category_list_view li{margin:0}#theme-page h3.geodir-entry-title{font-size:14px}#menu-item-gd-location-switcher dd{line-height:44px}#menu-item-gd-location-switcher .geodir_location_sugestion{line-height:20px}.geodir_loginbox{overflow:visible}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}'), |
|
649 | - 'geodir_theme_compat_js' => '', |
|
650 | - 'geodir_theme_compat_default_options' => '', |
|
651 | - 'geodir_theme_compat_code' => 'Jupiter' |
|
652 | - ); |
|
608 | + $theme_compat['Jupiter'] = array( |
|
609 | + 'geodir_wrapper_open_id' => '', |
|
610 | + 'geodir_wrapper_open_class' => '', |
|
611 | + 'geodir_wrapper_open_replace' => '<div id="theme-page"><div class="mk-main-wrapper-holder"><div class="theme-page-wrapper mk-main-wrapper mk-grid vc_row-fluid">', |
|
612 | + 'geodir_wrapper_close_replace' => '</div></div></div>', |
|
613 | + 'geodir_wrapper_content_open_id' => '', |
|
614 | + 'geodir_wrapper_content_open_class' => '', |
|
615 | + 'geodir_wrapper_content_open_replace' => '', |
|
616 | + 'geodir_wrapper_content_close_replace' => '', |
|
617 | + 'geodir_article_open_id' => '', |
|
618 | + 'geodir_article_open_class' => '', |
|
619 | + 'geodir_article_open_replace' => '', |
|
620 | + 'geodir_article_close_replace' => '', |
|
621 | + 'geodir_sidebar_right_open_id' => 'mk-sidebar', |
|
622 | + 'geodir_sidebar_right_open_class' => 'mk-builtin geodir-sidebar-right geodir-listings-sidebar-right', |
|
623 | + 'geodir_sidebar_right_open_replace' => '', |
|
624 | + 'geodir_sidebar_right_close_replace' => '', |
|
625 | + 'geodir_sidebar_left_open_id' => 'mk-sidebar', |
|
626 | + 'geodir_sidebar_left_open_class' => 'mk-builtin geodir-sidebar-right geodir-listings-sidebar-right', |
|
627 | + 'geodir_sidebar_left_open_replace' => '', |
|
628 | + 'geodir_sidebar_left_close_replace' => '', |
|
629 | + 'geodir_main_content_open_id' => '', |
|
630 | + 'geodir_main_content_open_class' => '', |
|
631 | + 'geodir_main_content_open_replace' => '', |
|
632 | + 'geodir_main_content_close_replace' => '', |
|
633 | + 'geodir_top_content_add' => '', |
|
634 | + 'geodir_before_main_content_add' => '', |
|
635 | + 'geodir_before_widget_filter' => '', |
|
636 | + 'geodir_after_widget_filter' => '', |
|
637 | + 'geodir_before_title_filter' => '<h3 class="widgettitle geodir-widget-title">', |
|
638 | + 'geodir_after_title_filter' => '', |
|
639 | + 'geodir_menu_li_class_filter' => 'menu-item menu-item-has-children no-mega-menu', |
|
640 | + 'geodir_sub_menu_ul_class_filter' => '', |
|
641 | + 'geodir_sub_menu_li_class_filter' => '', |
|
642 | + 'geodir_menu_a_class_filter' => 'menu-item-link', |
|
643 | + 'geodir_sub_menu_a_class_filter' => 'menu-item-link one-page-nav-item', |
|
644 | + 'geodir_location_switcher_menu_li_class_filter' => 'menu-item menu-item-type-social menu-item-type-social gd-location-switcher menu-item-has-children no-mega-menu', |
|
645 | + 'geodir_location_switcher_menu_a_class_filter' => 'menu-item-link', |
|
646 | + 'geodir_location_switcher_menu_sub_ul_class_filter' => '', |
|
647 | + 'geodir_location_switcher_menu_sub_li_class_filter' => '', |
|
648 | + 'geodir_theme_compat_css' => stripslashes('.geodir-widget li,.geodir_category_list_view li{margin:0}#theme-page h3.geodir-entry-title{font-size:14px}#menu-item-gd-location-switcher dd{line-height:44px}#menu-item-gd-location-switcher .geodir_location_sugestion{line-height:20px}.geodir_loginbox{overflow:visible}.geodir_full_page .geodir-listing-search{text-align:center}.geodir_full_page .geodir-search{float:none;margin:0}.geodir_full_page .geodir-search select,.geodir_full_page .geodir-search .search_by_post,.geodir_full_page .geodir-search input[type="text"],.geodir_full_page .geodir-search input[type="button"],.geodir_full_page .geodir-search input[type="submit"]{display:inline-block;float:none}'), |
|
649 | + 'geodir_theme_compat_js' => '', |
|
650 | + 'geodir_theme_compat_default_options' => '', |
|
651 | + 'geodir_theme_compat_code' => 'Jupiter' |
|
652 | + ); |
|
653 | 653 | |
654 | 654 | // Multi News |
655 | - $theme_compat['Multi_News'] = array( |
|
656 | - 'geodir_wrapper_open_id' => '', |
|
657 | - 'geodir_wrapper_open_class' => 'main-container clearfix', |
|
658 | - 'geodir_wrapper_open_replace' => '', |
|
659 | - 'geodir_wrapper_close_replace' => '', |
|
660 | - 'geodir_wrapper_content_open_id' => '', |
|
661 | - 'geodir_wrapper_content_open_class' => '', |
|
662 | - 'geodir_wrapper_content_open_replace' => '<div class="main-left" ><div class="main-content "><div class="site-content page-wrap">', |
|
663 | - 'geodir_wrapper_content_close_replace' => '</div></div></div>', |
|
664 | - 'geodir_article_open_id' => '', |
|
665 | - 'geodir_article_open_class' => '', |
|
666 | - 'geodir_article_open_replace' => '', |
|
667 | - 'geodir_article_close_replace' => '', |
|
668 | - 'geodir_sidebar_right_open_id' => '', |
|
669 | - 'geodir_sidebar_right_open_class' => '', |
|
670 | - 'geodir_sidebar_right_open_replace' => '<aside class="sidebar" role="complementary" itemscope itemtype="[itemtype]" >', |
|
671 | - 'geodir_sidebar_right_close_replace' => '', |
|
672 | - 'geodir_sidebar_left_open_id' => '', |
|
673 | - 'geodir_sidebar_left_open_class' => '', |
|
674 | - 'geodir_sidebar_left_open_replace' => '<aside class="secondary-sidebar" role="complementary" itemscope itemtype="[itemtype]" >', |
|
675 | - 'geodir_sidebar_left_close_replace' => '', |
|
676 | - 'geodir_main_content_open_id' => '', |
|
677 | - 'geodir_main_content_open_class' => '', |
|
678 | - 'geodir_main_content_open_replace' => '<div class="site-content page-wrap">', |
|
679 | - 'geodir_main_content_close_replace' => '</div>', |
|
680 | - 'geodir_top_content_add' => '', |
|
681 | - 'geodir_before_main_content_add' => '', |
|
682 | - 'geodir_full_page_class_filter' => 'section full-width-section', |
|
683 | - 'geodir_before_widget_filter' => '', |
|
684 | - 'geodir_after_widget_filter' => '', |
|
685 | - 'geodir_before_title_filter' => '<div class="widget-title"><h2>', |
|
686 | - 'geodir_after_title_filter' => '</h2></div>', |
|
687 | - 'geodir_menu_li_class_filter' => '', |
|
688 | - 'geodir_sub_menu_ul_class_filter' => '', |
|
689 | - 'geodir_sub_menu_li_class_filter' => '', |
|
690 | - 'geodir_menu_a_class_filter' => '', |
|
691 | - 'geodir_sub_menu_a_class_filter' => '', |
|
692 | - 'geodir_location_switcher_menu_li_class_filter' => '', |
|
693 | - 'geodir_location_switcher_menu_a_class_filter' => '', |
|
694 | - 'geodir_location_switcher_menu_sub_ul_class_filter' => '', |
|
695 | - 'geodir_location_switcher_menu_sub_li_class_filter' => '', |
|
696 | - 'geodir_theme_compat_css' => stripslashes('.full-width-section .geodir-search{margin:0;width:100%}.geodir_full_page .geodir-search{margin:0 auto;float:none}.geodir-search input[type=button],.geodir-search input[type=submit]{width:13%}.geodir-search input[type=text]{border:1px solid #ddd;border-radius:0;padding:0 8px}.geodir-category-list-in,.geodir-loc-bar-in{background:#f2f2f2;border-color:#dbdbdb}.geodir-category-list-in{margin-top:0}.geodir-cat-list .widget-title h2{margin:-13px -13px 13px}.widget .geodir-cat-list ul li.geodir-pcat-show a:before{display:none!important}.widget .geodir-cat-list ul li.geodir-pcat-show i{margin-right:5px}.container .geodir-search select{margin:0 3% 0 0;padding:8px 10px;width:13%}#geodir_carousel,#geodir_slider{border-radius:0;-webkit-border-radius:0;-moz-border-radius:0;margin-bottom:20px!important;border:1px solid #e1e1e1;box-shadow:none}#geodir_carousel{padding:10px}.geodir-tabs-content ol.commentlist{margin:40px 0;padding:0}li#post_mapTab{min-height:400px}#reviewsTab ol.commentlist li{border-bottom:none}#reviewsTab ol.commentlist li article.comment{border-bottom:1px solid #e1e1e1;padding-bottom:10px}.comment-content .rating{display:none}.comment-respond .gd_rating{margin-bottom:20px}div.geodir-rating{width:85px!important}.comment-respond .comment-notes{margin-bottom:10px}.average-review span,.comment-form label,.dtreviewed,.geodir-details-sidebar-user-links a,.geodir-viewall,.geodir_more_info span,.reviewer,dl.geodir-tab-head dd a{font-family:"Archivo Narrow",sans-serif}section.comment-content{margin:0 0 0 12%}#reviewsTab .comments-area .comment-content{width:auto}section.comment-content .description,section.comment-content p{margin:15px 0}dl.geodir-tab-head dd a{background:#f3f3f3;margin-top:-1px;font-size:14px;padding:0 15px}dl.geodir-tab-head dd.geodir-tab-active a{padding-bottom:1px}.geodir-widget .geodir_list_heading,.geodir-widget h3.widget-title{padding:0 15px;background:#e9e9e9;border:1px solid #dbdbdb;height:38px;line-height:38px;color:#2d2d2d}.geodir-widget .geodir_list_heading h3{background:0 0;border:none}.geodir-widget .geodir_list_heading{margin:-13px -14px 13px}.geodir-map-listing-page{border-width:1px 0 0;border-style:solid;border-color:#dbdbdb}.geodir-sidebar-wrap .geodir-company_info{margin:15px}.geodir-details-sidebar-social-sharing iframe{float:left}.geodir-details-sidebar-rating{overflow:hidden}.geodir-details-sidebar-rating .gd_rating_show,.geodir-details-sidebar-rating .geodir-rating{float:left;margin-right:15px}.geodir-details-sidebar-rating span.item{float:left;margin-top:5px}.geodir-details-sidebar-rating .average-review{top:-4px;position:relative}.geodir-details-sidebar-rating span.item img{margin-top:5px}.geodir_full_page{background:#fff;border:1px solid #e1e1e1;-webkit-box-shadow:0 1px 0 #e5e5e5;box-shadow:0 1px 0 #e5e5e5;padding:15px;margin-bottom:20px;clear:both}.geodir_map_container .main_list img{margin:0 5px}.geodir_category_list_view li.geodir-gridview .geodir-post-img .geodir_thumbnail{margin-bottom:10px}.geodir-addinfo .geodir-pinpoint,.geodir-addinfo a i{margin-right:5px}.geodir_category_list_view li.geodir-gridview h3{font-size:18px;margin-bottom:10px}#related_listingTab ul.geodir_category_list_view{padding:0!important}#reviewsTab #comments .gd_rating{margin-top:5px}.widget .geodir_category_list_view li .geodir-entry-content,.widget .geodir_category_list_view li a:before{display:none!important}.geodir_category_list_view li .geodir-entry-title{margin-bottom:10px}.widget ul.geodir_category_list_view{padding:15px}.sidebar .widget .geodir_category_list_view li{width:calc(100% - 25px)}.widget .geodir-loginbox-list li{overflow:visible!important}.widget ul.chosen-results{margin:0!important}.main_list_selecter{margin-right:5px}.geodir-viewall{float:right;width:auto!important}.widget-title h2{padding:0 15px;background:#e9e9e9;border:1px solid #dbdbdb;height:38px;line-height:38px}.widget:first-child .geodir_list_heading .widget-title{margin-top:0}.geodir_list_heading .widget-title{float:left;width:80%;margin-top:0}.geodir_list_heading .widget-title h2{padding:0 px;background:0 0;border:none;height:auto;line-height:auto}.chosen-default:before{content:none;display:none;position:absolute;margin-left:-1000000px;float:left}#geodir-wrapper .entry-crumbs{margin-bottom:20px}.geodir-search .mom-select{float:left;width:150px;margin:5px;border:1px solid #ddd;height:40px}.iprelative .gm-style .gm-style-iw{width:100%!important}'), |
|
697 | - 'geodir_theme_compat_js' => 'jQuery(document).ready(function(e){e(".geodir_full_page").length&&""===e.trim(e(".geodir_full_page").html())&&e(".geodir_full_page").css({display:"none"})});', |
|
698 | - 'geodir_theme_compat_default_options' => '', |
|
699 | - 'geodir_theme_compat_code' => 'Multi_News' |
|
700 | - ); |
|
701 | - |
|
702 | - update_option('gd_theme_compats', $theme_compat); |
|
703 | - |
|
704 | - gd_set_theme_compat();// set the compat pack if avail |
|
655 | + $theme_compat['Multi_News'] = array( |
|
656 | + 'geodir_wrapper_open_id' => '', |
|
657 | + 'geodir_wrapper_open_class' => 'main-container clearfix', |
|
658 | + 'geodir_wrapper_open_replace' => '', |
|
659 | + 'geodir_wrapper_close_replace' => '', |
|
660 | + 'geodir_wrapper_content_open_id' => '', |
|
661 | + 'geodir_wrapper_content_open_class' => '', |
|
662 | + 'geodir_wrapper_content_open_replace' => '<div class="main-left" ><div class="main-content "><div class="site-content page-wrap">', |
|
663 | + 'geodir_wrapper_content_close_replace' => '</div></div></div>', |
|
664 | + 'geodir_article_open_id' => '', |
|
665 | + 'geodir_article_open_class' => '', |
|
666 | + 'geodir_article_open_replace' => '', |
|
667 | + 'geodir_article_close_replace' => '', |
|
668 | + 'geodir_sidebar_right_open_id' => '', |
|
669 | + 'geodir_sidebar_right_open_class' => '', |
|
670 | + 'geodir_sidebar_right_open_replace' => '<aside class="sidebar" role="complementary" itemscope itemtype="[itemtype]" >', |
|
671 | + 'geodir_sidebar_right_close_replace' => '', |
|
672 | + 'geodir_sidebar_left_open_id' => '', |
|
673 | + 'geodir_sidebar_left_open_class' => '', |
|
674 | + 'geodir_sidebar_left_open_replace' => '<aside class="secondary-sidebar" role="complementary" itemscope itemtype="[itemtype]" >', |
|
675 | + 'geodir_sidebar_left_close_replace' => '', |
|
676 | + 'geodir_main_content_open_id' => '', |
|
677 | + 'geodir_main_content_open_class' => '', |
|
678 | + 'geodir_main_content_open_replace' => '<div class="site-content page-wrap">', |
|
679 | + 'geodir_main_content_close_replace' => '</div>', |
|
680 | + 'geodir_top_content_add' => '', |
|
681 | + 'geodir_before_main_content_add' => '', |
|
682 | + 'geodir_full_page_class_filter' => 'section full-width-section', |
|
683 | + 'geodir_before_widget_filter' => '', |
|
684 | + 'geodir_after_widget_filter' => '', |
|
685 | + 'geodir_before_title_filter' => '<div class="widget-title"><h2>', |
|
686 | + 'geodir_after_title_filter' => '</h2></div>', |
|
687 | + 'geodir_menu_li_class_filter' => '', |
|
688 | + 'geodir_sub_menu_ul_class_filter' => '', |
|
689 | + 'geodir_sub_menu_li_class_filter' => '', |
|
690 | + 'geodir_menu_a_class_filter' => '', |
|
691 | + 'geodir_sub_menu_a_class_filter' => '', |
|
692 | + 'geodir_location_switcher_menu_li_class_filter' => '', |
|
693 | + 'geodir_location_switcher_menu_a_class_filter' => '', |
|
694 | + 'geodir_location_switcher_menu_sub_ul_class_filter' => '', |
|
695 | + 'geodir_location_switcher_menu_sub_li_class_filter' => '', |
|
696 | + 'geodir_theme_compat_css' => stripslashes('.full-width-section .geodir-search{margin:0;width:100%}.geodir_full_page .geodir-search{margin:0 auto;float:none}.geodir-search input[type=button],.geodir-search input[type=submit]{width:13%}.geodir-search input[type=text]{border:1px solid #ddd;border-radius:0;padding:0 8px}.geodir-category-list-in,.geodir-loc-bar-in{background:#f2f2f2;border-color:#dbdbdb}.geodir-category-list-in{margin-top:0}.geodir-cat-list .widget-title h2{margin:-13px -13px 13px}.widget .geodir-cat-list ul li.geodir-pcat-show a:before{display:none!important}.widget .geodir-cat-list ul li.geodir-pcat-show i{margin-right:5px}.container .geodir-search select{margin:0 3% 0 0;padding:8px 10px;width:13%}#geodir_carousel,#geodir_slider{border-radius:0;-webkit-border-radius:0;-moz-border-radius:0;margin-bottom:20px!important;border:1px solid #e1e1e1;box-shadow:none}#geodir_carousel{padding:10px}.geodir-tabs-content ol.commentlist{margin:40px 0;padding:0}li#post_mapTab{min-height:400px}#reviewsTab ol.commentlist li{border-bottom:none}#reviewsTab ol.commentlist li article.comment{border-bottom:1px solid #e1e1e1;padding-bottom:10px}.comment-content .rating{display:none}.comment-respond .gd_rating{margin-bottom:20px}div.geodir-rating{width:85px!important}.comment-respond .comment-notes{margin-bottom:10px}.average-review span,.comment-form label,.dtreviewed,.geodir-details-sidebar-user-links a,.geodir-viewall,.geodir_more_info span,.reviewer,dl.geodir-tab-head dd a{font-family:"Archivo Narrow",sans-serif}section.comment-content{margin:0 0 0 12%}#reviewsTab .comments-area .comment-content{width:auto}section.comment-content .description,section.comment-content p{margin:15px 0}dl.geodir-tab-head dd a{background:#f3f3f3;margin-top:-1px;font-size:14px;padding:0 15px}dl.geodir-tab-head dd.geodir-tab-active a{padding-bottom:1px}.geodir-widget .geodir_list_heading,.geodir-widget h3.widget-title{padding:0 15px;background:#e9e9e9;border:1px solid #dbdbdb;height:38px;line-height:38px;color:#2d2d2d}.geodir-widget .geodir_list_heading h3{background:0 0;border:none}.geodir-widget .geodir_list_heading{margin:-13px -14px 13px}.geodir-map-listing-page{border-width:1px 0 0;border-style:solid;border-color:#dbdbdb}.geodir-sidebar-wrap .geodir-company_info{margin:15px}.geodir-details-sidebar-social-sharing iframe{float:left}.geodir-details-sidebar-rating{overflow:hidden}.geodir-details-sidebar-rating .gd_rating_show,.geodir-details-sidebar-rating .geodir-rating{float:left;margin-right:15px}.geodir-details-sidebar-rating span.item{float:left;margin-top:5px}.geodir-details-sidebar-rating .average-review{top:-4px;position:relative}.geodir-details-sidebar-rating span.item img{margin-top:5px}.geodir_full_page{background:#fff;border:1px solid #e1e1e1;-webkit-box-shadow:0 1px 0 #e5e5e5;box-shadow:0 1px 0 #e5e5e5;padding:15px;margin-bottom:20px;clear:both}.geodir_map_container .main_list img{margin:0 5px}.geodir_category_list_view li.geodir-gridview .geodir-post-img .geodir_thumbnail{margin-bottom:10px}.geodir-addinfo .geodir-pinpoint,.geodir-addinfo a i{margin-right:5px}.geodir_category_list_view li.geodir-gridview h3{font-size:18px;margin-bottom:10px}#related_listingTab ul.geodir_category_list_view{padding:0!important}#reviewsTab #comments .gd_rating{margin-top:5px}.widget .geodir_category_list_view li .geodir-entry-content,.widget .geodir_category_list_view li a:before{display:none!important}.geodir_category_list_view li .geodir-entry-title{margin-bottom:10px}.widget ul.geodir_category_list_view{padding:15px}.sidebar .widget .geodir_category_list_view li{width:calc(100% - 25px)}.widget .geodir-loginbox-list li{overflow:visible!important}.widget ul.chosen-results{margin:0!important}.main_list_selecter{margin-right:5px}.geodir-viewall{float:right;width:auto!important}.widget-title h2{padding:0 15px;background:#e9e9e9;border:1px solid #dbdbdb;height:38px;line-height:38px}.widget:first-child .geodir_list_heading .widget-title{margin-top:0}.geodir_list_heading .widget-title{float:left;width:80%;margin-top:0}.geodir_list_heading .widget-title h2{padding:0 px;background:0 0;border:none;height:auto;line-height:auto}.chosen-default:before{content:none;display:none;position:absolute;margin-left:-1000000px;float:left}#geodir-wrapper .entry-crumbs{margin-bottom:20px}.geodir-search .mom-select{float:left;width:150px;margin:5px;border:1px solid #ddd;height:40px}.iprelative .gm-style .gm-style-iw{width:100%!important}'), |
|
697 | + 'geodir_theme_compat_js' => 'jQuery(document).ready(function(e){e(".geodir_full_page").length&&""===e.trim(e(".geodir_full_page").html())&&e(".geodir_full_page").css({display:"none"})});', |
|
698 | + 'geodir_theme_compat_default_options' => '', |
|
699 | + 'geodir_theme_compat_code' => 'Multi_News' |
|
700 | + ); |
|
701 | + |
|
702 | + update_option('gd_theme_compats', $theme_compat); |
|
703 | + |
|
704 | + gd_set_theme_compat();// set the compat pack if avail |
|
705 | 705 | } |
706 | 706 | |
707 | 707 | |
@@ -713,61 +713,61 @@ discard block |
||
713 | 713 | * @global object $wpdb WordPress Database object. |
714 | 714 | */ |
715 | 715 | function gd_convert_virtual_pages(){ |
716 | - global $wpdb; |
|
717 | - |
|
718 | - // Update the add listing page settings |
|
719 | - $add_listing_page = $wpdb->get_var( |
|
720 | - $wpdb->prepare( |
|
721 | - "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
722 | - array('add-listing') |
|
723 | - ) |
|
724 | - ); |
|
725 | - |
|
726 | - if($add_listing_page){ |
|
727 | - wp_update_post( array('ID' => $add_listing_page, 'post_status' => 'publish') ); |
|
728 | - update_option( 'geodir_add_listing_page', $add_listing_page); |
|
729 | - } |
|
730 | - |
|
731 | - // Update the listing preview page settings |
|
732 | - $listing_preview_page = $wpdb->get_var( |
|
733 | - $wpdb->prepare( |
|
734 | - "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
735 | - array('listing-preview') |
|
736 | - ) |
|
737 | - ); |
|
738 | - |
|
739 | - if($listing_preview_page){ |
|
740 | - wp_update_post( array('ID' => $listing_preview_page, 'post_status' => 'publish') ); |
|
741 | - update_option( 'geodir_preview_page', $listing_preview_page); |
|
742 | - } |
|
743 | - |
|
744 | - // Update the listing success page settings |
|
745 | - $listing_success_page = $wpdb->get_var( |
|
746 | - $wpdb->prepare( |
|
747 | - "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
748 | - array('listing-success') |
|
749 | - ) |
|
750 | - ); |
|
751 | - |
|
752 | - if($listing_success_page){ |
|
753 | - wp_update_post( array('ID' => $listing_success_page, 'post_status' => 'publish') ); |
|
754 | - update_option( 'geodir_success_page', $listing_success_page); |
|
755 | - } |
|
756 | - |
|
757 | - // Update the listing success page settings |
|
758 | - $location_page = $wpdb->get_var( |
|
759 | - $wpdb->prepare( |
|
760 | - "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
761 | - array('location') |
|
762 | - ) |
|
763 | - ); |
|
764 | - |
|
765 | - if($location_page){ |
|
766 | - $location_slug = get_option('geodir_location_prefix'); |
|
767 | - if(!$location_slug ){$location_slug = 'location';} |
|
768 | - wp_update_post( array('ID' => $location_page, 'post_status' => 'publish','post_name' => $location_slug) ); |
|
769 | - update_option( 'geodir_location_page', $location_page); |
|
770 | - } |
|
716 | + global $wpdb; |
|
717 | + |
|
718 | + // Update the add listing page settings |
|
719 | + $add_listing_page = $wpdb->get_var( |
|
720 | + $wpdb->prepare( |
|
721 | + "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
722 | + array('add-listing') |
|
723 | + ) |
|
724 | + ); |
|
725 | + |
|
726 | + if($add_listing_page){ |
|
727 | + wp_update_post( array('ID' => $add_listing_page, 'post_status' => 'publish') ); |
|
728 | + update_option( 'geodir_add_listing_page', $add_listing_page); |
|
729 | + } |
|
730 | + |
|
731 | + // Update the listing preview page settings |
|
732 | + $listing_preview_page = $wpdb->get_var( |
|
733 | + $wpdb->prepare( |
|
734 | + "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
735 | + array('listing-preview') |
|
736 | + ) |
|
737 | + ); |
|
738 | + |
|
739 | + if($listing_preview_page){ |
|
740 | + wp_update_post( array('ID' => $listing_preview_page, 'post_status' => 'publish') ); |
|
741 | + update_option( 'geodir_preview_page', $listing_preview_page); |
|
742 | + } |
|
743 | + |
|
744 | + // Update the listing success page settings |
|
745 | + $listing_success_page = $wpdb->get_var( |
|
746 | + $wpdb->prepare( |
|
747 | + "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
748 | + array('listing-success') |
|
749 | + ) |
|
750 | + ); |
|
751 | + |
|
752 | + if($listing_success_page){ |
|
753 | + wp_update_post( array('ID' => $listing_success_page, 'post_status' => 'publish') ); |
|
754 | + update_option( 'geodir_success_page', $listing_success_page); |
|
755 | + } |
|
756 | + |
|
757 | + // Update the listing success page settings |
|
758 | + $location_page = $wpdb->get_var( |
|
759 | + $wpdb->prepare( |
|
760 | + "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
761 | + array('location') |
|
762 | + ) |
|
763 | + ); |
|
764 | + |
|
765 | + if($location_page){ |
|
766 | + $location_slug = get_option('geodir_location_prefix'); |
|
767 | + if(!$location_slug ){$location_slug = 'location';} |
|
768 | + wp_update_post( array('ID' => $location_page, 'post_status' => 'publish','post_name' => $location_slug) ); |
|
769 | + update_option( 'geodir_location_page', $location_page); |
|
770 | + } |
|
771 | 771 | |
772 | 772 | } |
773 | 773 | |
@@ -781,31 +781,31 @@ discard block |
||
781 | 781 | function gd_fix_cpt_rewrite_slug() |
782 | 782 | { |
783 | 783 | |
784 | - $alt_post_types = array(); |
|
785 | - $post_types = get_option('geodir_post_types'); |
|
784 | + $alt_post_types = array(); |
|
785 | + $post_types = get_option('geodir_post_types'); |
|
786 | 786 | |
787 | 787 | |
788 | - if (is_array($post_types)){ |
|
788 | + if (is_array($post_types)){ |
|
789 | 789 | |
790 | - foreach ($post_types as $post_type => $args) { |
|
790 | + foreach ($post_types as $post_type => $args) { |
|
791 | 791 | |
792 | 792 | |
793 | - if(isset($args['rewrite']['slug'])){ |
|
794 | - $args['rewrite']['slug'] = str_replace("/%gd_taxonomy%","",$args['rewrite']['slug']); |
|
795 | - } |
|
793 | + if(isset($args['rewrite']['slug'])){ |
|
794 | + $args['rewrite']['slug'] = str_replace("/%gd_taxonomy%","",$args['rewrite']['slug']); |
|
795 | + } |
|
796 | 796 | |
797 | - $alt_post_types[$post_type] = $args; |
|
797 | + $alt_post_types[$post_type] = $args; |
|
798 | 798 | |
799 | - } |
|
800 | - } |
|
799 | + } |
|
800 | + } |
|
801 | 801 | |
802 | - if(!empty($alt_post_types)) { |
|
803 | - update_option('geodir_post_types',$alt_post_types); |
|
804 | - } |
|
802 | + if(!empty($alt_post_types)) { |
|
803 | + update_option('geodir_post_types',$alt_post_types); |
|
804 | + } |
|
805 | 805 | |
806 | 806 | |
807 | - // flush the rewrite rules |
|
808 | - flush_rewrite_rules(); |
|
807 | + // flush the rewrite rules |
|
808 | + flush_rewrite_rules(); |
|
809 | 809 | } |
810 | 810 | |
811 | 811 | |
@@ -818,18 +818,18 @@ discard block |
||
818 | 818 | */ |
819 | 819 | function gd_fix_address_detail_table_limit() |
820 | 820 | { |
821 | - global $wpdb; |
|
822 | - |
|
823 | - $all_postypes = geodir_get_posttypes(); |
|
824 | - |
|
825 | - if (!empty($all_postypes)) { |
|
826 | - foreach ($all_postypes as $key) { |
|
827 | - // update each GD CTP |
|
828 | - try { |
|
829 | - $wpdb->query("ALTER TABLE " . $wpdb->prefix . "geodir_" . $key . "_detail MODIFY post_city VARCHAR( 50 ) NULL,MODIFY post_region VARCHAR( 50 ) NULL,MODIFY post_country VARCHAR( 50 ) NULL"); |
|
830 | - } catch(Exception $e) { |
|
831 | - error_log( 'Error: ' . $e->getMessage() ); |
|
832 | - } |
|
833 | - } |
|
834 | - } |
|
821 | + global $wpdb; |
|
822 | + |
|
823 | + $all_postypes = geodir_get_posttypes(); |
|
824 | + |
|
825 | + if (!empty($all_postypes)) { |
|
826 | + foreach ($all_postypes as $key) { |
|
827 | + // update each GD CTP |
|
828 | + try { |
|
829 | + $wpdb->query("ALTER TABLE " . $wpdb->prefix . "geodir_" . $key . "_detail MODIFY post_city VARCHAR( 50 ) NULL,MODIFY post_region VARCHAR( 50 ) NULL,MODIFY post_country VARCHAR( 50 ) NULL"); |
|
830 | + } catch(Exception $e) { |
|
831 | + error_log( 'Error: ' . $e->getMessage() ); |
|
832 | + } |
|
833 | + } |
|
834 | + } |
|
835 | 835 | } |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | |
10 | 10 | global $wpdb; |
11 | 11 | |
12 | -if (get_option('geodirectory' . '_db_version') != GEODIRECTORY_VERSION) { |
|
12 | +if (get_option('geodirectory'.'_db_version') != GEODIRECTORY_VERSION) { |
|
13 | 13 | /** |
14 | 14 | * Include custom database table related functions. |
15 | 15 | * |
@@ -48,9 +48,9 @@ discard block |
||
48 | 48 | |
49 | 49 | |
50 | 50 | |
51 | - add_action('init', 'gd_fix_cpt_rewrite_slug', 11);// this needs to be kept for a few versions |
|
51 | + add_action('init', 'gd_fix_cpt_rewrite_slug', 11); // this needs to be kept for a few versions |
|
52 | 52 | |
53 | - update_option('geodirectory' . '_db_version', GEODIRECTORY_VERSION); |
|
53 | + update_option('geodirectory'.'_db_version', GEODIRECTORY_VERSION); |
|
54 | 54 | |
55 | 55 | } |
56 | 56 | |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | * @since 1.0.0 |
87 | 87 | * @package GeoDirectory |
88 | 88 | */ |
89 | -function geodir_upgrade_146(){ |
|
89 | +function geodir_upgrade_146() { |
|
90 | 90 | gd_convert_virtual_pages(); |
91 | 91 | } |
92 | 92 | |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | * @since 1.5.0 |
97 | 97 | * @package GeoDirectory |
98 | 98 | */ |
99 | -function geodir_upgrade_150(){ |
|
99 | +function geodir_upgrade_150() { |
|
100 | 100 | gd_fix_cpt_rewrite_slug(); |
101 | 101 | } |
102 | 102 | |
@@ -108,12 +108,12 @@ discard block |
||
108 | 108 | * @since 1.4.8 |
109 | 109 | * @package GeoDirectory |
110 | 110 | */ |
111 | -function geodir_upgrade_148(){ |
|
111 | +function geodir_upgrade_148() { |
|
112 | 112 | /* |
113 | 113 | * Blank the users google password if present as we now use oAuth 2.0 |
114 | 114 | */ |
115 | - update_option('geodir_ga_pass',''); |
|
116 | - update_option('geodir_ga_user',''); |
|
115 | + update_option('geodir_ga_pass', ''); |
|
116 | + update_option('geodir_ga_user', ''); |
|
117 | 117 | |
118 | 118 | } |
119 | 119 | |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | * @since 1.5.3 |
125 | 125 | * @package GeoDirectory |
126 | 126 | */ |
127 | -function geodir_upgrade_153(){ |
|
127 | +function geodir_upgrade_153() { |
|
128 | 128 | geodir_create_page(esc_sql(_x('gd-info', 'page_slug', 'geodirectory')), 'geodir_info_page', __('Info', 'geodirectory'), ''); |
129 | 129 | geodir_create_page(esc_sql(_x('gd-login', 'page_slug', 'geodirectory')), 'geodir_login_page', __('Login', 'geodirectory'), ''); |
130 | 130 | } |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | * @since 1.5.3 |
136 | 136 | * @package GeoDirectory |
137 | 137 | */ |
138 | -function geodir_upgrade_154(){ |
|
138 | +function geodir_upgrade_154() { |
|
139 | 139 | geodir_create_page(esc_sql(_x('gd-home', 'page_slug', 'geodirectory')), 'geodir_home_page', __('GD Home page', 'geodirectory'), ''); |
140 | 140 | } |
141 | 141 | |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | * @since 1.5.2 |
146 | 146 | * @package GeoDirectory |
147 | 147 | */ |
148 | -function geodir_upgrade_152(){ |
|
148 | +function geodir_upgrade_152() { |
|
149 | 149 | gd_fix_address_detail_table_limit(); |
150 | 150 | } |
151 | 151 | |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | function geodir_fix_review_date() |
182 | 182 | { |
183 | 183 | global $wpdb; |
184 | - $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.post_date = c.comment_date WHERE gdr.post_date='0000-00-00 00:00:00'"); |
|
184 | + $wpdb->query("UPDATE ".GEODIR_REVIEW_TABLE." gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.post_date = c.comment_date WHERE gdr.post_date='0000-00-00 00:00:00'"); |
|
185 | 185 | } |
186 | 186 | |
187 | 187 | /** |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | function geodir_fix_review_post_status() |
195 | 195 | { |
196 | 196 | global $wpdb; |
197 | - $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->posts p ON gdr.post_id=p.ID SET gdr.post_status = 1 WHERE gdr.post_status IS NULL AND p.post_status='publish'"); |
|
197 | + $wpdb->query("UPDATE ".GEODIR_REVIEW_TABLE." gdr JOIN $wpdb->posts p ON gdr.post_id=p.ID SET gdr.post_status = 1 WHERE gdr.post_status IS NULL AND p.post_status='publish'"); |
|
198 | 198 | } |
199 | 199 | |
200 | 200 | /** |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | function geodir_fix_review_content() |
209 | 209 | { |
210 | 210 | global $wpdb; |
211 | - if ($wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.comment_content = c.comment_content WHERE gdr.comment_content IS NULL")) { |
|
211 | + if ($wpdb->query("UPDATE ".GEODIR_REVIEW_TABLE." gdr JOIN $wpdb->comments c ON gdr.comment_id=c.comment_ID SET gdr.comment_content = c.comment_content WHERE gdr.comment_content IS NULL")) { |
|
212 | 212 | return true; |
213 | 213 | } else { |
214 | 214 | return false; |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | foreach ($all_postypes as $key) { |
234 | 234 | // update each GD CTP |
235 | 235 | |
236 | - $wpdb->query("UPDATE " . GEODIR_REVIEW_TABLE . " gdr JOIN " . $wpdb->prefix . "geodir_" . $key . "_detail d ON gdr.post_id=d.post_id SET gdr.post_latitude = d.post_latitude, gdr.post_longitude = d.post_longitude, gdr.post_city = d.post_city, gdr.post_region=d.post_region, gdr.post_country=d.post_country WHERE gdr.post_latitude IS NULL OR gdr.post_city IS NULL"); |
|
236 | + $wpdb->query("UPDATE ".GEODIR_REVIEW_TABLE." gdr JOIN ".$wpdb->prefix."geodir_".$key."_detail d ON gdr.post_id=d.post_id SET gdr.post_latitude = d.post_latitude, gdr.post_longitude = d.post_longitude, gdr.post_city = d.post_city, gdr.post_region=d.post_region, gdr.post_country=d.post_country WHERE gdr.post_latitude IS NULL OR gdr.post_city IS NULL"); |
|
237 | 237 | |
238 | 238 | } |
239 | 239 | return true; |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | if (!empty($all_postypes)) { |
258 | 258 | foreach ($all_postypes as $key) { |
259 | 259 | // update each GD CTP |
260 | - $reviews = $wpdb->get_results("SELECT post_id FROM " . $wpdb->prefix . "geodir_" . $key . "_detail d"); |
|
260 | + $reviews = $wpdb->get_results("SELECT post_id FROM ".$wpdb->prefix."geodir_".$key."_detail d"); |
|
261 | 261 | |
262 | 262 | if (!empty($reviews)) { |
263 | 263 | foreach ($reviews as $post_id) { |
@@ -272,51 +272,51 @@ discard block |
||
272 | 272 | } |
273 | 273 | |
274 | 274 | |
275 | -function gd_convert_custom_field_display(){ |
|
275 | +function gd_convert_custom_field_display() { |
|
276 | 276 | global $wpdb; |
277 | 277 | |
278 | - $field_info = $wpdb->get_results("select * from " . GEODIR_CUSTOM_FIELDS_TABLE); |
|
278 | + $field_info = $wpdb->get_results("select * from ".GEODIR_CUSTOM_FIELDS_TABLE); |
|
279 | 279 | |
280 | 280 | $has_run = get_option('gd_convert_custom_field_display'); |
281 | - if($has_run){return;} |
|
281 | + if ($has_run) {return; } |
|
282 | 282 | |
283 | 283 | // set the field_type_key for standard fields |
284 | 284 | $wpdb->query("UPDATE ".GEODIR_CUSTOM_FIELDS_TABLE." SET field_type_key = field_type"); |
285 | 285 | |
286 | 286 | |
287 | - if(is_array( $field_info)){ |
|
287 | + if (is_array($field_info)) { |
|
288 | 288 | |
289 | - foreach( $field_info as $cf){ |
|
289 | + foreach ($field_info as $cf) { |
|
290 | 290 | |
291 | 291 | $id = $cf->id; |
292 | 292 | |
293 | - if(!property_exists($cf,'show_in') || !$id){return;} |
|
293 | + if (!property_exists($cf, 'show_in') || !$id) {return; } |
|
294 | 294 | |
295 | 295 | $show_in_arr = array(); |
296 | 296 | |
297 | - if($cf->is_default){ |
|
297 | + if ($cf->is_default) { |
|
298 | 298 | $show_in_arr[] = "[detail]"; |
299 | 299 | } |
300 | 300 | |
301 | - if($cf->show_on_detail){ |
|
301 | + if ($cf->show_on_detail) { |
|
302 | 302 | $show_in_arr[] = "[moreinfo]"; |
303 | 303 | } |
304 | 304 | |
305 | - if($cf->show_on_listing){ |
|
305 | + if ($cf->show_on_listing) { |
|
306 | 306 | $show_in_arr[] = "[listing]"; |
307 | 307 | } |
308 | 308 | |
309 | - if($cf->show_as_tab || $cf->htmlvar_name=='geodir_video' || $cf->htmlvar_name=='geodir_special_offers'){ |
|
309 | + if ($cf->show_as_tab || $cf->htmlvar_name == 'geodir_video' || $cf->htmlvar_name == 'geodir_special_offers') { |
|
310 | 310 | $show_in_arr[] = "[owntab]"; |
311 | 311 | } |
312 | 312 | |
313 | - if($cf->htmlvar_name=='post' || $cf->htmlvar_name=='geodir_contact' || $cf->htmlvar_name=='geodir_timing'){ |
|
313 | + if ($cf->htmlvar_name == 'post' || $cf->htmlvar_name == 'geodir_contact' || $cf->htmlvar_name == 'geodir_timing') { |
|
314 | 314 | $show_in_arr[] = "[mapbubble]"; |
315 | 315 | } |
316 | 316 | |
317 | - if(!empty($show_in_arr )){ |
|
318 | - $show_in_arr = implode(',',$show_in_arr); |
|
319 | - }else{ |
|
317 | + if (!empty($show_in_arr)) { |
|
318 | + $show_in_arr = implode(',', $show_in_arr); |
|
319 | + } else { |
|
320 | 320 | $show_in_arr = ''; |
321 | 321 | } |
322 | 322 | |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | |
325 | 325 | } |
326 | 326 | |
327 | - update_option('gd_convert_custom_field_display',1); |
|
327 | + update_option('gd_convert_custom_field_display', 1); |
|
328 | 328 | } |
329 | 329 | } |
330 | 330 | |
@@ -701,7 +701,7 @@ discard block |
||
701 | 701 | |
702 | 702 | update_option('gd_theme_compats', $theme_compat); |
703 | 703 | |
704 | - gd_set_theme_compat();// set the compat pack if avail |
|
704 | + gd_set_theme_compat(); // set the compat pack if avail |
|
705 | 705 | } |
706 | 706 | |
707 | 707 | |
@@ -712,61 +712,61 @@ discard block |
||
712 | 712 | * @package GeoDirectory |
713 | 713 | * @global object $wpdb WordPress Database object. |
714 | 714 | */ |
715 | -function gd_convert_virtual_pages(){ |
|
715 | +function gd_convert_virtual_pages() { |
|
716 | 716 | global $wpdb; |
717 | 717 | |
718 | 718 | // Update the add listing page settings |
719 | 719 | $add_listing_page = $wpdb->get_var( |
720 | 720 | $wpdb->prepare( |
721 | - "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
721 | + "SELECT ID FROM ".$wpdb->posts." WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
722 | 722 | array('add-listing') |
723 | 723 | ) |
724 | 724 | ); |
725 | 725 | |
726 | - if($add_listing_page){ |
|
727 | - wp_update_post( array('ID' => $add_listing_page, 'post_status' => 'publish') ); |
|
728 | - update_option( 'geodir_add_listing_page', $add_listing_page); |
|
726 | + if ($add_listing_page) { |
|
727 | + wp_update_post(array('ID' => $add_listing_page, 'post_status' => 'publish')); |
|
728 | + update_option('geodir_add_listing_page', $add_listing_page); |
|
729 | 729 | } |
730 | 730 | |
731 | 731 | // Update the listing preview page settings |
732 | 732 | $listing_preview_page = $wpdb->get_var( |
733 | 733 | $wpdb->prepare( |
734 | - "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
734 | + "SELECT ID FROM ".$wpdb->posts." WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
735 | 735 | array('listing-preview') |
736 | 736 | ) |
737 | 737 | ); |
738 | 738 | |
739 | - if($listing_preview_page){ |
|
740 | - wp_update_post( array('ID' => $listing_preview_page, 'post_status' => 'publish') ); |
|
741 | - update_option( 'geodir_preview_page', $listing_preview_page); |
|
739 | + if ($listing_preview_page) { |
|
740 | + wp_update_post(array('ID' => $listing_preview_page, 'post_status' => 'publish')); |
|
741 | + update_option('geodir_preview_page', $listing_preview_page); |
|
742 | 742 | } |
743 | 743 | |
744 | 744 | // Update the listing success page settings |
745 | 745 | $listing_success_page = $wpdb->get_var( |
746 | 746 | $wpdb->prepare( |
747 | - "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
747 | + "SELECT ID FROM ".$wpdb->posts." WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
748 | 748 | array('listing-success') |
749 | 749 | ) |
750 | 750 | ); |
751 | 751 | |
752 | - if($listing_success_page){ |
|
753 | - wp_update_post( array('ID' => $listing_success_page, 'post_status' => 'publish') ); |
|
754 | - update_option( 'geodir_success_page', $listing_success_page); |
|
752 | + if ($listing_success_page) { |
|
753 | + wp_update_post(array('ID' => $listing_success_page, 'post_status' => 'publish')); |
|
754 | + update_option('geodir_success_page', $listing_success_page); |
|
755 | 755 | } |
756 | 756 | |
757 | 757 | // Update the listing success page settings |
758 | 758 | $location_page = $wpdb->get_var( |
759 | 759 | $wpdb->prepare( |
760 | - "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
760 | + "SELECT ID FROM ".$wpdb->posts." WHERE post_name = %s AND post_status='virtual' LIMIT 1;", |
|
761 | 761 | array('location') |
762 | 762 | ) |
763 | 763 | ); |
764 | 764 | |
765 | - if($location_page){ |
|
765 | + if ($location_page) { |
|
766 | 766 | $location_slug = get_option('geodir_location_prefix'); |
767 | - if(!$location_slug ){$location_slug = 'location';} |
|
768 | - wp_update_post( array('ID' => $location_page, 'post_status' => 'publish','post_name' => $location_slug) ); |
|
769 | - update_option( 'geodir_location_page', $location_page); |
|
767 | + if (!$location_slug) {$location_slug = 'location'; } |
|
768 | + wp_update_post(array('ID' => $location_page, 'post_status' => 'publish', 'post_name' => $location_slug)); |
|
769 | + update_option('geodir_location_page', $location_page); |
|
770 | 770 | } |
771 | 771 | |
772 | 772 | } |
@@ -785,13 +785,13 @@ discard block |
||
785 | 785 | $post_types = get_option('geodir_post_types'); |
786 | 786 | |
787 | 787 | |
788 | - if (is_array($post_types)){ |
|
788 | + if (is_array($post_types)) { |
|
789 | 789 | |
790 | 790 | foreach ($post_types as $post_type => $args) { |
791 | 791 | |
792 | 792 | |
793 | - if(isset($args['rewrite']['slug'])){ |
|
794 | - $args['rewrite']['slug'] = str_replace("/%gd_taxonomy%","",$args['rewrite']['slug']); |
|
793 | + if (isset($args['rewrite']['slug'])) { |
|
794 | + $args['rewrite']['slug'] = str_replace("/%gd_taxonomy%", "", $args['rewrite']['slug']); |
|
795 | 795 | } |
796 | 796 | |
797 | 797 | $alt_post_types[$post_type] = $args; |
@@ -799,8 +799,8 @@ discard block |
||
799 | 799 | } |
800 | 800 | } |
801 | 801 | |
802 | - if(!empty($alt_post_types)) { |
|
803 | - update_option('geodir_post_types',$alt_post_types); |
|
802 | + if (!empty($alt_post_types)) { |
|
803 | + update_option('geodir_post_types', $alt_post_types); |
|
804 | 804 | } |
805 | 805 | |
806 | 806 | |
@@ -826,9 +826,9 @@ discard block |
||
826 | 826 | foreach ($all_postypes as $key) { |
827 | 827 | // update each GD CTP |
828 | 828 | try { |
829 | - $wpdb->query("ALTER TABLE " . $wpdb->prefix . "geodir_" . $key . "_detail MODIFY post_city VARCHAR( 50 ) NULL,MODIFY post_region VARCHAR( 50 ) NULL,MODIFY post_country VARCHAR( 50 ) NULL"); |
|
830 | - } catch(Exception $e) { |
|
831 | - error_log( 'Error: ' . $e->getMessage() ); |
|
829 | + $wpdb->query("ALTER TABLE ".$wpdb->prefix."geodir_".$key."_detail MODIFY post_city VARCHAR( 50 ) NULL,MODIFY post_region VARCHAR( 50 ) NULL,MODIFY post_country VARCHAR( 50 ) NULL"); |
|
830 | + } catch (Exception $e) { |
|
831 | + error_log('Error: '.$e->getMessage()); |
|
832 | 832 | } |
833 | 833 | } |
834 | 834 | } |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | |
28 | 28 | $field_info = stripslashes_deep($field_info); // strip slashes from labels |
29 | 29 | |
30 | -$nonce = wp_create_nonce('custom_fields_' . $result_str); |
|
30 | +$nonce = wp_create_nonce('custom_fields_'.$result_str); |
|
31 | 31 | |
32 | 32 | $field_admin_title = ''; |
33 | 33 | if (isset($field_info->admin_title)) |
@@ -52,9 +52,9 @@ discard block |
||
52 | 52 | |
53 | 53 | if (isset($cf['icon']) && strpos($cf['icon'], 'fa fa-') !== false) { |
54 | 54 | $field_icon = '<i class="'.$cf['icon'].'" aria-hidden="true"></i>'; |
55 | -}elseif(isset($cf['icon']) && $cf['icon']){ |
|
55 | +}elseif (isset($cf['icon']) && $cf['icon']) { |
|
56 | 56 | $field_icon = '<b style="background-image: url("'.$cf['icon'].'")"></b>'; |
57 | -}else{ |
|
57 | +} else { |
|
58 | 58 | $field_icon = '<i class="fa fa-cog" aria-hidden="true"></i>'; |
59 | 59 | } |
60 | 60 | |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | ondblclick="show_hide('field_frm<?php echo $result_str; ?>')"> |
66 | 66 | <?php |
67 | 67 | |
68 | - $nonce = wp_create_nonce('custom_fields_' . $result_str); |
|
68 | + $nonce = wp_create_nonce('custom_fields_'.$result_str); |
|
69 | 69 | ?> |
70 | 70 | |
71 | 71 | <?php if ($default): ?> |
@@ -80,12 +80,12 @@ discard block |
||
80 | 80 | <i class="fa fa-long-arrow-left " aria-hidden="true"></i> |
81 | 81 | <i class="fa fa-long-arrow-right " aria-hidden="true"></i> |
82 | 82 | <b style="cursor:pointer;" |
83 | - onclick="show_hide('field_frm<?php echo $result_str;?>')"><?php echo geodir_ucwords(__('Fieldset:', 'geodirectory') . ' ' . $field_admin_title);?></b> |
|
83 | + onclick="show_hide('field_frm<?php echo $result_str; ?>')"><?php echo geodir_ucwords(__('Fieldset:', 'geodirectory').' '.$field_admin_title); ?></b> |
|
84 | 84 | <?php |
85 | 85 | } else {echo $field_icon; |
86 | 86 | ?> |
87 | 87 | <b style="cursor:pointer;" |
88 | - onclick="show_hide('field_frm<?php echo $result_str;?>')"><?php echo geodir_ucwords(' ' . $field_admin_title . ' (' . $field_type . ')');?></b> |
|
88 | + onclick="show_hide('field_frm<?php echo $result_str; ?>')"><?php echo geodir_ucwords(' '.$field_admin_title.' ('.$field_type.')'); ?></b> |
|
89 | 89 | <?php |
90 | 90 | } |
91 | 91 | ?> |
@@ -108,43 +108,43 @@ discard block |
||
108 | 108 | } ?>"/> |
109 | 109 | <input type="hidden" name="is_active" id="is_active" value="1"/> |
110 | 110 | |
111 | - <input type="hidden" name="is_default" value="<?php echo isset($field_info->is_default) ? $field_info->is_default : '';?>" /><?php // show in sidebar value?> |
|
112 | - <input type="hidden" name="show_on_listing" value="<?php echo isset($field_info->show_on_listing) ? $field_info->show_on_listing : '';?>" /> |
|
113 | - <input type="hidden" name="show_on_detail" value="<?php echo isset($field_info->show_on_listing) ? $field_info->show_on_listing : '';?>" /> |
|
114 | - <input type="hidden" name="show_as_tab" value="<?php echo isset($field_info->show_as_tab) ? $field_info->show_as_tab : '';?>" /> |
|
111 | + <input type="hidden" name="is_default" value="<?php echo isset($field_info->is_default) ? $field_info->is_default : ''; ?>" /><?php // show in sidebar value?> |
|
112 | + <input type="hidden" name="show_on_listing" value="<?php echo isset($field_info->show_on_listing) ? $field_info->show_on_listing : ''; ?>" /> |
|
113 | + <input type="hidden" name="show_on_detail" value="<?php echo isset($field_info->show_on_listing) ? $field_info->show_on_listing : ''; ?>" /> |
|
114 | + <input type="hidden" name="show_as_tab" value="<?php echo isset($field_info->show_as_tab) ? $field_info->show_as_tab : ''; ?>" /> |
|
115 | 115 | |
116 | 116 | <ul class="widefat post fixed" border="0" style="width:100%;"> |
117 | 117 | |
118 | 118 | <?php |
119 | 119 | |
120 | 120 | // data_type |
121 | - if(has_filter("geodir_cfa_data_type_{$field_type}")){ |
|
121 | + if (has_filter("geodir_cfa_data_type_{$field_type}")) { |
|
122 | 122 | |
123 | - echo apply_filters("geodir_cfa_data_type_{$field_type}",'',$result_str,$cf,$field_info); |
|
123 | + echo apply_filters("geodir_cfa_data_type_{$field_type}", '', $result_str, $cf, $field_info); |
|
124 | 124 | |
125 | - }else{ |
|
125 | + } else { |
|
126 | 126 | $value = ''; |
127 | 127 | if (isset($field_info->data_type)) { |
128 | 128 | $value = esc_attr($field_info->data_type); |
129 | - }elseif(isset($cf['defaults']['data_type']) && $cf['defaults']['data_type']){ |
|
129 | + }elseif (isset($cf['defaults']['data_type']) && $cf['defaults']['data_type']) { |
|
130 | 130 | $value = $cf['defaults']['data_type']; |
131 | 131 | } |
132 | 132 | ?> |
133 | - <input type="hidden" name="data_type" id="data_type" value="<?php echo $value;?>"/> |
|
133 | + <input type="hidden" name="data_type" id="data_type" value="<?php echo $value; ?>"/> |
|
134 | 134 | <?php |
135 | 135 | } |
136 | 136 | |
137 | 137 | |
138 | 138 | // admin_title |
139 | - if(has_filter("geodir_cfa_admin_title_{$field_type}")){ |
|
139 | + if (has_filter("geodir_cfa_admin_title_{$field_type}")) { |
|
140 | 140 | |
141 | - echo apply_filters("geodir_cfa_admin_title_{$field_type}",'',$result_str,$cf,$field_info); |
|
141 | + echo apply_filters("geodir_cfa_admin_title_{$field_type}", '', $result_str, $cf, $field_info); |
|
142 | 142 | |
143 | - }else{ |
|
143 | + } else { |
|
144 | 144 | $value = ''; |
145 | 145 | if (isset($field_info->admin_title)) { |
146 | 146 | $value = esc_attr($field_info->admin_title); |
147 | - }elseif(isset($cf['defaults']['admin_title']) && $cf['defaults']['admin_title']){ |
|
147 | + }elseif (isset($cf['defaults']['admin_title']) && $cf['defaults']['admin_title']) { |
|
148 | 148 | $value = $cf['defaults']['admin_title']; |
149 | 149 | } |
150 | 150 | ?> |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | </label> |
158 | 158 | <div class="gd-cf-input-wrap"> |
159 | 159 | <input type="text" name="admin_title" id="admin_title" |
160 | - value="<?php echo $value;?>"/> |
|
160 | + value="<?php echo $value; ?>"/> |
|
161 | 161 | </div> |
162 | 162 | </li> |
163 | 163 | <?php |
@@ -165,15 +165,15 @@ discard block |
||
165 | 165 | |
166 | 166 | |
167 | 167 | // site_title |
168 | - if(has_filter("geodir_cfa_site_title_{$field_type}")){ |
|
168 | + if (has_filter("geodir_cfa_site_title_{$field_type}")) { |
|
169 | 169 | |
170 | - echo apply_filters("geodir_cfa_site_title_{$field_type}",'',$result_str,$cf,$field_info); |
|
170 | + echo apply_filters("geodir_cfa_site_title_{$field_type}", '', $result_str, $cf, $field_info); |
|
171 | 171 | |
172 | - }else{ |
|
172 | + } else { |
|
173 | 173 | $value = ''; |
174 | 174 | if (isset($field_info->site_title)) { |
175 | 175 | $value = esc_attr($field_info->site_title); |
176 | - }elseif(isset($cf['defaults']['site_title']) && $cf['defaults']['site_title']){ |
|
176 | + }elseif (isset($cf['defaults']['site_title']) && $cf['defaults']['site_title']) { |
|
177 | 177 | $value = $cf['defaults']['site_title']; |
178 | 178 | } |
179 | 179 | ?> |
@@ -193,15 +193,15 @@ discard block |
||
193 | 193 | |
194 | 194 | |
195 | 195 | // admin_desc |
196 | - if(has_filter("geodir_cfa_admin_desc_{$field_type}")){ |
|
196 | + if (has_filter("geodir_cfa_admin_desc_{$field_type}")) { |
|
197 | 197 | |
198 | - echo apply_filters("geodir_cfa_admin_desc_{$field_type}",'',$result_str,$cf,$field_info); |
|
198 | + echo apply_filters("geodir_cfa_admin_desc_{$field_type}", '', $result_str, $cf, $field_info); |
|
199 | 199 | |
200 | - }else{ |
|
200 | + } else { |
|
201 | 201 | $value = ''; |
202 | 202 | if (isset($field_info->admin_desc)) { |
203 | 203 | $value = esc_attr($field_info->admin_desc); |
204 | - }elseif(isset($cf['defaults']['admin_desc']) && $cf['defaults']['admin_desc']){ |
|
204 | + }elseif (isset($cf['defaults']['admin_desc']) && $cf['defaults']['admin_desc']) { |
|
205 | 205 | $value = $cf['defaults']['admin_desc']; |
206 | 206 | } |
207 | 207 | ?> |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | </div> |
213 | 213 | </label> |
214 | 214 | <div class="gd-cf-input-wrap"> |
215 | - <input type="text" name="admin_desc" id="admin_desc" value="<?php echo $value;?>"/> |
|
215 | + <input type="text" name="admin_desc" id="admin_desc" value="<?php echo $value; ?>"/> |
|
216 | 216 | </div> |
217 | 217 | </li> |
218 | 218 | <?php |
@@ -221,26 +221,26 @@ discard block |
||
221 | 221 | |
222 | 222 | |
223 | 223 | // htmlvar_name |
224 | - if(has_filter("geodir_cfa_htmlvar_name_{$field_type}")){ |
|
224 | + if (has_filter("geodir_cfa_htmlvar_name_{$field_type}")) { |
|
225 | 225 | |
226 | - echo apply_filters("geodir_cfa_htmlvar_name_{$field_type}",'',$result_str,$cf,$field_info); |
|
226 | + echo apply_filters("geodir_cfa_htmlvar_name_{$field_type}", '', $result_str, $cf, $field_info); |
|
227 | 227 | |
228 | - }else{ |
|
228 | + } else { |
|
229 | 229 | $value = ''; |
230 | 230 | if (isset($field_info->htmlvar_name)) { |
231 | 231 | $value = esc_attr($field_info->htmlvar_name); |
232 | - }elseif(isset($cf['defaults']['htmlvar_name']) && $cf['defaults']['htmlvar_name']){ |
|
232 | + }elseif (isset($cf['defaults']['htmlvar_name']) && $cf['defaults']['htmlvar_name']) { |
|
233 | 233 | $value = $cf['defaults']['htmlvar_name']; |
234 | 234 | } |
235 | 235 | ?> |
236 | 236 | <li> |
237 | - <label for="htmlvar_name" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('HTML variable name :', 'geodirectory');?> |
|
237 | + <label for="htmlvar_name" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('HTML variable name :', 'geodirectory'); ?> |
|
238 | 238 | <div class="gdcf-tooltip"> |
239 | 239 | <?php _e('This is a unique identifier used in the HTML, it MUST NOT contain spaces or special characters.', 'geodirectory'); ?> |
240 | 240 | </div> |
241 | 241 | </label> |
242 | 242 | <div class="gd-cf-input-wrap"> |
243 | - <input type="text" name="htmlvar_name" id="htmlvar_name" pattern="[a-zA-Z0-9]+" title="<?php _e('Must not contain spaces or special characters', 'geodirectory');?>" |
|
243 | + <input type="text" name="htmlvar_name" id="htmlvar_name" pattern="[a-zA-Z0-9]+" title="<?php _e('Must not contain spaces or special characters', 'geodirectory'); ?>" |
|
244 | 244 | value="<?php if ($value) { |
245 | 245 | echo preg_replace('/geodir_/', '', $value, 1); |
246 | 246 | }?>" <?php if ($default) { |
@@ -253,15 +253,15 @@ discard block |
||
253 | 253 | |
254 | 254 | |
255 | 255 | // is_active |
256 | - if(has_filter("geodir_cfa_is_active_{$field_type}")){ |
|
256 | + if (has_filter("geodir_cfa_is_active_{$field_type}")) { |
|
257 | 257 | |
258 | - echo apply_filters("geodir_cfa_is_active_{$field_type}",'',$result_str,$cf,$field_info); |
|
258 | + echo apply_filters("geodir_cfa_is_active_{$field_type}", '', $result_str, $cf, $field_info); |
|
259 | 259 | |
260 | - }else{ |
|
260 | + } else { |
|
261 | 261 | $value = ''; |
262 | 262 | if (isset($field_info->is_active)) { |
263 | 263 | $value = esc_attr($field_info->is_active); |
264 | - }elseif(isset($cf['defaults']['is_active']) && $cf['defaults']['is_active']){ |
|
264 | + }elseif (isset($cf['defaults']['is_active']) && $cf['defaults']['is_active']) { |
|
265 | 265 | $value = $cf['defaults']['is_active']; |
266 | 266 | } |
267 | 267 | ?> |
@@ -273,17 +273,17 @@ discard block |
||
273 | 273 | </label> |
274 | 274 | <div class="gd-cf-input-wrap gd-switch"> |
275 | 275 | |
276 | - <input type="radio" id="is_active_yes<?php echo $radio_id;?>" name="is_active" class="gdri-enabled" value="1" |
|
276 | + <input type="radio" id="is_active_yes<?php echo $radio_id; ?>" name="is_active" class="gdri-enabled" value="1" |
|
277 | 277 | <?php if ($value == '1') { |
278 | 278 | echo 'checked'; |
279 | 279 | } ?>/> |
280 | - <label for="is_active_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label> |
|
280 | + <label for="is_active_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label> |
|
281 | 281 | |
282 | - <input type="radio" id="is_active_no<?php echo $radio_id;?>" name="is_active" class="gdri-disabled" value="0" |
|
282 | + <input type="radio" id="is_active_no<?php echo $radio_id; ?>" name="is_active" class="gdri-disabled" value="0" |
|
283 | 283 | <?php if ($value == '0' || !$value) { |
284 | 284 | echo 'checked'; |
285 | 285 | } ?>/> |
286 | - <label for="is_active_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label> |
|
286 | + <label for="is_active_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label> |
|
287 | 287 | |
288 | 288 | </div> |
289 | 289 | </li> |
@@ -292,15 +292,15 @@ discard block |
||
292 | 292 | |
293 | 293 | |
294 | 294 | // for_admin_use |
295 | - if(has_filter("geodir_cfa_for_admin_use_{$field_type}")){ |
|
295 | + if (has_filter("geodir_cfa_for_admin_use_{$field_type}")) { |
|
296 | 296 | |
297 | - echo apply_filters("geodir_cfa_for_admin_use_{$field_type}",'',$result_str,$cf,$field_info); |
|
297 | + echo apply_filters("geodir_cfa_for_admin_use_{$field_type}", '', $result_str, $cf, $field_info); |
|
298 | 298 | |
299 | - }else{ |
|
299 | + } else { |
|
300 | 300 | $value = ''; |
301 | 301 | if (isset($field_info->for_admin_use)) { |
302 | 302 | $value = esc_attr($field_info->for_admin_use); |
303 | - }elseif(isset($cf['defaults']['for_admin_use']) && $cf['defaults']['for_admin_use']){ |
|
303 | + }elseif (isset($cf['defaults']['for_admin_use']) && $cf['defaults']['for_admin_use']) { |
|
304 | 304 | $value = $cf['defaults']['for_admin_use']; |
305 | 305 | } |
306 | 306 | ?> |
@@ -312,17 +312,17 @@ discard block |
||
312 | 312 | </label> |
313 | 313 | <div class="gd-cf-input-wrap gd-switch"> |
314 | 314 | |
315 | - <input type="radio" id="for_admin_use_yes<?php echo $radio_id;?>" name="for_admin_use" class="gdri-enabled" value="1" |
|
315 | + <input type="radio" id="for_admin_use_yes<?php echo $radio_id; ?>" name="for_admin_use" class="gdri-enabled" value="1" |
|
316 | 316 | <?php if ($value == '1') { |
317 | 317 | echo 'checked'; |
318 | 318 | } ?>/> |
319 | - <label for="for_admin_use_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label> |
|
319 | + <label for="for_admin_use_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label> |
|
320 | 320 | |
321 | - <input type="radio" id="for_admin_use_no<?php echo $radio_id;?>" name="for_admin_use" class="gdri-disabled" value="0" |
|
321 | + <input type="radio" id="for_admin_use_no<?php echo $radio_id; ?>" name="for_admin_use" class="gdri-disabled" value="0" |
|
322 | 322 | <?php if ($value == '0' || !$value) { |
323 | 323 | echo 'checked'; |
324 | 324 | } ?>/> |
325 | - <label for="for_admin_use_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label> |
|
325 | + <label for="for_admin_use_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label> |
|
326 | 326 | |
327 | 327 | </div> |
328 | 328 | </li> |
@@ -331,20 +331,20 @@ discard block |
||
331 | 331 | |
332 | 332 | |
333 | 333 | // default_value |
334 | - if(has_filter("geodir_cfa_default_value_{$field_type}")){ |
|
334 | + if (has_filter("geodir_cfa_default_value_{$field_type}")) { |
|
335 | 335 | |
336 | - echo apply_filters("geodir_cfa_default_value_{$field_type}",'',$result_str,$cf,$field_info); |
|
336 | + echo apply_filters("geodir_cfa_default_value_{$field_type}", '', $result_str, $cf, $field_info); |
|
337 | 337 | |
338 | - }else{ |
|
338 | + } else { |
|
339 | 339 | $value = ''; |
340 | 340 | if (isset($field_info->default_value)) { |
341 | 341 | $value = esc_attr($field_info->default_value); |
342 | - }elseif(isset($cf['defaults']['default_value']) && $cf['defaults']['default_value']){ |
|
342 | + }elseif (isset($cf['defaults']['default_value']) && $cf['defaults']['default_value']) { |
|
343 | 343 | $value = $cf['defaults']['default_value']; |
344 | 344 | } |
345 | 345 | ?> |
346 | 346 | <li> |
347 | - <label for="default_value" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Default value :', 'geodirectory');?> |
|
347 | + <label for="default_value" class="gd-cf-tooltip-wrap"><i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Default value :', 'geodirectory'); ?> |
|
348 | 348 | <div class="gdcf-tooltip"> |
349 | 349 | <?php |
350 | 350 | if ($field_type == 'checkbox') { |
@@ -361,12 +361,12 @@ discard block |
||
361 | 361 | <?php if ($field_type == 'checkbox') { ?> |
362 | 362 | <select name="default_value" id="default_value"> |
363 | 363 | <option value=""><?php _e('Unchecked', 'geodirectory'); ?></option> |
364 | - <option value="1" <?php selected(true, (int)$value === 1);?>><?php _e('Checked', 'geodirectory'); ?></option> |
|
364 | + <option value="1" <?php selected(true, (int) $value === 1); ?>><?php _e('Checked', 'geodirectory'); ?></option> |
|
365 | 365 | </select> |
366 | 366 | <?php } else if ($field_type == 'email') { ?> |
367 | - <input type="email" name="default_value" placeholder="<?php _e('[email protected]', 'geodirectory') ;?>" id="default_value" value="<?php echo esc_attr($value);?>" /><br/> |
|
367 | + <input type="email" name="default_value" placeholder="<?php _e('[email protected]', 'geodirectory'); ?>" id="default_value" value="<?php echo esc_attr($value); ?>" /><br/> |
|
368 | 368 | <?php } else { ?> |
369 | - <input type="text" name="default_value" id="default_value" value="<?php echo esc_attr($value);?>" /><br/> |
|
369 | + <input type="text" name="default_value" id="default_value" value="<?php echo esc_attr($value); ?>" /><br/> |
|
370 | 370 | <?php } ?> |
371 | 371 | </div> |
372 | 372 | </li> |
@@ -375,15 +375,15 @@ discard block |
||
375 | 375 | |
376 | 376 | |
377 | 377 | // show_in |
378 | - if(has_filter("geodir_cfa_show_in_{$field_type}")){ |
|
378 | + if (has_filter("geodir_cfa_show_in_{$field_type}")) { |
|
379 | 379 | |
380 | - echo apply_filters("geodir_cfa_show_in_{$field_type}",'',$result_str,$cf,$field_info); |
|
380 | + echo apply_filters("geodir_cfa_show_in_{$field_type}", '', $result_str, $cf, $field_info); |
|
381 | 381 | |
382 | - }else{ |
|
382 | + } else { |
|
383 | 383 | $value = ''; |
384 | 384 | if (isset($field_info->show_in)) { |
385 | 385 | $value = esc_attr($field_info->show_in); |
386 | - }elseif(isset($cf['defaults']['show_in']) && $cf['defaults']['show_in']){ |
|
386 | + }elseif (isset($cf['defaults']['show_in']) && $cf['defaults']['show_in']) { |
|
387 | 387 | $value = esc_attr($cf['defaults']['show_in']); |
388 | 388 | } |
389 | 389 | ?> |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | * @param object $field_info The field being displayed info. |
417 | 417 | * @param string $field_info The type of field. |
418 | 418 | */ |
419 | - $show_in_locations = apply_filters('geodir_show_in_locations',$show_in_locations,$field_info,$field_type); |
|
419 | + $show_in_locations = apply_filters('geodir_show_in_locations', $show_in_locations, $field_info, $field_type); |
|
420 | 420 | |
421 | 421 | |
422 | 422 | // remove some locations for some field types |
@@ -424,11 +424,11 @@ discard block |
||
424 | 424 | // don't show new tab option for some types |
425 | 425 | |
426 | 426 | if (in_array($field_type, array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file'))) { |
427 | - }else{ |
|
427 | + } else { |
|
428 | 428 | unset($show_in_locations['[owntab]']); |
429 | 429 | } |
430 | 430 | |
431 | - if(!$display_on_listing){ |
|
431 | + if (!$display_on_listing) { |
|
432 | 432 | unset($show_in_locations['[listings]']); |
433 | 433 | } |
434 | 434 | |
@@ -442,17 +442,17 @@ discard block |
||
442 | 442 | option-ajaxchosen="false"> |
443 | 443 | <?php |
444 | 444 | |
445 | - $show_in_values = explode(',',$value); |
|
445 | + $show_in_values = explode(',', $value); |
|
446 | 446 | |
447 | - foreach( $show_in_locations as $key => $val){ |
|
447 | + foreach ($show_in_locations as $key => $val) { |
|
448 | 448 | $selected = ''; |
449 | 449 | |
450 | - if(is_array($show_in_values) && in_array($key,$show_in_values ) ){ |
|
450 | + if (is_array($show_in_values) && in_array($key, $show_in_values)) { |
|
451 | 451 | $selected = 'selected'; |
452 | 452 | } |
453 | 453 | |
454 | 454 | ?> |
455 | - <option value="<?php echo $key;?>" <?php echo $selected;?>><?php echo $val;?></option> |
|
455 | + <option value="<?php echo $key; ?>" <?php echo $selected; ?>><?php echo $val; ?></option> |
|
456 | 456 | <?php |
457 | 457 | } |
458 | 458 | ?> |
@@ -464,9 +464,9 @@ discard block |
||
464 | 464 | |
465 | 465 | |
466 | 466 | // advanced_editor |
467 | - if(has_filter("geodir_cfa_advanced_editor_{$field_type}")){ |
|
467 | + if (has_filter("geodir_cfa_advanced_editor_{$field_type}")) { |
|
468 | 468 | |
469 | - echo apply_filters("geodir_cfa_advanced_editor_{$field_type}",'',$result_str,$cf,$field_info); |
|
469 | + echo apply_filters("geodir_cfa_advanced_editor_{$field_type}", '', $result_str, $cf, $field_info); |
|
470 | 470 | |
471 | 471 | } |
472 | 472 | |
@@ -477,10 +477,10 @@ discard block |
||
477 | 477 | |
478 | 478 | |
479 | 479 | <?php // @todo this does not seem to be used for anything, it can be removed or replaced ?> |
480 | - <input type="hidden" name="clabels" id="clabels" value="<?php if (isset($field_info->clabels)) { echo esc_attr($field_info->clabels);} ?>"/> |
|
480 | + <input type="hidden" name="clabels" id="clabels" value="<?php if (isset($field_info->clabels)) { echo esc_attr($field_info->clabels); } ?>"/> |
|
481 | 481 | |
482 | 482 | <?php // we dont need to show the sort order ?> |
483 | - <input type="hidden" readonly="readonly" name="sort_order" id="sort_order" value="<?php if (isset($field_info->sort_order)) { echo esc_attr($field_info->sort_order);} ?>"/> |
|
483 | + <input type="hidden" readonly="readonly" name="sort_order" id="sort_order" value="<?php if (isset($field_info->sort_order)) { echo esc_attr($field_info->sort_order); } ?>"/> |
|
484 | 484 | |
485 | 485 | |
486 | 486 | |
@@ -533,15 +533,15 @@ discard block |
||
533 | 533 | <?php |
534 | 534 | |
535 | 535 | // is_required |
536 | - if(has_filter("geodir_cfa_is_required_{$field_type}")){ |
|
536 | + if (has_filter("geodir_cfa_is_required_{$field_type}")) { |
|
537 | 537 | |
538 | - echo apply_filters("geodir_cfa_is_required_{$field_type}",'',$result_str,$cf,$field_info); |
|
538 | + echo apply_filters("geodir_cfa_is_required_{$field_type}", '', $result_str, $cf, $field_info); |
|
539 | 539 | |
540 | - }else{ |
|
540 | + } else { |
|
541 | 541 | $value = ''; |
542 | 542 | if (isset($field_info->is_required)) { |
543 | 543 | $value = esc_attr($field_info->is_required); |
544 | - }elseif(isset($cf['defaults']['is_required']) && $cf['defaults']['is_required']){ |
|
544 | + }elseif (isset($cf['defaults']['is_required']) && $cf['defaults']['is_required']) { |
|
545 | 545 | $value = $cf['defaults']['is_required']; |
546 | 546 | } |
547 | 547 | ?> |
@@ -554,17 +554,17 @@ discard block |
||
554 | 554 | |
555 | 555 | <div class="gd-cf-input-wrap gd-switch"> |
556 | 556 | |
557 | - <input type="radio" id="is_required_yes<?php echo $radio_id;?>" name="is_required" class="gdri-enabled" value="1" |
|
557 | + <input type="radio" id="is_required_yes<?php echo $radio_id; ?>" name="is_required" class="gdri-enabled" value="1" |
|
558 | 558 | <?php if ($value == '1') { |
559 | 559 | echo 'checked'; |
560 | 560 | } ?>/> |
561 | - <label onclick="show_hide_radio(this,'show','cf-is-required-msg');" for="is_required_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label> |
|
561 | + <label onclick="show_hide_radio(this,'show','cf-is-required-msg');" for="is_required_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label> |
|
562 | 562 | |
563 | - <input type="radio" id="is_required_no<?php echo $radio_id;?>" name="is_required" class="gdri-disabled" value="0" |
|
563 | + <input type="radio" id="is_required_no<?php echo $radio_id; ?>" name="is_required" class="gdri-disabled" value="0" |
|
564 | 564 | <?php if ($value == '0' || !$value) { |
565 | 565 | echo 'checked'; |
566 | 566 | } ?>/> |
567 | - <label onclick="show_hide_radio(this,'hide','cf-is-required-msg');" for="is_required_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label> |
|
567 | + <label onclick="show_hide_radio(this,'hide','cf-is-required-msg');" for="is_required_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label> |
|
568 | 568 | |
569 | 569 | </div> |
570 | 570 | |
@@ -574,19 +574,19 @@ discard block |
||
574 | 574 | } |
575 | 575 | |
576 | 576 | // required_msg |
577 | - if(has_filter("geodir_cfa_required_msg_{$field_type}")){ |
|
577 | + if (has_filter("geodir_cfa_required_msg_{$field_type}")) { |
|
578 | 578 | |
579 | - echo apply_filters("geodir_cfa_required_msg_{$field_type}",'',$result_str,$cf,$field_info); |
|
579 | + echo apply_filters("geodir_cfa_required_msg_{$field_type}", '', $result_str, $cf, $field_info); |
|
580 | 580 | |
581 | - }else{ |
|
581 | + } else { |
|
582 | 582 | $value = ''; |
583 | 583 | if (isset($field_info->required_msg)) { |
584 | 584 | $value = esc_attr($field_info->required_msg); |
585 | - }elseif(isset($cf['defaults']['required_msg']) && $cf['defaults']['required_msg']){ |
|
585 | + }elseif (isset($cf['defaults']['required_msg']) && $cf['defaults']['required_msg']) { |
|
586 | 586 | $value = $cf['defaults']['required_msg']; |
587 | 587 | } |
588 | 588 | ?> |
589 | - <li class="cf-is-required-msg" <?php if ((isset($field_info->is_required) && $field_info->is_required == '0') || !isset($field_info->is_required)) {echo "style='display:none;'";}?>> |
|
589 | + <li class="cf-is-required-msg" <?php if ((isset($field_info->is_required) && $field_info->is_required == '0') || !isset($field_info->is_required)) {echo "style='display:none;'"; }?>> |
|
590 | 590 | <label for="required_msg" class="gd-cf-tooltip-wrap"> |
591 | 591 | <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Required message:', 'geodirectory'); ?> |
592 | 592 | <div class="gdcf-tooltip"> |
@@ -603,31 +603,31 @@ discard block |
||
603 | 603 | |
604 | 604 | |
605 | 605 | // required_msg |
606 | - if(has_filter("geodir_cfa_validation_pattern_{$field_type}")){ |
|
606 | + if (has_filter("geodir_cfa_validation_pattern_{$field_type}")) { |
|
607 | 607 | |
608 | - echo apply_filters("geodir_cfa_validation_pattern_{$field_type}",'',$result_str,$cf,$field_info); |
|
608 | + echo apply_filters("geodir_cfa_validation_pattern_{$field_type}", '', $result_str, $cf, $field_info); |
|
609 | 609 | |
610 | 610 | } |
611 | 611 | |
612 | 612 | |
613 | 613 | // extra_fields |
614 | - if(has_filter("geodir_cfa_extra_fields_{$field_type}")){ |
|
614 | + if (has_filter("geodir_cfa_extra_fields_{$field_type}")) { |
|
615 | 615 | |
616 | - echo apply_filters("geodir_cfa_extra_fields_{$field_type}",'',$result_str,$cf,$field_info); |
|
616 | + echo apply_filters("geodir_cfa_extra_fields_{$field_type}", '', $result_str, $cf, $field_info); |
|
617 | 617 | |
618 | 618 | } |
619 | 619 | |
620 | 620 | |
621 | 621 | // field_icon |
622 | - if(has_filter("geodir_cfa_field_icon_{$field_type}")){ |
|
622 | + if (has_filter("geodir_cfa_field_icon_{$field_type}")) { |
|
623 | 623 | |
624 | - echo apply_filters("geodir_cfa_field_icon_{$field_type}",'',$result_str,$cf,$field_info); |
|
624 | + echo apply_filters("geodir_cfa_field_icon_{$field_type}", '', $result_str, $cf, $field_info); |
|
625 | 625 | |
626 | - }else{ |
|
626 | + } else { |
|
627 | 627 | $value = ''; |
628 | 628 | if (isset($field_info->field_icon)) { |
629 | 629 | $value = esc_attr($field_info->field_icon); |
630 | - }elseif(isset($cf['defaults']['field_icon']) && $cf['defaults']['field_icon']){ |
|
630 | + }elseif (isset($cf['defaults']['field_icon']) && $cf['defaults']['field_icon']) { |
|
631 | 631 | $value = $cf['defaults']['field_icon']; |
632 | 632 | } |
633 | 633 | ?> |
@@ -638,12 +638,12 @@ discard block |
||
638 | 638 | <label for="field_icon" class="gd-cf-tooltip-wrap"> |
639 | 639 | <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Upload icon :', 'geodirectory'); ?> |
640 | 640 | <div class="gdcf-tooltip"> |
641 | - <?php _e('Upload icon using media and enter its url path, or enter <a href="http://fortawesome.github.io/Font-Awesome/icons/" target="_blank" >font awesome </a>class eg:"fa fa-home"', 'geodirectory');?> |
|
641 | + <?php _e('Upload icon using media and enter its url path, or enter <a href="http://fortawesome.github.io/Font-Awesome/icons/" target="_blank" >font awesome </a>class eg:"fa fa-home"', 'geodirectory'); ?> |
|
642 | 642 | </div> |
643 | 643 | </label> |
644 | 644 | <div class="gd-cf-input-wrap"> |
645 | 645 | <input type="text" name="field_icon" id="field_icon" |
646 | - value="<?php echo $value;?>"/> |
|
646 | + value="<?php echo $value; ?>"/> |
|
647 | 647 | </div> |
648 | 648 | |
649 | 649 | </li> |
@@ -652,15 +652,15 @@ discard block |
||
652 | 652 | |
653 | 653 | |
654 | 654 | // css_class |
655 | - if(has_filter("geodir_cfa_css_class_{$field_type}")){ |
|
655 | + if (has_filter("geodir_cfa_css_class_{$field_type}")) { |
|
656 | 656 | |
657 | - echo apply_filters("geodir_cfa_css_class_{$field_type}",'',$result_str,$cf,$field_info); |
|
657 | + echo apply_filters("geodir_cfa_css_class_{$field_type}", '', $result_str, $cf, $field_info); |
|
658 | 658 | |
659 | - }else{ |
|
659 | + } else { |
|
660 | 660 | $value = ''; |
661 | 661 | if (isset($field_info->css_class)) { |
662 | 662 | $value = esc_attr($field_info->css_class); |
663 | - }elseif(isset($cf['defaults']['css_class']) && $cf['defaults']['css_class']){ |
|
663 | + }elseif (isset($cf['defaults']['css_class']) && $cf['defaults']['css_class']) { |
|
664 | 664 | $value = $cf['defaults']['css_class']; |
665 | 665 | } |
666 | 666 | ?> |
@@ -669,8 +669,8 @@ discard block |
||
669 | 669 | <label for="css_class" class="gd-cf-tooltip-wrap"> |
670 | 670 | <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Css class :', 'geodirectory'); ?> |
671 | 671 | <div class="gdcf-tooltip"> |
672 | - <?php _e('Enter custom css class for field custom style.', 'geodirectory');?> |
|
673 | - <?php if($field_type=='multiselect'){_e('(Enter class `gd-comma-list` to show list as comma separated)', 'geodirectory');}?> |
|
672 | + <?php _e('Enter custom css class for field custom style.', 'geodirectory'); ?> |
|
673 | + <?php if ($field_type == 'multiselect') {_e('(Enter class `gd-comma-list` to show list as comma separated)', 'geodirectory'); }?> |
|
674 | 674 | </div> |
675 | 675 | </label> |
676 | 676 | <div class="gd-cf-input-wrap"> |
@@ -685,23 +685,23 @@ discard block |
||
685 | 685 | |
686 | 686 | |
687 | 687 | // cat_sort |
688 | - if(has_filter("geodir_cfa_cat_sort_{$field_type}")){ |
|
688 | + if (has_filter("geodir_cfa_cat_sort_{$field_type}")) { |
|
689 | 689 | |
690 | - echo apply_filters("geodir_cfa_cat_sort_{$field_type}",'',$result_str,$cf,$field_info); |
|
690 | + echo apply_filters("geodir_cfa_cat_sort_{$field_type}", '', $result_str, $cf, $field_info); |
|
691 | 691 | |
692 | - }else{ |
|
692 | + } else { |
|
693 | 693 | $value = ''; |
694 | - $hide_cat_sort =''; |
|
694 | + $hide_cat_sort = ''; |
|
695 | 695 | if (isset($field_info->cat_sort)) { |
696 | 696 | $value = esc_attr($field_info->cat_sort); |
697 | - }elseif(isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']){ |
|
697 | + }elseif (isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']) { |
|
698 | 698 | $value = $cf['defaults']['cat_sort']; |
699 | - $hide_cat_sort = ($value===false) ? "style='display:none;'" : ''; |
|
699 | + $hide_cat_sort = ($value === false) ? "style='display:none;'" : ''; |
|
700 | 700 | } |
701 | 701 | |
702 | - $hide_cat_sort = (isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort']===false) ? "style='display:none;'" : ''; |
|
702 | + $hide_cat_sort = (isset($cf['defaults']['cat_sort']) && $cf['defaults']['cat_sort'] === false) ? "style='display:none;'" : ''; |
|
703 | 703 | ?> |
704 | - <li <?php echo $hide_cat_sort ;?>> |
|
704 | + <li <?php echo $hide_cat_sort; ?>> |
|
705 | 705 | <h3><?php |
706 | 706 | /** |
707 | 707 | * Filter the section title. |
@@ -720,23 +720,23 @@ discard block |
||
720 | 720 | <label for="cat_sort" class="gd-cf-tooltip-wrap"> |
721 | 721 | <i class="fa fa-info-circle" aria-hidden="true"></i> <?php _e('Include this field in sorting options :', 'geodirectory'); ?> |
722 | 722 | <div class="gdcf-tooltip"> |
723 | - <?php _e('Lets you use this filed as a sorting option, set from sorting options above.', 'geodirectory');?> |
|
723 | + <?php _e('Lets you use this filed as a sorting option, set from sorting options above.', 'geodirectory'); ?> |
|
724 | 724 | </div> |
725 | 725 | </label> |
726 | 726 | |
727 | 727 | <div class="gd-cf-input-wrap gd-switch"> |
728 | 728 | |
729 | - <input type="radio" id="cat_sort_yes<?php echo $radio_id;?>" name="cat_sort" class="gdri-enabled" value="1" |
|
729 | + <input type="radio" id="cat_sort_yes<?php echo $radio_id; ?>" name="cat_sort" class="gdri-enabled" value="1" |
|
730 | 730 | <?php if ($value == '1') { |
731 | 731 | echo 'checked'; |
732 | 732 | } ?>/> |
733 | - <label for="cat_sort_yes<?php echo $radio_id;?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label> |
|
733 | + <label for="cat_sort_yes<?php echo $radio_id; ?>" class="gdcb-enable"><span><?php _e('Yes', 'geodirectory'); ?></span></label> |
|
734 | 734 | |
735 | - <input type="radio" id="cat_sort_no<?php echo $radio_id;?>" name="cat_sort" class="gdri-disabled" value="0" |
|
735 | + <input type="radio" id="cat_sort_no<?php echo $radio_id; ?>" name="cat_sort" class="gdri-disabled" value="0" |
|
736 | 736 | <?php if (!$value) { |
737 | 737 | echo 'checked'; |
738 | 738 | } ?>/> |
739 | - <label for="cat_sort_no<?php echo $radio_id;?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label> |
|
739 | + <label for="cat_sort_no<?php echo $radio_id; ?>" class="gdcb-disable"><span><?php _e('No', 'geodirectory'); ?></span></label> |
|
740 | 740 | |
741 | 741 | </div> |
742 | 742 | </li> |
@@ -763,7 +763,7 @@ discard block |
||
763 | 763 | * @param object $field_info The current fields info. |
764 | 764 | * @param array $cf The custom field settings |
765 | 765 | */ |
766 | - do_action('geodir_advance_custom_fields', $field_info,$cf);?> |
|
766 | + do_action('geodir_advance_custom_fields', $field_info, $cf); ?> |
|
767 | 767 | |
768 | 768 | |
769 | 769 | <?php endswitch; ?> |
@@ -775,10 +775,10 @@ discard block |
||
775 | 775 | <h3></h3> |
776 | 776 | </label> |
777 | 777 | <div class="gd-cf-input-wrap"> |
778 | - <input type="button" class="button button-primary" name="save" id="save" value="<?php echo esc_attr(__('Save','geodirectory'));?>" |
|
778 | + <input type="button" class="button button-primary" name="save" id="save" value="<?php echo esc_attr(__('Save', 'geodirectory')); ?>" |
|
779 | 779 | onclick="save_field('<?php echo esc_attr($result_str); ?>')"/> |
780 | 780 | <?php if (!$default): ?> |
781 | - <a href="javascript:void(0)"><input type="button" name="delete" value="<?php echo esc_attr(__('Delete','geodirectory'));?>" |
|
781 | + <a href="javascript:void(0)"><input type="button" name="delete" value="<?php echo esc_attr(__('Delete', 'geodirectory')); ?>" |
|
782 | 782 | onclick="delete_field('<?php echo esc_attr($result_str); ?>', '<?php echo $nonce; ?>')" |
783 | 783 | class="button"/></a> |
784 | 784 | <?php endif; ?> |
@@ -21,84 +21,84 @@ discard block |
||
21 | 21 | */ |
22 | 22 | function geodir_cf_checkbox($html,$location,$cf,$p=''){ |
23 | 23 | |
24 | - // check we have the post value |
|
25 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
26 | - else{ global $post;} |
|
27 | - |
|
28 | - if(!is_array($cf) && $cf!=''){ |
|
29 | - $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
30 | - if(!$cf){return NULL;} |
|
31 | - } |
|
32 | - |
|
33 | - $html_var = $cf['htmlvar_name']; |
|
34 | - |
|
35 | - // Check if there is a location specific filter. |
|
36 | - if(has_filter("geodir_custom_field_output_checkbox_loc_{$location}")){ |
|
37 | - /** |
|
38 | - * Filter the checkbox html by location. |
|
39 | - * |
|
40 | - * @param string $html The html to filter. |
|
41 | - * @param array $cf The custom field array. |
|
42 | - * @since 1.6.6 |
|
43 | - */ |
|
44 | - $html = apply_filters("geodir_custom_field_output_checkbox_loc_{$location}",$html,$cf); |
|
45 | - } |
|
46 | - |
|
47 | - // Check if there is a custom field specific filter. |
|
48 | - if(has_filter("geodir_custom_field_output_checkbox_var_{$html_var}")){ |
|
49 | - /** |
|
50 | - * Filter the checkbox html by individual custom field. |
|
51 | - * |
|
52 | - * @param string $html The html to filter. |
|
53 | - * @param string $location The location to output the html. |
|
54 | - * @param array $cf The custom field array. |
|
55 | - * @since 1.6.6 |
|
56 | - */ |
|
57 | - $html = apply_filters("geodir_custom_field_output_checkbox_var_{$html_var}",$html,$location,$cf); |
|
58 | - } |
|
59 | - |
|
60 | - // Check if there is a custom field key specific filter. |
|
61 | - if(has_filter("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}")){ |
|
62 | - /** |
|
63 | - * Filter the checkbox html by field type key. |
|
64 | - * |
|
65 | - * @param string $html The html to filter. |
|
66 | - * @param string $location The location to output the html. |
|
67 | - * @param array $cf The custom field array. |
|
68 | - * @since 1.6.6 |
|
69 | - */ |
|
70 | - $html = apply_filters("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
71 | - } |
|
72 | - |
|
73 | - // If not html then we run the standard output. |
|
74 | - if(empty($html)){ |
|
75 | - |
|
76 | - if ( (int) $post->{$html_var} == 1 ): |
|
77 | - |
|
78 | - if ( $post->{$html_var} == '1' ): |
|
79 | - $html_val = __( 'Yes', 'geodirectory' ); |
|
80 | - else: |
|
81 | - $html_val = __( 'No', 'geodirectory' ); |
|
82 | - endif; |
|
83 | - |
|
84 | - $field_icon = geodir_field_icon_proccess($cf); |
|
85 | - if (strpos($field_icon, 'http') !== false) { |
|
86 | - $field_icon_af = ''; |
|
87 | - } elseif ($field_icon == '') { |
|
88 | - $field_icon_af = ''; |
|
89 | - } else { |
|
90 | - $field_icon_af = $field_icon; |
|
91 | - $field_icon = ''; |
|
92 | - } |
|
93 | - |
|
94 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-checkbox" style="' . $field_icon . '">' . $field_icon_af; |
|
95 | - $html .= ( trim( $cf['site_title'] ) ) ? __( $cf['site_title'], 'geodirectory' ) . ': ' : ''; |
|
96 | - $html .= '</span>' . $html_val . '</div>'; |
|
97 | - endif; |
|
98 | - |
|
99 | - } |
|
100 | - |
|
101 | - return $html; |
|
24 | + // check we have the post value |
|
25 | + if(is_int($p)){$post = geodir_get_post_info($p);} |
|
26 | + else{ global $post;} |
|
27 | + |
|
28 | + if(!is_array($cf) && $cf!=''){ |
|
29 | + $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
30 | + if(!$cf){return NULL;} |
|
31 | + } |
|
32 | + |
|
33 | + $html_var = $cf['htmlvar_name']; |
|
34 | + |
|
35 | + // Check if there is a location specific filter. |
|
36 | + if(has_filter("geodir_custom_field_output_checkbox_loc_{$location}")){ |
|
37 | + /** |
|
38 | + * Filter the checkbox html by location. |
|
39 | + * |
|
40 | + * @param string $html The html to filter. |
|
41 | + * @param array $cf The custom field array. |
|
42 | + * @since 1.6.6 |
|
43 | + */ |
|
44 | + $html = apply_filters("geodir_custom_field_output_checkbox_loc_{$location}",$html,$cf); |
|
45 | + } |
|
46 | + |
|
47 | + // Check if there is a custom field specific filter. |
|
48 | + if(has_filter("geodir_custom_field_output_checkbox_var_{$html_var}")){ |
|
49 | + /** |
|
50 | + * Filter the checkbox html by individual custom field. |
|
51 | + * |
|
52 | + * @param string $html The html to filter. |
|
53 | + * @param string $location The location to output the html. |
|
54 | + * @param array $cf The custom field array. |
|
55 | + * @since 1.6.6 |
|
56 | + */ |
|
57 | + $html = apply_filters("geodir_custom_field_output_checkbox_var_{$html_var}",$html,$location,$cf); |
|
58 | + } |
|
59 | + |
|
60 | + // Check if there is a custom field key specific filter. |
|
61 | + if(has_filter("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}")){ |
|
62 | + /** |
|
63 | + * Filter the checkbox html by field type key. |
|
64 | + * |
|
65 | + * @param string $html The html to filter. |
|
66 | + * @param string $location The location to output the html. |
|
67 | + * @param array $cf The custom field array. |
|
68 | + * @since 1.6.6 |
|
69 | + */ |
|
70 | + $html = apply_filters("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
71 | + } |
|
72 | + |
|
73 | + // If not html then we run the standard output. |
|
74 | + if(empty($html)){ |
|
75 | + |
|
76 | + if ( (int) $post->{$html_var} == 1 ): |
|
77 | + |
|
78 | + if ( $post->{$html_var} == '1' ): |
|
79 | + $html_val = __( 'Yes', 'geodirectory' ); |
|
80 | + else: |
|
81 | + $html_val = __( 'No', 'geodirectory' ); |
|
82 | + endif; |
|
83 | + |
|
84 | + $field_icon = geodir_field_icon_proccess($cf); |
|
85 | + if (strpos($field_icon, 'http') !== false) { |
|
86 | + $field_icon_af = ''; |
|
87 | + } elseif ($field_icon == '') { |
|
88 | + $field_icon_af = ''; |
|
89 | + } else { |
|
90 | + $field_icon_af = $field_icon; |
|
91 | + $field_icon = ''; |
|
92 | + } |
|
93 | + |
|
94 | + $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-checkbox" style="' . $field_icon . '">' . $field_icon_af; |
|
95 | + $html .= ( trim( $cf['site_title'] ) ) ? __( $cf['site_title'], 'geodirectory' ) . ': ' : ''; |
|
96 | + $html .= '</span>' . $html_val . '</div>'; |
|
97 | + endif; |
|
98 | + |
|
99 | + } |
|
100 | + |
|
101 | + return $html; |
|
102 | 102 | } |
103 | 103 | add_filter('geodir_custom_field_output_checkbox','geodir_cf_checkbox',10,3); |
104 | 104 | |
@@ -115,71 +115,71 @@ discard block |
||
115 | 115 | */ |
116 | 116 | function geodir_cf_fieldset($html,$location,$cf,$p=''){ |
117 | 117 | |
118 | - // check we have the post value |
|
119 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
120 | - else{ global $post;} |
|
121 | - |
|
122 | - if(!is_array($cf) && $cf!=''){ |
|
123 | - $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
124 | - if(!$cf){return NULL;} |
|
125 | - } |
|
126 | - |
|
127 | - $html_var = $cf['htmlvar_name']; |
|
128 | - |
|
129 | - // Check if there is a location specific filter. |
|
130 | - if(has_filter("geodir_custom_field_output_fieldset_loc_{$location}")){ |
|
131 | - /** |
|
132 | - * Filter the fieldset html by location. |
|
133 | - * |
|
134 | - * @param string $html The html to filter. |
|
135 | - * @param array $cf The custom field array. |
|
136 | - * @since 1.6.6 |
|
137 | - */ |
|
138 | - $html = apply_filters("geodir_custom_field_output_fieldset_loc_{$location}",$html,$cf); |
|
139 | - } |
|
140 | - |
|
141 | - // Check if there is a custom field specific filter. |
|
142 | - if(has_filter("geodir_custom_field_output_fieldset_var_{$html_var}")){ |
|
143 | - /** |
|
144 | - * Filter the fieldset html by individual custom field. |
|
145 | - * |
|
146 | - * @param string $html The html to filter. |
|
147 | - * @param string $location The location to output the html. |
|
148 | - * @param array $cf The custom field array. |
|
149 | - * @since 1.6.6 |
|
150 | - */ |
|
151 | - $html = apply_filters("geodir_custom_field_output_fieldset_var_{$html_var}",$html,$location,$cf); |
|
152 | - } |
|
153 | - |
|
154 | - // Check if there is a custom field key specific filter. |
|
155 | - if(has_filter("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}")){ |
|
156 | - /** |
|
157 | - * Filter the fieldset html by field type key. |
|
158 | - * |
|
159 | - * @param string $html The html to filter. |
|
160 | - * @param string $location The location to output the html. |
|
161 | - * @param array $cf The custom field array. |
|
162 | - * @since 1.6.6 |
|
163 | - */ |
|
164 | - $html = apply_filters("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
165 | - } |
|
166 | - |
|
167 | - // If not html then we run the standard output. |
|
168 | - if(empty($html)){ |
|
169 | - |
|
170 | - global $field_set_start; |
|
171 | - $fieldset_class = 'fieldset-'.sanitize_title_with_dashes($cf['site_title']); |
|
172 | - |
|
173 | - if ($field_set_start == 1) { |
|
174 | - $html = ''; |
|
175 | - } else { |
|
176 | - $html = '<h2 class="'.$fieldset_class.'">'. __($cf['site_title'], 'geodirectory') . '</h2>'; |
|
177 | - //$field_set_start = 1; |
|
178 | - } |
|
179 | - |
|
180 | - } |
|
181 | - |
|
182 | - return $html; |
|
118 | + // check we have the post value |
|
119 | + if(is_int($p)){$post = geodir_get_post_info($p);} |
|
120 | + else{ global $post;} |
|
121 | + |
|
122 | + if(!is_array($cf) && $cf!=''){ |
|
123 | + $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
124 | + if(!$cf){return NULL;} |
|
125 | + } |
|
126 | + |
|
127 | + $html_var = $cf['htmlvar_name']; |
|
128 | + |
|
129 | + // Check if there is a location specific filter. |
|
130 | + if(has_filter("geodir_custom_field_output_fieldset_loc_{$location}")){ |
|
131 | + /** |
|
132 | + * Filter the fieldset html by location. |
|
133 | + * |
|
134 | + * @param string $html The html to filter. |
|
135 | + * @param array $cf The custom field array. |
|
136 | + * @since 1.6.6 |
|
137 | + */ |
|
138 | + $html = apply_filters("geodir_custom_field_output_fieldset_loc_{$location}",$html,$cf); |
|
139 | + } |
|
140 | + |
|
141 | + // Check if there is a custom field specific filter. |
|
142 | + if(has_filter("geodir_custom_field_output_fieldset_var_{$html_var}")){ |
|
143 | + /** |
|
144 | + * Filter the fieldset html by individual custom field. |
|
145 | + * |
|
146 | + * @param string $html The html to filter. |
|
147 | + * @param string $location The location to output the html. |
|
148 | + * @param array $cf The custom field array. |
|
149 | + * @since 1.6.6 |
|
150 | + */ |
|
151 | + $html = apply_filters("geodir_custom_field_output_fieldset_var_{$html_var}",$html,$location,$cf); |
|
152 | + } |
|
153 | + |
|
154 | + // Check if there is a custom field key specific filter. |
|
155 | + if(has_filter("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}")){ |
|
156 | + /** |
|
157 | + * Filter the fieldset html by field type key. |
|
158 | + * |
|
159 | + * @param string $html The html to filter. |
|
160 | + * @param string $location The location to output the html. |
|
161 | + * @param array $cf The custom field array. |
|
162 | + * @since 1.6.6 |
|
163 | + */ |
|
164 | + $html = apply_filters("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
165 | + } |
|
166 | + |
|
167 | + // If not html then we run the standard output. |
|
168 | + if(empty($html)){ |
|
169 | + |
|
170 | + global $field_set_start; |
|
171 | + $fieldset_class = 'fieldset-'.sanitize_title_with_dashes($cf['site_title']); |
|
172 | + |
|
173 | + if ($field_set_start == 1) { |
|
174 | + $html = ''; |
|
175 | + } else { |
|
176 | + $html = '<h2 class="'.$fieldset_class.'">'. __($cf['site_title'], 'geodirectory') . '</h2>'; |
|
177 | + //$field_set_start = 1; |
|
178 | + } |
|
179 | + |
|
180 | + } |
|
181 | + |
|
182 | + return $html; |
|
183 | 183 | } |
184 | 184 | add_filter('geodir_custom_field_output_fieldset','geodir_cf_fieldset',10,3); |
185 | 185 | |
@@ -196,106 +196,106 @@ discard block |
||
196 | 196 | */ |
197 | 197 | function geodir_cf_url($html,$location,$cf,$p=''){ |
198 | 198 | |
199 | - // check we have the post value |
|
200 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
201 | - else{ global $post;} |
|
202 | - |
|
203 | - if(!is_array($cf) && $cf!=''){ |
|
204 | - $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
205 | - if(!$cf){return NULL;} |
|
206 | - } |
|
207 | - |
|
208 | - $html_var = $cf['htmlvar_name']; |
|
209 | - |
|
210 | - // Check if there is a location specific filter. |
|
211 | - if(has_filter("geodir_custom_field_output_url_loc_{$location}")){ |
|
212 | - /** |
|
213 | - * Filter the url html by location. |
|
214 | - * |
|
215 | - * @param string $html The html to filter. |
|
216 | - * @param array $cf The custom field array. |
|
217 | - * @since 1.6.6 |
|
218 | - */ |
|
219 | - $html = apply_filters("geodir_custom_field_output_url_loc_{$location}",$html,$cf); |
|
220 | - } |
|
221 | - |
|
222 | - // Check if there is a custom field specific filter. |
|
223 | - if(has_filter("geodir_custom_field_output_url_var_{$html_var}")){ |
|
224 | - /** |
|
225 | - * Filter the url html by individual custom field. |
|
226 | - * |
|
227 | - * @param string $html The html to filter. |
|
228 | - * @param string $location The location to output the html. |
|
229 | - * @param array $cf The custom field array. |
|
230 | - * @since 1.6.6 |
|
231 | - */ |
|
232 | - $html = apply_filters("geodir_custom_field_output_url_var_{$html_var}",$html,$location,$cf); |
|
233 | - } |
|
234 | - |
|
235 | - // Check if there is a custom field key specific filter. |
|
236 | - if(has_filter("geodir_custom_field_output_url_key_{$cf['field_type_key']}")){ |
|
237 | - /** |
|
238 | - * Filter the url html by field type key. |
|
239 | - * |
|
240 | - * @param string $html The html to filter. |
|
241 | - * @param string $location The location to output the html. |
|
242 | - * @param array $cf The custom field array. |
|
243 | - * @since 1.6.6 |
|
244 | - */ |
|
245 | - $html = apply_filters("geodir_custom_field_output_url_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
246 | - } |
|
247 | - |
|
248 | - // If not html then we run the standard output. |
|
249 | - if(empty($html)){ |
|
250 | - |
|
251 | - if ($post->{$cf['htmlvar_name']}): |
|
252 | - |
|
253 | - $field_icon = geodir_field_icon_proccess($cf); |
|
254 | - if (strpos($field_icon, 'http') !== false) { |
|
255 | - $field_icon_af = ''; |
|
256 | - } elseif ($field_icon == '') { |
|
257 | - |
|
258 | - if ($cf['name'] == 'geodir_facebook') { |
|
259 | - $field_icon_af = '<i class="fa fa-facebook-square"></i>'; |
|
260 | - } elseif ($cf['name'] == 'geodir_twitter') { |
|
261 | - $field_icon_af = '<i class="fa fa-twitter-square"></i>'; |
|
262 | - } else { |
|
263 | - $field_icon_af = '<i class="fa fa-link"></i>'; |
|
264 | - } |
|
265 | - |
|
266 | - } else { |
|
267 | - $field_icon_af = $field_icon; |
|
268 | - $field_icon = ''; |
|
269 | - } |
|
270 | - |
|
271 | - $a_url = geodir_parse_custom_field_url($post->{$cf['htmlvar_name']}); |
|
272 | - |
|
273 | - |
|
274 | - $website = !empty($a_url['url']) ? $a_url['url'] : ''; |
|
275 | - $title = !empty($a_url['label']) ? $a_url['label'] : $cf['site_title']; |
|
276 | - if(!empty($cf['default_value'])){$title = $cf['default_value'];} |
|
277 | - $title = $title != '' ? __(stripslashes($title), 'geodirectory') : ''; |
|
278 | - |
|
279 | - |
|
280 | - |
|
281 | - // all search engines that use the nofollow value exclude links that use it from their ranking calculation |
|
282 | - $rel = strpos($website, get_site_url()) !== false ? '' : 'rel="nofollow"'; |
|
283 | - /** |
|
284 | - * Filter custom field website name. |
|
285 | - * |
|
286 | - * @since 1.0.0 |
|
287 | - * |
|
288 | - * @param string $title Website Title. |
|
289 | - * @param string $website Website URL. |
|
290 | - * @param int $post->ID Post ID. |
|
291 | - */ |
|
292 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '"><span class="geodir-i-website" style="' . $field_icon . '">' . $field_icon_af . '<a href="' . $website . '" target="_blank" ' . $rel . ' ><strong>' . apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID) . '</strong></a></span></div>'; |
|
293 | - |
|
294 | - endif; |
|
295 | - |
|
296 | - } |
|
297 | - |
|
298 | - return $html; |
|
199 | + // check we have the post value |
|
200 | + if(is_int($p)){$post = geodir_get_post_info($p);} |
|
201 | + else{ global $post;} |
|
202 | + |
|
203 | + if(!is_array($cf) && $cf!=''){ |
|
204 | + $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
205 | + if(!$cf){return NULL;} |
|
206 | + } |
|
207 | + |
|
208 | + $html_var = $cf['htmlvar_name']; |
|
209 | + |
|
210 | + // Check if there is a location specific filter. |
|
211 | + if(has_filter("geodir_custom_field_output_url_loc_{$location}")){ |
|
212 | + /** |
|
213 | + * Filter the url html by location. |
|
214 | + * |
|
215 | + * @param string $html The html to filter. |
|
216 | + * @param array $cf The custom field array. |
|
217 | + * @since 1.6.6 |
|
218 | + */ |
|
219 | + $html = apply_filters("geodir_custom_field_output_url_loc_{$location}",$html,$cf); |
|
220 | + } |
|
221 | + |
|
222 | + // Check if there is a custom field specific filter. |
|
223 | + if(has_filter("geodir_custom_field_output_url_var_{$html_var}")){ |
|
224 | + /** |
|
225 | + * Filter the url html by individual custom field. |
|
226 | + * |
|
227 | + * @param string $html The html to filter. |
|
228 | + * @param string $location The location to output the html. |
|
229 | + * @param array $cf The custom field array. |
|
230 | + * @since 1.6.6 |
|
231 | + */ |
|
232 | + $html = apply_filters("geodir_custom_field_output_url_var_{$html_var}",$html,$location,$cf); |
|
233 | + } |
|
234 | + |
|
235 | + // Check if there is a custom field key specific filter. |
|
236 | + if(has_filter("geodir_custom_field_output_url_key_{$cf['field_type_key']}")){ |
|
237 | + /** |
|
238 | + * Filter the url html by field type key. |
|
239 | + * |
|
240 | + * @param string $html The html to filter. |
|
241 | + * @param string $location The location to output the html. |
|
242 | + * @param array $cf The custom field array. |
|
243 | + * @since 1.6.6 |
|
244 | + */ |
|
245 | + $html = apply_filters("geodir_custom_field_output_url_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
246 | + } |
|
247 | + |
|
248 | + // If not html then we run the standard output. |
|
249 | + if(empty($html)){ |
|
250 | + |
|
251 | + if ($post->{$cf['htmlvar_name']}): |
|
252 | + |
|
253 | + $field_icon = geodir_field_icon_proccess($cf); |
|
254 | + if (strpos($field_icon, 'http') !== false) { |
|
255 | + $field_icon_af = ''; |
|
256 | + } elseif ($field_icon == '') { |
|
257 | + |
|
258 | + if ($cf['name'] == 'geodir_facebook') { |
|
259 | + $field_icon_af = '<i class="fa fa-facebook-square"></i>'; |
|
260 | + } elseif ($cf['name'] == 'geodir_twitter') { |
|
261 | + $field_icon_af = '<i class="fa fa-twitter-square"></i>'; |
|
262 | + } else { |
|
263 | + $field_icon_af = '<i class="fa fa-link"></i>'; |
|
264 | + } |
|
265 | + |
|
266 | + } else { |
|
267 | + $field_icon_af = $field_icon; |
|
268 | + $field_icon = ''; |
|
269 | + } |
|
270 | + |
|
271 | + $a_url = geodir_parse_custom_field_url($post->{$cf['htmlvar_name']}); |
|
272 | + |
|
273 | + |
|
274 | + $website = !empty($a_url['url']) ? $a_url['url'] : ''; |
|
275 | + $title = !empty($a_url['label']) ? $a_url['label'] : $cf['site_title']; |
|
276 | + if(!empty($cf['default_value'])){$title = $cf['default_value'];} |
|
277 | + $title = $title != '' ? __(stripslashes($title), 'geodirectory') : ''; |
|
278 | + |
|
279 | + |
|
280 | + |
|
281 | + // all search engines that use the nofollow value exclude links that use it from their ranking calculation |
|
282 | + $rel = strpos($website, get_site_url()) !== false ? '' : 'rel="nofollow"'; |
|
283 | + /** |
|
284 | + * Filter custom field website name. |
|
285 | + * |
|
286 | + * @since 1.0.0 |
|
287 | + * |
|
288 | + * @param string $title Website Title. |
|
289 | + * @param string $website Website URL. |
|
290 | + * @param int $post->ID Post ID. |
|
291 | + */ |
|
292 | + $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '"><span class="geodir-i-website" style="' . $field_icon . '">' . $field_icon_af . '<a href="' . $website . '" target="_blank" ' . $rel . ' ><strong>' . apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID) . '</strong></a></span></div>'; |
|
293 | + |
|
294 | + endif; |
|
295 | + |
|
296 | + } |
|
297 | + |
|
298 | + return $html; |
|
299 | 299 | } |
300 | 300 | add_filter('geodir_custom_field_output_url','geodir_cf_url',10,3); |
301 | 301 | |
@@ -312,80 +312,80 @@ discard block |
||
312 | 312 | */ |
313 | 313 | function geodir_cf_phone($html,$location,$cf,$p=''){ |
314 | 314 | |
315 | - // check we have the post value |
|
316 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
317 | - else{ global $post;} |
|
318 | - |
|
319 | - if(!is_array($cf) && $cf!=''){ |
|
320 | - $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
321 | - if(!$cf){return NULL;} |
|
322 | - } |
|
323 | - |
|
324 | - $html_var = $cf['htmlvar_name']; |
|
325 | - |
|
326 | - // Check if there is a location specific filter. |
|
327 | - if(has_filter("geodir_custom_field_output_phone_loc_{$location}")){ |
|
328 | - /** |
|
329 | - * Filter the phone html by location. |
|
330 | - * |
|
331 | - * @param string $html The html to filter. |
|
332 | - * @param array $cf The custom field array. |
|
333 | - * @since 1.6.6 |
|
334 | - */ |
|
335 | - $html = apply_filters("geodir_custom_field_output_phone_loc_{$location}",$html,$cf); |
|
336 | - } |
|
337 | - |
|
338 | - // Check if there is a custom field specific filter. |
|
339 | - if(has_filter("geodir_custom_field_output_phone_var_{$html_var}")){ |
|
340 | - /** |
|
341 | - * Filter the phone html by individual custom field. |
|
342 | - * |
|
343 | - * @param string $html The html to filter. |
|
344 | - * @param string $location The location to output the html. |
|
345 | - * @param array $cf The custom field array. |
|
346 | - * @since 1.6.6 |
|
347 | - */ |
|
348 | - $html = apply_filters("geodir_custom_field_output_phone_var_{$html_var}",$html,$location,$cf); |
|
349 | - } |
|
350 | - |
|
351 | - // Check if there is a custom field key specific filter. |
|
352 | - if(has_filter("geodir_custom_field_output_phone_key_{$cf['field_type_key']}")){ |
|
353 | - /** |
|
354 | - * Filter the phone html by field type key. |
|
355 | - * |
|
356 | - * @param string $html The html to filter. |
|
357 | - * @param string $location The location to output the html. |
|
358 | - * @param array $cf The custom field array. |
|
359 | - * @since 1.6.6 |
|
360 | - */ |
|
361 | - $html = apply_filters("geodir_custom_field_output_phone_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
362 | - } |
|
363 | - |
|
364 | - // If not html then we run the standard output. |
|
365 | - if(empty($html)){ |
|
366 | - |
|
367 | - if ($post->{$cf['htmlvar_name']}): |
|
368 | - |
|
369 | - $field_icon = geodir_field_icon_proccess($cf); |
|
370 | - if (strpos($field_icon, 'http') !== false) { |
|
371 | - $field_icon_af = ''; |
|
372 | - } elseif ($field_icon == '') { |
|
373 | - $field_icon_af = '<i class="fa fa-phone"></i>'; |
|
374 | - } else { |
|
375 | - $field_icon_af = $field_icon; |
|
376 | - $field_icon = ''; |
|
377 | - } |
|
378 | - |
|
379 | - |
|
380 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-contact" style="' . $field_icon . '">' . $field_icon_af . |
|
381 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ' '; |
|
382 | - $html .= '</span><a href="tel:' . preg_replace('/[^0-9+]/', '', $post->{$cf['htmlvar_name']}) . '">' . $post->{$cf['htmlvar_name']} . '</a></div>'; |
|
383 | - |
|
384 | - endif; |
|
385 | - |
|
386 | - } |
|
387 | - |
|
388 | - return $html; |
|
315 | + // check we have the post value |
|
316 | + if(is_int($p)){$post = geodir_get_post_info($p);} |
|
317 | + else{ global $post;} |
|
318 | + |
|
319 | + if(!is_array($cf) && $cf!=''){ |
|
320 | + $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
321 | + if(!$cf){return NULL;} |
|
322 | + } |
|
323 | + |
|
324 | + $html_var = $cf['htmlvar_name']; |
|
325 | + |
|
326 | + // Check if there is a location specific filter. |
|
327 | + if(has_filter("geodir_custom_field_output_phone_loc_{$location}")){ |
|
328 | + /** |
|
329 | + * Filter the phone html by location. |
|
330 | + * |
|
331 | + * @param string $html The html to filter. |
|
332 | + * @param array $cf The custom field array. |
|
333 | + * @since 1.6.6 |
|
334 | + */ |
|
335 | + $html = apply_filters("geodir_custom_field_output_phone_loc_{$location}",$html,$cf); |
|
336 | + } |
|
337 | + |
|
338 | + // Check if there is a custom field specific filter. |
|
339 | + if(has_filter("geodir_custom_field_output_phone_var_{$html_var}")){ |
|
340 | + /** |
|
341 | + * Filter the phone html by individual custom field. |
|
342 | + * |
|
343 | + * @param string $html The html to filter. |
|
344 | + * @param string $location The location to output the html. |
|
345 | + * @param array $cf The custom field array. |
|
346 | + * @since 1.6.6 |
|
347 | + */ |
|
348 | + $html = apply_filters("geodir_custom_field_output_phone_var_{$html_var}",$html,$location,$cf); |
|
349 | + } |
|
350 | + |
|
351 | + // Check if there is a custom field key specific filter. |
|
352 | + if(has_filter("geodir_custom_field_output_phone_key_{$cf['field_type_key']}")){ |
|
353 | + /** |
|
354 | + * Filter the phone html by field type key. |
|
355 | + * |
|
356 | + * @param string $html The html to filter. |
|
357 | + * @param string $location The location to output the html. |
|
358 | + * @param array $cf The custom field array. |
|
359 | + * @since 1.6.6 |
|
360 | + */ |
|
361 | + $html = apply_filters("geodir_custom_field_output_phone_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
362 | + } |
|
363 | + |
|
364 | + // If not html then we run the standard output. |
|
365 | + if(empty($html)){ |
|
366 | + |
|
367 | + if ($post->{$cf['htmlvar_name']}): |
|
368 | + |
|
369 | + $field_icon = geodir_field_icon_proccess($cf); |
|
370 | + if (strpos($field_icon, 'http') !== false) { |
|
371 | + $field_icon_af = ''; |
|
372 | + } elseif ($field_icon == '') { |
|
373 | + $field_icon_af = '<i class="fa fa-phone"></i>'; |
|
374 | + } else { |
|
375 | + $field_icon_af = $field_icon; |
|
376 | + $field_icon = ''; |
|
377 | + } |
|
378 | + |
|
379 | + |
|
380 | + $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-contact" style="' . $field_icon . '">' . $field_icon_af . |
|
381 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ' '; |
|
382 | + $html .= '</span><a href="tel:' . preg_replace('/[^0-9+]/', '', $post->{$cf['htmlvar_name']}) . '">' . $post->{$cf['htmlvar_name']} . '</a></div>'; |
|
383 | + |
|
384 | + endif; |
|
385 | + |
|
386 | + } |
|
387 | + |
|
388 | + return $html; |
|
389 | 389 | } |
390 | 390 | add_filter('geodir_custom_field_output_phone','geodir_cf_phone',10,3); |
391 | 391 | |
@@ -402,85 +402,85 @@ discard block |
||
402 | 402 | */ |
403 | 403 | function geodir_cf_time($html,$location,$cf,$p=''){ |
404 | 404 | |
405 | - // check we have the post value |
|
406 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
407 | - else{ global $post;} |
|
408 | - |
|
409 | - if(!is_array($cf) && $cf!=''){ |
|
410 | - $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
411 | - if(!$cf){return NULL;} |
|
412 | - } |
|
413 | - |
|
414 | - $html_var = $cf['htmlvar_name']; |
|
415 | - |
|
416 | - // Check if there is a location specific filter. |
|
417 | - if(has_filter("geodir_custom_field_output_time_loc_{$location}")){ |
|
418 | - /** |
|
419 | - * Filter the time html by location. |
|
420 | - * |
|
421 | - * @param string $html The html to filter. |
|
422 | - * @param array $cf The custom field array. |
|
423 | - * @since 1.6.6 |
|
424 | - */ |
|
425 | - $html = apply_filters("geodir_custom_field_output_time_loc_{$location}",$html,$cf); |
|
426 | - } |
|
427 | - |
|
428 | - // Check if there is a custom field specific filter. |
|
429 | - if(has_filter("geodir_custom_field_output_time_var_{$html_var}")){ |
|
430 | - /** |
|
431 | - * Filter the time html by individual custom field. |
|
432 | - * |
|
433 | - * @param string $html The html to filter. |
|
434 | - * @param string $location The location to output the html. |
|
435 | - * @param array $cf The custom field array. |
|
436 | - * @since 1.6.6 |
|
437 | - */ |
|
438 | - $html = apply_filters("geodir_custom_field_output_time_var_{$html_var}",$html,$location,$cf); |
|
439 | - } |
|
440 | - |
|
441 | - // Check if there is a custom field key specific filter. |
|
442 | - if(has_filter("geodir_custom_field_output_time_key_{$cf['field_type_key']}")){ |
|
443 | - /** |
|
444 | - * Filter the time html by field type key. |
|
445 | - * |
|
446 | - * @param string $html The html to filter. |
|
447 | - * @param string $location The location to output the html. |
|
448 | - * @param array $cf The custom field array. |
|
449 | - * @since 1.6.6 |
|
450 | - */ |
|
451 | - $html = apply_filters("geodir_custom_field_output_time_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
452 | - } |
|
453 | - |
|
454 | - // If not html then we run the standard output. |
|
455 | - if(empty($html)){ |
|
456 | - |
|
457 | - if ($post->{$cf['htmlvar_name']}): |
|
458 | - |
|
459 | - $value = ''; |
|
460 | - if ($post->{$cf['htmlvar_name']} != '') |
|
461 | - //$value = date('h:i',strtotime($post->{$cf['htmlvar_name']})); |
|
462 | - $value = date(get_option('time_format'), strtotime($post->{$cf['htmlvar_name']})); |
|
463 | - |
|
464 | - $field_icon = geodir_field_icon_proccess($cf); |
|
465 | - if (strpos($field_icon, 'http') !== false) { |
|
466 | - $field_icon_af = ''; |
|
467 | - } elseif ($field_icon == '') { |
|
468 | - $field_icon_af = '<i class="fa fa-clock-o"></i>'; |
|
469 | - } else { |
|
470 | - $field_icon_af = $field_icon; |
|
471 | - $field_icon = ''; |
|
472 | - } |
|
473 | - |
|
474 | - |
|
475 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-time" style="' . $field_icon . '">' . $field_icon_af; |
|
476 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ' '; |
|
477 | - $html .= '</span>' . $value . '</div>'; |
|
478 | - |
|
479 | - endif; |
|
480 | - |
|
481 | - } |
|
482 | - |
|
483 | - return $html; |
|
405 | + // check we have the post value |
|
406 | + if(is_int($p)){$post = geodir_get_post_info($p);} |
|
407 | + else{ global $post;} |
|
408 | + |
|
409 | + if(!is_array($cf) && $cf!=''){ |
|
410 | + $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
411 | + if(!$cf){return NULL;} |
|
412 | + } |
|
413 | + |
|
414 | + $html_var = $cf['htmlvar_name']; |
|
415 | + |
|
416 | + // Check if there is a location specific filter. |
|
417 | + if(has_filter("geodir_custom_field_output_time_loc_{$location}")){ |
|
418 | + /** |
|
419 | + * Filter the time html by location. |
|
420 | + * |
|
421 | + * @param string $html The html to filter. |
|
422 | + * @param array $cf The custom field array. |
|
423 | + * @since 1.6.6 |
|
424 | + */ |
|
425 | + $html = apply_filters("geodir_custom_field_output_time_loc_{$location}",$html,$cf); |
|
426 | + } |
|
427 | + |
|
428 | + // Check if there is a custom field specific filter. |
|
429 | + if(has_filter("geodir_custom_field_output_time_var_{$html_var}")){ |
|
430 | + /** |
|
431 | + * Filter the time html by individual custom field. |
|
432 | + * |
|
433 | + * @param string $html The html to filter. |
|
434 | + * @param string $location The location to output the html. |
|
435 | + * @param array $cf The custom field array. |
|
436 | + * @since 1.6.6 |
|
437 | + */ |
|
438 | + $html = apply_filters("geodir_custom_field_output_time_var_{$html_var}",$html,$location,$cf); |
|
439 | + } |
|
440 | + |
|
441 | + // Check if there is a custom field key specific filter. |
|
442 | + if(has_filter("geodir_custom_field_output_time_key_{$cf['field_type_key']}")){ |
|
443 | + /** |
|
444 | + * Filter the time html by field type key. |
|
445 | + * |
|
446 | + * @param string $html The html to filter. |
|
447 | + * @param string $location The location to output the html. |
|
448 | + * @param array $cf The custom field array. |
|
449 | + * @since 1.6.6 |
|
450 | + */ |
|
451 | + $html = apply_filters("geodir_custom_field_output_time_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
452 | + } |
|
453 | + |
|
454 | + // If not html then we run the standard output. |
|
455 | + if(empty($html)){ |
|
456 | + |
|
457 | + if ($post->{$cf['htmlvar_name']}): |
|
458 | + |
|
459 | + $value = ''; |
|
460 | + if ($post->{$cf['htmlvar_name']} != '') |
|
461 | + //$value = date('h:i',strtotime($post->{$cf['htmlvar_name']})); |
|
462 | + $value = date(get_option('time_format'), strtotime($post->{$cf['htmlvar_name']})); |
|
463 | + |
|
464 | + $field_icon = geodir_field_icon_proccess($cf); |
|
465 | + if (strpos($field_icon, 'http') !== false) { |
|
466 | + $field_icon_af = ''; |
|
467 | + } elseif ($field_icon == '') { |
|
468 | + $field_icon_af = '<i class="fa fa-clock-o"></i>'; |
|
469 | + } else { |
|
470 | + $field_icon_af = $field_icon; |
|
471 | + $field_icon = ''; |
|
472 | + } |
|
473 | + |
|
474 | + |
|
475 | + $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-time" style="' . $field_icon . '">' . $field_icon_af; |
|
476 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ' '; |
|
477 | + $html .= '</span>' . $value . '</div>'; |
|
478 | + |
|
479 | + endif; |
|
480 | + |
|
481 | + } |
|
482 | + |
|
483 | + return $html; |
|
484 | 484 | } |
485 | 485 | add_filter('geodir_custom_field_output_time','geodir_cf_time',10,3); |
486 | 486 | |
@@ -496,111 +496,111 @@ discard block |
||
496 | 496 | * @return string The html to output for the custom field. |
497 | 497 | */ |
498 | 498 | function geodir_cf_datepicker($html,$location,$cf,$p=''){ |
499 | - global $preview; |
|
500 | - // check we have the post value |
|
501 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
502 | - else{ global $post;} |
|
503 | - |
|
504 | - if(!is_array($cf) && $cf!=''){ |
|
505 | - $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
506 | - if(!$cf){return NULL;} |
|
507 | - } |
|
508 | - |
|
509 | - $html_var = $cf['htmlvar_name']; |
|
510 | - |
|
511 | - // Check if there is a location specific filter. |
|
512 | - if(has_filter("geodir_custom_field_output_datepicker_loc_{$location}")){ |
|
513 | - /** |
|
514 | - * Filter the datepicker html by location. |
|
515 | - * |
|
516 | - * @param string $html The html to filter. |
|
517 | - * @param array $cf The custom field array. |
|
518 | - * @since 1.6.6 |
|
519 | - */ |
|
520 | - $html = apply_filters("geodir_custom_field_output_datepicker_loc_{$location}",$html,$cf); |
|
521 | - } |
|
522 | - |
|
523 | - // Check if there is a custom field specific filter. |
|
524 | - if(has_filter("geodir_custom_field_output_datepicker_var_{$html_var}")){ |
|
525 | - /** |
|
526 | - * Filter the datepicker html by individual custom field. |
|
527 | - * |
|
528 | - * @param string $html The html to filter. |
|
529 | - * @param string $location The location to output the html. |
|
530 | - * @param array $cf The custom field array. |
|
531 | - * @since 1.6.6 |
|
532 | - */ |
|
533 | - $html = apply_filters("geodir_custom_field_output_datepicker_var_{$html_var}",$html,$location,$cf); |
|
534 | - } |
|
535 | - |
|
536 | - // Check if there is a custom field key specific filter. |
|
537 | - if(has_filter("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}")){ |
|
538 | - /** |
|
539 | - * Filter the datepicker html by field type key. |
|
540 | - * |
|
541 | - * @param string $html The html to filter. |
|
542 | - * @param string $location The location to output the html. |
|
543 | - * @param array $cf The custom field array. |
|
544 | - * @since 1.6.6 |
|
545 | - */ |
|
546 | - $html = apply_filters("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
547 | - } |
|
548 | - |
|
549 | - // If not html then we run the standard output. |
|
550 | - if(empty($html)){ |
|
551 | - |
|
552 | - if ($post->{$cf['htmlvar_name']}): |
|
553 | - |
|
554 | - $date_format = geodir_default_date_format(); |
|
555 | - if ($cf['extra_fields'] != '') { |
|
556 | - $date_format = unserialize($cf['extra_fields']); |
|
557 | - $date_format = $date_format['date_format']; |
|
558 | - } |
|
559 | - // check if we need to change the format or not |
|
560 | - $date_format_len = strlen(str_replace(' ', '', $date_format)); |
|
561 | - if($date_format_len>5){// if greater then 4 then it's the old style format. |
|
562 | - |
|
563 | - $search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format |
|
564 | - $replace = array('d','j','l','m','n','F','Y');//PHP date format |
|
565 | - |
|
566 | - $date_format = str_replace($search, $replace, $date_format); |
|
567 | - |
|
568 | - $post_htmlvar_value = ($date_format == 'd/m/Y' || $date_format == 'j/n/Y' ) ? str_replace('/', '-', $post->{$cf['htmlvar_name']}) : $post->{$cf['htmlvar_name']}; // PHP doesn't work well with dd/mm/yyyy format |
|
569 | - }else{ |
|
570 | - $post_htmlvar_value = $post->{$cf['htmlvar_name']}; |
|
571 | - } |
|
572 | - |
|
573 | - if ($post->{$cf['htmlvar_name']} != '' && $post->{$cf['htmlvar_name']}!="0000-00-00") { |
|
574 | - $date_format_from = $preview ? $date_format : 'Y-m-d'; |
|
575 | - $value = geodir_date($post_htmlvar_value, $date_format, $date_format_from); // save as sql format Y-m-d |
|
576 | - //$post_htmlvar_value = strpos($post_htmlvar_value, '/') !== false ? str_replace('/', '-', $post_htmlvar_value) : $post_htmlvar_value; |
|
577 | - //$value = date_i18n($date_format, strtotime($post_htmlvar_value)); |
|
578 | - }else{ |
|
579 | - return ''; |
|
580 | - } |
|
581 | - |
|
582 | - $field_icon = geodir_field_icon_proccess($cf); |
|
583 | - |
|
584 | - if (strpos($field_icon, 'http') !== false) { |
|
585 | - $field_icon_af = ''; |
|
586 | - } elseif ($field_icon == '') { |
|
587 | - $field_icon_af = '<i class="fa fa-calendar"></i>'; |
|
588 | - } else { |
|
589 | - $field_icon_af = $field_icon; |
|
590 | - $field_icon = ''; |
|
591 | - } |
|
592 | - |
|
593 | - |
|
594 | - |
|
595 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-datepicker" style="' . $field_icon . '">' . $field_icon_af; |
|
596 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
597 | - $html .= '</span>' . $value . '</div>'; |
|
598 | - |
|
599 | - endif; |
|
600 | - |
|
601 | - } |
|
602 | - |
|
603 | - return $html; |
|
499 | + global $preview; |
|
500 | + // check we have the post value |
|
501 | + if(is_int($p)){$post = geodir_get_post_info($p);} |
|
502 | + else{ global $post;} |
|
503 | + |
|
504 | + if(!is_array($cf) && $cf!=''){ |
|
505 | + $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
506 | + if(!$cf){return NULL;} |
|
507 | + } |
|
508 | + |
|
509 | + $html_var = $cf['htmlvar_name']; |
|
510 | + |
|
511 | + // Check if there is a location specific filter. |
|
512 | + if(has_filter("geodir_custom_field_output_datepicker_loc_{$location}")){ |
|
513 | + /** |
|
514 | + * Filter the datepicker html by location. |
|
515 | + * |
|
516 | + * @param string $html The html to filter. |
|
517 | + * @param array $cf The custom field array. |
|
518 | + * @since 1.6.6 |
|
519 | + */ |
|
520 | + $html = apply_filters("geodir_custom_field_output_datepicker_loc_{$location}",$html,$cf); |
|
521 | + } |
|
522 | + |
|
523 | + // Check if there is a custom field specific filter. |
|
524 | + if(has_filter("geodir_custom_field_output_datepicker_var_{$html_var}")){ |
|
525 | + /** |
|
526 | + * Filter the datepicker html by individual custom field. |
|
527 | + * |
|
528 | + * @param string $html The html to filter. |
|
529 | + * @param string $location The location to output the html. |
|
530 | + * @param array $cf The custom field array. |
|
531 | + * @since 1.6.6 |
|
532 | + */ |
|
533 | + $html = apply_filters("geodir_custom_field_output_datepicker_var_{$html_var}",$html,$location,$cf); |
|
534 | + } |
|
535 | + |
|
536 | + // Check if there is a custom field key specific filter. |
|
537 | + if(has_filter("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}")){ |
|
538 | + /** |
|
539 | + * Filter the datepicker html by field type key. |
|
540 | + * |
|
541 | + * @param string $html The html to filter. |
|
542 | + * @param string $location The location to output the html. |
|
543 | + * @param array $cf The custom field array. |
|
544 | + * @since 1.6.6 |
|
545 | + */ |
|
546 | + $html = apply_filters("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
547 | + } |
|
548 | + |
|
549 | + // If not html then we run the standard output. |
|
550 | + if(empty($html)){ |
|
551 | + |
|
552 | + if ($post->{$cf['htmlvar_name']}): |
|
553 | + |
|
554 | + $date_format = geodir_default_date_format(); |
|
555 | + if ($cf['extra_fields'] != '') { |
|
556 | + $date_format = unserialize($cf['extra_fields']); |
|
557 | + $date_format = $date_format['date_format']; |
|
558 | + } |
|
559 | + // check if we need to change the format or not |
|
560 | + $date_format_len = strlen(str_replace(' ', '', $date_format)); |
|
561 | + if($date_format_len>5){// if greater then 4 then it's the old style format. |
|
562 | + |
|
563 | + $search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format |
|
564 | + $replace = array('d','j','l','m','n','F','Y');//PHP date format |
|
565 | + |
|
566 | + $date_format = str_replace($search, $replace, $date_format); |
|
567 | + |
|
568 | + $post_htmlvar_value = ($date_format == 'd/m/Y' || $date_format == 'j/n/Y' ) ? str_replace('/', '-', $post->{$cf['htmlvar_name']}) : $post->{$cf['htmlvar_name']}; // PHP doesn't work well with dd/mm/yyyy format |
|
569 | + }else{ |
|
570 | + $post_htmlvar_value = $post->{$cf['htmlvar_name']}; |
|
571 | + } |
|
572 | + |
|
573 | + if ($post->{$cf['htmlvar_name']} != '' && $post->{$cf['htmlvar_name']}!="0000-00-00") { |
|
574 | + $date_format_from = $preview ? $date_format : 'Y-m-d'; |
|
575 | + $value = geodir_date($post_htmlvar_value, $date_format, $date_format_from); // save as sql format Y-m-d |
|
576 | + //$post_htmlvar_value = strpos($post_htmlvar_value, '/') !== false ? str_replace('/', '-', $post_htmlvar_value) : $post_htmlvar_value; |
|
577 | + //$value = date_i18n($date_format, strtotime($post_htmlvar_value)); |
|
578 | + }else{ |
|
579 | + return ''; |
|
580 | + } |
|
581 | + |
|
582 | + $field_icon = geodir_field_icon_proccess($cf); |
|
583 | + |
|
584 | + if (strpos($field_icon, 'http') !== false) { |
|
585 | + $field_icon_af = ''; |
|
586 | + } elseif ($field_icon == '') { |
|
587 | + $field_icon_af = '<i class="fa fa-calendar"></i>'; |
|
588 | + } else { |
|
589 | + $field_icon_af = $field_icon; |
|
590 | + $field_icon = ''; |
|
591 | + } |
|
592 | + |
|
593 | + |
|
594 | + |
|
595 | + $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-datepicker" style="' . $field_icon . '">' . $field_icon_af; |
|
596 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
597 | + $html .= '</span>' . $value . '</div>'; |
|
598 | + |
|
599 | + endif; |
|
600 | + |
|
601 | + } |
|
602 | + |
|
603 | + return $html; |
|
604 | 604 | } |
605 | 605 | add_filter('geodir_custom_field_output_datepicker','geodir_cf_datepicker',10,3); |
606 | 606 | |
@@ -617,84 +617,84 @@ discard block |
||
617 | 617 | */ |
618 | 618 | function geodir_cf_text($html,$location,$cf,$p=''){ |
619 | 619 | |
620 | - // check we have the post value |
|
621 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
622 | - else{ global $post;} |
|
623 | - |
|
624 | - if(!is_array($cf) && $cf!=''){ |
|
625 | - $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
626 | - if(!$cf){return NULL;} |
|
627 | - } |
|
628 | - |
|
629 | - $html_var = $cf['htmlvar_name']; |
|
630 | - |
|
631 | - // Check if there is a location specific filter. |
|
632 | - if(has_filter("geodir_custom_field_output_text_loc_{$location}")){ |
|
633 | - /** |
|
634 | - * Filter the text html by location. |
|
635 | - * |
|
636 | - * @param string $html The html to filter. |
|
637 | - * @param array $cf The custom field array. |
|
638 | - * @since 1.6.6 |
|
639 | - */ |
|
640 | - $html = apply_filters("geodir_custom_field_output_text_loc_{$location}",$html,$cf); |
|
641 | - } |
|
642 | - |
|
643 | - // Check if there is a custom field specific filter. |
|
644 | - if(has_filter("geodir_custom_field_output_text_var_{$html_var}")){ |
|
645 | - /** |
|
646 | - * Filter the text html by individual custom field. |
|
647 | - * |
|
648 | - * @param string $html The html to filter. |
|
649 | - * @param string $location The location to output the html. |
|
650 | - * @param array $cf The custom field array. |
|
651 | - * @since 1.6.6 |
|
652 | - */ |
|
653 | - $html = apply_filters("geodir_custom_field_output_text_var_{$html_var}",$html,$location,$cf); |
|
654 | - } |
|
655 | - |
|
656 | - // Check if there is a custom field key specific filter. |
|
657 | - if(has_filter("geodir_custom_field_output_text_key_{$cf['field_type_key']}")){ |
|
658 | - /** |
|
659 | - * Filter the text html by field type key. |
|
660 | - * |
|
661 | - * @param string $html The html to filter. |
|
662 | - * @param string $location The location to output the html. |
|
663 | - * @param array $cf The custom field array. |
|
664 | - * @since 1.6.6 |
|
665 | - */ |
|
666 | - $html = apply_filters("geodir_custom_field_output_text_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
667 | - } |
|
620 | + // check we have the post value |
|
621 | + if(is_int($p)){$post = geodir_get_post_info($p);} |
|
622 | + else{ global $post;} |
|
623 | + |
|
624 | + if(!is_array($cf) && $cf!=''){ |
|
625 | + $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
626 | + if(!$cf){return NULL;} |
|
627 | + } |
|
628 | + |
|
629 | + $html_var = $cf['htmlvar_name']; |
|
630 | + |
|
631 | + // Check if there is a location specific filter. |
|
632 | + if(has_filter("geodir_custom_field_output_text_loc_{$location}")){ |
|
633 | + /** |
|
634 | + * Filter the text html by location. |
|
635 | + * |
|
636 | + * @param string $html The html to filter. |
|
637 | + * @param array $cf The custom field array. |
|
638 | + * @since 1.6.6 |
|
639 | + */ |
|
640 | + $html = apply_filters("geodir_custom_field_output_text_loc_{$location}",$html,$cf); |
|
641 | + } |
|
642 | + |
|
643 | + // Check if there is a custom field specific filter. |
|
644 | + if(has_filter("geodir_custom_field_output_text_var_{$html_var}")){ |
|
645 | + /** |
|
646 | + * Filter the text html by individual custom field. |
|
647 | + * |
|
648 | + * @param string $html The html to filter. |
|
649 | + * @param string $location The location to output the html. |
|
650 | + * @param array $cf The custom field array. |
|
651 | + * @since 1.6.6 |
|
652 | + */ |
|
653 | + $html = apply_filters("geodir_custom_field_output_text_var_{$html_var}",$html,$location,$cf); |
|
654 | + } |
|
655 | + |
|
656 | + // Check if there is a custom field key specific filter. |
|
657 | + if(has_filter("geodir_custom_field_output_text_key_{$cf['field_type_key']}")){ |
|
658 | + /** |
|
659 | + * Filter the text html by field type key. |
|
660 | + * |
|
661 | + * @param string $html The html to filter. |
|
662 | + * @param string $location The location to output the html. |
|
663 | + * @param array $cf The custom field array. |
|
664 | + * @since 1.6.6 |
|
665 | + */ |
|
666 | + $html = apply_filters("geodir_custom_field_output_text_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
667 | + } |
|
668 | 668 | |
669 | 669 | |
670 | 670 | |
671 | - // If not html then we run the standard output. |
|
672 | - if(empty($html)){ |
|
671 | + // If not html then we run the standard output. |
|
672 | + if(empty($html)){ |
|
673 | 673 | |
674 | - if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != '' ): |
|
674 | + if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != '' ): |
|
675 | 675 | |
676 | - $class = ($cf['htmlvar_name'] == 'geodir_timing') ? "geodir-i-time" : "geodir-i-text"; |
|
676 | + $class = ($cf['htmlvar_name'] == 'geodir_timing') ? "geodir-i-time" : "geodir-i-text"; |
|
677 | 677 | |
678 | - $field_icon = geodir_field_icon_proccess($cf); |
|
679 | - if (strpos($field_icon, 'http') !== false) { |
|
680 | - $field_icon_af = ''; |
|
681 | - } elseif ($field_icon == '') { |
|
682 | - $field_icon_af = ($cf['htmlvar_name'] == 'geodir_timing') ? '<i class="fa fa-clock-o"></i>' : ""; |
|
683 | - } else { |
|
684 | - $field_icon_af = $field_icon; |
|
685 | - $field_icon = ''; |
|
686 | - } |
|
678 | + $field_icon = geodir_field_icon_proccess($cf); |
|
679 | + if (strpos($field_icon, 'http') !== false) { |
|
680 | + $field_icon_af = ''; |
|
681 | + } elseif ($field_icon == '') { |
|
682 | + $field_icon_af = ($cf['htmlvar_name'] == 'geodir_timing') ? '<i class="fa fa-clock-o"></i>' : ""; |
|
683 | + } else { |
|
684 | + $field_icon_af = $field_icon; |
|
685 | + $field_icon = ''; |
|
686 | + } |
|
687 | 687 | |
688 | 688 | |
689 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="'.$class.'" style="' . $field_icon . '">' . $field_icon_af; |
|
690 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
691 | - $html .= '</span>' . $post->{$cf['htmlvar_name']} . '</div>'; |
|
689 | + $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="'.$class.'" style="' . $field_icon . '">' . $field_icon_af; |
|
690 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
691 | + $html .= '</span>' . $post->{$cf['htmlvar_name']} . '</div>'; |
|
692 | 692 | |
693 | - endif; |
|
693 | + endif; |
|
694 | 694 | |
695 | - } |
|
695 | + } |
|
696 | 696 | |
697 | - return $html; |
|
697 | + return $html; |
|
698 | 698 | } |
699 | 699 | add_filter('geodir_custom_field_output_text','geodir_cf_text',10,3); |
700 | 700 | |
@@ -711,98 +711,98 @@ discard block |
||
711 | 711 | */ |
712 | 712 | function geodir_cf_radio($html,$location,$cf,$p=''){ |
713 | 713 | |
714 | - // check we have the post value |
|
715 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
716 | - else{ global $post;} |
|
717 | - |
|
718 | - if(!is_array($cf) && $cf!=''){ |
|
719 | - $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
720 | - if(!$cf){return NULL;} |
|
721 | - } |
|
722 | - |
|
723 | - $html_var = $cf['htmlvar_name']; |
|
724 | - |
|
725 | - // Check if there is a location specific filter. |
|
726 | - if(has_filter("geodir_custom_field_output_radio_loc_{$location}")){ |
|
727 | - /** |
|
728 | - * Filter the radio html by location. |
|
729 | - * |
|
730 | - * @param string $html The html to filter. |
|
731 | - * @param array $cf The custom field array. |
|
732 | - * @since 1.6.6 |
|
733 | - */ |
|
734 | - $html = apply_filters("geodir_custom_field_output_radio_loc_{$location}",$html,$cf); |
|
735 | - } |
|
736 | - |
|
737 | - // Check if there is a custom field specific filter. |
|
738 | - if(has_filter("geodir_custom_field_output_radio_var_{$html_var}")){ |
|
739 | - /** |
|
740 | - * Filter the radio html by individual custom field. |
|
741 | - * |
|
742 | - * @param string $html The html to filter. |
|
743 | - * @param string $location The location to output the html. |
|
744 | - * @param array $cf The custom field array. |
|
745 | - * @since 1.6.6 |
|
746 | - */ |
|
747 | - $html = apply_filters("geodir_custom_field_output_radio_var_{$html_var}",$html,$location,$cf); |
|
748 | - } |
|
749 | - |
|
750 | - // Check if there is a custom field key specific filter. |
|
751 | - if(has_filter("geodir_custom_field_output_radio_key_{$cf['field_type_key']}")){ |
|
752 | - /** |
|
753 | - * Filter the radio html by field type key. |
|
754 | - * |
|
755 | - * @param string $html The html to filter. |
|
756 | - * @param string $location The location to output the html. |
|
757 | - * @param array $cf The custom field array. |
|
758 | - * @since 1.6.6 |
|
759 | - */ |
|
760 | - $html = apply_filters("geodir_custom_field_output_radio_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
761 | - } |
|
762 | - |
|
763 | - // If not html then we run the standard output. |
|
764 | - if(empty($html)){ |
|
765 | - |
|
766 | - $html_val = isset($post->{$cf['htmlvar_name']}) ? __($post->{$cf['htmlvar_name']}, 'geodirectory') : ''; |
|
767 | - if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != ''): |
|
768 | - |
|
769 | - if ($post->{$cf['htmlvar_name']} == 'f' || $post->{$cf['htmlvar_name']} == '0') { |
|
770 | - $html_val = __('No', 'geodirectory'); |
|
771 | - } else if ($post->{$cf['htmlvar_name']} == 't' || $post->{$cf['htmlvar_name']} == '1') { |
|
772 | - $html_val = __('Yes', 'geodirectory'); |
|
773 | - } else { |
|
774 | - if (!empty($cf['option_values'])) { |
|
775 | - $cf_option_values = geodir_string_values_to_options(stripslashes_deep($cf['option_values']), true); |
|
776 | - |
|
777 | - if (!empty($cf_option_values)) { |
|
778 | - foreach ($cf_option_values as $cf_option_value) { |
|
779 | - if (isset($cf_option_value['value']) && $cf_option_value['value'] == $post->{$cf['htmlvar_name']}) { |
|
780 | - $html_val = $cf_option_value['label']; |
|
781 | - } |
|
782 | - } |
|
783 | - } |
|
784 | - } |
|
785 | - } |
|
786 | - |
|
787 | - $field_icon = geodir_field_icon_proccess($cf); |
|
788 | - if (strpos($field_icon, 'http') !== false) { |
|
789 | - $field_icon_af = ''; |
|
790 | - } elseif ($field_icon == '') { |
|
791 | - $field_icon_af = ''; |
|
792 | - } else { |
|
793 | - $field_icon_af = $field_icon; |
|
794 | - $field_icon = ''; |
|
795 | - } |
|
796 | - |
|
797 | - |
|
798 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-radio" style="' . $field_icon . '">' . $field_icon_af; |
|
799 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
800 | - $html .= '</span>' . $html_val . '</div>'; |
|
801 | - endif; |
|
802 | - |
|
803 | - } |
|
804 | - |
|
805 | - return $html; |
|
714 | + // check we have the post value |
|
715 | + if(is_int($p)){$post = geodir_get_post_info($p);} |
|
716 | + else{ global $post;} |
|
717 | + |
|
718 | + if(!is_array($cf) && $cf!=''){ |
|
719 | + $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
720 | + if(!$cf){return NULL;} |
|
721 | + } |
|
722 | + |
|
723 | + $html_var = $cf['htmlvar_name']; |
|
724 | + |
|
725 | + // Check if there is a location specific filter. |
|
726 | + if(has_filter("geodir_custom_field_output_radio_loc_{$location}")){ |
|
727 | + /** |
|
728 | + * Filter the radio html by location. |
|
729 | + * |
|
730 | + * @param string $html The html to filter. |
|
731 | + * @param array $cf The custom field array. |
|
732 | + * @since 1.6.6 |
|
733 | + */ |
|
734 | + $html = apply_filters("geodir_custom_field_output_radio_loc_{$location}",$html,$cf); |
|
735 | + } |
|
736 | + |
|
737 | + // Check if there is a custom field specific filter. |
|
738 | + if(has_filter("geodir_custom_field_output_radio_var_{$html_var}")){ |
|
739 | + /** |
|
740 | + * Filter the radio html by individual custom field. |
|
741 | + * |
|
742 | + * @param string $html The html to filter. |
|
743 | + * @param string $location The location to output the html. |
|
744 | + * @param array $cf The custom field array. |
|
745 | + * @since 1.6.6 |
|
746 | + */ |
|
747 | + $html = apply_filters("geodir_custom_field_output_radio_var_{$html_var}",$html,$location,$cf); |
|
748 | + } |
|
749 | + |
|
750 | + // Check if there is a custom field key specific filter. |
|
751 | + if(has_filter("geodir_custom_field_output_radio_key_{$cf['field_type_key']}")){ |
|
752 | + /** |
|
753 | + * Filter the radio html by field type key. |
|
754 | + * |
|
755 | + * @param string $html The html to filter. |
|
756 | + * @param string $location The location to output the html. |
|
757 | + * @param array $cf The custom field array. |
|
758 | + * @since 1.6.6 |
|
759 | + */ |
|
760 | + $html = apply_filters("geodir_custom_field_output_radio_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
761 | + } |
|
762 | + |
|
763 | + // If not html then we run the standard output. |
|
764 | + if(empty($html)){ |
|
765 | + |
|
766 | + $html_val = isset($post->{$cf['htmlvar_name']}) ? __($post->{$cf['htmlvar_name']}, 'geodirectory') : ''; |
|
767 | + if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != ''): |
|
768 | + |
|
769 | + if ($post->{$cf['htmlvar_name']} == 'f' || $post->{$cf['htmlvar_name']} == '0') { |
|
770 | + $html_val = __('No', 'geodirectory'); |
|
771 | + } else if ($post->{$cf['htmlvar_name']} == 't' || $post->{$cf['htmlvar_name']} == '1') { |
|
772 | + $html_val = __('Yes', 'geodirectory'); |
|
773 | + } else { |
|
774 | + if (!empty($cf['option_values'])) { |
|
775 | + $cf_option_values = geodir_string_values_to_options(stripslashes_deep($cf['option_values']), true); |
|
776 | + |
|
777 | + if (!empty($cf_option_values)) { |
|
778 | + foreach ($cf_option_values as $cf_option_value) { |
|
779 | + if (isset($cf_option_value['value']) && $cf_option_value['value'] == $post->{$cf['htmlvar_name']}) { |
|
780 | + $html_val = $cf_option_value['label']; |
|
781 | + } |
|
782 | + } |
|
783 | + } |
|
784 | + } |
|
785 | + } |
|
786 | + |
|
787 | + $field_icon = geodir_field_icon_proccess($cf); |
|
788 | + if (strpos($field_icon, 'http') !== false) { |
|
789 | + $field_icon_af = ''; |
|
790 | + } elseif ($field_icon == '') { |
|
791 | + $field_icon_af = ''; |
|
792 | + } else { |
|
793 | + $field_icon_af = $field_icon; |
|
794 | + $field_icon = ''; |
|
795 | + } |
|
796 | + |
|
797 | + |
|
798 | + $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-radio" style="' . $field_icon . '">' . $field_icon_af; |
|
799 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
800 | + $html .= '</span>' . $html_val . '</div>'; |
|
801 | + endif; |
|
802 | + |
|
803 | + } |
|
804 | + |
|
805 | + return $html; |
|
806 | 806 | } |
807 | 807 | add_filter('geodir_custom_field_output_radio','geodir_cf_radio',10,3); |
808 | 808 | |
@@ -819,92 +819,92 @@ discard block |
||
819 | 819 | */ |
820 | 820 | function geodir_cf_select($html,$location,$cf,$p=''){ |
821 | 821 | |
822 | - // check we have the post value |
|
823 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
824 | - else{ global $post;} |
|
825 | - |
|
826 | - if(!is_array($cf) && $cf!=''){ |
|
827 | - $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
828 | - if(!$cf){return NULL;} |
|
829 | - } |
|
830 | - |
|
831 | - $html_var = $cf['htmlvar_name']; |
|
832 | - |
|
833 | - // Check if there is a location specific filter. |
|
834 | - if(has_filter("geodir_custom_field_output_select_loc_{$location}")){ |
|
835 | - /** |
|
836 | - * Filter the select html by location. |
|
837 | - * |
|
838 | - * @param string $html The html to filter. |
|
839 | - * @param array $cf The custom field array. |
|
840 | - * @since 1.6.6 |
|
841 | - */ |
|
842 | - $html = apply_filters("geodir_custom_field_output_select_loc_{$location}",$html,$cf); |
|
843 | - } |
|
844 | - |
|
845 | - // Check if there is a custom field specific filter. |
|
846 | - if(has_filter("geodir_custom_field_output_select_var_{$html_var}")){ |
|
847 | - /** |
|
848 | - * Filter the select html by individual custom field. |
|
849 | - * |
|
850 | - * @param string $html The html to filter. |
|
851 | - * @param string $location The location to output the html. |
|
852 | - * @param array $cf The custom field array. |
|
853 | - * @since 1.6.6 |
|
854 | - */ |
|
855 | - $html = apply_filters("geodir_custom_field_output_select_var_{$html_var}",$html,$location,$cf); |
|
856 | - } |
|
857 | - |
|
858 | - // Check if there is a custom field key specific filter. |
|
859 | - if(has_filter("geodir_custom_field_output_select_key_{$cf['field_type_key']}")){ |
|
860 | - /** |
|
861 | - * Filter the select html by field type key. |
|
862 | - * |
|
863 | - * @param string $html The html to filter. |
|
864 | - * @param string $location The location to output the html. |
|
865 | - * @param array $cf The custom field array. |
|
866 | - * @since 1.6.6 |
|
867 | - */ |
|
868 | - $html = apply_filters("geodir_custom_field_output_select_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
869 | - } |
|
870 | - |
|
871 | - // If not html then we run the standard output. |
|
872 | - if(empty($html)){ |
|
873 | - |
|
874 | - if ($post->{$cf['htmlvar_name']}): |
|
875 | - $field_value = __($post->{$cf['htmlvar_name']}, 'geodirectory'); |
|
876 | - |
|
877 | - if (!empty($cf['option_values'])) { |
|
878 | - $cf_option_values = geodir_string_values_to_options(stripslashes_deep($cf['option_values']), true); |
|
879 | - |
|
880 | - if (!empty($cf_option_values)) { |
|
881 | - foreach ($cf_option_values as $cf_option_value) { |
|
882 | - if (isset($cf_option_value['value']) && $cf_option_value['value'] == $post->{$cf['htmlvar_name']}) { |
|
883 | - //$field_value = $cf_option_value['label']; // no longer needed here. |
|
884 | - } |
|
885 | - } |
|
886 | - } |
|
887 | - } |
|
888 | - |
|
889 | - $field_icon = geodir_field_icon_proccess($cf); |
|
890 | - if (strpos($field_icon, 'http') !== false) { |
|
891 | - $field_icon_af = ''; |
|
892 | - } elseif ($field_icon == '') { |
|
893 | - $field_icon_af = ''; |
|
894 | - } else { |
|
895 | - $field_icon_af = $field_icon; |
|
896 | - $field_icon = ''; |
|
897 | - } |
|
898 | - |
|
899 | - |
|
900 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af; |
|
901 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
902 | - $html .= '</span>' . $field_value . '</div>'; |
|
903 | - endif; |
|
904 | - |
|
905 | - } |
|
906 | - |
|
907 | - return $html; |
|
822 | + // check we have the post value |
|
823 | + if(is_int($p)){$post = geodir_get_post_info($p);} |
|
824 | + else{ global $post;} |
|
825 | + |
|
826 | + if(!is_array($cf) && $cf!=''){ |
|
827 | + $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
828 | + if(!$cf){return NULL;} |
|
829 | + } |
|
830 | + |
|
831 | + $html_var = $cf['htmlvar_name']; |
|
832 | + |
|
833 | + // Check if there is a location specific filter. |
|
834 | + if(has_filter("geodir_custom_field_output_select_loc_{$location}")){ |
|
835 | + /** |
|
836 | + * Filter the select html by location. |
|
837 | + * |
|
838 | + * @param string $html The html to filter. |
|
839 | + * @param array $cf The custom field array. |
|
840 | + * @since 1.6.6 |
|
841 | + */ |
|
842 | + $html = apply_filters("geodir_custom_field_output_select_loc_{$location}",$html,$cf); |
|
843 | + } |
|
844 | + |
|
845 | + // Check if there is a custom field specific filter. |
|
846 | + if(has_filter("geodir_custom_field_output_select_var_{$html_var}")){ |
|
847 | + /** |
|
848 | + * Filter the select html by individual custom field. |
|
849 | + * |
|
850 | + * @param string $html The html to filter. |
|
851 | + * @param string $location The location to output the html. |
|
852 | + * @param array $cf The custom field array. |
|
853 | + * @since 1.6.6 |
|
854 | + */ |
|
855 | + $html = apply_filters("geodir_custom_field_output_select_var_{$html_var}",$html,$location,$cf); |
|
856 | + } |
|
857 | + |
|
858 | + // Check if there is a custom field key specific filter. |
|
859 | + if(has_filter("geodir_custom_field_output_select_key_{$cf['field_type_key']}")){ |
|
860 | + /** |
|
861 | + * Filter the select html by field type key. |
|
862 | + * |
|
863 | + * @param string $html The html to filter. |
|
864 | + * @param string $location The location to output the html. |
|
865 | + * @param array $cf The custom field array. |
|
866 | + * @since 1.6.6 |
|
867 | + */ |
|
868 | + $html = apply_filters("geodir_custom_field_output_select_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
869 | + } |
|
870 | + |
|
871 | + // If not html then we run the standard output. |
|
872 | + if(empty($html)){ |
|
873 | + |
|
874 | + if ($post->{$cf['htmlvar_name']}): |
|
875 | + $field_value = __($post->{$cf['htmlvar_name']}, 'geodirectory'); |
|
876 | + |
|
877 | + if (!empty($cf['option_values'])) { |
|
878 | + $cf_option_values = geodir_string_values_to_options(stripslashes_deep($cf['option_values']), true); |
|
879 | + |
|
880 | + if (!empty($cf_option_values)) { |
|
881 | + foreach ($cf_option_values as $cf_option_value) { |
|
882 | + if (isset($cf_option_value['value']) && $cf_option_value['value'] == $post->{$cf['htmlvar_name']}) { |
|
883 | + //$field_value = $cf_option_value['label']; // no longer needed here. |
|
884 | + } |
|
885 | + } |
|
886 | + } |
|
887 | + } |
|
888 | + |
|
889 | + $field_icon = geodir_field_icon_proccess($cf); |
|
890 | + if (strpos($field_icon, 'http') !== false) { |
|
891 | + $field_icon_af = ''; |
|
892 | + } elseif ($field_icon == '') { |
|
893 | + $field_icon_af = ''; |
|
894 | + } else { |
|
895 | + $field_icon_af = $field_icon; |
|
896 | + $field_icon = ''; |
|
897 | + } |
|
898 | + |
|
899 | + |
|
900 | + $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af; |
|
901 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
902 | + $html .= '</span>' . $field_value . '</div>'; |
|
903 | + endif; |
|
904 | + |
|
905 | + } |
|
906 | + |
|
907 | + return $html; |
|
908 | 908 | } |
909 | 909 | add_filter('geodir_custom_field_output_select','geodir_cf_select',10,3); |
910 | 910 | |
@@ -921,117 +921,117 @@ discard block |
||
921 | 921 | */ |
922 | 922 | function geodir_cf_multiselect($html,$location,$cf,$p=''){ |
923 | 923 | |
924 | - // check we have the post value |
|
925 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
926 | - else{ global $post;} |
|
927 | - |
|
928 | - if(!is_array($cf) && $cf!=''){ |
|
929 | - $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
930 | - if(!$cf){return NULL;} |
|
931 | - } |
|
932 | - |
|
933 | - $html_var = $cf['htmlvar_name']; |
|
934 | - |
|
935 | - // Check if there is a location specific filter. |
|
936 | - if(has_filter("geodir_custom_field_output_multiselect_loc_{$location}")){ |
|
937 | - /** |
|
938 | - * Filter the multiselect html by location. |
|
939 | - * |
|
940 | - * @param string $html The html to filter. |
|
941 | - * @param array $cf The custom field array. |
|
942 | - * @since 1.6.6 |
|
943 | - */ |
|
944 | - $html = apply_filters("geodir_custom_field_output_multiselect_loc_{$location}",$html,$cf); |
|
945 | - } |
|
946 | - |
|
947 | - // Check if there is a custom field specific filter. |
|
948 | - if(has_filter("geodir_custom_field_output_multiselect_var_{$html_var}")){ |
|
949 | - /** |
|
950 | - * Filter the multiselect html by individual custom field. |
|
951 | - * |
|
952 | - * @param string $html The html to filter. |
|
953 | - * @param string $location The location to output the html. |
|
954 | - * @param array $cf The custom field array. |
|
955 | - * @since 1.6.6 |
|
956 | - */ |
|
957 | - $html = apply_filters("geodir_custom_field_output_multiselect_var_{$html_var}",$html,$location,$cf); |
|
958 | - } |
|
959 | - |
|
960 | - // Check if there is a custom field key specific filter. |
|
961 | - if(has_filter("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}")){ |
|
962 | - /** |
|
963 | - * Filter the multiselect html by field type key. |
|
964 | - * |
|
965 | - * @param string $html The html to filter. |
|
966 | - * @param string $location The location to output the html. |
|
967 | - * @param array $cf The custom field array. |
|
968 | - * @since 1.6.6 |
|
969 | - */ |
|
970 | - $html = apply_filters("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
971 | - } |
|
972 | - |
|
973 | - // If not html then we run the standard output. |
|
974 | - if(empty($html)){ |
|
975 | - |
|
976 | - |
|
977 | - if (!empty($post->{$cf['htmlvar_name']})): |
|
978 | - |
|
979 | - if (is_array($post->{$cf['htmlvar_name']})) { |
|
980 | - $post->{$cf['htmlvar_name']} = implode(', ', $post->{$cf['htmlvar_name']}); |
|
981 | - } |
|
982 | - |
|
983 | - $field_icon = geodir_field_icon_proccess($cf); |
|
984 | - if (strpos($field_icon, 'http') !== false) { |
|
985 | - $field_icon_af = ''; |
|
986 | - } elseif ($field_icon == '') { |
|
987 | - $field_icon_af = ''; |
|
988 | - } else { |
|
989 | - $field_icon_af = $field_icon; |
|
990 | - $field_icon = ''; |
|
991 | - } |
|
992 | - |
|
993 | - $field_values = explode(',', trim($post->{$cf['htmlvar_name']}, ",")); |
|
994 | - |
|
995 | - if(is_array($field_values)){ |
|
996 | - $field_values = array_map('trim', $field_values); |
|
997 | - } |
|
998 | - |
|
999 | - $option_values = array(); |
|
1000 | - if (!empty($cf['option_values'])) { |
|
1001 | - $cf_option_values = geodir_string_values_to_options(stripslashes_deep($cf['option_values']), true); |
|
1002 | - |
|
1003 | - if (!empty($cf_option_values)) { |
|
1004 | - foreach ($cf_option_values as $cf_option_value) { |
|
1005 | - if (isset($cf_option_value['value']) && in_array($cf_option_value['value'], $field_values)) { |
|
1006 | - $option_values[] = $cf_option_value['label']; |
|
1007 | - } |
|
1008 | - } |
|
1009 | - } |
|
1010 | - } |
|
1011 | - |
|
1012 | - |
|
1013 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af; |
|
1014 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
1015 | - $html .= '</span>'; |
|
1016 | - |
|
1017 | - if (count($option_values) > 1) { |
|
1018 | - $html .= '<ul>'; |
|
1019 | - |
|
1020 | - foreach ($option_values as $val) { |
|
1021 | - $html .= '<li>' . $val . '</li>'; |
|
1022 | - } |
|
1023 | - |
|
1024 | - $html .= '</ul>'; |
|
1025 | - } else { |
|
1026 | - $html .= $post->{$cf['htmlvar_name']}; |
|
1027 | - } |
|
1028 | - |
|
1029 | - $html .= '</div>'; |
|
1030 | - endif; |
|
1031 | - |
|
1032 | - } |
|
1033 | - |
|
1034 | - return $html; |
|
924 | + // check we have the post value |
|
925 | + if(is_int($p)){$post = geodir_get_post_info($p);} |
|
926 | + else{ global $post;} |
|
927 | + |
|
928 | + if(!is_array($cf) && $cf!=''){ |
|
929 | + $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
930 | + if(!$cf){return NULL;} |
|
931 | + } |
|
932 | + |
|
933 | + $html_var = $cf['htmlvar_name']; |
|
934 | + |
|
935 | + // Check if there is a location specific filter. |
|
936 | + if(has_filter("geodir_custom_field_output_multiselect_loc_{$location}")){ |
|
937 | + /** |
|
938 | + * Filter the multiselect html by location. |
|
939 | + * |
|
940 | + * @param string $html The html to filter. |
|
941 | + * @param array $cf The custom field array. |
|
942 | + * @since 1.6.6 |
|
943 | + */ |
|
944 | + $html = apply_filters("geodir_custom_field_output_multiselect_loc_{$location}",$html,$cf); |
|
945 | + } |
|
946 | + |
|
947 | + // Check if there is a custom field specific filter. |
|
948 | + if(has_filter("geodir_custom_field_output_multiselect_var_{$html_var}")){ |
|
949 | + /** |
|
950 | + * Filter the multiselect html by individual custom field. |
|
951 | + * |
|
952 | + * @param string $html The html to filter. |
|
953 | + * @param string $location The location to output the html. |
|
954 | + * @param array $cf The custom field array. |
|
955 | + * @since 1.6.6 |
|
956 | + */ |
|
957 | + $html = apply_filters("geodir_custom_field_output_multiselect_var_{$html_var}",$html,$location,$cf); |
|
958 | + } |
|
959 | + |
|
960 | + // Check if there is a custom field key specific filter. |
|
961 | + if(has_filter("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}")){ |
|
962 | + /** |
|
963 | + * Filter the multiselect html by field type key. |
|
964 | + * |
|
965 | + * @param string $html The html to filter. |
|
966 | + * @param string $location The location to output the html. |
|
967 | + * @param array $cf The custom field array. |
|
968 | + * @since 1.6.6 |
|
969 | + */ |
|
970 | + $html = apply_filters("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
971 | + } |
|
972 | + |
|
973 | + // If not html then we run the standard output. |
|
974 | + if(empty($html)){ |
|
975 | + |
|
976 | + |
|
977 | + if (!empty($post->{$cf['htmlvar_name']})): |
|
978 | + |
|
979 | + if (is_array($post->{$cf['htmlvar_name']})) { |
|
980 | + $post->{$cf['htmlvar_name']} = implode(', ', $post->{$cf['htmlvar_name']}); |
|
981 | + } |
|
982 | + |
|
983 | + $field_icon = geodir_field_icon_proccess($cf); |
|
984 | + if (strpos($field_icon, 'http') !== false) { |
|
985 | + $field_icon_af = ''; |
|
986 | + } elseif ($field_icon == '') { |
|
987 | + $field_icon_af = ''; |
|
988 | + } else { |
|
989 | + $field_icon_af = $field_icon; |
|
990 | + $field_icon = ''; |
|
991 | + } |
|
992 | + |
|
993 | + $field_values = explode(',', trim($post->{$cf['htmlvar_name']}, ",")); |
|
994 | + |
|
995 | + if(is_array($field_values)){ |
|
996 | + $field_values = array_map('trim', $field_values); |
|
997 | + } |
|
998 | + |
|
999 | + $option_values = array(); |
|
1000 | + if (!empty($cf['option_values'])) { |
|
1001 | + $cf_option_values = geodir_string_values_to_options(stripslashes_deep($cf['option_values']), true); |
|
1002 | + |
|
1003 | + if (!empty($cf_option_values)) { |
|
1004 | + foreach ($cf_option_values as $cf_option_value) { |
|
1005 | + if (isset($cf_option_value['value']) && in_array($cf_option_value['value'], $field_values)) { |
|
1006 | + $option_values[] = $cf_option_value['label']; |
|
1007 | + } |
|
1008 | + } |
|
1009 | + } |
|
1010 | + } |
|
1011 | + |
|
1012 | + |
|
1013 | + $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af; |
|
1014 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
1015 | + $html .= '</span>'; |
|
1016 | + |
|
1017 | + if (count($option_values) > 1) { |
|
1018 | + $html .= '<ul>'; |
|
1019 | + |
|
1020 | + foreach ($option_values as $val) { |
|
1021 | + $html .= '<li>' . $val . '</li>'; |
|
1022 | + } |
|
1023 | + |
|
1024 | + $html .= '</ul>'; |
|
1025 | + } else { |
|
1026 | + $html .= $post->{$cf['htmlvar_name']}; |
|
1027 | + } |
|
1028 | + |
|
1029 | + $html .= '</div>'; |
|
1030 | + endif; |
|
1031 | + |
|
1032 | + } |
|
1033 | + |
|
1034 | + return $html; |
|
1035 | 1035 | } |
1036 | 1036 | add_filter('geodir_custom_field_output_multiselect','geodir_cf_multiselect',10,3); |
1037 | 1037 | |
@@ -1048,152 +1048,152 @@ discard block |
||
1048 | 1048 | */ |
1049 | 1049 | function geodir_cf_email($html,$location,$cf,$p=''){ |
1050 | 1050 | |
1051 | - // check we have the post value |
|
1052 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
1053 | - else{ global $post;} |
|
1054 | - |
|
1055 | - if(!is_array($cf) && $cf!=''){ |
|
1056 | - $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
1057 | - if(!$cf){return NULL;} |
|
1058 | - } |
|
1059 | - |
|
1060 | - $html_var = $cf['htmlvar_name']; |
|
1061 | - |
|
1062 | - // Check if there is a location specific filter. |
|
1063 | - if(has_filter("geodir_custom_field_output_email_loc_{$location}")){ |
|
1064 | - /** |
|
1065 | - * Filter the email html by location. |
|
1066 | - * |
|
1067 | - * @param string $html The html to filter. |
|
1068 | - * @param array $cf The custom field array. |
|
1069 | - * @since 1.6.6 |
|
1070 | - */ |
|
1071 | - $html = apply_filters("geodir_custom_field_output_email_loc_{$location}",$html,$cf); |
|
1072 | - } |
|
1073 | - |
|
1074 | - // Check if there is a custom field specific filter. |
|
1075 | - if(has_filter("geodir_custom_field_output_email_var_{$html_var}")){ |
|
1076 | - /** |
|
1077 | - * Filter the email html by individual custom field. |
|
1078 | - * |
|
1079 | - * @param string $html The html to filter. |
|
1080 | - * @param string $location The location to output the html. |
|
1081 | - * @param array $cf The custom field array. |
|
1082 | - * @since 1.6.6 |
|
1083 | - */ |
|
1084 | - $html = apply_filters("geodir_custom_field_output_email_var_{$html_var}",$html,$location,$cf); |
|
1085 | - } |
|
1086 | - |
|
1087 | - // Check if there is a custom field key specific filter. |
|
1088 | - if(has_filter("geodir_custom_field_output_email_key_{$cf['field_type_key']}")){ |
|
1089 | - /** |
|
1090 | - * Filter the email html by field type key. |
|
1091 | - * |
|
1092 | - * @param string $html The html to filter. |
|
1093 | - * @param string $location The location to output the html. |
|
1094 | - * @param array $cf The custom field array. |
|
1095 | - * @since 1.6.6 |
|
1096 | - */ |
|
1097 | - $html = apply_filters("geodir_custom_field_output_email_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
1098 | - } |
|
1099 | - |
|
1100 | - // If not html then we run the standard output. |
|
1101 | - if(empty($html)){ |
|
1102 | - |
|
1103 | - global $preview; |
|
1104 | - if ($cf['htmlvar_name'] == 'geodir_email' && !(geodir_is_page('detail') || geodir_is_page('preview'))) { |
|
1105 | - return ''; // Remove Send Enquiry | Send To Friend from listings page |
|
1106 | - } |
|
1107 | - |
|
1108 | - $package_info = (array)geodir_post_package_info(array(), $post, $post->post_type); |
|
1109 | - |
|
1110 | - if ($cf['htmlvar_name'] == 'geodir_email' && ((isset($package_info['sendtofriend']) && $package_info['sendtofriend']) || $post->{$cf['htmlvar_name']})) { |
|
1111 | - $send_to_friend = true; |
|
1112 | - $b_send_inquiry = ''; |
|
1113 | - $b_sendtofriend = ''; |
|
1114 | - |
|
1115 | - $html = ''; |
|
1116 | - if (!$preview) { |
|
1117 | - $b_send_inquiry = 'b_send_inquiry'; |
|
1118 | - $b_sendtofriend = 'b_sendtofriend'; |
|
1119 | - $html = '<input type="hidden" name="geodir_popup_post_id" value="' . $post->ID . '" /><div class="geodir_display_popup_forms"></div>'; |
|
1120 | - } |
|
1121 | - |
|
1122 | - $field_icon = geodir_field_icon_proccess($cf); |
|
1123 | - if (strpos($field_icon, 'http') !== false) { |
|
1124 | - $field_icon_af = ''; |
|
1125 | - } elseif ($field_icon == '') { |
|
1126 | - $field_icon_af = '<i class="fa fa-envelope"></i>'; |
|
1127 | - } else { |
|
1128 | - $field_icon_af = $field_icon; |
|
1129 | - $field_icon = ''; |
|
1130 | - } |
|
1131 | - |
|
1132 | - $html .= '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af; |
|
1133 | - $seperator = ''; |
|
1134 | - if ($post->{$cf['htmlvar_name']}) { |
|
1135 | - $html .= '<a href="javascript:void(0);" class="' . $b_send_inquiry . '" >' . SEND_INQUIRY . '</a>'; |
|
1136 | - $seperator = ' | '; |
|
1137 | - } |
|
1138 | - |
|
1139 | - if (isset($package_info['sendtofriend']) && $package_info['sendtofriend']) { |
|
1140 | - $html .= $seperator . '<a href="javascript:void(0);" class="' . $b_sendtofriend . '">' . SEND_TO_FRIEND . '</a>'; |
|
1141 | - } |
|
1142 | - |
|
1143 | - $html .= '</span></div>'; |
|
1144 | - |
|
1145 | - |
|
1146 | - if (isset($_REQUEST['send_inquiry']) && $_REQUEST['send_inquiry'] == 'success') { |
|
1147 | - $html .= '<p class="sucess_msg">' . SEND_INQUIRY_SUCCESS . '</p>'; |
|
1148 | - } elseif (isset($_REQUEST['sendtofrnd']) && $_REQUEST['sendtofrnd'] == 'success') { |
|
1149 | - $html .= '<p class="sucess_msg">' . SEND_FRIEND_SUCCESS . '</p>'; |
|
1150 | - } elseif (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 'captch') { |
|
1151 | - $html .= '<p class="error_msg_fix">' . WRONG_CAPTCH_MSG . '</p>'; |
|
1152 | - } |
|
1153 | - |
|
1154 | - /*if(!$preview){require_once (geodir_plugin_path().'/geodirectory-templates/popup-forms.php');}*/ |
|
1155 | - |
|
1156 | - } else { |
|
1157 | - |
|
1158 | - if ($post->{$cf['htmlvar_name']}) { |
|
1159 | - |
|
1160 | - $field_icon = geodir_field_icon_proccess($cf); |
|
1161 | - if (strpos($field_icon, 'http') !== false) { |
|
1162 | - $field_icon_af = ''; |
|
1163 | - } elseif ($field_icon == '') { |
|
1164 | - $field_icon_af = '<i class="fa fa-envelope"></i>'; |
|
1165 | - } else { |
|
1166 | - $field_icon_af = $field_icon; |
|
1167 | - $field_icon = ''; |
|
1168 | - } |
|
1169 | - |
|
1170 | - |
|
1171 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af; |
|
1172 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
1173 | - $html .= '</span><span class="geodir-email-address-output">'; |
|
1174 | - $email = $post->{$cf['htmlvar_name']} ; |
|
1175 | - if($e_split = explode('@',$email)){ |
|
1176 | - /** |
|
1177 | - * Filter email custom field name output. |
|
1178 | - * |
|
1179 | - * @since 1.5.3 |
|
1180 | - * |
|
1181 | - * @param string $email The email string being output. |
|
1182 | - * @param array $cf Custom field variables array. |
|
1183 | - */ |
|
1184 | - $email_name = apply_filters('geodir_email_field_name_output',$email,$cf); |
|
1185 | - $html .= "<script>document.write('<a href=\"mailto:'+'$e_split[0]' + '@' + '$e_split[1]'+'\">$email_name</a>')</script>"; |
|
1186 | - }else{ |
|
1187 | - $html .= $email; |
|
1188 | - } |
|
1189 | - $html .= '</span></div>'; |
|
1190 | - } |
|
1191 | - |
|
1192 | - } |
|
1193 | - |
|
1194 | - } |
|
1195 | - |
|
1196 | - return $html; |
|
1051 | + // check we have the post value |
|
1052 | + if(is_int($p)){$post = geodir_get_post_info($p);} |
|
1053 | + else{ global $post;} |
|
1054 | + |
|
1055 | + if(!is_array($cf) && $cf!=''){ |
|
1056 | + $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
1057 | + if(!$cf){return NULL;} |
|
1058 | + } |
|
1059 | + |
|
1060 | + $html_var = $cf['htmlvar_name']; |
|
1061 | + |
|
1062 | + // Check if there is a location specific filter. |
|
1063 | + if(has_filter("geodir_custom_field_output_email_loc_{$location}")){ |
|
1064 | + /** |
|
1065 | + * Filter the email html by location. |
|
1066 | + * |
|
1067 | + * @param string $html The html to filter. |
|
1068 | + * @param array $cf The custom field array. |
|
1069 | + * @since 1.6.6 |
|
1070 | + */ |
|
1071 | + $html = apply_filters("geodir_custom_field_output_email_loc_{$location}",$html,$cf); |
|
1072 | + } |
|
1073 | + |
|
1074 | + // Check if there is a custom field specific filter. |
|
1075 | + if(has_filter("geodir_custom_field_output_email_var_{$html_var}")){ |
|
1076 | + /** |
|
1077 | + * Filter the email html by individual custom field. |
|
1078 | + * |
|
1079 | + * @param string $html The html to filter. |
|
1080 | + * @param string $location The location to output the html. |
|
1081 | + * @param array $cf The custom field array. |
|
1082 | + * @since 1.6.6 |
|
1083 | + */ |
|
1084 | + $html = apply_filters("geodir_custom_field_output_email_var_{$html_var}",$html,$location,$cf); |
|
1085 | + } |
|
1086 | + |
|
1087 | + // Check if there is a custom field key specific filter. |
|
1088 | + if(has_filter("geodir_custom_field_output_email_key_{$cf['field_type_key']}")){ |
|
1089 | + /** |
|
1090 | + * Filter the email html by field type key. |
|
1091 | + * |
|
1092 | + * @param string $html The html to filter. |
|
1093 | + * @param string $location The location to output the html. |
|
1094 | + * @param array $cf The custom field array. |
|
1095 | + * @since 1.6.6 |
|
1096 | + */ |
|
1097 | + $html = apply_filters("geodir_custom_field_output_email_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
1098 | + } |
|
1099 | + |
|
1100 | + // If not html then we run the standard output. |
|
1101 | + if(empty($html)){ |
|
1102 | + |
|
1103 | + global $preview; |
|
1104 | + if ($cf['htmlvar_name'] == 'geodir_email' && !(geodir_is_page('detail') || geodir_is_page('preview'))) { |
|
1105 | + return ''; // Remove Send Enquiry | Send To Friend from listings page |
|
1106 | + } |
|
1107 | + |
|
1108 | + $package_info = (array)geodir_post_package_info(array(), $post, $post->post_type); |
|
1109 | + |
|
1110 | + if ($cf['htmlvar_name'] == 'geodir_email' && ((isset($package_info['sendtofriend']) && $package_info['sendtofriend']) || $post->{$cf['htmlvar_name']})) { |
|
1111 | + $send_to_friend = true; |
|
1112 | + $b_send_inquiry = ''; |
|
1113 | + $b_sendtofriend = ''; |
|
1114 | + |
|
1115 | + $html = ''; |
|
1116 | + if (!$preview) { |
|
1117 | + $b_send_inquiry = 'b_send_inquiry'; |
|
1118 | + $b_sendtofriend = 'b_sendtofriend'; |
|
1119 | + $html = '<input type="hidden" name="geodir_popup_post_id" value="' . $post->ID . '" /><div class="geodir_display_popup_forms"></div>'; |
|
1120 | + } |
|
1121 | + |
|
1122 | + $field_icon = geodir_field_icon_proccess($cf); |
|
1123 | + if (strpos($field_icon, 'http') !== false) { |
|
1124 | + $field_icon_af = ''; |
|
1125 | + } elseif ($field_icon == '') { |
|
1126 | + $field_icon_af = '<i class="fa fa-envelope"></i>'; |
|
1127 | + } else { |
|
1128 | + $field_icon_af = $field_icon; |
|
1129 | + $field_icon = ''; |
|
1130 | + } |
|
1131 | + |
|
1132 | + $html .= '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af; |
|
1133 | + $seperator = ''; |
|
1134 | + if ($post->{$cf['htmlvar_name']}) { |
|
1135 | + $html .= '<a href="javascript:void(0);" class="' . $b_send_inquiry . '" >' . SEND_INQUIRY . '</a>'; |
|
1136 | + $seperator = ' | '; |
|
1137 | + } |
|
1138 | + |
|
1139 | + if (isset($package_info['sendtofriend']) && $package_info['sendtofriend']) { |
|
1140 | + $html .= $seperator . '<a href="javascript:void(0);" class="' . $b_sendtofriend . '">' . SEND_TO_FRIEND . '</a>'; |
|
1141 | + } |
|
1142 | + |
|
1143 | + $html .= '</span></div>'; |
|
1144 | + |
|
1145 | + |
|
1146 | + if (isset($_REQUEST['send_inquiry']) && $_REQUEST['send_inquiry'] == 'success') { |
|
1147 | + $html .= '<p class="sucess_msg">' . SEND_INQUIRY_SUCCESS . '</p>'; |
|
1148 | + } elseif (isset($_REQUEST['sendtofrnd']) && $_REQUEST['sendtofrnd'] == 'success') { |
|
1149 | + $html .= '<p class="sucess_msg">' . SEND_FRIEND_SUCCESS . '</p>'; |
|
1150 | + } elseif (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 'captch') { |
|
1151 | + $html .= '<p class="error_msg_fix">' . WRONG_CAPTCH_MSG . '</p>'; |
|
1152 | + } |
|
1153 | + |
|
1154 | + /*if(!$preview){require_once (geodir_plugin_path().'/geodirectory-templates/popup-forms.php');}*/ |
|
1155 | + |
|
1156 | + } else { |
|
1157 | + |
|
1158 | + if ($post->{$cf['htmlvar_name']}) { |
|
1159 | + |
|
1160 | + $field_icon = geodir_field_icon_proccess($cf); |
|
1161 | + if (strpos($field_icon, 'http') !== false) { |
|
1162 | + $field_icon_af = ''; |
|
1163 | + } elseif ($field_icon == '') { |
|
1164 | + $field_icon_af = '<i class="fa fa-envelope"></i>'; |
|
1165 | + } else { |
|
1166 | + $field_icon_af = $field_icon; |
|
1167 | + $field_icon = ''; |
|
1168 | + } |
|
1169 | + |
|
1170 | + |
|
1171 | + $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af; |
|
1172 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
1173 | + $html .= '</span><span class="geodir-email-address-output">'; |
|
1174 | + $email = $post->{$cf['htmlvar_name']} ; |
|
1175 | + if($e_split = explode('@',$email)){ |
|
1176 | + /** |
|
1177 | + * Filter email custom field name output. |
|
1178 | + * |
|
1179 | + * @since 1.5.3 |
|
1180 | + * |
|
1181 | + * @param string $email The email string being output. |
|
1182 | + * @param array $cf Custom field variables array. |
|
1183 | + */ |
|
1184 | + $email_name = apply_filters('geodir_email_field_name_output',$email,$cf); |
|
1185 | + $html .= "<script>document.write('<a href=\"mailto:'+'$e_split[0]' + '@' + '$e_split[1]'+'\">$email_name</a>')</script>"; |
|
1186 | + }else{ |
|
1187 | + $html .= $email; |
|
1188 | + } |
|
1189 | + $html .= '</span></div>'; |
|
1190 | + } |
|
1191 | + |
|
1192 | + } |
|
1193 | + |
|
1194 | + } |
|
1195 | + |
|
1196 | + return $html; |
|
1197 | 1197 | } |
1198 | 1198 | add_filter('geodir_custom_field_output_email','geodir_cf_email',10,3); |
1199 | 1199 | |
@@ -1210,130 +1210,130 @@ discard block |
||
1210 | 1210 | */ |
1211 | 1211 | function geodir_cf_file($html,$location,$cf,$p=''){ |
1212 | 1212 | |
1213 | - // check we have the post value |
|
1214 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
1215 | - else{ global $post;} |
|
1216 | - |
|
1217 | - if(!is_array($cf) && $cf!=''){ |
|
1218 | - $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
1219 | - if(!$cf){return NULL;} |
|
1220 | - } |
|
1221 | - |
|
1222 | - $html_var = $cf['htmlvar_name']; |
|
1223 | - |
|
1224 | - // Check if there is a location specific filter. |
|
1225 | - if(has_filter("geodir_custom_field_output_file_loc_{$location}")){ |
|
1226 | - /** |
|
1227 | - * Filter the file html by location. |
|
1228 | - * |
|
1229 | - * @param string $html The html to filter. |
|
1230 | - * @param array $cf The custom field array. |
|
1231 | - * @since 1.6.6 |
|
1232 | - */ |
|
1233 | - $html = apply_filters("geodir_custom_field_output_file_loc_{$location}",$html,$cf); |
|
1234 | - } |
|
1235 | - |
|
1236 | - // Check if there is a custom field specific filter. |
|
1237 | - if(has_filter("geodir_custom_field_output_file_var_{$html_var}")){ |
|
1238 | - /** |
|
1239 | - * Filter the file html by individual custom field. |
|
1240 | - * |
|
1241 | - * @param string $html The html to filter. |
|
1242 | - * @param string $location The location to output the html. |
|
1243 | - * @param array $cf The custom field array. |
|
1244 | - * @since 1.6.6 |
|
1245 | - */ |
|
1246 | - $html = apply_filters("geodir_custom_field_output_file_var_{$html_var}",$html,$location,$cf); |
|
1247 | - } |
|
1248 | - |
|
1249 | - // Check if there is a custom field key specific filter. |
|
1250 | - if(has_filter("geodir_custom_field_output_file_key_{$cf['field_type_key']}")){ |
|
1251 | - /** |
|
1252 | - * Filter the file html by field type key. |
|
1253 | - * |
|
1254 | - * @param string $html The html to filter. |
|
1255 | - * @param string $location The location to output the html. |
|
1256 | - * @param array $cf The custom field array. |
|
1257 | - * @since 1.6.6 |
|
1258 | - */ |
|
1259 | - $html = apply_filters("geodir_custom_field_output_file_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
1260 | - } |
|
1261 | - |
|
1262 | - // If not html then we run the standard output. |
|
1263 | - if(empty($html)){ |
|
1264 | - |
|
1265 | - if (!empty($post->{$cf['htmlvar_name']})): |
|
1266 | - |
|
1267 | - $files = explode(",", $post->{$cf['htmlvar_name']}); |
|
1268 | - if (!empty($files)): |
|
1269 | - |
|
1270 | - $extra_fields = !empty($cf['extra_fields']) ? maybe_unserialize($cf['extra_fields']) : NULL; |
|
1271 | - $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'] : ''; |
|
1272 | - |
|
1273 | - $file_paths = ''; |
|
1274 | - foreach ($files as $file) { |
|
1275 | - if (!empty($file)) { |
|
1276 | - |
|
1277 | - // $filetype = wp_check_filetype($file); |
|
1278 | - |
|
1279 | - $image_name_arr = explode('/', $file); |
|
1280 | - $curr_img_dir = $image_name_arr[count($image_name_arr) - 2]; |
|
1281 | - $filename = end($image_name_arr); |
|
1282 | - $img_name_arr = explode('.', $filename); |
|
1283 | - |
|
1284 | - $arr_file_type = wp_check_filetype($filename); |
|
1285 | - if (empty($arr_file_type['ext']) || empty($arr_file_type['type'])) { |
|
1286 | - continue; |
|
1287 | - } |
|
1288 | - |
|
1289 | - $uploaded_file_type = $arr_file_type['type']; |
|
1290 | - $uploaded_file_ext = $arr_file_type['ext']; |
|
1291 | - |
|
1292 | - if (!empty($allowed_file_types) && !in_array($uploaded_file_ext, $allowed_file_types)) { |
|
1293 | - continue; // Invalid file type. |
|
1294 | - } |
|
1295 | - |
|
1296 | - //$allowed_file_types = array('application/pdf', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'text/csv', 'text/plain'); |
|
1297 | - $image_file_types = array('image/jpg', 'image/jpeg', 'image/gif', 'image/png', 'image/bmp', 'image/x-icon'); |
|
1298 | - |
|
1299 | - // If the uploaded file is image |
|
1300 | - if (in_array($uploaded_file_type, $image_file_types)) { |
|
1301 | - $file_paths .= '<div class="geodir-custom-post-gallery" class="clearfix">'; |
|
1302 | - $file_paths .= '<a href="'.$file.'">'; |
|
1303 | - $file_paths .= geodir_show_image(array('src' => $file), 'thumbnail', false, false); |
|
1304 | - $file_paths .= '</a>'; |
|
1305 | - //$file_paths .= '<img src="'.$file.'" />'; |
|
1306 | - $file_paths .= '</div>'; |
|
1307 | - } else { |
|
1308 | - $ext_path = '_' . $html_var . '_'; |
|
1309 | - $filename = explode($ext_path, $filename); |
|
1310 | - $file_paths .= '<a href="' . $file . '" target="_blank">' . $filename[count($filename) - 1] . '</a>'; |
|
1311 | - } |
|
1312 | - } |
|
1313 | - } |
|
1314 | - |
|
1315 | - $field_icon = geodir_field_icon_proccess($cf); |
|
1316 | - if (strpos($field_icon, 'http') !== false) { |
|
1317 | - $field_icon_af = ''; |
|
1318 | - } elseif ($field_icon == '') { |
|
1319 | - $field_icon_af = ''; |
|
1320 | - } else { |
|
1321 | - $field_icon_af = $field_icon; |
|
1322 | - $field_icon = ''; |
|
1323 | - } |
|
1324 | - |
|
1325 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' geodir-custom-file-box ' . $cf['htmlvar_name'] . '"><div class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af; |
|
1326 | - $html .= '<span style="display: inline-block; vertical-align: top; padding-right: 14px;">'; |
|
1327 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
1328 | - $html .= '</span>'; |
|
1329 | - $html .= $file_paths . '</div></div>'; |
|
1330 | - |
|
1331 | - endif; |
|
1332 | - endif; |
|
1333 | - |
|
1334 | - } |
|
1335 | - |
|
1336 | - return $html; |
|
1213 | + // check we have the post value |
|
1214 | + if(is_int($p)){$post = geodir_get_post_info($p);} |
|
1215 | + else{ global $post;} |
|
1216 | + |
|
1217 | + if(!is_array($cf) && $cf!=''){ |
|
1218 | + $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
1219 | + if(!$cf){return NULL;} |
|
1220 | + } |
|
1221 | + |
|
1222 | + $html_var = $cf['htmlvar_name']; |
|
1223 | + |
|
1224 | + // Check if there is a location specific filter. |
|
1225 | + if(has_filter("geodir_custom_field_output_file_loc_{$location}")){ |
|
1226 | + /** |
|
1227 | + * Filter the file html by location. |
|
1228 | + * |
|
1229 | + * @param string $html The html to filter. |
|
1230 | + * @param array $cf The custom field array. |
|
1231 | + * @since 1.6.6 |
|
1232 | + */ |
|
1233 | + $html = apply_filters("geodir_custom_field_output_file_loc_{$location}",$html,$cf); |
|
1234 | + } |
|
1235 | + |
|
1236 | + // Check if there is a custom field specific filter. |
|
1237 | + if(has_filter("geodir_custom_field_output_file_var_{$html_var}")){ |
|
1238 | + /** |
|
1239 | + * Filter the file html by individual custom field. |
|
1240 | + * |
|
1241 | + * @param string $html The html to filter. |
|
1242 | + * @param string $location The location to output the html. |
|
1243 | + * @param array $cf The custom field array. |
|
1244 | + * @since 1.6.6 |
|
1245 | + */ |
|
1246 | + $html = apply_filters("geodir_custom_field_output_file_var_{$html_var}",$html,$location,$cf); |
|
1247 | + } |
|
1248 | + |
|
1249 | + // Check if there is a custom field key specific filter. |
|
1250 | + if(has_filter("geodir_custom_field_output_file_key_{$cf['field_type_key']}")){ |
|
1251 | + /** |
|
1252 | + * Filter the file html by field type key. |
|
1253 | + * |
|
1254 | + * @param string $html The html to filter. |
|
1255 | + * @param string $location The location to output the html. |
|
1256 | + * @param array $cf The custom field array. |
|
1257 | + * @since 1.6.6 |
|
1258 | + */ |
|
1259 | + $html = apply_filters("geodir_custom_field_output_file_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
1260 | + } |
|
1261 | + |
|
1262 | + // If not html then we run the standard output. |
|
1263 | + if(empty($html)){ |
|
1264 | + |
|
1265 | + if (!empty($post->{$cf['htmlvar_name']})): |
|
1266 | + |
|
1267 | + $files = explode(",", $post->{$cf['htmlvar_name']}); |
|
1268 | + if (!empty($files)): |
|
1269 | + |
|
1270 | + $extra_fields = !empty($cf['extra_fields']) ? maybe_unserialize($cf['extra_fields']) : NULL; |
|
1271 | + $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'] : ''; |
|
1272 | + |
|
1273 | + $file_paths = ''; |
|
1274 | + foreach ($files as $file) { |
|
1275 | + if (!empty($file)) { |
|
1276 | + |
|
1277 | + // $filetype = wp_check_filetype($file); |
|
1278 | + |
|
1279 | + $image_name_arr = explode('/', $file); |
|
1280 | + $curr_img_dir = $image_name_arr[count($image_name_arr) - 2]; |
|
1281 | + $filename = end($image_name_arr); |
|
1282 | + $img_name_arr = explode('.', $filename); |
|
1283 | + |
|
1284 | + $arr_file_type = wp_check_filetype($filename); |
|
1285 | + if (empty($arr_file_type['ext']) || empty($arr_file_type['type'])) { |
|
1286 | + continue; |
|
1287 | + } |
|
1288 | + |
|
1289 | + $uploaded_file_type = $arr_file_type['type']; |
|
1290 | + $uploaded_file_ext = $arr_file_type['ext']; |
|
1291 | + |
|
1292 | + if (!empty($allowed_file_types) && !in_array($uploaded_file_ext, $allowed_file_types)) { |
|
1293 | + continue; // Invalid file type. |
|
1294 | + } |
|
1295 | + |
|
1296 | + //$allowed_file_types = array('application/pdf', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'text/csv', 'text/plain'); |
|
1297 | + $image_file_types = array('image/jpg', 'image/jpeg', 'image/gif', 'image/png', 'image/bmp', 'image/x-icon'); |
|
1298 | + |
|
1299 | + // If the uploaded file is image |
|
1300 | + if (in_array($uploaded_file_type, $image_file_types)) { |
|
1301 | + $file_paths .= '<div class="geodir-custom-post-gallery" class="clearfix">'; |
|
1302 | + $file_paths .= '<a href="'.$file.'">'; |
|
1303 | + $file_paths .= geodir_show_image(array('src' => $file), 'thumbnail', false, false); |
|
1304 | + $file_paths .= '</a>'; |
|
1305 | + //$file_paths .= '<img src="'.$file.'" />'; |
|
1306 | + $file_paths .= '</div>'; |
|
1307 | + } else { |
|
1308 | + $ext_path = '_' . $html_var . '_'; |
|
1309 | + $filename = explode($ext_path, $filename); |
|
1310 | + $file_paths .= '<a href="' . $file . '" target="_blank">' . $filename[count($filename) - 1] . '</a>'; |
|
1311 | + } |
|
1312 | + } |
|
1313 | + } |
|
1314 | + |
|
1315 | + $field_icon = geodir_field_icon_proccess($cf); |
|
1316 | + if (strpos($field_icon, 'http') !== false) { |
|
1317 | + $field_icon_af = ''; |
|
1318 | + } elseif ($field_icon == '') { |
|
1319 | + $field_icon_af = ''; |
|
1320 | + } else { |
|
1321 | + $field_icon_af = $field_icon; |
|
1322 | + $field_icon = ''; |
|
1323 | + } |
|
1324 | + |
|
1325 | + $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' geodir-custom-file-box ' . $cf['htmlvar_name'] . '"><div class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af; |
|
1326 | + $html .= '<span style="display: inline-block; vertical-align: top; padding-right: 14px;">'; |
|
1327 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
1328 | + $html .= '</span>'; |
|
1329 | + $html .= $file_paths . '</div></div>'; |
|
1330 | + |
|
1331 | + endif; |
|
1332 | + endif; |
|
1333 | + |
|
1334 | + } |
|
1335 | + |
|
1336 | + return $html; |
|
1337 | 1337 | } |
1338 | 1338 | add_filter('geodir_custom_field_output_file','geodir_cf_file',10,3); |
1339 | 1339 | |
@@ -1351,80 +1351,80 @@ discard block |
||
1351 | 1351 | */ |
1352 | 1352 | function geodir_cf_textarea($html,$location,$cf,$p=''){ |
1353 | 1353 | |
1354 | - // check we have the post value |
|
1355 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
1356 | - else{ global $post;} |
|
1357 | - |
|
1358 | - if(!is_array($cf) && $cf!=''){ |
|
1359 | - $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
1360 | - if(!$cf){return NULL;} |
|
1361 | - } |
|
1362 | - |
|
1363 | - $html_var = $cf['htmlvar_name']; |
|
1364 | - |
|
1365 | - // Check if there is a location specific filter. |
|
1366 | - if(has_filter("geodir_custom_field_output_textarea_loc_{$location}")){ |
|
1367 | - /** |
|
1368 | - * Filter the textarea html by location. |
|
1369 | - * |
|
1370 | - * @param string $html The html to filter. |
|
1371 | - * @param array $cf The custom field array. |
|
1372 | - * @since 1.6.6 |
|
1373 | - */ |
|
1374 | - $html = apply_filters("geodir_custom_field_output_textarea_loc_{$location}",$html,$cf); |
|
1375 | - } |
|
1376 | - |
|
1377 | - // Check if there is a custom field specific filter. |
|
1378 | - if(has_filter("geodir_custom_field_output_textarea_var_{$html_var}")){ |
|
1379 | - /** |
|
1380 | - * Filter the textarea html by individual custom field. |
|
1381 | - * |
|
1382 | - * @param string $html The html to filter. |
|
1383 | - * @param string $location The location to output the html. |
|
1384 | - * @param array $cf The custom field array. |
|
1385 | - * @since 1.6.6 |
|
1386 | - */ |
|
1387 | - $html = apply_filters("geodir_custom_field_output_textarea_var_{$html_var}",$html,$location,$cf); |
|
1388 | - } |
|
1389 | - |
|
1390 | - // Check if there is a custom field key specific filter. |
|
1391 | - if(has_filter("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}")){ |
|
1392 | - /** |
|
1393 | - * Filter the textarea html by field type key. |
|
1394 | - * |
|
1395 | - * @param string $html The html to filter. |
|
1396 | - * @param string $location The location to output the html. |
|
1397 | - * @param array $cf The custom field array. |
|
1398 | - * @since 1.6.6 |
|
1399 | - */ |
|
1400 | - $html = apply_filters("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
1401 | - } |
|
1402 | - |
|
1403 | - // If not html then we run the standard output. |
|
1404 | - if(empty($html)){ |
|
1405 | - |
|
1406 | - if (!empty($post->{$cf['htmlvar_name']})) { |
|
1407 | - |
|
1408 | - $field_icon = geodir_field_icon_proccess($cf); |
|
1409 | - if (strpos($field_icon, 'http') !== false) { |
|
1410 | - $field_icon_af = ''; |
|
1411 | - } elseif ($field_icon == '') { |
|
1412 | - $field_icon_af = ''; |
|
1413 | - } else { |
|
1414 | - $field_icon_af = $field_icon; |
|
1415 | - $field_icon = ''; |
|
1416 | - } |
|
1417 | - |
|
1418 | - |
|
1419 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af; |
|
1420 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
1421 | - $html .= '</span>' . wpautop($post->{$cf['htmlvar_name']}) . '</div>'; |
|
1422 | - |
|
1423 | - } |
|
1424 | - |
|
1425 | - } |
|
1426 | - |
|
1427 | - return $html; |
|
1354 | + // check we have the post value |
|
1355 | + if(is_int($p)){$post = geodir_get_post_info($p);} |
|
1356 | + else{ global $post;} |
|
1357 | + |
|
1358 | + if(!is_array($cf) && $cf!=''){ |
|
1359 | + $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
1360 | + if(!$cf){return NULL;} |
|
1361 | + } |
|
1362 | + |
|
1363 | + $html_var = $cf['htmlvar_name']; |
|
1364 | + |
|
1365 | + // Check if there is a location specific filter. |
|
1366 | + if(has_filter("geodir_custom_field_output_textarea_loc_{$location}")){ |
|
1367 | + /** |
|
1368 | + * Filter the textarea html by location. |
|
1369 | + * |
|
1370 | + * @param string $html The html to filter. |
|
1371 | + * @param array $cf The custom field array. |
|
1372 | + * @since 1.6.6 |
|
1373 | + */ |
|
1374 | + $html = apply_filters("geodir_custom_field_output_textarea_loc_{$location}",$html,$cf); |
|
1375 | + } |
|
1376 | + |
|
1377 | + // Check if there is a custom field specific filter. |
|
1378 | + if(has_filter("geodir_custom_field_output_textarea_var_{$html_var}")){ |
|
1379 | + /** |
|
1380 | + * Filter the textarea html by individual custom field. |
|
1381 | + * |
|
1382 | + * @param string $html The html to filter. |
|
1383 | + * @param string $location The location to output the html. |
|
1384 | + * @param array $cf The custom field array. |
|
1385 | + * @since 1.6.6 |
|
1386 | + */ |
|
1387 | + $html = apply_filters("geodir_custom_field_output_textarea_var_{$html_var}",$html,$location,$cf); |
|
1388 | + } |
|
1389 | + |
|
1390 | + // Check if there is a custom field key specific filter. |
|
1391 | + if(has_filter("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}")){ |
|
1392 | + /** |
|
1393 | + * Filter the textarea html by field type key. |
|
1394 | + * |
|
1395 | + * @param string $html The html to filter. |
|
1396 | + * @param string $location The location to output the html. |
|
1397 | + * @param array $cf The custom field array. |
|
1398 | + * @since 1.6.6 |
|
1399 | + */ |
|
1400 | + $html = apply_filters("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
1401 | + } |
|
1402 | + |
|
1403 | + // If not html then we run the standard output. |
|
1404 | + if(empty($html)){ |
|
1405 | + |
|
1406 | + if (!empty($post->{$cf['htmlvar_name']})) { |
|
1407 | + |
|
1408 | + $field_icon = geodir_field_icon_proccess($cf); |
|
1409 | + if (strpos($field_icon, 'http') !== false) { |
|
1410 | + $field_icon_af = ''; |
|
1411 | + } elseif ($field_icon == '') { |
|
1412 | + $field_icon_af = ''; |
|
1413 | + } else { |
|
1414 | + $field_icon_af = $field_icon; |
|
1415 | + $field_icon = ''; |
|
1416 | + } |
|
1417 | + |
|
1418 | + |
|
1419 | + $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af; |
|
1420 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
1421 | + $html .= '</span>' . wpautop($post->{$cf['htmlvar_name']}) . '</div>'; |
|
1422 | + |
|
1423 | + } |
|
1424 | + |
|
1425 | + } |
|
1426 | + |
|
1427 | + return $html; |
|
1428 | 1428 | } |
1429 | 1429 | add_filter('geodir_custom_field_output_textarea','geodir_cf_textarea',10,3); |
1430 | 1430 | |
@@ -1442,79 +1442,79 @@ discard block |
||
1442 | 1442 | */ |
1443 | 1443 | function geodir_cf_html($html,$location,$cf,$p=''){ |
1444 | 1444 | |
1445 | - // check we have the post value |
|
1446 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
1447 | - else{ global $post;} |
|
1448 | - |
|
1449 | - if(!is_array($cf) && $cf!=''){ |
|
1450 | - $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
1451 | - if(!$cf){return NULL;} |
|
1452 | - } |
|
1453 | - |
|
1454 | - $html_var = $cf['htmlvar_name']; |
|
1455 | - |
|
1456 | - // Check if there is a location specific filter. |
|
1457 | - if(has_filter("geodir_custom_field_output_html_loc_{$location}")){ |
|
1458 | - /** |
|
1459 | - * Filter the html html by location. |
|
1460 | - * |
|
1461 | - * @param string $html The html to filter. |
|
1462 | - * @param array $cf The custom field array. |
|
1463 | - * @since 1.6.6 |
|
1464 | - */ |
|
1465 | - $html = apply_filters("geodir_custom_field_output_html_loc_{$location}",$html,$cf); |
|
1466 | - } |
|
1467 | - |
|
1468 | - // Check if there is a custom field specific filter. |
|
1469 | - if(has_filter("geodir_custom_field_output_html_var_{$html_var}")){ |
|
1470 | - /** |
|
1471 | - * Filter the html html by individual custom field. |
|
1472 | - * |
|
1473 | - * @param string $html The html to filter. |
|
1474 | - * @param string $location The location to output the html. |
|
1475 | - * @param array $cf The custom field array. |
|
1476 | - * @since 1.6.6 |
|
1477 | - */ |
|
1478 | - $html = apply_filters("geodir_custom_field_output_html_var_{$html_var}",$html,$location,$cf); |
|
1479 | - } |
|
1480 | - |
|
1481 | - // Check if there is a custom field key specific filter. |
|
1482 | - if(has_filter("geodir_custom_field_output_html_key_{$cf['field_type_key']}")){ |
|
1483 | - /** |
|
1484 | - * Filter the html html by field type key. |
|
1485 | - * |
|
1486 | - * @param string $html The html to filter. |
|
1487 | - * @param string $location The location to output the html. |
|
1488 | - * @param array $cf The custom field array. |
|
1489 | - * @since 1.6.6 |
|
1490 | - */ |
|
1491 | - $html = apply_filters("geodir_custom_field_output_html_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
1492 | - } |
|
1493 | - |
|
1494 | - // If not html then we run the standard output. |
|
1495 | - if(empty($html)){ |
|
1496 | - |
|
1497 | - if (!empty($post->{$cf['htmlvar_name']})) { |
|
1498 | - |
|
1499 | - $field_icon = geodir_field_icon_proccess($cf); |
|
1500 | - if (strpos($field_icon, 'http') !== false) { |
|
1501 | - $field_icon_af = ''; |
|
1502 | - } elseif ($field_icon == '') { |
|
1503 | - $field_icon_af = ''; |
|
1504 | - } else { |
|
1505 | - $field_icon_af = $field_icon; |
|
1506 | - $field_icon = ''; |
|
1507 | - } |
|
1508 | - |
|
1509 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af; |
|
1510 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
1511 | - $html .= '</span>' . wpautop($post->{$cf['htmlvar_name']}) . '</div>'; |
|
1512 | - |
|
1513 | - } |
|
1514 | - |
|
1515 | - } |
|
1516 | - |
|
1517 | - return $html; |
|
1445 | + // check we have the post value |
|
1446 | + if(is_int($p)){$post = geodir_get_post_info($p);} |
|
1447 | + else{ global $post;} |
|
1448 | + |
|
1449 | + if(!is_array($cf) && $cf!=''){ |
|
1450 | + $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
1451 | + if(!$cf){return NULL;} |
|
1452 | + } |
|
1453 | + |
|
1454 | + $html_var = $cf['htmlvar_name']; |
|
1455 | + |
|
1456 | + // Check if there is a location specific filter. |
|
1457 | + if(has_filter("geodir_custom_field_output_html_loc_{$location}")){ |
|
1458 | + /** |
|
1459 | + * Filter the html html by location. |
|
1460 | + * |
|
1461 | + * @param string $html The html to filter. |
|
1462 | + * @param array $cf The custom field array. |
|
1463 | + * @since 1.6.6 |
|
1464 | + */ |
|
1465 | + $html = apply_filters("geodir_custom_field_output_html_loc_{$location}",$html,$cf); |
|
1466 | + } |
|
1467 | + |
|
1468 | + // Check if there is a custom field specific filter. |
|
1469 | + if(has_filter("geodir_custom_field_output_html_var_{$html_var}")){ |
|
1470 | + /** |
|
1471 | + * Filter the html html by individual custom field. |
|
1472 | + * |
|
1473 | + * @param string $html The html to filter. |
|
1474 | + * @param string $location The location to output the html. |
|
1475 | + * @param array $cf The custom field array. |
|
1476 | + * @since 1.6.6 |
|
1477 | + */ |
|
1478 | + $html = apply_filters("geodir_custom_field_output_html_var_{$html_var}",$html,$location,$cf); |
|
1479 | + } |
|
1480 | + |
|
1481 | + // Check if there is a custom field key specific filter. |
|
1482 | + if(has_filter("geodir_custom_field_output_html_key_{$cf['field_type_key']}")){ |
|
1483 | + /** |
|
1484 | + * Filter the html html by field type key. |
|
1485 | + * |
|
1486 | + * @param string $html The html to filter. |
|
1487 | + * @param string $location The location to output the html. |
|
1488 | + * @param array $cf The custom field array. |
|
1489 | + * @since 1.6.6 |
|
1490 | + */ |
|
1491 | + $html = apply_filters("geodir_custom_field_output_html_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
1492 | + } |
|
1493 | + |
|
1494 | + // If not html then we run the standard output. |
|
1495 | + if(empty($html)){ |
|
1496 | + |
|
1497 | + if (!empty($post->{$cf['htmlvar_name']})) { |
|
1498 | + |
|
1499 | + $field_icon = geodir_field_icon_proccess($cf); |
|
1500 | + if (strpos($field_icon, 'http') !== false) { |
|
1501 | + $field_icon_af = ''; |
|
1502 | + } elseif ($field_icon == '') { |
|
1503 | + $field_icon_af = ''; |
|
1504 | + } else { |
|
1505 | + $field_icon_af = $field_icon; |
|
1506 | + $field_icon = ''; |
|
1507 | + } |
|
1508 | + |
|
1509 | + $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af; |
|
1510 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
1511 | + $html .= '</span>' . wpautop($post->{$cf['htmlvar_name']}) . '</div>'; |
|
1512 | + |
|
1513 | + } |
|
1514 | + |
|
1515 | + } |
|
1516 | + |
|
1517 | + return $html; |
|
1518 | 1518 | } |
1519 | 1519 | add_filter('geodir_custom_field_output_html','geodir_cf_html',10,3); |
1520 | 1520 | |
@@ -1532,113 +1532,113 @@ discard block |
||
1532 | 1532 | */ |
1533 | 1533 | function geodir_cf_taxonomy($html,$location,$cf,$p=''){ |
1534 | 1534 | |
1535 | - // check we have the post value |
|
1536 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
1537 | - else{ global $post;} |
|
1538 | - |
|
1539 | - if(!is_array($cf) && $cf!=''){ |
|
1540 | - $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
1541 | - if(!$cf){return NULL;} |
|
1542 | - } |
|
1543 | - |
|
1544 | - $html_var = $cf['htmlvar_name']; |
|
1545 | - |
|
1546 | - // Check if there is a location specific filter. |
|
1547 | - if(has_filter("geodir_custom_field_output_taxonomy_loc_{$location}")){ |
|
1548 | - /** |
|
1549 | - * Filter the taxonomy html by location. |
|
1550 | - * |
|
1551 | - * @param string $html The html to filter. |
|
1552 | - * @param array $cf The custom field array. |
|
1553 | - * @since 1.6.6 |
|
1554 | - */ |
|
1555 | - $html = apply_filters("geodir_custom_field_output_taxonomy_loc_{$location}",$html,$cf); |
|
1556 | - } |
|
1557 | - |
|
1558 | - // Check if there is a custom field specific filter. |
|
1559 | - if(has_filter("geodir_custom_field_output_taxonomy_var_{$html_var}")){ |
|
1560 | - /** |
|
1561 | - * Filter the taxonomy html by individual custom field. |
|
1562 | - * |
|
1563 | - * @param string $html The html to filter. |
|
1564 | - * @param string $location The location to output the html. |
|
1565 | - * @param array $cf The custom field array. |
|
1566 | - * @since 1.6.6 |
|
1567 | - */ |
|
1568 | - $html = apply_filters("geodir_custom_field_output_taxonomy_var_{$html_var}",$html,$location,$cf); |
|
1569 | - } |
|
1570 | - |
|
1571 | - // Check if there is a custom field key specific filter. |
|
1572 | - if(has_filter("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}")){ |
|
1573 | - /** |
|
1574 | - * Filter the taxonomy html by field type key. |
|
1575 | - * |
|
1576 | - * @param string $html The html to filter. |
|
1577 | - * @param string $location The location to output the html. |
|
1578 | - * @param array $cf The custom field array. |
|
1579 | - * @since 1.6.6 |
|
1580 | - */ |
|
1581 | - $html = apply_filters("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
1582 | - } |
|
1583 | - |
|
1584 | - // If not html then we run the standard output. |
|
1585 | - if(empty($html)){ |
|
1586 | - |
|
1587 | - if ($html_var == $post->post_type . 'category' && !empty($post->{$html_var})) { |
|
1588 | - $post_taxonomy = $post->post_type . 'category'; |
|
1589 | - $field_value = $post->{$html_var}; |
|
1590 | - $links = array(); |
|
1591 | - $terms = array(); |
|
1592 | - $termsOrdered = array(); |
|
1593 | - if (!is_array($field_value)) { |
|
1594 | - $field_value = explode(",", trim($field_value, ",")); |
|
1595 | - } |
|
1596 | - |
|
1597 | - $field_value = array_unique($field_value); |
|
1598 | - |
|
1599 | - if (!empty($field_value)) { |
|
1600 | - foreach ($field_value as $term) { |
|
1601 | - $term = trim($term); |
|
1602 | - |
|
1603 | - if ($term != '') { |
|
1604 | - $term = get_term_by('id', $term, $html_var); |
|
1605 | - if (is_object($term)) { |
|
1606 | - $links[] = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>" . $term->name . "</a>"; |
|
1607 | - $terms[] = $term; |
|
1608 | - } |
|
1609 | - } |
|
1610 | - } |
|
1611 | - if (!empty($links)) { |
|
1612 | - // order alphabetically |
|
1613 | - asort($links); |
|
1614 | - foreach (array_keys($links) as $key) { |
|
1615 | - $termsOrdered[$key] = $terms[$key]; |
|
1616 | - } |
|
1617 | - $terms = $termsOrdered; |
|
1618 | - } |
|
1619 | - } |
|
1620 | - $html_value = !empty($links) && !empty($terms) ? wp_sprintf('%l', $links, (object)$terms) : ''; |
|
1621 | - |
|
1622 | - if ($html_value != '') { |
|
1623 | - $field_icon = geodir_field_icon_proccess($cf); |
|
1624 | - if (strpos($field_icon, 'http') !== false) { |
|
1625 | - $field_icon_af = ''; |
|
1626 | - } else if ($field_icon == '') { |
|
1627 | - $field_icon_af = ''; |
|
1628 | - } else { |
|
1629 | - $field_icon_af = $field_icon; |
|
1630 | - $field_icon = ''; |
|
1631 | - } |
|
1632 | - |
|
1633 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $html_var . '" style="clear:both;"><span class="geodir-i-taxonomy geodir-i-category" style="' . $field_icon . '">' . $field_icon_af; |
|
1634 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
1635 | - $html .= '</span> ' . $html_value . '</div>'; |
|
1636 | - } |
|
1637 | - } |
|
1638 | - |
|
1639 | - } |
|
1640 | - |
|
1641 | - return $html; |
|
1535 | + // check we have the post value |
|
1536 | + if(is_int($p)){$post = geodir_get_post_info($p);} |
|
1537 | + else{ global $post;} |
|
1538 | + |
|
1539 | + if(!is_array($cf) && $cf!=''){ |
|
1540 | + $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
1541 | + if(!$cf){return NULL;} |
|
1542 | + } |
|
1543 | + |
|
1544 | + $html_var = $cf['htmlvar_name']; |
|
1545 | + |
|
1546 | + // Check if there is a location specific filter. |
|
1547 | + if(has_filter("geodir_custom_field_output_taxonomy_loc_{$location}")){ |
|
1548 | + /** |
|
1549 | + * Filter the taxonomy html by location. |
|
1550 | + * |
|
1551 | + * @param string $html The html to filter. |
|
1552 | + * @param array $cf The custom field array. |
|
1553 | + * @since 1.6.6 |
|
1554 | + */ |
|
1555 | + $html = apply_filters("geodir_custom_field_output_taxonomy_loc_{$location}",$html,$cf); |
|
1556 | + } |
|
1557 | + |
|
1558 | + // Check if there is a custom field specific filter. |
|
1559 | + if(has_filter("geodir_custom_field_output_taxonomy_var_{$html_var}")){ |
|
1560 | + /** |
|
1561 | + * Filter the taxonomy html by individual custom field. |
|
1562 | + * |
|
1563 | + * @param string $html The html to filter. |
|
1564 | + * @param string $location The location to output the html. |
|
1565 | + * @param array $cf The custom field array. |
|
1566 | + * @since 1.6.6 |
|
1567 | + */ |
|
1568 | + $html = apply_filters("geodir_custom_field_output_taxonomy_var_{$html_var}",$html,$location,$cf); |
|
1569 | + } |
|
1570 | + |
|
1571 | + // Check if there is a custom field key specific filter. |
|
1572 | + if(has_filter("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}")){ |
|
1573 | + /** |
|
1574 | + * Filter the taxonomy html by field type key. |
|
1575 | + * |
|
1576 | + * @param string $html The html to filter. |
|
1577 | + * @param string $location The location to output the html. |
|
1578 | + * @param array $cf The custom field array. |
|
1579 | + * @since 1.6.6 |
|
1580 | + */ |
|
1581 | + $html = apply_filters("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
1582 | + } |
|
1583 | + |
|
1584 | + // If not html then we run the standard output. |
|
1585 | + if(empty($html)){ |
|
1586 | + |
|
1587 | + if ($html_var == $post->post_type . 'category' && !empty($post->{$html_var})) { |
|
1588 | + $post_taxonomy = $post->post_type . 'category'; |
|
1589 | + $field_value = $post->{$html_var}; |
|
1590 | + $links = array(); |
|
1591 | + $terms = array(); |
|
1592 | + $termsOrdered = array(); |
|
1593 | + if (!is_array($field_value)) { |
|
1594 | + $field_value = explode(",", trim($field_value, ",")); |
|
1595 | + } |
|
1596 | + |
|
1597 | + $field_value = array_unique($field_value); |
|
1598 | + |
|
1599 | + if (!empty($field_value)) { |
|
1600 | + foreach ($field_value as $term) { |
|
1601 | + $term = trim($term); |
|
1602 | + |
|
1603 | + if ($term != '') { |
|
1604 | + $term = get_term_by('id', $term, $html_var); |
|
1605 | + if (is_object($term)) { |
|
1606 | + $links[] = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>" . $term->name . "</a>"; |
|
1607 | + $terms[] = $term; |
|
1608 | + } |
|
1609 | + } |
|
1610 | + } |
|
1611 | + if (!empty($links)) { |
|
1612 | + // order alphabetically |
|
1613 | + asort($links); |
|
1614 | + foreach (array_keys($links) as $key) { |
|
1615 | + $termsOrdered[$key] = $terms[$key]; |
|
1616 | + } |
|
1617 | + $terms = $termsOrdered; |
|
1618 | + } |
|
1619 | + } |
|
1620 | + $html_value = !empty($links) && !empty($terms) ? wp_sprintf('%l', $links, (object)$terms) : ''; |
|
1621 | + |
|
1622 | + if ($html_value != '') { |
|
1623 | + $field_icon = geodir_field_icon_proccess($cf); |
|
1624 | + if (strpos($field_icon, 'http') !== false) { |
|
1625 | + $field_icon_af = ''; |
|
1626 | + } else if ($field_icon == '') { |
|
1627 | + $field_icon_af = ''; |
|
1628 | + } else { |
|
1629 | + $field_icon_af = $field_icon; |
|
1630 | + $field_icon = ''; |
|
1631 | + } |
|
1632 | + |
|
1633 | + $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $html_var . '" style="clear:both;"><span class="geodir-i-taxonomy geodir-i-category" style="' . $field_icon . '">' . $field_icon_af; |
|
1634 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
1635 | + $html .= '</span> ' . $html_value . '</div>'; |
|
1636 | + } |
|
1637 | + } |
|
1638 | + |
|
1639 | + } |
|
1640 | + |
|
1641 | + return $html; |
|
1642 | 1642 | } |
1643 | 1643 | add_filter('geodir_custom_field_output_taxonomy','geodir_cf_taxonomy',10,3); |
1644 | 1644 | |
@@ -1655,162 +1655,162 @@ discard block |
||
1655 | 1655 | */ |
1656 | 1656 | function geodir_cf_address($html,$location,$cf,$p=''){ |
1657 | 1657 | |
1658 | - // check we have the post value |
|
1659 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
1660 | - else{ global $post;} |
|
1661 | - |
|
1662 | - if(!is_array($cf) && $cf!=''){ |
|
1663 | - $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
1664 | - if(!$cf){return NULL;} |
|
1665 | - } |
|
1666 | - |
|
1667 | - $html_var = $cf['htmlvar_name']; |
|
1668 | - |
|
1669 | - // Check if there is a location specific filter. |
|
1670 | - if(has_filter("geodir_custom_field_output_address_loc_{$location}")){ |
|
1671 | - /** |
|
1672 | - * Filter the address html by location. |
|
1673 | - * |
|
1674 | - * @param string $html The html to filter. |
|
1675 | - * @param array $cf The custom field array. |
|
1676 | - * @since 1.6.6 |
|
1677 | - */ |
|
1678 | - $html = apply_filters("geodir_custom_field_output_address_loc_{$location}",$html,$cf); |
|
1679 | - } |
|
1680 | - |
|
1681 | - // Check if there is a custom field specific filter. |
|
1682 | - if(has_filter("geodir_custom_field_output_address_var_{$html_var}")){ |
|
1683 | - /** |
|
1684 | - * Filter the address html by individual custom field. |
|
1685 | - * |
|
1686 | - * @param string $html The html to filter. |
|
1687 | - * @param string $location The location to output the html. |
|
1688 | - * @param array $cf The custom field array. |
|
1689 | - * @since 1.6.6 |
|
1690 | - */ |
|
1691 | - $html = apply_filters("geodir_custom_field_output_address_var_{$html_var}",$html,$location,$cf); |
|
1692 | - } |
|
1693 | - |
|
1694 | - // Check if there is a custom field key specific filter. |
|
1695 | - if(has_filter("geodir_custom_field_output_address_key_{$cf['field_type_key']}")){ |
|
1696 | - /** |
|
1697 | - * Filter the address html by field type key. |
|
1698 | - * |
|
1699 | - * @param string $html The html to filter. |
|
1700 | - * @param string $location The location to output the html. |
|
1701 | - * @param array $cf The custom field array. |
|
1702 | - * @since 1.6.6 |
|
1703 | - */ |
|
1704 | - $html = apply_filters("geodir_custom_field_output_address_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
1705 | - } |
|
1706 | - |
|
1707 | - // If not html then we run the standard output. |
|
1708 | - if(empty($html)){ |
|
1709 | - |
|
1710 | - global $preview; |
|
1711 | - $html_var = $cf['htmlvar_name'] . '_address'; |
|
1712 | - |
|
1713 | - if ($cf['extra_fields']) { |
|
1714 | - |
|
1715 | - $extra_fields = unserialize($cf['extra_fields']); |
|
1716 | - |
|
1717 | - $addition_fields = ''; |
|
1718 | - |
|
1719 | - if (!empty($extra_fields)) { |
|
1720 | - |
|
1721 | - $show_city_in_address = false; |
|
1722 | - if (isset($extra_fields['show_city']) && $extra_fields['show_city']) { |
|
1723 | - $show_city_in_address = true; |
|
1724 | - } |
|
1725 | - /** |
|
1726 | - * Filter "show city in address" value. |
|
1727 | - * |
|
1728 | - * @since 1.0.0 |
|
1729 | - */ |
|
1730 | - $show_city_in_address = apply_filters('geodir_show_city_in_address', $show_city_in_address); |
|
1731 | - |
|
1732 | - |
|
1733 | - $show_region_in_address = false; |
|
1734 | - if (isset($extra_fields['show_region']) && $extra_fields['show_region']) { |
|
1735 | - $show_region_in_address = true; |
|
1736 | - } |
|
1737 | - /** |
|
1738 | - * Filter "show region in address" value. |
|
1739 | - * |
|
1740 | - * @since 1.6.6 |
|
1741 | - */ |
|
1742 | - $show_region_in_address = apply_filters('geodir_show_region_in_address', $show_region_in_address); |
|
1743 | - |
|
1744 | - $show_country_in_address = false; |
|
1745 | - if (isset($extra_fields['show_country']) && $extra_fields['show_country']) { |
|
1746 | - $show_country_in_address = true; |
|
1747 | - } |
|
1748 | - /** |
|
1749 | - * Filter "show country in address" value. |
|
1750 | - * |
|
1751 | - * @since 1.6.6 |
|
1752 | - */ |
|
1753 | - $show_country_in_address = apply_filters('geodir_show_country_in_address', $show_country_in_address); |
|
1754 | - |
|
1755 | - $show_zip_in_address = false; |
|
1756 | - if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) { |
|
1757 | - $show_zip_in_address = true; |
|
1758 | - } |
|
1759 | - /** |
|
1760 | - * Filter "show zip in address" value. |
|
1761 | - * |
|
1762 | - * @since 1.6.6 |
|
1763 | - */ |
|
1764 | - $show_zip_in_address = apply_filters('geodir_show_zip_in_address', $show_zip_in_address); |
|
1765 | - |
|
1766 | - |
|
1767 | - } |
|
1768 | - |
|
1769 | - } |
|
1770 | - |
|
1771 | - |
|
1772 | - if ($post->{$html_var}) { |
|
1773 | - |
|
1774 | - $field_icon = geodir_field_icon_proccess( $cf ); |
|
1775 | - if ( strpos( $field_icon, 'http' ) !== false ) { |
|
1776 | - $field_icon_af = ''; |
|
1777 | - } elseif ( $field_icon == '' ) { |
|
1778 | - $field_icon_af = '<i class="fa fa-home"></i>'; |
|
1779 | - } else { |
|
1780 | - $field_icon_af = $field_icon; |
|
1781 | - $field_icon = ''; |
|
1782 | - } |
|
1658 | + // check we have the post value |
|
1659 | + if(is_int($p)){$post = geodir_get_post_info($p);} |
|
1660 | + else{ global $post;} |
|
1661 | + |
|
1662 | + if(!is_array($cf) && $cf!=''){ |
|
1663 | + $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
|
1664 | + if(!$cf){return NULL;} |
|
1665 | + } |
|
1666 | + |
|
1667 | + $html_var = $cf['htmlvar_name']; |
|
1668 | + |
|
1669 | + // Check if there is a location specific filter. |
|
1670 | + if(has_filter("geodir_custom_field_output_address_loc_{$location}")){ |
|
1671 | + /** |
|
1672 | + * Filter the address html by location. |
|
1673 | + * |
|
1674 | + * @param string $html The html to filter. |
|
1675 | + * @param array $cf The custom field array. |
|
1676 | + * @since 1.6.6 |
|
1677 | + */ |
|
1678 | + $html = apply_filters("geodir_custom_field_output_address_loc_{$location}",$html,$cf); |
|
1679 | + } |
|
1680 | + |
|
1681 | + // Check if there is a custom field specific filter. |
|
1682 | + if(has_filter("geodir_custom_field_output_address_var_{$html_var}")){ |
|
1683 | + /** |
|
1684 | + * Filter the address html by individual custom field. |
|
1685 | + * |
|
1686 | + * @param string $html The html to filter. |
|
1687 | + * @param string $location The location to output the html. |
|
1688 | + * @param array $cf The custom field array. |
|
1689 | + * @since 1.6.6 |
|
1690 | + */ |
|
1691 | + $html = apply_filters("geodir_custom_field_output_address_var_{$html_var}",$html,$location,$cf); |
|
1692 | + } |
|
1693 | + |
|
1694 | + // Check if there is a custom field key specific filter. |
|
1695 | + if(has_filter("geodir_custom_field_output_address_key_{$cf['field_type_key']}")){ |
|
1696 | + /** |
|
1697 | + * Filter the address html by field type key. |
|
1698 | + * |
|
1699 | + * @param string $html The html to filter. |
|
1700 | + * @param string $location The location to output the html. |
|
1701 | + * @param array $cf The custom field array. |
|
1702 | + * @since 1.6.6 |
|
1703 | + */ |
|
1704 | + $html = apply_filters("geodir_custom_field_output_address_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
1705 | + } |
|
1706 | + |
|
1707 | + // If not html then we run the standard output. |
|
1708 | + if(empty($html)){ |
|
1709 | + |
|
1710 | + global $preview; |
|
1711 | + $html_var = $cf['htmlvar_name'] . '_address'; |
|
1712 | + |
|
1713 | + if ($cf['extra_fields']) { |
|
1714 | + |
|
1715 | + $extra_fields = unserialize($cf['extra_fields']); |
|
1716 | + |
|
1717 | + $addition_fields = ''; |
|
1718 | + |
|
1719 | + if (!empty($extra_fields)) { |
|
1720 | + |
|
1721 | + $show_city_in_address = false; |
|
1722 | + if (isset($extra_fields['show_city']) && $extra_fields['show_city']) { |
|
1723 | + $show_city_in_address = true; |
|
1724 | + } |
|
1725 | + /** |
|
1726 | + * Filter "show city in address" value. |
|
1727 | + * |
|
1728 | + * @since 1.0.0 |
|
1729 | + */ |
|
1730 | + $show_city_in_address = apply_filters('geodir_show_city_in_address', $show_city_in_address); |
|
1731 | + |
|
1732 | + |
|
1733 | + $show_region_in_address = false; |
|
1734 | + if (isset($extra_fields['show_region']) && $extra_fields['show_region']) { |
|
1735 | + $show_region_in_address = true; |
|
1736 | + } |
|
1737 | + /** |
|
1738 | + * Filter "show region in address" value. |
|
1739 | + * |
|
1740 | + * @since 1.6.6 |
|
1741 | + */ |
|
1742 | + $show_region_in_address = apply_filters('geodir_show_region_in_address', $show_region_in_address); |
|
1743 | + |
|
1744 | + $show_country_in_address = false; |
|
1745 | + if (isset($extra_fields['show_country']) && $extra_fields['show_country']) { |
|
1746 | + $show_country_in_address = true; |
|
1747 | + } |
|
1748 | + /** |
|
1749 | + * Filter "show country in address" value. |
|
1750 | + * |
|
1751 | + * @since 1.6.6 |
|
1752 | + */ |
|
1753 | + $show_country_in_address = apply_filters('geodir_show_country_in_address', $show_country_in_address); |
|
1754 | + |
|
1755 | + $show_zip_in_address = false; |
|
1756 | + if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) { |
|
1757 | + $show_zip_in_address = true; |
|
1758 | + } |
|
1759 | + /** |
|
1760 | + * Filter "show zip in address" value. |
|
1761 | + * |
|
1762 | + * @since 1.6.6 |
|
1763 | + */ |
|
1764 | + $show_zip_in_address = apply_filters('geodir_show_zip_in_address', $show_zip_in_address); |
|
1765 | + |
|
1766 | + |
|
1767 | + } |
|
1768 | + |
|
1769 | + } |
|
1770 | + |
|
1771 | + |
|
1772 | + if ($post->{$html_var}) { |
|
1773 | + |
|
1774 | + $field_icon = geodir_field_icon_proccess( $cf ); |
|
1775 | + if ( strpos( $field_icon, 'http' ) !== false ) { |
|
1776 | + $field_icon_af = ''; |
|
1777 | + } elseif ( $field_icon == '' ) { |
|
1778 | + $field_icon_af = '<i class="fa fa-home"></i>'; |
|
1779 | + } else { |
|
1780 | + $field_icon_af = $field_icon; |
|
1781 | + $field_icon = ''; |
|
1782 | + } |
|
1783 | 1783 | |
1784 | 1784 | |
1785 | 1785 | |
1786 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $html_var . '" style="clear:both;" itemscope itemtype="http://schema.org/PostalAddress">'; |
|
1787 | - $html .= '<span class="geodir-i-location" style="' . $field_icon . '">' . $field_icon_af; |
|
1788 | - $html .= ( trim( $cf['site_title'] ) ) ? __( $cf['site_title'], 'geodirectory' ) . ': ' : ' '; |
|
1789 | - $html .= '</span>'; |
|
1786 | + $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $html_var . '" style="clear:both;" itemscope itemtype="http://schema.org/PostalAddress">'; |
|
1787 | + $html .= '<span class="geodir-i-location" style="' . $field_icon . '">' . $field_icon_af; |
|
1788 | + $html .= ( trim( $cf['site_title'] ) ) ? __( $cf['site_title'], 'geodirectory' ) . ': ' : ' '; |
|
1789 | + $html .= '</span>'; |
|
1790 | 1790 | |
1791 | 1791 | |
1792 | - if ( $post->post_address ) { |
|
1793 | - $html .= '<span itemprop="streetAddress">' . $post->post_address . '</span><br>'; |
|
1794 | - } |
|
1795 | - if ($show_city_in_address && $post->post_city ) { |
|
1796 | - $html .= '<span itemprop="addressLocality">' . $post->post_city . '</span><br>'; |
|
1797 | - } |
|
1798 | - if ($show_region_in_address && $post->post_region ) { |
|
1799 | - $html .= '<span itemprop="addressRegion">' . $post->post_region . '</span><br>'; |
|
1800 | - } |
|
1801 | - if ($show_zip_in_address && $post->post_zip ) { |
|
1802 | - $html .= '<span itemprop="postalCode">' . $post->post_zip . '</span><br>'; |
|
1803 | - } |
|
1804 | - if ($show_country_in_address && $post->post_country ) { |
|
1805 | - $html .= '<span itemprop="addressCountry">' . __( $post->post_country, 'geodirectory' ) . '</span><br>'; |
|
1806 | - } |
|
1807 | - $html .= '</div>'; |
|
1792 | + if ( $post->post_address ) { |
|
1793 | + $html .= '<span itemprop="streetAddress">' . $post->post_address . '</span><br>'; |
|
1794 | + } |
|
1795 | + if ($show_city_in_address && $post->post_city ) { |
|
1796 | + $html .= '<span itemprop="addressLocality">' . $post->post_city . '</span><br>'; |
|
1797 | + } |
|
1798 | + if ($show_region_in_address && $post->post_region ) { |
|
1799 | + $html .= '<span itemprop="addressRegion">' . $post->post_region . '</span><br>'; |
|
1800 | + } |
|
1801 | + if ($show_zip_in_address && $post->post_zip ) { |
|
1802 | + $html .= '<span itemprop="postalCode">' . $post->post_zip . '</span><br>'; |
|
1803 | + } |
|
1804 | + if ($show_country_in_address && $post->post_country ) { |
|
1805 | + $html .= '<span itemprop="addressCountry">' . __( $post->post_country, 'geodirectory' ) . '</span><br>'; |
|
1806 | + } |
|
1807 | + $html .= '</div>'; |
|
1808 | 1808 | |
1809 | - } |
|
1809 | + } |
|
1810 | 1810 | |
1811 | - } |
|
1811 | + } |
|
1812 | 1812 | |
1813 | 1813 | |
1814 | - return $html; |
|
1814 | + return $html; |
|
1815 | 1815 | } |
1816 | 1816 | add_filter('geodir_custom_field_output_address','geodir_cf_address',10,3); |
1817 | 1817 | \ No newline at end of file |
@@ -19,21 +19,21 @@ discard block |
||
19 | 19 | * |
20 | 20 | * @return string The html to output for the custom field. |
21 | 21 | */ |
22 | -function geodir_cf_checkbox($html,$location,$cf,$p=''){ |
|
22 | +function geodir_cf_checkbox($html, $location, $cf, $p = '') { |
|
23 | 23 | |
24 | 24 | // check we have the post value |
25 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
26 | - else{ global $post;} |
|
25 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
26 | + else { global $post; } |
|
27 | 27 | |
28 | - if(!is_array($cf) && $cf!=''){ |
|
28 | + if (!is_array($cf) && $cf != '') { |
|
29 | 29 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
30 | - if(!$cf){return NULL;} |
|
30 | + if (!$cf) {return NULL; } |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | $html_var = $cf['htmlvar_name']; |
34 | 34 | |
35 | 35 | // Check if there is a location specific filter. |
36 | - if(has_filter("geodir_custom_field_output_checkbox_loc_{$location}")){ |
|
36 | + if (has_filter("geodir_custom_field_output_checkbox_loc_{$location}")) { |
|
37 | 37 | /** |
38 | 38 | * Filter the checkbox html by location. |
39 | 39 | * |
@@ -41,11 +41,11 @@ discard block |
||
41 | 41 | * @param array $cf The custom field array. |
42 | 42 | * @since 1.6.6 |
43 | 43 | */ |
44 | - $html = apply_filters("geodir_custom_field_output_checkbox_loc_{$location}",$html,$cf); |
|
44 | + $html = apply_filters("geodir_custom_field_output_checkbox_loc_{$location}", $html, $cf); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | // Check if there is a custom field specific filter. |
48 | - if(has_filter("geodir_custom_field_output_checkbox_var_{$html_var}")){ |
|
48 | + if (has_filter("geodir_custom_field_output_checkbox_var_{$html_var}")) { |
|
49 | 49 | /** |
50 | 50 | * Filter the checkbox html by individual custom field. |
51 | 51 | * |
@@ -54,11 +54,11 @@ discard block |
||
54 | 54 | * @param array $cf The custom field array. |
55 | 55 | * @since 1.6.6 |
56 | 56 | */ |
57 | - $html = apply_filters("geodir_custom_field_output_checkbox_var_{$html_var}",$html,$location,$cf); |
|
57 | + $html = apply_filters("geodir_custom_field_output_checkbox_var_{$html_var}", $html, $location, $cf); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | // Check if there is a custom field key specific filter. |
61 | - if(has_filter("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}")){ |
|
61 | + if (has_filter("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}")) { |
|
62 | 62 | /** |
63 | 63 | * Filter the checkbox html by field type key. |
64 | 64 | * |
@@ -67,18 +67,18 @@ discard block |
||
67 | 67 | * @param array $cf The custom field array. |
68 | 68 | * @since 1.6.6 |
69 | 69 | */ |
70 | - $html = apply_filters("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
70 | + $html = apply_filters("geodir_custom_field_output_checkbox_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | // If not html then we run the standard output. |
74 | - if(empty($html)){ |
|
74 | + if (empty($html)) { |
|
75 | 75 | |
76 | - if ( (int) $post->{$html_var} == 1 ): |
|
76 | + if ((int) $post->{$html_var} == 1): |
|
77 | 77 | |
78 | - if ( $post->{$html_var} == '1' ): |
|
79 | - $html_val = __( 'Yes', 'geodirectory' ); |
|
78 | + if ($post->{$html_var} == '1'): |
|
79 | + $html_val = __('Yes', 'geodirectory'); |
|
80 | 80 | else: |
81 | - $html_val = __( 'No', 'geodirectory' ); |
|
81 | + $html_val = __('No', 'geodirectory'); |
|
82 | 82 | endif; |
83 | 83 | |
84 | 84 | $field_icon = geodir_field_icon_proccess($cf); |
@@ -91,16 +91,16 @@ discard block |
||
91 | 91 | $field_icon = ''; |
92 | 92 | } |
93 | 93 | |
94 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-checkbox" style="' . $field_icon . '">' . $field_icon_af; |
|
95 | - $html .= ( trim( $cf['site_title'] ) ) ? __( $cf['site_title'], 'geodirectory' ) . ': ' : ''; |
|
96 | - $html .= '</span>' . $html_val . '</div>'; |
|
94 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-checkbox" style="'.$field_icon.'">'.$field_icon_af; |
|
95 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : ''; |
|
96 | + $html .= '</span>'.$html_val.'</div>'; |
|
97 | 97 | endif; |
98 | 98 | |
99 | 99 | } |
100 | 100 | |
101 | 101 | return $html; |
102 | 102 | } |
103 | -add_filter('geodir_custom_field_output_checkbox','geodir_cf_checkbox',10,3); |
|
103 | +add_filter('geodir_custom_field_output_checkbox', 'geodir_cf_checkbox', 10, 3); |
|
104 | 104 | |
105 | 105 | |
106 | 106 | /** |
@@ -113,21 +113,21 @@ discard block |
||
113 | 113 | * |
114 | 114 | * @return string The html to output for the custom field. |
115 | 115 | */ |
116 | -function geodir_cf_fieldset($html,$location,$cf,$p=''){ |
|
116 | +function geodir_cf_fieldset($html, $location, $cf, $p = '') { |
|
117 | 117 | |
118 | 118 | // check we have the post value |
119 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
120 | - else{ global $post;} |
|
119 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
120 | + else { global $post; } |
|
121 | 121 | |
122 | - if(!is_array($cf) && $cf!=''){ |
|
122 | + if (!is_array($cf) && $cf != '') { |
|
123 | 123 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
124 | - if(!$cf){return NULL;} |
|
124 | + if (!$cf) {return NULL; } |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | $html_var = $cf['htmlvar_name']; |
128 | 128 | |
129 | 129 | // Check if there is a location specific filter. |
130 | - if(has_filter("geodir_custom_field_output_fieldset_loc_{$location}")){ |
|
130 | + if (has_filter("geodir_custom_field_output_fieldset_loc_{$location}")) { |
|
131 | 131 | /** |
132 | 132 | * Filter the fieldset html by location. |
133 | 133 | * |
@@ -135,11 +135,11 @@ discard block |
||
135 | 135 | * @param array $cf The custom field array. |
136 | 136 | * @since 1.6.6 |
137 | 137 | */ |
138 | - $html = apply_filters("geodir_custom_field_output_fieldset_loc_{$location}",$html,$cf); |
|
138 | + $html = apply_filters("geodir_custom_field_output_fieldset_loc_{$location}", $html, $cf); |
|
139 | 139 | } |
140 | 140 | |
141 | 141 | // Check if there is a custom field specific filter. |
142 | - if(has_filter("geodir_custom_field_output_fieldset_var_{$html_var}")){ |
|
142 | + if (has_filter("geodir_custom_field_output_fieldset_var_{$html_var}")) { |
|
143 | 143 | /** |
144 | 144 | * Filter the fieldset html by individual custom field. |
145 | 145 | * |
@@ -148,11 +148,11 @@ discard block |
||
148 | 148 | * @param array $cf The custom field array. |
149 | 149 | * @since 1.6.6 |
150 | 150 | */ |
151 | - $html = apply_filters("geodir_custom_field_output_fieldset_var_{$html_var}",$html,$location,$cf); |
|
151 | + $html = apply_filters("geodir_custom_field_output_fieldset_var_{$html_var}", $html, $location, $cf); |
|
152 | 152 | } |
153 | 153 | |
154 | 154 | // Check if there is a custom field key specific filter. |
155 | - if(has_filter("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}")){ |
|
155 | + if (has_filter("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}")) { |
|
156 | 156 | /** |
157 | 157 | * Filter the fieldset html by field type key. |
158 | 158 | * |
@@ -161,11 +161,11 @@ discard block |
||
161 | 161 | * @param array $cf The custom field array. |
162 | 162 | * @since 1.6.6 |
163 | 163 | */ |
164 | - $html = apply_filters("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
164 | + $html = apply_filters("geodir_custom_field_output_fieldset_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
165 | 165 | } |
166 | 166 | |
167 | 167 | // If not html then we run the standard output. |
168 | - if(empty($html)){ |
|
168 | + if (empty($html)) { |
|
169 | 169 | |
170 | 170 | global $field_set_start; |
171 | 171 | $fieldset_class = 'fieldset-'.sanitize_title_with_dashes($cf['site_title']); |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | if ($field_set_start == 1) { |
174 | 174 | $html = ''; |
175 | 175 | } else { |
176 | - $html = '<h2 class="'.$fieldset_class.'">'. __($cf['site_title'], 'geodirectory') . '</h2>'; |
|
176 | + $html = '<h2 class="'.$fieldset_class.'">'.__($cf['site_title'], 'geodirectory').'</h2>'; |
|
177 | 177 | //$field_set_start = 1; |
178 | 178 | } |
179 | 179 | |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | |
182 | 182 | return $html; |
183 | 183 | } |
184 | -add_filter('geodir_custom_field_output_fieldset','geodir_cf_fieldset',10,3); |
|
184 | +add_filter('geodir_custom_field_output_fieldset', 'geodir_cf_fieldset', 10, 3); |
|
185 | 185 | |
186 | 186 | |
187 | 187 | /** |
@@ -194,21 +194,21 @@ discard block |
||
194 | 194 | * |
195 | 195 | * @return string The html to output for the custom field. |
196 | 196 | */ |
197 | -function geodir_cf_url($html,$location,$cf,$p=''){ |
|
197 | +function geodir_cf_url($html, $location, $cf, $p = '') { |
|
198 | 198 | |
199 | 199 | // check we have the post value |
200 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
201 | - else{ global $post;} |
|
200 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
201 | + else { global $post; } |
|
202 | 202 | |
203 | - if(!is_array($cf) && $cf!=''){ |
|
203 | + if (!is_array($cf) && $cf != '') { |
|
204 | 204 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
205 | - if(!$cf){return NULL;} |
|
205 | + if (!$cf) {return NULL; } |
|
206 | 206 | } |
207 | 207 | |
208 | 208 | $html_var = $cf['htmlvar_name']; |
209 | 209 | |
210 | 210 | // Check if there is a location specific filter. |
211 | - if(has_filter("geodir_custom_field_output_url_loc_{$location}")){ |
|
211 | + if (has_filter("geodir_custom_field_output_url_loc_{$location}")) { |
|
212 | 212 | /** |
213 | 213 | * Filter the url html by location. |
214 | 214 | * |
@@ -216,11 +216,11 @@ discard block |
||
216 | 216 | * @param array $cf The custom field array. |
217 | 217 | * @since 1.6.6 |
218 | 218 | */ |
219 | - $html = apply_filters("geodir_custom_field_output_url_loc_{$location}",$html,$cf); |
|
219 | + $html = apply_filters("geodir_custom_field_output_url_loc_{$location}", $html, $cf); |
|
220 | 220 | } |
221 | 221 | |
222 | 222 | // Check if there is a custom field specific filter. |
223 | - if(has_filter("geodir_custom_field_output_url_var_{$html_var}")){ |
|
223 | + if (has_filter("geodir_custom_field_output_url_var_{$html_var}")) { |
|
224 | 224 | /** |
225 | 225 | * Filter the url html by individual custom field. |
226 | 226 | * |
@@ -229,11 +229,11 @@ discard block |
||
229 | 229 | * @param array $cf The custom field array. |
230 | 230 | * @since 1.6.6 |
231 | 231 | */ |
232 | - $html = apply_filters("geodir_custom_field_output_url_var_{$html_var}",$html,$location,$cf); |
|
232 | + $html = apply_filters("geodir_custom_field_output_url_var_{$html_var}", $html, $location, $cf); |
|
233 | 233 | } |
234 | 234 | |
235 | 235 | // Check if there is a custom field key specific filter. |
236 | - if(has_filter("geodir_custom_field_output_url_key_{$cf['field_type_key']}")){ |
|
236 | + if (has_filter("geodir_custom_field_output_url_key_{$cf['field_type_key']}")) { |
|
237 | 237 | /** |
238 | 238 | * Filter the url html by field type key. |
239 | 239 | * |
@@ -242,11 +242,11 @@ discard block |
||
242 | 242 | * @param array $cf The custom field array. |
243 | 243 | * @since 1.6.6 |
244 | 244 | */ |
245 | - $html = apply_filters("geodir_custom_field_output_url_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
245 | + $html = apply_filters("geodir_custom_field_output_url_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
246 | 246 | } |
247 | 247 | |
248 | 248 | // If not html then we run the standard output. |
249 | - if(empty($html)){ |
|
249 | + if (empty($html)) { |
|
250 | 250 | |
251 | 251 | if ($post->{$cf['htmlvar_name']}): |
252 | 252 | |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | |
274 | 274 | $website = !empty($a_url['url']) ? $a_url['url'] : ''; |
275 | 275 | $title = !empty($a_url['label']) ? $a_url['label'] : $cf['site_title']; |
276 | - if(!empty($cf['default_value'])){$title = $cf['default_value'];} |
|
276 | + if (!empty($cf['default_value'])) {$title = $cf['default_value']; } |
|
277 | 277 | $title = $title != '' ? __(stripslashes($title), 'geodirectory') : ''; |
278 | 278 | |
279 | 279 | |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | * @param string $website Website URL. |
290 | 290 | * @param int $post->ID Post ID. |
291 | 291 | */ |
292 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '"><span class="geodir-i-website" style="' . $field_icon . '">' . $field_icon_af . '<a href="' . $website . '" target="_blank" ' . $rel . ' ><strong>' . apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID) . '</strong></a></span></div>'; |
|
292 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'"><span class="geodir-i-website" style="'.$field_icon.'">'.$field_icon_af.'<a href="'.$website.'" target="_blank" '.$rel.' ><strong>'.apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID).'</strong></a></span></div>'; |
|
293 | 293 | |
294 | 294 | endif; |
295 | 295 | |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | |
298 | 298 | return $html; |
299 | 299 | } |
300 | -add_filter('geodir_custom_field_output_url','geodir_cf_url',10,3); |
|
300 | +add_filter('geodir_custom_field_output_url', 'geodir_cf_url', 10, 3); |
|
301 | 301 | |
302 | 302 | |
303 | 303 | /** |
@@ -310,21 +310,21 @@ discard block |
||
310 | 310 | * |
311 | 311 | * @return string The html to output for the custom field. |
312 | 312 | */ |
313 | -function geodir_cf_phone($html,$location,$cf,$p=''){ |
|
313 | +function geodir_cf_phone($html, $location, $cf, $p = '') { |
|
314 | 314 | |
315 | 315 | // check we have the post value |
316 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
317 | - else{ global $post;} |
|
316 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
317 | + else { global $post; } |
|
318 | 318 | |
319 | - if(!is_array($cf) && $cf!=''){ |
|
319 | + if (!is_array($cf) && $cf != '') { |
|
320 | 320 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
321 | - if(!$cf){return NULL;} |
|
321 | + if (!$cf) {return NULL; } |
|
322 | 322 | } |
323 | 323 | |
324 | 324 | $html_var = $cf['htmlvar_name']; |
325 | 325 | |
326 | 326 | // Check if there is a location specific filter. |
327 | - if(has_filter("geodir_custom_field_output_phone_loc_{$location}")){ |
|
327 | + if (has_filter("geodir_custom_field_output_phone_loc_{$location}")) { |
|
328 | 328 | /** |
329 | 329 | * Filter the phone html by location. |
330 | 330 | * |
@@ -332,11 +332,11 @@ discard block |
||
332 | 332 | * @param array $cf The custom field array. |
333 | 333 | * @since 1.6.6 |
334 | 334 | */ |
335 | - $html = apply_filters("geodir_custom_field_output_phone_loc_{$location}",$html,$cf); |
|
335 | + $html = apply_filters("geodir_custom_field_output_phone_loc_{$location}", $html, $cf); |
|
336 | 336 | } |
337 | 337 | |
338 | 338 | // Check if there is a custom field specific filter. |
339 | - if(has_filter("geodir_custom_field_output_phone_var_{$html_var}")){ |
|
339 | + if (has_filter("geodir_custom_field_output_phone_var_{$html_var}")) { |
|
340 | 340 | /** |
341 | 341 | * Filter the phone html by individual custom field. |
342 | 342 | * |
@@ -345,11 +345,11 @@ discard block |
||
345 | 345 | * @param array $cf The custom field array. |
346 | 346 | * @since 1.6.6 |
347 | 347 | */ |
348 | - $html = apply_filters("geodir_custom_field_output_phone_var_{$html_var}",$html,$location,$cf); |
|
348 | + $html = apply_filters("geodir_custom_field_output_phone_var_{$html_var}", $html, $location, $cf); |
|
349 | 349 | } |
350 | 350 | |
351 | 351 | // Check if there is a custom field key specific filter. |
352 | - if(has_filter("geodir_custom_field_output_phone_key_{$cf['field_type_key']}")){ |
|
352 | + if (has_filter("geodir_custom_field_output_phone_key_{$cf['field_type_key']}")) { |
|
353 | 353 | /** |
354 | 354 | * Filter the phone html by field type key. |
355 | 355 | * |
@@ -358,11 +358,11 @@ discard block |
||
358 | 358 | * @param array $cf The custom field array. |
359 | 359 | * @since 1.6.6 |
360 | 360 | */ |
361 | - $html = apply_filters("geodir_custom_field_output_phone_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
361 | + $html = apply_filters("geodir_custom_field_output_phone_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
362 | 362 | } |
363 | 363 | |
364 | 364 | // If not html then we run the standard output. |
365 | - if(empty($html)){ |
|
365 | + if (empty($html)) { |
|
366 | 366 | |
367 | 367 | if ($post->{$cf['htmlvar_name']}): |
368 | 368 | |
@@ -377,9 +377,9 @@ discard block |
||
377 | 377 | } |
378 | 378 | |
379 | 379 | |
380 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-contact" style="' . $field_icon . '">' . $field_icon_af . |
|
381 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ' '; |
|
382 | - $html .= '</span><a href="tel:' . preg_replace('/[^0-9+]/', '', $post->{$cf['htmlvar_name']}) . '">' . $post->{$cf['htmlvar_name']} . '</a></div>'; |
|
380 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-contact" style="'.$field_icon.'">'.$field_icon_af. |
|
381 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : ' '; |
|
382 | + $html .= '</span><a href="tel:'.preg_replace('/[^0-9+]/', '', $post->{$cf['htmlvar_name']}).'">'.$post->{$cf['htmlvar_name']}.'</a></div>'; |
|
383 | 383 | |
384 | 384 | endif; |
385 | 385 | |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | |
388 | 388 | return $html; |
389 | 389 | } |
390 | -add_filter('geodir_custom_field_output_phone','geodir_cf_phone',10,3); |
|
390 | +add_filter('geodir_custom_field_output_phone', 'geodir_cf_phone', 10, 3); |
|
391 | 391 | |
392 | 392 | |
393 | 393 | /** |
@@ -400,21 +400,21 @@ discard block |
||
400 | 400 | * |
401 | 401 | * @return string The html to output for the custom field. |
402 | 402 | */ |
403 | -function geodir_cf_time($html,$location,$cf,$p=''){ |
|
403 | +function geodir_cf_time($html, $location, $cf, $p = '') { |
|
404 | 404 | |
405 | 405 | // check we have the post value |
406 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
407 | - else{ global $post;} |
|
406 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
407 | + else { global $post; } |
|
408 | 408 | |
409 | - if(!is_array($cf) && $cf!=''){ |
|
409 | + if (!is_array($cf) && $cf != '') { |
|
410 | 410 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
411 | - if(!$cf){return NULL;} |
|
411 | + if (!$cf) {return NULL; } |
|
412 | 412 | } |
413 | 413 | |
414 | 414 | $html_var = $cf['htmlvar_name']; |
415 | 415 | |
416 | 416 | // Check if there is a location specific filter. |
417 | - if(has_filter("geodir_custom_field_output_time_loc_{$location}")){ |
|
417 | + if (has_filter("geodir_custom_field_output_time_loc_{$location}")) { |
|
418 | 418 | /** |
419 | 419 | * Filter the time html by location. |
420 | 420 | * |
@@ -422,11 +422,11 @@ discard block |
||
422 | 422 | * @param array $cf The custom field array. |
423 | 423 | * @since 1.6.6 |
424 | 424 | */ |
425 | - $html = apply_filters("geodir_custom_field_output_time_loc_{$location}",$html,$cf); |
|
425 | + $html = apply_filters("geodir_custom_field_output_time_loc_{$location}", $html, $cf); |
|
426 | 426 | } |
427 | 427 | |
428 | 428 | // Check if there is a custom field specific filter. |
429 | - if(has_filter("geodir_custom_field_output_time_var_{$html_var}")){ |
|
429 | + if (has_filter("geodir_custom_field_output_time_var_{$html_var}")) { |
|
430 | 430 | /** |
431 | 431 | * Filter the time html by individual custom field. |
432 | 432 | * |
@@ -435,11 +435,11 @@ discard block |
||
435 | 435 | * @param array $cf The custom field array. |
436 | 436 | * @since 1.6.6 |
437 | 437 | */ |
438 | - $html = apply_filters("geodir_custom_field_output_time_var_{$html_var}",$html,$location,$cf); |
|
438 | + $html = apply_filters("geodir_custom_field_output_time_var_{$html_var}", $html, $location, $cf); |
|
439 | 439 | } |
440 | 440 | |
441 | 441 | // Check if there is a custom field key specific filter. |
442 | - if(has_filter("geodir_custom_field_output_time_key_{$cf['field_type_key']}")){ |
|
442 | + if (has_filter("geodir_custom_field_output_time_key_{$cf['field_type_key']}")) { |
|
443 | 443 | /** |
444 | 444 | * Filter the time html by field type key. |
445 | 445 | * |
@@ -448,11 +448,11 @@ discard block |
||
448 | 448 | * @param array $cf The custom field array. |
449 | 449 | * @since 1.6.6 |
450 | 450 | */ |
451 | - $html = apply_filters("geodir_custom_field_output_time_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
451 | + $html = apply_filters("geodir_custom_field_output_time_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
452 | 452 | } |
453 | 453 | |
454 | 454 | // If not html then we run the standard output. |
455 | - if(empty($html)){ |
|
455 | + if (empty($html)) { |
|
456 | 456 | |
457 | 457 | if ($post->{$cf['htmlvar_name']}): |
458 | 458 | |
@@ -472,9 +472,9 @@ discard block |
||
472 | 472 | } |
473 | 473 | |
474 | 474 | |
475 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-time" style="' . $field_icon . '">' . $field_icon_af; |
|
476 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ' '; |
|
477 | - $html .= '</span>' . $value . '</div>'; |
|
475 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-time" style="'.$field_icon.'">'.$field_icon_af; |
|
476 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : ' '; |
|
477 | + $html .= '</span>'.$value.'</div>'; |
|
478 | 478 | |
479 | 479 | endif; |
480 | 480 | |
@@ -482,7 +482,7 @@ discard block |
||
482 | 482 | |
483 | 483 | return $html; |
484 | 484 | } |
485 | -add_filter('geodir_custom_field_output_time','geodir_cf_time',10,3); |
|
485 | +add_filter('geodir_custom_field_output_time', 'geodir_cf_time', 10, 3); |
|
486 | 486 | |
487 | 487 | |
488 | 488 | /** |
@@ -495,21 +495,21 @@ discard block |
||
495 | 495 | * |
496 | 496 | * @return string The html to output for the custom field. |
497 | 497 | */ |
498 | -function geodir_cf_datepicker($html,$location,$cf,$p=''){ |
|
498 | +function geodir_cf_datepicker($html, $location, $cf, $p = '') { |
|
499 | 499 | global $preview; |
500 | 500 | // check we have the post value |
501 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
502 | - else{ global $post;} |
|
501 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
502 | + else { global $post; } |
|
503 | 503 | |
504 | - if(!is_array($cf) && $cf!=''){ |
|
504 | + if (!is_array($cf) && $cf != '') { |
|
505 | 505 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
506 | - if(!$cf){return NULL;} |
|
506 | + if (!$cf) {return NULL; } |
|
507 | 507 | } |
508 | 508 | |
509 | 509 | $html_var = $cf['htmlvar_name']; |
510 | 510 | |
511 | 511 | // Check if there is a location specific filter. |
512 | - if(has_filter("geodir_custom_field_output_datepicker_loc_{$location}")){ |
|
512 | + if (has_filter("geodir_custom_field_output_datepicker_loc_{$location}")) { |
|
513 | 513 | /** |
514 | 514 | * Filter the datepicker html by location. |
515 | 515 | * |
@@ -517,11 +517,11 @@ discard block |
||
517 | 517 | * @param array $cf The custom field array. |
518 | 518 | * @since 1.6.6 |
519 | 519 | */ |
520 | - $html = apply_filters("geodir_custom_field_output_datepicker_loc_{$location}",$html,$cf); |
|
520 | + $html = apply_filters("geodir_custom_field_output_datepicker_loc_{$location}", $html, $cf); |
|
521 | 521 | } |
522 | 522 | |
523 | 523 | // Check if there is a custom field specific filter. |
524 | - if(has_filter("geodir_custom_field_output_datepicker_var_{$html_var}")){ |
|
524 | + if (has_filter("geodir_custom_field_output_datepicker_var_{$html_var}")) { |
|
525 | 525 | /** |
526 | 526 | * Filter the datepicker html by individual custom field. |
527 | 527 | * |
@@ -530,11 +530,11 @@ discard block |
||
530 | 530 | * @param array $cf The custom field array. |
531 | 531 | * @since 1.6.6 |
532 | 532 | */ |
533 | - $html = apply_filters("geodir_custom_field_output_datepicker_var_{$html_var}",$html,$location,$cf); |
|
533 | + $html = apply_filters("geodir_custom_field_output_datepicker_var_{$html_var}", $html, $location, $cf); |
|
534 | 534 | } |
535 | 535 | |
536 | 536 | // Check if there is a custom field key specific filter. |
537 | - if(has_filter("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}")){ |
|
537 | + if (has_filter("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}")) { |
|
538 | 538 | /** |
539 | 539 | * Filter the datepicker html by field type key. |
540 | 540 | * |
@@ -543,11 +543,11 @@ discard block |
||
543 | 543 | * @param array $cf The custom field array. |
544 | 544 | * @since 1.6.6 |
545 | 545 | */ |
546 | - $html = apply_filters("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
546 | + $html = apply_filters("geodir_custom_field_output_datepicker_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
547 | 547 | } |
548 | 548 | |
549 | 549 | // If not html then we run the standard output. |
550 | - if(empty($html)){ |
|
550 | + if (empty($html)) { |
|
551 | 551 | |
552 | 552 | if ($post->{$cf['htmlvar_name']}): |
553 | 553 | |
@@ -558,24 +558,24 @@ discard block |
||
558 | 558 | } |
559 | 559 | // check if we need to change the format or not |
560 | 560 | $date_format_len = strlen(str_replace(' ', '', $date_format)); |
561 | - if($date_format_len>5){// if greater then 4 then it's the old style format. |
|
561 | + if ($date_format_len > 5) {// if greater then 4 then it's the old style format. |
|
562 | 562 | |
563 | - $search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format |
|
564 | - $replace = array('d','j','l','m','n','F','Y');//PHP date format |
|
563 | + $search = array('dd', 'd', 'DD', 'mm', 'm', 'MM', 'yy'); //jQuery UI datepicker format |
|
564 | + $replace = array('d', 'j', 'l', 'm', 'n', 'F', 'Y'); //PHP date format |
|
565 | 565 | |
566 | 566 | $date_format = str_replace($search, $replace, $date_format); |
567 | 567 | |
568 | - $post_htmlvar_value = ($date_format == 'd/m/Y' || $date_format == 'j/n/Y' ) ? str_replace('/', '-', $post->{$cf['htmlvar_name']}) : $post->{$cf['htmlvar_name']}; // PHP doesn't work well with dd/mm/yyyy format |
|
569 | - }else{ |
|
568 | + $post_htmlvar_value = ($date_format == 'd/m/Y' || $date_format == 'j/n/Y') ? str_replace('/', '-', $post->{$cf['htmlvar_name']}) : $post->{$cf['htmlvar_name']}; // PHP doesn't work well with dd/mm/yyyy format |
|
569 | + } else { |
|
570 | 570 | $post_htmlvar_value = $post->{$cf['htmlvar_name']}; |
571 | 571 | } |
572 | 572 | |
573 | - if ($post->{$cf['htmlvar_name']} != '' && $post->{$cf['htmlvar_name']}!="0000-00-00") { |
|
573 | + if ($post->{$cf['htmlvar_name']} != '' && $post->{$cf['htmlvar_name']} != "0000-00-00") { |
|
574 | 574 | $date_format_from = $preview ? $date_format : 'Y-m-d'; |
575 | 575 | $value = geodir_date($post_htmlvar_value, $date_format, $date_format_from); // save as sql format Y-m-d |
576 | 576 | //$post_htmlvar_value = strpos($post_htmlvar_value, '/') !== false ? str_replace('/', '-', $post_htmlvar_value) : $post_htmlvar_value; |
577 | 577 | //$value = date_i18n($date_format, strtotime($post_htmlvar_value)); |
578 | - }else{ |
|
578 | + } else { |
|
579 | 579 | return ''; |
580 | 580 | } |
581 | 581 | |
@@ -592,9 +592,9 @@ discard block |
||
592 | 592 | |
593 | 593 | |
594 | 594 | |
595 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-datepicker" style="' . $field_icon . '">' . $field_icon_af; |
|
596 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
597 | - $html .= '</span>' . $value . '</div>'; |
|
595 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-datepicker" style="'.$field_icon.'">'.$field_icon_af; |
|
596 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : ''; |
|
597 | + $html .= '</span>'.$value.'</div>'; |
|
598 | 598 | |
599 | 599 | endif; |
600 | 600 | |
@@ -602,7 +602,7 @@ discard block |
||
602 | 602 | |
603 | 603 | return $html; |
604 | 604 | } |
605 | -add_filter('geodir_custom_field_output_datepicker','geodir_cf_datepicker',10,3); |
|
605 | +add_filter('geodir_custom_field_output_datepicker', 'geodir_cf_datepicker', 10, 3); |
|
606 | 606 | |
607 | 607 | |
608 | 608 | /** |
@@ -615,21 +615,21 @@ discard block |
||
615 | 615 | * |
616 | 616 | * @return string The html to output for the custom field. |
617 | 617 | */ |
618 | -function geodir_cf_text($html,$location,$cf,$p=''){ |
|
618 | +function geodir_cf_text($html, $location, $cf, $p = '') { |
|
619 | 619 | |
620 | 620 | // check we have the post value |
621 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
622 | - else{ global $post;} |
|
621 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
622 | + else { global $post; } |
|
623 | 623 | |
624 | - if(!is_array($cf) && $cf!=''){ |
|
624 | + if (!is_array($cf) && $cf != '') { |
|
625 | 625 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
626 | - if(!$cf){return NULL;} |
|
626 | + if (!$cf) {return NULL; } |
|
627 | 627 | } |
628 | 628 | |
629 | 629 | $html_var = $cf['htmlvar_name']; |
630 | 630 | |
631 | 631 | // Check if there is a location specific filter. |
632 | - if(has_filter("geodir_custom_field_output_text_loc_{$location}")){ |
|
632 | + if (has_filter("geodir_custom_field_output_text_loc_{$location}")) { |
|
633 | 633 | /** |
634 | 634 | * Filter the text html by location. |
635 | 635 | * |
@@ -637,11 +637,11 @@ discard block |
||
637 | 637 | * @param array $cf The custom field array. |
638 | 638 | * @since 1.6.6 |
639 | 639 | */ |
640 | - $html = apply_filters("geodir_custom_field_output_text_loc_{$location}",$html,$cf); |
|
640 | + $html = apply_filters("geodir_custom_field_output_text_loc_{$location}", $html, $cf); |
|
641 | 641 | } |
642 | 642 | |
643 | 643 | // Check if there is a custom field specific filter. |
644 | - if(has_filter("geodir_custom_field_output_text_var_{$html_var}")){ |
|
644 | + if (has_filter("geodir_custom_field_output_text_var_{$html_var}")) { |
|
645 | 645 | /** |
646 | 646 | * Filter the text html by individual custom field. |
647 | 647 | * |
@@ -650,11 +650,11 @@ discard block |
||
650 | 650 | * @param array $cf The custom field array. |
651 | 651 | * @since 1.6.6 |
652 | 652 | */ |
653 | - $html = apply_filters("geodir_custom_field_output_text_var_{$html_var}",$html,$location,$cf); |
|
653 | + $html = apply_filters("geodir_custom_field_output_text_var_{$html_var}", $html, $location, $cf); |
|
654 | 654 | } |
655 | 655 | |
656 | 656 | // Check if there is a custom field key specific filter. |
657 | - if(has_filter("geodir_custom_field_output_text_key_{$cf['field_type_key']}")){ |
|
657 | + if (has_filter("geodir_custom_field_output_text_key_{$cf['field_type_key']}")) { |
|
658 | 658 | /** |
659 | 659 | * Filter the text html by field type key. |
660 | 660 | * |
@@ -663,15 +663,15 @@ discard block |
||
663 | 663 | * @param array $cf The custom field array. |
664 | 664 | * @since 1.6.6 |
665 | 665 | */ |
666 | - $html = apply_filters("geodir_custom_field_output_text_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
666 | + $html = apply_filters("geodir_custom_field_output_text_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
667 | 667 | } |
668 | 668 | |
669 | 669 | |
670 | 670 | |
671 | 671 | // If not html then we run the standard output. |
672 | - if(empty($html)){ |
|
672 | + if (empty($html)) { |
|
673 | 673 | |
674 | - if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != '' ): |
|
674 | + if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != ''): |
|
675 | 675 | |
676 | 676 | $class = ($cf['htmlvar_name'] == 'geodir_timing') ? "geodir-i-time" : "geodir-i-text"; |
677 | 677 | |
@@ -686,9 +686,9 @@ discard block |
||
686 | 686 | } |
687 | 687 | |
688 | 688 | |
689 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="'.$class.'" style="' . $field_icon . '">' . $field_icon_af; |
|
690 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
691 | - $html .= '</span>' . $post->{$cf['htmlvar_name']} . '</div>'; |
|
689 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="'.$class.'" style="'.$field_icon.'">'.$field_icon_af; |
|
690 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : ''; |
|
691 | + $html .= '</span>'.$post->{$cf['htmlvar_name']}.'</div>'; |
|
692 | 692 | |
693 | 693 | endif; |
694 | 694 | |
@@ -696,7 +696,7 @@ discard block |
||
696 | 696 | |
697 | 697 | return $html; |
698 | 698 | } |
699 | -add_filter('geodir_custom_field_output_text','geodir_cf_text',10,3); |
|
699 | +add_filter('geodir_custom_field_output_text', 'geodir_cf_text', 10, 3); |
|
700 | 700 | |
701 | 701 | |
702 | 702 | /** |
@@ -709,21 +709,21 @@ discard block |
||
709 | 709 | * |
710 | 710 | * @return string The html to output for the custom field. |
711 | 711 | */ |
712 | -function geodir_cf_radio($html,$location,$cf,$p=''){ |
|
712 | +function geodir_cf_radio($html, $location, $cf, $p = '') { |
|
713 | 713 | |
714 | 714 | // check we have the post value |
715 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
716 | - else{ global $post;} |
|
715 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
716 | + else { global $post; } |
|
717 | 717 | |
718 | - if(!is_array($cf) && $cf!=''){ |
|
718 | + if (!is_array($cf) && $cf != '') { |
|
719 | 719 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
720 | - if(!$cf){return NULL;} |
|
720 | + if (!$cf) {return NULL; } |
|
721 | 721 | } |
722 | 722 | |
723 | 723 | $html_var = $cf['htmlvar_name']; |
724 | 724 | |
725 | 725 | // Check if there is a location specific filter. |
726 | - if(has_filter("geodir_custom_field_output_radio_loc_{$location}")){ |
|
726 | + if (has_filter("geodir_custom_field_output_radio_loc_{$location}")) { |
|
727 | 727 | /** |
728 | 728 | * Filter the radio html by location. |
729 | 729 | * |
@@ -731,11 +731,11 @@ discard block |
||
731 | 731 | * @param array $cf The custom field array. |
732 | 732 | * @since 1.6.6 |
733 | 733 | */ |
734 | - $html = apply_filters("geodir_custom_field_output_radio_loc_{$location}",$html,$cf); |
|
734 | + $html = apply_filters("geodir_custom_field_output_radio_loc_{$location}", $html, $cf); |
|
735 | 735 | } |
736 | 736 | |
737 | 737 | // Check if there is a custom field specific filter. |
738 | - if(has_filter("geodir_custom_field_output_radio_var_{$html_var}")){ |
|
738 | + if (has_filter("geodir_custom_field_output_radio_var_{$html_var}")) { |
|
739 | 739 | /** |
740 | 740 | * Filter the radio html by individual custom field. |
741 | 741 | * |
@@ -744,11 +744,11 @@ discard block |
||
744 | 744 | * @param array $cf The custom field array. |
745 | 745 | * @since 1.6.6 |
746 | 746 | */ |
747 | - $html = apply_filters("geodir_custom_field_output_radio_var_{$html_var}",$html,$location,$cf); |
|
747 | + $html = apply_filters("geodir_custom_field_output_radio_var_{$html_var}", $html, $location, $cf); |
|
748 | 748 | } |
749 | 749 | |
750 | 750 | // Check if there is a custom field key specific filter. |
751 | - if(has_filter("geodir_custom_field_output_radio_key_{$cf['field_type_key']}")){ |
|
751 | + if (has_filter("geodir_custom_field_output_radio_key_{$cf['field_type_key']}")) { |
|
752 | 752 | /** |
753 | 753 | * Filter the radio html by field type key. |
754 | 754 | * |
@@ -757,11 +757,11 @@ discard block |
||
757 | 757 | * @param array $cf The custom field array. |
758 | 758 | * @since 1.6.6 |
759 | 759 | */ |
760 | - $html = apply_filters("geodir_custom_field_output_radio_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
760 | + $html = apply_filters("geodir_custom_field_output_radio_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
761 | 761 | } |
762 | 762 | |
763 | 763 | // If not html then we run the standard output. |
764 | - if(empty($html)){ |
|
764 | + if (empty($html)) { |
|
765 | 765 | |
766 | 766 | $html_val = isset($post->{$cf['htmlvar_name']}) ? __($post->{$cf['htmlvar_name']}, 'geodirectory') : ''; |
767 | 767 | if (isset($post->{$cf['htmlvar_name']}) && $post->{$cf['htmlvar_name']} != ''): |
@@ -795,16 +795,16 @@ discard block |
||
795 | 795 | } |
796 | 796 | |
797 | 797 | |
798 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-radio" style="' . $field_icon . '">' . $field_icon_af; |
|
799 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
800 | - $html .= '</span>' . $html_val . '</div>'; |
|
798 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-radio" style="'.$field_icon.'">'.$field_icon_af; |
|
799 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : ''; |
|
800 | + $html .= '</span>'.$html_val.'</div>'; |
|
801 | 801 | endif; |
802 | 802 | |
803 | 803 | } |
804 | 804 | |
805 | 805 | return $html; |
806 | 806 | } |
807 | -add_filter('geodir_custom_field_output_radio','geodir_cf_radio',10,3); |
|
807 | +add_filter('geodir_custom_field_output_radio', 'geodir_cf_radio', 10, 3); |
|
808 | 808 | |
809 | 809 | |
810 | 810 | /** |
@@ -817,21 +817,21 @@ discard block |
||
817 | 817 | * |
818 | 818 | * @return string The html to output for the custom field. |
819 | 819 | */ |
820 | -function geodir_cf_select($html,$location,$cf,$p=''){ |
|
820 | +function geodir_cf_select($html, $location, $cf, $p = '') { |
|
821 | 821 | |
822 | 822 | // check we have the post value |
823 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
824 | - else{ global $post;} |
|
823 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
824 | + else { global $post; } |
|
825 | 825 | |
826 | - if(!is_array($cf) && $cf!=''){ |
|
826 | + if (!is_array($cf) && $cf != '') { |
|
827 | 827 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
828 | - if(!$cf){return NULL;} |
|
828 | + if (!$cf) {return NULL; } |
|
829 | 829 | } |
830 | 830 | |
831 | 831 | $html_var = $cf['htmlvar_name']; |
832 | 832 | |
833 | 833 | // Check if there is a location specific filter. |
834 | - if(has_filter("geodir_custom_field_output_select_loc_{$location}")){ |
|
834 | + if (has_filter("geodir_custom_field_output_select_loc_{$location}")) { |
|
835 | 835 | /** |
836 | 836 | * Filter the select html by location. |
837 | 837 | * |
@@ -839,11 +839,11 @@ discard block |
||
839 | 839 | * @param array $cf The custom field array. |
840 | 840 | * @since 1.6.6 |
841 | 841 | */ |
842 | - $html = apply_filters("geodir_custom_field_output_select_loc_{$location}",$html,$cf); |
|
842 | + $html = apply_filters("geodir_custom_field_output_select_loc_{$location}", $html, $cf); |
|
843 | 843 | } |
844 | 844 | |
845 | 845 | // Check if there is a custom field specific filter. |
846 | - if(has_filter("geodir_custom_field_output_select_var_{$html_var}")){ |
|
846 | + if (has_filter("geodir_custom_field_output_select_var_{$html_var}")) { |
|
847 | 847 | /** |
848 | 848 | * Filter the select html by individual custom field. |
849 | 849 | * |
@@ -852,11 +852,11 @@ discard block |
||
852 | 852 | * @param array $cf The custom field array. |
853 | 853 | * @since 1.6.6 |
854 | 854 | */ |
855 | - $html = apply_filters("geodir_custom_field_output_select_var_{$html_var}",$html,$location,$cf); |
|
855 | + $html = apply_filters("geodir_custom_field_output_select_var_{$html_var}", $html, $location, $cf); |
|
856 | 856 | } |
857 | 857 | |
858 | 858 | // Check if there is a custom field key specific filter. |
859 | - if(has_filter("geodir_custom_field_output_select_key_{$cf['field_type_key']}")){ |
|
859 | + if (has_filter("geodir_custom_field_output_select_key_{$cf['field_type_key']}")) { |
|
860 | 860 | /** |
861 | 861 | * Filter the select html by field type key. |
862 | 862 | * |
@@ -865,11 +865,11 @@ discard block |
||
865 | 865 | * @param array $cf The custom field array. |
866 | 866 | * @since 1.6.6 |
867 | 867 | */ |
868 | - $html = apply_filters("geodir_custom_field_output_select_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
868 | + $html = apply_filters("geodir_custom_field_output_select_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
869 | 869 | } |
870 | 870 | |
871 | 871 | // If not html then we run the standard output. |
872 | - if(empty($html)){ |
|
872 | + if (empty($html)) { |
|
873 | 873 | |
874 | 874 | if ($post->{$cf['htmlvar_name']}): |
875 | 875 | $field_value = __($post->{$cf['htmlvar_name']}, 'geodirectory'); |
@@ -897,16 +897,16 @@ discard block |
||
897 | 897 | } |
898 | 898 | |
899 | 899 | |
900 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af; |
|
901 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
902 | - $html .= '</span>' . $field_value . '</div>'; |
|
900 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-select" style="'.$field_icon.'">'.$field_icon_af; |
|
901 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : ''; |
|
902 | + $html .= '</span>'.$field_value.'</div>'; |
|
903 | 903 | endif; |
904 | 904 | |
905 | 905 | } |
906 | 906 | |
907 | 907 | return $html; |
908 | 908 | } |
909 | -add_filter('geodir_custom_field_output_select','geodir_cf_select',10,3); |
|
909 | +add_filter('geodir_custom_field_output_select', 'geodir_cf_select', 10, 3); |
|
910 | 910 | |
911 | 911 | |
912 | 912 | /** |
@@ -919,21 +919,21 @@ discard block |
||
919 | 919 | * |
920 | 920 | * @return string The html to output for the custom field. |
921 | 921 | */ |
922 | -function geodir_cf_multiselect($html,$location,$cf,$p=''){ |
|
922 | +function geodir_cf_multiselect($html, $location, $cf, $p = '') { |
|
923 | 923 | |
924 | 924 | // check we have the post value |
925 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
926 | - else{ global $post;} |
|
925 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
926 | + else { global $post; } |
|
927 | 927 | |
928 | - if(!is_array($cf) && $cf!=''){ |
|
928 | + if (!is_array($cf) && $cf != '') { |
|
929 | 929 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
930 | - if(!$cf){return NULL;} |
|
930 | + if (!$cf) {return NULL; } |
|
931 | 931 | } |
932 | 932 | |
933 | 933 | $html_var = $cf['htmlvar_name']; |
934 | 934 | |
935 | 935 | // Check if there is a location specific filter. |
936 | - if(has_filter("geodir_custom_field_output_multiselect_loc_{$location}")){ |
|
936 | + if (has_filter("geodir_custom_field_output_multiselect_loc_{$location}")) { |
|
937 | 937 | /** |
938 | 938 | * Filter the multiselect html by location. |
939 | 939 | * |
@@ -941,11 +941,11 @@ discard block |
||
941 | 941 | * @param array $cf The custom field array. |
942 | 942 | * @since 1.6.6 |
943 | 943 | */ |
944 | - $html = apply_filters("geodir_custom_field_output_multiselect_loc_{$location}",$html,$cf); |
|
944 | + $html = apply_filters("geodir_custom_field_output_multiselect_loc_{$location}", $html, $cf); |
|
945 | 945 | } |
946 | 946 | |
947 | 947 | // Check if there is a custom field specific filter. |
948 | - if(has_filter("geodir_custom_field_output_multiselect_var_{$html_var}")){ |
|
948 | + if (has_filter("geodir_custom_field_output_multiselect_var_{$html_var}")) { |
|
949 | 949 | /** |
950 | 950 | * Filter the multiselect html by individual custom field. |
951 | 951 | * |
@@ -954,11 +954,11 @@ discard block |
||
954 | 954 | * @param array $cf The custom field array. |
955 | 955 | * @since 1.6.6 |
956 | 956 | */ |
957 | - $html = apply_filters("geodir_custom_field_output_multiselect_var_{$html_var}",$html,$location,$cf); |
|
957 | + $html = apply_filters("geodir_custom_field_output_multiselect_var_{$html_var}", $html, $location, $cf); |
|
958 | 958 | } |
959 | 959 | |
960 | 960 | // Check if there is a custom field key specific filter. |
961 | - if(has_filter("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}")){ |
|
961 | + if (has_filter("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}")) { |
|
962 | 962 | /** |
963 | 963 | * Filter the multiselect html by field type key. |
964 | 964 | * |
@@ -967,11 +967,11 @@ discard block |
||
967 | 967 | * @param array $cf The custom field array. |
968 | 968 | * @since 1.6.6 |
969 | 969 | */ |
970 | - $html = apply_filters("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
970 | + $html = apply_filters("geodir_custom_field_output_multiselect_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
971 | 971 | } |
972 | 972 | |
973 | 973 | // If not html then we run the standard output. |
974 | - if(empty($html)){ |
|
974 | + if (empty($html)) { |
|
975 | 975 | |
976 | 976 | |
977 | 977 | if (!empty($post->{$cf['htmlvar_name']})): |
@@ -992,7 +992,7 @@ discard block |
||
992 | 992 | |
993 | 993 | $field_values = explode(',', trim($post->{$cf['htmlvar_name']}, ",")); |
994 | 994 | |
995 | - if(is_array($field_values)){ |
|
995 | + if (is_array($field_values)) { |
|
996 | 996 | $field_values = array_map('trim', $field_values); |
997 | 997 | } |
998 | 998 | |
@@ -1010,15 +1010,15 @@ discard block |
||
1010 | 1010 | } |
1011 | 1011 | |
1012 | 1012 | |
1013 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af; |
|
1014 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
1013 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-select" style="'.$field_icon.'">'.$field_icon_af; |
|
1014 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : ''; |
|
1015 | 1015 | $html .= '</span>'; |
1016 | 1016 | |
1017 | 1017 | if (count($option_values) > 1) { |
1018 | 1018 | $html .= '<ul>'; |
1019 | 1019 | |
1020 | 1020 | foreach ($option_values as $val) { |
1021 | - $html .= '<li>' . $val . '</li>'; |
|
1021 | + $html .= '<li>'.$val.'</li>'; |
|
1022 | 1022 | } |
1023 | 1023 | |
1024 | 1024 | $html .= '</ul>'; |
@@ -1033,7 +1033,7 @@ discard block |
||
1033 | 1033 | |
1034 | 1034 | return $html; |
1035 | 1035 | } |
1036 | -add_filter('geodir_custom_field_output_multiselect','geodir_cf_multiselect',10,3); |
|
1036 | +add_filter('geodir_custom_field_output_multiselect', 'geodir_cf_multiselect', 10, 3); |
|
1037 | 1037 | |
1038 | 1038 | |
1039 | 1039 | /** |
@@ -1046,21 +1046,21 @@ discard block |
||
1046 | 1046 | * |
1047 | 1047 | * @return string The html to output for the custom field. |
1048 | 1048 | */ |
1049 | -function geodir_cf_email($html,$location,$cf,$p=''){ |
|
1049 | +function geodir_cf_email($html, $location, $cf, $p = '') { |
|
1050 | 1050 | |
1051 | 1051 | // check we have the post value |
1052 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
1053 | - else{ global $post;} |
|
1052 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
1053 | + else { global $post; } |
|
1054 | 1054 | |
1055 | - if(!is_array($cf) && $cf!=''){ |
|
1055 | + if (!is_array($cf) && $cf != '') { |
|
1056 | 1056 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
1057 | - if(!$cf){return NULL;} |
|
1057 | + if (!$cf) {return NULL; } |
|
1058 | 1058 | } |
1059 | 1059 | |
1060 | 1060 | $html_var = $cf['htmlvar_name']; |
1061 | 1061 | |
1062 | 1062 | // Check if there is a location specific filter. |
1063 | - if(has_filter("geodir_custom_field_output_email_loc_{$location}")){ |
|
1063 | + if (has_filter("geodir_custom_field_output_email_loc_{$location}")) { |
|
1064 | 1064 | /** |
1065 | 1065 | * Filter the email html by location. |
1066 | 1066 | * |
@@ -1068,11 +1068,11 @@ discard block |
||
1068 | 1068 | * @param array $cf The custom field array. |
1069 | 1069 | * @since 1.6.6 |
1070 | 1070 | */ |
1071 | - $html = apply_filters("geodir_custom_field_output_email_loc_{$location}",$html,$cf); |
|
1071 | + $html = apply_filters("geodir_custom_field_output_email_loc_{$location}", $html, $cf); |
|
1072 | 1072 | } |
1073 | 1073 | |
1074 | 1074 | // Check if there is a custom field specific filter. |
1075 | - if(has_filter("geodir_custom_field_output_email_var_{$html_var}")){ |
|
1075 | + if (has_filter("geodir_custom_field_output_email_var_{$html_var}")) { |
|
1076 | 1076 | /** |
1077 | 1077 | * Filter the email html by individual custom field. |
1078 | 1078 | * |
@@ -1081,11 +1081,11 @@ discard block |
||
1081 | 1081 | * @param array $cf The custom field array. |
1082 | 1082 | * @since 1.6.6 |
1083 | 1083 | */ |
1084 | - $html = apply_filters("geodir_custom_field_output_email_var_{$html_var}",$html,$location,$cf); |
|
1084 | + $html = apply_filters("geodir_custom_field_output_email_var_{$html_var}", $html, $location, $cf); |
|
1085 | 1085 | } |
1086 | 1086 | |
1087 | 1087 | // Check if there is a custom field key specific filter. |
1088 | - if(has_filter("geodir_custom_field_output_email_key_{$cf['field_type_key']}")){ |
|
1088 | + if (has_filter("geodir_custom_field_output_email_key_{$cf['field_type_key']}")) { |
|
1089 | 1089 | /** |
1090 | 1090 | * Filter the email html by field type key. |
1091 | 1091 | * |
@@ -1094,18 +1094,18 @@ discard block |
||
1094 | 1094 | * @param array $cf The custom field array. |
1095 | 1095 | * @since 1.6.6 |
1096 | 1096 | */ |
1097 | - $html = apply_filters("geodir_custom_field_output_email_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
1097 | + $html = apply_filters("geodir_custom_field_output_email_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
1098 | 1098 | } |
1099 | 1099 | |
1100 | 1100 | // If not html then we run the standard output. |
1101 | - if(empty($html)){ |
|
1101 | + if (empty($html)) { |
|
1102 | 1102 | |
1103 | 1103 | global $preview; |
1104 | 1104 | if ($cf['htmlvar_name'] == 'geodir_email' && !(geodir_is_page('detail') || geodir_is_page('preview'))) { |
1105 | 1105 | return ''; // Remove Send Enquiry | Send To Friend from listings page |
1106 | 1106 | } |
1107 | 1107 | |
1108 | - $package_info = (array)geodir_post_package_info(array(), $post, $post->post_type); |
|
1108 | + $package_info = (array) geodir_post_package_info(array(), $post, $post->post_type); |
|
1109 | 1109 | |
1110 | 1110 | if ($cf['htmlvar_name'] == 'geodir_email' && ((isset($package_info['sendtofriend']) && $package_info['sendtofriend']) || $post->{$cf['htmlvar_name']})) { |
1111 | 1111 | $send_to_friend = true; |
@@ -1116,7 +1116,7 @@ discard block |
||
1116 | 1116 | if (!$preview) { |
1117 | 1117 | $b_send_inquiry = 'b_send_inquiry'; |
1118 | 1118 | $b_sendtofriend = 'b_sendtofriend'; |
1119 | - $html = '<input type="hidden" name="geodir_popup_post_id" value="' . $post->ID . '" /><div class="geodir_display_popup_forms"></div>'; |
|
1119 | + $html = '<input type="hidden" name="geodir_popup_post_id" value="'.$post->ID.'" /><div class="geodir_display_popup_forms"></div>'; |
|
1120 | 1120 | } |
1121 | 1121 | |
1122 | 1122 | $field_icon = geodir_field_icon_proccess($cf); |
@@ -1129,26 +1129,26 @@ discard block |
||
1129 | 1129 | $field_icon = ''; |
1130 | 1130 | } |
1131 | 1131 | |
1132 | - $html .= '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af; |
|
1132 | + $html .= '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'"><span class="geodir-i-email" style="'.$field_icon.'">'.$field_icon_af; |
|
1133 | 1133 | $seperator = ''; |
1134 | 1134 | if ($post->{$cf['htmlvar_name']}) { |
1135 | - $html .= '<a href="javascript:void(0);" class="' . $b_send_inquiry . '" >' . SEND_INQUIRY . '</a>'; |
|
1135 | + $html .= '<a href="javascript:void(0);" class="'.$b_send_inquiry.'" >'.SEND_INQUIRY.'</a>'; |
|
1136 | 1136 | $seperator = ' | '; |
1137 | 1137 | } |
1138 | 1138 | |
1139 | 1139 | if (isset($package_info['sendtofriend']) && $package_info['sendtofriend']) { |
1140 | - $html .= $seperator . '<a href="javascript:void(0);" class="' . $b_sendtofriend . '">' . SEND_TO_FRIEND . '</a>'; |
|
1140 | + $html .= $seperator.'<a href="javascript:void(0);" class="'.$b_sendtofriend.'">'.SEND_TO_FRIEND.'</a>'; |
|
1141 | 1141 | } |
1142 | 1142 | |
1143 | 1143 | $html .= '</span></div>'; |
1144 | 1144 | |
1145 | 1145 | |
1146 | 1146 | if (isset($_REQUEST['send_inquiry']) && $_REQUEST['send_inquiry'] == 'success') { |
1147 | - $html .= '<p class="sucess_msg">' . SEND_INQUIRY_SUCCESS . '</p>'; |
|
1147 | + $html .= '<p class="sucess_msg">'.SEND_INQUIRY_SUCCESS.'</p>'; |
|
1148 | 1148 | } elseif (isset($_REQUEST['sendtofrnd']) && $_REQUEST['sendtofrnd'] == 'success') { |
1149 | - $html .= '<p class="sucess_msg">' . SEND_FRIEND_SUCCESS . '</p>'; |
|
1149 | + $html .= '<p class="sucess_msg">'.SEND_FRIEND_SUCCESS.'</p>'; |
|
1150 | 1150 | } elseif (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 'captch') { |
1151 | - $html .= '<p class="error_msg_fix">' . WRONG_CAPTCH_MSG . '</p>'; |
|
1151 | + $html .= '<p class="error_msg_fix">'.WRONG_CAPTCH_MSG.'</p>'; |
|
1152 | 1152 | } |
1153 | 1153 | |
1154 | 1154 | /*if(!$preview){require_once (geodir_plugin_path().'/geodirectory-templates/popup-forms.php');}*/ |
@@ -1168,11 +1168,11 @@ discard block |
||
1168 | 1168 | } |
1169 | 1169 | |
1170 | 1170 | |
1171 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af; |
|
1172 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
1171 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-email" style="'.$field_icon.'">'.$field_icon_af; |
|
1172 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : ''; |
|
1173 | 1173 | $html .= '</span><span class="geodir-email-address-output">'; |
1174 | 1174 | $email = $post->{$cf['htmlvar_name']} ; |
1175 | - if($e_split = explode('@',$email)){ |
|
1175 | + if ($e_split = explode('@', $email)) { |
|
1176 | 1176 | /** |
1177 | 1177 | * Filter email custom field name output. |
1178 | 1178 | * |
@@ -1181,10 +1181,10 @@ discard block |
||
1181 | 1181 | * @param string $email The email string being output. |
1182 | 1182 | * @param array $cf Custom field variables array. |
1183 | 1183 | */ |
1184 | - $email_name = apply_filters('geodir_email_field_name_output',$email,$cf); |
|
1185 | - $html .= "<script>document.write('<a href=\"mailto:'+'$e_split[0]' + '@' + '$e_split[1]'+'\">$email_name</a>')</script>"; |
|
1186 | - }else{ |
|
1187 | - $html .= $email; |
|
1184 | + $email_name = apply_filters('geodir_email_field_name_output', $email, $cf); |
|
1185 | + $html .= "<script>document.write('<a href=\"mailto:'+'$e_split[0]' + '@' + '$e_split[1]'+'\">$email_name</a>')</script>"; |
|
1186 | + } else { |
|
1187 | + $html .= $email; |
|
1188 | 1188 | } |
1189 | 1189 | $html .= '</span></div>'; |
1190 | 1190 | } |
@@ -1195,7 +1195,7 @@ discard block |
||
1195 | 1195 | |
1196 | 1196 | return $html; |
1197 | 1197 | } |
1198 | -add_filter('geodir_custom_field_output_email','geodir_cf_email',10,3); |
|
1198 | +add_filter('geodir_custom_field_output_email', 'geodir_cf_email', 10, 3); |
|
1199 | 1199 | |
1200 | 1200 | |
1201 | 1201 | /** |
@@ -1208,21 +1208,21 @@ discard block |
||
1208 | 1208 | * |
1209 | 1209 | * @return string The html to output for the custom field. |
1210 | 1210 | */ |
1211 | -function geodir_cf_file($html,$location,$cf,$p=''){ |
|
1211 | +function geodir_cf_file($html, $location, $cf, $p = '') { |
|
1212 | 1212 | |
1213 | 1213 | // check we have the post value |
1214 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
1215 | - else{ global $post;} |
|
1214 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
1215 | + else { global $post; } |
|
1216 | 1216 | |
1217 | - if(!is_array($cf) && $cf!=''){ |
|
1217 | + if (!is_array($cf) && $cf != '') { |
|
1218 | 1218 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
1219 | - if(!$cf){return NULL;} |
|
1219 | + if (!$cf) {return NULL; } |
|
1220 | 1220 | } |
1221 | 1221 | |
1222 | 1222 | $html_var = $cf['htmlvar_name']; |
1223 | 1223 | |
1224 | 1224 | // Check if there is a location specific filter. |
1225 | - if(has_filter("geodir_custom_field_output_file_loc_{$location}")){ |
|
1225 | + if (has_filter("geodir_custom_field_output_file_loc_{$location}")) { |
|
1226 | 1226 | /** |
1227 | 1227 | * Filter the file html by location. |
1228 | 1228 | * |
@@ -1230,11 +1230,11 @@ discard block |
||
1230 | 1230 | * @param array $cf The custom field array. |
1231 | 1231 | * @since 1.6.6 |
1232 | 1232 | */ |
1233 | - $html = apply_filters("geodir_custom_field_output_file_loc_{$location}",$html,$cf); |
|
1233 | + $html = apply_filters("geodir_custom_field_output_file_loc_{$location}", $html, $cf); |
|
1234 | 1234 | } |
1235 | 1235 | |
1236 | 1236 | // Check if there is a custom field specific filter. |
1237 | - if(has_filter("geodir_custom_field_output_file_var_{$html_var}")){ |
|
1237 | + if (has_filter("geodir_custom_field_output_file_var_{$html_var}")) { |
|
1238 | 1238 | /** |
1239 | 1239 | * Filter the file html by individual custom field. |
1240 | 1240 | * |
@@ -1243,11 +1243,11 @@ discard block |
||
1243 | 1243 | * @param array $cf The custom field array. |
1244 | 1244 | * @since 1.6.6 |
1245 | 1245 | */ |
1246 | - $html = apply_filters("geodir_custom_field_output_file_var_{$html_var}",$html,$location,$cf); |
|
1246 | + $html = apply_filters("geodir_custom_field_output_file_var_{$html_var}", $html, $location, $cf); |
|
1247 | 1247 | } |
1248 | 1248 | |
1249 | 1249 | // Check if there is a custom field key specific filter. |
1250 | - if(has_filter("geodir_custom_field_output_file_key_{$cf['field_type_key']}")){ |
|
1250 | + if (has_filter("geodir_custom_field_output_file_key_{$cf['field_type_key']}")) { |
|
1251 | 1251 | /** |
1252 | 1252 | * Filter the file html by field type key. |
1253 | 1253 | * |
@@ -1256,11 +1256,11 @@ discard block |
||
1256 | 1256 | * @param array $cf The custom field array. |
1257 | 1257 | * @since 1.6.6 |
1258 | 1258 | */ |
1259 | - $html = apply_filters("geodir_custom_field_output_file_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
1259 | + $html = apply_filters("geodir_custom_field_output_file_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
1260 | 1260 | } |
1261 | 1261 | |
1262 | 1262 | // If not html then we run the standard output. |
1263 | - if(empty($html)){ |
|
1263 | + if (empty($html)) { |
|
1264 | 1264 | |
1265 | 1265 | if (!empty($post->{$cf['htmlvar_name']})): |
1266 | 1266 | |
@@ -1268,7 +1268,7 @@ discard block |
||
1268 | 1268 | if (!empty($files)): |
1269 | 1269 | |
1270 | 1270 | $extra_fields = !empty($cf['extra_fields']) ? maybe_unserialize($cf['extra_fields']) : NULL; |
1271 | - $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'] : ''; |
|
1271 | + $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'] : ''; |
|
1272 | 1272 | |
1273 | 1273 | $file_paths = ''; |
1274 | 1274 | foreach ($files as $file) { |
@@ -1305,9 +1305,9 @@ discard block |
||
1305 | 1305 | //$file_paths .= '<img src="'.$file.'" />'; |
1306 | 1306 | $file_paths .= '</div>'; |
1307 | 1307 | } else { |
1308 | - $ext_path = '_' . $html_var . '_'; |
|
1308 | + $ext_path = '_'.$html_var.'_'; |
|
1309 | 1309 | $filename = explode($ext_path, $filename); |
1310 | - $file_paths .= '<a href="' . $file . '" target="_blank">' . $filename[count($filename) - 1] . '</a>'; |
|
1310 | + $file_paths .= '<a href="'.$file.'" target="_blank">'.$filename[count($filename) - 1].'</a>'; |
|
1311 | 1311 | } |
1312 | 1312 | } |
1313 | 1313 | } |
@@ -1322,11 +1322,11 @@ discard block |
||
1322 | 1322 | $field_icon = ''; |
1323 | 1323 | } |
1324 | 1324 | |
1325 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' geodir-custom-file-box ' . $cf['htmlvar_name'] . '"><div class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af; |
|
1325 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' geodir-custom-file-box '.$cf['htmlvar_name'].'"><div class="geodir-i-select" style="'.$field_icon.'">'.$field_icon_af; |
|
1326 | 1326 | $html .= '<span style="display: inline-block; vertical-align: top; padding-right: 14px;">'; |
1327 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
1327 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : ''; |
|
1328 | 1328 | $html .= '</span>'; |
1329 | - $html .= $file_paths . '</div></div>'; |
|
1329 | + $html .= $file_paths.'</div></div>'; |
|
1330 | 1330 | |
1331 | 1331 | endif; |
1332 | 1332 | endif; |
@@ -1335,7 +1335,7 @@ discard block |
||
1335 | 1335 | |
1336 | 1336 | return $html; |
1337 | 1337 | } |
1338 | -add_filter('geodir_custom_field_output_file','geodir_cf_file',10,3); |
|
1338 | +add_filter('geodir_custom_field_output_file', 'geodir_cf_file', 10, 3); |
|
1339 | 1339 | |
1340 | 1340 | |
1341 | 1341 | |
@@ -1349,21 +1349,21 @@ discard block |
||
1349 | 1349 | * |
1350 | 1350 | * @return string The html to output for the custom field. |
1351 | 1351 | */ |
1352 | -function geodir_cf_textarea($html,$location,$cf,$p=''){ |
|
1352 | +function geodir_cf_textarea($html, $location, $cf, $p = '') { |
|
1353 | 1353 | |
1354 | 1354 | // check we have the post value |
1355 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
1356 | - else{ global $post;} |
|
1355 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
1356 | + else { global $post; } |
|
1357 | 1357 | |
1358 | - if(!is_array($cf) && $cf!=''){ |
|
1358 | + if (!is_array($cf) && $cf != '') { |
|
1359 | 1359 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
1360 | - if(!$cf){return NULL;} |
|
1360 | + if (!$cf) {return NULL; } |
|
1361 | 1361 | } |
1362 | 1362 | |
1363 | 1363 | $html_var = $cf['htmlvar_name']; |
1364 | 1364 | |
1365 | 1365 | // Check if there is a location specific filter. |
1366 | - if(has_filter("geodir_custom_field_output_textarea_loc_{$location}")){ |
|
1366 | + if (has_filter("geodir_custom_field_output_textarea_loc_{$location}")) { |
|
1367 | 1367 | /** |
1368 | 1368 | * Filter the textarea html by location. |
1369 | 1369 | * |
@@ -1371,11 +1371,11 @@ discard block |
||
1371 | 1371 | * @param array $cf The custom field array. |
1372 | 1372 | * @since 1.6.6 |
1373 | 1373 | */ |
1374 | - $html = apply_filters("geodir_custom_field_output_textarea_loc_{$location}",$html,$cf); |
|
1374 | + $html = apply_filters("geodir_custom_field_output_textarea_loc_{$location}", $html, $cf); |
|
1375 | 1375 | } |
1376 | 1376 | |
1377 | 1377 | // Check if there is a custom field specific filter. |
1378 | - if(has_filter("geodir_custom_field_output_textarea_var_{$html_var}")){ |
|
1378 | + if (has_filter("geodir_custom_field_output_textarea_var_{$html_var}")) { |
|
1379 | 1379 | /** |
1380 | 1380 | * Filter the textarea html by individual custom field. |
1381 | 1381 | * |
@@ -1384,11 +1384,11 @@ discard block |
||
1384 | 1384 | * @param array $cf The custom field array. |
1385 | 1385 | * @since 1.6.6 |
1386 | 1386 | */ |
1387 | - $html = apply_filters("geodir_custom_field_output_textarea_var_{$html_var}",$html,$location,$cf); |
|
1387 | + $html = apply_filters("geodir_custom_field_output_textarea_var_{$html_var}", $html, $location, $cf); |
|
1388 | 1388 | } |
1389 | 1389 | |
1390 | 1390 | // Check if there is a custom field key specific filter. |
1391 | - if(has_filter("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}")){ |
|
1391 | + if (has_filter("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}")) { |
|
1392 | 1392 | /** |
1393 | 1393 | * Filter the textarea html by field type key. |
1394 | 1394 | * |
@@ -1397,11 +1397,11 @@ discard block |
||
1397 | 1397 | * @param array $cf The custom field array. |
1398 | 1398 | * @since 1.6.6 |
1399 | 1399 | */ |
1400 | - $html = apply_filters("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
1400 | + $html = apply_filters("geodir_custom_field_output_textarea_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
1401 | 1401 | } |
1402 | 1402 | |
1403 | 1403 | // If not html then we run the standard output. |
1404 | - if(empty($html)){ |
|
1404 | + if (empty($html)) { |
|
1405 | 1405 | |
1406 | 1406 | if (!empty($post->{$cf['htmlvar_name']})) { |
1407 | 1407 | |
@@ -1416,9 +1416,9 @@ discard block |
||
1416 | 1416 | } |
1417 | 1417 | |
1418 | 1418 | |
1419 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af; |
|
1420 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
1421 | - $html .= '</span>' . wpautop($post->{$cf['htmlvar_name']}) . '</div>'; |
|
1419 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-text" style="'.$field_icon.'">'.$field_icon_af; |
|
1420 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : ''; |
|
1421 | + $html .= '</span>'.wpautop($post->{$cf['htmlvar_name']}).'</div>'; |
|
1422 | 1422 | |
1423 | 1423 | } |
1424 | 1424 | |
@@ -1426,7 +1426,7 @@ discard block |
||
1426 | 1426 | |
1427 | 1427 | return $html; |
1428 | 1428 | } |
1429 | -add_filter('geodir_custom_field_output_textarea','geodir_cf_textarea',10,3); |
|
1429 | +add_filter('geodir_custom_field_output_textarea', 'geodir_cf_textarea', 10, 3); |
|
1430 | 1430 | |
1431 | 1431 | |
1432 | 1432 | |
@@ -1440,21 +1440,21 @@ discard block |
||
1440 | 1440 | * |
1441 | 1441 | * @return string The html to output for the custom field. |
1442 | 1442 | */ |
1443 | -function geodir_cf_html($html,$location,$cf,$p=''){ |
|
1443 | +function geodir_cf_html($html, $location, $cf, $p = '') { |
|
1444 | 1444 | |
1445 | 1445 | // check we have the post value |
1446 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
1447 | - else{ global $post;} |
|
1446 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
1447 | + else { global $post; } |
|
1448 | 1448 | |
1449 | - if(!is_array($cf) && $cf!=''){ |
|
1449 | + if (!is_array($cf) && $cf != '') { |
|
1450 | 1450 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
1451 | - if(!$cf){return NULL;} |
|
1451 | + if (!$cf) {return NULL; } |
|
1452 | 1452 | } |
1453 | 1453 | |
1454 | 1454 | $html_var = $cf['htmlvar_name']; |
1455 | 1455 | |
1456 | 1456 | // Check if there is a location specific filter. |
1457 | - if(has_filter("geodir_custom_field_output_html_loc_{$location}")){ |
|
1457 | + if (has_filter("geodir_custom_field_output_html_loc_{$location}")) { |
|
1458 | 1458 | /** |
1459 | 1459 | * Filter the html html by location. |
1460 | 1460 | * |
@@ -1462,11 +1462,11 @@ discard block |
||
1462 | 1462 | * @param array $cf The custom field array. |
1463 | 1463 | * @since 1.6.6 |
1464 | 1464 | */ |
1465 | - $html = apply_filters("geodir_custom_field_output_html_loc_{$location}",$html,$cf); |
|
1465 | + $html = apply_filters("geodir_custom_field_output_html_loc_{$location}", $html, $cf); |
|
1466 | 1466 | } |
1467 | 1467 | |
1468 | 1468 | // Check if there is a custom field specific filter. |
1469 | - if(has_filter("geodir_custom_field_output_html_var_{$html_var}")){ |
|
1469 | + if (has_filter("geodir_custom_field_output_html_var_{$html_var}")) { |
|
1470 | 1470 | /** |
1471 | 1471 | * Filter the html html by individual custom field. |
1472 | 1472 | * |
@@ -1475,11 +1475,11 @@ discard block |
||
1475 | 1475 | * @param array $cf The custom field array. |
1476 | 1476 | * @since 1.6.6 |
1477 | 1477 | */ |
1478 | - $html = apply_filters("geodir_custom_field_output_html_var_{$html_var}",$html,$location,$cf); |
|
1478 | + $html = apply_filters("geodir_custom_field_output_html_var_{$html_var}", $html, $location, $cf); |
|
1479 | 1479 | } |
1480 | 1480 | |
1481 | 1481 | // Check if there is a custom field key specific filter. |
1482 | - if(has_filter("geodir_custom_field_output_html_key_{$cf['field_type_key']}")){ |
|
1482 | + if (has_filter("geodir_custom_field_output_html_key_{$cf['field_type_key']}")) { |
|
1483 | 1483 | /** |
1484 | 1484 | * Filter the html html by field type key. |
1485 | 1485 | * |
@@ -1488,11 +1488,11 @@ discard block |
||
1488 | 1488 | * @param array $cf The custom field array. |
1489 | 1489 | * @since 1.6.6 |
1490 | 1490 | */ |
1491 | - $html = apply_filters("geodir_custom_field_output_html_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
1491 | + $html = apply_filters("geodir_custom_field_output_html_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
1492 | 1492 | } |
1493 | 1493 | |
1494 | 1494 | // If not html then we run the standard output. |
1495 | - if(empty($html)){ |
|
1495 | + if (empty($html)) { |
|
1496 | 1496 | |
1497 | 1497 | if (!empty($post->{$cf['htmlvar_name']})) { |
1498 | 1498 | |
@@ -1506,9 +1506,9 @@ discard block |
||
1506 | 1506 | $field_icon = ''; |
1507 | 1507 | } |
1508 | 1508 | |
1509 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $cf['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af; |
|
1510 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
1511 | - $html .= '</span>' . wpautop($post->{$cf['htmlvar_name']}) . '</div>'; |
|
1509 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$cf['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-text" style="'.$field_icon.'">'.$field_icon_af; |
|
1510 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : ''; |
|
1511 | + $html .= '</span>'.wpautop($post->{$cf['htmlvar_name']}).'</div>'; |
|
1512 | 1512 | |
1513 | 1513 | } |
1514 | 1514 | |
@@ -1516,7 +1516,7 @@ discard block |
||
1516 | 1516 | |
1517 | 1517 | return $html; |
1518 | 1518 | } |
1519 | -add_filter('geodir_custom_field_output_html','geodir_cf_html',10,3); |
|
1519 | +add_filter('geodir_custom_field_output_html', 'geodir_cf_html', 10, 3); |
|
1520 | 1520 | |
1521 | 1521 | |
1522 | 1522 | |
@@ -1530,21 +1530,21 @@ discard block |
||
1530 | 1530 | * |
1531 | 1531 | * @return string The html to output for the custom field. |
1532 | 1532 | */ |
1533 | -function geodir_cf_taxonomy($html,$location,$cf,$p=''){ |
|
1533 | +function geodir_cf_taxonomy($html, $location, $cf, $p = '') { |
|
1534 | 1534 | |
1535 | 1535 | // check we have the post value |
1536 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
1537 | - else{ global $post;} |
|
1536 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
1537 | + else { global $post; } |
|
1538 | 1538 | |
1539 | - if(!is_array($cf) && $cf!=''){ |
|
1539 | + if (!is_array($cf) && $cf != '') { |
|
1540 | 1540 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
1541 | - if(!$cf){return NULL;} |
|
1541 | + if (!$cf) {return NULL; } |
|
1542 | 1542 | } |
1543 | 1543 | |
1544 | 1544 | $html_var = $cf['htmlvar_name']; |
1545 | 1545 | |
1546 | 1546 | // Check if there is a location specific filter. |
1547 | - if(has_filter("geodir_custom_field_output_taxonomy_loc_{$location}")){ |
|
1547 | + if (has_filter("geodir_custom_field_output_taxonomy_loc_{$location}")) { |
|
1548 | 1548 | /** |
1549 | 1549 | * Filter the taxonomy html by location. |
1550 | 1550 | * |
@@ -1552,11 +1552,11 @@ discard block |
||
1552 | 1552 | * @param array $cf The custom field array. |
1553 | 1553 | * @since 1.6.6 |
1554 | 1554 | */ |
1555 | - $html = apply_filters("geodir_custom_field_output_taxonomy_loc_{$location}",$html,$cf); |
|
1555 | + $html = apply_filters("geodir_custom_field_output_taxonomy_loc_{$location}", $html, $cf); |
|
1556 | 1556 | } |
1557 | 1557 | |
1558 | 1558 | // Check if there is a custom field specific filter. |
1559 | - if(has_filter("geodir_custom_field_output_taxonomy_var_{$html_var}")){ |
|
1559 | + if (has_filter("geodir_custom_field_output_taxonomy_var_{$html_var}")) { |
|
1560 | 1560 | /** |
1561 | 1561 | * Filter the taxonomy html by individual custom field. |
1562 | 1562 | * |
@@ -1565,11 +1565,11 @@ discard block |
||
1565 | 1565 | * @param array $cf The custom field array. |
1566 | 1566 | * @since 1.6.6 |
1567 | 1567 | */ |
1568 | - $html = apply_filters("geodir_custom_field_output_taxonomy_var_{$html_var}",$html,$location,$cf); |
|
1568 | + $html = apply_filters("geodir_custom_field_output_taxonomy_var_{$html_var}", $html, $location, $cf); |
|
1569 | 1569 | } |
1570 | 1570 | |
1571 | 1571 | // Check if there is a custom field key specific filter. |
1572 | - if(has_filter("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}")){ |
|
1572 | + if (has_filter("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}")) { |
|
1573 | 1573 | /** |
1574 | 1574 | * Filter the taxonomy html by field type key. |
1575 | 1575 | * |
@@ -1578,14 +1578,14 @@ discard block |
||
1578 | 1578 | * @param array $cf The custom field array. |
1579 | 1579 | * @since 1.6.6 |
1580 | 1580 | */ |
1581 | - $html = apply_filters("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
1581 | + $html = apply_filters("geodir_custom_field_output_taxonomy_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
1582 | 1582 | } |
1583 | 1583 | |
1584 | 1584 | // If not html then we run the standard output. |
1585 | - if(empty($html)){ |
|
1585 | + if (empty($html)) { |
|
1586 | 1586 | |
1587 | - if ($html_var == $post->post_type . 'category' && !empty($post->{$html_var})) { |
|
1588 | - $post_taxonomy = $post->post_type . 'category'; |
|
1587 | + if ($html_var == $post->post_type.'category' && !empty($post->{$html_var})) { |
|
1588 | + $post_taxonomy = $post->post_type.'category'; |
|
1589 | 1589 | $field_value = $post->{$html_var}; |
1590 | 1590 | $links = array(); |
1591 | 1591 | $terms = array(); |
@@ -1603,7 +1603,7 @@ discard block |
||
1603 | 1603 | if ($term != '') { |
1604 | 1604 | $term = get_term_by('id', $term, $html_var); |
1605 | 1605 | if (is_object($term)) { |
1606 | - $links[] = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>" . $term->name . "</a>"; |
|
1606 | + $links[] = "<a href='".esc_attr(get_term_link($term, $post_taxonomy))."'>".$term->name."</a>"; |
|
1607 | 1607 | $terms[] = $term; |
1608 | 1608 | } |
1609 | 1609 | } |
@@ -1617,7 +1617,7 @@ discard block |
||
1617 | 1617 | $terms = $termsOrdered; |
1618 | 1618 | } |
1619 | 1619 | } |
1620 | - $html_value = !empty($links) && !empty($terms) ? wp_sprintf('%l', $links, (object)$terms) : ''; |
|
1620 | + $html_value = !empty($links) && !empty($terms) ? wp_sprintf('%l', $links, (object) $terms) : ''; |
|
1621 | 1621 | |
1622 | 1622 | if ($html_value != '') { |
1623 | 1623 | $field_icon = geodir_field_icon_proccess($cf); |
@@ -1630,9 +1630,9 @@ discard block |
||
1630 | 1630 | $field_icon = ''; |
1631 | 1631 | } |
1632 | 1632 | |
1633 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $html_var . '" style="clear:both;"><span class="geodir-i-taxonomy geodir-i-category" style="' . $field_icon . '">' . $field_icon_af; |
|
1634 | - $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory') . ': ' : ''; |
|
1635 | - $html .= '</span> ' . $html_value . '</div>'; |
|
1633 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$html_var.'" style="clear:both;"><span class="geodir-i-taxonomy geodir-i-category" style="'.$field_icon.'">'.$field_icon_af; |
|
1634 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : ''; |
|
1635 | + $html .= '</span> '.$html_value.'</div>'; |
|
1636 | 1636 | } |
1637 | 1637 | } |
1638 | 1638 | |
@@ -1640,7 +1640,7 @@ discard block |
||
1640 | 1640 | |
1641 | 1641 | return $html; |
1642 | 1642 | } |
1643 | -add_filter('geodir_custom_field_output_taxonomy','geodir_cf_taxonomy',10,3); |
|
1643 | +add_filter('geodir_custom_field_output_taxonomy', 'geodir_cf_taxonomy', 10, 3); |
|
1644 | 1644 | |
1645 | 1645 | |
1646 | 1646 | /** |
@@ -1653,21 +1653,21 @@ discard block |
||
1653 | 1653 | * |
1654 | 1654 | * @return string The html to output for the custom field. |
1655 | 1655 | */ |
1656 | -function geodir_cf_address($html,$location,$cf,$p=''){ |
|
1656 | +function geodir_cf_address($html, $location, $cf, $p = '') { |
|
1657 | 1657 | |
1658 | 1658 | // check we have the post value |
1659 | - if(is_int($p)){$post = geodir_get_post_info($p);} |
|
1660 | - else{ global $post;} |
|
1659 | + if (is_int($p)) {$post = geodir_get_post_info($p); } |
|
1660 | + else { global $post; } |
|
1661 | 1661 | |
1662 | - if(!is_array($cf) && $cf!=''){ |
|
1662 | + if (!is_array($cf) && $cf != '') { |
|
1663 | 1663 | $cf = geodir_get_field_infoby('htmlvar_name', $cf, $post->post_type); |
1664 | - if(!$cf){return NULL;} |
|
1664 | + if (!$cf) {return NULL; } |
|
1665 | 1665 | } |
1666 | 1666 | |
1667 | 1667 | $html_var = $cf['htmlvar_name']; |
1668 | 1668 | |
1669 | 1669 | // Check if there is a location specific filter. |
1670 | - if(has_filter("geodir_custom_field_output_address_loc_{$location}")){ |
|
1670 | + if (has_filter("geodir_custom_field_output_address_loc_{$location}")) { |
|
1671 | 1671 | /** |
1672 | 1672 | * Filter the address html by location. |
1673 | 1673 | * |
@@ -1675,11 +1675,11 @@ discard block |
||
1675 | 1675 | * @param array $cf The custom field array. |
1676 | 1676 | * @since 1.6.6 |
1677 | 1677 | */ |
1678 | - $html = apply_filters("geodir_custom_field_output_address_loc_{$location}",$html,$cf); |
|
1678 | + $html = apply_filters("geodir_custom_field_output_address_loc_{$location}", $html, $cf); |
|
1679 | 1679 | } |
1680 | 1680 | |
1681 | 1681 | // Check if there is a custom field specific filter. |
1682 | - if(has_filter("geodir_custom_field_output_address_var_{$html_var}")){ |
|
1682 | + if (has_filter("geodir_custom_field_output_address_var_{$html_var}")) { |
|
1683 | 1683 | /** |
1684 | 1684 | * Filter the address html by individual custom field. |
1685 | 1685 | * |
@@ -1688,11 +1688,11 @@ discard block |
||
1688 | 1688 | * @param array $cf The custom field array. |
1689 | 1689 | * @since 1.6.6 |
1690 | 1690 | */ |
1691 | - $html = apply_filters("geodir_custom_field_output_address_var_{$html_var}",$html,$location,$cf); |
|
1691 | + $html = apply_filters("geodir_custom_field_output_address_var_{$html_var}", $html, $location, $cf); |
|
1692 | 1692 | } |
1693 | 1693 | |
1694 | 1694 | // Check if there is a custom field key specific filter. |
1695 | - if(has_filter("geodir_custom_field_output_address_key_{$cf['field_type_key']}")){ |
|
1695 | + if (has_filter("geodir_custom_field_output_address_key_{$cf['field_type_key']}")) { |
|
1696 | 1696 | /** |
1697 | 1697 | * Filter the address html by field type key. |
1698 | 1698 | * |
@@ -1701,14 +1701,14 @@ discard block |
||
1701 | 1701 | * @param array $cf The custom field array. |
1702 | 1702 | * @since 1.6.6 |
1703 | 1703 | */ |
1704 | - $html = apply_filters("geodir_custom_field_output_address_key_{$cf['field_type_key']}",$html,$location,$cf); |
|
1704 | + $html = apply_filters("geodir_custom_field_output_address_key_{$cf['field_type_key']}", $html, $location, $cf); |
|
1705 | 1705 | } |
1706 | 1706 | |
1707 | 1707 | // If not html then we run the standard output. |
1708 | - if(empty($html)){ |
|
1708 | + if (empty($html)) { |
|
1709 | 1709 | |
1710 | 1710 | global $preview; |
1711 | - $html_var = $cf['htmlvar_name'] . '_address'; |
|
1711 | + $html_var = $cf['htmlvar_name'].'_address'; |
|
1712 | 1712 | |
1713 | 1713 | if ($cf['extra_fields']) { |
1714 | 1714 | |
@@ -1771,10 +1771,10 @@ discard block |
||
1771 | 1771 | |
1772 | 1772 | if ($post->{$html_var}) { |
1773 | 1773 | |
1774 | - $field_icon = geodir_field_icon_proccess( $cf ); |
|
1775 | - if ( strpos( $field_icon, 'http' ) !== false ) { |
|
1774 | + $field_icon = geodir_field_icon_proccess($cf); |
|
1775 | + if (strpos($field_icon, 'http') !== false) { |
|
1776 | 1776 | $field_icon_af = ''; |
1777 | - } elseif ( $field_icon == '' ) { |
|
1777 | + } elseif ($field_icon == '') { |
|
1778 | 1778 | $field_icon_af = '<i class="fa fa-home"></i>'; |
1779 | 1779 | } else { |
1780 | 1780 | $field_icon_af = $field_icon; |
@@ -1783,26 +1783,26 @@ discard block |
||
1783 | 1783 | |
1784 | 1784 | |
1785 | 1785 | |
1786 | - $html = '<div class="geodir_more_info ' . $cf['css_class'] . ' ' . $html_var . '" style="clear:both;" itemscope itemtype="http://schema.org/PostalAddress">'; |
|
1787 | - $html .= '<span class="geodir-i-location" style="' . $field_icon . '">' . $field_icon_af; |
|
1788 | - $html .= ( trim( $cf['site_title'] ) ) ? __( $cf['site_title'], 'geodirectory' ) . ': ' : ' '; |
|
1786 | + $html = '<div class="geodir_more_info '.$cf['css_class'].' '.$html_var.'" style="clear:both;" itemscope itemtype="http://schema.org/PostalAddress">'; |
|
1787 | + $html .= '<span class="geodir-i-location" style="'.$field_icon.'">'.$field_icon_af; |
|
1788 | + $html .= (trim($cf['site_title'])) ? __($cf['site_title'], 'geodirectory').': ' : ' '; |
|
1789 | 1789 | $html .= '</span>'; |
1790 | 1790 | |
1791 | 1791 | |
1792 | - if ( $post->post_address ) { |
|
1793 | - $html .= '<span itemprop="streetAddress">' . $post->post_address . '</span><br>'; |
|
1792 | + if ($post->post_address) { |
|
1793 | + $html .= '<span itemprop="streetAddress">'.$post->post_address.'</span><br>'; |
|
1794 | 1794 | } |
1795 | - if ($show_city_in_address && $post->post_city ) { |
|
1796 | - $html .= '<span itemprop="addressLocality">' . $post->post_city . '</span><br>'; |
|
1795 | + if ($show_city_in_address && $post->post_city) { |
|
1796 | + $html .= '<span itemprop="addressLocality">'.$post->post_city.'</span><br>'; |
|
1797 | 1797 | } |
1798 | - if ($show_region_in_address && $post->post_region ) { |
|
1799 | - $html .= '<span itemprop="addressRegion">' . $post->post_region . '</span><br>'; |
|
1798 | + if ($show_region_in_address && $post->post_region) { |
|
1799 | + $html .= '<span itemprop="addressRegion">'.$post->post_region.'</span><br>'; |
|
1800 | 1800 | } |
1801 | - if ($show_zip_in_address && $post->post_zip ) { |
|
1802 | - $html .= '<span itemprop="postalCode">' . $post->post_zip . '</span><br>'; |
|
1801 | + if ($show_zip_in_address && $post->post_zip) { |
|
1802 | + $html .= '<span itemprop="postalCode">'.$post->post_zip.'</span><br>'; |
|
1803 | 1803 | } |
1804 | - if ($show_country_in_address && $post->post_country ) { |
|
1805 | - $html .= '<span itemprop="addressCountry">' . __( $post->post_country, 'geodirectory' ) . '</span><br>'; |
|
1804 | + if ($show_country_in_address && $post->post_country) { |
|
1805 | + $html .= '<span itemprop="addressCountry">'.__($post->post_country, 'geodirectory').'</span><br>'; |
|
1806 | 1806 | } |
1807 | 1807 | $html .= '</div>'; |
1808 | 1808 | |
@@ -1813,4 +1813,4 @@ discard block |
||
1813 | 1813 | |
1814 | 1814 | return $html; |
1815 | 1815 | } |
1816 | -add_filter('geodir_custom_field_output_address','geodir_cf_address',10,3); |
|
1817 | 1816 | \ No newline at end of file |
1817 | +add_filter('geodir_custom_field_output_address', 'geodir_cf_address', 10, 3); |
|
1818 | 1818 | \ No newline at end of file |