@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | function geodir_add_column_if_not_exist($db, $column, $column_attr = "VARCHAR( 255 ) NOT NULL") |
50 | 50 | { |
51 | 51 | global $wpdb; |
52 | - $result = 0;// no rows affected |
|
52 | + $result = 0; // no rows affected |
|
53 | 53 | if (!geodir_column_exist($db, $column)) { |
54 | 54 | if (!empty($db) && !empty($column)) |
55 | 55 | $result = $wpdb->query("ALTER TABLE `$db` ADD `$column` $column_attr"); |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | { |
75 | 75 | global $wpdb, $geodir_post_custom_fields_cache; |
76 | 76 | |
77 | - $cache_stored = $post_type . '_' . $package_id . '_' . $default . '_' . $fields_location; |
|
77 | + $cache_stored = $post_type.'_'.$package_id.'_'.$default.'_'.$fields_location; |
|
78 | 78 | |
79 | 79 | if (array_key_exists($cache_stored, $geodir_post_custom_fields_cache)) { |
80 | 80 | return $geodir_post_custom_fields_cache[$cache_stored]; |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | |
96 | 96 | $post_meta_info = $wpdb->get_results( |
97 | 97 | $wpdb->prepare( |
98 | - "select * from " . GEODIR_CUSTOM_FIELDS_TABLE . " where is_active = '1' and post_type = %s {$default_query} order by sort_order asc,admin_title asc", |
|
98 | + "select * from ".GEODIR_CUSTOM_FIELDS_TABLE." where is_active = '1' and post_type = %s {$default_query} order by sort_order asc,admin_title asc", |
|
99 | 99 | array($post_type) |
100 | 100 | ) |
101 | 101 | ); |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | $cf = $result_str; |
170 | 170 | if (!is_object($cf)) { |
171 | 171 | |
172 | - $field_info = $wpdb->get_row($wpdb->prepare("select * from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id= %d", array($cf))); |
|
172 | + $field_info = $wpdb->get_row($wpdb->prepare("select * from ".GEODIR_CUSTOM_FIELDS_TABLE." where id= %d", array($cf))); |
|
173 | 173 | |
174 | 174 | } else { |
175 | 175 | $field_info = $cf; |
@@ -203,14 +203,14 @@ discard block |
||
203 | 203 | if ($field_id != '') { |
204 | 204 | $cf = trim($field_id, '_'); |
205 | 205 | |
206 | - if ($field = $wpdb->get_row($wpdb->prepare("select htmlvar_name,post_type,field_type from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id= %d", array($cf)))) { |
|
207 | - $wpdb->query($wpdb->prepare("delete from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id= %d ", array($cf))); |
|
206 | + if ($field = $wpdb->get_row($wpdb->prepare("select htmlvar_name,post_type,field_type from ".GEODIR_CUSTOM_FIELDS_TABLE." where id= %d", array($cf)))) { |
|
207 | + $wpdb->query($wpdb->prepare("delete from ".GEODIR_CUSTOM_FIELDS_TABLE." where id= %d ", array($cf))); |
|
208 | 208 | |
209 | 209 | $post_type = $field->post_type; |
210 | 210 | $htmlvar_name = $field->htmlvar_name; |
211 | 211 | |
212 | 212 | if ($post_type != '' && $htmlvar_name != '') { |
213 | - $wpdb->query($wpdb->prepare("DELETE FROM " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " WHERE htmlvar_name=%s AND post_type=%s LIMIT 1", array($htmlvar_name, $post_type))); |
|
213 | + $wpdb->query($wpdb->prepare("DELETE FROM ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." WHERE htmlvar_name=%s AND post_type=%s LIMIT 1", array($htmlvar_name, $post_type))); |
|
214 | 214 | } |
215 | 215 | |
216 | 216 | /** |
@@ -224,18 +224,18 @@ discard block |
||
224 | 224 | do_action('geodir_after_custom_field_deleted', $cf, $field->htmlvar_name, $post_type); |
225 | 225 | |
226 | 226 | if ($field->field_type == 'address') { |
227 | - $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_address`"); |
|
228 | - $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_city`"); |
|
229 | - $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_region`"); |
|
230 | - $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_country`"); |
|
231 | - $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_zip`"); |
|
232 | - $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_latitude`"); |
|
233 | - $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_longitude`"); |
|
234 | - $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_mapview`"); |
|
235 | - $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "_mapzoom`"); |
|
227 | + $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_address`"); |
|
228 | + $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_city`"); |
|
229 | + $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_region`"); |
|
230 | + $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_country`"); |
|
231 | + $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_zip`"); |
|
232 | + $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_latitude`"); |
|
233 | + $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_longitude`"); |
|
234 | + $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_mapview`"); |
|
235 | + $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."_mapzoom`"); |
|
236 | 236 | } else { |
237 | 237 | if ($field->field_type != 'fieldset') { |
238 | - $wpdb->query("ALTER TABLE " . $plugin_prefix . $post_type . "_detail DROP `" . $field->htmlvar_name . "`"); |
|
238 | + $wpdb->query("ALTER TABLE ".$plugin_prefix.$post_type."_detail DROP `".$field->htmlvar_name."`"); |
|
239 | 239 | } |
240 | 240 | } |
241 | 241 | |
@@ -304,7 +304,7 @@ discard block |
||
304 | 304 | $result_str = isset($request_field['field_id']) ? trim($request_field['field_id']) : ''; |
305 | 305 | |
306 | 306 | // some servers fail if a POST value is VARCHAR so we change it. |
307 | - if(isset($request_field['data_type']) && $request_field['data_type']=='XVARCHAR'){ |
|
307 | + if (isset($request_field['data_type']) && $request_field['data_type'] == 'XVARCHAR') { |
|
308 | 308 | $request_field['data_type'] = 'VARCHAR'; |
309 | 309 | } |
310 | 310 | |
@@ -317,12 +317,12 @@ discard block |
||
317 | 317 | $post_type = $request_field['listing_type']; |
318 | 318 | |
319 | 319 | if ($request_field['field_type'] != 'address' && $request_field['field_type'] != 'taxonomy' && $request_field['field_type'] != 'fieldset') { |
320 | - $cehhtmlvar_name = 'geodir_' . $cehhtmlvar_name; |
|
320 | + $cehhtmlvar_name = 'geodir_'.$cehhtmlvar_name; |
|
321 | 321 | } |
322 | 322 | |
323 | 323 | $check_html_variable = $wpdb->get_var( |
324 | 324 | $wpdb->prepare( |
325 | - "select htmlvar_name from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id <> %d and htmlvar_name = %s and post_type = %s ", |
|
325 | + "select htmlvar_name from ".GEODIR_CUSTOM_FIELDS_TABLE." where id <> %d and htmlvar_name = %s and post_type = %s ", |
|
326 | 326 | array($cf, $cehhtmlvar_name, $post_type) |
327 | 327 | ) |
328 | 328 | ); |
@@ -334,7 +334,7 @@ discard block |
||
334 | 334 | |
335 | 335 | $post_meta_info = $wpdb->get_row( |
336 | 336 | $wpdb->prepare( |
337 | - "select * from " . GEODIR_CUSTOM_FIELDS_TABLE . " where id = %d", |
|
337 | + "select * from ".GEODIR_CUSTOM_FIELDS_TABLE." where id = %d", |
|
338 | 338 | array($cf) |
339 | 339 | ) |
340 | 340 | ); |
@@ -352,7 +352,7 @@ discard block |
||
352 | 352 | if ($post_type == '') $post_type = 'gd_place'; |
353 | 353 | |
354 | 354 | |
355 | - $detail_table = $plugin_prefix . $post_type . '_detail'; |
|
355 | + $detail_table = $plugin_prefix.$post_type.'_detail'; |
|
356 | 356 | |
357 | 357 | $admin_title = $request_field['admin_title']; |
358 | 358 | $site_title = $request_field['site_title']; |
@@ -378,7 +378,7 @@ discard block |
||
378 | 378 | $for_admin_use = isset($request_field['for_admin_use']) ? $request_field['for_admin_use'] : ''; |
379 | 379 | |
380 | 380 | if ($field_type != 'address' && $field_type != 'taxonomy' && $field_type != 'fieldset') { |
381 | - $htmlvar_name = 'geodir_' . $htmlvar_name; |
|
381 | + $htmlvar_name = 'geodir_'.$htmlvar_name; |
|
382 | 382 | } |
383 | 383 | |
384 | 384 | $option_values = ''; |
@@ -423,9 +423,9 @@ discard block |
||
423 | 423 | |
424 | 424 | if ($sort_order == '') { |
425 | 425 | |
426 | - $last_order = $wpdb->get_var("SELECT MAX(sort_order) as last_order FROM " . GEODIR_CUSTOM_FIELDS_TABLE); |
|
426 | + $last_order = $wpdb->get_var("SELECT MAX(sort_order) as last_order FROM ".GEODIR_CUSTOM_FIELDS_TABLE); |
|
427 | 427 | |
428 | - $sort_order = (int)$last_order + 1; |
|
428 | + $sort_order = (int) $last_order + 1; |
|
429 | 429 | } |
430 | 430 | |
431 | 431 | $default_value_add = ''; |
@@ -437,15 +437,15 @@ discard block |
||
437 | 437 | case 'address': |
438 | 438 | |
439 | 439 | if ($htmlvar_name != '') { |
440 | - $prefix = $htmlvar_name . '_'; |
|
440 | + $prefix = $htmlvar_name.'_'; |
|
441 | 441 | } |
442 | - $old_prefix = $old_html_variable . '_'; |
|
442 | + $old_prefix = $old_html_variable.'_'; |
|
443 | 443 | |
444 | 444 | |
445 | - $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "address` `" . $prefix . "address` VARCHAR( 254 ) NULL"; |
|
445 | + $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."address` `".$prefix."address` VARCHAR( 254 ) NULL"; |
|
446 | 446 | |
447 | 447 | if ($default_value != '') { |
448 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
448 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
449 | 449 | } |
450 | 450 | |
451 | 451 | $wpdb->query($meta_field_add); |
@@ -454,12 +454,12 @@ discard block |
||
454 | 454 | |
455 | 455 | if (isset($extra_fields['show_city']) && $extra_fields['show_city']) { |
456 | 456 | |
457 | - $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "city'"); |
|
457 | + $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."city'"); |
|
458 | 458 | if ($is_column) { |
459 | - $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "city` `" . $prefix . "city` VARCHAR( 50 ) NULL"; |
|
459 | + $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."city` `".$prefix."city` VARCHAR( 50 ) NULL"; |
|
460 | 460 | |
461 | 461 | if ($default_value != '') { |
462 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
462 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
463 | 463 | } |
464 | 464 | |
465 | 465 | $wpdb->query($meta_field_add); |
@@ -467,9 +467,9 @@ discard block |
||
467 | 467 | |
468 | 468 | $meta_field_add = "VARCHAR( 50 ) NULL"; |
469 | 469 | if ($default_value != '') { |
470 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
470 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
471 | 471 | } |
472 | - geodir_add_column_if_not_exist($detail_table, $prefix . "city", $meta_field_add); |
|
472 | + geodir_add_column_if_not_exist($detail_table, $prefix."city", $meta_field_add); |
|
473 | 473 | |
474 | 474 | } |
475 | 475 | |
@@ -479,36 +479,36 @@ discard block |
||
479 | 479 | |
480 | 480 | if (isset($extra_fields['show_region']) && $extra_fields['show_region']) { |
481 | 481 | |
482 | - $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "region'"); |
|
482 | + $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."region'"); |
|
483 | 483 | |
484 | 484 | if ($is_column) { |
485 | - $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "region` `" . $prefix . "region` VARCHAR( 50 ) NULL"; |
|
485 | + $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."region` `".$prefix."region` VARCHAR( 50 ) NULL"; |
|
486 | 486 | |
487 | 487 | if ($default_value != '') { |
488 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
488 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
489 | 489 | } |
490 | 490 | |
491 | 491 | $wpdb->query($meta_field_add); |
492 | 492 | } else { |
493 | 493 | $meta_field_add = "VARCHAR( 50 ) NULL"; |
494 | 494 | if ($default_value != '') { |
495 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
495 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
496 | 496 | } |
497 | 497 | |
498 | - geodir_add_column_if_not_exist($detail_table, $prefix . "region", $meta_field_add); |
|
498 | + geodir_add_column_if_not_exist($detail_table, $prefix."region", $meta_field_add); |
|
499 | 499 | } |
500 | 500 | |
501 | 501 | } |
502 | 502 | if (isset($extra_fields['show_country']) && $extra_fields['show_country']) { |
503 | 503 | |
504 | - $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "country'"); |
|
504 | + $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."country'"); |
|
505 | 505 | |
506 | 506 | if ($is_column) { |
507 | 507 | |
508 | - $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "country` `" . $prefix . "country` VARCHAR( 50 ) NULL"; |
|
508 | + $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."country` `".$prefix."country` VARCHAR( 50 ) NULL"; |
|
509 | 509 | |
510 | 510 | if ($default_value != '') { |
511 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
511 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
512 | 512 | } |
513 | 513 | |
514 | 514 | $wpdb->query($meta_field_add); |
@@ -516,24 +516,24 @@ discard block |
||
516 | 516 | |
517 | 517 | $meta_field_add = "VARCHAR( 50 ) NULL"; |
518 | 518 | if ($default_value != '') { |
519 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
519 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
520 | 520 | } |
521 | 521 | |
522 | - geodir_add_column_if_not_exist($detail_table, $prefix . "country", $meta_field_add); |
|
522 | + geodir_add_column_if_not_exist($detail_table, $prefix."country", $meta_field_add); |
|
523 | 523 | |
524 | 524 | } |
525 | 525 | |
526 | 526 | } |
527 | 527 | if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) { |
528 | 528 | |
529 | - $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "zip'"); |
|
529 | + $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."zip'"); |
|
530 | 530 | |
531 | 531 | if ($is_column) { |
532 | 532 | |
533 | - $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "zip` `" . $prefix . "zip` VARCHAR( 50 ) NULL"; |
|
533 | + $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."zip` `".$prefix."zip` VARCHAR( 50 ) NULL"; |
|
534 | 534 | |
535 | 535 | if ($default_value != '') { |
536 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
536 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
537 | 537 | } |
538 | 538 | |
539 | 539 | $wpdb->query($meta_field_add); |
@@ -541,128 +541,128 @@ discard block |
||
541 | 541 | |
542 | 542 | $meta_field_add = "VARCHAR( 50 ) NULL"; |
543 | 543 | if ($default_value != '') { |
544 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
544 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
545 | 545 | } |
546 | 546 | |
547 | - geodir_add_column_if_not_exist($detail_table, $prefix . "zip", $meta_field_add); |
|
547 | + geodir_add_column_if_not_exist($detail_table, $prefix."zip", $meta_field_add); |
|
548 | 548 | |
549 | 549 | } |
550 | 550 | |
551 | 551 | } |
552 | 552 | if (isset($extra_fields['show_map']) && $extra_fields['show_map']) { |
553 | 553 | |
554 | - $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "latitude'"); |
|
554 | + $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."latitude'"); |
|
555 | 555 | if ($is_column) { |
556 | 556 | |
557 | - $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "latitude` `" . $prefix . "latitude` VARCHAR( 20 ) NULL"; |
|
557 | + $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."latitude` `".$prefix."latitude` VARCHAR( 20 ) NULL"; |
|
558 | 558 | |
559 | 559 | if ($default_value != '') { |
560 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
560 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
561 | 561 | } |
562 | 562 | |
563 | 563 | $wpdb->query($meta_field_add); |
564 | 564 | } else { |
565 | 565 | |
566 | - $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "latitude` VARCHAR( 20 ) NULL"; |
|
566 | + $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."latitude` VARCHAR( 20 ) NULL"; |
|
567 | 567 | $meta_field_add = "VARCHAR( 20 ) NULL"; |
568 | 568 | if ($default_value != '') { |
569 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
569 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
570 | 570 | } |
571 | 571 | |
572 | - geodir_add_column_if_not_exist($detail_table, $prefix . "latitude", $meta_field_add); |
|
572 | + geodir_add_column_if_not_exist($detail_table, $prefix."latitude", $meta_field_add); |
|
573 | 573 | |
574 | 574 | } |
575 | 575 | |
576 | 576 | |
577 | - $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "longitude'"); |
|
577 | + $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."longitude'"); |
|
578 | 578 | |
579 | 579 | if ($is_column) { |
580 | - $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "longitude` `" . $prefix . "longitude` VARCHAR( 20 ) NULL"; |
|
580 | + $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."longitude` `".$prefix."longitude` VARCHAR( 20 ) NULL"; |
|
581 | 581 | |
582 | 582 | if ($default_value != '') { |
583 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
583 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
584 | 584 | } |
585 | 585 | |
586 | 586 | $wpdb->query($meta_field_add); |
587 | 587 | } else { |
588 | 588 | |
589 | - $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "longitude` VARCHAR( 20 ) NULL"; |
|
589 | + $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."longitude` VARCHAR( 20 ) NULL"; |
|
590 | 590 | $meta_field_add = "VARCHAR( 20 ) NULL"; |
591 | 591 | if ($default_value != '') { |
592 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
592 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
593 | 593 | } |
594 | 594 | |
595 | - geodir_add_column_if_not_exist($detail_table, $prefix . "longitude", $meta_field_add); |
|
595 | + geodir_add_column_if_not_exist($detail_table, $prefix."longitude", $meta_field_add); |
|
596 | 596 | } |
597 | 597 | |
598 | 598 | } |
599 | 599 | if (isset($extra_fields['show_mapview']) && $extra_fields['show_mapview']) { |
600 | 600 | |
601 | - $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "mapview'"); |
|
601 | + $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."mapview'"); |
|
602 | 602 | |
603 | 603 | if ($is_column) { |
604 | - $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "mapview` `" . $prefix . "mapview` VARCHAR( 15 ) NULL"; |
|
604 | + $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."mapview` `".$prefix."mapview` VARCHAR( 15 ) NULL"; |
|
605 | 605 | |
606 | 606 | if ($default_value != '') { |
607 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
607 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
608 | 608 | } |
609 | 609 | |
610 | 610 | $wpdb->query($meta_field_add); |
611 | 611 | } else { |
612 | 612 | |
613 | - $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "mapview` VARCHAR( 15 ) NULL"; |
|
613 | + $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."mapview` VARCHAR( 15 ) NULL"; |
|
614 | 614 | |
615 | 615 | $meta_field_add = "VARCHAR( 15 ) NULL"; |
616 | 616 | if ($default_value != '') { |
617 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
617 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
618 | 618 | } |
619 | 619 | |
620 | - geodir_add_column_if_not_exist($detail_table, $prefix . "mapview", $meta_field_add); |
|
620 | + geodir_add_column_if_not_exist($detail_table, $prefix."mapview", $meta_field_add); |
|
621 | 621 | } |
622 | 622 | |
623 | 623 | |
624 | 624 | } |
625 | 625 | if (isset($extra_fields['show_mapzoom']) && $extra_fields['show_mapzoom']) { |
626 | 626 | |
627 | - $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "mapzoom'"); |
|
627 | + $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."mapzoom'"); |
|
628 | 628 | if ($is_column) { |
629 | - $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "mapzoom` `" . $prefix . "mapzoom` VARCHAR( 3 ) NULL"; |
|
629 | + $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."mapzoom` `".$prefix."mapzoom` VARCHAR( 3 ) NULL"; |
|
630 | 630 | |
631 | 631 | if ($default_value != '') { |
632 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
632 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
633 | 633 | } |
634 | 634 | |
635 | 635 | $wpdb->query($meta_field_add); |
636 | 636 | |
637 | 637 | } else { |
638 | 638 | |
639 | - $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "mapzoom` VARCHAR( 3 ) NULL"; |
|
639 | + $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."mapzoom` VARCHAR( 3 ) NULL"; |
|
640 | 640 | |
641 | 641 | $meta_field_add = "VARCHAR( 3 ) NULL"; |
642 | 642 | if ($default_value != '') { |
643 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
643 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
644 | 644 | } |
645 | 645 | |
646 | - geodir_add_column_if_not_exist($detail_table, $prefix . "mapzoom", $meta_field_add); |
|
646 | + geodir_add_column_if_not_exist($detail_table, $prefix."mapzoom", $meta_field_add); |
|
647 | 647 | } |
648 | 648 | |
649 | 649 | } |
650 | 650 | // show lat lng |
651 | 651 | if (isset($extra_fields['show_latlng']) && $extra_fields['show_latlng']) { |
652 | - $is_column = $wpdb->get_var("SHOW COLUMNS FROM " . $detail_table . " where field='" . $old_prefix . "latlng'"); |
|
652 | + $is_column = $wpdb->get_var("SHOW COLUMNS FROM ".$detail_table." where field='".$old_prefix."latlng'"); |
|
653 | 653 | |
654 | 654 | if ($is_column) { |
655 | - $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_prefix . "latlng` `" . $prefix . "latlng` VARCHAR( 3 ) NULL"; |
|
655 | + $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_prefix."latlng` `".$prefix."latlng` VARCHAR( 3 ) NULL"; |
|
656 | 656 | $meta_field_add .= " DEFAULT '1'"; |
657 | 657 | |
658 | 658 | $wpdb->query($meta_field_add); |
659 | 659 | } else { |
660 | - $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "latlng` VARCHAR( 3 ) NULL"; |
|
660 | + $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."latlng` VARCHAR( 3 ) NULL"; |
|
661 | 661 | |
662 | 662 | $meta_field_add = "VARCHAR( 3 ) NULL"; |
663 | 663 | $meta_field_add .= " DEFAULT '1'"; |
664 | 664 | |
665 | - geodir_add_column_if_not_exist($detail_table, $prefix . "latlng", $meta_field_add); |
|
665 | + geodir_add_column_if_not_exist($detail_table, $prefix."latlng", $meta_field_add); |
|
666 | 666 | } |
667 | 667 | |
668 | 668 | } |
@@ -678,30 +678,30 @@ discard block |
||
678 | 678 | $op_size = '500'; |
679 | 679 | |
680 | 680 | // only make the field as big as it needs to be. |
681 | - if(isset($option_values) && $option_values && $field_type=='select'){ |
|
682 | - $option_values_arr = explode(',',$option_values); |
|
683 | - if(is_array($option_values_arr)){ |
|
681 | + if (isset($option_values) && $option_values && $field_type == 'select') { |
|
682 | + $option_values_arr = explode(',', $option_values); |
|
683 | + if (is_array($option_values_arr)) { |
|
684 | 684 | $op_max = 0; |
685 | - foreach($option_values_arr as $op_val){ |
|
686 | - if(strlen($op_val) && strlen($op_val)>$op_max){$op_max = strlen($op_val);} |
|
685 | + foreach ($option_values_arr as $op_val) { |
|
686 | + if (strlen($op_val) && strlen($op_val) > $op_max) {$op_max = strlen($op_val); } |
|
687 | 687 | } |
688 | - if($op_max){$op_size =$op_max; } |
|
688 | + if ($op_max) {$op_size = $op_max; } |
|
689 | 689 | } |
690 | - }elseif(isset($option_values) && $option_values && $field_type=='multiselect'){ |
|
691 | - if(strlen($option_values)){ |
|
692 | - $op_size = strlen($option_values); |
|
690 | + }elseif (isset($option_values) && $option_values && $field_type == 'multiselect') { |
|
691 | + if (strlen($option_values)) { |
|
692 | + $op_size = strlen($option_values); |
|
693 | 693 | } |
694 | 694 | } |
695 | 695 | |
696 | - $meta_field_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "`VARCHAR( $op_size ) NULL"; |
|
696 | + $meta_field_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_html_variable."` `".$htmlvar_name."`VARCHAR( $op_size ) NULL"; |
|
697 | 697 | |
698 | 698 | if ($default_value != '') { |
699 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
699 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
700 | 700 | } |
701 | 701 | |
702 | 702 | $alter_result = $wpdb->query($meta_field_add); |
703 | - if($alter_result===false){ |
|
704 | - return __('Column change failed, you may have too many columns.','geodirectory'); |
|
703 | + if ($alter_result === false) { |
|
704 | + return __('Column change failed, you may have too many columns.', 'geodirectory'); |
|
705 | 705 | } |
706 | 706 | |
707 | 707 | if (isset($request_field['cat_display_type'])) |
@@ -718,9 +718,9 @@ discard block |
||
718 | 718 | case 'url': |
719 | 719 | case 'file': |
720 | 720 | |
721 | - $alter_result = $wpdb->query("ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "` TEXT NULL"); |
|
722 | - if($alter_result===false){ |
|
723 | - return __('Column change failed, you may have too many columns.','geodirectory'); |
|
721 | + $alter_result = $wpdb->query("ALTER TABLE ".$detail_table." CHANGE `".$old_html_variable."` `".$htmlvar_name."` TEXT NULL"); |
|
722 | + if ($alter_result === false) { |
|
723 | + return __('Column change failed, you may have too many columns.', 'geodirectory'); |
|
724 | 724 | } |
725 | 725 | if (isset($request_field['advanced_editor'])) |
726 | 726 | $extra_fields = $request_field['advanced_editor']; |
@@ -734,24 +734,24 @@ discard block |
||
734 | 734 | default: |
735 | 735 | if ($data_type != 'VARCHAR' && $data_type != '') { |
736 | 736 | if ($data_type == 'FLOAT' && $decimal_point > 0) { |
737 | - $default_value_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "` DECIMAL(11, " . (int)$decimal_point . ") NULL"; |
|
737 | + $default_value_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_html_variable."` `".$htmlvar_name."` DECIMAL(11, ".(int) $decimal_point.") NULL"; |
|
738 | 738 | } else { |
739 | - $default_value_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "` " . $data_type . " NULL"; |
|
739 | + $default_value_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_html_variable."` `".$htmlvar_name."` ".$data_type." NULL"; |
|
740 | 740 | } |
741 | 741 | |
742 | 742 | if (is_numeric($default_value) && $default_value != '') { |
743 | - $default_value_add .= " DEFAULT '" . $default_value . "'"; |
|
743 | + $default_value_add .= " DEFAULT '".$default_value."'"; |
|
744 | 744 | } |
745 | 745 | } else { |
746 | - $default_value_add = "ALTER TABLE " . $detail_table . " CHANGE `" . $old_html_variable . "` `" . $htmlvar_name . "` VARCHAR( 254 ) NULL"; |
|
746 | + $default_value_add = "ALTER TABLE ".$detail_table." CHANGE `".$old_html_variable."` `".$htmlvar_name."` VARCHAR( 254 ) NULL"; |
|
747 | 747 | if ($default_value != '') { |
748 | - $default_value_add .= " DEFAULT '" . $default_value . "'"; |
|
748 | + $default_value_add .= " DEFAULT '".$default_value."'"; |
|
749 | 749 | } |
750 | 750 | } |
751 | 751 | |
752 | 752 | $alter_result = $wpdb->query($default_value_add); |
753 | - if($alter_result===false){ |
|
754 | - return __('Column change failed, you may have too many columns.','geodirectory'); |
|
753 | + if ($alter_result === false) { |
|
754 | + return __('Column change failed, you may have too many columns.', 'geodirectory'); |
|
755 | 755 | } |
756 | 756 | break; |
757 | 757 | endswitch; |
@@ -767,7 +767,7 @@ discard block |
||
767 | 767 | |
768 | 768 | $wpdb->prepare( |
769 | 769 | |
770 | - "update " . GEODIR_CUSTOM_FIELDS_TABLE . " set |
|
770 | + "update ".GEODIR_CUSTOM_FIELDS_TABLE." set |
|
771 | 771 | post_type = %s, |
772 | 772 | admin_title = %s, |
773 | 773 | site_title = %s, |
@@ -799,7 +799,7 @@ discard block |
||
799 | 799 | for_admin_use = %s |
800 | 800 | where id = %d", |
801 | 801 | |
802 | - array($post_type, $admin_title, $site_title, $field_type, $htmlvar_name, $admin_desc, $clabels, $default_value, $sort_order, $is_active, $is_default, $is_required, $required_msg, $css_class, $field_icon, $field_icon, $show_on_listing, $show_on_detail, $show_as_tab, $option_values, $price_pkg, $cat_sort, $cat_filter, $data_type, $extra_field_query, $decimal_point,$validation_pattern,$validation_msg, $for_admin_use, $cf) |
|
802 | + array($post_type, $admin_title, $site_title, $field_type, $htmlvar_name, $admin_desc, $clabels, $default_value, $sort_order, $is_active, $is_default, $is_required, $required_msg, $css_class, $field_icon, $field_icon, $show_on_listing, $show_on_detail, $show_as_tab, $option_values, $price_pkg, $cat_sort, $cat_filter, $data_type, $extra_field_query, $decimal_point, $validation_pattern, $validation_msg, $for_admin_use, $cf) |
|
803 | 803 | ) |
804 | 804 | |
805 | 805 | ); |
@@ -809,7 +809,7 @@ discard block |
||
809 | 809 | |
810 | 810 | $wpdb->query( |
811 | 811 | $wpdb->prepare( |
812 | - "update " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set |
|
812 | + "update ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." set |
|
813 | 813 | site_title=%s |
814 | 814 | where post_type = %s and htmlvar_name = %s", |
815 | 815 | array($site_title, $post_type, $htmlvar_name) |
@@ -818,7 +818,7 @@ discard block |
||
818 | 818 | |
819 | 819 | |
820 | 820 | if ($cat_sort == '') |
821 | - $wpdb->query($wpdb->prepare("delete from " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " where post_type = %s and htmlvar_name = %s", array($post_type, $htmlvar_name))); |
|
821 | + $wpdb->query($wpdb->prepare("delete from ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." where post_type = %s and htmlvar_name = %s", array($post_type, $htmlvar_name))); |
|
822 | 822 | |
823 | 823 | |
824 | 824 | /** |
@@ -838,7 +838,7 @@ discard block |
||
838 | 838 | $data_type = ''; |
839 | 839 | |
840 | 840 | if ($htmlvar_name != '') { |
841 | - $prefix = $htmlvar_name . '_'; |
|
841 | + $prefix = $htmlvar_name.'_'; |
|
842 | 842 | } |
843 | 843 | $old_prefix = $old_html_variable; |
844 | 844 | |
@@ -846,109 +846,109 @@ discard block |
||
846 | 846 | |
847 | 847 | $meta_field_add = "VARCHAR( 254 ) NULL"; |
848 | 848 | if ($default_value != '') { |
849 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
849 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
850 | 850 | } |
851 | 851 | |
852 | - geodir_add_column_if_not_exist($detail_table, $prefix . "address", $meta_field_add); |
|
852 | + geodir_add_column_if_not_exist($detail_table, $prefix."address", $meta_field_add); |
|
853 | 853 | //$wpdb->query($meta_field_add); |
854 | 854 | |
855 | 855 | |
856 | 856 | if (!empty($extra_fields)) { |
857 | 857 | |
858 | 858 | if (isset($extra_fields['show_city']) && $extra_fields['show_city']) { |
859 | - $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "city` VARCHAR( 30 ) NULL"; |
|
859 | + $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."city` VARCHAR( 30 ) NULL"; |
|
860 | 860 | $meta_field_add = "VARCHAR( 30 ) NULL"; |
861 | 861 | if ($default_value != '') { |
862 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
862 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
863 | 863 | } |
864 | 864 | |
865 | - geodir_add_column_if_not_exist($detail_table, $prefix . "city", $meta_field_add); |
|
865 | + geodir_add_column_if_not_exist($detail_table, $prefix."city", $meta_field_add); |
|
866 | 866 | //$wpdb->query($meta_field_add); |
867 | 867 | } |
868 | 868 | if (isset($extra_fields['show_region']) && $extra_fields['show_region']) { |
869 | - $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "region` VARCHAR( 30 ) NULL"; |
|
869 | + $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."region` VARCHAR( 30 ) NULL"; |
|
870 | 870 | $meta_field_add = "VARCHAR( 30 ) NULL"; |
871 | 871 | if ($default_value != '') { |
872 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
872 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
873 | 873 | } |
874 | 874 | |
875 | - geodir_add_column_if_not_exist($detail_table, $prefix . "region", $meta_field_add); |
|
875 | + geodir_add_column_if_not_exist($detail_table, $prefix."region", $meta_field_add); |
|
876 | 876 | //$wpdb->query($meta_field_add); |
877 | 877 | } |
878 | 878 | if (isset($extra_fields['show_country']) && $extra_fields['show_country']) { |
879 | - $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "country` VARCHAR( 30 ) NULL"; |
|
879 | + $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."country` VARCHAR( 30 ) NULL"; |
|
880 | 880 | |
881 | 881 | $meta_field_add = "VARCHAR( 30 ) NULL"; |
882 | 882 | if ($default_value != '') { |
883 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
883 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
884 | 884 | } |
885 | 885 | |
886 | - geodir_add_column_if_not_exist($detail_table, $prefix . "country", $meta_field_add); |
|
886 | + geodir_add_column_if_not_exist($detail_table, $prefix."country", $meta_field_add); |
|
887 | 887 | //$wpdb->query($meta_field_add); |
888 | 888 | } |
889 | 889 | if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) { |
890 | - $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "zip` VARCHAR( 15 ) NULL"; |
|
890 | + $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."zip` VARCHAR( 15 ) NULL"; |
|
891 | 891 | $meta_field_add = "VARCHAR( 15 ) NULL"; |
892 | 892 | if ($default_value != '') { |
893 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
893 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
894 | 894 | } |
895 | 895 | |
896 | - geodir_add_column_if_not_exist($detail_table, $prefix . "zip", $meta_field_add); |
|
896 | + geodir_add_column_if_not_exist($detail_table, $prefix."zip", $meta_field_add); |
|
897 | 897 | //$wpdb->query($meta_field_add); |
898 | 898 | } |
899 | 899 | if (isset($extra_fields['show_map']) && $extra_fields['show_map']) { |
900 | - $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "latitude` VARCHAR( 20 ) NULL"; |
|
900 | + $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."latitude` VARCHAR( 20 ) NULL"; |
|
901 | 901 | $meta_field_add = "VARCHAR( 20 ) NULL"; |
902 | 902 | if ($default_value != '') { |
903 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
903 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
904 | 904 | } |
905 | 905 | |
906 | - geodir_add_column_if_not_exist($detail_table, $prefix . "latitude", $meta_field_add); |
|
906 | + geodir_add_column_if_not_exist($detail_table, $prefix."latitude", $meta_field_add); |
|
907 | 907 | //$wpdb->query($meta_field_add); |
908 | 908 | |
909 | - $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "longitude` VARCHAR( 20 ) NULL"; |
|
909 | + $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."longitude` VARCHAR( 20 ) NULL"; |
|
910 | 910 | |
911 | 911 | $meta_field_add = "VARCHAR( 20 ) NULL"; |
912 | 912 | if ($default_value != '') { |
913 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
913 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
914 | 914 | } |
915 | 915 | |
916 | - geodir_add_column_if_not_exist($detail_table, $prefix . "longitude", $meta_field_add); |
|
916 | + geodir_add_column_if_not_exist($detail_table, $prefix."longitude", $meta_field_add); |
|
917 | 917 | |
918 | 918 | //$wpdb->query($meta_field_add); |
919 | 919 | } |
920 | 920 | if (isset($extra_fields['show_mapview']) && $extra_fields['show_mapview']) { |
921 | - $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "mapview` VARCHAR( 15 ) NULL"; |
|
921 | + $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."mapview` VARCHAR( 15 ) NULL"; |
|
922 | 922 | |
923 | 923 | $meta_field_add = "VARCHAR( 15 ) NULL"; |
924 | 924 | if ($default_value != '') { |
925 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
925 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
926 | 926 | } |
927 | 927 | |
928 | - geodir_add_column_if_not_exist($detail_table, $prefix . "mapview", $meta_field_add); |
|
928 | + geodir_add_column_if_not_exist($detail_table, $prefix."mapview", $meta_field_add); |
|
929 | 929 | |
930 | 930 | //$wpdb->query($meta_field_add); |
931 | 931 | } |
932 | 932 | if (isset($extra_fields['show_mapzoom']) && $extra_fields['show_mapzoom']) { |
933 | - $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "mapzoom` VARCHAR( 3 ) NULL"; |
|
933 | + $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."mapzoom` VARCHAR( 3 ) NULL"; |
|
934 | 934 | |
935 | 935 | $meta_field_add = "VARCHAR( 3 ) NULL"; |
936 | 936 | if ($default_value != '') { |
937 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
937 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
938 | 938 | } |
939 | 939 | |
940 | - geodir_add_column_if_not_exist($detail_table, $prefix . "mapzoom", $meta_field_add); |
|
940 | + geodir_add_column_if_not_exist($detail_table, $prefix."mapzoom", $meta_field_add); |
|
941 | 941 | |
942 | 942 | //$wpdb->query($meta_field_add); |
943 | 943 | } |
944 | 944 | // show lat lng |
945 | 945 | if (isset($extra_fields['show_latlng']) && $extra_fields['show_latlng']) { |
946 | - $meta_field_add = "ALTER TABLE " . $detail_table . " ADD `" . $prefix . "latlng` VARCHAR( 3 ) NULL"; |
|
946 | + $meta_field_add = "ALTER TABLE ".$detail_table." ADD `".$prefix."latlng` VARCHAR( 3 ) NULL"; |
|
947 | 947 | |
948 | 948 | $meta_field_add = "VARCHAR( 3 ) NULL"; |
949 | 949 | $meta_field_add .= " DEFAULT '1'"; |
950 | 950 | |
951 | - geodir_add_column_if_not_exist($detail_table, $prefix . "latlng", $meta_field_add); |
|
951 | + geodir_add_column_if_not_exist($detail_table, $prefix."latlng", $meta_field_add); |
|
952 | 952 | //$wpdb->query($meta_field_add); |
953 | 953 | } |
954 | 954 | } |
@@ -958,8 +958,8 @@ discard block |
||
958 | 958 | case 'checkbox': |
959 | 959 | $data_type = 'TINYINT'; |
960 | 960 | |
961 | - $meta_field_add = $data_type . "( 1 ) NOT NULL "; |
|
962 | - if ((int)$default_value === 1) { |
|
961 | + $meta_field_add = $data_type."( 1 ) NOT NULL "; |
|
962 | + if ((int) $default_value === 1) { |
|
963 | 963 | $meta_field_add .= " DEFAULT '1'"; |
964 | 964 | } |
965 | 965 | |
@@ -992,7 +992,7 @@ discard block |
||
992 | 992 | } |
993 | 993 | } elseif (isset($option_values) && $option_values && $field_type == 'multiselect') { |
994 | 994 | if (strlen($option_values)) { |
995 | - $op_size = strlen($option_values); |
|
995 | + $op_size = strlen($option_values); |
|
996 | 996 | } |
997 | 997 | |
998 | 998 | if (isset($request_field['multi_display_type'])) { |
@@ -1000,9 +1000,9 @@ discard block |
||
1000 | 1000 | } |
1001 | 1001 | } |
1002 | 1002 | |
1003 | - $meta_field_add = $data_type . "( $op_size ) NULL "; |
|
1003 | + $meta_field_add = $data_type."( $op_size ) NULL "; |
|
1004 | 1004 | if ($default_value != '') { |
1005 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
1005 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
1006 | 1006 | } |
1007 | 1007 | |
1008 | 1008 | $add_result = geodir_add_column_if_not_exist($detail_table, $htmlvar_name, $meta_field_add); |
@@ -1017,9 +1017,9 @@ discard block |
||
1017 | 1017 | |
1018 | 1018 | $data_type = 'TEXT'; |
1019 | 1019 | |
1020 | - $default_value_add = " `" . $htmlvar_name . "` " . $data_type . " NULL "; |
|
1020 | + $default_value_add = " `".$htmlvar_name."` ".$data_type." NULL "; |
|
1021 | 1021 | |
1022 | - $meta_field_add = $data_type . " NULL "; |
|
1022 | + $meta_field_add = $data_type." NULL "; |
|
1023 | 1023 | /*if($default_value != '') |
1024 | 1024 | { $meta_field_add .= " DEFAULT '".$default_value."'"; }*/ |
1025 | 1025 | |
@@ -1034,9 +1034,9 @@ discard block |
||
1034 | 1034 | |
1035 | 1035 | $data_type = 'DATE'; |
1036 | 1036 | |
1037 | - $default_value_add = " `" . $htmlvar_name . "` " . $data_type . " NULL "; |
|
1037 | + $default_value_add = " `".$htmlvar_name."` ".$data_type." NULL "; |
|
1038 | 1038 | |
1039 | - $meta_field_add = $data_type . " NULL "; |
|
1039 | + $meta_field_add = $data_type." NULL "; |
|
1040 | 1040 | |
1041 | 1041 | $add_result = geodir_add_column_if_not_exist($detail_table, $htmlvar_name, $meta_field_add); |
1042 | 1042 | if ($add_result === false) { |
@@ -1049,9 +1049,9 @@ discard block |
||
1049 | 1049 | |
1050 | 1050 | $data_type = 'TIME'; |
1051 | 1051 | |
1052 | - $default_value_add = " `" . $htmlvar_name . "` " . $data_type . " NULL "; |
|
1052 | + $default_value_add = " `".$htmlvar_name."` ".$data_type." NULL "; |
|
1053 | 1053 | |
1054 | - $meta_field_add = $data_type . " NULL "; |
|
1054 | + $meta_field_add = $data_type." NULL "; |
|
1055 | 1055 | |
1056 | 1056 | $add_result = geodir_add_column_if_not_exist($detail_table, $htmlvar_name, $meta_field_add); |
1057 | 1057 | if ($add_result === false) { |
@@ -1063,22 +1063,22 @@ discard block |
||
1063 | 1063 | default: |
1064 | 1064 | |
1065 | 1065 | if ($data_type != 'VARCHAR' && $data_type != '') { |
1066 | - $meta_field_add = $data_type . " NULL "; |
|
1066 | + $meta_field_add = $data_type." NULL "; |
|
1067 | 1067 | |
1068 | 1068 | if ($data_type == 'FLOAT' && $decimal_point > 0) { |
1069 | - $meta_field_add = "DECIMAL(11, " . (int)$decimal_point . ") NULL "; |
|
1069 | + $meta_field_add = "DECIMAL(11, ".(int) $decimal_point.") NULL "; |
|
1070 | 1070 | } |
1071 | 1071 | |
1072 | 1072 | if (is_numeric($default_value) && $default_value != '') { |
1073 | - $default_value_add .= " DEFAULT '" . $default_value . "'"; |
|
1074 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
1073 | + $default_value_add .= " DEFAULT '".$default_value."'"; |
|
1074 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
1075 | 1075 | } |
1076 | 1076 | } else { |
1077 | 1077 | $meta_field_add = " VARCHAR( 254 ) NULL "; |
1078 | 1078 | |
1079 | 1079 | if ($default_value != '') { |
1080 | - $default_value_add .= " DEFAULT '" . $default_value . "'"; |
|
1081 | - $meta_field_add .= " DEFAULT '" . $default_value . "'"; |
|
1080 | + $default_value_add .= " DEFAULT '".$default_value."'"; |
|
1081 | + $meta_field_add .= " DEFAULT '".$default_value."'"; |
|
1082 | 1082 | } |
1083 | 1083 | } |
1084 | 1084 | |
@@ -1100,7 +1100,7 @@ discard block |
||
1100 | 1100 | |
1101 | 1101 | $wpdb->prepare( |
1102 | 1102 | |
1103 | - "insert into " . GEODIR_CUSTOM_FIELDS_TABLE . " set |
|
1103 | + "insert into ".GEODIR_CUSTOM_FIELDS_TABLE." set |
|
1104 | 1104 | post_type = %s, |
1105 | 1105 | admin_title = %s, |
1106 | 1106 | site_title = %s, |
@@ -1131,7 +1131,7 @@ discard block |
||
1131 | 1131 | validation_msg = %s, |
1132 | 1132 | for_admin_use = %s ", |
1133 | 1133 | |
1134 | - array($post_type, $admin_title, $site_title, $field_type, $htmlvar_name, $admin_desc, $clabels, $default_value, $sort_order, $is_active, $is_default, $is_admin, $is_required, $required_msg, $css_class, $field_icon, $show_on_listing, $show_on_detail, $show_as_tab, $option_values, $price_pkg, $cat_sort, $cat_filter, $data_type, $extra_field_query, $decimal_point,$validation_pattern,$validation_msg, $for_admin_use) |
|
1134 | + array($post_type, $admin_title, $site_title, $field_type, $htmlvar_name, $admin_desc, $clabels, $default_value, $sort_order, $is_active, $is_default, $is_admin, $is_required, $required_msg, $css_class, $field_icon, $show_on_listing, $show_on_detail, $show_as_tab, $option_values, $price_pkg, $cat_sort, $cat_filter, $data_type, $extra_field_query, $decimal_point, $validation_pattern, $validation_msg, $for_admin_use) |
|
1135 | 1135 | |
1136 | 1136 | ) |
1137 | 1137 | |
@@ -1143,7 +1143,7 @@ discard block |
||
1143 | 1143 | |
1144 | 1144 | } |
1145 | 1145 | |
1146 | - return (int)$lastid; |
|
1146 | + return (int) $lastid; |
|
1147 | 1147 | |
1148 | 1148 | |
1149 | 1149 | } else { |
@@ -1176,7 +1176,7 @@ discard block |
||
1176 | 1176 | |
1177 | 1177 | $post_meta_info = $wpdb->query( |
1178 | 1178 | $wpdb->prepare( |
1179 | - "update " . GEODIR_CUSTOM_FIELDS_TABLE . " set |
|
1179 | + "update ".GEODIR_CUSTOM_FIELDS_TABLE." set |
|
1180 | 1180 | sort_order=%d |
1181 | 1181 | where id= %d", |
1182 | 1182 | array($count, $cf) |
@@ -1232,7 +1232,7 @@ discard block |
||
1232 | 1232 | $value = ''; |
1233 | 1233 | |
1234 | 1234 | /* field available to site admin only for edit */ |
1235 | - $for_admin_use = isset($val['for_admin_use']) && (int)$val['for_admin_use'] == 1 ? true : false; |
|
1235 | + $for_admin_use = isset($val['for_admin_use']) && (int) $val['for_admin_use'] == 1 ? true : false; |
|
1236 | 1236 | if ($for_admin_use && !is_super_admin()) { |
1237 | 1237 | continue; |
1238 | 1238 | } |
@@ -1266,22 +1266,22 @@ discard block |
||
1266 | 1266 | * @param array $val The settings array for the field. {@see geodir_custom_field_save()}. |
1267 | 1267 | * @see 'geodir_after_custom_form_field_$name' |
1268 | 1268 | */ |
1269 | - do_action('geodir_before_custom_form_field_' . $name, $listing_type, $package_id, $val); |
|
1269 | + do_action('geodir_before_custom_form_field_'.$name, $listing_type, $package_id, $val); |
|
1270 | 1270 | |
1271 | 1271 | if ($type == 'fieldset') { |
1272 | - $fieldset_id = (int)$val['id']; |
|
1273 | - $fieldset_field_class = 'gd-fieldset-' . $fieldset_id; |
|
1272 | + $fieldset_id = (int) $val['id']; |
|
1273 | + $fieldset_field_class = 'gd-fieldset-'.$fieldset_id; |
|
1274 | 1274 | ?> |
1275 | - <h5 id="geodir_fieldset_<?php echo $fieldset_id;?>" class="geodir-fieldset-row" gd-fieldset="<?php echo $fieldset_id;?>"><?php echo $site_title;?> |
|
1276 | - <?php if ($admin_desc != '') echo '<small>( ' . $admin_desc . ' )</small>';?></h5> |
|
1275 | + <h5 id="geodir_fieldset_<?php echo $fieldset_id; ?>" class="geodir-fieldset-row" gd-fieldset="<?php echo $fieldset_id; ?>"><?php echo $site_title; ?> |
|
1276 | + <?php if ($admin_desc != '') echo '<small>( '.$admin_desc.' )</small>'; ?></h5> |
|
1277 | 1277 | <?php |
1278 | 1278 | } else if ($type == 'address') { |
1279 | - $prefix = $name . '_'; |
|
1279 | + $prefix = $name.'_'; |
|
1280 | 1280 | |
1281 | - ($site_title != '') ? $address_title = $site_title : $address_title = geodir_ucwords($prefix . ' address'); |
|
1282 | - ($extra_fields['zip_lable'] != '') ? $zip_title = $extra_fields['zip_lable'] : $zip_title = geodir_ucwords($prefix . ' zip/post code '); |
|
1281 | + ($site_title != '') ? $address_title = $site_title : $address_title = geodir_ucwords($prefix.' address'); |
|
1282 | + ($extra_fields['zip_lable'] != '') ? $zip_title = $extra_fields['zip_lable'] : $zip_title = geodir_ucwords($prefix.' zip/post code '); |
|
1283 | 1283 | ($extra_fields['map_lable'] != '') ? $map_title = $extra_fields['map_lable'] : $map_title = geodir_ucwords('set address on map'); |
1284 | - ($extra_fields['mapview_lable'] != '') ? $mapview_title = $extra_fields['mapview_lable'] : $mapview_title = geodir_ucwords($prefix . ' mapview'); |
|
1284 | + ($extra_fields['mapview_lable'] != '') ? $mapview_title = $extra_fields['mapview_lable'] : $mapview_title = geodir_ucwords($prefix.' mapview'); |
|
1285 | 1285 | |
1286 | 1286 | $address = ''; |
1287 | 1287 | $zip = ''; |
@@ -1292,21 +1292,21 @@ discard block |
||
1292 | 1292 | |
1293 | 1293 | if (isset($_REQUEST['backandedit']) && $_REQUEST['backandedit'] && $gd_ses_listing = $gd_session->get('listing')) { |
1294 | 1294 | $post = $gd_ses_listing; |
1295 | - $address = $post[$prefix . 'address']; |
|
1296 | - $zip = isset($post[$prefix . 'zip']) ? $post[$prefix . 'zip'] : ''; |
|
1297 | - $lat = isset($post[$prefix . 'latitude']) ? $post[$prefix . 'latitude'] : ''; |
|
1298 | - $lng = isset($post[$prefix . 'longitude']) ? $post[$prefix . 'longitude'] : ''; |
|
1299 | - $mapview = isset($post[$prefix . 'mapview']) ? $post[$prefix . 'mapview'] : ''; |
|
1300 | - $mapzoom = isset($post[$prefix . 'mapzoom']) ? $post[$prefix . 'mapzoom'] : ''; |
|
1295 | + $address = $post[$prefix.'address']; |
|
1296 | + $zip = isset($post[$prefix.'zip']) ? $post[$prefix.'zip'] : ''; |
|
1297 | + $lat = isset($post[$prefix.'latitude']) ? $post[$prefix.'latitude'] : ''; |
|
1298 | + $lng = isset($post[$prefix.'longitude']) ? $post[$prefix.'longitude'] : ''; |
|
1299 | + $mapview = isset($post[$prefix.'mapview']) ? $post[$prefix.'mapview'] : ''; |
|
1300 | + $mapzoom = isset($post[$prefix.'mapzoom']) ? $post[$prefix.'mapzoom'] : ''; |
|
1301 | 1301 | } else if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '' && $post_info = geodir_get_post_info($_REQUEST['pid'])) { |
1302 | - $post_info = (array)$post_info; |
|
1303 | - |
|
1304 | - $address = $post_info[$prefix . 'address']; |
|
1305 | - $zip = isset($post_info[$prefix . 'zip']) ? $post_info[$prefix . 'zip'] : ''; |
|
1306 | - $lat = isset($post_info[$prefix . 'latitude']) ? $post_info[$prefix . 'latitude'] : ''; |
|
1307 | - $lng = isset($post_info[$prefix . 'longitude']) ? $post_info[$prefix . 'longitude'] : ''; |
|
1308 | - $mapview = isset($post_info[$prefix . 'mapview']) ? $post_info[$prefix . 'mapview'] : ''; |
|
1309 | - $mapzoom = isset($post_info[$prefix . 'mapzoom']) ? $post_info[$prefix . 'mapzoom'] : ''; |
|
1302 | + $post_info = (array) $post_info; |
|
1303 | + |
|
1304 | + $address = $post_info[$prefix.'address']; |
|
1305 | + $zip = isset($post_info[$prefix.'zip']) ? $post_info[$prefix.'zip'] : ''; |
|
1306 | + $lat = isset($post_info[$prefix.'latitude']) ? $post_info[$prefix.'latitude'] : ''; |
|
1307 | + $lng = isset($post_info[$prefix.'longitude']) ? $post_info[$prefix.'longitude'] : ''; |
|
1308 | + $mapview = isset($post_info[$prefix.'mapview']) ? $post_info[$prefix.'mapview'] : ''; |
|
1309 | + $mapzoom = isset($post_info[$prefix.'mapzoom']) ? $post_info[$prefix.'mapzoom'] : ''; |
|
1310 | 1310 | } |
1311 | 1311 | |
1312 | 1312 | $location = geodir_get_default_location(); |
@@ -1343,16 +1343,16 @@ discard block |
||
1343 | 1343 | |
1344 | 1344 | ?> |
1345 | 1345 | |
1346 | - <div id="geodir_<?php echo $prefix . 'address';?>_row" |
|
1347 | - class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix <?php echo $fieldset_field_class;?>"> |
|
1346 | + <div id="geodir_<?php echo $prefix.'address'; ?>_row" |
|
1347 | + class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix <?php echo $fieldset_field_class; ?>"> |
|
1348 | 1348 | <label> |
1349 | 1349 | <?php _e($address_title, 'geodirectory'); ?> |
1350 | - <?php if ($is_required) echo '<span>*</span>';?> |
|
1350 | + <?php if ($is_required) echo '<span>*</span>'; ?> |
|
1351 | 1351 | </label> |
1352 | - <input type="text" field_type="<?php echo $type;?>" name="<?php echo $prefix . 'address';?>" |
|
1353 | - id="<?php echo $prefix . 'address';?>" class="geodir_textfield" |
|
1352 | + <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix.'address'; ?>" |
|
1353 | + id="<?php echo $prefix.'address'; ?>" class="geodir_textfield" |
|
1354 | 1354 | value="<?php echo esc_attr(stripslashes($address)); ?>"/> |
1355 | - <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory');?></span> |
|
1355 | + <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory'); ?></span> |
|
1356 | 1356 | <?php if ($is_required) { ?> |
1357 | 1357 | <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span> |
1358 | 1358 | <?php } ?> |
@@ -1372,14 +1372,14 @@ discard block |
||
1372 | 1372 | |
1373 | 1373 | if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) { ?> |
1374 | 1374 | |
1375 | - <div id="geodir_<?php echo $prefix . 'zip'; ?>_row" |
|
1376 | - class="<?php /*if($is_required) echo 'required_field';*/ ?> geodir_form_row clearfix <?php echo $fieldset_field_class;?>"> |
|
1375 | + <div id="geodir_<?php echo $prefix.'zip'; ?>_row" |
|
1376 | + class="<?php /*if($is_required) echo 'required_field';*/ ?> geodir_form_row clearfix <?php echo $fieldset_field_class; ?>"> |
|
1377 | 1377 | <label> |
1378 | 1378 | <?php _e($zip_title, 'geodirectory'); ?> |
1379 | 1379 | <?php /*if($is_required) echo '<span>*</span>';*/ ?> |
1380 | 1380 | </label> |
1381 | - <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix . 'zip'; ?>" |
|
1382 | - id="<?php echo $prefix . 'zip'; ?>" class="geodir_textfield autofill" |
|
1381 | + <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix.'zip'; ?>" |
|
1382 | + id="<?php echo $prefix.'zip'; ?>" class="geodir_textfield autofill" |
|
1383 | 1383 | value="<?php echo esc_attr(stripslashes($zip)); ?>"/> |
1384 | 1384 | <?php /*if($is_required) {?> |
1385 | 1385 | <span class="geodir_message_error"><?php echo _e($required_msg,'geodirectory');?></span> |
@@ -1389,14 +1389,14 @@ discard block |
||
1389 | 1389 | |
1390 | 1390 | <?php if (isset($extra_fields['show_map']) && $extra_fields['show_map']) { ?> |
1391 | 1391 | |
1392 | - <div id="geodir_<?php echo $prefix . 'map'; ?>_row" class="geodir_form_row clearfix <?php echo $fieldset_field_class;?>"> |
|
1392 | + <div id="geodir_<?php echo $prefix.'map'; ?>_row" class="geodir_form_row clearfix <?php echo $fieldset_field_class; ?>"> |
|
1393 | 1393 | <?php |
1394 | 1394 | /** |
1395 | 1395 | * Contains add listing page map functions. |
1396 | 1396 | * |
1397 | 1397 | * @since 1.0.0 |
1398 | 1398 | */ |
1399 | - include(geodir_plugin_path() . "/geodirectory-functions/map-functions/map_on_add_listing_page.php"); |
|
1399 | + include(geodir_plugin_path()."/geodirectory-functions/map-functions/map_on_add_listing_page.php"); |
|
1400 | 1400 | if ($lat_lng_blank) { |
1401 | 1401 | $lat = ''; |
1402 | 1402 | $lng = ''; |
@@ -1407,14 +1407,14 @@ discard block |
||
1407 | 1407 | <?php |
1408 | 1408 | /* show lat lng */ |
1409 | 1409 | $style_latlng = ((isset($extra_fields['show_latlng']) && $extra_fields['show_latlng']) || is_admin()) ? '' : 'style="display:none"'; ?> |
1410 | - <div id="geodir_<?php echo $prefix . 'latitude'; ?>_row" |
|
1411 | - class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix <?php echo $fieldset_field_class;?>" <?php echo $style_latlng; ?>> |
|
1410 | + <div id="geodir_<?php echo $prefix.'latitude'; ?>_row" |
|
1411 | + class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix <?php echo $fieldset_field_class; ?>" <?php echo $style_latlng; ?>> |
|
1412 | 1412 | <label> |
1413 | 1413 | <?php echo PLACE_ADDRESS_LAT; ?> |
1414 | 1414 | <?php if ($is_required) echo '<span>*</span>'; ?> |
1415 | 1415 | </label> |
1416 | - <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix . 'latitude'; ?>" |
|
1417 | - id="<?php echo $prefix . 'latitude'; ?>" class="geodir_textfield" |
|
1416 | + <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix.'latitude'; ?>" |
|
1417 | + id="<?php echo $prefix.'latitude'; ?>" class="geodir_textfield" |
|
1418 | 1418 | value="<?php echo esc_attr(stripslashes($lat)); ?>" size="25"/> |
1419 | 1419 | <span class="geodir_message_note"><?php echo GET_LATITUDE_MSG; ?></span> |
1420 | 1420 | <?php if ($is_required) { ?> |
@@ -1422,14 +1422,14 @@ discard block |
||
1422 | 1422 | <?php } ?> |
1423 | 1423 | </div> |
1424 | 1424 | |
1425 | - <div id="geodir_<?php echo $prefix . 'longitude'; ?>_row" |
|
1426 | - class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix <?php echo $fieldset_field_class;?>" <?php echo $style_latlng; ?>> |
|
1425 | + <div id="geodir_<?php echo $prefix.'longitude'; ?>_row" |
|
1426 | + class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix <?php echo $fieldset_field_class; ?>" <?php echo $style_latlng; ?>> |
|
1427 | 1427 | <label> |
1428 | 1428 | <?php echo PLACE_ADDRESS_LNG; ?> |
1429 | 1429 | <?php if ($is_required) echo '<span>*</span>'; ?> |
1430 | 1430 | </label> |
1431 | - <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix . 'longitude'; ?>" |
|
1432 | - id="<?php echo $prefix . 'longitude'; ?>" class="geodir_textfield" |
|
1431 | + <input type="text" field_type="<?php echo $type; ?>" name="<?php echo $prefix.'longitude'; ?>" |
|
1432 | + id="<?php echo $prefix.'longitude'; ?>" class="geodir_textfield" |
|
1433 | 1433 | value="<?php echo esc_attr(stripslashes($lng)); ?>" size="25"/> |
1434 | 1434 | <span class="geodir_message_note"><?php echo GET_LOGNGITUDE_MSG; ?></span> |
1435 | 1435 | <?php if ($is_required) { ?> |
@@ -1439,32 +1439,32 @@ discard block |
||
1439 | 1439 | <?php } ?> |
1440 | 1440 | |
1441 | 1441 | <?php if (isset($extra_fields['show_mapview']) && $extra_fields['show_mapview']) { ?> |
1442 | - <div id="geodir_<?php echo $prefix . 'mapview'; ?>_row" class="geodir_form_row clearfix <?php echo $fieldset_field_class;?>"> |
|
1442 | + <div id="geodir_<?php echo $prefix.'mapview'; ?>_row" class="geodir_form_row clearfix <?php echo $fieldset_field_class; ?>"> |
|
1443 | 1443 | <label><?php _e($mapview_title, 'geodirectory'); ?></label> |
1444 | 1444 | |
1445 | 1445 | |
1446 | 1446 | <span class="geodir_user_define"><input field_type="<?php echo $type; ?>" type="radio" |
1447 | 1447 | class="gd-checkbox" |
1448 | - name="<?php echo $prefix . 'mapview'; ?>" |
|
1449 | - id="<?php echo $prefix . 'mapview'; ?>" <?php if ($mapview == 'ROADMAP' || $mapview == '') { |
|
1448 | + name="<?php echo $prefix.'mapview'; ?>" |
|
1449 | + id="<?php echo $prefix.'mapview'; ?>" <?php if ($mapview == 'ROADMAP' || $mapview == '') { |
|
1450 | 1450 | echo 'checked="checked"'; |
1451 | 1451 | } ?> value="ROADMAP" size="25"/> <?php _e('Default Map', 'geodirectory'); ?></span> |
1452 | 1452 | <span class="geodir_user_define"> <input field_type="<?php echo $type; ?>" type="radio" |
1453 | 1453 | class="gd-checkbox" |
1454 | - name="<?php echo $prefix . 'mapview'; ?>" |
|
1454 | + name="<?php echo $prefix.'mapview'; ?>" |
|
1455 | 1455 | id="map_view1" <?php if ($mapview == 'SATELLITE') { |
1456 | 1456 | echo 'checked="checked"'; |
1457 | 1457 | } ?> value="SATELLITE" size="25"/> <?php _e('Satellite Map', 'geodirectory'); ?></span> |
1458 | 1458 | |
1459 | 1459 | <span class="geodir_user_define"><input field_type="<?php echo $type; ?>" type="radio" |
1460 | 1460 | class="gd-checkbox" |
1461 | - name="<?php echo $prefix . 'mapview'; ?>" |
|
1461 | + name="<?php echo $prefix.'mapview'; ?>" |
|
1462 | 1462 | id="map_view2" <?php if ($mapview == 'HYBRID') { |
1463 | 1463 | echo 'checked="checked"'; |
1464 | 1464 | } ?> value="HYBRID" size="25"/> <?php _e('Hybrid Map', 'geodirectory'); ?></span> |
1465 | 1465 | <span class="geodir_user_define"><input field_type="<?php echo $type; ?>" type="radio" |
1466 | 1466 | class="gd-checkbox" |
1467 | - name="<?php echo $prefix . 'mapview'; ?>" |
|
1467 | + name="<?php echo $prefix.'mapview'; ?>" |
|
1468 | 1468 | id="map_view3" <?php if ($mapview == 'TERRAIN') { |
1469 | 1469 | echo 'checked="checked"'; |
1470 | 1470 | } ?> value="TERRAIN" size="25"/> <?php _e('Terrain Map', 'geodirectory'); ?></span> |
@@ -1476,35 +1476,35 @@ discard block |
||
1476 | 1476 | <?php if (isset($extra_fields['show_mapzoom']) && $extra_fields['show_mapzoom']) { ?> |
1477 | 1477 | <input type="hidden" value="<?php if (isset($mapzoom)) { |
1478 | 1478 | echo esc_attr($mapzoom); |
1479 | - } ?>" name="<?php echo $prefix . 'mapzoom'; ?>" id="<?php echo $prefix . 'mapzoom'; ?>"/> |
|
1479 | + } ?>" name="<?php echo $prefix.'mapzoom'; ?>" id="<?php echo $prefix.'mapzoom'; ?>"/> |
|
1480 | 1480 | <?php }?> |
1481 | 1481 | <?php } elseif ($type == 'text') { |
1482 | 1482 | |
1483 | 1483 | //number and float validation $validation_pattern |
1484 | - if(isset($val['data_type']) && $val['data_type']=='INT'){$type = 'number';} |
|
1485 | - elseif(isset($val['data_type']) && $val['data_type']=='FLOAT'){$type = 'float';} |
|
1484 | + if (isset($val['data_type']) && $val['data_type'] == 'INT') {$type = 'number'; } |
|
1485 | + elseif (isset($val['data_type']) && $val['data_type'] == 'FLOAT') {$type = 'float'; } |
|
1486 | 1486 | //print_r($val); |
1487 | 1487 | //validation |
1488 | - if(isset($val['validation_pattern']) && $val['validation_pattern']){ |
|
1488 | + if (isset($val['validation_pattern']) && $val['validation_pattern']) { |
|
1489 | 1489 | $validation = 'pattern="'.$val['validation_pattern'].'"'; |
1490 | - }else{$validation='';} |
|
1490 | + } else {$validation = ''; } |
|
1491 | 1491 | |
1492 | 1492 | // validation message |
1493 | - if(isset($val['validation_msg']) && $val['validation_msg']){ |
|
1493 | + if (isset($val['validation_msg']) && $val['validation_msg']) { |
|
1494 | 1494 | $validation_msg = 'title="'.$val['validation_msg'].'"'; |
1495 | - }else{$validation_msg='';} |
|
1495 | + } else {$validation_msg = ''; } |
|
1496 | 1496 | ?> |
1497 | 1497 | |
1498 | - <div id="<?php echo $name;?>_row" |
|
1499 | - class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix <?php echo $fieldset_field_class;?>"> |
|
1498 | + <div id="<?php echo $name; ?>_row" |
|
1499 | + class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix <?php echo $fieldset_field_class; ?>"> |
|
1500 | 1500 | <label> |
1501 | 1501 | <?php $site_title = __($site_title, 'geodirectory'); |
1502 | 1502 | echo (trim($site_title)) ? $site_title : ' '; ?> |
1503 | - <?php if ($is_required) echo '<span>*</span>';?> |
|
1503 | + <?php if ($is_required) echo '<span>*</span>'; ?> |
|
1504 | 1504 | </label> |
1505 | - <input field_type="<?php echo $type;?>" name="<?php echo $name;?>" id="<?php echo $name;?>" |
|
1506 | - value="<?php echo esc_attr(stripslashes($value));?>" type="<?php echo $type;?>" class="geodir_textfield" <?php echo $validation;echo $validation_msg;?> /> |
|
1507 | - <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory');?></span> |
|
1505 | + <input field_type="<?php echo $type; ?>" name="<?php echo $name; ?>" id="<?php echo $name; ?>" |
|
1506 | + value="<?php echo esc_attr(stripslashes($value)); ?>" type="<?php echo $type; ?>" class="geodir_textfield" <?php echo $validation; echo $validation_msg; ?> /> |
|
1507 | + <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory'); ?></span> |
|
1508 | 1508 | <?php if ($is_required) { ?> |
1509 | 1509 | <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span> |
1510 | 1510 | <?php } ?> |
@@ -1515,16 +1515,16 @@ discard block |
||
1515 | 1515 | $value = ''; |
1516 | 1516 | }?> |
1517 | 1517 | |
1518 | - <div id="<?php echo $name;?>_row" |
|
1519 | - class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix <?php echo $fieldset_field_class;?>"> |
|
1518 | + <div id="<?php echo $name; ?>_row" |
|
1519 | + class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix <?php echo $fieldset_field_class; ?>"> |
|
1520 | 1520 | <label> |
1521 | 1521 | <?php $site_title = __($site_title, 'geodirectory'); |
1522 | 1522 | echo (trim($site_title)) ? $site_title : ' '; ?> |
1523 | - <?php if ($is_required) echo '<span>*</span>';?> |
|
1523 | + <?php if ($is_required) echo '<span>*</span>'; ?> |
|
1524 | 1524 | </label> |
1525 | - <input field_type="<?php echo $type;?>" name="<?php echo $name;?>" id="<?php echo $name;?>" |
|
1526 | - value="<?php echo esc_attr(stripslashes($value));?>" type="email" class="geodir_textfield"/> |
|
1527 | - <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory');?></span> |
|
1525 | + <input field_type="<?php echo $type; ?>" name="<?php echo $name; ?>" id="<?php echo $name; ?>" |
|
1526 | + value="<?php echo esc_attr(stripslashes($value)); ?>" type="email" class="geodir_textfield"/> |
|
1527 | + <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory'); ?></span> |
|
1528 | 1528 | <?php if ($is_required) { ?> |
1529 | 1529 | <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span> |
1530 | 1530 | <?php } ?> |
@@ -1535,16 +1535,16 @@ discard block |
||
1535 | 1535 | $value = ''; |
1536 | 1536 | } ?> |
1537 | 1537 | |
1538 | - <div id="<?php echo $name;?>_row" |
|
1539 | - class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix <?php echo $fieldset_field_class;?>"> |
|
1538 | + <div id="<?php echo $name; ?>_row" |
|
1539 | + class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix <?php echo $fieldset_field_class; ?>"> |
|
1540 | 1540 | <label> |
1541 | 1541 | <?php $site_title = __($site_title, 'geodirectory'); |
1542 | 1542 | echo (trim($site_title)) ? $site_title : ' '; ?> |
1543 | - <?php if ($is_required) echo '<span>*</span>';?> |
|
1543 | + <?php if ($is_required) echo '<span>*</span>'; ?> |
|
1544 | 1544 | </label> |
1545 | - <input field_type="<?php echo $type;?>" name="<?php echo $name;?>" id="<?php echo $name;?>" |
|
1546 | - value="<?php echo esc_attr(stripslashes($value));?>" type="tel" class="geodir_textfield"/> |
|
1547 | - <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory');?></span> |
|
1545 | + <input field_type="<?php echo $type; ?>" name="<?php echo $name; ?>" id="<?php echo $name; ?>" |
|
1546 | + value="<?php echo esc_attr(stripslashes($value)); ?>" type="tel" class="geodir_textfield"/> |
|
1547 | + <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory'); ?></span> |
|
1548 | 1548 | <?php if ($is_required) { ?> |
1549 | 1549 | <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span> |
1550 | 1550 | <?php } ?> |
@@ -1555,31 +1555,31 @@ discard block |
||
1555 | 1555 | $value = ''; |
1556 | 1556 | }?> |
1557 | 1557 | |
1558 | - <div id="<?php echo $name;?>_row" |
|
1559 | - class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix <?php echo $fieldset_field_class;?>"> |
|
1558 | + <div id="<?php echo $name; ?>_row" |
|
1559 | + class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix <?php echo $fieldset_field_class; ?>"> |
|
1560 | 1560 | <label> |
1561 | 1561 | <?php $site_title = __($site_title, 'geodirectory'); |
1562 | 1562 | echo (trim($site_title)) ? $site_title : ' '; ?> |
1563 | - <?php if ($is_required) echo '<span>*</span>';?> |
|
1563 | + <?php if ($is_required) echo '<span>*</span>'; ?> |
|
1564 | 1564 | </label> |
1565 | - <input field_type="<?php echo $type;?>" name="<?php echo $name;?>" id="<?php echo $name;?>" |
|
1566 | - value="<?php echo esc_attr(stripslashes($value));?>" type="url" class="geodir_textfield" |
|
1565 | + <input field_type="<?php echo $type; ?>" name="<?php echo $name; ?>" id="<?php echo $name; ?>" |
|
1566 | + value="<?php echo esc_attr(stripslashes($value)); ?>" type="url" class="geodir_textfield" |
|
1567 | 1567 | oninvalid="setCustomValidity('<?php _e('Please enter a valid URL including http://', 'geodirectory'); ?>')" |
1568 | 1568 | onchange="try{setCustomValidity('')}catch(e){}" |
1569 | 1569 | /> |
1570 | - <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory');?></span> |
|
1570 | + <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory'); ?></span> |
|
1571 | 1571 | <?php if ($is_required) { ?> |
1572 | 1572 | <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span> |
1573 | 1573 | <?php } ?> |
1574 | 1574 | </div> |
1575 | 1575 | |
1576 | 1576 | <?php } elseif ($type == 'radio') { ?> |
1577 | - <div id="<?php echo $name;?>_row" |
|
1578 | - class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix <?php echo $fieldset_field_class;?>"> |
|
1577 | + <div id="<?php echo $name; ?>_row" |
|
1578 | + class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix <?php echo $fieldset_field_class; ?>"> |
|
1579 | 1579 | <label> |
1580 | 1580 | <?php $site_title = __($site_title, 'geodirectory'); |
1581 | 1581 | echo (trim($site_title)) ? $site_title : ' '; ?> |
1582 | - <?php if ($is_required) echo '<span>*</span>';?> |
|
1582 | + <?php if ($is_required) echo '<span>*</span>'; ?> |
|
1583 | 1583 | </label> |
1584 | 1584 | <?php if ($option_values) { |
1585 | 1585 | $option_values = geodir_string_values_to_options($option_values, true); |
@@ -1588,14 +1588,14 @@ discard block |
||
1588 | 1588 | foreach ($option_values as $option_value) { |
1589 | 1589 | if (empty($option_value['optgroup'])) { |
1590 | 1590 | ?> |
1591 | - <span class="gd-radios"><input name="<?php echo $name;?>" id="<?php echo $name;?>" <?php checked($value, $option_value['value']);?> value="<?php echo esc_attr($option_value['value']); ?>" class="gd-checkbox" field_type="<?php echo $type;?>" type="radio" /><?php echo $option_value['label']; ?></span> |
|
1591 | + <span class="gd-radios"><input name="<?php echo $name; ?>" id="<?php echo $name; ?>" <?php checked($value, $option_value['value']); ?> value="<?php echo esc_attr($option_value['value']); ?>" class="gd-checkbox" field_type="<?php echo $type; ?>" type="radio" /><?php echo $option_value['label']; ?></span> |
|
1592 | 1592 | <?php |
1593 | 1593 | } |
1594 | 1594 | } |
1595 | 1595 | } |
1596 | 1596 | } |
1597 | 1597 | ?> |
1598 | - <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory');?></span> |
|
1598 | + <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory'); ?></span> |
|
1599 | 1599 | <?php if ($is_required) { ?> |
1600 | 1600 | <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span> |
1601 | 1601 | <?php } ?> |
@@ -1603,22 +1603,22 @@ discard block |
||
1603 | 1603 | |
1604 | 1604 | <?php } elseif ($type == 'checkbox') { ?> |
1605 | 1605 | |
1606 | - <div id="<?php echo $name;?>_row" |
|
1607 | - class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix <?php echo $fieldset_field_class;?>"> |
|
1606 | + <div id="<?php echo $name; ?>_row" |
|
1607 | + class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix <?php echo $fieldset_field_class; ?>"> |
|
1608 | 1608 | <label> |
1609 | 1609 | <?php $site_title = __($site_title, 'geodirectory'); |
1610 | 1610 | echo (trim($site_title)) ? $site_title : ' '; ?> |
1611 | - <?php if ($is_required) echo '<span>*</span>';?> |
|
1611 | + <?php if ($is_required) echo '<span>*</span>'; ?> |
|
1612 | 1612 | </label> |
1613 | 1613 | <?php if ($value != '1') { |
1614 | 1614 | $value = '0'; |
1615 | 1615 | }?> |
1616 | - <input type="hidden" name="<?php echo $name;?>" id="<?php echo $name;?>" value="<?php echo esc_attr($value);?>"/> |
|
1616 | + <input type="hidden" name="<?php echo $name; ?>" id="<?php echo $name; ?>" value="<?php echo esc_attr($value); ?>"/> |
|
1617 | 1617 | <input <?php if ($value == '1') { |
1618 | 1618 | echo 'checked="checked"'; |
1619 | - }?> value="1" class="gd-checkbox" field_type="<?php echo $type;?>" type="checkbox" |
|
1620 | - onchange="if(this.checked){jQuery('#<?php echo $name;?>').val('1');} else{ jQuery('#<?php echo $name;?>').val('0');}"/> |
|
1621 | - <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory');?></span> |
|
1619 | + }?> value="1" class="gd-checkbox" field_type="<?php echo $type; ?>" type="checkbox" |
|
1620 | + onchange="if(this.checked){jQuery('#<?php echo $name; ?>').val('1');} else{ jQuery('#<?php echo $name; ?>').val('0');}"/> |
|
1621 | + <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory'); ?></span> |
|
1622 | 1622 | <?php if ($is_required) { ?> |
1623 | 1623 | <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span> |
1624 | 1624 | <?php } ?> |
@@ -1627,44 +1627,44 @@ discard block |
||
1627 | 1627 | <?php } elseif ($type == 'textarea') { |
1628 | 1628 | ?> |
1629 | 1629 | |
1630 | - <div id="<?php echo $name;?>_row" |
|
1631 | - class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix <?php echo $fieldset_field_class;?>"> |
|
1630 | + <div id="<?php echo $name; ?>_row" |
|
1631 | + class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix <?php echo $fieldset_field_class; ?>"> |
|
1632 | 1632 | <label> |
1633 | 1633 | <?php $site_title = __($site_title, 'geodirectory'); |
1634 | 1634 | echo (trim($site_title)) ? $site_title : ' '; ?> |
1635 | - <?php if ($is_required) echo '<span>*</span>';?> |
|
1635 | + <?php if ($is_required) echo '<span>*</span>'; ?> |
|
1636 | 1636 | </label><?php |
1637 | 1637 | |
1638 | 1638 | |
1639 | 1639 | if (is_array($extra_fields) && in_array('1', $extra_fields)) { |
1640 | 1640 | |
1641 | - $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10);?> |
|
1641 | + $editor_settings = array('media_buttons' => false, 'textarea_rows' => 10); ?> |
|
1642 | 1642 | |
1643 | - <div class="editor" field_id="<?php echo $name;?>" field_type="editor"> |
|
1643 | + <div class="editor" field_id="<?php echo $name; ?>" field_type="editor"> |
|
1644 | 1644 | <?php wp_editor(stripslashes($value), $name, $editor_settings); ?> |
1645 | 1645 | </div><?php |
1646 | 1646 | |
1647 | 1647 | } else { |
1648 | 1648 | |
1649 | - ?><textarea field_type="<?php echo $type;?>" class="geodir_textarea" name="<?php echo $name;?>" |
|
1650 | - id="<?php echo $name;?>"><?php echo stripslashes($value);?></textarea><?php |
|
1649 | + ?><textarea field_type="<?php echo $type; ?>" class="geodir_textarea" name="<?php echo $name; ?>" |
|
1650 | + id="<?php echo $name; ?>"><?php echo stripslashes($value); ?></textarea><?php |
|
1651 | 1651 | |
1652 | 1652 | }?> |
1653 | 1653 | |
1654 | 1654 | |
1655 | - <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory');?></span> |
|
1655 | + <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory'); ?></span> |
|
1656 | 1656 | <?php if ($is_required) { ?> |
1657 | 1657 | <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span> |
1658 | 1658 | <?php } ?> |
1659 | 1659 | </div> |
1660 | 1660 | |
1661 | 1661 | <?php } elseif ($type == 'select') { ?> |
1662 | - <div id="<?php echo $name;?>_row" |
|
1663 | - class="<?php if ($is_required) echo 'required_field';?> geodir_form_row geodir_custom_fields clearfix <?php echo $fieldset_field_class;?>"> |
|
1662 | + <div id="<?php echo $name; ?>_row" |
|
1663 | + class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row geodir_custom_fields clearfix <?php echo $fieldset_field_class; ?>"> |
|
1664 | 1664 | <label> |
1665 | 1665 | <?php $site_title = __($site_title, 'geodirectory'); |
1666 | 1666 | echo (trim($site_title)) ? $site_title : ' '; ?> |
1667 | - <?php if ($is_required) echo '<span>*</span>';?> |
|
1667 | + <?php if ($is_required) echo '<span>*</span>'; ?> |
|
1668 | 1668 | </label> |
1669 | 1669 | <?php |
1670 | 1670 | $option_values_arr = geodir_string_values_to_options($option_values, true); |
@@ -1674,22 +1674,22 @@ discard block |
||
1674 | 1674 | if (isset($option_row['optgroup']) && ($option_row['optgroup'] == 'start' || $option_row['optgroup'] == 'end')) { |
1675 | 1675 | $option_label = isset($option_row['label']) ? $option_row['label'] : ''; |
1676 | 1676 | |
1677 | - $select_options .= $option_row['optgroup'] == 'start' ? '<optgroup label="' . esc_attr($option_label) . '">' : '</optgroup>'; |
|
1677 | + $select_options .= $option_row['optgroup'] == 'start' ? '<optgroup label="'.esc_attr($option_label).'">' : '</optgroup>'; |
|
1678 | 1678 | } else { |
1679 | 1679 | $option_label = isset($option_row['label']) ? $option_row['label'] : ''; |
1680 | 1680 | $option_value = isset($option_row['value']) ? $option_row['value'] : ''; |
1681 | 1681 | $selected = $option_value == $value ? 'selected="selected"' : ''; |
1682 | 1682 | |
1683 | - $select_options .= '<option value="' . esc_attr($option_value) . '" ' . $selected . '>' . $option_label . '</option>'; |
|
1683 | + $select_options .= '<option value="'.esc_attr($option_value).'" '.$selected.'>'.$option_label.'</option>'; |
|
1684 | 1684 | } |
1685 | 1685 | } |
1686 | 1686 | } |
1687 | 1687 | ?> |
1688 | - <select field_type="<?php echo $type;?>" name="<?php echo $name;?>" id="<?php echo $name;?>" |
|
1688 | + <select field_type="<?php echo $type; ?>" name="<?php echo $name; ?>" id="<?php echo $name; ?>" |
|
1689 | 1689 | class="geodir_textfield textfield_x chosen_select" |
1690 | - data-placeholder="<?php echo __('Choose', 'geodirectory') . ' ' . $site_title . '…';?>" |
|
1691 | - option-ajaxchosen="false"><?php echo $select_options;?></select> |
|
1692 | - <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory');?></span> |
|
1690 | + data-placeholder="<?php echo __('Choose', 'geodirectory').' '.$site_title.'…'; ?>" |
|
1691 | + option-ajaxchosen="false"><?php echo $select_options; ?></select> |
|
1692 | + <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory'); ?></span> |
|
1693 | 1693 | <?php if ($is_required) { ?> |
1694 | 1694 | <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span> |
1695 | 1695 | <?php } ?> |
@@ -1703,7 +1703,7 @@ discard block |
||
1703 | 1703 | } |
1704 | 1704 | ?> |
1705 | 1705 | <div id="<?php echo $name; ?>_row" |
1706 | - class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix <?php echo $fieldset_field_class;?>"> |
|
1706 | + class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix <?php echo $fieldset_field_class; ?>"> |
|
1707 | 1707 | <label> |
1708 | 1708 | <?php $site_title = __($site_title, 'geodirectory'); |
1709 | 1709 | echo (trim($site_title)) ? $site_title : ' '; ?> |
@@ -1729,9 +1729,9 @@ discard block |
||
1729 | 1729 | $option_label = isset($option_row['label']) ? $option_row['label'] : ''; |
1730 | 1730 | |
1731 | 1731 | if ($multi_display == 'select') { |
1732 | - $select_options .= $option_row['optgroup'] == 'start' ? '<optgroup label="' . esc_attr($option_label) . '">' : '</optgroup>'; |
|
1732 | + $select_options .= $option_row['optgroup'] == 'start' ? '<optgroup label="'.esc_attr($option_label).'">' : '</optgroup>'; |
|
1733 | 1733 | } else { |
1734 | - $select_options .= $option_row['optgroup'] == 'start' ? '<li>' . $option_label . '</li>' : ''; |
|
1734 | + $select_options .= $option_row['optgroup'] == 'start' ? '<li>'.$option_label.'</li>' : ''; |
|
1735 | 1735 | } |
1736 | 1736 | } else { |
1737 | 1737 | $option_label = isset($option_row['label']) ? $option_row['label'] : ''; |
@@ -1756,9 +1756,9 @@ discard block |
||
1756 | 1756 | } |
1757 | 1757 | |
1758 | 1758 | if ($multi_display == 'select') { |
1759 | - $select_options .= '<option value="' . esc_attr($option_value) . '" ' . $selected . '>' . $option_label . '</option>'; |
|
1759 | + $select_options .= '<option value="'.esc_attr($option_value).'" '.$selected.'>'.$option_label.'</option>'; |
|
1760 | 1760 | } else { |
1761 | - $select_options .= '<li><input name="' . $name . '[]" ' . $checked . ' value="' . esc_attr($option_value) . '" class="gd-' . $multi_display . '" field_type="' . $multi_display . '" type="' . $multi_display . '" /> ' . $option_label . ' </li>'; |
|
1761 | + $select_options .= '<li><input name="'.$name.'[]" '.$checked.' value="'.esc_attr($option_value).'" class="gd-'.$multi_display.'" field_type="'.$multi_display.'" type="'.$multi_display.'" /> '.$option_label.' </li>'; |
|
1762 | 1762 | } |
1763 | 1763 | } |
1764 | 1764 | } |
@@ -1777,7 +1777,7 @@ discard block |
||
1777 | 1777 | ?> |
1778 | 1778 | |
1779 | 1779 | <div id="<?php echo $name; ?>_row" |
1780 | - class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix <?php echo $fieldset_field_class;?>"> |
|
1780 | + class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix <?php echo $fieldset_field_class; ?>"> |
|
1781 | 1781 | <label> |
1782 | 1782 | <?php $site_title = __($site_title, 'geodirectory'); |
1783 | 1783 | echo (trim($site_title)) ? $site_title : ' '; ?> |
@@ -1807,8 +1807,8 @@ discard block |
||
1807 | 1807 | |
1808 | 1808 | $date_format = str_replace($search, $replace, $extra_fields['date_format']); |
1809 | 1809 | |
1810 | - if($value=='0000-00-00'){$value='';}//if date not set, then mark it empty |
|
1811 | - if($value && !isset($_REQUEST['backandedit'])) { |
|
1810 | + if ($value == '0000-00-00') {$value = ''; }//if date not set, then mark it empty |
|
1811 | + if ($value && !isset($_REQUEST['backandedit'])) { |
|
1812 | 1812 | $time = strtotime($value); |
1813 | 1813 | $value = date($date_format, $time); |
1814 | 1814 | } |
@@ -1818,37 +1818,37 @@ discard block |
||
1818 | 1818 | |
1819 | 1819 | jQuery(function () { |
1820 | 1820 | |
1821 | - jQuery("#<?php echo $name;?>").datepicker({changeMonth: true, changeYear: true <?php |
|
1821 | + jQuery("#<?php echo $name; ?>").datepicker({changeMonth: true, changeYear: true <?php |
|
1822 | 1822 | /** |
1823 | 1823 | * Used to add extra option to datepicker per custom field. |
1824 | 1824 | * |
1825 | 1825 | * @since 1.5.7 |
1826 | 1826 | * @param string $name The custom field name. |
1827 | 1827 | */ |
1828 | - echo apply_filters("gd_datepicker_extra_{$name}",'');?>}); |
|
1828 | + echo apply_filters("gd_datepicker_extra_{$name}", ''); ?>}); |
|
1829 | 1829 | |
1830 | - jQuery("#<?php echo $name;?>").datepicker("option", "dateFormat", '<?php echo $extra_fields['date_format'];?>'); |
|
1830 | + jQuery("#<?php echo $name; ?>").datepicker("option", "dateFormat", '<?php echo $extra_fields['date_format']; ?>'); |
|
1831 | 1831 | |
1832 | - <?php if(!empty($value)){?> |
|
1833 | - jQuery("#<?php echo $name;?>").datepicker("setDate", "<?php echo $value;?>"); |
|
1832 | + <?php if (!empty($value)) {?> |
|
1833 | + jQuery("#<?php echo $name; ?>").datepicker("setDate", "<?php echo $value; ?>"); |
|
1834 | 1834 | <?php } ?> |
1835 | 1835 | |
1836 | 1836 | }); |
1837 | 1837 | |
1838 | 1838 | </script> |
1839 | - <div id="<?php echo $name;?>_row" |
|
1840 | - class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix <?php echo $fieldset_field_class;?>"> |
|
1839 | + <div id="<?php echo $name; ?>_row" |
|
1840 | + class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix <?php echo $fieldset_field_class; ?>"> |
|
1841 | 1841 | <label> |
1842 | 1842 | |
1843 | 1843 | <?php $site_title = __($site_title, 'geodirectory'); |
1844 | 1844 | echo (trim($site_title)) ? $site_title : ' '; ?> |
1845 | - <?php if ($is_required) echo '<span>*</span>';?> |
|
1845 | + <?php if ($is_required) echo '<span>*</span>'; ?> |
|
1846 | 1846 | </label> |
1847 | 1847 | |
1848 | - <input field_type="<?php echo $type;?>" name="<?php echo $name;?>" id="<?php echo $name;?>" |
|
1849 | - value="<?php echo esc_attr($value);?>" type="text" class="geodir_textfield"/> |
|
1848 | + <input field_type="<?php echo $type; ?>" name="<?php echo $name; ?>" id="<?php echo $name; ?>" |
|
1849 | + value="<?php echo esc_attr($value); ?>" type="text" class="geodir_textfield"/> |
|
1850 | 1850 | |
1851 | - <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory');?></span> |
|
1851 | + <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory'); ?></span> |
|
1852 | 1852 | <?php if ($is_required) { ?> |
1853 | 1853 | <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span> |
1854 | 1854 | <?php } ?> |
@@ -1862,25 +1862,25 @@ discard block |
||
1862 | 1862 | <script type="text/javascript"> |
1863 | 1863 | jQuery(document).ready(function () { |
1864 | 1864 | |
1865 | - jQuery('#<?php echo $name;?>').timepicker({ |
|
1865 | + jQuery('#<?php echo $name; ?>').timepicker({ |
|
1866 | 1866 | showPeriod: true, |
1867 | 1867 | showLeadingZero: true, |
1868 | 1868 | showPeriod: true, |
1869 | 1869 | }); |
1870 | 1870 | }); |
1871 | 1871 | </script> |
1872 | - <div id="<?php echo $name;?>_row" |
|
1873 | - class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix <?php echo $fieldset_field_class;?>"> |
|
1872 | + <div id="<?php echo $name; ?>_row" |
|
1873 | + class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix <?php echo $fieldset_field_class; ?>"> |
|
1874 | 1874 | <label> |
1875 | 1875 | |
1876 | 1876 | <?php $site_title = __($site_title, 'geodirectory'); |
1877 | 1877 | echo (trim($site_title)) ? $site_title : ' '; ?> |
1878 | - <?php if ($is_required) echo '<span>*</span>';?> |
|
1878 | + <?php if ($is_required) echo '<span>*</span>'; ?> |
|
1879 | 1879 | </label> |
1880 | - <input readonly="readonly" field_type="<?php echo $type;?>" name="<?php echo $name;?>" |
|
1881 | - id="<?php echo $name;?>" value="<?php echo esc_attr($value);?>" type="text" class="geodir_textfield"/> |
|
1880 | + <input readonly="readonly" field_type="<?php echo $type; ?>" name="<?php echo $name; ?>" |
|
1881 | + id="<?php echo $name; ?>" value="<?php echo esc_attr($value); ?>" type="text" class="geodir_textfield"/> |
|
1882 | 1882 | |
1883 | - <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory');?></span> |
|
1883 | + <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory'); ?></span> |
|
1884 | 1884 | <?php if ($is_required) { ?> |
1885 | 1885 | <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span> |
1886 | 1886 | <?php } ?> |
@@ -1890,15 +1890,15 @@ discard block |
||
1890 | 1890 | if ($value == $val['default']) { |
1891 | 1891 | $value = ''; |
1892 | 1892 | } ?> |
1893 | - <div id="<?php echo $name;?>_row" |
|
1894 | - class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix <?php echo $fieldset_field_class;?>"> |
|
1893 | + <div id="<?php echo $name; ?>_row" |
|
1894 | + class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix <?php echo $fieldset_field_class; ?>"> |
|
1895 | 1895 | <label> |
1896 | 1896 | <?php $site_title = __($site_title, 'geodirectory'); |
1897 | 1897 | echo (trim($site_title)) ? $site_title : ' '; ?> |
1898 | - <?php if ($is_required) echo '<span>*</span>';?> |
|
1898 | + <?php if ($is_required) echo '<span>*</span>'; ?> |
|
1899 | 1899 | </label> |
1900 | 1900 | |
1901 | - <div id="<?php echo $name;?>" class="geodir_taxonomy_field" style="float:left; width:70%;"> |
|
1901 | + <div id="<?php echo $name; ?>" class="geodir_taxonomy_field" style="float:left; width:70%;"> |
|
1902 | 1902 | <?php |
1903 | 1903 | global $wpdb, $post, $cat_display, $post_cat, $package_id, $exclude_cats; |
1904 | 1904 | |
@@ -1910,7 +1910,7 @@ discard block |
||
1910 | 1910 | |
1911 | 1911 | $package_info = array(); |
1912 | 1912 | |
1913 | - $package_info = (array)geodir_post_package_info($package_info, $post, $post_type); |
|
1913 | + $package_info = (array) geodir_post_package_info($package_info, $post, $post_type); |
|
1914 | 1914 | |
1915 | 1915 | if (!empty($package_info)) { |
1916 | 1916 | |
@@ -1939,7 +1939,7 @@ discard block |
||
1939 | 1939 | |
1940 | 1940 | $catadd_limit = $wpdb->get_var( |
1941 | 1941 | $wpdb->prepare( |
1942 | - "SELECT cat_limit FROM " . GEODIR_PRICE_TABLE . " WHERE pid = %d", |
|
1942 | + "SELECT cat_limit FROM ".GEODIR_PRICE_TABLE." WHERE pid = %d", |
|
1943 | 1943 | array($package_id) |
1944 | 1944 | ) |
1945 | 1945 | ); |
@@ -1955,13 +1955,13 @@ discard block |
||
1955 | 1955 | $required_limit_msg = ''; |
1956 | 1956 | if ($catadd_limit > 0 && $cat_display != 'select' && $cat_display != 'radio') { |
1957 | 1957 | |
1958 | - $required_limit_msg = __('Only select', 'geodirectory') . ' ' . $catadd_limit . __(' categories for this package.', 'geodirectory'); |
|
1958 | + $required_limit_msg = __('Only select', 'geodirectory').' '.$catadd_limit.__(' categories for this package.', 'geodirectory'); |
|
1959 | 1959 | |
1960 | 1960 | } else { |
1961 | 1961 | $required_limit_msg = $required_msg; |
1962 | 1962 | } |
1963 | 1963 | |
1964 | - echo '<input type="hidden" cat_limit="' . $catadd_limit . '" id="cat_limit" value="' . esc_attr($required_limit_msg) . '" name="cat_limit[' . $name . ']" />'; |
|
1964 | + echo '<input type="hidden" cat_limit="'.$catadd_limit.'" id="cat_limit" value="'.esc_attr($required_limit_msg).'" name="cat_limit['.$name.']" />'; |
|
1965 | 1965 | |
1966 | 1966 | |
1967 | 1967 | if ($cat_display == 'select' || $cat_display == 'multiselect') { |
@@ -1971,11 +1971,11 @@ discard block |
||
1971 | 1971 | if ($cat_display == 'multiselect') |
1972 | 1972 | $multiple = 'multiple="multiple"'; |
1973 | 1973 | |
1974 | - echo '<select id="' . $name . '" ' . $multiple . ' type="' . $name . '" name="post_category[' . $name . '][]" alt="' . $name . '" field_type="' . $cat_display . '" class="geodir_textfield textfield_x chosen_select" data-placeholder="' . __('Select Category', 'geodirectory') . '">'; |
|
1974 | + echo '<select id="'.$name.'" '.$multiple.' type="'.$name.'" name="post_category['.$name.'][]" alt="'.$name.'" field_type="'.$cat_display.'" class="geodir_textfield textfield_x chosen_select" data-placeholder="'.__('Select Category', 'geodirectory').'">'; |
|
1975 | 1975 | |
1976 | 1976 | |
1977 | 1977 | if ($cat_display == 'select') |
1978 | - echo '<option value="">' . __('Select Category', 'geodirectory') . '</option>'; |
|
1978 | + echo '<option value="">'.__('Select Category', 'geodirectory').'</option>'; |
|
1979 | 1979 | |
1980 | 1980 | } |
1981 | 1981 | |
@@ -1993,7 +1993,7 @@ discard block |
||
1993 | 1993 | ?> |
1994 | 1994 | </div> |
1995 | 1995 | |
1996 | - <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory');?></span> |
|
1996 | + <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory'); ?></span> |
|
1997 | 1997 | <?php if ($is_required) { ?> |
1998 | 1998 | <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span> |
1999 | 1999 | <?php } ?> |
@@ -2035,8 +2035,8 @@ discard block |
||
2035 | 2035 | $file_totImg = count($curImages); |
2036 | 2036 | } |
2037 | 2037 | |
2038 | - $allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types'] ) ? implode(",", $extra_fields['gd_file_types']) : ''; |
|
2039 | - $display_file_types = $allowed_file_types != '' ? '.' . implode(", .", $extra_fields['gd_file_types']) : ''; |
|
2038 | + $allowed_file_types = !empty($extra_fields['gd_file_types']) && is_array($extra_fields['gd_file_types']) && !in_array("*", $extra_fields['gd_file_types']) ? implode(",", $extra_fields['gd_file_types']) : ''; |
|
2039 | + $display_file_types = $allowed_file_types != '' ? '.'.implode(", .", $extra_fields['gd_file_types']) : ''; |
|
2040 | 2040 | |
2041 | 2041 | ?> |
2042 | 2042 | <?php /*?> <h5 class="geodir-form_title"> <?php echo $site_title; ?> |
@@ -2046,13 +2046,13 @@ discard block |
||
2046 | 2046 | </h5> <?php */ |
2047 | 2047 | ?> |
2048 | 2048 | |
2049 | - <div id="<?php echo $name;?>_row" |
|
2050 | - class="<?php if ($is_required) echo 'required_field';?> geodir_form_row clearfix <?php echo $fieldset_field_class;?>"> |
|
2049 | + <div id="<?php echo $name; ?>_row" |
|
2050 | + class="<?php if ($is_required) echo 'required_field'; ?> geodir_form_row clearfix <?php echo $fieldset_field_class; ?>"> |
|
2051 | 2051 | |
2052 | 2052 | <div id="<?php echo $file_id; ?>dropbox" style="text-align:center;"> |
2053 | 2053 | <label |
2054 | 2054 | style="text-align:left; padding-top:10px;"><?php $site_title = __($site_title, 'geodirectory'); |
2055 | - echo $site_title; ?><?php if ($is_required) echo '<span>*</span>';?></label> |
|
2055 | + echo $site_title; ?><?php if ($is_required) echo '<span>*</span>'; ?></label> |
|
2056 | 2056 | <input class="geodir-custom-file-upload" field_type="file" type="hidden" |
2057 | 2057 | name="<?php echo $file_id; ?>" id="<?php echo $file_id; ?>" |
2058 | 2058 | value="<?php echo esc_attr($file_value); ?>"/> |
@@ -2060,7 +2060,7 @@ discard block |
||
2060 | 2060 | id="<?php echo $file_id; ?>image_limit" value="<?php echo $file_image_limit; ?>"/> |
2061 | 2061 | <?php if ($allowed_file_types != '') { ?> |
2062 | 2062 | <input type="hidden" name="<?php echo $file_id; ?>_allowed_types" |
2063 | - id="<?php echo $file_id; ?>_allowed_types" value="<?php echo esc_attr($allowed_file_types); ?>" data-exts="<?php echo esc_attr($display_file_types);?>"/> |
|
2063 | + id="<?php echo $file_id; ?>_allowed_types" value="<?php echo esc_attr($allowed_file_types); ?>" data-exts="<?php echo esc_attr($display_file_types); ?>"/> |
|
2064 | 2064 | <?php } ?> |
2065 | 2065 | <input type="hidden" name="<?php echo $file_id; ?>totImg" id="<?php echo $file_id; ?>totImg" |
2066 | 2066 | value="<?php if (isset($file_totImg)) { |
@@ -2076,10 +2076,10 @@ discard block |
||
2076 | 2076 | <?php /*?><h4><?php _e('Drop files to upload');?></h4><br/><?php */ |
2077 | 2077 | ?> |
2078 | 2078 | <input id="<?php echo $file_id; ?>plupload-browse-button" type="button" |
2079 | - value="<?php ($file_image_limit > 1 ? esc_attr_e('Select Files', 'geodirectory') : esc_attr_e('Select File', 'geodirectory') ); ?>" |
|
2079 | + value="<?php ($file_image_limit > 1 ? esc_attr_e('Select Files', 'geodirectory') : esc_attr_e('Select File', 'geodirectory')); ?>" |
|
2080 | 2080 | class="geodir_button" style="margin-top:10px;"/> |
2081 | 2081 | <span class="ajaxnonceplu" |
2082 | - id="ajaxnonceplu<?php echo wp_create_nonce($file_id . 'pluploadan'); ?>"></span> |
|
2082 | + id="ajaxnonceplu<?php echo wp_create_nonce($file_id.'pluploadan'); ?>"></span> |
|
2083 | 2083 | <?php if ($file_width && $file_height): ?> |
2084 | 2084 | <span class="plupload-resize"></span> |
2085 | 2085 | <span class="plupload-width" id="plupload-width<?php echo $file_width; ?>"></span> |
@@ -2099,7 +2099,7 @@ discard block |
||
2099 | 2099 | |
2100 | 2100 | </div> |
2101 | 2101 | </div> |
2102 | - <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory');?> <?php echo ( $display_file_types != '' ? __('Allowed file types:', 'geodirectory') . ' ' . $display_file_types : '' );?></span> |
|
2102 | + <span class="geodir_message_note"><?php _e($admin_desc, 'geodirectory'); ?> <?php echo ($display_file_types != '' ? __('Allowed file types:', 'geodirectory').' '.$display_file_types : ''); ?></span> |
|
2103 | 2103 | <?php if ($is_required) { ?> |
2104 | 2104 | <span class="geodir_message_error"><?php _e($required_msg, 'geodirectory'); ?></span> |
2105 | 2105 | <?php } ?> |
@@ -2118,7 +2118,7 @@ discard block |
||
2118 | 2118 | * @param array $val The settings array for the field. {@see geodir_custom_field_save()}. |
2119 | 2119 | * @see 'geodir_before_custom_form_field_$name' |
2120 | 2120 | */ |
2121 | - do_action('geodir_after_custom_form_field_' . $name, $listing_type, $package_id, $val); |
|
2121 | + do_action('geodir_after_custom_form_field_'.$name, $listing_type, $package_id, $val); |
|
2122 | 2122 | |
2123 | 2123 | } |
2124 | 2124 | |
@@ -2144,7 +2144,7 @@ discard block |
||
2144 | 2144 | |
2145 | 2145 | $filter = $wpdb->get_row( |
2146 | 2146 | $wpdb->prepare( |
2147 | - "SELECT * FROM " . GEODIR_CUSTOM_FIELDS_TABLE . " WHERE post_type=%s AND " . $key . "='" . $value . "'", |
|
2147 | + "SELECT * FROM ".GEODIR_CUSTOM_FIELDS_TABLE." WHERE post_type=%s AND ".$key."='".$value."'", |
|
2148 | 2148 | array($geodir_post_type) |
2149 | 2149 | ) |
2150 | 2150 | ); |
@@ -2206,7 +2206,7 @@ discard block |
||
2206 | 2206 | |
2207 | 2207 | $variables_array = array(); |
2208 | 2208 | |
2209 | - if ($fields_location == 'detail' && isset($type['show_as_tab']) && (int)$type['show_as_tab'] == 1 && in_array($type['type'], array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file'))) { |
|
2209 | + if ($fields_location == 'detail' && isset($type['show_as_tab']) && (int) $type['show_as_tab'] == 1 && in_array($type['type'], array('text', 'datepicker', 'textarea', 'time', 'phone', 'email', 'select', 'multiselect', 'url', 'html', 'fieldset', 'radio', 'checkbox', 'file'))) { |
|
2210 | 2210 | continue; |
2211 | 2211 | } |
2212 | 2212 | |
@@ -2221,9 +2221,9 @@ discard block |
||
2221 | 2221 | //if($type['field_icon']) |
2222 | 2222 | |
2223 | 2223 | if (strpos($type['field_icon'], 'http') !== false) { |
2224 | - $field_icon = ' background: url(' . $type['field_icon'] . ') no-repeat left center;background-size:18px 18px;padding-left: 21px;'; |
|
2224 | + $field_icon = ' background: url('.$type['field_icon'].') no-repeat left center;background-size:18px 18px;padding-left: 21px;'; |
|
2225 | 2225 | } elseif (strpos($type['field_icon'], 'fa fa-') !== false) { |
2226 | - $field_icon = '<i class="' . $type['field_icon'] . '"></i>'; |
|
2226 | + $field_icon = '<i class="'.$type['field_icon'].'"></i>'; |
|
2227 | 2227 | } |
2228 | 2228 | //else{$field_icon = $type['field_icon'];} |
2229 | 2229 | |
@@ -2235,9 +2235,9 @@ discard block |
||
2235 | 2235 | $fieldset_class = 'fieldset-'.sanitize_title_with_dashes($type['site_title']); |
2236 | 2236 | |
2237 | 2237 | if ($field_set_start == 1) { |
2238 | - echo '</div><div class="geodir-company_info field-group ' . $type['htmlvar_name'] . '"><h2 class="'.$fieldset_class.'">' . __($type['site_title'], 'geodirectory') . '</h2>'; |
|
2238 | + echo '</div><div class="geodir-company_info field-group '.$type['htmlvar_name'].'"><h2 class="'.$fieldset_class.'">'.__($type['site_title'], 'geodirectory').'</h2>'; |
|
2239 | 2239 | } else { |
2240 | - echo '<h2 class="'.$fieldset_class.'">' . __($type['site_title'], 'geodirectory') . '</h2>'; |
|
2240 | + echo '<h2 class="'.$fieldset_class.'">'.__($type['site_title'], 'geodirectory').'</h2>'; |
|
2241 | 2241 | $field_set_start = 1; |
2242 | 2242 | } |
2243 | 2243 | |
@@ -2245,7 +2245,7 @@ discard block |
||
2245 | 2245 | |
2246 | 2246 | case 'address': |
2247 | 2247 | |
2248 | - $html_var = $type['htmlvar_name'] . '_address'; |
|
2248 | + $html_var = $type['htmlvar_name'].'_address'; |
|
2249 | 2249 | |
2250 | 2250 | if ($type['extra_fields']) { |
2251 | 2251 | |
@@ -2261,17 +2261,17 @@ discard block |
||
2261 | 2261 | */ |
2262 | 2262 | $show_city_in_address = apply_filters('geodir_show_city_in_address', false); |
2263 | 2263 | if (isset($extra_fields['show_city']) && $extra_fields['show_city'] && $show_city_in_address) { |
2264 | - $field = $type['htmlvar_name'] . '_city'; |
|
2264 | + $field = $type['htmlvar_name'].'_city'; |
|
2265 | 2265 | if ($post->{$field}) { |
2266 | - $addition_fields .= ', ' . $post->{$field}; |
|
2266 | + $addition_fields .= ', '.$post->{$field}; |
|
2267 | 2267 | } |
2268 | 2268 | } |
2269 | 2269 | |
2270 | 2270 | |
2271 | 2271 | if (isset($extra_fields['show_zip']) && $extra_fields['show_zip']) { |
2272 | - $field = $type['htmlvar_name'] . '_zip'; |
|
2272 | + $field = $type['htmlvar_name'].'_zip'; |
|
2273 | 2273 | if ($post->{$field}) { |
2274 | - $addition_fields .= ', ' . $post->{$field}; |
|
2274 | + $addition_fields .= ', '.$post->{$field}; |
|
2275 | 2275 | } |
2276 | 2276 | } |
2277 | 2277 | |
@@ -2348,28 +2348,28 @@ discard block |
||
2348 | 2348 | $i++; |
2349 | 2349 | } |
2350 | 2350 | |
2351 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;" itemscope itemtype="http://schema.org/PostalAddress">'; |
|
2352 | - $html .= '<span class="geodir-i-location" style="' . $field_icon . '">' . $field_icon_af; |
|
2353 | - $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory') . ': ' : ' '; |
|
2351 | + $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;" itemscope itemtype="http://schema.org/PostalAddress">'; |
|
2352 | + $html .= '<span class="geodir-i-location" style="'.$field_icon.'">'.$field_icon_af; |
|
2353 | + $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory').': ' : ' '; |
|
2354 | 2354 | $html .= '</span>'; |
2355 | 2355 | |
2356 | 2356 | if ($preview) { |
2357 | - $html .= $post->{$html_var} . $addition_fields . '</p></div>'; |
|
2357 | + $html .= $post->{$html_var}.$addition_fields.'</p></div>'; |
|
2358 | 2358 | } else { |
2359 | 2359 | if ($post->post_address) { |
2360 | - $html .= '<span itemprop="streetAddress">' . $post->post_address . '</span><br>'; |
|
2360 | + $html .= '<span itemprop="streetAddress">'.$post->post_address.'</span><br>'; |
|
2361 | 2361 | } |
2362 | 2362 | if ($post->post_city) { |
2363 | - $html .= '<span itemprop="addressLocality">' . $post->post_city . '</span><br>'; |
|
2363 | + $html .= '<span itemprop="addressLocality">'.$post->post_city.'</span><br>'; |
|
2364 | 2364 | } |
2365 | 2365 | if ($post->post_region) { |
2366 | - $html .= '<span itemprop="addressRegion">' . $post->post_region . '</span><br>'; |
|
2366 | + $html .= '<span itemprop="addressRegion">'.$post->post_region.'</span><br>'; |
|
2367 | 2367 | } |
2368 | 2368 | if ($post->post_zip) { |
2369 | - $html .= '<span itemprop="postalCode">' . $post->post_zip . '</span><br>'; |
|
2369 | + $html .= '<span itemprop="postalCode">'.$post->post_zip.'</span><br>'; |
|
2370 | 2370 | } |
2371 | 2371 | if ($post->post_country) { |
2372 | - $html .= '<span itemprop="addressCountry">' . __($post->post_country, 'geodirectory') . '</span><br>'; |
|
2372 | + $html .= '<span itemprop="addressCountry">'.__($post->post_country, 'geodirectory').'</span><br>'; |
|
2373 | 2373 | } |
2374 | 2374 | $html .= '</div>'; |
2375 | 2375 | } |
@@ -2409,7 +2409,7 @@ discard block |
||
2409 | 2409 | |
2410 | 2410 | $website = !empty($a_url['url']) ? $a_url['url'] : ''; |
2411 | 2411 | $title = !empty($a_url['label']) ? $a_url['label'] : $type['site_title']; |
2412 | - if(!empty($type['default_value'])){$title = $type['default_value'];} |
|
2412 | + if (!empty($type['default_value'])) {$title = $type['default_value']; } |
|
2413 | 2413 | $title = $title != '' ? __(stripslashes($title), 'geodirectory') : ''; |
2414 | 2414 | |
2415 | 2415 | |
@@ -2435,7 +2435,7 @@ discard block |
||
2435 | 2435 | * @param string $website Website URL. |
2436 | 2436 | * @param int $post->ID Post ID. |
2437 | 2437 | */ |
2438 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '"><span class="geodir-i-website" style="' . $field_icon . '">' . $field_icon_af . '<a href="' . $website . '" target="_blank" ' . $rel . ' ><strong>' . apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID) . '</strong></a></span></div>'; |
|
2438 | + $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'"><span class="geodir-i-website" style="'.$field_icon.'">'.$field_icon_af.'<a href="'.$website.'" target="_blank" '.$rel.' ><strong>'.apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID).'</strong></a></span></div>'; |
|
2439 | 2439 | |
2440 | 2440 | endif; |
2441 | 2441 | |
@@ -2466,9 +2466,9 @@ discard block |
||
2466 | 2466 | $i++; |
2467 | 2467 | } |
2468 | 2468 | |
2469 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-contact" style="' . $field_icon . '">' . $field_icon_af . |
|
2470 | - $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory') . ': ' : ' '; |
|
2471 | - $html .= '</span><a href="tel:' . preg_replace('/[^0-9+]/', '', $post->{$type['htmlvar_name']}) . '">' . $post->{$type['htmlvar_name']} . '</a></div>'; |
|
2469 | + $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-contact" style="'.$field_icon.'">'.$field_icon_af. |
|
2470 | + $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory').': ' : ' '; |
|
2471 | + $html .= '</span><a href="tel:'.preg_replace('/[^0-9+]/', '', $post->{$type['htmlvar_name']}).'">'.$post->{$type['htmlvar_name']}.'</a></div>'; |
|
2472 | 2472 | |
2473 | 2473 | endif; |
2474 | 2474 | |
@@ -2504,9 +2504,9 @@ discard block |
||
2504 | 2504 | $i++; |
2505 | 2505 | } |
2506 | 2506 | |
2507 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-time" style="' . $field_icon . '">' . $field_icon_af; |
|
2508 | - $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory') . ': ' : ' '; |
|
2509 | - $html .= '</span>' . $value . '</div>'; |
|
2507 | + $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-time" style="'.$field_icon.'">'.$field_icon_af; |
|
2508 | + $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory').': ' : ' '; |
|
2509 | + $html .= '</span>'.$value.'</div>'; |
|
2510 | 2510 | |
2511 | 2511 | endif; |
2512 | 2512 | |
@@ -2522,17 +2522,17 @@ discard block |
||
2522 | 2522 | $date_format = $date_format['date_format']; |
2523 | 2523 | } |
2524 | 2524 | |
2525 | - $search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format |
|
2526 | - $replace = array('d','j','l','m','n','F','Y');//PHP date format |
|
2525 | + $search = array('dd', 'd', 'DD', 'mm', 'm', 'MM', 'yy'); //jQuery UI datepicker format |
|
2526 | + $replace = array('d', 'j', 'l', 'm', 'n', 'F', 'Y'); //PHP date format |
|
2527 | 2527 | |
2528 | 2528 | $date_format = str_replace($search, $replace, $date_format); |
2529 | 2529 | |
2530 | 2530 | $post_htmlvar_value = $date_format == 'd/m/Y' ? str_replace('/', '-', $post->{$type['htmlvar_name']}) : $post->{$type['htmlvar_name']}; // PHP doesn't work well with dd/mm/yyyy format |
2531 | 2531 | |
2532 | 2532 | $value = ''; |
2533 | - if ($post->{$type['htmlvar_name']} != '' && $post->{$type['htmlvar_name']}!="0000-00-00") { |
|
2533 | + if ($post->{$type['htmlvar_name']} != '' && $post->{$type['htmlvar_name']} != "0000-00-00") { |
|
2534 | 2534 | $value = date($date_format, strtotime($post_htmlvar_value)); |
2535 | - }else{ |
|
2535 | + } else { |
|
2536 | 2536 | continue; |
2537 | 2537 | } |
2538 | 2538 | |
@@ -2555,9 +2555,9 @@ discard block |
||
2555 | 2555 | $i++; |
2556 | 2556 | } |
2557 | 2557 | |
2558 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-datepicker" style="' . $field_icon . '">' . $field_icon_af; |
|
2559 | - $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory') . ': ' : ''; |
|
2560 | - $html .= '</span>' . $value . '</div>'; |
|
2558 | + $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-datepicker" style="'.$field_icon.'">'.$field_icon_af; |
|
2559 | + $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory').': ' : ''; |
|
2560 | + $html .= '</span>'.$value.'</div>'; |
|
2561 | 2561 | |
2562 | 2562 | endif; |
2563 | 2563 | |
@@ -2588,9 +2588,9 @@ discard block |
||
2588 | 2588 | $i++; |
2589 | 2589 | } |
2590 | 2590 | |
2591 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-time" style="' . $field_icon . '">' . $field_icon_af; |
|
2592 | - $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory') . ': ' : ' '; |
|
2593 | - $html .= '</span>' . $post->{$type['htmlvar_name']} . '</div>'; |
|
2591 | + $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-time" style="'.$field_icon.'">'.$field_icon_af; |
|
2592 | + $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory').': ' : ' '; |
|
2593 | + $html .= '</span>'.$post->{$type['htmlvar_name']}.'</div>'; |
|
2594 | 2594 | |
2595 | 2595 | elseif (isset($post->{$type['htmlvar_name']}) && $post->{$type['htmlvar_name']}): |
2596 | 2596 | |
@@ -2613,9 +2613,9 @@ discard block |
||
2613 | 2613 | $i++; |
2614 | 2614 | } |
2615 | 2615 | |
2616 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af; |
|
2617 | - $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory') . ': ' : ''; |
|
2618 | - $html .= '</span>' . $post->{$type['htmlvar_name']} . '</div>'; |
|
2616 | + $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-text" style="'.$field_icon.'">'.$field_icon_af; |
|
2617 | + $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory').': ' : ''; |
|
2618 | + $html .= '</span>'.$post->{$type['htmlvar_name']}.'</div>'; |
|
2619 | 2619 | |
2620 | 2620 | endif; |
2621 | 2621 | |
@@ -2624,7 +2624,7 @@ discard block |
||
2624 | 2624 | case 'radio': |
2625 | 2625 | |
2626 | 2626 | $html_var = $type['htmlvar_name']; |
2627 | - if(!isset($post->{$type['htmlvar_name']})){continue;} |
|
2627 | + if (!isset($post->{$type['htmlvar_name']})) {continue; } |
|
2628 | 2628 | $html_val = __($post->{$type['htmlvar_name']}, 'geodirectory'); |
2629 | 2629 | if ($post->{$type['htmlvar_name']} != ''): |
2630 | 2630 | |
@@ -2665,9 +2665,9 @@ discard block |
||
2665 | 2665 | $i++; |
2666 | 2666 | } |
2667 | 2667 | |
2668 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-radio" style="' . $field_icon . '">' . $field_icon_af; |
|
2669 | - $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory') . ': ' : ''; |
|
2670 | - $html .= '</span>' . $html_val . '</div>'; |
|
2668 | + $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-radio" style="'.$field_icon.'">'.$field_icon_af; |
|
2669 | + $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory').': ' : ''; |
|
2670 | + $html .= '</span>'.$html_val.'</div>'; |
|
2671 | 2671 | endif; |
2672 | 2672 | |
2673 | 2673 | break; |
@@ -2676,7 +2676,7 @@ discard block |
||
2676 | 2676 | |
2677 | 2677 | $html_var = $type['htmlvar_name']; |
2678 | 2678 | |
2679 | - if ((int)$post->{$html_var} == 1): |
|
2679 | + if ((int) $post->{$html_var} == 1): |
|
2680 | 2680 | |
2681 | 2681 | if ($post->{$type['htmlvar_name']} == '1'): |
2682 | 2682 | $html_val = __('Yes', 'geodirectory'); |
@@ -2703,9 +2703,9 @@ discard block |
||
2703 | 2703 | $i++; |
2704 | 2704 | } |
2705 | 2705 | |
2706 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-checkbox" style="' . $field_icon . '">' . $field_icon_af; |
|
2707 | - $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory') . ': ' : ''; |
|
2708 | - $html .= '</span>' . $html_val . '</div>'; |
|
2706 | + $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-checkbox" style="'.$field_icon.'">'.$field_icon_af; |
|
2707 | + $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory').': ' : ''; |
|
2708 | + $html .= '</span>'.$html_val.'</div>'; |
|
2709 | 2709 | endif; |
2710 | 2710 | |
2711 | 2711 | break; |
@@ -2713,7 +2713,7 @@ discard block |
||
2713 | 2713 | case 'select': |
2714 | 2714 | |
2715 | 2715 | $html_var = $type['htmlvar_name']; |
2716 | - if(!isset($post->{$type['htmlvar_name']})){continue;} |
|
2716 | + if (!isset($post->{$type['htmlvar_name']})) {continue; } |
|
2717 | 2717 | if ($post->{$type['htmlvar_name']}): |
2718 | 2718 | $field_value = __($post->{$type['htmlvar_name']}, 'geodirectory'); |
2719 | 2719 | |
@@ -2748,9 +2748,9 @@ discard block |
||
2748 | 2748 | $i++; |
2749 | 2749 | } |
2750 | 2750 | |
2751 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af; |
|
2752 | - $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory') . ': ' : ''; |
|
2753 | - $html .= '</span>' . $field_value . '</div>'; |
|
2751 | + $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-select" style="'.$field_icon.'">'.$field_icon_af; |
|
2752 | + $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory').': ' : ''; |
|
2753 | + $html .= '</span>'.$field_value.'</div>'; |
|
2754 | 2754 | endif; |
2755 | 2755 | |
2756 | 2756 | break; |
@@ -2800,15 +2800,15 @@ discard block |
||
2800 | 2800 | $i++; |
2801 | 2801 | } |
2802 | 2802 | |
2803 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af; |
|
2804 | - $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory') . ': ' : ''; |
|
2803 | + $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-select" style="'.$field_icon.'">'.$field_icon_af; |
|
2804 | + $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory').': ' : ''; |
|
2805 | 2805 | $html .= '</span>'; |
2806 | 2806 | |
2807 | 2807 | if (count($option_values) > 1) { |
2808 | 2808 | $html .= '<ul>'; |
2809 | 2809 | |
2810 | 2810 | foreach ($option_values as $val) { |
2811 | - $html .= '<li>' . $val . '</li>'; |
|
2811 | + $html .= '<li>'.$val.'</li>'; |
|
2812 | 2812 | } |
2813 | 2813 | |
2814 | 2814 | $html .= '</ul>'; |
@@ -2834,7 +2834,7 @@ discard block |
||
2834 | 2834 | if (!$preview) { |
2835 | 2835 | $b_send_inquiry = 'b_send_inquiry'; |
2836 | 2836 | $b_sendtofriend = 'b_sendtofriend'; |
2837 | - $html = '<input type="hidden" name="geodir_popup_post_id" value="' . $post->ID . '" /><div class="geodir_display_popup_forms"></div>'; |
|
2837 | + $html = '<input type="hidden" name="geodir_popup_post_id" value="'.$post->ID.'" /><div class="geodir_display_popup_forms"></div>'; |
|
2838 | 2838 | } |
2839 | 2839 | |
2840 | 2840 | if (strpos($field_icon, 'http') !== false) { |
@@ -2856,26 +2856,26 @@ discard block |
||
2856 | 2856 | $i++; |
2857 | 2857 | } |
2858 | 2858 | |
2859 | - $html .= '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af; |
|
2859 | + $html .= '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'"><span class="geodir-i-email" style="'.$field_icon.'">'.$field_icon_af; |
|
2860 | 2860 | $seperator = ''; |
2861 | 2861 | if ($post->{$type['htmlvar_name']}) { |
2862 | - $html .= '<a href="javascript:void(0);" class="' . $b_send_inquiry . '" >' . SEND_INQUIRY . '</a>'; |
|
2862 | + $html .= '<a href="javascript:void(0);" class="'.$b_send_inquiry.'" >'.SEND_INQUIRY.'</a>'; |
|
2863 | 2863 | $seperator = ' | '; |
2864 | 2864 | } |
2865 | 2865 | |
2866 | 2866 | if (isset($package_info->sendtofriend) && $package_info->sendtofriend) { |
2867 | - $html .= $seperator . '<a href="javascript:void(0);" class="' . $b_sendtofriend . '">' . SEND_TO_FRIEND . '</a>'; |
|
2867 | + $html .= $seperator.'<a href="javascript:void(0);" class="'.$b_sendtofriend.'">'.SEND_TO_FRIEND.'</a>'; |
|
2868 | 2868 | } |
2869 | 2869 | |
2870 | 2870 | $html .= '</span></div>'; |
2871 | 2871 | |
2872 | 2872 | |
2873 | 2873 | if (isset($_REQUEST['send_inquiry']) && $_REQUEST['send_inquiry'] == 'success') { |
2874 | - $html .= '<p class="sucess_msg">' . SEND_INQUIRY_SUCCESS . '</p>'; |
|
2874 | + $html .= '<p class="sucess_msg">'.SEND_INQUIRY_SUCCESS.'</p>'; |
|
2875 | 2875 | } elseif (isset($_REQUEST['sendtofrnd']) && $_REQUEST['sendtofrnd'] == 'success') { |
2876 | - $html .= '<p class="sucess_msg">' . SEND_FRIEND_SUCCESS . '</p>'; |
|
2876 | + $html .= '<p class="sucess_msg">'.SEND_FRIEND_SUCCESS.'</p>'; |
|
2877 | 2877 | } elseif (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 'captch') { |
2878 | - $html .= '<p class="error_msg_fix">' . WRONG_CAPTCH_MSG . '</p>'; |
|
2878 | + $html .= '<p class="error_msg_fix">'.WRONG_CAPTCH_MSG.'</p>'; |
|
2879 | 2879 | } |
2880 | 2880 | |
2881 | 2881 | /*if(!$preview){require_once (geodir_plugin_path().'/geodirectory-templates/popup-forms.php');}*/ |
@@ -2902,11 +2902,11 @@ discard block |
||
2902 | 2902 | $i++; |
2903 | 2903 | } |
2904 | 2904 | |
2905 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af; |
|
2906 | - $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory') . ': ' : ''; |
|
2905 | + $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-email" style="'.$field_icon.'">'.$field_icon_af; |
|
2906 | + $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory').': ' : ''; |
|
2907 | 2907 | $html .= '</span><span class="geodir-email-address-output">'; |
2908 | 2908 | $email = $post->{$type['htmlvar_name']} ; |
2909 | - if($e_split = explode('@',$email)){ |
|
2909 | + if ($e_split = explode('@', $email)) { |
|
2910 | 2910 | /** |
2911 | 2911 | * Filter email custom field name output. |
2912 | 2912 | * |
@@ -2915,10 +2915,10 @@ discard block |
||
2915 | 2915 | * @param string $email The email string being output. |
2916 | 2916 | * @param array $type Custom field variables array. |
2917 | 2917 | */ |
2918 | - $email_name = apply_filters('geodir_email_field_name_output',$email,$type); |
|
2919 | - $html .= "<script>document.write('<a href=\"mailto:'+'$e_split[0]' + '@' + '$e_split[1]'+'\">$email_name</a>')</script>"; |
|
2920 | - }else{ |
|
2921 | - $html .= $email; |
|
2918 | + $email_name = apply_filters('geodir_email_field_name_output', $email, $type); |
|
2919 | + $html .= "<script>document.write('<a href=\"mailto:'+'$e_split[0]' + '@' + '$e_split[1]'+'\">$email_name</a>')</script>"; |
|
2920 | + } else { |
|
2921 | + $html .= $email; |
|
2922 | 2922 | } |
2923 | 2923 | $html .= '</span></div>'; |
2924 | 2924 | } |
@@ -2938,7 +2938,7 @@ discard block |
||
2938 | 2938 | if (!empty($files)): |
2939 | 2939 | |
2940 | 2940 | $extra_fields = !empty($type['extra_fields']) ? maybe_unserialize($type['extra_fields']) : NULL; |
2941 | - $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'] : ''; |
|
2941 | + $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'] : ''; |
|
2942 | 2942 | |
2943 | 2943 | $file_paths = ''; |
2944 | 2944 | foreach ($files as $file) { |
@@ -2975,9 +2975,9 @@ discard block |
||
2975 | 2975 | //$file_paths .= '<img src="'.$file.'" />'; |
2976 | 2976 | $file_paths .= '</div>'; |
2977 | 2977 | } else { |
2978 | - $ext_path = '_' . $html_var . '_'; |
|
2978 | + $ext_path = '_'.$html_var.'_'; |
|
2979 | 2979 | $filename = explode($ext_path, $filename); |
2980 | - $file_paths .= '<a href="' . $file . '" target="_blank">' . $filename[count($filename) - 1] . '</a>'; |
|
2980 | + $file_paths .= '<a href="'.$file.'" target="_blank">'.$filename[count($filename) - 1].'</a>'; |
|
2981 | 2981 | } |
2982 | 2982 | } |
2983 | 2983 | } |
@@ -3001,11 +3001,11 @@ discard block |
||
3001 | 3001 | $i++; |
3002 | 3002 | } |
3003 | 3003 | |
3004 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' geodir-custom-file-box ' . $type['htmlvar_name'] . '"><div class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af; |
|
3004 | + $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' geodir-custom-file-box '.$type['htmlvar_name'].'"><div class="geodir-i-select" style="'.$field_icon.'">'.$field_icon_af; |
|
3005 | 3005 | $html .= '<span style="display: inline-block; vertical-align: top; padding-right: 14px;">'; |
3006 | - $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory') . ': ' : ''; |
|
3006 | + $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory').': ' : ''; |
|
3007 | 3007 | $html .= '</span>'; |
3008 | - $html .= $file_paths . '</div></div>'; |
|
3008 | + $html .= $file_paths.'</div></div>'; |
|
3009 | 3009 | |
3010 | 3010 | endif; |
3011 | 3011 | endif; |
@@ -3036,9 +3036,9 @@ discard block |
||
3036 | 3036 | $i++; |
3037 | 3037 | } |
3038 | 3038 | |
3039 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af; |
|
3040 | - $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory') . ': ' : ''; |
|
3041 | - $html .= '</span>' . wpautop($post->{$type['htmlvar_name']}) . '</div>'; |
|
3039 | + $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-text" style="'.$field_icon.'">'.$field_icon_af; |
|
3040 | + $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory').': ' : ''; |
|
3041 | + $html .= '</span>'.wpautop($post->{$type['htmlvar_name']}).'</div>'; |
|
3042 | 3042 | |
3043 | 3043 | } |
3044 | 3044 | break; |
@@ -3065,16 +3065,16 @@ discard block |
||
3065 | 3065 | $i++; |
3066 | 3066 | } |
3067 | 3067 | |
3068 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af; |
|
3069 | - $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory') . ': ' : ''; |
|
3070 | - $html .= '</span>' . wpautop($post->{$type['htmlvar_name']}) . '</div>'; |
|
3068 | + $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-text" style="'.$field_icon.'">'.$field_icon_af; |
|
3069 | + $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory').': ' : ''; |
|
3070 | + $html .= '</span>'.wpautop($post->{$type['htmlvar_name']}).'</div>'; |
|
3071 | 3071 | |
3072 | 3072 | } |
3073 | 3073 | break; |
3074 | 3074 | case 'taxonomy': { |
3075 | 3075 | $html_var = $type['htmlvar_name']; |
3076 | - if ($html_var == $post->post_type . 'category' && !empty($post->{$html_var})) { |
|
3077 | - $post_taxonomy = $post->post_type . 'category'; |
|
3076 | + if ($html_var == $post->post_type.'category' && !empty($post->{$html_var})) { |
|
3077 | + $post_taxonomy = $post->post_type.'category'; |
|
3078 | 3078 | $field_value = $post->{$html_var}; |
3079 | 3079 | $links = array(); |
3080 | 3080 | $terms = array(); |
@@ -3092,7 +3092,7 @@ discard block |
||
3092 | 3092 | if ($term != '') { |
3093 | 3093 | $term = get_term_by('id', $term, $html_var); |
3094 | 3094 | if (is_object($term)) { |
3095 | - $links[] = "<a href='" . esc_attr(get_term_link($term, $post_taxonomy)) . "'>" . $term->name . "</a>"; |
|
3095 | + $links[] = "<a href='".esc_attr(get_term_link($term, $post_taxonomy))."'>".$term->name."</a>"; |
|
3096 | 3096 | $terms[] = $term; |
3097 | 3097 | } |
3098 | 3098 | } |
@@ -3106,7 +3106,7 @@ discard block |
||
3106 | 3106 | $terms = $termsOrdered; |
3107 | 3107 | } |
3108 | 3108 | } |
3109 | - $html_value = !empty($links) && !empty($terms) ? wp_sprintf('%l', $links, (object)$terms) : ''; |
|
3109 | + $html_value = !empty($links) && !empty($terms) ? wp_sprintf('%l', $links, (object) $terms) : ''; |
|
3110 | 3110 | |
3111 | 3111 | if ($html_value != '') { |
3112 | 3112 | if (strpos($field_icon, 'http') !== false) { |
@@ -3127,9 +3127,9 @@ discard block |
||
3127 | 3127 | $i++; |
3128 | 3128 | } |
3129 | 3129 | |
3130 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $html_var . '" style="clear:both;"><span class="geodir-i-taxonomy geodir-i-category" style="' . $field_icon . '">' . $field_icon_af; |
|
3131 | - $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory') . ': ' : ''; |
|
3132 | - $html .= '</span> ' . $html_value . '</div>'; |
|
3130 | + $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$html_var.'" style="clear:both;"><span class="geodir-i-taxonomy geodir-i-category" style="'.$field_icon.'">'.$field_icon_af; |
|
3131 | + $html .= (trim($type['site_title'])) ? __($type['site_title'], 'geodirectory').': ' : ''; |
|
3132 | + $html .= '</span> '.$html_value.'</div>'; |
|
3133 | 3133 | } |
3134 | 3134 | } |
3135 | 3135 | } |
@@ -3249,7 +3249,7 @@ discard block |
||
3249 | 3249 | |
3250 | 3250 | $post_type = get_post_type($post_id); |
3251 | 3251 | //echo $field_id; exit; |
3252 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
3252 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
3253 | 3253 | |
3254 | 3254 | $postcurr_images = array(); |
3255 | 3255 | $postcurr_images = geodir_get_post_meta($post_id, $field_id, true); |
@@ -3268,13 +3268,13 @@ discard block |
||
3268 | 3268 | $geodir_uploadurl = $uploads['url']; |
3269 | 3269 | $sub_dir = $uploads['subdir']; |
3270 | 3270 | |
3271 | - $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'] : ''; |
|
3271 | + $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'] : ''; |
|
3272 | 3272 | |
3273 | 3273 | for ($m = 0; $m < count($post_image); $m++) { |
3274 | 3274 | |
3275 | 3275 | /* --------- start ------- */ |
3276 | 3276 | |
3277 | - if (!$find_image = $wpdb->get_var($wpdb->prepare("SELECT post_id FROM " . $table . " WHERE $field_id = %s AND post_id = %d", array($post_image[$m], $post_id)))) { |
|
3277 | + if (!$find_image = $wpdb->get_var($wpdb->prepare("SELECT post_id FROM ".$table." WHERE $field_id = %s AND post_id = %d", array($post_image[$m], $post_id)))) { |
|
3278 | 3278 | |
3279 | 3279 | |
3280 | 3280 | $curr_img_url = $post_image[$m]; |
@@ -3300,24 +3300,24 @@ discard block |
||
3300 | 3300 | //$allowed_file_types = array('image/jpg', 'image/jpeg', 'image/gif', 'image/png', 'application/pdf', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'application/octet-stream', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'text/csv', 'text/plain'); |
3301 | 3301 | |
3302 | 3302 | if (!function_exists('wp_handle_upload')) |
3303 | - require_once(ABSPATH . 'wp-admin/includes/file.php'); |
|
3303 | + require_once(ABSPATH.'wp-admin/includes/file.php'); |
|
3304 | 3304 | |
3305 | 3305 | if (!is_dir($geodir_uploadpath)) |
3306 | 3306 | mkdir($geodir_uploadpath); |
3307 | 3307 | |
3308 | - $new_name = $post_id . '_' . $field_id . '_' . $img_name_arr[0] . '.' . $img_name_arr[1]; |
|
3308 | + $new_name = $post_id.'_'.$field_id.'_'.$img_name_arr[0].'.'.$img_name_arr[1]; |
|
3309 | 3309 | $explode_sub_dir = explode("/", $sub_dir); |
3310 | 3310 | if ($curr_img_dir == end($explode_sub_dir)) { |
3311 | - $img_path = $geodir_uploadpath . '/' . $filename; |
|
3312 | - $img_url = $geodir_uploadurl . '/' . $filename; |
|
3311 | + $img_path = $geodir_uploadpath.'/'.$filename; |
|
3312 | + $img_url = $geodir_uploadurl.'/'.$filename; |
|
3313 | 3313 | } else { |
3314 | - $img_path = $uploads_dir . '/temp_' . $current_user->data->ID . '/' . $filename; |
|
3315 | - $img_url = $uploads['url'] . '/temp_' . $current_user->data->ID . '/' . $filename; |
|
3314 | + $img_path = $uploads_dir.'/temp_'.$current_user->data->ID.'/'.$filename; |
|
3315 | + $img_url = $uploads['url'].'/temp_'.$current_user->data->ID.'/'.$filename; |
|
3316 | 3316 | } |
3317 | 3317 | |
3318 | 3318 | $uploaded_file = ''; |
3319 | 3319 | if (file_exists($img_path)) |
3320 | - $uploaded_file = copy($img_path, $geodir_uploadpath . '/' . $new_name); |
|
3320 | + $uploaded_file = copy($img_path, $geodir_uploadpath.'/'.$new_name); |
|
3321 | 3321 | |
3322 | 3322 | if ($curr_img_dir != $geodir_uploaddir) { |
3323 | 3323 | if (file_exists($img_path)) |
@@ -3325,7 +3325,7 @@ discard block |
||
3325 | 3325 | } |
3326 | 3326 | |
3327 | 3327 | if (!empty($uploaded_file)) |
3328 | - $file_urls = $geodir_uploadurl . '/' . $new_name; |
|
3328 | + $file_urls = $geodir_uploadurl.'/'.$new_name; |
|
3329 | 3329 | |
3330 | 3330 | } else { |
3331 | 3331 | $file_urls = $post_image[$m]; |
@@ -3339,8 +3339,8 @@ discard block |
||
3339 | 3339 | if (!empty($postcurr_images)) { |
3340 | 3340 | |
3341 | 3341 | if ($file_urls != $postcurr_images) { |
3342 | - $invalid_files[] = (object)array('src' => $postcurr_images); |
|
3343 | - $invalid_files = (object)$invalid_files; |
|
3342 | + $invalid_files[] = (object) array('src' => $postcurr_images); |
|
3343 | + $invalid_files = (object) $invalid_files; |
|
3344 | 3344 | } |
3345 | 3345 | } |
3346 | 3346 | |
@@ -3392,9 +3392,9 @@ discard block |
||
3392 | 3392 | function geodir_upload_dir($upload) |
3393 | 3393 | { |
3394 | 3394 | global $current_user; |
3395 | - $upload['subdir'] = $upload['subdir'] . '/temp_' . $current_user->data->ID; |
|
3396 | - $upload['path'] = $upload['basedir'] . $upload['subdir']; |
|
3397 | - $upload['url'] = $upload['baseurl'] . $upload['subdir']; |
|
3395 | + $upload['subdir'] = $upload['subdir'].'/temp_'.$current_user->data->ID; |
|
3396 | + $upload['path'] = $upload['basedir'].$upload['subdir']; |
|
3397 | + $upload['url'] = $upload['baseurl'].$upload['subdir']; |
|
3398 | 3398 | return $upload; |
3399 | 3399 | } |
3400 | 3400 | |
@@ -3409,20 +3409,20 @@ discard block |
||
3409 | 3409 | // check ajax noonce |
3410 | 3410 | $imgid = $_POST["imgid"]; |
3411 | 3411 | |
3412 | - check_ajax_referer($imgid . 'pluploadan'); |
|
3412 | + check_ajax_referer($imgid.'pluploadan'); |
|
3413 | 3413 | |
3414 | 3414 | // handle custom file uploaddir |
3415 | 3415 | add_filter('upload_dir', 'geodir_upload_dir'); |
3416 | 3416 | |
3417 | 3417 | // change file orinetation if needed |
3418 | - $fixed_file = geodir_exif($_FILES[$imgid . 'async-upload']); |
|
3418 | + $fixed_file = geodir_exif($_FILES[$imgid.'async-upload']); |
|
3419 | 3419 | |
3420 | 3420 | // handle file upload |
3421 | 3421 | $status = wp_handle_upload($fixed_file, array('test_form' => true, 'action' => 'plupload_action')); |
3422 | 3422 | // remove handle custom file uploaddir |
3423 | 3423 | remove_filter('upload_dir', 'geodir_upload_dir'); |
3424 | 3424 | |
3425 | - if(!isset($status['url']) && isset($status['error'])){ |
|
3425 | + if (!isset($status['url']) && isset($status['error'])) { |
|
3426 | 3426 | print_r($status); |
3427 | 3427 | } |
3428 | 3428 | |
@@ -3452,9 +3452,9 @@ discard block |
||
3452 | 3452 | |
3453 | 3453 | $post_type = get_post_type($post_id); |
3454 | 3454 | |
3455 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
3455 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
3456 | 3456 | |
3457 | - $results = $wpdb->get_results($wpdb->prepare("SELECT geodir_video FROM " . $table . " WHERE post_id=%d", array($post_id))); |
|
3457 | + $results = $wpdb->get_results($wpdb->prepare("SELECT geodir_video FROM ".$table." WHERE post_id=%d", array($post_id))); |
|
3458 | 3458 | |
3459 | 3459 | if ($results) { |
3460 | 3460 | return $results[0]->geodir_video; |
@@ -3478,9 +3478,9 @@ discard block |
||
3478 | 3478 | |
3479 | 3479 | $post_type = get_post_type($post_id); |
3480 | 3480 | |
3481 | - $table = $plugin_prefix . $post_type . '_detail'; |
|
3481 | + $table = $plugin_prefix.$post_type.'_detail'; |
|
3482 | 3482 | |
3483 | - $results = $wpdb->get_results($wpdb->prepare("SELECT geodir_special_offers FROM " . $table . " WHERE post_id=%d", array($post_id))); |
|
3483 | + $results = $wpdb->get_results($wpdb->prepare("SELECT geodir_special_offers FROM ".$table." WHERE post_id=%d", array($post_id))); |
|
3484 | 3484 | |
3485 | 3485 | if ($results) { |
3486 | 3486 | return $results[0]->geodir_special_offers; |
@@ -3498,12 +3498,12 @@ discard block |
||
3498 | 3498 | */ |
3499 | 3499 | function geodir_max_upload_size() |
3500 | 3500 | { |
3501 | - $max_filesize = (float)get_option('geodir_upload_max_filesize', 2); |
|
3501 | + $max_filesize = (float) get_option('geodir_upload_max_filesize', 2); |
|
3502 | 3502 | |
3503 | 3503 | if ($max_filesize > 0 && $max_filesize < 1) { |
3504 | - $max_filesize = (int)($max_filesize * 1024) . 'kb'; |
|
3504 | + $max_filesize = (int) ($max_filesize * 1024).'kb'; |
|
3505 | 3505 | } else { |
3506 | - $max_filesize = $max_filesize > 0 ? $max_filesize . 'mb' : '2mb'; |
|
3506 | + $max_filesize = $max_filesize > 0 ? $max_filesize.'mb' : '2mb'; |
|
3507 | 3507 | } |
3508 | 3508 | /** Filter documented in geodirectory-functions/general_functions.php **/ |
3509 | 3509 | return apply_filters('geodir_default_image_upload_size_limit', $max_filesize); |
@@ -3535,7 +3535,7 @@ discard block |
||
3535 | 3535 | |
3536 | 3536 | $custom_fields = $wpdb->get_results( |
3537 | 3537 | $wpdb->prepare( |
3538 | - "select post_type,data_type,field_type,site_title,htmlvar_name from " . GEODIR_CUSTOM_FIELDS_TABLE . " where post_type = %s and is_active='1' and cat_sort='1' AND field_type != 'address' order by sort_order asc", |
|
3538 | + "select post_type,data_type,field_type,site_title,htmlvar_name from ".GEODIR_CUSTOM_FIELDS_TABLE." where post_type = %s and is_active='1' and cat_sort='1' AND field_type != 'address' order by sort_order asc", |
|
3539 | 3539 | array($post_type) |
3540 | 3540 | ), 'ARRAY_A' |
3541 | 3541 | ); |
@@ -3652,7 +3652,7 @@ discard block |
||
3652 | 3652 | |
3653 | 3653 | $post_meta_info = $wpdb->query( |
3654 | 3654 | $wpdb->prepare( |
3655 | - "update " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set |
|
3655 | + "update ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." set |
|
3656 | 3656 | sort_order=%d |
3657 | 3657 | where id= %d", |
3658 | 3658 | array($count, $cf) |
@@ -3734,14 +3734,14 @@ discard block |
||
3734 | 3734 | |
3735 | 3735 | $check_html_variable = $wpdb->get_var( |
3736 | 3736 | $wpdb->prepare( |
3737 | - "select htmlvar_name from " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s and field_type=%s ", |
|
3737 | + "select htmlvar_name from ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." where htmlvar_name = %s and post_type = %s and field_type=%s ", |
|
3738 | 3738 | array($cehhtmlvar_name, $post_type, $field_type) |
3739 | 3739 | ) |
3740 | 3740 | ); |
3741 | 3741 | |
3742 | 3742 | if ($is_default == 1) { |
3743 | 3743 | |
3744 | - $wpdb->query($wpdb->prepare("update " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set is_default='0', default_order='' where post_type = %s", array($post_type))); |
|
3744 | + $wpdb->query($wpdb->prepare("update ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." set is_default='0', default_order='' where post_type = %s", array($post_type))); |
|
3745 | 3745 | |
3746 | 3746 | } |
3747 | 3747 | |
@@ -3752,7 +3752,7 @@ discard block |
||
3752 | 3752 | |
3753 | 3753 | $wpdb->prepare( |
3754 | 3754 | |
3755 | - "insert into " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set |
|
3755 | + "insert into ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." set |
|
3756 | 3756 | post_type = %s, |
3757 | 3757 | data_type = %s, |
3758 | 3758 | field_type = %s, |
@@ -3783,7 +3783,7 @@ discard block |
||
3783 | 3783 | |
3784 | 3784 | $wpdb->prepare( |
3785 | 3785 | |
3786 | - "update " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " set |
|
3786 | + "update ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." set |
|
3787 | 3787 | post_type = %s, |
3788 | 3788 | data_type = %s, |
3789 | 3789 | field_type = %s, |
@@ -3809,7 +3809,7 @@ discard block |
||
3809 | 3809 | } |
3810 | 3810 | |
3811 | 3811 | |
3812 | - return (int)$lastid; |
|
3812 | + return (int) $lastid; |
|
3813 | 3813 | |
3814 | 3814 | } |
3815 | 3815 | } |
@@ -3832,7 +3832,7 @@ discard block |
||
3832 | 3832 | if ($field_id != '') { |
3833 | 3833 | $cf = trim($field_id, '_'); |
3834 | 3834 | |
3835 | - $wpdb->query($wpdb->prepare("delete from " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " where id= %d ", array($cf))); |
|
3835 | + $wpdb->query($wpdb->prepare("delete from ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." where id= %d ", array($cf))); |
|
3836 | 3836 | |
3837 | 3837 | return $field_id; |
3838 | 3838 | |
@@ -3860,7 +3860,7 @@ discard block |
||
3860 | 3860 | global $wpdb; |
3861 | 3861 | $cf = $result_str; |
3862 | 3862 | if (!is_object($cf)) { |
3863 | - $field_info = $wpdb->get_row($wpdb->prepare("SELECT * FROM " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " WHERE id = %d", array($cf))); |
|
3863 | + $field_info = $wpdb->get_row($wpdb->prepare("SELECT * FROM ".GEODIR_CUSTOM_SORT_FIELDS_TABLE." WHERE id = %d", array($cf))); |
|
3864 | 3864 | } else { |
3865 | 3865 | $field_info = $cf; |
3866 | 3866 | $result_str = $cf->id; |
@@ -3897,41 +3897,41 @@ discard block |
||
3897 | 3897 | if ($htmlvar_name == '') |
3898 | 3898 | $htmlvar_name = isset($field_info->htmlvar_name) ? $field_info->htmlvar_name : ''; |
3899 | 3899 | |
3900 | - $nonce = wp_create_nonce('custom_fields_' . $result_str); |
|
3900 | + $nonce = wp_create_nonce('custom_fields_'.$result_str); |
|
3901 | 3901 | |
3902 | 3902 | ?> |
3903 | - <li class="text" id="licontainer_<?php echo $result_str;?>"> |
|
3904 | - <div class="title title<?php echo $result_str;?> gt-fieldset" |
|
3905 | - title="<?php _e('Double Click to toggle and drag-drop to sort', 'geodirectory');?>" |
|
3906 | - ondblclick="show_hide('field_frm<?php echo $result_str;?>')"> |
|
3903 | + <li class="text" id="licontainer_<?php echo $result_str; ?>"> |
|
3904 | + <div class="title title<?php echo $result_str; ?> gt-fieldset" |
|
3905 | + title="<?php _e('Double Click to toggle and drag-drop to sort', 'geodirectory'); ?>" |
|
3906 | + ondblclick="show_hide('field_frm<?php echo $result_str; ?>')"> |
|
3907 | 3907 | <?php |
3908 | 3908 | |
3909 | - $nonce = wp_create_nonce('custom_fields_' . $result_str); |
|
3909 | + $nonce = wp_create_nonce('custom_fields_'.$result_str); |
|
3910 | 3910 | ?> |
3911 | 3911 | |
3912 | - <div title="<?php _e('Click to remove field', 'geodirectory');?>" |
|
3913 | - onclick="delete_sort_field('<?php echo $result_str;?>', '<?php echo $nonce;?>', this)" |
|
3912 | + <div title="<?php _e('Click to remove field', 'geodirectory'); ?>" |
|
3913 | + onclick="delete_sort_field('<?php echo $result_str; ?>', '<?php echo $nonce; ?>', this)" |
|
3914 | 3914 | class="handlediv close"></div> |
3915 | 3915 | |
3916 | 3916 | <b style="cursor:pointer;" |
3917 | - onclick="show_hide('field_frm<?php echo $result_str;?>')"><?php echo geodir_ucwords(__('Field:', 'geodirectory') . ' (' . $site_title . ')');?></b> |
|
3917 | + onclick="show_hide('field_frm<?php echo $result_str; ?>')"><?php echo geodir_ucwords(__('Field:', 'geodirectory').' ('.$site_title.')'); ?></b> |
|
3918 | 3918 | |
3919 | 3919 | </div> |
3920 | 3920 | |
3921 | - <div id="field_frm<?php echo $result_str;?>" class="field_frm" |
|
3921 | + <div id="field_frm<?php echo $result_str; ?>" class="field_frm" |
|
3922 | 3922 | style="display:<?php if ($field_ins_upd == 'submit') { |
3923 | 3923 | echo 'block;'; |
3924 | 3924 | } else { |
3925 | 3925 | echo 'none;'; |
3926 | 3926 | } ?>"> |
3927 | 3927 | <input type="hidden" name="_wpnonce" value="<?php echo $nonce; ?>"/> |
3928 | - <input type="hidden" name="listing_type" id="listing_type" value="<?php echo $post_type;?>"/> |
|
3929 | - <input type="hidden" name="field_type" id="field_type" value="<?php echo $field_type;?>"/> |
|
3930 | - <input type="hidden" name="field_id" id="field_id" value="<?php echo $result_str;?>"/> |
|
3928 | + <input type="hidden" name="listing_type" id="listing_type" value="<?php echo $post_type; ?>"/> |
|
3929 | + <input type="hidden" name="field_type" id="field_type" value="<?php echo $field_type; ?>"/> |
|
3930 | + <input type="hidden" name="field_id" id="field_id" value="<?php echo $result_str; ?>"/> |
|
3931 | 3931 | <input type="hidden" name="data_type" id="data_type" value="<?php if (isset($field_info->data_type)) { |
3932 | 3932 | echo $field_info->data_type; |
3933 | 3933 | }?>"/> |
3934 | - <input type="hidden" name="htmlvar_name" id="htmlvar_name" value="<?php echo $htmlvar_name;?>"/> |
|
3934 | + <input type="hidden" name="htmlvar_name" id="htmlvar_name" value="<?php echo $htmlvar_name; ?>"/> |
|
3935 | 3935 | |
3936 | 3936 | |
3937 | 3937 | <table class="widefat post fixed" border="0" style="width:100%;"> |
@@ -3955,7 +3955,7 @@ discard block |
||
3955 | 3955 | } ?>" style="width:45%;"/> |
3956 | 3956 | |
3957 | 3957 | <input type="radio" name="is_default" |
3958 | - value="<?php echo $htmlvar_name; ?>_asc" <?php if (isset($field_info->default_order) && $field_info->default_order == $htmlvar_name . '_asc') { |
|
3958 | + value="<?php echo $htmlvar_name; ?>_asc" <?php if (isset($field_info->default_order) && $field_info->default_order == $htmlvar_name.'_asc') { |
|
3959 | 3959 | echo 'checked="checked"'; |
3960 | 3960 | } ?>/><span><?php _e('Set as default sort.', 'geodirectory'); ?></span> |
3961 | 3961 | |
@@ -3978,7 +3978,7 @@ discard block |
||
3978 | 3978 | echo esc_attr($field_info->desc_title); |
3979 | 3979 | } ?>" style="width:45%;"/> |
3980 | 3980 | <input type="radio" name="is_default" |
3981 | - value="<?php echo $htmlvar_name; ?>_desc" <?php if (isset($field_info->default_order) && $field_info->default_order == $htmlvar_name . '_desc') { |
|
3981 | + value="<?php echo $htmlvar_name; ?>_desc" <?php if (isset($field_info->default_order) && $field_info->default_order == $htmlvar_name.'_desc') { |
|
3982 | 3982 | echo 'checked="checked"'; |
3983 | 3983 | } ?>/><span><?php _e('Set as default sort.', 'geodirectory'); ?></span> |
3984 | 3984 | <br/> |
@@ -4013,42 +4013,42 @@ discard block |
||
4013 | 4013 | <?php } ?> |
4014 | 4014 | |
4015 | 4015 | <tr> |
4016 | - <td><strong><?php _e('Is active :', 'geodirectory');?></strong></td> |
|
4016 | + <td><strong><?php _e('Is active :', 'geodirectory'); ?></strong></td> |
|
4017 | 4017 | <td align="left"> |
4018 | 4018 | <select name="is_active" id="is_active"> |
4019 | 4019 | <option |
4020 | 4020 | value="1" <?php if (isset($field_info->is_active) && $field_info->is_active == '1') { |
4021 | 4021 | echo 'selected="selected"'; |
4022 | - }?>><?php _e('Yes', 'geodirectory');?></option> |
|
4022 | + }?>><?php _e('Yes', 'geodirectory'); ?></option> |
|
4023 | 4023 | <option |
4024 | 4024 | value="0" <?php if (isset($field_info->is_active) && $field_info->is_active == '0') { |
4025 | 4025 | echo 'selected="selected"'; |
4026 | - }?>><?php _e('No', 'geodirectory');?></option> |
|
4026 | + }?>><?php _e('No', 'geodirectory'); ?></option> |
|
4027 | 4027 | </select> |
4028 | 4028 | <br/> |
4029 | - <span><?php _e('Select yes or no. If no is selected then the field will not be displayed anywhere.', 'geodirectory');?></span> |
|
4029 | + <span><?php _e('Select yes or no. If no is selected then the field will not be displayed anywhere.', 'geodirectory'); ?></span> |
|
4030 | 4030 | </td> |
4031 | 4031 | </tr> |
4032 | 4032 | |
4033 | 4033 | <tr> |
4034 | - <td><strong><?php _e('Display order :', 'geodirectory');?></strong></td> |
|
4034 | + <td><strong><?php _e('Display order :', 'geodirectory'); ?></strong></td> |
|
4035 | 4035 | <td align="left"><input type="text" readonly="readonly" name="sort_order" id="sort_order" |
4036 | 4036 | value="<?php if (isset($field_info->sort_order)) { |
4037 | 4037 | echo esc_attr($field_info->sort_order); |
4038 | 4038 | }?>" size="50"/> |
4039 | 4039 | <br/> |
4040 | - <span><?php _e('Enter the display order of this field in backend. e.g. 5', 'geodirectory');?></span> |
|
4040 | + <span><?php _e('Enter the display order of this field in backend. e.g. 5', 'geodirectory'); ?></span> |
|
4041 | 4041 | </td> |
4042 | 4042 | </tr> |
4043 | 4043 | |
4044 | 4044 | <tr> |
4045 | 4045 | <td> </td> |
4046 | 4046 | <td align="left"> |
4047 | - <input type="button" class="button" name="save" id="save" value="<?php esc_attr_e('Save', 'geodirectory');?>" |
|
4048 | - onclick="save_sort_field('<?php echo $result_str;?>')"/> |
|
4047 | + <input type="button" class="button" name="save" id="save" value="<?php esc_attr_e('Save', 'geodirectory'); ?>" |
|
4048 | + onclick="save_sort_field('<?php echo $result_str; ?>')"/> |
|
4049 | 4049 | |
4050 | - <a href="javascript:void(0)"><input type="button" name="delete" value="<?php esc_attr_e('Delete', 'geodirectory');?>" |
|
4051 | - onclick="delete_sort_field('<?php echo $result_str;?>', '<?php echo $nonce;?>', this)" |
|
4050 | + <a href="javascript:void(0)"><input type="button" name="delete" value="<?php esc_attr_e('Delete', 'geodirectory'); ?>" |
|
4051 | + onclick="delete_sort_field('<?php echo $result_str; ?>', '<?php echo $nonce; ?>', this)" |
|
4052 | 4052 | class="button_n"/></a> |
4053 | 4053 | |
4054 | 4054 | </td> |
@@ -4083,7 +4083,7 @@ discard block |
||
4083 | 4083 | if (!$package_id || !$field_name || !$post_type) { |
4084 | 4084 | return true; |
4085 | 4085 | } |
4086 | - $sql = $wpdb->prepare("SELECT id FROM " . GEODIR_CUSTOM_FIELDS_TABLE . " WHERE is_active='1' AND htmlvar_name=%s AND post_type=%s AND FIND_IN_SET(%s, packages)", array($field_name, $post_type, (int)$package_id)); |
|
4086 | + $sql = $wpdb->prepare("SELECT id FROM ".GEODIR_CUSTOM_FIELDS_TABLE." WHERE is_active='1' AND htmlvar_name=%s AND post_type=%s AND FIND_IN_SET(%s, packages)", array($field_name, $post_type, (int) $package_id)); |
|
4087 | 4087 | |
4088 | 4088 | if ($wpdb->get_var($sql)) { |
4089 | 4089 | return true; |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | /* ON TEMPLATE INCLUDE */ |
137 | 137 | ///////////////////////// |
138 | 138 | |
139 | -add_filter('template_include', 'geodir_template_loader',9); |
|
139 | +add_filter('template_include', 'geodir_template_loader', 9); |
|
140 | 140 | |
141 | 141 | ///////////////////////// |
142 | 142 | /* CATEGORY / TAXONOMY / CUSTOM POST ACTIONS */ |
@@ -176,9 +176,9 @@ discard block |
||
176 | 176 | /* WP REVIEW COUNT ACTIONS */ |
177 | 177 | //////////////////////// |
178 | 178 | |
179 | -add_action('geodir_update_postrating', 'geodir_term_review_count_force_update_single_post', 100,1); |
|
179 | +add_action('geodir_update_postrating', 'geodir_term_review_count_force_update_single_post', 100, 1); |
|
180 | 180 | //add_action('geodir_update_postrating', 'geodir_term_review_count_force_update', 100); |
181 | -add_action('transition_post_status', 'geodir_term_review_count_force_update', 100,3); |
|
181 | +add_action('transition_post_status', 'geodir_term_review_count_force_update', 100, 3); |
|
182 | 182 | //add_action('created_term', 'geodir_term_review_count_force_update', 100); |
183 | 183 | add_action('edited_term', 'geodir_term_review_count_force_update', 100); |
184 | 184 | add_action('delete_term', 'geodir_term_review_count_force_update', 100); |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | */ |
223 | 223 | function geodir_unset_prev_theme_nav_location($newname) |
224 | 224 | { |
225 | - $geodir_theme_location = get_option('geodir_theme_location_nav_' . $newname); |
|
225 | + $geodir_theme_location = get_option('geodir_theme_location_nav_'.$newname); |
|
226 | 226 | if ($geodir_theme_location) { |
227 | 227 | update_option('geodir_theme_location_nav', $geodir_theme_location); |
228 | 228 | } else { |
@@ -320,8 +320,8 @@ discard block |
||
320 | 320 | |
321 | 321 | /////// GEO DIRECOTORY CUSTOM HOOKS /// |
322 | 322 | |
323 | -add_action('geodir_before_tab_content', 'geodir_before_tab_content');// this function is in custom_functions.php and it is used to wrap detail page tab content |
|
324 | -add_action('geodir_after_tab_content', 'geodir_after_tab_content');// this function is in custom_functions.php and it is used to wrap detail page tab content |
|
323 | +add_action('geodir_before_tab_content', 'geodir_before_tab_content'); // this function is in custom_functions.php and it is used to wrap detail page tab content |
|
324 | +add_action('geodir_after_tab_content', 'geodir_after_tab_content'); // this function is in custom_functions.php and it is used to wrap detail page tab content |
|
325 | 325 | |
326 | 326 | // Detail page sidebar content |
327 | 327 | add_action('geodir_detail_page_sidebar', 'geodir_detail_page_sidebar_content_sorting', 1); |
@@ -422,8 +422,8 @@ discard block |
||
422 | 422 | do_action('geodir_after_social_sharing_buttons'); |
423 | 423 | $content_html = ob_get_clean(); |
424 | 424 | if (trim($content_html) != '') |
425 | - $content_html = '<div class="geodir-company_info geodir-details-sidebar-social-sharing">' . $content_html . '</div>'; |
|
426 | - if ((int)get_option('geodir_disable_tfg_buttons_section') != 1) { |
|
425 | + $content_html = '<div class="geodir-company_info geodir-details-sidebar-social-sharing">'.$content_html.'</div>'; |
|
426 | + if ((int) get_option('geodir_disable_tfg_buttons_section') != 1) { |
|
427 | 427 | /** |
428 | 428 | * Filter the geodir_social_sharing_buttons() function content. |
429 | 429 | * |
@@ -469,8 +469,8 @@ discard block |
||
469 | 469 | do_action('geodir_after_share_this_button'); |
470 | 470 | $content_html = ob_get_clean(); |
471 | 471 | if (trim($content_html) != '') |
472 | - $content_html = '<div class="geodir-company_info geodir-details-sidebar-sharethis">' . $content_html . '</div>'; |
|
473 | - if ((int)get_option('geodir_disable_sharethis_button_section') != 1) { |
|
472 | + $content_html = '<div class="geodir-company_info geodir-details-sidebar-sharethis">'.$content_html.'</div>'; |
|
473 | + if ((int) get_option('geodir_disable_sharethis_button_section') != 1) { |
|
474 | 474 | /** |
475 | 475 | * Filter the geodir_share_this_button() function content. |
476 | 476 | * |
@@ -509,12 +509,12 @@ discard block |
||
509 | 509 | $post_id = $post->ID; |
510 | 510 | |
511 | 511 | if (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '') { |
512 | - $post_id = (int)$_REQUEST['pid']; |
|
512 | + $post_id = (int) $_REQUEST['pid']; |
|
513 | 513 | } |
514 | 514 | |
515 | 515 | $postlink = get_permalink(geodir_add_listing_page_id()); |
516 | 516 | $editlink = geodir_getlink($postlink, array('pid' => $post_id), false); |
517 | - echo ' <p class="edit_link"><i class="fa fa-pencil"></i> <a href="' . esc_url($editlink) . '">' . __('Edit this Post', 'geodirectory') . '</a></p>'; |
|
517 | + echo ' <p class="edit_link"><i class="fa fa-pencil"></i> <a href="'.esc_url($editlink).'">'.__('Edit this Post', 'geodirectory').'</a></p>'; |
|
518 | 518 | } |
519 | 519 | }// end of if, if its a preview or not |
520 | 520 | /** |
@@ -525,8 +525,8 @@ discard block |
||
525 | 525 | do_action('geodir_after_edit_post_link'); |
526 | 526 | $content_html = ob_get_clean(); |
527 | 527 | if (trim($content_html) != '') |
528 | - $content_html = '<div class="geodir-company_info geodir-details-sidebar-user-links">' . $content_html . '</div>'; |
|
529 | - if ((int)get_option('geodir_disable_user_links_section') != 1) { |
|
528 | + $content_html = '<div class="geodir-company_info geodir-details-sidebar-user-links">'.$content_html.'</div>'; |
|
529 | + if ((int) get_option('geodir_disable_user_links_section') != 1) { |
|
530 | 530 | /** |
531 | 531 | * Filter the geodir_edit_post_link() function content. |
532 | 532 | * |
@@ -579,14 +579,14 @@ discard block |
||
579 | 579 | $hide_refresh = get_option('geodir_ga_auto_refresh'); |
580 | 580 | |
581 | 581 | $auto_refresh = $hide_refresh && $refresh_time && $refresh_time > 0 ? 1 : 0; |
582 | - if (get_option('geodir_ga_stats') && is_user_logged_in() && (isset($package_info->google_analytics) && $package_info->google_analytics == '1') && (get_current_user_id()==$post->post_author || current_user_can( 'manage_options' )) ) { |
|
582 | + if (get_option('geodir_ga_stats') && is_user_logged_in() && (isset($package_info->google_analytics) && $package_info->google_analytics == '1') && (get_current_user_id() == $post->post_author || current_user_can('manage_options'))) { |
|
583 | 583 | $page_url = urlencode($_SERVER['REQUEST_URI']); |
584 | 584 | ?> |
585 | 585 | <script type="text/javascript"> |
586 | 586 | var gd_gaTimeOut; |
587 | - var gd_gaTime = parseInt('<?php echo $refresh_time;?>'); |
|
588 | - var gd_gaHideRefresh = <?php echo (int)$hide_refresh;?>; |
|
589 | - var gd_gaAutoRefresh = <?php echo $auto_refresh;?>; |
|
587 | + var gd_gaTime = parseInt('<?php echo $refresh_time; ?>'); |
|
588 | + var gd_gaHideRefresh = <?php echo (int) $hide_refresh; ?>; |
|
589 | + var gd_gaAutoRefresh = <?php echo $auto_refresh; ?>; |
|
590 | 590 | ga_data1 = false; |
591 | 591 | ga_data2 = false; |
592 | 592 | ga_data3 = false; |
@@ -727,7 +727,7 @@ discard block |
||
727 | 727 | } |
728 | 728 | |
729 | 729 | function gdga_noResults() { |
730 | - jQuery('#gdga-chart-container').html('<?php _e('No results available','geodirectory');?>'); |
|
730 | + jQuery('#gdga-chart-container').html('<?php _e('No results available', 'geodirectory'); ?>'); |
|
731 | 731 | jQuery('#gdga-legend-container').html(''); |
732 | 732 | } |
733 | 733 | |
@@ -759,18 +759,18 @@ discard block |
||
759 | 759 | var data2 = results[1].rows.map(function(row) { return +row[2]; }); |
760 | 760 | //var labelsN = results[0].rows.map(function(row) { return +row[1]; }); |
761 | 761 | |
762 | - var labels = ['<?php _e('Jan', 'geodirectory');?>', |
|
763 | - '<?php _e('Feb', 'geodirectory');?>', |
|
764 | - '<?php _e('Mar', 'geodirectory');?>', |
|
765 | - '<?php _e('Apr', 'geodirectory');?>', |
|
766 | - '<?php _e('May', 'geodirectory');?>', |
|
767 | - '<?php _e('Jun', 'geodirectory');?>', |
|
768 | - '<?php _e('Jul', 'geodirectory');?>', |
|
769 | - '<?php _e('Aug', 'geodirectory');?>', |
|
770 | - '<?php _e('Sep', 'geodirectory');?>', |
|
771 | - '<?php _e('Oct', 'geodirectory');?>', |
|
772 | - '<?php _e('Nov', 'geodirectory');?>', |
|
773 | - '<?php _e('Dec', 'geodirectory');?>']; |
|
762 | + var labels = ['<?php _e('Jan', 'geodirectory'); ?>', |
|
763 | + '<?php _e('Feb', 'geodirectory'); ?>', |
|
764 | + '<?php _e('Mar', 'geodirectory'); ?>', |
|
765 | + '<?php _e('Apr', 'geodirectory'); ?>', |
|
766 | + '<?php _e('May', 'geodirectory'); ?>', |
|
767 | + '<?php _e('Jun', 'geodirectory'); ?>', |
|
768 | + '<?php _e('Jul', 'geodirectory'); ?>', |
|
769 | + '<?php _e('Aug', 'geodirectory'); ?>', |
|
770 | + '<?php _e('Sep', 'geodirectory'); ?>', |
|
771 | + '<?php _e('Oct', 'geodirectory'); ?>', |
|
772 | + '<?php _e('Nov', 'geodirectory'); ?>', |
|
773 | + '<?php _e('Dec', 'geodirectory'); ?>']; |
|
774 | 774 | |
775 | 775 | // Ensure the data arrays are at least as long as the labels array. |
776 | 776 | // Chart.js bar charts don't (yet) accept sparse datasets. |
@@ -783,13 +783,13 @@ discard block |
||
783 | 783 | labels : labels, |
784 | 784 | datasets : [ |
785 | 785 | { |
786 | - label: '<?php _e('Last Year', 'geodirectory');?>', |
|
786 | + label: '<?php _e('Last Year', 'geodirectory'); ?>', |
|
787 | 787 | fillColor : "rgba(220,220,220,0.5)", |
788 | 788 | strokeColor : "rgba(220,220,220,1)", |
789 | 789 | data : data2 |
790 | 790 | }, |
791 | 791 | { |
792 | - label: '<?php _e('This Year', 'geodirectory');?>', |
|
792 | + label: '<?php _e('This Year', 'geodirectory'); ?>', |
|
793 | 793 | fillColor : "rgba(151,187,205,0.5)", |
794 | 794 | strokeColor : "rgba(151,187,205,1)", |
795 | 795 | data : data1 |
@@ -834,30 +834,30 @@ discard block |
||
834 | 834 | |
835 | 835 | <?php |
836 | 836 | // Here we list the shorthand days of the week so it can be used in translation. |
837 | - __("Mon",'geodirectory'); |
|
838 | - __("Tue",'geodirectory'); |
|
839 | - __("Wed",'geodirectory'); |
|
840 | - __("Thu",'geodirectory'); |
|
841 | - __("Fri",'geodirectory'); |
|
842 | - __("Sat",'geodirectory'); |
|
843 | - __("Sun",'geodirectory'); |
|
837 | + __("Mon", 'geodirectory'); |
|
838 | + __("Tue", 'geodirectory'); |
|
839 | + __("Wed", 'geodirectory'); |
|
840 | + __("Thu", 'geodirectory'); |
|
841 | + __("Fri", 'geodirectory'); |
|
842 | + __("Sat", 'geodirectory'); |
|
843 | + __("Sun", 'geodirectory'); |
|
844 | 844 | ?> |
845 | 845 | |
846 | 846 | labels = [ |
847 | - "<?php _e(date('D', strtotime("+1 day")),'geodirectory'); ?>", |
|
848 | - "<?php _e(date('D', strtotime("+2 day")),'geodirectory'); ?>", |
|
849 | - "<?php _e(date('D', strtotime("+3 day")),'geodirectory'); ?>", |
|
850 | - "<?php _e(date('D', strtotime("+4 day")),'geodirectory'); ?>", |
|
851 | - "<?php _e(date('D', strtotime("+5 day")),'geodirectory'); ?>", |
|
852 | - "<?php _e(date('D', strtotime("+6 day")),'geodirectory'); ?>", |
|
853 | - "<?php _e(date('D', strtotime("+7 day")),'geodirectory'); ?>" |
|
847 | + "<?php _e(date('D', strtotime("+1 day")), 'geodirectory'); ?>", |
|
848 | + "<?php _e(date('D', strtotime("+2 day")), 'geodirectory'); ?>", |
|
849 | + "<?php _e(date('D', strtotime("+3 day")), 'geodirectory'); ?>", |
|
850 | + "<?php _e(date('D', strtotime("+4 day")), 'geodirectory'); ?>", |
|
851 | + "<?php _e(date('D', strtotime("+5 day")), 'geodirectory'); ?>", |
|
852 | + "<?php _e(date('D', strtotime("+6 day")), 'geodirectory'); ?>", |
|
853 | + "<?php _e(date('D', strtotime("+7 day")), 'geodirectory'); ?>" |
|
854 | 854 | ]; |
855 | 855 | |
856 | 856 | var data = { |
857 | 857 | labels : labels, |
858 | 858 | datasets : [ |
859 | 859 | { |
860 | - label: '<?php _e('Last Week', 'geodirectory');?>', |
|
860 | + label: '<?php _e('Last Week', 'geodirectory'); ?>', |
|
861 | 861 | fillColor : "rgba(220,220,220,0.5)", |
862 | 862 | strokeColor : "rgba(220,220,220,1)", |
863 | 863 | pointColor : "rgba(220,220,220,1)", |
@@ -865,7 +865,7 @@ discard block |
||
865 | 865 | data : data2 |
866 | 866 | }, |
867 | 867 | { |
868 | - label: '<?php _e('This Week', 'geodirectory');?>', |
|
868 | + label: '<?php _e('This Week', 'geodirectory'); ?>', |
|
869 | 869 | fillColor : "rgba(151,187,205,0.5)", |
870 | 870 | strokeColor : "rgba(151,187,205,1)", |
871 | 871 | pointColor : "rgba(151,187,205,1)", |
@@ -1072,18 +1072,18 @@ discard block |
||
1072 | 1072 | </style> |
1073 | 1073 | <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.2/Chart.min.js"></script> |
1074 | 1074 | <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.10.2/moment.min.js"></script> |
1075 | - <button type="button" class="gdga-show-analytics"><?php _e('Show Google Analytics', 'geodirectory');?></button> |
|
1075 | + <button type="button" class="gdga-show-analytics"><?php _e('Show Google Analytics', 'geodirectory'); ?></button> |
|
1076 | 1076 | <span id="ga_stats" class="gdga-analytics-box" style="display:none"> |
1077 | - <div id="ga-analytics-title"><?php _e("Analytics", 'geodirectory');?></div> |
|
1077 | + <div id="ga-analytics-title"><?php _e("Analytics", 'geodirectory'); ?></div> |
|
1078 | 1078 | <div id="gd-active-users-container"> |
1079 | - <div class="gd-ActiveUsers"><i id="gdga-loader-icon" class="fa fa-refresh fa-spin" title="<?php esc_attr_e("Refresh", 'geodirectory');?>"></i><?php _e("Active Users:", 'geodirectory');?> |
|
1079 | + <div class="gd-ActiveUsers"><i id="gdga-loader-icon" class="fa fa-refresh fa-spin" title="<?php esc_attr_e("Refresh", 'geodirectory'); ?>"></i><?php _e("Active Users:", 'geodirectory'); ?> |
|
1080 | 1080 | <b class="gd-ActiveUsers-value">0</b> |
1081 | 1081 | </div> |
1082 | 1082 | </div> |
1083 | 1083 | <select id="gdga-select-analytic" onchange="gdga_select_option();" style="display: none;"> |
1084 | - <option value="weeks"><?php _e("Last Week vs This Week", 'geodirectory');?></option> |
|
1085 | - <option value="years"><?php _e("This Year vs Last Year", 'geodirectory');?></option> |
|
1086 | - <option value="country"><?php _e("Top Countries", 'geodirectory');?></option> |
|
1084 | + <option value="weeks"><?php _e("Last Week vs This Week", 'geodirectory'); ?></option> |
|
1085 | + <option value="years"><?php _e("This Year vs Last Year", 'geodirectory'); ?></option> |
|
1086 | + <option value="country"><?php _e("Top Countries", 'geodirectory'); ?></option> |
|
1087 | 1087 | </select> |
1088 | 1088 | <div class="Chartjs-figure" id="gdga-chart-container"></div> |
1089 | 1089 | <ol class="Chartjs-legend" id="gdga-legend-container"></ol> |
@@ -1099,8 +1099,8 @@ discard block |
||
1099 | 1099 | do_action('geodir_after_google_analytics'); |
1100 | 1100 | $content_html = ob_get_clean(); |
1101 | 1101 | if (trim($content_html) != '') |
1102 | - $content_html = '<div class="geodir-company_info geodir-details-sidebar-google-analytics">' . $content_html . '</div>'; |
|
1103 | - if ((int)get_option('geodir_disable_google_analytics_section') != 1) { |
|
1102 | + $content_html = '<div class="geodir-company_info geodir-details-sidebar-google-analytics">'.$content_html.'</div>'; |
|
1103 | + if ((int) get_option('geodir_disable_google_analytics_section') != 1) { |
|
1104 | 1104 | /** |
1105 | 1105 | * Filter the geodir_edit_post_link() function content. |
1106 | 1106 | * |
@@ -1156,10 +1156,10 @@ discard block |
||
1156 | 1156 | |
1157 | 1157 | $reviews_text = $comment_count > 1 ? __("reviews", 'geodirectory') : __("review", 'geodirectory'); |
1158 | 1158 | |
1159 | - $html .= '<span itemprop="rating" itemscope itemtype="http://data-vocabulary.org/Rating"><span class="rating" itemprop="average" content="' . $post_avgratings . '">' . $post_avgratings . '</span> / <span itemprop="best" content="5">5</span> ' . __("based on", 'geodirectory') . ' </span><span class="count" itemprop="count" content="' . $comment_count . '">' . $comment_count . ' ' . $reviews_text . '</span><br />'; |
|
1159 | + $html .= '<span itemprop="rating" itemscope itemtype="http://data-vocabulary.org/Rating"><span class="rating" itemprop="average" content="'.$post_avgratings.'">'.$post_avgratings.'</span> / <span itemprop="best" content="5">5</span> '.__("based on", 'geodirectory').' </span><span class="count" itemprop="count" content="'.$comment_count.'">'.$comment_count.' '.$reviews_text.'</span><br />'; |
|
1160 | 1160 | |
1161 | 1161 | $html .= '<span class="item">'; |
1162 | - $html .= '<span class="fn" itemprop="itemreviewed">' . $post->post_title . '</span>'; |
|
1162 | + $html .= '<span class="fn" itemprop="itemreviewed">'.$post->post_title.'</span>'; |
|
1163 | 1163 | |
1164 | 1164 | if ($post_images) { |
1165 | 1165 | foreach ($post_images as $img) { |
@@ -1169,7 +1169,7 @@ discard block |
||
1169 | 1169 | } |
1170 | 1170 | |
1171 | 1171 | if (isset($post_img) && $post_img) { |
1172 | - $html .= '<br /><img src="' . $post_img . '" class="photo" alt="' . esc_attr($post->post_title) . '" itemprop="photo" content="' . $post_img . '" class="photo" />'; |
|
1172 | + $html .= '<br /><img src="'.$post_img.'" class="photo" alt="'.esc_attr($post->post_title).'" itemprop="photo" content="'.$post_img.'" class="photo" />'; |
|
1173 | 1173 | } |
1174 | 1174 | |
1175 | 1175 | $html .= '</span>'; |
@@ -1196,9 +1196,9 @@ discard block |
||
1196 | 1196 | do_action('geodir_after_detail_page_review_rating'); |
1197 | 1197 | $content_html = ob_get_clean(); |
1198 | 1198 | if (trim($content_html) != '') { |
1199 | - $content_html = '<div class="geodir-company_info geodir-details-sidebar-rating">' . $content_html . '</div>'; |
|
1199 | + $content_html = '<div class="geodir-company_info geodir-details-sidebar-rating">'.$content_html.'</div>'; |
|
1200 | 1200 | } |
1201 | - if ((int)get_option('geodir_disable_rating_info_section') != 1) { |
|
1201 | + if ((int) get_option('geodir_disable_rating_info_section') != 1) { |
|
1202 | 1202 | /** |
1203 | 1203 | * Filter the geodir_detail_page_review_rating() function content. |
1204 | 1204 | * |
@@ -1237,8 +1237,8 @@ discard block |
||
1237 | 1237 | |
1238 | 1238 | $content_html = ob_get_clean(); |
1239 | 1239 | if (trim($content_html) != '') |
1240 | - $content_html = '<div class="geodir-company_info geodir-details-sidebar-listing-info">' . $content_html . '</div>'; |
|
1241 | - if ((int)get_option('geodir_disable_listing_info_section') != 1) { |
|
1240 | + $content_html = '<div class="geodir-company_info geodir-details-sidebar-listing-info">'.$content_html.'</div>'; |
|
1241 | + if ((int) get_option('geodir_disable_listing_info_section') != 1) { |
|
1242 | 1242 | /** |
1243 | 1243 | * Filter the output html for function geodir_detail_page_more_info(). |
1244 | 1244 | * |
@@ -1336,7 +1336,7 @@ discard block |
||
1336 | 1336 | 'gd_allowed_img_types' => !empty($allowed_img_types) ? implode(',', $allowed_img_types) : '', |
1337 | 1337 | 'geodir_txt_form_wait' => __('Wait...', 'geodirectory'), |
1338 | 1338 | 'geodir_txt_form_searching' => __('Searching...', 'geodirectory'), |
1339 | - 'fa_rating' => (int)get_option('geodir_reviewrating_enable_font_awesome') == 1 ? 1 : '', |
|
1339 | + 'fa_rating' => (int) get_option('geodir_reviewrating_enable_font_awesome') == 1 ? 1 : '', |
|
1340 | 1340 | 'reviewrating' => defined('GEODIRREVIEWRATING_VERSION') ? 1 : '', |
1341 | 1341 | 'geodir_map_name' => geodir_map_name(), |
1342 | 1342 | ); |
@@ -1354,10 +1354,10 @@ discard block |
||
1354 | 1354 | foreach ($arr_alert_msg as $key => $value) { |
1355 | 1355 | if (!is_scalar($value)) |
1356 | 1356 | continue; |
1357 | - $arr_alert_msg[$key] = html_entity_decode((string)$value, ENT_QUOTES, 'UTF-8'); |
|
1357 | + $arr_alert_msg[$key] = html_entity_decode((string) $value, ENT_QUOTES, 'UTF-8'); |
|
1358 | 1358 | } |
1359 | 1359 | |
1360 | - $script = "var geodir_all_js_msg = " . json_encode($arr_alert_msg) . ';'; |
|
1360 | + $script = "var geodir_all_js_msg = ".json_encode($arr_alert_msg).';'; |
|
1361 | 1361 | echo '<script>'; |
1362 | 1362 | echo $script; |
1363 | 1363 | echo '</script>'; |
@@ -1445,7 +1445,7 @@ discard block |
||
1445 | 1445 | $geodir_old_sidebars = get_option('geodir_sidebars'); |
1446 | 1446 | if (is_array($geodir_old_sidebars)) { |
1447 | 1447 | foreach ($geodir_old_sidebars as $key => $val) { |
1448 | - if(0 === strpos($key, 'geodir_'))// if gd widget |
|
1448 | + if (0 === strpos($key, 'geodir_'))// if gd widget |
|
1449 | 1449 | { |
1450 | 1450 | $sidebars_widgets[$key] = $geodir_old_sidebars[$key]; |
1451 | 1451 | } |
@@ -1524,7 +1524,7 @@ discard block |
||
1524 | 1524 | global $post; |
1525 | 1525 | $term_condition = ''; |
1526 | 1526 | if (isset($_REQUEST['backandedit'])) { |
1527 | - $post = (object)$gd_session->get('listing'); |
|
1527 | + $post = (object) $gd_session->get('listing'); |
|
1528 | 1528 | $term_condition = isset($post->geodir_accept_term_condition) ? $post->geodir_accept_term_condition : ''; |
1529 | 1529 | } |
1530 | 1530 | |
@@ -1538,7 +1538,7 @@ discard block |
||
1538 | 1538 | echo 'checked="checked"'; |
1539 | 1539 | } ?> field_type="checkbox" name="geodir_accept_term_condition" id="geodir_accept_term_condition" |
1540 | 1540 | class="geodir_textfield" value="1" |
1541 | - style="display:inline-block"/><a href="<?php $terms_page = get_option('geodir_term_condition_page'); if($terms_page){ echo get_permalink($terms_page);}?>" target="_blank"><?php _e('Please accept our terms and conditions', 'geodirectory'); ?></a> |
|
1541 | + style="display:inline-block"/><a href="<?php $terms_page = get_option('geodir_term_condition_page'); if ($terms_page) { echo get_permalink($terms_page); }?>" target="_blank"><?php _e('Please accept our terms and conditions', 'geodirectory'); ?></a> |
|
1542 | 1542 | </span> |
1543 | 1543 | </div> |
1544 | 1544 | <span class="geodir_message_error"><?php if (isset($required_msg)) { |
@@ -1578,7 +1578,7 @@ discard block |
||
1578 | 1578 | /** This action is documented in geodirectory_template_actions.php */ |
1579 | 1579 | $desc_limit = apply_filters('geodir_description_field_desc_limit', ''); |
1580 | 1580 | |
1581 | - if (!($desc_limit === '' || (int)$desc_limit > 0)) { |
|
1581 | + if (!($desc_limit === '' || (int) $desc_limit > 0)) { |
|
1582 | 1582 | $is_display = false; |
1583 | 1583 | } |
1584 | 1584 | } |
@@ -1626,16 +1626,16 @@ discard block |
||
1626 | 1626 | global $wpdb, $plugin_prefix; |
1627 | 1627 | |
1628 | 1628 | // Remove unused virtual page |
1629 | - $listings_page_id = (int)get_option('geodir_listing_page'); |
|
1629 | + $listings_page_id = (int) get_option('geodir_listing_page'); |
|
1630 | 1630 | if ($listings_page_id) { |
1631 | - $wpdb->query($wpdb->prepare("DELETE FROM " . $wpdb->posts . " WHERE ID=%d AND post_name = %s AND post_type=%s", array($listings_page_id, 'listings', 'page'))); |
|
1631 | + $wpdb->query($wpdb->prepare("DELETE FROM ".$wpdb->posts." WHERE ID=%d AND post_name = %s AND post_type=%s", array($listings_page_id, 'listings', 'page'))); |
|
1632 | 1632 | delete_option('geodir_listing_page'); |
1633 | 1633 | } |
1634 | 1634 | |
1635 | 1635 | if (!get_option('geodir_changes_in_custom_fields_table')) { |
1636 | 1636 | $wpdb->query( |
1637 | 1637 | $wpdb->prepare( |
1638 | - "UPDATE " . GEODIR_CUSTOM_FIELDS_TABLE . " SET is_default=%s, is_admin=%s WHERE is_default=%s", |
|
1638 | + "UPDATE ".GEODIR_CUSTOM_FIELDS_TABLE." SET is_default=%s, is_admin=%s WHERE is_default=%s", |
|
1639 | 1639 | array('1', '1', 'admin') |
1640 | 1640 | ) |
1641 | 1641 | ); |
@@ -1643,9 +1643,9 @@ discard block |
||
1643 | 1643 | |
1644 | 1644 | /* --- terms meta value set --- */ |
1645 | 1645 | |
1646 | - update_option('geodir_default_marker_icon', geodir_plugin_url() . '/geodirectory-functions/map-functions/icons/pin.png'); |
|
1646 | + update_option('geodir_default_marker_icon', geodir_plugin_url().'/geodirectory-functions/map-functions/icons/pin.png'); |
|
1647 | 1647 | |
1648 | - $options_data = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "options WHERE option_name LIKE %s", array('%tax_meta_%'))); |
|
1648 | + $options_data = $wpdb->get_results($wpdb->prepare("SELECT * FROM ".$wpdb->prefix."options WHERE option_name LIKE %s", array('%tax_meta_%'))); |
|
1649 | 1649 | |
1650 | 1650 | if (!empty($options_data)) { |
1651 | 1651 | |
@@ -1653,7 +1653,7 @@ discard block |
||
1653 | 1653 | |
1654 | 1654 | $option_val = str_replace('tax_meta_', '', $optobj->option_name); |
1655 | 1655 | |
1656 | - $taxonomies_data = $wpdb->get_results($wpdb->prepare("SELECT taxonomy FROM " . $wpdb->prefix . "term_taxonomy WHERE taxonomy LIKE %s AND term_id=%d", array('%category%', $option_val))); |
|
1656 | + $taxonomies_data = $wpdb->get_results($wpdb->prepare("SELECT taxonomy FROM ".$wpdb->prefix."term_taxonomy WHERE taxonomy LIKE %s AND term_id=%d", array('%category%', $option_val))); |
|
1657 | 1657 | |
1658 | 1658 | if (!empty($taxonomies_data)) { |
1659 | 1659 | |
@@ -1662,17 +1662,17 @@ discard block |
||
1662 | 1662 | $taxObject = get_taxonomy($taxobj->taxonomy); |
1663 | 1663 | $post_type = $taxObject->object_type[0]; |
1664 | 1664 | |
1665 | - $opt_value = 'tax_meta_' . $post_type . '_' . $option_val; |
|
1665 | + $opt_value = 'tax_meta_'.$post_type.'_'.$option_val; |
|
1666 | 1666 | |
1667 | - $duplicate_data = $wpdb->get_var($wpdb->prepare("SELECT option_id FROM " . $wpdb->prefix . "options WHERE option_name=%s", array('tax_meta_' . $option_val))); |
|
1667 | + $duplicate_data = $wpdb->get_var($wpdb->prepare("SELECT option_id FROM ".$wpdb->prefix."options WHERE option_name=%s", array('tax_meta_'.$option_val))); |
|
1668 | 1668 | |
1669 | 1669 | if ($duplicate_data) { |
1670 | 1670 | |
1671 | - $wpdb->query($wpdb->prepare("UPDATE " . $wpdb->prefix . "options SET option_name=%s WHERE option_id=%d", array($opt_value, $optobj->option_id))); |
|
1671 | + $wpdb->query($wpdb->prepare("UPDATE ".$wpdb->prefix."options SET option_name=%s WHERE option_id=%d", array($opt_value, $optobj->option_id))); |
|
1672 | 1672 | |
1673 | 1673 | } else { |
1674 | 1674 | |
1675 | - $wpdb->query($wpdb->prepare("INSERT INTO " . $wpdb->prefix . "options (option_name,option_value,autoload) VALUES (%s, %s, %s)", array($opt_value, $optobj->option_value, $optobj->autoload))); |
|
1675 | + $wpdb->query($wpdb->prepare("INSERT INTO ".$wpdb->prefix."options (option_name,option_value,autoload) VALUES (%s, %s, %s)", array($opt_value, $optobj->option_value, $optobj->autoload))); |
|
1676 | 1676 | |
1677 | 1677 | } |
1678 | 1678 | |
@@ -1706,14 +1706,14 @@ discard block |
||
1706 | 1706 | |
1707 | 1707 | global $wpdb, $table_prefix; |
1708 | 1708 | |
1709 | - $slug_exists = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($slug))); |
|
1709 | + $slug_exists = $wpdb->get_var($wpdb->prepare("SELECT slug FROM ".$table_prefix."terms WHERE slug=%s", array($slug))); |
|
1710 | 1710 | |
1711 | 1711 | if ($slug_exists) { |
1712 | 1712 | |
1713 | 1713 | $suffix = 1; |
1714 | 1714 | do { |
1715 | - $alt_location_name = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix"; |
|
1716 | - $location_slug_check = $wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s", array($alt_location_name))); |
|
1715 | + $alt_location_name = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1))."-$suffix"; |
|
1716 | + $location_slug_check = $wpdb->get_var($wpdb->prepare("SELECT slug FROM ".$table_prefix."terms WHERE slug=%s", array($alt_location_name))); |
|
1717 | 1717 | $suffix++; |
1718 | 1718 | } while ($location_slug_check && $suffix < 100); |
1719 | 1719 | |
@@ -1767,7 +1767,7 @@ discard block |
||
1767 | 1767 | |
1768 | 1768 | $suffix = 1; |
1769 | 1769 | do { |
1770 | - $new_slug = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1)) . "-$suffix"; |
|
1770 | + $new_slug = _truncate_post_slug($slug, 200 - (strlen($suffix) + 1))."-$suffix"; |
|
1771 | 1771 | |
1772 | 1772 | /** This action is documented in geodirectory_hooks_actions.php */ |
1773 | 1773 | $term_slug_check = apply_filters('geodir_term_slug_is_exists', false, $new_slug, $term_id); |
@@ -1779,7 +1779,7 @@ discard block |
||
1779 | 1779 | |
1780 | 1780 | //wp_update_term( $term_id, $taxonomy, array('slug' => $slug) ); |
1781 | 1781 | |
1782 | - $wpdb->query($wpdb->prepare("UPDATE " . $table_prefix . "terms SET slug=%s WHERE term_id=%d", array($slug, $term_id))); |
|
1782 | + $wpdb->query($wpdb->prepare("UPDATE ".$table_prefix."terms SET slug=%s WHERE term_id=%d", array($slug, $term_id))); |
|
1783 | 1783 | |
1784 | 1784 | } |
1785 | 1785 | |
@@ -1788,18 +1788,18 @@ discard block |
||
1788 | 1788 | $post_type = !empty($taxonomy_obj) ? $taxonomy_obj->object_type[0] : NULL; |
1789 | 1789 | |
1790 | 1790 | $post_types = geodir_get_posttypes(); |
1791 | - if ($post_type && in_array($post_type, $post_types) && $post_type . '_tags' == $taxonomy) { |
|
1792 | - $posts_obj = $wpdb->get_results($wpdb->prepare("SELECT object_id FROM " . $wpdb->term_relationships . " WHERE term_taxonomy_id = %d", array($tt_id))); |
|
1791 | + if ($post_type && in_array($post_type, $post_types) && $post_type.'_tags' == $taxonomy) { |
|
1792 | + $posts_obj = $wpdb->get_results($wpdb->prepare("SELECT object_id FROM ".$wpdb->term_relationships." WHERE term_taxonomy_id = %d", array($tt_id))); |
|
1793 | 1793 | |
1794 | 1794 | if (!empty($posts_obj)) { |
1795 | 1795 | foreach ($posts_obj as $post_obj) { |
1796 | 1796 | $post_id = $post_obj->object_id; |
1797 | 1797 | |
1798 | - $raw_tags = wp_get_object_terms($post_id, $post_type . '_tags', array('fields' => 'names')); |
|
1798 | + $raw_tags = wp_get_object_terms($post_id, $post_type.'_tags', array('fields' => 'names')); |
|
1799 | 1799 | $post_tags = !empty($raw_tags) ? implode(',', $raw_tags) : ''; |
1800 | 1800 | |
1801 | - $listing_table = $plugin_prefix . $post_type . '_detail'; |
|
1802 | - $wpdb->query($wpdb->prepare("UPDATE " . $listing_table . " SET post_tags=%s WHERE post_id =%d", array($post_tags, $post_id))); |
|
1801 | + $listing_table = $plugin_prefix.$post_type.'_detail'; |
|
1802 | + $wpdb->query($wpdb->prepare("UPDATE ".$listing_table." SET post_tags=%s WHERE post_id =%d", array($post_tags, $post_id))); |
|
1803 | 1803 | } |
1804 | 1804 | } |
1805 | 1805 | } |
@@ -1833,7 +1833,7 @@ discard block |
||
1833 | 1833 | if ($country_slug == $slug || $region_slug == $slug || $city_slug == $slug) |
1834 | 1834 | return $slug_exists = true; |
1835 | 1835 | |
1836 | - if ($wpdb->get_var($wpdb->prepare("SELECT slug FROM " . $table_prefix . "terms WHERE slug=%s AND term_id != %d", array($slug, $term_id)))) |
|
1836 | + if ($wpdb->get_var($wpdb->prepare("SELECT slug FROM ".$table_prefix."terms WHERE slug=%s AND term_id != %d", array($slug, $term_id)))) |
|
1837 | 1837 | return $slug_exists = true; |
1838 | 1838 | |
1839 | 1839 | return $slug_exists; |
@@ -1873,43 +1873,43 @@ discard block |
||
1873 | 1873 | |
1874 | 1874 | |
1875 | 1875 | $gd_page = ''; |
1876 | - if(geodir_is_page('home')){ |
|
1876 | + if (geodir_is_page('home')) { |
|
1877 | 1877 | $gd_page = 'home'; |
1878 | 1878 | $title = (get_option('geodir_meta_title_homepage')) ? get_option('geodir_meta_title_homepage') : $title; |
1879 | 1879 | } |
1880 | - elseif(geodir_is_page('detail')){ |
|
1880 | + elseif (geodir_is_page('detail')) { |
|
1881 | 1881 | $gd_page = 'detail'; |
1882 | 1882 | $title = (get_option('geodir_meta_title_detail')) ? get_option('geodir_meta_title_detail') : $title; |
1883 | 1883 | } |
1884 | - elseif(geodir_is_page('pt')){ |
|
1884 | + elseif (geodir_is_page('pt')) { |
|
1885 | 1885 | $gd_page = 'pt'; |
1886 | 1886 | $title = (get_option('geodir_meta_title_pt')) ? get_option('geodir_meta_title_pt') : $title; |
1887 | 1887 | } |
1888 | - elseif(geodir_is_page('listing')){ |
|
1888 | + elseif (geodir_is_page('listing')) { |
|
1889 | 1889 | $gd_page = 'listing'; |
1890 | 1890 | $title = (get_option('geodir_meta_title_listing')) ? get_option('geodir_meta_title_listing') : $title; |
1891 | 1891 | } |
1892 | - elseif(geodir_is_page('location')){ |
|
1892 | + elseif (geodir_is_page('location')) { |
|
1893 | 1893 | $gd_page = 'location'; |
1894 | 1894 | $title = (get_option('geodir_meta_title_location')) ? get_option('geodir_meta_title_location') : $title; |
1895 | 1895 | } |
1896 | - elseif(geodir_is_page('search')){ |
|
1896 | + elseif (geodir_is_page('search')) { |
|
1897 | 1897 | $gd_page = 'search'; |
1898 | 1898 | $title = (get_option('geodir_meta_title_search')) ? get_option('geodir_meta_title_search') : $title; |
1899 | 1899 | } |
1900 | - elseif(geodir_is_page('add-listing')){ |
|
1900 | + elseif (geodir_is_page('add-listing')) { |
|
1901 | 1901 | $gd_page = 'add-listing'; |
1902 | 1902 | $title = (get_option('geodir_meta_title_add-listing')) ? get_option('geodir_meta_title_add-listing') : $title; |
1903 | 1903 | } |
1904 | - elseif(geodir_is_page('author')){ |
|
1904 | + elseif (geodir_is_page('author')) { |
|
1905 | 1905 | $gd_page = 'author'; |
1906 | 1906 | $title = (get_option('geodir_meta_title_author')) ? get_option('geodir_meta_title_author') : $title; |
1907 | 1907 | } |
1908 | - elseif(geodir_is_page('login')){ |
|
1908 | + elseif (geodir_is_page('login')) { |
|
1909 | 1909 | $gd_page = 'login'; |
1910 | 1910 | $title = (get_option('geodir_meta_title_login')) ? get_option('geodir_meta_title_login') : $title; |
1911 | 1911 | } |
1912 | - elseif(geodir_is_page('listing-success')){ |
|
1912 | + elseif (geodir_is_page('listing-success')) { |
|
1913 | 1913 | $gd_page = 'listing-success'; |
1914 | 1914 | $title = (get_option('geodir_meta_title_listing-success')) ? get_option('geodir_meta_title_listing-success') : $title; |
1915 | 1915 | } |
@@ -1941,12 +1941,12 @@ discard block |
||
1941 | 1941 | |
1942 | 1942 | if (!get_option('geodir_set_post_attachments')) { |
1943 | 1943 | |
1944 | - require_once(ABSPATH . 'wp-admin/includes/image.php'); |
|
1945 | - require_once(ABSPATH . 'wp-admin/includes/file.php'); |
|
1944 | + require_once(ABSPATH.'wp-admin/includes/image.php'); |
|
1945 | + require_once(ABSPATH.'wp-admin/includes/file.php'); |
|
1946 | 1946 | |
1947 | 1947 | $all_postypes = geodir_get_posttypes(); |
1948 | 1948 | |
1949 | - foreach($all_postypes as $post_type){ |
|
1949 | + foreach ($all_postypes as $post_type) { |
|
1950 | 1950 | $args = array( |
1951 | 1951 | 'posts_per_page' => -1, |
1952 | 1952 | 'post_type' => $post_type, |
@@ -2040,7 +2040,7 @@ discard block |
||
2040 | 2040 | { |
2041 | 2041 | $user_id = get_current_user_id(); |
2042 | 2042 | |
2043 | - if(!$user_id){return $post;} |
|
2043 | + if (!$user_id) {return $post; } |
|
2044 | 2044 | |
2045 | 2045 | $gd_post_types = geodir_get_posttypes(); |
2046 | 2046 | |
@@ -2149,7 +2149,7 @@ discard block |
||
2149 | 2149 | |
2150 | 2150 | if (array_key_exists('post_video', $tabs_arr)) { |
2151 | 2151 | |
2152 | - $field_title = $wpdb->get_var($wpdb->prepare("select site_title from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array('geodir_video', $post_type))); |
|
2152 | + $field_title = $wpdb->get_var($wpdb->prepare("select site_title from ".GEODIR_CUSTOM_FIELDS_TABLE." where htmlvar_name = %s and post_type = %s ", array('geodir_video', $post_type))); |
|
2153 | 2153 | |
2154 | 2154 | if (isset($tabs_arr['post_video']['heading_text']) && $field_title != '') |
2155 | 2155 | $tabs_arr['post_video']['heading_text'] = $field_title; |
@@ -2157,7 +2157,7 @@ discard block |
||
2157 | 2157 | |
2158 | 2158 | if (array_key_exists('special_offers', $tabs_arr)) { |
2159 | 2159 | |
2160 | - $field_title = $wpdb->get_var($wpdb->prepare("select site_title from " . GEODIR_CUSTOM_FIELDS_TABLE . " where htmlvar_name = %s and post_type = %s ", array('geodir_special_offers', $post_type))); |
|
2160 | + $field_title = $wpdb->get_var($wpdb->prepare("select site_title from ".GEODIR_CUSTOM_FIELDS_TABLE." where htmlvar_name = %s and post_type = %s ", array('geodir_special_offers', $post_type))); |
|
2161 | 2161 | |
2162 | 2162 | if (isset($tabs_arr['special_offers']['heading_text']) && $field_title != '') |
2163 | 2163 | $tabs_arr['special_offers']['heading_text'] = $field_title; |
@@ -2178,7 +2178,7 @@ discard block |
||
2178 | 2178 | */ |
2179 | 2179 | function geodir_remove_template_redirect_actions() |
2180 | 2180 | { |
2181 | - if (geodir_is_page('login')){ |
|
2181 | + if (geodir_is_page('login')) { |
|
2182 | 2182 | remove_all_actions('template_redirect'); |
2183 | 2183 | remove_action('init', 'avia_modify_front', 10); |
2184 | 2184 | } |
@@ -2225,25 +2225,25 @@ discard block |
||
2225 | 2225 | $split_img_file_path = isset($split_img_path[1]) ? $split_img_path[1] : ''; |
2226 | 2226 | |
2227 | 2227 | $wpdb->query( |
2228 | - $wpdb->prepare("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id = %d AND file=%s ", |
|
2228 | + $wpdb->prepare("DELETE FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id = %d AND file=%s ", |
|
2229 | 2229 | array($post_id, $split_img_file_path) |
2230 | 2230 | ) |
2231 | 2231 | ); |
2232 | 2232 | |
2233 | 2233 | $attachment_data = $wpdb->get_row( |
2234 | - $wpdb->prepare("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=%d", |
|
2234 | + $wpdb->prepare("SELECT ID, MIN(`menu_order`) FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id=%d", |
|
2235 | 2235 | array($post_id) |
2236 | 2236 | ) |
2237 | 2237 | ); |
2238 | 2238 | |
2239 | 2239 | if (!empty($attachment_data)) { |
2240 | - $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID); |
|
2240 | + $wpdb->query("UPDATE ".GEODIR_ATTACHMENT_TABLE." SET menu_order=1 WHERE ID=".$attachment_data->ID); |
|
2241 | 2241 | } |
2242 | 2242 | |
2243 | 2243 | |
2244 | - $table_name = $plugin_prefix . $post_type . '_detail'; |
|
2244 | + $table_name = $plugin_prefix.$post_type.'_detail'; |
|
2245 | 2245 | |
2246 | - $wpdb->query("UPDATE " . $table_name . " SET featured_image='' WHERE post_id =" . $post_id); |
|
2246 | + $wpdb->query("UPDATE ".$table_name." SET featured_image='' WHERE post_id =".$post_id); |
|
2247 | 2247 | |
2248 | 2248 | geodir_set_wp_featured_image($post_id); |
2249 | 2249 | |
@@ -2271,9 +2271,9 @@ discard block |
||
2271 | 2271 | |
2272 | 2272 | foreach ($all_postypes as $posttype) { |
2273 | 2273 | |
2274 | - $tablename = $plugin_prefix . $posttype . '_detail'; |
|
2274 | + $tablename = $plugin_prefix.$posttype.'_detail'; |
|
2275 | 2275 | |
2276 | - $get_post_data = $wpdb->get_results("SELECT post_id FROM " . $tablename); |
|
2276 | + $get_post_data = $wpdb->get_results("SELECT post_id FROM ".$tablename); |
|
2277 | 2277 | |
2278 | 2278 | if (!empty($get_post_data)) { |
2279 | 2279 | |
@@ -2281,7 +2281,7 @@ discard block |
||
2281 | 2281 | |
2282 | 2282 | $post_id = $data->post_id; |
2283 | 2283 | |
2284 | - $attachment_data = $wpdb->get_results("SELECT * FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id =" . $post_id . " AND file!=''"); |
|
2284 | + $attachment_data = $wpdb->get_results("SELECT * FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id =".$post_id." AND file!=''"); |
|
2285 | 2285 | |
2286 | 2286 | if (!empty($attachment_data)) { |
2287 | 2287 | |
@@ -2298,22 +2298,22 @@ discard block |
||
2298 | 2298 | |
2299 | 2299 | $file_name = $file_info['basename']; |
2300 | 2300 | |
2301 | - $img_arr['path'] = $uploads_path . $sub_dir . '/' . $file_name; |
|
2301 | + $img_arr['path'] = $uploads_path.$sub_dir.'/'.$file_name; |
|
2302 | 2302 | |
2303 | 2303 | if (!file_exists($img_arr['path'])) { |
2304 | 2304 | |
2305 | - $wpdb->query("DELETE FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE ID=" . $attach->ID); |
|
2305 | + $wpdb->query("DELETE FROM ".GEODIR_ATTACHMENT_TABLE." WHERE ID=".$attach->ID); |
|
2306 | 2306 | |
2307 | 2307 | } |
2308 | 2308 | |
2309 | 2309 | } |
2310 | 2310 | |
2311 | - $attachment_data = $wpdb->get_row("SELECT ID, MIN(`menu_order`) FROM " . GEODIR_ATTACHMENT_TABLE . " WHERE post_id=" . $post_id . " GROUP BY post_id"); |
|
2311 | + $attachment_data = $wpdb->get_row("SELECT ID, MIN(`menu_order`) FROM ".GEODIR_ATTACHMENT_TABLE." WHERE post_id=".$post_id." GROUP BY post_id"); |
|
2312 | 2312 | |
2313 | 2313 | if (!empty($attachment_data)) { |
2314 | 2314 | |
2315 | 2315 | if ($attachment_data->ID) |
2316 | - $wpdb->query("UPDATE " . GEODIR_ATTACHMENT_TABLE . " SET menu_order=1 WHERE ID=" . $attachment_data->ID); |
|
2316 | + $wpdb->query("UPDATE ".GEODIR_ATTACHMENT_TABLE." SET menu_order=1 WHERE ID=".$attachment_data->ID); |
|
2317 | 2317 | |
2318 | 2318 | } else { |
2319 | 2319 | |
@@ -2327,7 +2327,7 @@ discard block |
||
2327 | 2327 | |
2328 | 2328 | } |
2329 | 2329 | |
2330 | - $wpdb->query("UPDATE " . $tablename . " SET featured_image='' WHERE post_id =" . $post_id); |
|
2330 | + $wpdb->query("UPDATE ".$tablename." SET featured_image='' WHERE post_id =".$post_id); |
|
2331 | 2331 | |
2332 | 2332 | geodir_set_wp_featured_image($post_id); |
2333 | 2333 | |
@@ -2356,7 +2356,7 @@ discard block |
||
2356 | 2356 | { |
2357 | 2357 | |
2358 | 2358 | if (!get_option('geodir_default_rating_star_icon')) { |
2359 | - update_option('geodir_default_rating_star_icon', geodir_plugin_url() . '/geodirectory-assets/images/stars.png'); |
|
2359 | + update_option('geodir_default_rating_star_icon', geodir_plugin_url().'/geodirectory-assets/images/stars.png'); |
|
2360 | 2360 | } |
2361 | 2361 | |
2362 | 2362 | } |
@@ -2373,10 +2373,10 @@ discard block |
||
2373 | 2373 | * @global string $plugin_prefix Geodirectory plugin table prefix. |
2374 | 2374 | * @return array User listing count for each post type. |
2375 | 2375 | */ |
2376 | -function geodir_user_post_listing_count($user_id=null) |
|
2376 | +function geodir_user_post_listing_count($user_id = null) |
|
2377 | 2377 | { |
2378 | 2378 | global $wpdb, $plugin_prefix, $current_user; |
2379 | - if(!$user_id){ |
|
2379 | + if (!$user_id) { |
|
2380 | 2380 | $user_id = $current_user->ID; |
2381 | 2381 | } |
2382 | 2382 | |
@@ -2387,7 +2387,7 @@ discard block |
||
2387 | 2387 | $user_listing = array(); |
2388 | 2388 | if (is_array($all_posts) && !empty($all_posts)) { |
2389 | 2389 | foreach ($all_posts as $ptype) { |
2390 | - $total_posts = $wpdb->get_var("SELECT count( ID ) FROM " . $wpdb->prefix . "posts WHERE post_author=" . $user_id . " AND post_type='" . $ptype . "' AND ( post_status = 'publish' OR post_status = 'draft' OR post_status = 'private' )"); |
|
2390 | + $total_posts = $wpdb->get_var("SELECT count( ID ) FROM ".$wpdb->prefix."posts WHERE post_author=".$user_id." AND post_type='".$ptype."' AND ( post_status = 'publish' OR post_status = 'draft' OR post_status = 'private' )"); |
|
2391 | 2391 | |
2392 | 2392 | if ($total_posts > 0) { |
2393 | 2393 | $user_listing[$ptype] = $total_posts; |
@@ -2490,9 +2490,9 @@ discard block |
||
2490 | 2490 | } |
2491 | 2491 | |
2492 | 2492 | if (strpos($type['field_icon'], 'http') !== false) { |
2493 | - $field_icon = ' background: url(' . $type['field_icon'] . ') no-repeat left center;background-size:18px 18px;padding-left: 21px;'; |
|
2493 | + $field_icon = ' background: url('.$type['field_icon'].') no-repeat left center;background-size:18px 18px;padding-left: 21px;'; |
|
2494 | 2494 | } elseif (strpos($type['field_icon'], 'fa fa-') !== false) { |
2495 | - $field_icon = '<i class="' . $type['field_icon'] . '"></i>'; |
|
2495 | + $field_icon = '<i class="'.$type['field_icon'].'"></i>'; |
|
2496 | 2496 | } |
2497 | 2497 | |
2498 | 2498 | switch ($type['type']) { |
@@ -2500,7 +2500,7 @@ discard block |
||
2500 | 2500 | $i = 0; |
2501 | 2501 | $fieldset_count++; |
2502 | 2502 | $field_set_start = 1; |
2503 | - $fieldset_arr[$fieldset_count]['htmlvar_name'] = 'gd_tab_' . $fieldset_count; |
|
2503 | + $fieldset_arr[$fieldset_count]['htmlvar_name'] = 'gd_tab_'.$fieldset_count; |
|
2504 | 2504 | $fieldset_arr[$fieldset_count]['label'] = $label; |
2505 | 2505 | } |
2506 | 2506 | break; |
@@ -2533,7 +2533,7 @@ discard block |
||
2533 | 2533 | // all search engines that use the nofollow value exclude links that use it from their ranking calculation |
2534 | 2534 | $rel = strpos($website, get_site_url()) !== false ? '' : 'rel="nofollow"'; |
2535 | 2535 | |
2536 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '"><span class="geodir-i-website" style="' . $field_icon . '">' . $field_icon_af . ' <a href="' . $website . '" target="_blank" ' . $rel . ' ><strong>' . |
|
2536 | + $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'"><span class="geodir-i-website" style="'.$field_icon.'">'.$field_icon_af.' <a href="'.$website.'" target="_blank" '.$rel.' ><strong>'. |
|
2537 | 2537 | /** |
2538 | 2538 | * Filer the custom field website name. |
2539 | 2539 | * |
@@ -2542,7 +2542,7 @@ discard block |
||
2542 | 2542 | * @param string $website The website address. |
2543 | 2543 | * @param int $post->ID The post ID. |
2544 | 2544 | */ |
2545 | - apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID) . '</strong></a></span></div>'; |
|
2545 | + apply_filters('geodir_custom_field_website_name', $title, $website, $post->ID).'</strong></a></span></div>'; |
|
2546 | 2546 | } |
2547 | 2547 | break; |
2548 | 2548 | case 'phone': { |
@@ -2557,11 +2557,11 @@ discard block |
||
2557 | 2557 | |
2558 | 2558 | $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
2559 | 2559 | |
2560 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-contact" style="' . $field_icon . '">' . $field_icon_af; |
|
2560 | + $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-contact" style="'.$field_icon.'">'.$field_icon_af; |
|
2561 | 2561 | if ($field_set_start == 1 && $site_title != '') { |
2562 | - $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
2562 | + $html .= ' '.__($site_title, 'geodirectory').': '; |
|
2563 | 2563 | } |
2564 | - $html .= ' </span>' . $post->{$type['htmlvar_name']} . '</div>'; |
|
2564 | + $html .= ' </span>'.$post->{$type['htmlvar_name']}.'</div>'; |
|
2565 | 2565 | } |
2566 | 2566 | break; |
2567 | 2567 | case 'time': { |
@@ -2580,11 +2580,11 @@ discard block |
||
2580 | 2580 | |
2581 | 2581 | $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
2582 | 2582 | |
2583 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-time" style="' . $field_icon . '">' . $field_icon_af; |
|
2583 | + $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-time" style="'.$field_icon.'">'.$field_icon_af; |
|
2584 | 2584 | if ($field_set_start == 1 && $site_title != '') { |
2585 | - $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
2585 | + $html .= ' '.__($site_title, 'geodirectory').': '; |
|
2586 | 2586 | } |
2587 | - $html .= ' </span>' . $value . '</div>'; |
|
2587 | + $html .= ' </span>'.$value.'</div>'; |
|
2588 | 2588 | } |
2589 | 2589 | break; |
2590 | 2590 | case 'datepicker': { |
@@ -2594,8 +2594,8 @@ discard block |
||
2594 | 2594 | $date_format = $date_format['date_format']; |
2595 | 2595 | } |
2596 | 2596 | |
2597 | - $search = array('dd','d','DD','mm','m','MM','yy'); //jQuery UI datepicker format |
|
2598 | - $replace = array('d','j','l','m','n','F','Y');//PHP date format |
|
2597 | + $search = array('dd', 'd', 'DD', 'mm', 'm', 'MM', 'yy'); //jQuery UI datepicker format |
|
2598 | + $replace = array('d', 'j', 'l', 'm', 'n', 'F', 'Y'); //PHP date format |
|
2599 | 2599 | |
2600 | 2600 | $date_format = str_replace($search, $replace, $date_format); |
2601 | 2601 | |
@@ -2616,11 +2616,11 @@ discard block |
||
2616 | 2616 | |
2617 | 2617 | $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
2618 | 2618 | |
2619 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-datepicker" style="' . $field_icon . '">' . $field_icon_af; |
|
2619 | + $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-datepicker" style="'.$field_icon.'">'.$field_icon_af; |
|
2620 | 2620 | if ($field_set_start == 1 && $site_title != '') { |
2621 | - $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
2621 | + $html .= ' '.__($site_title, 'geodirectory').': '; |
|
2622 | 2622 | } |
2623 | - $html .= ' </span>' . $value . '</div>'; |
|
2623 | + $html .= ' </span>'.$value.'</div>'; |
|
2624 | 2624 | } |
2625 | 2625 | break; |
2626 | 2626 | case 'text': { |
@@ -2635,11 +2635,11 @@ discard block |
||
2635 | 2635 | |
2636 | 2636 | $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
2637 | 2637 | |
2638 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af; |
|
2638 | + $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-text" style="'.$field_icon.'">'.$field_icon_af; |
|
2639 | 2639 | if ($field_set_start == 1 && $site_title != '') { |
2640 | - $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
2640 | + $html .= ' '.__($site_title, 'geodirectory').': '; |
|
2641 | 2641 | } |
2642 | - $html .= ' </span>' . $post->{$type['htmlvar_name']} . '</div>'; |
|
2642 | + $html .= ' </span>'.$post->{$type['htmlvar_name']}.'</div>'; |
|
2643 | 2643 | } |
2644 | 2644 | break; |
2645 | 2645 | case 'radio': { |
@@ -2676,13 +2676,13 @@ discard block |
||
2676 | 2676 | |
2677 | 2677 | $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
2678 | 2678 | |
2679 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-radio" style="' . $field_icon . '">' . $field_icon_af; |
|
2679 | + $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-radio" style="'.$field_icon.'">'.$field_icon_af; |
|
2680 | 2680 | |
2681 | 2681 | if ($field_set_start == 1 && $site_title != '') { |
2682 | - $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
2682 | + $html .= ' '.__($site_title, 'geodirectory').': '; |
|
2683 | 2683 | } |
2684 | 2684 | |
2685 | - $html .= ' </span>' . $html_val . '</div>'; |
|
2685 | + $html .= ' </span>'.$html_val.'</div>'; |
|
2686 | 2686 | } |
2687 | 2687 | } |
2688 | 2688 | break; |
@@ -2690,7 +2690,7 @@ discard block |
||
2690 | 2690 | $html_var = $type['htmlvar_name']; |
2691 | 2691 | $html_val = $type['htmlvar_name']; |
2692 | 2692 | |
2693 | - if ((int)$post->{$html_var} == 1) { |
|
2693 | + if ((int) $post->{$html_var} == 1) { |
|
2694 | 2694 | |
2695 | 2695 | if ($post->{$type['htmlvar_name']} == '1') { |
2696 | 2696 | $html_val = __('Yes', 'geodirectory'); |
@@ -2709,13 +2709,13 @@ discard block |
||
2709 | 2709 | |
2710 | 2710 | $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
2711 | 2711 | |
2712 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-checkbox" style="' . $field_icon . '">' . $field_icon_af; |
|
2712 | + $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-checkbox" style="'.$field_icon.'">'.$field_icon_af; |
|
2713 | 2713 | |
2714 | 2714 | if ($field_set_start == 1 && $site_title != '') { |
2715 | - $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
2715 | + $html .= ' '.__($site_title, 'geodirectory').': '; |
|
2716 | 2716 | } |
2717 | 2717 | |
2718 | - $html .= ' </span>' . $html_val . '</div>'; |
|
2718 | + $html .= ' </span>'.$html_val.'</div>'; |
|
2719 | 2719 | } |
2720 | 2720 | } |
2721 | 2721 | break; |
@@ -2745,11 +2745,11 @@ discard block |
||
2745 | 2745 | |
2746 | 2746 | $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
2747 | 2747 | |
2748 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af; |
|
2748 | + $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-select" style="'.$field_icon.'">'.$field_icon_af; |
|
2749 | 2749 | if ($field_set_start == 1 && $site_title != '') { |
2750 | - $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
2750 | + $html .= ' '.__($site_title, 'geodirectory').': '; |
|
2751 | 2751 | } |
2752 | - $html .= ' </span>' . $field_value . '</div>'; |
|
2752 | + $html .= ' </span>'.$field_value.'</div>'; |
|
2753 | 2753 | } |
2754 | 2754 | break; |
2755 | 2755 | case 'multiselect': { |
@@ -2783,18 +2783,18 @@ discard block |
||
2783 | 2783 | |
2784 | 2784 | $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
2785 | 2785 | |
2786 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-select" style="' . $field_icon . '">' . $field_icon_af; |
|
2786 | + $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-select" style="'.$field_icon.'">'.$field_icon_af; |
|
2787 | 2787 | if ($field_set_start == 1 && $site_title != '') { |
2788 | - $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
2788 | + $html .= ' '.__($site_title, 'geodirectory').': '; |
|
2789 | 2789 | } |
2790 | 2790 | $html .= ' </span>'; |
2791 | 2791 | |
2792 | 2792 | $html .= ' <span class="gd-multiselect-value-output gd-val-'.$type['htmlvar_name'].'" >'; |
2793 | 2793 | |
2794 | 2794 | if (count($option_values) > 1) { |
2795 | - $html .= "<span>".implode('</span>, <span>',$option_values)."</span>"; |
|
2795 | + $html .= "<span>".implode('</span>, <span>', $option_values)."</span>"; |
|
2796 | 2796 | } else { |
2797 | - $vals = explode(",",$post->{$type['htmlvar_name']}); |
|
2797 | + $vals = explode(",", $post->{$type['htmlvar_name']}); |
|
2798 | 2798 | $html .= "<span>".implode('</span>, <span>', $vals)."</span>"; |
2799 | 2799 | } |
2800 | 2800 | |
@@ -2818,11 +2818,11 @@ discard block |
||
2818 | 2818 | |
2819 | 2819 | $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
2820 | 2820 | |
2821 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-email" style="' . $field_icon . '">' . $field_icon_af; |
|
2821 | + $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-email" style="'.$field_icon.'">'.$field_icon_af; |
|
2822 | 2822 | if ($field_set_start == 1 && $site_title != '') { |
2823 | - $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
2823 | + $html .= ' '.__($site_title, 'geodirectory').': '; |
|
2824 | 2824 | } |
2825 | - $html .= ' </span>' . $post->{$type['htmlvar_name']} . '</div>'; |
|
2825 | + $html .= ' </span>'.$post->{$type['htmlvar_name']}.'</div>'; |
|
2826 | 2826 | } |
2827 | 2827 | break; |
2828 | 2828 | case 'textarea': { |
@@ -2837,11 +2837,11 @@ discard block |
||
2837 | 2837 | |
2838 | 2838 | $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
2839 | 2839 | |
2840 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af; |
|
2840 | + $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-text" style="'.$field_icon.'">'.$field_icon_af; |
|
2841 | 2841 | if ($field_set_start == 1 && $site_title != '') { |
2842 | - $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
2842 | + $html .= ' '.__($site_title, 'geodirectory').': '; |
|
2843 | 2843 | } |
2844 | - $html .= '</span>' . wpautop($post->{$type['htmlvar_name']}) . '</div>'; |
|
2844 | + $html .= '</span>'.wpautop($post->{$type['htmlvar_name']}).'</div>'; |
|
2845 | 2845 | } |
2846 | 2846 | break; |
2847 | 2847 | case 'html': { |
@@ -2856,11 +2856,11 @@ discard block |
||
2856 | 2856 | |
2857 | 2857 | $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
2858 | 2858 | |
2859 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . '" style="clear:both;"><span class="geodir-i-text" style="' . $field_icon . '">' . $field_icon_af; |
|
2859 | + $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].'" style="clear:both;"><span class="geodir-i-text" style="'.$field_icon.'">'.$field_icon_af; |
|
2860 | 2860 | if ($field_set_start == 1 && $site_title != '') { |
2861 | - $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
2861 | + $html .= ' '.__($site_title, 'geodirectory').': '; |
|
2862 | 2862 | } |
2863 | - $html .= ' </span>' . wpautop($post->{$type['htmlvar_name']}) . '</div>'; |
|
2863 | + $html .= ' </span>'.wpautop($post->{$type['htmlvar_name']}).'</div>'; |
|
2864 | 2864 | } |
2865 | 2865 | break; |
2866 | 2866 | case 'file': { |
@@ -2871,7 +2871,7 @@ discard block |
||
2871 | 2871 | |
2872 | 2872 | if (!empty($files)) { |
2873 | 2873 | $extra_fields = !empty($type['extra_fields']) ? maybe_unserialize($type['extra_fields']) : NULL; |
2874 | - $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'] : ''; |
|
2874 | + $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'] : ''; |
|
2875 | 2875 | |
2876 | 2876 | $file_paths = ''; |
2877 | 2877 | foreach ($files as $file) { |
@@ -2900,9 +2900,9 @@ discard block |
||
2900 | 2900 | $file_paths .= '</a>'; |
2901 | 2901 | $file_paths .= '</div>'; |
2902 | 2902 | } else { |
2903 | - $ext_path = '_' . $html_var . '_'; |
|
2903 | + $ext_path = '_'.$html_var.'_'; |
|
2904 | 2904 | $filename = explode($ext_path, $filename); |
2905 | - $file_paths .= '<a href="' . $file . '" target="_blank">' . $filename[count($filename) - 1] . '</a>'; |
|
2905 | + $file_paths .= '<a href="'.$file.'" target="_blank">'.$filename[count($filename) - 1].'</a>'; |
|
2906 | 2906 | } |
2907 | 2907 | } |
2908 | 2908 | } |
@@ -2919,13 +2919,13 @@ discard block |
||
2919 | 2919 | $geodir_odd_even = $field_set_start == 1 && $i % 2 == 0 ? 'geodir_more_info_even' : 'geodir_more_info_odd'; |
2920 | 2920 | |
2921 | 2921 | |
2922 | - $html = '<div class="geodir_more_info ' . $geodir_odd_even . ' ' . $type['css_class'] . ' ' . $type['htmlvar_name'] . ' geodir-custom-file-box" style="clear:both;"><span class="geodir-i-file" style="display:inline-block;vertical-align:top;padding-right:14px;' . $field_icon . '">' . $field_icon_af; |
|
2922 | + $html = '<div class="geodir_more_info '.$geodir_odd_even.' '.$type['css_class'].' '.$type['htmlvar_name'].' geodir-custom-file-box" style="clear:both;"><span class="geodir-i-file" style="display:inline-block;vertical-align:top;padding-right:14px;'.$field_icon.'">'.$field_icon_af; |
|
2923 | 2923 | |
2924 | 2924 | if ($field_set_start == 1 && $site_title != '') { |
2925 | - $html .= ' ' . __($site_title, 'geodirectory') . ': '; |
|
2925 | + $html .= ' '.__($site_title, 'geodirectory').': '; |
|
2926 | 2926 | } |
2927 | 2927 | |
2928 | - $html .= ' </span>' . $file_paths . '</div>'; |
|
2928 | + $html .= ' </span>'.$file_paths.'</div>'; |
|
2929 | 2929 | } |
2930 | 2930 | } |
2931 | 2931 | } |
@@ -2976,7 +2976,7 @@ discard block |
||
2976 | 2976 | * @param string $htmlvar_name The field HTML var name. |
2977 | 2977 | */ |
2978 | 2978 | 'is_display' => apply_filters('geodir_detail_page_tab_is_display', true, $htmlvar_name), |
2979 | - 'tab_content' => '<div class="geodir-company_info field-group">' . $fieldset_html . '</html>' |
|
2979 | + 'tab_content' => '<div class="geodir-company_info field-group">'.$fieldset_html.'</html>' |
|
2980 | 2980 | ); |
2981 | 2981 | } |
2982 | 2982 | } else { |
@@ -3036,7 +3036,7 @@ discard block |
||
3036 | 3036 | } |
3037 | 3037 | $status .= ")</strong>"; |
3038 | 3038 | |
3039 | - $html = '<span class="geodir-post-status">' . $status_icon . ' <font class="geodir-status-label">' . __('Status: ', 'geodirectory') . '</font>' . $status . '</span>'; |
|
3039 | + $html = '<span class="geodir-post-status">'.$status_icon.' <font class="geodir-status-label">'.__('Status: ', 'geodirectory').'</font>'.$status.'</span>'; |
|
3040 | 3040 | } |
3041 | 3041 | } |
3042 | 3042 | |
@@ -3116,7 +3116,7 @@ discard block |
||
3116 | 3116 | function geodir_no_rating_comment_text($content, $comment = '') |
3117 | 3117 | { |
3118 | 3118 | if (!is_admin()) { |
3119 | - return '<div class="description">' . $content . '</div>'; |
|
3119 | + return '<div class="description">'.$content.'</div>'; |
|
3120 | 3120 | } else { |
3121 | 3121 | return $content; |
3122 | 3122 | } |
@@ -3194,7 +3194,7 @@ discard block |
||
3194 | 3194 | $classes[] = 'gd-no-rating'; |
3195 | 3195 | } |
3196 | 3196 | |
3197 | - $classes[] = 'gd-map-' . geodir_map_name(); |
|
3197 | + $classes[] = 'gd-map-'.geodir_map_name(); |
|
3198 | 3198 | |
3199 | 3199 | return $classes; |
3200 | 3200 | } |
@@ -3214,7 +3214,7 @@ discard block |
||
3214 | 3214 | $class .= ' gd-no-rating'; |
3215 | 3215 | } |
3216 | 3216 | |
3217 | - $class .= ' gd-map-' . geodir_map_name(); |
|
3217 | + $class .= ' gd-map-'.geodir_map_name(); |
|
3218 | 3218 | |
3219 | 3219 | return $class; |
3220 | 3220 | } |
@@ -3249,7 +3249,7 @@ discard block |
||
3249 | 3249 | * @return array Translation texts. |
3250 | 3250 | */ |
3251 | 3251 | function geodir_load_gd_options_text_translation($translation_texts = array()) { |
3252 | - $translation_texts = !empty( $translation_texts ) && is_array( $translation_texts ) ? $translation_texts : array(); |
|
3252 | + $translation_texts = !empty($translation_texts) && is_array($translation_texts) ? $translation_texts : array(); |
|
3253 | 3253 | |
3254 | 3254 | $gd_options = array('geodir_post_submited_success_email_subject_admin', 'geodir_post_submited_success_email_content_admin', 'geodir_post_submited_success_email_subject', 'geodir_post_submited_success_email_content', 'geodir_forgot_password_subject', 'geodir_forgot_password_content', 'geodir_registration_success_email_subject', 'geodir_registration_success_email_content', 'geodir_post_published_email_subject', 'geodir_post_published_email_content', 'geodir_email_friend_subject', 'geodir_email_friend_content', 'geodir_email_enquiry_subject', 'geodir_email_enquiry_content', 'geodir_post_added_success_msg_content', 'geodir_post_edited_email_subject_admin', 'geodir_post_edited_email_content_admin'); |
3255 | 3255 | |
@@ -3315,14 +3315,14 @@ discard block |
||
3315 | 3315 | * @param array $args The array of menu arguments. |
3316 | 3316 | * @return array The modified arguments. |
3317 | 3317 | */ |
3318 | -function geodir_add_nav_menu_class( $args ) |
|
3318 | +function geodir_add_nav_menu_class($args) |
|
3319 | 3319 | { |
3320 | 3320 | |
3321 | - if(isset($args['menu_class'])){ |
|
3321 | + if (isset($args['menu_class'])) { |
|
3322 | 3322 | $args['menu_class'] = $args['menu_class']." gd-menu-z"; |
3323 | 3323 | } |
3324 | 3324 | |
3325 | 3325 | return $args; |
3326 | 3326 | } |
3327 | 3327 | |
3328 | -add_filter( 'wp_nav_menu_args', 'geodir_add_nav_menu_class' ); |
|
3329 | 3328 | \ No newline at end of file |
3329 | +add_filter('wp_nav_menu_args', 'geodir_add_nav_menu_class'); |
|
3330 | 3330 | \ No newline at end of file |