@@ -6,26 +6,26 @@ discard block |
||
6 | 6 | * @package GeoDirectory |
7 | 7 | */ |
8 | 8 | if (!function_exists('geodir_create_tables')) { |
9 | - /** |
|
10 | - * Creates custom db tables for storing GeoDirectory plugin data. |
|
11 | - * |
|
12 | - * @since 1.0.0 |
|
13 | - * @package GeoDirectory |
|
14 | - * @global object $wpdb WordPress Database object. |
|
15 | - * @global string $plugin_prefix GeoDirectory plugin table prefix. |
|
16 | - */ |
|
17 | - function geodir_create_tables() |
|
18 | - { |
|
19 | - |
|
20 | - global $wpdb, $plugin_prefix; |
|
21 | - |
|
22 | - $wpdb->hide_errors(); |
|
23 | - |
|
24 | - $collate = ''; |
|
25 | - if ($wpdb->has_cap('collation')) { |
|
26 | - if (!empty($wpdb->charset)) $collate = "DEFAULT CHARACTER SET $wpdb->charset"; |
|
27 | - if (!empty($wpdb->collate)) $collate .= " COLLATE $wpdb->collate"; |
|
28 | - } |
|
9 | + /** |
|
10 | + * Creates custom db tables for storing GeoDirectory plugin data. |
|
11 | + * |
|
12 | + * @since 1.0.0 |
|
13 | + * @package GeoDirectory |
|
14 | + * @global object $wpdb WordPress Database object. |
|
15 | + * @global string $plugin_prefix GeoDirectory plugin table prefix. |
|
16 | + */ |
|
17 | + function geodir_create_tables() |
|
18 | + { |
|
19 | + |
|
20 | + global $wpdb, $plugin_prefix; |
|
21 | + |
|
22 | + $wpdb->hide_errors(); |
|
23 | + |
|
24 | + $collate = ''; |
|
25 | + if ($wpdb->has_cap('collation')) { |
|
26 | + if (!empty($wpdb->charset)) $collate = "DEFAULT CHARACTER SET $wpdb->charset"; |
|
27 | + if (!empty($wpdb->collate)) $collate .= " COLLATE $wpdb->collate"; |
|
28 | + } |
|
29 | 29 | |
30 | 30 | /** |
31 | 31 | * Include any functions needed for upgrades. |
@@ -36,31 +36,31 @@ discard block |
||
36 | 36 | |
37 | 37 | |
38 | 38 | // rename tables if we need to |
39 | - if ($wpdb->query("SHOW TABLES LIKE 'geodir_countries'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "geodir_countries'") == 0) { |
|
40 | - $wpdb->query("RENAME TABLE geodir_countries TO " . $wpdb->prefix . "geodir_countries"); |
|
41 | - } |
|
42 | - if ($wpdb->query("SHOW TABLES LIKE 'geodir_custom_fields'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "geodir_custom_fields'") == 0) { |
|
43 | - $wpdb->query("RENAME TABLE geodir_custom_fields TO " . $wpdb->prefix . "geodir_custom_fields"); |
|
44 | - } |
|
45 | - if ($wpdb->query("SHOW TABLES LIKE 'geodir_post_icon'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "geodir_post_icon'") == 0) { |
|
46 | - $wpdb->query("RENAME TABLE geodir_post_icon TO " . $wpdb->prefix . "geodir_post_icon"); |
|
47 | - } |
|
48 | - if ($wpdb->query("SHOW TABLES LIKE 'geodir_attachments'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "geodir_attachments'") == 0) { |
|
49 | - $wpdb->query("RENAME TABLE geodir_attachments TO " . $wpdb->prefix . "geodir_attachments"); |
|
50 | - } |
|
51 | - if ($wpdb->query("SHOW TABLES LIKE 'geodir_post_review'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "geodir_post_review'") == 0) { |
|
52 | - $wpdb->query("RENAME TABLE geodir_post_review TO " . $wpdb->prefix . "geodir_post_review"); |
|
53 | - } |
|
54 | - if ($wpdb->query("SHOW TABLES LIKE 'geodir_custom_sort_fields'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "geodir_custom_sort_fields'") == 0) { |
|
55 | - $wpdb->query("RENAME TABLE geodir_custom_sort_fields TO " . $wpdb->prefix . "geodir_custom_sort_fields"); |
|
56 | - } |
|
57 | - if ($wpdb->query("SHOW TABLES LIKE 'geodir_gd_place_detail'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "geodir_gd_place_detail'") == 0) { |
|
58 | - $wpdb->query("RENAME TABLE geodir_gd_place_detail TO " . $wpdb->prefix . "geodir_gd_place_detail"); |
|
59 | - } |
|
60 | - |
|
61 | - |
|
62 | - // Table for storing Countries |
|
63 | - $GEODIR_COUNTRIES_TABLE = "CREATE TABLE " . GEODIR_COUNTRIES_TABLE . " ( |
|
39 | + if ($wpdb->query("SHOW TABLES LIKE 'geodir_countries'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "geodir_countries'") == 0) { |
|
40 | + $wpdb->query("RENAME TABLE geodir_countries TO " . $wpdb->prefix . "geodir_countries"); |
|
41 | + } |
|
42 | + if ($wpdb->query("SHOW TABLES LIKE 'geodir_custom_fields'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "geodir_custom_fields'") == 0) { |
|
43 | + $wpdb->query("RENAME TABLE geodir_custom_fields TO " . $wpdb->prefix . "geodir_custom_fields"); |
|
44 | + } |
|
45 | + if ($wpdb->query("SHOW TABLES LIKE 'geodir_post_icon'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "geodir_post_icon'") == 0) { |
|
46 | + $wpdb->query("RENAME TABLE geodir_post_icon TO " . $wpdb->prefix . "geodir_post_icon"); |
|
47 | + } |
|
48 | + if ($wpdb->query("SHOW TABLES LIKE 'geodir_attachments'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "geodir_attachments'") == 0) { |
|
49 | + $wpdb->query("RENAME TABLE geodir_attachments TO " . $wpdb->prefix . "geodir_attachments"); |
|
50 | + } |
|
51 | + if ($wpdb->query("SHOW TABLES LIKE 'geodir_post_review'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "geodir_post_review'") == 0) { |
|
52 | + $wpdb->query("RENAME TABLE geodir_post_review TO " . $wpdb->prefix . "geodir_post_review"); |
|
53 | + } |
|
54 | + if ($wpdb->query("SHOW TABLES LIKE 'geodir_custom_sort_fields'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "geodir_custom_sort_fields'") == 0) { |
|
55 | + $wpdb->query("RENAME TABLE geodir_custom_sort_fields TO " . $wpdb->prefix . "geodir_custom_sort_fields"); |
|
56 | + } |
|
57 | + if ($wpdb->query("SHOW TABLES LIKE 'geodir_gd_place_detail'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "geodir_gd_place_detail'") == 0) { |
|
58 | + $wpdb->query("RENAME TABLE geodir_gd_place_detail TO " . $wpdb->prefix . "geodir_gd_place_detail"); |
|
59 | + } |
|
60 | + |
|
61 | + |
|
62 | + // Table for storing Countries |
|
63 | + $GEODIR_COUNTRIES_TABLE = "CREATE TABLE " . GEODIR_COUNTRIES_TABLE . " ( |
|
64 | 64 | CountryId smallint AUTO_INCREMENT NOT NULL , |
65 | 65 | Country varchar (50) NOT NULL , |
66 | 66 | FIPS104 varchar (2) NOT NULL , |
@@ -79,21 +79,21 @@ discard block |
||
79 | 79 | Comment varchar (255) NULL , |
80 | 80 | PRIMARY KEY (CountryId)) $collate "; |
81 | 81 | |
82 | - /** |
|
83 | - * Filter the SQL query that creates/updates the country DB table structure. |
|
84 | - * |
|
85 | - * @since 1.0.0 |
|
86 | - * @param string $sql The SQL insert query string. |
|
87 | - */ |
|
88 | - $GEODIR_COUNTRIES_TABLE = apply_filters('geodir_before_country_table_create', $GEODIR_COUNTRIES_TABLE); |
|
89 | - dbDelta($GEODIR_COUNTRIES_TABLE); |
|
82 | + /** |
|
83 | + * Filter the SQL query that creates/updates the country DB table structure. |
|
84 | + * |
|
85 | + * @since 1.0.0 |
|
86 | + * @param string $sql The SQL insert query string. |
|
87 | + */ |
|
88 | + $GEODIR_COUNTRIES_TABLE = apply_filters('geodir_before_country_table_create', $GEODIR_COUNTRIES_TABLE); |
|
89 | + dbDelta($GEODIR_COUNTRIES_TABLE); |
|
90 | 90 | |
91 | 91 | |
92 | - $country_table_empty = $wpdb->get_var("SELECT COUNT(CountryId) FROM " . GEODIR_COUNTRIES_TABLE . ""); |
|
92 | + $country_table_empty = $wpdb->get_var("SELECT COUNT(CountryId) FROM " . GEODIR_COUNTRIES_TABLE . ""); |
|
93 | 93 | |
94 | - if ($country_table_empty == 0) { |
|
94 | + if ($country_table_empty == 0) { |
|
95 | 95 | |
96 | - $countries_insert = "INSERT INTO " . GEODIR_COUNTRIES_TABLE . " (`CountryId`, `Country`, `FIPS104`, `ISO2`, `ISO3`, `ISON`, `Internet`, `Capital`, `MapReference`, `NationalitySingular`, `NationalityPlural`, `Currency`, `CurrencyCode`, `Population`, `Title`, `COMMENT`) VALUES |
|
96 | + $countries_insert = "INSERT INTO " . GEODIR_COUNTRIES_TABLE . " (`CountryId`, `Country`, `FIPS104`, `ISO2`, `ISO3`, `ISON`, `Internet`, `Capital`, `MapReference`, `NationalitySingular`, `NationalityPlural`, `Currency`, `CurrencyCode`, `Population`, `Title`, `COMMENT`) VALUES |
|
97 | 97 | (1, 'Afghanistan', 'AF', 'AF', 'AFG', '4', 'AF', 'Kabul ', 'Asia ', 'Afghan', 'Afghans', 'Afghani ', 'AFA', 26813057, 'Afghanistan', ''), |
98 | 98 | (2, 'Albania', 'AL', 'AL', 'ALB', '8', 'AL', 'Tirana ', 'Europe ', 'Albanian', 'Albanians', 'Lek ', 'ALL', 3510484, 'Albania', ''), |
99 | 99 | (3, 'Algeria', 'AG', 'DZ', 'DZA', '12', 'DZ', 'Algiers ', 'Africa ', 'Algerian', 'Algerians', 'Algerian Dinar ', 'DZD', 31736053, 'Algeria', ''), |
@@ -367,21 +367,21 @@ discard block |
||
367 | 367 | (276, 'Curaçao', 'UC', 'CW', 'CUW', '531', 'CW', 'Willemstad ', 'Central America and the Caribbean', 'Curaçaoan', 'Curaçaoans', 'Netherlands Antillean guilder', 'ANG', 152760, 'Curaçao', ''), |
368 | 368 | (277, 'Caribbean Netherlands', '--', 'BQ', 'BES', '535', 'BQ', '--', 'Central America and the Caribbean', '--', '--', 'United States dollar', 'USD', 21133, 'Caribbean Netherlands', '')"; |
369 | 369 | |
370 | - /** |
|
371 | - * Filter the SQL query that inserts the country DB table data. |
|
372 | - * |
|
373 | - * @since 1.0.0 |
|
374 | - * @param string $sql The SQL insert query string. |
|
375 | - */ |
|
376 | - $countries_insert = apply_filters('geodir_before_country_data_insert', $countries_insert); |
|
377 | - $wpdb->query($countries_insert); |
|
370 | + /** |
|
371 | + * Filter the SQL query that inserts the country DB table data. |
|
372 | + * |
|
373 | + * @since 1.0.0 |
|
374 | + * @param string $sql The SQL insert query string. |
|
375 | + */ |
|
376 | + $countries_insert = apply_filters('geodir_before_country_data_insert', $countries_insert); |
|
377 | + $wpdb->query($countries_insert); |
|
378 | 378 | |
379 | - } |
|
379 | + } |
|
380 | 380 | |
381 | 381 | |
382 | - // Table for storing location attribute - these are user defined |
|
382 | + // Table for storing location attribute - these are user defined |
|
383 | 383 | |
384 | - $icon_table = "CREATE TABLE " . GEODIR_ICON_TABLE . " ( |
|
384 | + $icon_table = "CREATE TABLE " . GEODIR_ICON_TABLE . " ( |
|
385 | 385 | id int NOT NULL AUTO_INCREMENT, |
386 | 386 | post_id int( 10 ) NOT NULL, |
387 | 387 | post_title varchar(254) NOT NULL, |
@@ -390,19 +390,19 @@ discard block |
||
390 | 390 | PRIMARY KEY (id) |
391 | 391 | ) $collate "; |
392 | 392 | |
393 | - /** |
|
394 | - * Filter the SQL query that creates/updates the post_icon DB table structure. |
|
395 | - * |
|
396 | - * @since 1.0.0 |
|
397 | - * @param string $sql The SQL insert query string. |
|
398 | - */ |
|
399 | - $icon_table = apply_filters('geodir_before_icon_table_create', $icon_table); |
|
393 | + /** |
|
394 | + * Filter the SQL query that creates/updates the post_icon DB table structure. |
|
395 | + * |
|
396 | + * @since 1.0.0 |
|
397 | + * @param string $sql The SQL insert query string. |
|
398 | + */ |
|
399 | + $icon_table = apply_filters('geodir_before_icon_table_create', $icon_table); |
|
400 | 400 | |
401 | - dbDelta($icon_table); |
|
401 | + dbDelta($icon_table); |
|
402 | 402 | |
403 | - // Table for storing post custom fields - these are user defined |
|
403 | + // Table for storing post custom fields - these are user defined |
|
404 | 404 | |
405 | - $post_custom_fields = "CREATE TABLE " . GEODIR_CUSTOM_FIELDS_TABLE . " ( |
|
405 | + $post_custom_fields = "CREATE TABLE " . GEODIR_CUSTOM_FIELDS_TABLE . " ( |
|
406 | 406 | id int(11) NOT NULL AUTO_INCREMENT, |
407 | 407 | post_type varchar(100) NULL, |
408 | 408 | data_type varchar(100) NULL DEFAULT NULL, |
@@ -436,18 +436,18 @@ discard block |
||
436 | 436 | PRIMARY KEY (id) |
437 | 437 | ) $collate"; |
438 | 438 | |
439 | - /** |
|
440 | - * Filter the SQL query that creates/updates the custom_fields DB table structure. |
|
441 | - * |
|
442 | - * @since 1.0.0 |
|
443 | - * @param string $sql The SQL insert query string. |
|
444 | - */ |
|
445 | - $post_custom_fields = apply_filters('geodir_before_custom_field_table_create', $post_custom_fields); |
|
439 | + /** |
|
440 | + * Filter the SQL query that creates/updates the custom_fields DB table structure. |
|
441 | + * |
|
442 | + * @since 1.0.0 |
|
443 | + * @param string $sql The SQL insert query string. |
|
444 | + */ |
|
445 | + $post_custom_fields = apply_filters('geodir_before_custom_field_table_create', $post_custom_fields); |
|
446 | 446 | |
447 | - dbDelta($post_custom_fields); |
|
447 | + dbDelta($post_custom_fields); |
|
448 | 448 | |
449 | - // Table for storing place attribute - these are user defined |
|
450 | - $post_detail = "CREATE TABLE " . $plugin_prefix . "gd_place_detail ( |
|
449 | + // Table for storing place attribute - these are user defined |
|
450 | + $post_detail = "CREATE TABLE " . $plugin_prefix . "gd_place_detail ( |
|
451 | 451 | post_id int(11) NOT NULL, |
452 | 452 | post_title text NULL DEFAULT NULL, |
453 | 453 | post_status varchar(20) NULL DEFAULT NULL, |
@@ -473,22 +473,22 @@ discard block |
||
473 | 473 | PRIMARY KEY (post_id) |
474 | 474 | ) $collate "; |
475 | 475 | |
476 | - /** |
|
477 | - * Filter the SQL query that creates/updates the post_detail DB table structure. |
|
478 | - * |
|
479 | - * @since 1.0.0 |
|
480 | - * @param string $sql The SQL insert query string. |
|
481 | - */ |
|
482 | - $post_detail = apply_filters('geodir_before_post_detail_table_create', $post_detail); |
|
476 | + /** |
|
477 | + * Filter the SQL query that creates/updates the post_detail DB table structure. |
|
478 | + * |
|
479 | + * @since 1.0.0 |
|
480 | + * @param string $sql The SQL insert query string. |
|
481 | + */ |
|
482 | + $post_detail = apply_filters('geodir_before_post_detail_table_create', $post_detail); |
|
483 | 483 | |
484 | - dbDelta($post_detail); |
|
484 | + dbDelta($post_detail); |
|
485 | 485 | |
486 | - // alter post_title |
|
487 | - //$wpdb->query("ALTER TABLE ".$wpdb->prefix."geodir_gd_place_detail MODIFY `post_title` text NULL"); |
|
486 | + // alter post_title |
|
487 | + //$wpdb->query("ALTER TABLE ".$wpdb->prefix."geodir_gd_place_detail MODIFY `post_title` text NULL"); |
|
488 | 488 | |
489 | - // Table for storing place images - these are user defined |
|
489 | + // Table for storing place images - these are user defined |
|
490 | 490 | |
491 | - $attechment_table = "CREATE TABLE " . GEODIR_ATTACHMENT_TABLE . " ( |
|
491 | + $attechment_table = "CREATE TABLE " . GEODIR_ATTACHMENT_TABLE . " ( |
|
492 | 492 | ID int(11) NOT NULL AUTO_INCREMENT, |
493 | 493 | post_id int(11) NOT NULL, |
494 | 494 | user_id int(11) DEFAULT NULL, |
@@ -504,18 +504,18 @@ discard block |
||
504 | 504 | PRIMARY KEY (ID) |
505 | 505 | ) $collate "; |
506 | 506 | |
507 | - /** |
|
508 | - * Filter the SQL query that creates/updates the attachments DB table structure. |
|
509 | - * |
|
510 | - * @since 1.0.0 |
|
511 | - * @param string $sql The SQL insert query string. |
|
512 | - */ |
|
513 | - $attechment_table = apply_filters('geodir_before_attachment_table_create', $attechment_table); |
|
507 | + /** |
|
508 | + * Filter the SQL query that creates/updates the attachments DB table structure. |
|
509 | + * |
|
510 | + * @since 1.0.0 |
|
511 | + * @param string $sql The SQL insert query string. |
|
512 | + */ |
|
513 | + $attechment_table = apply_filters('geodir_before_attachment_table_create', $attechment_table); |
|
514 | 514 | |
515 | - dbDelta($attechment_table); |
|
515 | + dbDelta($attechment_table); |
|
516 | 516 | |
517 | 517 | |
518 | - $custom_sort_fields_table = "CREATE TABLE " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " ( |
|
518 | + $custom_sort_fields_table = "CREATE TABLE " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " ( |
|
519 | 519 | id int(11) NOT NULL AUTO_INCREMENT, |
520 | 520 | post_type varchar(255) NOT NULL, |
521 | 521 | data_type varchar(255) NOT NULL, |
@@ -533,18 +533,18 @@ discard block |
||
533 | 533 | PRIMARY KEY (id) |
534 | 534 | ) $collate "; |
535 | 535 | |
536 | - /** |
|
537 | - * Filter the SQL query that creates/updates the custom_sort_fields DB table structure. |
|
538 | - * |
|
539 | - * @since 1.0.0 |
|
540 | - * @param string $sql The SQL insert query string. |
|
541 | - */ |
|
542 | - $custom_sort_fields_table = apply_filters('geodir_before_sort_fields_table_create', $custom_sort_fields_table); |
|
536 | + /** |
|
537 | + * Filter the SQL query that creates/updates the custom_sort_fields DB table structure. |
|
538 | + * |
|
539 | + * @since 1.0.0 |
|
540 | + * @param string $sql The SQL insert query string. |
|
541 | + */ |
|
542 | + $custom_sort_fields_table = apply_filters('geodir_before_sort_fields_table_create', $custom_sort_fields_table); |
|
543 | 543 | |
544 | - dbDelta($custom_sort_fields_table); |
|
544 | + dbDelta($custom_sort_fields_table); |
|
545 | 545 | |
546 | 546 | |
547 | - $review_table = "CREATE TABLE " . GEODIR_REVIEW_TABLE . " ( |
|
547 | + $review_table = "CREATE TABLE " . GEODIR_REVIEW_TABLE . " ( |
|
548 | 548 | id int(11) NOT NULL AUTO_INCREMENT, |
549 | 549 | post_id int(11) DEFAULT NULL, |
550 | 550 | post_title varchar( 255 ) NULL DEFAULT NULL, |
@@ -568,191 +568,191 @@ discard block |
||
568 | 568 | PRIMARY KEY (id) |
569 | 569 | ) $collate "; |
570 | 570 | |
571 | - /** |
|
572 | - * Filter the SQL query that creates the review DB table structure. |
|
573 | - * |
|
574 | - * @since 1.0.0 |
|
575 | - * @param string $sql The SQL insert query string. |
|
576 | - */ |
|
577 | - $review_table = apply_filters('geodir_before_review_table_create', $review_table); |
|
578 | - dbDelta($review_table); |
|
571 | + /** |
|
572 | + * Filter the SQL query that creates the review DB table structure. |
|
573 | + * |
|
574 | + * @since 1.0.0 |
|
575 | + * @param string $sql The SQL insert query string. |
|
576 | + */ |
|
577 | + $review_table = apply_filters('geodir_before_review_table_create', $review_table); |
|
578 | + dbDelta($review_table); |
|
579 | 579 | |
580 | 580 | |
581 | 581 | |
582 | - // Alter terms table |
|
583 | - $term_icon_column = $wpdb->get_var("SHOW COLUMNS FROM $wpdb->terms where field='term_icon'"); |
|
584 | - if (!$term_icon_column) { |
|
585 | - $wpdb->query("ALTER TABLE $wpdb->terms ADD `term_icon` TEXT NULL DEFAULT NULL"); |
|
586 | - } |
|
582 | + // Alter terms table |
|
583 | + $term_icon_column = $wpdb->get_var("SHOW COLUMNS FROM $wpdb->terms where field='term_icon'"); |
|
584 | + if (!$term_icon_column) { |
|
585 | + $wpdb->query("ALTER TABLE $wpdb->terms ADD `term_icon` TEXT NULL DEFAULT NULL"); |
|
586 | + } |
|
587 | 587 | |
588 | - //require_once(geodir_plugin_path() . '/upgrade.php'); |
|
588 | + //require_once(geodir_plugin_path() . '/upgrade.php'); |
|
589 | 589 | |
590 | 590 | |
591 | - } |
|
591 | + } |
|
592 | 592 | } // END MAIN FUNCTION geodir_tables_install |
593 | 593 | |
594 | 594 | if (!function_exists('geodir_create_default_fields')) { |
595 | - /** |
|
596 | - * Inserts default custom fields table data into database. |
|
597 | - * |
|
598 | - * @since 1.0.0 |
|
599 | - * @package GeoDirectory |
|
600 | - */ |
|
601 | - function geodir_create_default_fields() |
|
602 | - { |
|
603 | - |
|
604 | - $fields = array(); |
|
605 | - |
|
606 | - $fields[] = array('listing_type' => 'gd_place', |
|
607 | - 'data_type' => 'VARCHAR', |
|
608 | - 'field_type' => 'taxonomy', |
|
609 | - 'admin_title' => __('Category', 'geodirectory'), |
|
610 | - 'admin_desc' => __('SELECT listing category FROM here. SELECT at least one CATEGORY', 'geodirectory'), |
|
611 | - 'site_title' => __('Category', 'geodirectory'), |
|
612 | - 'htmlvar_name' => 'gd_placecategory', |
|
613 | - 'default_value' => '', |
|
614 | - 'is_default' => '1', |
|
615 | - 'is_admin' => '1', |
|
616 | - 'is_required' => '1', |
|
617 | - 'clabels' => __('Category', 'geodirectory')); |
|
618 | - |
|
619 | - $fields[] = array('listing_type' => 'gd_place', |
|
620 | - 'data_type' => 'VARCHAR', |
|
621 | - 'field_type' => 'address', |
|
622 | - 'admin_title' => __('Address', 'geodirectory'), |
|
623 | - 'admin_desc' => ADDRESS_MSG, |
|
624 | - 'site_title' => __('Address', 'geodirectory'), |
|
625 | - 'htmlvar_name' => 'post', |
|
626 | - 'default_value' => '', |
|
627 | - 'option_values' => '', |
|
628 | - 'is_default' => '1', |
|
629 | - 'is_admin' => '1', |
|
630 | - 'is_required' => '1', |
|
631 | - 'required_msg' => __('Address fields are required', 'geodirectory'), |
|
632 | - 'clabels' => __('Address', 'geodirectory'), |
|
633 | - 'extra' => array('show_city' => 1, 'city_lable' => __('City', 'geodirectory'), |
|
634 | - 'show_region' => 1, 'region_lable' => __('Region', 'geodirectory'), |
|
635 | - 'show_country' => 1, 'country_lable' => __('Country', 'geodirectory'), |
|
636 | - 'show_zip' => 1, 'zip_lable' => __('Zip/Post Code', 'geodirectory'), |
|
637 | - 'show_map' => 1, 'map_lable' => __('Set Address On Map', 'geodirectory'), |
|
638 | - 'show_mapview' => 1, 'mapview_lable' => __('Select Map View', 'geodirectory'), |
|
639 | - 'show_mapzoom' => 1, 'mapzoom_lable' => 'hidden', |
|
640 | - 'show_latlng' => 1)); |
|
641 | - |
|
642 | - $fields[] = array('listing_type' => 'gd_place', |
|
643 | - 'data_type' => 'VARCHAR', |
|
644 | - 'field_type' => 'text', |
|
645 | - 'admin_title' => __('Time', 'geodirectory'), |
|
646 | - 'admin_desc' => __('Enter Business or Listing Timing Information.<br/>eg. : 10.00 am to 6 pm every day', 'geodirectory'), |
|
647 | - 'site_title' => __('Time', 'geodirectory'), |
|
648 | - 'htmlvar_name' => 'timing', |
|
649 | - 'default_value' => '', |
|
650 | - 'option_values' => '', |
|
651 | - 'is_default' => '1', |
|
652 | - 'is_admin' => '1', |
|
653 | - 'clabels' => __('Time', 'geodirectory')); |
|
654 | - |
|
655 | - $fields[] = array('listing_type' => 'gd_place', |
|
656 | - 'data_type' => 'VARCHAR', |
|
657 | - 'field_type' => 'phone', |
|
658 | - 'admin_title' => __('Phone', 'geodirectory'), |
|
659 | - 'admin_desc' => __('You can enter phone number,cell phone number etc.', 'geodirectory'), |
|
660 | - 'site_title' => __('Phone', 'geodirectory'), |
|
661 | - 'htmlvar_name' => 'contact', |
|
662 | - 'default_value' => '', |
|
663 | - 'option_values' => '', |
|
664 | - 'is_default' => '1', |
|
665 | - 'is_admin' => '1', |
|
666 | - 'clabels' => __('Phone', 'geodirectory')); |
|
667 | - |
|
668 | - $fields[] = array('listing_type' => 'gd_place', |
|
669 | - 'data_type' => 'VARCHAR', |
|
670 | - 'field_type' => 'email', |
|
671 | - 'admin_title' => __('Email', 'geodirectory'), |
|
672 | - 'admin_desc' => __('You can enter your business or listing email.', 'geodirectory'), |
|
673 | - 'site_title' => __('Email', 'geodirectory'), |
|
674 | - 'htmlvar_name' => 'email', |
|
675 | - 'default_value' => '', |
|
676 | - 'option_values' => '', |
|
677 | - 'is_default' => '1', |
|
678 | - 'is_admin' => '1', |
|
679 | - 'clabels' => __('Email', 'geodirectory')); |
|
680 | - |
|
681 | - $fields[] = array('listing_type' => 'gd_place', |
|
682 | - 'data_type' => 'VARCHAR', |
|
683 | - 'field_type' => 'url', |
|
684 | - 'admin_title' => __('Website', 'geodirectory'), |
|
685 | - 'admin_desc' => __('You can enter your business or listing website.', 'geodirectory'), |
|
686 | - 'site_title' => __('Website', 'geodirectory'), |
|
687 | - 'htmlvar_name' => 'website', |
|
688 | - 'default_value' => '', |
|
689 | - 'option_values' => '', |
|
690 | - 'is_default' => '1', |
|
691 | - 'is_admin' => '1', |
|
692 | - 'clabels' => __('Website', 'geodirectory')); |
|
693 | - |
|
694 | - $fields[] = array('listing_type' => 'gd_place', |
|
695 | - 'data_type' => 'VARCHAR', |
|
696 | - 'field_type' => 'url', |
|
697 | - 'admin_title' => __('Twitter', 'geodirectory'), |
|
698 | - 'admin_desc' => __('You can enter your business or listing twitter url.', 'geodirectory'), |
|
699 | - 'site_title' => __('Twitter', 'geodirectory'), |
|
700 | - 'htmlvar_name' => 'twitter', |
|
701 | - 'default_value' => '', |
|
702 | - 'option_values' => '', |
|
703 | - 'is_default' => '1', |
|
704 | - 'is_admin' => '1', |
|
705 | - 'clabels' => __('Twitter', 'geodirectory')); |
|
706 | - |
|
707 | - $fields[] = array('listing_type' => 'gd_place', |
|
708 | - 'data_type' => 'VARCHAR', |
|
709 | - 'field_type' => 'url', |
|
710 | - 'admin_title' => __('Facebook', 'geodirectory'), |
|
711 | - 'admin_desc' => __('You can enter your business or listing facebook url.', 'geodirectory'), |
|
712 | - 'site_title' => __('Facebook', 'geodirectory'), |
|
713 | - 'htmlvar_name' => 'facebook', |
|
714 | - 'default_value' => '', |
|
715 | - 'option_values' => '', |
|
716 | - 'is_default' => '1', |
|
717 | - 'is_admin' => '1', |
|
718 | - 'clabels' => __('Facebook', 'geodirectory')); |
|
719 | - |
|
720 | - $fields[] = array('listing_type' => 'gd_place', |
|
721 | - 'data_type' => 'TEXT', |
|
722 | - 'field_type' => 'textarea', |
|
723 | - 'admin_title' => __('Video', 'geodirectory'), |
|
724 | - 'admin_desc' => __('Add video code here, YouTube etc.', 'geodirectory'), |
|
725 | - 'site_title' => __('Video', 'geodirectory'), |
|
726 | - 'htmlvar_name' => 'video', |
|
727 | - 'default_value' => '', |
|
728 | - 'option_values' => '', |
|
729 | - 'is_default' => '0', |
|
730 | - 'is_admin' => '1', |
|
731 | - 'clabels' => __('Video', 'geodirectory')); |
|
732 | - |
|
733 | - $fields[] = array('listing_type' => 'gd_place', |
|
734 | - 'data_type' => 'TEXT', |
|
735 | - 'field_type' => 'textarea', |
|
736 | - 'admin_title' => __('Special Offers', 'geodirectory'), |
|
737 | - 'admin_desc' => __('Note: List out any special offers (optional)', 'geodirectory'), |
|
738 | - 'site_title' => __('Special Offers', 'geodirectory'), |
|
739 | - 'htmlvar_name' => 'special_offers', |
|
740 | - 'default_value' => '', |
|
741 | - 'option_values' => '', |
|
742 | - 'is_default' => '0', |
|
743 | - 'is_admin' => '1', |
|
744 | - 'clabels' => __('Special Offers', 'geodirectory')); |
|
745 | - |
|
746 | - /** |
|
747 | - * Filter the array of default custom fields DB table data. |
|
748 | - * |
|
749 | - * @since 1.0.0 |
|
750 | - * @param string $fields The default custom fields as an array. |
|
751 | - */ |
|
752 | - $fields = apply_filters('geodir_before_default_custom_fields_saved', $fields); |
|
753 | - foreach ($fields as $field_index => $field) { |
|
754 | - geodir_custom_field_save($field); |
|
755 | - |
|
756 | - } |
|
757 | - } |
|
595 | + /** |
|
596 | + * Inserts default custom fields table data into database. |
|
597 | + * |
|
598 | + * @since 1.0.0 |
|
599 | + * @package GeoDirectory |
|
600 | + */ |
|
601 | + function geodir_create_default_fields() |
|
602 | + { |
|
603 | + |
|
604 | + $fields = array(); |
|
605 | + |
|
606 | + $fields[] = array('listing_type' => 'gd_place', |
|
607 | + 'data_type' => 'VARCHAR', |
|
608 | + 'field_type' => 'taxonomy', |
|
609 | + 'admin_title' => __('Category', 'geodirectory'), |
|
610 | + 'admin_desc' => __('SELECT listing category FROM here. SELECT at least one CATEGORY', 'geodirectory'), |
|
611 | + 'site_title' => __('Category', 'geodirectory'), |
|
612 | + 'htmlvar_name' => 'gd_placecategory', |
|
613 | + 'default_value' => '', |
|
614 | + 'is_default' => '1', |
|
615 | + 'is_admin' => '1', |
|
616 | + 'is_required' => '1', |
|
617 | + 'clabels' => __('Category', 'geodirectory')); |
|
618 | + |
|
619 | + $fields[] = array('listing_type' => 'gd_place', |
|
620 | + 'data_type' => 'VARCHAR', |
|
621 | + 'field_type' => 'address', |
|
622 | + 'admin_title' => __('Address', 'geodirectory'), |
|
623 | + 'admin_desc' => ADDRESS_MSG, |
|
624 | + 'site_title' => __('Address', 'geodirectory'), |
|
625 | + 'htmlvar_name' => 'post', |
|
626 | + 'default_value' => '', |
|
627 | + 'option_values' => '', |
|
628 | + 'is_default' => '1', |
|
629 | + 'is_admin' => '1', |
|
630 | + 'is_required' => '1', |
|
631 | + 'required_msg' => __('Address fields are required', 'geodirectory'), |
|
632 | + 'clabels' => __('Address', 'geodirectory'), |
|
633 | + 'extra' => array('show_city' => 1, 'city_lable' => __('City', 'geodirectory'), |
|
634 | + 'show_region' => 1, 'region_lable' => __('Region', 'geodirectory'), |
|
635 | + 'show_country' => 1, 'country_lable' => __('Country', 'geodirectory'), |
|
636 | + 'show_zip' => 1, 'zip_lable' => __('Zip/Post Code', 'geodirectory'), |
|
637 | + 'show_map' => 1, 'map_lable' => __('Set Address On Map', 'geodirectory'), |
|
638 | + 'show_mapview' => 1, 'mapview_lable' => __('Select Map View', 'geodirectory'), |
|
639 | + 'show_mapzoom' => 1, 'mapzoom_lable' => 'hidden', |
|
640 | + 'show_latlng' => 1)); |
|
641 | + |
|
642 | + $fields[] = array('listing_type' => 'gd_place', |
|
643 | + 'data_type' => 'VARCHAR', |
|
644 | + 'field_type' => 'text', |
|
645 | + 'admin_title' => __('Time', 'geodirectory'), |
|
646 | + 'admin_desc' => __('Enter Business or Listing Timing Information.<br/>eg. : 10.00 am to 6 pm every day', 'geodirectory'), |
|
647 | + 'site_title' => __('Time', 'geodirectory'), |
|
648 | + 'htmlvar_name' => 'timing', |
|
649 | + 'default_value' => '', |
|
650 | + 'option_values' => '', |
|
651 | + 'is_default' => '1', |
|
652 | + 'is_admin' => '1', |
|
653 | + 'clabels' => __('Time', 'geodirectory')); |
|
654 | + |
|
655 | + $fields[] = array('listing_type' => 'gd_place', |
|
656 | + 'data_type' => 'VARCHAR', |
|
657 | + 'field_type' => 'phone', |
|
658 | + 'admin_title' => __('Phone', 'geodirectory'), |
|
659 | + 'admin_desc' => __('You can enter phone number,cell phone number etc.', 'geodirectory'), |
|
660 | + 'site_title' => __('Phone', 'geodirectory'), |
|
661 | + 'htmlvar_name' => 'contact', |
|
662 | + 'default_value' => '', |
|
663 | + 'option_values' => '', |
|
664 | + 'is_default' => '1', |
|
665 | + 'is_admin' => '1', |
|
666 | + 'clabels' => __('Phone', 'geodirectory')); |
|
667 | + |
|
668 | + $fields[] = array('listing_type' => 'gd_place', |
|
669 | + 'data_type' => 'VARCHAR', |
|
670 | + 'field_type' => 'email', |
|
671 | + 'admin_title' => __('Email', 'geodirectory'), |
|
672 | + 'admin_desc' => __('You can enter your business or listing email.', 'geodirectory'), |
|
673 | + 'site_title' => __('Email', 'geodirectory'), |
|
674 | + 'htmlvar_name' => 'email', |
|
675 | + 'default_value' => '', |
|
676 | + 'option_values' => '', |
|
677 | + 'is_default' => '1', |
|
678 | + 'is_admin' => '1', |
|
679 | + 'clabels' => __('Email', 'geodirectory')); |
|
680 | + |
|
681 | + $fields[] = array('listing_type' => 'gd_place', |
|
682 | + 'data_type' => 'VARCHAR', |
|
683 | + 'field_type' => 'url', |
|
684 | + 'admin_title' => __('Website', 'geodirectory'), |
|
685 | + 'admin_desc' => __('You can enter your business or listing website.', 'geodirectory'), |
|
686 | + 'site_title' => __('Website', 'geodirectory'), |
|
687 | + 'htmlvar_name' => 'website', |
|
688 | + 'default_value' => '', |
|
689 | + 'option_values' => '', |
|
690 | + 'is_default' => '1', |
|
691 | + 'is_admin' => '1', |
|
692 | + 'clabels' => __('Website', 'geodirectory')); |
|
693 | + |
|
694 | + $fields[] = array('listing_type' => 'gd_place', |
|
695 | + 'data_type' => 'VARCHAR', |
|
696 | + 'field_type' => 'url', |
|
697 | + 'admin_title' => __('Twitter', 'geodirectory'), |
|
698 | + 'admin_desc' => __('You can enter your business or listing twitter url.', 'geodirectory'), |
|
699 | + 'site_title' => __('Twitter', 'geodirectory'), |
|
700 | + 'htmlvar_name' => 'twitter', |
|
701 | + 'default_value' => '', |
|
702 | + 'option_values' => '', |
|
703 | + 'is_default' => '1', |
|
704 | + 'is_admin' => '1', |
|
705 | + 'clabels' => __('Twitter', 'geodirectory')); |
|
706 | + |
|
707 | + $fields[] = array('listing_type' => 'gd_place', |
|
708 | + 'data_type' => 'VARCHAR', |
|
709 | + 'field_type' => 'url', |
|
710 | + 'admin_title' => __('Facebook', 'geodirectory'), |
|
711 | + 'admin_desc' => __('You can enter your business or listing facebook url.', 'geodirectory'), |
|
712 | + 'site_title' => __('Facebook', 'geodirectory'), |
|
713 | + 'htmlvar_name' => 'facebook', |
|
714 | + 'default_value' => '', |
|
715 | + 'option_values' => '', |
|
716 | + 'is_default' => '1', |
|
717 | + 'is_admin' => '1', |
|
718 | + 'clabels' => __('Facebook', 'geodirectory')); |
|
719 | + |
|
720 | + $fields[] = array('listing_type' => 'gd_place', |
|
721 | + 'data_type' => 'TEXT', |
|
722 | + 'field_type' => 'textarea', |
|
723 | + 'admin_title' => __('Video', 'geodirectory'), |
|
724 | + 'admin_desc' => __('Add video code here, YouTube etc.', 'geodirectory'), |
|
725 | + 'site_title' => __('Video', 'geodirectory'), |
|
726 | + 'htmlvar_name' => 'video', |
|
727 | + 'default_value' => '', |
|
728 | + 'option_values' => '', |
|
729 | + 'is_default' => '0', |
|
730 | + 'is_admin' => '1', |
|
731 | + 'clabels' => __('Video', 'geodirectory')); |
|
732 | + |
|
733 | + $fields[] = array('listing_type' => 'gd_place', |
|
734 | + 'data_type' => 'TEXT', |
|
735 | + 'field_type' => 'textarea', |
|
736 | + 'admin_title' => __('Special Offers', 'geodirectory'), |
|
737 | + 'admin_desc' => __('Note: List out any special offers (optional)', 'geodirectory'), |
|
738 | + 'site_title' => __('Special Offers', 'geodirectory'), |
|
739 | + 'htmlvar_name' => 'special_offers', |
|
740 | + 'default_value' => '', |
|
741 | + 'option_values' => '', |
|
742 | + 'is_default' => '0', |
|
743 | + 'is_admin' => '1', |
|
744 | + 'clabels' => __('Special Offers', 'geodirectory')); |
|
745 | + |
|
746 | + /** |
|
747 | + * Filter the array of default custom fields DB table data. |
|
748 | + * |
|
749 | + * @since 1.0.0 |
|
750 | + * @param string $fields The default custom fields as an array. |
|
751 | + */ |
|
752 | + $fields = apply_filters('geodir_before_default_custom_fields_saved', $fields); |
|
753 | + foreach ($fields as $field_index => $field) { |
|
754 | + geodir_custom_field_save($field); |
|
755 | + |
|
756 | + } |
|
757 | + } |
|
758 | 758 | } |
759 | 759 | \ No newline at end of file |
@@ -16,184 +16,184 @@ |
||
16 | 16 | */ |
17 | 17 | $geodir_settings['permalink_settings'] = apply_filters('geodir_permalink_settings', array( |
18 | 18 | |
19 | - /* Listing Permalink Settings start */ |
|
20 | - array('name' => __('Permalink', 'geodirectory'), 'type' => 'no_tabs', 'desc' => 'Settings to set permalink', 'id' => 'geodir_permalink_settings '), |
|
21 | - |
|
22 | - |
|
23 | - array('name' => __('Listing Detail Permalink Settings', 'geodirectory'), |
|
24 | - 'type' => 'sectionstart', |
|
25 | - 'desc' => '', |
|
26 | - 'id' => 'geodir_permalink'), |
|
27 | - |
|
28 | - array( |
|
29 | - 'name' => __('Add location in urls', 'geodirectory'), |
|
30 | - 'desc' => __('Add location slug in listing urls', 'geodirectory'), |
|
31 | - 'id' => 'geodir_add_location_url', |
|
32 | - 'type' => 'checkbox', |
|
33 | - 'std' => '1', |
|
34 | - 'checkboxgroup' => 'start' |
|
35 | - ), |
|
36 | - |
|
37 | - array( |
|
38 | - 'name' => __('Add full location in listing urls', 'geodirectory'), |
|
39 | - 'desc' => __('Add full location info with country, region and city slug in listing urls', 'geodirectory'), |
|
40 | - 'id' => 'geodir_show_location_url', |
|
41 | - 'type' => 'radio', |
|
42 | - 'value' => 'all', |
|
43 | - 'std' => 'all', |
|
44 | - 'radiogroup' => '' |
|
45 | - ), |
|
46 | - |
|
47 | - array( |
|
48 | - 'name' => __('Add country and city slug in listing urls', 'geodirectory'), |
|
49 | - 'desc' => __('Add country and city slug in listing urls (/country/city/)', 'geodirectory'), |
|
50 | - 'id' => 'geodir_show_location_url', |
|
51 | - 'type' => 'radio', |
|
52 | - 'std' => 'all', |
|
53 | - 'value' => 'country_city', |
|
54 | - 'radiogroup' => '' |
|
55 | - ), |
|
56 | - array( |
|
57 | - 'name' => __('Add region and city slug in listing urls', 'geodirectory'), |
|
58 | - 'desc' => __('Add region and city slug in listing urls (/region/city/)', 'geodirectory'), |
|
59 | - 'id' => 'geodir_show_location_url', |
|
60 | - 'type' => 'radio', |
|
61 | - 'std' => 'all', |
|
62 | - 'value' => 'region_city', |
|
63 | - 'radiogroup' => '' |
|
64 | - ), |
|
65 | - array( |
|
66 | - 'name' => __('Add only city in listing urls', 'geodirectory'), |
|
67 | - 'desc' => __('Add city slug in listing urls', 'geodirectory'), |
|
68 | - 'id' => 'geodir_show_location_url', |
|
69 | - 'type' => 'radio', |
|
70 | - 'std' => 'all', |
|
71 | - 'value' => 'city', |
|
72 | - 'radiogroup' => 'end' |
|
73 | - ), |
|
74 | - |
|
75 | - |
|
76 | - |
|
77 | - array( |
|
78 | - 'name' => __('Add category in listing urls', 'geodirectory'), |
|
79 | - 'desc' => __('Add requested category slugs in listing urls', 'geodirectory'), |
|
80 | - 'id' => 'geodir_add_categories_url', |
|
81 | - 'type' => 'checkbox', |
|
82 | - 'std' => '1', |
|
83 | - ), |
|
84 | - |
|
85 | - array( |
|
86 | - 'name' => __('Listing url prefix', 'geodirectory'), |
|
87 | - 'desc' => __('Listing prefix to show in url', 'geodirectory'), |
|
88 | - 'id' => 'geodir_listing_prefix', |
|
89 | - 'type' => 'text', |
|
90 | - 'css' => 'min-width:300px;', |
|
91 | - 'std' => 'places' |
|
92 | - ), |
|
93 | - |
|
94 | - array( |
|
95 | - 'name' => __('Location url prefix', 'geodirectory'), |
|
96 | - 'desc' => __('Depreciated, now uses the location page slug', 'geodirectory'), |
|
97 | - 'id' => 'geodir_location_prefix', |
|
98 | - 'type' => 'text', |
|
99 | - 'css' => 'min-width:300px;', |
|
100 | - 'std' => 'location' // Default value to show home top section |
|
101 | - ), |
|
102 | - |
|
103 | - array( |
|
104 | - 'name' => __('Location and category url separator', 'geodirectory'), |
|
105 | - 'desc' => __('Separator to show between location and category url slugs in listing urls', 'geodirectory'), |
|
106 | - 'id' => 'geodir_listingurl_separator', |
|
107 | - 'type' => 'text', |
|
108 | - 'css' => 'min-width:300px;', |
|
109 | - 'std' => 'C' // Default value to show home top section |
|
110 | - ), |
|
111 | - |
|
112 | - array( |
|
113 | - 'name' => __('Listing detail url separator', 'geodirectory'), |
|
114 | - 'desc' => __('Separator to show before listing slug in listing detail urls', 'geodirectory'), |
|
115 | - 'id' => 'geodir_detailurl_separator', |
|
116 | - 'type' => 'text', |
|
117 | - 'css' => 'min-width:300px;', |
|
118 | - 'std' => 'info' // Default value to show home top section |
|
119 | - ), |
|
120 | - |
|
121 | - |
|
122 | - array('type' => 'sectionend', 'id' => 'geodir_permalink'), |
|
123 | - |
|
124 | - array('name' => __('GeoDirectory Pages', 'geodirectory'), |
|
125 | - 'type' => 'sectionstart', |
|
126 | - 'desc' => '', |
|
127 | - 'id' => 'geodir_pages'), |
|
128 | - |
|
129 | - array( |
|
130 | - 'name' => __('GD Home page', 'geodirectory'), |
|
131 | - 'desc' => __('Select the page to use for the GD homepage (you must also set this page in Settings>Reading>Front page for it to work)', 'geodirectory'), |
|
132 | - 'id' => 'geodir_home_page', |
|
133 | - 'type' => 'single_select_page', |
|
134 | - 'class' => 'chosen_select' |
|
135 | - ), |
|
136 | - |
|
137 | - array( |
|
138 | - 'name' => __('Add listing page', 'geodirectory'), |
|
139 | - 'desc' => __('Select the page to use for adding listings', 'geodirectory'), |
|
140 | - 'id' => 'geodir_add_listing_page', |
|
141 | - 'type' => 'single_select_page', |
|
142 | - 'class' => 'chosen_select' |
|
143 | - ), |
|
144 | - |
|
145 | - array( |
|
146 | - 'name' => __('Listing preview page', 'geodirectory'), |
|
147 | - 'desc' => __('Select the page to use for listing preview', 'geodirectory'), |
|
148 | - 'id' => 'geodir_preview_page', |
|
149 | - 'type' => 'single_select_page', |
|
150 | - 'class' => 'chosen_select' |
|
151 | - ), |
|
152 | - |
|
153 | - array( |
|
154 | - 'name' => __('Listing success page', 'geodirectory'), |
|
155 | - 'desc' => __('Select the page to use for listing success', 'geodirectory'), |
|
156 | - 'id' => 'geodir_success_page', |
|
157 | - 'type' => 'single_select_page', |
|
158 | - 'class' => 'chosen_select' |
|
159 | - ), |
|
160 | - |
|
161 | - array( |
|
162 | - 'name' => __('Location page', 'geodirectory'), |
|
163 | - 'desc' => __('Select the page to use for locations', 'geodirectory'), |
|
164 | - 'id' => 'geodir_location_page', |
|
165 | - 'type' => 'single_select_page', |
|
166 | - 'class' => 'chosen_select' |
|
167 | - ), |
|
168 | - |
|
169 | - array( |
|
170 | - 'name' => __('Terms and Conditions page', 'geodirectory'), |
|
171 | - 'desc' => __('Select the page to use for Terms and Conditions (if enabled)', 'geodirectory'), |
|
172 | - 'id' => 'geodir_term_condition_page', |
|
173 | - 'type' => 'single_select_page', |
|
174 | - 'class' => 'chosen_select' |
|
175 | - ), |
|
176 | - |
|
177 | - array( |
|
178 | - 'name' => __('Info page', 'geodirectory'), |
|
179 | - 'desc' => __('Select the page to use for Gd general Info', 'geodirectory'), |
|
180 | - 'id' => 'geodir_info_page', |
|
181 | - 'type' => 'single_select_page', |
|
182 | - 'class' => 'chosen_select' |
|
183 | - ), |
|
184 | - |
|
185 | - array( |
|
186 | - 'name' => __('Login page', 'geodirectory'), |
|
187 | - 'desc' => __('Select the page to use for Login / Register', 'geodirectory'), |
|
188 | - 'id' => 'geodir_login_page', |
|
189 | - 'type' => 'single_select_page', |
|
190 | - 'class' => 'chosen_select' |
|
191 | - ), |
|
192 | - |
|
193 | - |
|
194 | - array('type' => 'sectionend', 'id' => 'geodir_pages'), |
|
195 | - |
|
196 | - /* Listing Detail Permalink Settings End */ |
|
19 | + /* Listing Permalink Settings start */ |
|
20 | + array('name' => __('Permalink', 'geodirectory'), 'type' => 'no_tabs', 'desc' => 'Settings to set permalink', 'id' => 'geodir_permalink_settings '), |
|
21 | + |
|
22 | + |
|
23 | + array('name' => __('Listing Detail Permalink Settings', 'geodirectory'), |
|
24 | + 'type' => 'sectionstart', |
|
25 | + 'desc' => '', |
|
26 | + 'id' => 'geodir_permalink'), |
|
27 | + |
|
28 | + array( |
|
29 | + 'name' => __('Add location in urls', 'geodirectory'), |
|
30 | + 'desc' => __('Add location slug in listing urls', 'geodirectory'), |
|
31 | + 'id' => 'geodir_add_location_url', |
|
32 | + 'type' => 'checkbox', |
|
33 | + 'std' => '1', |
|
34 | + 'checkboxgroup' => 'start' |
|
35 | + ), |
|
36 | + |
|
37 | + array( |
|
38 | + 'name' => __('Add full location in listing urls', 'geodirectory'), |
|
39 | + 'desc' => __('Add full location info with country, region and city slug in listing urls', 'geodirectory'), |
|
40 | + 'id' => 'geodir_show_location_url', |
|
41 | + 'type' => 'radio', |
|
42 | + 'value' => 'all', |
|
43 | + 'std' => 'all', |
|
44 | + 'radiogroup' => '' |
|
45 | + ), |
|
46 | + |
|
47 | + array( |
|
48 | + 'name' => __('Add country and city slug in listing urls', 'geodirectory'), |
|
49 | + 'desc' => __('Add country and city slug in listing urls (/country/city/)', 'geodirectory'), |
|
50 | + 'id' => 'geodir_show_location_url', |
|
51 | + 'type' => 'radio', |
|
52 | + 'std' => 'all', |
|
53 | + 'value' => 'country_city', |
|
54 | + 'radiogroup' => '' |
|
55 | + ), |
|
56 | + array( |
|
57 | + 'name' => __('Add region and city slug in listing urls', 'geodirectory'), |
|
58 | + 'desc' => __('Add region and city slug in listing urls (/region/city/)', 'geodirectory'), |
|
59 | + 'id' => 'geodir_show_location_url', |
|
60 | + 'type' => 'radio', |
|
61 | + 'std' => 'all', |
|
62 | + 'value' => 'region_city', |
|
63 | + 'radiogroup' => '' |
|
64 | + ), |
|
65 | + array( |
|
66 | + 'name' => __('Add only city in listing urls', 'geodirectory'), |
|
67 | + 'desc' => __('Add city slug in listing urls', 'geodirectory'), |
|
68 | + 'id' => 'geodir_show_location_url', |
|
69 | + 'type' => 'radio', |
|
70 | + 'std' => 'all', |
|
71 | + 'value' => 'city', |
|
72 | + 'radiogroup' => 'end' |
|
73 | + ), |
|
74 | + |
|
75 | + |
|
76 | + |
|
77 | + array( |
|
78 | + 'name' => __('Add category in listing urls', 'geodirectory'), |
|
79 | + 'desc' => __('Add requested category slugs in listing urls', 'geodirectory'), |
|
80 | + 'id' => 'geodir_add_categories_url', |
|
81 | + 'type' => 'checkbox', |
|
82 | + 'std' => '1', |
|
83 | + ), |
|
84 | + |
|
85 | + array( |
|
86 | + 'name' => __('Listing url prefix', 'geodirectory'), |
|
87 | + 'desc' => __('Listing prefix to show in url', 'geodirectory'), |
|
88 | + 'id' => 'geodir_listing_prefix', |
|
89 | + 'type' => 'text', |
|
90 | + 'css' => 'min-width:300px;', |
|
91 | + 'std' => 'places' |
|
92 | + ), |
|
93 | + |
|
94 | + array( |
|
95 | + 'name' => __('Location url prefix', 'geodirectory'), |
|
96 | + 'desc' => __('Depreciated, now uses the location page slug', 'geodirectory'), |
|
97 | + 'id' => 'geodir_location_prefix', |
|
98 | + 'type' => 'text', |
|
99 | + 'css' => 'min-width:300px;', |
|
100 | + 'std' => 'location' // Default value to show home top section |
|
101 | + ), |
|
102 | + |
|
103 | + array( |
|
104 | + 'name' => __('Location and category url separator', 'geodirectory'), |
|
105 | + 'desc' => __('Separator to show between location and category url slugs in listing urls', 'geodirectory'), |
|
106 | + 'id' => 'geodir_listingurl_separator', |
|
107 | + 'type' => 'text', |
|
108 | + 'css' => 'min-width:300px;', |
|
109 | + 'std' => 'C' // Default value to show home top section |
|
110 | + ), |
|
111 | + |
|
112 | + array( |
|
113 | + 'name' => __('Listing detail url separator', 'geodirectory'), |
|
114 | + 'desc' => __('Separator to show before listing slug in listing detail urls', 'geodirectory'), |
|
115 | + 'id' => 'geodir_detailurl_separator', |
|
116 | + 'type' => 'text', |
|
117 | + 'css' => 'min-width:300px;', |
|
118 | + 'std' => 'info' // Default value to show home top section |
|
119 | + ), |
|
120 | + |
|
121 | + |
|
122 | + array('type' => 'sectionend', 'id' => 'geodir_permalink'), |
|
123 | + |
|
124 | + array('name' => __('GeoDirectory Pages', 'geodirectory'), |
|
125 | + 'type' => 'sectionstart', |
|
126 | + 'desc' => '', |
|
127 | + 'id' => 'geodir_pages'), |
|
128 | + |
|
129 | + array( |
|
130 | + 'name' => __('GD Home page', 'geodirectory'), |
|
131 | + 'desc' => __('Select the page to use for the GD homepage (you must also set this page in Settings>Reading>Front page for it to work)', 'geodirectory'), |
|
132 | + 'id' => 'geodir_home_page', |
|
133 | + 'type' => 'single_select_page', |
|
134 | + 'class' => 'chosen_select' |
|
135 | + ), |
|
136 | + |
|
137 | + array( |
|
138 | + 'name' => __('Add listing page', 'geodirectory'), |
|
139 | + 'desc' => __('Select the page to use for adding listings', 'geodirectory'), |
|
140 | + 'id' => 'geodir_add_listing_page', |
|
141 | + 'type' => 'single_select_page', |
|
142 | + 'class' => 'chosen_select' |
|
143 | + ), |
|
144 | + |
|
145 | + array( |
|
146 | + 'name' => __('Listing preview page', 'geodirectory'), |
|
147 | + 'desc' => __('Select the page to use for listing preview', 'geodirectory'), |
|
148 | + 'id' => 'geodir_preview_page', |
|
149 | + 'type' => 'single_select_page', |
|
150 | + 'class' => 'chosen_select' |
|
151 | + ), |
|
152 | + |
|
153 | + array( |
|
154 | + 'name' => __('Listing success page', 'geodirectory'), |
|
155 | + 'desc' => __('Select the page to use for listing success', 'geodirectory'), |
|
156 | + 'id' => 'geodir_success_page', |
|
157 | + 'type' => 'single_select_page', |
|
158 | + 'class' => 'chosen_select' |
|
159 | + ), |
|
160 | + |
|
161 | + array( |
|
162 | + 'name' => __('Location page', 'geodirectory'), |
|
163 | + 'desc' => __('Select the page to use for locations', 'geodirectory'), |
|
164 | + 'id' => 'geodir_location_page', |
|
165 | + 'type' => 'single_select_page', |
|
166 | + 'class' => 'chosen_select' |
|
167 | + ), |
|
168 | + |
|
169 | + array( |
|
170 | + 'name' => __('Terms and Conditions page', 'geodirectory'), |
|
171 | + 'desc' => __('Select the page to use for Terms and Conditions (if enabled)', 'geodirectory'), |
|
172 | + 'id' => 'geodir_term_condition_page', |
|
173 | + 'type' => 'single_select_page', |
|
174 | + 'class' => 'chosen_select' |
|
175 | + ), |
|
176 | + |
|
177 | + array( |
|
178 | + 'name' => __('Info page', 'geodirectory'), |
|
179 | + 'desc' => __('Select the page to use for Gd general Info', 'geodirectory'), |
|
180 | + 'id' => 'geodir_info_page', |
|
181 | + 'type' => 'single_select_page', |
|
182 | + 'class' => 'chosen_select' |
|
183 | + ), |
|
184 | + |
|
185 | + array( |
|
186 | + 'name' => __('Login page', 'geodirectory'), |
|
187 | + 'desc' => __('Select the page to use for Login / Register', 'geodirectory'), |
|
188 | + 'id' => 'geodir_login_page', |
|
189 | + 'type' => 'single_select_page', |
|
190 | + 'class' => 'chosen_select' |
|
191 | + ), |
|
192 | + |
|
193 | + |
|
194 | + array('type' => 'sectionend', 'id' => 'geodir_pages'), |
|
195 | + |
|
196 | + /* Listing Detail Permalink Settings End */ |
|
197 | 197 | |
198 | 198 | |
199 | 199 | )); // End Design settings |
@@ -11,139 +11,139 @@ discard block |
||
11 | 11 | //include the main class file |
12 | 12 | require_once("Tax-meta-class.php"); |
13 | 13 | if (is_admin()) { |
14 | - /* |
|
14 | + /* |
|
15 | 15 | * prefix of meta keys, optional |
16 | 16 | * use underscore (_) at the beginning to make keys hidden, for example $prefix = '_ba_'; |
17 | 17 | * you also can make prefix empty to disable it |
18 | 18 | * |
19 | 19 | */ |
20 | 20 | |
21 | - $prefix = 'ct_'; |
|
22 | - /* |
|
21 | + $prefix = 'ct_'; |
|
22 | + /* |
|
23 | 23 | * configure your meta box |
24 | 24 | */ |
25 | 25 | |
26 | - $config = array( |
|
27 | - 'id' => 'demo_meta_box', // meta box id, unique per meta box |
|
28 | - 'title' => __('Demo Meta Box', 'geodirectory'), // meta box title |
|
29 | - 'pages' => geodir_get_taxonomies(), // taxonomy name, accept categories, post_tag and custom taxonomies |
|
30 | - 'context' => 'normal', // where the meta box appear: normal (default), advanced, side; optional |
|
31 | - 'fields' => array(), // list of meta fields (can be added by field arrays) |
|
32 | - 'local_images' => false, // Use local or hosted images (meta box images for add/remove) |
|
33 | - 'use_with_theme' => true //change path if used with theme set to true, false for a plugin or anything else for a custom path(default false). |
|
34 | - ); |
|
26 | + $config = array( |
|
27 | + 'id' => 'demo_meta_box', // meta box id, unique per meta box |
|
28 | + 'title' => __('Demo Meta Box', 'geodirectory'), // meta box title |
|
29 | + 'pages' => geodir_get_taxonomies(), // taxonomy name, accept categories, post_tag and custom taxonomies |
|
30 | + 'context' => 'normal', // where the meta box appear: normal (default), advanced, side; optional |
|
31 | + 'fields' => array(), // list of meta fields (can be added by field arrays) |
|
32 | + 'local_images' => false, // Use local or hosted images (meta box images for add/remove) |
|
33 | + 'use_with_theme' => true //change path if used with theme set to true, false for a plugin or anything else for a custom path(default false). |
|
34 | + ); |
|
35 | 35 | |
36 | 36 | |
37 | - /* |
|
37 | + /* |
|
38 | 38 | * Initiate your meta box |
39 | 39 | */ |
40 | - $my_meta = new Tax_Meta_Class($config); |
|
41 | - $my_meta->addWysiwyg($prefix . 'cat_top_desc', array('name' => __('Category Top Description', 'geodirectory'), 'desc' => __('This will appear at the top of the category listing.', 'geodirectory'))); |
|
42 | - $my_meta->addImage($prefix . 'cat_default_img', array('name' => __('Default Listing Image', 'geodirectory'), 'desc' => __('Choose a default "no image"', 'geodirectory'))); |
|
43 | - $my_meta->addImage($prefix . 'cat_icon', array('name' => __('Category Icon', 'geodirectory'), 'desc' => __('Choose a category icon', 'geodirectory'), 'validate_func' => '!empty')); |
|
44 | - /*$my_meta->addCheckbox($prefix.'pointless',array('name'=> __('<b>Exclude</b> Rating sort option','geodirectory'),'style'=>'hidden'));*/// hidden setting to trick WPML |
|
45 | - |
|
46 | - $my_meta->addSelect($prefix . 'cat_schema', |
|
47 | - /* |
|
40 | + $my_meta = new Tax_Meta_Class($config); |
|
41 | + $my_meta->addWysiwyg($prefix . 'cat_top_desc', array('name' => __('Category Top Description', 'geodirectory'), 'desc' => __('This will appear at the top of the category listing.', 'geodirectory'))); |
|
42 | + $my_meta->addImage($prefix . 'cat_default_img', array('name' => __('Default Listing Image', 'geodirectory'), 'desc' => __('Choose a default "no image"', 'geodirectory'))); |
|
43 | + $my_meta->addImage($prefix . 'cat_icon', array('name' => __('Category Icon', 'geodirectory'), 'desc' => __('Choose a category icon', 'geodirectory'), 'validate_func' => '!empty')); |
|
44 | + /*$my_meta->addCheckbox($prefix.'pointless',array('name'=> __('<b>Exclude</b> Rating sort option','geodirectory'),'style'=>'hidden'));*/// hidden setting to trick WPML |
|
45 | + |
|
46 | + $my_meta->addSelect($prefix . 'cat_schema', |
|
47 | + /* |
|
48 | 48 | * Allows you to add/filter the cat schema types. |
49 | 49 | * |
50 | 50 | * @since 1.5.7 |
51 | 51 | */ |
52 | - apply_filters('geodir_cat_schemas',array( |
|
53 | - '' => __('Default (LocalBusiness)', 'geodirectory'), |
|
54 | - 'AccountingService' => 'AccountingService', |
|
55 | - 'Attorney' => 'Attorney', |
|
56 | - 'AutoBodyShop' => 'AutoBodyShop', |
|
57 | - 'AutoDealer' => 'AutoDealer', |
|
58 | - 'AutoPartsStore' => 'AutoPartsStore', |
|
59 | - 'AutoRental' => 'AutoRental', |
|
60 | - 'AutoRepair' => 'AutoRepair', |
|
61 | - 'AutoWash' => 'AutoWash', |
|
62 | - 'Bakery' => 'Bakery', |
|
63 | - 'BarOrPub' => 'BarOrPub', |
|
64 | - 'BeautySalon' => 'BeautySalon', |
|
65 | - 'BedAndBreakfast' => 'BedAndBreakfast', |
|
66 | - 'BikeStore' => 'BikeStore', |
|
67 | - 'BookStore' => 'BookStore', |
|
68 | - 'CafeOrCoffeeShop' => 'CafeOrCoffeeShop', |
|
69 | - 'ChildCare' => 'ChildCare', |
|
70 | - 'ClothingStore' => 'ClothingStore', |
|
71 | - 'ComputerStore' => 'ComputerStore', |
|
72 | - 'DaySpa' => 'DaySpa', |
|
73 | - 'Dentist' => 'Dentist', |
|
74 | - 'DryCleaningOrLaundry' => 'DryCleaningOrLaundry', |
|
75 | - 'Electrician' => 'Electrician', |
|
76 | - 'ElectronicsStore' => 'ElectronicsStore', |
|
77 | - 'EmergencyService' => 'EmergencyService', |
|
78 | - 'EntertainmentBusiness' => 'EntertainmentBusiness', |
|
79 | - 'Event' => 'Event', |
|
80 | - 'EventVenue' => 'EventVenue', |
|
81 | - 'ExerciseGym' => 'ExerciseGym', |
|
82 | - 'FinancialService' => 'FinancialService', |
|
83 | - 'Florist' => 'Florist', |
|
84 | - 'FoodEstablishment' => 'FoodEstablishment', |
|
85 | - 'FurnitureStore' => 'FurnitureStore', |
|
86 | - 'GardenStore' => 'GardenStore', |
|
87 | - 'GeneralContractor' => 'GeneralContractor', |
|
88 | - 'GolfCourse' => 'GolfCourse', |
|
89 | - 'HairSalon' => 'HairSalon', |
|
90 | - 'HardwareStore' => 'HardwareStore', |
|
91 | - 'HealthAndBeautyBusiness' => 'HealthAndBeautyBusiness', |
|
92 | - 'HobbyShop' => 'HobbyShop', |
|
93 | - 'HomeAndConstructionBusiness' => 'HomeAndConstructionBusiness', |
|
94 | - 'HomeGoodsStore' => 'HomeGoodsStore', |
|
95 | - 'Hospital' => 'Hospital', |
|
96 | - 'Hotel' => 'Hotel', |
|
97 | - 'HousePainter' => 'HousePainter', |
|
98 | - 'HVACBusiness' => 'HVACBusiness', |
|
99 | - 'InsuranceAgency' => 'InsuranceAgency', |
|
100 | - 'JewelryStore' => 'JewelryStore', |
|
101 | - 'LiquorStore' => 'LiquorStore', |
|
102 | - 'Locksmith' => 'Locksmith', |
|
103 | - 'LodgingBusiness' => 'LodgingBusiness', |
|
104 | - 'MedicalClinic' => 'MedicalClinic', |
|
105 | - 'MensClothingStore' => 'MensClothingStore', |
|
106 | - 'MobilePhoneStore' => 'MobilePhoneStore', |
|
107 | - 'Motel' => 'Motel', |
|
108 | - 'MotorcycleDealer' => 'MotorcycleDealer', |
|
109 | - 'MotorcycleRepair' => 'MotorcycleRepair', |
|
110 | - 'MovingCompany' => 'MovingCompany', |
|
111 | - 'MusicStore' => 'MusicStore', |
|
112 | - 'NailSalon' => 'NailSalon', |
|
113 | - 'NightClub' => 'NightClub', |
|
114 | - 'Notary' => 'Notary', |
|
115 | - 'OfficeEquipmentStore' => 'OfficeEquipmentStore', |
|
116 | - 'Optician' => 'Optician', |
|
117 | - 'PetStore' => 'PetStore', |
|
118 | - 'Physician' => 'Physician', |
|
119 | - 'Plumber' => 'Plumber', |
|
120 | - 'ProfessionalService' => 'ProfessionalService', |
|
121 | - 'RealEstateAgent' => 'RealEstateAgent', |
|
122 | - 'Residence' => 'Residence', |
|
123 | - 'Restaurant' => 'Restaurant', |
|
124 | - 'RoofingContractor' => 'RoofingContractor', |
|
125 | - 'RVPark' => 'RVPark', |
|
126 | - 'School' => 'School', |
|
127 | - 'SelfStorage' => 'SelfStorage', |
|
128 | - 'ShoeStore' => 'ShoeStore', |
|
129 | - 'SkiResort' => 'SkiResort', |
|
130 | - 'SportingGoodsStore' => 'SportingGoodsStore', |
|
131 | - 'SportsClub' => 'SportsClub', |
|
132 | - 'Store' => 'Store', |
|
133 | - 'TattooParlor' => 'TattooParlor', |
|
134 | - 'Taxi' => 'Taxi', |
|
135 | - 'TennisComplex' => 'TennisComplex', |
|
136 | - 'TireShop' => 'TireShop', |
|
137 | - 'TouristAttraction' => 'TouristAttraction', |
|
138 | - 'ToyStore' => 'ToyStore', |
|
139 | - 'TravelAgency' => 'TravelAgency', |
|
140 | - 'VeterinaryCare' => 'VeterinaryCare', |
|
141 | - 'WholesaleStore' => 'WholesaleStore', |
|
142 | - 'Winery' => 'Winery' |
|
143 | - )), |
|
144 | - array('name' => __('Schema Type', 'geodirectory'), 'desc' => __('Select the Schema to use for this category', 'geodirectory') . "", 'std' => array('selectkey2'))); |
|
145 | - |
|
146 | - /*$my_meta->addSelect($prefix.'cat_sort',array(''=>__('Default' , 'geodirectory'), |
|
52 | + apply_filters('geodir_cat_schemas',array( |
|
53 | + '' => __('Default (LocalBusiness)', 'geodirectory'), |
|
54 | + 'AccountingService' => 'AccountingService', |
|
55 | + 'Attorney' => 'Attorney', |
|
56 | + 'AutoBodyShop' => 'AutoBodyShop', |
|
57 | + 'AutoDealer' => 'AutoDealer', |
|
58 | + 'AutoPartsStore' => 'AutoPartsStore', |
|
59 | + 'AutoRental' => 'AutoRental', |
|
60 | + 'AutoRepair' => 'AutoRepair', |
|
61 | + 'AutoWash' => 'AutoWash', |
|
62 | + 'Bakery' => 'Bakery', |
|
63 | + 'BarOrPub' => 'BarOrPub', |
|
64 | + 'BeautySalon' => 'BeautySalon', |
|
65 | + 'BedAndBreakfast' => 'BedAndBreakfast', |
|
66 | + 'BikeStore' => 'BikeStore', |
|
67 | + 'BookStore' => 'BookStore', |
|
68 | + 'CafeOrCoffeeShop' => 'CafeOrCoffeeShop', |
|
69 | + 'ChildCare' => 'ChildCare', |
|
70 | + 'ClothingStore' => 'ClothingStore', |
|
71 | + 'ComputerStore' => 'ComputerStore', |
|
72 | + 'DaySpa' => 'DaySpa', |
|
73 | + 'Dentist' => 'Dentist', |
|
74 | + 'DryCleaningOrLaundry' => 'DryCleaningOrLaundry', |
|
75 | + 'Electrician' => 'Electrician', |
|
76 | + 'ElectronicsStore' => 'ElectronicsStore', |
|
77 | + 'EmergencyService' => 'EmergencyService', |
|
78 | + 'EntertainmentBusiness' => 'EntertainmentBusiness', |
|
79 | + 'Event' => 'Event', |
|
80 | + 'EventVenue' => 'EventVenue', |
|
81 | + 'ExerciseGym' => 'ExerciseGym', |
|
82 | + 'FinancialService' => 'FinancialService', |
|
83 | + 'Florist' => 'Florist', |
|
84 | + 'FoodEstablishment' => 'FoodEstablishment', |
|
85 | + 'FurnitureStore' => 'FurnitureStore', |
|
86 | + 'GardenStore' => 'GardenStore', |
|
87 | + 'GeneralContractor' => 'GeneralContractor', |
|
88 | + 'GolfCourse' => 'GolfCourse', |
|
89 | + 'HairSalon' => 'HairSalon', |
|
90 | + 'HardwareStore' => 'HardwareStore', |
|
91 | + 'HealthAndBeautyBusiness' => 'HealthAndBeautyBusiness', |
|
92 | + 'HobbyShop' => 'HobbyShop', |
|
93 | + 'HomeAndConstructionBusiness' => 'HomeAndConstructionBusiness', |
|
94 | + 'HomeGoodsStore' => 'HomeGoodsStore', |
|
95 | + 'Hospital' => 'Hospital', |
|
96 | + 'Hotel' => 'Hotel', |
|
97 | + 'HousePainter' => 'HousePainter', |
|
98 | + 'HVACBusiness' => 'HVACBusiness', |
|
99 | + 'InsuranceAgency' => 'InsuranceAgency', |
|
100 | + 'JewelryStore' => 'JewelryStore', |
|
101 | + 'LiquorStore' => 'LiquorStore', |
|
102 | + 'Locksmith' => 'Locksmith', |
|
103 | + 'LodgingBusiness' => 'LodgingBusiness', |
|
104 | + 'MedicalClinic' => 'MedicalClinic', |
|
105 | + 'MensClothingStore' => 'MensClothingStore', |
|
106 | + 'MobilePhoneStore' => 'MobilePhoneStore', |
|
107 | + 'Motel' => 'Motel', |
|
108 | + 'MotorcycleDealer' => 'MotorcycleDealer', |
|
109 | + 'MotorcycleRepair' => 'MotorcycleRepair', |
|
110 | + 'MovingCompany' => 'MovingCompany', |
|
111 | + 'MusicStore' => 'MusicStore', |
|
112 | + 'NailSalon' => 'NailSalon', |
|
113 | + 'NightClub' => 'NightClub', |
|
114 | + 'Notary' => 'Notary', |
|
115 | + 'OfficeEquipmentStore' => 'OfficeEquipmentStore', |
|
116 | + 'Optician' => 'Optician', |
|
117 | + 'PetStore' => 'PetStore', |
|
118 | + 'Physician' => 'Physician', |
|
119 | + 'Plumber' => 'Plumber', |
|
120 | + 'ProfessionalService' => 'ProfessionalService', |
|
121 | + 'RealEstateAgent' => 'RealEstateAgent', |
|
122 | + 'Residence' => 'Residence', |
|
123 | + 'Restaurant' => 'Restaurant', |
|
124 | + 'RoofingContractor' => 'RoofingContractor', |
|
125 | + 'RVPark' => 'RVPark', |
|
126 | + 'School' => 'School', |
|
127 | + 'SelfStorage' => 'SelfStorage', |
|
128 | + 'ShoeStore' => 'ShoeStore', |
|
129 | + 'SkiResort' => 'SkiResort', |
|
130 | + 'SportingGoodsStore' => 'SportingGoodsStore', |
|
131 | + 'SportsClub' => 'SportsClub', |
|
132 | + 'Store' => 'Store', |
|
133 | + 'TattooParlor' => 'TattooParlor', |
|
134 | + 'Taxi' => 'Taxi', |
|
135 | + 'TennisComplex' => 'TennisComplex', |
|
136 | + 'TireShop' => 'TireShop', |
|
137 | + 'TouristAttraction' => 'TouristAttraction', |
|
138 | + 'ToyStore' => 'ToyStore', |
|
139 | + 'TravelAgency' => 'TravelAgency', |
|
140 | + 'VeterinaryCare' => 'VeterinaryCare', |
|
141 | + 'WholesaleStore' => 'WholesaleStore', |
|
142 | + 'Winery' => 'Winery' |
|
143 | + )), |
|
144 | + array('name' => __('Schema Type', 'geodirectory'), 'desc' => __('Select the Schema to use for this category', 'geodirectory') . "", 'std' => array('selectkey2'))); |
|
145 | + |
|
146 | + /*$my_meta->addSelect($prefix.'cat_sort',array(''=>__('Default' , 'geodirectory'), |
|
147 | 147 | 'random'=>__('Random','geodirectory'), |
148 | 148 | 'az'=>__('Alphabetical' , 'geodirectory'), |
149 | 149 | 'newest'=>__('Newest','geodirectory'), |
@@ -154,8 +154,8 @@ discard block |
||
154 | 154 | 'low_review'=>__('Lowest Reviews','geodirectory')), |
155 | 155 | array('name'=> __('Sort By','geodirectory'),'desc' => __('Select the default sort option.' ,'geodirectory'), 'std'=> array('selectkey2')));*/ |
156 | 156 | |
157 | - // Show options for placecategories only |
|
158 | - /* if(isset($_REQUEST['taxonomy']) && in_array($_REQUEST['taxonomy'],$config['pages']) ){ |
|
157 | + // Show options for placecategories only |
|
158 | + /* if(isset($_REQUEST['taxonomy']) && in_array($_REQUEST['taxonomy'],$config['pages']) ){ |
|
159 | 159 | // Exclude sort options |
160 | 160 | $my_meta->addCheckbox($prefix.'cat_exclude_rating',array('name'=> __('<b>Exclude</b> Rating sort option','geodirectory'))); |
161 | 161 | $my_meta->addCheckbox($prefix.'cat_exclude_reviews',array('name'=> __('<b>Exclude</b> Reviews sort option','geodirectory'))); |
@@ -167,8 +167,8 @@ discard block |
||
167 | 167 | |
168 | 168 | }*/ |
169 | 169 | |
170 | - //Finish Meta Box Decleration |
|
171 | - $my_meta->Finish(); |
|
170 | + //Finish Meta Box Decleration |
|
171 | + $my_meta->Finish(); |
|
172 | 172 | } |
173 | 173 | |
174 | 174 | |
@@ -177,86 +177,86 @@ discard block |
||
177 | 177 | ############################################################## |
178 | 178 | $gd_taxonomies = geodir_get_taxonomies(); |
179 | 179 | if (!empty($gd_taxonomies)) { |
180 | - foreach ($gd_taxonomies as $gd_taxonomy) { |
|
180 | + foreach ($gd_taxonomies as $gd_taxonomy) { |
|
181 | 181 | |
182 | - add_filter('manage_edit-' . $gd_taxonomy . '_columns', 'addCat_column', 10, 2); |
|
183 | - add_action('manage_' . $gd_taxonomy . '_custom_column', 'manage_category_custom_fields', 10, 3); |
|
182 | + add_filter('manage_edit-' . $gd_taxonomy . '_columns', 'addCat_column', 10, 2); |
|
183 | + add_action('manage_' . $gd_taxonomy . '_custom_column', 'manage_category_custom_fields', 10, 3); |
|
184 | 184 | |
185 | - } |
|
185 | + } |
|
186 | 186 | } |
187 | 187 | |
188 | 188 | function addCat_column($columns) |
189 | 189 | { |
190 | - // only edit the columns on the current taxonomy |
|
191 | - /*if ( !isset($_GET['taxonomy']) && !in_array($_GET['taxonomy'],geodir_get_taxonomies()) ) |
|
190 | + // only edit the columns on the current taxonomy |
|
191 | + /*if ( !isset($_GET['taxonomy']) && !in_array($_GET['taxonomy'],geodir_get_taxonomies()) ) |
|
192 | 192 | return $columns; |
193 | 193 | */ |
194 | - if ($posts = $columns['description']) { |
|
195 | - unset($columns['description']); |
|
196 | - } |
|
197 | - |
|
198 | - $columns['cat_icon'] = 'Icon'; |
|
199 | - $columns['cat_default_img'] = __('Default Image', 'geodirectory'); |
|
200 | - $columns['cat_ID_num'] = __('Cat ID', 'geodirectory'); |
|
201 | - return $columns; |
|
194 | + if ($posts = $columns['description']) { |
|
195 | + unset($columns['description']); |
|
196 | + } |
|
197 | + |
|
198 | + $columns['cat_icon'] = 'Icon'; |
|
199 | + $columns['cat_default_img'] = __('Default Image', 'geodirectory'); |
|
200 | + $columns['cat_ID_num'] = __('Cat ID', 'geodirectory'); |
|
201 | + return $columns; |
|
202 | 202 | } |
203 | 203 | |
204 | 204 | ############################################################# |
205 | 205 | function manage_category_custom_fields($deprecated, $column_name, $term_id) |
206 | 206 | { |
207 | - if ($column_name == 'cat_ID_num') |
|
208 | - echo $term_id; |
|
207 | + if ($column_name == 'cat_ID_num') |
|
208 | + echo $term_id; |
|
209 | 209 | |
210 | - if ($column_name == 'cat_icon') { |
|
211 | - $term_icon_url = get_tax_meta($term_id, 'ct_cat_icon'); |
|
210 | + if ($column_name == 'cat_icon') { |
|
211 | + $term_icon_url = get_tax_meta($term_id, 'ct_cat_icon'); |
|
212 | 212 | |
213 | - if ($term_icon_url != '') { |
|
213 | + if ($term_icon_url != '') { |
|
214 | 214 | |
215 | - $file_info = pathinfo($term_icon_url['src']); |
|
215 | + $file_info = pathinfo($term_icon_url['src']); |
|
216 | 216 | |
217 | - if (isset($file_info['dirname'] ) && $file_info['dirname'] != '.' && $file_info['dirname'] != '..') |
|
218 | - $sub_dir = $file_info['dirname']; |
|
219 | - else{$sub_dir = '';} |
|
217 | + if (isset($file_info['dirname'] ) && $file_info['dirname'] != '.' && $file_info['dirname'] != '..') |
|
218 | + $sub_dir = $file_info['dirname']; |
|
219 | + else{$sub_dir = '';} |
|
220 | 220 | |
221 | - $uploads = wp_upload_dir(trim($sub_dir, '/')); // Array of key => value pairs |
|
222 | - $uploads_baseurl = $uploads['baseurl']; |
|
223 | - $uploads_path = $uploads['path']; |
|
221 | + $uploads = wp_upload_dir(trim($sub_dir, '/')); // Array of key => value pairs |
|
222 | + $uploads_baseurl = $uploads['baseurl']; |
|
223 | + $uploads_path = $uploads['path']; |
|
224 | 224 | |
225 | - $file_name = $file_info['basename']; |
|
225 | + $file_name = $file_info['basename']; |
|
226 | 226 | |
227 | - $sub_dir = str_replace($uploads_baseurl, '', $sub_dir); |
|
227 | + $sub_dir = str_replace($uploads_baseurl, '', $sub_dir); |
|
228 | 228 | |
229 | - $uploads_url = $uploads_baseurl . $sub_dir; |
|
229 | + $uploads_url = $uploads_baseurl . $sub_dir; |
|
230 | 230 | |
231 | - $term_icon_url['src'] = $uploads_url . '/' . $file_name; |
|
232 | - echo '<img src="' . $term_icon_url['src'] . '" />'; |
|
231 | + $term_icon_url['src'] = $uploads_url . '/' . $file_name; |
|
232 | + echo '<img src="' . $term_icon_url['src'] . '" />'; |
|
233 | 233 | |
234 | - } |
|
235 | - } |
|
234 | + } |
|
235 | + } |
|
236 | 236 | |
237 | - if ($column_name == 'cat_default_img') { |
|
238 | - $cat_default_img = get_tax_meta($term_id, 'ct_cat_default_img'); |
|
239 | - if ($cat_default_img != '') |
|
240 | - echo '<img src="' . $cat_default_img['src'] . '" style="max-height:60px;max-width:60px;"/>'; |
|
237 | + if ($column_name == 'cat_default_img') { |
|
238 | + $cat_default_img = get_tax_meta($term_id, 'ct_cat_default_img'); |
|
239 | + if ($cat_default_img != '') |
|
240 | + echo '<img src="' . $cat_default_img['src'] . '" style="max-height:60px;max-width:60px;"/>'; |
|
241 | 241 | |
242 | - } |
|
242 | + } |
|
243 | 243 | } |
244 | 244 | |
245 | 245 | function geodir_get_default_catimage($term_id, $post_type = 'gd_place') |
246 | 246 | { |
247 | 247 | |
248 | - if ($cat_default_img = get_tax_meta($term_id, 'ct_cat_default_img', '', $post_type)) |
|
249 | - return $cat_default_img; |
|
250 | - else |
|
251 | - return false; |
|
248 | + if ($cat_default_img = get_tax_meta($term_id, 'ct_cat_default_img', '', $post_type)) |
|
249 | + return $cat_default_img; |
|
250 | + else |
|
251 | + return false; |
|
252 | 252 | } |
253 | 253 | |
254 | 254 | //Clear custom fields |
255 | 255 | add_action('in_admin_footer', 'geodir_tax_meta_clear_custom_field'); |
256 | 256 | function geodir_tax_meta_clear_custom_field() |
257 | 257 | { |
258 | - if (isset($_REQUEST['taxonomy']) && !empty($_REQUEST['taxonomy'])): |
|
259 | - ?> |
|
258 | + if (isset($_REQUEST['taxonomy']) && !empty($_REQUEST['taxonomy'])): |
|
259 | + ?> |
|
260 | 260 | <script type="text/javascript"> |
261 | 261 | jQuery(document).ready(function () { |
262 | 262 | jQuery('#addtag #submit').click(function () { |
@@ -277,5 +277,5 @@ discard block |
||
277 | 277 | }); |
278 | 278 | </script> |
279 | 279 | <?php |
280 | - endif; |
|
280 | + endif; |
|
281 | 281 | } |
@@ -1,100 +1,100 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Enfold theme compatibility functions. |
|
4 | - * |
|
5 | - * This file lets the GeoDirectory Plugin use the Enfold theme HTML wrappers to fit and work perfectly. |
|
6 | - * |
|
7 | - * @since 1.0.0 |
|
8 | - * @package GeoDirectory |
|
9 | - */ |
|
3 | + * Enfold theme compatibility functions. |
|
4 | + * |
|
5 | + * This file lets the GeoDirectory Plugin use the Enfold theme HTML wrappers to fit and work perfectly. |
|
6 | + * |
|
7 | + * @since 1.0.0 |
|
8 | + * @package GeoDirectory |
|
9 | + */ |
|
10 | 10 | add_action('after_setup_theme', 'enfold_action_calls', 11); |
11 | 11 | /** |
12 | - * Action calls for enfold theme compatibility. |
|
13 | - * |
|
14 | - * @since 1.0.0 |
|
15 | - * @package GeoDirectory |
|
16 | - */ |
|
12 | + * Action calls for enfold theme compatibility. |
|
13 | + * |
|
14 | + * @since 1.0.0 |
|
15 | + * @package GeoDirectory |
|
16 | + */ |
|
17 | 17 | function enfold_action_calls() |
18 | 18 | { |
19 | 19 | |
20 | - /* ACTIONS |
|
20 | + /* ACTIONS |
|
21 | 21 | ****************************************************************************************/ |
22 | 22 | |
23 | - // Add body class for styling purposes |
|
24 | - add_filter('body_class', 'wpgeo_enfold_body_class'); |
|
23 | + // Add body class for styling purposes |
|
24 | + add_filter('body_class', 'wpgeo_enfold_body_class'); |
|
25 | 25 | |
26 | - // Pages using the page-builder shouldn't redirect on successful payment |
|
27 | - if (isset($_REQUEST['pay_action'])) { |
|
28 | - add_action('init', 'geodir_allow_payment_urls_enfold', 15); |
|
29 | - } |
|
26 | + // Pages using the page-builder shouldn't redirect on successful payment |
|
27 | + if (isset($_REQUEST['pay_action'])) { |
|
28 | + add_action('init', 'geodir_allow_payment_urls_enfold', 15); |
|
29 | + } |
|
30 | 30 | |
31 | - // LOCATION MANAGER MENU ACTIONS - set the location menu item before the Enfold search |
|
32 | - if (function_exists('geodir_location_menu_items')) { |
|
33 | - remove_filter('wp_nav_menu_items', 'geodir_location_menu_items', 110); |
|
34 | - add_filter('wp_nav_menu_items', 'geodir_location_menu_items', 8, 2); |
|
35 | - } |
|
36 | - // GEODIR MENU ACTIONS - set the GeoDir menu items before the Enfold search |
|
37 | - remove_filter('wp_nav_menu_items', 'geodir_menu_items', 100); |
|
38 | - add_filter('wp_nav_menu_items', 'geodir_menu_items', 7, 2); |
|
31 | + // LOCATION MANAGER MENU ACTIONS - set the location menu item before the Enfold search |
|
32 | + if (function_exists('geodir_location_menu_items')) { |
|
33 | + remove_filter('wp_nav_menu_items', 'geodir_location_menu_items', 110); |
|
34 | + add_filter('wp_nav_menu_items', 'geodir_location_menu_items', 8, 2); |
|
35 | + } |
|
36 | + // GEODIR MENU ACTIONS - set the GeoDir menu items before the Enfold search |
|
37 | + remove_filter('wp_nav_menu_items', 'geodir_menu_items', 100); |
|
38 | + add_filter('wp_nav_menu_items', 'geodir_menu_items', 7, 2); |
|
39 | 39 | |
40 | - // HOME TOP SIDEBAR |
|
41 | - remove_action('geodir_home_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10); |
|
42 | - remove_action('geodir_location_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10); |
|
43 | - //add_action( 'ava_after_main_container', 'enfold_home_sidebar' ); |
|
40 | + // HOME TOP SIDEBAR |
|
41 | + remove_action('geodir_home_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10); |
|
42 | + remove_action('geodir_location_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10); |
|
43 | + //add_action( 'ava_after_main_container', 'enfold_home_sidebar' ); |
|
44 | 44 | |
45 | 45 | |
46 | - // WRAPPER OPEN ACTIONS |
|
47 | - remove_action('geodir_wrapper_open', 'geodir_action_wrapper_open', 10); |
|
48 | - add_action('geodir_wrapper_open', 'enfold_action_wrapper_open', 9); |
|
49 | - add_action('geodir_wrapper_open', 'enfold_detail_title', 8, 2); // ADD GEODIR TITLE |
|
46 | + // WRAPPER OPEN ACTIONS |
|
47 | + remove_action('geodir_wrapper_open', 'geodir_action_wrapper_open', 10); |
|
48 | + add_action('geodir_wrapper_open', 'enfold_action_wrapper_open', 9); |
|
49 | + add_action('geodir_wrapper_open', 'enfold_detail_title', 8, 2); // ADD GEODIR TITLE |
|
50 | 50 | |
51 | 51 | |
52 | - // WRAPPER CONTENT OPEN ACTIONS |
|
53 | - remove_action('geodir_wrapper_content_open', 'geodir_action_wrapper_content_open', 10); |
|
54 | - add_action('geodir_wrapper_content_open', 'enfold_action_wrapper_content_open', 9, 3); |
|
52 | + // WRAPPER CONTENT OPEN ACTIONS |
|
53 | + remove_action('geodir_wrapper_content_open', 'geodir_action_wrapper_content_open', 10); |
|
54 | + add_action('geodir_wrapper_content_open', 'enfold_action_wrapper_content_open', 9, 3); |
|
55 | 55 | |
56 | 56 | |
57 | - // SIDEBAR RIGHT OPEN ACTIONS |
|
58 | - remove_action('geodir_sidebar_right_open', 'geodir_action_sidebar_right_open', 10); |
|
59 | - add_action('geodir_sidebar_right_open', 'enfold_action_sidebar_right_open', 10, 4); |
|
57 | + // SIDEBAR RIGHT OPEN ACTIONS |
|
58 | + remove_action('geodir_sidebar_right_open', 'geodir_action_sidebar_right_open', 10); |
|
59 | + add_action('geodir_sidebar_right_open', 'enfold_action_sidebar_right_open', 10, 4); |
|
60 | 60 | |
61 | - // SIDEBAR LEFT OPEN ACTIONS |
|
62 | - remove_action('geodir_sidebar_left_open', 'geodir_action_sidebar_left_open', 10); |
|
63 | - add_action('geodir_sidebar_left_open', 'enfold_action_sidebar_left_open', 10, 4); |
|
61 | + // SIDEBAR LEFT OPEN ACTIONS |
|
62 | + remove_action('geodir_sidebar_left_open', 'geodir_action_sidebar_left_open', 10); |
|
63 | + add_action('geodir_sidebar_left_open', 'enfold_action_sidebar_left_open', 10, 4); |
|
64 | 64 | |
65 | 65 | |
66 | - // HOME PAGE BREADCRUMBS |
|
67 | - remove_action('geodir_home_before_main_content', 'geodir_breadcrumb', 20); |
|
68 | - remove_action('geodir_location_before_main_content', 'geodir_breadcrumb', 20); |
|
66 | + // HOME PAGE BREADCRUMBS |
|
67 | + remove_action('geodir_home_before_main_content', 'geodir_breadcrumb', 20); |
|
68 | + remove_action('geodir_location_before_main_content', 'geodir_breadcrumb', 20); |
|
69 | 69 | |
70 | - // LISTINGS PAGE BREADCRUMBS & TITLES |
|
71 | - remove_action('geodir_listings_before_main_content', 'geodir_breadcrumb', 20); |
|
72 | - remove_action('geodir_listings_page_title', 'geodir_action_listings_title', 10); |
|
70 | + // LISTINGS PAGE BREADCRUMBS & TITLES |
|
71 | + remove_action('geodir_listings_before_main_content', 'geodir_breadcrumb', 20); |
|
72 | + remove_action('geodir_listings_page_title', 'geodir_action_listings_title', 10); |
|
73 | 73 | |
74 | - // DETAILS PAGE BREADCRUMBS & TITLES |
|
75 | - remove_action('geodir_detail_before_main_content', 'geodir_breadcrumb', 20); |
|
76 | - remove_action('geodir_details_main_content', 'geodir_action_page_title', 20); |
|
74 | + // DETAILS PAGE BREADCRUMBS & TITLES |
|
75 | + remove_action('geodir_detail_before_main_content', 'geodir_breadcrumb', 20); |
|
76 | + remove_action('geodir_details_main_content', 'geodir_action_page_title', 20); |
|
77 | 77 | |
78 | - // SEARCH PAGE BREADCRUMBS & TITLES |
|
79 | - remove_action('geodir_search_before_main_content', 'geodir_breadcrumb', 20); |
|
80 | - remove_action('geodir_search_page_title', 'geodir_action_search_page_title', 10); |
|
78 | + // SEARCH PAGE BREADCRUMBS & TITLES |
|
79 | + remove_action('geodir_search_before_main_content', 'geodir_breadcrumb', 20); |
|
80 | + remove_action('geodir_search_page_title', 'geodir_action_search_page_title', 10); |
|
81 | 81 | |
82 | - // AUTHOR PAGE BREADCRUMBS & TITLES |
|
83 | - remove_action('geodir_author_before_main_content', 'geodir_breadcrumb', 20); |
|
84 | - remove_action('geodir_author_page_title', 'geodir_action_author_page_title', 10); |
|
82 | + // AUTHOR PAGE BREADCRUMBS & TITLES |
|
83 | + remove_action('geodir_author_before_main_content', 'geodir_breadcrumb', 20); |
|
84 | + remove_action('geodir_author_page_title', 'geodir_action_author_page_title', 10); |
|
85 | 85 | |
86 | - // DISABLE ENFOLD MAPS CALL |
|
87 | - add_filter('avf_load_google_map_api', 'gd_enfold_remove_maps_api', 10, 1); |
|
86 | + // DISABLE ENFOLD MAPS CALL |
|
87 | + add_filter('avf_load_google_map_api', 'gd_enfold_remove_maps_api', 10, 1); |
|
88 | 88 | |
89 | - // make top section wide |
|
90 | - remove_action('geodir_home_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10); |
|
91 | - remove_action('geodir_location_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10); |
|
92 | - remove_action('geodir_author_before_main_content', 'geodir_action_geodir_sidebar_author_top', 10); |
|
93 | - remove_action('geodir_search_before_main_content', 'geodir_action_geodir_sidebar_search_top', 10); |
|
94 | - remove_action('geodir_detail_before_main_content', 'geodir_action_geodir_sidebar_detail_top', 10); |
|
95 | - remove_action('geodir_listings_before_main_content', 'geodir_action_geodir_sidebar_listings_top', 10); |
|
89 | + // make top section wide |
|
90 | + remove_action('geodir_home_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10); |
|
91 | + remove_action('geodir_location_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10); |
|
92 | + remove_action('geodir_author_before_main_content', 'geodir_action_geodir_sidebar_author_top', 10); |
|
93 | + remove_action('geodir_search_before_main_content', 'geodir_action_geodir_sidebar_search_top', 10); |
|
94 | + remove_action('geodir_detail_before_main_content', 'geodir_action_geodir_sidebar_detail_top', 10); |
|
95 | + remove_action('geodir_listings_before_main_content', 'geodir_action_geodir_sidebar_listings_top', 10); |
|
96 | 96 | |
97 | - add_action('geodir_wrapper_open', 'gd_enfold_compat_add_top_section_back', 5); |
|
97 | + add_action('geodir_wrapper_open', 'gd_enfold_compat_add_top_section_back', 5); |
|
98 | 98 | |
99 | 99 | } // Close enfold_action_calls |
100 | 100 | |
@@ -108,17 +108,17 @@ discard block |
||
108 | 108 | function gd_enfold_compat_add_top_section_back() |
109 | 109 | { |
110 | 110 | |
111 | - if (is_page_geodir_home() || geodir_is_page('location')) { |
|
112 | - add_action('geodir_wrapper_open', 'geodir_action_geodir_sidebar_home_top', 8); |
|
113 | - } elseif (geodir_is_page('listing')) { |
|
114 | - add_action('geodir_wrapper_open', 'geodir_action_geodir_sidebar_listings_top', 8); |
|
115 | - } elseif (geodir_is_page('detail')) { |
|
116 | - add_action('geodir_wrapper_open', 'geodir_action_geodir_sidebar_detail_top', 8); |
|
117 | - } elseif (geodir_is_page('search')) { |
|
118 | - add_action('geodir_wrapper_open', 'geodir_action_geodir_sidebar_search_top', 8); |
|
119 | - } elseif (geodir_is_page('author')) { |
|
120 | - add_action('geodir_wrapper_open', 'geodir_action_geodir_sidebar_author_top', 8); |
|
121 | - } |
|
111 | + if (is_page_geodir_home() || geodir_is_page('location')) { |
|
112 | + add_action('geodir_wrapper_open', 'geodir_action_geodir_sidebar_home_top', 8); |
|
113 | + } elseif (geodir_is_page('listing')) { |
|
114 | + add_action('geodir_wrapper_open', 'geodir_action_geodir_sidebar_listings_top', 8); |
|
115 | + } elseif (geodir_is_page('detail')) { |
|
116 | + add_action('geodir_wrapper_open', 'geodir_action_geodir_sidebar_detail_top', 8); |
|
117 | + } elseif (geodir_is_page('search')) { |
|
118 | + add_action('geodir_wrapper_open', 'geodir_action_geodir_sidebar_search_top', 8); |
|
119 | + } elseif (geodir_is_page('author')) { |
|
120 | + add_action('geodir_wrapper_open', 'geodir_action_geodir_sidebar_author_top', 8); |
|
121 | + } |
|
122 | 122 | |
123 | 123 | |
124 | 124 | } |
@@ -137,8 +137,8 @@ discard block |
||
137 | 137 | */ |
138 | 138 | function wpgeo_enfold_body_class($classes) |
139 | 139 | { |
140 | - $classes[] = 'wpgeo-enfold'; |
|
141 | - return $classes; |
|
140 | + $classes[] = 'wpgeo-enfold'; |
|
141 | + return $classes; |
|
142 | 142 | } |
143 | 143 | |
144 | 144 | /** |
@@ -149,8 +149,8 @@ discard block |
||
149 | 149 | */ |
150 | 150 | function geodir_allow_payment_urls_enfold() |
151 | 151 | { |
152 | - global $builder; |
|
153 | - remove_action('template_redirect', array($builder, 'template_redirect'), 1000); |
|
152 | + global $builder; |
|
153 | + remove_action('template_redirect', array($builder, 'template_redirect'), 1000); |
|
154 | 154 | } |
155 | 155 | |
156 | 156 | |
@@ -162,8 +162,8 @@ discard block |
||
162 | 162 | */ |
163 | 163 | function enfold_action_wrapper_open() |
164 | 164 | { |
165 | - echo "<div class='container_wrap container_wrap_first main_color " . avia_layout_class('main', false) . "'>"; |
|
166 | - echo "<div class='container template-blog '>"; |
|
165 | + echo "<div class='container_wrap container_wrap_first main_color " . avia_layout_class('main', false) . "'>"; |
|
166 | + echo "<div class='container template-blog '>"; |
|
167 | 167 | } |
168 | 168 | |
169 | 169 | /** |
@@ -177,38 +177,38 @@ discard block |
||
177 | 177 | */ |
178 | 178 | function enfold_detail_title($page, $class) |
179 | 179 | { |
180 | - //echo '###'.$page; |
|
181 | - global $wp; |
|
182 | - if (isset($wp->query_vars['page_id']) && $wp->query_vars['page_id'] == geodir_location_page_id() && !geodir_is_page('login')) { |
|
183 | - add_action('avia_breadcrumbs_trail', 'enfold_detail_breadcrum', 8, 2); |
|
184 | - echo avia_title(); |
|
185 | - } elseif ($page == 'details-page') { |
|
186 | - add_action('avia_breadcrumbs_trail', 'enfold_detail_breadcrum', 8, 2); |
|
187 | - echo avia_title(); |
|
188 | - } elseif ($page == 'listings-page' || $page == 'search-page') { |
|
189 | - add_action('avia_breadcrumbs_trail', 'enfold_detail_breadcrum', 8, 2); |
|
190 | - ob_start(); // Start buffering; |
|
191 | - geodir_action_listings_title(); |
|
192 | - $gd_title = ob_get_clean(); |
|
193 | - $title_p = explode('">', $gd_title); |
|
194 | - $title = str_replace('</h1></header>', "", $title_p[2]); |
|
195 | - //print_r($title_p); |
|
196 | - echo avia_title(array('title' => $title)); |
|
197 | - } elseif ($page == 'author-page') { |
|
198 | - add_action('avia_breadcrumbs_trail', 'enfold_detail_breadcrum', 8, 2); |
|
199 | - ob_start(); // Start buffering; |
|
200 | - geodir_action_author_page_title(); |
|
201 | - $gd_title = ob_get_clean(); |
|
202 | - $gd_title = str_replace('<h1>', "", $gd_title); |
|
203 | - $gd_title = str_replace('</h1>', "", $gd_title); |
|
204 | - echo avia_title(array('title' => $gd_title)); |
|
205 | - } elseif ($page == 'add-listing-page') { |
|
206 | - add_action('avia_breadcrumbs_trail', 'enfold_detail_breadcrum', 8, 2); |
|
207 | - echo avia_title(); |
|
208 | - } elseif ($page == 'add-listing-page') { |
|
209 | - add_action('avia_breadcrumbs_trail', 'enfold_detail_breadcrum', 8, 2); |
|
210 | - echo avia_title(); |
|
211 | - } |
|
180 | + //echo '###'.$page; |
|
181 | + global $wp; |
|
182 | + if (isset($wp->query_vars['page_id']) && $wp->query_vars['page_id'] == geodir_location_page_id() && !geodir_is_page('login')) { |
|
183 | + add_action('avia_breadcrumbs_trail', 'enfold_detail_breadcrum', 8, 2); |
|
184 | + echo avia_title(); |
|
185 | + } elseif ($page == 'details-page') { |
|
186 | + add_action('avia_breadcrumbs_trail', 'enfold_detail_breadcrum', 8, 2); |
|
187 | + echo avia_title(); |
|
188 | + } elseif ($page == 'listings-page' || $page == 'search-page') { |
|
189 | + add_action('avia_breadcrumbs_trail', 'enfold_detail_breadcrum', 8, 2); |
|
190 | + ob_start(); // Start buffering; |
|
191 | + geodir_action_listings_title(); |
|
192 | + $gd_title = ob_get_clean(); |
|
193 | + $title_p = explode('">', $gd_title); |
|
194 | + $title = str_replace('</h1></header>', "", $title_p[2]); |
|
195 | + //print_r($title_p); |
|
196 | + echo avia_title(array('title' => $title)); |
|
197 | + } elseif ($page == 'author-page') { |
|
198 | + add_action('avia_breadcrumbs_trail', 'enfold_detail_breadcrum', 8, 2); |
|
199 | + ob_start(); // Start buffering; |
|
200 | + geodir_action_author_page_title(); |
|
201 | + $gd_title = ob_get_clean(); |
|
202 | + $gd_title = str_replace('<h1>', "", $gd_title); |
|
203 | + $gd_title = str_replace('</h1>', "", $gd_title); |
|
204 | + echo avia_title(array('title' => $gd_title)); |
|
205 | + } elseif ($page == 'add-listing-page') { |
|
206 | + add_action('avia_breadcrumbs_trail', 'enfold_detail_breadcrum', 8, 2); |
|
207 | + echo avia_title(); |
|
208 | + } elseif ($page == 'add-listing-page') { |
|
209 | + add_action('avia_breadcrumbs_trail', 'enfold_detail_breadcrum', 8, 2); |
|
210 | + echo avia_title(); |
|
211 | + } |
|
212 | 212 | |
213 | 213 | } |
214 | 214 | |
@@ -223,22 +223,22 @@ discard block |
||
223 | 223 | */ |
224 | 224 | function enfold_detail_breadcrum($trail, $args) |
225 | 225 | { |
226 | - ob_start(); // Start buffering; |
|
227 | - geodir_breadcrumb(); |
|
228 | - $gd_crums = ob_get_clean(); |
|
229 | - if ($gd_crums) { |
|
230 | - $gd_crums = str_replace('<div class="geodir-breadcrumb clearfix"><ul id="breadcrumbs"><li>', "", $gd_crums); |
|
231 | - $gd_crums = str_replace('</li></ul></div>', "", $gd_crums); |
|
232 | - $gd_crums = str_replace(' > ', " > ", $gd_crums); |
|
233 | - $gd_crums = str_replace('</li><li>', "", $gd_crums); |
|
234 | - $gd_crums = explode(" > ", $gd_crums); |
|
235 | - $trail_end = array_pop($gd_crums); |
|
236 | - $gd_crums['trail_end'] = $trail_end; |
|
237 | - //print_r($gd_crums); |
|
238 | - //print_r($trail); |
|
239 | - $trail = $gd_crums; |
|
240 | - } |
|
241 | - return $trail; |
|
226 | + ob_start(); // Start buffering; |
|
227 | + geodir_breadcrumb(); |
|
228 | + $gd_crums = ob_get_clean(); |
|
229 | + if ($gd_crums) { |
|
230 | + $gd_crums = str_replace('<div class="geodir-breadcrumb clearfix"><ul id="breadcrumbs"><li>', "", $gd_crums); |
|
231 | + $gd_crums = str_replace('</li></ul></div>', "", $gd_crums); |
|
232 | + $gd_crums = str_replace(' > ', " > ", $gd_crums); |
|
233 | + $gd_crums = str_replace('</li><li>', "", $gd_crums); |
|
234 | + $gd_crums = explode(" > ", $gd_crums); |
|
235 | + $trail_end = array_pop($gd_crums); |
|
236 | + $gd_crums['trail_end'] = $trail_end; |
|
237 | + //print_r($gd_crums); |
|
238 | + //print_r($trail); |
|
239 | + $trail = $gd_crums; |
|
240 | + } |
|
241 | + return $trail; |
|
242 | 242 | } |
243 | 243 | |
244 | 244 | |
@@ -253,12 +253,12 @@ discard block |
||
253 | 253 | */ |
254 | 254 | function enfold_action_wrapper_content_open($type = '', $id = '', $class = '') |
255 | 255 | { |
256 | - if (geodir_is_page('login')) { |
|
257 | - echo "<main class='template-page content twelve alpha units " . $class . "' " . avia_markup_helper(array('context' => 'content', 'post_type' => 'page', 'echo' => false)) . ">"; |
|
258 | - } else { |
|
259 | - echo "<main class='template-page content " . avia_layout_class('content', false) . " units " . $class . "' " . avia_markup_helper(array('context' => 'content', 'post_type' => 'page', 'echo' => false)) . ">"; |
|
260 | - } |
|
261 | - echo '<div class="entry-content-wrapper">'; |
|
256 | + if (geodir_is_page('login')) { |
|
257 | + echo "<main class='template-page content twelve alpha units " . $class . "' " . avia_markup_helper(array('context' => 'content', 'post_type' => 'page', 'echo' => false)) . ">"; |
|
258 | + } else { |
|
259 | + echo "<main class='template-page content " . avia_layout_class('content', false) . " units " . $class . "' " . avia_markup_helper(array('context' => 'content', 'post_type' => 'page', 'echo' => false)) . ">"; |
|
260 | + } |
|
261 | + echo '<div class="entry-content-wrapper">'; |
|
262 | 262 | } |
263 | 263 | |
264 | 264 | |
@@ -274,9 +274,9 @@ discard block |
||
274 | 274 | */ |
275 | 275 | function enfold_action_sidebar_right_open($type = '', $id = '', $class = '', $itemtype = '') |
276 | 276 | { |
277 | - $sidebar_smartphone = avia_get_option('smartphones_sidebar') == 'smartphones_sidebar' ? 'smartphones_sidebar_active' : ""; |
|
278 | - echo "<aside class='sidebar sidebar_right " . $sidebar_smartphone . " " . avia_layout_class('sidebar', false) . " units' " . avia_markup_helper(array('context' => 'sidebar', 'echo' => false)) . ">"; |
|
279 | - echo "<div class='inner_sidebar extralight-border'>"; |
|
277 | + $sidebar_smartphone = avia_get_option('smartphones_sidebar') == 'smartphones_sidebar' ? 'smartphones_sidebar_active' : ""; |
|
278 | + echo "<aside class='sidebar sidebar_right " . $sidebar_smartphone . " " . avia_layout_class('sidebar', false) . " units' " . avia_markup_helper(array('context' => 'sidebar', 'echo' => false)) . ">"; |
|
279 | + echo "<div class='inner_sidebar extralight-border'>"; |
|
280 | 280 | } |
281 | 281 | |
282 | 282 | /** |
@@ -291,9 +291,9 @@ discard block |
||
291 | 291 | */ |
292 | 292 | function enfold_action_sidebar_left_open($type = '', $id = '', $class = '', $itemtype = '') |
293 | 293 | { |
294 | - $sidebar_smartphone = avia_get_option('smartphones_sidebar') == 'smartphones_sidebar' ? 'smartphones_sidebar_active' : ""; |
|
295 | - echo "<aside class='sidebar sidebar_left " . $sidebar_smartphone . " " . avia_layout_class('sidebar', false) . " units' " . avia_markup_helper(array('context' => 'sidebar', 'echo' => false)) . ">"; |
|
296 | - echo "<div class='inner_sidebar extralight-border'>"; |
|
294 | + $sidebar_smartphone = avia_get_option('smartphones_sidebar') == 'smartphones_sidebar' ? 'smartphones_sidebar_active' : ""; |
|
295 | + echo "<aside class='sidebar sidebar_left " . $sidebar_smartphone . " " . avia_layout_class('sidebar', false) . " units' " . avia_markup_helper(array('context' => 'sidebar', 'echo' => false)) . ">"; |
|
296 | + echo "<div class='inner_sidebar extralight-border'>"; |
|
297 | 297 | } |
298 | 298 | |
299 | 299 | |
@@ -307,7 +307,7 @@ discard block |
||
307 | 307 | */ |
308 | 308 | function gd_enfold_remove_maps_api($call) |
309 | 309 | { |
310 | - return false; |
|
310 | + return false; |
|
311 | 311 | } |
312 | 312 | |
313 | 313 |
@@ -17,26 +17,26 @@ discard block |
||
17 | 17 | function gd_compat_php_genesis() |
18 | 18 | { |
19 | 19 | // REPLACE GENESIS BREADCRUMBS WITH GD BREADCRUMBS |
20 | - remove_action('geodir_detail_before_main_content', 'geodir_breadcrumb', 20); |
|
21 | - remove_action('geodir_listings_before_main_content', 'geodir_breadcrumb', 20); |
|
22 | - remove_action('geodir_author_before_main_content', 'geodir_breadcrumb', 20); |
|
23 | - remove_action('geodir_search_before_main_content', 'geodir_breadcrumb', 20); |
|
24 | - remove_action('geodir_home_before_main_content', 'geodir_breadcrumb', 20); |
|
25 | - remove_action('geodir_location_before_main_content', 'geodir_breadcrumb', 20); |
|
20 | + remove_action('geodir_detail_before_main_content', 'geodir_breadcrumb', 20); |
|
21 | + remove_action('geodir_listings_before_main_content', 'geodir_breadcrumb', 20); |
|
22 | + remove_action('geodir_author_before_main_content', 'geodir_breadcrumb', 20); |
|
23 | + remove_action('geodir_search_before_main_content', 'geodir_breadcrumb', 20); |
|
24 | + remove_action('geodir_home_before_main_content', 'geodir_breadcrumb', 20); |
|
25 | + remove_action('geodir_location_before_main_content', 'geodir_breadcrumb', 20); |
|
26 | 26 | |
27 | 27 | |
28 | - // make top section wide |
|
29 | - remove_action('geodir_home_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10); |
|
30 | - remove_action('geodir_location_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10); |
|
31 | - remove_action('geodir_author_before_main_content', 'geodir_action_geodir_sidebar_author_top', 10); |
|
32 | - remove_action('geodir_search_before_main_content', 'geodir_action_geodir_sidebar_search_top', 10); |
|
33 | - remove_action('geodir_detail_before_main_content', 'geodir_action_geodir_sidebar_detail_top', 10); |
|
34 | - remove_action('geodir_listings_before_main_content', 'geodir_action_geodir_sidebar_listings_top', 10); |
|
28 | + // make top section wide |
|
29 | + remove_action('geodir_home_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10); |
|
30 | + remove_action('geodir_location_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10); |
|
31 | + remove_action('geodir_author_before_main_content', 'geodir_action_geodir_sidebar_author_top', 10); |
|
32 | + remove_action('geodir_search_before_main_content', 'geodir_action_geodir_sidebar_search_top', 10); |
|
33 | + remove_action('geodir_detail_before_main_content', 'geodir_action_geodir_sidebar_detail_top', 10); |
|
34 | + remove_action('geodir_listings_before_main_content', 'geodir_action_geodir_sidebar_listings_top', 10); |
|
35 | 35 | |
36 | - // REMOVE PAGE TITLES |
|
37 | - remove_action('geodir_listings_page_title', 'geodir_action_listings_title', 10); |
|
38 | - remove_action('geodir_search_page_title', 'geodir_action_search_page_title', 10); |
|
39 | - remove_action('geodir_author_page_title', 'geodir_action_author_page_title', 10); |
|
36 | + // REMOVE PAGE TITLES |
|
37 | + remove_action('geodir_listings_page_title', 'geodir_action_listings_title', 10); |
|
38 | + remove_action('geodir_search_page_title', 'geodir_action_search_page_title', 10); |
|
39 | + remove_action('geodir_author_page_title', 'geodir_action_author_page_title', 10); |
|
40 | 40 | |
41 | 41 | |
42 | 42 | } |
@@ -53,25 +53,25 @@ discard block |
||
53 | 53 | function gd_genesis_compat_left_sidebars() |
54 | 54 | { |
55 | 55 | |
56 | - if (is_page_geodir_home()) { |
|
57 | - remove_action('geodir_home_sidebar_left', 'geodir_action_home_sidebar_left', 10); |
|
58 | - add_action('geodir_wrapper_close', 'geodir_action_home_sidebar_left', 11); |
|
59 | - } elseif (geodir_is_page('location')) { |
|
60 | - remove_action('geodir_location_sidebar_left', 'geodir_action_home_sidebar_left', 10); |
|
61 | - add_action('geodir_wrapper_close', 'geodir_action_home_sidebar_left', 11); |
|
62 | - } elseif (geodir_is_page('listing')) { |
|
63 | - remove_action('geodir_listings_sidebar_left', 'geodir_action_listings_sidebar_left', 10); |
|
64 | - add_action('geodir_wrapper_close', 'geodir_action_listings_sidebar_left', 11); |
|
65 | - } elseif (geodir_is_page('detail') && get_option('geodir_detail_sidebar_left_section')) { |
|
66 | - //remove_action( 'geodir_detail_sidebar', 'geodir_action_details_sidebar', 10 ); |
|
67 | - //add_action( 'geodir_wrapper_close', 'geodir_action_details_sidebar', 11 ); |
|
68 | - } elseif (geodir_is_page('search')) { |
|
69 | - remove_action('geodir_search_sidebar_left', 'geodir_action_search_sidebar_left', 10); |
|
70 | - add_action('geodir_wrapper_close', 'geodir_action_search_sidebar_left', 11); |
|
71 | - } elseif (geodir_is_page('author')) { |
|
72 | - remove_action('geodir_author_sidebar_left', 'geodir_action_author_sidebar_left', 10); |
|
73 | - add_action('geodir_wrapper_close', 'geodir_action_author_sidebar_left', 11); |
|
74 | - } |
|
56 | + if (is_page_geodir_home()) { |
|
57 | + remove_action('geodir_home_sidebar_left', 'geodir_action_home_sidebar_left', 10); |
|
58 | + add_action('geodir_wrapper_close', 'geodir_action_home_sidebar_left', 11); |
|
59 | + } elseif (geodir_is_page('location')) { |
|
60 | + remove_action('geodir_location_sidebar_left', 'geodir_action_home_sidebar_left', 10); |
|
61 | + add_action('geodir_wrapper_close', 'geodir_action_home_sidebar_left', 11); |
|
62 | + } elseif (geodir_is_page('listing')) { |
|
63 | + remove_action('geodir_listings_sidebar_left', 'geodir_action_listings_sidebar_left', 10); |
|
64 | + add_action('geodir_wrapper_close', 'geodir_action_listings_sidebar_left', 11); |
|
65 | + } elseif (geodir_is_page('detail') && get_option('geodir_detail_sidebar_left_section')) { |
|
66 | + //remove_action( 'geodir_detail_sidebar', 'geodir_action_details_sidebar', 10 ); |
|
67 | + //add_action( 'geodir_wrapper_close', 'geodir_action_details_sidebar', 11 ); |
|
68 | + } elseif (geodir_is_page('search')) { |
|
69 | + remove_action('geodir_search_sidebar_left', 'geodir_action_search_sidebar_left', 10); |
|
70 | + add_action('geodir_wrapper_close', 'geodir_action_search_sidebar_left', 11); |
|
71 | + } elseif (geodir_is_page('author')) { |
|
72 | + remove_action('geodir_author_sidebar_left', 'geodir_action_author_sidebar_left', 10); |
|
73 | + add_action('geodir_wrapper_close', 'geodir_action_author_sidebar_left', 11); |
|
74 | + } |
|
75 | 75 | |
76 | 76 | |
77 | 77 | } |
@@ -88,65 +88,65 @@ discard block |
||
88 | 88 | */ |
89 | 89 | function geodir_set_body_scs($classes) |
90 | 90 | { |
91 | - $remove_class = false; |
|
92 | - $new_class = ''; |
|
93 | - if (is_page_geodir_home() || geodir_is_page('location')) { |
|
94 | - $remove_class = true; |
|
95 | - if (get_option('geodir_show_home_left_section')) { |
|
96 | - $new_class .= 'sidebar-'; |
|
97 | - } |
|
98 | - if (get_option('geodir_show_home_contant_section')) { |
|
99 | - $new_class .= 'content'; |
|
100 | - } |
|
101 | - if (get_option('geodir_show_home_right_section')) { |
|
102 | - $new_class .= '-sidebar'; |
|
103 | - } |
|
104 | - } elseif (geodir_is_page('listing')) { |
|
105 | - $remove_class = true; |
|
106 | - if (get_option('geodir_show_listing_left_section')) { |
|
107 | - $new_class .= 'sidebar-'; |
|
108 | - } |
|
109 | - $new_class .= 'content'; |
|
110 | - if (get_option('geodir_show_listing_right_section')) { |
|
111 | - $new_class .= '-sidebar'; |
|
112 | - } |
|
113 | - } elseif (geodir_is_page('detail')) { |
|
114 | - $remove_class = true; |
|
115 | - if (get_option('geodir_detail_sidebar_left_section')) { |
|
116 | - $new_class .= 'sidebar-content gd-details-sidebar-left'; |
|
117 | - } else { |
|
118 | - $new_class .= 'content-sidebar'; |
|
119 | - } |
|
120 | - } elseif (geodir_is_page('search')) { |
|
121 | - $remove_class = true; |
|
122 | - if (get_option('geodir_show_search_left_section')) { |
|
123 | - $new_class .= 'sidebar-'; |
|
124 | - } |
|
125 | - $new_class .= 'content'; |
|
126 | - if (get_option('geodir_show_search_right_section')) { |
|
127 | - $new_class .= '-sidebar'; |
|
128 | - } |
|
129 | - } elseif (geodir_is_page('author')) { |
|
130 | - $remove_class = true; |
|
131 | - if (get_option('geodir_show_author_left_section')) { |
|
132 | - $new_class .= 'sidebar-'; |
|
133 | - } |
|
134 | - $new_class .= 'content'; |
|
135 | - if (get_option('geodir_show_author_right_section')) { |
|
136 | - $new_class .= '-sidebar'; |
|
137 | - } |
|
138 | - } elseif (geodir_is_page('add-listing')) { |
|
139 | - $remove_class = true; |
|
140 | - $new_class .= 'content-sidebar'; |
|
141 | - } |
|
142 | - |
|
143 | - if ($remove_class) { |
|
144 | - $classes = array_diff($classes, array('content-sidebar', 'sidebar-content', 'content-sidebar-sidebar', 'sidebar-sidebar-content', 'sidebar-content-sidebar', 'full-width-content')); |
|
145 | - //str_replace(array('content-sidebar','sidebar-content','content-sidebar-sidebar','sidebar-sidebar-content','sidebar-content-sidebar','full-width-content'),array('','','','','',''),$classes); |
|
146 | - $classes[] = $new_class; |
|
147 | - } |
|
148 | - |
|
149 | - return $classes; |
|
91 | + $remove_class = false; |
|
92 | + $new_class = ''; |
|
93 | + if (is_page_geodir_home() || geodir_is_page('location')) { |
|
94 | + $remove_class = true; |
|
95 | + if (get_option('geodir_show_home_left_section')) { |
|
96 | + $new_class .= 'sidebar-'; |
|
97 | + } |
|
98 | + if (get_option('geodir_show_home_contant_section')) { |
|
99 | + $new_class .= 'content'; |
|
100 | + } |
|
101 | + if (get_option('geodir_show_home_right_section')) { |
|
102 | + $new_class .= '-sidebar'; |
|
103 | + } |
|
104 | + } elseif (geodir_is_page('listing')) { |
|
105 | + $remove_class = true; |
|
106 | + if (get_option('geodir_show_listing_left_section')) { |
|
107 | + $new_class .= 'sidebar-'; |
|
108 | + } |
|
109 | + $new_class .= 'content'; |
|
110 | + if (get_option('geodir_show_listing_right_section')) { |
|
111 | + $new_class .= '-sidebar'; |
|
112 | + } |
|
113 | + } elseif (geodir_is_page('detail')) { |
|
114 | + $remove_class = true; |
|
115 | + if (get_option('geodir_detail_sidebar_left_section')) { |
|
116 | + $new_class .= 'sidebar-content gd-details-sidebar-left'; |
|
117 | + } else { |
|
118 | + $new_class .= 'content-sidebar'; |
|
119 | + } |
|
120 | + } elseif (geodir_is_page('search')) { |
|
121 | + $remove_class = true; |
|
122 | + if (get_option('geodir_show_search_left_section')) { |
|
123 | + $new_class .= 'sidebar-'; |
|
124 | + } |
|
125 | + $new_class .= 'content'; |
|
126 | + if (get_option('geodir_show_search_right_section')) { |
|
127 | + $new_class .= '-sidebar'; |
|
128 | + } |
|
129 | + } elseif (geodir_is_page('author')) { |
|
130 | + $remove_class = true; |
|
131 | + if (get_option('geodir_show_author_left_section')) { |
|
132 | + $new_class .= 'sidebar-'; |
|
133 | + } |
|
134 | + $new_class .= 'content'; |
|
135 | + if (get_option('geodir_show_author_right_section')) { |
|
136 | + $new_class .= '-sidebar'; |
|
137 | + } |
|
138 | + } elseif (geodir_is_page('add-listing')) { |
|
139 | + $remove_class = true; |
|
140 | + $new_class .= 'content-sidebar'; |
|
141 | + } |
|
142 | + |
|
143 | + if ($remove_class) { |
|
144 | + $classes = array_diff($classes, array('content-sidebar', 'sidebar-content', 'content-sidebar-sidebar', 'sidebar-sidebar-content', 'sidebar-content-sidebar', 'full-width-content')); |
|
145 | + //str_replace(array('content-sidebar','sidebar-content','content-sidebar-sidebar','sidebar-sidebar-content','sidebar-content-sidebar','full-width-content'),array('','','','','',''),$classes); |
|
146 | + $classes[] = $new_class; |
|
147 | + } |
|
148 | + |
|
149 | + return $classes; |
|
150 | 150 | |
151 | 151 | } |
152 | 152 | |
@@ -160,17 +160,17 @@ discard block |
||
160 | 160 | function gd_genesis_compat_add_top_section_back() |
161 | 161 | { |
162 | 162 | |
163 | - if (is_page_geodir_home() || geodir_is_page('location')) { |
|
164 | - geodir_action_geodir_sidebar_home_top(); |
|
165 | - } elseif (geodir_is_page('listing')) { |
|
166 | - geodir_action_geodir_sidebar_listings_top(); |
|
167 | - } elseif (geodir_is_page('detail')) { |
|
168 | - geodir_action_geodir_sidebar_detail_top(); |
|
169 | - } elseif (geodir_is_page('search')) { |
|
170 | - geodir_action_geodir_sidebar_search_top(); |
|
171 | - } elseif (geodir_is_page('author')) { |
|
172 | - geodir_action_geodir_sidebar_author_top(); |
|
173 | - } |
|
163 | + if (is_page_geodir_home() || geodir_is_page('location')) { |
|
164 | + geodir_action_geodir_sidebar_home_top(); |
|
165 | + } elseif (geodir_is_page('listing')) { |
|
166 | + geodir_action_geodir_sidebar_listings_top(); |
|
167 | + } elseif (geodir_is_page('detail')) { |
|
168 | + geodir_action_geodir_sidebar_detail_top(); |
|
169 | + } elseif (geodir_is_page('search')) { |
|
170 | + geodir_action_geodir_sidebar_search_top(); |
|
171 | + } elseif (geodir_is_page('author')) { |
|
172 | + geodir_action_geodir_sidebar_author_top(); |
|
173 | + } |
|
174 | 174 | |
175 | 175 | |
176 | 176 | } |
@@ -183,12 +183,12 @@ discard block |
||
183 | 183 | */ |
184 | 184 | function geodir_replace_breadcrumb() |
185 | 185 | { |
186 | - if (is_front_page() && get_option('geodir_set_as_home') && !geodir_is_page('login')) { |
|
187 | - } else { |
|
188 | - echo '<div class="geodir-breadcrumb-bar"><div class="wrap">'; |
|
189 | - geodir_breadcrumb(); |
|
190 | - echo '</div></div>'; |
|
191 | - } |
|
186 | + if (is_front_page() && get_option('geodir_set_as_home') && !geodir_is_page('login')) { |
|
187 | + } else { |
|
188 | + echo '<div class="geodir-breadcrumb-bar"><div class="wrap">'; |
|
189 | + geodir_breadcrumb(); |
|
190 | + echo '</div></div>'; |
|
191 | + } |
|
192 | 192 | } |
193 | 193 | |
194 | 194 | // Force Full Width on signup page |
@@ -201,9 +201,9 @@ discard block |
||
201 | 201 | */ |
202 | 202 | function geodir_genesis_meta() |
203 | 203 | { |
204 | - if (geodir_is_page('login')) { |
|
205 | - add_filter('genesis_pre_get_option_site_layout', '__genesis_return_full_width_content'); |
|
206 | - } |
|
204 | + if (geodir_is_page('login')) { |
|
205 | + add_filter('genesis_pre_get_option_site_layout', '__genesis_return_full_width_content'); |
|
206 | + } |
|
207 | 207 | } |
208 | 208 | |
209 | 209 | add_action('geodir_add_listing_page_title', 'geodir_add_listing_page_title_genesis_before', 8); |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | function geodir_add_listing_page_title_genesis_before() |
217 | 217 | { |
218 | 218 | |
219 | - echo "<div class='entry' >"; |
|
219 | + echo "<div class='entry' >"; |
|
220 | 220 | } |
221 | 221 | |
222 | 222 | |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | function geodir_add_listing_form_genesis_after() |
231 | 231 | { |
232 | 232 | |
233 | - echo "</div>"; |
|
233 | + echo "</div>"; |
|
234 | 234 | } |
235 | 235 | |
236 | 236 | |
@@ -249,38 +249,38 @@ discard block |
||
249 | 249 | { |
250 | 250 | |
251 | 251 | |
252 | - $title = ''; |
|
253 | - $subtitle = ''; |
|
254 | - |
|
255 | - if (geodir_is_page('listing')) { |
|
256 | - echo '<div class="wrap gd-title-wrap">'; |
|
257 | - geodir_action_listings_title(); |
|
258 | - echo '</div>'; |
|
259 | - } |
|
260 | - |
|
261 | - if (geodir_is_page('add-listing')) { |
|
262 | - echo '<div class="wrap gd-title-wrap">'; |
|
263 | - geodir_action_add_listing_page_title(); |
|
264 | - echo '</div>'; |
|
265 | - } |
|
266 | - |
|
267 | - if (geodir_is_page('author')) { |
|
268 | - echo '<div class="wrap gd-title-wrap">'; |
|
269 | - geodir_action_author_page_title(); |
|
270 | - echo '</div>'; |
|
271 | - } |
|
272 | - |
|
273 | - if (geodir_is_page('detail') || geodir_is_page('preview')) { |
|
274 | - echo '<div class="wrap gd-title-wrap">'; |
|
275 | - echo get_the_title(); |
|
276 | - echo '</div>'; |
|
277 | - } |
|
278 | - |
|
279 | - if (geodir_is_page('search')) { |
|
280 | - echo '<div class="wrap gd-title-wrap">'; |
|
281 | - geodir_action_search_page_title(); |
|
282 | - echo '</div>'; |
|
283 | - } |
|
252 | + $title = ''; |
|
253 | + $subtitle = ''; |
|
254 | + |
|
255 | + if (geodir_is_page('listing')) { |
|
256 | + echo '<div class="wrap gd-title-wrap">'; |
|
257 | + geodir_action_listings_title(); |
|
258 | + echo '</div>'; |
|
259 | + } |
|
260 | + |
|
261 | + if (geodir_is_page('add-listing')) { |
|
262 | + echo '<div class="wrap gd-title-wrap">'; |
|
263 | + geodir_action_add_listing_page_title(); |
|
264 | + echo '</div>'; |
|
265 | + } |
|
266 | + |
|
267 | + if (geodir_is_page('author')) { |
|
268 | + echo '<div class="wrap gd-title-wrap">'; |
|
269 | + geodir_action_author_page_title(); |
|
270 | + echo '</div>'; |
|
271 | + } |
|
272 | + |
|
273 | + if (geodir_is_page('detail') || geodir_is_page('preview')) { |
|
274 | + echo '<div class="wrap gd-title-wrap">'; |
|
275 | + echo get_the_title(); |
|
276 | + echo '</div>'; |
|
277 | + } |
|
278 | + |
|
279 | + if (geodir_is_page('search')) { |
|
280 | + echo '<div class="wrap gd-title-wrap">'; |
|
281 | + geodir_action_search_page_title(); |
|
282 | + echo '</div>'; |
|
283 | + } |
|
284 | 284 | } |
285 | 285 | |
286 | 286 | |
@@ -293,8 +293,8 @@ discard block |
||
293 | 293 | */ |
294 | 294 | function gd_genesis_listing_page_title_bar() |
295 | 295 | { |
296 | - geodir_action_listings_title(); |
|
297 | - //geodir_action_listings_description(); |
|
296 | + geodir_action_listings_title(); |
|
297 | + //geodir_action_listings_description(); |
|
298 | 298 | } |
299 | 299 | |
300 | 300 | |
@@ -307,19 +307,19 @@ discard block |
||
307 | 307 | */ |
308 | 308 | function gd_compat_php_genesis_geo_1280_fix() |
309 | 309 | { |
310 | - if (function_exists('geo1280_search_bar')) { |
|
311 | - remove_action('genesis_after_header', 'geo1280_search_bar', 20); |
|
312 | - add_action('genesis_after_header', 'geo1280_search_bar_fix', 4); |
|
310 | + if (function_exists('geo1280_search_bar')) { |
|
311 | + remove_action('genesis_after_header', 'geo1280_search_bar', 20); |
|
312 | + add_action('genesis_after_header', 'geo1280_search_bar_fix', 4); |
|
313 | 313 | |
314 | - // |
|
314 | + // |
|
315 | 315 | |
316 | - remove_action('genesis_after_header', 'geodir_replace_breadcrumb', 20); |
|
317 | - remove_action('genesis_before_content_sidebar_wrap', 'geodir_replace_breadcrumb', 20); |
|
318 | - add_action('geodir_wrapper_open', 'geodir_replace_breadcrumb', 105); |
|
316 | + remove_action('genesis_after_header', 'geodir_replace_breadcrumb', 20); |
|
317 | + remove_action('genesis_before_content_sidebar_wrap', 'geodir_replace_breadcrumb', 20); |
|
318 | + add_action('geodir_wrapper_open', 'geodir_replace_breadcrumb', 105); |
|
319 | 319 | |
320 | - remove_action('genesis_before_content_sidebar_wrap', 'geo1280_page_title', 10); |
|
321 | - add_action('geodir_wrapper_open', 'geo1280_page_title', 101); |
|
322 | - } |
|
320 | + remove_action('genesis_before_content_sidebar_wrap', 'geo1280_page_title', 10); |
|
321 | + add_action('geodir_wrapper_open', 'geo1280_page_title', 101); |
|
322 | + } |
|
323 | 323 | } |
324 | 324 | |
325 | 325 | /** |
@@ -331,11 +331,11 @@ discard block |
||
331 | 331 | function geo1280_search_bar_fix() |
332 | 332 | { |
333 | 333 | |
334 | - echo '<div class="geo1280-placeholder"></div>'; |
|
335 | - if (is_active_sidebar('search-bar')) { |
|
336 | - genesis_widget_area('search-bar', array( |
|
337 | - 'before' => '<div class="search-bar widget-area"><div class="wrap">', |
|
338 | - 'after' => '</div></div>', |
|
339 | - )); |
|
340 | - } |
|
334 | + echo '<div class="geo1280-placeholder"></div>'; |
|
335 | + if (is_active_sidebar('search-bar')) { |
|
336 | + genesis_widget_area('search-bar', array( |
|
337 | + 'before' => '<div class="search-bar widget-area"><div class="wrap">', |
|
338 | + 'after' => '</div></div>', |
|
339 | + )); |
|
340 | + } |
|
341 | 341 | } |
@@ -19,60 +19,60 @@ discard block |
||
19 | 19 | function geodir_x_action_calls() |
20 | 20 | { |
21 | 21 | |
22 | - /* ACTIONS |
|
22 | + /* ACTIONS |
|
23 | 23 | ****************************************************************************************/ |
24 | 24 | |
25 | - // Add body class for styling purposes |
|
26 | - add_filter('body_class', 'geodir_x_body_class'); |
|
25 | + // Add body class for styling purposes |
|
26 | + add_filter('body_class', 'geodir_x_body_class'); |
|
27 | 27 | |
28 | - // HOME TOP SIDEBAR |
|
29 | - //remove_action( 'geodir_location_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10 ); |
|
30 | - //remove_action( 'geodir_home_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10 ); |
|
31 | - //add_action( 'geodir_wrapper_open', 'geodir_x_home_sidebar', 5 ); |
|
32 | - add_action('geodir_before_search_form', 'geodir_x_search_container_open'); |
|
33 | - add_action('geodir_after_search_form', 'geodir_x_search_container_close'); |
|
28 | + // HOME TOP SIDEBAR |
|
29 | + //remove_action( 'geodir_location_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10 ); |
|
30 | + //remove_action( 'geodir_home_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10 ); |
|
31 | + //add_action( 'geodir_wrapper_open', 'geodir_x_home_sidebar', 5 ); |
|
32 | + add_action('geodir_before_search_form', 'geodir_x_search_container_open'); |
|
33 | + add_action('geodir_after_search_form', 'geodir_x_search_container_close'); |
|
34 | 34 | |
35 | - // WRAPPER OPEN ACTIONS |
|
36 | - remove_action('geodir_wrapper_open', 'geodir_action_wrapper_open', 10); |
|
37 | - add_action('geodir_wrapper_open', 'geodir_x_action_wrapper_open', 9); |
|
35 | + // WRAPPER OPEN ACTIONS |
|
36 | + remove_action('geodir_wrapper_open', 'geodir_action_wrapper_open', 10); |
|
37 | + add_action('geodir_wrapper_open', 'geodir_x_action_wrapper_open', 9); |
|
38 | 38 | |
39 | - // WRAPPER CLOSE ACTIONS |
|
40 | - remove_action('geodir_wrapper_close', 'geodir_action_wrapper_close', 10); |
|
41 | - add_action('geodir_wrapper_close', 'geodir_x_action_wrapper_close', 11); |
|
39 | + // WRAPPER CLOSE ACTIONS |
|
40 | + remove_action('geodir_wrapper_close', 'geodir_action_wrapper_close', 10); |
|
41 | + add_action('geodir_wrapper_close', 'geodir_x_action_wrapper_close', 11); |
|
42 | 42 | |
43 | - // WRAPPER CONTENT OPEN ACTIONS |
|
44 | - remove_action('geodir_wrapper_content_open', 'geodir_action_wrapper_content_open', 10); |
|
45 | - add_action('geodir_wrapper_content_open', 'geodir_x_action_wrapper_content_open', 9, 3); |
|
43 | + // WRAPPER CONTENT OPEN ACTIONS |
|
44 | + remove_action('geodir_wrapper_content_open', 'geodir_action_wrapper_content_open', 10); |
|
45 | + add_action('geodir_wrapper_content_open', 'geodir_x_action_wrapper_content_open', 9, 3); |
|
46 | 46 | |
47 | - // WRAPPER CONTENT CLOSE ACTIONS |
|
48 | - remove_action('geodir_wrapper_content_close', 'geodir_action_wrapper_content_close', 10); |
|
49 | - add_action('geodir_wrapper_content_close', 'geodir_x_action_wrapper_content_close', 11); |
|
47 | + // WRAPPER CONTENT CLOSE ACTIONS |
|
48 | + remove_action('geodir_wrapper_content_close', 'geodir_action_wrapper_content_close', 10); |
|
49 | + add_action('geodir_wrapper_content_close', 'geodir_x_action_wrapper_content_close', 11); |
|
50 | 50 | |
51 | - // SIDEBAR RIGHT OPEN ACTIONS |
|
52 | - remove_action('geodir_sidebar_right_open', 'geodir_action_sidebar_right_open', 10); |
|
53 | - add_action('geodir_sidebar_right_open', 'geodir_x_action_sidebar_right_open', 10, 4); |
|
51 | + // SIDEBAR RIGHT OPEN ACTIONS |
|
52 | + remove_action('geodir_sidebar_right_open', 'geodir_action_sidebar_right_open', 10); |
|
53 | + add_action('geodir_sidebar_right_open', 'geodir_x_action_sidebar_right_open', 10, 4); |
|
54 | 54 | |
55 | - // SIDEBAR RIGHT CLOSE ACTIONS |
|
56 | - remove_action('geodir_sidebar_right_close', 'geodir_action_sidebar_right_close', 10); |
|
57 | - add_action('geodir_sidebar_right_close', 'geodir_x_action_sidebar_right_close', 10, 1); |
|
55 | + // SIDEBAR RIGHT CLOSE ACTIONS |
|
56 | + remove_action('geodir_sidebar_right_close', 'geodir_action_sidebar_right_close', 10); |
|
57 | + add_action('geodir_sidebar_right_close', 'geodir_x_action_sidebar_right_close', 10, 1); |
|
58 | 58 | |
59 | - // REMOVE BREADCRUMBS |
|
60 | - remove_action('geodir_listings_before_main_content', 'geodir_breadcrumb', 20); |
|
61 | - remove_action('geodir_detail_before_main_content', 'geodir_breadcrumb', 20); |
|
62 | - remove_action('geodir_search_before_main_content', 'geodir_breadcrumb', 20); |
|
63 | - remove_action('geodir_author_before_main_content', 'geodir_breadcrumb', 20); |
|
64 | - remove_action('geodir_home_before_main_content', 'geodir_breadcrumb', 20); |
|
65 | - remove_action('geodir_location_before_main_content', 'geodir_breadcrumb', 20); |
|
59 | + // REMOVE BREADCRUMBS |
|
60 | + remove_action('geodir_listings_before_main_content', 'geodir_breadcrumb', 20); |
|
61 | + remove_action('geodir_detail_before_main_content', 'geodir_breadcrumb', 20); |
|
62 | + remove_action('geodir_search_before_main_content', 'geodir_breadcrumb', 20); |
|
63 | + remove_action('geodir_author_before_main_content', 'geodir_breadcrumb', 20); |
|
64 | + remove_action('geodir_home_before_main_content', 'geodir_breadcrumb', 20); |
|
65 | + remove_action('geodir_location_before_main_content', 'geodir_breadcrumb', 20); |
|
66 | 66 | |
67 | - // make top section wide |
|
68 | - remove_action('geodir_home_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10); |
|
69 | - remove_action('geodir_location_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10); |
|
70 | - remove_action('geodir_author_before_main_content', 'geodir_action_geodir_sidebar_author_top', 10); |
|
71 | - remove_action('geodir_search_before_main_content', 'geodir_action_geodir_sidebar_search_top', 10); |
|
72 | - remove_action('geodir_detail_before_main_content', 'geodir_action_geodir_sidebar_detail_top', 10); |
|
73 | - remove_action('geodir_listings_before_main_content', 'geodir_action_geodir_sidebar_listings_top', 10); |
|
67 | + // make top section wide |
|
68 | + remove_action('geodir_home_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10); |
|
69 | + remove_action('geodir_location_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10); |
|
70 | + remove_action('geodir_author_before_main_content', 'geodir_action_geodir_sidebar_author_top', 10); |
|
71 | + remove_action('geodir_search_before_main_content', 'geodir_action_geodir_sidebar_search_top', 10); |
|
72 | + remove_action('geodir_detail_before_main_content', 'geodir_action_geodir_sidebar_detail_top', 10); |
|
73 | + remove_action('geodir_listings_before_main_content', 'geodir_action_geodir_sidebar_listings_top', 10); |
|
74 | 74 | |
75 | - add_action('geodir_wrapper_open', 'gd_X_compat_add_top_section_back', 5); |
|
75 | + add_action('geodir_wrapper_open', 'gd_X_compat_add_top_section_back', 5); |
|
76 | 76 | |
77 | 77 | |
78 | 78 | } // Close geodir_x_action_calls |
@@ -89,17 +89,17 @@ discard block |
||
89 | 89 | function gd_X_compat_add_top_section_back() |
90 | 90 | { |
91 | 91 | |
92 | - if (is_page_geodir_home() || geodir_is_page('location')) { |
|
93 | - geodir_action_geodir_sidebar_home_top(); |
|
94 | - } elseif (geodir_is_page('listing')) { |
|
95 | - geodir_action_geodir_sidebar_listings_top(); |
|
96 | - } elseif (geodir_is_page('detail')) { |
|
97 | - geodir_action_geodir_sidebar_detail_top(); |
|
98 | - } elseif (geodir_is_page('search')) { |
|
99 | - geodir_action_geodir_sidebar_search_top(); |
|
100 | - } elseif (geodir_is_page('author')) { |
|
101 | - geodir_action_geodir_sidebar_author_top(); |
|
102 | - } |
|
92 | + if (is_page_geodir_home() || geodir_is_page('location')) { |
|
93 | + geodir_action_geodir_sidebar_home_top(); |
|
94 | + } elseif (geodir_is_page('listing')) { |
|
95 | + geodir_action_geodir_sidebar_listings_top(); |
|
96 | + } elseif (geodir_is_page('detail')) { |
|
97 | + geodir_action_geodir_sidebar_detail_top(); |
|
98 | + } elseif (geodir_is_page('search')) { |
|
99 | + geodir_action_geodir_sidebar_search_top(); |
|
100 | + } elseif (geodir_is_page('author')) { |
|
101 | + geodir_action_geodir_sidebar_author_top(); |
|
102 | + } |
|
103 | 103 | |
104 | 104 | |
105 | 105 | } |
@@ -117,8 +117,8 @@ discard block |
||
117 | 117 | */ |
118 | 118 | function geodir_x_body_class($classes) |
119 | 119 | { |
120 | - $classes[] = 'geodir-x'; |
|
121 | - return $classes; |
|
120 | + $classes[] = 'geodir-x'; |
|
121 | + return $classes; |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | /** |
@@ -130,14 +130,14 @@ discard block |
||
130 | 130 | */ |
131 | 131 | function geodir_x_home_sidebar() |
132 | 132 | { |
133 | - //if ( geodir_is_geodir_page() ) { |
|
134 | - global $wp; |
|
135 | - if ($wp->query_vars['page_id'] == geodir_location_page_id() || is_home() && !geodir_is_page('login')) { |
|
136 | - echo '<div class="x-main full">'; |
|
137 | - dynamic_sidebar('geodir_home_top'); |
|
138 | - echo '</div>'; |
|
139 | - } |
|
140 | - //} |
|
133 | + //if ( geodir_is_geodir_page() ) { |
|
134 | + global $wp; |
|
135 | + if ($wp->query_vars['page_id'] == geodir_location_page_id() || is_home() && !geodir_is_page('login')) { |
|
136 | + echo '<div class="x-main full">'; |
|
137 | + dynamic_sidebar('geodir_home_top'); |
|
138 | + echo '</div>'; |
|
139 | + } |
|
140 | + //} |
|
141 | 141 | } |
142 | 142 | |
143 | 143 | /** |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | */ |
149 | 149 | function geodir_x_search_container_open() |
150 | 150 | { |
151 | - echo '<div class="x-container-fluid x-container max">'; |
|
151 | + echo '<div class="x-container-fluid x-container max">'; |
|
152 | 152 | } |
153 | 153 | |
154 | 154 | /** |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | */ |
160 | 160 | function geodir_x_search_container_close() |
161 | 161 | { |
162 | - echo '</div>'; |
|
162 | + echo '</div>'; |
|
163 | 163 | } |
164 | 164 | |
165 | 165 | /** |
@@ -170,16 +170,16 @@ discard block |
||
170 | 170 | */ |
171 | 171 | function geodir_x_action_wrapper_open() |
172 | 172 | { |
173 | - global $stack; |
|
174 | - if ($stack == 'integrity') { |
|
175 | - echo '<div class="x-container-fluid x-container max width offset">'; |
|
176 | - } elseif ($stack == 'renew') { |
|
177 | - echo '<div class="x-container-fluid x-container max width offset cf">'; |
|
178 | - } elseif ($stack == 'icon') { |
|
179 | - echo '<div class="x-main full" role="main">'; |
|
180 | - } elseif ($stack == 'ethos') { |
|
181 | - echo '<div class="x-container-fluid x-container max width main"><div class="offset cf">'; |
|
182 | - } |
|
173 | + global $stack; |
|
174 | + if ($stack == 'integrity') { |
|
175 | + echo '<div class="x-container-fluid x-container max width offset">'; |
|
176 | + } elseif ($stack == 'renew') { |
|
177 | + echo '<div class="x-container-fluid x-container max width offset cf">'; |
|
178 | + } elseif ($stack == 'icon') { |
|
179 | + echo '<div class="x-main full" role="main">'; |
|
180 | + } elseif ($stack == 'ethos') { |
|
181 | + echo '<div class="x-container-fluid x-container max width main"><div class="offset cf">'; |
|
182 | + } |
|
183 | 183 | } |
184 | 184 | |
185 | 185 | /** |
@@ -190,12 +190,12 @@ discard block |
||
190 | 190 | */ |
191 | 191 | function geodir_x_action_wrapper_close() |
192 | 192 | { |
193 | - global $stack; |
|
194 | - if ($stack == 'ethos') { |
|
195 | - echo '</div></div>'; |
|
196 | - } else { |
|
197 | - echo '</div>'; |
|
198 | - } |
|
193 | + global $stack; |
|
194 | + if ($stack == 'ethos') { |
|
195 | + echo '</div></div>'; |
|
196 | + } else { |
|
197 | + echo '</div>'; |
|
198 | + } |
|
199 | 199 | } |
200 | 200 | |
201 | 201 | /** |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | */ |
210 | 210 | function geodir_x_action_wrapper_content_open($type = '', $id = '', $class = '') |
211 | 211 | { |
212 | - echo '<div class="x-main left ' . $class . '" role="main">'; |
|
212 | + echo '<div class="x-main left ' . $class . '" role="main">'; |
|
213 | 213 | } |
214 | 214 | |
215 | 215 | /** |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | */ |
221 | 221 | function geodir_x_action_wrapper_content_close() |
222 | 222 | { |
223 | - echo '</div>'; |
|
223 | + echo '</div>'; |
|
224 | 224 | } |
225 | 225 | |
226 | 226 | /** |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | */ |
236 | 236 | function geodir_x_action_sidebar_right_open($type = '', $id = '', $class = '', $itemtype = '') |
237 | 237 | { |
238 | - echo '<aside class="x-sidebar right" role="complementary" itemscope itemtype="' . $itemtype . '">'; |
|
238 | + echo '<aside class="x-sidebar right" role="complementary" itemscope itemtype="' . $itemtype . '">'; |
|
239 | 239 | } |
240 | 240 | |
241 | 241 | /** |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | */ |
248 | 248 | function geodir_x_action_sidebar_right_close($type = '') |
249 | 249 | { |
250 | - echo '</aside>'; |
|
250 | + echo '</aside>'; |
|
251 | 251 | } |
252 | 252 | |
253 | 253 | add_filter('geodir_breadcrumb', 'geodir_x_breadcrumb'); |
@@ -261,12 +261,12 @@ discard block |
||
261 | 261 | */ |
262 | 262 | function geodir_x_breadcrumb($breadcrumb) |
263 | 263 | { |
264 | - $breadcrumb = str_replace('<div class="geodir-breadcrumb clearfix"><ul id="breadcrumbs">', '', $breadcrumb); |
|
265 | - $breadcrumb = str_replace('<li>', '', $breadcrumb); |
|
266 | - $breadcrumb = str_replace('</li>', '', $breadcrumb); |
|
267 | - $breadcrumb = str_replace('Home', '<span class="home"><i class="x-icon-home"></i></span>', $breadcrumb); |
|
268 | - $breadcrumb = str_replace('</ul></div>', '', $breadcrumb); |
|
269 | - return $breadcrumb; |
|
264 | + $breadcrumb = str_replace('<div class="geodir-breadcrumb clearfix"><ul id="breadcrumbs">', '', $breadcrumb); |
|
265 | + $breadcrumb = str_replace('<li>', '', $breadcrumb); |
|
266 | + $breadcrumb = str_replace('</li>', '', $breadcrumb); |
|
267 | + $breadcrumb = str_replace('Home', '<span class="home"><i class="x-icon-home"></i></span>', $breadcrumb); |
|
268 | + $breadcrumb = str_replace('</ul></div>', '', $breadcrumb); |
|
269 | + return $breadcrumb; |
|
270 | 270 | } |
271 | 271 | |
272 | 272 | add_filter('geodir_breadcrumb_separator', 'geodir_x_breadcrumb_separator'); |
@@ -280,125 +280,125 @@ discard block |
||
280 | 280 | */ |
281 | 281 | function geodir_x_breadcrumb_separator($separator) |
282 | 282 | { |
283 | - $separator = str_replace(' > ', ' <span class="delimiter"><i class="x-icon-angle-right"></i></span> ', $separator); |
|
284 | - return $separator; |
|
283 | + $separator = str_replace(' > ', ' <span class="delimiter"><i class="x-icon-angle-right"></i></span> ', $separator); |
|
284 | + return $separator; |
|
285 | 285 | } |
286 | 286 | |
287 | 287 | if (!function_exists('x_breadcrumbs')) : |
288 | - /** |
|
289 | - * breadcrumbs. |
|
290 | - * |
|
291 | - * @since 1.0.0 |
|
292 | - * @package GeoDirectory |
|
293 | - */ |
|
294 | - function x_breadcrumbs() |
|
295 | - { |
|
296 | - |
|
297 | - if (x_get_option('x_breadcrumb_display', '1')) { |
|
298 | - |
|
299 | - // |
|
300 | - // 1. Delimiter between crumbs. |
|
301 | - // 2. Output text for the "Home" link. |
|
302 | - // 3. Link to the home page. |
|
303 | - // 4. Tag before the current crumb. |
|
304 | - // 5. Tag after the current crumb. |
|
305 | - // 6. Get page title. |
|
306 | - // 7. Get blog title. |
|
307 | - // 8. Get shop title. |
|
308 | - // |
|
309 | - |
|
310 | - GLOBAL $post,$wp; |
|
311 | - |
|
312 | - if (geodir_is_page('detail') || geodir_is_page('listing') || (isset($wp->query_vars['page_id']) && $wp->query_vars['page_id'] == geodir_location_page_id())) { |
|
313 | - geodir_breadcrumb(); |
|
314 | - } else { |
|
315 | - |
|
316 | - $stack = x_get_stack(); |
|
317 | - $delimiter = ' <span class="delimiter"><i class="x-icon-angle-right"></i></span> '; // 1 |
|
318 | - $home_text = '<span class="home"><i class="x-icon-home"></i></span>'; // 2 |
|
319 | - $home_link = home_url(); // 3 |
|
320 | - $current_before = '<span class="current">'; // 4 |
|
321 | - $current_after = '</span>'; // 5 |
|
322 | - $page_title = get_the_title(); // 6 |
|
323 | - $blog_title = get_the_title(get_option('page_for_posts', true)); // 7 |
|
324 | - $shop_title = get_theme_mod('x_' . $stack . '_shop_title'); // 8 |
|
325 | - |
|
326 | - if (function_exists('woocommerce_get_page_id')) { |
|
327 | - $shop_url = x_get_shop_link(); |
|
328 | - $shop_link = '<a href="' . $shop_url . '">' . $shop_title . '</a>'; |
|
329 | - } |
|
330 | - |
|
331 | - if (is_front_page()) { |
|
332 | - echo '<div class="x-breadcrumbs">' . $current_before . $home_text . $current_after . '</div>'; |
|
333 | - } elseif (is_home()) { |
|
334 | - echo '<div class="x-breadcrumbs"><a href="' . $home_link . '">' . $home_text . '</a>' . $delimiter . $current_before . $blog_title . $current_after . '</div>'; |
|
335 | - } else { |
|
336 | - echo '<div class="x-breadcrumbs"><a href="' . $home_link . '">' . $home_text . '</a>' . $delimiter; |
|
337 | - if (is_category()) { |
|
338 | - $the_cat = get_category(get_query_var('cat'), false); |
|
339 | - if ($the_cat->parent != 0) echo get_category_parents($the_cat->parent, TRUE, $delimiter); |
|
340 | - echo $current_before . single_cat_title('', false) . $current_after; |
|
341 | - } elseif (x_is_product_category()) { |
|
342 | - echo $shop_link . $delimiter . $current_before . single_cat_title('', false) . $current_after; |
|
343 | - } elseif (x_is_product_tag()) { |
|
344 | - echo $shop_link . $delimiter . $current_before . single_tag_title('', false) . $current_after; |
|
345 | - } elseif (is_search()) { |
|
346 | - echo $current_before . __('Search Results for ', '__x__') . '“' . get_search_query() . '”' . $current_after; |
|
347 | - } elseif (is_singular('post')) { |
|
348 | - if (get_option('page_for_posts') == is_front_page()) { |
|
349 | - echo $current_before . $page_title . $current_after; |
|
350 | - } else { |
|
351 | - echo '<a href="' . get_permalink(get_option('page_for_posts')) . '" title="' . esc_attr(__('See All Posts', '__x__')) . '">' . $blog_title . '</a>' . $delimiter . $current_before . $page_title . $current_after; |
|
352 | - } |
|
353 | - } elseif (x_is_portfolio()) { |
|
354 | - echo $current_before . get_the_title() . $current_after; |
|
355 | - } elseif (x_is_portfolio_item()) { |
|
356 | - $link = x_get_parent_portfolio_link(); |
|
357 | - $title = x_get_parent_portfolio_title(); |
|
358 | - echo '<a href="' . $link . '" title="' . esc_attr(__('See All Posts', '__x__')) . '">' . $title . '</a>' . $delimiter . $current_before . $page_title . $current_after; |
|
359 | - } elseif (x_is_product()) { |
|
360 | - echo $shop_link . $delimiter . $current_before . $page_title . $current_after; |
|
361 | - } elseif (is_page() && !$post->post_parent) { |
|
362 | - echo $current_before . $page_title . $current_after; |
|
363 | - } elseif (is_page() && $post->post_parent) { |
|
364 | - $parent_id = $post->post_parent; |
|
365 | - $breadcrumbs = array(); |
|
366 | - while ($parent_id) { |
|
367 | - $page = get_page($parent_id); |
|
368 | - $breadcrumbs[] = '<a href="' . get_permalink($page->ID) . '">' . get_the_title($page->ID) . '</a>'; |
|
369 | - $parent_id = $page->post_parent; |
|
370 | - } |
|
371 | - $breadcrumbs = array_reverse($breadcrumbs); |
|
372 | - for ($i = 0; $i < count($breadcrumbs); $i++) { |
|
373 | - echo $breadcrumbs[$i]; |
|
374 | - if ($i != count($breadcrumbs) - 1) echo $delimiter; |
|
375 | - } |
|
376 | - echo $delimiter . $current_before . $page_title . $current_after; |
|
377 | - } elseif (is_tag()) { |
|
378 | - echo $current_before . single_tag_title('', false) . $current_after; |
|
379 | - } elseif (is_author()) { |
|
380 | - GLOBAL $author; |
|
381 | - $userdata = get_userdata($author); |
|
382 | - echo $current_before . __('Posts by ', '__x__') . '“' . $userdata->display_name . $current_after . '”'; |
|
383 | - } elseif (is_404()) { |
|
384 | - echo $current_before . __('404 (Page Not Found)', '__x__') . $current_after; |
|
385 | - } elseif (is_archive()) { |
|
386 | - if (x_is_shop()) { |
|
387 | - echo $current_before . $shop_title . $current_after; |
|
388 | - } else { |
|
389 | - echo $current_before . __('Archives ', '__x__') . $current_after; |
|
390 | - } |
|
391 | - } |
|
392 | - if (get_query_var('paged')) { |
|
393 | - echo ' <span class="current" style="white-space: nowrap;">(' . __('Page', '__x__') . ' ' . get_query_var('paged') . ')</span>'; |
|
394 | - } |
|
395 | - echo '</div>'; |
|
396 | - } |
|
397 | - |
|
398 | - } |
|
399 | - |
|
400 | - } |
|
401 | - } // ends my geodir check |
|
288 | + /** |
|
289 | + * breadcrumbs. |
|
290 | + * |
|
291 | + * @since 1.0.0 |
|
292 | + * @package GeoDirectory |
|
293 | + */ |
|
294 | + function x_breadcrumbs() |
|
295 | + { |
|
296 | + |
|
297 | + if (x_get_option('x_breadcrumb_display', '1')) { |
|
298 | + |
|
299 | + // |
|
300 | + // 1. Delimiter between crumbs. |
|
301 | + // 2. Output text for the "Home" link. |
|
302 | + // 3. Link to the home page. |
|
303 | + // 4. Tag before the current crumb. |
|
304 | + // 5. Tag after the current crumb. |
|
305 | + // 6. Get page title. |
|
306 | + // 7. Get blog title. |
|
307 | + // 8. Get shop title. |
|
308 | + // |
|
309 | + |
|
310 | + GLOBAL $post,$wp; |
|
311 | + |
|
312 | + if (geodir_is_page('detail') || geodir_is_page('listing') || (isset($wp->query_vars['page_id']) && $wp->query_vars['page_id'] == geodir_location_page_id())) { |
|
313 | + geodir_breadcrumb(); |
|
314 | + } else { |
|
315 | + |
|
316 | + $stack = x_get_stack(); |
|
317 | + $delimiter = ' <span class="delimiter"><i class="x-icon-angle-right"></i></span> '; // 1 |
|
318 | + $home_text = '<span class="home"><i class="x-icon-home"></i></span>'; // 2 |
|
319 | + $home_link = home_url(); // 3 |
|
320 | + $current_before = '<span class="current">'; // 4 |
|
321 | + $current_after = '</span>'; // 5 |
|
322 | + $page_title = get_the_title(); // 6 |
|
323 | + $blog_title = get_the_title(get_option('page_for_posts', true)); // 7 |
|
324 | + $shop_title = get_theme_mod('x_' . $stack . '_shop_title'); // 8 |
|
325 | + |
|
326 | + if (function_exists('woocommerce_get_page_id')) { |
|
327 | + $shop_url = x_get_shop_link(); |
|
328 | + $shop_link = '<a href="' . $shop_url . '">' . $shop_title . '</a>'; |
|
329 | + } |
|
330 | + |
|
331 | + if (is_front_page()) { |
|
332 | + echo '<div class="x-breadcrumbs">' . $current_before . $home_text . $current_after . '</div>'; |
|
333 | + } elseif (is_home()) { |
|
334 | + echo '<div class="x-breadcrumbs"><a href="' . $home_link . '">' . $home_text . '</a>' . $delimiter . $current_before . $blog_title . $current_after . '</div>'; |
|
335 | + } else { |
|
336 | + echo '<div class="x-breadcrumbs"><a href="' . $home_link . '">' . $home_text . '</a>' . $delimiter; |
|
337 | + if (is_category()) { |
|
338 | + $the_cat = get_category(get_query_var('cat'), false); |
|
339 | + if ($the_cat->parent != 0) echo get_category_parents($the_cat->parent, TRUE, $delimiter); |
|
340 | + echo $current_before . single_cat_title('', false) . $current_after; |
|
341 | + } elseif (x_is_product_category()) { |
|
342 | + echo $shop_link . $delimiter . $current_before . single_cat_title('', false) . $current_after; |
|
343 | + } elseif (x_is_product_tag()) { |
|
344 | + echo $shop_link . $delimiter . $current_before . single_tag_title('', false) . $current_after; |
|
345 | + } elseif (is_search()) { |
|
346 | + echo $current_before . __('Search Results for ', '__x__') . '“' . get_search_query() . '”' . $current_after; |
|
347 | + } elseif (is_singular('post')) { |
|
348 | + if (get_option('page_for_posts') == is_front_page()) { |
|
349 | + echo $current_before . $page_title . $current_after; |
|
350 | + } else { |
|
351 | + echo '<a href="' . get_permalink(get_option('page_for_posts')) . '" title="' . esc_attr(__('See All Posts', '__x__')) . '">' . $blog_title . '</a>' . $delimiter . $current_before . $page_title . $current_after; |
|
352 | + } |
|
353 | + } elseif (x_is_portfolio()) { |
|
354 | + echo $current_before . get_the_title() . $current_after; |
|
355 | + } elseif (x_is_portfolio_item()) { |
|
356 | + $link = x_get_parent_portfolio_link(); |
|
357 | + $title = x_get_parent_portfolio_title(); |
|
358 | + echo '<a href="' . $link . '" title="' . esc_attr(__('See All Posts', '__x__')) . '">' . $title . '</a>' . $delimiter . $current_before . $page_title . $current_after; |
|
359 | + } elseif (x_is_product()) { |
|
360 | + echo $shop_link . $delimiter . $current_before . $page_title . $current_after; |
|
361 | + } elseif (is_page() && !$post->post_parent) { |
|
362 | + echo $current_before . $page_title . $current_after; |
|
363 | + } elseif (is_page() && $post->post_parent) { |
|
364 | + $parent_id = $post->post_parent; |
|
365 | + $breadcrumbs = array(); |
|
366 | + while ($parent_id) { |
|
367 | + $page = get_page($parent_id); |
|
368 | + $breadcrumbs[] = '<a href="' . get_permalink($page->ID) . '">' . get_the_title($page->ID) . '</a>'; |
|
369 | + $parent_id = $page->post_parent; |
|
370 | + } |
|
371 | + $breadcrumbs = array_reverse($breadcrumbs); |
|
372 | + for ($i = 0; $i < count($breadcrumbs); $i++) { |
|
373 | + echo $breadcrumbs[$i]; |
|
374 | + if ($i != count($breadcrumbs) - 1) echo $delimiter; |
|
375 | + } |
|
376 | + echo $delimiter . $current_before . $page_title . $current_after; |
|
377 | + } elseif (is_tag()) { |
|
378 | + echo $current_before . single_tag_title('', false) . $current_after; |
|
379 | + } elseif (is_author()) { |
|
380 | + GLOBAL $author; |
|
381 | + $userdata = get_userdata($author); |
|
382 | + echo $current_before . __('Posts by ', '__x__') . '“' . $userdata->display_name . $current_after . '”'; |
|
383 | + } elseif (is_404()) { |
|
384 | + echo $current_before . __('404 (Page Not Found)', '__x__') . $current_after; |
|
385 | + } elseif (is_archive()) { |
|
386 | + if (x_is_shop()) { |
|
387 | + echo $current_before . $shop_title . $current_after; |
|
388 | + } else { |
|
389 | + echo $current_before . __('Archives ', '__x__') . $current_after; |
|
390 | + } |
|
391 | + } |
|
392 | + if (get_query_var('paged')) { |
|
393 | + echo ' <span class="current" style="white-space: nowrap;">(' . __('Page', '__x__') . ' ' . get_query_var('paged') . ')</span>'; |
|
394 | + } |
|
395 | + echo '</div>'; |
|
396 | + } |
|
397 | + |
|
398 | + } |
|
399 | + |
|
400 | + } |
|
401 | + } // ends my geodir check |
|
402 | 402 | endif; |
403 | 403 | |
404 | 404 | |
@@ -413,8 +413,8 @@ discard block |
||
413 | 413 | */ |
414 | 414 | function geodir_x_location_switcher_menu_li_class($class) |
415 | 415 | { |
416 | - $class .= " menu-item-has-children "; |
|
417 | - return $class; |
|
416 | + $class .= " menu-item-has-children "; |
|
417 | + return $class; |
|
418 | 418 | } |
419 | 419 | |
420 | 420 | add_filter('geodir_sub_menu_li_class', 'geodir_x_sub_menu_li_class', 10, 1); |
@@ -428,6 +428,6 @@ discard block |
||
428 | 428 | */ |
429 | 429 | function geodir_x_sub_menu_li_class($class) |
430 | 430 | { |
431 | - $class .= " menu-item-has-children "; |
|
432 | - return $class; |
|
431 | + $class .= " menu-item-has-children "; |
|
432 | + return $class; |
|
433 | 433 | } |
434 | 434 | \ No newline at end of file |
@@ -1,11 +1,11 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Admin custom field form |
|
4 | - * |
|
5 | - * @since 1.0.0 |
|
6 | - * |
|
7 | - * @package GeoDirectory |
|
8 | - */ |
|
3 | + * Admin custom field form |
|
4 | + * |
|
5 | + * @since 1.0.0 |
|
6 | + * |
|
7 | + * @package GeoDirectory |
|
8 | + */ |
|
9 | 9 | |
10 | 10 | /** |
11 | 11 | * Displays the custom field form content. |
@@ -18,9 +18,9 @@ discard block |
||
18 | 18 | global $post_type; |
19 | 19 | |
20 | 20 | if (!isset($field_info->post_type)) { |
21 | - $post_type = sanitize_text_field($_REQUEST['listing_type']); |
|
21 | + $post_type = sanitize_text_field($_REQUEST['listing_type']); |
|
22 | 22 | } else |
23 | - $post_type = $field_info->post_type; |
|
23 | + $post_type = $field_info->post_type; |
|
24 | 24 | |
25 | 25 | $field_info = stripslashes_deep($field_info); // strip slashes from labels |
26 | 26 | |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | |
29 | 29 | $field_admin_title = ''; |
30 | 30 | if (isset($field_info->admin_title)) |
31 | - $field_admin_title = $field_info->admin_title; |
|
31 | + $field_admin_title = $field_info->admin_title; |
|
32 | 32 | |
33 | 33 | $default = isset($field_info->is_admin) ? $field_info->is_admin : ''; |
34 | 34 | |
@@ -47,8 +47,8 @@ discard block |
||
47 | 47 | ondblclick="show_hide('field_frm<?php echo $result_str; ?>')"> |
48 | 48 | <?php |
49 | 49 | |
50 | - $nonce = wp_create_nonce('custom_fields_' . $result_str); |
|
51 | - ?> |
|
50 | + $nonce = wp_create_nonce('custom_fields_' . $result_str); |
|
51 | + ?> |
|
52 | 52 | |
53 | 53 | <?php if ($default): ?> |
54 | 54 | <div title="<?php _e('Drag and drop to sort', 'geodirectory'); ?>" class="handlediv move"></div> |
@@ -57,42 +57,42 @@ discard block |
||
57 | 57 | onclick="delete_field('<?php echo $result_str; ?>', '<?php echo $nonce; ?>')" |
58 | 58 | class="handlediv close"></div> |
59 | 59 | <?php endif; |
60 | - if ($field_type == 'fieldset') { |
|
61 | - ?> |
|
60 | + if ($field_type == 'fieldset') { |
|
61 | + ?> |
|
62 | 62 | |
63 | 63 | <b style="cursor:pointer;" |
64 | 64 | onclick="show_hide('field_frm<?php echo $result_str;?>')"><?php echo geodir_ucwords(__('Fieldset:', 'geodirectory') . ' ' . $field_admin_title);?></b> |
65 | 65 | <?php |
66 | - } else { |
|
67 | - ?> |
|
66 | + } else { |
|
67 | + ?> |
|
68 | 68 | <b style="cursor:pointer;" |
69 | 69 | onclick="show_hide('field_frm<?php echo $result_str;?>')"><?php echo geodir_ucwords(__('Field:', 'geodirectory') . ' ' . $field_admin_title . ' (' . $field_type . ')');?></b> |
70 | 70 | <?php |
71 | - } |
|
72 | - ?> |
|
71 | + } |
|
72 | + ?> |
|
73 | 73 | </div> |
74 | 74 | |
75 | 75 | <div id="field_frm<?php echo $result_str; ?>" class="field_frm" |
76 | 76 | style="display:<?php if ($field_ins_upd == 'submit') { |
77 | - echo 'block;'; |
|
78 | - } else { |
|
79 | - echo 'none;'; |
|
80 | - } ?>"> |
|
77 | + echo 'block;'; |
|
78 | + } else { |
|
79 | + echo 'none;'; |
|
80 | + } ?>"> |
|
81 | 81 | <input type="hidden" name="_wpnonce" value="<?php echo esc_attr($nonce); ?>"/> |
82 | 82 | <input type="hidden" name="listing_type" id="listing_type" value="<?php echo $post_type; ?>"/> |
83 | 83 | <input type="hidden" name="field_type" id="field_type" value="<?php echo $field_type; ?>"/> |
84 | 84 | <input type="hidden" name="field_id" id="field_id" value="<?php echo esc_attr($result_str); ?>"/> |
85 | 85 | <input type="hidden" name="data_type" id="data_type" value="<?php if (isset($field_info->data_type)) { |
86 | - echo $field_info->data_type; |
|
87 | - } ?>"/> |
|
86 | + echo $field_info->data_type; |
|
87 | + } ?>"/> |
|
88 | 88 | <input type="hidden" name="is_active" id="is_active" value="1"/> |
89 | 89 | |
90 | 90 | <table class="widefat post fixed" border="0" style="width:100%;"> |
91 | 91 | <?php if ($field_type != 'text' || $default) { ?> |
92 | 92 | |
93 | 93 | <input type="hidden" name="data_type" id="data_type" value="<?php if (isset($field_info->data_type)) { |
94 | - echo esc_attr($field_info->data_type); |
|
95 | - } ?>"/> |
|
94 | + echo esc_attr($field_info->data_type); |
|
95 | + } ?>"/> |
|
96 | 96 | |
97 | 97 | <?php } else { ?> |
98 | 98 | |
@@ -104,16 +104,16 @@ discard block |
||
104 | 104 | onchange="javascript:gd_data_type_changed(this, '<?php echo $result_str; ?>');"> |
105 | 105 | <option |
106 | 106 | value="VARCHAR" <?php if (isset($field_info->data_type) && $field_info->data_type == 'VARCHAR') { |
107 | - echo 'selected="selected"'; |
|
108 | - } ?>><?php _e('CHARACTER', 'geodirectory'); ?></option> |
|
107 | + echo 'selected="selected"'; |
|
108 | + } ?>><?php _e('CHARACTER', 'geodirectory'); ?></option> |
|
109 | 109 | <option |
110 | 110 | value="INT" <?php if (isset($field_info->data_type) && $field_info->data_type == 'INT') { |
111 | - echo 'selected="selected"'; |
|
112 | - } ?>><?php _e('NUMBER', 'geodirectory'); ?></option> |
|
111 | + echo 'selected="selected"'; |
|
112 | + } ?>><?php _e('NUMBER', 'geodirectory'); ?></option> |
|
113 | 113 | <option |
114 | 114 | value="FLOAT" <?php if (isset($field_info->data_type) && $field_info->data_type == 'FLOAT') { |
115 | - echo 'selected="selected"'; |
|
116 | - } ?>><?php _e('DECIMAL', 'geodirectory'); ?></option> |
|
115 | + echo 'selected="selected"'; |
|
116 | + } ?>><?php _e('DECIMAL', 'geodirectory'); ?></option> |
|
117 | 117 | </select> |
118 | 118 | <br/> <span><?php _e('Select Custom Field type', 'geodirectory'); ?></span> |
119 | 119 | |
@@ -127,8 +127,8 @@ discard block |
||
127 | 127 | <select name="decimal_point" id="decimal_point"> |
128 | 128 | <option value=""><?php echo _e('Select', 'geodirectory'); ?></option> |
129 | 129 | <?php for ($i = 1; $i <= 10; $i++) { |
130 | - $decimal_point = isset($field_info->decimal_point) ? $field_info->decimal_point : ''; |
|
131 | - $selected = $i == $decimal_point ? 'selected="selected"' : ''; ?> |
|
130 | + $decimal_point = isset($field_info->decimal_point) ? $field_info->decimal_point : ''; |
|
131 | + $selected = $i == $decimal_point ? 'selected="selected"' : ''; ?> |
|
132 | 132 | <option value="<?php echo $i; ?>" <?php echo $selected; ?>><?php echo $i; ?></option> |
133 | 133 | <?php } ?> |
134 | 134 | </select> |
@@ -143,8 +143,8 @@ discard block |
||
143 | 143 | <td align="left"> |
144 | 144 | <input type="text" name="admin_title" id="admin_title" |
145 | 145 | value="<?php if (isset($field_info->admin_title)) { |
146 | - echo esc_attr($field_info->admin_title); |
|
147 | - } ?>"/> |
|
146 | + echo esc_attr($field_info->admin_title); |
|
147 | + } ?>"/> |
|
148 | 148 | <br/><span><?php _e('Personal comment, it would not be displayed anywhere except in custom field settings', 'geodirectory'); ?></span> |
149 | 149 | </td> |
150 | 150 | </tr> |
@@ -153,8 +153,8 @@ discard block |
||
153 | 153 | <td align="left"> |
154 | 154 | <input type="text" name="site_title" id="site_title" |
155 | 155 | value="<?php if (isset($field_info->site_title)) { |
156 | - echo esc_attr($field_info->site_title); |
|
157 | - } ?>"/> |
|
156 | + echo esc_attr($field_info->site_title); |
|
157 | + } ?>"/> |
|
158 | 158 | <br/><span><?php _e('Section title which you wish to display in frontend', 'geodirectory'); ?></span> |
159 | 159 | </td> |
160 | 160 | </tr> |
@@ -163,23 +163,23 @@ discard block |
||
163 | 163 | <td align="left"> |
164 | 164 | <input type="text" name="admin_desc" id="admin_desc" |
165 | 165 | value="<?php if (isset($field_info->admin_desc)) { |
166 | - echo esc_attr($field_info->admin_desc); |
|
167 | - } ?>"/> |
|
166 | + echo esc_attr($field_info->admin_desc); |
|
167 | + } ?>"/> |
|
168 | 168 | <br/><span><?php _e('Section description which will appear in frontend', 'geodirectory'); ?></span> |
169 | 169 | </td> |
170 | 170 | </tr> |
171 | 171 | <?php if ($field_type != 'fieldset' && $field_type != 'taxonomy') { |
172 | - ?> |
|
172 | + ?> |
|
173 | 173 | |
174 | 174 | <tr> |
175 | 175 | <td><strong><?php _e('HTML variable name :', 'geodirectory');?></strong></td> |
176 | 176 | <td align="left"> |
177 | 177 | <input type="text" name="htmlvar_name" id="htmlvar_name" |
178 | 178 | value="<?php if (isset($field_info->htmlvar_name)) { |
179 | - echo preg_replace('/geodir_/', '', $field_info->htmlvar_name, 1); |
|
180 | - }?>" <?php if ($default) { |
|
181 | - echo 'readonly="readonly"'; |
|
182 | - }?> /> |
|
179 | + echo preg_replace('/geodir_/', '', $field_info->htmlvar_name, 1); |
|
180 | + }?>" <?php if ($default) { |
|
181 | + echo 'readonly="readonly"'; |
|
182 | + }?> /> |
|
183 | 183 | <br/> <span><?php _e('HTML variable name must not be blank', 'geodirectory');?></span> |
184 | 184 | <br/> <span><?php _e('This should be a unique name', 'geodirectory');?></span> |
185 | 185 | <br/> |
@@ -191,8 +191,8 @@ discard block |
||
191 | 191 | <td><strong><?php _e('Admin label :', 'geodirectory'); ?></strong></td> |
192 | 192 | <td align="left"><input type="text" name="clabels" id="clabels" |
193 | 193 | value="<?php if (isset($field_info->clabels)) { |
194 | - echo esc_attr($field_info->clabels); |
|
195 | - } ?>"/> |
|
194 | + echo esc_attr($field_info->clabels); |
|
195 | + } ?>"/> |
|
196 | 196 | <br/> |
197 | 197 | <span><?php _e('Section Title which will appear in backend', 'geodirectory'); ?></span> |
198 | 198 | </td> |
@@ -223,8 +223,8 @@ discard block |
||
223 | 223 | <td><strong><?php _e('Display order :', 'geodirectory'); ?></strong></td> |
224 | 224 | <td align="left"><input type="text" readonly="readonly" name="sort_order" id="sort_order" |
225 | 225 | value="<?php if (isset($field_info->sort_order)) { |
226 | - echo esc_attr($field_info->sort_order); |
|
227 | - } ?>"/> |
|
226 | + echo esc_attr($field_info->sort_order); |
|
227 | + } ?>"/> |
|
228 | 228 | <br/> |
229 | 229 | <span><?php _e('Enter the display order of this field in backend. e.g. 5', 'geodirectory'); ?></span> |
230 | 230 | </td> |
@@ -235,11 +235,11 @@ discard block |
||
235 | 235 | <td align="left"> |
236 | 236 | <select name="is_default" id="is_default"> |
237 | 237 | <option value="0" <?php if (!isset($field_info->is_default) || $field_info->is_default == '0') { |
238 | - echo 'selected="selected"'; |
|
239 | - } ?>><?php _e('No', 'geodirectory'); ?></option> |
|
238 | + echo 'selected="selected"'; |
|
239 | + } ?>><?php _e('No', 'geodirectory'); ?></option> |
|
240 | 240 | <option value="1" <?php if (isset($field_info->is_default) && $field_info->is_default == '1') { |
241 | - echo 'selected="selected"'; |
|
242 | - } ?>><?php _e('Yes', 'geodirectory'); ?></option> |
|
241 | + echo 'selected="selected"'; |
|
242 | + } ?>><?php _e('Yes', 'geodirectory'); ?></option> |
|
243 | 243 | </select> |
244 | 244 | <br/> |
245 | 245 | <span><?php _e('Select yes or no. If no is selected then the field will be displayed as main form field or additional field', 'geodirectory'); ?></span> |
@@ -254,13 +254,13 @@ discard block |
||
254 | 254 | <td> |
255 | 255 | |
256 | 256 | <?php |
257 | - $selected = ''; |
|
258 | - if (isset($field_info->extra_fields)) |
|
259 | - $advanced_editor = unserialize($field_info->extra_fields); |
|
257 | + $selected = ''; |
|
258 | + if (isset($field_info->extra_fields)) |
|
259 | + $advanced_editor = unserialize($field_info->extra_fields); |
|
260 | 260 | |
261 | - if (!empty($advanced_editor) && is_array($advanced_editor) && in_array('1', $advanced_editor)) |
|
262 | - $selected = 'checked="checked"'; |
|
263 | - ?> |
|
261 | + if (!empty($advanced_editor) && is_array($advanced_editor) && in_array('1', $advanced_editor)) |
|
262 | + $selected = 'checked="checked"'; |
|
263 | + ?> |
|
264 | 264 | |
265 | 265 | <input type="checkbox" name="advanced_editor[]" id="advanced_editor" |
266 | 266 | value="1" <?php echo $selected; ?>/> |
@@ -268,42 +268,42 @@ discard block |
||
268 | 268 | </td> |
269 | 269 | |
270 | 270 | </tr><?php |
271 | - } ?> |
|
271 | + } ?> |
|
272 | 272 | |
273 | 273 | <?php |
274 | 274 | |
275 | - $pricearr = array(); |
|
276 | - if (isset($field_info->packages) && $field_info->packages != '') { |
|
277 | - $pricearr = explode(',', trim($field_info->packages, ',')); |
|
278 | - } else { |
|
279 | - $package_info = array(); |
|
275 | + $pricearr = array(); |
|
276 | + if (isset($field_info->packages) && $field_info->packages != '') { |
|
277 | + $pricearr = explode(',', trim($field_info->packages, ',')); |
|
278 | + } else { |
|
279 | + $package_info = array(); |
|
280 | 280 | |
281 | - $package_info = geodir_post_package_info($package_info, '', $post_type); |
|
282 | - $pricearr[] = $package_info->pid; |
|
283 | - } |
|
281 | + $package_info = geodir_post_package_info($package_info, '', $post_type); |
|
282 | + $pricearr[] = $package_info->pid; |
|
283 | + } |
|
284 | 284 | |
285 | - ob_start() |
|
286 | - ?> |
|
285 | + ob_start() |
|
286 | + ?> |
|
287 | 287 | |
288 | 288 | <select style="display:none" name="show_on_pkg[]" id="show_on_pkg" multiple="multiple"> |
289 | 289 | <?php |
290 | - if (!empty($pricearr)) { |
|
291 | - foreach ($pricearr as $val) { |
|
292 | - ?> |
|
290 | + if (!empty($pricearr)) { |
|
291 | + foreach ($pricearr as $val) { |
|
292 | + ?> |
|
293 | 293 | <option selected="selected" value="<?php echo esc_attr($val); ?>" ><?php echo $val; ?></option><?php |
294 | - } |
|
295 | - } |
|
296 | - ?> |
|
294 | + } |
|
295 | + } |
|
296 | + ?> |
|
297 | 297 | </select> |
298 | 298 | |
299 | 299 | <?php |
300 | - $html = ob_get_clean(); |
|
300 | + $html = ob_get_clean(); |
|
301 | 301 | |
302 | 302 | /** |
303 | 303 | * Filter the price packages list. |
304 | 304 | * |
305 | 305 | * Filter the price packages list in custom field form in admin |
306 | - * custom fields settings. |
|
306 | + * custom fields settings. |
|
307 | 307 | * |
308 | 308 | * @since 1.0.0 |
309 | 309 | * |
@@ -312,26 +312,26 @@ discard block |
||
312 | 312 | */ |
313 | 313 | echo $html = apply_filters('geodir_packages_list_on_custom_fields', $html, $field_info); |
314 | 314 | |
315 | - ?> |
|
315 | + ?> |
|
316 | 316 | |
317 | 317 | <tr> |
318 | 318 | <td><strong><?php _e('Is active :', 'geodirectory'); ?></strong></td> |
319 | 319 | <td align="left"> |
320 | 320 | <select name="is_active" id="is_active"> |
321 | 321 | <option value="1" <?php if (isset($field_info->is_active) && $field_info->is_active == '1') { |
322 | - echo 'selected="selected"'; |
|
323 | - } ?>><?php _e('Yes', 'geodirectory'); ?></option> |
|
322 | + echo 'selected="selected"'; |
|
323 | + } ?>><?php _e('Yes', 'geodirectory'); ?></option> |
|
324 | 324 | <option |
325 | 325 | value="0" <?php if ((isset($field_info->is_active) && $field_info->is_active == '0') || !isset($field_info->is_active)) { |
326 | - echo 'selected="selected"'; |
|
327 | - } ?>><?php _e('No', 'geodirectory'); ?></option> |
|
326 | + echo 'selected="selected"'; |
|
327 | + } ?>><?php _e('No', 'geodirectory'); ?></option> |
|
328 | 328 | </select> |
329 | 329 | <br/> |
330 | 330 | <span><?php _e('Select yes or no. If no is selected then the field will not be displayed anywhere', 'geodirectory'); ?></span> |
331 | 331 | </td> |
332 | 332 | </tr> |
333 | 333 | <?php if (!$default) { /* field for admin use only */ |
334 | - $for_admin_use = isset($field_info->for_admin_use) && $field_info->for_admin_use == '1' ? true : false; ?> |
|
334 | + $for_admin_use = isset($field_info->for_admin_use) && $field_info->for_admin_use == '1' ? true : false; ?> |
|
335 | 335 | <tr> |
336 | 336 | <td><strong><?php _e('For admin use only? :', 'geodirectory'); ?></strong></td> |
337 | 337 | <td align="left"> |
@@ -353,12 +353,12 @@ discard block |
||
353 | 353 | <select name="is_required" id="is_required"> |
354 | 354 | <option |
355 | 355 | value="1" <?php if (isset($field_info->is_required) && $field_info->is_required == '1') { |
356 | - echo 'selected="selected"'; |
|
357 | - } ?>><?php _e('Yes', 'geodirectory'); ?></option> |
|
356 | + echo 'selected="selected"'; |
|
357 | + } ?>><?php _e('Yes', 'geodirectory'); ?></option> |
|
358 | 358 | <option |
359 | 359 | value="0" <?php if ((isset($field_info->is_required) && $field_info->is_required == '0') || !isset($field_info->is_required)) { |
360 | - echo 'selected="selected"'; |
|
361 | - } ?>><?php _e('No', 'geodirectory'); ?></option> |
|
360 | + echo 'selected="selected"'; |
|
361 | + } ?>><?php _e('No', 'geodirectory'); ?></option> |
|
362 | 362 | </select> |
363 | 363 | <br/> <span><?php _e('Select yes to set field as required', 'geodirectory'); ?></span> |
364 | 364 | </td> |
@@ -370,8 +370,8 @@ discard block |
||
370 | 370 | <td align="left"> |
371 | 371 | <input type="text" name="required_msg" id="required_msg" |
372 | 372 | value="<?php if (isset($field_info->required_msg)) { |
373 | - echo esc_attr($field_info->required_msg); |
|
374 | - } ?>"/> |
|
373 | + echo esc_attr($field_info->required_msg); |
|
374 | + } ?>"/> |
|
375 | 375 | <span> |
376 | 376 | <?php _e('Enter text for error message if field required and have not full fill requirement.', 'geodirectory'); ?> |
377 | 377 | </span> |
@@ -385,8 +385,8 @@ discard block |
||
385 | 385 | <td align="left"> |
386 | 386 | <input type="text" name="validation_pattern" id="validation_pattern" |
387 | 387 | value="<?php if (isset($field_info->validation_pattern)) { |
388 | - echo esc_attr($field_info->validation_pattern); |
|
389 | - } ?>"/> |
|
388 | + echo esc_attr($field_info->validation_pattern); |
|
389 | + } ?>"/> |
|
390 | 390 | <span> |
391 | 391 | <?php _e('Enter regex expression for HTML5 pattern validation.', 'geodirectory'); ?> |
392 | 392 | </span> |
@@ -399,8 +399,8 @@ discard block |
||
399 | 399 | <td align="left"> |
400 | 400 | <input type="text" name="validation_msg" id="validation_msg" |
401 | 401 | value="<?php if (isset($field_info->validation_msg)) { |
402 | - echo esc_attr($field_info->validation_msg); |
|
403 | - } ?>"/> |
|
402 | + echo esc_attr($field_info->validation_msg); |
|
403 | + } ?>"/> |
|
404 | 404 | <span> |
405 | 405 | <?php _e('Enter a extra validation message to show to the user if validation fails.', 'geodirectory'); ?> |
406 | 406 | </span> |
@@ -415,12 +415,12 @@ discard block |
||
415 | 415 | <select name="show_on_listing" id="show_on_listing"> |
416 | 416 | <option |
417 | 417 | value="1" <?php if (isset($field_info->show_on_listing) && $field_info->show_on_listing == '1') { |
418 | - echo 'selected="selected"'; |
|
419 | - } ?>><?php _e('Yes', 'geodirectory'); ?></option> |
|
418 | + echo 'selected="selected"'; |
|
419 | + } ?>><?php _e('Yes', 'geodirectory'); ?></option> |
|
420 | 420 | <option |
421 | 421 | value="0" <?php if ((isset($field_info->show_on_listing) && ($field_info->show_on_listing == '0' || $field_info->show_on_listing == '')) || !isset($field_info->show_on_listing)) { |
422 | - echo 'selected="selected"'; |
|
423 | - } ?>><?php _e('No', 'geodirectory'); ?></option> |
|
422 | + echo 'selected="selected"'; |
|
423 | + } ?>><?php _e('No', 'geodirectory'); ?></option> |
|
424 | 424 | </select> |
425 | 425 | <br/> <span><?php _e('Want to show this on listing page ?', 'geodirectory'); ?></span> |
426 | 426 | </td> |
@@ -432,12 +432,12 @@ discard block |
||
432 | 432 | <select name="show_on_detail" id="show_on_detail"> |
433 | 433 | <option |
434 | 434 | value="1" <?php if (isset($field_info->show_on_detail) && $field_info->show_on_detail == '1') { |
435 | - echo 'selected="selected"'; |
|
436 | - } ?>><?php _e('Yes', 'geodirectory'); ?></option> |
|
435 | + echo 'selected="selected"'; |
|
436 | + } ?>><?php _e('Yes', 'geodirectory'); ?></option> |
|
437 | 437 | <option |
438 | 438 | value="0" <?php if ((isset($field_info->show_on_detail) && ($field_info->show_on_detail == '0' || $field_info->show_on_detail == '')) || !isset($field_info->show_on_detail)) { |
439 | - echo 'selected="selected"'; |
|
440 | - } ?>><?php _e('No', 'geodirectory'); ?></option> |
|
439 | + echo 'selected="selected"'; |
|
440 | + } ?>><?php _e('No', 'geodirectory'); ?></option> |
|
441 | 441 | </select> |
442 | 442 | <br/> |
443 | 443 | <span><?php _e('Want to show this in More Info tab on detail page?', 'geodirectory'); ?></span> |
@@ -450,12 +450,12 @@ discard block |
||
450 | 450 | <select name="show_as_tab" id="show_as_tab"> |
451 | 451 | <option |
452 | 452 | value="1" <?php if (isset($field_info->show_as_tab) && $field_info->show_as_tab == '1') { |
453 | - echo 'selected="selected"'; |
|
454 | - } ?>><?php _e('Yes', 'geodirectory'); ?></option> |
|
453 | + echo 'selected="selected"'; |
|
454 | + } ?>><?php _e('Yes', 'geodirectory'); ?></option> |
|
455 | 455 | <option |
456 | 456 | value="0" <?php if ((isset($field_info->show_as_tab) && ($field_info->show_as_tab == '0' || $field_info->show_as_tab == '')) || !isset($field_info->show_as_tab)) { |
457 | - echo 'selected="selected"'; |
|
458 | - } ?>><?php _e('No', 'geodirectory'); ?></option> |
|
457 | + echo 'selected="selected"'; |
|
458 | + } ?>><?php _e('No', 'geodirectory'); ?></option> |
|
459 | 459 | </select> |
460 | 460 | <br/><span><?php _e('Want to display this as a tab on detail page? If "Yes" then "Show on detail page?" must be Yes.', 'geodirectory'); ?></span> |
461 | 461 | </td> |
@@ -464,23 +464,23 @@ discard block |
||
464 | 464 | |
465 | 465 | <?php |
466 | 466 | |
467 | - switch ($field_type): |
|
468 | - case 'taxonomy': { |
|
469 | - ?> |
|
467 | + switch ($field_type): |
|
468 | + case 'taxonomy': { |
|
469 | + ?> |
|
470 | 470 | <tr> |
471 | 471 | <td><strong><?php _e('Select taxonomy:', 'geodirectory');?></strong></td> |
472 | 472 | <td align="left"> |
473 | 473 | <select name="htmlvar_name" id="htmlvar_name"> |
474 | 474 | <?php |
475 | - $gd_taxonomy = geodir_get_taxonomies($post_type); |
|
475 | + $gd_taxonomy = geodir_get_taxonomies($post_type); |
|
476 | 476 | |
477 | - foreach ($gd_taxonomy as $gd_tax) { |
|
478 | - ?> |
|
477 | + foreach ($gd_taxonomy as $gd_tax) { |
|
478 | + ?> |
|
479 | 479 | <option <?php if (isset($field_info->htmlvar_name) && $field_info->htmlvar_name == $gd_tax) { |
480 | - echo 'selected="selected"'; |
|
481 | - }?> id="<?php echo $gd_tax;?>"><?php echo $gd_tax;?></option><?php |
|
482 | - } |
|
483 | - ?> |
|
480 | + echo 'selected="selected"'; |
|
481 | + }?> id="<?php echo $gd_tax;?>"><?php echo $gd_tax;?></option><?php |
|
482 | + } |
|
483 | + ?> |
|
484 | 484 | </select> |
485 | 485 | |
486 | 486 | <br/> |
@@ -494,20 +494,20 @@ discard block |
||
494 | 494 | |
495 | 495 | <select name="cat_display_type" id="cat_display_type"> |
496 | 496 | <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'ajax_chained') { |
497 | - echo 'selected="selected"'; |
|
498 | - }?> value="ajax_chained"><?php _e('Ajax Chained', 'geodirectory');?></option> |
|
497 | + echo 'selected="selected"'; |
|
498 | + }?> value="ajax_chained"><?php _e('Ajax Chained', 'geodirectory');?></option> |
|
499 | 499 | <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'select') { |
500 | - echo 'selected="selected"'; |
|
501 | - }?> value="select"><?php _e('Select', 'geodirectory');?></option> |
|
500 | + echo 'selected="selected"'; |
|
501 | + }?> value="select"><?php _e('Select', 'geodirectory');?></option> |
|
502 | 502 | <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'multiselect') { |
503 | - echo 'selected="selected"'; |
|
504 | - }?> value="multiselect"><?php _e('Multiselect', 'geodirectory');?></option> |
|
503 | + echo 'selected="selected"'; |
|
504 | + }?> value="multiselect"><?php _e('Multiselect', 'geodirectory');?></option> |
|
505 | 505 | <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'checkbox') { |
506 | - echo 'selected="selected"'; |
|
507 | - }?> value="checkbox"><?php _e('Checkbox', 'geodirectory');?></option> |
|
506 | + echo 'selected="selected"'; |
|
507 | + }?> value="checkbox"><?php _e('Checkbox', 'geodirectory');?></option> |
|
508 | 508 | <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'radio') { |
509 | - echo 'selected="selected"'; |
|
510 | - }?> value="radio"><?php _e('Radio', 'geodirectory');?></option> |
|
509 | + echo 'selected="selected"'; |
|
510 | + }?> value="radio"><?php _e('Radio', 'geodirectory');?></option> |
|
511 | 511 | </select> |
512 | 512 | |
513 | 513 | <br/> |
@@ -515,29 +515,29 @@ discard block |
||
515 | 515 | </td> |
516 | 516 | </tr> |
517 | 517 | <?php } // end of additional field for taxonomy field type |
518 | - break; |
|
519 | - case 'address': { |
|
520 | - if (isset($field_info->extra_fields) && $field_info->extra_fields != '') { |
|
521 | - $address = unserialize($field_info->extra_fields); |
|
522 | - } |
|
523 | - ?> |
|
518 | + break; |
|
519 | + case 'address': { |
|
520 | + if (isset($field_info->extra_fields) && $field_info->extra_fields != '') { |
|
521 | + $address = unserialize($field_info->extra_fields); |
|
522 | + } |
|
523 | + ?> |
|
524 | 524 | <?php |
525 | - /** |
|
526 | - * Called on the add custom fields settings page before the address field is output. |
|
527 | - * |
|
528 | - * @since 1.0.0 |
|
529 | - * @param array $address The address settings array. |
|
530 | - * @param object $field_info Extra fileds info. |
|
531 | - */ |
|
532 | - do_action('geodir_address_extra_admin_fields', $address, $field_info); ?> |
|
525 | + /** |
|
526 | + * Called on the add custom fields settings page before the address field is output. |
|
527 | + * |
|
528 | + * @since 1.0.0 |
|
529 | + * @param array $address The address settings array. |
|
530 | + * @param object $field_info Extra fileds info. |
|
531 | + */ |
|
532 | + do_action('geodir_address_extra_admin_fields', $address, $field_info); ?> |
|
533 | 533 | |
534 | 534 | <tr> |
535 | 535 | <td><strong><?php _e('Display zip/post code :', 'geodirectory');?></strong></td> |
536 | 536 | <td align="left"> |
537 | 537 | <input type="checkbox" name="extra[show_zip]" id="show_zip" |
538 | 538 | value="1" <?php if (isset($address['show_zip']) && $address['show_zip'] == '1') { |
539 | - echo 'checked="checked"'; |
|
540 | - }?>/> |
|
539 | + echo 'checked="checked"'; |
|
540 | + }?>/> |
|
541 | 541 | <span><?php _e('Select if you want to show zip/post code field in address section.', 'geodirectory');?></span> |
542 | 542 | </td> |
543 | 543 | </tr> |
@@ -547,8 +547,8 @@ discard block |
||
547 | 547 | <td align="left"> |
548 | 548 | <input type="text" name="extra[zip_lable]" id="zip_lable" |
549 | 549 | value="<?php if (isset($address['zip_lable'])) { |
550 | - echo esc_attr($address['zip_lable']); |
|
551 | - }?>"/> |
|
550 | + echo esc_attr($address['zip_lable']); |
|
551 | + }?>"/> |
|
552 | 552 | <span><?php _e('Enter zip/post code field label in address section.', 'geodirectory');?></span> |
553 | 553 | </td> |
554 | 554 | </tr> |
@@ -558,8 +558,8 @@ discard block |
||
558 | 558 | <td align="left"> |
559 | 559 | <input type="checkbox" name="extra[show_map]" id="show_map" |
560 | 560 | value="1" <?php if (isset($address['show_map']) && $address['show_map'] == '1') { |
561 | - echo 'checked="checked"'; |
|
562 | - }?>/> |
|
561 | + echo 'checked="checked"'; |
|
562 | + }?>/> |
|
563 | 563 | <span><?php _e('Select if you want to `set address on map` field in address section.', 'geodirectory');?></span> |
564 | 564 | </td> |
565 | 565 | </tr> |
@@ -569,8 +569,8 @@ discard block |
||
569 | 569 | <td align="left"> |
570 | 570 | <input type="text" name="extra[map_lable]" id="map_lable" |
571 | 571 | value="<?php if (isset($address['map_lable'])) { |
572 | - echo esc_attr($address['map_lable']); |
|
573 | - }?>"/> |
|
572 | + echo esc_attr($address['map_lable']); |
|
573 | + }?>"/> |
|
574 | 574 | <span><?php _e('Enter text for `set address on map` button in address section.', 'geodirectory');?></span> |
575 | 575 | </td> |
576 | 576 | </tr> |
@@ -580,8 +580,8 @@ discard block |
||
580 | 580 | <td align="left"> |
581 | 581 | <input type="checkbox" name="extra[show_mapzoom]" id="show_mapzoom" |
582 | 582 | value="1" <?php if (isset($address['show_mapzoom']) && $address['show_mapzoom'] == '1') { |
583 | - echo 'checked="checked"'; |
|
584 | - }?>/> |
|
583 | + echo 'checked="checked"'; |
|
584 | + }?>/> |
|
585 | 585 | <span><?php _e('Select if you want to use the user defined map zoom level.', 'geodirectory');?></span> |
586 | 586 | </td> |
587 | 587 | </tr> |
@@ -591,8 +591,8 @@ discard block |
||
591 | 591 | <td align="left"> |
592 | 592 | <input type="checkbox" name="extra[show_mapview]" id="show_mapview" |
593 | 593 | value="1" <?php if (isset($address['show_mapview']) && $address['show_mapview'] == '1') { |
594 | - echo 'checked="checked"'; |
|
595 | - }?>/> |
|
594 | + echo 'checked="checked"'; |
|
595 | + }?>/> |
|
596 | 596 | <span><?php _e('Select if you want to `set default map` options in address section.', 'geodirectory');?></span> |
597 | 597 | </td> |
598 | 598 | </tr> |
@@ -603,8 +603,8 @@ discard block |
||
603 | 603 | <td align="left"> |
604 | 604 | <input type="text" name="extra[mapview_lable]" id="mapview_lable" |
605 | 605 | value="<?php if (isset($address['mapview_lable'])) { |
606 | - echo esc_attr($address['mapview_lable']); |
|
607 | - }?>"/> |
|
606 | + echo esc_attr($address['mapview_lable']); |
|
607 | + }?>"/> |
|
608 | 608 | <span><?php _e('Enter mapview field label in address section.', 'geodirectory');?></span> |
609 | 609 | </td> |
610 | 610 | </tr> |
@@ -615,33 +615,33 @@ discard block |
||
615 | 615 | <td align="left"> |
616 | 616 | <input type="checkbox" name="extra[show_latlng]" id="show_latlng" |
617 | 617 | value="1" <?php if (isset($address['show_latlng']) && $address['show_latlng'] == '1') { |
618 | - echo 'checked="checked"'; |
|
619 | - }?>/> |
|
618 | + echo 'checked="checked"'; |
|
619 | + }?>/> |
|
620 | 620 | <span><?php _e('Select if you want to show latitude and logatude fields in address section from front-end.', 'geodirectory');?></span> |
621 | 621 | </td> |
622 | 622 | </tr> |
623 | 623 | <?php } // end of extra fields for address field type |
624 | - break; |
|
625 | - case 'select': |
|
626 | - case 'multiselect': |
|
627 | - case 'radio' : { |
|
628 | - if ($field_type == 'multiselect') { |
|
624 | + break; |
|
625 | + case 'select': |
|
626 | + case 'multiselect': |
|
627 | + case 'radio' : { |
|
628 | + if ($field_type == 'multiselect') { |
|
629 | 629 | |
630 | - ?> |
|
630 | + ?> |
|
631 | 631 | <tr> |
632 | 632 | <td><strong><?php _e('Multiselect display type :', 'geodirectory');?></strong></td> |
633 | 633 | <td align="left"> |
634 | 634 | |
635 | 635 | <select name="multi_display_type" id="multi_display_type"> |
636 | 636 | <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'select') { |
637 | - echo 'selected="selected"'; |
|
638 | - }?> value="select"><?php _e('Select', 'geodirectory');?></option> |
|
637 | + echo 'selected="selected"'; |
|
638 | + }?> value="select"><?php _e('Select', 'geodirectory');?></option> |
|
639 | 639 | <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'checkbox') { |
640 | - echo 'selected="selected"'; |
|
641 | - }?> value="checkbox"><?php _e('Checkbox', 'geodirectory');?></option> |
|
640 | + echo 'selected="selected"'; |
|
641 | + }?> value="checkbox"><?php _e('Checkbox', 'geodirectory');?></option> |
|
642 | 642 | <option <?php if (isset($field_info->extra_fields) && unserialize($field_info->extra_fields) == 'radio') { |
643 | - echo 'selected="selected"'; |
|
644 | - }?> value="radio"><?php _e('Radio', 'geodirectory');?></option> |
|
643 | + echo 'selected="selected"'; |
|
644 | + }?> value="radio"><?php _e('Radio', 'geodirectory');?></option> |
|
645 | 645 | </select> |
646 | 646 | |
647 | 647 | <br/> |
@@ -649,15 +649,15 @@ discard block |
||
649 | 649 | </td> |
650 | 650 | </tr> |
651 | 651 | <?php |
652 | - } |
|
653 | - ?> |
|
652 | + } |
|
653 | + ?> |
|
654 | 654 | <tr> |
655 | 655 | <td><strong><?php _e('Option Values :', 'geodirectory');?></strong></td> |
656 | 656 | <td align="left"> |
657 | 657 | <input type="text" name="option_values" id="option_values" |
658 | 658 | value="<?php if (isset($field_info->option_values)) { |
659 | - echo esc_attr($field_info->option_values); |
|
660 | - }?>"/> |
|
659 | + echo esc_attr($field_info->option_values); |
|
660 | + }?>"/> |
|
661 | 661 | <br/> |
662 | 662 | <span><?php _e('Option Values should be separated by comma.', 'geodirectory');?></span> |
663 | 663 | <br/> |
@@ -673,20 +673,20 @@ discard block |
||
673 | 673 | </td> |
674 | 674 | </tr> |
675 | 675 | <?php |
676 | - } // end of extra fields for select , multiselect and radio type fields |
|
677 | - break; |
|
678 | - case 'datepicker': { |
|
679 | - if (isset($field_info->extra_fields) && $field_info->extra_fields != '') { |
|
680 | - $extra = unserialize($field_info->extra_fields); |
|
681 | - } |
|
682 | - ?> |
|
676 | + } // end of extra fields for select , multiselect and radio type fields |
|
677 | + break; |
|
678 | + case 'datepicker': { |
|
679 | + if (isset($field_info->extra_fields) && $field_info->extra_fields != '') { |
|
680 | + $extra = unserialize($field_info->extra_fields); |
|
681 | + } |
|
682 | + ?> |
|
683 | 683 | <tr> |
684 | 684 | <td><strong><?php _e('Date Format :', 'geodirectory');?></strong></td> |
685 | 685 | <td align="left" style="overflow:inherit;"> |
686 | 686 | <input type="text" name="extra[date_format]" id="date_format" |
687 | 687 | value="<?php if (isset($extra['date_format'])) { |
688 | - echo esc_attr($extra['date_format']); |
|
689 | - }else{echo "mm/dd/yy";}?>"/> |
|
688 | + echo esc_attr($extra['date_format']); |
|
689 | + }else{echo "mm/dd/yy";}?>"/> |
|
690 | 690 | |
691 | 691 | <div style="position:relative; cursor:pointer;"> |
692 | 692 | <span onclick="jQuery('#show_dateformat').toggle();"> |
@@ -768,8 +768,8 @@ discard block |
||
768 | 768 | </td> |
769 | 769 | </tr> |
770 | 770 | <?php |
771 | - } |
|
772 | - break; |
|
771 | + } |
|
772 | + break; |
|
773 | 773 | case 'file': { |
774 | 774 | $allowed_file_types = geodir_allowed_mime_types(); |
775 | 775 | |
@@ -797,9 +797,9 @@ discard block |
||
797 | 797 | } |
798 | 798 | break; |
799 | 799 | |
800 | - endswitch; ?> |
|
800 | + endswitch; ?> |
|
801 | 801 | <?php if ($field_type != 'fieldset') { |
802 | - ?> |
|
802 | + ?> |
|
803 | 803 | <tr> |
804 | 804 | <td colspan="2" align="left"><h3><?php echo __('Custom css', 'geodirectory'); ?></h3></td> |
805 | 805 | </tr> |
@@ -809,8 +809,8 @@ discard block |
||
809 | 809 | <td align="left"> |
810 | 810 | <input type="text" name="field_icon" id="field_icon" |
811 | 811 | value="<?php if (isset($field_info->field_icon)) { |
812 | - echo $field_info->field_icon; |
|
813 | - }?>"/> |
|
812 | + echo $field_info->field_icon; |
|
813 | + }?>"/> |
|
814 | 814 | <span> |
815 | 815 | <?php _e('Upload icon using media and enter its url path, or enter <a href="http://fortawesome.github.io/Font-Awesome/icons/" target="_blank" >font awesome </a>class eg:"fa fa-home"', 'geodirectory');?> |
816 | 816 | </span> |
@@ -823,8 +823,8 @@ discard block |
||
823 | 823 | <td align="left"> |
824 | 824 | <input type="text" name="css_class" id="css_class" |
825 | 825 | value="<?php if (isset($field_info->css_class)) { |
826 | - echo esc_attr($field_info->css_class); |
|
827 | - }?>"/> |
|
826 | + echo esc_attr($field_info->css_class); |
|
827 | + }?>"/> |
|
828 | 828 | <span> |
829 | 829 | <?php _e('Enter custom css class for field custom style.', 'geodirectory');?> |
830 | 830 | </span> |
@@ -832,19 +832,19 @@ discard block |
||
832 | 832 | </td> |
833 | 833 | </tr> |
834 | 834 | <?php |
835 | - } |
|
836 | - ?> |
|
835 | + } |
|
836 | + ?> |
|
837 | 837 | |
838 | 838 | <?php |
839 | 839 | |
840 | - switch ($field_type): |
|
841 | - case 'html': |
|
842 | - case 'file': |
|
843 | - case 'url': |
|
844 | - case 'fieldset': |
|
845 | - break; |
|
846 | - default: |
|
847 | - ?> |
|
840 | + switch ($field_type): |
|
841 | + case 'html': |
|
842 | + case 'file': |
|
843 | + case 'url': |
|
844 | + case 'fieldset': |
|
845 | + break; |
|
846 | + default: |
|
847 | + ?> |
|
848 | 848 | |
849 | 849 | <tr> |
850 | 850 | <td colspan="2" align="left"> |
@@ -862,7 +862,7 @@ discard block |
||
862 | 862 | */ |
863 | 863 | echo apply_filters('geodir_advance_custom_fields_heading', __('Posts sort options', 'geodirectory'), $field_type); |
864 | 864 | |
865 | - ?></h3> |
|
865 | + ?></h3> |
|
866 | 866 | </td> |
867 | 867 | </tr> |
868 | 868 | |
@@ -872,23 +872,23 @@ discard block |
||
872 | 872 | <td>: |
873 | 873 | <input type="checkbox" name="cat_sort[]" id="cat_sort" |
874 | 874 | value="1" <?php if (isset($field_info->cat_sort[0]) && $field_info->cat_sort[0] == '1') { |
875 | - echo 'checked="checked"'; |
|
876 | - } ?>/> |
|
875 | + echo 'checked="checked"'; |
|
876 | + } ?>/> |
|
877 | 877 | <span><?php _e('Select if you want to show option in sort.', 'geodirectory'); ?></span> |
878 | 878 | </td> |
879 | 879 | </tr> |
880 | 880 | <?php } ?> |
881 | 881 | |
882 | 882 | <?php |
883 | - /** |
|
884 | - * Called at the end of the advanced custom fields settings page loop. |
|
885 | - * |
|
886 | - * Can be used to add or deal with different settings types. |
|
887 | - * |
|
888 | - * @since 1.0.0 |
|
889 | - * @param object $field_info The current fields info. |
|
890 | - */ |
|
891 | - do_action('geodir_advance_custom_fields', $field_info);?> |
|
883 | + /** |
|
884 | + * Called at the end of the advanced custom fields settings page loop. |
|
885 | + * |
|
886 | + * Can be used to add or deal with different settings types. |
|
887 | + * |
|
888 | + * @since 1.0.0 |
|
889 | + * @param object $field_info The current fields info. |
|
890 | + */ |
|
891 | + do_action('geodir_advance_custom_fields', $field_info);?> |
|
892 | 892 | |
893 | 893 | <?php /*if(!in_array($field_type,array() )){?> |
894 | 894 | <tr> |
@@ -7,59 +7,59 @@ discard block |
||
7 | 7 | */ |
8 | 8 | |
9 | 9 | if (isset($_REQUEST['ajax_action']) && $_REQUEST['ajax_action'] == 'homemap_catlist') { |
10 | - $gd_post_type = sanitize_text_field($_REQUEST['post_type']); |
|
11 | - $post_taxonomy = geodir_get_taxonomies($gd_post_type); |
|
12 | - $map_canvas_name = sanitize_text_field($_REQUEST['map_canvas']); |
|
13 | - $child_collapse = (bool)$_REQUEST['child_collapse']; |
|
14 | - echo home_map_taxonomy_walker($post_taxonomy, 0, true, 0, $map_canvas_name, $child_collapse, true); |
|
15 | - die; |
|
10 | + $gd_post_type = sanitize_text_field($_REQUEST['post_type']); |
|
11 | + $post_taxonomy = geodir_get_taxonomies($gd_post_type); |
|
12 | + $map_canvas_name = sanitize_text_field($_REQUEST['map_canvas']); |
|
13 | + $child_collapse = (bool)$_REQUEST['child_collapse']; |
|
14 | + echo home_map_taxonomy_walker($post_taxonomy, 0, true, 0, $map_canvas_name, $child_collapse, true); |
|
15 | + die; |
|
16 | 16 | } |
17 | 17 | |
18 | 18 | // Send the content-type header with correct encoding |
19 | 19 | header("Content-type: text/javascript; charset=utf-8"); |
20 | 20 | |
21 | 21 | if (isset($_REQUEST['ajax_action']) && $_REQUEST['ajax_action'] == 'cat') { // Retrives markers data for categories |
22 | - echo get_markers(); |
|
23 | - exit; |
|
22 | + echo get_markers(); |
|
23 | + exit; |
|
24 | 24 | } else if (isset($_REQUEST['ajax_action']) && $_REQUEST['ajax_action'] == 'info') { // Retrives marker info window html |
25 | - /** |
|
26 | - * @global object $wpdb WordPress Database object. |
|
27 | - * @global string $plugin_prefix Geodirectory plugin table prefix. |
|
28 | - * @global object $gd_session GeoDirectory Session object. |
|
29 | - */ |
|
30 | - global $wpdb, $plugin_prefix, $gd_session; |
|
31 | - |
|
32 | - if ($_REQUEST['m_id'] != '') { |
|
33 | - $pid = (int)$_REQUEST['m_id']; |
|
34 | - } else { |
|
35 | - echo __('No marker data found', 'geodirectory'); |
|
36 | - exit; |
|
37 | - } |
|
38 | - |
|
39 | - if (isset($_REQUEST['post_preview']) && $_REQUEST['post_preview'] != '' && $gd_ses_listing = $gd_session->get('listing')) { |
|
40 | - $post = (object)$gd_ses_listing; |
|
41 | - echo geodir_get_infowindow_html($post, $_REQUEST['post_preview']); |
|
42 | - } else { |
|
43 | - $geodir_post_type = get_post_type($pid); |
|
44 | - |
|
45 | - $table = $plugin_prefix . $geodir_post_type . '_detail'; |
|
46 | - |
|
47 | - $sql = $wpdb->prepare("SELECT * FROM " . $table . " WHERE post_id = %d", array($pid)); |
|
48 | - |
|
49 | - $postinfo = $wpdb->get_results($sql); |
|
50 | - |
|
51 | - $data_arr = array(); |
|
52 | - |
|
53 | - if ($postinfo) { |
|
54 | - $srcharr = array("'", "/", "-", '"', '\\'); |
|
55 | - $replarr = array("′", "⁄", "–", "“", ''); |
|
56 | - |
|
57 | - foreach ($postinfo as $postinfo_obj) { |
|
58 | - echo geodir_get_infowindow_html($postinfo_obj); |
|
59 | - } |
|
60 | - } |
|
61 | - } |
|
62 | - exit; |
|
25 | + /** |
|
26 | + * @global object $wpdb WordPress Database object. |
|
27 | + * @global string $plugin_prefix Geodirectory plugin table prefix. |
|
28 | + * @global object $gd_session GeoDirectory Session object. |
|
29 | + */ |
|
30 | + global $wpdb, $plugin_prefix, $gd_session; |
|
31 | + |
|
32 | + if ($_REQUEST['m_id'] != '') { |
|
33 | + $pid = (int)$_REQUEST['m_id']; |
|
34 | + } else { |
|
35 | + echo __('No marker data found', 'geodirectory'); |
|
36 | + exit; |
|
37 | + } |
|
38 | + |
|
39 | + if (isset($_REQUEST['post_preview']) && $_REQUEST['post_preview'] != '' && $gd_ses_listing = $gd_session->get('listing')) { |
|
40 | + $post = (object)$gd_ses_listing; |
|
41 | + echo geodir_get_infowindow_html($post, $_REQUEST['post_preview']); |
|
42 | + } else { |
|
43 | + $geodir_post_type = get_post_type($pid); |
|
44 | + |
|
45 | + $table = $plugin_prefix . $geodir_post_type . '_detail'; |
|
46 | + |
|
47 | + $sql = $wpdb->prepare("SELECT * FROM " . $table . " WHERE post_id = %d", array($pid)); |
|
48 | + |
|
49 | + $postinfo = $wpdb->get_results($sql); |
|
50 | + |
|
51 | + $data_arr = array(); |
|
52 | + |
|
53 | + if ($postinfo) { |
|
54 | + $srcharr = array("'", "/", "-", '"', '\\'); |
|
55 | + $replarr = array("′", "⁄", "–", "“", ''); |
|
56 | + |
|
57 | + foreach ($postinfo as $postinfo_obj) { |
|
58 | + echo geodir_get_infowindow_html($postinfo_obj); |
|
59 | + } |
|
60 | + } |
|
61 | + } |
|
62 | + exit; |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | /** |
@@ -75,80 +75,80 @@ discard block |
||
75 | 75 | * @return string |
76 | 76 | */ |
77 | 77 | function get_markers() { |
78 | - global $wpdb, $plugin_prefix, $geodir_cat_icons; |
|
78 | + global $wpdb, $plugin_prefix, $geodir_cat_icons; |
|
79 | 79 | |
80 | - $search = ''; |
|
81 | - $main_query_array; |
|
80 | + $search = ''; |
|
81 | + $main_query_array; |
|
82 | 82 | |
83 | - $srcharr = array("'", "/", "-", '"', '\\'); |
|
84 | - $replarr = array("′", "⁄", "–", "“", ''); |
|
83 | + $srcharr = array("'", "/", "-", '"', '\\'); |
|
84 | + $replarr = array("′", "⁄", "–", "“", ''); |
|
85 | 85 | |
86 | - $post_type = isset($_REQUEST['gd_posttype']) ? $_REQUEST['gd_posttype'] : 'gd_place'; |
|
86 | + $post_type = isset($_REQUEST['gd_posttype']) ? $_REQUEST['gd_posttype'] : 'gd_place'; |
|
87 | 87 | |
88 | - $map_cat_ids_array = array('0'); |
|
89 | - $cat_find_array = array(" FIND_IN_SET(%d, pd." . $post_type . "category)"); |
|
88 | + $map_cat_ids_array = array('0'); |
|
89 | + $cat_find_array = array(" FIND_IN_SET(%d, pd." . $post_type . "category)"); |
|
90 | 90 | |
91 | 91 | |
92 | - $field_default_cat = ''; |
|
93 | - if (isset($_REQUEST['cat_id']) && $_REQUEST['cat_id'] != '') { |
|
94 | - $map_cat_arr = trim($_REQUEST['cat_id'], ','); |
|
92 | + $field_default_cat = ''; |
|
93 | + if (isset($_REQUEST['cat_id']) && $_REQUEST['cat_id'] != '') { |
|
94 | + $map_cat_arr = trim($_REQUEST['cat_id'], ','); |
|
95 | 95 | |
96 | - if (!empty($map_cat_arr)) { |
|
97 | - $field_default_cat .= "WHEN (default_category IN (" . $map_cat_arr . ")) THEN default_category "; |
|
96 | + if (!empty($map_cat_arr)) { |
|
97 | + $field_default_cat .= "WHEN (default_category IN (" . $map_cat_arr . ")) THEN default_category "; |
|
98 | 98 | |
99 | - $map_cat_ids_array = explode(',', $map_cat_arr); |
|
100 | - $cat_find_array = array(); |
|
101 | - foreach ($map_cat_ids_array as $cat_id) { |
|
102 | - $field_default_cat .= "WHEN (FIND_IN_SET($cat_id, `" . $post_type . "category`) > 0) THEN $cat_id "; |
|
103 | - $cat_find_array[] = " FIND_IN_SET(%d, pd." . $post_type . "category)"; |
|
104 | - $main_query_array[] = $cat_id; |
|
105 | - } |
|
99 | + $map_cat_ids_array = explode(',', $map_cat_arr); |
|
100 | + $cat_find_array = array(); |
|
101 | + foreach ($map_cat_ids_array as $cat_id) { |
|
102 | + $field_default_cat .= "WHEN (FIND_IN_SET($cat_id, `" . $post_type . "category`) > 0) THEN $cat_id "; |
|
103 | + $cat_find_array[] = " FIND_IN_SET(%d, pd." . $post_type . "category)"; |
|
104 | + $main_query_array[] = $cat_id; |
|
105 | + } |
|
106 | 106 | |
107 | - } |
|
108 | - } |
|
107 | + } |
|
108 | + } |
|
109 | 109 | |
110 | - if (!empty($field_default_cat)) |
|
111 | - $field_default_cat = ''; |
|
110 | + if (!empty($field_default_cat)) |
|
111 | + $field_default_cat = ''; |
|
112 | 112 | |
113 | - if (!empty($cat_find_array)) |
|
114 | - $search .= "AND (" . implode(' OR ', $cat_find_array) . ")"; |
|
113 | + if (!empty($cat_find_array)) |
|
114 | + $search .= "AND (" . implode(' OR ', $cat_find_array) . ")"; |
|
115 | 115 | |
116 | - $main_query_array = $map_cat_ids_array; |
|
116 | + $main_query_array = $map_cat_ids_array; |
|
117 | 117 | |
118 | - if (isset($_REQUEST['search']) && !empty($_REQUEST['search']) && $_REQUEST['search'] != __('Title', 'geodirectory')) { |
|
119 | - $search .= " AND p.post_title LIKE %s"; |
|
120 | - $main_query_array[] = "%" . $_REQUEST['search'] . "%"; |
|
121 | - } |
|
122 | - |
|
123 | - /** |
|
124 | - * Filter the marker query search SQL, values are replaces with %s or %d. |
|
125 | - * |
|
126 | - * @since 1.5.3 |
|
127 | - * |
|
128 | - * @param string $search The SQL query for search/where. |
|
129 | - */ |
|
130 | - $search = apply_filters('geodir_marker_search', $search); |
|
131 | - /** |
|
132 | - * Filter the marker query search SQL values %s and %d, this is an array of values. |
|
133 | - * |
|
134 | - * @since 1.5.3 |
|
135 | - * |
|
136 | - * @param array $main_query_array The SQL query values for search/where. |
|
137 | - */ |
|
138 | - $main_query_array = apply_filters('geodir_marker_main_query_array', $main_query_array); |
|
139 | - |
|
140 | - $gd_posttype = ''; |
|
141 | - if (isset($_REQUEST['gd_posttype']) && $_REQUEST['gd_posttype'] != '') { |
|
142 | - $table = $plugin_prefix . $_REQUEST['gd_posttype'] . '_detail'; |
|
143 | - $gd_posttype = " AND p.post_type = %s"; |
|
144 | - $main_query_array[] = $_REQUEST['gd_posttype']; |
|
145 | - |
|
146 | - } else |
|
147 | - $table = $plugin_prefix . 'gd_place_detail'; |
|
148 | - |
|
149 | - $join = ", " . $table . " AS pd "; |
|
150 | - |
|
151 | - /** |
|
118 | + if (isset($_REQUEST['search']) && !empty($_REQUEST['search']) && $_REQUEST['search'] != __('Title', 'geodirectory')) { |
|
119 | + $search .= " AND p.post_title LIKE %s"; |
|
120 | + $main_query_array[] = "%" . $_REQUEST['search'] . "%"; |
|
121 | + } |
|
122 | + |
|
123 | + /** |
|
124 | + * Filter the marker query search SQL, values are replaces with %s or %d. |
|
125 | + * |
|
126 | + * @since 1.5.3 |
|
127 | + * |
|
128 | + * @param string $search The SQL query for search/where. |
|
129 | + */ |
|
130 | + $search = apply_filters('geodir_marker_search', $search); |
|
131 | + /** |
|
132 | + * Filter the marker query search SQL values %s and %d, this is an array of values. |
|
133 | + * |
|
134 | + * @since 1.5.3 |
|
135 | + * |
|
136 | + * @param array $main_query_array The SQL query values for search/where. |
|
137 | + */ |
|
138 | + $main_query_array = apply_filters('geodir_marker_main_query_array', $main_query_array); |
|
139 | + |
|
140 | + $gd_posttype = ''; |
|
141 | + if (isset($_REQUEST['gd_posttype']) && $_REQUEST['gd_posttype'] != '') { |
|
142 | + $table = $plugin_prefix . $_REQUEST['gd_posttype'] . '_detail'; |
|
143 | + $gd_posttype = " AND p.post_type = %s"; |
|
144 | + $main_query_array[] = $_REQUEST['gd_posttype']; |
|
145 | + |
|
146 | + } else |
|
147 | + $table = $plugin_prefix . 'gd_place_detail'; |
|
148 | + |
|
149 | + $join = ", " . $table . " AS pd "; |
|
150 | + |
|
151 | + /** |
|
152 | 152 | * Filter the SQL JOIN clause for the markers data |
153 | 153 | * |
154 | 154 | * @since 1.0.0 |
@@ -165,16 +165,16 @@ discard block |
||
165 | 165 | * @param string $search Row of searched fields to use in WHERE clause. |
166 | 166 | */ |
167 | 167 | $search = apply_filters('geodir_home_map_listing_where', $search); |
168 | - $search = str_replace(array("'%", "%'"), array("'%%", "%%'"), $search); |
|
169 | - $cat_type = $post_type . 'category'; |
|
170 | - if ($post_type == 'gd_event') { |
|
171 | - $event_select = ", pd.recurring_dates, pd.is_recurring"; |
|
172 | - } else { |
|
173 | - $event_select = ""; |
|
174 | - } |
|
175 | - |
|
176 | - $sql_select = 'SELECT pd.default_category, pd.' . $cat_type . ', pd.post_title, pd.post_id, pd.post_latitude, pd.post_longitude' . $event_select; |
|
177 | - /** |
|
168 | + $search = str_replace(array("'%", "%'"), array("'%%", "%%'"), $search); |
|
169 | + $cat_type = $post_type . 'category'; |
|
170 | + if ($post_type == 'gd_event') { |
|
171 | + $event_select = ", pd.recurring_dates, pd.is_recurring"; |
|
172 | + } else { |
|
173 | + $event_select = ""; |
|
174 | + } |
|
175 | + |
|
176 | + $sql_select = 'SELECT pd.default_category, pd.' . $cat_type . ', pd.post_title, pd.post_id, pd.post_latitude, pd.post_longitude' . $event_select; |
|
177 | + /** |
|
178 | 178 | * Filter the SQL SELECT clause to retrive fields data |
179 | 179 | * |
180 | 180 | * @since 1.0.0 |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | */ |
194 | 194 | $groupby = apply_filters('geodir_home_map_listing_groupby', $groupby); |
195 | 195 | |
196 | - $catsql = $wpdb->prepare("$select $field_default_cat FROM " . $wpdb->posts . " as p" . $join . " WHERE p.ID = pd.post_id AND p.post_status = 'publish' " . $search . $gd_posttype . $groupby , $main_query_array); |
|
196 | + $catsql = $wpdb->prepare("$select $field_default_cat FROM " . $wpdb->posts . " as p" . $join . " WHERE p.ID = pd.post_id AND p.post_status = 'publish' " . $search . $gd_posttype . $groupby , $main_query_array); |
|
197 | 197 | |
198 | 198 | /** |
199 | 199 | * Filter the SQL query to retrive markers data |
@@ -205,112 +205,112 @@ discard block |
||
205 | 205 | */ |
206 | 206 | $catsql = apply_filters('geodir_home_map_listing_query', $catsql, $search); |
207 | 207 | |
208 | - $catinfo = $wpdb->get_results($catsql); |
|
208 | + $catinfo = $wpdb->get_results($catsql); |
|
209 | 209 | |
210 | - $cat_content_info = array(); |
|
211 | - $content_data = array(); |
|
212 | - $post_ids = array(); |
|
213 | - |
|
214 | - /** |
|
215 | - * Called before marker data is processed into JSON. |
|
216 | - * |
|
217 | - * Called before marker data is processed into JSON, this action can be used to change the format or add/remove markers. |
|
218 | - * |
|
219 | - * @since 1.5.3 |
|
220 | - * @param object $catinfo The posts object containing all marker data. |
|
221 | - * @see 'geodir_after_marker_post_process' |
|
222 | - */ |
|
223 | - $catinfo = apply_filters('geodir_before_marker_post_process', $catinfo); |
|
224 | - |
|
225 | - /** |
|
226 | - * Called before marker data is processed into JSON. |
|
227 | - * |
|
228 | - * Called before marker data is processed into JSON, this action can be used to change the format or add/remove markers. |
|
229 | - * |
|
230 | - * @since 1.4.9 |
|
231 | - * @param object $catinfo The posts object containing all marker data. |
|
232 | - * @see 'geodir_after_marker_post_process' |
|
233 | - */ |
|
234 | - do_action('geodir_before_marker_post_process_action', $catinfo); |
|
235 | - |
|
236 | - // Sort any posts into a ajax array |
|
237 | - if (!empty($catinfo)) { |
|
238 | - $geodir_cat_icons = geodir_get_term_icon(); |
|
239 | - global $geodir_date_format; |
|
240 | - |
|
241 | - $today = strtotime(date_i18n('Y-m-d')); |
|
210 | + $cat_content_info = array(); |
|
211 | + $content_data = array(); |
|
212 | + $post_ids = array(); |
|
213 | + |
|
214 | + /** |
|
215 | + * Called before marker data is processed into JSON. |
|
216 | + * |
|
217 | + * Called before marker data is processed into JSON, this action can be used to change the format or add/remove markers. |
|
218 | + * |
|
219 | + * @since 1.5.3 |
|
220 | + * @param object $catinfo The posts object containing all marker data. |
|
221 | + * @see 'geodir_after_marker_post_process' |
|
222 | + */ |
|
223 | + $catinfo = apply_filters('geodir_before_marker_post_process', $catinfo); |
|
224 | + |
|
225 | + /** |
|
226 | + * Called before marker data is processed into JSON. |
|
227 | + * |
|
228 | + * Called before marker data is processed into JSON, this action can be used to change the format or add/remove markers. |
|
229 | + * |
|
230 | + * @since 1.4.9 |
|
231 | + * @param object $catinfo The posts object containing all marker data. |
|
232 | + * @see 'geodir_after_marker_post_process' |
|
233 | + */ |
|
234 | + do_action('geodir_before_marker_post_process_action', $catinfo); |
|
235 | + |
|
236 | + // Sort any posts into a ajax array |
|
237 | + if (!empty($catinfo)) { |
|
238 | + $geodir_cat_icons = geodir_get_term_icon(); |
|
239 | + global $geodir_date_format; |
|
240 | + |
|
241 | + $today = strtotime(date_i18n('Y-m-d')); |
|
242 | 242 | |
243 | - foreach ($catinfo as $catinfo_obj) { |
|
244 | - $post_title = $catinfo_obj->post_title; |
|
243 | + foreach ($catinfo as $catinfo_obj) { |
|
244 | + $post_title = $catinfo_obj->post_title; |
|
245 | 245 | |
246 | - if ($post_type == 'gd_event' && !empty($catinfo_obj->recurring_dates)) { |
|
247 | - $event_dates = ''; |
|
248 | - $recurring_data = isset($catinfo_obj->recurring_dates) ? maybe_unserialize($catinfo_obj->recurring_dates) : array(); |
|
246 | + if ($post_type == 'gd_event' && !empty($catinfo_obj->recurring_dates)) { |
|
247 | + $event_dates = ''; |
|
248 | + $recurring_data = isset($catinfo_obj->recurring_dates) ? maybe_unserialize($catinfo_obj->recurring_dates) : array(); |
|
249 | 249 | |
250 | - $post_info = geodir_get_post_info($catinfo_obj->post_id); |
|
251 | - if (!empty($catinfo_obj->is_recurring) && !empty($recurring_data) && !empty($recurring_data['is_recurring']) && geodir_event_recurring_pkg($post_info)) { |
|
252 | - $recurring_dates = explode(',', $recurring_data['event_recurring_dates']); |
|
250 | + $post_info = geodir_get_post_info($catinfo_obj->post_id); |
|
251 | + if (!empty($catinfo_obj->is_recurring) && !empty($recurring_data) && !empty($recurring_data['is_recurring']) && geodir_event_recurring_pkg($post_info)) { |
|
252 | + $recurring_dates = explode(',', $recurring_data['event_recurring_dates']); |
|
253 | 253 | |
254 | - if (!empty($recurring_dates)) { |
|
255 | - $e = 0; |
|
256 | - foreach ($recurring_dates as $date) { |
|
257 | - if (strtotime($date) >= $today) { |
|
258 | - $event_dates .= ' :: ' . date_i18n($geodir_date_format, strtotime($date)); |
|
254 | + if (!empty($recurring_dates)) { |
|
255 | + $e = 0; |
|
256 | + foreach ($recurring_dates as $date) { |
|
257 | + if (strtotime($date) >= $today) { |
|
258 | + $event_dates .= ' :: ' . date_i18n($geodir_date_format, strtotime($date)); |
|
259 | 259 | |
260 | - $e++; |
|
261 | - if ($e == 3) { // only show 3 event dates |
|
262 | - break; |
|
263 | - } |
|
264 | - } |
|
265 | - } |
|
266 | - } |
|
267 | - } else { |
|
268 | - $start_date = !empty($recurring_data['event_start']) && $recurring_data['event_start'] != '0000-00-00 00:00:00' ? $recurring_data['event_start'] : ''; |
|
269 | - $end_date = !empty($recurring_data['event_end']) && $recurring_data['event_end'] != '0000-00-00 00:00:00' ? $recurring_data['event_end'] : $start_date; |
|
260 | + $e++; |
|
261 | + if ($e == 3) { // only show 3 event dates |
|
262 | + break; |
|
263 | + } |
|
264 | + } |
|
265 | + } |
|
266 | + } |
|
267 | + } else { |
|
268 | + $start_date = !empty($recurring_data['event_start']) && $recurring_data['event_start'] != '0000-00-00 00:00:00' ? $recurring_data['event_start'] : ''; |
|
269 | + $end_date = !empty($recurring_data['event_end']) && $recurring_data['event_end'] != '0000-00-00 00:00:00' ? $recurring_data['event_end'] : $start_date; |
|
270 | 270 | |
271 | - if ($end_date != '' && strtotime($end_date) >= $today) { |
|
272 | - $event_dates .= ' :: ' . date_i18n($geodir_date_format, strtotime($start_date)) .' -> ' . date_i18n($geodir_date_format, strtotime($end_date)); |
|
273 | - } |
|
274 | - } |
|
275 | - |
|
276 | - if (empty($event_dates)) { |
|
277 | - continue; |
|
278 | - } |
|
271 | + if ($end_date != '' && strtotime($end_date) >= $today) { |
|
272 | + $event_dates .= ' :: ' . date_i18n($geodir_date_format, strtotime($start_date)) .' -> ' . date_i18n($geodir_date_format, strtotime($end_date)); |
|
273 | + } |
|
274 | + } |
|
275 | + |
|
276 | + if (empty($event_dates)) { |
|
277 | + continue; |
|
278 | + } |
|
279 | 279 | |
280 | - $post_title .= $event_dates; |
|
281 | - } |
|
282 | - |
|
283 | - $icon = !empty($geodir_cat_icons) && isset($geodir_cat_icons[$catinfo_obj->default_category]) ? $geodir_cat_icons[$catinfo_obj->default_category] : ''; |
|
284 | - $mark_extra = (isset($catinfo_obj->marker_extra)) ? $catinfo_obj->marker_extra : ''; |
|
285 | - $title = str_replace($srcharr, $replarr, $post_title); |
|
286 | - |
|
287 | - $content_data[] = '{"id":"' . $catinfo_obj->post_id . '","t": "' . $title . '","lt": "' . $catinfo_obj->post_latitude . '","ln": "' . $catinfo_obj->post_longitude . '","mk_id":"' . $catinfo_obj->post_id . '_' . $catinfo_obj->default_category . '","i":"' . $icon . '"'.$mark_extra.'}'; |
|
288 | - $post_ids[] = $catinfo_obj->post_id; |
|
289 | - } |
|
290 | - } |
|
291 | - |
|
292 | - /** |
|
293 | - * Called after marker data is processed into JSON. |
|
294 | - * |
|
295 | - * Called after marker data is processed into JSON, this action can be used to change the format or add/remove markers. |
|
296 | - * |
|
297 | - * @since 1.4.9 |
|
298 | - * @param array $content_data The array containing all markers in JSON format. |
|
299 | - * @param object $catinfo The posts object containing all marker data. |
|
300 | - * @see 'geodir_before_marker_post_process' |
|
301 | - */ |
|
302 | - do_action('geodir_after_marker_post_process', $content_data, $catinfo); |
|
303 | - |
|
304 | - if (!empty($content_data)) { |
|
305 | - $cat_content_info[] = implode(',', $content_data); |
|
306 | - } |
|
307 | - |
|
308 | - $totalcount = count(array_unique($post_ids)); |
|
309 | - |
|
310 | - if (!empty($cat_content_info)) { |
|
311 | - return '[{"totalcount":"' . $totalcount . '",' . substr(implode(',', $cat_content_info), 1) . ']'; |
|
312 | - } |
|
313 | - else { |
|
314 | - return '[{"totalcount":"0"}]'; |
|
315 | - } |
|
280 | + $post_title .= $event_dates; |
|
281 | + } |
|
282 | + |
|
283 | + $icon = !empty($geodir_cat_icons) && isset($geodir_cat_icons[$catinfo_obj->default_category]) ? $geodir_cat_icons[$catinfo_obj->default_category] : ''; |
|
284 | + $mark_extra = (isset($catinfo_obj->marker_extra)) ? $catinfo_obj->marker_extra : ''; |
|
285 | + $title = str_replace($srcharr, $replarr, $post_title); |
|
286 | + |
|
287 | + $content_data[] = '{"id":"' . $catinfo_obj->post_id . '","t": "' . $title . '","lt": "' . $catinfo_obj->post_latitude . '","ln": "' . $catinfo_obj->post_longitude . '","mk_id":"' . $catinfo_obj->post_id . '_' . $catinfo_obj->default_category . '","i":"' . $icon . '"'.$mark_extra.'}'; |
|
288 | + $post_ids[] = $catinfo_obj->post_id; |
|
289 | + } |
|
290 | + } |
|
291 | + |
|
292 | + /** |
|
293 | + * Called after marker data is processed into JSON. |
|
294 | + * |
|
295 | + * Called after marker data is processed into JSON, this action can be used to change the format or add/remove markers. |
|
296 | + * |
|
297 | + * @since 1.4.9 |
|
298 | + * @param array $content_data The array containing all markers in JSON format. |
|
299 | + * @param object $catinfo The posts object containing all marker data. |
|
300 | + * @see 'geodir_before_marker_post_process' |
|
301 | + */ |
|
302 | + do_action('geodir_after_marker_post_process', $content_data, $catinfo); |
|
303 | + |
|
304 | + if (!empty($content_data)) { |
|
305 | + $cat_content_info[] = implode(',', $content_data); |
|
306 | + } |
|
307 | + |
|
308 | + $totalcount = count(array_unique($post_ids)); |
|
309 | + |
|
310 | + if (!empty($cat_content_info)) { |
|
311 | + return '[{"totalcount":"' . $totalcount . '",' . substr(implode(',', $cat_content_info), 1) . ']'; |
|
312 | + } |
|
313 | + else { |
|
314 | + return '[{"totalcount":"0"}]'; |
|
315 | + } |
|
316 | 316 | } |
317 | 317 | \ No newline at end of file |
@@ -1,10 +1,10 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * All map related templates used by the plugin |
|
4 | - * |
|
5 | - * @since 1.0.0 |
|
6 | - * @package GeoDirectory |
|
7 | - */ |
|
3 | + * All map related templates used by the plugin |
|
4 | + * |
|
5 | + * @since 1.0.0 |
|
6 | + * @package GeoDirectory |
|
7 | + */ |
|
8 | 8 | |
9 | 9 | /** |
10 | 10 | * Contains all map related functions. |
@@ -67,77 +67,77 @@ discard block |
||
67 | 67 | */ |
68 | 68 | function geodir_draw_map($map_args = array()) |
69 | 69 | { |
70 | - global $map_canvas_arr; |
|
71 | - $map_canvas_name = (!empty($map_args) && $map_args['map_canvas_name'] != '') ? $map_args['map_canvas_name'] : 'home_map_canvas'; |
|
72 | - $map_class_name = (!empty($map_args) && isset($map_args['map_class_name'])) ? $map_args['map_class_name'] : ''; |
|
73 | - |
|
74 | - $default_location = geodir_get_default_location(); |
|
75 | - |
|
76 | - $map_default_lat = isset($default_location->city_latitude) ? $default_location->city_latitude : ''; |
|
77 | - $map_default_lng = isset($default_location->city_longitude) ? $default_location->city_longitude : ''; |
|
78 | - $map_default_zoom = 12; |
|
79 | - // map options default values |
|
80 | - $width = 950; |
|
81 | - $height = 450; |
|
82 | - $child_collapse = '0'; |
|
83 | - $sticky = ''; |
|
84 | - $enable_cat_filters = false; |
|
85 | - $enable_text_search = false; |
|
86 | - $enable_post_type_filters = false; |
|
87 | - $enable_location_filters = false; |
|
88 | - $enable_jason_on_load = false; |
|
89 | - $enable_map_direction = false; |
|
90 | - $enable_marker_cluster = false; |
|
91 | - $enable_map_resize_button = false; |
|
92 | - $maptype = 'ROADMAP'; |
|
93 | - |
|
94 | - $geodir_map_options = array( |
|
95 | - 'width' => $width, |
|
96 | - 'height' => $height, |
|
97 | - 'child_collapse' => $child_collapse, |
|
98 | - 'sticky' => $sticky, |
|
99 | - 'enable_map_resize_button' => $enable_map_resize_button, |
|
100 | - 'enable_cat_filters' => $enable_cat_filters, |
|
101 | - 'enable_text_search' => $enable_text_search, |
|
102 | - 'enable_post_type_filters' => $enable_post_type_filters, |
|
103 | - 'enable_location_filters' => $enable_location_filters, |
|
104 | - 'enable_jason_on_load' => $enable_jason_on_load, |
|
105 | - 'enable_map_direction' => $enable_map_direction, |
|
106 | - 'enable_marker_cluster' => $enable_marker_cluster, |
|
107 | - 'ajax_url' => geodir_get_ajax_url(), |
|
108 | - 'map_canvas_name' => $map_canvas_name, |
|
109 | - 'inputText' => __('Title or Keyword', 'geodirectory'), |
|
110 | - 'latitude' => $map_default_lat, |
|
111 | - 'longitude' => $map_default_lng, |
|
112 | - 'zoom' => $map_default_zoom, |
|
113 | - 'scrollwheel' => true, |
|
114 | - 'streetViewControl' => true, |
|
115 | - 'maptype' => $maptype, |
|
116 | - 'showPreview' => '0', |
|
117 | - 'maxZoom' => 21, |
|
118 | - 'autozoom' => true, |
|
119 | - 'bubble_size' => 'small', |
|
120 | - 'token' => '68f48005e256696074e1da9bf9f67f06', |
|
121 | - 'navigationControlOptions' => array('position' => 'TOP_LEFT', 'style' => 'ZOOM_PAN') |
|
122 | - ); |
|
123 | - |
|
124 | - if (!empty($map_args)) { |
|
125 | - foreach ($map_args as $map_option_key => $map_option_value) { |
|
126 | - $geodir_map_options[$map_option_key] = $map_option_value; |
|
127 | - } |
|
128 | - } |
|
129 | - |
|
130 | - if (strpos($geodir_map_options['height'], '%') !== false || strpos($geodir_map_options['height'], 'px') !== false || strpos($geodir_map_options['height'], 'vh') !== false) { |
|
131 | - } else { |
|
132 | - $geodir_map_options['height'] = $geodir_map_options['height'] . 'px'; |
|
133 | - } |
|
134 | - |
|
135 | - if (strpos($geodir_map_options['width'], '%') !== false || strpos($geodir_map_options['width'], 'px') !== false) { |
|
136 | - } else { |
|
137 | - $geodir_map_options['width'] = $geodir_map_options['width'] . 'px'; |
|
138 | - } |
|
139 | - |
|
140 | - /** |
|
70 | + global $map_canvas_arr; |
|
71 | + $map_canvas_name = (!empty($map_args) && $map_args['map_canvas_name'] != '') ? $map_args['map_canvas_name'] : 'home_map_canvas'; |
|
72 | + $map_class_name = (!empty($map_args) && isset($map_args['map_class_name'])) ? $map_args['map_class_name'] : ''; |
|
73 | + |
|
74 | + $default_location = geodir_get_default_location(); |
|
75 | + |
|
76 | + $map_default_lat = isset($default_location->city_latitude) ? $default_location->city_latitude : ''; |
|
77 | + $map_default_lng = isset($default_location->city_longitude) ? $default_location->city_longitude : ''; |
|
78 | + $map_default_zoom = 12; |
|
79 | + // map options default values |
|
80 | + $width = 950; |
|
81 | + $height = 450; |
|
82 | + $child_collapse = '0'; |
|
83 | + $sticky = ''; |
|
84 | + $enable_cat_filters = false; |
|
85 | + $enable_text_search = false; |
|
86 | + $enable_post_type_filters = false; |
|
87 | + $enable_location_filters = false; |
|
88 | + $enable_jason_on_load = false; |
|
89 | + $enable_map_direction = false; |
|
90 | + $enable_marker_cluster = false; |
|
91 | + $enable_map_resize_button = false; |
|
92 | + $maptype = 'ROADMAP'; |
|
93 | + |
|
94 | + $geodir_map_options = array( |
|
95 | + 'width' => $width, |
|
96 | + 'height' => $height, |
|
97 | + 'child_collapse' => $child_collapse, |
|
98 | + 'sticky' => $sticky, |
|
99 | + 'enable_map_resize_button' => $enable_map_resize_button, |
|
100 | + 'enable_cat_filters' => $enable_cat_filters, |
|
101 | + 'enable_text_search' => $enable_text_search, |
|
102 | + 'enable_post_type_filters' => $enable_post_type_filters, |
|
103 | + 'enable_location_filters' => $enable_location_filters, |
|
104 | + 'enable_jason_on_load' => $enable_jason_on_load, |
|
105 | + 'enable_map_direction' => $enable_map_direction, |
|
106 | + 'enable_marker_cluster' => $enable_marker_cluster, |
|
107 | + 'ajax_url' => geodir_get_ajax_url(), |
|
108 | + 'map_canvas_name' => $map_canvas_name, |
|
109 | + 'inputText' => __('Title or Keyword', 'geodirectory'), |
|
110 | + 'latitude' => $map_default_lat, |
|
111 | + 'longitude' => $map_default_lng, |
|
112 | + 'zoom' => $map_default_zoom, |
|
113 | + 'scrollwheel' => true, |
|
114 | + 'streetViewControl' => true, |
|
115 | + 'maptype' => $maptype, |
|
116 | + 'showPreview' => '0', |
|
117 | + 'maxZoom' => 21, |
|
118 | + 'autozoom' => true, |
|
119 | + 'bubble_size' => 'small', |
|
120 | + 'token' => '68f48005e256696074e1da9bf9f67f06', |
|
121 | + 'navigationControlOptions' => array('position' => 'TOP_LEFT', 'style' => 'ZOOM_PAN') |
|
122 | + ); |
|
123 | + |
|
124 | + if (!empty($map_args)) { |
|
125 | + foreach ($map_args as $map_option_key => $map_option_value) { |
|
126 | + $geodir_map_options[$map_option_key] = $map_option_value; |
|
127 | + } |
|
128 | + } |
|
129 | + |
|
130 | + if (strpos($geodir_map_options['height'], '%') !== false || strpos($geodir_map_options['height'], 'px') !== false || strpos($geodir_map_options['height'], 'vh') !== false) { |
|
131 | + } else { |
|
132 | + $geodir_map_options['height'] = $geodir_map_options['height'] . 'px'; |
|
133 | + } |
|
134 | + |
|
135 | + if (strpos($geodir_map_options['width'], '%') !== false || strpos($geodir_map_options['width'], 'px') !== false) { |
|
136 | + } else { |
|
137 | + $geodir_map_options['width'] = $geodir_map_options['width'] . 'px'; |
|
138 | + } |
|
139 | + |
|
140 | + /** |
|
141 | 141 | * Filter the options to use in google map. |
142 | 142 | * |
143 | 143 | * @since 1.0.0 |
@@ -146,9 +146,9 @@ discard block |
||
146 | 146 | */ |
147 | 147 | $geodir_map_options = apply_filters("geodir_map_options_{$map_canvas_name}", $geodir_map_options); |
148 | 148 | |
149 | - $map_canvas_arr[$map_canvas_name] = array(); |
|
149 | + $map_canvas_arr[$map_canvas_name] = array(); |
|
150 | 150 | |
151 | - /** |
|
151 | + /** |
|
152 | 152 | * Filter the post types to display data on map. |
153 | 153 | * |
154 | 154 | * @since 1.0.0 |
@@ -166,20 +166,20 @@ discard block |
||
166 | 166 | */ |
167 | 167 | $exclude_post_types = apply_filters("geodir_exclude_post_type_on_map_{$map_canvas_name}", get_option('geodir_exclude_post_type_on_map')); |
168 | 168 | |
169 | - if (count((array)$post_types) != count($exclude_post_types) || ($enable_jason_on_load)): |
|
170 | - // Set default map options |
|
169 | + if (count((array)$post_types) != count($exclude_post_types) || ($enable_jason_on_load)): |
|
170 | + // Set default map options |
|
171 | 171 | |
172 | - wp_enqueue_script('geodir-map-widget', geodir_plugin_url() . '/geodirectory-functions/map-functions/js/map.min.js',array(),false,true); |
|
172 | + wp_enqueue_script('geodir-map-widget', geodir_plugin_url() . '/geodirectory-functions/map-functions/js/map.min.js',array(),false,true); |
|
173 | 173 | |
174 | - wp_localize_script('geodir-map-widget', $map_canvas_name, $geodir_map_options); |
|
174 | + wp_localize_script('geodir-map-widget', $map_canvas_name, $geodir_map_options); |
|
175 | 175 | |
176 | - if ($map_canvas_name == 'detail_page_map_canvas' || $map_canvas_name == 'preview_map_canvas') { |
|
177 | - $map_width = '100%'; |
|
178 | - } else { |
|
179 | - $map_width = $geodir_map_options['width']; |
|
180 | - } |
|
176 | + if ($map_canvas_name == 'detail_page_map_canvas' || $map_canvas_name == 'preview_map_canvas') { |
|
177 | + $map_width = '100%'; |
|
178 | + } else { |
|
179 | + $map_width = $geodir_map_options['width']; |
|
180 | + } |
|
181 | 181 | |
182 | - /** |
|
182 | + /** |
|
183 | 183 | * Filter the width of map. |
184 | 184 | * |
185 | 185 | * @since 1.0.0 |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | * @param int $map_width Width of map box, eg: gd_place. |
188 | 188 | */ |
189 | 189 | $map_width = apply_filters('geodir_change_map_width', $map_width); |
190 | - ?> |
|
190 | + ?> |
|
191 | 191 | <div id="catcher_<?php echo $map_canvas_name;?>"></div> |
192 | 192 | <div class="stick_trigger_container"> |
193 | 193 | <div class="trigger_sticky triggeroff_sticky"></div> |
@@ -219,15 +219,15 @@ discard block |
||
219 | 219 | <?php if ($geodir_map_options['enable_jason_on_load']) { ?> |
220 | 220 | <input type="hidden" id="<?php echo $map_canvas_name;?>_jason_enabled" value="1"/> |
221 | 221 | <?php } else { |
222 | - ?> |
|
222 | + ?> |
|
223 | 223 | <input type="hidden" id="<?php echo $map_canvas_name;?>_jason_enabled" value="0"/> |
224 | 224 | <?php } |
225 | 225 | |
226 | - if (!$geodir_map_options['enable_text_search'] && !$geodir_map_options['enable_cat_filters']) |
|
227 | - $show_entire_cat_panel = "none"; |
|
228 | - else |
|
229 | - $show_entire_cat_panel = "''"; |
|
230 | - ?> |
|
226 | + if (!$geodir_map_options['enable_text_search'] && !$geodir_map_options['enable_cat_filters']) |
|
227 | + $show_entire_cat_panel = "none"; |
|
228 | + else |
|
229 | + $show_entire_cat_panel = "''"; |
|
230 | + ?> |
|
231 | 231 | |
232 | 232 | <?php if ($geodir_map_options['enable_map_direction']) { ?> |
233 | 233 | |
@@ -278,8 +278,8 @@ discard block |
||
278 | 278 | <select id="travel-units" onchange="calcRoute('<?php echo $map_canvas_name; ?>')"> |
279 | 279 | <option value="miles"><?php _e('Miles', 'geodirectory'); ?></option> |
280 | 280 | <option <?php if (get_option('geodir_search_dist_1') == 'km') { |
281 | - echo 'selected="selected"'; |
|
282 | - } ?> value="kilometers"><?php _e('Kilometers', 'geodirectory'); ?></option> |
|
281 | + echo 'selected="selected"'; |
|
282 | + } ?> value="kilometers"><?php _e('Kilometers', 'geodirectory'); ?></option> |
|
283 | 283 | </select> |
284 | 284 | </div> |
285 | 285 | |
@@ -302,13 +302,13 @@ discard block |
||
302 | 302 | ?> |
303 | 303 | <div class="map-category-listing-main" style="display:<?php echo $show_entire_cat_panel;?>"> |
304 | 304 | <?php |
305 | - $exclude_post_types = get_option('geodir_exclude_post_type_on_map'); |
|
306 | - $geodir_available_pt_on_map = count(geodir_get_posttypes('array')) - count($exclude_post_types); |
|
305 | + $exclude_post_types = get_option('geodir_exclude_post_type_on_map'); |
|
306 | + $geodir_available_pt_on_map = count(geodir_get_posttypes('array')) - count($exclude_post_types); |
|
307 | 307 | $map_cat_class = ''; |
308 | 308 | if ($geodir_map_options['enable_post_type_filters']) { |
309 | 309 | $map_cat_class = $geodir_available_pt_on_map > 1 ? ' map-cat-ptypes' : ' map-cat-floor'; |
310 | 310 | } |
311 | - ?> |
|
311 | + ?> |
|
312 | 312 | <div |
313 | 313 | class="map-category-listing<?php echo $map_cat_class;?>"> |
314 | 314 | <div class="trigger triggeroff"><i class="fa fa-compress"></i><i class="fa fa-expand"></i></div> |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | <?php if ($geodir_map_options['child_collapse']) { $child_collapse = "1"; ?> |
327 | 327 | <input type="hidden" id="<?php echo $map_canvas_name; ?>_child_collapse" value="1"/> |
328 | 328 | <?php } else {$child_collapse = "0"; |
329 | - ?> |
|
329 | + ?> |
|
330 | 330 | <input type="hidden" id="<?php echo $map_canvas_name;?>_child_collapse" value="0"/> |
331 | 331 | <?php } ?> |
332 | 332 | <input type="hidden" id="<?php echo $map_canvas_name; ?>_cat_enabled" value="1"/> |
@@ -349,17 +349,17 @@ discard block |
||
349 | 349 | <!-- map-category-listings--> |
350 | 350 | |
351 | 351 | <?php |
352 | - if ($geodir_map_options['enable_location_filters']) { |
|
352 | + if ($geodir_map_options['enable_location_filters']) { |
|
353 | 353 | $country = get_query_var('gd_country'); |
354 | 354 | $region = get_query_var('gd_region'); |
355 | 355 | $city = get_query_var('gd_city'); |
356 | 356 | |
357 | - //fix for location/me page |
|
358 | - $country = $country != 'me' ? $country : ''; |
|
357 | + //fix for location/me page |
|
358 | + $country = $country != 'me' ? $country : ''; |
|
359 | 359 | $region = $region != 'me' ? $region : ''; |
360 | 360 | $city = $country != 'me' ? $city : ''; |
361 | - $gd_neighbourhood = isset($_REQUEST['gd_neighbourhood']) ? sanitize_text_field($_REQUEST['gd_neighbourhood']) : ''; |
|
362 | - ?> |
|
361 | + $gd_neighbourhood = isset($_REQUEST['gd_neighbourhood']) ? sanitize_text_field($_REQUEST['gd_neighbourhood']) : ''; |
|
362 | + ?> |
|
363 | 363 | <input type="hidden" id="<?php echo $map_canvas_name;?>_location_enabled" value="1"/> |
364 | 364 | <input type="hidden" id="<?php echo $map_canvas_name;?>_country" name="gd_country" |
365 | 365 | value="<?php echo $country;?>"/> |
@@ -370,7 +370,7 @@ discard block |
||
370 | 370 | <input type="hidden" id="<?php echo $map_canvas_name;?>_neighbourhood" name="gd_neighbourhood" |
371 | 371 | value="<?php echo $gd_neighbourhood;?>"/> |
372 | 372 | <?php } else { //end of location filter |
373 | - ?> |
|
373 | + ?> |
|
374 | 374 | <input type="hidden" id="<?php echo $map_canvas_name;?>_location_enabled" value="0"/> |
375 | 375 | <?php }?> |
376 | 376 | |
@@ -381,9 +381,9 @@ discard block |
||
381 | 381 | |
382 | 382 | |
383 | 383 | <?php if ($geodir_map_options['enable_post_type_filters']) { |
384 | - $post_types = geodir_get_posttypes('object'); |
|
385 | - if (count((array)($post_types)) > 1) { |
|
386 | - ?> |
|
384 | + $post_types = geodir_get_posttypes('object'); |
|
385 | + if (count((array)($post_types)) > 1) { |
|
386 | + ?> |
|
387 | 387 | <div class="map-places-listing" id="<?php echo $map_canvas_name;?>_posttype_menu" |
388 | 388 | style="max-width:<?php echo $map_width;?>!important;"> |
389 | 389 | |
@@ -391,15 +391,15 @@ discard block |
||
391 | 391 | <div class="geodir-map-posttype-list"><?php } ?> |
392 | 392 | <ul class="clearfix place-list"> |
393 | 393 | <?php |
394 | - $exclude_post_types = get_option('geodir_exclude_post_type_on_map'); |
|
394 | + $exclude_post_types = get_option('geodir_exclude_post_type_on_map'); |
|
395 | 395 | |
396 | - foreach ($post_types as $post_type => $args) { |
|
397 | - if (!in_array($post_type, $exclude_post_types)) { |
|
398 | - $class = $map_search_pt == $post_type ? 'class="gd-map-search-pt"' : ''; |
|
396 | + foreach ($post_types as $post_type => $args) { |
|
397 | + if (!in_array($post_type, $exclude_post_types)) { |
|
398 | + $class = $map_search_pt == $post_type ? 'class="gd-map-search-pt"' : ''; |
|
399 | 399 | echo '<li id="' . $post_type . '" ' . $class . '><a href="javascript:void(0);" onclick="jQuery(\'#' . $map_canvas_name . '_posttype\').val(\'' . $post_type . '\');build_map_ajax_search_param(\'' . $map_canvas_name . '\', true)">' . __(ucfirst($args->labels->name), 'geodirectory') . '</a></li>'; |
400 | - } |
|
401 | - } |
|
402 | - ?> |
|
400 | + } |
|
401 | + } |
|
402 | + ?> |
|
403 | 403 | </ul> |
404 | 404 | <?php if (isset($geodir_map_options['is_geodir_home_map_widget']) && $map_args['is_geodir_home_map_widget']) { ?> |
405 | 405 | </div><?php } ?> |
@@ -413,8 +413,8 @@ discard block |
||
413 | 413 | |
414 | 414 | </div> <!-- map-places-listings--> |
415 | 415 | <?php } |
416 | - } // end of post type filter if |
|
417 | - ?> |
|
416 | + } // end of post type filter if |
|
417 | + ?> |
|
418 | 418 | |
419 | 419 | </div> |
420 | 420 | </div> <!--end of stick trigger container--> |
@@ -429,8 +429,8 @@ discard block |
||
429 | 429 | </script> |
430 | 430 | <?php |
431 | 431 | |
432 | - if (strpos($geodir_map_options['height'], 'vh')) { |
|
433 | - ?> |
|
432 | + if (strpos($geodir_map_options['height'], 'vh')) { |
|
433 | + ?> |
|
434 | 434 | <script> |
435 | 435 | (function () { |
436 | 436 | var screenH = jQuery(window).height(); |
@@ -452,8 +452,8 @@ discard block |
||
452 | 452 | |
453 | 453 | <?php |
454 | 454 | |
455 | - } elseif (strpos($geodir_map_options['height'], 'px')) { |
|
456 | - ?> |
|
455 | + } elseif (strpos($geodir_map_options['height'], 'px')) { |
|
456 | + ?> |
|
457 | 457 | <script> |
458 | 458 | (function () { |
459 | 459 | var screenH = jQuery(window).height(); |
@@ -468,20 +468,20 @@ discard block |
||
468 | 468 | }()); |
469 | 469 | </script> |
470 | 470 | <?php |
471 | - } |
|
471 | + } |
|
472 | 472 | |
473 | - /** |
|
474 | - * Action that runs after all the map code has been output; |
|
475 | - * |
|
476 | - * @since 1.5.3 |
|
477 | - * |
|
478 | - * @param array $geodir_map_options Array of map settings. |
|
479 | - * @param string $map_canvas_name The canvas name and ID for the map. |
|
480 | - */ |
|
481 | - do_action('geodir_map_after_render',$geodir_map_options,$map_canvas_name); |
|
473 | + /** |
|
474 | + * Action that runs after all the map code has been output; |
|
475 | + * |
|
476 | + * @since 1.5.3 |
|
477 | + * |
|
478 | + * @param array $geodir_map_options Array of map settings. |
|
479 | + * @param string $map_canvas_name The canvas name and ID for the map. |
|
480 | + */ |
|
481 | + do_action('geodir_map_after_render',$geodir_map_options,$map_canvas_name); |
|
482 | 482 | |
483 | 483 | |
484 | - endif; // Exclude posttypes if end |
|
484 | + endif; // Exclude posttypes if end |
|
485 | 485 | } |
486 | 486 | |
487 | 487 | ?> |
488 | 488 | \ No newline at end of file |