Completed
Pull Request — master (#210)
by Kiran
05:26
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/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/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/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.
geodirectory-admin/option-pages/title_meta_settings_array.php 1 patch
Indentation   +358 added lines, -358 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 
11 11
 $gd_wpseo_use = '';
12 12
 if (class_exists('WPSEO_Frontend') || class_exists('All_in_One_SEO_Pack')) {
13
-    $gd_wpseo_use = "<b style='color:red;'>".__('Please use the WPSEO settings instead.','geodirectory')."</b><br />";
13
+	$gd_wpseo_use = "<b style='color:red;'>".__('Please use the WPSEO settings instead.','geodirectory')."</b><br />";
14 14
 }
15 15
 
16 16
 /**
@@ -21,363 +21,363 @@  discard block
 block discarded – undo
21 21
  */
22 22
 $geodir_settings['title_meta_settings'] = apply_filters('geodir_title_meta_settings', array(
23 23
 
24
-    /* Listing Permalink Settings start */
25
-    array('name' => __('Title / Meta', 'geodirectory'), 'type' => 'no_tabs', 'desc' => 'Settings to set page title and meta', 'id' => 'geodir_title_meta_settings '),
26
-
27
-
28
-
29
-
30
-    array('name' => $gd_wpseo_use.__('Available Variables', 'geodirectory'),
31
-        'desc' => __('%%title%%, %%sitename%%, %%sitedesc%%, %%excerpt%%, %%pt_single%%, %%pt_plural%%, %%category%%, %%id%%, %%sep%%, %%location%%, %%in_location%%, %%in_location_single%%, %%location_single%%, %%search_term%%, %%search_near%%, %%name%%', 'geodirectory'),
32
-        'type' => 'sectionstart',
33
-        'id' => 'geodir_meta_vars'),
34
-
35
-    array('type' => 'sectionend', 'id' => 'geodir_meta_vars'),
36
-
37
-    array('name' => __('Homepage Meta Settings', 'geodirectory'),
38
-        'type' => 'sectionstart',
39
-        'desc' => '',
40
-        'id' => 'geodir_home_meta'),
41
-
42
-    array(
43
-        'name' => __('Homepage meta title', 'geodirectory'),
44
-        'desc' => __('This will use the title of the page set as frontpage if left blank.', 'geodirectory'),
45
-        'id' => 'geodir_meta_title_homepage',
46
-        'type' => 'text',
47
-        'css' => 'width:100%;',
48
-        'std' => '',
49
-        'placeholder' => ''
50
-    ),
51
-
52
-    array(
53
-        'name' => __('Homepage meta description', 'geodirectory'),
54
-        'desc' => __('Enter the meta description for the homepage.', 'geodirectory'),
55
-        'id' => 'geodir_meta_desc_homepage',
56
-        'type' => 'textarea',
57
-        'css' => 'width:100%;',
58
-        'std' => ''
59
-    ),
60
-
61
-    array('type' => 'sectionend', 'id' => 'geodir_home_meta'),
62
-
63
-    // details page meta
64
-    array('name' => __('Details Page Meta Settings', 'geodirectory'),
65
-        'type' => 'sectionstart',
66
-        'desc' => '',
67
-        'id' => 'geodir_details_meta'),
68
-
69
-    array(
70
-        'name' => __('Details page meta title', 'geodirectory'),
71
-        'desc' => __('Enter the meta title for the details page.', 'geodirectory'),
72
-        'id' => 'geodir_meta_title_detail',
73
-        'type' => 'text',
74
-        'css' => 'width:100%;',
75
-        'std' => __('%%title%% %%sep%% %%sitename%%', 'geodirectory'),
76
-        'placeholder' => '%%title%% %%sep%% %%sitename%%'
77
-    ),
78
-
79
-    array(
80
-        'name' => __('Details page meta description', 'geodirectory'),
81
-        'desc' => __('Enter the meta description for the details page.', 'geodirectory'),
82
-        'id' => 'geodir_meta_desc_detail',
83
-        'type' => 'textarea',
84
-        'css' => 'width:100%;',
85
-        'std' => __('%%excerpt%%', 'geodirectory'),
86
-        'placeholder' => '%%excerpt%%'
87
-    ),
88
-
89
-    array('type' => 'sectionend', 'id' => 'geodir_details_meta'),
90
-
91
-    // CPT page meta
92
-    array('name' => __('Post Type Page Meta Settings', 'geodirectory'),
93
-        'type' => 'sectionstart',
94
-        'desc' => '',
95
-        'id' => 'geodir_pt_meta'),
96
-
97
-    array(
98
-        'name' => __('Post type page meta title', 'geodirectory'),
99
-        'desc' => __('Enter the meta title for the post type pages.', 'geodirectory'),
100
-        'id' => 'geodir_meta_title_pt',
101
-        'type' => 'text',
102
-        'css' => 'width:100%;',
103
-        'std' => __('%%pt_plural%% %%in_location%% %%sep%% %%sitename%%', 'geodirectory'),
104
-        'placeholder' => '%%pt_plural%% %%in_location%% %%sep%% %%sitename%%'
105
-    ),
106
-
107
-    array(
108
-        'name' => __('Post type page meta description', 'geodirectory'),
109
-        'desc' => __('Enter the meta description for the post type pages.', 'geodirectory'),
110
-        'id' => 'geodir_meta_desc_pt',
111
-        'type' => 'textarea',
112
-        'css' => 'width:100%;',
113
-        'std' => __('%%pt_plural%% %%in_location%%', 'geodirectory'),
114
-        'placeholder' => '%%pt_plural%% %%in_location%%'
115
-    ),
116
-
117
-    array(
118
-        'name' => __('Post type page title', 'geodirectory'),
119
-        'desc' => __('Enter the title for the post type pages.', 'geodirectory'),
120
-        'id' => 'geodir_page_title_pt',
121
-        'type' => 'text',
122
-        'css' => 'width:100%;',
123
-        'std' => __('All %%pt_plural%% %%in_location_single%%', 'geodirectory'),
124
-        'placeholder' => 'All %%pt_plural%% %%in_location_single%%'
125
-    ),
126
-
127
-    array('type' => 'sectionend', 'id' => 'geodir_pt_meta'),
128
-
129
-    // Cat listing page meta
130
-    array('name' => __('Listing Page Meta Settings', 'geodirectory'),
131
-        'type' => 'sectionstart',
132
-        'desc' => '',
133
-        'id' => 'geodir_pt_meta'),
134
-
135
-    array(
136
-        'name' => __('Listing page meta title', 'geodirectory'),
137
-        'desc' => __('Enter the meta title for the category listing pages.', 'geodirectory'),
138
-        'id' => 'geodir_meta_title_listing',
139
-        'type' => 'text',
140
-        'css' => 'width:100%;',
141
-        'std' => __('%%category%% %%in_location%% %%sep%% %%sitename%%', 'geodirectory'),
142
-        'placeholder' => '%%category%% %%in_location%% %%sep%% %%sitename%%'
143
-    ),
144
-
145
-    array(
146
-        'name' => __('Listing page meta description', 'geodirectory'),
147
-        'desc' => __('Enter the meta description for the category listing pages.', 'geodirectory'),
148
-        'id' => 'geodir_meta_desc_listing',
149
-        'type' => 'textarea',
150
-        'css' => 'width:100%;',
151
-        'std' => __('Posts related to Category: %%category%% %%in_location%%', 'geodirectory'),
152
-        'placeholder' => 'Posts related to Category: %%category%% %%in_location%%'
153
-    ),
154
-
155
-    array(
156
-        'name' => __('Category listing page title', 'geodirectory'),
157
-        'desc' => __('Enter the title for the category listing pages.', 'geodirectory'),
158
-        'id' => 'geodir_page_title_cat-listing',
159
-        'type' => 'text',
160
-        'css' => 'width:100%;',
161
-        'std' => __('All %%category%% %%in_location_single%%', 'geodirectory'),
162
-        'placeholder' => 'All %%category%% %%in_location_single%%'
163
-    ),
164
-
165
-    array(
166
-        'name' => __('Tag listing page title', 'geodirectory'),
167
-        'desc' => __('Enter the title for the tag listing pages.', 'geodirectory'),
168
-        'id' => 'geodir_page_title_tag-listing',
169
-        'type' => 'text',
170
-        'css' => 'width:100%;',
171
-        'std' => __('Tag: %%tag%% %%in_location_single%%', 'geodirectory'),
172
-        'placeholder' => 'Tag: %%tag%% %%in_location_single%%'
173
-    ),
174
-
175
-    array('type' => 'sectionend', 'id' => 'geodir_location_meta'),
176
-
177
-    // location page meta
178
-    array('name' => __('Location Page Meta Settings', 'geodirectory'),
179
-        'type' => 'sectionstart',
180
-        'desc' => '',
181
-        'id' => 'geodir_pt_meta'),
182
-
183
-    array(
184
-        'name' => __('Location page meta title', 'geodirectory'),
185
-        'desc' => __('Enter the meta title for the location pages.', 'geodirectory'),
186
-        'id' => 'geodir_meta_title_location',
187
-        'type' => 'text',
188
-        'css' => 'width:100%;',
189
-        'std' => __('%%title%% %%location%% %%sep%% %%sitename%%', 'geodirectory'),
190
-        'placeholder' => '%%title%% %%location%% %%sep%% %%sitename%%'
191
-    ),
192
-
193
-    array(
194
-        'name' => __('Location page meta description', 'geodirectory'),
195
-        'desc' => __('Enter the meta description for the location pages.', 'geodirectory'),
196
-        'id' => 'geodir_meta_desc_location',
197
-        'type' => 'textarea',
198
-        'css' => 'width:100%;',
199
-        'std' => __('%%location%%', 'geodirectory'),
200
-        'placeholder' => '%%location%%'
201
-    ),
202
-
203
-    array('type' => 'sectionend', 'id' => 'geodir_location_meta'),
204
-
205
-    // Search page meta
206
-    array('name' => __('Search Page Meta Settings', 'geodirectory'),
207
-        'type' => 'sectionstart',
208
-        'desc' => '',
209
-        'id' => 'geodir_pt_meta'),
210
-
211
-    array(
212
-        'name' => __('Search page meta title', 'geodirectory'),
213
-        'desc' => __('Enter the meta title for the search page.', 'geodirectory'),
214
-        'id' => 'geodir_meta_title_search',
215
-        'type' => 'text',
216
-        'css' => 'width:100%;',
217
-        'std' => __('%%pt_plural%% search results for %%search_term%%, Near %%search_near%% %%sep%% %%sitename%%', 'geodirectory'),
218
-        'placeholder' => '%%pt_plural%% search results for %%search_term%%, Near %%search_near%% %%sep%% %%sitename%%'
219
-    ),
220
-
221
-    array(
222
-        'name' => __('Search page meta description', 'geodirectory'),
223
-        'desc' => __('Enter the meta description for the search page.', 'geodirectory'),
224
-        'id' => 'geodir_meta_desc_search',
225
-        'type' => 'textarea',
226
-        'css' => 'width:100%;',
227
-        'std' => __('%%pt_plural%% search results for %%search_term%%, Near %%search_near%%', 'geodirectory'),
228
-        'placeholder' => '%%pt_plural%% search results for %%search_term%%, Near %%search_near%%'
229
-    ),
230
-
231
-    array('type' => 'sectionend', 'id' => 'geodir_location_meta'),
232
-
233
-    //Add listing page meta
234
-    array('name' => __('Add Listing Page Meta Settings', 'geodirectory'),
235
-        'type' => 'sectionstart',
236
-        'desc' => '',
237
-        'id' => 'geodir_pt_meta'),
238
-
239
-    array(
240
-        'name' => __('Add listing page meta title', 'geodirectory'),
241
-        'desc' => __('Enter the meta title for the add listing page.', 'geodirectory'),
242
-        'id' => 'geodir_meta_title_add-listing',
243
-        'type' => 'text',
244
-        'css' => 'width:100%;',
245
-        'std' => __('Add %%pt_single%% %%sep%% %%sitename%%', 'geodirectory'),
246
-        'placeholder' => 'Add %%pt_single%% %%sep%% %%sitename%%'
247
-    ),
248
-
249
-    array(
250
-        'name' => __('Add listing page meta description', 'geodirectory'),
251
-        'desc' => __('Enter the meta description for the add listing page.', 'geodirectory'),
252
-        'id' => 'geodir_meta_desc_add-listing',
253
-        'type' => 'textarea',
254
-        'css' => 'width:100%;',
255
-        'std' => __('Add %%pt_single%%', 'geodirectory'),
256
-        'placeholder' => 'Add %%pt_single%%'
257
-    ),
258
-
259
-    array(
260
-        'name' => __('Add listing page title', 'geodirectory'),
261
-        'desc' => __('Enter the title for the add listing page.', 'geodirectory'),
262
-        'id' => 'geodir_page_title_add-listing',
263
-        'type' => 'text',
264
-        'css' => 'width:100%;',
265
-        'std' => __('Add %%pt_single%%', 'geodirectory'),
266
-        'placeholder' => 'Add %%pt_single%%'
267
-    ),
268
-
269
-    array(
270
-        'name' => __('Edit listing page title', 'geodirectory'),
271
-        'desc' => __('Enter the title for the edit listing page.', 'geodirectory'),
272
-        'id' => 'geodir_page_title_edit-listing',
273
-        'type' => 'text',
274
-        'css' => 'width:100%;',
275
-        'std' => __('Edit %%pt_single%%', 'geodirectory'),
276
-        'placeholder' => 'Edit %%pt_single%%'
277
-    ),
278
-
279
-    array('type' => 'sectionend', 'id' => 'geodir_location_meta'),
280
-
281
-    //Author page meta
282
-    array('name' => __('Author Page Meta Settings', 'geodirectory'),
283
-        'type' => 'sectionstart',
284
-        'desc' => '',
285
-        'id' => 'geodir_pt_meta'),
286
-
287
-    array(
288
-        'name' => __('Author page meta title', 'geodirectory'),
289
-        'desc' => __('Enter the meta title for the author page.', 'geodirectory'),
290
-        'id' => 'geodir_meta_title_author',
291
-        'type' => 'text',
292
-        'css' => 'width:100%;',
293
-        'std' => __('Author: %%name%% %%sep%% %%sitename%%', 'geodirectory'),
294
-        'placeholder' => 'Author: %%name%% %%sep%% %%sitename%%'
295
-    ),
296
-
297
-    array(
298
-        'name' => __('Author page meta description', 'geodirectory'),
299
-        'desc' => __('Enter the meta description for the author page.', 'geodirectory'),
300
-        'id' => 'geodir_meta_desc_author',
301
-        'type' => 'textarea',
302
-        'css' => 'width:100%;',
303
-        'std' => ''
304
-    ),
305
-
306
-    array(
307
-        'name' => __('Author page title', 'geodirectory'),
308
-        'desc' => __('Enter the title for the author page.', 'geodirectory'),
309
-        'id' => 'geodir_page_title_author',
310
-        'type' => 'text',
311
-        'css' => 'width:100%;',
312
-        'std' => __('%%pt_plural%% by: %%name%%', 'geodirectory'),
313
-        'placeholder' => '%%pt_plural%% by: %%name%%'
314
-    ),
315
-
316
-    array(
317
-        'name' => __('Author favorite page title', 'geodirectory'),
318
-        'desc' => __('Enter the title for the author favorite page.', 'geodirectory'),
319
-        'id' => 'geodir_page_title_favorite',
320
-        'type' => 'text',
321
-        'css' => 'width:100%;',
322
-        'std' => __('%%name%%: Favorite %%pt_plural%%', 'geodirectory'),
323
-        'placeholder' => '%%name%%: Favorite %%pt_plural%%'
324
-    ),
325
-
326
-    array('type' => 'sectionend', 'id' => 'geodir_location_meta'),
327
-
328
-    //Login page meta
329
-    array('name' => __('Login Page Meta Settings', 'geodirectory'),
330
-        'type' => 'sectionstart',
331
-        'desc' => '',
332
-        'id' => 'geodir_login_meta'),
333
-
334
-    array(
335
-        'name' => __('Login page meta title', 'geodirectory'),
336
-        'desc' => __('Enter the meta title for the login page.', 'geodirectory'),
337
-        'id' => 'geodir_meta_title_login',
338
-        'type' => 'text',
339
-        'css' => 'width:100%;',
340
-        'std' => __('%%title%% %%sep%% %%sitename%%', 'geodirectory'),
341
-        'placeholder' => '%%title%% %%sep%% %%sitename%%'
342
-    ),
343
-
344
-    array(
345
-        'name' => __('Login page meta description', 'geodirectory'),
346
-        'desc' => __('Enter the meta description for the login page.', 'geodirectory'),
347
-        'id' => 'geodir_meta_desc_login',
348
-        'type' => 'textarea',
349
-        'css' => 'width:100%;',
350
-        'std' => ''
351
-    ),
352
-
353
-    array('type' => 'sectionend', 'id' => 'geodir_login_meta'),
354
-
355
-    //Listing success page meta
356
-    array('name' => __('Listing Success Page Meta Settings', 'geodirectory'),
357
-        'type' => 'sectionstart',
358
-        'desc' => '',
359
-        'id' => 'geodir_login_meta'),
360
-
361
-    array(
362
-        'name' => __('Listing success page meta title', 'geodirectory'),
363
-        'desc' => __('Enter the meta title for the listing success page.', 'geodirectory'),
364
-        'id' => 'geodir_meta_title_listing-success',
365
-        'type' => 'text',
366
-        'css' => 'width:100%;',
367
-        'std' => __('%%title%% %%sep%% %%sitename%%', 'geodirectory'),
368
-        'placeholder' => '%%title%% %%sep%% %%sitename%%'
369
-    ),
370
-
371
-    array(
372
-        'name' => __('Listing success page meta description', 'geodirectory'),
373
-        'desc' => __('Enter the meta description for the listing success page.', 'geodirectory'),
374
-        'id' => 'geodir_meta_desc_listing-success',
375
-        'type' => 'textarea',
376
-        'css' => 'width:100%;',
377
-        'std' => ''
378
-    ),
379
-
380
-    array('type' => 'sectionend', 'id' => 'geodir_login_meta'),
24
+	/* Listing Permalink Settings start */
25
+	array('name' => __('Title / Meta', 'geodirectory'), 'type' => 'no_tabs', 'desc' => 'Settings to set page title and meta', 'id' => 'geodir_title_meta_settings '),
26
+
27
+
28
+
29
+
30
+	array('name' => $gd_wpseo_use.__('Available Variables', 'geodirectory'),
31
+		'desc' => __('%%title%%, %%sitename%%, %%sitedesc%%, %%excerpt%%, %%pt_single%%, %%pt_plural%%, %%category%%, %%id%%, %%sep%%, %%location%%, %%in_location%%, %%in_location_single%%, %%location_single%%, %%search_term%%, %%search_near%%, %%name%%', 'geodirectory'),
32
+		'type' => 'sectionstart',
33
+		'id' => 'geodir_meta_vars'),
34
+
35
+	array('type' => 'sectionend', 'id' => 'geodir_meta_vars'),
36
+
37
+	array('name' => __('Homepage Meta Settings', 'geodirectory'),
38
+		'type' => 'sectionstart',
39
+		'desc' => '',
40
+		'id' => 'geodir_home_meta'),
41
+
42
+	array(
43
+		'name' => __('Homepage meta title', 'geodirectory'),
44
+		'desc' => __('This will use the title of the page set as frontpage if left blank.', 'geodirectory'),
45
+		'id' => 'geodir_meta_title_homepage',
46
+		'type' => 'text',
47
+		'css' => 'width:100%;',
48
+		'std' => '',
49
+		'placeholder' => ''
50
+	),
51
+
52
+	array(
53
+		'name' => __('Homepage meta description', 'geodirectory'),
54
+		'desc' => __('Enter the meta description for the homepage.', 'geodirectory'),
55
+		'id' => 'geodir_meta_desc_homepage',
56
+		'type' => 'textarea',
57
+		'css' => 'width:100%;',
58
+		'std' => ''
59
+	),
60
+
61
+	array('type' => 'sectionend', 'id' => 'geodir_home_meta'),
62
+
63
+	// details page meta
64
+	array('name' => __('Details Page Meta Settings', 'geodirectory'),
65
+		'type' => 'sectionstart',
66
+		'desc' => '',
67
+		'id' => 'geodir_details_meta'),
68
+
69
+	array(
70
+		'name' => __('Details page meta title', 'geodirectory'),
71
+		'desc' => __('Enter the meta title for the details page.', 'geodirectory'),
72
+		'id' => 'geodir_meta_title_detail',
73
+		'type' => 'text',
74
+		'css' => 'width:100%;',
75
+		'std' => __('%%title%% %%sep%% %%sitename%%', 'geodirectory'),
76
+		'placeholder' => '%%title%% %%sep%% %%sitename%%'
77
+	),
78
+
79
+	array(
80
+		'name' => __('Details page meta description', 'geodirectory'),
81
+		'desc' => __('Enter the meta description for the details page.', 'geodirectory'),
82
+		'id' => 'geodir_meta_desc_detail',
83
+		'type' => 'textarea',
84
+		'css' => 'width:100%;',
85
+		'std' => __('%%excerpt%%', 'geodirectory'),
86
+		'placeholder' => '%%excerpt%%'
87
+	),
88
+
89
+	array('type' => 'sectionend', 'id' => 'geodir_details_meta'),
90
+
91
+	// CPT page meta
92
+	array('name' => __('Post Type Page Meta Settings', 'geodirectory'),
93
+		'type' => 'sectionstart',
94
+		'desc' => '',
95
+		'id' => 'geodir_pt_meta'),
96
+
97
+	array(
98
+		'name' => __('Post type page meta title', 'geodirectory'),
99
+		'desc' => __('Enter the meta title for the post type pages.', 'geodirectory'),
100
+		'id' => 'geodir_meta_title_pt',
101
+		'type' => 'text',
102
+		'css' => 'width:100%;',
103
+		'std' => __('%%pt_plural%% %%in_location%% %%sep%% %%sitename%%', 'geodirectory'),
104
+		'placeholder' => '%%pt_plural%% %%in_location%% %%sep%% %%sitename%%'
105
+	),
106
+
107
+	array(
108
+		'name' => __('Post type page meta description', 'geodirectory'),
109
+		'desc' => __('Enter the meta description for the post type pages.', 'geodirectory'),
110
+		'id' => 'geodir_meta_desc_pt',
111
+		'type' => 'textarea',
112
+		'css' => 'width:100%;',
113
+		'std' => __('%%pt_plural%% %%in_location%%', 'geodirectory'),
114
+		'placeholder' => '%%pt_plural%% %%in_location%%'
115
+	),
116
+
117
+	array(
118
+		'name' => __('Post type page title', 'geodirectory'),
119
+		'desc' => __('Enter the title for the post type pages.', 'geodirectory'),
120
+		'id' => 'geodir_page_title_pt',
121
+		'type' => 'text',
122
+		'css' => 'width:100%;',
123
+		'std' => __('All %%pt_plural%% %%in_location_single%%', 'geodirectory'),
124
+		'placeholder' => 'All %%pt_plural%% %%in_location_single%%'
125
+	),
126
+
127
+	array('type' => 'sectionend', 'id' => 'geodir_pt_meta'),
128
+
129
+	// Cat listing page meta
130
+	array('name' => __('Listing Page Meta Settings', 'geodirectory'),
131
+		'type' => 'sectionstart',
132
+		'desc' => '',
133
+		'id' => 'geodir_pt_meta'),
134
+
135
+	array(
136
+		'name' => __('Listing page meta title', 'geodirectory'),
137
+		'desc' => __('Enter the meta title for the category listing pages.', 'geodirectory'),
138
+		'id' => 'geodir_meta_title_listing',
139
+		'type' => 'text',
140
+		'css' => 'width:100%;',
141
+		'std' => __('%%category%% %%in_location%% %%sep%% %%sitename%%', 'geodirectory'),
142
+		'placeholder' => '%%category%% %%in_location%% %%sep%% %%sitename%%'
143
+	),
144
+
145
+	array(
146
+		'name' => __('Listing page meta description', 'geodirectory'),
147
+		'desc' => __('Enter the meta description for the category listing pages.', 'geodirectory'),
148
+		'id' => 'geodir_meta_desc_listing',
149
+		'type' => 'textarea',
150
+		'css' => 'width:100%;',
151
+		'std' => __('Posts related to Category: %%category%% %%in_location%%', 'geodirectory'),
152
+		'placeholder' => 'Posts related to Category: %%category%% %%in_location%%'
153
+	),
154
+
155
+	array(
156
+		'name' => __('Category listing page title', 'geodirectory'),
157
+		'desc' => __('Enter the title for the category listing pages.', 'geodirectory'),
158
+		'id' => 'geodir_page_title_cat-listing',
159
+		'type' => 'text',
160
+		'css' => 'width:100%;',
161
+		'std' => __('All %%category%% %%in_location_single%%', 'geodirectory'),
162
+		'placeholder' => 'All %%category%% %%in_location_single%%'
163
+	),
164
+
165
+	array(
166
+		'name' => __('Tag listing page title', 'geodirectory'),
167
+		'desc' => __('Enter the title for the tag listing pages.', 'geodirectory'),
168
+		'id' => 'geodir_page_title_tag-listing',
169
+		'type' => 'text',
170
+		'css' => 'width:100%;',
171
+		'std' => __('Tag: %%tag%% %%in_location_single%%', 'geodirectory'),
172
+		'placeholder' => 'Tag: %%tag%% %%in_location_single%%'
173
+	),
174
+
175
+	array('type' => 'sectionend', 'id' => 'geodir_location_meta'),
176
+
177
+	// location page meta
178
+	array('name' => __('Location Page Meta Settings', 'geodirectory'),
179
+		'type' => 'sectionstart',
180
+		'desc' => '',
181
+		'id' => 'geodir_pt_meta'),
182
+
183
+	array(
184
+		'name' => __('Location page meta title', 'geodirectory'),
185
+		'desc' => __('Enter the meta title for the location pages.', 'geodirectory'),
186
+		'id' => 'geodir_meta_title_location',
187
+		'type' => 'text',
188
+		'css' => 'width:100%;',
189
+		'std' => __('%%title%% %%location%% %%sep%% %%sitename%%', 'geodirectory'),
190
+		'placeholder' => '%%title%% %%location%% %%sep%% %%sitename%%'
191
+	),
192
+
193
+	array(
194
+		'name' => __('Location page meta description', 'geodirectory'),
195
+		'desc' => __('Enter the meta description for the location pages.', 'geodirectory'),
196
+		'id' => 'geodir_meta_desc_location',
197
+		'type' => 'textarea',
198
+		'css' => 'width:100%;',
199
+		'std' => __('%%location%%', 'geodirectory'),
200
+		'placeholder' => '%%location%%'
201
+	),
202
+
203
+	array('type' => 'sectionend', 'id' => 'geodir_location_meta'),
204
+
205
+	// Search page meta
206
+	array('name' => __('Search Page Meta Settings', 'geodirectory'),
207
+		'type' => 'sectionstart',
208
+		'desc' => '',
209
+		'id' => 'geodir_pt_meta'),
210
+
211
+	array(
212
+		'name' => __('Search page meta title', 'geodirectory'),
213
+		'desc' => __('Enter the meta title for the search page.', 'geodirectory'),
214
+		'id' => 'geodir_meta_title_search',
215
+		'type' => 'text',
216
+		'css' => 'width:100%;',
217
+		'std' => __('%%pt_plural%% search results for %%search_term%%, Near %%search_near%% %%sep%% %%sitename%%', 'geodirectory'),
218
+		'placeholder' => '%%pt_plural%% search results for %%search_term%%, Near %%search_near%% %%sep%% %%sitename%%'
219
+	),
220
+
221
+	array(
222
+		'name' => __('Search page meta description', 'geodirectory'),
223
+		'desc' => __('Enter the meta description for the search page.', 'geodirectory'),
224
+		'id' => 'geodir_meta_desc_search',
225
+		'type' => 'textarea',
226
+		'css' => 'width:100%;',
227
+		'std' => __('%%pt_plural%% search results for %%search_term%%, Near %%search_near%%', 'geodirectory'),
228
+		'placeholder' => '%%pt_plural%% search results for %%search_term%%, Near %%search_near%%'
229
+	),
230
+
231
+	array('type' => 'sectionend', 'id' => 'geodir_location_meta'),
232
+
233
+	//Add listing page meta
234
+	array('name' => __('Add Listing Page Meta Settings', 'geodirectory'),
235
+		'type' => 'sectionstart',
236
+		'desc' => '',
237
+		'id' => 'geodir_pt_meta'),
238
+
239
+	array(
240
+		'name' => __('Add listing page meta title', 'geodirectory'),
241
+		'desc' => __('Enter the meta title for the add listing page.', 'geodirectory'),
242
+		'id' => 'geodir_meta_title_add-listing',
243
+		'type' => 'text',
244
+		'css' => 'width:100%;',
245
+		'std' => __('Add %%pt_single%% %%sep%% %%sitename%%', 'geodirectory'),
246
+		'placeholder' => 'Add %%pt_single%% %%sep%% %%sitename%%'
247
+	),
248
+
249
+	array(
250
+		'name' => __('Add listing page meta description', 'geodirectory'),
251
+		'desc' => __('Enter the meta description for the add listing page.', 'geodirectory'),
252
+		'id' => 'geodir_meta_desc_add-listing',
253
+		'type' => 'textarea',
254
+		'css' => 'width:100%;',
255
+		'std' => __('Add %%pt_single%%', 'geodirectory'),
256
+		'placeholder' => 'Add %%pt_single%%'
257
+	),
258
+
259
+	array(
260
+		'name' => __('Add listing page title', 'geodirectory'),
261
+		'desc' => __('Enter the title for the add listing page.', 'geodirectory'),
262
+		'id' => 'geodir_page_title_add-listing',
263
+		'type' => 'text',
264
+		'css' => 'width:100%;',
265
+		'std' => __('Add %%pt_single%%', 'geodirectory'),
266
+		'placeholder' => 'Add %%pt_single%%'
267
+	),
268
+
269
+	array(
270
+		'name' => __('Edit listing page title', 'geodirectory'),
271
+		'desc' => __('Enter the title for the edit listing page.', 'geodirectory'),
272
+		'id' => 'geodir_page_title_edit-listing',
273
+		'type' => 'text',
274
+		'css' => 'width:100%;',
275
+		'std' => __('Edit %%pt_single%%', 'geodirectory'),
276
+		'placeholder' => 'Edit %%pt_single%%'
277
+	),
278
+
279
+	array('type' => 'sectionend', 'id' => 'geodir_location_meta'),
280
+
281
+	//Author page meta
282
+	array('name' => __('Author Page Meta Settings', 'geodirectory'),
283
+		'type' => 'sectionstart',
284
+		'desc' => '',
285
+		'id' => 'geodir_pt_meta'),
286
+
287
+	array(
288
+		'name' => __('Author page meta title', 'geodirectory'),
289
+		'desc' => __('Enter the meta title for the author page.', 'geodirectory'),
290
+		'id' => 'geodir_meta_title_author',
291
+		'type' => 'text',
292
+		'css' => 'width:100%;',
293
+		'std' => __('Author: %%name%% %%sep%% %%sitename%%', 'geodirectory'),
294
+		'placeholder' => 'Author: %%name%% %%sep%% %%sitename%%'
295
+	),
296
+
297
+	array(
298
+		'name' => __('Author page meta description', 'geodirectory'),
299
+		'desc' => __('Enter the meta description for the author page.', 'geodirectory'),
300
+		'id' => 'geodir_meta_desc_author',
301
+		'type' => 'textarea',
302
+		'css' => 'width:100%;',
303
+		'std' => ''
304
+	),
305
+
306
+	array(
307
+		'name' => __('Author page title', 'geodirectory'),
308
+		'desc' => __('Enter the title for the author page.', 'geodirectory'),
309
+		'id' => 'geodir_page_title_author',
310
+		'type' => 'text',
311
+		'css' => 'width:100%;',
312
+		'std' => __('%%pt_plural%% by: %%name%%', 'geodirectory'),
313
+		'placeholder' => '%%pt_plural%% by: %%name%%'
314
+	),
315
+
316
+	array(
317
+		'name' => __('Author favorite page title', 'geodirectory'),
318
+		'desc' => __('Enter the title for the author favorite page.', 'geodirectory'),
319
+		'id' => 'geodir_page_title_favorite',
320
+		'type' => 'text',
321
+		'css' => 'width:100%;',
322
+		'std' => __('%%name%%: Favorite %%pt_plural%%', 'geodirectory'),
323
+		'placeholder' => '%%name%%: Favorite %%pt_plural%%'
324
+	),
325
+
326
+	array('type' => 'sectionend', 'id' => 'geodir_location_meta'),
327
+
328
+	//Login page meta
329
+	array('name' => __('Login Page Meta Settings', 'geodirectory'),
330
+		'type' => 'sectionstart',
331
+		'desc' => '',
332
+		'id' => 'geodir_login_meta'),
333
+
334
+	array(
335
+		'name' => __('Login page meta title', 'geodirectory'),
336
+		'desc' => __('Enter the meta title for the login page.', 'geodirectory'),
337
+		'id' => 'geodir_meta_title_login',
338
+		'type' => 'text',
339
+		'css' => 'width:100%;',
340
+		'std' => __('%%title%% %%sep%% %%sitename%%', 'geodirectory'),
341
+		'placeholder' => '%%title%% %%sep%% %%sitename%%'
342
+	),
343
+
344
+	array(
345
+		'name' => __('Login page meta description', 'geodirectory'),
346
+		'desc' => __('Enter the meta description for the login page.', 'geodirectory'),
347
+		'id' => 'geodir_meta_desc_login',
348
+		'type' => 'textarea',
349
+		'css' => 'width:100%;',
350
+		'std' => ''
351
+	),
352
+
353
+	array('type' => 'sectionend', 'id' => 'geodir_login_meta'),
354
+
355
+	//Listing success page meta
356
+	array('name' => __('Listing Success Page Meta Settings', 'geodirectory'),
357
+		'type' => 'sectionstart',
358
+		'desc' => '',
359
+		'id' => 'geodir_login_meta'),
360
+
361
+	array(
362
+		'name' => __('Listing success page meta title', 'geodirectory'),
363
+		'desc' => __('Enter the meta title for the listing success page.', 'geodirectory'),
364
+		'id' => 'geodir_meta_title_listing-success',
365
+		'type' => 'text',
366
+		'css' => 'width:100%;',
367
+		'std' => __('%%title%% %%sep%% %%sitename%%', 'geodirectory'),
368
+		'placeholder' => '%%title%% %%sep%% %%sitename%%'
369
+	),
370
+
371
+	array(
372
+		'name' => __('Listing success page meta description', 'geodirectory'),
373
+		'desc' => __('Enter the meta description for the listing success page.', 'geodirectory'),
374
+		'id' => 'geodir_meta_desc_listing-success',
375
+		'type' => 'textarea',
376
+		'css' => 'width:100%;',
377
+		'std' => ''
378
+	),
379
+
380
+	array('type' => 'sectionend', 'id' => 'geodir_login_meta'),
381 381
 
382 382
 
383 383
 
Please login to merge, or discard this patch.
geodirectory-functions/cat-meta-functions/cat_meta.php 1 patch
Indentation   +165 added lines, -165 removed lines patch added patch discarded remove patch
@@ -11,139 +11,139 @@  discard block
 block discarded – undo
11 11
 //include the main class file
12 12
 require_once("Tax-meta-class.php");
13 13
 if (is_admin()) {
14
-    /*
14
+	/*
15 15
      * prefix of meta keys, optional
16 16
      * use underscore (_) at the beginning to make keys hidden, for example $prefix = '_ba_';
17 17
      *  you also can make prefix empty to disable it
18 18
      *
19 19
      */
20 20
 
21
-    $prefix = 'ct_';
22
-    /*
21
+	$prefix = 'ct_';
22
+	/*
23 23
      * configure your meta box
24 24
      */
25 25
 
26
-    $config = array(
27
-        'id' => 'demo_meta_box',                    // meta box id, unique per meta box
28
-        'title' => __('Demo Meta Box', 'geodirectory'),                    // meta box title
29
-        'pages' => geodir_get_taxonomies(),            // taxonomy name, accept categories, post_tag and custom taxonomies
30
-        'context' => 'normal',                        // where the meta box appear: normal (default), advanced, side; optional
31
-        'fields' => array(),                        // list of meta fields (can be added by field arrays)
32
-        'local_images' => false,                    // Use local or hosted images (meta box images for add/remove)
33
-        'use_with_theme' => true                    //change path if used with theme set to true, false for a plugin or anything else for a custom path(default false).
34
-    );
26
+	$config = array(
27
+		'id' => 'demo_meta_box',                    // meta box id, unique per meta box
28
+		'title' => __('Demo Meta Box', 'geodirectory'),                    // meta box title
29
+		'pages' => geodir_get_taxonomies(),            // taxonomy name, accept categories, post_tag and custom taxonomies
30
+		'context' => 'normal',                        // where the meta box appear: normal (default), advanced, side; optional
31
+		'fields' => array(),                        // list of meta fields (can be added by field arrays)
32
+		'local_images' => false,                    // Use local or hosted images (meta box images for add/remove)
33
+		'use_with_theme' => true                    //change path if used with theme set to true, false for a plugin or anything else for a custom path(default false).
34
+	);
35 35
 
36 36
 
37
-    /*
37
+	/*
38 38
      * Initiate your meta box
39 39
      */
40
-    $my_meta = new Tax_Meta_Class($config);
41
-    $my_meta->addWysiwyg($prefix . 'cat_top_desc', array('name' => __('Category Top Description', 'geodirectory'), 'desc' => __('This will appear at the top of the category listing.', 'geodirectory')));
42
-    $my_meta->addImage($prefix . 'cat_default_img', array('name' => __('Default Listing Image', 'geodirectory'), 'desc' => __('Choose a default "no image"', 'geodirectory')));
43
-    $my_meta->addImage($prefix . 'cat_icon', array('name' => __('Category Icon', 'geodirectory'), 'desc' => __('Choose a category icon', 'geodirectory'), 'validate_func' => '!empty'));
44
-    /*$my_meta->addCheckbox($prefix.'pointless',array('name'=> __('<b>Exclude</b> Rating sort option','geodirectory'),'style'=>'hidden'));*/// hidden setting to trick WPML
45
-
46
-    $my_meta->addSelect($prefix . 'cat_schema',
47
-    /*
40
+	$my_meta = new Tax_Meta_Class($config);
41
+	$my_meta->addWysiwyg($prefix . 'cat_top_desc', array('name' => __('Category Top Description', 'geodirectory'), 'desc' => __('This will appear at the top of the category listing.', 'geodirectory')));
42
+	$my_meta->addImage($prefix . 'cat_default_img', array('name' => __('Default Listing Image', 'geodirectory'), 'desc' => __('Choose a default "no image"', 'geodirectory')));
43
+	$my_meta->addImage($prefix . 'cat_icon', array('name' => __('Category Icon', 'geodirectory'), 'desc' => __('Choose a category icon', 'geodirectory'), 'validate_func' => '!empty'));
44
+	/*$my_meta->addCheckbox($prefix.'pointless',array('name'=> __('<b>Exclude</b> Rating sort option','geodirectory'),'style'=>'hidden'));*/// hidden setting to trick WPML
45
+
46
+	$my_meta->addSelect($prefix . 'cat_schema',
47
+	/*
48 48
      * Allows you to add/filter the cat schema types.
49 49
      *
50 50
      * @since 1.5.7
51 51
      */
52
-        apply_filters('geodir_cat_schemas',array(
53
-            '' => __('Default (LocalBusiness)', 'geodirectory'),
54
-            'AccountingService' => 'AccountingService',
55
-            'Attorney' => 'Attorney',
56
-            'AutoBodyShop' => 'AutoBodyShop',
57
-            'AutoDealer' => 'AutoDealer',
58
-            'AutoPartsStore' => 'AutoPartsStore',
59
-            'AutoRental' => 'AutoRental',
60
-            'AutoRepair' => 'AutoRepair',
61
-            'AutoWash' => 'AutoWash',
62
-            'Bakery' => 'Bakery',
63
-            'BarOrPub' => 'BarOrPub',
64
-            'BeautySalon' => 'BeautySalon',
65
-            'BedAndBreakfast' => 'BedAndBreakfast',
66
-            'BikeStore' => 'BikeStore',
67
-            'BookStore' => 'BookStore',
68
-            'CafeOrCoffeeShop' => 'CafeOrCoffeeShop',
69
-            'ChildCare' => 'ChildCare',
70
-            'ClothingStore' => 'ClothingStore',
71
-            'ComputerStore' => 'ComputerStore',
72
-            'DaySpa' => 'DaySpa',
73
-            'Dentist' => 'Dentist',
74
-            'DryCleaningOrLaundry' => 'DryCleaningOrLaundry',
75
-            'Electrician' => 'Electrician',
76
-            'ElectronicsStore' => 'ElectronicsStore',
77
-            'EmergencyService' => 'EmergencyService',
78
-            'EntertainmentBusiness' => 'EntertainmentBusiness',
79
-            'Event' => 'Event',
80
-            'EventVenue' => 'EventVenue',
81
-            'ExerciseGym' => 'ExerciseGym',
82
-            'FinancialService' => 'FinancialService',
83
-            'Florist' => 'Florist',
84
-            'FoodEstablishment' => 'FoodEstablishment',
85
-            'FurnitureStore' => 'FurnitureStore',
86
-            'GardenStore' => 'GardenStore',
87
-            'GeneralContractor' => 'GeneralContractor',
88
-            'GolfCourse' => 'GolfCourse',
89
-            'HairSalon' => 'HairSalon',
90
-            'HardwareStore' => 'HardwareStore',
91
-            'HealthAndBeautyBusiness' => 'HealthAndBeautyBusiness',
92
-            'HobbyShop' => 'HobbyShop',
93
-            'HomeAndConstructionBusiness' => 'HomeAndConstructionBusiness',
94
-            'HomeGoodsStore' => 'HomeGoodsStore',
95
-            'Hospital' => 'Hospital',
96
-            'Hotel' => 'Hotel',
97
-            'HousePainter' => 'HousePainter',
98
-            'HVACBusiness' => 'HVACBusiness',
99
-            'InsuranceAgency' => 'InsuranceAgency',
100
-            'JewelryStore' => 'JewelryStore',
101
-            'LiquorStore' => 'LiquorStore',
102
-            'Locksmith' => 'Locksmith',
103
-            'LodgingBusiness' => 'LodgingBusiness',
104
-            'MedicalClinic' => 'MedicalClinic',
105
-            'MensClothingStore' => 'MensClothingStore',
106
-            'MobilePhoneStore' => 'MobilePhoneStore',
107
-            'Motel' => 'Motel',
108
-            'MotorcycleDealer' => 'MotorcycleDealer',
109
-            'MotorcycleRepair' => 'MotorcycleRepair',
110
-            'MovingCompany' => 'MovingCompany',
111
-            'MusicStore' => 'MusicStore',
112
-            'NailSalon' => 'NailSalon',
113
-            'NightClub' => 'NightClub',
114
-            'Notary' => 'Notary',
115
-            'OfficeEquipmentStore' => 'OfficeEquipmentStore',
116
-            'Optician' => 'Optician',
117
-            'PetStore' => 'PetStore',
118
-            'Physician' => 'Physician',
119
-            'Plumber' => 'Plumber',
120
-            'ProfessionalService' => 'ProfessionalService',
121
-            'RealEstateAgent' => 'RealEstateAgent',
122
-            'Residence' => 'Residence',
123
-            'Restaurant' => 'Restaurant',
124
-            'RoofingContractor' => 'RoofingContractor',
125
-            'RVPark' => 'RVPark',
126
-            'School' => 'School',
127
-            'SelfStorage' => 'SelfStorage',
128
-            'ShoeStore' => 'ShoeStore',
129
-            'SkiResort' => 'SkiResort',
130
-            'SportingGoodsStore' => 'SportingGoodsStore',
131
-            'SportsClub' => 'SportsClub',
132
-            'Store' => 'Store',
133
-            'TattooParlor' => 'TattooParlor',
134
-            'Taxi' => 'Taxi',
135
-            'TennisComplex' => 'TennisComplex',
136
-            'TireShop' => 'TireShop',
137
-            'TouristAttraction' => 'TouristAttraction',
138
-            'ToyStore' => 'ToyStore',
139
-            'TravelAgency' => 'TravelAgency',
140
-            'VeterinaryCare' => 'VeterinaryCare',
141
-            'WholesaleStore' => 'WholesaleStore',
142
-            'Winery' => 'Winery'
143
-        )),
144
-        array('name' => __('Schema Type', 'geodirectory'), 'desc' => __('Select the Schema to use for this category', 'geodirectory') . "", 'std' => array('selectkey2')));
145
-
146
-    /*$my_meta->addSelect($prefix.'cat_sort',array(''=>__('Default' , 'geodirectory'),
52
+		apply_filters('geodir_cat_schemas',array(
53
+			'' => __('Default (LocalBusiness)', 'geodirectory'),
54
+			'AccountingService' => 'AccountingService',
55
+			'Attorney' => 'Attorney',
56
+			'AutoBodyShop' => 'AutoBodyShop',
57
+			'AutoDealer' => 'AutoDealer',
58
+			'AutoPartsStore' => 'AutoPartsStore',
59
+			'AutoRental' => 'AutoRental',
60
+			'AutoRepair' => 'AutoRepair',
61
+			'AutoWash' => 'AutoWash',
62
+			'Bakery' => 'Bakery',
63
+			'BarOrPub' => 'BarOrPub',
64
+			'BeautySalon' => 'BeautySalon',
65
+			'BedAndBreakfast' => 'BedAndBreakfast',
66
+			'BikeStore' => 'BikeStore',
67
+			'BookStore' => 'BookStore',
68
+			'CafeOrCoffeeShop' => 'CafeOrCoffeeShop',
69
+			'ChildCare' => 'ChildCare',
70
+			'ClothingStore' => 'ClothingStore',
71
+			'ComputerStore' => 'ComputerStore',
72
+			'DaySpa' => 'DaySpa',
73
+			'Dentist' => 'Dentist',
74
+			'DryCleaningOrLaundry' => 'DryCleaningOrLaundry',
75
+			'Electrician' => 'Electrician',
76
+			'ElectronicsStore' => 'ElectronicsStore',
77
+			'EmergencyService' => 'EmergencyService',
78
+			'EntertainmentBusiness' => 'EntertainmentBusiness',
79
+			'Event' => 'Event',
80
+			'EventVenue' => 'EventVenue',
81
+			'ExerciseGym' => 'ExerciseGym',
82
+			'FinancialService' => 'FinancialService',
83
+			'Florist' => 'Florist',
84
+			'FoodEstablishment' => 'FoodEstablishment',
85
+			'FurnitureStore' => 'FurnitureStore',
86
+			'GardenStore' => 'GardenStore',
87
+			'GeneralContractor' => 'GeneralContractor',
88
+			'GolfCourse' => 'GolfCourse',
89
+			'HairSalon' => 'HairSalon',
90
+			'HardwareStore' => 'HardwareStore',
91
+			'HealthAndBeautyBusiness' => 'HealthAndBeautyBusiness',
92
+			'HobbyShop' => 'HobbyShop',
93
+			'HomeAndConstructionBusiness' => 'HomeAndConstructionBusiness',
94
+			'HomeGoodsStore' => 'HomeGoodsStore',
95
+			'Hospital' => 'Hospital',
96
+			'Hotel' => 'Hotel',
97
+			'HousePainter' => 'HousePainter',
98
+			'HVACBusiness' => 'HVACBusiness',
99
+			'InsuranceAgency' => 'InsuranceAgency',
100
+			'JewelryStore' => 'JewelryStore',
101
+			'LiquorStore' => 'LiquorStore',
102
+			'Locksmith' => 'Locksmith',
103
+			'LodgingBusiness' => 'LodgingBusiness',
104
+			'MedicalClinic' => 'MedicalClinic',
105
+			'MensClothingStore' => 'MensClothingStore',
106
+			'MobilePhoneStore' => 'MobilePhoneStore',
107
+			'Motel' => 'Motel',
108
+			'MotorcycleDealer' => 'MotorcycleDealer',
109
+			'MotorcycleRepair' => 'MotorcycleRepair',
110
+			'MovingCompany' => 'MovingCompany',
111
+			'MusicStore' => 'MusicStore',
112
+			'NailSalon' => 'NailSalon',
113
+			'NightClub' => 'NightClub',
114
+			'Notary' => 'Notary',
115
+			'OfficeEquipmentStore' => 'OfficeEquipmentStore',
116
+			'Optician' => 'Optician',
117
+			'PetStore' => 'PetStore',
118
+			'Physician' => 'Physician',
119
+			'Plumber' => 'Plumber',
120
+			'ProfessionalService' => 'ProfessionalService',
121
+			'RealEstateAgent' => 'RealEstateAgent',
122
+			'Residence' => 'Residence',
123
+			'Restaurant' => 'Restaurant',
124
+			'RoofingContractor' => 'RoofingContractor',
125
+			'RVPark' => 'RVPark',
126
+			'School' => 'School',
127
+			'SelfStorage' => 'SelfStorage',
128
+			'ShoeStore' => 'ShoeStore',
129
+			'SkiResort' => 'SkiResort',
130
+			'SportingGoodsStore' => 'SportingGoodsStore',
131
+			'SportsClub' => 'SportsClub',
132
+			'Store' => 'Store',
133
+			'TattooParlor' => 'TattooParlor',
134
+			'Taxi' => 'Taxi',
135
+			'TennisComplex' => 'TennisComplex',
136
+			'TireShop' => 'TireShop',
137
+			'TouristAttraction' => 'TouristAttraction',
138
+			'ToyStore' => 'ToyStore',
139
+			'TravelAgency' => 'TravelAgency',
140
+			'VeterinaryCare' => 'VeterinaryCare',
141
+			'WholesaleStore' => 'WholesaleStore',
142
+			'Winery' => 'Winery'
143
+		)),
144
+		array('name' => __('Schema Type', 'geodirectory'), 'desc' => __('Select the Schema to use for this category', 'geodirectory') . "", 'std' => array('selectkey2')));
145
+
146
+	/*$my_meta->addSelect($prefix.'cat_sort',array(''=>__('Default' , 'geodirectory'),
147 147
     'random'=>__('Random','geodirectory'),
148 148
     'az'=>__('Alphabetical' , 'geodirectory'),
149 149
     'newest'=>__('Newest','geodirectory'),
@@ -154,8 +154,8 @@  discard block
 block discarded – undo
154 154
     'low_review'=>__('Lowest Reviews','geodirectory')),
155 155
     array('name'=> __('Sort By','geodirectory'),'desc' => __('Select the default sort option.' ,'geodirectory'), 'std'=> array('selectkey2')));*/
156 156
 
157
-    // Show options for placecategories only
158
-    /*	if(isset($_REQUEST['taxonomy']) && in_array($_REQUEST['taxonomy'],$config['pages']) ){
157
+	// Show options for placecategories only
158
+	/*	if(isset($_REQUEST['taxonomy']) && in_array($_REQUEST['taxonomy'],$config['pages']) ){
159 159
         // Exclude sort options
160 160
         $my_meta->addCheckbox($prefix.'cat_exclude_rating',array('name'=> __('<b>Exclude</b> Rating sort option','geodirectory')));
161 161
         $my_meta->addCheckbox($prefix.'cat_exclude_reviews',array('name'=> __('<b>Exclude</b> Reviews sort option','geodirectory')));
@@ -167,8 +167,8 @@  discard block
 block discarded – undo
167 167
 
168 168
         }*/
169 169
 
170
-    //Finish Meta Box Decleration
171
-    $my_meta->Finish();
170
+	//Finish Meta Box Decleration
171
+	$my_meta->Finish();
172 172
 }
173 173
 
174 174
 
@@ -177,86 +177,86 @@  discard block
 block discarded – undo
177 177
 ##############################################################
178 178
 $gd_taxonomies = geodir_get_taxonomies();
179 179
 if (!empty($gd_taxonomies)) {
180
-    foreach ($gd_taxonomies as $gd_taxonomy) {
180
+	foreach ($gd_taxonomies as $gd_taxonomy) {
181 181
 
182
-        add_filter('manage_edit-' . $gd_taxonomy . '_columns', 'addCat_column', 10, 2);
183
-        add_action('manage_' . $gd_taxonomy . '_custom_column', 'manage_category_custom_fields', 10, 3);
182
+		add_filter('manage_edit-' . $gd_taxonomy . '_columns', 'addCat_column', 10, 2);
183
+		add_action('manage_' . $gd_taxonomy . '_custom_column', 'manage_category_custom_fields', 10, 3);
184 184
 
185
-    }
185
+	}
186 186
 }
187 187
 
188 188
 function addCat_column($columns)
189 189
 {
190
-    // only edit the columns on the current taxonomy
191
-    /*if ( !isset($_GET['taxonomy']) && !in_array($_GET['taxonomy'],geodir_get_taxonomies()) )
190
+	// only edit the columns on the current taxonomy
191
+	/*if ( !isset($_GET['taxonomy']) && !in_array($_GET['taxonomy'],geodir_get_taxonomies()) )
192 192
     return $columns;
193 193
     */
194
-    if ($posts = $columns['description']) {
195
-        unset($columns['description']);
196
-    }
197
-
198
-    $columns['cat_icon'] = 'Icon';
199
-    $columns['cat_default_img'] = __('Default Image', 'geodirectory');
200
-    $columns['cat_ID_num'] = __('Cat ID', 'geodirectory');
201
-    return $columns;
194
+	if ($posts = $columns['description']) {
195
+		unset($columns['description']);
196
+	}
197
+
198
+	$columns['cat_icon'] = 'Icon';
199
+	$columns['cat_default_img'] = __('Default Image', 'geodirectory');
200
+	$columns['cat_ID_num'] = __('Cat ID', 'geodirectory');
201
+	return $columns;
202 202
 }
203 203
 
204 204
 #############################################################
205 205
 function manage_category_custom_fields($deprecated, $column_name, $term_id)
206 206
 {
207
-    if ($column_name == 'cat_ID_num')
208
-        echo $term_id;
207
+	if ($column_name == 'cat_ID_num')
208
+		echo $term_id;
209 209
 
210
-    if ($column_name == 'cat_icon') {
211
-        $term_icon_url = get_tax_meta($term_id, 'ct_cat_icon');
210
+	if ($column_name == 'cat_icon') {
211
+		$term_icon_url = get_tax_meta($term_id, 'ct_cat_icon');
212 212
 
213
-        if ($term_icon_url != '') {
213
+		if ($term_icon_url != '') {
214 214
 
215
-            $file_info = pathinfo($term_icon_url['src']);
215
+			$file_info = pathinfo($term_icon_url['src']);
216 216
 
217
-            if (isset($file_info['dirname'] ) && $file_info['dirname'] != '.' && $file_info['dirname'] != '..')
218
-                $sub_dir = $file_info['dirname'];
219
-            else{$sub_dir = '';}
217
+			if (isset($file_info['dirname'] ) && $file_info['dirname'] != '.' && $file_info['dirname'] != '..')
218
+				$sub_dir = $file_info['dirname'];
219
+			else{$sub_dir = '';}
220 220
 
221
-            $uploads = wp_upload_dir(trim($sub_dir, '/')); // Array of key => value pairs
222
-            $uploads_baseurl = $uploads['baseurl'];
223
-            $uploads_path = $uploads['path'];
221
+			$uploads = wp_upload_dir(trim($sub_dir, '/')); // Array of key => value pairs
222
+			$uploads_baseurl = $uploads['baseurl'];
223
+			$uploads_path = $uploads['path'];
224 224
 
225
-            $file_name = $file_info['basename'];
225
+			$file_name = $file_info['basename'];
226 226
 
227
-            $sub_dir = str_replace($uploads_baseurl, '', $sub_dir);
227
+			$sub_dir = str_replace($uploads_baseurl, '', $sub_dir);
228 228
 
229
-            $uploads_url = $uploads_baseurl . $sub_dir;
229
+			$uploads_url = $uploads_baseurl . $sub_dir;
230 230
 
231
-            $term_icon_url['src'] = $uploads_url . '/' . $file_name;
232
-            echo '<img src="' . $term_icon_url['src'] . '" />';
231
+			$term_icon_url['src'] = $uploads_url . '/' . $file_name;
232
+			echo '<img src="' . $term_icon_url['src'] . '" />';
233 233
 
234
-        }
235
-    }
234
+		}
235
+	}
236 236
 
237
-    if ($column_name == 'cat_default_img') {
238
-        $cat_default_img = get_tax_meta($term_id, 'ct_cat_default_img');
239
-        if ($cat_default_img != '')
240
-            echo '<img src="' . $cat_default_img['src'] . '" style="max-height:60px;max-width:60px;"/>';
237
+	if ($column_name == 'cat_default_img') {
238
+		$cat_default_img = get_tax_meta($term_id, 'ct_cat_default_img');
239
+		if ($cat_default_img != '')
240
+			echo '<img src="' . $cat_default_img['src'] . '" style="max-height:60px;max-width:60px;"/>';
241 241
 
242
-    }
242
+	}
243 243
 }
244 244
 
245 245
 function geodir_get_default_catimage($term_id, $post_type = 'gd_place')
246 246
 {
247 247
 
248
-    if ($cat_default_img = get_tax_meta($term_id, 'ct_cat_default_img', '', $post_type))
249
-        return $cat_default_img;
250
-    else
251
-        return false;
248
+	if ($cat_default_img = get_tax_meta($term_id, 'ct_cat_default_img', '', $post_type))
249
+		return $cat_default_img;
250
+	else
251
+		return false;
252 252
 }
253 253
 
254 254
 //Clear custom fields
255 255
 add_action('in_admin_footer', 'geodir_tax_meta_clear_custom_field');
256 256
 function geodir_tax_meta_clear_custom_field()
257 257
 {
258
-    if (isset($_REQUEST['taxonomy']) && !empty($_REQUEST['taxonomy'])):
259
-        ?>
258
+	if (isset($_REQUEST['taxonomy']) && !empty($_REQUEST['taxonomy'])):
259
+		?>
260 260
         <script type="text/javascript">
261 261
             jQuery(document).ready(function () {
262 262
                 jQuery('#addtag #submit').click(function () {
@@ -277,5 +277,5 @@  discard block
 block discarded – undo
277 277
             });
278 278
         </script>
279 279
     <?php
280
-    endif;
280
+	endif;
281 281
 }
Please login to merge, or discard this patch.
geodirectory-functions/comments_functions.php 1 patch
Indentation   +419 added lines, -419 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Comment related functions.
4
- *
5
- * @since 1.0.0
6
- * @package GeoDirectory
7
- */
3
+	 * Comment related functions.
4
+	 *
5
+	 * @since 1.0.0
6
+	 * @package GeoDirectory
7
+	 */
8 8
 
9 9
 add_filter('comment_row_actions', 'geodir_comment_meta_row_action', 11, 1);
10 10
 /**
@@ -31,14 +31,14 @@  discard block
 block discarded – undo
31 31
  */
32 32
 function geodir_comment_meta_row_action($a)
33 33
 {
34
-    global $comment;
35
-
36
-    $rating = geodir_get_commentoverall($comment->comment_ID);
37
-    if ($rating != 0) {
38
-        //echo '<div class="gd_rating_show" data-average="'.$rating.'" data-id="'.$comment->comment_ID.'"></div>';
39
-        echo geodir_get_rating_stars($rating, $comment->comment_ID);
40
-    }
41
-    return $a;
34
+	global $comment;
35
+
36
+	$rating = geodir_get_commentoverall($comment->comment_ID);
37
+	if ($rating != 0) {
38
+		//echo '<div class="gd_rating_show" data-average="'.$rating.'" data-id="'.$comment->comment_ID.'"></div>';
39
+		echo geodir_get_rating_stars($rating, $comment->comment_ID);
40
+	}
41
+	return $a;
42 42
 }
43 43
 
44 44
 add_action('add_meta_boxes_comment', 'geodir_comment_add_meta_box');
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
  */
54 54
 function geodir_comment_add_meta_box($comment)
55 55
 {
56
-    add_meta_box('gd-comment-rating', __('Comment Rating', 'geodirectory'), 'geodir_comment_rating_meta', 'comment', 'normal', 'high');
56
+	add_meta_box('gd-comment-rating', __('Comment Rating', 'geodirectory'), 'geodir_comment_rating_meta', 'comment', 'normal', 'high');
57 57
 }
58 58
 
59 59
 /**
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
  */
68 68
 function geodir_comment_rating_meta($comment)
69 69
 {
70
-    $post_type = get_post_type($comment->comment_post_ID);
70
+	$post_type = get_post_type($comment->comment_post_ID);
71 71
 	if (in_array($post_type, (array)geodir_get_posttypes()) && (int)$comment->comment_parent == 0) {
72 72
 		$rating = geodir_get_commentoverall($comment->comment_ID);
73 73
 		
@@ -107,12 +107,12 @@  discard block
 block discarded – undo
107 107
  */
108 108
 function geodir_comment_rating_fields()
109 109
 {
110
-    global $post;
110
+	global $post;
111 111
 
112
-    $post_types = geodir_get_posttypes();
112
+	$post_types = geodir_get_posttypes();
113 113
 
114
-    if (in_array($post->post_type, $post_types)) {
115
-        $star_texts = array();
114
+	if (in_array($post->post_type, $post_types)) {
115
+		$star_texts = array();
116 116
 		$star_texts[] = __('Terrible', 'geodirectory');
117 117
 		$star_texts[] = __('Poor', 'geodirectory');
118 118
 		$star_texts[] = __('Average', 'geodirectory');
@@ -120,10 +120,10 @@  discard block
 block discarded – undo
120 120
 		$star_texts[] = __('Excellent', 'geodirectory');
121 121
 		
122 122
 		$gd_rating_html = apply_filters('gd_rating_form_html', '<div class="gd_rating" data-average="0" data-id="5"></div>', $star_texts);
123
-        echo $gd_rating_html;
124
-        ?>
123
+		echo $gd_rating_html;
124
+		?>
125 125
         <input type="hidden" id="geodir_overallrating" name="geodir_overallrating" value="0"/><?php
126
-    }
126
+	}
127 127
 }
128 128
 
129 129
 
@@ -139,9 +139,9 @@  discard block
 block discarded – undo
139 139
 function geodir_comment_replaylink($link)
140 140
 {
141 141
 
142
-    $link = '<div class="gd_comment_replaylink">' . $link . '</div>';
142
+	$link = '<div class="gd_comment_replaylink">' . $link . '</div>';
143 143
 
144
-    return $link;
144
+	return $link;
145 145
 }
146 146
 
147 147
 add_filter('cancel_comment_reply_link', 'geodir_cancle_replaylink');
@@ -156,9 +156,9 @@  discard block
 block discarded – undo
156 156
 function geodir_cancle_replaylink($link)
157 157
 {
158 158
 
159
-    $link = '<span class="gd-cancel-replaylink">' . $link . '</span>';
159
+	$link = '<span class="gd-cancel-replaylink">' . $link . '</span>';
160 160
 
161
-    return $link;
161
+	return $link;
162 162
 }
163 163
 
164 164
 add_action('comment_post', 'geodir_save_rating');
@@ -174,29 +174,29 @@  discard block
 block discarded – undo
174 174
  */
175 175
 function geodir_save_rating($comment = 0)
176 176
 {
177
-    global $wpdb, $user_ID, $plugin_prefix;
177
+	global $wpdb, $user_ID, $plugin_prefix;
178 178
 
179
-    $comment_info = get_comment($comment);
179
+	$comment_info = get_comment($comment);
180 180
 
181
-    $post_id = $comment_info->comment_post_ID;
182
-    $status = $comment_info->comment_approved;
183
-    $rating_ip = getenv("REMOTE_ADDR");
181
+	$post_id = $comment_info->comment_post_ID;
182
+	$status = $comment_info->comment_approved;
183
+	$rating_ip = getenv("REMOTE_ADDR");
184 184
 	
185
-    $post = geodir_get_post_info($post_id);
185
+	$post = geodir_get_post_info($post_id);
186 186
 
187
-    if ($post->post_status == 'publish') {
188
-        $post_status = '1';
189
-    } else {
190
-        $post_status = '0';
191
-    }
187
+	if ($post->post_status == 'publish') {
188
+		$post_status = '1';
189
+	} else {
190
+		$post_status = '0';
191
+	}
192 192
 	
193
-    if (isset($_REQUEST['geodir_overallrating'])) {
194
-        $overall_rating = $_REQUEST['geodir_overallrating'];
193
+	if (isset($_REQUEST['geodir_overallrating'])) {
194
+		$overall_rating = $_REQUEST['geodir_overallrating'];
195 195
         
196 196
 		if (isset($comment_info->comment_parent) && (int)$comment_info->comment_parent == 0) {
197
-            $overall_rating = $overall_rating > 0 ? $overall_rating : '0';
197
+			$overall_rating = $overall_rating > 0 ? $overall_rating : '0';
198 198
 
199
-            $sqlqry = $wpdb->prepare("INSERT INTO " . GEODIR_REVIEW_TABLE . " SET
199
+			$sqlqry = $wpdb->prepare("INSERT INTO " . GEODIR_REVIEW_TABLE . " SET
200 200
 					post_id		= %d,
201 201
 					post_type = %s,
202 202
 					post_title	= %s,
@@ -214,35 +214,35 @@  discard block
 block discarded – undo
214 214
 					post_latitude	= %s,
215 215
 					comment_content	= %s 
216 216
 					",
217
-                array($post_id, $post->post_type, $post->post_title, $user_ID, $comment, $rating_ip, $overall_rating, $status, $post_status, date_i18n('Y-m-d H:i:s', current_time('timestamp')), $post->post_city, $post->post_region, $post->post_country, $post->post_latitude, $post->post_longitude, $comment_info->comment_content)
218
-            );
219
-
220
-            $wpdb->query($sqlqry);
221
-
222
-            /**
223
-             * Called after saving the comment.
224
-             *
225
-             * @since 1.0.0
226
-             * @package GeoDirectory
227
-             * @param array $_REQUEST {
228
-             *    Attributes of the $_REQUEST variable.
229
-             *
230
-             *    @type string $geodir_overallrating Overall rating.
231
-             *    @type string $comment Comment text.
232
-             *    @type string $submit Submit button text.
233
-             *    @type string $comment_post_ID Comment post ID.
234
-             *    @type string $comment_parent Comment Parent ID.
235
-             *    @type string $_wp_unfiltered_html_comment Unfiltered html comment string.
236
-             *
237
-             * }
238
-             */
239
-            do_action('geodir_after_save_comment', $_REQUEST, 'Comment Your Post');
240
-
241
-            if ($status) {
242
-                geodir_update_postrating($post_id);
243
-            }
244
-        }
245
-    }
217
+				array($post_id, $post->post_type, $post->post_title, $user_ID, $comment, $rating_ip, $overall_rating, $status, $post_status, date_i18n('Y-m-d H:i:s', current_time('timestamp')), $post->post_city, $post->post_region, $post->post_country, $post->post_latitude, $post->post_longitude, $comment_info->comment_content)
218
+			);
219
+
220
+			$wpdb->query($sqlqry);
221
+
222
+			/**
223
+			 * Called after saving the comment.
224
+			 *
225
+			 * @since 1.0.0
226
+			 * @package GeoDirectory
227
+			 * @param array $_REQUEST {
228
+			 *    Attributes of the $_REQUEST variable.
229
+			 *
230
+			 *    @type string $geodir_overallrating Overall rating.
231
+			 *    @type string $comment Comment text.
232
+			 *    @type string $submit Submit button text.
233
+			 *    @type string $comment_post_ID Comment post ID.
234
+			 *    @type string $comment_parent Comment Parent ID.
235
+			 *    @type string $_wp_unfiltered_html_comment Unfiltered html comment string.
236
+			 *
237
+			 * }
238
+			 */
239
+			do_action('geodir_after_save_comment', $_REQUEST, 'Comment Your Post');
240
+
241
+			if ($status) {
242
+				geodir_update_postrating($post_id);
243
+			}
244
+		}
245
+	}
246 246
 }
247 247
 
248 248
 
@@ -261,48 +261,48 @@  discard block
 block discarded – undo
261 261
 function geodir_update_rating_status_change($comment_id, $status)
262 262
 {
263 263
 
264
-    global $wpdb, $plugin_prefix, $user_ID;
264
+	global $wpdb, $plugin_prefix, $user_ID;
265 265
 
266
-    $comment_info = get_comment($comment_id);
266
+	$comment_info = get_comment($comment_id);
267 267
 
268
-    $post_id = isset($comment_info->comment_post_ID) ? $comment_info->comment_post_ID : '';
268
+	$post_id = isset($comment_info->comment_post_ID) ? $comment_info->comment_post_ID : '';
269 269
 
270
-    if (!empty($comment_info))
271
-        $status = $comment_info->comment_approved;
270
+	if (!empty($comment_info))
271
+		$status = $comment_info->comment_approved;
272 272
 
273
-    if ($status == 'approve' || $status == 1) {
274
-        $status = 1;
275
-    } else {
276
-        $status = 0;
277
-    }
273
+	if ($status == 'approve' || $status == 1) {
274
+		$status = 1;
275
+	} else {
276
+		$status = 0;
277
+	}
278 278
 
279
-    $comment_info_ID = isset($comment_info->comment_ID) ? $comment_info->comment_ID : '';
280
-    $old_rating = geodir_get_commentoverall($comment_info_ID);
279
+	$comment_info_ID = isset($comment_info->comment_ID) ? $comment_info->comment_ID : '';
280
+	$old_rating = geodir_get_commentoverall($comment_info_ID);
281 281
 
282
-    $post_type = get_post_type($post_id);
282
+	$post_type = get_post_type($post_id);
283 283
 
284
-    $detail_table = $plugin_prefix . $post_type . '_detail';
284
+	$detail_table = $plugin_prefix . $post_type . '_detail';
285 285
 
286
-    if ($comment_id) {
286
+	if ($comment_id) {
287 287
 
288
-        $overall_rating = $old_rating;
288
+		$overall_rating = $old_rating;
289 289
 
290
-        if (isset($old_rating)) {
290
+		if (isset($old_rating)) {
291 291
 
292
-            $sqlqry = $wpdb->prepare("UPDATE " . GEODIR_REVIEW_TABLE . " SET
292
+			$sqlqry = $wpdb->prepare("UPDATE " . GEODIR_REVIEW_TABLE . " SET
293 293
 						overall_rating = %f,
294 294
 						status		= %s,
295 295
 						comment_content = %s 
296 296
 						WHERE comment_id = %d ", array($overall_rating, $status, $comment_info->comment_content, $comment_id));
297 297
 
298
-            $wpdb->query($sqlqry);
298
+			$wpdb->query($sqlqry);
299 299
 
300
-            //update rating
301
-            geodir_update_postrating($post_id, $post_type);
300
+			//update rating
301
+			geodir_update_postrating($post_id, $post_type);
302 302
 
303
-        }
303
+		}
304 304
 
305
-    }
305
+	}
306 306
 
307 307
 }
308 308
 
@@ -321,41 +321,41 @@  discard block
 block discarded – undo
321 321
 function geodir_update_rating($comment_id = 0)
322 322
 {
323 323
 
324
-    global $wpdb, $plugin_prefix, $user_ID;
324
+	global $wpdb, $plugin_prefix, $user_ID;
325 325
 
326
-    $comment_info = get_comment($comment_id);
326
+	$comment_info = get_comment($comment_id);
327 327
 
328
-    $post_id = $comment_info->comment_post_ID;
329
-    $status = $comment_info->comment_approved;
330
-    $old_rating = geodir_get_commentoverall($comment_info->comment_ID);
328
+	$post_id = $comment_info->comment_post_ID;
329
+	$status = $comment_info->comment_approved;
330
+	$old_rating = geodir_get_commentoverall($comment_info->comment_ID);
331 331
 
332
-    $post_type = get_post_type($post_id);
332
+	$post_type = get_post_type($post_id);
333 333
 
334
-    $detail_table = $plugin_prefix . $post_type . '_detail';
334
+	$detail_table = $plugin_prefix . $post_type . '_detail';
335 335
 
336
-    if (isset($_REQUEST['geodir_overallrating'])) {
336
+	if (isset($_REQUEST['geodir_overallrating'])) {
337 337
 
338
-        $overall_rating = $_REQUEST['geodir_overallrating'];
338
+		$overall_rating = $_REQUEST['geodir_overallrating'];
339 339
 
340
-        if (isset($comment_info->comment_parent) && (int)$comment_info->comment_parent == 0) {
341
-            $overall_rating = $overall_rating > 0 ? $overall_rating : '0';
340
+		if (isset($comment_info->comment_parent) && (int)$comment_info->comment_parent == 0) {
341
+			$overall_rating = $overall_rating > 0 ? $overall_rating : '0';
342 342
 
343
-            if (isset($old_rating)) {
343
+			if (isset($old_rating)) {
344 344
 
345
-                $sqlqry = $wpdb->prepare("UPDATE " . GEODIR_REVIEW_TABLE . " SET
345
+				$sqlqry = $wpdb->prepare("UPDATE " . GEODIR_REVIEW_TABLE . " SET
346 346
 						overall_rating = %f,
347 347
 						status		= %s,
348 348
 						comment_content	= %s 
349 349
 						WHERE comment_id = %d ", array($overall_rating, $status, $comment_info->comment_content, $comment_id));
350 350
 
351
-                $wpdb->query($sqlqry);
351
+				$wpdb->query($sqlqry);
352 352
 
353
-                //update rating
354
-                geodir_update_postrating($post_id, $post_type);
353
+				//update rating
354
+				geodir_update_postrating($post_id, $post_type);
355 355
 
356
-            }
357
-        }
358
-    }
356
+			}
357
+		}
358
+	}
359 359
 
360 360
 
361 361
 }
@@ -371,19 +371,19 @@  discard block
 block discarded – undo
371 371
  */
372 372
 function geodir_comment_delete_comment($comment_id)
373 373
 {
374
-    global $wpdb;
374
+	global $wpdb;
375 375
 
376
-    $review_info = geodir_get_review($comment_id);
377
-    if ($review_info) {
378
-        geodir_update_postrating($review_info->post_id);
379
-    }
376
+	$review_info = geodir_get_review($comment_id);
377
+	if ($review_info) {
378
+		geodir_update_postrating($review_info->post_id);
379
+	}
380 380
 
381
-    $wpdb->query(
382
-        $wpdb->prepare(
383
-            "DELETE FROM " . GEODIR_REVIEW_TABLE . " WHERE comment_id=%d",
384
-            array($comment_id)
385
-        )
386
-    );
381
+	$wpdb->query(
382
+		$wpdb->prepare(
383
+			"DELETE FROM " . GEODIR_REVIEW_TABLE . " WHERE comment_id=%d",
384
+			array($comment_id)
385
+		)
386
+	);
387 387
 
388 388
 }
389 389
 
@@ -399,13 +399,13 @@  discard block
 block discarded – undo
399 399
  */
400 400
 function geodir_wrap_comment_text($content, $comment = '')
401 401
 {
402
-    $rating = 0;
403
-    if (!empty($comment))
404
-        $rating = geodir_get_commentoverall($comment->comment_ID);
405
-    if ($rating != 0 && !is_admin()) {
406
-        return '<div><div class="gd-rating-text">' . __('Overall Rating', 'geodirectory') . ': <div class="rating">' . $rating . '</div></div>' . geodir_get_rating_stars($rating, $comment->comment_ID) . '</div><div class="description">' . $content . '</div>';
407
-    } else
408
-        return $content;
402
+	$rating = 0;
403
+	if (!empty($comment))
404
+		$rating = geodir_get_commentoverall($comment->comment_ID);
405
+	if ($rating != 0 && !is_admin()) {
406
+		return '<div><div class="gd-rating-text">' . __('Overall Rating', 'geodirectory') . ': <div class="rating">' . $rating . '</div></div>' . geodir_get_rating_stars($rating, $comment->comment_ID) . '</div><div class="description">' . $content . '</div>';
407
+	} else
408
+		return $content;
409 409
 
410 410
 }
411 411
 
@@ -423,41 +423,41 @@  discard block
 block discarded – undo
423 423
  */
424 424
 function geodir_update_postrating($post_id = 0, $post_type = '', $delete = false)
425 425
 {
426
-    global $wpdb, $plugin_prefix, $comment;
427
-    if (!$post_type) {
428
-        $post_type = get_post_type($post_id);
429
-    }
430
-    $detail_table = $plugin_prefix . $post_type . '_detail';
431
-    $post_newrating = geodir_get_post_rating($post_id, 1);
432
-    $post_newrating_count = geodir_get_review_count_total($post_id);
426
+	global $wpdb, $plugin_prefix, $comment;
427
+	if (!$post_type) {
428
+		$post_type = get_post_type($post_id);
429
+	}
430
+	$detail_table = $plugin_prefix . $post_type . '_detail';
431
+	$post_newrating = geodir_get_post_rating($post_id, 1);
432
+	$post_newrating_count = geodir_get_review_count_total($post_id);
433 433
 
434 434
 
435
-    //$post_newrating = ( (float)$post_oldrating - (float)$old_rating ) + (float)$overall_rating ;
435
+	//$post_newrating = ( (float)$post_oldrating - (float)$old_rating ) + (float)$overall_rating ;
436 436
 
437
-    if ($wpdb->get_var("SHOW TABLES LIKE '" . $detail_table . "'") == $detail_table) {
437
+	if ($wpdb->get_var("SHOW TABLES LIKE '" . $detail_table . "'") == $detail_table) {
438 438
 
439
-        $wpdb->query(
440
-            $wpdb->prepare(
441
-                "UPDATE " . $detail_table . " SET
439
+		$wpdb->query(
440
+			$wpdb->prepare(
441
+				"UPDATE " . $detail_table . " SET
442 442
 						overall_rating = %f,
443 443
 						rating_count = %f
444 444
 						where post_id = %d",
445
-                array($post_newrating, $post_newrating_count, $post_id)
446
-            )
447
-        );
448
-
449
-        update_post_meta($post_id, 'overall_rating', $post_newrating);
450
-        update_post_meta($post_id, 'rating_count', $post_newrating_count);
451
-    }
452
-    /**
453
-     * Called after Updating post overall rating and rating count.
454
-     *
455
-     * @since 1.0.0
456
-     * @since 1.4.3 Added `$post_id` param.
457
-     * @package GeoDirectory
458
-     * @param int $post_id The post ID.
459
-     */
460
-    do_action('geodir_update_postrating',$post_id);
445
+				array($post_newrating, $post_newrating_count, $post_id)
446
+			)
447
+		);
448
+
449
+		update_post_meta($post_id, 'overall_rating', $post_newrating);
450
+		update_post_meta($post_id, 'rating_count', $post_newrating_count);
451
+	}
452
+	/**
453
+	 * Called after Updating post overall rating and rating count.
454
+	 *
455
+	 * @since 1.0.0
456
+	 * @since 1.4.3 Added `$post_id` param.
457
+	 * @package GeoDirectory
458
+	 * @param int $post_id The post ID.
459
+	 */
460
+	do_action('geodir_update_postrating',$post_id);
461 461
 
462 462
 }
463 463
 
@@ -475,29 +475,29 @@  discard block
 block discarded – undo
475 475
  */
476 476
 function geodir_get_postoverall($post_id = 0)
477 477
 {
478
-    global $wpdb, $plugin_prefix;
478
+	global $wpdb, $plugin_prefix;
479 479
 
480
-    $post_type = get_post_type($post_id);
481
-    $detail_table = $plugin_prefix . $post_type . '_detail';
480
+	$post_type = get_post_type($post_id);
481
+	$detail_table = $plugin_prefix . $post_type . '_detail';
482 482
 
483
-    if ($wpdb->get_var("SHOW TABLES LIKE '" . $detail_table . "'") == $detail_table) {
483
+	if ($wpdb->get_var("SHOW TABLES LIKE '" . $detail_table . "'") == $detail_table) {
484 484
 
485
-        $post_ratings = $wpdb->get_var(
486
-            $wpdb->prepare(
487
-                "SELECT overall_rating FROM " . $detail_table . " WHERE post_id = %d",
488
-                array($post_id)
489
-            )
490
-        );
485
+		$post_ratings = $wpdb->get_var(
486
+			$wpdb->prepare(
487
+				"SELECT overall_rating FROM " . $detail_table . " WHERE post_id = %d",
488
+				array($post_id)
489
+			)
490
+		);
491 491
 
492 492
 
493
-    } else {
494
-        $post_ratings = get_post_meta($post_id, 'overall_rating');
495
-    }
493
+	} else {
494
+		$post_ratings = get_post_meta($post_id, 'overall_rating');
495
+	}
496 496
 
497
-    if ($post_ratings)
498
-        return $post_ratings;
499
-    else
500
-        return false;
497
+	if ($post_ratings)
498
+		return $post_ratings;
499
+	else
500
+		return false;
501 501
 }
502 502
 
503 503
 
@@ -514,19 +514,19 @@  discard block
 block discarded – undo
514 514
  */
515 515
 function geodir_get_review($comment_id = 0)
516 516
 {
517
-    global $wpdb;
518
-
519
-    $reatings = $wpdb->get_row(
520
-        $wpdb->prepare(
521
-            "SELECT * FROM " . GEODIR_REVIEW_TABLE . " WHERE comment_id = %d",
522
-            array($comment_id)
523
-        )
524
-    );
525
-
526
-    if (!empty($reatings))
527
-        return $reatings;
528
-    else
529
-        return false;
517
+	global $wpdb;
518
+
519
+	$reatings = $wpdb->get_row(
520
+		$wpdb->prepare(
521
+			"SELECT * FROM " . GEODIR_REVIEW_TABLE . " WHERE comment_id = %d",
522
+			array($comment_id)
523
+		)
524
+	);
525
+
526
+	if (!empty($reatings))
527
+		return $reatings;
528
+	else
529
+		return false;
530 530
 }
531 531
 
532 532
 /**
@@ -542,19 +542,19 @@  discard block
 block discarded – undo
542 542
  */
543 543
 function geodir_get_review_total($post_id = 0)
544 544
 {
545
-    global $wpdb;
546
-
547
-    $results = $wpdb->get_var(
548
-        $wpdb->prepare(
549
-            "SELECT SUM(overall_rating) FROM " . GEODIR_REVIEW_TABLE . " WHERE post_id = %d AND status=1 AND overall_rating>0",
550
-            array($post_id)
551
-        )
552
-    );
553
-
554
-    if (!empty($results))
555
-        return $results;
556
-    else
557
-        return false;
545
+	global $wpdb;
546
+
547
+	$results = $wpdb->get_var(
548
+		$wpdb->prepare(
549
+			"SELECT SUM(overall_rating) FROM " . GEODIR_REVIEW_TABLE . " WHERE post_id = %d AND status=1 AND overall_rating>0",
550
+			array($post_id)
551
+		)
552
+	);
553
+
554
+	if (!empty($results))
555
+		return $results;
556
+	else
557
+		return false;
558 558
 }
559 559
 
560 560
 /**
@@ -570,18 +570,18 @@  discard block
 block discarded – undo
570 570
  */
571 571
 function geodir_get_review_count_by_user_id($user_id = 0)
572 572
 {
573
-    global $wpdb;
574
-    $results = $wpdb->get_var(
575
-        $wpdb->prepare(
576
-            "SELECT COUNT(overall_rating) FROM " . GEODIR_REVIEW_TABLE . " WHERE user_id = %d AND status=1 AND overall_rating>0",
577
-            array($user_id)
578
-        )
579
-    );
580
-
581
-    if (!empty($results))
582
-        return $results;
583
-    else
584
-        return false;
573
+	global $wpdb;
574
+	$results = $wpdb->get_var(
575
+		$wpdb->prepare(
576
+			"SELECT COUNT(overall_rating) FROM " . GEODIR_REVIEW_TABLE . " WHERE user_id = %d AND status=1 AND overall_rating>0",
577
+			array($user_id)
578
+		)
579
+	);
580
+
581
+	if (!empty($results))
582
+		return $results;
583
+	else
584
+		return false;
585 585
 }
586 586
 
587 587
 /**
@@ -599,27 +599,27 @@  discard block
 block discarded – undo
599 599
  */
600 600
 function geodir_get_post_rating($post_id = 0, $force_query = 0)
601 601
 {
602
-    global $wpdb, $post;
603
-
604
-    if (isset($post->ID) && $post->ID == $post_id && !$force_query) {
605
-        if (isset($post->rating_count) && $post->rating_count > 0 && isset($post->overall_rating) && $post->overall_rating > 0) {
606
-            return $post->overall_rating;
607
-        } else {
608
-            return 0;
609
-        }
610
-    }
611
-
612
-    $results = $wpdb->get_var(
613
-        $wpdb->prepare(
614
-            "SELECT COALESCE(avg(overall_rating),0) FROM " . GEODIR_REVIEW_TABLE . " WHERE post_id = %d AND status=1 AND overall_rating>0",
615
-            array($post_id)
616
-        )
617
-    );
618
-
619
-    if (!empty($results))
620
-        return $results;
621
-    else
622
-        return false;
602
+	global $wpdb, $post;
603
+
604
+	if (isset($post->ID) && $post->ID == $post_id && !$force_query) {
605
+		if (isset($post->rating_count) && $post->rating_count > 0 && isset($post->overall_rating) && $post->overall_rating > 0) {
606
+			return $post->overall_rating;
607
+		} else {
608
+			return 0;
609
+		}
610
+	}
611
+
612
+	$results = $wpdb->get_var(
613
+		$wpdb->prepare(
614
+			"SELECT COALESCE(avg(overall_rating),0) FROM " . GEODIR_REVIEW_TABLE . " WHERE post_id = %d AND status=1 AND overall_rating>0",
615
+			array($post_id)
616
+		)
617
+	);
618
+
619
+	if (!empty($results))
620
+		return $results;
621
+	else
622
+		return false;
623 623
 }
624 624
 
625 625
 /**
@@ -635,19 +635,19 @@  discard block
 block discarded – undo
635 635
  */
636 636
 function geodir_get_review_count_total($post_id = 0)
637 637
 {
638
-    global $wpdb;
639
-
640
-    $results = $wpdb->get_var(
641
-        $wpdb->prepare(
642
-            "SELECT COUNT(overall_rating) FROM " . GEODIR_REVIEW_TABLE . " WHERE post_id = %d AND status=1 AND overall_rating>0",
643
-            array($post_id)
644
-        )
645
-    );
646
-
647
-    if (!empty($results))
648
-        return $results;
649
-    else
650
-        return false;
638
+	global $wpdb;
639
+
640
+	$results = $wpdb->get_var(
641
+		$wpdb->prepare(
642
+			"SELECT COUNT(overall_rating) FROM " . GEODIR_REVIEW_TABLE . " WHERE post_id = %d AND status=1 AND overall_rating>0",
643
+			array($post_id)
644
+		)
645
+	);
646
+
647
+	if (!empty($results))
648
+		return $results;
649
+	else
650
+		return false;
651 651
 }
652 652
 
653 653
 /**
@@ -664,20 +664,20 @@  discard block
 block discarded – undo
664 664
  */
665 665
 function geodir_get_comments_number($post_id = 0)
666 666
 {
667
-    global $wpdb;
667
+	global $wpdb;
668 668
 
669
-    $results = $wpdb->get_var(
670
-        $wpdb->prepare(
671
-            "SELECT COUNT(overall_rating) FROM " . GEODIR_REVIEW_TABLE . " WHERE post_id = %d AND status=1 AND overall_rating>0",
672
-            array($post_id)
673
-        )
674
-    );
669
+	$results = $wpdb->get_var(
670
+		$wpdb->prepare(
671
+			"SELECT COUNT(overall_rating) FROM " . GEODIR_REVIEW_TABLE . " WHERE post_id = %d AND status=1 AND overall_rating>0",
672
+			array($post_id)
673
+		)
674
+	);
675 675
 
676 676
 
677
-    if (!empty($results))
678
-        return $results;
679
-    else
680
-        return false;
677
+	if (!empty($results))
678
+		return $results;
679
+	else
680
+		return false;
681 681
 }
682 682
 
683 683
 /**
@@ -693,19 +693,19 @@  discard block
 block discarded – undo
693 693
  */
694 694
 function geodir_get_commentoverall($comment_id = 0)
695 695
 {
696
-    global $wpdb;
697
-
698
-    $reatings = $wpdb->get_var(
699
-        $wpdb->prepare(
700
-            "SELECT overall_rating FROM " . GEODIR_REVIEW_TABLE . " WHERE comment_id = %d",
701
-            array($comment_id)
702
-        )
703
-    );
704
-
705
-    if ($reatings)
706
-        return $reatings;
707
-    else
708
-        return false;
696
+	global $wpdb;
697
+
698
+	$reatings = $wpdb->get_var(
699
+		$wpdb->prepare(
700
+			"SELECT overall_rating FROM " . GEODIR_REVIEW_TABLE . " WHERE comment_id = %d",
701
+			array($comment_id)
702
+		)
703
+	);
704
+
705
+	if ($reatings)
706
+		return $reatings;
707
+	else
708
+		return false;
709 709
 }
710 710
 
711 711
 /**
@@ -719,7 +719,7 @@  discard block
 block discarded – undo
719 719
  */
720 720
 function geodir_get_commentoverall_number($post_id = 0)
721 721
 {
722
-    return geodir_get_post_rating($post_id);
722
+	return geodir_get_post_rating($post_id);
723 723
 }
724 724
 
725 725
 
@@ -737,98 +737,98 @@  discard block
 block discarded – undo
737 737
  */
738 738
 function geodir_comment_template($comment_template)
739 739
 {
740
-    global $post;
741
-
742
-    $post_types = geodir_get_posttypes();
743
-
744
-    if (!(is_singular() && (have_comments() || (isset($post->comment_status) && 'open' == $post->comment_status)))) {
745
-        return;
746
-    }
747
-    if (in_array($post->post_type, $post_types)) { // assuming there is a post type called business
748
-        $template = locate_template(array("geodirectory/reviews.php")); // Use theme template if available
749
-        if (!$template) {
750
-            $template = dirname(__FILE__) . '/reviews.php';
751
-        }
752
-        return $template;
753
-    }
740
+	global $post;
741
+
742
+	$post_types = geodir_get_posttypes();
743
+
744
+	if (!(is_singular() && (have_comments() || (isset($post->comment_status) && 'open' == $post->comment_status)))) {
745
+		return;
746
+	}
747
+	if (in_array($post->post_type, $post_types)) { // assuming there is a post type called business
748
+		$template = locate_template(array("geodirectory/reviews.php")); // Use theme template if available
749
+		if (!$template) {
750
+			$template = dirname(__FILE__) . '/reviews.php';
751
+		}
752
+		return $template;
753
+	}
754 754
 }
755 755
 
756 756
 add_filter("comments_template", "geodir_comment_template");
757 757
 
758 758
 
759 759
 if (!function_exists('geodir_comment')) {
760
-    /**
761
-     * Comment HTML markup.
762
-     *
763
-     * @since 1.0.0
764
-     * @package GeoDirectory
765
-     * @global object $post The current post object.
766
-     * @param object $comment The comment object.
767
-     * @param string|array $args {
768
-     *     Optional. Formatting options.
769
-     *
770
-     *     @type object $walker            Instance of a Walker class to list comments. Default null.
771
-     *     @type int    $max_depth         The maximum comments depth. Default empty.
772
-     *     @type string $style             The style of list ordering. Default 'ul'. Accepts 'ul', 'ol'.
773
-     *     @type string $callback          Callback function to use. Default null.
774
-     *     @type string $end-callback      Callback function to use at the end. Default null.
775
-     *     @type string $type              Type of comments to list.
776
-     *                                     Default 'all'. Accepts 'all', 'comment', 'pingback', 'trackback', 'pings'.
777
-     *     @type int    $page              Page ID to list comments for. Default empty.
778
-     *     @type int    $per_page          Number of comments to list per page. Default empty.
779
-     *     @type int    $avatar_size       Height and width dimensions of the avatar size. Default 32.
780
-     *     @type string $reverse_top_level Ordering of the listed comments. Default null. Accepts 'desc', 'asc'.
781
-     *     @type bool   $reverse_children  Whether to reverse child comments in the list. Default null.
782
-     *     @type string $format            How to format the comments list.
783
-     *                                     Default 'html5' if the theme supports it. Accepts 'html5', 'xhtml'.
784
-     *     @type bool   $short_ping        Whether to output short pings. Default false.
785
-     *     @type bool   $echo              Whether to echo the output or return it. Default true.
786
-     * }
787
-     * @param int $depth Depth of comment.
788
-     */
789
-    function geodir_comment($comment, $args, $depth)
790
-    {
791
-        $GLOBALS['comment'] = $comment;
792
-        switch ($comment->comment_type) :
793
-            case 'pingback' :
794
-            case 'trackback' :
795
-                // Display trackbacks differently than normal comments.
796
-                ?>
760
+	/**
761
+	 * Comment HTML markup.
762
+	 *
763
+	 * @since 1.0.0
764
+	 * @package GeoDirectory
765
+	 * @global object $post The current post object.
766
+	 * @param object $comment The comment object.
767
+	 * @param string|array $args {
768
+	 *     Optional. Formatting options.
769
+	 *
770
+	 *     @type object $walker            Instance of a Walker class to list comments. Default null.
771
+	 *     @type int    $max_depth         The maximum comments depth. Default empty.
772
+	 *     @type string $style             The style of list ordering. Default 'ul'. Accepts 'ul', 'ol'.
773
+	 *     @type string $callback          Callback function to use. Default null.
774
+	 *     @type string $end-callback      Callback function to use at the end. Default null.
775
+	 *     @type string $type              Type of comments to list.
776
+	 *                                     Default 'all'. Accepts 'all', 'comment', 'pingback', 'trackback', 'pings'.
777
+	 *     @type int    $page              Page ID to list comments for. Default empty.
778
+	 *     @type int    $per_page          Number of comments to list per page. Default empty.
779
+	 *     @type int    $avatar_size       Height and width dimensions of the avatar size. Default 32.
780
+	 *     @type string $reverse_top_level Ordering of the listed comments. Default null. Accepts 'desc', 'asc'.
781
+	 *     @type bool   $reverse_children  Whether to reverse child comments in the list. Default null.
782
+	 *     @type string $format            How to format the comments list.
783
+	 *                                     Default 'html5' if the theme supports it. Accepts 'html5', 'xhtml'.
784
+	 *     @type bool   $short_ping        Whether to output short pings. Default false.
785
+	 *     @type bool   $echo              Whether to echo the output or return it. Default true.
786
+	 * }
787
+	 * @param int $depth Depth of comment.
788
+	 */
789
+	function geodir_comment($comment, $args, $depth)
790
+	{
791
+		$GLOBALS['comment'] = $comment;
792
+		switch ($comment->comment_type) :
793
+			case 'pingback' :
794
+			case 'trackback' :
795
+				// Display trackbacks differently than normal comments.
796
+				?>
797 797
                 <li <?php comment_class('geodir-comment'); ?> id="comment-<?php comment_ID(); ?>">
798 798
                 <p><?php _e('Pingback:', 'geodirectory'); ?> <?php comment_author_link(); ?> <?php edit_comment_link(__('(Edit)', 'geodirectory'), '<span class="edit-link">', '</span>'); ?></p>
799 799
                 <?php
800
-                break;
801
-            default :
802
-                // Proceed with normal comments.
803
-                global $post;
804
-                ?>
800
+				break;
801
+			default :
802
+				// Proceed with normal comments.
803
+				global $post;
804
+				?>
805 805
             <li <?php comment_class('geodir-comment'); ?> id="li-comment-<?php comment_ID(); ?>">
806 806
                 <article id="comment-<?php comment_ID(); ?>" class="comment hreview">
807 807
                     <header class="comment-meta comment-author vcard">
808 808
                         <?php
809
-                        /**
810
-                         * Filter to modify comment avatar size
811
-                         *
812
-                         * You can use this filter to change comment avatar size.
813
-                         *
814
-                         * @since 1.0.0
815
-                         * @package GeoDirectory
816
-                         */
817
-                        $avatar_size = apply_filters('geodir_comment_avatar_size', 44);
818
-                        echo get_avatar($comment, $avatar_size);
819
-                        printf('<cite><b class="reviewer">%1$s</b> %2$s</cite>',
820
-                            get_comment_author_link(),
821
-                            // If current post author is also comment author, make it known visually.
822
-                            ($comment->user_id === $post->post_author) ? '<span>' . __('Post author', 'geodirectory') . '</span>' : ''
823
-                        );
824
-                        echo "<span class='item'><small><span class='fn'>$post->post_title</span></small></span>";
825
-                        printf('<a href="%1$s"><time datetime="%2$s" class="dtreviewed">%3$s<span class="value-title" title="%2$s"></span></time></a>',
826
-                            esc_url(get_comment_link($comment->comment_ID)),
827
-                            get_comment_time('c'),
828
-                            /* translators: 1: date, 2: time */
829
-                            sprintf(__('%1$s at %2$s', 'geodirectory'), get_comment_date(), get_comment_time())
830
-                        );
831
-                        ?>
809
+						/**
810
+						 * Filter to modify comment avatar size
811
+						 *
812
+						 * You can use this filter to change comment avatar size.
813
+						 *
814
+						 * @since 1.0.0
815
+						 * @package GeoDirectory
816
+						 */
817
+						$avatar_size = apply_filters('geodir_comment_avatar_size', 44);
818
+						echo get_avatar($comment, $avatar_size);
819
+						printf('<cite><b class="reviewer">%1$s</b> %2$s</cite>',
820
+							get_comment_author_link(),
821
+							// If current post author is also comment author, make it known visually.
822
+							($comment->user_id === $post->post_author) ? '<span>' . __('Post author', 'geodirectory') . '</span>' : ''
823
+						);
824
+						echo "<span class='item'><small><span class='fn'>$post->post_title</span></small></span>";
825
+						printf('<a href="%1$s"><time datetime="%2$s" class="dtreviewed">%3$s<span class="value-title" title="%2$s"></span></time></a>',
826
+							esc_url(get_comment_link($comment->comment_ID)),
827
+							get_comment_time('c'),
828
+							/* translators: 1: date, 2: time */
829
+							sprintf(__('%1$s at %2$s', 'geodirectory'), get_comment_date(), get_comment_time())
830
+						);
831
+						?>
832 832
                     </header>
833 833
                     <!-- .comment-meta -->
834 834
 
@@ -852,47 +852,47 @@  discard block
 block discarded – undo
852 852
                 </article>
853 853
                 <!-- #comment-## -->
854 854
                 <?php
855
-                break;
856
-        endswitch; // end comment_type check
857
-    }
855
+				break;
856
+		endswitch; // end comment_type check
857
+	}
858 858
 }
859 859
 
860 860
 
861 861
 add_filter('get_comments_number', 'geodir_fix_comment_count', 10, 2);
862 862
 if (!function_exists('geodir_fix_comment_count')) {
863
-    /**
864
-     * Fix comment count by not listing replies as reviews
865
-     *
866
-     * @since 1.0.0
867
-     * @package GeoDirectory
868
-     * @global object $post The current post object.
869
-     * @param int $count The comment count.
870
-     * @param int $post_id The post ID.
871
-     * @todo $post is unreachable since the function return the count before that variable.
872
-     * @return bool|null|string The comment count.
873
-     */
874
-    function geodir_fix_comment_count($count, $post_id)
875
-    {
876
-        if (!is_admin() || strpos($_SERVER['REQUEST_URI'], 'admin-ajax.php')) {
877
-            global $post;
878
-            $post_types = geodir_get_posttypes();
879
-
880
-            if (in_array(get_post_type($post_id), $post_types)) {
881
-                $review_count = geodir_get_review_count_total($post_id);
882
-                return $review_count;
883
-
884
-                if ($post && isset($post->rating_count)) {
885
-                    return $post->rating_count;
886
-                } else {
887
-                    return geodir_get_comments_number($post_id);
888
-                }
889
-            } else {
890
-                return $count;
891
-            }
892
-        } else {
893
-            return $count;
894
-        }
895
-    }
863
+	/**
864
+	 * Fix comment count by not listing replies as reviews
865
+	 *
866
+	 * @since 1.0.0
867
+	 * @package GeoDirectory
868
+	 * @global object $post The current post object.
869
+	 * @param int $count The comment count.
870
+	 * @param int $post_id The post ID.
871
+	 * @todo $post is unreachable since the function return the count before that variable.
872
+	 * @return bool|null|string The comment count.
873
+	 */
874
+	function geodir_fix_comment_count($count, $post_id)
875
+	{
876
+		if (!is_admin() || strpos($_SERVER['REQUEST_URI'], 'admin-ajax.php')) {
877
+			global $post;
878
+			$post_types = geodir_get_posttypes();
879
+
880
+			if (in_array(get_post_type($post_id), $post_types)) {
881
+				$review_count = geodir_get_review_count_total($post_id);
882
+				return $review_count;
883
+
884
+				if ($post && isset($post->rating_count)) {
885
+					return $post->rating_count;
886
+				} else {
887
+					return geodir_get_comments_number($post_id);
888
+				}
889
+			} else {
890
+				return $count;
891
+			}
892
+		} else {
893
+			return $count;
894
+		}
895
+	}
896 896
 }
897 897
 
898 898
 /**
@@ -909,11 +909,11 @@  discard block
 block discarded – undo
909 909
  */
910 910
 function geodir_get_rating_stars($rating, $post_id, $small = false)
911 911
 {
912
-    $a_rating = $rating / 5 * 100;
912
+	$a_rating = $rating / 5 * 100;
913 913
 
914
-    if ($small) {
915
-        $r_html = '<div class="rating"><div class="gd_rating_map" data-average="' . $rating . '" data-id="' . $post_id . '"><div class="geodir_RatingColor" ></div><div class="geodir_RatingAverage_small" style="width: ' . $a_rating . '%;"></div><div class="geodir_Star_small"></div></div></div>';
916
-    } else {
914
+	if ($small) {
915
+		$r_html = '<div class="rating"><div class="gd_rating_map" data-average="' . $rating . '" data-id="' . $post_id . '"><div class="geodir_RatingColor" ></div><div class="geodir_RatingAverage_small" style="width: ' . $a_rating . '%;"></div><div class="geodir_Star_small"></div></div></div>';
916
+	} else {
917 917
 		if (function_exists('geodir_reviewrating_draw_overall_rating')) {
918 918
 			// Show rating stars from review rating manager
919 919
 			$r_html = geodir_reviewrating_draw_overall_rating($rating);
@@ -931,8 +931,8 @@  discard block
 block discarded – undo
931 931
 			}
932 932
 			$r_html = '<div class="geodir-rating" style="' . $attach_style . '"><div class="gd_rating_show" data-average="' . $rating . '" data-id="' . $post_id . '"><div class="geodir_RatingAverage" style="width: ' . $a_rating . '%;"></div><div class="geodir_Star">' . $rating_img . $rating_img . $rating_img . $rating_img . $rating_img . '</div></div></div>';
933 933
 		}
934
-    }
935
-    return apply_filters('geodir_get_rating_stars_html', $r_html, $rating, 5);
934
+	}
935
+	return apply_filters('geodir_get_rating_stars_html', $r_html, $rating, 5);
936 936
 }
937 937
 
938 938
 /**
@@ -946,23 +946,23 @@  discard block
 block discarded – undo
946 946
 function geodir_is_reviews_show($pageview = '')
947 947
 {
948 948
 
949
-    $active_tabs = get_option('geodir_detail_page_tabs_excluded');
950
-
951
-    $is_display = true;
952
-    if (!empty($active_tabs) && in_array('reviews', $active_tabs))
953
-        $is_display = false;
954
-
955
-    /**
956
-     * Filter to change display value.
957
-     *
958
-     * You can use this filter to change the is_display value.
959
-     *
960
-     * @since 1.0.0
961
-     * @package GeoDirectory
962
-     * @param bool $is_display Display ratings when set to true.
963
-     * @param string $pageview The view template. Ex: listview, gridview etc.
964
-     */
965
-    return apply_filters('geodir_is_reviews_show', $is_display, $pageview);
949
+	$active_tabs = get_option('geodir_detail_page_tabs_excluded');
950
+
951
+	$is_display = true;
952
+	if (!empty($active_tabs) && in_array('reviews', $active_tabs))
953
+		$is_display = false;
954
+
955
+	/**
956
+	 * Filter to change display value.
957
+	 *
958
+	 * You can use this filter to change the is_display value.
959
+	 *
960
+	 * @since 1.0.0
961
+	 * @package GeoDirectory
962
+	 * @param bool $is_display Display ratings when set to true.
963
+	 * @param string $pageview The view template. Ex: listview, gridview etc.
964
+	 */
965
+	return apply_filters('geodir_is_reviews_show', $is_display, $pageview);
966 966
 }
967 967
 
968 968
 
@@ -970,9 +970,9 @@  discard block
 block discarded – undo
970 970
  * If Disqus plugin is active, do some fixes to show on blogs but no on GD post types
971 971
  */
972 972
 if(function_exists('dsq_can_replace')) {
973
-    remove_filter('comments_template', 'dsq_comments_template');
974
-    add_filter('comments_template', 'dsq_comments_template', 100);
975
-    add_filter('pre_option_disqus_active', 'geodir_option_disqus_active',10,1);
973
+	remove_filter('comments_template', 'dsq_comments_template');
974
+	add_filter('comments_template', 'dsq_comments_template', 100);
975
+	add_filter('pre_option_disqus_active', 'geodir_option_disqus_active',10,1);
976 976
 }
977 977
 
978 978
 
@@ -986,13 +986,13 @@  discard block
 block discarded – undo
986 986
  * @return string `1` if active `0` if disabled.
987 987
  */
988 988
 function geodir_option_disqus_active($disqus_active){
989
-    global $post;
990
-    $all_postypes = geodir_get_posttypes();
989
+	global $post;
990
+	$all_postypes = geodir_get_posttypes();
991 991
 
992
-    if(isset($post->post_type) && is_array($all_postypes) && in_array($post->post_type,$all_postypes)){
993
-        $disqus_active = '0';
994
-    }
992
+	if(isset($post->post_type) && is_array($all_postypes) && in_array($post->post_type,$all_postypes)){
993
+		$disqus_active = '0';
994
+	}
995 995
 
996
-    return $disqus_active;
996
+	return $disqus_active;
997 997
 }
998 998
 
Please login to merge, or discard this patch.