@@ -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 |
@@ -18,11 +18,11 @@ discard block |
||
| 18 | 18 | */ |
| 19 | 19 | function geodir_divi_signup_body_class($classes) |
| 20 | 20 | { |
| 21 | - if (geodir_is_page('login')) { |
|
| 22 | - $classes = str_replace('et_right_sidebar', 'et_full_width_page', $classes); |
|
| 23 | - $classes[] = 'divi-gd-signup'; |
|
| 24 | - } |
|
| 25 | - return $classes; |
|
| 21 | + if (geodir_is_page('login')) { |
|
| 22 | + $classes = str_replace('et_right_sidebar', 'et_full_width_page', $classes); |
|
| 23 | + $classes[] = 'divi-gd-signup'; |
|
| 24 | + } |
|
| 25 | + return $classes; |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | add_action('geodir_wrapper_close', 'geodir_divi_action_wrapper_close', 11); |
@@ -34,8 +34,8 @@ discard block |
||
| 34 | 34 | */ |
| 35 | 35 | function geodir_divi_action_wrapper_close() |
| 36 | 36 | { |
| 37 | - if (geodir_is_page('login')) { |
|
| 38 | - // We need to close extra divs generated by WRAPPER BEFORE MAIN CONTENT (below) because there is no sidebar on this page |
|
| 39 | - echo '</div></div>'; |
|
| 40 | - } |
|
| 37 | + if (geodir_is_page('login')) { |
|
| 38 | + // We need to close extra divs generated by WRAPPER BEFORE MAIN CONTENT (below) because there is no sidebar on this page |
|
| 39 | + echo '</div></div>'; |
|
| 40 | + } |
|
| 41 | 41 | } |
| 42 | 42 | \ No newline at end of file |
@@ -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 |
@@ -13,8 +13,8 @@ |
||
| 13 | 13 | * If user is not signed in, redirect home. |
| 14 | 14 | */ |
| 15 | 15 | if (get_current_user_id()) { |
| 16 | - wp_redirect(home_url(), 302); |
|
| 17 | - exit; |
|
| 16 | + wp_redirect(home_url(), 302); |
|
| 17 | + exit; |
|
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | // call header |
@@ -10,13 +10,13 @@ discard block |
||
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | 12 | if (isset($_GET['redirect_to']) && $_GET['redirect_to'] != '') {
|
| 13 | - $redirect_to = $_GET['redirect_to']; |
|
| 13 | + $redirect_to = $_GET['redirect_to']; |
|
| 14 | 14 | } else {
|
| 15 | - //echo $_SERVER['HTTP_HOST'] ; |
|
| 16 | - $redirect_to = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''; |
|
| 17 | - if (strpos($redirect_to, $_SERVER['HTTP_HOST']) === false) {
|
|
| 18 | - $redirect_to = home_url(); |
|
| 19 | - } |
|
| 15 | + //echo $_SERVER['HTTP_HOST'] ; |
|
| 16 | + $redirect_to = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''; |
|
| 17 | + if (strpos($redirect_to, $_SERVER['HTTP_HOST']) === false) {
|
|
| 18 | + $redirect_to = home_url(); |
|
| 19 | + } |
|
| 20 | 20 | |
| 21 | 21 | } |
| 22 | 22 | |
@@ -38,36 +38,36 @@ discard block |
||
| 38 | 38 | <h4> |
| 39 | 39 | <?php |
| 40 | 40 | |
| 41 | - /** |
|
| 42 | - * Filter the `SIGN_IN_PAGE_TITLE` title text on login form template. |
|
| 43 | - * |
|
| 44 | - * @since 1.0.0 |
|
| 45 | - */ |
|
| 46 | - echo apply_filters('geodir_login_page_title', SIGN_IN_PAGE_TITLE);
|
|
| 41 | + /** |
|
| 42 | + * Filter the `SIGN_IN_PAGE_TITLE` title text on login form template. |
|
| 43 | + * |
|
| 44 | + * @since 1.0.0 |
|
| 45 | + */ |
|
| 46 | + echo apply_filters('geodir_login_page_title', SIGN_IN_PAGE_TITLE);
|
|
| 47 | 47 | |
| 48 | - ?> |
|
| 48 | + ?> |
|
| 49 | 49 | </h4> |
| 50 | 50 | <?php |
| 51 | - if (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 'fw') {
|
|
| 52 | - echo "<p class=\"error_msg\"> " . INVALID_USER_FPW_MSG . " </p>"; |
|
| 53 | - } elseif (isset($_REQUEST['logemsg']) && $_REQUEST['logemsg'] == 1) {
|
|
| 54 | - echo "<p class=\"error_msg\"> " . INVALID_USER_PW_MSG . " </p>"; |
|
| 55 | - } |
|
| 51 | + if (isset($_REQUEST['emsg']) && $_REQUEST['emsg'] == 'fw') {
|
|
| 52 | + echo "<p class=\"error_msg\"> " . INVALID_USER_FPW_MSG . " </p>"; |
|
| 53 | + } elseif (isset($_REQUEST['logemsg']) && $_REQUEST['logemsg'] == 1) {
|
|
| 54 | + echo "<p class=\"error_msg\"> " . INVALID_USER_PW_MSG . " </p>"; |
|
| 55 | + } |
|
| 56 | 56 | |
| 57 | - if (isset($_REQUEST['checkemail']) && $_REQUEST['checkemail'] == 'confirm') |
|
| 58 | - echo '<p class="sucess_msg">' . PW_SEND_CONFIRM_MSG . '</p>'; |
|
| 57 | + if (isset($_REQUEST['checkemail']) && $_REQUEST['checkemail'] == 'confirm') |
|
| 58 | + echo '<p class="sucess_msg">' . PW_SEND_CONFIRM_MSG . '</p>'; |
|
| 59 | 59 | |
| 60 | - ?> |
|
| 60 | + ?> |
|
| 61 | 61 | <form name="cus_loginform" id="cus_loginform" action="<?php echo esc_url(geodir_curPageURL()); ?>" |
| 62 | 62 | method="post"> |
| 63 | 63 | |
| 64 | 64 | <div class="form_row clearfix"> |
| 65 | 65 | <input placeholder='<?php echo USERNAME_TEXT; ?>' type="text" name="log" id="user_login" |
| 66 | 66 | value="<?php global $user_login; |
| 67 | - if (!isset($user_login)) {
|
|
| 68 | - $user_login = ''; |
|
| 69 | - } |
|
| 70 | - echo esc_attr($user_login); ?>" size="20" class="textfield"/> |
|
| 67 | + if (!isset($user_login)) {
|
|
| 68 | + $user_login = ''; |
|
| 69 | + } |
|
| 70 | + echo esc_attr($user_login); ?>" size="20" class="textfield"/> |
|
| 71 | 71 | <span class="user_loginInfo"></span> |
| 72 | 72 | </div> |
| 73 | 73 | |
@@ -78,14 +78,14 @@ discard block |
||
| 78 | 78 | </div> |
| 79 | 79 | |
| 80 | 80 | <?php |
| 81 | - /** |
|
| 82 | - * This is a default WordPress action that calls any additional elements needed for any login forms. |
|
| 83 | - * |
|
| 84 | - * We use this action before the remember me checkbox on the sigin form. |
|
| 85 | - * |
|
| 86 | - * @since 1.0.0 |
|
| 87 | - */ |
|
| 88 | - do_action('login_form'); ?>
|
|
| 81 | + /** |
|
| 82 | + * This is a default WordPress action that calls any additional elements needed for any login forms. |
|
| 83 | + * |
|
| 84 | + * We use this action before the remember me checkbox on the sigin form. |
|
| 85 | + * |
|
| 86 | + * @since 1.0.0 |
|
| 87 | + */ |
|
| 88 | + do_action('login_form'); ?>
|
|
| 89 | 89 | <p class="rember"> |
| 90 | 90 | <input name="rememberme" type="checkbox" id="rememberme" value="forever" class="fl"/> |
| 91 | 91 | <?php echo REMEMBER_ON_COMPUTER_TEXT; ?> |
@@ -109,12 +109,12 @@ discard block |
||
| 109 | 109 | <input placeholder='<?php echo USERNAME_EMAIL_TEXT; ?>' type="text" name="user_login" |
| 110 | 110 | value="<?php echo esc_attr($user_login); ?>" size="20" class="user_login1 textfield"/> |
| 111 | 111 | <?php |
| 112 | - /** |
|
| 113 | - * Called before the get new password button in the login box template. |
|
| 114 | - * |
|
| 115 | - * @since 1.0.0 |
|
| 116 | - */ |
|
| 117 | - do_action('lostpassword_form'); ?>
|
|
| 112 | + /** |
|
| 113 | + * Called before the get new password button in the login box template. |
|
| 114 | + * |
|
| 115 | + * @since 1.0.0 |
|
| 116 | + */ |
|
| 117 | + do_action('lostpassword_form'); ?>
|
|
| 118 | 118 | </div> |
| 119 | 119 | <input type="submit" name="get_new_password" value="<?php echo GET_NEW_PW_TEXT; ?>" class="geodir_button"/> |
| 120 | 120 | </form> |
@@ -15,29 +15,29 @@ discard block |
||
| 15 | 15 | <?php |
| 16 | 16 | |
| 17 | 17 | |
| 18 | - global $wpdb; |
|
| 18 | + global $wpdb; |
|
| 19 | 19 | |
| 20 | - $post_id = $_REQUEST['pid']; |
|
| 21 | - $post_info = get_post($post_id); |
|
| 20 | + $post_id = $_REQUEST['pid']; |
|
| 21 | + $post_info = get_post($post_id); |
|
| 22 | 22 | |
| 23 | - $posted_date = $post_info->post_date; |
|
| 24 | - $productlink = get_permalink($post_id); |
|
| 25 | - $siteName = get_bloginfo('name');
|
|
| 26 | - $siteurl = home_url(); |
|
| 27 | - $siteurl_link = '<a href="' . $siteurl . '">' . $siteurl . '</a>'; |
|
| 23 | + $posted_date = $post_info->post_date; |
|
| 24 | + $productlink = get_permalink($post_id); |
|
| 25 | + $siteName = get_bloginfo('name');
|
|
| 26 | + $siteurl = home_url(); |
|
| 27 | + $siteurl_link = '<a href="' . $siteurl . '">' . $siteurl . '</a>'; |
|
| 28 | 28 | |
| 29 | - $loginurl = geodir_login_url(); |
|
| 30 | - $loginurl_link = '<a href="' . $loginurl . '">login</a>'; |
|
| 29 | + $loginurl = geodir_login_url(); |
|
| 30 | + $loginurl_link = '<a href="' . $loginurl . '">login</a>'; |
|
| 31 | 31 | |
| 32 | - $post_author = $post_info->post_author; |
|
| 32 | + $post_author = $post_info->post_author; |
|
| 33 | 33 | |
| 34 | - $user_info = get_userdata($post_author); |
|
| 35 | - $username = $user_info->user_login; |
|
| 36 | - $user_email = $user_info->user_email; |
|
| 34 | + $user_info = get_userdata($post_author); |
|
| 35 | + $username = $user_info->user_login; |
|
| 36 | + $user_email = $user_info->user_email; |
|
| 37 | 37 | |
| 38 | - $message = wpautop(__(stripslashes_deep(get_option('geodir_post_added_success_msg_content')),'geodirectory'));
|
|
| 38 | + $message = wpautop(__(stripslashes_deep(get_option('geodir_post_added_success_msg_content')),'geodirectory'));
|
|
| 39 | 39 | |
| 40 | - /* |
|
| 40 | + /* |
|
| 41 | 41 | * Filter the success page message before variable replacements. |
| 42 | 42 | * |
| 43 | 43 | * @since 1.5.7 |
@@ -45,13 +45,13 @@ discard block |
||
| 45 | 45 | * @param object $post_info Post object. |
| 46 | 46 | * @param object $user_info User object. |
| 47 | 47 | */ |
| 48 | - $message = apply_filters('geodir_success_page_msg_before_var_replace', $message,$post_info, $user_info);
|
|
| 48 | + $message = apply_filters('geodir_success_page_msg_before_var_replace', $message,$post_info, $user_info);
|
|
| 49 | 49 | |
| 50 | - $search_array = array('[#submited_information_link#]', '[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#user_email#]', '[#username#]', '[#login_url#]', '[#posted_date#]');
|
|
| 51 | - $replace_array = array($productlink, $productlink, $siteurl_link, $post_id, $siteName, $user_email, $username, $loginurl_link, $posted_date); |
|
| 52 | - $message = str_replace($search_array, $replace_array, $message); |
|
| 50 | + $search_array = array('[#submited_information_link#]', '[#listing_link#]', '[#site_name_url#]', '[#post_id#]', '[#site_name#]', '[#user_email#]', '[#username#]', '[#login_url#]', '[#posted_date#]');
|
|
| 51 | + $replace_array = array($productlink, $productlink, $siteurl_link, $post_id, $siteName, $user_email, $username, $loginurl_link, $posted_date); |
|
| 52 | + $message = str_replace($search_array, $replace_array, $message); |
|
| 53 | 53 | |
| 54 | - /* |
|
| 54 | + /* |
|
| 55 | 55 | * Filter the success page message after variable replacements. |
| 56 | 56 | * |
| 57 | 57 | * @since 1.5.7 |
@@ -59,15 +59,15 @@ discard block |
||
| 59 | 59 | * @param object $post_info Post object. |
| 60 | 60 | * @param object $user_info User object. |
| 61 | 61 | */ |
| 62 | - $message = apply_filters('geodir_success_page_msg_after_var_replace', $message,$post_info, $user_info);
|
|
| 62 | + $message = apply_filters('geodir_success_page_msg_after_var_replace', $message,$post_info, $user_info);
|
|
| 63 | 63 | |
| 64 | 64 | |
| 65 | 65 | |
| 66 | - ?> |
|
| 66 | + ?> |
|
| 67 | 67 | |
| 68 | 68 | <?php |
| 69 | 69 | |
| 70 | - /* |
|
| 70 | + /* |
|
| 71 | 71 | * Action called before the success page message wrapper. |
| 72 | 72 | * |
| 73 | 73 | * @since 1.5.7 |
@@ -75,11 +75,11 @@ discard block |
||
| 75 | 75 | * @param object $post_info Post object. |
| 76 | 76 | * @param object $user_info User object. |
| 77 | 77 | */ |
| 78 | - do_action('geodir_before_success_page_msg_wrapper', $message,$post_info, $user_info);
|
|
| 79 | - echo '<h5 class="geodir_information">'; |
|
| 80 | - echo $message; |
|
| 81 | - echo '</h5>'; |
|
| 82 | - /* |
|
| 78 | + do_action('geodir_before_success_page_msg_wrapper', $message,$post_info, $user_info);
|
|
| 79 | + echo '<h5 class="geodir_information">'; |
|
| 80 | + echo $message; |
|
| 81 | + echo '</h5>'; |
|
| 82 | + /* |
|
| 83 | 83 | * Action called after the success page message wrapper. |
| 84 | 84 | * |
| 85 | 85 | * @since 1.5.7 |
@@ -87,8 +87,8 @@ discard block |
||
| 87 | 87 | * @param object $post_info Post object. |
| 88 | 88 | * @param object $user_info User object. |
| 89 | 89 | */ |
| 90 | - do_action('geodir_after_success_page_msg_wrapper', $message,$post_info, $user_info);
|
|
| 90 | + do_action('geodir_after_success_page_msg_wrapper', $message,$post_info, $user_info);
|
|
| 91 | 91 | |
| 92 | - ?> |
|
| 92 | + ?> |
|
| 93 | 93 | |
| 94 | 94 | </div> |
| 95 | 95 | \ No newline at end of file |
@@ -14,41 +14,41 @@ discard block |
||
| 14 | 14 | */ |
| 15 | 15 | class geodir_popular_post_category extends WP_Widget |
| 16 | 16 | {
|
| 17 | - /** |
|
| 17 | + /** |
|
| 18 | 18 | * Register the popular post category widget. |
| 19 | 19 | * |
| 20 | 20 | * @since 1.0.0 |
| 21 | - * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct. |
|
| 21 | + * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct. |
|
| 22 | 22 | */ |
| 23 | - public function __construct() {
|
|
| 24 | - $widget_ops = array('classname' => 'geodir_popular_post_category', 'description' => __('GD > Popular Post Category', 'geodirectory'));
|
|
| 25 | - parent::__construct( |
|
| 26 | - 'popular_post_category', // Base ID |
|
| 27 | - __('GD > Popular Post Category', 'geodirectory'), // Name
|
|
| 28 | - $widget_ops// Args |
|
| 29 | - ); |
|
| 30 | - } |
|
| 23 | + public function __construct() {
|
|
| 24 | + $widget_ops = array('classname' => 'geodir_popular_post_category', 'description' => __('GD > Popular Post Category', 'geodirectory'));
|
|
| 25 | + parent::__construct( |
|
| 26 | + 'popular_post_category', // Base ID |
|
| 27 | + __('GD > Popular Post Category', 'geodirectory'), // Name
|
|
| 28 | + $widget_ops// Args |
|
| 29 | + ); |
|
| 30 | + } |
|
| 31 | 31 | |
| 32 | 32 | /** |
| 33 | 33 | * Front-end display content for popular post category widget. |
| 34 | 34 | * |
| 35 | 35 | * @since 1.0.0 |
| 36 | - * @since 1.5.1 Declare function public. |
|
| 36 | + * @since 1.5.1 Declare function public. |
|
| 37 | 37 | * |
| 38 | 38 | * @param array $args Widget arguments. |
| 39 | 39 | * @param array $instance Saved values from database. |
| 40 | 40 | */ |
| 41 | 41 | public function widget($args, $instance) |
| 42 | - {
|
|
| 43 | - geodir_popular_post_category_output($args, $instance); |
|
| 44 | - } |
|
| 42 | + {
|
|
| 43 | + geodir_popular_post_category_output($args, $instance); |
|
| 44 | + } |
|
| 45 | 45 | |
| 46 | 46 | /** |
| 47 | 47 | * Sanitize popular post category widget form values as they are saved. |
| 48 | 48 | * |
| 49 | 49 | * @since 1.0.0 |
| 50 | - * @since 1.5.1 Declare function public. |
|
| 51 | - * @since 1.5.1 Added default_post_type parameter. |
|
| 50 | + * @since 1.5.1 Declare function public. |
|
| 51 | + * @since 1.5.1 Added default_post_type parameter. |
|
| 52 | 52 | * |
| 53 | 53 | * @param array $new_instance Values just sent to be saved. |
| 54 | 54 | * @param array $old_instance Previously saved values from database. |
@@ -56,37 +56,37 @@ discard block |
||
| 56 | 56 | * @return array Updated safe values to be saved. |
| 57 | 57 | */ |
| 58 | 58 | public function update($new_instance, $old_instance) |
| 59 | - {
|
|
| 60 | - //save the widget |
|
| 61 | - $instance = $old_instance; |
|
| 62 | - $instance['title'] = strip_tags($new_instance['title']); |
|
| 63 | - $category_limit = (int)$new_instance['category_limit']; |
|
| 64 | - $instance['category_limit'] = $category_limit > 0 ? $category_limit : 15; |
|
| 59 | + {
|
|
| 60 | + //save the widget |
|
| 61 | + $instance = $old_instance; |
|
| 62 | + $instance['title'] = strip_tags($new_instance['title']); |
|
| 63 | + $category_limit = (int)$new_instance['category_limit']; |
|
| 64 | + $instance['category_limit'] = $category_limit > 0 ? $category_limit : 15; |
|
| 65 | 65 | $instance['default_post_type'] = isset($new_instance['default_post_type']) ? $new_instance['default_post_type'] : ''; |
| 66 | - return $instance; |
|
| 67 | - } |
|
| 66 | + return $instance; |
|
| 67 | + } |
|
| 68 | 68 | |
| 69 | 69 | /** |
| 70 | 70 | * Back-end popular post category widget settings form. |
| 71 | 71 | * |
| 72 | 72 | * @since 1.0.0 |
| 73 | - * @since 1.5.1 Declare function public. |
|
| 74 | - * @since 1.5.1 Added option to set default post type. |
|
| 73 | + * @since 1.5.1 Declare function public. |
|
| 74 | + * @since 1.5.1 Added option to set default post type. |
|
| 75 | 75 | * |
| 76 | 76 | * @param array $instance Previously saved values from database. |
| 77 | 77 | */ |
| 78 | 78 | public function form($instance) |
| 79 | - {
|
|
| 80 | - //widgetform in backend |
|
| 81 | - $instance = wp_parse_args((array)$instance, array('title' => '', 'category_limit' => 15, 'default_post_type' => ''));
|
|
| 79 | + {
|
|
| 80 | + //widgetform in backend |
|
| 81 | + $instance = wp_parse_args((array)$instance, array('title' => '', 'category_limit' => 15, 'default_post_type' => ''));
|
|
| 82 | 82 | |
| 83 | - $title = strip_tags($instance['title']); |
|
| 84 | - $category_limit = (int)$instance['category_limit']; |
|
| 85 | - $category_limit = $category_limit > 0 ? $category_limit : 15; |
|
| 83 | + $title = strip_tags($instance['title']); |
|
| 84 | + $category_limit = (int)$instance['category_limit']; |
|
| 85 | + $category_limit = $category_limit > 0 ? $category_limit : 15; |
|
| 86 | 86 | $default_post_type = isset($instance['default_post_type']) ? $instance['default_post_type'] : ''; |
| 87 | 87 | |
| 88 | 88 | $post_type_options = geodir_get_posttypes('options');
|
| 89 | - ?> |
|
| 89 | + ?> |
|
| 90 | 90 | <p> |
| 91 | 91 | <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'geodirectory'); ?>
|
| 92 | 92 | <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>"
|
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | </label> |
| 117 | 117 | </p> |
| 118 | 118 | <?php |
| 119 | - } |
|
| 119 | + } |
|
| 120 | 120 | } // class geodir_popular_post_category |
| 121 | 121 | |
| 122 | 122 | register_widget('geodir_popular_post_category');
|
@@ -130,40 +130,40 @@ discard block |
||
| 130 | 130 | class geodir_popular_postview extends WP_Widget |
| 131 | 131 | {
|
| 132 | 132 | |
| 133 | - /** |
|
| 133 | + /** |
|
| 134 | 134 | * Register the popular posts widget. |
| 135 | 135 | * |
| 136 | 136 | * @since 1.0.0 |
| 137 | - * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct. |
|
| 137 | + * @since 1.5.1 Changed from PHP4 style constructors to PHP5 __construct. |
|
| 138 | 138 | */ |
| 139 | - public function __construct() {
|
|
| 140 | - $widget_ops = array('classname' => 'geodir_popular_post_view', 'description' => __('GD > Popular Post View', 'geodirectory'));
|
|
| 141 | - parent::__construct( |
|
| 142 | - 'popular_post_view', // Base ID |
|
| 143 | - __('GD > Popular Post View', 'geodirectory'), // Name
|
|
| 144 | - $widget_ops// Args |
|
| 145 | - ); |
|
| 146 | - } |
|
| 139 | + public function __construct() {
|
|
| 140 | + $widget_ops = array('classname' => 'geodir_popular_post_view', 'description' => __('GD > Popular Post View', 'geodirectory'));
|
|
| 141 | + parent::__construct( |
|
| 142 | + 'popular_post_view', // Base ID |
|
| 143 | + __('GD > Popular Post View', 'geodirectory'), // Name
|
|
| 144 | + $widget_ops// Args |
|
| 145 | + ); |
|
| 146 | + } |
|
| 147 | 147 | |
| 148 | 148 | /** |
| 149 | 149 | * Front-end display content for popular posts widget. |
| 150 | 150 | * |
| 151 | 151 | * @since 1.0.0 |
| 152 | - * @since 1.5.1 Declare function public. |
|
| 152 | + * @since 1.5.1 Declare function public. |
|
| 153 | 153 | * |
| 154 | 154 | * @param array $args Widget arguments. |
| 155 | 155 | * @param array $instance Saved values from database. |
| 156 | 156 | */ |
| 157 | 157 | public function widget($args, $instance) |
| 158 | - {
|
|
| 159 | - geodir_popular_postview_output($args, $instance); |
|
| 160 | - } |
|
| 158 | + {
|
|
| 159 | + geodir_popular_postview_output($args, $instance); |
|
| 160 | + } |
|
| 161 | 161 | |
| 162 | 162 | /** |
| 163 | 163 | * Sanitize popular posts widget form values as they are saved. |
| 164 | 164 | * |
| 165 | 165 | * @since 1.0.0 |
| 166 | - * @since 1.5.1 Declare function public. |
|
| 166 | + * @since 1.5.1 Declare function public. |
|
| 167 | 167 | * |
| 168 | 168 | * @param array $new_instance Values just sent to be saved. |
| 169 | 169 | * @param array $old_instance Previously saved values from database. |
@@ -171,99 +171,99 @@ discard block |
||
| 171 | 171 | * @return array Updated safe values to be saved. |
| 172 | 172 | */ |
| 173 | 173 | public function update($new_instance, $old_instance) |
| 174 | - {
|
|
| 175 | - //save the widget |
|
| 176 | - $instance = $old_instance; |
|
| 177 | - |
|
| 178 | - if ($new_instance['title'] == '') {
|
|
| 179 | - $title = geodir_ucwords(strip_tags($new_instance['category_title'])); |
|
| 180 | - //$instance['title'] = $title; |
|
| 181 | - } |
|
| 182 | - $instance['title'] = strip_tags($new_instance['title']); |
|
| 183 | - |
|
| 184 | - $instance['post_type'] = strip_tags($new_instance['post_type']); |
|
| 185 | - //$instance['category'] = strip_tags($new_instance['category']); |
|
| 186 | - $instance['category'] = isset($new_instance['category']) ? $new_instance['category'] : ''; |
|
| 187 | - $instance['category_title'] = strip_tags($new_instance['category_title']); |
|
| 188 | - $instance['post_number'] = strip_tags($new_instance['post_number']); |
|
| 189 | - $instance['layout'] = strip_tags($new_instance['layout']); |
|
| 190 | - $instance['listing_width'] = strip_tags($new_instance['listing_width']); |
|
| 191 | - $instance['list_sort'] = strip_tags($new_instance['list_sort']); |
|
| 192 | - $instance['character_count'] = $new_instance['character_count']; |
|
| 193 | - if (isset($new_instance['add_location_filter']) && $new_instance['add_location_filter'] != '') |
|
| 194 | - $instance['add_location_filter'] = strip_tags($new_instance['add_location_filter']); |
|
| 195 | - else |
|
| 196 | - $instance['add_location_filter'] = '0'; |
|
| 197 | - |
|
| 198 | - $instance['show_featured_only'] = isset($new_instance['show_featured_only']) && $new_instance['show_featured_only'] ? 1 : 0; |
|
| 199 | - $instance['show_special_only'] = isset($new_instance['show_special_only']) && $new_instance['show_special_only'] ? 1 : 0; |
|
| 200 | - $instance['with_pics_only'] = isset($new_instance['with_pics_only']) && $new_instance['with_pics_only'] ? 1 : 0; |
|
| 201 | - $instance['with_videos_only'] = isset($new_instance['with_videos_only']) && $new_instance['with_videos_only'] ? 1 : 0; |
|
| 202 | - $instance['use_viewing_post_type'] = isset($new_instance['use_viewing_post_type']) && $new_instance['use_viewing_post_type'] ? 1 : 0; |
|
| 203 | - |
|
| 204 | - return $instance; |
|
| 205 | - } |
|
| 174 | + {
|
|
| 175 | + //save the widget |
|
| 176 | + $instance = $old_instance; |
|
| 177 | + |
|
| 178 | + if ($new_instance['title'] == '') {
|
|
| 179 | + $title = geodir_ucwords(strip_tags($new_instance['category_title'])); |
|
| 180 | + //$instance['title'] = $title; |
|
| 181 | + } |
|
| 182 | + $instance['title'] = strip_tags($new_instance['title']); |
|
| 183 | + |
|
| 184 | + $instance['post_type'] = strip_tags($new_instance['post_type']); |
|
| 185 | + //$instance['category'] = strip_tags($new_instance['category']); |
|
| 186 | + $instance['category'] = isset($new_instance['category']) ? $new_instance['category'] : ''; |
|
| 187 | + $instance['category_title'] = strip_tags($new_instance['category_title']); |
|
| 188 | + $instance['post_number'] = strip_tags($new_instance['post_number']); |
|
| 189 | + $instance['layout'] = strip_tags($new_instance['layout']); |
|
| 190 | + $instance['listing_width'] = strip_tags($new_instance['listing_width']); |
|
| 191 | + $instance['list_sort'] = strip_tags($new_instance['list_sort']); |
|
| 192 | + $instance['character_count'] = $new_instance['character_count']; |
|
| 193 | + if (isset($new_instance['add_location_filter']) && $new_instance['add_location_filter'] != '') |
|
| 194 | + $instance['add_location_filter'] = strip_tags($new_instance['add_location_filter']); |
|
| 195 | + else |
|
| 196 | + $instance['add_location_filter'] = '0'; |
|
| 197 | + |
|
| 198 | + $instance['show_featured_only'] = isset($new_instance['show_featured_only']) && $new_instance['show_featured_only'] ? 1 : 0; |
|
| 199 | + $instance['show_special_only'] = isset($new_instance['show_special_only']) && $new_instance['show_special_only'] ? 1 : 0; |
|
| 200 | + $instance['with_pics_only'] = isset($new_instance['with_pics_only']) && $new_instance['with_pics_only'] ? 1 : 0; |
|
| 201 | + $instance['with_videos_only'] = isset($new_instance['with_videos_only']) && $new_instance['with_videos_only'] ? 1 : 0; |
|
| 202 | + $instance['use_viewing_post_type'] = isset($new_instance['use_viewing_post_type']) && $new_instance['use_viewing_post_type'] ? 1 : 0; |
|
| 203 | + |
|
| 204 | + return $instance; |
|
| 205 | + } |
|
| 206 | 206 | |
| 207 | 207 | /** |
| 208 | 208 | * Back-end popular posts widget settings form. |
| 209 | 209 | * |
| 210 | 210 | * @since 1.0.0 |
| 211 | - * @since 1.5.1 Declare function public. |
|
| 211 | + * @since 1.5.1 Declare function public. |
|
| 212 | 212 | * |
| 213 | 213 | * @param array $instance Previously saved values from database. |
| 214 | 214 | */ |
| 215 | 215 | public function form($instance) |
| 216 | - {
|
|
| 217 | - //widgetform in backend |
|
| 218 | - $instance = wp_parse_args((array)$instance, |
|
| 219 | - array('title' => '',
|
|
| 220 | - 'post_type' => '', |
|
| 221 | - 'category' => array(), |
|
| 222 | - 'category_title' => '', |
|
| 223 | - 'list_sort' => '', |
|
| 224 | - 'list_order' => '', |
|
| 225 | - 'post_number' => '5', |
|
| 226 | - 'layout' => 'gridview_onehalf', |
|
| 227 | - 'listing_width' => '', |
|
| 228 | - 'add_location_filter' => '1', |
|
| 229 | - 'character_count' => '20', |
|
| 230 | - 'show_featured_only' => '', |
|
| 231 | - 'show_special_only' => '', |
|
| 232 | - 'with_pics_only' => '', |
|
| 233 | - 'with_videos_only' => '', |
|
| 234 | - 'use_viewing_post_type' => '' |
|
| 235 | - ) |
|
| 236 | - ); |
|
| 216 | + {
|
|
| 217 | + //widgetform in backend |
|
| 218 | + $instance = wp_parse_args((array)$instance, |
|
| 219 | + array('title' => '',
|
|
| 220 | + 'post_type' => '', |
|
| 221 | + 'category' => array(), |
|
| 222 | + 'category_title' => '', |
|
| 223 | + 'list_sort' => '', |
|
| 224 | + 'list_order' => '', |
|
| 225 | + 'post_number' => '5', |
|
| 226 | + 'layout' => 'gridview_onehalf', |
|
| 227 | + 'listing_width' => '', |
|
| 228 | + 'add_location_filter' => '1', |
|
| 229 | + 'character_count' => '20', |
|
| 230 | + 'show_featured_only' => '', |
|
| 231 | + 'show_special_only' => '', |
|
| 232 | + 'with_pics_only' => '', |
|
| 233 | + 'with_videos_only' => '', |
|
| 234 | + 'use_viewing_post_type' => '' |
|
| 235 | + ) |
|
| 236 | + ); |
|
| 237 | 237 | |
| 238 | - $title = strip_tags($instance['title']); |
|
| 238 | + $title = strip_tags($instance['title']); |
|
| 239 | 239 | |
| 240 | - $post_type = strip_tags($instance['post_type']); |
|
| 240 | + $post_type = strip_tags($instance['post_type']); |
|
| 241 | 241 | |
| 242 | - $category = $instance['category']; |
|
| 242 | + $category = $instance['category']; |
|
| 243 | 243 | |
| 244 | - $category_title = strip_tags($instance['category_title']); |
|
| 244 | + $category_title = strip_tags($instance['category_title']); |
|
| 245 | 245 | |
| 246 | - $list_sort = strip_tags($instance['list_sort']); |
|
| 246 | + $list_sort = strip_tags($instance['list_sort']); |
|
| 247 | 247 | |
| 248 | - $list_order = strip_tags($instance['list_order']); |
|
| 248 | + $list_order = strip_tags($instance['list_order']); |
|
| 249 | 249 | |
| 250 | - $post_number = strip_tags($instance['post_number']); |
|
| 250 | + $post_number = strip_tags($instance['post_number']); |
|
| 251 | 251 | |
| 252 | - $layout = strip_tags($instance['layout']); |
|
| 252 | + $layout = strip_tags($instance['layout']); |
|
| 253 | 253 | |
| 254 | - $listing_width = strip_tags($instance['listing_width']); |
|
| 254 | + $listing_width = strip_tags($instance['listing_width']); |
|
| 255 | 255 | |
| 256 | - $add_location_filter = strip_tags($instance['add_location_filter']); |
|
| 256 | + $add_location_filter = strip_tags($instance['add_location_filter']); |
|
| 257 | 257 | |
| 258 | - $character_count = $instance['character_count']; |
|
| 258 | + $character_count = $instance['character_count']; |
|
| 259 | 259 | |
| 260 | - $show_featured_only = isset($instance['show_featured_only']) && $instance['show_featured_only'] ? true : false; |
|
| 261 | - $show_special_only = isset($instance['show_special_only']) && $instance['show_special_only'] ? true : false; |
|
| 262 | - $with_pics_only = isset($instance['with_pics_only']) && $instance['with_pics_only'] ? true : false; |
|
| 263 | - $with_videos_only = isset($instance['with_videos_only']) && $instance['with_videos_only'] ? true : false; |
|
| 264 | - $use_viewing_post_type = isset($instance['use_viewing_post_type']) && $instance['use_viewing_post_type'] ? true : false; |
|
| 260 | + $show_featured_only = isset($instance['show_featured_only']) && $instance['show_featured_only'] ? true : false; |
|
| 261 | + $show_special_only = isset($instance['show_special_only']) && $instance['show_special_only'] ? true : false; |
|
| 262 | + $with_pics_only = isset($instance['with_pics_only']) && $instance['with_pics_only'] ? true : false; |
|
| 263 | + $with_videos_only = isset($instance['with_videos_only']) && $instance['with_videos_only'] ? true : false; |
|
| 264 | + $use_viewing_post_type = isset($instance['use_viewing_post_type']) && $instance['use_viewing_post_type'] ? true : false; |
|
| 265 | 265 | |
| 266 | - ?> |
|
| 266 | + ?> |
|
| 267 | 267 | |
| 268 | 268 | <p> |
| 269 | 269 | <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'geodirectory');?>
|
@@ -298,9 +298,9 @@ discard block |
||
| 298 | 298 | <?php foreach ($postypes as $postypes_obj) { ?>
|
| 299 | 299 | |
| 300 | 300 | <option <?php if ($post_type == $postypes_obj) {
|
| 301 | - echo 'selected="selected"'; |
|
| 302 | - } ?> value="<?php echo $postypes_obj; ?>"><?php $extvalue = explode('_', $postypes_obj);
|
|
| 303 | - echo ucfirst($extvalue[1]); ?></option> |
|
| 301 | + echo 'selected="selected"'; |
|
| 302 | + } ?> value="<?php echo $postypes_obj; ?>"><?php $extvalue = explode('_', $postypes_obj);
|
|
| 303 | + echo ucfirst($extvalue[1]); ?></option> |
|
| 304 | 304 | |
| 305 | 305 | <?php } ?> |
| 306 | 306 | |
@@ -315,30 +315,30 @@ discard block |
||
| 315 | 315 | |
| 316 | 316 | <?php |
| 317 | 317 | |
| 318 | - $post_type = ($post_type != '') ? $post_type : 'gd_place'; |
|
| 318 | + $post_type = ($post_type != '') ? $post_type : 'gd_place'; |
|
| 319 | 319 | |
| 320 | - $all_postypes = geodir_get_posttypes(); |
|
| 320 | + $all_postypes = geodir_get_posttypes(); |
|
| 321 | 321 | |
| 322 | - if (!in_array($post_type, $all_postypes)) |
|
| 323 | - $post_type = 'gd_place'; |
|
| 322 | + if (!in_array($post_type, $all_postypes)) |
|
| 323 | + $post_type = 'gd_place'; |
|
| 324 | 324 | |
| 325 | - $category_taxonomy = geodir_get_taxonomies($post_type); |
|
| 326 | - $categories = get_terms($category_taxonomy, array('orderby' => 'count', 'order' => 'DESC'));
|
|
| 325 | + $category_taxonomy = geodir_get_taxonomies($post_type); |
|
| 326 | + $categories = get_terms($category_taxonomy, array('orderby' => 'count', 'order' => 'DESC'));
|
|
| 327 | 327 | |
| 328 | - ?> |
|
| 328 | + ?> |
|
| 329 | 329 | |
| 330 | 330 | <select multiple="multiple" class="widefat" name="<?php echo $this->get_field_name('category'); ?>[]"
|
| 331 | 331 | onchange="geodir_popular_widget_cat_title(this)"> |
| 332 | 332 | |
| 333 | 333 | <option <?php if (!is_array($category) || (is_array($category) && in_array('0', $category))) {
|
| 334 | - echo 'selected="selected"'; |
|
| 335 | - } ?> value="0"><?php _e('All', 'geodirectory'); ?></option>
|
|
| 334 | + echo 'selected="selected"'; |
|
| 335 | + } ?> value="0"><?php _e('All', 'geodirectory'); ?></option>
|
|
| 336 | 336 | <?php foreach ($categories as $category_obj) {
|
| 337 | - $selected = ''; |
|
| 338 | - if (is_array($category) && in_array($category_obj->term_id, $category)) |
|
| 339 | - echo $selected = 'selected="selected"'; |
|
| 337 | + $selected = ''; |
|
| 338 | + if (is_array($category) && in_array($category_obj->term_id, $category)) |
|
| 339 | + echo $selected = 'selected="selected"'; |
|
| 340 | 340 | |
| 341 | - ?> |
|
| 341 | + ?> |
|
| 342 | 342 | |
| 343 | 343 | <option <?php echo $selected; ?> |
| 344 | 344 | value="<?php echo $category_obj->term_id; ?>"><?php echo ucfirst($category_obj->name); ?></option> |
@@ -363,28 +363,28 @@ discard block |
||
| 363 | 363 | name="<?php echo $this->get_field_name('list_sort'); ?>">
|
| 364 | 364 | |
| 365 | 365 | <option <?php if ($list_sort == 'az') {
|
| 366 | - echo 'selected="selected"'; |
|
| 367 | - } ?> value="az"><?php _e('A-Z', 'geodirectory'); ?></option>
|
|
| 366 | + echo 'selected="selected"'; |
|
| 367 | + } ?> value="az"><?php _e('A-Z', 'geodirectory'); ?></option>
|
|
| 368 | 368 | |
| 369 | 369 | <option <?php if ($list_sort == 'latest') {
|
| 370 | - echo 'selected="selected"'; |
|
| 371 | - } ?> value="latest"><?php _e('Latest', 'geodirectory'); ?></option>
|
|
| 370 | + echo 'selected="selected"'; |
|
| 371 | + } ?> value="latest"><?php _e('Latest', 'geodirectory'); ?></option>
|
|
| 372 | 372 | |
| 373 | 373 | <option <?php if ($list_sort == 'featured') {
|
| 374 | - echo 'selected="selected"'; |
|
| 375 | - } ?> value="featured"><?php _e('Featured', 'geodirectory'); ?></option>
|
|
| 374 | + echo 'selected="selected"'; |
|
| 375 | + } ?> value="featured"><?php _e('Featured', 'geodirectory'); ?></option>
|
|
| 376 | 376 | |
| 377 | 377 | <option <?php if ($list_sort == 'high_review') {
|
| 378 | - echo 'selected="selected"'; |
|
| 379 | - } ?> value="high_review"><?php _e('Review', 'geodirectory'); ?></option>
|
|
| 378 | + echo 'selected="selected"'; |
|
| 379 | + } ?> value="high_review"><?php _e('Review', 'geodirectory'); ?></option>
|
|
| 380 | 380 | |
| 381 | 381 | <option <?php if ($list_sort == 'high_rating') {
|
| 382 | - echo 'selected="selected"'; |
|
| 383 | - } ?> value="high_rating"><?php _e('Rating', 'geodirectory'); ?></option>
|
|
| 382 | + echo 'selected="selected"'; |
|
| 383 | + } ?> value="high_rating"><?php _e('Rating', 'geodirectory'); ?></option>
|
|
| 384 | 384 | |
| 385 | 385 | <option <?php if ($list_sort == 'random') {
|
| 386 | - echo 'selected="selected"'; |
|
| 387 | - } ?> value="random"><?php _e('Random', 'geodirectory'); ?></option>
|
|
| 386 | + echo 'selected="selected"'; |
|
| 387 | + } ?> value="random"><?php _e('Random', 'geodirectory'); ?></option>
|
|
| 388 | 388 | |
| 389 | 389 | </select> |
| 390 | 390 | </label> |
@@ -407,24 +407,24 @@ discard block |
||
| 407 | 407 | <select class="widefat" id="<?php echo $this->get_field_id('layout'); ?>"
|
| 408 | 408 | name="<?php echo $this->get_field_name('layout'); ?>">
|
| 409 | 409 | <option <?php if ($layout == 'gridview_onehalf') {
|
| 410 | - echo 'selected="selected"'; |
|
| 411 | - } ?> |
|
| 410 | + echo 'selected="selected"'; |
|
| 411 | + } ?> |
|
| 412 | 412 | value="gridview_onehalf"><?php _e('Grid View (Two Columns)', 'geodirectory'); ?></option>
|
| 413 | 413 | <option <?php if ($layout == 'gridview_onethird') {
|
| 414 | - echo 'selected="selected"'; |
|
| 415 | - } ?> |
|
| 414 | + echo 'selected="selected"'; |
|
| 415 | + } ?> |
|
| 416 | 416 | value="gridview_onethird"><?php _e('Grid View (Three Columns)', 'geodirectory'); ?></option>
|
| 417 | 417 | <option <?php if ($layout == 'gridview_onefourth') {
|
| 418 | - echo 'selected="selected"'; |
|
| 419 | - } ?> |
|
| 418 | + echo 'selected="selected"'; |
|
| 419 | + } ?> |
|
| 420 | 420 | value="gridview_onefourth"><?php _e('Grid View (Four Columns)', 'geodirectory'); ?></option>
|
| 421 | 421 | <option <?php if ($layout == 'gridview_onefifth') {
|
| 422 | - echo 'selected="selected"'; |
|
| 423 | - } ?> |
|
| 422 | + echo 'selected="selected"'; |
|
| 423 | + } ?> |
|
| 424 | 424 | value="gridview_onefifth"><?php _e('Grid View (Five Columns)', 'geodirectory'); ?></option>
|
| 425 | 425 | <option <?php if ($layout == 'list') {
|
| 426 | - echo 'selected="selected"'; |
|
| 427 | - } ?> value="list"><?php _e('List view', 'geodirectory'); ?></option>
|
|
| 426 | + echo 'selected="selected"'; |
|
| 427 | + } ?> value="list"><?php _e('List view', 'geodirectory'); ?></option>
|
|
| 428 | 428 | |
| 429 | 429 | </select> |
| 430 | 430 | </label> |
@@ -494,8 +494,8 @@ discard block |
||
| 494 | 494 | for="<?php echo $this->get_field_id('use_viewing_post_type'); ?>"><?php _e('Use current viewing post type:', 'geodirectory'); ?>
|
| 495 | 495 | <input type="checkbox" id="<?php echo $this->get_field_id('use_viewing_post_type'); ?>"
|
| 496 | 496 | name="<?php echo $this->get_field_name('use_viewing_post_type'); ?>" <?php if ($use_viewing_post_type) {
|
| 497 | - echo 'checked="checked"'; |
|
| 498 | - } ?> value="1"/> |
|
| 497 | + echo 'checked="checked"'; |
|
| 498 | + } ?> value="1"/> |
|
| 499 | 499 | </label> |
| 500 | 500 | </p> |
| 501 | 501 | |
@@ -539,7 +539,7 @@ discard block |
||
| 539 | 539 | </script> |
| 540 | 540 | |
| 541 | 541 | <?php |
| 542 | - } |
|
| 542 | + } |
|
| 543 | 543 | } // class geodir_popular_postview |
| 544 | 544 | |
| 545 | 545 | register_widget('geodir_popular_postview'); |
| 546 | 546 | \ No newline at end of file |