Completed
Pull Request — master (#208)
by Kiran
08:04
created
geodirectory-admin/admin_db_install.php 1 patch
Indentation   +295 added lines, -295 removed lines patch added patch discarded remove patch
@@ -6,26 +6,26 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
Please login to merge, or discard this patch.
geodirectory-admin/admin_hooks_actions.php 1 patch
Indentation   +1305 added lines, -1305 removed lines patch added patch discarded remove patch
@@ -1,42 +1,42 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * GeoDirectory Admin.
4
- *
5
- * Main admin file which loads all settings panels and sets up admin menus.
6
- *
7
- * @since 1.0.0
8
- * @package GeoDirectory
9
- */
3
+	 * GeoDirectory Admin.
4
+	 *
5
+	 * Main admin file which loads all settings panels and sets up admin menus.
6
+	 *
7
+	 * @since 1.0.0
8
+	 * @package GeoDirectory
9
+	 */
10 10
 
11 11
 add_action('admin_init', 'geodir_admin_init');
12 12
 if (!function_exists('geodir_admin_init')) {
13
-    /**
14
-     * Adds GD setting pages in admin.
15
-     *
16
-     * @since 1.0.0
17
-     * @package GeoDirectory
18
-     * @global string $current_tab The current settings tab name.
19
-     */
20
-    function geodir_admin_init()
21
-    {
22
-
23
-        if (is_admin()):
24
-            global $current_tab;
25
-            geodir_redirect_to_admin_panel_on_installed();
26
-            $current_tab = (isset($_GET['tab']) && $_GET['tab'] != '') ? $_GET['tab'] : 'general_settings';
27
-            if (!(isset($_REQUEST['action']))) // this will avoide Ajax requests
28
-                geodir_handle_option_form_submit($current_tab); // located in admin function.php
29
-            /**
30
-             * Called on the WordPress 'admin_init' hook this hookis used to call everything for the GD settings pages in the admin area.
31
-             *
32
-             * @since 1.0.0
33
-             */
34
-            do_action('admin_panel_init');
35
-            add_action('geodir_admin_option_form', 'geodir_get_admin_option_form', 1);
36
-
37
-
38
-        endif;
39
-    }
13
+	/**
14
+	 * Adds GD setting pages in admin.
15
+	 *
16
+	 * @since 1.0.0
17
+	 * @package GeoDirectory
18
+	 * @global string $current_tab The current settings tab name.
19
+	 */
20
+	function geodir_admin_init()
21
+	{
22
+
23
+		if (is_admin()):
24
+			global $current_tab;
25
+			geodir_redirect_to_admin_panel_on_installed();
26
+			$current_tab = (isset($_GET['tab']) && $_GET['tab'] != '') ? $_GET['tab'] : 'general_settings';
27
+			if (!(isset($_REQUEST['action']))) // this will avoide Ajax requests
28
+				geodir_handle_option_form_submit($current_tab); // located in admin function.php
29
+			/**
30
+			 * Called on the WordPress 'admin_init' hook this hookis used to call everything for the GD settings pages in the admin area.
31
+			 *
32
+			 * @since 1.0.0
33
+			 */
34
+			do_action('admin_panel_init');
35
+			add_action('geodir_admin_option_form', 'geodir_get_admin_option_form', 1);
36
+
37
+
38
+		endif;
39
+	}
40 40
 }
41 41
 
42 42
 /**
@@ -47,10 +47,10 @@  discard block
 block discarded – undo
47 47
  */
48 48
 function geodir_redirect_to_admin_panel_on_installed()
49 49
 {
50
-    if (get_option('geodir_installation_redirect', false)) {
51
-        delete_option('geodir_installation_redirect');
52
-        wp_redirect(admin_url('admin.php?page=geodirectory&installed=yes'));
53
-    }
50
+	if (get_option('geodir_installation_redirect', false)) {
51
+		delete_option('geodir_installation_redirect');
52
+		wp_redirect(admin_url('admin.php?page=geodirectory&installed=yes'));
53
+	}
54 54
 }
55 55
 
56 56
 /**
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
  */
63 63
 function geodir_get_admin_option_form($current_tab)
64 64
 {
65
-    geodir_admin_option_form($current_tab);// defined in admin template tags.php
65
+	geodir_admin_option_form($current_tab);// defined in admin template tags.php
66 66
 }
67 67
 
68 68
 
@@ -83,18 +83,18 @@  discard block
 block discarded – undo
83 83
  */
84 84
 function geodir_conditional_admin_script_load()
85 85
 {
86
-    global $pagenow;
86
+	global $pagenow;
87 87
 	
88 88
 	// Get the current post type
89 89
 	$post_type = geodir_admin_current_post_type();
90 90
 	$geodir_post_types = geodir_get_posttypes();
91 91
     
92 92
 	if ((isset($_REQUEST['page']) && $_REQUEST['page'] == 'geodirectory') || (($pagenow == 'post.php' || $pagenow == 'post-new.php' || $pagenow == 'edit.php') && $post_type && in_array($post_type, $geodir_post_types)) || ($pagenow == 'edit-tags.php' || $pagenow == 'edit-comments.php' || $pagenow == 'comment.php')) {
93
-        add_action('admin_enqueue_scripts', 'geodir_admin_scripts');
94
-        add_action('admin_enqueue_scripts', 'geodir_admin_styles');
95
-    }
93
+		add_action('admin_enqueue_scripts', 'geodir_admin_scripts');
94
+		add_action('admin_enqueue_scripts', 'geodir_admin_styles');
95
+	}
96 96
 
97
-    add_action('admin_enqueue_scripts', 'geodir_admin_styles_req');
97
+	add_action('admin_enqueue_scripts', 'geodir_admin_styles_req');
98 98
 
99 99
 }
100 100
 
@@ -128,12 +128,12 @@  discard block
 block discarded – undo
128 128
  */
129 129
 function create_default_admin_main_nav()
130 130
 {
131
-    add_filter('geodir_settings_tabs_array', 'geodir_default_admin_main_tabs', 1);
132
-    add_filter('geodir_settings_tabs_array', 'places_custom_fields_tab', 2);
133
-    add_filter('geodir_settings_tabs_array', 'geodir_compatibility_setting_tab', 90);
134
-    add_filter('geodir_settings_tabs_array', 'geodir_tools_setting_tab', 95);
135
-    add_filter('geodir_settings_tabs_array', 'geodir_extend_geodirectory_setting_tab', 100);
136
-    //add_filter('geodir_settings_tabs_array', 'geodir_hide_set_location_default',3);
131
+	add_filter('geodir_settings_tabs_array', 'geodir_default_admin_main_tabs', 1);
132
+	add_filter('geodir_settings_tabs_array', 'places_custom_fields_tab', 2);
133
+	add_filter('geodir_settings_tabs_array', 'geodir_compatibility_setting_tab', 90);
134
+	add_filter('geodir_settings_tabs_array', 'geodir_tools_setting_tab', 95);
135
+	add_filter('geodir_settings_tabs_array', 'geodir_extend_geodirectory_setting_tab', 100);
136
+	//add_filter('geodir_settings_tabs_array', 'geodir_hide_set_location_default',3);
137 137
 
138 138
 }
139 139
 
@@ -146,16 +146,16 @@  discard block
 block discarded – undo
146 146
  */
147 147
 function geodir_admin_list_columns()
148 148
 {
149
-    if ($post_types = geodir_get_posttypes()) {
149
+	if ($post_types = geodir_get_posttypes()) {
150 150
 
151
-        foreach ($post_types as $post_type):
152
-            add_filter("manage_edit-{$post_type}_columns", 'geodir_edit_post_columns', 100);
153
-            //Filter-Payment-Manager to show Package
154
-            add_action("manage_{$post_type}_posts_custom_column", 'geodir_manage_post_columns', 10, 2);
151
+		foreach ($post_types as $post_type):
152
+			add_filter("manage_edit-{$post_type}_columns", 'geodir_edit_post_columns', 100);
153
+			//Filter-Payment-Manager to show Package
154
+			add_action("manage_{$post_type}_posts_custom_column", 'geodir_manage_post_columns', 10, 2);
155 155
 
156
-            add_filter("manage_edit-{$post_type}_sortable_columns", 'geodir_post_sortable_columns');
157
-        endforeach;
158
-    }
156
+			add_filter("manage_edit-{$post_type}_sortable_columns", 'geodir_post_sortable_columns');
157
+		endforeach;
158
+	}
159 159
 }
160 160
 
161 161
 /**
@@ -168,15 +168,15 @@  discard block
 block discarded – undo
168 168
  */
169 169
 function geodir_default_admin_main_tabs($tabs)
170 170
 {
171
-    return $tabs = array(
172
-        'general_settings' => array('label' => __('General', 'geodirectory')),
173
-        'design_settings' => array('label' => __('Design', 'geodirectory')),
174
-        'permalink_settings' => array('label' => __('Permalinks', 'geodirectory')),
175
-        'title_meta_settings' => array('label' => __('Titles & Metas', 'geodirectory')),
176
-        'notifications_settings' => array('label' => __('Notifications', 'geodirectory')),
177
-        'default_location_settings' => array('label' => __('Set Default Location', 'geodirectory')),
178
-
179
-    );
171
+	return $tabs = array(
172
+		'general_settings' => array('label' => __('General', 'geodirectory')),
173
+		'design_settings' => array('label' => __('Design', 'geodirectory')),
174
+		'permalink_settings' => array('label' => __('Permalinks', 'geodirectory')),
175
+		'title_meta_settings' => array('label' => __('Titles & Metas', 'geodirectory')),
176
+		'notifications_settings' => array('label' => __('Notifications', 'geodirectory')),
177
+		'default_location_settings' => array('label' => __('Set Default Location', 'geodirectory')),
178
+
179
+	);
180 180
 }
181 181
 
182 182
 add_action('do_meta_boxes', 'geodir_remove_image_box');
@@ -189,16 +189,16 @@  discard block
 block discarded – undo
189 189
  */
190 190
 function geodir_remove_image_box()
191 191
 {
192
-    global $post;
192
+	global $post;
193 193
 
194
-    $geodir_posttypes = geodir_get_posttypes();
194
+	$geodir_posttypes = geodir_get_posttypes();
195 195
 
196
-    if (isset($post) && in_array($post->post_type, $geodir_posttypes)):
196
+	if (isset($post) && in_array($post->post_type, $geodir_posttypes)):
197 197
 
198
-        remove_meta_box('postimagediv', $post->post_type, 'side');
199
-        remove_meta_box('revisionsdiv', $post->post_type, 'normal');
198
+		remove_meta_box('postimagediv', $post->post_type, 'side');
199
+		remove_meta_box('revisionsdiv', $post->post_type, 'normal');
200 200
 
201
-    endif;
201
+	endif;
202 202
 
203 203
 }
204 204
 
@@ -213,26 +213,26 @@  discard block
 block discarded – undo
213 213
  */
214 214
 function geodir_meta_box_add()
215 215
 {
216
-    global $post;
216
+	global $post;
217 217
 
218
-    $geodir_post_types = geodir_get_posttypes('array');
219
-    $geodir_posttypes = array_keys($geodir_post_types);
218
+	$geodir_post_types = geodir_get_posttypes('array');
219
+	$geodir_posttypes = array_keys($geodir_post_types);
220 220
 
221
-    if (isset($post->post_type) && in_array($post->post_type, $geodir_posttypes)):
221
+	if (isset($post->post_type) && in_array($post->post_type, $geodir_posttypes)):
222 222
 
223
-        $geodir_posttype = $post->post_type;
224
-        $post_typename = geodir_ucwords($geodir_post_types[$geodir_posttype]['labels']['singular_name']);
223
+		$geodir_posttype = $post->post_type;
224
+		$post_typename = geodir_ucwords($geodir_post_types[$geodir_posttype]['labels']['singular_name']);
225 225
 
226
-        // Filter-Payment-Manager
226
+		// Filter-Payment-Manager
227 227
 
228
-        add_meta_box('geodir_post_images', $post_typename . ' ' . __('Attachments', 'geodirectory'), 'geodir_post_attachments', $geodir_posttype, 'side');
228
+		add_meta_box('geodir_post_images', $post_typename . ' ' . __('Attachments', 'geodirectory'), 'geodir_post_attachments', $geodir_posttype, 'side');
229 229
 
230
-        add_meta_box('geodir_post_info', $post_typename . ' ' . __('Information', 'geodirectory'), 'geodir_post_info_setting', $geodir_posttype, 'normal', 'high');
230
+		add_meta_box('geodir_post_info', $post_typename . ' ' . __('Information', 'geodirectory'), 'geodir_post_info_setting', $geodir_posttype, 'normal', 'high');
231 231
 
232
-        // no need of this box as all fields moved to main informain box
233
-        //add_meta_box( 'geodir_post_addinfo', $post_typename. ' ' .__('Additional Information' , 'geodirectory'), 'geodir_post_addinfo_setting', $geodir_posttype,'normal', 'high' );
232
+		// no need of this box as all fields moved to main informain box
233
+		//add_meta_box( 'geodir_post_addinfo', $post_typename. ' ' .__('Additional Information' , 'geodirectory'), 'geodir_post_addinfo_setting', $geodir_posttype,'normal', 'high' );
234 234
 
235
-    endif;
235
+	endif;
236 236
 
237 237
 }
238 238
 
@@ -256,23 +256,23 @@  discard block
 block discarded – undo
256 256
 function geodir_hide_post_taxonomy_meta_boxes()
257 257
 {
258 258
 
259
-    $geodir_post_types = get_option('geodir_post_types');
259
+	$geodir_post_types = get_option('geodir_post_types');
260 260
 
261
-    if (!empty($geodir_post_types)) {
262
-        foreach ($geodir_post_types as $geodir_post_type => $geodir_posttype_info) {
261
+	if (!empty($geodir_post_types)) {
262
+		foreach ($geodir_post_types as $geodir_post_type => $geodir_posttype_info) {
263 263
 
264
-            $gd_taxonomy = geodir_get_taxonomies($geodir_post_type);
264
+			$gd_taxonomy = geodir_get_taxonomies($geodir_post_type);
265 265
 
266
-            if(!empty($gd_taxonomy)) {
267
-                foreach ($gd_taxonomy as $tax) {
266
+			if(!empty($gd_taxonomy)) {
267
+				foreach ($gd_taxonomy as $tax) {
268 268
 
269
-                    remove_meta_box($tax . 'div', $geodir_post_type, 'normal');
269
+					remove_meta_box($tax . 'div', $geodir_post_type, 'normal');
270 270
 
271
-                }
272
-            }
271
+				}
272
+			}
273 273
 
274
-        }
275
-    }
274
+		}
275
+	}
276 276
 }
277 277
 
278 278
 add_filter('geodir_add_listing_map_restrict', 'geodir_add_listing_map_restrict');
@@ -286,12 +286,12 @@  discard block
 block discarded – undo
286 286
  */
287 287
 function geodir_add_listing_map_restrict($map_restirct)
288 288
 {
289
-    if (is_admin()) {
290
-        if (isset($_REQUEST['tab']) && $_REQUEST['tab'] == 'default_location_settings') {
291
-            $map_restirct = false;
292
-        }
293
-    }
294
-    return $map_restirct;
289
+	if (is_admin()) {
290
+		if (isset($_REQUEST['tab']) && $_REQUEST['tab'] == 'default_location_settings') {
291
+			$map_restirct = false;
292
+		}
293
+	}
294
+	return $map_restirct;
295 295
 }
296 296
 
297 297
 
@@ -310,16 +310,16 @@  discard block
 block discarded – undo
310 310
 function geodir_enable_editor_on_notifications($notification)
311 311
 {
312 312
 
313
-    if (!empty($notification) && get_option('geodir_tiny_editor') == '1') {
313
+	if (!empty($notification) && get_option('geodir_tiny_editor') == '1') {
314 314
 
315
-        foreach ($notification as $key => $value) {
316
-            if ($value['type'] == 'textarea')
317
-                $notification[$key]['type'] = 'editor';
318
-        }
315
+		foreach ($notification as $key => $value) {
316
+			if ($value['type'] == 'textarea')
317
+				$notification[$key]['type'] = 'editor';
318
+		}
319 319
 
320
-    }
320
+	}
321 321
 
322
-    return $notification;
322
+	return $notification;
323 323
 }
324 324
 
325 325
 
@@ -336,16 +336,16 @@  discard block
 block discarded – undo
336 336
 function geodir_enable_editor_on_design_settings($design_setting)
337 337
 {
338 338
 
339
-    if (!empty($design_setting) && get_option('geodir_tiny_editor') == '1') {
339
+	if (!empty($design_setting) && get_option('geodir_tiny_editor') == '1') {
340 340
 
341
-        foreach ($design_setting as $key => $value) {
342
-            if ($value['type'] == 'textarea' && $value['id'] == 'geodir_term_condition_content')
343
-                $design_setting[$key]['type'] = 'editor';
344
-        }
341
+		foreach ($design_setting as $key => $value) {
342
+			if ($value['type'] == 'textarea' && $value['id'] == 'geodir_term_condition_content')
343
+				$design_setting[$key]['type'] = 'editor';
344
+		}
345 345
 
346
-    }
346
+	}
347 347
 
348
-    return $design_setting;
348
+	return $design_setting;
349 349
 }
350 350
 
351 351
 /* ----------- START MANAGE CUSTOM FIELDS ---------------- */
@@ -366,16 +366,16 @@  discard block
 block discarded – undo
366 366
 function geodir_manage_available_fields($sub_tab)
367 367
 {
368 368
 
369
-    switch ($sub_tab) {
370
-        case 'custom_fields':
371
-            geodir_custom_available_fields();
372
-            break;
369
+	switch ($sub_tab) {
370
+		case 'custom_fields':
371
+			geodir_custom_available_fields();
372
+			break;
373 373
 
374
-        case 'sorting_options':
375
-            geodir_sorting_options_available_fields();
376
-            break;
374
+		case 'sorting_options':
375
+			geodir_sorting_options_available_fields();
376
+			break;
377 377
 
378
-    }
378
+	}
379 379
 }
380 380
 
381 381
 
@@ -391,16 +391,16 @@  discard block
 block discarded – undo
391 391
 function geodir_manage_selected_fields($sub_tab)
392 392
 {
393 393
 
394
-    switch ($sub_tab) {
395
-        case 'custom_fields':
396
-            geodir_custom_selected_fields();
397
-            break;
394
+	switch ($sub_tab) {
395
+		case 'custom_fields':
396
+			geodir_custom_selected_fields();
397
+			break;
398 398
 
399
-        case 'sorting_options':
400
-            geodir_sorting_options_selected_fields();
401
-            break;
399
+		case 'sorting_options':
400
+			geodir_sorting_options_selected_fields();
401
+			break;
402 402
 
403
-    }
403
+	}
404 404
 }
405 405
 
406 406
 /**
@@ -412,27 +412,27 @@  discard block
 block discarded – undo
412 412
  */
413 413
 function geodir_sorting_options_available_fields()
414 414
 {
415
-    global $wpdb;
416
-    $listing_type = ($_REQUEST['listing_type'] != '') ? sanitize_text_field($_REQUEST['listing_type']) : 'gd_place';
417
-    ?>
415
+	global $wpdb;
416
+	$listing_type = ($_REQUEST['listing_type'] != '') ? sanitize_text_field($_REQUEST['listing_type']) : 'gd_place';
417
+	?>
418 418
     <input type="hidden" name="listing_type" id="new_post_type" value="<?php echo $listing_type;?>"/>
419 419
     <input type="hidden" name="manage_field_type" class="manage_field_type" value="<?php echo sanitize_text_field($_REQUEST['subtab']); ?>"/>
420 420
     <ul>
421 421
     <?php
422
-        $sort_options = geodir_get_custom_sort_options($listing_type);
422
+		$sort_options = geodir_get_custom_sort_options($listing_type);
423 423
         
424
-        foreach ($sort_options as $key => $val) {
425
-            $val = stripslashes_deep($val); // strip slashes
426
-
427
-            $check_html_variable = $wpdb->get_var(
428
-                $wpdb->prepare(
429
-                    "SELECT htmlvar_name FROM " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " WHERE htmlvar_name = %s AND post_type = %s AND field_type=%s",
430
-                    array($val['htmlvar_name'], $listing_type, $val['field_type'])
431
-                )
432
-            );
424
+		foreach ($sort_options as $key => $val) {
425
+			$val = stripslashes_deep($val); // strip slashes
426
+
427
+			$check_html_variable = $wpdb->get_var(
428
+				$wpdb->prepare(
429
+					"SELECT htmlvar_name FROM " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " WHERE htmlvar_name = %s AND post_type = %s AND field_type=%s",
430
+					array($val['htmlvar_name'], $listing_type, $val['field_type'])
431
+				)
432
+			);
433 433
             
434
-            $display = $check_html_variable ? ' style="display:none;"' : '';
435
-            ?>
434
+			$display = $check_html_variable ? ' style="display:none;"' : '';
435
+			?>
436 436
             <li <?php echo $display;?>>
437 437
             <a id="gt-<?php echo $val['field_type'];?>-_-<?php echo $val['htmlvar_name'];?>"
438 438
                title="<?php echo $val['site_title'];?>"
@@ -440,8 +440,8 @@  discard block
 block discarded – undo
440 440
                href="javascript:void(0);"><b></b><?php _e($val['site_title'], 'geodirectory');?></a>
441 441
             </li>
442 442
             <?php
443
-        }
444
-    ?>
443
+		}
444
+	?>
445 445
     </ul>
446 446
     <?php
447 447
 }
@@ -455,28 +455,28 @@  discard block
 block discarded – undo
455 455
  */
456 456
 function geodir_sorting_options_selected_fields()
457 457
 {
458
-    $listing_type = ($_REQUEST['listing_type'] != '') ? sanitize_text_field($_REQUEST['listing_type']) : 'gd_place';
459
-    ?>
458
+	$listing_type = ($_REQUEST['listing_type'] != '') ? sanitize_text_field($_REQUEST['listing_type']) : 'gd_place';
459
+	?>
460 460
     <input type="hidden" name="manage_field_type" class="manage_field_type" value="<?php echo sanitize_text_field($_REQUEST['subtab']); ?>"/>
461 461
     <ul class="core">
462 462
     <?php 
463
-        global $wpdb;
463
+		global $wpdb;
464 464
         
465
-        $fields = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " WHERE post_type = %s AND field_type != 'address' ORDER BY sort_order ASC", array($listing_type)));
465
+		$fields = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . GEODIR_CUSTOM_SORT_FIELDS_TABLE . " WHERE post_type = %s AND field_type != 'address' ORDER BY sort_order ASC", array($listing_type)));
466 466
 
467
-        if (!empty($fields)) {
468
-            foreach ($fields as $field) {
469
-                //$result_str = $field->id;
470
-                $result_str = $field;
471
-                $field_type = $field->field_type;
472
-                $field_ins_upd = 'display';
467
+		if (!empty($fields)) {
468
+			foreach ($fields as $field) {
469
+				//$result_str = $field->id;
470
+				$result_str = $field;
471
+				$field_type = $field->field_type;
472
+				$field_ins_upd = 'display';
473 473
 
474
-                $default = false;
474
+				$default = false;
475 475
 
476
-                geodir_custom_sort_field_adminhtml($field_type, $result_str, $field_ins_upd, $default);
477
-            }
478
-        }
479
-    ?>
476
+				geodir_custom_sort_field_adminhtml($field_type, $result_str, $field_ins_upd, $default);
477
+			}
478
+		}
479
+	?>
480 480
     </ul>
481 481
     <?php
482 482
 }
@@ -489,8 +489,8 @@  discard block
 block discarded – undo
489 489
  */
490 490
 function geodir_custom_available_fields()
491 491
 {
492
-    $listing_type = ($_REQUEST['listing_type'] != '') ? sanitize_text_field($_REQUEST['listing_type']) : 'gd_place';
493
-    ?>
492
+	$listing_type = ($_REQUEST['listing_type'] != '') ? sanitize_text_field($_REQUEST['listing_type']) : 'gd_place';
493
+	?>
494 494
     <input type="hidden" name="listing_type" id="new_post_type" value="<?php echo $listing_type;?>"/>
495 495
     <input type="hidden" name="manage_field_type" class="manage_field_type" value="<?php echo sanitize_text_field($_REQUEST['subtab']); ?>"/>
496 496
     <ul class="full">
@@ -541,25 +541,25 @@  discard block
 block discarded – undo
541 541
  */
542 542
 function geodir_custom_selected_fields()
543 543
 {
544
-    $listing_type = ($_REQUEST['listing_type'] != '') ? sanitize_text_field($_REQUEST['listing_type']) : 'gd_place';
545
-    ?>
544
+	$listing_type = ($_REQUEST['listing_type'] != '') ? sanitize_text_field($_REQUEST['listing_type']) : 'gd_place';
545
+	?>
546 546
     <input type="hidden" name="manage_field_type" class="manage_field_type" value="<?php echo sanitize_text_field($_REQUEST['subtab']); ?>"/>
547 547
     <ul class="core">
548 548
     <?php 
549
-        global $wpdb;
550
-        $fields = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . GEODIR_CUSTOM_FIELDS_TABLE . " WHERE post_type = %s ORDER BY sort_order ASC", array($listing_type)));
551
-
552
-        if (!empty($fields)) {
553
-            foreach ($fields as $field) {
554
-                //$result_str = $field->id;
555
-                $result_str = $field;
556
-                $field_type = $field->field_type;
557
-                $field_ins_upd = 'display';
558
-
559
-                geodir_custom_field_adminhtml($field_type, $result_str, $field_ins_upd);
560
-            }
561
-        }
562
-        ?></ul>
549
+		global $wpdb;
550
+		$fields = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . GEODIR_CUSTOM_FIELDS_TABLE . " WHERE post_type = %s ORDER BY sort_order ASC", array($listing_type)));
551
+
552
+		if (!empty($fields)) {
553
+			foreach ($fields as $field) {
554
+				//$result_str = $field->id;
555
+				$result_str = $field;
556
+				$field_type = $field->field_type;
557
+				$field_ins_upd = 'display';
558
+
559
+				geodir_custom_field_adminhtml($field_type, $result_str, $field_ins_upd);
560
+			}
561
+		}
562
+		?></ul>
563 563
 <?php
564 564
 
565 565
 }
@@ -578,16 +578,16 @@  discard block
 block discarded – undo
578 578
 function geodir_custom_fields_panel_head($heading, $sub_tab, $listing_type)
579 579
 {
580 580
 
581
-    switch ($sub_tab) {
582
-        case 'custom_fields':
583
-            $heading = sprintf(__('Manage %s Custom Fields', 'geodirectory'), get_post_type_singular_label($listing_type));
584
-            break;
581
+	switch ($sub_tab) {
582
+		case 'custom_fields':
583
+			$heading = sprintf(__('Manage %s Custom Fields', 'geodirectory'), get_post_type_singular_label($listing_type));
584
+			break;
585 585
 
586
-        case 'sorting_options':
587
-            $heading = sprintf(__('Manage %s Listing Sorting Options Fields', 'geodirectory'), get_post_type_singular_label($listing_type));
588
-            break;
589
-    }
590
-    return $heading;
586
+		case 'sorting_options':
587
+			$heading = sprintf(__('Manage %s Listing Sorting Options Fields', 'geodirectory'), get_post_type_singular_label($listing_type));
588
+			break;
589
+	}
590
+	return $heading;
591 591
 }
592 592
 
593 593
 
@@ -605,16 +605,16 @@  discard block
 block discarded – undo
605 605
 function geodir_cf_panel_available_fields_head($heading, $sub_tab, $listing_type)
606 606
 {
607 607
 
608
-    switch ($sub_tab) {
609
-        case 'custom_fields':
610
-            $heading = sprintf(__('Add new %s form field', 'geodirectory'), get_post_type_singular_label($listing_type));
611
-            break;
608
+	switch ($sub_tab) {
609
+		case 'custom_fields':
610
+			$heading = sprintf(__('Add new %s form field', 'geodirectory'), get_post_type_singular_label($listing_type));
611
+			break;
612 612
 
613
-        case 'sorting_options':
614
-            $heading = sprintf(__('Available sorting options for %s listing and search results', 'geodirectory'), get_post_type_singular_label($listing_type));
615
-            break;
616
-    }
617
-    return $heading;
613
+		case 'sorting_options':
614
+			$heading = sprintf(__('Available sorting options for %s listing and search results', 'geodirectory'), get_post_type_singular_label($listing_type));
615
+			break;
616
+	}
617
+	return $heading;
618 618
 }
619 619
 
620 620
 
@@ -632,16 +632,16 @@  discard block
 block discarded – undo
632 632
 function geodir_cf_panel_available_fields_note($note, $sub_tab, $listing_type)
633 633
 {
634 634
 
635
-    switch ($sub_tab) {
636
-        case 'custom_fields':
637
-            $note = sprintf(__('Click on any box below to add a field of that type on add %s listing form. You must be use a fieldset to group your fields.', 'geodirectory'), get_post_type_singular_label($listing_type));;
638
-            break;
635
+	switch ($sub_tab) {
636
+		case 'custom_fields':
637
+			$note = sprintf(__('Click on any box below to add a field of that type on add %s listing form. You must be use a fieldset to group your fields.', 'geodirectory'), get_post_type_singular_label($listing_type));;
638
+			break;
639 639
 
640
-        case 'sorting_options':
641
-            $note = sprintf(__('Click on any box below to make it appear in sorting option dropdown on %s listing and search results.<br />To make a field available here, go to custom fields tab and expand any field from selected fields panel and tick the checkbox saying \'Include this field in sort option\'.', 'geodirectory'), get_post_type_singular_label($listing_type));
642
-            break;
643
-    }
644
-    return $note;
640
+		case 'sorting_options':
641
+			$note = sprintf(__('Click on any box below to make it appear in sorting option dropdown on %s listing and search results.<br />To make a field available here, go to custom fields tab and expand any field from selected fields panel and tick the checkbox saying \'Include this field in sort option\'.', 'geodirectory'), get_post_type_singular_label($listing_type));
642
+			break;
643
+	}
644
+	return $note;
645 645
 }
646 646
 
647 647
 
@@ -659,16 +659,16 @@  discard block
 block discarded – undo
659 659
 function geodir_cf_panel_selected_fields_head($heading, $sub_tab, $listing_type)
660 660
 {
661 661
 
662
-    switch ($sub_tab) {
663
-        case 'custom_fields':
664
-            $heading = sprintf(__('List of fields those will appear on add new %s listing form', 'geodirectory'), get_post_type_singular_label($listing_type));
665
-            break;
662
+	switch ($sub_tab) {
663
+		case 'custom_fields':
664
+			$heading = sprintf(__('List of fields those will appear on add new %s listing form', 'geodirectory'), get_post_type_singular_label($listing_type));
665
+			break;
666 666
 
667
-        case 'sorting_options':
668
-            $heading = sprintf(__('List of fields those will appear in %s listing and search resutls sorting option dropdown box.', 'geodirectory'), get_post_type_singular_label($listing_type));
669
-            break;
670
-    }
671
-    return $heading;
667
+		case 'sorting_options':
668
+			$heading = sprintf(__('List of fields those will appear in %s listing and search resutls sorting option dropdown box.', 'geodirectory'), get_post_type_singular_label($listing_type));
669
+			break;
670
+	}
671
+	return $heading;
672 672
 }
673 673
 
674 674
 
@@ -686,16 +686,16 @@  discard block
 block discarded – undo
686 686
 function geodir_cf_panel_selected_fields_note($note, $sub_tab, $listing_type)
687 687
 {
688 688
 
689
-    switch ($sub_tab) {
690
-        case 'custom_fields':
691
-            $note = sprintf(__('Click to expand and view field related settings. You may drag and drop to arrange fields order on add %s listing form too.', 'geodirectory'), get_post_type_singular_label($listing_type));;
692
-            break;
689
+	switch ($sub_tab) {
690
+		case 'custom_fields':
691
+			$note = sprintf(__('Click to expand and view field related settings. You may drag and drop to arrange fields order on add %s listing form too.', 'geodirectory'), get_post_type_singular_label($listing_type));;
692
+			break;
693 693
 
694
-        case 'sorting_options':
695
-            $note = sprintf(__('Click to expand and view field related settings. You may drag and drop to arrange fields order in sorting option dropdown box on %s listing and search results page.', 'geodirectory'), get_post_type_singular_label($listing_type));
696
-            break;
697
-    }
698
-    return $note;
694
+		case 'sorting_options':
695
+			$note = sprintf(__('Click to expand and view field related settings. You may drag and drop to arrange fields order in sorting option dropdown box on %s listing and search results page.', 'geodirectory'), get_post_type_singular_label($listing_type));
696
+			break;
697
+	}
698
+	return $note;
699 699
 }
700 700
 
701 701
 
@@ -711,16 +711,16 @@  discard block
 block discarded – undo
711 711
  */
712 712
 function geodir_remove_unnecessary_fields()
713 713
 {
714
-    global $wpdb, $plugin_prefix;
714
+	global $wpdb, $plugin_prefix;
715 715
 
716
-    if (!get_option('geodir_remove_unnecessary_fields')) {
716
+	if (!get_option('geodir_remove_unnecessary_fields')) {
717 717
 
718
-        if ($wpdb->get_var("SHOW COLUMNS FROM " . $plugin_prefix . "gd_place_detail WHERE field = 'categories'"))
719
-            $wpdb->query("ALTER TABLE `" . $plugin_prefix . "gd_place_detail` DROP `categories`");
718
+		if ($wpdb->get_var("SHOW COLUMNS FROM " . $plugin_prefix . "gd_place_detail WHERE field = 'categories'"))
719
+			$wpdb->query("ALTER TABLE `" . $plugin_prefix . "gd_place_detail` DROP `categories`");
720 720
 
721
-        update_option('geodir_remove_unnecessary_fields', '1');
721
+		update_option('geodir_remove_unnecessary_fields', '1');
722 722
 
723
-    }
723
+	}
724 724
 
725 725
 }
726 726
 
@@ -738,25 +738,25 @@  discard block
 block discarded – undo
738 738
  */
739 739
 function geodir_admin_ajax_handler()
740 740
 {
741
-    if (isset($_REQUEST['geodir_admin_ajax_action']) && $_REQUEST['geodir_admin_ajax_action'] != '') {
742
-        $geodir_admin_ajax_action = $_REQUEST['geodir_admin_ajax_action'];
743
-        switch ($geodir_admin_ajax_action) {
744
-            case 'diagnosis' :
745
-                if (isset($_REQUEST['diagnose_this']) && $_REQUEST['diagnose_this'] != '')
746
-                    $diagnose_this = sanitize_text_field($_REQUEST['diagnose_this']);
747
-                call_user_func('geodir_diagnose_' . $diagnose_this);
748
-                exit();
749
-                break;
750
-
751
-            case 'diagnosis-fix' :
752
-                if (isset($_REQUEST['diagnose_this']) && $_REQUEST['diagnose_this'] != '')
753
-                    $diagnose_this = sanitize_text_field($_REQUEST['diagnose_this']);
754
-                call_user_func('geodir_diagnose_' . $diagnose_this);
755
-                exit();
756
-                break;
757
-        }
758
-    }
759
-    exit();
741
+	if (isset($_REQUEST['geodir_admin_ajax_action']) && $_REQUEST['geodir_admin_ajax_action'] != '') {
742
+		$geodir_admin_ajax_action = $_REQUEST['geodir_admin_ajax_action'];
743
+		switch ($geodir_admin_ajax_action) {
744
+			case 'diagnosis' :
745
+				if (isset($_REQUEST['diagnose_this']) && $_REQUEST['diagnose_this'] != '')
746
+					$diagnose_this = sanitize_text_field($_REQUEST['diagnose_this']);
747
+				call_user_func('geodir_diagnose_' . $diagnose_this);
748
+				exit();
749
+				break;
750
+
751
+			case 'diagnosis-fix' :
752
+				if (isset($_REQUEST['diagnose_this']) && $_REQUEST['diagnose_this'] != '')
753
+					$diagnose_this = sanitize_text_field($_REQUEST['diagnose_this']);
754
+				call_user_func('geodir_diagnose_' . $diagnose_this);
755
+				exit();
756
+				break;
757
+		}
758
+	}
759
+	exit();
760 760
 }
761 761
 
762 762
 
@@ -774,127 +774,127 @@  discard block
 block discarded – undo
774 774
  */
775 775
 function geodir_diagnose_multisite_table($filter_arr, $table, $tabel_name, $fix)
776 776
 {
777
-    global $wpdb;
778
-    //$filter_arr['output_str'] .='###'.$table.'###';
779
-    if ($wpdb->query("SHOW TABLES LIKE '" . $table . "_ms_bak2'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $table . "_ms_bak'") > 0) {
780
-        $filter_arr['output_str'] .= "<li>" . __('ERROR: You didnt follow instructions! Now you will need to contact support to manually fix things.', 'geodirectory') . "</li>";
781
-        $filter_arr['is_error_during_diagnose'] = true;
782
-
783
-    } elseif ($wpdb->query("SHOW TABLES LIKE '" . $table . "_ms_bak'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "$table'") > 0) {
784
-        $filter_arr['output_str'] .= "<li>" . sprintf(__('ERROR: %s_ms_bak table found', 'geodirectory'), $tabel_name) . "</li>";
785
-        $filter_arr['is_error_during_diagnose'] = true;
786
-        $filter_arr['output_str'] .= "<li>" . __('IMPORTANT: This can be caused by out of date core or addons, please update core + addons before trying the fix OR YOU WILL HAVE A BAD TIME!', 'geodirectory') . "</li>";
787
-        $filter_arr['is_error_during_diagnose'] = true;
788
-
789
-        if ($fix) {
790
-            $ms_bak_count = $wpdb->get_var("SELECT COUNT(*) FROM " . $table . "_ms_bak");// get backup table count
791
-            $new_table_count = $wpdb->get_var("SELECT COUNT(*) FROM " . $wpdb->prefix . "$table");// get new table count
792
-
793
-            if ($ms_bak_count == $new_table_count) {// if they are the same count rename to bak2
794
-                //$filter_arr['output_str'] .= "<li>".sprintf( __('-->PROBLEM: %s table count is the same as new table, contact support' , 'geodirectory'), $table )."</li>" ;
795
-
796
-                $wpdb->query("RENAME TABLE " . $table . "_ms_bak TO " . $table . "_ms_bak2");// rename bak table to new table
797
-
798
-                if ($wpdb->query("SHOW TABLES LIKE '" . $table . "_ms_bak2'") && $wpdb->query("SHOW TABLES LIKE '" . $table . "_ms_bak'") == 0) {
799
-                    $filter_arr['output_str'] .= "<li>" . __('-->FIXED: Renamed and backed up the tables', 'geodirectory') . "</li>";
800
-                } else {
801
-                    $filter_arr['output_str'] .= "<li>" . __('-->PROBLEM: Failed to rename tables, please contact support.', 'geodirectory') . "</li>";
802
-                }
803
-
804
-            } elseif ($ms_bak_count > $new_table_count) {//if backup is greater then restore it
805
-
806
-                $wpdb->query("RENAME TABLE " . $wpdb->prefix . "$table TO " . $table . "_ms_bak2");// rename new table to bak2
807
-                $wpdb->query("RENAME TABLE " . $table . "_ms_bak TO " . $wpdb->prefix . "$table");// rename bak table to new table
808
-
809
-                if ($wpdb->query("SHOW TABLES LIKE '" . $table . "_ms_bak2'") && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "$table'") && $wpdb->query("SHOW TABLES LIKE '$table'") == 0) {
810
-                    $filter_arr['output_str'] .= "<li>" . sprintf(__('-->FIXED: restored largest table %s', 'geodirectory'), $table) . "</li>";
811
-                } else {
812
-                    $filter_arr['output_str'] .= "<li>" . __('-->PROBLEM: Failed to rename tables, please contact support.', 'geodirectory') . "</li>";
813
-                }
814
-
815
-            } elseif ($new_table_count > $ms_bak_count) {// we cant do much so rename the table to stop errors
816
-
817
-                $wpdb->query("RENAME TABLE " . $table . "_ms_bak TO " . $table . "_ms_bak2");// rename ms_bak table to ms_bak2
818
-
819
-                if ($wpdb->query("SHOW TABLES LIKE '" . $table . "_ms_bak'") == 0) {
820
-                    $filter_arr['output_str'] .= "<li>" . sprintf(__('-->FIXED: table %s_ms_bak renamed and backed up', 'geodirectory'), $table) . "</li>";
821
-                } else {
822
-                    $filter_arr['output_str'] .= "<li>" . __('-->PROBLEM: Failed to rename tables, please contact support.', 'geodirectory') . "</li>";
823
-                }
824
-
825
-            }
826
-
827
-        }
828
-
829
-
830
-    } elseif ($wpdb->query("SHOW TABLES LIKE '$table'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "$table'") > 0) {
831
-        $filter_arr['output_str'] .= "<li>" . sprintf(__('ERROR: Two %s tables found', 'geodirectory'), $tabel_name) . "</li>";
832
-        $filter_arr['is_error_during_diagnose'] = true;
833
-
834
-        if ($fix) {
835
-            if ($wpdb->get_var("SELECT COUNT(*) FROM $table") == 0) {// if first table is empty just delete it
836
-                if ($wpdb->query("DROP TABLE IF EXISTS $table")) {
837
-                    $filter_arr['output_str'] .= "<li>" . sprintf(__('-->FIXED: Deleted table %s', 'geodirectory'), $table) . "</li>";
838
-                } else {
839
-                    $filter_arr['output_str'] .= "<li>" . sprintf(__('-->PROBLEM: Delete table %s failed, please try manual delete from DB', 'geodirectory'), $table) . "</li>";
840
-                }
841
-
842
-            } elseif ($wpdb->get_var("SELECT COUNT(*) FROM " . $wpdb->prefix . "$table") == 0) {// if main table is empty but original is not, delete main and rename original
843
-                if ($wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "$table")) {
844
-                    $filter_arr['output_str'] .= "<li>" . sprintf(__('-->FIXED: Deleted table %s', 'geodirectory'), $wpdb->prefix . $table) . "</li>";
845
-                } else {
846
-                    $filter_arr['output_str'] .= "<li>" . sprintf(__('-->PROBLEM: Delete table %s failed, please try manual delete from DB', 'geodirectory'), $wpdb->prefix . $table) . "</li>";
847
-                }
848
-                if ($wpdb->query("RENAME TABLE $table TO " . $wpdb->prefix . "$table") || $wpdb->query("SHOW TABLES LIKE '$table'") == 0) {
849
-                    $filter_arr['output_str'] .= "<li>" . sprintf(__('-->FIXED: Table %s renamed to %s', 'geodirectory'), $table, $wpdb->prefix . $table) . "</li>";
850
-                } else {
851
-                    $filter_arr['output_str'] .= "<li>" . sprintf(__('-->PROBLEM: Failed to rename table %s to %s, please try manually from DB', 'geodirectory'), $table, $wpdb->prefix . $table) . "</li>";
852
-                }
853
-            } else {// else rename the original table to _ms_bak
854
-                if ($wpdb->query("RENAME TABLE $table TO " . $table . "_ms_bak") || $wpdb->query("SHOW TABLES LIKE '$table'") == 0) {
855
-                    $filter_arr['output_str'] .= "<li>" . sprintf(__('-->FIXED: Table contained info so we renamed %s to %s incase it is needed in future', 'geodirectory'), $table, $table . "_ms_bak") . "</li>";
856
-                } else {
857
-                    $filter_arr['output_str'] .= "<li>" . sprintf(__('-->PROBLEM: Table %s could not be renamed to %s, this table has info so may need to be reviewed manually in the DB', 'geodirectory'), $table, $table . "_ms_bak") . "</li>";
858
-                }
859
-            }
860
-        }
861
-
862
-    } elseif ($wpdb->query("SHOW TABLES LIKE '$table'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "$table'") == 0) {
863
-        $filter_arr['output_str'] .= "<li>" . sprintf(__('ERROR: %s table not converted', 'geodirectory'), $tabel_name) . "</li>";
864
-        $filter_arr['is_error_during_diagnose'] = true;
865
-
866
-        if ($fix) {
867
-            // if orignal table exists but new does not, rename
868
-            if ($wpdb->query("RENAME TABLE $table TO " . $wpdb->prefix . "$table") || $wpdb->query("SHOW TABLES LIKE '$table'") == 0) {
869
-                $filter_arr['output_str'] .= "<li>" . sprintf(__('-->FIXED: Table %s renamed to %s', 'geodirectory'), $table, $wpdb->prefix . $table) . "</li>";
870
-            } else {
871
-                $filter_arr['output_str'] .= "<li>" . sprintf(__('-->PROBLEM: Failed to rename table %s to %s, please try manually from DB', 'geodirectory'), $table, $wpdb->prefix . $table) . "</li>";
872
-            }
873
-
874
-        }
875
-
876
-    } elseif ($wpdb->query("SHOW TABLES LIKE '$table'") == 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "$table'") == 0) {
877
-        $filter_arr['output_str'] .= "<li>" . sprintf(__('ERROR: %s table does not exist', 'geodirectory'), $tabel_name) . "</li>";
878
-        $filter_arr['is_error_during_diagnose'] = true;
879
-
880
-        if ($fix) {
881
-            // if orignal table does not exist try deleting db_vers of all addons so the initial db_install scripts run;
882
-            delete_option('geodirlocation_db_version');
883
-            delete_option('geodirevents_db_version');
884
-            delete_option('geodir_reviewrating_db_version');
885
-            delete_option('gdevents_db_version');
886
-            delete_option('geodirectory_db_version');
887
-            delete_option('geodirclaim_db_version');
888
-            delete_option('geodir_custom_posts_db_version');
889
-            delete_option('geodir_reviewratings_db_version');
890
-            delete_option('geodiradvancesearch_db_version');
891
-            $filter_arr['output_str'] .= "<li>" . __('-->TRY: Please refresh page to run table install functions', 'geodirectory') . "</li>";
892
-        }
893
-
894
-    } else {
895
-        $filter_arr['output_str'] .= "<li>" . sprintf(__('%s table converted correctly', 'geodirectory'), $tabel_name) . "</li>";
896
-    }
897
-    return $filter_arr;
777
+	global $wpdb;
778
+	//$filter_arr['output_str'] .='###'.$table.'###';
779
+	if ($wpdb->query("SHOW TABLES LIKE '" . $table . "_ms_bak2'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $table . "_ms_bak'") > 0) {
780
+		$filter_arr['output_str'] .= "<li>" . __('ERROR: You didnt follow instructions! Now you will need to contact support to manually fix things.', 'geodirectory') . "</li>";
781
+		$filter_arr['is_error_during_diagnose'] = true;
782
+
783
+	} elseif ($wpdb->query("SHOW TABLES LIKE '" . $table . "_ms_bak'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "$table'") > 0) {
784
+		$filter_arr['output_str'] .= "<li>" . sprintf(__('ERROR: %s_ms_bak table found', 'geodirectory'), $tabel_name) . "</li>";
785
+		$filter_arr['is_error_during_diagnose'] = true;
786
+		$filter_arr['output_str'] .= "<li>" . __('IMPORTANT: This can be caused by out of date core or addons, please update core + addons before trying the fix OR YOU WILL HAVE A BAD TIME!', 'geodirectory') . "</li>";
787
+		$filter_arr['is_error_during_diagnose'] = true;
788
+
789
+		if ($fix) {
790
+			$ms_bak_count = $wpdb->get_var("SELECT COUNT(*) FROM " . $table . "_ms_bak");// get backup table count
791
+			$new_table_count = $wpdb->get_var("SELECT COUNT(*) FROM " . $wpdb->prefix . "$table");// get new table count
792
+
793
+			if ($ms_bak_count == $new_table_count) {// if they are the same count rename to bak2
794
+				//$filter_arr['output_str'] .= "<li>".sprintf( __('-->PROBLEM: %s table count is the same as new table, contact support' , 'geodirectory'), $table )."</li>" ;
795
+
796
+				$wpdb->query("RENAME TABLE " . $table . "_ms_bak TO " . $table . "_ms_bak2");// rename bak table to new table
797
+
798
+				if ($wpdb->query("SHOW TABLES LIKE '" . $table . "_ms_bak2'") && $wpdb->query("SHOW TABLES LIKE '" . $table . "_ms_bak'") == 0) {
799
+					$filter_arr['output_str'] .= "<li>" . __('-->FIXED: Renamed and backed up the tables', 'geodirectory') . "</li>";
800
+				} else {
801
+					$filter_arr['output_str'] .= "<li>" . __('-->PROBLEM: Failed to rename tables, please contact support.', 'geodirectory') . "</li>";
802
+				}
803
+
804
+			} elseif ($ms_bak_count > $new_table_count) {//if backup is greater then restore it
805
+
806
+				$wpdb->query("RENAME TABLE " . $wpdb->prefix . "$table TO " . $table . "_ms_bak2");// rename new table to bak2
807
+				$wpdb->query("RENAME TABLE " . $table . "_ms_bak TO " . $wpdb->prefix . "$table");// rename bak table to new table
808
+
809
+				if ($wpdb->query("SHOW TABLES LIKE '" . $table . "_ms_bak2'") && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "$table'") && $wpdb->query("SHOW TABLES LIKE '$table'") == 0) {
810
+					$filter_arr['output_str'] .= "<li>" . sprintf(__('-->FIXED: restored largest table %s', 'geodirectory'), $table) . "</li>";
811
+				} else {
812
+					$filter_arr['output_str'] .= "<li>" . __('-->PROBLEM: Failed to rename tables, please contact support.', 'geodirectory') . "</li>";
813
+				}
814
+
815
+			} elseif ($new_table_count > $ms_bak_count) {// we cant do much so rename the table to stop errors
816
+
817
+				$wpdb->query("RENAME TABLE " . $table . "_ms_bak TO " . $table . "_ms_bak2");// rename ms_bak table to ms_bak2
818
+
819
+				if ($wpdb->query("SHOW TABLES LIKE '" . $table . "_ms_bak'") == 0) {
820
+					$filter_arr['output_str'] .= "<li>" . sprintf(__('-->FIXED: table %s_ms_bak renamed and backed up', 'geodirectory'), $table) . "</li>";
821
+				} else {
822
+					$filter_arr['output_str'] .= "<li>" . __('-->PROBLEM: Failed to rename tables, please contact support.', 'geodirectory') . "</li>";
823
+				}
824
+
825
+			}
826
+
827
+		}
828
+
829
+
830
+	} elseif ($wpdb->query("SHOW TABLES LIKE '$table'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "$table'") > 0) {
831
+		$filter_arr['output_str'] .= "<li>" . sprintf(__('ERROR: Two %s tables found', 'geodirectory'), $tabel_name) . "</li>";
832
+		$filter_arr['is_error_during_diagnose'] = true;
833
+
834
+		if ($fix) {
835
+			if ($wpdb->get_var("SELECT COUNT(*) FROM $table") == 0) {// if first table is empty just delete it
836
+				if ($wpdb->query("DROP TABLE IF EXISTS $table")) {
837
+					$filter_arr['output_str'] .= "<li>" . sprintf(__('-->FIXED: Deleted table %s', 'geodirectory'), $table) . "</li>";
838
+				} else {
839
+					$filter_arr['output_str'] .= "<li>" . sprintf(__('-->PROBLEM: Delete table %s failed, please try manual delete from DB', 'geodirectory'), $table) . "</li>";
840
+				}
841
+
842
+			} elseif ($wpdb->get_var("SELECT COUNT(*) FROM " . $wpdb->prefix . "$table") == 0) {// if main table is empty but original is not, delete main and rename original
843
+				if ($wpdb->query("DROP TABLE IF EXISTS " . $wpdb->prefix . "$table")) {
844
+					$filter_arr['output_str'] .= "<li>" . sprintf(__('-->FIXED: Deleted table %s', 'geodirectory'), $wpdb->prefix . $table) . "</li>";
845
+				} else {
846
+					$filter_arr['output_str'] .= "<li>" . sprintf(__('-->PROBLEM: Delete table %s failed, please try manual delete from DB', 'geodirectory'), $wpdb->prefix . $table) . "</li>";
847
+				}
848
+				if ($wpdb->query("RENAME TABLE $table TO " . $wpdb->prefix . "$table") || $wpdb->query("SHOW TABLES LIKE '$table'") == 0) {
849
+					$filter_arr['output_str'] .= "<li>" . sprintf(__('-->FIXED: Table %s renamed to %s', 'geodirectory'), $table, $wpdb->prefix . $table) . "</li>";
850
+				} else {
851
+					$filter_arr['output_str'] .= "<li>" . sprintf(__('-->PROBLEM: Failed to rename table %s to %s, please try manually from DB', 'geodirectory'), $table, $wpdb->prefix . $table) . "</li>";
852
+				}
853
+			} else {// else rename the original table to _ms_bak
854
+				if ($wpdb->query("RENAME TABLE $table TO " . $table . "_ms_bak") || $wpdb->query("SHOW TABLES LIKE '$table'") == 0) {
855
+					$filter_arr['output_str'] .= "<li>" . sprintf(__('-->FIXED: Table contained info so we renamed %s to %s incase it is needed in future', 'geodirectory'), $table, $table . "_ms_bak") . "</li>";
856
+				} else {
857
+					$filter_arr['output_str'] .= "<li>" . sprintf(__('-->PROBLEM: Table %s could not be renamed to %s, this table has info so may need to be reviewed manually in the DB', 'geodirectory'), $table, $table . "_ms_bak") . "</li>";
858
+				}
859
+			}
860
+		}
861
+
862
+	} elseif ($wpdb->query("SHOW TABLES LIKE '$table'") > 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "$table'") == 0) {
863
+		$filter_arr['output_str'] .= "<li>" . sprintf(__('ERROR: %s table not converted', 'geodirectory'), $tabel_name) . "</li>";
864
+		$filter_arr['is_error_during_diagnose'] = true;
865
+
866
+		if ($fix) {
867
+			// if orignal table exists but new does not, rename
868
+			if ($wpdb->query("RENAME TABLE $table TO " . $wpdb->prefix . "$table") || $wpdb->query("SHOW TABLES LIKE '$table'") == 0) {
869
+				$filter_arr['output_str'] .= "<li>" . sprintf(__('-->FIXED: Table %s renamed to %s', 'geodirectory'), $table, $wpdb->prefix . $table) . "</li>";
870
+			} else {
871
+				$filter_arr['output_str'] .= "<li>" . sprintf(__('-->PROBLEM: Failed to rename table %s to %s, please try manually from DB', 'geodirectory'), $table, $wpdb->prefix . $table) . "</li>";
872
+			}
873
+
874
+		}
875
+
876
+	} elseif ($wpdb->query("SHOW TABLES LIKE '$table'") == 0 && $wpdb->query("SHOW TABLES LIKE '" . $wpdb->prefix . "$table'") == 0) {
877
+		$filter_arr['output_str'] .= "<li>" . sprintf(__('ERROR: %s table does not exist', 'geodirectory'), $tabel_name) . "</li>";
878
+		$filter_arr['is_error_during_diagnose'] = true;
879
+
880
+		if ($fix) {
881
+			// if orignal table does not exist try deleting db_vers of all addons so the initial db_install scripts run;
882
+			delete_option('geodirlocation_db_version');
883
+			delete_option('geodirevents_db_version');
884
+			delete_option('geodir_reviewrating_db_version');
885
+			delete_option('gdevents_db_version');
886
+			delete_option('geodirectory_db_version');
887
+			delete_option('geodirclaim_db_version');
888
+			delete_option('geodir_custom_posts_db_version');
889
+			delete_option('geodir_reviewratings_db_version');
890
+			delete_option('geodiradvancesearch_db_version');
891
+			$filter_arr['output_str'] .= "<li>" . __('-->TRY: Please refresh page to run table install functions', 'geodirectory') . "</li>";
892
+		}
893
+
894
+	} else {
895
+		$filter_arr['output_str'] .= "<li>" . sprintf(__('%s table converted correctly', 'geodirectory'), $tabel_name) . "</li>";
896
+	}
897
+	return $filter_arr;
898 898
 }
899 899
 
900 900
 
@@ -908,53 +908,53 @@  discard block
 block discarded – undo
908 908
  */
909 909
 function geodir_diagnose_tags_sync()
910 910
 {
911
-    global $wpdb, $plugin_prefix;
912
-    $fix = isset($_POST['fix']) ? true : false;
913
-
914
-    //if($fix){echo 'true';}else{echo 'false';}
915
-    $is_error_during_diagnose = false;
916
-    $output_str = '';
917
-
918
-
919
-    $all_postypes = geodir_get_posttypes();
920
-
921
-    if (!empty($all_postypes)) {
922
-        foreach ($all_postypes as $key) {
923
-            // update each GD CTP
924
-            $posts = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "geodir_" . $key . "_detail d");
925
-
926
-            if (!empty($posts)) {
927
-
928
-                foreach ($posts as $p) {
929
-                    $p->post_type = $key;
930
-                    $raw_tags = wp_get_object_terms($p->post_id, $p->post_type . '_tags', array('fields' => 'names'));
931
-                    if (empty($raw_tags)) {
932
-                        $post_tags = '';
933
-                    } else {
934
-                        $post_tags = implode(",", $raw_tags);
935
-                    }
936
-                    $tablename = $plugin_prefix . $p->post_type . '_detail';
937
-                    $wpdb->query($wpdb->prepare("UPDATE " . $tablename . " SET post_tags=%s WHERE post_id =%d", $post_tags, $p->post_id));
938
-
939
-                }
940
-                $output_str .= "<li>" . $key . __(': Done', 'geodirectory') . "</li>";
941
-            }
942
-
943
-        }
944
-
945
-    }
946
-
947
-    if ($is_error_during_diagnose) {
948
-        $info_div_class = "geodir_problem_info";
949
-        $fix_button_txt = "<input type='button' value='" . __('Fix', 'geodirectory') . "' class='button-primary geodir_fix_diagnostic_issue' data-diagnostic-issue='ratings' />";
950
-    } else {
951
-        $info_div_class = "geodir_noproblem_info";
952
-        $fix_button_txt = '';
953
-    }
954
-    echo "<ul class='$info_div_class'>";
955
-    echo $output_str;
956
-    echo $fix_button_txt;
957
-    echo "</ul>";
911
+	global $wpdb, $plugin_prefix;
912
+	$fix = isset($_POST['fix']) ? true : false;
913
+
914
+	//if($fix){echo 'true';}else{echo 'false';}
915
+	$is_error_during_diagnose = false;
916
+	$output_str = '';
917
+
918
+
919
+	$all_postypes = geodir_get_posttypes();
920
+
921
+	if (!empty($all_postypes)) {
922
+		foreach ($all_postypes as $key) {
923
+			// update each GD CTP
924
+			$posts = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "geodir_" . $key . "_detail d");
925
+
926
+			if (!empty($posts)) {
927
+
928
+				foreach ($posts as $p) {
929
+					$p->post_type = $key;
930
+					$raw_tags = wp_get_object_terms($p->post_id, $p->post_type . '_tags', array('fields' => 'names'));
931
+					if (empty($raw_tags)) {
932
+						$post_tags = '';
933
+					} else {
934
+						$post_tags = implode(",", $raw_tags);
935
+					}
936
+					$tablename = $plugin_prefix . $p->post_type . '_detail';
937
+					$wpdb->query($wpdb->prepare("UPDATE " . $tablename . " SET post_tags=%s WHERE post_id =%d", $post_tags, $p->post_id));
938
+
939
+				}
940
+				$output_str .= "<li>" . $key . __(': Done', 'geodirectory') . "</li>";
941
+			}
942
+
943
+		}
944
+
945
+	}
946
+
947
+	if ($is_error_during_diagnose) {
948
+		$info_div_class = "geodir_problem_info";
949
+		$fix_button_txt = "<input type='button' value='" . __('Fix', 'geodirectory') . "' class='button-primary geodir_fix_diagnostic_issue' data-diagnostic-issue='ratings' />";
950
+	} else {
951
+		$info_div_class = "geodir_noproblem_info";
952
+		$fix_button_txt = '';
953
+	}
954
+	echo "<ul class='$info_div_class'>";
955
+	echo $output_str;
956
+	echo $fix_button_txt;
957
+	echo "</ul>";
958 958
 
959 959
 }
960 960
 
@@ -970,75 +970,75 @@  discard block
 block discarded – undo
970 970
  */
971 971
 function geodir_diagnose_cats_sync()
972 972
 {
973
-    global $wpdb, $plugin_prefix;
974
-    $fix = isset($_POST['fix']) ? true : false;
973
+	global $wpdb, $plugin_prefix;
974
+	$fix = isset($_POST['fix']) ? true : false;
975 975
 
976
-    //if($fix){echo 'true';}else{echo 'false';}
977
-    $is_error_during_diagnose = false;
978
-    $output_str = '';
976
+	//if($fix){echo 'true';}else{echo 'false';}
977
+	$is_error_during_diagnose = false;
978
+	$output_str = '';
979 979
 
980 980
 
981
-    $all_postypes = geodir_get_posttypes();
981
+	$all_postypes = geodir_get_posttypes();
982 982
 
983
-    if (!empty($all_postypes)) {
984
-        foreach ($all_postypes as $key) {
985
-            // update each GD CTP
986
-            $posts = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "geodir_" . $key . "_detail d WHERE d." . $key . "category='' ");
983
+	if (!empty($all_postypes)) {
984
+		foreach ($all_postypes as $key) {
985
+			// update each GD CTP
986
+			$posts = $wpdb->get_results("SELECT * FROM " . $wpdb->prefix . "geodir_" . $key . "_detail d WHERE d." . $key . "category='' ");
987 987
 
988
-            if (!empty($posts)) {
988
+			if (!empty($posts)) {
989 989
 
990
-                foreach ($posts as $p) {
991
-                    $p->post_type = $key;
992
-                    $raw_cats = wp_get_object_terms($p->post_id, $p->post_type . 'category', array('fields' => 'ids'));
990
+				foreach ($posts as $p) {
991
+					$p->post_type = $key;
992
+					$raw_cats = wp_get_object_terms($p->post_id, $p->post_type . 'category', array('fields' => 'ids'));
993 993
 
994
-                    if (empty($raw_cats)) {
995
-                        $post_categories = get_post_meta($p->post_id, 'post_categories', true);
994
+					if (empty($raw_cats)) {
995
+						$post_categories = get_post_meta($p->post_id, 'post_categories', true);
996 996
 
997
-                        if (!empty($post_categories) && !empty($post_categories[$p->post_type . 'category'])) {
998
-                            $post_categories[$p->post_type . 'category'] = str_replace("d:", "", $post_categories[$p->post_type . 'category']);
999
-                            foreach (explode(",", $post_categories[$p->post_type . 'category']) as $cat_part) {
1000
-                                if (is_numeric($cat_part)) {
1001
-                                    $raw_cats[] = (int)$cat_part;
1002
-                                }
1003
-                            }
997
+						if (!empty($post_categories) && !empty($post_categories[$p->post_type . 'category'])) {
998
+							$post_categories[$p->post_type . 'category'] = str_replace("d:", "", $post_categories[$p->post_type . 'category']);
999
+							foreach (explode(",", $post_categories[$p->post_type . 'category']) as $cat_part) {
1000
+								if (is_numeric($cat_part)) {
1001
+									$raw_cats[] = (int)$cat_part;
1002
+								}
1003
+							}
1004 1004
 
1005
-                        }
1005
+						}
1006 1006
 
1007
-                        if (!empty($raw_cats)) {
1008
-                            $term_taxonomy_ids = wp_set_object_terms($p->post_id, $raw_cats, $p->post_type . 'category');
1007
+						if (!empty($raw_cats)) {
1008
+							$term_taxonomy_ids = wp_set_object_terms($p->post_id, $raw_cats, $p->post_type . 'category');
1009 1009
 
1010
-                        }
1010
+						}
1011 1011
 
1012
-                    }
1012
+					}
1013 1013
 
1014 1014
 
1015
-                    if (empty($raw_cats)) {
1016
-                        $post_cats = '';
1017
-                    } else {
1018
-                        $post_cats = ',' . implode(",", $raw_cats) . ',';
1019
-                    }
1020
-                    $tablename = $plugin_prefix . $p->post_type . '_detail';
1021
-                    $wpdb->query($wpdb->prepare("UPDATE " . $tablename . " SET " . $p->post_type . "category=%s WHERE post_id =%d", $post_cats, $p->post_id));
1022
-                }
1015
+					if (empty($raw_cats)) {
1016
+						$post_cats = '';
1017
+					} else {
1018
+						$post_cats = ',' . implode(",", $raw_cats) . ',';
1019
+					}
1020
+					$tablename = $plugin_prefix . $p->post_type . '_detail';
1021
+					$wpdb->query($wpdb->prepare("UPDATE " . $tablename . " SET " . $p->post_type . "category=%s WHERE post_id =%d", $post_cats, $p->post_id));
1022
+				}
1023 1023
 
1024
-            }
1025
-            $output_str .= "<li>" . $key . __(': Done', 'geodirectory') . "</li>";
1024
+			}
1025
+			$output_str .= "<li>" . $key . __(': Done', 'geodirectory') . "</li>";
1026 1026
 
1027
-        }
1027
+		}
1028 1028
 
1029
-    }
1029
+	}
1030 1030
 
1031
-    if ($is_error_during_diagnose) {
1032
-        $info_div_class = "geodir_problem_info";
1033
-        $fix_button_txt = "<input type='button' value='" . __('Fix', 'geodirectory') . "' class='button-primary geodir_fix_diagnostic_issue' data-diagnostic-issue='ratings' />";
1034
-    } else {
1035
-        $info_div_class = "geodir_noproblem_info";
1036
-        $fix_button_txt = '';
1037
-    }
1038
-    echo "<ul class='$info_div_class'>";
1039
-    echo $output_str;
1040
-    echo $fix_button_txt;
1041
-    echo "</ul>";
1031
+	if ($is_error_during_diagnose) {
1032
+		$info_div_class = "geodir_problem_info";
1033
+		$fix_button_txt = "<input type='button' value='" . __('Fix', 'geodirectory') . "' class='button-primary geodir_fix_diagnostic_issue' data-diagnostic-issue='ratings' />";
1034
+	} else {
1035
+		$info_div_class = "geodir_noproblem_info";
1036
+		$fix_button_txt = '';
1037
+	}
1038
+	echo "<ul class='$info_div_class'>";
1039
+	echo $output_str;
1040
+	echo $fix_button_txt;
1041
+	echo "</ul>";
1042 1042
 
1043 1043
 }
1044 1044
 
@@ -1052,61 +1052,61 @@  discard block
 block discarded – undo
1052 1052
  */
1053 1053
 function geodir_diagnose_version_clear()
1054 1054
 {
1055
-    global $wpdb, $plugin_prefix;
1056
-    $fix = isset($_POST['fix']) ? true : false;
1057
-
1058
-    //if($fix){echo 'true';}else{echo 'false';}
1059
-    $is_error_during_diagnose = false;
1060
-    $output_str = '';
1061
-
1062
-
1063
-    $gd_arr = array('GeoDirectory' => 'geodirectory_db_version',
1064
-        'Payment Manager' => 'geodir_payments_db_version',
1065
-        'GeoDirectory Framework' => 'gdf_db_version',
1066
-        'Advanced Search' => 'geodiradvancesearch_db_version',
1067
-        'Review Rating Manager' => 'geodir_reviewratings_db_version',
1068
-        'Claim Manager' => 'geodirclaim_db_version',
1069
-        'CPT Manager' => 'geodir_custom_posts_db_version',
1070
-        'Location Manager' => 'geodirlocation_db_version',
1071
-        'Payment Manager' => 'geodir_payments_db_version',
1072
-        'Events Manager' => 'geodirevents_db_version',
1073
-    );
1074
-
1075
-    /**
1076
-     * Filter the array of plugins to clear the version numbers for in the GD >Tools : clear all version numbers.
1077
-     *
1078
-     * @since 1.0.0
1079
-     * @param array $gd_arr The array or addons to clear, array('GeoDirectory' => 'geodirectory_db_version',...
1080
-     */
1081
-    $ver_arr = apply_filters('geodir_db_version_name', $gd_arr);
1082
-
1083
-    if (!empty($ver_arr)) {
1084
-        foreach ($ver_arr as $key => $val) {
1085
-            if (delete_option($val)) {
1086
-                $output_str .= "<li>" . $key . __(' Version: Deleted', 'geodirectory') . "</li>";
1087
-            } else {
1088
-                $output_str .= "<li>" . $key . __(' Version: Not Found', 'geodirectory') . "</li>";
1089
-            }
1090
-
1091
-        }
1092
-
1093
-        if ($output_str) {
1094
-            $output_str .= "<li><strong>" . __(' Upgrade/install scripts will run on next page reload.', 'geodirectory') . "</strong></li>";
1095
-        }
1096
-
1097
-    }
1098
-
1099
-    if ($is_error_during_diagnose) {
1100
-        $info_div_class = "geodir_problem_info";
1101
-        $fix_button_txt = "";
1102
-    } else {
1103
-        $info_div_class = "geodir_noproblem_info";
1104
-        $fix_button_txt = '';
1105
-    }
1106
-    echo "<ul class='$info_div_class'>";
1107
-    echo $output_str;
1108
-    echo $fix_button_txt;
1109
-    echo "</ul>";
1055
+	global $wpdb, $plugin_prefix;
1056
+	$fix = isset($_POST['fix']) ? true : false;
1057
+
1058
+	//if($fix){echo 'true';}else{echo 'false';}
1059
+	$is_error_during_diagnose = false;
1060
+	$output_str = '';
1061
+
1062
+
1063
+	$gd_arr = array('GeoDirectory' => 'geodirectory_db_version',
1064
+		'Payment Manager' => 'geodir_payments_db_version',
1065
+		'GeoDirectory Framework' => 'gdf_db_version',
1066
+		'Advanced Search' => 'geodiradvancesearch_db_version',
1067
+		'Review Rating Manager' => 'geodir_reviewratings_db_version',
1068
+		'Claim Manager' => 'geodirclaim_db_version',
1069
+		'CPT Manager' => 'geodir_custom_posts_db_version',
1070
+		'Location Manager' => 'geodirlocation_db_version',
1071
+		'Payment Manager' => 'geodir_payments_db_version',
1072
+		'Events Manager' => 'geodirevents_db_version',
1073
+	);
1074
+
1075
+	/**
1076
+	 * Filter the array of plugins to clear the version numbers for in the GD >Tools : clear all version numbers.
1077
+	 *
1078
+	 * @since 1.0.0
1079
+	 * @param array $gd_arr The array or addons to clear, array('GeoDirectory' => 'geodirectory_db_version',...
1080
+	 */
1081
+	$ver_arr = apply_filters('geodir_db_version_name', $gd_arr);
1082
+
1083
+	if (!empty($ver_arr)) {
1084
+		foreach ($ver_arr as $key => $val) {
1085
+			if (delete_option($val)) {
1086
+				$output_str .= "<li>" . $key . __(' Version: Deleted', 'geodirectory') . "</li>";
1087
+			} else {
1088
+				$output_str .= "<li>" . $key . __(' Version: Not Found', 'geodirectory') . "</li>";
1089
+			}
1090
+
1091
+		}
1092
+
1093
+		if ($output_str) {
1094
+			$output_str .= "<li><strong>" . __(' Upgrade/install scripts will run on next page reload.', 'geodirectory') . "</strong></li>";
1095
+		}
1096
+
1097
+	}
1098
+
1099
+	if ($is_error_during_diagnose) {
1100
+		$info_div_class = "geodir_problem_info";
1101
+		$fix_button_txt = "";
1102
+	} else {
1103
+		$info_div_class = "geodir_noproblem_info";
1104
+		$fix_button_txt = '';
1105
+	}
1106
+	echo "<ul class='$info_div_class'>";
1107
+	echo $output_str;
1108
+	echo $fix_button_txt;
1109
+	echo "</ul>";
1110 1110
 
1111 1111
 }
1112 1112
 
@@ -1120,59 +1120,59 @@  discard block
 block discarded – undo
1120 1120
  */
1121 1121
 function geodir_diagnose_ratings()
1122 1122
 {
1123
-    global $wpdb;
1124
-    $fix = isset($_POST['fix']) ? true : false;
1125
-
1126
-    //if($fix){echo 'true';}else{echo 'false';}
1127
-    $is_error_during_diagnose = false;
1128
-    $output_str = '';
1129
-
1130
-    // check review locations
1131
-    if ($wpdb->get_results("SELECT * FROM " . GEODIR_REVIEW_TABLE . " WHERE post_city='' OR post_city IS NULL OR post_latitude='' OR post_latitude IS NULL")) {
1132
-        $output_str .= "<li>" . __('Review locations missing or broken', 'geodirectory') . "</li>";
1133
-        $is_error_during_diagnose = true;
1134
-
1135
-        if ($fix) {
1136
-            if (geodir_fix_review_location()) {
1137
-                $output_str .= "<li><strong>" . __('-->FIXED: Review locations fixed', 'geodirectory') . "</strong></li>";
1138
-            } else {
1139
-                $output_str .= "<li><strong>" . __('-->FAILED: Review locations fix failed', 'geodirectory') . "</strong></li>";
1140
-            }
1141
-        }
1142
-
1143
-    } else {
1144
-        $output_str .= "<li>" . __('Review locations ok', 'geodirectory') . "</li>";
1145
-    }
1146
-
1147
-    // check review content
1148
-    if ($wpdb->get_results("SELECT * FROM " . GEODIR_REVIEW_TABLE . " WHERE comment_content IS NULL")) {
1149
-        $output_str .= "<li>" . __('Review content missing or broken', 'geodirectory') . "</li>";
1150
-        $is_error_during_diagnose = true;
1151
-
1152
-        if ($fix) {
1153
-            if (geodir_fix_review_content()) {
1154
-                $output_str .= "<li><strong>" . __('-->FIXED: Review content fixed', 'geodirectory') . "</strong></li>";
1155
-            } else {
1156
-                $output_str .= "<li><strong>" . __('-->FAILED: Review content fix failed', 'geodirectory') . "</strong></li>";
1157
-            }
1158
-        }
1159
-
1160
-    } else {
1161
-        $output_str .= "<li>" . __('Review content ok', 'geodirectory') . "</li>";
1162
-    }
1163
-
1164
-
1165
-    if ($is_error_during_diagnose) {
1166
-        $info_div_class = "geodir_problem_info";
1167
-        $fix_button_txt = "<input type='button' value='" . __('Fix', 'geodirectory') . "' class='button-primary geodir_fix_diagnostic_issue' data-diagnostic-issue='ratings' />";
1168
-    } else {
1169
-        $info_div_class = "geodir_noproblem_info";
1170
-        $fix_button_txt = '';
1171
-    }
1172
-    echo "<ul class='$info_div_class'>";
1173
-    echo $output_str;
1174
-    echo $fix_button_txt;
1175
-    echo "</ul>";
1123
+	global $wpdb;
1124
+	$fix = isset($_POST['fix']) ? true : false;
1125
+
1126
+	//if($fix){echo 'true';}else{echo 'false';}
1127
+	$is_error_during_diagnose = false;
1128
+	$output_str = '';
1129
+
1130
+	// check review locations
1131
+	if ($wpdb->get_results("SELECT * FROM " . GEODIR_REVIEW_TABLE . " WHERE post_city='' OR post_city IS NULL OR post_latitude='' OR post_latitude IS NULL")) {
1132
+		$output_str .= "<li>" . __('Review locations missing or broken', 'geodirectory') . "</li>";
1133
+		$is_error_during_diagnose = true;
1134
+
1135
+		if ($fix) {
1136
+			if (geodir_fix_review_location()) {
1137
+				$output_str .= "<li><strong>" . __('-->FIXED: Review locations fixed', 'geodirectory') . "</strong></li>";
1138
+			} else {
1139
+				$output_str .= "<li><strong>" . __('-->FAILED: Review locations fix failed', 'geodirectory') . "</strong></li>";
1140
+			}
1141
+		}
1142
+
1143
+	} else {
1144
+		$output_str .= "<li>" . __('Review locations ok', 'geodirectory') . "</li>";
1145
+	}
1146
+
1147
+	// check review content
1148
+	if ($wpdb->get_results("SELECT * FROM " . GEODIR_REVIEW_TABLE . " WHERE comment_content IS NULL")) {
1149
+		$output_str .= "<li>" . __('Review content missing or broken', 'geodirectory') . "</li>";
1150
+		$is_error_during_diagnose = true;
1151
+
1152
+		if ($fix) {
1153
+			if (geodir_fix_review_content()) {
1154
+				$output_str .= "<li><strong>" . __('-->FIXED: Review content fixed', 'geodirectory') . "</strong></li>";
1155
+			} else {
1156
+				$output_str .= "<li><strong>" . __('-->FAILED: Review content fix failed', 'geodirectory') . "</strong></li>";
1157
+			}
1158
+		}
1159
+
1160
+	} else {
1161
+		$output_str .= "<li>" . __('Review content ok', 'geodirectory') . "</li>";
1162
+	}
1163
+
1164
+
1165
+	if ($is_error_during_diagnose) {
1166
+		$info_div_class = "geodir_problem_info";
1167
+		$fix_button_txt = "<input type='button' value='" . __('Fix', 'geodirectory') . "' class='button-primary geodir_fix_diagnostic_issue' data-diagnostic-issue='ratings' />";
1168
+	} else {
1169
+		$info_div_class = "geodir_noproblem_info";
1170
+		$fix_button_txt = '';
1171
+	}
1172
+	echo "<ul class='$info_div_class'>";
1173
+	echo $output_str;
1174
+	echo $fix_button_txt;
1175
+	echo "</ul>";
1176 1176
 
1177 1177
 }
1178 1178
 
@@ -1186,57 +1186,57 @@  discard block
 block discarded – undo
1186 1186
  */
1187 1187
 function geodir_diagnose_multisite_conversion()
1188 1188
 {
1189
-    global $wpdb;
1190
-    $fix = isset($_POST['fix']) ? true : false;
1191
-    //if($fix){echo 'true';}else{echo 'false';}
1192
-    $is_error_during_diagnose = false;
1193
-    $output_str = '';
1194
-
1195
-    $filter_arr = array();
1196
-    $filter_arr['output_str'] = $output_str;
1197
-    $filter_arr['is_error_during_diagnose'] = $is_error_during_diagnose;
1198
-    $table_arr = array('geodir_countries' => __('Countries', 'geodirectory'),
1199
-        'geodir_custom_fields' => __('Custom fields', 'geodirectory'),
1200
-        'geodir_post_icon' => __('Post icon', 'geodirectory'),
1201
-        'geodir_attachments' => __('Attachments', 'geodirectory'),
1202
-        'geodir_post_review' => __('Reviews', 'geodirectory'),
1203
-        'geodir_custom_sort_fields' => __('Custom sort fields', 'geodirectory'),
1204
-        'geodir_gd_place_detail' => __('Place detail', 'geodirectory')
1205
-    );
1206
-
1207
-    // allow other addons to hook in and add their checks
1208
-
1209
-    /**
1210
-     * Filter the array of tables.
1211
-     *
1212
-     * Filter the array of tables to check during the GD>Tools multisite DB conversion tool check, this allows adons to add their DB tables to the checks.
1213
-     *
1214
-     * @since 1.0.0
1215
-     * @param array $table_arr The array of tables to check, array('geodir_countries' => __('Countries', 'geodirectory'),...
1216
-     */
1217
-    $table_arr = apply_filters('geodir_diagnose_multisite_conversion', $table_arr);
1218
-
1219
-    foreach ($table_arr as $table => $table_name) {
1220
-        // Diagnose table
1221
-        $filter_arr = geodir_diagnose_multisite_table($filter_arr, $table, $table_name, $fix);
1222
-    }
1223
-
1224
-
1225
-    $output_str = $filter_arr['output_str'];
1226
-    $is_error_during_diagnose = $filter_arr['is_error_during_diagnose'];
1227
-
1228
-
1229
-    if ($is_error_during_diagnose) {
1230
-        $info_div_class = "geodir_problem_info";
1231
-        $fix_button_txt = "<input type='button' value='" . __('Fix', 'geodirectory') . "' class='button-primary geodir_fix_diagnostic_issue' data-diagnostic-issue='multisite_conversion' />";
1232
-    } else {
1233
-        $info_div_class = "geodir_noproblem_info";
1234
-        $fix_button_txt = '';
1235
-    }
1236
-    echo "<ul class='$info_div_class'>";
1237
-    echo $output_str;
1238
-    echo $fix_button_txt;
1239
-    echo "</ul>";
1189
+	global $wpdb;
1190
+	$fix = isset($_POST['fix']) ? true : false;
1191
+	//if($fix){echo 'true';}else{echo 'false';}
1192
+	$is_error_during_diagnose = false;
1193
+	$output_str = '';
1194
+
1195
+	$filter_arr = array();
1196
+	$filter_arr['output_str'] = $output_str;
1197
+	$filter_arr['is_error_during_diagnose'] = $is_error_during_diagnose;
1198
+	$table_arr = array('geodir_countries' => __('Countries', 'geodirectory'),
1199
+		'geodir_custom_fields' => __('Custom fields', 'geodirectory'),
1200
+		'geodir_post_icon' => __('Post icon', 'geodirectory'),
1201
+		'geodir_attachments' => __('Attachments', 'geodirectory'),
1202
+		'geodir_post_review' => __('Reviews', 'geodirectory'),
1203
+		'geodir_custom_sort_fields' => __('Custom sort fields', 'geodirectory'),
1204
+		'geodir_gd_place_detail' => __('Place detail', 'geodirectory')
1205
+	);
1206
+
1207
+	// allow other addons to hook in and add their checks
1208
+
1209
+	/**
1210
+	 * Filter the array of tables.
1211
+	 *
1212
+	 * Filter the array of tables to check during the GD>Tools multisite DB conversion tool check, this allows adons to add their DB tables to the checks.
1213
+	 *
1214
+	 * @since 1.0.0
1215
+	 * @param array $table_arr The array of tables to check, array('geodir_countries' => __('Countries', 'geodirectory'),...
1216
+	 */
1217
+	$table_arr = apply_filters('geodir_diagnose_multisite_conversion', $table_arr);
1218
+
1219
+	foreach ($table_arr as $table => $table_name) {
1220
+		// Diagnose table
1221
+		$filter_arr = geodir_diagnose_multisite_table($filter_arr, $table, $table_name, $fix);
1222
+	}
1223
+
1224
+
1225
+	$output_str = $filter_arr['output_str'];
1226
+	$is_error_during_diagnose = $filter_arr['is_error_during_diagnose'];
1227
+
1228
+
1229
+	if ($is_error_during_diagnose) {
1230
+		$info_div_class = "geodir_problem_info";
1231
+		$fix_button_txt = "<input type='button' value='" . __('Fix', 'geodirectory') . "' class='button-primary geodir_fix_diagnostic_issue' data-diagnostic-issue='multisite_conversion' />";
1232
+	} else {
1233
+		$info_div_class = "geodir_noproblem_info";
1234
+		$fix_button_txt = '';
1235
+	}
1236
+	echo "<ul class='$info_div_class'>";
1237
+	echo $output_str;
1238
+	echo $fix_button_txt;
1239
+	echo "</ul>";
1240 1240
 }
1241 1241
 
1242 1242
 /**
@@ -1254,39 +1254,39 @@  discard block
 block discarded – undo
1254 1254
  */
1255 1255
 function geodir_fix_virtual_page($slug, $page_title, $old_id, $option)
1256 1256
 {
1257
-    global $wpdb, $current_user;
1258
-
1259
-    if (!empty($old_id)) {
1260
-        wp_delete_post($old_id, true);
1261
-    }//delete post if already there
1262
-    else {
1263
-        $page_found = $wpdb->get_var(
1264
-            $wpdb->prepare(
1265
-                "SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s LIMIT 1;",
1266
-                array($slug)
1267
-            )
1268
-        );
1269
-        wp_delete_post($page_found, true);
1270
-
1271
-    }
1272
-
1273
-    $page_data = array(
1274
-        'post_status' => 'publish',
1275
-        'post_type' => 'page',
1276
-        'post_author' => $current_user->ID,
1277
-        'post_name' => $slug,
1278
-        'post_title' => $page_title,
1279
-        'post_content' => '',
1280
-        'post_parent' => 0,
1281
-        'comment_status' => 'closed'
1282
-    );
1283
-    $page_id = wp_insert_post($page_data);
1284
-    update_option($option, $page_id);
1285
-    if ($page_id) {
1286
-        return true;
1287
-    } else {
1288
-        return false;
1289
-    }
1257
+	global $wpdb, $current_user;
1258
+
1259
+	if (!empty($old_id)) {
1260
+		wp_delete_post($old_id, true);
1261
+	}//delete post if already there
1262
+	else {
1263
+		$page_found = $wpdb->get_var(
1264
+			$wpdb->prepare(
1265
+				"SELECT ID FROM " . $wpdb->posts . " WHERE post_name = %s LIMIT 1;",
1266
+				array($slug)
1267
+			)
1268
+		);
1269
+		wp_delete_post($page_found, true);
1270
+
1271
+	}
1272
+
1273
+	$page_data = array(
1274
+		'post_status' => 'publish',
1275
+		'post_type' => 'page',
1276
+		'post_author' => $current_user->ID,
1277
+		'post_name' => $slug,
1278
+		'post_title' => $page_title,
1279
+		'post_content' => '',
1280
+		'post_parent' => 0,
1281
+		'comment_status' => 'closed'
1282
+	);
1283
+	$page_id = wp_insert_post($page_data);
1284
+	update_option($option, $page_id);
1285
+	if ($page_id) {
1286
+		return true;
1287
+	} else {
1288
+		return false;
1289
+	}
1290 1290
 }
1291 1291
 
1292 1292
 /**
@@ -1298,212 +1298,212 @@  discard block
 block discarded – undo
1298 1298
  */
1299 1299
 function geodir_diagnose_default_pages()
1300 1300
 {
1301
-    global $wpdb;
1302
-    $is_error_during_diagnose = false;
1303
-    $output_str = '';
1304
-    $fix = isset($_POST['fix']) ? true : false;
1305
-
1306
-    //////////////////////////////////
1307
-    /* Diagnose GD Home Page Starts */
1308
-    //////////////////////////////////
1309
-    $option_value = get_option('geodir_home_page');
1310
-    $page = get_post($option_value);
1311
-    if(!empty($page)){$page_found = $page->ID;}else{$page_found = '';}
1312
-
1313
-    if(!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status=='publish')
1314
-        $output_str .= "<li>" . __('GD Home page exists with proper setting.', 'geodirectory') . "</li>";
1315
-    else {
1316
-        $is_error_during_diagnose = true;
1317
-        $output_str .= "<li><strong>" . __('GD Home page is missing.', 'geodirectory') . "</strong></li>";
1318
-        if ($fix) {
1319
-            if (geodir_fix_virtual_page('gd-home', __('GD Home page', 'geodirectory'), $page_found, 'geodir_home_page')) {
1320
-                $output_str .= "<li><strong>" . __('-->FIXED: GD Home page fixed', 'geodirectory') . "</strong></li>";
1321
-            } else {
1322
-                $output_str .= "<li><strong>" . __('-->FAILED: GD Home page fix failed', 'geodirectory') . "</strong></li>";
1323
-            }
1324
-        }
1325
-    }
1326
-
1327
-    ////////////////////////////////
1328
-    /* Diagnose GD Home Page Ends */
1329
-    ////////////////////////////////
1330
-
1331
-    //////////////////////////////////
1332
-    /* Diagnose Add Listing Page Starts */
1333
-    //////////////////////////////////
1334
-    $option_value = get_option('geodir_add_listing_page');
1335
-    $page = get_post($option_value);
1336
-    if(!empty($page)){$page_found = $page->ID;}else{$page_found = '';}
1337
-
1338
-    if(!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status=='publish')
1339
-        $output_str .= "<li>" . __('Add Listing page exists with proper setting.', 'geodirectory') . "</li>";
1340
-    else {
1341
-        $is_error_during_diagnose = true;
1342
-        $output_str .= "<li><strong>" . __('Add Listing page is missing.', 'geodirectory') . "</strong></li>";
1343
-        if ($fix) {
1344
-            if (geodir_fix_virtual_page('add-listing', __('Add Listing', 'geodirectory'), $page_found, 'geodir_add_listing_page')) {
1345
-                $output_str .= "<li><strong>" . __('-->FIXED: Add Listing page fixed', 'geodirectory') . "</strong></li>";
1346
-            } else {
1347
-                $output_str .= "<li><strong>" . __('-->FAILED: Add Listing page fix failed', 'geodirectory') . "</strong></li>";
1348
-            }
1349
-        }
1350
-    }
1351
-
1352
-    ////////////////////////////////
1353
-    /* Diagnose Add Listing Page Ends */
1354
-    ////////////////////////////////
1355
-
1356
-
1357
-    //////////////////////////////////
1358
-    /* Diagnose Listing Preview Page Starts */
1359
-    //////////////////////////////////
1360
-    $option_value = get_option('geodir_preview_page');
1361
-    $page = get_post($option_value);
1362
-    if(!empty($page)){$page_found = $page->ID;}else{$page_found = '';}
1363
-
1364
-    if(!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status=='publish')
1365
-        $output_str .= "<li>" . __('Listing Preview page exists with proper setting.', 'geodirectory') . "</li>";
1366
-    else {
1367
-        $is_error_during_diagnose = true;
1368
-        $output_str .= "<li><strong>" . __('Listing Preview page is missing.', 'geodirectory') . "</strong></li>";
1369
-        if ($fix) {
1370
-            if (geodir_fix_virtual_page('listing-preview', __('Listing Preview', 'geodirectory'), $page_found, 'geodir_preview_page')) {
1371
-                $output_str .= "<li><strong>" . __('-->FIXED: Listing Preview page fixed', 'geodirectory') . "</strong></li>";
1372
-            } else {
1373
-                $output_str .= "<li><strong>" . __('-->FAILED: Listing Preview page fix failed', 'geodirectory') . "</strong></li>";
1374
-            }
1375
-        }
1376
-    }
1377
-
1378
-    ////////////////////////////////
1379
-    /* Diagnose Listing Preview Page Ends */
1380
-    ////////////////////////////////
1381
-
1382
-    //////////////////////////////////
1383
-    /* Diagnose Listing Success Page Starts */
1384
-    //////////////////////////////////
1385
-    $option_value = get_option('geodir_success_page');
1386
-    $page = get_post($option_value);
1387
-    if(!empty($page)){$page_found = $page->ID;}else{$page_found = '';}
1388
-
1389
-    if(!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status=='publish')
1390
-        $output_str .= "<li>" . __('Listing Success page exists with proper setting.', 'geodirectory') . "</li>";
1391
-    else {
1392
-        $is_error_during_diagnose = true;
1393
-        $output_str .= "<li><strong>" . __('Listing Success page is missing.', 'geodirectory') . "</strong></li>";
1394
-        if ($fix) {
1395
-            if (geodir_fix_virtual_page('listing-success', __('Listing Success', 'geodirectory'), $page_found, 'geodir_success_page')) {
1396
-                $output_str .= "<li><strong>" . __('-->FIXED: Listing Success page fixed', 'geodirectory') . "</strong></li>";
1397
-            } else {
1398
-                $output_str .= "<li><strong>" . __('-->FAILED: Listing Success page fix failed', 'geodirectory') . "</strong></li>";
1399
-            }
1400
-        }
1401
-    }
1402
-
1403
-    ////////////////////////////////
1404
-    /* Diagnose Listing Sucess Page Ends */
1405
-    ////////////////////////////////
1406
-
1407
-    //////////////////////////////////
1408
-    /* Diagnose Info Page Starts */
1409
-    //////////////////////////////////
1410
-    $option_value = get_option('geodir_info_page');
1411
-    $page = get_post($option_value);
1412
-    if(!empty($page)){$page_found = $page->ID;}else{$page_found = '';}
1413
-
1414
-    if(!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status=='publish')
1415
-        $output_str .= "<li>" . __('Info page exists with proper setting.', 'geodirectory') . "</li>";
1416
-    else {
1417
-        $is_error_during_diagnose = true;
1418
-        $output_str .= "<li><strong>" . __('Info page is missing.', 'geodirectory') . "</strong></li>";
1419
-        if ($fix) {
1420
-            if (geodir_fix_virtual_page('gd-info', __('Info', 'geodirectory'), $page_found, 'geodir_info_page')) {
1421
-                $output_str .= "<li><strong>" . __('-->FIXED: Info page fixed', 'geodirectory') . "</strong></li>";
1422
-            } else {
1423
-                $output_str .= "<li><strong>" . __('-->FAILED: Info page fix failed', 'geodirectory') . "</strong></li>";
1424
-            }
1425
-        }
1426
-    }
1427
-
1428
-    ////////////////////////////////
1429
-    /* Diagnose Info Page Ends */
1430
-    ////////////////////////////////
1431
-
1432
-    //////////////////////////////////
1433
-    /* Diagnose Login Page Starts */
1434
-    //////////////////////////////////
1435
-    $option_value = get_option('geodir_login_page');
1436
-    $page = get_post($option_value);
1437
-    if(!empty($page)){$page_found = $page->ID;}else{$page_found = '';}
1438
-
1439
-    if(!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status=='publish')
1440
-        $output_str .= "<li>" . __('Login page exists with proper setting.', 'geodirectory') . "</li>";
1441
-    else {
1442
-        $is_error_during_diagnose = true;
1443
-        $output_str .= "<li><strong>" . __('Login page is missing.', 'geodirectory') . "</strong></li>";
1444
-        if ($fix) {
1445
-            if (geodir_fix_virtual_page('gd-login', __('Login', 'geodirectory'), $page_found, 'geodir_login_page')) {
1446
-                $output_str .= "<li><strong>" . __('-->FIXED: Login page fixed', 'geodirectory') . "</strong></li>";
1447
-            } else {
1448
-                $output_str .= "<li><strong>" . __('-->FAILED: Login page fix failed', 'geodirectory') . "</strong></li>";
1449
-            }
1450
-        }
1451
-    }
1452
-
1453
-    ////////////////////////////////
1454
-    /* Diagnose Info Page Ends */
1455
-    ////////////////////////////////
1456
-
1457
-    //////////////////////////////////
1458
-    /* Diagnose Location Page Starts */
1459
-    //////////////////////////////////
1460
-    $option_value = get_option('geodir_location_page');
1461
-    $page = get_post($option_value);
1462
-    if(!empty($page)){$page_found = $page->ID;}else{$page_found = '';}
1463
-
1464
-    if(!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status=='publish')
1465
-        $output_str .= "<li>" . __('Location page exists with proper setting.', 'geodirectory') . "</li>";
1466
-    else {
1467
-        $is_error_during_diagnose = true;
1468
-        $output_str .= "<li><strong>" . __('Location page is missing.', 'geodirectory') . "</strong></li>";
1469
-        if ($fix) {
1470
-            if (geodir_fix_virtual_page('location', __('Location', 'geodirectory'), $page_found, 'geodir_location_page')) {
1471
-                $output_str .= "<li><strong>" . __('-->FIXED: Location page fixed', 'geodirectory') . "</strong></li>";
1472
-            } else {
1473
-                $output_str .= "<li><strong>" . __('-->FAILED: Location page fix failed', 'geodirectory') . "</strong></li>";
1474
-            }
1475
-        }
1476
-    }
1477
-
1478
-    ////////////////////////////////
1479
-    /* Diagnose Location Page Ends */
1480
-    ////////////////////////////////
1481
-
1482
-    $page_chk_arr = array('output_str'=>$output_str,'is_error_during_diagnose'=>$is_error_during_diagnose );
1483
-    /**
1484
-     * This action is called at the end of the GD Tools page check function.
1485
-     *
1486
-     * @since 1.5.2
1487
-     */
1488
-    $page_chk_arr = apply_filters('geodir_diagnose_default_pages',$page_chk_arr);
1489
-
1490
-    $output_str = $page_chk_arr['output_str'];
1491
-    $is_error_during_diagnose = $page_chk_arr['is_error_during_diagnose'];
1492
-
1493
-    if ($is_error_during_diagnose) {
1494
-        if ($fix) {
1495
-            flush_rewrite_rules();
1496
-        }
1497
-        $info_div_class = "geodir_problem_info";
1498
-        $fix_button_txt = "<input type='button' value='" . __('Fix', 'geodirectory') . "' class='button-primary geodir_fix_diagnostic_issue' data-diagnostic-issue='default_pages' />";
1499
-    } else {
1500
-        $info_div_class = "geodir_noproblem_info";
1501
-        $fix_button_txt = '';
1502
-    }
1503
-    echo "<ul class='$info_div_class'>";
1504
-    echo $output_str;
1505
-    echo $fix_button_txt;
1506
-    echo "</ul>";
1301
+	global $wpdb;
1302
+	$is_error_during_diagnose = false;
1303
+	$output_str = '';
1304
+	$fix = isset($_POST['fix']) ? true : false;
1305
+
1306
+	//////////////////////////////////
1307
+	/* Diagnose GD Home Page Starts */
1308
+	//////////////////////////////////
1309
+	$option_value = get_option('geodir_home_page');
1310
+	$page = get_post($option_value);
1311
+	if(!empty($page)){$page_found = $page->ID;}else{$page_found = '';}
1312
+
1313
+	if(!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status=='publish')
1314
+		$output_str .= "<li>" . __('GD Home page exists with proper setting.', 'geodirectory') . "</li>";
1315
+	else {
1316
+		$is_error_during_diagnose = true;
1317
+		$output_str .= "<li><strong>" . __('GD Home page is missing.', 'geodirectory') . "</strong></li>";
1318
+		if ($fix) {
1319
+			if (geodir_fix_virtual_page('gd-home', __('GD Home page', 'geodirectory'), $page_found, 'geodir_home_page')) {
1320
+				$output_str .= "<li><strong>" . __('-->FIXED: GD Home page fixed', 'geodirectory') . "</strong></li>";
1321
+			} else {
1322
+				$output_str .= "<li><strong>" . __('-->FAILED: GD Home page fix failed', 'geodirectory') . "</strong></li>";
1323
+			}
1324
+		}
1325
+	}
1326
+
1327
+	////////////////////////////////
1328
+	/* Diagnose GD Home Page Ends */
1329
+	////////////////////////////////
1330
+
1331
+	//////////////////////////////////
1332
+	/* Diagnose Add Listing Page Starts */
1333
+	//////////////////////////////////
1334
+	$option_value = get_option('geodir_add_listing_page');
1335
+	$page = get_post($option_value);
1336
+	if(!empty($page)){$page_found = $page->ID;}else{$page_found = '';}
1337
+
1338
+	if(!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status=='publish')
1339
+		$output_str .= "<li>" . __('Add Listing page exists with proper setting.', 'geodirectory') . "</li>";
1340
+	else {
1341
+		$is_error_during_diagnose = true;
1342
+		$output_str .= "<li><strong>" . __('Add Listing page is missing.', 'geodirectory') . "</strong></li>";
1343
+		if ($fix) {
1344
+			if (geodir_fix_virtual_page('add-listing', __('Add Listing', 'geodirectory'), $page_found, 'geodir_add_listing_page')) {
1345
+				$output_str .= "<li><strong>" . __('-->FIXED: Add Listing page fixed', 'geodirectory') . "</strong></li>";
1346
+			} else {
1347
+				$output_str .= "<li><strong>" . __('-->FAILED: Add Listing page fix failed', 'geodirectory') . "</strong></li>";
1348
+			}
1349
+		}
1350
+	}
1351
+
1352
+	////////////////////////////////
1353
+	/* Diagnose Add Listing Page Ends */
1354
+	////////////////////////////////
1355
+
1356
+
1357
+	//////////////////////////////////
1358
+	/* Diagnose Listing Preview Page Starts */
1359
+	//////////////////////////////////
1360
+	$option_value = get_option('geodir_preview_page');
1361
+	$page = get_post($option_value);
1362
+	if(!empty($page)){$page_found = $page->ID;}else{$page_found = '';}
1363
+
1364
+	if(!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status=='publish')
1365
+		$output_str .= "<li>" . __('Listing Preview page exists with proper setting.', 'geodirectory') . "</li>";
1366
+	else {
1367
+		$is_error_during_diagnose = true;
1368
+		$output_str .= "<li><strong>" . __('Listing Preview page is missing.', 'geodirectory') . "</strong></li>";
1369
+		if ($fix) {
1370
+			if (geodir_fix_virtual_page('listing-preview', __('Listing Preview', 'geodirectory'), $page_found, 'geodir_preview_page')) {
1371
+				$output_str .= "<li><strong>" . __('-->FIXED: Listing Preview page fixed', 'geodirectory') . "</strong></li>";
1372
+			} else {
1373
+				$output_str .= "<li><strong>" . __('-->FAILED: Listing Preview page fix failed', 'geodirectory') . "</strong></li>";
1374
+			}
1375
+		}
1376
+	}
1377
+
1378
+	////////////////////////////////
1379
+	/* Diagnose Listing Preview Page Ends */
1380
+	////////////////////////////////
1381
+
1382
+	//////////////////////////////////
1383
+	/* Diagnose Listing Success Page Starts */
1384
+	//////////////////////////////////
1385
+	$option_value = get_option('geodir_success_page');
1386
+	$page = get_post($option_value);
1387
+	if(!empty($page)){$page_found = $page->ID;}else{$page_found = '';}
1388
+
1389
+	if(!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status=='publish')
1390
+		$output_str .= "<li>" . __('Listing Success page exists with proper setting.', 'geodirectory') . "</li>";
1391
+	else {
1392
+		$is_error_during_diagnose = true;
1393
+		$output_str .= "<li><strong>" . __('Listing Success page is missing.', 'geodirectory') . "</strong></li>";
1394
+		if ($fix) {
1395
+			if (geodir_fix_virtual_page('listing-success', __('Listing Success', 'geodirectory'), $page_found, 'geodir_success_page')) {
1396
+				$output_str .= "<li><strong>" . __('-->FIXED: Listing Success page fixed', 'geodirectory') . "</strong></li>";
1397
+			} else {
1398
+				$output_str .= "<li><strong>" . __('-->FAILED: Listing Success page fix failed', 'geodirectory') . "</strong></li>";
1399
+			}
1400
+		}
1401
+	}
1402
+
1403
+	////////////////////////////////
1404
+	/* Diagnose Listing Sucess Page Ends */
1405
+	////////////////////////////////
1406
+
1407
+	//////////////////////////////////
1408
+	/* Diagnose Info Page Starts */
1409
+	//////////////////////////////////
1410
+	$option_value = get_option('geodir_info_page');
1411
+	$page = get_post($option_value);
1412
+	if(!empty($page)){$page_found = $page->ID;}else{$page_found = '';}
1413
+
1414
+	if(!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status=='publish')
1415
+		$output_str .= "<li>" . __('Info page exists with proper setting.', 'geodirectory') . "</li>";
1416
+	else {
1417
+		$is_error_during_diagnose = true;
1418
+		$output_str .= "<li><strong>" . __('Info page is missing.', 'geodirectory') . "</strong></li>";
1419
+		if ($fix) {
1420
+			if (geodir_fix_virtual_page('gd-info', __('Info', 'geodirectory'), $page_found, 'geodir_info_page')) {
1421
+				$output_str .= "<li><strong>" . __('-->FIXED: Info page fixed', 'geodirectory') . "</strong></li>";
1422
+			} else {
1423
+				$output_str .= "<li><strong>" . __('-->FAILED: Info page fix failed', 'geodirectory') . "</strong></li>";
1424
+			}
1425
+		}
1426
+	}
1427
+
1428
+	////////////////////////////////
1429
+	/* Diagnose Info Page Ends */
1430
+	////////////////////////////////
1431
+
1432
+	//////////////////////////////////
1433
+	/* Diagnose Login Page Starts */
1434
+	//////////////////////////////////
1435
+	$option_value = get_option('geodir_login_page');
1436
+	$page = get_post($option_value);
1437
+	if(!empty($page)){$page_found = $page->ID;}else{$page_found = '';}
1438
+
1439
+	if(!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status=='publish')
1440
+		$output_str .= "<li>" . __('Login page exists with proper setting.', 'geodirectory') . "</li>";
1441
+	else {
1442
+		$is_error_during_diagnose = true;
1443
+		$output_str .= "<li><strong>" . __('Login page is missing.', 'geodirectory') . "</strong></li>";
1444
+		if ($fix) {
1445
+			if (geodir_fix_virtual_page('gd-login', __('Login', 'geodirectory'), $page_found, 'geodir_login_page')) {
1446
+				$output_str .= "<li><strong>" . __('-->FIXED: Login page fixed', 'geodirectory') . "</strong></li>";
1447
+			} else {
1448
+				$output_str .= "<li><strong>" . __('-->FAILED: Login page fix failed', 'geodirectory') . "</strong></li>";
1449
+			}
1450
+		}
1451
+	}
1452
+
1453
+	////////////////////////////////
1454
+	/* Diagnose Info Page Ends */
1455
+	////////////////////////////////
1456
+
1457
+	//////////////////////////////////
1458
+	/* Diagnose Location Page Starts */
1459
+	//////////////////////////////////
1460
+	$option_value = get_option('geodir_location_page');
1461
+	$page = get_post($option_value);
1462
+	if(!empty($page)){$page_found = $page->ID;}else{$page_found = '';}
1463
+
1464
+	if(!empty($option_value) && !empty($page_found) && $option_value == $page_found && $page->post_status=='publish')
1465
+		$output_str .= "<li>" . __('Location page exists with proper setting.', 'geodirectory') . "</li>";
1466
+	else {
1467
+		$is_error_during_diagnose = true;
1468
+		$output_str .= "<li><strong>" . __('Location page is missing.', 'geodirectory') . "</strong></li>";
1469
+		if ($fix) {
1470
+			if (geodir_fix_virtual_page('location', __('Location', 'geodirectory'), $page_found, 'geodir_location_page')) {
1471
+				$output_str .= "<li><strong>" . __('-->FIXED: Location page fixed', 'geodirectory') . "</strong></li>";
1472
+			} else {
1473
+				$output_str .= "<li><strong>" . __('-->FAILED: Location page fix failed', 'geodirectory') . "</strong></li>";
1474
+			}
1475
+		}
1476
+	}
1477
+
1478
+	////////////////////////////////
1479
+	/* Diagnose Location Page Ends */
1480
+	////////////////////////////////
1481
+
1482
+	$page_chk_arr = array('output_str'=>$output_str,'is_error_during_diagnose'=>$is_error_during_diagnose );
1483
+	/**
1484
+	 * This action is called at the end of the GD Tools page check function.
1485
+	 *
1486
+	 * @since 1.5.2
1487
+	 */
1488
+	$page_chk_arr = apply_filters('geodir_diagnose_default_pages',$page_chk_arr);
1489
+
1490
+	$output_str = $page_chk_arr['output_str'];
1491
+	$is_error_during_diagnose = $page_chk_arr['is_error_during_diagnose'];
1492
+
1493
+	if ($is_error_during_diagnose) {
1494
+		if ($fix) {
1495
+			flush_rewrite_rules();
1496
+		}
1497
+		$info_div_class = "geodir_problem_info";
1498
+		$fix_button_txt = "<input type='button' value='" . __('Fix', 'geodirectory') . "' class='button-primary geodir_fix_diagnostic_issue' data-diagnostic-issue='default_pages' />";
1499
+	} else {
1500
+		$info_div_class = "geodir_noproblem_info";
1501
+		$fix_button_txt = '';
1502
+	}
1503
+	echo "<ul class='$info_div_class'>";
1504
+	echo $output_str;
1505
+	echo $fix_button_txt;
1506
+	echo "</ul>";
1507 1507
 
1508 1508
 }
1509 1509
 
@@ -1515,25 +1515,25 @@  discard block
 block discarded – undo
1515 1515
  * @global object $wpdb WordPress Database object.
1516 1516
  */
1517 1517
 function geodir_diagnose_load_db_language() {
1518
-    global $wpdb;
1518
+	global $wpdb;
1519 1519
 	
1520 1520
 	$is_error_during_diagnose = geodirectory_load_db_language();
1521 1521
 
1522
-    $output_str = '';
1522
+	$output_str = '';
1523 1523
 
1524
-    if ($is_error_during_diagnose) {
1525
-        $output_str .= "<li>" . __('Fail to load custom fields in to file for translation, please check file permission:', 'geodirectory') . ' ' . geodir_plugin_path() . '/db-language.php' . "</li>";
1524
+	if ($is_error_during_diagnose) {
1525
+		$output_str .= "<li>" . __('Fail to load custom fields in to file for translation, please check file permission:', 'geodirectory') . ' ' . geodir_plugin_path() . '/db-language.php' . "</li>";
1526 1526
 		$info_div_class = "geodir_problem_info";
1527
-    } else {
1528
-        $output_str .= "<li>" . __('Load custom fields in to file for translation: ok', 'geodirectory') . "</li>";
1527
+	} else {
1528
+		$output_str .= "<li>" . __('Load custom fields in to file for translation: ok', 'geodirectory') . "</li>";
1529 1529
 		$info_div_class = "geodir_noproblem_info";
1530
-        $fix_button_txt = '';
1531
-    }
1530
+		$fix_button_txt = '';
1531
+	}
1532 1532
     
1533 1533
 	echo "<ul class='$info_div_class'>";
1534
-    echo $output_str;
1535
-    echo $fix_button_txt;
1536
-    echo "</ul>";
1534
+	echo $output_str;
1535
+	echo $fix_button_txt;
1536
+	echo "</ul>";
1537 1537
 
1538 1538
 }
1539 1539
 
@@ -1564,23 +1564,23 @@  discard block
 block discarded – undo
1564 1564
  */
1565 1565
 function geodir_posts_clauses_request($clauses)
1566 1566
 {
1567
-    global $wpdb, $wp_query, $plugin_prefix;
1567
+	global $wpdb, $wp_query, $plugin_prefix;
1568 1568
 
1569
-    if (is_admin() && !empty($wp_query->query_vars) && !empty($wp_query->query_vars['is_geodir_loop']) && !empty($wp_query->query_vars['orderby']) && $wp_query->query_vars['orderby'] == 'expire' && !empty($wp_query->query_vars['post_type']) && in_array($wp_query->query_vars['post_type'], geodir_get_posttypes()) && !empty($wp_query->query_vars['orderby']) && isset($clauses['join']) && isset($clauses['orderby']) && isset($clauses['fields'])) {
1570
-        $table = $plugin_prefix . $wp_query->query_vars['post_type'] . '_detail';
1569
+	if (is_admin() && !empty($wp_query->query_vars) && !empty($wp_query->query_vars['is_geodir_loop']) && !empty($wp_query->query_vars['orderby']) && $wp_query->query_vars['orderby'] == 'expire' && !empty($wp_query->query_vars['post_type']) && in_array($wp_query->query_vars['post_type'], geodir_get_posttypes()) && !empty($wp_query->query_vars['orderby']) && isset($clauses['join']) && isset($clauses['orderby']) && isset($clauses['fields'])) {
1570
+		$table = $plugin_prefix . $wp_query->query_vars['post_type'] . '_detail';
1571 1571
 
1572
-        $join = $clauses['join'] . ' INNER JOIN ' . $table . ' AS gd_posts ON (gd_posts.post_id = ' . $wpdb->posts . '.ID)';
1573
-        $clauses['join'] = $join;
1572
+		$join = $clauses['join'] . ' INNER JOIN ' . $table . ' AS gd_posts ON (gd_posts.post_id = ' . $wpdb->posts . '.ID)';
1573
+		$clauses['join'] = $join;
1574 1574
 
1575
-        $fields = $clauses['fields'] != '' ? $clauses['fields'] . ', ' : '';
1576
-        $fields .= 'IF(UNIX_TIMESTAMP(DATE_FORMAT(gd_posts.expire_date, "%Y-%m-%d")), UNIX_TIMESTAMP(DATE_FORMAT(gd_posts.expire_date, "%Y-%m-%d")), 253402300799) AS gd_expire';
1577
-        $clauses['fields'] = $fields;
1575
+		$fields = $clauses['fields'] != '' ? $clauses['fields'] . ', ' : '';
1576
+		$fields .= 'IF(UNIX_TIMESTAMP(DATE_FORMAT(gd_posts.expire_date, "%Y-%m-%d")), UNIX_TIMESTAMP(DATE_FORMAT(gd_posts.expire_date, "%Y-%m-%d")), 253402300799) AS gd_expire';
1577
+		$clauses['fields'] = $fields;
1578 1578
 
1579
-        $order = !empty($wp_query->query_vars['order']) ? $wp_query->query_vars['order'] : 'ASC';
1580
-        $orderby = 'gd_expire ' . $order;
1581
-        $clauses['orderby'] = $orderby;
1582
-    }
1583
-    return $clauses;
1579
+		$order = !empty($wp_query->query_vars['order']) ? $wp_query->query_vars['order'] : 'ASC';
1580
+		$orderby = 'gd_expire ' . $order;
1581
+		$clauses['orderby'] = $orderby;
1582
+	}
1583
+	return $clauses;
1584 1584
 }
1585 1585
 
1586 1586
 
@@ -1601,7 +1601,7 @@  discard block
 block discarded – undo
1601 1601
  */
1602 1602
 function gd_theme_switch_compat_check()
1603 1603
 {
1604
-    gd_set_theme_compat();
1604
+	gd_set_theme_compat();
1605 1605
 }
1606 1606
 
1607 1607
 /**
@@ -1614,27 +1614,27 @@  discard block
 block discarded – undo
1614 1614
  */
1615 1615
 function geodir_str_getcsv($input, $delimiter = ",", $enclosure = '"', $escape = "\\")
1616 1616
 {
1617
-    if (function_exists('str_getcsv')) {
1618
-        $fgetcsv = str_getcsv($input, $delimiter, $enclosure, $escape);
1619
-    } else {
1620
-        global $current_user;
1621
-        $upload_dir = wp_upload_dir();
1622
-
1623
-        $file = $upload_dir['path'] . '/temp_' . $current_user->data->ID . '/geodir_tmp.csv';
1624
-        $handle = fopen($file, 'w');
1625
-
1626
-        fwrite($handle, $input);
1627
-        fclose($handle);
1628
-
1629
-        $handle = fopen($file, 'rt');
1630
-        if (PHP_VERSION >= '5.3.0') {
1631
-            $fgetcsv = fgetcsv($handle, 0, $delimiter, $enclosure, $escape);
1632
-        } else {
1633
-            $fgetcsv = fgetcsv($handle, 0, $delimiter, $enclosure);
1634
-        }
1635
-        fclose($handle);
1636
-    }
1637
-    return $fgetcsv;
1617
+	if (function_exists('str_getcsv')) {
1618
+		$fgetcsv = str_getcsv($input, $delimiter, $enclosure, $escape);
1619
+	} else {
1620
+		global $current_user;
1621
+		$upload_dir = wp_upload_dir();
1622
+
1623
+		$file = $upload_dir['path'] . '/temp_' . $current_user->data->ID . '/geodir_tmp.csv';
1624
+		$handle = fopen($file, 'w');
1625
+
1626
+		fwrite($handle, $input);
1627
+		fclose($handle);
1628
+
1629
+		$handle = fopen($file, 'rt');
1630
+		if (PHP_VERSION >= '5.3.0') {
1631
+			$fgetcsv = fgetcsv($handle, 0, $delimiter, $enclosure, $escape);
1632
+		} else {
1633
+			$fgetcsv = fgetcsv($handle, 0, $delimiter, $enclosure);
1634
+		}
1635
+		fclose($handle);
1636
+	}
1637
+	return $fgetcsv;
1638 1638
 }
1639 1639
 
1640 1640
 add_action('wp_ajax_gdImportCsv', 'geodir_ajax_import_csv');
@@ -1649,375 +1649,375 @@  discard block
 block discarded – undo
1649 1649
  */
1650 1650
 function geodir_ajax_import_csv()
1651 1651
 {
1652
-    error_reporting(0); // hide error to get clean json response
1652
+	error_reporting(0); // hide error to get clean json response
1653 1653
 
1654
-    global $wpdb, $plugin_prefix, $current_user;
1655
-    $uploads = wp_upload_dir();
1656
-    ini_set('auto_detect_line_endings', true);
1654
+	global $wpdb, $plugin_prefix, $current_user;
1655
+	$uploads = wp_upload_dir();
1656
+	ini_set('auto_detect_line_endings', true);
1657 1657
 	
1658 1658
 	$wp_post_statuses = get_post_statuses(); // All of the WordPress supported post statuses.
1659 1659
 
1660
-    $task = isset($_POST['task']) ? $_POST['task'] : '';
1661
-    $uploadedFile = isset($_POST['gddata']['uploadedFile']) ? $_POST['gddata']['uploadedFile'] : NULL;
1662
-    $filename = $uploadedFile;
1663
-
1664
-    $uploads = wp_upload_dir();
1665
-    $uploads_dir = $uploads['path'];
1666
-    $image_name_arr = explode('/', $filename);
1667
-    $filename = end($image_name_arr);
1668
-    $target_path = $uploads_dir . '/temp_' . $current_user->data->ID . '/' . $filename;
1669
-    $return = array();
1670
-    $return['file'] = $uploadedFile;
1671
-    $return['error'] = __('The uploaded file is not a valid csv file. Please try again.', 'geodirectory');
1672
-
1673
-    if (is_file($target_path) && file_exists($target_path) && $uploadedFile) {
1674
-        $wp_filetype = wp_check_filetype_and_ext($target_path, $filename);
1675
-
1676
-        if (!empty($wp_filetype) && isset($wp_filetype['ext']) && geodir_strtolower($wp_filetype['ext']) == 'csv') {
1677
-            $return['error'] = NULL;
1678
-
1679
-            $return['rows'] = 0;
1680
-
1681
-
1682
-
1683
-                if (($handle = fopen($target_path, "r")) !== FALSE) {
1684
-                    while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
1685
-                        if(is_array($data) && !empty($data)) {
1686
-                            $file[] = '"' . implode('","', $data) . '"';
1687
-                        }
1688
-                    }
1689
-                    fclose($handle);
1690
-                    $file = $file;
1691
-                }
1692
-
1693
-
1694
-
1695
-                $return['rows'] = (!empty($file) && count($file) > 1) ? count($file) - 1 : 0;
1696
-
1697
-
1698
-            if (!$return['rows'] > 0) {
1699
-                $return['error'] = __('No data found in csv file.', 'geodirectory');
1700
-            }
1701
-        }
1702
-    }
1703
-    if ($task == 'prepare' || !empty($return['error'])) {
1704
-        echo json_encode($return);
1705
-        exit;
1706
-    }
1707
-
1708
-    $totRecords = isset($_POST['gddata']['totRecords']) ? $_POST['gddata']['totRecords'] : NULL;
1709
-    $importlimit = isset($_POST['gddata']['importlimit']) ? $_POST['gddata']['importlimit'] : 1;
1710
-    $count = $importlimit;
1711
-    $requested_limit = $importlimit;
1712
-    $tmpCnt = isset($_POST['gddata']['tmpcount']) ? $_POST['gddata']['tmpcount'] : 0;
1713
-
1714
-    if ($count < $totRecords) {
1715
-        $count = $tmpCnt + $count;
1716
-        if ($count > $totRecords) {
1717
-            $count = $totRecords;
1718
-        }
1719
-    } else {
1720
-        $count = $totRecords;
1721
-    }
1722
-
1723
-    $total_records = 0;
1724
-    $rowcount = 0;
1725
-    $address_invalid = 0;
1726
-    $blank_address = 0;
1727
-    $upload_files = 0;
1728
-    $invalid_post_type = 0;
1729
-    $invalid_title = 0;
1730
-    $customKeyarray = array();
1731
-    $gd_post_info = array();
1732
-    $post_location = array();
1733
-    $countpost = 0;
1734
-
1735
-    if (!empty($file)) {
1736
-        $columns = isset($file[0]) ? geodir_str_getcsv($file[0]) : NULL;
1737
-        $customKeyarray = $columns;
1738
-
1739
-        if (empty($columns) || (!empty($columns) && $columns[0] == '')) {
1740
-            $return['error'] = CSV_INVAILD_FILE;
1741
-            echo json_encode($return);
1742
-            exit;
1743
-        }
1744
-
1745
-        for ($i = 1; $i <= $importlimit; $i++) {
1746
-            $current_index = $tmpCnt + $i;
1747
-            if (isset($file[$current_index])) {
1748
-                $total_records++;
1749
-
1750
-                $buffer = geodir_str_getcsv($file[$current_index]);
1751
-                $post_title = addslashes($buffer[0]);
1752
-                $current_post_author = $buffer[1];
1753
-                $post_desc = addslashes($buffer[2]);
1754
-                $post_cat = array();
1755
-                $catids_arr = array();
1756
-                $post_cat = trim($buffer[3]); // comma seperated category name
1757
-
1758
-                if ($post_cat) {
1759
-                    $post_cat_arr = explode(',', $post_cat);
1760
-
1761
-                    for ($c = 0; $c < count($post_cat_arr); $c++) {
1762
-                        $catid = wp_kses_normalize_entities(trim($post_cat_arr[$c]));
1763
-
1764
-                        if (!empty($buffer[5])) {
1765
-                            if (in_array($buffer[5], geodir_get_posttypes())) {
1766
-
1767
-                                $p_taxonomy = geodir_get_taxonomies(addslashes($buffer[5]));
1768
-
1769
-                                if (get_term_by('name', $catid, $p_taxonomy[0])) {
1770
-                                    $cat = get_term_by('name', $catid, $p_taxonomy[0]);
1771
-                                    $catids_arr[] = $cat->slug;
1772
-                                } else if (get_term_by('slug', $catid, $p_taxonomy[0])) {
1773
-                                    $cat = get_term_by('slug', $catid, $p_taxonomy[0]);
1774
-                                    $catids_arr[] = $cat->slug;
1775
-                                } else {
1776
-                                    $ret = wp_insert_term($catid, $p_taxonomy[0]);
1777
-                                    if ($ret && !is_wp_error($ret)) {
1778
-                                        if (get_term_by('name', $catid, $p_taxonomy[0])) {
1779
-                                            $cat = get_term_by('name', $catid, $p_taxonomy[0]);
1780
-                                            $catids_arr[] = $cat->slug;
1781
-                                        } elseif (get_term_by('slug', $catid, $p_taxonomy[0])) {
1782
-                                            $cat = get_term_by('slug', $catid, $p_taxonomy[0]);
1783
-                                            $catids_arr[] = $cat->slug;
1784
-                                        }
1785
-                                    }
1786
-                                }
1787
-                            }
1788
-                        }
1789
-                    }
1790
-                }
1791
-
1792
-                if (!$catids_arr) {
1793
-                    $catids_arr[] = 1;
1794
-                }
1795
-
1796
-                $post_tags = trim($buffer[4]); // comma seperated tags
1797
-
1798
-                $tag_arr = '';
1799
-                if ($post_tags) {
1800
-                    $tag_arr = explode(',', $post_tags);
1801
-                }
1802
-
1803
-                $table = $plugin_prefix . $buffer[5] . '_detail'; // check table in database
1804
-
1805
-                $error = '';
1806
-                if ($wpdb->get_var("SHOW TABLES LIKE '" . $table . "'") != $table) {
1807
-                    $invalid_post_type++;
1808
-                    continue;
1809
-                }
1810
-
1811
-                if ($post_title != '') {
1812
-                    $menu_order = 0;
1813
-                    $image_folder_name = 'uplaod/';
1814
-
1815
-                    $image_names = array();
1816
-
1817
-                    for ($c = 5; $c < count($customKeyarray); $c++) {
1818
-                        $gd_post_info[$customKeyarray[$c]] = addslashes($buffer[$c]);
1819
-
1820
-                        if ($customKeyarray[$c] == 'IMAGE') {
1821
-                            $buffer[$c] = trim($buffer[$c]);
1822
-
1823
-                            if (!empty($buffer[$c])) {
1824
-                                $image_names[] = $buffer[$c];
1825
-                            }
1826
-                        }
1827
-
1828
-                        if ($customKeyarray[$c] == 'alive_days') {
1829
-                            if ($buffer[$c] != '0' && $buffer[$c] != '') {
1830
-                                $submitdata = date('Y-m-d');
1831
-
1832
-                                $gd_post_info['expire_date'] = date('Y-m-d', strtotime($submitdata . "+" . addslashes($buffer[$c]) . " days"));
1833
-                            } else {
1834
-                                $gd_post_info['expire_date'] = 'Never';
1835
-                            }
1836
-                        }
1837
-
1838
-                        if ($customKeyarray[$c] == 'post_city') {
1839
-                            $post_city = addslashes($buffer[$c]);
1840
-                        }
1841
-
1842
-                        if ($customKeyarray[$c] == 'post_region') {
1843
-                            $post_region = addslashes($buffer[$c]);
1844
-                        }
1845
-
1846
-                        if ($customKeyarray[$c] == 'post_country') {
1847
-                            $post_country = addslashes($buffer[$c]);
1848
-                        }
1849
-
1850
-                        if ($customKeyarray[$c] == 'post_latitude') {
1851
-                            $post_latitude = addslashes($buffer[$c]);
1852
-                        }
1853
-
1854
-                        if ($customKeyarray[$c] == 'post_longitude') {
1855
-                            $post_longitude = addslashes($buffer[$c]);
1856
-                        }
1660
+	$task = isset($_POST['task']) ? $_POST['task'] : '';
1661
+	$uploadedFile = isset($_POST['gddata']['uploadedFile']) ? $_POST['gddata']['uploadedFile'] : NULL;
1662
+	$filename = $uploadedFile;
1663
+
1664
+	$uploads = wp_upload_dir();
1665
+	$uploads_dir = $uploads['path'];
1666
+	$image_name_arr = explode('/', $filename);
1667
+	$filename = end($image_name_arr);
1668
+	$target_path = $uploads_dir . '/temp_' . $current_user->data->ID . '/' . $filename;
1669
+	$return = array();
1670
+	$return['file'] = $uploadedFile;
1671
+	$return['error'] = __('The uploaded file is not a valid csv file. Please try again.', 'geodirectory');
1672
+
1673
+	if (is_file($target_path) && file_exists($target_path) && $uploadedFile) {
1674
+		$wp_filetype = wp_check_filetype_and_ext($target_path, $filename);
1675
+
1676
+		if (!empty($wp_filetype) && isset($wp_filetype['ext']) && geodir_strtolower($wp_filetype['ext']) == 'csv') {
1677
+			$return['error'] = NULL;
1678
+
1679
+			$return['rows'] = 0;
1680
+
1681
+
1682
+
1683
+				if (($handle = fopen($target_path, "r")) !== FALSE) {
1684
+					while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
1685
+						if(is_array($data) && !empty($data)) {
1686
+							$file[] = '"' . implode('","', $data) . '"';
1687
+						}
1688
+					}
1689
+					fclose($handle);
1690
+					$file = $file;
1691
+				}
1692
+
1693
+
1694
+
1695
+				$return['rows'] = (!empty($file) && count($file) > 1) ? count($file) - 1 : 0;
1696
+
1697
+
1698
+			if (!$return['rows'] > 0) {
1699
+				$return['error'] = __('No data found in csv file.', 'geodirectory');
1700
+			}
1701
+		}
1702
+	}
1703
+	if ($task == 'prepare' || !empty($return['error'])) {
1704
+		echo json_encode($return);
1705
+		exit;
1706
+	}
1707
+
1708
+	$totRecords = isset($_POST['gddata']['totRecords']) ? $_POST['gddata']['totRecords'] : NULL;
1709
+	$importlimit = isset($_POST['gddata']['importlimit']) ? $_POST['gddata']['importlimit'] : 1;
1710
+	$count = $importlimit;
1711
+	$requested_limit = $importlimit;
1712
+	$tmpCnt = isset($_POST['gddata']['tmpcount']) ? $_POST['gddata']['tmpcount'] : 0;
1713
+
1714
+	if ($count < $totRecords) {
1715
+		$count = $tmpCnt + $count;
1716
+		if ($count > $totRecords) {
1717
+			$count = $totRecords;
1718
+		}
1719
+	} else {
1720
+		$count = $totRecords;
1721
+	}
1722
+
1723
+	$total_records = 0;
1724
+	$rowcount = 0;
1725
+	$address_invalid = 0;
1726
+	$blank_address = 0;
1727
+	$upload_files = 0;
1728
+	$invalid_post_type = 0;
1729
+	$invalid_title = 0;
1730
+	$customKeyarray = array();
1731
+	$gd_post_info = array();
1732
+	$post_location = array();
1733
+	$countpost = 0;
1734
+
1735
+	if (!empty($file)) {
1736
+		$columns = isset($file[0]) ? geodir_str_getcsv($file[0]) : NULL;
1737
+		$customKeyarray = $columns;
1738
+
1739
+		if (empty($columns) || (!empty($columns) && $columns[0] == '')) {
1740
+			$return['error'] = CSV_INVAILD_FILE;
1741
+			echo json_encode($return);
1742
+			exit;
1743
+		}
1744
+
1745
+		for ($i = 1; $i <= $importlimit; $i++) {
1746
+			$current_index = $tmpCnt + $i;
1747
+			if (isset($file[$current_index])) {
1748
+				$total_records++;
1749
+
1750
+				$buffer = geodir_str_getcsv($file[$current_index]);
1751
+				$post_title = addslashes($buffer[0]);
1752
+				$current_post_author = $buffer[1];
1753
+				$post_desc = addslashes($buffer[2]);
1754
+				$post_cat = array();
1755
+				$catids_arr = array();
1756
+				$post_cat = trim($buffer[3]); // comma seperated category name
1757
+
1758
+				if ($post_cat) {
1759
+					$post_cat_arr = explode(',', $post_cat);
1760
+
1761
+					for ($c = 0; $c < count($post_cat_arr); $c++) {
1762
+						$catid = wp_kses_normalize_entities(trim($post_cat_arr[$c]));
1763
+
1764
+						if (!empty($buffer[5])) {
1765
+							if (in_array($buffer[5], geodir_get_posttypes())) {
1766
+
1767
+								$p_taxonomy = geodir_get_taxonomies(addslashes($buffer[5]));
1768
+
1769
+								if (get_term_by('name', $catid, $p_taxonomy[0])) {
1770
+									$cat = get_term_by('name', $catid, $p_taxonomy[0]);
1771
+									$catids_arr[] = $cat->slug;
1772
+								} else if (get_term_by('slug', $catid, $p_taxonomy[0])) {
1773
+									$cat = get_term_by('slug', $catid, $p_taxonomy[0]);
1774
+									$catids_arr[] = $cat->slug;
1775
+								} else {
1776
+									$ret = wp_insert_term($catid, $p_taxonomy[0]);
1777
+									if ($ret && !is_wp_error($ret)) {
1778
+										if (get_term_by('name', $catid, $p_taxonomy[0])) {
1779
+											$cat = get_term_by('name', $catid, $p_taxonomy[0]);
1780
+											$catids_arr[] = $cat->slug;
1781
+										} elseif (get_term_by('slug', $catid, $p_taxonomy[0])) {
1782
+											$cat = get_term_by('slug', $catid, $p_taxonomy[0]);
1783
+											$catids_arr[] = $cat->slug;
1784
+										}
1785
+									}
1786
+								}
1787
+							}
1788
+						}
1789
+					}
1790
+				}
1791
+
1792
+				if (!$catids_arr) {
1793
+					$catids_arr[] = 1;
1794
+				}
1795
+
1796
+				$post_tags = trim($buffer[4]); // comma seperated tags
1797
+
1798
+				$tag_arr = '';
1799
+				if ($post_tags) {
1800
+					$tag_arr = explode(',', $post_tags);
1801
+				}
1802
+
1803
+				$table = $plugin_prefix . $buffer[5] . '_detail'; // check table in database
1804
+
1805
+				$error = '';
1806
+				if ($wpdb->get_var("SHOW TABLES LIKE '" . $table . "'") != $table) {
1807
+					$invalid_post_type++;
1808
+					continue;
1809
+				}
1810
+
1811
+				if ($post_title != '') {
1812
+					$menu_order = 0;
1813
+					$image_folder_name = 'uplaod/';
1814
+
1815
+					$image_names = array();
1816
+
1817
+					for ($c = 5; $c < count($customKeyarray); $c++) {
1818
+						$gd_post_info[$customKeyarray[$c]] = addslashes($buffer[$c]);
1819
+
1820
+						if ($customKeyarray[$c] == 'IMAGE') {
1821
+							$buffer[$c] = trim($buffer[$c]);
1822
+
1823
+							if (!empty($buffer[$c])) {
1824
+								$image_names[] = $buffer[$c];
1825
+							}
1826
+						}
1827
+
1828
+						if ($customKeyarray[$c] == 'alive_days') {
1829
+							if ($buffer[$c] != '0' && $buffer[$c] != '') {
1830
+								$submitdata = date('Y-m-d');
1831
+
1832
+								$gd_post_info['expire_date'] = date('Y-m-d', strtotime($submitdata . "+" . addslashes($buffer[$c]) . " days"));
1833
+							} else {
1834
+								$gd_post_info['expire_date'] = 'Never';
1835
+							}
1836
+						}
1837
+
1838
+						if ($customKeyarray[$c] == 'post_city') {
1839
+							$post_city = addslashes($buffer[$c]);
1840
+						}
1841
+
1842
+						if ($customKeyarray[$c] == 'post_region') {
1843
+							$post_region = addslashes($buffer[$c]);
1844
+						}
1845
+
1846
+						if ($customKeyarray[$c] == 'post_country') {
1847
+							$post_country = addslashes($buffer[$c]);
1848
+						}
1849
+
1850
+						if ($customKeyarray[$c] == 'post_latitude') {
1851
+							$post_latitude = addslashes($buffer[$c]);
1852
+						}
1853
+
1854
+						if ($customKeyarray[$c] == 'post_longitude') {
1855
+							$post_longitude = addslashes($buffer[$c]);
1856
+						}
1857 1857
 						
1858 1858
 						// Post status
1859 1859
 						if ($customKeyarray[$c] == 'post_status') {
1860
-                            $post_status = sanitize_key( $buffer[$c] );
1861
-                        }
1862
-                    }
1863
-
1864
-                    /* ================ before array create ============== */
1865
-                    $location_result = geodir_get_default_location();
1866
-                    if ((!isset($gd_post_info['post_city']) || $gd_post_info['post_city'] == '') || (!isset($gd_post_info['post_region']) || $gd_post_info['post_region'] == '') || (!isset($gd_post_info['post_country']) || $gd_post_info['post_country'] == '') || (!isset($gd_post_info['post_address']) || $gd_post_info['post_address'] == '') || (!isset($gd_post_info['post_latitude']) || $gd_post_info['post_latitude'] == '') || (!isset($gd_post_info['post_longitude']) || $gd_post_info['post_longitude'] == '')) {
1867
-                        $blank_address++;
1868
-                        continue;
1869
-                    } else if ($location_result->location_id == 0) {
1870
-                        if ((geodir_strtolower($gd_post_info['post_city']) != geodir_strtolower($location_result->city)) || (geodir_strtolower($gd_post_info['post_region']) != geodir_strtolower($location_result->region)) || (geodir_strtolower($gd_post_info['post_country']) != geodir_strtolower($location_result->country))) {
1871
-                            $address_invalid++;
1872
-                            continue;
1873
-                        }
1874
-                    }
1860
+							$post_status = sanitize_key( $buffer[$c] );
1861
+						}
1862
+					}
1863
+
1864
+					/* ================ before array create ============== */
1865
+					$location_result = geodir_get_default_location();
1866
+					if ((!isset($gd_post_info['post_city']) || $gd_post_info['post_city'] == '') || (!isset($gd_post_info['post_region']) || $gd_post_info['post_region'] == '') || (!isset($gd_post_info['post_country']) || $gd_post_info['post_country'] == '') || (!isset($gd_post_info['post_address']) || $gd_post_info['post_address'] == '') || (!isset($gd_post_info['post_latitude']) || $gd_post_info['post_latitude'] == '') || (!isset($gd_post_info['post_longitude']) || $gd_post_info['post_longitude'] == '')) {
1867
+						$blank_address++;
1868
+						continue;
1869
+					} else if ($location_result->location_id == 0) {
1870
+						if ((geodir_strtolower($gd_post_info['post_city']) != geodir_strtolower($location_result->city)) || (geodir_strtolower($gd_post_info['post_region']) != geodir_strtolower($location_result->region)) || (geodir_strtolower($gd_post_info['post_country']) != geodir_strtolower($location_result->country))) {
1871
+							$address_invalid++;
1872
+							continue;
1873
+						}
1874
+					}
1875 1875
 					
1876 1876
 					// Default post status
1877 1877
 					$default_status = 'publish';
1878 1878
 					$post_status = !empty( $post_status ) ? sanitize_key( $post_status ) : $default_status;
1879 1879
 					$post_status = !empty( $wp_post_statuses ) && !isset( $wp_post_statuses[$post_status] ) ? $default_status : $post_status;
1880 1880
 
1881
-                    $my_post['post_title'] = $post_title;
1882
-                    $my_post['post_content'] = $post_desc;
1883
-                    $my_post['post_type'] = addslashes($buffer[5]);
1884
-                    $my_post['post_author'] = $current_post_author;
1885
-                    $my_post['post_status'] = $post_status;
1886
-                    $my_post['post_category'] = $catids_arr;
1887
-                    $my_post['post_tags'] = $tag_arr;
1888
-
1889
-                    $gd_post_info['post_tags'] = $tag_arr;
1890
-                    $gd_post_info['post_title'] = $post_title;
1891
-                    $gd_post_info['post_status'] = $post_status;
1892
-                    $gd_post_info['submit_time'] = time();
1893
-                    $gd_post_info['submit_ip'] = $_SERVER['REMOTE_ADDR'];
1894
-
1895
-                    $last_postid = wp_insert_post($my_post);
1896
-                    $countpost++;
1897
-
1898
-                    // Check if we need to save post location as new location
1899
-                    if ($location_result->location_id > 0) {
1900
-                        if (isset($post_city) && isset($post_region)) {
1901
-                            $request_info['post_location'] = array(
1902
-                                'city' => $post_city,
1903
-                                'region' => $post_region,
1904
-                                'country' => $post_country,
1905
-                                'geo_lat' => $post_latitude,
1906
-                                'geo_lng' => $post_longitude
1907
-                            );
1908
-
1909
-                            $post_location_info = $request_info['post_location'];
1910
-                            if ($location_id = geodir_add_new_location($post_location_info))
1911
-                                $post_location_id = $location_id;
1912
-                        } else {
1913
-                            $post_location_id = 0;
1914
-                        }
1915
-                    } else {
1916
-                        $post_location_id = 0;
1917
-                    }
1918
-
1919
-                    /* ------- get default package info ----- */
1920
-                    $payment_info = array();
1921
-                    $package_info = array();
1922
-
1923
-                    $package_info = (array)geodir_post_package_info($package_info, '', $buffer[5]);
1924
-                    $package_id = '';
1925
-                    if (isset($gd_post_info['package_id']) && $gd_post_info['package_id'] != '') {
1926
-                        $package_id = $gd_post_info['package_id'];
1927
-                    }
1928
-
1929
-                    if (!empty($package_info)) {
1930
-                        $payment_info['package_id'] = $package_info['pid'];
1931
-
1932
-                        if (isset($package_info['alive_days']) && $package_info['alive_days'] != 0) {
1933
-                            $payment_info['expire_date'] = date('Y-m-d', strtotime("+" . $package_info['alive_days'] . " days"));
1934
-                        } else {
1935
-                            $payment_info['expire_date'] = 'Never';
1936
-                        }
1937
-
1938
-                        $gd_post_info = array_merge($gd_post_info, $payment_info);
1939
-                    }
1940
-
1941
-                    $gd_post_info['post_location_id'] = $post_location_id;
1942
-
1943
-                    $post_type = get_post_type($last_postid);
1944
-
1945
-                    $table = $plugin_prefix . $post_type . '_detail';
1946
-
1947
-                    geodir_save_post_info($last_postid, $gd_post_info);
1948
-
1949
-                    if (!empty($image_names)) {
1950
-                        $upload_files++;
1951
-                        $menu_order = 1;
1952
-
1953
-                        foreach ($image_names as $image_name) {
1954
-                            $img_name_arr = explode('.', $image_name);
1955
-
1956
-                            $uploads = wp_upload_dir();
1957
-                            $sub_dir = $uploads['subdir'];
1958
-
1959
-                            $arr_file_type = wp_check_filetype($image_name);
1960
-                            $uploaded_file_type = $arr_file_type['type'];
1961
-
1962
-                            $attachment = array();
1963
-                            $attachment['post_id'] = $last_postid;
1964
-                            $attachment['title'] = $img_name_arr[0];
1965
-                            $attachment['content'] = '';
1966
-                            $attachment['file'] = $sub_dir . '/' . $image_name;
1967
-                            $attachment['mime_type'] = $uploaded_file_type;
1968
-                            $attachment['menu_order'] = $menu_order;
1969
-                            $attachment['is_featured'] = 0;
1970
-
1971
-                            $attachment_set = '';
1972
-
1973
-                            foreach ($attachment as $key => $val) {
1974
-                                if ($val != '')
1975
-                                    $attachment_set .= $key . " = '" . $val . "', ";
1976
-                            }
1977
-                            $attachment_set = trim($attachment_set, ", ");
1978
-
1979
-                            $wpdb->query("INSERT INTO " . GEODIR_ATTACHMENT_TABLE . " SET " . $attachment_set);
1980
-
1981
-                            if ($menu_order == 1) {
1982
-                                $post_type = get_post_type($last_postid);
1983
-                                $wpdb->query($wpdb->prepare("UPDATE " . $table . " SET featured_image = %s where post_id =%d", array($sub_dir . '/' . $image_name, $last_postid)));
1984
-                            }
1985
-                            $menu_order++;
1986
-                        }
1987
-                    }
1988
-
1989
-                    $gd_post_info['package_id'] = $package_id;
1990
-
1991
-                    /** This action is documented in geodirectory-functions/post-functions.php */
1992
-                    do_action('geodir_after_save_listing', $last_postid, $gd_post_info);
1993
-
1994
-                    if (!empty($buffer[5])) {
1995
-                        if (in_array($buffer[5], geodir_get_posttypes())) {
1996
-                            $taxonomies = geodir_get_posttype_info(addslashes($buffer[5]));
1997
-                            wp_set_object_terms($last_postid, $my_post['post_tags'], $taxonomy = $taxonomies['taxonomies'][1]);
1998
-                            wp_set_object_terms($last_postid, $my_post['post_category'], $taxonomy = $taxonomies['taxonomies'][0]);
1999
-
2000
-                            $post_default_category = isset($my_post['post_default_category']) ? $my_post['post_default_category'] : '';
2001
-                            $post_category_str = isset($my_post['post_category_str']) ? $my_post['post_category_str'] : '';
2002
-                            geodir_set_postcat_structure($last_postid, $taxonomy, $post_default_category, $post_category_str);
2003
-                        }
2004
-                    }
2005
-                } else {
2006
-                    $invalid_title++;
2007
-                }
2008
-            }
2009
-        }
2010
-    }
2011
-    $return['rowcount'] = $countpost;
2012
-    $return['invalidcount'] = $address_invalid;
2013
-    $return['blank_address'] = $blank_address;
2014
-    $return['upload_files'] = $upload_files;
2015
-    $return['invalid_post_type'] = $invalid_post_type;
2016
-    $return['invalid_title'] = $invalid_title;
2017
-    $return['total_records'] = $total_records;
2018
-
2019
-    echo json_encode($return);
2020
-    exit;
1881
+					$my_post['post_title'] = $post_title;
1882
+					$my_post['post_content'] = $post_desc;
1883
+					$my_post['post_type'] = addslashes($buffer[5]);
1884
+					$my_post['post_author'] = $current_post_author;
1885
+					$my_post['post_status'] = $post_status;
1886
+					$my_post['post_category'] = $catids_arr;
1887
+					$my_post['post_tags'] = $tag_arr;
1888
+
1889
+					$gd_post_info['post_tags'] = $tag_arr;
1890
+					$gd_post_info['post_title'] = $post_title;
1891
+					$gd_post_info['post_status'] = $post_status;
1892
+					$gd_post_info['submit_time'] = time();
1893
+					$gd_post_info['submit_ip'] = $_SERVER['REMOTE_ADDR'];
1894
+
1895
+					$last_postid = wp_insert_post($my_post);
1896
+					$countpost++;
1897
+
1898
+					// Check if we need to save post location as new location
1899
+					if ($location_result->location_id > 0) {
1900
+						if (isset($post_city) && isset($post_region)) {
1901
+							$request_info['post_location'] = array(
1902
+								'city' => $post_city,
1903
+								'region' => $post_region,
1904
+								'country' => $post_country,
1905
+								'geo_lat' => $post_latitude,
1906
+								'geo_lng' => $post_longitude
1907
+							);
1908
+
1909
+							$post_location_info = $request_info['post_location'];
1910
+							if ($location_id = geodir_add_new_location($post_location_info))
1911
+								$post_location_id = $location_id;
1912
+						} else {
1913
+							$post_location_id = 0;
1914
+						}
1915
+					} else {
1916
+						$post_location_id = 0;
1917
+					}
1918
+
1919
+					/* ------- get default package info ----- */
1920
+					$payment_info = array();
1921
+					$package_info = array();
1922
+
1923
+					$package_info = (array)geodir_post_package_info($package_info, '', $buffer[5]);
1924
+					$package_id = '';
1925
+					if (isset($gd_post_info['package_id']) && $gd_post_info['package_id'] != '') {
1926
+						$package_id = $gd_post_info['package_id'];
1927
+					}
1928
+
1929
+					if (!empty($package_info)) {
1930
+						$payment_info['package_id'] = $package_info['pid'];
1931
+
1932
+						if (isset($package_info['alive_days']) && $package_info['alive_days'] != 0) {
1933
+							$payment_info['expire_date'] = date('Y-m-d', strtotime("+" . $package_info['alive_days'] . " days"));
1934
+						} else {
1935
+							$payment_info['expire_date'] = 'Never';
1936
+						}
1937
+
1938
+						$gd_post_info = array_merge($gd_post_info, $payment_info);
1939
+					}
1940
+
1941
+					$gd_post_info['post_location_id'] = $post_location_id;
1942
+
1943
+					$post_type = get_post_type($last_postid);
1944
+
1945
+					$table = $plugin_prefix . $post_type . '_detail';
1946
+
1947
+					geodir_save_post_info($last_postid, $gd_post_info);
1948
+
1949
+					if (!empty($image_names)) {
1950
+						$upload_files++;
1951
+						$menu_order = 1;
1952
+
1953
+						foreach ($image_names as $image_name) {
1954
+							$img_name_arr = explode('.', $image_name);
1955
+
1956
+							$uploads = wp_upload_dir();
1957
+							$sub_dir = $uploads['subdir'];
1958
+
1959
+							$arr_file_type = wp_check_filetype($image_name);
1960
+							$uploaded_file_type = $arr_file_type['type'];
1961
+
1962
+							$attachment = array();
1963
+							$attachment['post_id'] = $last_postid;
1964
+							$attachment['title'] = $img_name_arr[0];
1965
+							$attachment['content'] = '';
1966
+							$attachment['file'] = $sub_dir . '/' . $image_name;
1967
+							$attachment['mime_type'] = $uploaded_file_type;
1968
+							$attachment['menu_order'] = $menu_order;
1969
+							$attachment['is_featured'] = 0;
1970
+
1971
+							$attachment_set = '';
1972
+
1973
+							foreach ($attachment as $key => $val) {
1974
+								if ($val != '')
1975
+									$attachment_set .= $key . " = '" . $val . "', ";
1976
+							}
1977
+							$attachment_set = trim($attachment_set, ", ");
1978
+
1979
+							$wpdb->query("INSERT INTO " . GEODIR_ATTACHMENT_TABLE . " SET " . $attachment_set);
1980
+
1981
+							if ($menu_order == 1) {
1982
+								$post_type = get_post_type($last_postid);
1983
+								$wpdb->query($wpdb->prepare("UPDATE " . $table . " SET featured_image = %s where post_id =%d", array($sub_dir . '/' . $image_name, $last_postid)));
1984
+							}
1985
+							$menu_order++;
1986
+						}
1987
+					}
1988
+
1989
+					$gd_post_info['package_id'] = $package_id;
1990
+
1991
+					/** This action is documented in geodirectory-functions/post-functions.php */
1992
+					do_action('geodir_after_save_listing', $last_postid, $gd_post_info);
1993
+
1994
+					if (!empty($buffer[5])) {
1995
+						if (in_array($buffer[5], geodir_get_posttypes())) {
1996
+							$taxonomies = geodir_get_posttype_info(addslashes($buffer[5]));
1997
+							wp_set_object_terms($last_postid, $my_post['post_tags'], $taxonomy = $taxonomies['taxonomies'][1]);
1998
+							wp_set_object_terms($last_postid, $my_post['post_category'], $taxonomy = $taxonomies['taxonomies'][0]);
1999
+
2000
+							$post_default_category = isset($my_post['post_default_category']) ? $my_post['post_default_category'] : '';
2001
+							$post_category_str = isset($my_post['post_category_str']) ? $my_post['post_category_str'] : '';
2002
+							geodir_set_postcat_structure($last_postid, $taxonomy, $post_default_category, $post_category_str);
2003
+						}
2004
+					}
2005
+				} else {
2006
+					$invalid_title++;
2007
+				}
2008
+			}
2009
+		}
2010
+	}
2011
+	$return['rowcount'] = $countpost;
2012
+	$return['invalidcount'] = $address_invalid;
2013
+	$return['blank_address'] = $blank_address;
2014
+	$return['upload_files'] = $upload_files;
2015
+	$return['invalid_post_type'] = $invalid_post_type;
2016
+	$return['invalid_title'] = $invalid_title;
2017
+	$return['total_records'] = $total_records;
2018
+
2019
+	echo json_encode($return);
2020
+	exit;
2021 2021
 }
2022 2022
 
2023 2023
 // Add the tab in left sidebar menu fro import & export page.
@@ -2037,9 +2037,9 @@  discard block
 block discarded – undo
2037 2037
  * @param $post object $post The post object of the post being saved.
2038 2038
  */
2039 2039
 function geodir_update_location_prefix($post_id,$post){
2040
-    if($post->post_type=='page' && $post->post_name && $post_id==get_option('geodir_location_page')){
2041
-        update_option('geodir_location_prefix',$post->post_name);
2042
-    }
2040
+	if($post->post_type=='page' && $post->post_name && $post_id==get_option('geodir_location_page')){
2041
+		update_option('geodir_location_prefix',$post->post_name);
2042
+	}
2043 2043
 
2044 2044
 }
2045 2045
 
@@ -2050,50 +2050,50 @@  discard block
 block discarded – undo
2050 2050
 function geodir_ga_callback(){
2051 2051
 
2052 2052
 if(isset($_REQUEST['code']) && $_REQUEST['code']) {
2053
-    $oAuthURL = "https://www.googleapis.com/oauth2/v3/token?";
2054
-    $code = "code=".$_REQUEST['code'];
2055
-    $grant_type = "&grant_type=authorization_code";
2056
-    $redirect_uri = "&redirect_uri=" . admin_url('admin-ajax.php') . "?action=geodir_ga_callback";
2057
-    $client_id = "&client_id=".get_option('geodir_ga_client_id');
2058
-    $client_secret = "&client_secret=".get_option('geodir_ga_client_secret');
2053
+	$oAuthURL = "https://www.googleapis.com/oauth2/v3/token?";
2054
+	$code = "code=".$_REQUEST['code'];
2055
+	$grant_type = "&grant_type=authorization_code";
2056
+	$redirect_uri = "&redirect_uri=" . admin_url('admin-ajax.php') . "?action=geodir_ga_callback";
2057
+	$client_id = "&client_id=".get_option('geodir_ga_client_id');
2058
+	$client_secret = "&client_secret=".get_option('geodir_ga_client_secret');
2059 2059
 
2060
-    $auth_url = $oAuthURL . $code . $redirect_uri .  $grant_type . $client_id .$client_secret;
2060
+	$auth_url = $oAuthURL . $code . $redirect_uri .  $grant_type . $client_id .$client_secret;
2061 2061
 
2062
-    $response = wp_remote_post($auth_url, array('timeout' => 15));
2062
+	$response = wp_remote_post($auth_url, array('timeout' => 15));
2063 2063
 
2064
-    //print_r($response);
2064
+	//print_r($response);
2065 2065
 
2066
-    $error_msg =  __('Something went wrong','geodirectory');
2067
-    if(!empty($response['response']['code']) && $response['response']['code']==200){
2066
+	$error_msg =  __('Something went wrong','geodirectory');
2067
+	if(!empty($response['response']['code']) && $response['response']['code']==200){
2068 2068
 
2069
-        $parts = json_decode($response['body']);
2070
-        //print_r($parts);
2071
-        if(!isset($parts->access_token)){echo $error_msg." - #1";exit;}
2072
-        else{
2069
+		$parts = json_decode($response['body']);
2070
+		//print_r($parts);
2071
+		if(!isset($parts->access_token)){echo $error_msg." - #1";exit;}
2072
+		else{
2073 2073
 
2074
-            update_option('gd_ga_access_token', $parts->access_token);
2075
-            update_option('gd_ga_refresh_token', $parts->refresh_token);
2076
-            ?><script>window.close();</script><?php
2077
-        }
2074
+			update_option('gd_ga_access_token', $parts->access_token);
2075
+			update_option('gd_ga_refresh_token', $parts->refresh_token);
2076
+			?><script>window.close();</script><?php
2077
+		}
2078 2078
 
2079 2079
 
2080
-    }
2081
-    elseif(!empty($response['response']['code'])) {
2082
-        $parts = json_decode($response['body']);
2080
+	}
2081
+	elseif(!empty($response['response']['code'])) {
2082
+		$parts = json_decode($response['body']);
2083 2083
 
2084
-        if(isset($parts->error)){
2085
-            echo $parts->error.": ".$parts->error_description;exit;
2086
-        }else{
2087
-            echo $error_msg." - #2";exit;
2088
-        }
2084
+		if(isset($parts->error)){
2085
+			echo $parts->error.": ".$parts->error_description;exit;
2086
+		}else{
2087
+			echo $error_msg." - #2";exit;
2088
+		}
2089 2089
 
2090
-    }else{
2090
+	}else{
2091 2091
 
2092
-        echo $error_msg." - #3";exit;
2092
+		echo $error_msg." - #3";exit;
2093 2093
 
2094
-    }
2094
+	}
2095 2095
 }
2096
-    exit;
2096
+	exit;
2097 2097
 }
2098 2098
 
2099 2099
 add_filter( 'icl_make_duplicate', 'geodir_icl_make_duplicate', 11, 4 );
Please login to merge, or discard this patch.
geodirectory-admin/admin_install.php 1 patch
Indentation   +167 added lines, -167 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * GeoDirectory Installation related functions.
4
- *
5
- * Plugin install script which adds default pages, taxonomies, and database tables.
6
- *
7
- * @since 1.0.0
8
- * @package GeoDirectory
9
- */
3
+	 * GeoDirectory Installation related functions.
4
+	 *
5
+	 * Plugin install script which adds default pages, taxonomies, and database tables.
6
+	 *
7
+	 * @since 1.0.0
8
+	 * @package GeoDirectory
9
+	 */
10 10
 
11 11
 /**
12 12
  * Include custom database table related functions.
@@ -24,8 +24,8 @@  discard block
 block discarded – undo
24 24
 function geodir_activation()
25 25
 {
26 26
 
27
-    geodir_install();
28
-    add_action('wp_loaded', 'geodir_flush_activation');
27
+	geodir_install();
28
+	add_action('wp_loaded', 'geodir_flush_activation');
29 29
 }
30 30
 
31 31
 /**
@@ -36,9 +36,9 @@  discard block
 block discarded – undo
36 36
  */
37 37
 function geodir_flush_activation()
38 38
 {
39
-    // Remove rewrite rules and then recreate rewrite rules.
40
-    // flush late so everything is loaded
41
-    flush_rewrite_rules();
39
+	// Remove rewrite rules and then recreate rewrite rules.
40
+	// flush late so everything is loaded
41
+	flush_rewrite_rules();
42 42
 }
43 43
 
44 44
 /**
@@ -50,44 +50,44 @@  discard block
 block discarded – undo
50 50
  */
51 51
 function geodir_install()
52 52
 {
53
-    global $geodir_settings;
54
-
55
-    /**
56
-     * Called before the GD installation scripts have run.
57
-     *
58
-     * @since 1.0.0
59
-     * @see 'geodir_installation_end'
60
-     */
61
-    do_action('geodir_installation_start');
62
-
63
-    // Do install
64
-    if (!get_option('geodir_default_data_installed')) {
65
-        geodir_create_tables(); // in admin db install.php
66
-        geodir_register_defaults(); // geodir_functions/ taxonomy_functions.php
67
-        geodir_create_default_fields();
68
-        //geodir_default_taxonomies();
69
-        geodir_set_default_options();
70
-        geodir_create_pages();
71
-        geodir_set_default_widgets();
72
-        gd_install_theme_compat();
73
-
74
-        update_option('geodir_default_data_installed', 1);
75
-
76
-    }
77
-
78
-    if (!get_option('geodir_default_data_installed_1.2.8')) {
79
-        //geodir_create_tables(); // in admin db install.php
80
-        update_option('geodir_default_data_installed_1.2.8', 1);
81
-    }
82
-
83
-    geodir_installation_end();
84
-    /**
85
-     * Called after the GD installation scripts have run.
86
-     *
87
-     * @since 1.0.0
88
-     * @see 'geodir_installation_start'
89
-     */
90
-    do_action('geodir_installation_end');
53
+	global $geodir_settings;
54
+
55
+	/**
56
+	 * Called before the GD installation scripts have run.
57
+	 *
58
+	 * @since 1.0.0
59
+	 * @see 'geodir_installation_end'
60
+	 */
61
+	do_action('geodir_installation_start');
62
+
63
+	// Do install
64
+	if (!get_option('geodir_default_data_installed')) {
65
+		geodir_create_tables(); // in admin db install.php
66
+		geodir_register_defaults(); // geodir_functions/ taxonomy_functions.php
67
+		geodir_create_default_fields();
68
+		//geodir_default_taxonomies();
69
+		geodir_set_default_options();
70
+		geodir_create_pages();
71
+		geodir_set_default_widgets();
72
+		gd_install_theme_compat();
73
+
74
+		update_option('geodir_default_data_installed', 1);
75
+
76
+	}
77
+
78
+	if (!get_option('geodir_default_data_installed_1.2.8')) {
79
+		//geodir_create_tables(); // in admin db install.php
80
+		update_option('geodir_default_data_installed_1.2.8', 1);
81
+	}
82
+
83
+	geodir_installation_end();
84
+	/**
85
+	 * Called after the GD installation scripts have run.
86
+	 *
87
+	 * @since 1.0.0
88
+	 * @see 'geodir_installation_start'
89
+	 */
90
+	do_action('geodir_installation_end');
91 91
 
92 92
 
93 93
 }
@@ -104,16 +104,16 @@  discard block
 block discarded – undo
104 104
 function geodir_create_pages()
105 105
 {
106 106
 
107
-    //geodir_create_page( esc_sql( _x('home-map', 'page_slug', 'geodirectory') ), 'geodir_home_map_page', __('Home Map', 'geodirectory'), '',0,'publish' );
108
-    geodir_create_page(esc_sql(_x('gd-home', 'page_slug', 'geodirectory')), 'geodir_home_page', __('GD Home page', 'geodirectory'), '');
109
-    geodir_create_page(esc_sql(_x('add-listing', 'page_slug', 'geodirectory')), 'geodir_add_listing_page', __('Add Listing', 'geodirectory'), '');
110
-    geodir_create_page(esc_sql(_x('listing-preview', 'page_slug', 'geodirectory')), 'geodir_preview_page', __('Listing Preview', 'geodirectory'), '');
111
-    geodir_create_page(esc_sql(_x('listing-success', 'page_slug', 'geodirectory')), 'geodir_success_page', __('Listing Success', 'geodirectory'), '');
112
-    geodir_create_page(esc_sql(_x('location', 'page_slug', 'geodirectory')), 'geodir_location_page', __('Location', 'geodirectory'), '');
107
+	//geodir_create_page( esc_sql( _x('home-map', 'page_slug', 'geodirectory') ), 'geodir_home_map_page', __('Home Map', 'geodirectory'), '',0,'publish' );
108
+	geodir_create_page(esc_sql(_x('gd-home', 'page_slug', 'geodirectory')), 'geodir_home_page', __('GD Home page', 'geodirectory'), '');
109
+	geodir_create_page(esc_sql(_x('add-listing', 'page_slug', 'geodirectory')), 'geodir_add_listing_page', __('Add Listing', 'geodirectory'), '');
110
+	geodir_create_page(esc_sql(_x('listing-preview', 'page_slug', 'geodirectory')), 'geodir_preview_page', __('Listing Preview', 'geodirectory'), '');
111
+	geodir_create_page(esc_sql(_x('listing-success', 'page_slug', 'geodirectory')), 'geodir_success_page', __('Listing Success', 'geodirectory'), '');
112
+	geodir_create_page(esc_sql(_x('location', 'page_slug', 'geodirectory')), 'geodir_location_page', __('Location', 'geodirectory'), '');
113 113
 
114
-    //New since 1.5.3
115
-    geodir_create_page(esc_sql(_x('gd-info', 'page_slug', 'geodirectory')), 'geodir_info_page', __('Info', 'geodirectory'), '');
116
-    geodir_create_page(esc_sql(_x('gd-login', 'page_slug', 'geodirectory')), 'geodir_login_page', __('Login', 'geodirectory'), '');
114
+	//New since 1.5.3
115
+	geodir_create_page(esc_sql(_x('gd-info', 'page_slug', 'geodirectory')), 'geodir_info_page', __('Info', 'geodirectory'), '');
116
+	geodir_create_page(esc_sql(_x('gd-login', 'page_slug', 'geodirectory')), 'geodir_login_page', __('Login', 'geodirectory'), '');
117 117
 
118 118
 
119 119
 }
@@ -129,11 +129,11 @@  discard block
 block discarded – undo
129 129
  */
130 130
 function geodir_installation_end()
131 131
 {
132
-    //update_option( "geodir_db_version", GEODIRECTORY_VERSION );
132
+	//update_option( "geodir_db_version", GEODIRECTORY_VERSION );
133 133
 
134
-    update_option("geodir_installed", 1);
135
-    update_option("geodir_installation_redirect", 1);
136
-    update_option('skip_install_geodir_pages', 0);
134
+	update_option("geodir_installed", 1);
135
+	update_option("geodir_installation_redirect", 1);
136
+	update_option('skip_install_geodir_pages', 0);
137 137
 }
138 138
 
139 139
 /**
@@ -147,45 +147,45 @@  discard block
 block discarded – undo
147 147
  */
148 148
 function geodir_set_default_options()
149 149
 {
150
-    global $geodir_settings;
151
-    /**
152
-     * Contains settings array for general tab.
153
-     *
154
-     * @since 1.0.0
155
-     * @package GeoDirectory
156
-     */
157
-    include_once("option-pages/general_settings_array.php");
158
-    /**
159
-     * Contains settings array for design tab.
160
-     *
161
-     * @since 1.0.0
162
-     * @package GeoDirectory
163
-     */
164
-    include_once("option-pages/design_settings_array.php");
165
-    /**
166
-     * Contains settings array for notifications tab.
167
-     *
168
-     * @since 1.0.0
169
-     * @package GeoDirectory
170
-     */
171
-    include_once("option-pages/notifications_settings_array.php");
172
-    /**
173
-     * Contains settings array for permalink tab.
174
-     *
175
-     * @since 1.0.0
176
-     * @package GeoDirectory
177
-     */
178
-    include_once("option-pages/permalink_settings_array.php");
179
-    /**
180
-     * Contains settings array for title / meta tab.
181
-     *
182
-     * @since 1.5.4
183
-     * @package GeoDirectory
184
-     */
185
-    include_once("option-pages/title_meta_settings_array.php");
186
-    foreach ($geodir_settings as $value) {
187
-        geodir_update_options($value, true);
188
-    }
150
+	global $geodir_settings;
151
+	/**
152
+	 * Contains settings array for general tab.
153
+	 *
154
+	 * @since 1.0.0
155
+	 * @package GeoDirectory
156
+	 */
157
+	include_once("option-pages/general_settings_array.php");
158
+	/**
159
+	 * Contains settings array for design tab.
160
+	 *
161
+	 * @since 1.0.0
162
+	 * @package GeoDirectory
163
+	 */
164
+	include_once("option-pages/design_settings_array.php");
165
+	/**
166
+	 * Contains settings array for notifications tab.
167
+	 *
168
+	 * @since 1.0.0
169
+	 * @package GeoDirectory
170
+	 */
171
+	include_once("option-pages/notifications_settings_array.php");
172
+	/**
173
+	 * Contains settings array for permalink tab.
174
+	 *
175
+	 * @since 1.0.0
176
+	 * @package GeoDirectory
177
+	 */
178
+	include_once("option-pages/permalink_settings_array.php");
179
+	/**
180
+	 * Contains settings array for title / meta tab.
181
+	 *
182
+	 * @since 1.5.4
183
+	 * @package GeoDirectory
184
+	 */
185
+	include_once("option-pages/title_meta_settings_array.php");
186
+	foreach ($geodir_settings as $value) {
187
+		geodir_update_options($value, true);
188
+	}
189 189
 
190 190
 }
191 191
 
@@ -199,103 +199,103 @@  discard block
 block discarded – undo
199 199
 function geodir_set_default_widgets()
200 200
 {
201 201
 
202
-    $widget_option_list = array();
203
-    $widgetinfo = array();
204
-    $sidebarvalue_array = array();
205
-    $sidebars_widgets = array();
202
+	$widget_option_list = array();
203
+	$widgetinfo = array();
204
+	$sidebarvalue_array = array();
205
+	$sidebars_widgets = array();
206 206
 
207
-    /*===========================*/
208
-    /*  Widgets ON HOME PAGE     */
209
-    /*===========================*/
207
+	/*===========================*/
208
+	/*  Widgets ON HOME PAGE     */
209
+	/*===========================*/
210 210
 
211
-    $widget_option_list['geodir_home_top'] =
212
-        array('popular_post_category' => array("title" => __('Popular Categories', 'geodirectory')),
213
-            'geodir_map_v3_home_map' => array("autozoom" => 1, "width" => '100%', "heigh" => '425'),
214
-            'geodir_advance_search' => array());
211
+	$widget_option_list['geodir_home_top'] =
212
+		array('popular_post_category' => array("title" => __('Popular Categories', 'geodirectory')),
213
+			'geodir_map_v3_home_map' => array("autozoom" => 1, "width" => '100%', "heigh" => '425'),
214
+			'geodir_advance_search' => array());
215 215
 
216
-    $widget_option_list['geodir_home_content'] =
217
-        array('popular_post_view' => array("title" => __('Popular Places', 'geodirectory'), "layout" => 'list', "add_location_filter" => '1'));
216
+	$widget_option_list['geodir_home_content'] =
217
+		array('popular_post_view' => array("title" => __('Popular Places', 'geodirectory'), "layout" => 'list', "add_location_filter" => '1'));
218 218
 
219
-    $widget_option_list['geodir_home_right'] =
220
-        array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')),
221
-            'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1'));
219
+	$widget_option_list['geodir_home_right'] =
220
+		array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')),
221
+			'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1'));
222 222
 
223
-    /*===========================*/
224
-    /*  Widgets ON LISTING PAGE     */
225
-    /*===========================*/
223
+	/*===========================*/
224
+	/*  Widgets ON LISTING PAGE     */
225
+	/*===========================*/
226 226
 
227
-    $widget_option_list['geodir_listing_top'] =
228
-        array('popular_post_category' => array("title" => __('Popular Categories', 'geodirectory')),
229
-            'geodir_advance_search' => array());
227
+	$widget_option_list['geodir_listing_top'] =
228
+		array('popular_post_category' => array("title" => __('Popular Categories', 'geodirectory')),
229
+			'geodir_advance_search' => array());
230 230
 
231
-    $widget_option_list['geodir_listing_right_sidebar'] =
232
-        array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')),
233
-            'geodir_map_v3_listing_map' => array("autozoom" => 1, "sticky" => 1),
234
-            'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1'));
231
+	$widget_option_list['geodir_listing_right_sidebar'] =
232
+		array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')),
233
+			'geodir_map_v3_listing_map' => array("autozoom" => 1, "sticky" => 1),
234
+			'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1'));
235 235
 
236 236
 
237
-    /*===========================*/
238
-    /*  Widgets ON SEARCH PAGE     */
239
-    /*===========================*/
237
+	/*===========================*/
238
+	/*  Widgets ON SEARCH PAGE     */
239
+	/*===========================*/
240 240
 
241
-    $widget_option_list['geodir_search_top'] =
242
-        array('popular_post_category' => array("title" => __('Popular Categories', 'geodirectory')),
243
-            'geodir_advance_search' => array());
241
+	$widget_option_list['geodir_search_top'] =
242
+		array('popular_post_category' => array("title" => __('Popular Categories', 'geodirectory')),
243
+			'geodir_advance_search' => array());
244 244
 
245
-    $widget_option_list['geodir_search_right_sidebar'] =
246
-        array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')),
247
-            'geodir_map_v3_listing_map' => array("autozoom" => 1, "sticky" => 1),
248
-            'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1'));
245
+	$widget_option_list['geodir_search_right_sidebar'] =
246
+		array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')),
247
+			'geodir_map_v3_listing_map' => array("autozoom" => 1, "sticky" => 1),
248
+			'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1'));
249 249
 
250
-    /*===========================*/
251
-    /*  Widgets ON DETAIL/SINGLE PAGE     */
252
-    /*===========================*/
250
+	/*===========================*/
251
+	/*  Widgets ON DETAIL/SINGLE PAGE     */
252
+	/*===========================*/
253 253
 
254
-    $widget_option_list['geodir_detail_sidebar'] =
255
-        array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')),
256
-            'geodir_map_v3_listing_map' => array("autozoom" => 1, "sticky" => 1),
257
-            'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1'));
254
+	$widget_option_list['geodir_detail_sidebar'] =
255
+		array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')),
256
+			'geodir_map_v3_listing_map' => array("autozoom" => 1, "sticky" => 1),
257
+			'popular_post_view' => array("title" => __('Latest Places', 'geodirectory'), "add_location_filter" => '1'));
258 258
 
259 259
 
260
-    /*===========================*/
261
-    /*  Widgets ON AUTHOR PAGE     */
262
-    /*===========================*/
260
+	/*===========================*/
261
+	/*  Widgets ON AUTHOR PAGE     */
262
+	/*===========================*/
263 263
 
264 264
 
265
-    $widget_option_list['geodir_author_right_sidebar'] =
266
-        array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')));
265
+	$widget_option_list['geodir_author_right_sidebar'] =
266
+		array('geodir_loginbox' => array("title" => __('My Dashboard', 'geodirectory')));
267 267
 
268 268
 
269
-    $sidebars_widgets = get_option('sidebars_widgets');
269
+	$sidebars_widgets = get_option('sidebars_widgets');
270 270
 
271
-    foreach ($widget_option_list as $key => $widget_options) {
271
+	foreach ($widget_option_list as $key => $widget_options) {
272 272
 
273
-        foreach ($widget_options as $key2 => $widget_options_obj) {
274
-            $widgetid = 'widget_' . $key2;
273
+		foreach ($widget_options as $key2 => $widget_options_obj) {
274
+			$widgetid = 'widget_' . $key2;
275 275
 
276
-            $widgetinfo[$widgetid][] = $widget_options_obj;
276
+			$widgetinfo[$widgetid][] = $widget_options_obj;
277 277
 
278
-            $sidebarvalue_array[$key][] = $key2 . "-" . (count($widgetinfo[$widgetid]));
278
+			$sidebarvalue_array[$key][] = $key2 . "-" . (count($widgetinfo[$widgetid]));
279 279
 
280
-            $widget_update[$widgetid][count($widgetinfo[$widgetid])] = $widget_options_obj;
280
+			$widget_update[$widgetid][count($widgetinfo[$widgetid])] = $widget_options_obj;
281 281
 
282
-        }
282
+		}
283 283
 
284
-        if (!empty($sidebarvalue_array[$key])) {
284
+		if (!empty($sidebarvalue_array[$key])) {
285 285
 
286
-            $sidebars_widgets = get_option('sidebars_widgets');
287
-            $sidebars_widgets[$key] = $sidebarvalue_array[$key];
288
-            update_option('sidebars_widgets', $sidebars_widgets);
286
+			$sidebars_widgets = get_option('sidebars_widgets');
287
+			$sidebars_widgets[$key] = $sidebarvalue_array[$key];
288
+			update_option('sidebars_widgets', $sidebars_widgets);
289 289
 
290
-            foreach ($widget_update as $key => $value) {
290
+			foreach ($widget_update as $key => $value) {
291 291
 
292
-                update_option($key, $value);
292
+				update_option($key, $value);
293 293
 
294
-            }
294
+			}
295 295
 
296
-        }
296
+		}
297 297
 
298
-    }
298
+	}
299 299
 
300 300
 
301 301
 }
Please login to merge, or discard this patch.
geodirectory-admin/geodir_admin_ajax.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -13,14 +13,14 @@
 block discarded – undo
13 13
 	 * @since 1.0.0
14 14
 	 */
15 15
 	include_once(geodir_plugin_path() . '/geodirectory-admin/option-pages/create_field.php');
16
-    die;
16
+	die;
17 17
 }
18 18
 
19 19
 
20 20
 if (isset($_REQUEST['ajax_action']) && $_REQUEST['ajax_action'] != '') {
21
-    switch ($_REQUEST['ajax_action']):
22
-        case 'get_cat_dl':
23
-            geodir_get_categories_dl($_REQUEST['post_type'], $_REQUEST['selected'], false, true);
24
-            break;
25
-    endswitch;
21
+	switch ($_REQUEST['ajax_action']):
22
+		case 'get_cat_dl':
23
+			geodir_get_categories_dl($_REQUEST['post_type'], $_REQUEST['selected'], false, true);
24
+			break;
25
+	endswitch;
26 26
 }
27 27
\ No newline at end of file
Please login to merge, or discard this patch.
geodirectory-admin/option-pages/create_field.php 1 patch
Indentation   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Creates custom fields
4
- *
5
- * @since 1.0.0
6
- * @package GeoDirectory
7
- */
3
+	 * Creates custom fields
4
+	 *
5
+	 * @since 1.0.0
6
+	 * @package GeoDirectory
7
+	 */
8 8
 
9 9
 $data_type = isset($_REQUEST['data_type']) ? sanitize_text_field($_REQUEST['data_type']) : '';
10 10
 $field_type = isset($_REQUEST['field_type']) ? sanitize_text_field($_REQUEST['field_type']) : '';
@@ -15,95 +15,95 @@  discard block
 block discarded – undo
15 15
 
16 16
 $field_ids = array();
17 17
 if (!empty($_REQUEST['licontainer']) && is_array($_REQUEST['licontainer'])) {
18
-    foreach ($_REQUEST['licontainer'] as $lic_id) {
19
-        $field_ids[] = sanitize_text_field($lic_id);
20
-    }
18
+	foreach ($_REQUEST['licontainer'] as $lic_id) {
19
+		$field_ids[] = sanitize_text_field($lic_id);
20
+	}
21 21
 }
22 22
 
23 23
 /* ------- check nonce field ------- */
24 24
 if (isset($_REQUEST['update']) && $_REQUEST['update'] == "update" && isset($_REQUEST['create_field']) && isset($_REQUEST['manage_field_type']) && $_REQUEST['manage_field_type'] == 'custom_fields') {
25
-    echo godir_set_field_order($field_ids);
25
+	echo godir_set_field_order($field_ids);
26 26
 }
27 27
 
28 28
 if (isset($_REQUEST['update']) && $_REQUEST['update'] == "update" && isset($_REQUEST['create_field']) && isset($_REQUEST['manage_field_type']) && $_REQUEST['manage_field_type'] == 'sorting_options') {
29
-    echo godir_set_sort_field_order($field_ids);
29
+	echo godir_set_sort_field_order($field_ids);
30 30
 }
31 31
 
32 32
 /* ---- Show field form in admin ---- */
33 33
 if ($field_type != '' && $field_id != '' && $field_action == 'new' && isset($_REQUEST['create_field']) && isset($_REQUEST['manage_field_type']) && $_REQUEST['manage_field_type'] == 'custom_fields') {
34
-    geodir_custom_field_adminhtml($field_type, $field_id, $field_action);
34
+	geodir_custom_field_adminhtml($field_type, $field_id, $field_action);
35 35
 }
36 36
 
37 37
 if ($field_type != '' && $field_id != '' && $field_action == 'new' && isset($_REQUEST['create_field']) && isset($_REQUEST['manage_field_type']) && $_REQUEST['manage_field_type'] == 'sorting_options') {
38
-    geodir_custom_sort_field_adminhtml($field_type, $field_id, $field_action);
38
+	geodir_custom_sort_field_adminhtml($field_type, $field_id, $field_action);
39 39
 }
40 40
 
41 41
 /* ---- Delete field ---- */
42 42
 if ($field_id != '' && $field_action == 'delete' && isset($_REQUEST['_wpnonce']) && isset($_REQUEST['create_field']) && isset($_REQUEST['manage_field_type']) && $_REQUEST['manage_field_type'] == 'custom_fields') {
43
-    if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_' . $field_id))
44
-        return;
43
+	if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_' . $field_id))
44
+		return;
45 45
     
46
-    echo geodir_custom_field_delete($field_id);
46
+	echo geodir_custom_field_delete($field_id);
47 47
 }
48 48
 
49 49
 if ($field_id != '' && $field_action == 'delete' && isset($_REQUEST['_wpnonce']) && isset($_REQUEST['create_field']) && isset($_REQUEST['manage_field_type']) && $_REQUEST['manage_field_type'] == 'sorting_options') {
50
-    if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_' . $field_id))
51
-        return;
50
+	if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_' . $field_id))
51
+		return;
52 52
     
53
-    echo geodir_custom_sort_field_delete($field_id);
53
+	echo geodir_custom_sort_field_delete($field_id);
54 54
 }
55 55
 
56 56
 /* ---- Save field  ---- */
57 57
 if ($field_id != '' && $field_action == 'submit' && isset($_REQUEST['_wpnonce']) && isset($_REQUEST['create_field']) && isset($_REQUEST['manage_field_type']) && $_REQUEST['manage_field_type'] == 'custom_fields') {
58
-    if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_' . $field_id))
59
-        return;
60
-
61
-    foreach ($_REQUEST as $pkey => $pval) {
62
-        if (is_array($_REQUEST[$pkey])) {
63
-            $tags = 'skip_field';
64
-        } else {
65
-            $tags = '';
66
-        }
67
-
68
-        if ($tags != 'skip_field') {
69
-            $_REQUEST[$pkey] = strip_tags($_REQUEST[$pkey], $tags);
70
-        }
71
-    }
72
-
73
-    $return = geodir_custom_field_save($_REQUEST);
74
-
75
-    if (is_int($return)) {
76
-        $lastid = $return;
77
-        geodir_custom_field_adminhtml($field_type, $lastid, 'submit');
78
-    } else {
79
-        echo $return;
80
-    }
58
+	if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_' . $field_id))
59
+		return;
60
+
61
+	foreach ($_REQUEST as $pkey => $pval) {
62
+		if (is_array($_REQUEST[$pkey])) {
63
+			$tags = 'skip_field';
64
+		} else {
65
+			$tags = '';
66
+		}
67
+
68
+		if ($tags != 'skip_field') {
69
+			$_REQUEST[$pkey] = strip_tags($_REQUEST[$pkey], $tags);
70
+		}
71
+	}
72
+
73
+	$return = geodir_custom_field_save($_REQUEST);
74
+
75
+	if (is_int($return)) {
76
+		$lastid = $return;
77
+		geodir_custom_field_adminhtml($field_type, $lastid, 'submit');
78
+	} else {
79
+		echo $return;
80
+	}
81 81
 }
82 82
 
83 83
 /* ---- Save sort field  ---- */
84 84
 if ($field_id != '' && $field_action == 'submit' && isset($_REQUEST['_wpnonce']) && isset($_REQUEST['create_field']) && isset($_REQUEST['manage_field_type']) && $_REQUEST['manage_field_type'] == 'sorting_options') {
85
-    if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_' . $field_id))
86
-        return;
87
-
88
-    foreach ($_REQUEST as $pkey => $pval) {
89
-        if (is_array($_REQUEST[$pkey])) {
90
-            $tags = 'skip_field';
91
-        } else {
92
-            $tags = '';
93
-        }
94
-
95
-        if ($tags != 'skip_field') {
96
-            $_REQUEST[$pkey] = strip_tags($_REQUEST[$pkey], $tags);
97
-        }
98
-    }
99
-
100
-    $return = geodir_custom_sort_field_save($_REQUEST);
101
-
102
-    if (is_int($return)) {
103
-        $lastid = $return;
104
-        $default = false;
105
-        geodir_custom_sort_field_adminhtml($field_type, $lastid, 'submit', $default);
106
-    } else {
107
-        echo $return;
108
-    }
85
+	if (!wp_verify_nonce($_REQUEST['_wpnonce'], 'custom_fields_' . $field_id))
86
+		return;
87
+
88
+	foreach ($_REQUEST as $pkey => $pval) {
89
+		if (is_array($_REQUEST[$pkey])) {
90
+			$tags = 'skip_field';
91
+		} else {
92
+			$tags = '';
93
+		}
94
+
95
+		if ($tags != 'skip_field') {
96
+			$_REQUEST[$pkey] = strip_tags($_REQUEST[$pkey], $tags);
97
+		}
98
+	}
99
+
100
+	$return = geodir_custom_sort_field_save($_REQUEST);
101
+
102
+	if (is_int($return)) {
103
+		$lastid = $return;
104
+		$default = false;
105
+		geodir_custom_sort_field_adminhtml($field_type, $lastid, 'submit', $default);
106
+	} else {
107
+		echo $return;
108
+	}
109 109
 }
110 110
\ No newline at end of file
Please login to merge, or discard this patch.
geodirectory-admin/option-pages/design_settings_array.php 1 patch
Indentation   +902 added lines, -902 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Design tab settings.
4
- *
5
- * @since 1.0.0
6
- * @package GeoDirectory
7
- * @global array $geodir_settings Geodirectory settings array.
8
- */
3
+	 * Design tab settings.
4
+	 *
5
+	 * @since 1.0.0
6
+	 * @package GeoDirectory
7
+	 * @global array $geodir_settings Geodirectory settings array.
8
+	 */
9 9
 global $geodir_settings;
10 10
 
11 11
 
@@ -17,14 +17,14 @@  discard block
 block discarded – undo
17 17
  */
18 18
 function geodir_post_type_setting_fun()
19 19
 {
20
-    $post_type_arr = array();
20
+	$post_type_arr = array();
21 21
 
22
-    $post_types = geodir_get_posttypes('object');
22
+	$post_types = geodir_get_posttypes('object');
23 23
 
24
-    foreach ($post_types as $key => $post_types_obj) {
25
-        $post_type_arr[$key] = $post_types_obj->labels->singular_name;
26
-    }
27
-    return $post_type_arr;
24
+	foreach ($post_types as $key => $post_types_obj) {
25
+		$post_type_arr[$key] = $post_types_obj->labels->singular_name;
26
+	}
27
+	return $post_type_arr;
28 28
 }
29 29
 
30 30
 /**
@@ -35,548 +35,548 @@  discard block
 block discarded – undo
35 35
  */
36 36
 function geodir_theme_location_setting_fun()
37 37
 {
38
-    $post_type_arr = array();
39
-    $geodir_all_nav_locations = get_registered_nav_menus();
40
-    $geodir_active_nav_locations = get_nav_menu_locations();
41
-    if (!empty($geodir_active_nav_locations) && is_array($geodir_active_nav_locations)) {
42
-        foreach ($geodir_active_nav_locations as $key => $theme_location) {
43
-            if (!empty($geodir_all_nav_locations) && is_array($geodir_all_nav_locations) && array_key_exists($key, $geodir_all_nav_locations))
44
-                $post_type_arr[$key] = $geodir_all_nav_locations[$key];
45
-        }
46
-    }
47
-
48
-    return $post_type_arr;
38
+	$post_type_arr = array();
39
+	$geodir_all_nav_locations = get_registered_nav_menus();
40
+	$geodir_active_nav_locations = get_nav_menu_locations();
41
+	if (!empty($geodir_active_nav_locations) && is_array($geodir_active_nav_locations)) {
42
+		foreach ($geodir_active_nav_locations as $key => $theme_location) {
43
+			if (!empty($geodir_all_nav_locations) && is_array($geodir_all_nav_locations) && array_key_exists($key, $geodir_all_nav_locations))
44
+				$post_type_arr[$key] = $geodir_all_nav_locations[$key];
45
+		}
46
+	}
47
+
48
+	return $post_type_arr;
49 49
 }
50 50
 /**
51
- * Filter GD design settings array.
52
- *
53
- * @since 1.0.0
54
- * @package GeoDirectory
55
- */
51
+	 * Filter GD design settings array.
52
+	 *
53
+	 * @since 1.0.0
54
+	 * @package GeoDirectory
55
+	 */
56 56
 $geodir_settings['design_settings'] = apply_filters('geodir_design_settings', array(
57 57
 
58
-    /* Home Layout Settings start */
59
-    array('name' => __('Home', 'geodirectory'), 'type' => 'title', 'desc' => 'Setting to set home page layout', 'id' => 'home_page_settings '),
58
+	/* Home Layout Settings start */
59
+	array('name' => __('Home', 'geodirectory'), 'type' => 'title', 'desc' => 'Setting to set home page layout', 'id' => 'home_page_settings '),
60 60
 
61 61
 
62
-    array('name' => __('Home Top Section Settings', 'geodirectory'),
63
-        'type' => 'sectionstart',
64
-        'desc' => '',
65
-        'id' => 'geodir_home_top_section'),
62
+	array('name' => __('Home Top Section Settings', 'geodirectory'),
63
+		'type' => 'sectionstart',
64
+		'desc' => '',
65
+		'id' => 'geodir_home_top_section'),
66 66
 
67
-    array(
68
-        'name' => __('Geodirectory home page', 'geodirectory'),
69
-        'desc' => __('Set geodirectory home page as your home. <b style="color:red;">This setting has been depreciated and will be removed in the next version, instead please set the GD home page in GD>Permalinks and then set this page to the front page under Settings>Reading>Front Page</b>', 'geodirectory'),
70
-        'id' => 'geodir_set_as_home',
71
-        'type' => 'checkbox',
72
-        'std' => '0' // Default value to show home top section
73
-    ),
67
+	array(
68
+		'name' => __('Geodirectory home page', 'geodirectory'),
69
+		'desc' => __('Set geodirectory home page as your home. <b style="color:red;">This setting has been depreciated and will be removed in the next version, instead please set the GD home page in GD>Permalinks and then set this page to the front page under Settings>Reading>Front Page</b>', 'geodirectory'),
70
+		'id' => 'geodir_set_as_home',
71
+		'type' => 'checkbox',
72
+		'std' => '0' // Default value to show home top section
73
+	),
74 74
 
75
-    array(
76
-        'name' => __('Home top section', 'geodirectory'),
77
-        'desc' => __('Show the top section of home page', 'geodirectory'),
78
-        'id' => 'geodir_show_home_top_section',
79
-        'type' => 'checkbox',
80
-        'std' => '1' // Default value to show home top section
81
-    ),
75
+	array(
76
+		'name' => __('Home top section', 'geodirectory'),
77
+		'desc' => __('Show the top section of home page', 'geodirectory'),
78
+		'id' => 'geodir_show_home_top_section',
79
+		'type' => 'checkbox',
80
+		'std' => '1' // Default value to show home top section
81
+	),
82 82
 
83 83
 
84
-    array('type' => 'sectionend', 'id' => 'geodir_home_top_section'),
84
+	array('type' => 'sectionend', 'id' => 'geodir_home_top_section'),
85 85
 
86 86
 
87
-    array('name' => __('Home Page Layout Settings', 'geodirectory'),
88
-        'type' => 'sectionstart',
89
-        'desc' => '',
90
-        'id' => 'geodir_home_layout'),
87
+	array('name' => __('Home Page Layout Settings', 'geodirectory'),
88
+		'type' => 'sectionstart',
89
+		'desc' => '',
90
+		'id' => 'geodir_home_layout'),
91 91
 
92
-    array(
93
-        'name' => __('Home right section', 'geodirectory'),
94
-        'desc' => __('Show the right section of home page', 'geodirectory'),
95
-        'id' => 'geodir_show_home_right_section',
96
-        'type' => 'checkbox',
97
-        'std' => '1' // Default value to show home top section
98
-    ),
92
+	array(
93
+		'name' => __('Home right section', 'geodirectory'),
94
+		'desc' => __('Show the right section of home page', 'geodirectory'),
95
+		'id' => 'geodir_show_home_right_section',
96
+		'type' => 'checkbox',
97
+		'std' => '1' // Default value to show home top section
98
+	),
99 99
 
100
-    array(
101
-        'name' => __('Width of home right section', 'geodirectory'),
102
-        'desc' => __('Enter the width of right section of home page in %', 'geodirectory'),
103
-        'id' => 'geodir_width_home_right_section',
104
-        'type' => 'text',
105
-        'css' => 'min-width:300px;',
106
-        'std' => '30' // Default value to show home top section
107
-    ),
100
+	array(
101
+		'name' => __('Width of home right section', 'geodirectory'),
102
+		'desc' => __('Enter the width of right section of home page in %', 'geodirectory'),
103
+		'id' => 'geodir_width_home_right_section',
104
+		'type' => 'text',
105
+		'css' => 'min-width:300px;',
106
+		'std' => '30' // Default value to show home top section
107
+	),
108 108
 
109
-    array(
110
-        'name' => __('Home content section', 'geodirectory'),
111
-        'desc' => __('Show the content section of home page', 'geodirectory'),
112
-        'id' => 'geodir_show_home_contant_section',
113
-        'type' => 'checkbox',
114
-        'std' => '1' // Default value to show home top section
115
-    ),
109
+	array(
110
+		'name' => __('Home content section', 'geodirectory'),
111
+		'desc' => __('Show the content section of home page', 'geodirectory'),
112
+		'id' => 'geodir_show_home_contant_section',
113
+		'type' => 'checkbox',
114
+		'std' => '1' // Default value to show home top section
115
+	),
116 116
 
117
-    array(
118
-        'name' => __('Width of home content section', 'geodirectory'),
119
-        'desc' => __('Enter the width of content section of home page in %', 'geodirectory'),
120
-        'id' => 'geodir_width_home_contant_section',
121
-        'type' => 'text',
122
-        'css' => 'min-width:300px;',
123
-        'std' => '63' // Default value to show home top section
124
-    ),
117
+	array(
118
+		'name' => __('Width of home content section', 'geodirectory'),
119
+		'desc' => __('Enter the width of content section of home page in %', 'geodirectory'),
120
+		'id' => 'geodir_width_home_contant_section',
121
+		'type' => 'text',
122
+		'css' => 'min-width:300px;',
123
+		'std' => '63' // Default value to show home top section
124
+	),
125 125
 
126
-    array(
127
-        'name' => __('Home left section', 'geodirectory'),
128
-        'desc' => __('Show the left section of home page', 'geodirectory'),
129
-        'id' => 'geodir_show_home_left_section',
130
-        'type' => 'checkbox',
131
-        'std' => '0' // Default value to show home top section
132
-    ),
126
+	array(
127
+		'name' => __('Home left section', 'geodirectory'),
128
+		'desc' => __('Show the left section of home page', 'geodirectory'),
129
+		'id' => 'geodir_show_home_left_section',
130
+		'type' => 'checkbox',
131
+		'std' => '0' // Default value to show home top section
132
+	),
133 133
 
134
-    array(
135
-        'name' => __('Width of home left section', 'geodirectory'),
136
-        'desc' => __('Enter the width of left section of home page in %', 'geodirectory'),
137
-        'id' => 'geodir_width_home_left_section',
138
-        'type' => 'text',
139
-        'css' => 'min-width:300px;',
140
-        'std' => '30' // Default value to show home top section
141
-    ),
134
+	array(
135
+		'name' => __('Width of home left section', 'geodirectory'),
136
+		'desc' => __('Enter the width of left section of home page in %', 'geodirectory'),
137
+		'id' => 'geodir_width_home_left_section',
138
+		'type' => 'text',
139
+		'css' => 'min-width:300px;',
140
+		'std' => '30' // Default value to show home top section
141
+	),
142 142
 
143
-    array(
144
-        'name' => __('Home bottom section', 'geodirectory'),
145
-        'desc' => __('Show the bottom section of home page', 'geodirectory'),
146
-        'id' => 'geodir_show_home_bottom_section',
147
-        'type' => 'checkbox',
148
-        'std' => '0' // Default value to show home top section
149
-    ),
150
-    array(
151
-        'name' => __('Resize image large size', 'geodirectory'),
152
-        'desc' => sprintf(__('Use default wordpress media image large size ( %s ) for featured image upload. If unchecked then default geodirectory image large size ( 800x800 ) will be used.', 'geodirectory'), get_option('large_size_w') . 'x' . get_option('large_size_h')),
153
-        'id' => 'geodir_use_wp_media_large_size',
154
-        'type' => 'checkbox',
155
-        'std' => '0'
156
-    ),
143
+	array(
144
+		'name' => __('Home bottom section', 'geodirectory'),
145
+		'desc' => __('Show the bottom section of home page', 'geodirectory'),
146
+		'id' => 'geodir_show_home_bottom_section',
147
+		'type' => 'checkbox',
148
+		'std' => '0' // Default value to show home top section
149
+	),
150
+	array(
151
+		'name' => __('Resize image large size', 'geodirectory'),
152
+		'desc' => sprintf(__('Use default wordpress media image large size ( %s ) for featured image upload. If unchecked then default geodirectory image large size ( 800x800 ) will be used.', 'geodirectory'), get_option('large_size_w') . 'x' . get_option('large_size_h')),
153
+		'id' => 'geodir_use_wp_media_large_size',
154
+		'type' => 'checkbox',
155
+		'std' => '0'
156
+	),
157 157
 
158
-    array('type' => 'sectionend', 'id' => 'geodir_home_layout'),
158
+	array('type' => 'sectionend', 'id' => 'geodir_home_layout'),
159 159
 
160 160
 
161
-    /* Home Layout Settings end */
161
+	/* Home Layout Settings end */
162 162
 
163 163
 
164
-    /* Listing Layout Settings end */
164
+	/* Listing Layout Settings end */
165 165
 
166
-    array('name' => __('Listings', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_listing_settings '),
166
+	array('name' => __('Listings', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_listing_settings '),
167 167
 
168 168
 
169
-    array('name' => __('Listing Page Layout Settings', 'geodirectory'),
170
-        'type' => 'sectionstart',
171
-        'desc' => '',
172
-        'id' => 'geodir_listing_layout'),
169
+	array('name' => __('Listing Page Layout Settings', 'geodirectory'),
170
+		'type' => 'sectionstart',
171
+		'desc' => '',
172
+		'id' => 'geodir_listing_layout'),
173 173
 
174
-    array(
175
-        'name' => __('Listing top section', 'geodirectory'),
176
-        'desc' => __('Show the top section of listing page', 'geodirectory'),
177
-        'id' => 'geodir_show_listing_top_section',
178
-        'type' => 'checkbox',
179
-        'std' => '1' // Default value to show home top section
180
-    ),
174
+	array(
175
+		'name' => __('Listing top section', 'geodirectory'),
176
+		'desc' => __('Show the top section of listing page', 'geodirectory'),
177
+		'id' => 'geodir_show_listing_top_section',
178
+		'type' => 'checkbox',
179
+		'std' => '1' // Default value to show home top section
180
+	),
181 181
 
182
-    array(
183
-        'name' => __('Listing right section', 'geodirectory'),
184
-        'desc' => __('Show the right section of listing page', 'geodirectory'),
185
-        'id' => 'geodir_show_listing_right_section',
186
-        'type' => 'checkbox',
187
-        'std' => '1' // Default value to show home top section
188
-    ),
182
+	array(
183
+		'name' => __('Listing right section', 'geodirectory'),
184
+		'desc' => __('Show the right section of listing page', 'geodirectory'),
185
+		'id' => 'geodir_show_listing_right_section',
186
+		'type' => 'checkbox',
187
+		'std' => '1' // Default value to show home top section
188
+	),
189 189
 
190
-    array(
191
-        'name' => __('Width of listing right section', 'geodirectory'),
192
-        'desc' => __('Enter the width of right section of listing page in %', 'geodirectory'),
193
-        'id' => 'geodir_width_listing_right_section',
194
-        'type' => 'text',
195
-        'css' => 'min-width:300px;',
196
-        'std' => '30' // Default value to show home top section
197
-    ),
190
+	array(
191
+		'name' => __('Width of listing right section', 'geodirectory'),
192
+		'desc' => __('Enter the width of right section of listing page in %', 'geodirectory'),
193
+		'id' => 'geodir_width_listing_right_section',
194
+		'type' => 'text',
195
+		'css' => 'min-width:300px;',
196
+		'std' => '30' // Default value to show home top section
197
+	),
198 198
 
199 199
 
200
-    array(
201
-        'name' => __('Listing content section view', 'geodirectory'),
202
-        'desc' => __('Set the listing view of listing page', 'geodirectory'),
203
-        'id' => 'geodir_listing_view',
204
-        'css' => 'min-width:300px;',
205
-        'std' => 'gridview_onehalf',
206
-        'type' => 'select',
207
-        'class' => 'chosen_select',
208
-        'options' => array_unique(array(
209
-            'gridview_onehalf' => __('Grid View (Two Columns)', 'geodirectory'),
210
-            'gridview_onethird' => __('Grid View (Three Columns)', 'geodirectory'),
211
-            'gridview_onefourth' => __('Grid View (Four Columns)', 'geodirectory'),
212
-            'gridview_onefifth' => __('Grid View (Five Columns)', 'geodirectory'),
213
-            'listview' => __('List view', 'geodirectory'),
214
-        ))
215
-    ),
200
+	array(
201
+		'name' => __('Listing content section view', 'geodirectory'),
202
+		'desc' => __('Set the listing view of listing page', 'geodirectory'),
203
+		'id' => 'geodir_listing_view',
204
+		'css' => 'min-width:300px;',
205
+		'std' => 'gridview_onehalf',
206
+		'type' => 'select',
207
+		'class' => 'chosen_select',
208
+		'options' => array_unique(array(
209
+			'gridview_onehalf' => __('Grid View (Two Columns)', 'geodirectory'),
210
+			'gridview_onethird' => __('Grid View (Three Columns)', 'geodirectory'),
211
+			'gridview_onefourth' => __('Grid View (Four Columns)', 'geodirectory'),
212
+			'gridview_onefifth' => __('Grid View (Five Columns)', 'geodirectory'),
213
+			'listview' => __('List view', 'geodirectory'),
214
+		))
215
+	),
216 216
 
217
-    array(
218
-        'name' => __('Width of listing content section', 'geodirectory'),
219
-        'desc' => __('Enter the width of content section of listing page in %', 'geodirectory'),
220
-        'id' => 'geodir_width_listing_contant_section',
221
-        'type' => 'text',
222
-        'css' => 'min-width:300px;',
223
-        'std' => '63' // Default value to show home top section
224
-    ),
217
+	array(
218
+		'name' => __('Width of listing content section', 'geodirectory'),
219
+		'desc' => __('Enter the width of content section of listing page in %', 'geodirectory'),
220
+		'id' => 'geodir_width_listing_contant_section',
221
+		'type' => 'text',
222
+		'css' => 'min-width:300px;',
223
+		'std' => '63' // Default value to show home top section
224
+	),
225 225
 
226
-    array(
227
-        'name' => __('Listing left section', 'geodirectory'),
228
-        'desc' => __('Show the left section of listing page', 'geodirectory'),
229
-        'id' => 'geodir_show_listing_left_section',
230
-        'type' => 'checkbox',
231
-        'std' => '0' // Default value to show home top section
232
-    ),
226
+	array(
227
+		'name' => __('Listing left section', 'geodirectory'),
228
+		'desc' => __('Show the left section of listing page', 'geodirectory'),
229
+		'id' => 'geodir_show_listing_left_section',
230
+		'type' => 'checkbox',
231
+		'std' => '0' // Default value to show home top section
232
+	),
233 233
 
234
-    array(
235
-        'name' => __('Width of listing left section', 'geodirectory'),
236
-        'desc' => __('Enter the width of left section of listing in %', 'geodirectory'),
237
-        'id' => 'geodir_width_listing_left_section',
238
-        'type' => 'text',
239
-        'css' => 'min-width:300px;',
240
-        'std' => '30' // Default value to show home top section
241
-    ),
234
+	array(
235
+		'name' => __('Width of listing left section', 'geodirectory'),
236
+		'desc' => __('Enter the width of left section of listing in %', 'geodirectory'),
237
+		'id' => 'geodir_width_listing_left_section',
238
+		'type' => 'text',
239
+		'css' => 'min-width:300px;',
240
+		'std' => '30' // Default value to show home top section
241
+	),
242 242
 
243
-    array(
244
-        'name' => __('Listing bottom section', 'geodirectory'),
245
-        'desc' => __('Show the bottom section of listing page', 'geodirectory'),
246
-        'id' => 'geodir_show_listing_bottom_section',
247
-        'type' => 'checkbox',
248
-        'std' => '0' // Default value to show home top section
249
-    ),
243
+	array(
244
+		'name' => __('Listing bottom section', 'geodirectory'),
245
+		'desc' => __('Show the bottom section of listing page', 'geodirectory'),
246
+		'id' => 'geodir_show_listing_bottom_section',
247
+		'type' => 'checkbox',
248
+		'std' => '0' // Default value to show home top section
249
+	),
250 250
 
251
-    array(
252
-        'name' => __('Upload listing no image', 'geodirectory'),
253
-        'desc' => '',
254
-        'id' => 'geodir_listing_no_img',
255
-        'type' => 'file',
256
-        'std' => '0' // Default value to show home top section
257
-    ),
251
+	array(
252
+		'name' => __('Upload listing no image', 'geodirectory'),
253
+		'desc' => '',
254
+		'id' => 'geodir_listing_no_img',
255
+		'type' => 'file',
256
+		'std' => '0' // Default value to show home top section
257
+	),
258 258
 
259
-    array(
260
-        'name' => __('Description word limit', 'geodirectory'),
261
-        'desc' => '',
262
-        'id' => 'geodir_desc_word_limit',
263
-        'type' => 'text',
264
-        'css' => 'min-width:300px;',
265
-        'std' => '50' // Default value to show home top section
266
-    ),
259
+	array(
260
+		'name' => __('Description word limit', 'geodirectory'),
261
+		'desc' => '',
262
+		'id' => 'geodir_desc_word_limit',
263
+		'type' => 'text',
264
+		'css' => 'min-width:300px;',
265
+		'std' => '50' // Default value to show home top section
266
+	),
267 267
 
268
-    array('type' => 'sectionend', 'id' => 'geodir_listing_layout'),
268
+	array('type' => 'sectionend', 'id' => 'geodir_listing_layout'),
269 269
 
270 270
 
271
-    array('name' => __('Listing General Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_listing_gen_settings '),
271
+	array('name' => __('Listing General Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_listing_gen_settings '),
272 272
 
273
-    array(
274
-        'name' => __('New listing default status', 'geodirectory'),
275
-        'desc' => __('Select new listing default status.', 'geodirectory'),
276
-        'tip' => '',
277
-        'id' => 'geodir_new_post_default_status',
278
-        'css' => 'min-width:300px;',
279
-        'std' => 'publish',
280
-        'type' => 'select',
281
-        'class' => 'chosen_select',
282
-        'options' => array_unique(array(
283
-            'publish' => __('publish', 'geodirectory'),
284
-            'draft' => __('draft', 'geodirectory'),
285
-        ))
286
-    ),
273
+	array(
274
+		'name' => __('New listing default status', 'geodirectory'),
275
+		'desc' => __('Select new listing default status.', 'geodirectory'),
276
+		'tip' => '',
277
+		'id' => 'geodir_new_post_default_status',
278
+		'css' => 'min-width:300px;',
279
+		'std' => 'publish',
280
+		'type' => 'select',
281
+		'class' => 'chosen_select',
282
+		'options' => array_unique(array(
283
+			'publish' => __('publish', 'geodirectory'),
284
+			'draft' => __('draft', 'geodirectory'),
285
+		))
286
+	),
287 287
 
288
-    array(
289
-        'name' => __('New listings settings', 'geodirectory'),
290
-        'desc' => __('Enter number of days a listing will appear new.(enter 0 to disable feature)', 'geodirectory'),
291
-        'id' => 'geodir_listing_new_days',
292
-        'type' => 'text',
293
-        'css' => 'min-width:300px;',
294
-        'std' => '30' // Default value for the page title - changed in settings
295
-    ),
288
+	array(
289
+		'name' => __('New listings settings', 'geodirectory'),
290
+		'desc' => __('Enter number of days a listing will appear new.(enter 0 to disable feature)', 'geodirectory'),
291
+		'id' => 'geodir_listing_new_days',
292
+		'type' => 'text',
293
+		'css' => 'min-width:300px;',
294
+		'std' => '30' // Default value for the page title - changed in settings
295
+	),
296 296
 
297
-    array('type' => 'sectionend', 'id' => 'geodir_listing_gen_settings'),
297
+	array('type' => 'sectionend', 'id' => 'geodir_listing_gen_settings'),
298 298
 
299 299
 
300
-    array('name' => __('Add Listing Form Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_add_listing_gen_settings'),
300
+	array('name' => __('Add Listing Form Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_add_listing_gen_settings'),
301 301
 
302
-    array(
303
-        'name' => __('Enable "Accept Terms and Conditions"', 'geodirectory'),
304
-        'desc' => __('Show the "Accept Terms and Conditions" field on add listing.', 'geodirectory'),
305
-        'id' => 'geodir_accept_term_condition',
306
-        'type' => 'checkbox',
307
-        'std' => '1' // Default value to show home top section
308
-    ),
302
+	array(
303
+		'name' => __('Enable "Accept Terms and Conditions"', 'geodirectory'),
304
+		'desc' => __('Show the "Accept Terms and Conditions" field on add listing.', 'geodirectory'),
305
+		'id' => 'geodir_accept_term_condition',
306
+		'type' => 'checkbox',
307
+		'std' => '1' // Default value to show home top section
308
+	),
309 309
 
310 310
 
311
-    array(
312
-        'name' => __('Show description field as editor', 'geodirectory'),
313
-        'desc' => __('Select post types to show advanced editor on add listing page.', 'geodirectory'),
314
-        'tip' => '',
315
-        'id' => 'geodir_tiny_editor_on_add_listing',
316
-        'css' => 'min-width:300px;',
317
-        'std' => array(),
318
-        'type' => 'multiselect',
319
-        'placeholder_text' => __('Select post types', 'geodirectory'),
320
-        'class' => 'chosen_select',
321
-        'options' => array_unique(geodir_post_type_setting_fun())
322
-    ),
311
+	array(
312
+		'name' => __('Show description field as editor', 'geodirectory'),
313
+		'desc' => __('Select post types to show advanced editor on add listing page.', 'geodirectory'),
314
+		'tip' => '',
315
+		'id' => 'geodir_tiny_editor_on_add_listing',
316
+		'css' => 'min-width:300px;',
317
+		'std' => array(),
318
+		'type' => 'multiselect',
319
+		'placeholder_text' => __('Select post types', 'geodirectory'),
320
+		'class' => 'chosen_select',
321
+		'options' => array_unique(geodir_post_type_setting_fun())
322
+	),
323 323
 
324
-    array('type' => 'sectionend', 'id' => 'geodir_add_listing_gen_settings'),
325
-    /* Listing Layout Settings end */
324
+	array('type' => 'sectionend', 'id' => 'geodir_add_listing_gen_settings'),
325
+	/* Listing Layout Settings end */
326 326
 
327 327
 
328
-    /* Search Layout Settings end */
328
+	/* Search Layout Settings end */
329 329
 
330
-    array('name' => __('Search', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_search_settings '),
330
+	array('name' => __('Search', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_search_settings '),
331 331
 
332 332
 
333
-    array('name' => __('Search Page Layout Settings', 'geodirectory'),
334
-        'type' => 'sectionstart',
335
-        'desc' => '',
336
-        'id' => 'geodir_search_layout'),
333
+	array('name' => __('Search Page Layout Settings', 'geodirectory'),
334
+		'type' => 'sectionstart',
335
+		'desc' => '',
336
+		'id' => 'geodir_search_layout'),
337 337
 
338
-    array(
339
-        'name' => __('Search top section', 'geodirectory'),
340
-        'desc' => __('Show the top section of search page', 'geodirectory'),
341
-        'id' => 'geodir_show_search_top_section',
342
-        'type' => 'checkbox',
343
-        'std' => '1' // Default value to show home top section
344
-    ),
338
+	array(
339
+		'name' => __('Search top section', 'geodirectory'),
340
+		'desc' => __('Show the top section of search page', 'geodirectory'),
341
+		'id' => 'geodir_show_search_top_section',
342
+		'type' => 'checkbox',
343
+		'std' => '1' // Default value to show home top section
344
+	),
345 345
 
346
-    array(
347
-        'name' => __('Search right section', 'geodirectory'),
348
-        'desc' => __('Show the right section of search page', 'geodirectory'),
349
-        'id' => 'geodir_show_search_right_section',
350
-        'type' => 'checkbox',
351
-        'std' => '1' // Default value to show home top section
352
-    ),
346
+	array(
347
+		'name' => __('Search right section', 'geodirectory'),
348
+		'desc' => __('Show the right section of search page', 'geodirectory'),
349
+		'id' => 'geodir_show_search_right_section',
350
+		'type' => 'checkbox',
351
+		'std' => '1' // Default value to show home top section
352
+	),
353 353
 
354
-    array(
355
-        'name' => __('Width of search right section', 'geodirectory'),
356
-        'desc' => __('Enter the width of right section of search page in %', 'geodirectory'),
357
-        'id' => 'geodir_width_search_right_section',
358
-        'type' => 'text',
359
-        'css' => 'min-width:300px;',
360
-        'std' => '30' // Default value to show home top section
361
-    ),
354
+	array(
355
+		'name' => __('Width of search right section', 'geodirectory'),
356
+		'desc' => __('Enter the width of right section of search page in %', 'geodirectory'),
357
+		'id' => 'geodir_width_search_right_section',
358
+		'type' => 'text',
359
+		'css' => 'min-width:300px;',
360
+		'std' => '30' // Default value to show home top section
361
+	),
362 362
 
363 363
 
364
-    array(
365
-        'name' => __('Search content section view', 'geodirectory'),
366
-        'desc' => __('Set the listing view of search page', 'geodirectory'),
367
-        'id' => 'geodir_search_view',
368
-        'css' => 'min-width:300px;',
369
-        'std' => 'gridview_onehalf',
370
-        'type' => 'select',
371
-        'class' => 'chosen_select',
372
-        'options' => array_unique(array(
373
-            'gridview_onehalf' => __('Grid View (Two Columns)', 'geodirectory'),
374
-            'gridview_onethird' => __('Grid View (Three Columns)', 'geodirectory'),
375
-            'gridview_onefourth' => __('Grid View (Four Columns)', 'geodirectory'),
376
-            'gridview_onefifth' => __('Grid View (Five Columns)', 'geodirectory'),
377
-            'listview' => __('List view', 'geodirectory'),
378
-        ))
379
-    ),
364
+	array(
365
+		'name' => __('Search content section view', 'geodirectory'),
366
+		'desc' => __('Set the listing view of search page', 'geodirectory'),
367
+		'id' => 'geodir_search_view',
368
+		'css' => 'min-width:300px;',
369
+		'std' => 'gridview_onehalf',
370
+		'type' => 'select',
371
+		'class' => 'chosen_select',
372
+		'options' => array_unique(array(
373
+			'gridview_onehalf' => __('Grid View (Two Columns)', 'geodirectory'),
374
+			'gridview_onethird' => __('Grid View (Three Columns)', 'geodirectory'),
375
+			'gridview_onefourth' => __('Grid View (Four Columns)', 'geodirectory'),
376
+			'gridview_onefifth' => __('Grid View (Five Columns)', 'geodirectory'),
377
+			'listview' => __('List view', 'geodirectory'),
378
+		))
379
+	),
380 380
 
381
-    array(
382
-        'name' => __('Width of search content section', 'geodirectory'),
383
-        'desc' => __('Enter the width of content section of search page in %', 'geodirectory'),
384
-        'id' => 'geodir_width_search_contant_section',
385
-        'type' => 'text',
386
-        'css' => 'min-width:300px;',
387
-        'std' => '63' // Default value to show home top section
388
-    ),
381
+	array(
382
+		'name' => __('Width of search content section', 'geodirectory'),
383
+		'desc' => __('Enter the width of content section of search page in %', 'geodirectory'),
384
+		'id' => 'geodir_width_search_contant_section',
385
+		'type' => 'text',
386
+		'css' => 'min-width:300px;',
387
+		'std' => '63' // Default value to show home top section
388
+	),
389 389
 
390
-    array(
391
-        'name' => __('Search left section', 'geodirectory'),
392
-        'desc' => __('Show the left section of search page', 'geodirectory'),
393
-        'id' => 'geodir_show_search_left_section',
394
-        'type' => 'checkbox',
395
-        'std' => '0' // Default value to show home top section
396
-    ),
390
+	array(
391
+		'name' => __('Search left section', 'geodirectory'),
392
+		'desc' => __('Show the left section of search page', 'geodirectory'),
393
+		'id' => 'geodir_show_search_left_section',
394
+		'type' => 'checkbox',
395
+		'std' => '0' // Default value to show home top section
396
+	),
397 397
 
398
-    array(
399
-        'name' => __('Width of search left section', 'geodirectory'),
400
-        'desc' => __('Enter the width of left section of search in %', 'geodirectory'),
401
-        'id' => 'geodir_width_search_left_section',
402
-        'type' => 'text',
403
-        'css' => 'min-width:300px;',
404
-        'std' => '30' // Default value to show home top section
405
-    ),
398
+	array(
399
+		'name' => __('Width of search left section', 'geodirectory'),
400
+		'desc' => __('Enter the width of left section of search in %', 'geodirectory'),
401
+		'id' => 'geodir_width_search_left_section',
402
+		'type' => 'text',
403
+		'css' => 'min-width:300px;',
404
+		'std' => '30' // Default value to show home top section
405
+	),
406 406
 
407
-    array(
408
-        'name' => __('Search bottom section', 'geodirectory'),
409
-        'desc' => __('Show the bottom section of search page', 'geodirectory'),
410
-        'id' => 'geodir_show_search_bottom_section',
411
-        'type' => 'checkbox',
412
-        'std' => '0' // Default value to show home top section
413
-    ),
407
+	array(
408
+		'name' => __('Search bottom section', 'geodirectory'),
409
+		'desc' => __('Show the bottom section of search page', 'geodirectory'),
410
+		'id' => 'geodir_show_search_bottom_section',
411
+		'type' => 'checkbox',
412
+		'std' => '0' // Default value to show home top section
413
+	),
414 414
 	
415 415
 	array(
416
-        'name' => __('Show advanced pagination details', 'geodirectory'),
417
-        'desc' => __('This will add extra pagination info like "Showing listings x-y of z" aftre/before pagination.', 'geodirectory'),
418
-        'id' => 'geodir_pagination_advance_info',
419
-        'css' => 'min-width:300px;',
420
-        'std' => '',
421
-        'type' => 'select',
422
-        'class' => 'chosen_select',
423
-        'options' => array(
416
+		'name' => __('Show advanced pagination details', 'geodirectory'),
417
+		'desc' => __('This will add extra pagination info like "Showing listings x-y of z" aftre/before pagination.', 'geodirectory'),
418
+		'id' => 'geodir_pagination_advance_info',
419
+		'css' => 'min-width:300px;',
420
+		'std' => '',
421
+		'type' => 'select',
422
+		'class' => 'chosen_select',
423
+		'options' => array(
424 424
 						'' => __('Never Display', 'geodirectory'),
425 425
 						'after' => __('After Pagination', 'geodirectory'),
426 426
 						'before' => __('Before Pagination', 'geodirectory')
427 427
 					)
428
-    ),
428
+	),
429 429
 
430
-    array('type' => 'sectionend', 'id' => 'geodir_search_layout'),
430
+	array('type' => 'sectionend', 'id' => 'geodir_search_layout'),
431 431
 
432 432
 
433
-    array('name' => __('Search form default text settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_search_form_default_text_settings'),
433
+	array('name' => __('Search form default text settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_search_form_default_text_settings'),
434 434
 
435
-    array(
436
-        'name' => __('Search field default value', 'geodirectory'),
437
-        'desc' => __('Show the search text box \'placeholder\' value on search form.', 'geodirectory'),
438
-        'id' => 'geodir_search_field_default_text',
439
-        'type' => 'text',
440
-        'css' => 'min-width:300px;',
441
-        'std' => 'Search for' // show on the listing page.
442
-    ),
435
+	array(
436
+		'name' => __('Search field default value', 'geodirectory'),
437
+		'desc' => __('Show the search text box \'placeholder\' value on search form.', 'geodirectory'),
438
+		'id' => 'geodir_search_field_default_text',
439
+		'type' => 'text',
440
+		'css' => 'min-width:300px;',
441
+		'std' => 'Search for' // show on the listing page.
442
+	),
443 443
 
444
-    array(
445
-        'name' => __('Near field default value', 'geodirectory'),
446
-        'desc' => __('Show the near text box \'placeholder\' value on search form.', 'geodirectory'),
447
-        'id' => 'geodir_near_field_default_text',
448
-        'type' => 'text',
449
-        'css' => 'min-width:300px;',
450
-        'std' => 'Near' // show on the listing page.
451
-    ),
444
+	array(
445
+		'name' => __('Near field default value', 'geodirectory'),
446
+		'desc' => __('Show the near text box \'placeholder\' value on search form.', 'geodirectory'),
447
+		'id' => 'geodir_near_field_default_text',
448
+		'type' => 'text',
449
+		'css' => 'min-width:300px;',
450
+		'std' => 'Near' // show on the listing page.
451
+	),
452 452
 
453
-    array(
454
-        'name' => __('Search button label', 'geodirectory'),
455
-        'desc' => __('Show the search button label on search form.', 'geodirectory'),
456
-        'id' => 'geodir_search_button_label',
457
-        'type' => 'text',
458
-        'css' => 'min-width:300px;',
459
-        'std' => 'Search' // show on the listing page.
460
-    ),
453
+	array(
454
+		'name' => __('Search button label', 'geodirectory'),
455
+		'desc' => __('Show the search button label on search form.', 'geodirectory'),
456
+		'id' => 'geodir_search_button_label',
457
+		'type' => 'text',
458
+		'css' => 'min-width:300px;',
459
+		'std' => 'Search' // show on the listing page.
460
+	),
461 461
 
462
-    array('type' => 'sectionend', 'id' => 'geodir_search_form_default_text_settings'),
462
+	array('type' => 'sectionend', 'id' => 'geodir_search_form_default_text_settings'),
463 463
 
464
-    /* Listing Layout Settings end */
464
+	/* Listing Layout Settings end */
465 465
 
466 466
 
467
-    /* Detail Layout Settings end */
467
+	/* Detail Layout Settings end */
468 468
 
469
-    array('name' => __('Detail', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_detail_settings '),
469
+	array('name' => __('Detail', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_detail_settings '),
470 470
 
471
-    array('name' => __('Detail/Single Page Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'detail_page_settings '),
471
+	array('name' => __('Detail/Single Page Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'detail_page_settings '),
472 472
 
473
-    array(
474
-        'name' => __('Detail top section', 'geodirectory'),
475
-        'desc' => __('Show the top section of listing page', 'geodirectory'),
476
-        'id' => 'geodir_show_detail_top_section',
477
-        'type' => 'checkbox',
478
-        'std' => '1' // Default value to show home top section
479
-    ),
473
+	array(
474
+		'name' => __('Detail top section', 'geodirectory'),
475
+		'desc' => __('Show the top section of listing page', 'geodirectory'),
476
+		'id' => 'geodir_show_detail_top_section',
477
+		'type' => 'checkbox',
478
+		'std' => '1' // Default value to show home top section
479
+	),
480 480
 
481
-    array(
482
-        'name' => __('Detail bottom section', 'geodirectory'),
483
-        'desc' => __('Show the bottom section of listing page', 'geodirectory'),
484
-        'id' => 'geodir_show_detail_bottom_section',
485
-        'type' => 'checkbox',
486
-        'std' => '1' // Default value to show home top section
487
-    ),
488
-    array(
489
-        'name' => __('Detail sidebar section on left side', 'geodirectory'),
490
-        'desc' => __('Display detail sidebar section on left side of the detail page', 'geodirectory'),
491
-        'id' => 'geodir_detail_sidebar_left_section',
492
-        'type' => 'checkbox',
493
-        'std' => '0'
494
-    ),
495
-    array(
496
-        'name' => __('Disable GD modal', 'geodirectory'),
497
-        'desc' => __('Disable GD modal that displays slideshow images in popup', 'geodirectory'),
498
-        'id' => 'geodir_disable_gb_modal',
499
-        'type' => 'checkbox',
500
-        'std' => '0'
501
-    ),
502
-    array(
503
-        'name' => __('Disable Tweet, Fb Like, Google+ buttons section', 'geodirectory'),
504
-        'desc' => __('Disable Tweet, Fb Like, Google+ buttons section that displays on Detail page sidebar', 'geodirectory'),
505
-        'id' => 'geodir_disable_tfg_buttons_section',
506
-        'type' => 'checkbox',
507
-        'std' => '0'
508
-    ),
509
-    array(
510
-        'name' => __('Disable share this button section', 'geodirectory'),
511
-        'desc' => __('Disable share this button section that displays on Detail page sidebar', 'geodirectory'),
512
-        'id' => 'geodir_disable_sharethis_button_section',
513
-        'type' => 'checkbox',
514
-        'std' => '0'
515
-    ),
516
-    array(
517
-        'name' => __('Disable Google Analytics section', 'geodirectory'),
518
-        'desc' => __('Disable Google Analytics section that displays on Detail page sidebar', 'geodirectory'),
519
-        'id' => 'geodir_disable_google_analytics_section',
520
-        'type' => 'checkbox',
521
-        'std' => '0'
522
-    ),
523
-    array(
524
-        'name' => __('Disable User Links section', 'geodirectory'),
525
-        'desc' => __('Disable User Links section (Edit post, Favorite etc..) that displays on Detail page sidebar', 'geodirectory'),
526
-        'id' => 'geodir_disable_user_links_section',
527
-        'type' => 'checkbox',
528
-        'std' => '0'
529
-    ),
530
-    array(
531
-        'name' => __('Disable Rating Info section', 'geodirectory'),
532
-        'desc' => __('Disable Rating Info section that displays on Detail page sidebar', 'geodirectory'),
533
-        'id' => 'geodir_disable_rating_info_section',
534
-        'type' => 'checkbox',
535
-        'std' => '0'
536
-    ),
537
-    array(
538
-        'name' => __('Disable Listing Info section', 'geodirectory'),
539
-        'desc' => __('Disable Listing Info section that displays on Detail page sidebar', 'geodirectory'),
540
-        'id' => 'geodir_disable_listing_info_section',
541
-        'type' => 'checkbox',
542
-        'std' => '0'
543
-    ),
481
+	array(
482
+		'name' => __('Detail bottom section', 'geodirectory'),
483
+		'desc' => __('Show the bottom section of listing page', 'geodirectory'),
484
+		'id' => 'geodir_show_detail_bottom_section',
485
+		'type' => 'checkbox',
486
+		'std' => '1' // Default value to show home top section
487
+	),
488
+	array(
489
+		'name' => __('Detail sidebar section on left side', 'geodirectory'),
490
+		'desc' => __('Display detail sidebar section on left side of the detail page', 'geodirectory'),
491
+		'id' => 'geodir_detail_sidebar_left_section',
492
+		'type' => 'checkbox',
493
+		'std' => '0'
494
+	),
495
+	array(
496
+		'name' => __('Disable GD modal', 'geodirectory'),
497
+		'desc' => __('Disable GD modal that displays slideshow images in popup', 'geodirectory'),
498
+		'id' => 'geodir_disable_gb_modal',
499
+		'type' => 'checkbox',
500
+		'std' => '0'
501
+	),
502
+	array(
503
+		'name' => __('Disable Tweet, Fb Like, Google+ buttons section', 'geodirectory'),
504
+		'desc' => __('Disable Tweet, Fb Like, Google+ buttons section that displays on Detail page sidebar', 'geodirectory'),
505
+		'id' => 'geodir_disable_tfg_buttons_section',
506
+		'type' => 'checkbox',
507
+		'std' => '0'
508
+	),
509
+	array(
510
+		'name' => __('Disable share this button section', 'geodirectory'),
511
+		'desc' => __('Disable share this button section that displays on Detail page sidebar', 'geodirectory'),
512
+		'id' => 'geodir_disable_sharethis_button_section',
513
+		'type' => 'checkbox',
514
+		'std' => '0'
515
+	),
516
+	array(
517
+		'name' => __('Disable Google Analytics section', 'geodirectory'),
518
+		'desc' => __('Disable Google Analytics section that displays on Detail page sidebar', 'geodirectory'),
519
+		'id' => 'geodir_disable_google_analytics_section',
520
+		'type' => 'checkbox',
521
+		'std' => '0'
522
+	),
523
+	array(
524
+		'name' => __('Disable User Links section', 'geodirectory'),
525
+		'desc' => __('Disable User Links section (Edit post, Favorite etc..) that displays on Detail page sidebar', 'geodirectory'),
526
+		'id' => 'geodir_disable_user_links_section',
527
+		'type' => 'checkbox',
528
+		'std' => '0'
529
+	),
530
+	array(
531
+		'name' => __('Disable Rating Info section', 'geodirectory'),
532
+		'desc' => __('Disable Rating Info section that displays on Detail page sidebar', 'geodirectory'),
533
+		'id' => 'geodir_disable_rating_info_section',
534
+		'type' => 'checkbox',
535
+		'std' => '0'
536
+	),
537
+	array(
538
+		'name' => __('Disable Listing Info section', 'geodirectory'),
539
+		'desc' => __('Disable Listing Info section that displays on Detail page sidebar', 'geodirectory'),
540
+		'id' => 'geodir_disable_listing_info_section',
541
+		'type' => 'checkbox',
542
+		'std' => '0'
543
+	),
544 544
 
545
-    array('type' => 'sectionend', 'id' => 'detail_page_settings'),
545
+	array('type' => 'sectionend', 'id' => 'detail_page_settings'),
546 546
 
547 547
 
548
-    /* ---------- DETAIL PAGE TAB SETTING START*/
548
+	/* ---------- DETAIL PAGE TAB SETTING START*/
549 549
 
550
-    array('name' => __('Detail Page Tab Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_detail_page_tab_settings '),
550
+	array('name' => __('Detail Page Tab Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_detail_page_tab_settings '),
551 551
 
552
-    array(
553
-        'name' => __('Exclude selected tabs from detail page', 'geodirectory'),
554
-        'desc' => __('Select tabs to exclude from the list of all appearing tabs on detail page.', 'geodirectory'),
555
-        'tip' => '',
556
-        'id' => 'geodir_detail_page_tabs_excluded',
557
-        'css' => 'min-width:300px;',
558
-        'std' => geodir_get_posttypes(),
559
-        'type' => 'multiselect',
560
-        'placeholder_text' => __('Select tabs', 'geodirectory'),
561
-        'class' => 'chosen_select',
562
-        'options' => array_unique(geodir_detail_page_tabs_key_value_array())
563
-    ),
552
+	array(
553
+		'name' => __('Exclude selected tabs from detail page', 'geodirectory'),
554
+		'desc' => __('Select tabs to exclude from the list of all appearing tabs on detail page.', 'geodirectory'),
555
+		'tip' => '',
556
+		'id' => 'geodir_detail_page_tabs_excluded',
557
+		'css' => 'min-width:300px;',
558
+		'std' => geodir_get_posttypes(),
559
+		'type' => 'multiselect',
560
+		'placeholder_text' => __('Select tabs', 'geodirectory'),
561
+		'class' => 'chosen_select',
562
+		'options' => array_unique(geodir_detail_page_tabs_key_value_array())
563
+	),
564 564
 
565 565
 
566
-    array('type' => 'sectionend', 'id' => 'geodir_detail_page_tab_settings'),
567
-    /* ---------- DETAIL PAGE TAB SETTING END*/
566
+	array('type' => 'sectionend', 'id' => 'geodir_detail_page_tab_settings'),
567
+	/* ---------- DETAIL PAGE TAB SETTING END*/
568 568
 
569
-    /* START DEFAULT STAR IMAGE*/
570
-    array('name' => __('Default Rating Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_rating_settings '),
569
+	/* START DEFAULT STAR IMAGE*/
570
+	array('name' => __('Default Rating Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_rating_settings '),
571 571
 
572
-    array(
573
-        'name' => __('Upload default rating star icon', 'geodirectory'),
574
-        'desc' => '',
575
-        'id' => 'geodir_default_rating_star_icon',
576
-        'type' => 'file',
577
-        'std' => '0',
578
-        'value' => geodir_plugin_url() . '/geodirectory-assets/images/stars.png'// Default value to show home top section
579
-    ),
572
+	array(
573
+		'name' => __('Upload default rating star icon', 'geodirectory'),
574
+		'desc' => '',
575
+		'id' => 'geodir_default_rating_star_icon',
576
+		'type' => 'file',
577
+		'std' => '0',
578
+		'value' => geodir_plugin_url() . '/geodirectory-assets/images/stars.png'// Default value to show home top section
579
+	),
580 580
 	array(
581 581
 		'name' => __('Enable Font Awesome', 'geodirectory'),
582 582
 		'desc' => __('When enabled all rating images will be using font awesome rating icons as images.', 'geodirectory' ),
@@ -592,368 +592,368 @@  discard block
 block discarded – undo
592 592
 		'std' => '#757575'
593 593
 	),
594 594
 
595
-    array('type' => 'sectionend', 'id' => 'geodir_detail_page_tab_settings'),
595
+	array('type' => 'sectionend', 'id' => 'geodir_detail_page_tab_settings'),
596 596
 
597
-    /* END DEFAULT STAR IMAGE*/
597
+	/* END DEFAULT STAR IMAGE*/
598 598
 
599
-    /* Detail related post settings start */
599
+	/* Detail related post settings start */
600 600
 
601
-    array('name' => __('Related Post Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'detail_page_related_post_settings '),
601
+	array('name' => __('Related Post Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'detail_page_related_post_settings '),
602 602
 
603
-    array(
604
-        'name' => __('Show related post listing on', 'geodirectory'),
605
-        'desc' => __('Select the post types to display related listing on detail page.', 'geodirectory'),
606
-        'tip' => '',
607
-        'id' => 'geodir_add_related_listing_posttypes',
608
-        'css' => 'min-width:300px;',
609
-        'std' => geodir_get_posttypes(),
610
-        'type' => 'multiselect',
611
-        'placeholder_text' => __('Select post types', 'geodirectory'),
612
-        'class' => 'chosen_select',
613
-        'options' => array_unique(geodir_post_type_setting_fun())
614
-    ),
603
+	array(
604
+		'name' => __('Show related post listing on', 'geodirectory'),
605
+		'desc' => __('Select the post types to display related listing on detail page.', 'geodirectory'),
606
+		'tip' => '',
607
+		'id' => 'geodir_add_related_listing_posttypes',
608
+		'css' => 'min-width:300px;',
609
+		'std' => geodir_get_posttypes(),
610
+		'type' => 'multiselect',
611
+		'placeholder_text' => __('Select post types', 'geodirectory'),
612
+		'class' => 'chosen_select',
613
+		'options' => array_unique(geodir_post_type_setting_fun())
614
+	),
615 615
 
616
-    array(
617
-        'name' => __('Relate to', 'geodirectory'),
618
-        'desc' => __('Set the relation between current post to related posts.', 'geodirectory'),
619
-        'id' => 'geodir_related_post_relate_to',
620
-        'css' => 'min-width:300px;',
621
-        'std' => 'category',
622
-        'type' => 'select',
623
-        'class' => 'chosen_select',
624
-        'options' => array_unique(array(
625
-            'category' => __('Categories', 'geodirectory'),
626
-            'tags' => __('Tags', 'geodirectory'),
627
-        ))
628
-    ),
616
+	array(
617
+		'name' => __('Relate to', 'geodirectory'),
618
+		'desc' => __('Set the relation between current post to related posts.', 'geodirectory'),
619
+		'id' => 'geodir_related_post_relate_to',
620
+		'css' => 'min-width:300px;',
621
+		'std' => 'category',
622
+		'type' => 'select',
623
+		'class' => 'chosen_select',
624
+		'options' => array_unique(array(
625
+			'category' => __('Categories', 'geodirectory'),
626
+			'tags' => __('Tags', 'geodirectory'),
627
+		))
628
+	),
629 629
 
630
-    array(
631
-        'name' => __('Layout', 'geodirectory'),
632
-        'desc' => __('Set the listing view of relate post on detail page', 'geodirectory'),
633
-        'id' => 'geodir_related_post_listing_view',
634
-        'css' => 'min-width:300px;',
635
-        'std' => 'gridview_onehalf',
636
-        'type' => 'select',
637
-        'class' => 'chosen_select',
638
-        'options' => array_unique(array(
639
-            'gridview_onehalf' => __('Grid View (Two Columns)', 'geodirectory'),
640
-            'gridview_onethird' => __('Grid View (Three Columns)', 'geodirectory'),
641
-            'gridview_onefourth' => __('Grid View (Four Columns)', 'geodirectory'),
642
-            'gridview_onefifth' => __('Grid View (Five Columns)', 'geodirectory'),
643
-            'listview' => __('List view', 'geodirectory'),
644
-        ))
645
-    ),
630
+	array(
631
+		'name' => __('Layout', 'geodirectory'),
632
+		'desc' => __('Set the listing view of relate post on detail page', 'geodirectory'),
633
+		'id' => 'geodir_related_post_listing_view',
634
+		'css' => 'min-width:300px;',
635
+		'std' => 'gridview_onehalf',
636
+		'type' => 'select',
637
+		'class' => 'chosen_select',
638
+		'options' => array_unique(array(
639
+			'gridview_onehalf' => __('Grid View (Two Columns)', 'geodirectory'),
640
+			'gridview_onethird' => __('Grid View (Three Columns)', 'geodirectory'),
641
+			'gridview_onefourth' => __('Grid View (Four Columns)', 'geodirectory'),
642
+			'gridview_onefifth' => __('Grid View (Five Columns)', 'geodirectory'),
643
+			'listview' => __('List view', 'geodirectory'),
644
+		))
645
+	),
646 646
 
647
-    array(
648
-        'name' => __('Sort by', 'geodirectory'),
649
-        'desc' => __('Set the related post listing sort by view', 'geodirectory'),
650
-        'id' => 'geodir_related_post_sortby',
651
-        'css' => 'min-width:300px;',
652
-        'std' => 'latest',
653
-        'type' => 'select',
654
-        'class' => 'chosen_select',
655
-        'options' => array_unique(array(
656
-            'latest' => __('Latest', 'geodirectory'),
657
-            'featured' => __('Featured', 'geodirectory'),
658
-            'high_review' => __('Review', 'geodirectory'),
659
-            'high_rating' => __('Rating', 'geodirectory'),
660
-            'random' => __('Random', 'geodirectory'),
661
-        ))
662
-    ),
647
+	array(
648
+		'name' => __('Sort by', 'geodirectory'),
649
+		'desc' => __('Set the related post listing sort by view', 'geodirectory'),
650
+		'id' => 'geodir_related_post_sortby',
651
+		'css' => 'min-width:300px;',
652
+		'std' => 'latest',
653
+		'type' => 'select',
654
+		'class' => 'chosen_select',
655
+		'options' => array_unique(array(
656
+			'latest' => __('Latest', 'geodirectory'),
657
+			'featured' => __('Featured', 'geodirectory'),
658
+			'high_review' => __('Review', 'geodirectory'),
659
+			'high_rating' => __('Rating', 'geodirectory'),
660
+			'random' => __('Random', 'geodirectory'),
661
+		))
662
+	),
663 663
 
664
-    array(
665
-        'name' => __('Number of posts:', 'geodirectory'),
666
-        'desc' => __('Enter number of posts to display on related posts listing', 'geodirectory'),
667
-        'id' => 'geodir_related_post_count',
668
-        'type' => 'text',
669
-        'css' => 'min-width:300px;',
670
-        'std' => '5' // Default value to show home top section
671
-    ),
664
+	array(
665
+		'name' => __('Number of posts:', 'geodirectory'),
666
+		'desc' => __('Enter number of posts to display on related posts listing', 'geodirectory'),
667
+		'id' => 'geodir_related_post_count',
668
+		'type' => 'text',
669
+		'css' => 'min-width:300px;',
670
+		'std' => '5' // Default value to show home top section
671
+	),
672 672
 
673
-    array(
674
-        'name' => __('Post excerpt', 'geodirectory'),
675
-        'desc' => __('Post content excerpt character count', 'geodirectory'),
676
-        'id' => 'geodir_related_post_excerpt',
677
-        'type' => 'text',
678
-        'css' => 'min-width:300px;',
679
-        'std' => '20' // Default value to show home top section
680
-    ),
673
+	array(
674
+		'name' => __('Post excerpt', 'geodirectory'),
675
+		'desc' => __('Post content excerpt character count', 'geodirectory'),
676
+		'id' => 'geodir_related_post_excerpt',
677
+		'type' => 'text',
678
+		'css' => 'min-width:300px;',
679
+		'std' => '20' // Default value to show home top section
680
+	),
681 681
 
682 682
 
683
-    array('type' => 'sectionend', 'id' => 'detail_page_related_post_settings'),
684
-    /* Detail Layout Settings end */
683
+	array('type' => 'sectionend', 'id' => 'detail_page_related_post_settings'),
684
+	/* Detail Layout Settings end */
685 685
 
686
-    /* Author Layout Settings Start */
686
+	/* Author Layout Settings Start */
687 687
 
688
-    array('name' => __('Author', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_author_settings '),
688
+	array('name' => __('Author', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_author_settings '),
689 689
 
690 690
 
691
-    array('name' => __('Author Page Layout Settings', 'geodirectory'),
692
-        'type' => 'sectionstart',
693
-        'desc' => '',
694
-        'id' => 'geodir_author_layout'),
691
+	array('name' => __('Author Page Layout Settings', 'geodirectory'),
692
+		'type' => 'sectionstart',
693
+		'desc' => '',
694
+		'id' => 'geodir_author_layout'),
695 695
 
696
-    array(
697
-        'name' => __('Author top section', 'geodirectory'),
698
-        'desc' => __('Show the top section of author page', 'geodirectory'),
699
-        'id' => 'geodir_show_author_top_section',
700
-        'type' => 'checkbox',
701
-        'std' => '1' // Default value to show home top section
702
-    ),
696
+	array(
697
+		'name' => __('Author top section', 'geodirectory'),
698
+		'desc' => __('Show the top section of author page', 'geodirectory'),
699
+		'id' => 'geodir_show_author_top_section',
700
+		'type' => 'checkbox',
701
+		'std' => '1' // Default value to show home top section
702
+	),
703 703
 
704
-    array(
705
-        'name' => __('Author right section', 'geodirectory'),
706
-        'desc' => __('Show the right section of author page', 'geodirectory'),
707
-        'id' => 'geodir_show_author_right_section',
708
-        'type' => 'checkbox',
709
-        'std' => '1' // Default value to show home top section
710
-    ),
704
+	array(
705
+		'name' => __('Author right section', 'geodirectory'),
706
+		'desc' => __('Show the right section of author page', 'geodirectory'),
707
+		'id' => 'geodir_show_author_right_section',
708
+		'type' => 'checkbox',
709
+		'std' => '1' // Default value to show home top section
710
+	),
711 711
 
712
-    array(
713
-        'name' => __('Width of author right section', 'geodirectory'),
714
-        'desc' => __('Enter the width of right section of author page in %', 'geodirectory'),
715
-        'id' => 'geodir_width_author_right_section',
716
-        'type' => 'text',
717
-        'css' => 'min-width:300px;',
718
-        'std' => '30' // Default value to show home top section
719
-    ),
712
+	array(
713
+		'name' => __('Width of author right section', 'geodirectory'),
714
+		'desc' => __('Enter the width of right section of author page in %', 'geodirectory'),
715
+		'id' => 'geodir_width_author_right_section',
716
+		'type' => 'text',
717
+		'css' => 'min-width:300px;',
718
+		'std' => '30' // Default value to show home top section
719
+	),
720 720
 
721
-    array(
722
-        'name' => __('Author content section view', 'geodirectory'),
723
-        'desc' => __('Set the listing view of author page', 'geodirectory'),
724
-        'id' => 'geodir_author_view',
725
-        'css' => 'min-width:300px;',
726
-        'std' => 'gridview_onehalf',
727
-        'type' => 'select',
728
-        'class' => 'chosen_select',
729
-        'options' => array_unique(array(
730
-            'gridview_onehalf' => __('Grid View (Two Columns)', 'geodirectory'),
731
-            'gridview_onethird' => __('Grid View (Three Columns)', 'geodirectory'),
732
-            'gridview_onefourth' => __('Grid View (Four Columns)', 'geodirectory'),
733
-            'gridview_onefifth' => __('Grid View (Five Columns)', 'geodirectory'),
734
-            'listview' => __('List view', 'geodirectory'),
735
-        ))
736
-    ),
721
+	array(
722
+		'name' => __('Author content section view', 'geodirectory'),
723
+		'desc' => __('Set the listing view of author page', 'geodirectory'),
724
+		'id' => 'geodir_author_view',
725
+		'css' => 'min-width:300px;',
726
+		'std' => 'gridview_onehalf',
727
+		'type' => 'select',
728
+		'class' => 'chosen_select',
729
+		'options' => array_unique(array(
730
+			'gridview_onehalf' => __('Grid View (Two Columns)', 'geodirectory'),
731
+			'gridview_onethird' => __('Grid View (Three Columns)', 'geodirectory'),
732
+			'gridview_onefourth' => __('Grid View (Four Columns)', 'geodirectory'),
733
+			'gridview_onefifth' => __('Grid View (Five Columns)', 'geodirectory'),
734
+			'listview' => __('List view', 'geodirectory'),
735
+		))
736
+	),
737 737
 
738
-    array(
739
-        'name' => __('Width of author content section', 'geodirectory'),
740
-        'desc' => __('Enter the width of content section of author page in %', 'geodirectory'),
741
-        'id' => 'geodir_width_author_contant_section',
742
-        'type' => 'text',
743
-        'css' => 'min-width:300px;',
744
-        'std' => '63' // Default value to show home top section
745
-    ),
738
+	array(
739
+		'name' => __('Width of author content section', 'geodirectory'),
740
+		'desc' => __('Enter the width of content section of author page in %', 'geodirectory'),
741
+		'id' => 'geodir_width_author_contant_section',
742
+		'type' => 'text',
743
+		'css' => 'min-width:300px;',
744
+		'std' => '63' // Default value to show home top section
745
+	),
746 746
 
747
-    array(
748
-        'name' => __('Author left section', 'geodirectory'),
749
-        'desc' => __('Show the left section of author page', 'geodirectory'),
750
-        'id' => 'geodir_show_author_left_section',
751
-        'type' => 'checkbox',
752
-        'std' => '0' // Default value to show home top section
753
-    ),
747
+	array(
748
+		'name' => __('Author left section', 'geodirectory'),
749
+		'desc' => __('Show the left section of author page', 'geodirectory'),
750
+		'id' => 'geodir_show_author_left_section',
751
+		'type' => 'checkbox',
752
+		'std' => '0' // Default value to show home top section
753
+	),
754 754
 
755
-    array(
756
-        'name' => __('Width of author left section', 'geodirectory'),
757
-        'desc' => __('Enter the width of left section of home page in %', 'geodirectory'),
758
-        'id' => 'geodir_width_author_left_section',
759
-        'type' => 'text',
760
-        'css' => 'min-width:300px;',
761
-        'std' => '30' // Default value to show home top section
762
-    ),
755
+	array(
756
+		'name' => __('Width of author left section', 'geodirectory'),
757
+		'desc' => __('Enter the width of left section of home page in %', 'geodirectory'),
758
+		'id' => 'geodir_width_author_left_section',
759
+		'type' => 'text',
760
+		'css' => 'min-width:300px;',
761
+		'std' => '30' // Default value to show home top section
762
+	),
763 763
 
764
-    array(
765
-        'name' => __('Author bottom section', 'geodirectory'),
766
-        'desc' => __('Show the bottom section of author page', 'geodirectory'),
767
-        'id' => 'geodir_show_author_bottom_section',
768
-        'type' => 'checkbox',
769
-        'std' => '0' // Default value to show home top section
770
-    ),
764
+	array(
765
+		'name' => __('Author bottom section', 'geodirectory'),
766
+		'desc' => __('Show the bottom section of author page', 'geodirectory'),
767
+		'id' => 'geodir_show_author_bottom_section',
768
+		'type' => 'checkbox',
769
+		'std' => '0' // Default value to show home top section
770
+	),
771 771
 
772 772
 
773
-    array(
774
-        'name' => __('Description word limit', 'geodirectory'),
775
-        'desc' => '',
776
-        'id' => 'geodir_author_desc_word_limit',
777
-        'type' => 'text',
778
-        'css' => 'min-width:300px;',
779
-        'std' => '50' // Default value to show home top section
780
-    ),
773
+	array(
774
+		'name' => __('Description word limit', 'geodirectory'),
775
+		'desc' => '',
776
+		'id' => 'geodir_author_desc_word_limit',
777
+		'type' => 'text',
778
+		'css' => 'min-width:300px;',
779
+		'std' => '50' // Default value to show home top section
780
+	),
781 781
 
782
-    array('type' => 'sectionend', 'id' => 'geodir_author_layout'),
783
-    /* Author Layout Settings end */
782
+	array('type' => 'sectionend', 'id' => 'geodir_author_layout'),
783
+	/* Author Layout Settings end */
784 784
 
785 785
 
786
-    /* Post Type Navigation Settings Start */
787
-    array('name' => __('Navigation', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_navigation_settings'),
786
+	/* Post Type Navigation Settings Start */
787
+	array('name' => __('Navigation', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_navigation_settings'),
788 788
 
789 789
 
790
-    /* Post Type Navigation Settings Start */
790
+	/* Post Type Navigation Settings Start */
791 791
 
792
-    array('name' => __('Navigation Locations', 'geodirectory'),
793
-        'type' => 'sectionstart',
794
-        'desc' => '',
795
-        'id' => 'geodir_navigation_locations'),
792
+	array('name' => __('Navigation Locations', 'geodirectory'),
793
+		'type' => 'sectionstart',
794
+		'desc' => '',
795
+		'id' => 'geodir_navigation_locations'),
796 796
 
797
-    array(
798
-        'name' => __('Show geodirectory navigation in selected menu locations', 'geodirectory'),
799
-        'desc' => '',
800
-        'tip' => '',
801
-        'id' => 'geodir_theme_location_nav',
802
-        'css' => 'min-width:300px;',
803
-        'std' => array(),
804
-        'type' => 'multiselect',
805
-        'placeholder_text' => __('Select menu locations', 'geodirectory'),
806
-        'class' => 'chosen_select',
807
-        'options' => array_unique(geodir_theme_location_setting_fun())
808
-    ),
809
-    array('type' => 'sectionend', 'id' => 'geodir_navigation_options'),
810
-
811
-
812
-    array('name' => __('Navigation Settings', 'geodirectory'),
813
-        'type' => 'sectionstart',
814
-        'desc' => '',
815
-        'id' => 'geodir_navigation_options'),
797
+	array(
798
+		'name' => __('Show geodirectory navigation in selected menu locations', 'geodirectory'),
799
+		'desc' => '',
800
+		'tip' => '',
801
+		'id' => 'geodir_theme_location_nav',
802
+		'css' => 'min-width:300px;',
803
+		'std' => array(),
804
+		'type' => 'multiselect',
805
+		'placeholder_text' => __('Select menu locations', 'geodirectory'),
806
+		'class' => 'chosen_select',
807
+		'options' => array_unique(geodir_theme_location_setting_fun())
808
+	),
809
+	array('type' => 'sectionend', 'id' => 'geodir_navigation_options'),
816 810
 
817 811
 
818
-    array(
819
-        'name' => __('Show add listing navigation in menu', 'geodirectory'),
820
-        'desc' => sprintf(__('Show add listing navigation in main menu? (untick to disable) If you disable this option, none of the add listing link will appear in main navigation.', 'geodirectory')),
821
-        'id' => 'geodir_show_addlisting_nav',
822
-        'std' => '1',
823
-        'type' => 'checkbox'
824
-    ),
812
+	array('name' => __('Navigation Settings', 'geodirectory'),
813
+		'type' => 'sectionstart',
814
+		'desc' => '',
815
+		'id' => 'geodir_navigation_options'),
825 816
 
826
-    array(
827
-        'name' => __('Show listings navigation in menu', 'geodirectory'),
828
-        'desc' => sprintf(__('Show listing navigation in main menu? (untick to disable) If you disable this option, none of the listing link will appear in main navigation.', 'geodirectory')),
829
-        'id' => 'geodir_show_listing_nav',
830
-        'std' => '1',
831
-        'type' => 'checkbox'
832
-    ),
833 817
 
834
-    array('type' => 'sectionend', 'id' => 'geodir_navigation_options'),
818
+	array(
819
+		'name' => __('Show add listing navigation in menu', 'geodirectory'),
820
+		'desc' => sprintf(__('Show add listing navigation in main menu? (untick to disable) If you disable this option, none of the add listing link will appear in main navigation.', 'geodirectory')),
821
+		'id' => 'geodir_show_addlisting_nav',
822
+		'std' => '1',
823
+		'type' => 'checkbox'
824
+	),
835 825
 
826
+	array(
827
+		'name' => __('Show listings navigation in menu', 'geodirectory'),
828
+		'desc' => sprintf(__('Show listing navigation in main menu? (untick to disable) If you disable this option, none of the listing link will appear in main navigation.', 'geodirectory')),
829
+		'id' => 'geodir_show_listing_nav',
830
+		'std' => '1',
831
+		'type' => 'checkbox'
832
+	),
836 833
 
837
-    array('name' => __('Post Type Navigation Settings', 'geodirectory'),
838
-        'type' => 'sectionstart',
839
-        'desc' => '',
840
-        'id' => 'geodir_post_type_navigation_layout'),
841
-    array(
842
-        'name' => __('Show listing link in main navigation', 'geodirectory'),
843
-        'desc' => '',
844
-        'tip' => '',
845
-        'id' => 'geodir_add_posttype_in_main_nav',
846
-        'css' => 'min-width:300px;',
847
-        'std' => array(),
848
-        'type' => 'multiselect',
849
-        'placeholder_text' => __('Select post types', 'geodirectory'),
850
-        'class' => 'chosen_select',
851
-        'options' => array_unique(geodir_post_type_setting_fun())
852
-    ),
834
+	array('type' => 'sectionend', 'id' => 'geodir_navigation_options'),
853 835
 
854
-    array(
855
-        'name' => __('Show listing link in listing navigation', 'geodirectory'),
856
-        'desc' => '',
857
-        'tip' => '',
858
-        'id' => 'geodir_add_posttype_in_listing_nav',
859
-        'css' => 'min-width:300px;',
860
-        'std' => geodir_get_posttypes(),
861
-        'type' => 'multiselect',
862
-        'placeholder_text' => __('Select post types', 'geodirectory'),
863
-        'class' => 'chosen_select',
864
-        'options' => array_unique(geodir_post_type_setting_fun())
865
-    ),
866 836
 
867
-    array(
868
-        'name' => __('Allow post type to add from frontend', 'geodirectory'),
869
-        'desc' => '',
870
-        'tip' => '',
871
-        'id' => 'geodir_allow_posttype_frontend',
872
-        'css' => 'min-width:300px;',
873
-        'std' => geodir_get_posttypes(),
874
-        'type' => 'multiselect',
875
-        'placeholder_text' => __('Select post types', 'geodirectory'),
876
-        'class' => 'chosen_select',
877
-        'options' => array_unique(geodir_post_type_setting_fun())
878
-    ),
837
+	array('name' => __('Post Type Navigation Settings', 'geodirectory'),
838
+		'type' => 'sectionstart',
839
+		'desc' => '',
840
+		'id' => 'geodir_post_type_navigation_layout'),
841
+	array(
842
+		'name' => __('Show listing link in main navigation', 'geodirectory'),
843
+		'desc' => '',
844
+		'tip' => '',
845
+		'id' => 'geodir_add_posttype_in_main_nav',
846
+		'css' => 'min-width:300px;',
847
+		'std' => array(),
848
+		'type' => 'multiselect',
849
+		'placeholder_text' => __('Select post types', 'geodirectory'),
850
+		'class' => 'chosen_select',
851
+		'options' => array_unique(geodir_post_type_setting_fun())
852
+	),
879 853
 
880
-    array(
881
-        'name' => __('Show add listing link in main navigation', 'geodirectory'),
882
-        'desc' => '',
883
-        'tip' => '',
884
-        'id' => 'geodir_add_listing_link_main_nav',
885
-        'css' => 'min-width:300px;',
886
-        'std' => array(),
887
-        'type' => 'multiselect',
888
-        'placeholder_text' => __('Select post types', 'geodirectory'),
889
-        'class' => 'chosen_select',
890
-        'options' => array_unique(geodir_post_type_setting_fun())
891
-    ),
854
+	array(
855
+		'name' => __('Show listing link in listing navigation', 'geodirectory'),
856
+		'desc' => '',
857
+		'tip' => '',
858
+		'id' => 'geodir_add_posttype_in_listing_nav',
859
+		'css' => 'min-width:300px;',
860
+		'std' => geodir_get_posttypes(),
861
+		'type' => 'multiselect',
862
+		'placeholder_text' => __('Select post types', 'geodirectory'),
863
+		'class' => 'chosen_select',
864
+		'options' => array_unique(geodir_post_type_setting_fun())
865
+	),
892 866
 
893
-    array(
894
-        'name' => __('Show add listing link in add listing navigation', 'geodirectory'),
895
-        'desc' => '',
896
-        'tip' => '',
897
-        'id' => 'geodir_add_listing_link_add_listing_nav',
898
-        'css' => 'min-width:300px;',
899
-        'std' => geodir_get_posttypes(),
900
-        'type' => 'multiselect',
901
-        'class' => 'chosen_select',
902
-        'options' => array_unique(geodir_post_type_setting_fun())
903
-    ),
867
+	array(
868
+		'name' => __('Allow post type to add from frontend', 'geodirectory'),
869
+		'desc' => '',
870
+		'tip' => '',
871
+		'id' => 'geodir_allow_posttype_frontend',
872
+		'css' => 'min-width:300px;',
873
+		'std' => geodir_get_posttypes(),
874
+		'type' => 'multiselect',
875
+		'placeholder_text' => __('Select post types', 'geodirectory'),
876
+		'class' => 'chosen_select',
877
+		'options' => array_unique(geodir_post_type_setting_fun())
878
+	),
904 879
 
905
-    array('type' => 'sectionend', 'id' => 'geodir_post_type_navigation_layout'),
880
+	array(
881
+		'name' => __('Show add listing link in main navigation', 'geodirectory'),
882
+		'desc' => '',
883
+		'tip' => '',
884
+		'id' => 'geodir_add_listing_link_main_nav',
885
+		'css' => 'min-width:300px;',
886
+		'std' => array(),
887
+		'type' => 'multiselect',
888
+		'placeholder_text' => __('Select post types', 'geodirectory'),
889
+		'class' => 'chosen_select',
890
+		'options' => array_unique(geodir_post_type_setting_fun())
891
+	),
906 892
 
893
+	array(
894
+		'name' => __('Show add listing link in add listing navigation', 'geodirectory'),
895
+		'desc' => '',
896
+		'tip' => '',
897
+		'id' => 'geodir_add_listing_link_add_listing_nav',
898
+		'css' => 'min-width:300px;',
899
+		'std' => geodir_get_posttypes(),
900
+		'type' => 'multiselect',
901
+		'class' => 'chosen_select',
902
+		'options' => array_unique(geodir_post_type_setting_fun())
903
+	),
907 904
 
908
-    array('name' => __('User Dashboard Post Type Navigation Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_user_dashboard_post_type '),
905
+	array('type' => 'sectionend', 'id' => 'geodir_post_type_navigation_layout'),
909 906
 
910 907
 
911
-    array(
912
-        'name' => __('Show add listing link in user dashboard', 'geodirectory'),
913
-        'desc' => '',
914
-        'tip' => '',
915
-        'id' => 'geodir_add_listing_link_user_dashboard',
916
-        'css' => 'min-width:300px;',
917
-        'std' => geodir_get_posttypes(),
918
-        'type' => 'multiselect',
919
-        'placeholder_text' => __('Select post types', 'geodirectory'),
920
-        'class' => 'chosen_select',
921
-        'options' => array_unique(geodir_post_type_setting_fun())
922
-    ),
908
+	array('name' => __('User Dashboard Post Type Navigation Settings', 'geodirectory'), 'type' => 'sectionstart', 'desc' => '', 'id' => 'geodir_user_dashboard_post_type '),
923 909
 
924
-    array(
925
-        'name' => __('Show favorite link in user dashboard', 'geodirectory'),
926
-        'desc' => __('Option will not appear if user does not have a favorite of that post type', 'geodirectory'),
927
-        'tip' => '',
928
-        'id' => 'geodir_favorite_link_user_dashboard',
929
-        'css' => 'min-width:300px;',
930
-        'std' => geodir_get_posttypes(),
931
-        'type' => 'multiselect',
932
-        'placeholder_text' => __('Select post types', 'geodirectory'),
933
-        'class' => 'chosen_select',
934
-        'options' => array_unique(geodir_post_type_setting_fun())
935
-    ),
936 910
 
937
-    array(
938
-        'name' => __('Show listing link in user dashboard', 'geodirectory'),
939
-        'desc' => __('Option will not appear if user does not have his/her own listing of that post type', 'geodirectory'),
940
-        'tip' => '',
941
-        'id' => 'geodir_listing_link_user_dashboard',
942
-        'css' => 'min-width:300px;',
943
-        'std' => geodir_get_posttypes(),
944
-        'type' => 'multiselect',
945
-        'placeholder_text' => __('Select post types', 'geodirectory'),
946
-        'class' => 'chosen_select',
947
-        'options' => array_unique(geodir_post_type_setting_fun())
948
-    ),
949
-
950
-    array('type' => 'sectionend', 'id' => 'geodir_user_dashboard_post_type'),
951
-    /* Post Type Navigation Settings End */
952
-
953
-    /* Script Settings Start */
954
-    array('name' => __('Scripts', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_script_settings '),
955
-
956
-    /*
911
+	array(
912
+		'name' => __('Show add listing link in user dashboard', 'geodirectory'),
913
+		'desc' => '',
914
+		'tip' => '',
915
+		'id' => 'geodir_add_listing_link_user_dashboard',
916
+		'css' => 'min-width:300px;',
917
+		'std' => geodir_get_posttypes(),
918
+		'type' => 'multiselect',
919
+		'placeholder_text' => __('Select post types', 'geodirectory'),
920
+		'class' => 'chosen_select',
921
+		'options' => array_unique(geodir_post_type_setting_fun())
922
+	),
923
+
924
+	array(
925
+		'name' => __('Show favorite link in user dashboard', 'geodirectory'),
926
+		'desc' => __('Option will not appear if user does not have a favorite of that post type', 'geodirectory'),
927
+		'tip' => '',
928
+		'id' => 'geodir_favorite_link_user_dashboard',
929
+		'css' => 'min-width:300px;',
930
+		'std' => geodir_get_posttypes(),
931
+		'type' => 'multiselect',
932
+		'placeholder_text' => __('Select post types', 'geodirectory'),
933
+		'class' => 'chosen_select',
934
+		'options' => array_unique(geodir_post_type_setting_fun())
935
+	),
936
+
937
+	array(
938
+		'name' => __('Show listing link in user dashboard', 'geodirectory'),
939
+		'desc' => __('Option will not appear if user does not have his/her own listing of that post type', 'geodirectory'),
940
+		'tip' => '',
941
+		'id' => 'geodir_listing_link_user_dashboard',
942
+		'css' => 'min-width:300px;',
943
+		'std' => geodir_get_posttypes(),
944
+		'type' => 'multiselect',
945
+		'placeholder_text' => __('Select post types', 'geodirectory'),
946
+		'class' => 'chosen_select',
947
+		'options' => array_unique(geodir_post_type_setting_fun())
948
+	),
949
+
950
+	array('type' => 'sectionend', 'id' => 'geodir_user_dashboard_post_type'),
951
+	/* Post Type Navigation Settings End */
952
+
953
+	/* Script Settings Start */
954
+	array('name' => __('Scripts', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_script_settings '),
955
+
956
+	/*
957 957
     array( 	'name' => __( 'Add/Remove Scripts', 'geodirectory' ),
958 958
                 'type' => 'sectionstart',
959 959
                 'desc' => '',
@@ -979,150 +979,150 @@  discard block
 block discarded – undo
979 979
 
980 980
     */
981 981
 
982
-    array('name' => __('SCSS Settings (CSS combine and minify)', 'geodirectory'),
983
-        'type' => 'sectionstart',
984
-        'desc' => '',
985
-        'id' => 'geodir_scss_settings'),
982
+	array('name' => __('SCSS Settings (CSS combine and minify)', 'geodirectory'),
983
+		'type' => 'sectionstart',
984
+		'desc' => '',
985
+		'id' => 'geodir_scss_settings'),
986 986
 
987
-    array(
988
-        'name' => __('Disable Core SCSS', 'geodirectory'),
989
-        'desc' => __('Stops the CSS files being minified and output as one.', 'geodirectory'),
990
-        'id' => 'geodir_scss_core',
991
-        'type' => 'checkbox',
992
-        'std' => '0' // Default value to show home top section
993
-    ),
987
+	array(
988
+		'name' => __('Disable Core SCSS', 'geodirectory'),
989
+		'desc' => __('Stops the CSS files being minified and output as one.', 'geodirectory'),
990
+		'id' => 'geodir_scss_core',
991
+		'type' => 'checkbox',
992
+		'std' => '0' // Default value to show home top section
993
+	),
994 994
 
995
-    array('type' => 'sectionend', 'id' => 'geodir_scss_settings'),
995
+	array('type' => 'sectionend', 'id' => 'geodir_scss_settings'),
996 996
 
997
-    array('name' => __('Script Settings', 'geodirectory'),
998
-        'type' => 'sectionstart',
999
-        'desc' => '',
1000
-        'id' => 'geodir_script_settings'),
997
+	array('name' => __('Script Settings', 'geodirectory'),
998
+		'type' => 'sectionstart',
999
+		'desc' => '',
1000
+		'id' => 'geodir_script_settings'),
1001 1001
 
1002
-    array(
1003
-        'name' => __('Custom style css code', 'geodirectory'),
1004
-        'desc' => '',
1005
-        'id' => 'geodir_coustem_css',
1006
-        'type' => 'textarea',
1007
-        'css' => 'min-width:300px;',
1008
-        'std' => '' // Default value for the page title - changed in settings
1009
-    ),
1002
+	array(
1003
+		'name' => __('Custom style css code', 'geodirectory'),
1004
+		'desc' => '',
1005
+		'id' => 'geodir_coustem_css',
1006
+		'type' => 'textarea',
1007
+		'css' => 'min-width:300px;',
1008
+		'std' => '' // Default value for the page title - changed in settings
1009
+	),
1010 1010
 
1011
-    array(
1012
-        'name' => __('Header script code', 'geodirectory'),
1013
-        'desc' => '',
1014
-        'id' => 'geodir_header_scripts',
1015
-        'type' => 'textarea',
1016
-        'css' => 'min-width:300px;',
1017
-        'std' => '' // Default value for the page title - changed in settings
1018
-    ),
1011
+	array(
1012
+		'name' => __('Header script code', 'geodirectory'),
1013
+		'desc' => '',
1014
+		'id' => 'geodir_header_scripts',
1015
+		'type' => 'textarea',
1016
+		'css' => 'min-width:300px;',
1017
+		'std' => '' // Default value for the page title - changed in settings
1018
+	),
1019 1019
 
1020
-    array(
1021
-        'name' => __('Footer script code', 'geodirectory'),
1022
-        'desc' => '',
1023
-        'id' => 'geodir_footer_scripts',
1024
-        'type' => 'textarea',
1025
-        'css' => 'min-width:300px;',
1026
-        'std' => '' // Default value for the page title - changed in settings
1027
-    ),
1020
+	array(
1021
+		'name' => __('Footer script code', 'geodirectory'),
1022
+		'desc' => '',
1023
+		'id' => 'geodir_footer_scripts',
1024
+		'type' => 'textarea',
1025
+		'css' => 'min-width:300px;',
1026
+		'std' => '' // Default value for the page title - changed in settings
1027
+	),
1028 1028
 
1029
-    array('type' => 'sectionend', 'id' => 'geodir_script_settings'),
1030
-    /* Script Settings End */
1029
+	array('type' => 'sectionend', 'id' => 'geodir_script_settings'),
1030
+	/* Script Settings End */
1031 1031
 
1032
-    /* Map Settings Start */
1033
-    array('name' => __('Map', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_map_settings '),
1032
+	/* Map Settings Start */
1033
+	array('name' => __('Map', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'geodir_map_settings '),
1034 1034
 
1035
-    /* Untick the category by default on home map */
1036
-    array(
1037
-        'name' => __('Home Map Settings', 'geodirectory'),
1038
-        'type' => 'sectionstart',
1039
-        'desc' => '',
1040
-        'id' => 'geodir_home_map_section'
1041
-    ),
1042
-    array(
1043
-        'name' => __('Select category to untick by default on map', 'geodirectory'),
1044
-        'desc' => __('Select category to untick by default on the home map.', 'geodirectory'),
1045
-        'tip' => '',
1046
-        'id' => 'geodir_home_map_untick',
1047
-        'css' => 'min-width:300px;',
1048
-        'std' => '',
1049
-        'type' => 'multiselect',
1050
-        'placeholder_text' => __('Select category', 'geodirectory'),
1051
-        'class' => 'chosen_select',
1052
-        'options' => geodir_home_map_cats_key_value_array()
1053
-    ),
1054
-    array(
1055
-        'type' => 'sectionend',
1056
-        'id' => 'geodir_home_map_section'
1057
-    ),
1035
+	/* Untick the category by default on home map */
1036
+	array(
1037
+		'name' => __('Home Map Settings', 'geodirectory'),
1038
+		'type' => 'sectionstart',
1039
+		'desc' => '',
1040
+		'id' => 'geodir_home_map_section'
1041
+	),
1042
+	array(
1043
+		'name' => __('Select category to untick by default on map', 'geodirectory'),
1044
+		'desc' => __('Select category to untick by default on the home map.', 'geodirectory'),
1045
+		'tip' => '',
1046
+		'id' => 'geodir_home_map_untick',
1047
+		'css' => 'min-width:300px;',
1048
+		'std' => '',
1049
+		'type' => 'multiselect',
1050
+		'placeholder_text' => __('Select category', 'geodirectory'),
1051
+		'class' => 'chosen_select',
1052
+		'options' => geodir_home_map_cats_key_value_array()
1053
+	),
1054
+	array(
1055
+		'type' => 'sectionend',
1056
+		'id' => 'geodir_home_map_section'
1057
+	),
1058 1058
 
1059
-    array(
1060
-        'name' => __('Add Listing Map Settings', 'geodirectory'),
1061
-        'type' => 'sectionstart',
1062
-        'desc' => '',
1063
-        'id' => 'geodir_add_listing_map_section'
1064
-    ),
1065
-    array(
1066
-        'name' => __('Disable mouse scroll', 'geodirectory'),
1067
-        'desc' => __('Stops the mouse scroll zooming the map', 'geodirectory'),
1068
-        'id' => 'geodir_add_listing_mouse_scroll',
1069
-        'type' => 'checkbox',
1070
-        'std' => '0' // Default value to show home top section
1071
-    ),
1072
-    array(
1073
-        'type' => 'sectionend',
1074
-        'id' => 'geodir_add_listing_map_section'
1075
-    ),
1059
+	array(
1060
+		'name' => __('Add Listing Map Settings', 'geodirectory'),
1061
+		'type' => 'sectionstart',
1062
+		'desc' => '',
1063
+		'id' => 'geodir_add_listing_map_section'
1064
+	),
1065
+	array(
1066
+		'name' => __('Disable mouse scroll', 'geodirectory'),
1067
+		'desc' => __('Stops the mouse scroll zooming the map', 'geodirectory'),
1068
+		'id' => 'geodir_add_listing_mouse_scroll',
1069
+		'type' => 'checkbox',
1070
+		'std' => '0' // Default value to show home top section
1071
+	),
1072
+	array(
1073
+		'type' => 'sectionend',
1074
+		'id' => 'geodir_add_listing_map_section'
1075
+	),
1076 1076
 
1077 1077
 
1078
-    array('name' => __('Default map settings', 'geodirectory'),
1079
-        'type' => 'sectionstart',
1080
-        'desc' => '',
1081
-        'id' => 'geodir_map_default_settings'),
1078
+	array('name' => __('Default map settings', 'geodirectory'),
1079
+		'type' => 'sectionstart',
1080
+		'desc' => '',
1081
+		'id' => 'geodir_map_default_settings'),
1082 1082
 
1083
-    array(
1084
-        'name' => '',
1085
-        'desc' => '',
1086
-        'id' => 'map_default_settings',
1087
-        'type' => 'map_default_settings',
1088
-        'css' => 'min-width:300px;',
1089
-        'std' => '' // Default value for the page title - changed in settings
1090
-    ),
1083
+	array(
1084
+		'name' => '',
1085
+		'desc' => '',
1086
+		'id' => 'map_default_settings',
1087
+		'type' => 'map_default_settings',
1088
+		'css' => 'min-width:300px;',
1089
+		'std' => '' // Default value for the page title - changed in settings
1090
+	),
1091 1091
 
1092
-    array(
1093
-        'name' => __('Upload map default marker icon', 'geodirectory'),
1094
-        'desc' => '',
1095
-        'id' => 'geodir_default_marker_icon',
1096
-        'type' => 'file',
1097
-        'std' => '0',
1098
-        'value' => geodir_plugin_url() . '/geodirectory-functions/map-functions/icons/pin.png'// Default value to show home top section
1099
-    ),
1100
-    // add option that allows enable/disable map dragging to phone devices
1101
-    array(
1102
-        'name' => __('Show button control on map to enable/disable dragging', 'geodirectory'),
1103
-        'desc' => __('If checked, it displays button control to enable/disable dragging on google maps for phone devices', 'geodirectory'),
1104
-        'id' => 'geodir_map_onoff_dragging',
1105
-        'type' => 'checkbox',
1106
-        'std' => '0' // Default value to show home top section
1107
-    ),
1092
+	array(
1093
+		'name' => __('Upload map default marker icon', 'geodirectory'),
1094
+		'desc' => '',
1095
+		'id' => 'geodir_default_marker_icon',
1096
+		'type' => 'file',
1097
+		'std' => '0',
1098
+		'value' => geodir_plugin_url() . '/geodirectory-functions/map-functions/icons/pin.png'// Default value to show home top section
1099
+	),
1100
+	// add option that allows enable/disable map dragging to phone devices
1101
+	array(
1102
+		'name' => __('Show button control on map to enable/disable dragging', 'geodirectory'),
1103
+		'desc' => __('If checked, it displays button control to enable/disable dragging on google maps for phone devices', 'geodirectory'),
1104
+		'id' => 'geodir_map_onoff_dragging',
1105
+		'type' => 'checkbox',
1106
+		'std' => '0' // Default value to show home top section
1107
+	),
1108 1108
 
1109
-    array('type' => 'sectionend', 'id' => 'geodir_map_default_settings'),
1109
+	array('type' => 'sectionend', 'id' => 'geodir_map_default_settings'),
1110 1110
 
1111
-    array('name' => __('Show / hide post type and category on map', 'geodirectory'),
1112
-        'type' => 'sectionstart',
1113
-        'desc' => '',
1114
-        'id' => 'geodir_map_settings'),
1111
+	array('name' => __('Show / hide post type and category on map', 'geodirectory'),
1112
+		'type' => 'sectionstart',
1113
+		'desc' => '',
1114
+		'id' => 'geodir_map_settings'),
1115 1115
 
1116
-    array(
1117
-        'name' => __('Select Map Category', 'geodirectory'),
1118
-        'desc' => '',
1119
-        'id' => 'geodir_map_settings',
1120
-        'type' => 'map',
1121
-        'css' => 'min-width:300px;',
1122
-        'std' => '' // Default value for the page title - changed in settings
1123
-    ),
1124
-
1125
-    array('type' => 'sectionend', 'id' => 'geodir_map_settings'),
1126
-    /* Map Settings End */
1116
+	array(
1117
+		'name' => __('Select Map Category', 'geodirectory'),
1118
+		'desc' => '',
1119
+		'id' => 'geodir_map_settings',
1120
+		'type' => 'map',
1121
+		'css' => 'min-width:300px;',
1122
+		'std' => '' // Default value for the page title - changed in settings
1123
+	),
1124
+
1125
+	array('type' => 'sectionend', 'id' => 'geodir_map_settings'),
1126
+	/* Map Settings End */
1127 1127
 
1128 1128
 )); // End Design settings
Please login to merge, or discard this patch.
geodirectory-admin/option-pages/general_settings_array.php 1 patch
Indentation   +252 added lines, -252 removed lines patch added patch discarded remove patch
@@ -16,30 +16,30 @@  discard block
 block discarded – undo
16 16
  */
17 17
 $general_options = apply_filters('geodir_general_options', array(
18 18
 
19
-    array('name' => __('General', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'general_options'),
20
-
21
-    array('name' => __('General Options', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'general_options'),
22
-
23
-    array(
24
-        'name' => __('Sender name', 'geodirectory'),
25
-        'desc' => __('(Name that will be shown as email sender when users receive emails from this site)', 'geodirectory'),
26
-        'id' => 'site_email_name',
27
-        'type' => 'text',
28
-        'css' => 'min-width:300px;',
29
-        'std' => get_bloginfo('name') // Default value for the page title - changed in settings
30
-    ),
31
-
32
-    array(
33
-        'name' => __('Email address', 'geodirectory'),
34
-        'desc' => __('(Emails to users will be sent via this mail ID)', 'geodirectory'),
35
-        'id' => 'site_email',
36
-        'type' => 'text',
37
-        'css' => 'min-width:300px;',
38
-        'std' => get_bloginfo('admin_email') // Default value for the page title - changed in settings
39
-    ),
40
-
41
-
42
-    /*array(
19
+	array('name' => __('General', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'general_options'),
20
+
21
+	array('name' => __('General Options', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'general_options'),
22
+
23
+	array(
24
+		'name' => __('Sender name', 'geodirectory'),
25
+		'desc' => __('(Name that will be shown as email sender when users receive emails from this site)', 'geodirectory'),
26
+		'id' => 'site_email_name',
27
+		'type' => 'text',
28
+		'css' => 'min-width:300px;',
29
+		'std' => get_bloginfo('name') // Default value for the page title - changed in settings
30
+	),
31
+
32
+	array(
33
+		'name' => __('Email address', 'geodirectory'),
34
+		'desc' => __('(Emails to users will be sent via this mail ID)', 'geodirectory'),
35
+		'id' => 'site_email',
36
+		'type' => 'text',
37
+		'css' => 'min-width:300px;',
38
+		'std' => get_bloginfo('admin_email') // Default value for the page title - changed in settings
39
+	),
40
+
41
+
42
+	/*array(
43 43
         'name' => __( 'Display Category', 'geodirectory' ),
44 44
         'desc' 		=> __( 'Allow users to select category at add listing page', 'geodirectory' ),
45 45
         'tip' 		=> '',
@@ -58,69 +58,69 @@  discard block
 block discarded – undo
58 58
 
59 59
 
60 60
     */
61
-    array(
62
-        'name' => __('Allow user to see wp-admin area', 'geodirectory'),
63
-        'desc' => __('Yes', 'geodirectory'),
64
-        'id' => 'geodir_allow_wpadmin',
65
-        'std' => '1',
66
-        'type' => 'radio',
67
-        'value' => '1',
68
-        'radiogroup' => 'start'
69
-    ),
70
-    array(
71
-        'name' => __('Allow user to see wp-admin area', 'geodirectory'),
72
-        'desc' => __('No', 'geodirectory'),
73
-        'id' => 'geodir_allow_wpadmin',
74
-        'std' => '0',
75
-        'type' => 'radio',
76
-        'value' => '0',
77
-        'radiogroup' => 'end'
78
-    ),
79
-
80
-    array(
81
-        'name' => __('Allow user to choose own password', 'geodirectory'),
82
-        'desc' => __('Yes', 'geodirectory'),
83
-        'id' => 'geodir_allow_cpass',
84
-        'std' => '1',
85
-        'type' => 'radio',
86
-        'value' => '1',
87
-        'radiogroup' => 'start'
88
-    ),
89
-    array(
90
-        'name' => __('Allow user to choose own password', 'geodirectory'),
91
-        'desc' => __('No', 'geodirectory'),
92
-        'id' => 'geodir_allow_cpass',
93
-        'std' => '0',
94
-        'type' => 'radio',
95
-        'value' => '0',
96
-        'radiogroup' => 'end'
97
-    ),
98
-    array(
99
-        'name' => __('Disable rating on comments', 'geodirectory'),
100
-        'desc' => __('Disable rating without disabling comments on listings', 'geodirectory'),
101
-        'id' => 'geodir_disable_rating',
102
-        'type' => 'checkbox',
103
-        'std' => '0'
104
-    ),
105
-    array(
106
-        'name' => __('User deleted posts go to trash', 'geodirectory'),
107
-        'desc' => __('If checked a user deleted post will go to trash, otherwise it will be permanently deleted', 'geodirectory'),
108
-        'id' => 'geodir_disable_perm_delete',
109
-        'type' => 'checkbox',
110
-        'std' => '1'
111
-    ),
112
-    array(
113
-        'name' => __('Maxi upload file size(in mb)', 'geodirectory'),
114
-        'desc' => __('(Maximum upload file size in MB, 1 MB = 1024 KB. Must be greater then 0(ZERO), for ex: 2 )', 'geodirectory'),
115
-        'id' => 'geodir_upload_max_filesize',
116
-        'type' => 'text',
117
-        'css' => 'min-width:300px;',
118
-        'std' => '2'
119
-    ),
120
-
121
-
122
-
123
-    array('type' => 'sectionend', 'id' => 'general_options'),
61
+	array(
62
+		'name' => __('Allow user to see wp-admin area', 'geodirectory'),
63
+		'desc' => __('Yes', 'geodirectory'),
64
+		'id' => 'geodir_allow_wpadmin',
65
+		'std' => '1',
66
+		'type' => 'radio',
67
+		'value' => '1',
68
+		'radiogroup' => 'start'
69
+	),
70
+	array(
71
+		'name' => __('Allow user to see wp-admin area', 'geodirectory'),
72
+		'desc' => __('No', 'geodirectory'),
73
+		'id' => 'geodir_allow_wpadmin',
74
+		'std' => '0',
75
+		'type' => 'radio',
76
+		'value' => '0',
77
+		'radiogroup' => 'end'
78
+	),
79
+
80
+	array(
81
+		'name' => __('Allow user to choose own password', 'geodirectory'),
82
+		'desc' => __('Yes', 'geodirectory'),
83
+		'id' => 'geodir_allow_cpass',
84
+		'std' => '1',
85
+		'type' => 'radio',
86
+		'value' => '1',
87
+		'radiogroup' => 'start'
88
+	),
89
+	array(
90
+		'name' => __('Allow user to choose own password', 'geodirectory'),
91
+		'desc' => __('No', 'geodirectory'),
92
+		'id' => 'geodir_allow_cpass',
93
+		'std' => '0',
94
+		'type' => 'radio',
95
+		'value' => '0',
96
+		'radiogroup' => 'end'
97
+	),
98
+	array(
99
+		'name' => __('Disable rating on comments', 'geodirectory'),
100
+		'desc' => __('Disable rating without disabling comments on listings', 'geodirectory'),
101
+		'id' => 'geodir_disable_rating',
102
+		'type' => 'checkbox',
103
+		'std' => '0'
104
+	),
105
+	array(
106
+		'name' => __('User deleted posts go to trash', 'geodirectory'),
107
+		'desc' => __('If checked a user deleted post will go to trash, otherwise it will be permanently deleted', 'geodirectory'),
108
+		'id' => 'geodir_disable_perm_delete',
109
+		'type' => 'checkbox',
110
+		'std' => '1'
111
+	),
112
+	array(
113
+		'name' => __('Maxi upload file size(in mb)', 'geodirectory'),
114
+		'desc' => __('(Maximum upload file size in MB, 1 MB = 1024 KB. Must be greater then 0(ZERO), for ex: 2 )', 'geodirectory'),
115
+		'id' => 'geodir_upload_max_filesize',
116
+		'type' => 'text',
117
+		'css' => 'min-width:300px;',
118
+		'std' => '2'
119
+	),
120
+
121
+
122
+
123
+	array('type' => 'sectionend', 'id' => 'general_options'),
124 124
 
125 125
 ));/* General Options End*/
126 126
 
@@ -132,82 +132,82 @@  discard block
 block discarded – undo
132 132
  */
133 133
 $google_analytic_settings = apply_filters('geodir_google_analytic_settings', array(
134 134
 
135
-    array('name' => __('Google Analytics', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'google_analytic_settings'),
136
-
137
-    array('name' => __('Google Analytic Settings', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'google_analytic_settings'),
138
-
139
-
140
-
141
-    array(
142
-        'name' => __('Show business owner google analytics stats?', 'geodirectory'),
143
-        'desc' => __('Yes', 'geodirectory'),
144
-        'id' => 'geodir_ga_stats',
145
-        'std' => '0',
146
-        'type' => 'radio',
147
-        'value' => '1',
148
-        'radiogroup' => 'start'
149
-    ),
150
-    array(
151
-        'name' => __('Show business owner Google Analytics stats?', 'geodirectory'),
152
-        'desc' => __('No', 'geodirectory'),
153
-        'id' => 'geodir_ga_stats',
154
-        'std' => '1',
155
-        'type' => 'radio',
156
-        'value' => '0',
157
-        'radiogroup' => 'end'
158
-    ),
159
-
160
-    array(
161
-        'name' => __('Google analytics "Profile ID(ie: ga:12345678)?', 'geodirectory') . ' ' .
162
-            '<a target="_blank" href="https://docs.wpgeodirectory.com/gd-core-plugin-google-analytics/">' . __('help', 'geodirectory') . '</a>',
163
-        'desc' => '',
164
-        'id' => 'geodir_ga_id',
165
-        'type' => 'text',
166
-        'css' => 'min-width:300px;',
167
-        'std' => '' // Default value for the page title - changed in settings
168
-    ),
169
-
170
-    array(
171
-        'name' => __('Client ID', 'geodirectory') . ' ' .
172
-            '<a target="_blank" href="https://docs.wpgeodirectory.com/gd-core-plugin-google-analytics/">' . __('help', 'geodirectory') . '</a>',
173
-        'desc' => '',
174
-        'id' => 'geodir_ga_client_id',
175
-        'type' => 'text',
176
-        'css' => 'min-width:300px;',
177
-        'std' => '' // Default value for the page title - changed in settings
178
-    ),
179
-
180
-    array(
181
-        'name' => __('Client secret', 'geodirectory') . ' ' .
182
-            '<a target="_blank" href="https://docs.wpgeodirectory.com/gd-core-plugin-google-analytics/">' . __('help', 'geodirectory') . '</a>',
183
-        'desc' => '',
184
-        'id' => 'geodir_ga_client_secret',
185
-        'type' => 'password',
186
-        'css' => 'min-width:300px;',
187
-        'std' => '' // Default value for the page title - changed in settings
188
-    ),
189
-
190
-    array(
191
-        'name' => __('Google analytics access', 'geodirectory'),
192
-        'desc' => '',
193
-        'id' => 'geodir_ga_token',
194
-        'type' => 'google_analytics',
195
-        'css' => 'min-width:300px;',
196
-        'std' => '' // Default value for the page title - changed in settings
197
-    ),
198
-
199
-
200
-    array(
201
-        'name' => __('Google analytics tracking code', 'geodirectory'),
202
-        'desc' => '',
203
-        'id' => 'geodir_ga_tracking_code',
204
-        'type' => 'textarea',
205
-        'css' => 'min-width:300px;',
206
-        'std' => '' // Default value for the page title - changed in settings
207
-    ),
208
-
209
-
210
-    array('type' => 'sectionend', 'id' => 'google_analytic_settings'),
135
+	array('name' => __('Google Analytics', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'google_analytic_settings'),
136
+
137
+	array('name' => __('Google Analytic Settings', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'google_analytic_settings'),
138
+
139
+
140
+
141
+	array(
142
+		'name' => __('Show business owner google analytics stats?', 'geodirectory'),
143
+		'desc' => __('Yes', 'geodirectory'),
144
+		'id' => 'geodir_ga_stats',
145
+		'std' => '0',
146
+		'type' => 'radio',
147
+		'value' => '1',
148
+		'radiogroup' => 'start'
149
+	),
150
+	array(
151
+		'name' => __('Show business owner Google Analytics stats?', 'geodirectory'),
152
+		'desc' => __('No', 'geodirectory'),
153
+		'id' => 'geodir_ga_stats',
154
+		'std' => '1',
155
+		'type' => 'radio',
156
+		'value' => '0',
157
+		'radiogroup' => 'end'
158
+	),
159
+
160
+	array(
161
+		'name' => __('Google analytics "Profile ID(ie: ga:12345678)?', 'geodirectory') . ' ' .
162
+			'<a target="_blank" href="https://docs.wpgeodirectory.com/gd-core-plugin-google-analytics/">' . __('help', 'geodirectory') . '</a>',
163
+		'desc' => '',
164
+		'id' => 'geodir_ga_id',
165
+		'type' => 'text',
166
+		'css' => 'min-width:300px;',
167
+		'std' => '' // Default value for the page title - changed in settings
168
+	),
169
+
170
+	array(
171
+		'name' => __('Client ID', 'geodirectory') . ' ' .
172
+			'<a target="_blank" href="https://docs.wpgeodirectory.com/gd-core-plugin-google-analytics/">' . __('help', 'geodirectory') . '</a>',
173
+		'desc' => '',
174
+		'id' => 'geodir_ga_client_id',
175
+		'type' => 'text',
176
+		'css' => 'min-width:300px;',
177
+		'std' => '' // Default value for the page title - changed in settings
178
+	),
179
+
180
+	array(
181
+		'name' => __('Client secret', 'geodirectory') . ' ' .
182
+			'<a target="_blank" href="https://docs.wpgeodirectory.com/gd-core-plugin-google-analytics/">' . __('help', 'geodirectory') . '</a>',
183
+		'desc' => '',
184
+		'id' => 'geodir_ga_client_secret',
185
+		'type' => 'password',
186
+		'css' => 'min-width:300px;',
187
+		'std' => '' // Default value for the page title - changed in settings
188
+	),
189
+
190
+	array(
191
+		'name' => __('Google analytics access', 'geodirectory'),
192
+		'desc' => '',
193
+		'id' => 'geodir_ga_token',
194
+		'type' => 'google_analytics',
195
+		'css' => 'min-width:300px;',
196
+		'std' => '' // Default value for the page title - changed in settings
197
+	),
198
+
199
+
200
+	array(
201
+		'name' => __('Google analytics tracking code', 'geodirectory'),
202
+		'desc' => '',
203
+		'id' => 'geodir_ga_tracking_code',
204
+		'type' => 'textarea',
205
+		'css' => 'min-width:300px;',
206
+		'std' => '' // Default value for the page title - changed in settings
207
+	),
208
+
209
+
210
+	array('type' => 'sectionend', 'id' => 'google_analytic_settings'),
211 211
 
212 212
 )); // google_analytic_settings End
213 213
 
@@ -219,84 +219,84 @@  discard block
 block discarded – undo
219 219
  */
220 220
 $search_settings = apply_filters('geodir_search_settings', array(
221 221
 
222
-    array('name' => __('Search', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'search_settings'),
223
-
224
-    array('name' => __('Search Settings', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'search_settings'),
225
-
226
-    array(
227
-        'name' => __('Limit squared distance area to X miles (helps improve search speed)', 'geodirectory'),
228
-        'desc' => __('Enter whole number only ex. 40 (Tokyo is largest city in the world @40 sq miles) LEAVE BLANK FOR NO DISTANCE LIMIT', 'geodirectory'),
229
-        'id' => 'geodir_search_dist',
230
-        'type' => 'text',
231
-        'css' => 'min-width:300px;',
232
-        'std' => '40' // Default value for the page title - changed in settings
233
-    ),
234
-
235
-    array(
236
-        'name' => __('Show search distances in miles or km', 'geodirectory'),
237
-        'desc' => __('Miles', 'geodirectory'),
238
-        'id' => 'geodir_search_dist_1',
239
-        'std' => 'miles',
240
-        'type' => 'radio',
241
-        'value' => 'miles',
242
-        'radiogroup' => 'start'
243
-    ),
244
-    array(
245
-        'name' => __('Show search distances in miles or km', 'geodirectory'),
246
-        'desc' => __('Kilometers', 'geodirectory'),
247
-        'id' => 'geodir_search_dist_1',
248
-        'std' => 'miles',
249
-        'type' => 'radio',
250
-        'value' => 'km',
251
-        'radiogroup' => 'end'
252
-    ),
253
-
254
-    array(
255
-        'name' => __('If distance is less than 0.01 show distance in meters or feet', 'geodirectory'),
256
-        'desc' => __('Meters', 'geodirectory'),
257
-        'id' => 'geodir_search_dist_2',
258
-        'std' => 'meters',
259
-        'type' => 'radio',
260
-        'value' => 'meters',
261
-        'radiogroup' => 'start'
262
-    ),
263
-
264
-    array(
265
-        'name' => __('If distance is less than 0.01 show distance in meters or feet', 'geodirectory'),
266
-        'desc' => __('Feet', 'geodirectory'),
267
-        'id' => 'geodir_search_dist_2',
268
-        'std' => 'meters',
269
-        'type' => 'radio',
270
-        'value' => 'feet',
271
-        'radiogroup' => 'end'
272
-    ),
273
-
274
-    array(
275
-        'name' => __('Add location specific text to (Near) search for Google', 'geodirectory'),
276
-        'desc' => __('This is usefull if your directory is limted to one location such as: New York or Australia (this setting should be blank if using default country, regions etc with multilocation addon as it will automatically add them)', 'geodirectory'),
277
-        'id' => 'geodir_search_near_addition',
278
-        'type' => 'text',
279
-        'css' => 'min-width:300px;',
280
-        'std' => ''
281
-    ),
282
-    array(
283
-        'name' => __('Individual word search limit', 'geodirectory'),
284
-        'desc' => __('With this option you can limit individual words being searched for, for example searching for `Jo Brown` would return results with words like `Jones`, you can exclude these types of small character words if you wish.', 'geodirectory'),
285
-        'id' => 'geodir_search_word_limit',
286
-        'css' => 'min-width:300px;',
287
-        'std' => 'gridview_onehalf',
288
-        'type' => 'select',
289
-        'class' => 'chosen_select',
290
-        'options' => array_unique(array(
291
-            '0' => __('Disabled', 'geodirectory'),
292
-            '1' => __('1 Character words excluded', 'geodirectory'),
293
-            '2' => __('2 Character words and less excluded', 'geodirectory'),
294
-            '3' => __('3 Character words and less excluded', 'geodirectory'),
295
-        ))
296
-    ),
297
-
298
-
299
-    array('type' => 'sectionend', 'id' => 'search_settings'),
222
+	array('name' => __('Search', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'search_settings'),
223
+
224
+	array('name' => __('Search Settings', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'search_settings'),
225
+
226
+	array(
227
+		'name' => __('Limit squared distance area to X miles (helps improve search speed)', 'geodirectory'),
228
+		'desc' => __('Enter whole number only ex. 40 (Tokyo is largest city in the world @40 sq miles) LEAVE BLANK FOR NO DISTANCE LIMIT', 'geodirectory'),
229
+		'id' => 'geodir_search_dist',
230
+		'type' => 'text',
231
+		'css' => 'min-width:300px;',
232
+		'std' => '40' // Default value for the page title - changed in settings
233
+	),
234
+
235
+	array(
236
+		'name' => __('Show search distances in miles or km', 'geodirectory'),
237
+		'desc' => __('Miles', 'geodirectory'),
238
+		'id' => 'geodir_search_dist_1',
239
+		'std' => 'miles',
240
+		'type' => 'radio',
241
+		'value' => 'miles',
242
+		'radiogroup' => 'start'
243
+	),
244
+	array(
245
+		'name' => __('Show search distances in miles or km', 'geodirectory'),
246
+		'desc' => __('Kilometers', 'geodirectory'),
247
+		'id' => 'geodir_search_dist_1',
248
+		'std' => 'miles',
249
+		'type' => 'radio',
250
+		'value' => 'km',
251
+		'radiogroup' => 'end'
252
+	),
253
+
254
+	array(
255
+		'name' => __('If distance is less than 0.01 show distance in meters or feet', 'geodirectory'),
256
+		'desc' => __('Meters', 'geodirectory'),
257
+		'id' => 'geodir_search_dist_2',
258
+		'std' => 'meters',
259
+		'type' => 'radio',
260
+		'value' => 'meters',
261
+		'radiogroup' => 'start'
262
+	),
263
+
264
+	array(
265
+		'name' => __('If distance is less than 0.01 show distance in meters or feet', 'geodirectory'),
266
+		'desc' => __('Feet', 'geodirectory'),
267
+		'id' => 'geodir_search_dist_2',
268
+		'std' => 'meters',
269
+		'type' => 'radio',
270
+		'value' => 'feet',
271
+		'radiogroup' => 'end'
272
+	),
273
+
274
+	array(
275
+		'name' => __('Add location specific text to (Near) search for Google', 'geodirectory'),
276
+		'desc' => __('This is usefull if your directory is limted to one location such as: New York or Australia (this setting should be blank if using default country, regions etc with multilocation addon as it will automatically add them)', 'geodirectory'),
277
+		'id' => 'geodir_search_near_addition',
278
+		'type' => 'text',
279
+		'css' => 'min-width:300px;',
280
+		'std' => ''
281
+	),
282
+	array(
283
+		'name' => __('Individual word search limit', 'geodirectory'),
284
+		'desc' => __('With this option you can limit individual words being searched for, for example searching for `Jo Brown` would return results with words like `Jones`, you can exclude these types of small character words if you wish.', 'geodirectory'),
285
+		'id' => 'geodir_search_word_limit',
286
+		'css' => 'min-width:300px;',
287
+		'std' => 'gridview_onehalf',
288
+		'type' => 'select',
289
+		'class' => 'chosen_select',
290
+		'options' => array_unique(array(
291
+			'0' => __('Disabled', 'geodirectory'),
292
+			'1' => __('1 Character words excluded', 'geodirectory'),
293
+			'2' => __('2 Character words and less excluded', 'geodirectory'),
294
+			'3' => __('3 Character words and less excluded', 'geodirectory'),
295
+		))
296
+	),
297
+
298
+
299
+	array('type' => 'sectionend', 'id' => 'search_settings'),
300 300
 
301 301
 )); //search_settings End
302 302
 
@@ -308,17 +308,17 @@  discard block
 block discarded – undo
308 308
  */
309 309
 $dummy_data_settings = apply_filters('geodir_dummy_data_settings', array(
310 310
 
311
-    array('name' => __('Dummy Data', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'dummy_data_settings'),
312
-
313
-    array(
314
-        'name' => '',
315
-        'desc' => '',
316
-        'id' => 'geodir_dummy_data_installer',
317
-        'type' => 'dummy_installer',
318
-        'css' => 'min-width:300px;',
319
-        'std' => '40' // Default value for the page title - changed in settings
320
-    ),
321
-    array('type' => 'sectionend', 'id' => 'geodir_dummy_data_settings'),
311
+	array('name' => __('Dummy Data', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'dummy_data_settings'),
312
+
313
+	array(
314
+		'name' => '',
315
+		'desc' => '',
316
+		'id' => 'geodir_dummy_data_installer',
317
+		'type' => 'dummy_installer',
318
+		'css' => 'min-width:300px;',
319
+		'std' => '40' // Default value for the page title - changed in settings
320
+	),
321
+	array('type' => 'sectionend', 'id' => 'geodir_dummy_data_settings'),
322 322
 
323 323
 )); //dummy_data_settings End
324 324
 
Please login to merge, or discard this patch.
geodirectory-admin/option-pages/notifications_settings_array.php 1 patch
Indentation   +257 added lines, -257 removed lines patch added patch discarded remove patch
@@ -17,262 +17,262 @@
 block discarded – undo
17 17
 $geodir_settings['notifications_settings'] = apply_filters('geodir_notifications_settings', array(
18 18
 
19 19
 
20
-    array('name' => __('Options', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'notification_options'),
21
-
22
-
23
-    array('name' => __('Notification Options', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'notification_options'),
24
-
25
-    array(
26
-        'name' => __('List of usable shortcodes', 'geodirectory'),
27
-        'desc' => __('[#client_name#],[#listing_link#],[#posted_date#],[#number_of_days#],[#number_of_grace_days#],[#login_url#],[#username#],[#user_email#],[#site_name_url#],[#renew_link#],[#post_id#],[#site_name#],[#from_email#](in most cases this will be the admin email, except for popup forms)', 'geodirectory'),
28
-        'id' => 'geodir_list_of_usable_shordcodes',
29
-        'type' => 'html_content',
30
-        'css' => 'min-width:300px;',
31
-        'std' => 'All Places' // Default value for the page title - changed in settings
32
-    ),
33
-
34
-    array(
35
-        'name' => __('Use advanced editor? (slow loading)', 'geodirectory'),
36
-        'desc' => __('Yes', 'geodirectory'),
37
-        'id' => 'geodir_tiny_editor',
38
-        'std' => 'yes',
39
-        'type' => 'radio',
40
-        'value' => '1',
41
-        'radiogroup' => 'start'
42
-    ),
43
-    array(
44
-        'name' => __('Use advanced editor?(slow loading)', 'geodirectory'),
45
-        'desc' => __('No', 'geodirectory'),
46
-        'id' => 'geodir_tiny_editor',
47
-        'std' => 'yes',
48
-        'type' => 'radio',
49
-        'value' => '0',
50
-        'radiogroup' => 'end'
51
-    ),
52
-
53
-
54
-    array('type' => 'sectionend', 'id' => 'notification_options'),
55
-
56
-
57
-    array('name' => __('Site Bcc Options', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'site_bcc_options'),
58
-
59
-    array('name' => __('Site Bcc Options', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'site_bcc_options'),
60
-
61
-    array(
62
-        'name' => __('New user registration', 'geodirectory'),
63
-        'desc' => __('Yes', 'geodirectory'),
64
-        'id' => 'geodir_bcc_new_user',
65
-        'std' => 'yes',
66
-        'type' => 'radio',
67
-        'value' => '1',
68
-        'radiogroup' => 'start'
69
-    ),
70
-    array(
71
-        'name' => __('New user registration', 'geodirectory'),
72
-        'desc' => __('No', 'geodirectory'),
73
-        'id' => 'geodir_bcc_new_user',
74
-        'std' => 'yes',
75
-        'type' => 'radio',
76
-        'value' => '0',
77
-        'radiogroup' => 'end'
78
-    ),
79
-
80
-    array(
81
-        'name' => __('Send to friend', 'geodirectory'),
82
-        'desc' => __('Yes', 'geodirectory'),
83
-        'id' => 'geodir_bcc_friend',
84
-        'std' => 'yes',
85
-        'type' => 'radio',
86
-        'value' => '1',
87
-        'radiogroup' => 'start'
88
-    ),
89
-    array(
90
-        'name' => __('Send to friend', 'geodirectory'),
91
-        'desc' => __('No', 'geodirectory'),
92
-        'id' => 'geodir_bcc_friend',
93
-        'std' => 'yes',
94
-        'type' => 'radio',
95
-        'value' => '0',
96
-        'radiogroup' => 'end'
97
-    ),
98
-
99
-    array(
100
-        'name' => __('Send enquiry', 'geodirectory'),
101
-        'desc' => __('Yes', 'geodirectory'),
102
-        'id' => 'geodir_bcc_enquiry',
103
-        'std' => 'yes',
104
-        'type' => 'radio',
105
-        'value' => '1',
106
-        'radiogroup' => 'start'
107
-    ),
108
-    array(
109
-        'name' => __('Send enquiry', 'geodirectory'),
110
-        'desc' => __('No', 'geodirectory'),
111
-        'id' => 'geodir_bcc_enquiry',
112
-        'std' => 'yes',
113
-        'type' => 'radio',
114
-        'value' => '0',
115
-        'radiogroup' => 'end'
116
-    ),
117
-
118
-
119
-    array('type' => 'sectionend', 'id' => 'site_bcc_options'),
120
-
121
-
122
-    array('name' => __('Admin Emails', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'admin_emails'),
123
-
124
-    array('name' => __('Admin Emails', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'admin_emails'),
125
-
126
-    array(
127
-        'name' => __('Post submit success to admin email', 'geodirectory'),
128
-        'desc' => '',
129
-        'id' => 'geodir_post_submited_success_email_subject_admin',
130
-        'type' => 'text',
131
-        'css' => 'min-width:300px;',
132
-        'std' => __('Post Submitted Successfully','geodirectory') // Default value for the page title - changed in settings
133
-    ),
134
-    array(
135
-        'name' => '',
136
-        'desc' => '',
137
-        'id' => 'geodir_post_submited_success_email_content_admin',
138
-        'css' => 'width:500px; height: 150px;',
139
-        'type' => 'textarea',
140
-        'std' => __('<p>Dear Admin,</p><p>A new  listing has been published [#listing_link#]. This email is just for your information.</p><br><p>[#site_name#]</p>','geodirectory')
141
-    ),
142
-
143
-
144
-    array('type' => 'sectionend', 'id' => 'admin_emails'),
145
-
146
-
147
-    array('name' => __('Client Emails', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'client_emails'),
148
-
149
-    array('name' => __('Client Emails', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'client_emails'),
150
-
151
-    array(
152
-        'name' => __('Post submit success to client email', 'geodirectory'),
153
-        'desc' => '',
154
-        'id' => 'geodir_post_submited_success_email_subject',
155
-        'type' => 'text',
156
-        'css' => 'min-width:300px;',
157
-        'std' => __('Post Submitted Successfully','geodirectory') // Default value for the page title - changed in settings
158
-    ),
159
-    array(
160
-        'name' => '',
161
-        'desc' => '',
162
-        'id' => 'geodir_post_submited_success_email_content',
163
-        'css' => 'width:500px; height: 150px;',
164
-        'type' => 'textarea',
165
-        'std' => __('<p>Dear [#client_name#],</p><p>You submitted the below listing information. This email is just for your information.</p><p>[#listing_link#]</p><br><p>Thank you for your contribution.</p><p>[#site_name#]</p>','geodirectory')
166
-    ),
167
-
168
-
169
-    array(
170
-        'name' => __('User forgot password email', 'geodirectory'),
171
-        'desc' => '',
172
-        'id' => 'geodir_forgot_password_subject',
173
-        'type' => 'text',
174
-        'css' => 'min-width:300px;',
175
-        'std' => __('[#site_name#] - Your new password', 'geodirectory') // Default value for the page title - changed in settings
176
-    ),
177
-    array(
178
-        'name' => '',
179
-        'desc' => '',
180
-        'id' => 'geodir_forgot_password_content',
181
-        'css' => 'width:500px; height: 150px;',
182
-        'type' => 'textarea',
183
-        'std' => __("<p>Dear [#client_name#],<p><p>You requested a new password for [#site_name_url#]</p><p>[#login_details#]</p><p>You can login here: [#login_url#]</p><p>Thank you,<br /><br />[#site_name_url#].</p>",'geodirectory')
184
-    ),
185
-
186
-    array(
187
-        'name' => __('Registration success email', 'geodirectory'),
188
-        'desc' => '',
189
-        'id' => 'geodir_registration_success_email_subject',
190
-        'type' => 'text',
191
-        'css' => 'min-width:300px;',
192
-        'std' => __('Your Log In Details', 'geodirectory') // Default value for the page title - changed in settings
193
-    ),
194
-    array(
195
-        'name' => '',
196
-        'desc' => '',
197
-        'id' => 'geodir_registration_success_email_content',
198
-        'css' => 'width:500px; height: 150px;',
199
-        'type' => 'textarea',
200
-        'std' => __("<p>Dear [#client_name#],</p><p>You can log in  with the following information:</p><p>[#login_details#]</p><p>You can login here: [#login_url#]</p><p>Thank you,<br /><br />[#site_name_url#].</p>",'geodirectory')
201
-    ),
202
-    array(
203
-        'name' => __('Listing published email', 'geodirectory'),
204
-        'desc' => '',
205
-        'id' => 'geodir_post_published_email_subject',
206
-        'type' => 'text',
207
-        'css' => 'min-width:300px;',
208
-        'std' => __('Listing Published Successfully', 'geodirectory') // Default value for the page title - changed in settings
209
-    ),
210
-    array(
211
-        'name' => '',
212
-        'desc' => '',
213
-        'id' => 'geodir_post_published_email_content',
214
-        'css' => 'width:500px; height: 150px;',
215
-        'type' => 'textarea',
216
-        'std' => __("<p>Dear [#client_name#],</p><p>Your listing [#listing_link#] has been published. This email is just for your information.</p><p>[#listing_link#]</p><br><p>Thank you for your contribution.</p><p>[#site_name#]</p>", 'geodirectory')
217
-    ),
218
-
219
-    array('type' => 'sectionend', 'id' => 'client_emails'),
220
-
221
-    array('name' => __('Other Emails', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'other_emails'),
222
-
223
-    array('name' => __('Other Emails', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'other_emails'),
224
-
225
-    array(
226
-        'name' => __('Send to friend', 'geodirectory'),
227
-        'desc' => '',
228
-        'id' => 'geodir_email_friend_subject',
229
-        'type' => 'text',
230
-        'css' => 'min-width:300px;',
231
-        'std' => __('[#from_name#] thought you might be interested in..', 'geodirectory')
232
-    ),
233
-    array(
234
-        'name' => '',
235
-        'desc' => '',
236
-        'id' => 'geodir_email_friend_content',
237
-        'css' => 'width:500px; height: 150px;',
238
-        'type' => 'textarea',
239
-        'std' => __("<p>Dear [#to_name#],<p><p>Your friend has sent you a message from <b>[#site_name#]</b> </p><p>===============================</p><p><b>Subject : [#subject#]</b></p><p>[#comments#] [#listing_link#]</p><p>===============================</p><p>Thank you,<br /><br />[#site_name#].</p>",'geodirectory')
240
-    ),
241
-
242
-    array(
243
-        'name' => __('Email enquiry', 'geodirectory'),
244
-        'desc' => '',
245
-        'id' => 'geodir_email_enquiry_subject',
246
-        'type' => 'text',
247
-        'css' => 'min-width:300px;',
248
-        'std' => __('Website Enquiry', 'geodirectory')
249
-    ),
250
-    array(
251
-        'name' => '',
252
-        'desc' => '',
253
-        'id' => 'geodir_email_enquiry_content',
254
-        'css' => 'width:500px; height: 150px;',
255
-        'type' => 'textarea',
256
-        'std' => __("<p>Dear [#to_name#],<p><p>An enquiry has been sent from <b>[#listing_link#]</b></p><p>===============================</p><p>[#comments#]</p><p>===============================</p><p>Thank you,<br /><br />[#site_name_url#].</p>",'geodirectory')
257
-    ),
258
-
259
-    array('type' => 'sectionend', 'id' => 'other_emails'),
260
-
261
-
262
-    array('name' => __('Messages', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'messages'),
263
-
264
-    array('name' => __('Messages', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'messages'),
265
-
266
-    array(
267
-        'name' => __('Post submitted success', 'geodirectory'),
268
-        'desc' => '',
269
-        'id' => 'geodir_post_added_success_msg_content',
270
-        'css' => 'width:500px; height: 150px;',
271
-        'type' => 'textarea',
272
-        'std' => __('<p>Thank you, your information has been successfully received.</p><p><a href="[#submited_information_link#]" >View your submitted information &raquo;</a></p><p>Thank you for visiting us at [#site_name#].</p>','geodirectory')
273
-    ),
274
-
275
-
276
-    array('type' => 'sectionend', 'id' => 'messages'),
20
+	array('name' => __('Options', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'notification_options'),
21
+
22
+
23
+	array('name' => __('Notification Options', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'notification_options'),
24
+
25
+	array(
26
+		'name' => __('List of usable shortcodes', 'geodirectory'),
27
+		'desc' => __('[#client_name#],[#listing_link#],[#posted_date#],[#number_of_days#],[#number_of_grace_days#],[#login_url#],[#username#],[#user_email#],[#site_name_url#],[#renew_link#],[#post_id#],[#site_name#],[#from_email#](in most cases this will be the admin email, except for popup forms)', 'geodirectory'),
28
+		'id' => 'geodir_list_of_usable_shordcodes',
29
+		'type' => 'html_content',
30
+		'css' => 'min-width:300px;',
31
+		'std' => 'All Places' // Default value for the page title - changed in settings
32
+	),
33
+
34
+	array(
35
+		'name' => __('Use advanced editor? (slow loading)', 'geodirectory'),
36
+		'desc' => __('Yes', 'geodirectory'),
37
+		'id' => 'geodir_tiny_editor',
38
+		'std' => 'yes',
39
+		'type' => 'radio',
40
+		'value' => '1',
41
+		'radiogroup' => 'start'
42
+	),
43
+	array(
44
+		'name' => __('Use advanced editor?(slow loading)', 'geodirectory'),
45
+		'desc' => __('No', 'geodirectory'),
46
+		'id' => 'geodir_tiny_editor',
47
+		'std' => 'yes',
48
+		'type' => 'radio',
49
+		'value' => '0',
50
+		'radiogroup' => 'end'
51
+	),
52
+
53
+
54
+	array('type' => 'sectionend', 'id' => 'notification_options'),
55
+
56
+
57
+	array('name' => __('Site Bcc Options', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'site_bcc_options'),
58
+
59
+	array('name' => __('Site Bcc Options', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'site_bcc_options'),
60
+
61
+	array(
62
+		'name' => __('New user registration', 'geodirectory'),
63
+		'desc' => __('Yes', 'geodirectory'),
64
+		'id' => 'geodir_bcc_new_user',
65
+		'std' => 'yes',
66
+		'type' => 'radio',
67
+		'value' => '1',
68
+		'radiogroup' => 'start'
69
+	),
70
+	array(
71
+		'name' => __('New user registration', 'geodirectory'),
72
+		'desc' => __('No', 'geodirectory'),
73
+		'id' => 'geodir_bcc_new_user',
74
+		'std' => 'yes',
75
+		'type' => 'radio',
76
+		'value' => '0',
77
+		'radiogroup' => 'end'
78
+	),
79
+
80
+	array(
81
+		'name' => __('Send to friend', 'geodirectory'),
82
+		'desc' => __('Yes', 'geodirectory'),
83
+		'id' => 'geodir_bcc_friend',
84
+		'std' => 'yes',
85
+		'type' => 'radio',
86
+		'value' => '1',
87
+		'radiogroup' => 'start'
88
+	),
89
+	array(
90
+		'name' => __('Send to friend', 'geodirectory'),
91
+		'desc' => __('No', 'geodirectory'),
92
+		'id' => 'geodir_bcc_friend',
93
+		'std' => 'yes',
94
+		'type' => 'radio',
95
+		'value' => '0',
96
+		'radiogroup' => 'end'
97
+	),
98
+
99
+	array(
100
+		'name' => __('Send enquiry', 'geodirectory'),
101
+		'desc' => __('Yes', 'geodirectory'),
102
+		'id' => 'geodir_bcc_enquiry',
103
+		'std' => 'yes',
104
+		'type' => 'radio',
105
+		'value' => '1',
106
+		'radiogroup' => 'start'
107
+	),
108
+	array(
109
+		'name' => __('Send enquiry', 'geodirectory'),
110
+		'desc' => __('No', 'geodirectory'),
111
+		'id' => 'geodir_bcc_enquiry',
112
+		'std' => 'yes',
113
+		'type' => 'radio',
114
+		'value' => '0',
115
+		'radiogroup' => 'end'
116
+	),
117
+
118
+
119
+	array('type' => 'sectionend', 'id' => 'site_bcc_options'),
120
+
121
+
122
+	array('name' => __('Admin Emails', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'admin_emails'),
123
+
124
+	array('name' => __('Admin Emails', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'admin_emails'),
125
+
126
+	array(
127
+		'name' => __('Post submit success to admin email', 'geodirectory'),
128
+		'desc' => '',
129
+		'id' => 'geodir_post_submited_success_email_subject_admin',
130
+		'type' => 'text',
131
+		'css' => 'min-width:300px;',
132
+		'std' => __('Post Submitted Successfully','geodirectory') // Default value for the page title - changed in settings
133
+	),
134
+	array(
135
+		'name' => '',
136
+		'desc' => '',
137
+		'id' => 'geodir_post_submited_success_email_content_admin',
138
+		'css' => 'width:500px; height: 150px;',
139
+		'type' => 'textarea',
140
+		'std' => __('<p>Dear Admin,</p><p>A new  listing has been published [#listing_link#]. This email is just for your information.</p><br><p>[#site_name#]</p>','geodirectory')
141
+	),
142
+
143
+
144
+	array('type' => 'sectionend', 'id' => 'admin_emails'),
145
+
146
+
147
+	array('name' => __('Client Emails', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'client_emails'),
148
+
149
+	array('name' => __('Client Emails', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'client_emails'),
150
+
151
+	array(
152
+		'name' => __('Post submit success to client email', 'geodirectory'),
153
+		'desc' => '',
154
+		'id' => 'geodir_post_submited_success_email_subject',
155
+		'type' => 'text',
156
+		'css' => 'min-width:300px;',
157
+		'std' => __('Post Submitted Successfully','geodirectory') // Default value for the page title - changed in settings
158
+	),
159
+	array(
160
+		'name' => '',
161
+		'desc' => '',
162
+		'id' => 'geodir_post_submited_success_email_content',
163
+		'css' => 'width:500px; height: 150px;',
164
+		'type' => 'textarea',
165
+		'std' => __('<p>Dear [#client_name#],</p><p>You submitted the below listing information. This email is just for your information.</p><p>[#listing_link#]</p><br><p>Thank you for your contribution.</p><p>[#site_name#]</p>','geodirectory')
166
+	),
167
+
168
+
169
+	array(
170
+		'name' => __('User forgot password email', 'geodirectory'),
171
+		'desc' => '',
172
+		'id' => 'geodir_forgot_password_subject',
173
+		'type' => 'text',
174
+		'css' => 'min-width:300px;',
175
+		'std' => __('[#site_name#] - Your new password', 'geodirectory') // Default value for the page title - changed in settings
176
+	),
177
+	array(
178
+		'name' => '',
179
+		'desc' => '',
180
+		'id' => 'geodir_forgot_password_content',
181
+		'css' => 'width:500px; height: 150px;',
182
+		'type' => 'textarea',
183
+		'std' => __("<p>Dear [#client_name#],<p><p>You requested a new password for [#site_name_url#]</p><p>[#login_details#]</p><p>You can login here: [#login_url#]</p><p>Thank you,<br /><br />[#site_name_url#].</p>",'geodirectory')
184
+	),
185
+
186
+	array(
187
+		'name' => __('Registration success email', 'geodirectory'),
188
+		'desc' => '',
189
+		'id' => 'geodir_registration_success_email_subject',
190
+		'type' => 'text',
191
+		'css' => 'min-width:300px;',
192
+		'std' => __('Your Log In Details', 'geodirectory') // Default value for the page title - changed in settings
193
+	),
194
+	array(
195
+		'name' => '',
196
+		'desc' => '',
197
+		'id' => 'geodir_registration_success_email_content',
198
+		'css' => 'width:500px; height: 150px;',
199
+		'type' => 'textarea',
200
+		'std' => __("<p>Dear [#client_name#],</p><p>You can log in  with the following information:</p><p>[#login_details#]</p><p>You can login here: [#login_url#]</p><p>Thank you,<br /><br />[#site_name_url#].</p>",'geodirectory')
201
+	),
202
+	array(
203
+		'name' => __('Listing published email', 'geodirectory'),
204
+		'desc' => '',
205
+		'id' => 'geodir_post_published_email_subject',
206
+		'type' => 'text',
207
+		'css' => 'min-width:300px;',
208
+		'std' => __('Listing Published Successfully', 'geodirectory') // Default value for the page title - changed in settings
209
+	),
210
+	array(
211
+		'name' => '',
212
+		'desc' => '',
213
+		'id' => 'geodir_post_published_email_content',
214
+		'css' => 'width:500px; height: 150px;',
215
+		'type' => 'textarea',
216
+		'std' => __("<p>Dear [#client_name#],</p><p>Your listing [#listing_link#] has been published. This email is just for your information.</p><p>[#listing_link#]</p><br><p>Thank you for your contribution.</p><p>[#site_name#]</p>", 'geodirectory')
217
+	),
218
+
219
+	array('type' => 'sectionend', 'id' => 'client_emails'),
220
+
221
+	array('name' => __('Other Emails', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'other_emails'),
222
+
223
+	array('name' => __('Other Emails', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'other_emails'),
224
+
225
+	array(
226
+		'name' => __('Send to friend', 'geodirectory'),
227
+		'desc' => '',
228
+		'id' => 'geodir_email_friend_subject',
229
+		'type' => 'text',
230
+		'css' => 'min-width:300px;',
231
+		'std' => __('[#from_name#] thought you might be interested in..', 'geodirectory')
232
+	),
233
+	array(
234
+		'name' => '',
235
+		'desc' => '',
236
+		'id' => 'geodir_email_friend_content',
237
+		'css' => 'width:500px; height: 150px;',
238
+		'type' => 'textarea',
239
+		'std' => __("<p>Dear [#to_name#],<p><p>Your friend has sent you a message from <b>[#site_name#]</b> </p><p>===============================</p><p><b>Subject : [#subject#]</b></p><p>[#comments#] [#listing_link#]</p><p>===============================</p><p>Thank you,<br /><br />[#site_name#].</p>",'geodirectory')
240
+	),
241
+
242
+	array(
243
+		'name' => __('Email enquiry', 'geodirectory'),
244
+		'desc' => '',
245
+		'id' => 'geodir_email_enquiry_subject',
246
+		'type' => 'text',
247
+		'css' => 'min-width:300px;',
248
+		'std' => __('Website Enquiry', 'geodirectory')
249
+	),
250
+	array(
251
+		'name' => '',
252
+		'desc' => '',
253
+		'id' => 'geodir_email_enquiry_content',
254
+		'css' => 'width:500px; height: 150px;',
255
+		'type' => 'textarea',
256
+		'std' => __("<p>Dear [#to_name#],<p><p>An enquiry has been sent from <b>[#listing_link#]</b></p><p>===============================</p><p>[#comments#]</p><p>===============================</p><p>Thank you,<br /><br />[#site_name_url#].</p>",'geodirectory')
257
+	),
258
+
259
+	array('type' => 'sectionend', 'id' => 'other_emails'),
260
+
261
+
262
+	array('name' => __('Messages', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'messages'),
263
+
264
+	array('name' => __('Messages', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'messages'),
265
+
266
+	array(
267
+		'name' => __('Post submitted success', 'geodirectory'),
268
+		'desc' => '',
269
+		'id' => 'geodir_post_added_success_msg_content',
270
+		'css' => 'width:500px; height: 150px;',
271
+		'type' => 'textarea',
272
+		'std' => __('<p>Thank you, your information has been successfully received.</p><p><a href="[#submited_information_link#]" >View your submitted information &raquo;</a></p><p>Thank you for visiting us at [#site_name#].</p>','geodirectory')
273
+	),
274
+
275
+
276
+	array('type' => 'sectionend', 'id' => 'messages'),
277 277
 
278 278
 )); // End Manage NOtifications settings
Please login to merge, or discard this patch.
geodirectory-admin/option-pages/permalink_settings_array.php 1 patch
Indentation   +178 added lines, -178 removed lines patch added patch discarded remove patch
@@ -16,184 +16,184 @@
 block discarded – undo
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
Please login to merge, or discard this patch.