@@ -1,39 +1,39 @@ |
||
1 | 1 | <?php |
2 | 2 | class AddListing extends WP_UnitTestCase |
3 | 3 | { |
4 | - public function setUp() |
|
5 | - { |
|
6 | - parent::setUp(); |
|
7 | - wp_set_current_user(1); |
|
8 | - } |
|
4 | + public function setUp() |
|
5 | + { |
|
6 | + parent::setUp(); |
|
7 | + wp_set_current_user(1); |
|
8 | + } |
|
9 | 9 | |
10 | - public function testAddListing() |
|
11 | - { |
|
12 | - $args = array( |
|
13 | - 'listing_type' => 'gd_place', |
|
14 | - 'post_title' => 'Test Listing Title', |
|
15 | - 'post_desc' => 'Test Desc', |
|
16 | - 'post_tags' => 'test1,test2', |
|
17 | - 'post_address' => 'New York City Hall', |
|
18 | - 'post_zip' => '10007', |
|
19 | - 'post_mapview' => 'ROADMAP', |
|
20 | - 'post_mapzoom' => '10', |
|
21 | - 'geodir_timing' => '10.00 am to 6 pm every day', |
|
22 | - 'geodir_contact' => '1234567890', |
|
23 | - 'geodir_email' => '[email protected]', |
|
24 | - 'geodir_website' => 'http://test.com', |
|
25 | - 'geodir_twitter' => 'http://twitter.com/test', |
|
26 | - 'geodir_facebook' => 'http://facebook.com/test', |
|
27 | - 'geodir_special_offers' => 'Test offer' |
|
28 | - ); |
|
29 | - $post_id = geodir_save_listing($args, true); |
|
10 | + public function testAddListing() |
|
11 | + { |
|
12 | + $args = array( |
|
13 | + 'listing_type' => 'gd_place', |
|
14 | + 'post_title' => 'Test Listing Title', |
|
15 | + 'post_desc' => 'Test Desc', |
|
16 | + 'post_tags' => 'test1,test2', |
|
17 | + 'post_address' => 'New York City Hall', |
|
18 | + 'post_zip' => '10007', |
|
19 | + 'post_mapview' => 'ROADMAP', |
|
20 | + 'post_mapzoom' => '10', |
|
21 | + 'geodir_timing' => '10.00 am to 6 pm every day', |
|
22 | + 'geodir_contact' => '1234567890', |
|
23 | + 'geodir_email' => '[email protected]', |
|
24 | + 'geodir_website' => 'http://test.com', |
|
25 | + 'geodir_twitter' => 'http://twitter.com/test', |
|
26 | + 'geodir_facebook' => 'http://facebook.com/test', |
|
27 | + 'geodir_special_offers' => 'Test offer' |
|
28 | + ); |
|
29 | + $post_id = geodir_save_listing($args, true); |
|
30 | 30 | |
31 | - $this->assertTrue(is_int($post_id)); |
|
32 | - } |
|
31 | + $this->assertTrue(is_int($post_id)); |
|
32 | + } |
|
33 | 33 | |
34 | - public function tearDown() |
|
35 | - { |
|
36 | - parent::tearDown(); |
|
37 | - } |
|
34 | + public function tearDown() |
|
35 | + { |
|
36 | + parent::tearDown(); |
|
37 | + } |
|
38 | 38 | } |
39 | 39 | ?> |
40 | 40 | \ No newline at end of file |
@@ -1,57 +1,57 @@ |
||
1 | 1 | <?php |
2 | 2 | class CheckLoginBox extends WP_UnitTestCase |
3 | 3 | { |
4 | - public function setUp() |
|
5 | - { |
|
6 | - parent::setUp(); |
|
7 | - } |
|
4 | + public function setUp() |
|
5 | + { |
|
6 | + parent::setUp(); |
|
7 | + } |
|
8 | 8 | |
9 | - public function testLoginBoxEmptyPassword() |
|
10 | - { |
|
11 | - global $errors; |
|
12 | - $_POST['testcookie'] = 1; |
|
13 | - $_POST['log'] = 'admin'; |
|
14 | - add_filter('wp_redirect', '__return_false'); |
|
15 | - geodir_user_signup(); |
|
16 | - remove_filter('wp_redirect', '__return_false'); |
|
17 | - $errors = (array) $errors; |
|
18 | - $this->assertArrayHasKey( 'empty_password', $errors["errors"] ); |
|
19 | - $this->assertContains( 'The password field is empty', $errors["errors"]["empty_password"][0] ); |
|
20 | - } |
|
9 | + public function testLoginBoxEmptyPassword() |
|
10 | + { |
|
11 | + global $errors; |
|
12 | + $_POST['testcookie'] = 1; |
|
13 | + $_POST['log'] = 'admin'; |
|
14 | + add_filter('wp_redirect', '__return_false'); |
|
15 | + geodir_user_signup(); |
|
16 | + remove_filter('wp_redirect', '__return_false'); |
|
17 | + $errors = (array) $errors; |
|
18 | + $this->assertArrayHasKey( 'empty_password', $errors["errors"] ); |
|
19 | + $this->assertContains( 'The password field is empty', $errors["errors"]["empty_password"][0] ); |
|
20 | + } |
|
21 | 21 | |
22 | - public function testLoginBoxIncorrectPassword() |
|
23 | - { |
|
24 | - global $errors; |
|
25 | - $_POST['testcookie'] = 1; |
|
26 | - $_REQUEST['action'] = 'login'; |
|
27 | - $_POST['log'] = 'testuser'; |
|
28 | - $_POST['pwd'] = 'admin'; |
|
29 | - add_filter('wp_redirect', '__return_false'); |
|
30 | - geodir_user_signup(); |
|
31 | - remove_filter('wp_redirect', '__return_false'); |
|
32 | - $errors = (array) $errors; |
|
33 | - $this->assertArrayHasKey( 'incorrect_password', $errors["errors"] ); |
|
34 | - $this->assertContains( 'The password you entered for the username', $errors["errors"]["incorrect_password"][0] ); |
|
35 | - } |
|
22 | + public function testLoginBoxIncorrectPassword() |
|
23 | + { |
|
24 | + global $errors; |
|
25 | + $_POST['testcookie'] = 1; |
|
26 | + $_REQUEST['action'] = 'login'; |
|
27 | + $_POST['log'] = 'testuser'; |
|
28 | + $_POST['pwd'] = 'admin'; |
|
29 | + add_filter('wp_redirect', '__return_false'); |
|
30 | + geodir_user_signup(); |
|
31 | + remove_filter('wp_redirect', '__return_false'); |
|
32 | + $errors = (array) $errors; |
|
33 | + $this->assertArrayHasKey( 'incorrect_password', $errors["errors"] ); |
|
34 | + $this->assertContains( 'The password you entered for the username', $errors["errors"]["incorrect_password"][0] ); |
|
35 | + } |
|
36 | 36 | |
37 | - public function testLoginBoxInvalidUsername() |
|
38 | - { |
|
39 | - global $errors; |
|
40 | - $_POST['testcookie'] = 1; |
|
41 | - $_REQUEST['action'] = 'login'; |
|
42 | - $_POST['log'] = 'adm##@in'; |
|
43 | - $_POST['pwd'] = 'admin'; |
|
44 | - add_filter('wp_redirect', '__return_false'); |
|
45 | - geodir_user_signup(); |
|
46 | - remove_filter('wp_redirect', '__return_false'); |
|
47 | - $errors = (array) $errors; |
|
48 | - $this->assertArrayHasKey( 'invalid_username', $errors["errors"] ); |
|
49 | - $this->assertContains( 'Invalid username', $errors["errors"]["invalid_username"][0] ); |
|
50 | - } |
|
37 | + public function testLoginBoxInvalidUsername() |
|
38 | + { |
|
39 | + global $errors; |
|
40 | + $_POST['testcookie'] = 1; |
|
41 | + $_REQUEST['action'] = 'login'; |
|
42 | + $_POST['log'] = 'adm##@in'; |
|
43 | + $_POST['pwd'] = 'admin'; |
|
44 | + add_filter('wp_redirect', '__return_false'); |
|
45 | + geodir_user_signup(); |
|
46 | + remove_filter('wp_redirect', '__return_false'); |
|
47 | + $errors = (array) $errors; |
|
48 | + $this->assertArrayHasKey( 'invalid_username', $errors["errors"] ); |
|
49 | + $this->assertContains( 'Invalid username', $errors["errors"]["invalid_username"][0] ); |
|
50 | + } |
|
51 | 51 | |
52 | - public function tearDown() |
|
53 | - { |
|
54 | - parent::tearDown(); |
|
55 | - } |
|
52 | + public function tearDown() |
|
53 | + { |
|
54 | + parent::tearDown(); |
|
55 | + } |
|
56 | 56 | } |
57 | 57 | ?> |
58 | 58 | \ No newline at end of file |
@@ -15,8 +15,8 @@ discard block |
||
15 | 15 | geodir_user_signup(); |
16 | 16 | remove_filter('wp_redirect', '__return_false'); |
17 | 17 | $errors = (array) $errors; |
18 | - $this->assertArrayHasKey( 'empty_password', $errors["errors"] ); |
|
19 | - $this->assertContains( 'The password field is empty', $errors["errors"]["empty_password"][0] ); |
|
18 | + $this->assertArrayHasKey('empty_password', $errors["errors"]); |
|
19 | + $this->assertContains('The password field is empty', $errors["errors"]["empty_password"][0]); |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | public function testLoginBoxIncorrectPassword() |
@@ -30,8 +30,8 @@ discard block |
||
30 | 30 | geodir_user_signup(); |
31 | 31 | remove_filter('wp_redirect', '__return_false'); |
32 | 32 | $errors = (array) $errors; |
33 | - $this->assertArrayHasKey( 'incorrect_password', $errors["errors"] ); |
|
34 | - $this->assertContains( 'The password you entered for the username', $errors["errors"]["incorrect_password"][0] ); |
|
33 | + $this->assertArrayHasKey('incorrect_password', $errors["errors"]); |
|
34 | + $this->assertContains('The password you entered for the username', $errors["errors"]["incorrect_password"][0]); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | public function testLoginBoxInvalidUsername() |
@@ -45,8 +45,8 @@ discard block |
||
45 | 45 | geodir_user_signup(); |
46 | 46 | remove_filter('wp_redirect', '__return_false'); |
47 | 47 | $errors = (array) $errors; |
48 | - $this->assertArrayHasKey( 'invalid_username', $errors["errors"] ); |
|
49 | - $this->assertContains( 'Invalid username', $errors["errors"]["invalid_username"][0] ); |
|
48 | + $this->assertArrayHasKey('invalid_username', $errors["errors"]); |
|
49 | + $this->assertContains('Invalid username', $errors["errors"]["invalid_username"][0]); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | public function tearDown() |
@@ -16,8 +16,8 @@ discard block |
||
16 | 16 | geodir_user_signup(); |
17 | 17 | remove_filter('wp_redirect', '__return_false'); |
18 | 18 | $errors = (array) $errors; |
19 | - $this->assertArrayHasKey( 'empty_password', $errors["errors"] ); |
|
20 | - $this->assertContains( 'The password field is empty', $errors["errors"]["empty_password"][0] ); |
|
19 | + $this->assertArrayHasKey('empty_password', $errors["errors"]); |
|
20 | + $this->assertContains('The password field is empty', $errors["errors"]["empty_password"][0]); |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | public function testLoginIncorrectPassword() |
@@ -30,8 +30,8 @@ discard block |
||
30 | 30 | geodir_user_signup(); |
31 | 31 | remove_filter('wp_redirect', '__return_false'); |
32 | 32 | $errors = (array) $errors; |
33 | - $this->assertArrayHasKey( 'incorrect_password', $errors["errors"] ); |
|
34 | - $this->assertContains( 'The password you entered for the username', $errors["errors"]["incorrect_password"][0] ); |
|
33 | + $this->assertArrayHasKey('incorrect_password', $errors["errors"]); |
|
34 | + $this->assertContains('The password you entered for the username', $errors["errors"]["incorrect_password"][0]); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | public function testLoginInvalidUsername() |
@@ -44,8 +44,8 @@ discard block |
||
44 | 44 | geodir_user_signup(); |
45 | 45 | remove_filter('wp_redirect', '__return_false'); |
46 | 46 | $errors = (array) $errors; |
47 | - $this->assertArrayHasKey( 'invalid_username', $errors["errors"] ); |
|
48 | - $this->assertContains( 'Invalid username', $errors["errors"]["invalid_username"][0] ); |
|
47 | + $this->assertArrayHasKey('invalid_username', $errors["errors"]); |
|
48 | + $this->assertContains('Invalid username', $errors["errors"]["invalid_username"][0]); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | // public function testLoginValid() |
@@ -70,8 +70,8 @@ discard block |
||
70 | 70 | geodir_user_signup(); |
71 | 71 | remove_filter('wp_redirect', '__return_false'); |
72 | 72 | $errors = (array) $errors; |
73 | - $this->assertArrayHasKey( 'empty_username', $errors["errors"] ); |
|
74 | - $this->assertContains( 'Enter a username or e-mail address', $errors["errors"]["empty_username"][0] ); |
|
73 | + $this->assertArrayHasKey('empty_username', $errors["errors"]); |
|
74 | + $this->assertContains('Enter a username or e-mail address', $errors["errors"]["empty_username"][0]); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | public function testForgotPassInvalidEmail() |
@@ -85,8 +85,8 @@ discard block |
||
85 | 85 | geodir_user_signup(); |
86 | 86 | remove_filter('wp_redirect', '__return_false'); |
87 | 87 | $errors = (array) $errors; |
88 | - $this->assertArrayHasKey( 'invalid_email', $errors["errors"] ); |
|
89 | - $this->assertContains( 'There is no user registered with that email address', $errors["errors"]["invalid_email"][0] ); |
|
88 | + $this->assertArrayHasKey('invalid_email', $errors["errors"]); |
|
89 | + $this->assertContains('There is no user registered with that email address', $errors["errors"]["invalid_email"][0]); |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | public function testForgotPassInvalidUsername() |
@@ -100,8 +100,8 @@ discard block |
||
100 | 100 | geodir_user_signup(); |
101 | 101 | remove_filter('wp_redirect', '__return_false'); |
102 | 102 | $errors = (array) $errors; |
103 | - $this->assertArrayHasKey( 'invalidcombo', $errors["errors"] ); |
|
104 | - $this->assertContains( 'Invalid username or e-mail', $errors["errors"]["invalidcombo"][0] ); |
|
103 | + $this->assertArrayHasKey('invalidcombo', $errors["errors"]); |
|
104 | + $this->assertContains('Invalid username or e-mail', $errors["errors"]["invalidcombo"][0]); |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | public function tearDown() |
@@ -1,51 +1,51 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | class LoginUser extends WP_UnitTestCase |
3 | 3 | { |
4 | - public function setUp() |
|
5 | - { |
|
6 | - parent::setUp(); |
|
7 | - } |
|
4 | + public function setUp() |
|
5 | + { |
|
6 | + parent::setUp(); |
|
7 | + } |
|
8 | 8 | |
9 | - public function testLoginEmptyPassword() |
|
10 | - { |
|
11 | - global $errors; |
|
12 | - $_REQUEST['action'] = 'login'; |
|
13 | - $_POST['log'] = 'admin'; |
|
14 | - add_filter('wp_redirect', '__return_false'); |
|
15 | - geodir_user_signup(); |
|
16 | - remove_filter('wp_redirect', '__return_false'); |
|
17 | - $errors = (array) $errors; |
|
18 | - $this->assertArrayHasKey( 'empty_password', $errors["errors"] ); |
|
19 | - $this->assertContains( 'The password field is empty', $errors["errors"]["empty_password"][0] ); |
|
20 | - } |
|
9 | + public function testLoginEmptyPassword() |
|
10 | + { |
|
11 | + global $errors; |
|
12 | + $_REQUEST['action'] = 'login'; |
|
13 | + $_POST['log'] = 'admin'; |
|
14 | + add_filter('wp_redirect', '__return_false'); |
|
15 | + geodir_user_signup(); |
|
16 | + remove_filter('wp_redirect', '__return_false'); |
|
17 | + $errors = (array) $errors; |
|
18 | + $this->assertArrayHasKey( 'empty_password', $errors["errors"] ); |
|
19 | + $this->assertContains( 'The password field is empty', $errors["errors"]["empty_password"][0] ); |
|
20 | + } |
|
21 | 21 | |
22 | - public function testLoginIncorrectPassword() |
|
23 | - { |
|
24 | - global $errors; |
|
25 | - $_REQUEST['action'] = 'login'; |
|
26 | - $_POST['log'] = 'testuser'; |
|
27 | - $_POST['pwd'] = 'admin'; |
|
28 | - add_filter('wp_redirect', '__return_false'); |
|
29 | - geodir_user_signup(); |
|
30 | - remove_filter('wp_redirect', '__return_false'); |
|
31 | - $errors = (array) $errors; |
|
32 | - $this->assertArrayHasKey( 'incorrect_password', $errors["errors"] ); |
|
33 | - $this->assertContains( 'The password you entered for the username', $errors["errors"]["incorrect_password"][0] ); |
|
34 | - } |
|
22 | + public function testLoginIncorrectPassword() |
|
23 | + { |
|
24 | + global $errors; |
|
25 | + $_REQUEST['action'] = 'login'; |
|
26 | + $_POST['log'] = 'testuser'; |
|
27 | + $_POST['pwd'] = 'admin'; |
|
28 | + add_filter('wp_redirect', '__return_false'); |
|
29 | + geodir_user_signup(); |
|
30 | + remove_filter('wp_redirect', '__return_false'); |
|
31 | + $errors = (array) $errors; |
|
32 | + $this->assertArrayHasKey( 'incorrect_password', $errors["errors"] ); |
|
33 | + $this->assertContains( 'The password you entered for the username', $errors["errors"]["incorrect_password"][0] ); |
|
34 | + } |
|
35 | 35 | |
36 | - public function testLoginInvalidUsername() |
|
37 | - { |
|
38 | - global $errors; |
|
39 | - $_REQUEST['action'] = 'login'; |
|
40 | - $_POST['log'] = 'adm##@in'; |
|
41 | - $_POST['pwd'] = 'admin'; |
|
42 | - add_filter('wp_redirect', '__return_false'); |
|
43 | - geodir_user_signup(); |
|
44 | - remove_filter('wp_redirect', '__return_false'); |
|
45 | - $errors = (array) $errors; |
|
46 | - $this->assertArrayHasKey( 'invalid_username', $errors["errors"] ); |
|
47 | - $this->assertContains( 'Invalid username', $errors["errors"]["invalid_username"][0] ); |
|
48 | - } |
|
36 | + public function testLoginInvalidUsername() |
|
37 | + { |
|
38 | + global $errors; |
|
39 | + $_REQUEST['action'] = 'login'; |
|
40 | + $_POST['log'] = 'adm##@in'; |
|
41 | + $_POST['pwd'] = 'admin'; |
|
42 | + add_filter('wp_redirect', '__return_false'); |
|
43 | + geodir_user_signup(); |
|
44 | + remove_filter('wp_redirect', '__return_false'); |
|
45 | + $errors = (array) $errors; |
|
46 | + $this->assertArrayHasKey( 'invalid_username', $errors["errors"] ); |
|
47 | + $this->assertContains( 'Invalid username', $errors["errors"]["invalid_username"][0] ); |
|
48 | + } |
|
49 | 49 | |
50 | 50 | // public function testLoginValid() |
51 | 51 | // { |
@@ -58,55 +58,55 @@ discard block |
||
58 | 58 | // remove_filter('wp_redirect', '__return_false'); |
59 | 59 | // } |
60 | 60 | |
61 | - public function testForgotPassEmptyData() |
|
62 | - { |
|
63 | - global $errors; |
|
64 | - $_SERVER['REQUEST_METHOD'] = 'POST'; |
|
65 | - $_REQUEST['action'] = 'retrievepassword'; |
|
66 | - $_POST['user_login'] = ''; |
|
67 | - $_POST['user_email'] = ''; |
|
68 | - add_filter('wp_redirect', '__return_false'); |
|
69 | - geodir_user_signup(); |
|
70 | - remove_filter('wp_redirect', '__return_false'); |
|
71 | - $errors = (array) $errors; |
|
72 | - $this->assertArrayHasKey( 'empty_username', $errors["errors"] ); |
|
73 | - $this->assertContains( 'Enter a username or e-mail address', $errors["errors"]["empty_username"][0] ); |
|
74 | - } |
|
61 | + public function testForgotPassEmptyData() |
|
62 | + { |
|
63 | + global $errors; |
|
64 | + $_SERVER['REQUEST_METHOD'] = 'POST'; |
|
65 | + $_REQUEST['action'] = 'retrievepassword'; |
|
66 | + $_POST['user_login'] = ''; |
|
67 | + $_POST['user_email'] = ''; |
|
68 | + add_filter('wp_redirect', '__return_false'); |
|
69 | + geodir_user_signup(); |
|
70 | + remove_filter('wp_redirect', '__return_false'); |
|
71 | + $errors = (array) $errors; |
|
72 | + $this->assertArrayHasKey( 'empty_username', $errors["errors"] ); |
|
73 | + $this->assertContains( 'Enter a username or e-mail address', $errors["errors"]["empty_username"][0] ); |
|
74 | + } |
|
75 | 75 | |
76 | - public function testForgotPassInvalidEmail() |
|
77 | - { |
|
78 | - global $errors; |
|
79 | - $_SERVER['REQUEST_METHOD'] = 'POST'; |
|
80 | - $_REQUEST['action'] = 'retrievepassword'; |
|
81 | - $_POST['user_login'] = '[email protected]'; |
|
82 | - $_POST['user_email'] = ''; |
|
83 | - add_filter('wp_redirect', '__return_false'); |
|
84 | - geodir_user_signup(); |
|
85 | - remove_filter('wp_redirect', '__return_false'); |
|
86 | - $errors = (array) $errors; |
|
87 | - $this->assertArrayHasKey( 'invalid_email', $errors["errors"] ); |
|
88 | - $this->assertContains( 'There is no user registered with that email address', $errors["errors"]["invalid_email"][0] ); |
|
89 | - } |
|
76 | + public function testForgotPassInvalidEmail() |
|
77 | + { |
|
78 | + global $errors; |
|
79 | + $_SERVER['REQUEST_METHOD'] = 'POST'; |
|
80 | + $_REQUEST['action'] = 'retrievepassword'; |
|
81 | + $_POST['user_login'] = '[email protected]'; |
|
82 | + $_POST['user_email'] = ''; |
|
83 | + add_filter('wp_redirect', '__return_false'); |
|
84 | + geodir_user_signup(); |
|
85 | + remove_filter('wp_redirect', '__return_false'); |
|
86 | + $errors = (array) $errors; |
|
87 | + $this->assertArrayHasKey( 'invalid_email', $errors["errors"] ); |
|
88 | + $this->assertContains( 'There is no user registered with that email address', $errors["errors"]["invalid_email"][0] ); |
|
89 | + } |
|
90 | 90 | |
91 | - public function testForgotPassInvalidUsername() |
|
92 | - { |
|
93 | - global $errors; |
|
94 | - $_SERVER['REQUEST_METHOD'] = 'POST'; |
|
95 | - $_REQUEST['action'] = 'retrievepassword'; |
|
96 | - $_POST['user_login'] = 'holla'; |
|
97 | - $_POST['user_email'] = '[email protected]'; |
|
98 | - add_filter('wp_redirect', '__return_false'); |
|
99 | - geodir_user_signup(); |
|
100 | - remove_filter('wp_redirect', '__return_false'); |
|
101 | - $errors = (array) $errors; |
|
102 | - $this->assertArrayHasKey( 'invalidcombo', $errors["errors"] ); |
|
103 | - $this->assertContains( 'Invalid username or e-mail', $errors["errors"]["invalidcombo"][0] ); |
|
104 | - } |
|
91 | + public function testForgotPassInvalidUsername() |
|
92 | + { |
|
93 | + global $errors; |
|
94 | + $_SERVER['REQUEST_METHOD'] = 'POST'; |
|
95 | + $_REQUEST['action'] = 'retrievepassword'; |
|
96 | + $_POST['user_login'] = 'holla'; |
|
97 | + $_POST['user_email'] = '[email protected]'; |
|
98 | + add_filter('wp_redirect', '__return_false'); |
|
99 | + geodir_user_signup(); |
|
100 | + remove_filter('wp_redirect', '__return_false'); |
|
101 | + $errors = (array) $errors; |
|
102 | + $this->assertArrayHasKey( 'invalidcombo', $errors["errors"] ); |
|
103 | + $this->assertContains( 'Invalid username or e-mail', $errors["errors"]["invalidcombo"][0] ); |
|
104 | + } |
|
105 | 105 | |
106 | - public function tearDown() |
|
107 | - { |
|
108 | - parent::tearDown(); |
|
109 | - } |
|
106 | + public function tearDown() |
|
107 | + { |
|
108 | + parent::tearDown(); |
|
109 | + } |
|
110 | 110 | |
111 | 111 | } |
112 | 112 | ?> |
113 | 113 | \ No newline at end of file |
@@ -1,63 +1,63 @@ |
||
1 | 1 | <?php |
2 | 2 | class EditListing extends WP_UnitTestCase |
3 | 3 | { |
4 | - public function setUp() |
|
5 | - { |
|
6 | - parent::setUp(); |
|
7 | - wp_set_current_user(1); |
|
8 | - } |
|
9 | - |
|
10 | - public function testEditListing() |
|
11 | - { |
|
12 | - $query_args = array( |
|
13 | - 'post_status' => 'publish', |
|
14 | - 'post_type' => 'gd_place', |
|
15 | - 'posts_per_page' => 1, |
|
16 | - ); |
|
17 | - |
|
18 | - $all_posts = new WP_Query( $query_args ); |
|
19 | - $post_id = null; |
|
20 | - while ( $all_posts->have_posts() ) : $all_posts->the_post(); |
|
21 | - $post_id = get_the_ID(); |
|
22 | - endwhile; |
|
23 | - |
|
24 | - $this->assertTrue(is_int($post_id)); |
|
25 | - |
|
26 | - $args = array( |
|
27 | - 'pid' => $post_id, |
|
28 | - 'listing_type' => 'gd_place', |
|
29 | - 'post_title' => 'Test Listing Title Modified', |
|
30 | - 'post_desc' => 'Test Desc', |
|
31 | - 'post_tags' => 'test1,test2', |
|
32 | - 'post_address' => 'New York City Hall', |
|
33 | - 'post_zip' => '10007', |
|
34 | - 'post_latitude' => '40.7127837', |
|
35 | - 'post_longitude' => '-74.00594130000002', |
|
36 | - 'post_mapview' => 'ROADMAP', |
|
37 | - 'post_mapzoom' => '10', |
|
38 | - 'geodir_timing' => '10.00 am to 6 pm every day', |
|
39 | - 'geodir_contact' => '1234567890', |
|
40 | - 'geodir_email' => '[email protected]', |
|
41 | - 'geodir_website' => 'http://test.com', |
|
42 | - 'geodir_twitter' => 'http://twitter.com/test', |
|
43 | - 'geodir_facebook' => 'http://facebook.com/test', |
|
44 | - 'geodir_special_offers' => 'Test offer' |
|
45 | - ); |
|
46 | - $saved_post_id = geodir_save_listing($args, true); |
|
47 | - |
|
48 | - $this->assertTrue(is_int($saved_post_id)); |
|
49 | - |
|
50 | - $title = get_the_title($post_id); |
|
51 | - |
|
52 | - $this->assertEquals('Test Listing Title Modified', $title); |
|
53 | - |
|
54 | - |
|
55 | - } |
|
56 | - |
|
57 | - |
|
58 | - public function tearDown() |
|
59 | - { |
|
60 | - parent::tearDown(); |
|
61 | - } |
|
4 | + public function setUp() |
|
5 | + { |
|
6 | + parent::setUp(); |
|
7 | + wp_set_current_user(1); |
|
8 | + } |
|
9 | + |
|
10 | + public function testEditListing() |
|
11 | + { |
|
12 | + $query_args = array( |
|
13 | + 'post_status' => 'publish', |
|
14 | + 'post_type' => 'gd_place', |
|
15 | + 'posts_per_page' => 1, |
|
16 | + ); |
|
17 | + |
|
18 | + $all_posts = new WP_Query( $query_args ); |
|
19 | + $post_id = null; |
|
20 | + while ( $all_posts->have_posts() ) : $all_posts->the_post(); |
|
21 | + $post_id = get_the_ID(); |
|
22 | + endwhile; |
|
23 | + |
|
24 | + $this->assertTrue(is_int($post_id)); |
|
25 | + |
|
26 | + $args = array( |
|
27 | + 'pid' => $post_id, |
|
28 | + 'listing_type' => 'gd_place', |
|
29 | + 'post_title' => 'Test Listing Title Modified', |
|
30 | + 'post_desc' => 'Test Desc', |
|
31 | + 'post_tags' => 'test1,test2', |
|
32 | + 'post_address' => 'New York City Hall', |
|
33 | + 'post_zip' => '10007', |
|
34 | + 'post_latitude' => '40.7127837', |
|
35 | + 'post_longitude' => '-74.00594130000002', |
|
36 | + 'post_mapview' => 'ROADMAP', |
|
37 | + 'post_mapzoom' => '10', |
|
38 | + 'geodir_timing' => '10.00 am to 6 pm every day', |
|
39 | + 'geodir_contact' => '1234567890', |
|
40 | + 'geodir_email' => '[email protected]', |
|
41 | + 'geodir_website' => 'http://test.com', |
|
42 | + 'geodir_twitter' => 'http://twitter.com/test', |
|
43 | + 'geodir_facebook' => 'http://facebook.com/test', |
|
44 | + 'geodir_special_offers' => 'Test offer' |
|
45 | + ); |
|
46 | + $saved_post_id = geodir_save_listing($args, true); |
|
47 | + |
|
48 | + $this->assertTrue(is_int($saved_post_id)); |
|
49 | + |
|
50 | + $title = get_the_title($post_id); |
|
51 | + |
|
52 | + $this->assertEquals('Test Listing Title Modified', $title); |
|
53 | + |
|
54 | + |
|
55 | + } |
|
56 | + |
|
57 | + |
|
58 | + public function tearDown() |
|
59 | + { |
|
60 | + parent::tearDown(); |
|
61 | + } |
|
62 | 62 | } |
63 | 63 | ?> |
64 | 64 | \ No newline at end of file |
@@ -15,9 +15,9 @@ |
||
15 | 15 | 'posts_per_page' => 1, |
16 | 16 | ); |
17 | 17 | |
18 | - $all_posts = new WP_Query( $query_args ); |
|
18 | + $all_posts = new WP_Query($query_args); |
|
19 | 19 | $post_id = null; |
20 | - while ( $all_posts->have_posts() ) : $all_posts->the_post(); |
|
20 | + while ($all_posts->have_posts()) : $all_posts->the_post(); |
|
21 | 21 | $post_id = get_the_ID(); |
22 | 22 | endwhile; |
23 | 23 |
@@ -1,92 +1,92 @@ |
||
1 | 1 | <?php |
2 | 2 | class CheckNotifications extends WP_UnitTestCase |
3 | 3 | { |
4 | - public function setUp() |
|
5 | - { |
|
6 | - parent::setUp(); |
|
7 | - } |
|
4 | + public function setUp() |
|
5 | + { |
|
6 | + parent::setUp(); |
|
7 | + } |
|
8 | 8 | |
9 | - public function testSendFriendEmail() |
|
10 | - { |
|
11 | - add_filter('wp_mail', 'print_mail'); |
|
12 | - ob_start(); |
|
13 | - geodir_sendEmail('','', '[email protected]', 'Test User', 'Test subject', 'Test message', '', 'send_friend'); |
|
14 | - $output = ob_get_clean(); |
|
15 | - remove_filter('wp_mail', 'print_mail'); |
|
16 | - $this->assertContains( 'thought you might be interested in', $output ); |
|
17 | - $this->assertContains( 'Your friend has sent you a message from', $output ); |
|
18 | - $this->assertContains( '[email protected]', $output ); |
|
19 | - $this->assertContains( 'ADMIN BCC COPY', $output ); |
|
20 | - } |
|
9 | + public function testSendFriendEmail() |
|
10 | + { |
|
11 | + add_filter('wp_mail', 'print_mail'); |
|
12 | + ob_start(); |
|
13 | + geodir_sendEmail('','', '[email protected]', 'Test User', 'Test subject', 'Test message', '', 'send_friend'); |
|
14 | + $output = ob_get_clean(); |
|
15 | + remove_filter('wp_mail', 'print_mail'); |
|
16 | + $this->assertContains( 'thought you might be interested in', $output ); |
|
17 | + $this->assertContains( 'Your friend has sent you a message from', $output ); |
|
18 | + $this->assertContains( '[email protected]', $output ); |
|
19 | + $this->assertContains( 'ADMIN BCC COPY', $output ); |
|
20 | + } |
|
21 | 21 | |
22 | - public function testSendEnquiryEmail() |
|
23 | - { |
|
24 | - add_filter('wp_mail', 'print_mail'); |
|
25 | - ob_start(); |
|
26 | - geodir_sendEmail('','', '[email protected]', 'Test User', 'Test subject', 'Test message', '', 'send_enquiry'); |
|
27 | - $output = ob_get_clean(); |
|
28 | - remove_filter('wp_mail', 'print_mail'); |
|
29 | - $this->assertContains( 'Website Enquiry', $output ); |
|
30 | - $this->assertContains( 'An enquiry has been sent from', $output ); |
|
31 | - $this->assertContains( '[email protected]', $output ); |
|
32 | - $this->assertContains( 'ADMIN BCC COPY', $output ); |
|
33 | - } |
|
22 | + public function testSendEnquiryEmail() |
|
23 | + { |
|
24 | + add_filter('wp_mail', 'print_mail'); |
|
25 | + ob_start(); |
|
26 | + geodir_sendEmail('','', '[email protected]', 'Test User', 'Test subject', 'Test message', '', 'send_enquiry'); |
|
27 | + $output = ob_get_clean(); |
|
28 | + remove_filter('wp_mail', 'print_mail'); |
|
29 | + $this->assertContains( 'Website Enquiry', $output ); |
|
30 | + $this->assertContains( 'An enquiry has been sent from', $output ); |
|
31 | + $this->assertContains( '[email protected]', $output ); |
|
32 | + $this->assertContains( 'ADMIN BCC COPY', $output ); |
|
33 | + } |
|
34 | 34 | |
35 | - public function testForgotPassEmail() |
|
36 | - { |
|
37 | - add_filter('wp_mail', 'print_mail'); |
|
38 | - ob_start(); |
|
39 | - geodir_sendEmail('','', '[email protected]', 'Test User', 'Test subject', 'Test message', '', 'forgot_password'); |
|
40 | - $output = ob_get_clean(); |
|
41 | - remove_filter('wp_mail', 'print_mail'); |
|
42 | - $this->assertContains( 'Your new password', $output ); |
|
43 | - $this->assertContains( 'You requested a new password for', $output ); |
|
44 | - $this->assertContains( '[email protected]', $output ); |
|
45 | - } |
|
35 | + public function testForgotPassEmail() |
|
36 | + { |
|
37 | + add_filter('wp_mail', 'print_mail'); |
|
38 | + ob_start(); |
|
39 | + geodir_sendEmail('','', '[email protected]', 'Test User', 'Test subject', 'Test message', '', 'forgot_password'); |
|
40 | + $output = ob_get_clean(); |
|
41 | + remove_filter('wp_mail', 'print_mail'); |
|
42 | + $this->assertContains( 'Your new password', $output ); |
|
43 | + $this->assertContains( 'You requested a new password for', $output ); |
|
44 | + $this->assertContains( '[email protected]', $output ); |
|
45 | + } |
|
46 | 46 | |
47 | - public function testRegistrationEmail() |
|
48 | - { |
|
49 | - add_filter('wp_mail', 'print_mail'); |
|
50 | - ob_start(); |
|
51 | - geodir_sendEmail('','', '[email protected]', 'Test User', 'Test subject', 'Test message', '', 'registration'); |
|
52 | - $output = ob_get_clean(); |
|
53 | - remove_filter('wp_mail', 'print_mail'); |
|
54 | - $this->assertContains( 'Your Log In Details', $output ); |
|
55 | - $this->assertContains( 'You can log in with the following information', $output ); |
|
56 | - $this->assertContains( '[email protected]', $output ); |
|
57 | - $this->assertContains( 'ADMIN BCC COPY', $output ); |
|
58 | - } |
|
47 | + public function testRegistrationEmail() |
|
48 | + { |
|
49 | + add_filter('wp_mail', 'print_mail'); |
|
50 | + ob_start(); |
|
51 | + geodir_sendEmail('','', '[email protected]', 'Test User', 'Test subject', 'Test message', '', 'registration'); |
|
52 | + $output = ob_get_clean(); |
|
53 | + remove_filter('wp_mail', 'print_mail'); |
|
54 | + $this->assertContains( 'Your Log In Details', $output ); |
|
55 | + $this->assertContains( 'You can log in with the following information', $output ); |
|
56 | + $this->assertContains( '[email protected]', $output ); |
|
57 | + $this->assertContains( 'ADMIN BCC COPY', $output ); |
|
58 | + } |
|
59 | 59 | |
60 | - public function testPostSubmitEmail() |
|
61 | - { |
|
62 | - add_filter('wp_mail', 'print_mail'); |
|
63 | - ob_start(); |
|
64 | - geodir_sendEmail('','', '[email protected]', 'Test User', 'Test subject', 'Test message', '', 'post_submit'); |
|
65 | - $output = ob_get_clean(); |
|
66 | - remove_filter('wp_mail', 'print_mail'); |
|
67 | - $this->assertContains( 'Post Submitted Successfully', $output ); |
|
68 | - $this->assertContains( 'You submitted the below listing information', $output ); |
|
69 | - $this->assertContains( '[email protected]', $output ); |
|
70 | - $this->assertContains( 'ADMIN BCC COPY', $output ); |
|
71 | - $this->assertContains( 'A new listing has been published', $output ); |
|
72 | - } |
|
60 | + public function testPostSubmitEmail() |
|
61 | + { |
|
62 | + add_filter('wp_mail', 'print_mail'); |
|
63 | + ob_start(); |
|
64 | + geodir_sendEmail('','', '[email protected]', 'Test User', 'Test subject', 'Test message', '', 'post_submit'); |
|
65 | + $output = ob_get_clean(); |
|
66 | + remove_filter('wp_mail', 'print_mail'); |
|
67 | + $this->assertContains( 'Post Submitted Successfully', $output ); |
|
68 | + $this->assertContains( 'You submitted the below listing information', $output ); |
|
69 | + $this->assertContains( '[email protected]', $output ); |
|
70 | + $this->assertContains( 'ADMIN BCC COPY', $output ); |
|
71 | + $this->assertContains( 'A new listing has been published', $output ); |
|
72 | + } |
|
73 | 73 | |
74 | - public function testListingPublishedEmail() |
|
75 | - { |
|
76 | - add_filter('wp_mail', 'print_mail'); |
|
77 | - ob_start(); |
|
78 | - geodir_sendEmail('','', '[email protected]', 'Test User', 'Test subject', 'Test message', '', 'listing_published'); |
|
79 | - $output = ob_get_clean(); |
|
80 | - remove_filter('wp_mail', 'print_mail'); |
|
81 | - $this->assertContains( 'Listing Published Successfully', $output ); |
|
82 | - $this->assertContains( 'Your listing has been published', $output ); |
|
83 | - $this->assertContains( '[email protected]', $output ); |
|
84 | - $this->assertContains( 'ADMIN BCC COPY', $output ); |
|
85 | - } |
|
74 | + public function testListingPublishedEmail() |
|
75 | + { |
|
76 | + add_filter('wp_mail', 'print_mail'); |
|
77 | + ob_start(); |
|
78 | + geodir_sendEmail('','', '[email protected]', 'Test User', 'Test subject', 'Test message', '', 'listing_published'); |
|
79 | + $output = ob_get_clean(); |
|
80 | + remove_filter('wp_mail', 'print_mail'); |
|
81 | + $this->assertContains( 'Listing Published Successfully', $output ); |
|
82 | + $this->assertContains( 'Your listing has been published', $output ); |
|
83 | + $this->assertContains( '[email protected]', $output ); |
|
84 | + $this->assertContains( 'ADMIN BCC COPY', $output ); |
|
85 | + } |
|
86 | 86 | |
87 | - public function tearDown() |
|
88 | - { |
|
89 | - parent::tearDown(); |
|
90 | - } |
|
87 | + public function tearDown() |
|
88 | + { |
|
89 | + parent::tearDown(); |
|
90 | + } |
|
91 | 91 | } |
92 | 92 | ?> |
93 | 93 | \ No newline at end of file |
@@ -10,78 +10,78 @@ |
||
10 | 10 | { |
11 | 11 | add_filter('wp_mail', 'print_mail'); |
12 | 12 | ob_start(); |
13 | - geodir_sendEmail('','', '[email protected]', 'Test User', 'Test subject', 'Test message', '', 'send_friend'); |
|
13 | + geodir_sendEmail('', '', '[email protected]', 'Test User', 'Test subject', 'Test message', '', 'send_friend'); |
|
14 | 14 | $output = ob_get_clean(); |
15 | 15 | remove_filter('wp_mail', 'print_mail'); |
16 | - $this->assertContains( 'thought you might be interested in', $output ); |
|
17 | - $this->assertContains( 'Your friend has sent you a message from', $output ); |
|
18 | - $this->assertContains( '[email protected]', $output ); |
|
19 | - $this->assertContains( 'ADMIN BCC COPY', $output ); |
|
16 | + $this->assertContains('thought you might be interested in', $output); |
|
17 | + $this->assertContains('Your friend has sent you a message from', $output); |
|
18 | + $this->assertContains('[email protected]', $output); |
|
19 | + $this->assertContains('ADMIN BCC COPY', $output); |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | public function testSendEnquiryEmail() |
23 | 23 | { |
24 | 24 | add_filter('wp_mail', 'print_mail'); |
25 | 25 | ob_start(); |
26 | - geodir_sendEmail('','', '[email protected]', 'Test User', 'Test subject', 'Test message', '', 'send_enquiry'); |
|
26 | + geodir_sendEmail('', '', '[email protected]', 'Test User', 'Test subject', 'Test message', '', 'send_enquiry'); |
|
27 | 27 | $output = ob_get_clean(); |
28 | 28 | remove_filter('wp_mail', 'print_mail'); |
29 | - $this->assertContains( 'Website Enquiry', $output ); |
|
30 | - $this->assertContains( 'An enquiry has been sent from', $output ); |
|
31 | - $this->assertContains( '[email protected]', $output ); |
|
32 | - $this->assertContains( 'ADMIN BCC COPY', $output ); |
|
29 | + $this->assertContains('Website Enquiry', $output); |
|
30 | + $this->assertContains('An enquiry has been sent from', $output); |
|
31 | + $this->assertContains('[email protected]', $output); |
|
32 | + $this->assertContains('ADMIN BCC COPY', $output); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | public function testForgotPassEmail() |
36 | 36 | { |
37 | 37 | add_filter('wp_mail', 'print_mail'); |
38 | 38 | ob_start(); |
39 | - geodir_sendEmail('','', '[email protected]', 'Test User', 'Test subject', 'Test message', '', 'forgot_password'); |
|
39 | + geodir_sendEmail('', '', '[email protected]', 'Test User', 'Test subject', 'Test message', '', 'forgot_password'); |
|
40 | 40 | $output = ob_get_clean(); |
41 | 41 | remove_filter('wp_mail', 'print_mail'); |
42 | - $this->assertContains( 'Your new password', $output ); |
|
43 | - $this->assertContains( 'You requested a new password for', $output ); |
|
44 | - $this->assertContains( '[email protected]', $output ); |
|
42 | + $this->assertContains('Your new password', $output); |
|
43 | + $this->assertContains('You requested a new password for', $output); |
|
44 | + $this->assertContains('[email protected]', $output); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | public function testRegistrationEmail() |
48 | 48 | { |
49 | 49 | add_filter('wp_mail', 'print_mail'); |
50 | 50 | ob_start(); |
51 | - geodir_sendEmail('','', '[email protected]', 'Test User', 'Test subject', 'Test message', '', 'registration'); |
|
51 | + geodir_sendEmail('', '', '[email protected]', 'Test User', 'Test subject', 'Test message', '', 'registration'); |
|
52 | 52 | $output = ob_get_clean(); |
53 | 53 | remove_filter('wp_mail', 'print_mail'); |
54 | - $this->assertContains( 'Your Log In Details', $output ); |
|
55 | - $this->assertContains( 'You can log in with the following information', $output ); |
|
56 | - $this->assertContains( '[email protected]', $output ); |
|
57 | - $this->assertContains( 'ADMIN BCC COPY', $output ); |
|
54 | + $this->assertContains('Your Log In Details', $output); |
|
55 | + $this->assertContains('You can log in with the following information', $output); |
|
56 | + $this->assertContains('[email protected]', $output); |
|
57 | + $this->assertContains('ADMIN BCC COPY', $output); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | public function testPostSubmitEmail() |
61 | 61 | { |
62 | 62 | add_filter('wp_mail', 'print_mail'); |
63 | 63 | ob_start(); |
64 | - geodir_sendEmail('','', '[email protected]', 'Test User', 'Test subject', 'Test message', '', 'post_submit'); |
|
64 | + geodir_sendEmail('', '', '[email protected]', 'Test User', 'Test subject', 'Test message', '', 'post_submit'); |
|
65 | 65 | $output = ob_get_clean(); |
66 | 66 | remove_filter('wp_mail', 'print_mail'); |
67 | - $this->assertContains( 'Post Submitted Successfully', $output ); |
|
68 | - $this->assertContains( 'You submitted the below listing information', $output ); |
|
69 | - $this->assertContains( '[email protected]', $output ); |
|
70 | - $this->assertContains( 'ADMIN BCC COPY', $output ); |
|
71 | - $this->assertContains( 'A new listing has been published', $output ); |
|
67 | + $this->assertContains('Post Submitted Successfully', $output); |
|
68 | + $this->assertContains('You submitted the below listing information', $output); |
|
69 | + $this->assertContains('[email protected]', $output); |
|
70 | + $this->assertContains('ADMIN BCC COPY', $output); |
|
71 | + $this->assertContains('A new listing has been published', $output); |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | public function testListingPublishedEmail() |
75 | 75 | { |
76 | 76 | add_filter('wp_mail', 'print_mail'); |
77 | 77 | ob_start(); |
78 | - geodir_sendEmail('','', '[email protected]', 'Test User', 'Test subject', 'Test message', '', 'listing_published'); |
|
78 | + geodir_sendEmail('', '', '[email protected]', 'Test User', 'Test subject', 'Test message', '', 'listing_published'); |
|
79 | 79 | $output = ob_get_clean(); |
80 | 80 | remove_filter('wp_mail', 'print_mail'); |
81 | - $this->assertContains( 'Listing Published Successfully', $output ); |
|
82 | - $this->assertContains( 'Your listing has been published', $output ); |
|
83 | - $this->assertContains( '[email protected]', $output ); |
|
84 | - $this->assertContains( 'ADMIN BCC COPY', $output ); |
|
81 | + $this->assertContains('Listing Published Successfully', $output); |
|
82 | + $this->assertContains('Your listing has been published', $output); |
|
83 | + $this->assertContains('[email protected]', $output); |
|
84 | + $this->assertContains('ADMIN BCC COPY', $output); |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | public function tearDown() |
@@ -29,7 +29,7 @@ |
||
29 | 29 | 'post_type' => 'gd_place' |
30 | 30 | ); |
31 | 31 | |
32 | - $all_posts = new WP_Query( $query_args ); |
|
32 | + $all_posts = new WP_Query($query_args); |
|
33 | 33 | |
34 | 34 | $total_posts = $all_posts->found_posts; |
35 | 35 |
@@ -1,50 +1,50 @@ |
||
1 | 1 | <?php |
2 | 2 | class TestDummyData extends WP_UnitTestCase |
3 | 3 | { |
4 | - public function setUp() |
|
5 | - { |
|
6 | - parent::setUp(); |
|
7 | - wp_set_current_user(1); |
|
8 | - geodir_delete_dummy_posts(); |
|
9 | - } |
|
4 | + public function setUp() |
|
5 | + { |
|
6 | + parent::setUp(); |
|
7 | + wp_set_current_user(1); |
|
8 | + geodir_delete_dummy_posts(); |
|
9 | + } |
|
10 | 10 | |
11 | - public function testCreatePlaces() |
|
12 | - { |
|
13 | - global $dummy_post_index, $city_bound_lat1, $city_bound_lng1, $city_bound_lat2, $city_bound_lng2; |
|
11 | + public function testCreatePlaces() |
|
12 | + { |
|
13 | + global $dummy_post_index, $city_bound_lat1, $city_bound_lng1, $city_bound_lat2, $city_bound_lng2; |
|
14 | 14 | |
15 | - global $geodir_post_custom_fields_cache; |
|
16 | - $geodir_post_custom_fields_cache = array(); |
|
15 | + global $geodir_post_custom_fields_cache; |
|
16 | + $geodir_post_custom_fields_cache = array(); |
|
17 | 17 | |
18 | - $city_bound_lat1 = 40.4960439; |
|
19 | - $city_bound_lng1 = -74.2557349; |
|
20 | - $city_bound_lat2 = 40.91525559999999; |
|
21 | - $city_bound_lng2 = -73.7002721; |
|
18 | + $city_bound_lat1 = 40.4960439; |
|
19 | + $city_bound_lng1 = -74.2557349; |
|
20 | + $city_bound_lat2 = 40.91525559999999; |
|
21 | + $city_bound_lng2 = -73.7002721; |
|
22 | 22 | |
23 | 23 | |
24 | - $dummy_post_index = 30; |
|
25 | - test_create_dummy_posts(30); |
|
24 | + $dummy_post_index = 30; |
|
25 | + test_create_dummy_posts(30); |
|
26 | 26 | |
27 | - $query_args = array( |
|
28 | - 'post_status' => 'publish', |
|
29 | - 'post_type' => 'gd_place' |
|
30 | - ); |
|
27 | + $query_args = array( |
|
28 | + 'post_status' => 'publish', |
|
29 | + 'post_type' => 'gd_place' |
|
30 | + ); |
|
31 | 31 | |
32 | - $all_posts = new WP_Query( $query_args ); |
|
32 | + $all_posts = new WP_Query( $query_args ); |
|
33 | 33 | |
34 | - $total_posts = $all_posts->found_posts; |
|
34 | + $total_posts = $all_posts->found_posts; |
|
35 | 35 | |
36 | - $this->assertTrue((int) $total_posts > 0); |
|
36 | + $this->assertTrue((int) $total_posts > 0); |
|
37 | 37 | |
38 | - } |
|
38 | + } |
|
39 | 39 | |
40 | - public function testDeletePlaces() |
|
41 | - { |
|
42 | - geodir_delete_dummy_posts(); |
|
43 | - } |
|
40 | + public function testDeletePlaces() |
|
41 | + { |
|
42 | + geodir_delete_dummy_posts(); |
|
43 | + } |
|
44 | 44 | |
45 | - public function tearDown() |
|
46 | - { |
|
47 | - parent::tearDown(); |
|
48 | - } |
|
45 | + public function tearDown() |
|
46 | + { |
|
47 | + parent::tearDown(); |
|
48 | + } |
|
49 | 49 | } |
50 | 50 | ?> |
51 | 51 | \ No newline at end of file |
@@ -1,19 +1,19 @@ |
||
1 | 1 | <?php |
2 | 2 | class ImportExport extends WP_UnitTestCase |
3 | 3 | { |
4 | - public function setUp() |
|
5 | - { |
|
6 | - parent::setUp(); |
|
7 | - } |
|
4 | + public function setUp() |
|
5 | + { |
|
6 | + parent::setUp(); |
|
7 | + } |
|
8 | 8 | |
9 | - public function testImportExport() |
|
10 | - { |
|
9 | + public function testImportExport() |
|
10 | + { |
|
11 | 11 | |
12 | - } |
|
12 | + } |
|
13 | 13 | |
14 | - public function tearDown() |
|
15 | - { |
|
16 | - parent::tearDown(); |
|
17 | - } |
|
14 | + public function tearDown() |
|
15 | + { |
|
16 | + parent::tearDown(); |
|
17 | + } |
|
18 | 18 | } |
19 | 19 | ?> |
20 | 20 | \ No newline at end of file |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | |
81 | 81 | if($output_type=='select'){ |
82 | 82 | $favourite_links .= '<option ' . $selected . ' value="' . $post_type_link . '">' . __(ucfirst($name), 'geodirectory') . '</option>'; |
83 | - }elseif($output_type=='link'){ |
|
83 | + } elseif($output_type=='link'){ |
|
84 | 84 | $favourite_links[] = '<a href="' . $post_type_link . '">' . __(ucfirst($name), 'geodirectory') . '</a>'; |
85 | 85 | } |
86 | 86 | |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | </select> |
103 | 103 | </li> |
104 | 104 | <?php |
105 | - }elseif($output_type=='link'){ |
|
105 | + } elseif($output_type=='link'){ |
|
106 | 106 | if(!empty($favourite_links)){ |
107 | 107 | echo implode(" | ",$favourite_links); |
108 | 108 | } |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | $listing_link = apply_filters('geodir_dashboard_link_my_listing', $listing_link, $key, $user_id); |
149 | 149 | if($output_type=='select') { |
150 | 150 | $listing_links .= '<option ' . $selected . ' value="' . $listing_link . '">' . __(ucfirst($name), 'geodirectory') . '</option>'; |
151 | - }elseif($output_type=='link'){ |
|
151 | + } elseif($output_type=='link'){ |
|
152 | 152 | $listing_links [] = '<a href="' .$listing_link . '">' . __(ucfirst($name), 'geodirectory') . '</a>'; |
153 | 153 | } |
154 | 154 | } |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | </select> |
169 | 169 | </li> |
170 | 170 | <?php |
171 | - }elseif($output_type=='link'){ |
|
171 | + } elseif($output_type=='link'){ |
|
172 | 172 | if(!empty($listing_links )){ |
173 | 173 | echo implode(" | ",$listing_links ); |
174 | 174 | } |
@@ -13,28 +13,28 @@ discard block |
||
13 | 13 | */ |
14 | 14 | function geodir_user_favourite_listing_count($user_id=false) |
15 | 15 | { |
16 | - global $wpdb, $plugin_prefix, $current_user; |
|
16 | + global $wpdb, $plugin_prefix, $current_user; |
|
17 | 17 | |
18 | - if(!$user_id){$user_id = $current_user->ID;} |
|
19 | - if(!$user_id){return array();} |
|
18 | + if(!$user_id){$user_id = $current_user->ID;} |
|
19 | + if(!$user_id){return array();} |
|
20 | 20 | |
21 | - $user_favorites = get_user_meta($user_id, 'gd_user_favourite_post', true); |
|
22 | - $all_posts = get_option('geodir_favorite_link_user_dashboard'); |
|
21 | + $user_favorites = get_user_meta($user_id, 'gd_user_favourite_post', true); |
|
22 | + $all_posts = get_option('geodir_favorite_link_user_dashboard'); |
|
23 | 23 | |
24 | - $user_listing = array(); |
|
25 | - if (is_array($all_posts) && !empty($all_posts) && is_array($user_favorites) && !empty($user_favorites)) { |
|
26 | - $user_favorites = "'" . implode("','", $user_favorites) . "'"; |
|
24 | + $user_listing = array(); |
|
25 | + if (is_array($all_posts) && !empty($all_posts) && is_array($user_favorites) && !empty($user_favorites)) { |
|
26 | + $user_favorites = "'" . implode("','", $user_favorites) . "'"; |
|
27 | 27 | |
28 | - foreach ($all_posts as $ptype) { |
|
29 | - $total_posts = $wpdb->get_var("SELECT count( ID ) FROM " . $wpdb->prefix . "posts WHERE post_type='" . $ptype . "' AND post_status = 'publish' AND ID IN (" . $user_favorites . ")"); |
|
28 | + foreach ($all_posts as $ptype) { |
|
29 | + $total_posts = $wpdb->get_var("SELECT count( ID ) FROM " . $wpdb->prefix . "posts WHERE post_type='" . $ptype . "' AND post_status = 'publish' AND ID IN (" . $user_favorites . ")"); |
|
30 | 30 | |
31 | - if ($total_posts > 0) { |
|
32 | - $user_listing[$ptype] = $total_posts; |
|
33 | - } |
|
34 | - } |
|
35 | - } |
|
31 | + if ($total_posts > 0) { |
|
32 | + $user_listing[$ptype] = $total_posts; |
|
33 | + } |
|
34 | + } |
|
35 | + } |
|
36 | 36 | |
37 | - return $user_listing; |
|
37 | + return $user_listing; |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | |
@@ -47,51 +47,51 @@ discard block |
||
47 | 47 | */ |
48 | 48 | |
49 | 49 | function geodir_user_show_favourites($user_id='',$output_type='select'){ |
50 | - // My Favourites in Dashboard |
|
51 | - $show_favorite_link_user_dashboard = get_option('geodir_favorite_link_user_dashboard'); |
|
52 | - $user_favourite = geodir_user_favourite_listing_count($user_id); |
|
53 | - |
|
54 | - if (!empty($show_favorite_link_user_dashboard) && !empty($user_favourite)) { |
|
55 | - $favourite_links = ''; |
|
56 | - $post_types = geodir_get_posttypes('object'); |
|
57 | - |
|
58 | - $author_link = get_author_posts_url($user_id); |
|
59 | - $author_link = geodir_getlink($author_link, array('geodir_dashbord' => 'true'), false); |
|
60 | - |
|
61 | - foreach ($post_types as $key => $postobj) { |
|
62 | - if (in_array($key, $show_favorite_link_user_dashboard) && array_key_exists($key, $user_favourite)) { |
|
63 | - $name = $postobj->labels->name; |
|
64 | - $post_type_link = geodir_getlink($author_link, array('stype' => $key, 'list' => 'favourite'), false); |
|
65 | - |
|
66 | - $selected = ''; |
|
67 | - |
|
68 | - if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite' && isset($_REQUEST['stype']) && $_REQUEST['stype'] == $key && isset($_REQUEST['geodir_dashbord'])) { |
|
69 | - $selected = 'selected="selected"'; |
|
70 | - } |
|
71 | - /** |
|
72 | - * Filter favorite listing link. |
|
73 | - * |
|
74 | - * @since 1.0.0 |
|
75 | - * @param string $post_type_link Favorite listing link. |
|
76 | - * @param string $key Favorite listing array key. |
|
77 | - * @param int $current_user->ID Current user ID. |
|
78 | - */ |
|
79 | - $post_type_link = apply_filters('geodir_dashboard_link_favorite_listing', $post_type_link, $key, $user_id); |
|
80 | - |
|
81 | - if($output_type=='select'){ |
|
82 | - $favourite_links .= '<option ' . $selected . ' value="' . $post_type_link . '">' . __(ucfirst($name), 'geodirectory') . '</option>'; |
|
83 | - }elseif($output_type=='link'){ |
|
84 | - $favourite_links[] = '<a href="' . $post_type_link . '">' . __(ucfirst($name), 'geodirectory') . '</a>'; |
|
85 | - } |
|
86 | - |
|
87 | - |
|
88 | - } |
|
89 | - } |
|
90 | - |
|
91 | - if ($favourite_links != '') { |
|
92 | - $user = get_user_by( 'ID', $user_id ); |
|
93 | - if($output_type=='select') { |
|
94 | - ?> |
|
50 | + // My Favourites in Dashboard |
|
51 | + $show_favorite_link_user_dashboard = get_option('geodir_favorite_link_user_dashboard'); |
|
52 | + $user_favourite = geodir_user_favourite_listing_count($user_id); |
|
53 | + |
|
54 | + if (!empty($show_favorite_link_user_dashboard) && !empty($user_favourite)) { |
|
55 | + $favourite_links = ''; |
|
56 | + $post_types = geodir_get_posttypes('object'); |
|
57 | + |
|
58 | + $author_link = get_author_posts_url($user_id); |
|
59 | + $author_link = geodir_getlink($author_link, array('geodir_dashbord' => 'true'), false); |
|
60 | + |
|
61 | + foreach ($post_types as $key => $postobj) { |
|
62 | + if (in_array($key, $show_favorite_link_user_dashboard) && array_key_exists($key, $user_favourite)) { |
|
63 | + $name = $postobj->labels->name; |
|
64 | + $post_type_link = geodir_getlink($author_link, array('stype' => $key, 'list' => 'favourite'), false); |
|
65 | + |
|
66 | + $selected = ''; |
|
67 | + |
|
68 | + if (isset($_REQUEST['list']) && $_REQUEST['list'] == 'favourite' && isset($_REQUEST['stype']) && $_REQUEST['stype'] == $key && isset($_REQUEST['geodir_dashbord'])) { |
|
69 | + $selected = 'selected="selected"'; |
|
70 | + } |
|
71 | + /** |
|
72 | + * Filter favorite listing link. |
|
73 | + * |
|
74 | + * @since 1.0.0 |
|
75 | + * @param string $post_type_link Favorite listing link. |
|
76 | + * @param string $key Favorite listing array key. |
|
77 | + * @param int $current_user->ID Current user ID. |
|
78 | + */ |
|
79 | + $post_type_link = apply_filters('geodir_dashboard_link_favorite_listing', $post_type_link, $key, $user_id); |
|
80 | + |
|
81 | + if($output_type=='select'){ |
|
82 | + $favourite_links .= '<option ' . $selected . ' value="' . $post_type_link . '">' . __(ucfirst($name), 'geodirectory') . '</option>'; |
|
83 | + }elseif($output_type=='link'){ |
|
84 | + $favourite_links[] = '<a href="' . $post_type_link . '">' . __(ucfirst($name), 'geodirectory') . '</a>'; |
|
85 | + } |
|
86 | + |
|
87 | + |
|
88 | + } |
|
89 | + } |
|
90 | + |
|
91 | + if ($favourite_links != '') { |
|
92 | + $user = get_user_by( 'ID', $user_id ); |
|
93 | + if($output_type=='select') { |
|
94 | + ?> |
|
95 | 95 | <li> |
96 | 96 | <select id="geodir_my_favourites" class="chosen_select" onchange="window.location.href=this.value" |
97 | 97 | option-autoredirect="1" name="geodir_my_favourites" option-ajaxchosen="false" |
@@ -102,62 +102,62 @@ discard block |
||
102 | 102 | </select> |
103 | 103 | </li> |
104 | 104 | <?php |
105 | - }elseif($output_type=='link'){ |
|
106 | - if(!empty($favourite_links)){ |
|
107 | - echo implode(" | ",$favourite_links); |
|
108 | - } |
|
109 | - |
|
110 | - } |
|
111 | - } |
|
112 | - } |
|
105 | + }elseif($output_type=='link'){ |
|
106 | + if(!empty($favourite_links)){ |
|
107 | + echo implode(" | ",$favourite_links); |
|
108 | + } |
|
109 | + |
|
110 | + } |
|
111 | + } |
|
112 | + } |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | |
116 | 116 | |
117 | 117 | function geodir_user_show_listings($user_id='',$output_type='select'){ |
118 | 118 | |
119 | - $show_listing_link_user_dashboard = get_option('geodir_listing_link_user_dashboard'); |
|
120 | - $user_listing = geodir_user_post_listing_count($user_id); |
|
121 | - |
|
122 | - if (!empty($show_listing_link_user_dashboard) && !empty($user_listing)) { |
|
123 | - $listing_links = ''; |
|
124 | - |
|
125 | - $post_types = geodir_get_posttypes('object'); |
|
126 | - |
|
127 | - $author_link = get_author_posts_url($user_id); |
|
128 | - $author_link = geodir_getlink($author_link, array('geodir_dashbord' => 'true'), false); |
|
129 | - |
|
130 | - foreach ($post_types as $key => $postobj) { |
|
131 | - if (in_array($key, $show_listing_link_user_dashboard) && array_key_exists($key, $user_listing)) { |
|
132 | - $name = $postobj->labels->name; |
|
133 | - $listing_link = geodir_getlink($author_link, array('stype' => $key), false); |
|
134 | - |
|
135 | - $selected = ''; |
|
136 | - if (!isset($_REQUEST['list']) && isset($_REQUEST['geodir_dashbord']) && isset($_REQUEST['stype']) && $_REQUEST['stype'] == $key) { |
|
137 | - $selected = 'selected="selected"'; |
|
138 | - } |
|
139 | - |
|
140 | - /** |
|
141 | - * Filter my listing link. |
|
142 | - * |
|
143 | - * @since 1.0.0 |
|
144 | - * @param string $listing_link My listing link. |
|
145 | - * @param string $key My listing array key. |
|
146 | - * @param int $current_user->ID Current user ID. |
|
147 | - */ |
|
148 | - $listing_link = apply_filters('geodir_dashboard_link_my_listing', $listing_link, $key, $user_id); |
|
149 | - if($output_type=='select') { |
|
150 | - $listing_links .= '<option ' . $selected . ' value="' . $listing_link . '">' . __(ucfirst($name), 'geodirectory') . '</option>'; |
|
151 | - }elseif($output_type=='link'){ |
|
152 | - $listing_links [] = '<a href="' .$listing_link . '">' . __(ucfirst($name), 'geodirectory') . '</a>'; |
|
153 | - } |
|
154 | - } |
|
155 | - } |
|
156 | - |
|
157 | - if ($listing_links != '') { |
|
158 | - $user = get_user_by( 'ID', $user_id ); |
|
159 | - if($output_type=='select') { |
|
160 | - ?> |
|
119 | + $show_listing_link_user_dashboard = get_option('geodir_listing_link_user_dashboard'); |
|
120 | + $user_listing = geodir_user_post_listing_count($user_id); |
|
121 | + |
|
122 | + if (!empty($show_listing_link_user_dashboard) && !empty($user_listing)) { |
|
123 | + $listing_links = ''; |
|
124 | + |
|
125 | + $post_types = geodir_get_posttypes('object'); |
|
126 | + |
|
127 | + $author_link = get_author_posts_url($user_id); |
|
128 | + $author_link = geodir_getlink($author_link, array('geodir_dashbord' => 'true'), false); |
|
129 | + |
|
130 | + foreach ($post_types as $key => $postobj) { |
|
131 | + if (in_array($key, $show_listing_link_user_dashboard) && array_key_exists($key, $user_listing)) { |
|
132 | + $name = $postobj->labels->name; |
|
133 | + $listing_link = geodir_getlink($author_link, array('stype' => $key), false); |
|
134 | + |
|
135 | + $selected = ''; |
|
136 | + if (!isset($_REQUEST['list']) && isset($_REQUEST['geodir_dashbord']) && isset($_REQUEST['stype']) && $_REQUEST['stype'] == $key) { |
|
137 | + $selected = 'selected="selected"'; |
|
138 | + } |
|
139 | + |
|
140 | + /** |
|
141 | + * Filter my listing link. |
|
142 | + * |
|
143 | + * @since 1.0.0 |
|
144 | + * @param string $listing_link My listing link. |
|
145 | + * @param string $key My listing array key. |
|
146 | + * @param int $current_user->ID Current user ID. |
|
147 | + */ |
|
148 | + $listing_link = apply_filters('geodir_dashboard_link_my_listing', $listing_link, $key, $user_id); |
|
149 | + if($output_type=='select') { |
|
150 | + $listing_links .= '<option ' . $selected . ' value="' . $listing_link . '">' . __(ucfirst($name), 'geodirectory') . '</option>'; |
|
151 | + }elseif($output_type=='link'){ |
|
152 | + $listing_links [] = '<a href="' .$listing_link . '">' . __(ucfirst($name), 'geodirectory') . '</a>'; |
|
153 | + } |
|
154 | + } |
|
155 | + } |
|
156 | + |
|
157 | + if ($listing_links != '') { |
|
158 | + $user = get_user_by( 'ID', $user_id ); |
|
159 | + if($output_type=='select') { |
|
160 | + ?> |
|
161 | 161 | <li> |
162 | 162 | <select id="geodir_my_listings" class="chosen_select" onchange="window.location.href=this.value" |
163 | 163 | option-autoredirect="1" name="geodir_my_listings" option-ajaxchosen="false" |
@@ -168,13 +168,13 @@ discard block |
||
168 | 168 | </select> |
169 | 169 | </li> |
170 | 170 | <?php |
171 | - }elseif($output_type=='link'){ |
|
172 | - if(!empty($listing_links )){ |
|
173 | - echo implode(" | ",$listing_links ); |
|
174 | - } |
|
175 | - |
|
176 | - } |
|
177 | - } |
|
178 | - } |
|
171 | + }elseif($output_type=='link'){ |
|
172 | + if(!empty($listing_links )){ |
|
173 | + echo implode(" | ",$listing_links ); |
|
174 | + } |
|
175 | + |
|
176 | + } |
|
177 | + } |
|
178 | + } |
|
179 | 179 | |
180 | 180 | } |
@@ -11,22 +11,22 @@ discard block |
||
11 | 11 | * @global string $plugin_prefix Geodirectory plugin table prefix. |
12 | 12 | * @return array User listing count for each post type. |
13 | 13 | */ |
14 | -function geodir_user_favourite_listing_count($user_id=false) |
|
14 | +function geodir_user_favourite_listing_count($user_id = false) |
|
15 | 15 | { |
16 | 16 | global $wpdb, $plugin_prefix, $current_user; |
17 | 17 | |
18 | - if(!$user_id){$user_id = $current_user->ID;} |
|
19 | - if(!$user_id){return array();} |
|
18 | + if (!$user_id) {$user_id = $current_user->ID; } |
|
19 | + if (!$user_id) {return array(); } |
|
20 | 20 | |
21 | 21 | $user_favorites = get_user_meta($user_id, 'gd_user_favourite_post', true); |
22 | 22 | $all_posts = get_option('geodir_favorite_link_user_dashboard'); |
23 | 23 | |
24 | 24 | $user_listing = array(); |
25 | 25 | if (is_array($all_posts) && !empty($all_posts) && is_array($user_favorites) && !empty($user_favorites)) { |
26 | - $user_favorites = "'" . implode("','", $user_favorites) . "'"; |
|
26 | + $user_favorites = "'".implode("','", $user_favorites)."'"; |
|
27 | 27 | |
28 | 28 | foreach ($all_posts as $ptype) { |
29 | - $total_posts = $wpdb->get_var("SELECT count( ID ) FROM " . $wpdb->prefix . "posts WHERE post_type='" . $ptype . "' AND post_status = 'publish' AND ID IN (" . $user_favorites . ")"); |
|
29 | + $total_posts = $wpdb->get_var("SELECT count( ID ) FROM ".$wpdb->prefix."posts WHERE post_type='".$ptype."' AND post_status = 'publish' AND ID IN (".$user_favorites.")"); |
|
30 | 30 | |
31 | 31 | if ($total_posts > 0) { |
32 | 32 | $user_listing[$ptype] = $total_posts; |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | * @package GeoDirectory |
47 | 47 | */ |
48 | 48 | |
49 | -function geodir_user_show_favourites($user_id='',$output_type='select'){ |
|
49 | +function geodir_user_show_favourites($user_id = '', $output_type = 'select') { |
|
50 | 50 | // My Favourites in Dashboard |
51 | 51 | $show_favorite_link_user_dashboard = get_option('geodir_favorite_link_user_dashboard'); |
52 | 52 | $user_favourite = geodir_user_favourite_listing_count($user_id); |
@@ -78,10 +78,10 @@ discard block |
||
78 | 78 | */ |
79 | 79 | $post_type_link = apply_filters('geodir_dashboard_link_favorite_listing', $post_type_link, $key, $user_id); |
80 | 80 | |
81 | - if($output_type=='select'){ |
|
82 | - $favourite_links .= '<option ' . $selected . ' value="' . $post_type_link . '">' . __(ucfirst($name), 'geodirectory') . '</option>'; |
|
83 | - }elseif($output_type=='link'){ |
|
84 | - $favourite_links[] = '<a href="' . $post_type_link . '">' . __(ucfirst($name), 'geodirectory') . '</a>'; |
|
81 | + if ($output_type == 'select') { |
|
82 | + $favourite_links .= '<option '.$selected.' value="'.$post_type_link.'">'.__(ucfirst($name), 'geodirectory').'</option>'; |
|
83 | + }elseif ($output_type == 'link') { |
|
84 | + $favourite_links[] = '<a href="'.$post_type_link.'">'.__(ucfirst($name), 'geodirectory').'</a>'; |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | |
@@ -89,8 +89,8 @@ discard block |
||
89 | 89 | } |
90 | 90 | |
91 | 91 | if ($favourite_links != '') { |
92 | - $user = get_user_by( 'ID', $user_id ); |
|
93 | - if($output_type=='select') { |
|
92 | + $user = get_user_by('ID', $user_id); |
|
93 | + if ($output_type == 'select') { |
|
94 | 94 | ?> |
95 | 95 | <li> |
96 | 96 | <select id="geodir_my_favourites" class="chosen_select" onchange="window.location.href=this.value" |
@@ -102,9 +102,9 @@ discard block |
||
102 | 102 | </select> |
103 | 103 | </li> |
104 | 104 | <?php |
105 | - }elseif($output_type=='link'){ |
|
106 | - if(!empty($favourite_links)){ |
|
107 | - echo implode(" | ",$favourite_links); |
|
105 | + }elseif ($output_type == 'link') { |
|
106 | + if (!empty($favourite_links)) { |
|
107 | + echo implode(" | ", $favourite_links); |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | } |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | |
115 | 115 | |
116 | 116 | |
117 | -function geodir_user_show_listings($user_id='',$output_type='select'){ |
|
117 | +function geodir_user_show_listings($user_id = '', $output_type = 'select') { |
|
118 | 118 | |
119 | 119 | $show_listing_link_user_dashboard = get_option('geodir_listing_link_user_dashboard'); |
120 | 120 | $user_listing = geodir_user_post_listing_count($user_id); |
@@ -146,17 +146,17 @@ discard block |
||
146 | 146 | * @param int $current_user->ID Current user ID. |
147 | 147 | */ |
148 | 148 | $listing_link = apply_filters('geodir_dashboard_link_my_listing', $listing_link, $key, $user_id); |
149 | - if($output_type=='select') { |
|
150 | - $listing_links .= '<option ' . $selected . ' value="' . $listing_link . '">' . __(ucfirst($name), 'geodirectory') . '</option>'; |
|
151 | - }elseif($output_type=='link'){ |
|
152 | - $listing_links [] = '<a href="' .$listing_link . '">' . __(ucfirst($name), 'geodirectory') . '</a>'; |
|
149 | + if ($output_type == 'select') { |
|
150 | + $listing_links .= '<option '.$selected.' value="'.$listing_link.'">'.__(ucfirst($name), 'geodirectory').'</option>'; |
|
151 | + }elseif ($output_type == 'link') { |
|
152 | + $listing_links [] = '<a href="'.$listing_link.'">'.__(ucfirst($name), 'geodirectory').'</a>'; |
|
153 | 153 | } |
154 | 154 | } |
155 | 155 | } |
156 | 156 | |
157 | 157 | if ($listing_links != '') { |
158 | - $user = get_user_by( 'ID', $user_id ); |
|
159 | - if($output_type=='select') { |
|
158 | + $user = get_user_by('ID', $user_id); |
|
159 | + if ($output_type == 'select') { |
|
160 | 160 | ?> |
161 | 161 | <li> |
162 | 162 | <select id="geodir_my_listings" class="chosen_select" onchange="window.location.href=this.value" |
@@ -168,9 +168,9 @@ discard block |
||
168 | 168 | </select> |
169 | 169 | </li> |
170 | 170 | <?php |
171 | - }elseif($output_type=='link'){ |
|
172 | - if(!empty($listing_links )){ |
|
173 | - echo implode(" | ",$listing_links ); |
|
171 | + }elseif ($output_type == 'link') { |
|
172 | + if (!empty($listing_links)) { |
|
173 | + echo implode(" | ", $listing_links); |
|
174 | 174 | } |
175 | 175 | |
176 | 176 | } |
@@ -16,87 +16,87 @@ discard block |
||
16 | 16 | */ |
17 | 17 | $general_options = apply_filters('geodir_general_options', array( |
18 | 18 | |
19 | - array('name' => __('General', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'general_options'), |
|
20 | - |
|
21 | - array('name' => __('General Options', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'general_options'), |
|
22 | - |
|
23 | - array( |
|
24 | - 'name' => __('Sender name', 'geodirectory'), |
|
25 | - 'desc' => __('(Name that will be shown as email sender when users receive emails from this site)', 'geodirectory'), |
|
26 | - 'id' => 'site_email_name', |
|
27 | - 'type' => 'text', |
|
28 | - 'css' => 'min-width:300px;', |
|
29 | - 'std' => get_bloginfo('name') // Default value for the page title - changed in settings |
|
30 | - ), |
|
31 | - |
|
32 | - array( |
|
33 | - 'name' => __('Email address', 'geodirectory'), |
|
34 | - 'desc' => __('(Emails to users will be sent via this mail ID)', 'geodirectory'), |
|
35 | - 'id' => 'site_email', |
|
36 | - 'type' => 'text', |
|
37 | - 'css' => 'min-width:300px;', |
|
38 | - 'std' => get_bloginfo('admin_email') // Default value for the page title - changed in settings |
|
39 | - ), |
|
40 | - array( |
|
41 | - 'name' => __('Allow user to see wp-admin area', 'geodirectory'), |
|
42 | - 'desc' => __('Yes', 'geodirectory'), |
|
43 | - 'id' => 'geodir_allow_wpadmin', |
|
44 | - 'std' => '1', |
|
45 | - 'type' => 'radio', |
|
46 | - 'value' => '1', |
|
47 | - 'radiogroup' => 'start' |
|
48 | - ), |
|
49 | - array( |
|
50 | - 'name' => __('Allow user to see wp-admin area', 'geodirectory'), |
|
51 | - 'desc' => __('No', 'geodirectory'), |
|
52 | - 'id' => 'geodir_allow_wpadmin', |
|
53 | - 'std' => '0', |
|
54 | - 'type' => 'radio', |
|
55 | - 'value' => '0', |
|
56 | - 'radiogroup' => 'end' |
|
57 | - ), |
|
58 | - |
|
59 | - array( |
|
60 | - 'name' => __('Allow user to choose own password', 'geodirectory'), |
|
61 | - 'desc' => __('Yes', 'geodirectory'), |
|
62 | - 'id' => 'geodir_allow_cpass', |
|
63 | - 'std' => '1', |
|
64 | - 'type' => 'radio', |
|
65 | - 'value' => '1', |
|
66 | - 'radiogroup' => 'start' |
|
67 | - ), |
|
68 | - array( |
|
69 | - 'name' => __('Allow user to choose own password', 'geodirectory'), |
|
70 | - 'desc' => __('No', 'geodirectory'), |
|
71 | - 'id' => 'geodir_allow_cpass', |
|
72 | - 'std' => '0', |
|
73 | - 'type' => 'radio', |
|
74 | - 'value' => '0', |
|
75 | - 'radiogroup' => 'end' |
|
76 | - ), |
|
77 | - array( |
|
78 | - 'name' => __('Disable rating on comments', 'geodirectory'), |
|
79 | - 'desc' => __('Disable rating without disabling comments on listings', 'geodirectory'), |
|
80 | - 'id' => 'geodir_disable_rating', |
|
81 | - 'type' => 'checkbox', |
|
82 | - 'std' => '0' |
|
83 | - ), |
|
84 | - array( |
|
85 | - 'name' => __('User deleted posts go to trash', 'geodirectory'), |
|
86 | - 'desc' => __('If checked a user deleted post will go to trash, otherwise it will be permanently deleted', 'geodirectory'), |
|
87 | - 'id' => 'geodir_disable_perm_delete', |
|
88 | - 'type' => 'checkbox', |
|
89 | - 'std' => '1' |
|
90 | - ), |
|
91 | - array( |
|
92 | - 'name' => __('Max upload file size(in mb)', 'geodirectory'), |
|
93 | - 'desc' => __('(Maximum upload file size in MB, 1 MB = 1024 KB. Must be greater then 0(ZERO), for ex: 2. This setting will overwrite the max upload file size limit in image/file upload & import listings for entire GeoDirectory core + GeoDirectory plugins.)', 'geodirectory'), |
|
94 | - 'id' => 'geodir_upload_max_filesize', |
|
95 | - 'type' => 'text', |
|
96 | - 'css' => 'min-width:300px;', |
|
97 | - 'std' => '2' |
|
98 | - ), |
|
99 | - array('type' => 'sectionend', 'id' => 'general_options'), |
|
19 | + array('name' => __('General', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'general_options'), |
|
20 | + |
|
21 | + array('name' => __('General Options', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'general_options'), |
|
22 | + |
|
23 | + array( |
|
24 | + 'name' => __('Sender name', 'geodirectory'), |
|
25 | + 'desc' => __('(Name that will be shown as email sender when users receive emails from this site)', 'geodirectory'), |
|
26 | + 'id' => 'site_email_name', |
|
27 | + 'type' => 'text', |
|
28 | + 'css' => 'min-width:300px;', |
|
29 | + 'std' => get_bloginfo('name') // Default value for the page title - changed in settings |
|
30 | + ), |
|
31 | + |
|
32 | + array( |
|
33 | + 'name' => __('Email address', 'geodirectory'), |
|
34 | + 'desc' => __('(Emails to users will be sent via this mail ID)', 'geodirectory'), |
|
35 | + 'id' => 'site_email', |
|
36 | + 'type' => 'text', |
|
37 | + 'css' => 'min-width:300px;', |
|
38 | + 'std' => get_bloginfo('admin_email') // Default value for the page title - changed in settings |
|
39 | + ), |
|
40 | + array( |
|
41 | + 'name' => __('Allow user to see wp-admin area', 'geodirectory'), |
|
42 | + 'desc' => __('Yes', 'geodirectory'), |
|
43 | + 'id' => 'geodir_allow_wpadmin', |
|
44 | + 'std' => '1', |
|
45 | + 'type' => 'radio', |
|
46 | + 'value' => '1', |
|
47 | + 'radiogroup' => 'start' |
|
48 | + ), |
|
49 | + array( |
|
50 | + 'name' => __('Allow user to see wp-admin area', 'geodirectory'), |
|
51 | + 'desc' => __('No', 'geodirectory'), |
|
52 | + 'id' => 'geodir_allow_wpadmin', |
|
53 | + 'std' => '0', |
|
54 | + 'type' => 'radio', |
|
55 | + 'value' => '0', |
|
56 | + 'radiogroup' => 'end' |
|
57 | + ), |
|
58 | + |
|
59 | + array( |
|
60 | + 'name' => __('Allow user to choose own password', 'geodirectory'), |
|
61 | + 'desc' => __('Yes', 'geodirectory'), |
|
62 | + 'id' => 'geodir_allow_cpass', |
|
63 | + 'std' => '1', |
|
64 | + 'type' => 'radio', |
|
65 | + 'value' => '1', |
|
66 | + 'radiogroup' => 'start' |
|
67 | + ), |
|
68 | + array( |
|
69 | + 'name' => __('Allow user to choose own password', 'geodirectory'), |
|
70 | + 'desc' => __('No', 'geodirectory'), |
|
71 | + 'id' => 'geodir_allow_cpass', |
|
72 | + 'std' => '0', |
|
73 | + 'type' => 'radio', |
|
74 | + 'value' => '0', |
|
75 | + 'radiogroup' => 'end' |
|
76 | + ), |
|
77 | + array( |
|
78 | + 'name' => __('Disable rating on comments', 'geodirectory'), |
|
79 | + 'desc' => __('Disable rating without disabling comments on listings', 'geodirectory'), |
|
80 | + 'id' => 'geodir_disable_rating', |
|
81 | + 'type' => 'checkbox', |
|
82 | + 'std' => '0' |
|
83 | + ), |
|
84 | + array( |
|
85 | + 'name' => __('User deleted posts go to trash', 'geodirectory'), |
|
86 | + 'desc' => __('If checked a user deleted post will go to trash, otherwise it will be permanently deleted', 'geodirectory'), |
|
87 | + 'id' => 'geodir_disable_perm_delete', |
|
88 | + 'type' => 'checkbox', |
|
89 | + 'std' => '1' |
|
90 | + ), |
|
91 | + array( |
|
92 | + 'name' => __('Max upload file size(in mb)', 'geodirectory'), |
|
93 | + 'desc' => __('(Maximum upload file size in MB, 1 MB = 1024 KB. Must be greater then 0(ZERO), for ex: 2. This setting will overwrite the max upload file size limit in image/file upload & import listings for entire GeoDirectory core + GeoDirectory plugins.)', 'geodirectory'), |
|
94 | + 'id' => 'geodir_upload_max_filesize', |
|
95 | + 'type' => 'text', |
|
96 | + 'css' => 'min-width:300px;', |
|
97 | + 'std' => '2' |
|
98 | + ), |
|
99 | + array('type' => 'sectionend', 'id' => 'general_options'), |
|
100 | 100 | |
101 | 101 | ));/* General Options End*/ |
102 | 102 | |
@@ -108,95 +108,95 @@ discard block |
||
108 | 108 | */ |
109 | 109 | $google_analytic_settings = apply_filters('geodir_google_analytic_settings', array( |
110 | 110 | |
111 | - array('name' => __('Google Analytics', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'google_analytic_settings'), |
|
112 | - |
|
113 | - array('name' => __('Google Analytic Settings', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'google_analytic_settings'), |
|
114 | - |
|
115 | - |
|
116 | - |
|
117 | - array( |
|
118 | - 'name' => __('Show business owner google analytics stats?', 'geodirectory'), |
|
119 | - 'desc' => __('Yes', 'geodirectory'), |
|
120 | - 'id' => 'geodir_ga_stats', |
|
121 | - 'std' => '0', |
|
122 | - 'type' => 'radio', |
|
123 | - 'value' => '1', |
|
124 | - 'radiogroup' => 'start' |
|
125 | - ), |
|
126 | - array( |
|
127 | - 'name' => __('Show business owner Google Analytics stats?', 'geodirectory'), |
|
128 | - 'desc' => __('No', 'geodirectory'), |
|
129 | - 'id' => 'geodir_ga_stats', |
|
130 | - 'std' => '1', |
|
131 | - 'type' => 'radio', |
|
132 | - 'value' => '0', |
|
133 | - 'radiogroup' => 'end' |
|
134 | - ), |
|
135 | - |
|
136 | - array( |
|
137 | - 'name' => __('Google analytics "Profile ID(ie: ga:12345678)?', 'geodirectory') . ' ' . |
|
138 | - '<a target="_blank" href="https://docs.wpgeodirectory.com/gd-core-plugin-google-analytics/">' . __('help', 'geodirectory') . '</a>', |
|
139 | - 'desc' => '', |
|
140 | - 'id' => 'geodir_ga_id', |
|
141 | - 'type' => 'text', |
|
142 | - 'css' => 'min-width:300px;', |
|
143 | - 'std' => '' // Default value for the page title - changed in settings |
|
144 | - ), |
|
145 | - |
|
146 | - array( |
|
147 | - 'name' => __('Client ID', 'geodirectory') . ' ' . |
|
148 | - '<a target="_blank" href="https://docs.wpgeodirectory.com/gd-core-plugin-google-analytics/">' . __('help', 'geodirectory') . '</a>', |
|
149 | - 'desc' => '', |
|
150 | - 'id' => 'geodir_ga_client_id', |
|
151 | - 'type' => 'text', |
|
152 | - 'css' => 'min-width:300px;', |
|
153 | - 'std' => '' // Default value for the page title - changed in settings |
|
154 | - ), |
|
155 | - |
|
156 | - array( |
|
157 | - 'name' => __('Client secret', 'geodirectory') . ' ' . |
|
158 | - '<a target="_blank" href="https://docs.wpgeodirectory.com/gd-core-plugin-google-analytics/">' . __('help', 'geodirectory') . '</a>', |
|
159 | - 'desc' => '', |
|
160 | - 'id' => 'geodir_ga_client_secret', |
|
161 | - 'type' => 'password', |
|
162 | - 'css' => 'min-width:300px;', |
|
163 | - 'std' => '' // Default value for the page title - changed in settings |
|
164 | - ), |
|
165 | - |
|
166 | - array( |
|
167 | - 'name' => __('Google analytics access', 'geodirectory'), |
|
168 | - 'desc' => '', |
|
169 | - 'id' => 'geodir_ga_token', |
|
170 | - 'type' => 'google_analytics', |
|
171 | - 'css' => 'min-width:300px;', |
|
172 | - 'std' => '' // Default value for the page title - changed in settings |
|
173 | - ), |
|
174 | - |
|
175 | - |
|
176 | - array( |
|
177 | - 'name' => __('Google analytics tracking code', 'geodirectory'), |
|
178 | - 'desc' => '', |
|
179 | - 'id' => 'geodir_ga_tracking_code', |
|
180 | - 'type' => 'textarea', |
|
181 | - 'css' => 'min-width:300px;', |
|
182 | - 'std' => '' // Default value for the page title - changed in settings |
|
183 | - ), |
|
184 | - array( |
|
185 | - 'name' => __('Auto refresh active users?', 'geodirectory'), |
|
186 | - 'desc' => __('If ticked it uses the auto refresh time below, if not it never refreshes unless the refresh button is clicked.', 'geodirectory'), |
|
187 | - 'id' => 'geodir_ga_auto_refresh', |
|
188 | - 'type' => 'checkbox', |
|
189 | - 'std' => '0' |
|
190 | - ), |
|
191 | - array( |
|
192 | - 'name' => __('Time interval for auto refresh active users', 'geodirectory'), |
|
193 | - 'desc' => __('Time interval in seconds to auto refresh active users. The active users will be auto refreshed after this time interval. Leave blank or use 0(zero) to disable auto refresh. Default: 5', 'geodirectory'), |
|
194 | - 'id' => 'geodir_ga_refresh_time', |
|
195 | - 'type' => 'text', |
|
196 | - 'std' => '5' |
|
197 | - ), |
|
198 | - |
|
199 | - array('type' => 'sectionend', 'id' => 'google_analytic_settings'), |
|
111 | + array('name' => __('Google Analytics', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'google_analytic_settings'), |
|
112 | + |
|
113 | + array('name' => __('Google Analytic Settings', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'google_analytic_settings'), |
|
114 | + |
|
115 | + |
|
116 | + |
|
117 | + array( |
|
118 | + 'name' => __('Show business owner google analytics stats?', 'geodirectory'), |
|
119 | + 'desc' => __('Yes', 'geodirectory'), |
|
120 | + 'id' => 'geodir_ga_stats', |
|
121 | + 'std' => '0', |
|
122 | + 'type' => 'radio', |
|
123 | + 'value' => '1', |
|
124 | + 'radiogroup' => 'start' |
|
125 | + ), |
|
126 | + array( |
|
127 | + 'name' => __('Show business owner Google Analytics stats?', 'geodirectory'), |
|
128 | + 'desc' => __('No', 'geodirectory'), |
|
129 | + 'id' => 'geodir_ga_stats', |
|
130 | + 'std' => '1', |
|
131 | + 'type' => 'radio', |
|
132 | + 'value' => '0', |
|
133 | + 'radiogroup' => 'end' |
|
134 | + ), |
|
135 | + |
|
136 | + array( |
|
137 | + 'name' => __('Google analytics "Profile ID(ie: ga:12345678)?', 'geodirectory') . ' ' . |
|
138 | + '<a target="_blank" href="https://docs.wpgeodirectory.com/gd-core-plugin-google-analytics/">' . __('help', 'geodirectory') . '</a>', |
|
139 | + 'desc' => '', |
|
140 | + 'id' => 'geodir_ga_id', |
|
141 | + 'type' => 'text', |
|
142 | + 'css' => 'min-width:300px;', |
|
143 | + 'std' => '' // Default value for the page title - changed in settings |
|
144 | + ), |
|
145 | + |
|
146 | + array( |
|
147 | + 'name' => __('Client ID', 'geodirectory') . ' ' . |
|
148 | + '<a target="_blank" href="https://docs.wpgeodirectory.com/gd-core-plugin-google-analytics/">' . __('help', 'geodirectory') . '</a>', |
|
149 | + 'desc' => '', |
|
150 | + 'id' => 'geodir_ga_client_id', |
|
151 | + 'type' => 'text', |
|
152 | + 'css' => 'min-width:300px;', |
|
153 | + 'std' => '' // Default value for the page title - changed in settings |
|
154 | + ), |
|
155 | + |
|
156 | + array( |
|
157 | + 'name' => __('Client secret', 'geodirectory') . ' ' . |
|
158 | + '<a target="_blank" href="https://docs.wpgeodirectory.com/gd-core-plugin-google-analytics/">' . __('help', 'geodirectory') . '</a>', |
|
159 | + 'desc' => '', |
|
160 | + 'id' => 'geodir_ga_client_secret', |
|
161 | + 'type' => 'password', |
|
162 | + 'css' => 'min-width:300px;', |
|
163 | + 'std' => '' // Default value for the page title - changed in settings |
|
164 | + ), |
|
165 | + |
|
166 | + array( |
|
167 | + 'name' => __('Google analytics access', 'geodirectory'), |
|
168 | + 'desc' => '', |
|
169 | + 'id' => 'geodir_ga_token', |
|
170 | + 'type' => 'google_analytics', |
|
171 | + 'css' => 'min-width:300px;', |
|
172 | + 'std' => '' // Default value for the page title - changed in settings |
|
173 | + ), |
|
174 | + |
|
175 | + |
|
176 | + array( |
|
177 | + 'name' => __('Google analytics tracking code', 'geodirectory'), |
|
178 | + 'desc' => '', |
|
179 | + 'id' => 'geodir_ga_tracking_code', |
|
180 | + 'type' => 'textarea', |
|
181 | + 'css' => 'min-width:300px;', |
|
182 | + 'std' => '' // Default value for the page title - changed in settings |
|
183 | + ), |
|
184 | + array( |
|
185 | + 'name' => __('Auto refresh active users?', 'geodirectory'), |
|
186 | + 'desc' => __('If ticked it uses the auto refresh time below, if not it never refreshes unless the refresh button is clicked.', 'geodirectory'), |
|
187 | + 'id' => 'geodir_ga_auto_refresh', |
|
188 | + 'type' => 'checkbox', |
|
189 | + 'std' => '0' |
|
190 | + ), |
|
191 | + array( |
|
192 | + 'name' => __('Time interval for auto refresh active users', 'geodirectory'), |
|
193 | + 'desc' => __('Time interval in seconds to auto refresh active users. The active users will be auto refreshed after this time interval. Leave blank or use 0(zero) to disable auto refresh. Default: 5', 'geodirectory'), |
|
194 | + 'id' => 'geodir_ga_refresh_time', |
|
195 | + 'type' => 'text', |
|
196 | + 'std' => '5' |
|
197 | + ), |
|
198 | + |
|
199 | + array('type' => 'sectionend', 'id' => 'google_analytic_settings'), |
|
200 | 200 | |
201 | 201 | )); // google_analytic_settings End |
202 | 202 | |
@@ -208,84 +208,84 @@ discard block |
||
208 | 208 | */ |
209 | 209 | $search_settings = apply_filters('geodir_search_settings', array( |
210 | 210 | |
211 | - array('name' => __('Search', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'search_settings'), |
|
212 | - |
|
213 | - array('name' => __('Search Settings', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'search_settings'), |
|
214 | - |
|
215 | - array( |
|
216 | - 'name' => __('Limit squared distance area to X miles (helps improve search speed)', 'geodirectory'), |
|
217 | - 'desc' => __('Enter whole number only ex. 40 (Tokyo is largest city in the world @40 sq miles) LEAVE BLANK FOR NO DISTANCE LIMIT', 'geodirectory'), |
|
218 | - 'id' => 'geodir_search_dist', |
|
219 | - 'type' => 'text', |
|
220 | - 'css' => 'min-width:300px;', |
|
221 | - 'std' => '40' // Default value for the page title - changed in settings |
|
222 | - ), |
|
223 | - |
|
224 | - array( |
|
225 | - 'name' => __('Show search distances in miles or km', 'geodirectory'), |
|
226 | - 'desc' => __('Miles', 'geodirectory'), |
|
227 | - 'id' => 'geodir_search_dist_1', |
|
228 | - 'std' => 'miles', |
|
229 | - 'type' => 'radio', |
|
230 | - 'value' => 'miles', |
|
231 | - 'radiogroup' => 'start' |
|
232 | - ), |
|
233 | - array( |
|
234 | - 'name' => __('Show search distances in miles or km', 'geodirectory'), |
|
235 | - 'desc' => __('Kilometers', 'geodirectory'), |
|
236 | - 'id' => 'geodir_search_dist_1', |
|
237 | - 'std' => 'miles', |
|
238 | - 'type' => 'radio', |
|
239 | - 'value' => 'km', |
|
240 | - 'radiogroup' => 'end' |
|
241 | - ), |
|
242 | - |
|
243 | - array( |
|
244 | - 'name' => __('If distance is less than 0.01 show distance in meters or feet', 'geodirectory'), |
|
245 | - 'desc' => __('Meters', 'geodirectory'), |
|
246 | - 'id' => 'geodir_search_dist_2', |
|
247 | - 'std' => 'meters', |
|
248 | - 'type' => 'radio', |
|
249 | - 'value' => 'meters', |
|
250 | - 'radiogroup' => 'start' |
|
251 | - ), |
|
252 | - |
|
253 | - array( |
|
254 | - 'name' => __('If distance is less than 0.01 show distance in meters or feet', 'geodirectory'), |
|
255 | - 'desc' => __('Feet', 'geodirectory'), |
|
256 | - 'id' => 'geodir_search_dist_2', |
|
257 | - 'std' => 'meters', |
|
258 | - 'type' => 'radio', |
|
259 | - 'value' => 'feet', |
|
260 | - 'radiogroup' => 'end' |
|
261 | - ), |
|
262 | - |
|
263 | - array( |
|
264 | - 'name' => __('Add location specific text to (Near) search for Google', 'geodirectory'), |
|
265 | - 'desc' => __('This is usefull if your directory is limted to one location such as: New York or Australia (this setting should be blank if using default country, regions etc with multilocation addon as it will automatically add them)', 'geodirectory'), |
|
266 | - 'id' => 'geodir_search_near_addition', |
|
267 | - 'type' => 'text', |
|
268 | - 'css' => 'min-width:300px;', |
|
269 | - 'std' => '' |
|
270 | - ), |
|
271 | - array( |
|
272 | - 'name' => __('Individual word search limit', 'geodirectory'), |
|
273 | - 'desc' => __('With this option you can limit individual words being searched for, for example searching for `Jo Brown` would return results with words like `Jones`, you can exclude these types of small character words if you wish.', 'geodirectory'), |
|
274 | - 'id' => 'geodir_search_word_limit', |
|
275 | - 'css' => 'min-width:300px;', |
|
276 | - 'std' => 'gridview_onehalf', |
|
277 | - 'type' => 'select', |
|
278 | - 'class' => 'chosen_select', |
|
279 | - 'options' => array_unique(array( |
|
280 | - '0' => __('Disabled', 'geodirectory'), |
|
281 | - '1' => __('1 Character words excluded', 'geodirectory'), |
|
282 | - '2' => __('2 Character words and less excluded', 'geodirectory'), |
|
283 | - '3' => __('3 Character words and less excluded', 'geodirectory'), |
|
284 | - )) |
|
285 | - ), |
|
286 | - |
|
287 | - |
|
288 | - array('type' => 'sectionend', 'id' => 'search_settings'), |
|
211 | + array('name' => __('Search', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'search_settings'), |
|
212 | + |
|
213 | + array('name' => __('Search Settings', 'geodirectory'), 'type' => 'sectionstart', 'id' => 'search_settings'), |
|
214 | + |
|
215 | + array( |
|
216 | + 'name' => __('Limit squared distance area to X miles (helps improve search speed)', 'geodirectory'), |
|
217 | + 'desc' => __('Enter whole number only ex. 40 (Tokyo is largest city in the world @40 sq miles) LEAVE BLANK FOR NO DISTANCE LIMIT', 'geodirectory'), |
|
218 | + 'id' => 'geodir_search_dist', |
|
219 | + 'type' => 'text', |
|
220 | + 'css' => 'min-width:300px;', |
|
221 | + 'std' => '40' // Default value for the page title - changed in settings |
|
222 | + ), |
|
223 | + |
|
224 | + array( |
|
225 | + 'name' => __('Show search distances in miles or km', 'geodirectory'), |
|
226 | + 'desc' => __('Miles', 'geodirectory'), |
|
227 | + 'id' => 'geodir_search_dist_1', |
|
228 | + 'std' => 'miles', |
|
229 | + 'type' => 'radio', |
|
230 | + 'value' => 'miles', |
|
231 | + 'radiogroup' => 'start' |
|
232 | + ), |
|
233 | + array( |
|
234 | + 'name' => __('Show search distances in miles or km', 'geodirectory'), |
|
235 | + 'desc' => __('Kilometers', 'geodirectory'), |
|
236 | + 'id' => 'geodir_search_dist_1', |
|
237 | + 'std' => 'miles', |
|
238 | + 'type' => 'radio', |
|
239 | + 'value' => 'km', |
|
240 | + 'radiogroup' => 'end' |
|
241 | + ), |
|
242 | + |
|
243 | + array( |
|
244 | + 'name' => __('If distance is less than 0.01 show distance in meters or feet', 'geodirectory'), |
|
245 | + 'desc' => __('Meters', 'geodirectory'), |
|
246 | + 'id' => 'geodir_search_dist_2', |
|
247 | + 'std' => 'meters', |
|
248 | + 'type' => 'radio', |
|
249 | + 'value' => 'meters', |
|
250 | + 'radiogroup' => 'start' |
|
251 | + ), |
|
252 | + |
|
253 | + array( |
|
254 | + 'name' => __('If distance is less than 0.01 show distance in meters or feet', 'geodirectory'), |
|
255 | + 'desc' => __('Feet', 'geodirectory'), |
|
256 | + 'id' => 'geodir_search_dist_2', |
|
257 | + 'std' => 'meters', |
|
258 | + 'type' => 'radio', |
|
259 | + 'value' => 'feet', |
|
260 | + 'radiogroup' => 'end' |
|
261 | + ), |
|
262 | + |
|
263 | + array( |
|
264 | + 'name' => __('Add location specific text to (Near) search for Google', 'geodirectory'), |
|
265 | + 'desc' => __('This is usefull if your directory is limted to one location such as: New York or Australia (this setting should be blank if using default country, regions etc with multilocation addon as it will automatically add them)', 'geodirectory'), |
|
266 | + 'id' => 'geodir_search_near_addition', |
|
267 | + 'type' => 'text', |
|
268 | + 'css' => 'min-width:300px;', |
|
269 | + 'std' => '' |
|
270 | + ), |
|
271 | + array( |
|
272 | + 'name' => __('Individual word search limit', 'geodirectory'), |
|
273 | + 'desc' => __('With this option you can limit individual words being searched for, for example searching for `Jo Brown` would return results with words like `Jones`, you can exclude these types of small character words if you wish.', 'geodirectory'), |
|
274 | + 'id' => 'geodir_search_word_limit', |
|
275 | + 'css' => 'min-width:300px;', |
|
276 | + 'std' => 'gridview_onehalf', |
|
277 | + 'type' => 'select', |
|
278 | + 'class' => 'chosen_select', |
|
279 | + 'options' => array_unique(array( |
|
280 | + '0' => __('Disabled', 'geodirectory'), |
|
281 | + '1' => __('1 Character words excluded', 'geodirectory'), |
|
282 | + '2' => __('2 Character words and less excluded', 'geodirectory'), |
|
283 | + '3' => __('3 Character words and less excluded', 'geodirectory'), |
|
284 | + )) |
|
285 | + ), |
|
286 | + |
|
287 | + |
|
288 | + array('type' => 'sectionend', 'id' => 'search_settings'), |
|
289 | 289 | |
290 | 290 | )); //search_settings End |
291 | 291 | |
@@ -297,17 +297,17 @@ discard block |
||
297 | 297 | */ |
298 | 298 | $dummy_data_settings = apply_filters('geodir_dummy_data_settings', array( |
299 | 299 | |
300 | - array('name' => __('Dummy Data', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'dummy_data_settings'), |
|
301 | - |
|
302 | - array( |
|
303 | - 'name' => '', |
|
304 | - 'desc' => '', |
|
305 | - 'id' => 'geodir_dummy_data_installer', |
|
306 | - 'type' => 'dummy_installer', |
|
307 | - 'css' => 'min-width:300px;', |
|
308 | - 'std' => '40' // Default value for the page title - changed in settings |
|
309 | - ), |
|
310 | - array('type' => 'sectionend', 'id' => 'geodir_dummy_data_settings'), |
|
300 | + array('name' => __('Dummy Data', 'geodirectory'), 'type' => 'title', 'desc' => '', 'id' => 'dummy_data_settings'), |
|
301 | + |
|
302 | + array( |
|
303 | + 'name' => '', |
|
304 | + 'desc' => '', |
|
305 | + 'id' => 'geodir_dummy_data_installer', |
|
306 | + 'type' => 'dummy_installer', |
|
307 | + 'css' => 'min-width:300px;', |
|
308 | + 'std' => '40' // Default value for the page title - changed in settings |
|
309 | + ), |
|
310 | + array('type' => 'sectionend', 'id' => 'geodir_dummy_data_settings'), |
|
311 | 311 | |
312 | 312 | )); //dummy_data_settings End |
313 | 313 |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | ), |
99 | 99 | array('type' => 'sectionend', 'id' => 'general_options'), |
100 | 100 | |
101 | -));/* General Options End*/ |
|
101 | +)); /* General Options End*/ |
|
102 | 102 | |
103 | 103 | /** |
104 | 104 | * Filter GD Google Analytic Settings array. |
@@ -134,8 +134,8 @@ discard block |
||
134 | 134 | ), |
135 | 135 | |
136 | 136 | array( |
137 | - 'name' => __('Google analytics "Profile ID(ie: ga:12345678)?', 'geodirectory') . ' ' . |
|
138 | - '<a target="_blank" href="https://docs.wpgeodirectory.com/gd-core-plugin-google-analytics/">' . __('help', 'geodirectory') . '</a>', |
|
137 | + 'name' => __('Google analytics "Profile ID(ie: ga:12345678)?', 'geodirectory').' '. |
|
138 | + '<a target="_blank" href="https://docs.wpgeodirectory.com/gd-core-plugin-google-analytics/">'.__('help', 'geodirectory').'</a>', |
|
139 | 139 | 'desc' => '', |
140 | 140 | 'id' => 'geodir_ga_id', |
141 | 141 | 'type' => 'text', |
@@ -144,8 +144,8 @@ discard block |
||
144 | 144 | ), |
145 | 145 | |
146 | 146 | array( |
147 | - 'name' => __('Client ID', 'geodirectory') . ' ' . |
|
148 | - '<a target="_blank" href="https://docs.wpgeodirectory.com/gd-core-plugin-google-analytics/">' . __('help', 'geodirectory') . '</a>', |
|
147 | + 'name' => __('Client ID', 'geodirectory').' '. |
|
148 | + '<a target="_blank" href="https://docs.wpgeodirectory.com/gd-core-plugin-google-analytics/">'.__('help', 'geodirectory').'</a>', |
|
149 | 149 | 'desc' => '', |
150 | 150 | 'id' => 'geodir_ga_client_id', |
151 | 151 | 'type' => 'text', |
@@ -154,8 +154,8 @@ discard block |
||
154 | 154 | ), |
155 | 155 | |
156 | 156 | array( |
157 | - 'name' => __('Client secret', 'geodirectory') . ' ' . |
|
158 | - '<a target="_blank" href="https://docs.wpgeodirectory.com/gd-core-plugin-google-analytics/">' . __('help', 'geodirectory') . '</a>', |
|
157 | + 'name' => __('Client secret', 'geodirectory').' '. |
|
158 | + '<a target="_blank" href="https://docs.wpgeodirectory.com/gd-core-plugin-google-analytics/">'.__('help', 'geodirectory').'</a>', |
|
159 | 159 | 'desc' => '', |
160 | 160 | 'id' => 'geodir_ga_client_secret', |
161 | 161 | 'type' => 'password', |